/* ===================================================
   Bartech Bonus Mobile – mobilní styly
   =================================================== */

/* --- Proměnné ---------------------------------------- */
:root {
    --topbar-height: 52px;
    --bottomnav-height: 62px;
    --primary: #0078d4;
    --primary-dark: #005fa3;
    --surface: #ffffff;
    --surface-2: #f5f5f5;
    --border: #e0e0e0;
    --text: #1a1a1a;
    --text-muted: #6c757d;
    --radius: 12px;
    --shadow: 0 2px 8px rgba(0,0,0,0.10);
}

/* --- Základní reset ----------------------------------- */
*, *::before, *::after { box-sizing: border-box; }

html, body {
    height: 100%;
    overflow: hidden;
    overscroll-behavior: none;
    -webkit-tap-highlight-color: transparent;
}

/* --- Shell -------------------------------------------- */
.mobile-shell {
    display: flex;
    flex-direction: column;
    height: 100dvh;
    height: 100vh;
    background: var(--surface-2);
}

/* --- Top bar ------------------------------------------ */
.mobile-topbar {
    flex-shrink: 0;
    height: var(--topbar-height);
    background: var(--primary);
    color: #fff;
    box-shadow: var(--shadow);
    z-index: 100;
}

.topbar-inner {
    display: flex;
    align-items: center;
    height: 100%;
    padding: 0 12px;
    gap: 8px;
}

.topbar-back {
    background: none;
    border: none;
    color: #fff;
    font-size: 1.4rem;
    line-height: 1;
    padding: 4px 8px;
    cursor: pointer;
    border-radius: 6px;
    min-width: 36px;
    min-height: 36px;
}
.topbar-back:hover { background: rgba(255,255,255,0.15); }
.topbar-back.invisible { visibility: hidden; pointer-events: none; }

.topbar-brand {
    font-weight: 600;
    font-size: 1rem;
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.topbar-right {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}

.topbar-user {
    color: rgba(255,255,255,0.85);
    font-size: 0.78rem;
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* --- Content ------------------------------------------ */
.mobile-content {
    flex: 1;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 12px 16px;
    padding-bottom: calc(var(--bottomnav-height) + 8px);
}

/* --- Bottom Navigation -------------------------------- */
.bottom-nav {
    flex-shrink: 0;
    display: flex;
    height: var(--bottomnav-height);
    background: var(--surface);
    border-top: 1px solid var(--border);
    box-shadow: 0 -2px 8px rgba(0,0,0,0.07);
    z-index: 100;
}

.bottom-nav-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    text-decoration: none;
    color: var(--text-muted);
    padding: 6px 4px;
    transition: color 0.15s, background 0.15s;
    min-height: 44px;
}

.bottom-nav-item:hover,
.bottom-nav-item:focus {
    color: var(--primary);
    background: rgba(0,120,212,0.06);
    text-decoration: none;
}

.bottom-nav-item.active {
    color: var(--primary);
}

.bottom-nav-item.active .nav-icon {
    transform: scale(1.1);
}

.nav-icon { font-size: 1.25rem; line-height: 1; }
.nav-label { font-size: 0.64rem; font-weight: 500; line-height: 1; }

/* --- View Filter Toggle (segmented control) ----------- */
.view-filter-toggle {
    display: inline-flex;
    background: rgba(255,255,255,0.2);
    border-radius: 8px;
    padding: 2px;
    gap: 2px;
}

.toggle-segment {
    border: none;
    background: transparent;
    color: rgba(255,255,255,0.75);
    font-size: 0.78rem;
    font-weight: 500;
    padding: 4px 10px;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
    white-space: nowrap;
    min-height: 30px;
}

.toggle-segment.active {
    background: #fff;
    color: var(--primary);
}

.toggle-segment:not(.active):hover {
    background: rgba(255,255,255,0.15);
    color: #fff;
}

/* Varianta pro použití mimo topbar (bílé pozadí) */
.view-filter-toggle.light {
    background: var(--surface-2);
    border: 1px solid var(--border);
}
.view-filter-toggle.light .toggle-segment { color: var(--text-muted); }
.view-filter-toggle.light .toggle-segment.active {
    background: var(--primary);
    color: #fff;
}

/* --- Dashboard --------------------------------------- */
.dashboard {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.dashboard-header {
    padding: 4px 0 8px;
}

.dashboard-card {
    display: flex;
    align-items: center;
    gap: 14px;
    background: var(--surface);
    border-radius: var(--radius);
    padding: 14px 16px;
    box-shadow: var(--shadow);
    cursor: pointer;
    transition: transform 0.1s, box-shadow 0.1s;
    border: 1px solid var(--border);
    text-decoration: none;
    color: var(--text);
}

.dashboard-card:active { transform: scale(0.98); box-shadow: none; }

.dashboard-card-icon {
    font-size: 2rem;
    line-height: 1;
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.absence-icon  { background: #e8f4fd; }
.overtime-icon { background: #fff3cd; }
.car-icon      { background: #d1e7dd; }

.dashboard-card-body { flex: 1; min-width: 0; }
.dashboard-card-title { font-weight: 600; font-size: 0.95rem; margin-bottom: 2px; }
.dashboard-card-stats { font-size: 0.82rem; }
.dashboard-card-arrow { color: var(--text-muted); font-size: 1.2rem; }

.quick-actions .btn { min-height: 44px; }

/* --- Login page -------------------------------------- */
.login-page {
    min-height: 100dvh;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(145deg, #005fa3 0%, #0078d4 60%, #2196f3 100%);
    padding: 20px;
}

.login-card {
    background: #fff;
    border-radius: 20px;
    padding: 32px 24px;
    width: 100%;
    max-width: 360px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.25);
}

.login-logo {
    text-align: center;
    margin-bottom: 28px;
}

.login-logo img {
    border-radius: 16px;
    box-shadow: var(--shadow);
    margin-bottom: 12px;
}

.login-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary);
    margin: 0;
}

.login-subtitle {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin: 2px 0 0;
}

.login-form .btn-primary {
    background: var(--primary);
    border-color: var(--primary);
    min-height: 48px;
    font-weight: 600;
}

/* --- Profile ----------------------------------------- */
.profile-avatar {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: var(--primary);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    font-weight: 700;
    flex-shrink: 0;
}

/* --- Scheduler (kalendář) ---------------------------- */
.scheduler-table td { min-height: 56px; }

/* --- Sdílené utility --------------------------------- */
/* Touch target minimum */
.btn, .list-group-item-action, select.form-select,
input.form-control, .bottom-nav-item {
    min-height: 44px;
}

/* Odebrat hover efekty na touch zařízeních */
@media (hover: none) {
    .btn:hover { filter: none; }
    .list-group-item-action:hover { background-color: inherit; }
}

/* Responsivní tabulky – horizontal scroll */
.table-responsive { border-radius: var(--radius); }

/* --- Animace ----------------------------------------- */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(6px); }
    to   { opacity: 1; transform: translateY(0); }
}

.dashboard-card, .list-group-item, .card {
    animation: fadeIn 0.18s ease-out both;
}

/* --- Scrollbar (desktop/Chrome) ---------------------- */
.mobile-content::-webkit-scrollbar { width: 4px; }
.mobile-content::-webkit-scrollbar-thumb { background: #ccc; border-radius: 4px; }
