/* ==========================================================
   NERO SECURITY – PERSONÁLNÍ A MZDOVÝ SYSTÉM
   Design: minimalistický černobílý enterprise, menu vlevo
   ========================================================== */

:root {
    --bg-main: #fbfbfb;
    --bg-card: #ffffff;
    --bg-card-hover: #fafafa;
    --bg-surface: #f4f4f5;
    --bg-subtle: #f4f4f5;
    --bg-hover: #ececed;
    --border-color: #e4e4e7;
    --border-light: #f0f0f2;
    --border-strong: #18181b;

    /* Akcent je černá – názvy proměnných zůstaly kvůli šablonám */
    --nero-yellow: #09090b;
    --nero-yellow-hover: #27272a;
    --nero-yellow-glow: rgba(9, 9, 11, 0.06);
    --nero-dark: #ffffff;

    --text-primary: #09090b;
    --text-secondary: #52525b;
    --text-muted: #71717a;

    --success: #047857;
    --success-bg: #ecfdf5;
    --success-border: #a7f3d0;
    --danger: #b91c1c;
    --danger-bg: #fef2f2;
    --danger-border: #fecaca;
    --warning: #a16207;
    --warning-bg: #fefce8;
    --warning-border: #fef08a;
    --info: #1d4ed8;
    --info-bg: #eff6ff;
    --info-border: #bfdbfe;

    --sidebar-width: 250px;
}

*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html, body {
    overflow-x: hidden;
    width: 100%;
}

body {
    background-color: var(--bg-main);
    color: var(--text-primary);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    font-size: 13.5px;
    line-height: 1.5;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
}

a { color: var(--text-primary); }

h1, h2, h3, h4 { color: var(--text-primary); letter-spacing: -0.3px; }

/* ==========================================================
   DVOUSLOUPCOVÝ LAYOUT – POSTRANNÍ MENU VLEVO
   ========================================================== */

.app-wrapper {
    display: flex;
    width: 100%;
    min-height: 100vh;
}

.sidebar {
    width: var(--sidebar-width);
    background-color: var(--bg-card);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    z-index: 50;
    user-select: none;
}

.sidebar-header {
    padding: 20px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    gap: 10px;
}

.brand-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: var(--text-primary);
    font-weight: 800;
    font-size: 15px;
    letter-spacing: -0.3px;
    white-space: nowrap;
}

.brand-logo .nero-logo {
    display: block;
    height: 40px;
    width: auto;
    color: var(--text-primary);
}

.mobile-topbar .brand-logo .nero-logo { height: 32px; }

.brand-badge {
    background: var(--text-primary);
    color: #ffffff;
    font-size: 11px;
    font-weight: 800;
    padding: 3px 7px;
    border-radius: 4px;
    letter-spacing: 0.6px;
}

.sidebar-nav {
    flex: 1;
    padding: 12px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.nav-section-label {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: var(--text-muted);
    padding: 14px 10px 4px;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    border-radius: 6px;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 13px;
    font-weight: 500;
    transition: background 0.12s ease, color 0.12s ease;
}

.nav-link:hover {
    background-color: var(--bg-subtle);
    color: var(--text-primary);
}

.nav-link.active {
    background-color: var(--text-primary);
    color: #ffffff;
    font-weight: 600;
}

.nav-icon {
    width: 18px;
    text-align: center;
    font-size: 14px;
}

.sidebar-footer {
    padding: 14px 16px;
    border-top: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.user-profile {
    display: flex;
    flex-direction: column;
    font-size: 12px;
    color: var(--text-muted);
    text-decoration: none;
}

.user-profile strong {
    color: var(--text-primary);
    font-size: 13px;
}

.main-viewport {
    flex: 1;
    margin-left: var(--sidebar-width);
    min-width: 0;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* Mobilní hlavička (jen na telefonu) */
.mobile-topbar {
    display: none;
}

.hamburger-btn {
    display: flex;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 6px;
    flex-direction: column;
    gap: 5px;
}

.hamburger-btn span {
    display: block;
    width: 22px;
    height: 2px;
    background-color: var(--text-primary);
    border-radius: 2px;
    transition: transform 0.25s ease, opacity 0.25s ease;
}

.hamburger-btn.is-open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.hamburger-btn.is-open span:nth-child(2) { opacity: 0; }
.hamburger-btn.is-open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

.sidebar-backdrop {
    display: none;
}

.main-container {
    flex: 1;
    width: 100%;
    max-width: 1440px;
    padding: 28px 32px;
}

/* Stránky se širokou tabulkou (např. Reklamace mezd) – na celou šířku obrazovky */
.main-container.is-wide { max-width: none; }

/* Přihlášení a stránky bez menu */
.auth-shell {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 24px 16px;
}

.auth-shell .main-container {
    flex: 0 0 auto;
    max-width: 520px;
    padding: 0;
}

/* ==========================================================
   KOMPONENTY
   ========================================================== */

.card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 22px;
    margin-bottom: 20px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
    max-width: 100%;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 9px 16px;
    font-size: 13px;
    font-weight: 600;
    border-radius: 6px;
    cursor: pointer;
    text-decoration: none;
    border: 1px solid transparent;
    transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
    white-space: normal;
    text-align: center;
    font-family: inherit;
}

.btn-primary {
    background: var(--text-primary);
    color: #ffffff !important;
    border-color: var(--text-primary);
}

.btn-primary:hover {
    background: #27272a;
}

.btn-secondary, .btn-outline {
    background: #ffffff;
    color: var(--text-primary) !important;
    border: 1px solid var(--border-color);
}

.btn-secondary:hover, .btn-outline:hover {
    background: var(--bg-subtle);
    border-color: #d4d4d8;
}

.btn-danger {
    background: var(--danger-bg);
    color: var(--danger) !important;
    border: 1px solid var(--danger-border);
}

.btn-danger:hover {
    background: var(--danger);
    border-color: var(--danger);
    color: #ffffff !important;
}

.btn-success {
    background: var(--success);
    color: #ffffff;
}

.btn-sm {
    padding: 6px 10px;
    font-size: 12px;
}

.btn:disabled, .btn[disabled] {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Štítky */
.badge-tag {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 9px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 600;
    white-space: nowrap;
    background: var(--bg-subtle);
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
}

.badge-tag.yellow { background: var(--bg-subtle); color: var(--text-primary); border-color: #d4d4d8; }
.badge-tag.green { background: var(--success-bg); color: var(--success); border-color: var(--success-border); }
.badge-tag.red { background: var(--danger-bg); color: var(--danger); border-color: var(--danger-border); }
.badge-tag.blue { background: var(--info-bg); color: var(--info); border-color: var(--info-border); }
.badge-tag.amber { background: var(--warning-bg); color: var(--warning); border-color: var(--warning-border); }

/* Tabulky */
.table-responsive {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 13px;
    text-align: left;
}

.table th {
    background: var(--bg-subtle);
    color: var(--text-secondary);
    font-weight: 600;
    padding: 10px 14px;
    border-bottom: 1px solid var(--border-color);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
}

.table td {
    padding: 11px 14px;
    border-bottom: 1px solid var(--border-light);
    color: var(--text-primary);
    vertical-align: middle;
}

.table tbody tr:hover {
    background: var(--bg-card-hover);
}

/* Formuláře */
.form-group {
    margin-bottom: 14px;
}

.form-group label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 5px;
}

.form-control, .form-select, select, textarea,
input[type="text"], input[type="email"], input[type="password"], input[type="tel"],
input[type="number"], input[type="file"], input[type="date"], input[type="datetime-local"], input[type="time"],
input[type="month"] {
    width: 100%;
    padding: 9px 11px;
    font-size: 13.5px;
    font-family: inherit;
    border: 1px solid #d4d4d8;
    border-radius: 6px;
    background-color: #ffffff;
    color: var(--text-primary);
    outline: none;
    transition: border-color 0.15s, box-shadow 0.15s;
    color-scheme: light;
}

input[type="date"], input[type="datetime-local"], input[type="month"] {
    min-height: 40px;
    min-width: 0;
    max-width: 100%;
    display: block;
    /* iOS Safari jinak dá datumovým polím vlastní šířku a pole přeteče kartu */
    -webkit-appearance: none;
    appearance: none;
    box-sizing: border-box;
}

input[type="date"]::-webkit-date-and-time-value,
input[type="month"]::-webkit-date-and-time-value,
input[type="datetime-local"]::-webkit-date-and-time-value {
    text-align: left;
}

.form-control:focus, select:focus, textarea:focus, input:focus {
    border-color: var(--text-primary);
    box-shadow: 0 0 0 3px rgba(9, 9, 11, 0.08);
}

input[type="checkbox"], input[type="radio"] {
    accent-color: var(--text-primary);
}

.errorlist {
    list-style: none;
    color: var(--danger);
    font-size: 12px;
    margin-top: 4px;
}

/* Hlášky */
.alert {
    padding: 11px 15px;
    border-radius: 8px;
    margin-bottom: 16px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 10px;
    border: 1px solid;
}

.alert-success { background: var(--success-bg); border-color: var(--success-border); color: var(--success); }
.alert-error, .alert-danger { background: var(--danger-bg); border-color: var(--danger-border); color: var(--danger); }
.alert-warning { background: var(--warning-bg); border-color: var(--warning-border); color: var(--warning); }
.alert-info { background: var(--info-bg); border-color: var(--info-border); color: var(--info); }

/* Ukazatele (kokpit, přehledy) */
.stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 14px;
    margin-bottom: 20px;
}

.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 16px 18px;
}

.stat-label {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
}

.stat-value {
    font-size: 24px;
    font-weight: 800;
    margin-top: 4px;
    letter-spacing: -0.5px;
    font-variant-numeric: tabular-nums;
}

.stat-sub {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 2px;
}

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 22px;
}

.page-header h1 {
    font-size: 24px;
    font-weight: 800;
    margin: 4px 0 2px;
}

.page-header p {
    color: var(--text-muted);
    font-size: 13px;
}

.eyebrow-label {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.8px;
    text-transform: uppercase;
    color: var(--text-muted);
}

/* Sloupcový graf (kokpit) */
.bar-chart {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 14px;
    height: 200px;
    padding-top: 10px;
}

.bar-col {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    min-height: 0;
}

.bar-track {
    flex: 1;
    width: 100%;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    min-height: 0;
}

.bar {
    width: 100%;
    max-width: 56px;
    background: var(--text-primary);
    border-radius: 4px 4px 0 0;
    min-height: 2px;
}

.bar.is-muted {
    background: #d4d4d8;
}

.bar-value {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-secondary);
    white-space: nowrap;
}

.bar-label {
    font-size: 11px;
    color: var(--text-muted);
}

/* Patička */
footer.app-footer {
    border-top: 1px solid var(--border-color);
    padding: 16px 32px;
    font-size: 11.5px;
    color: var(--text-muted);
    background: var(--bg-card);
    /* firma vlevo, poslední aktualizace přesně uprostřed patičky */
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 12px;
}
.app-footer-left { grid-column: 1; }
.app-footer-center { grid-column: 2; text-align: center; white-space: nowrap; }

/* ==========================================================
   MOBIL
   ========================================================== */

@media (max-width: 992px) {
    .mobile-topbar {
        display: flex;
        align-items: center;
        justify-content: space-between;
        position: sticky;
        top: 0;
        z-index: 40;
        background: rgba(255, 255, 255, 0.96);
        border-bottom: 1px solid var(--border-color);
        padding: 10px 16px;
    }

    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
        width: min(300px, 85vw);
        z-index: 60;
    }

    .sidebar.is-open {
        transform: translateX(0);
        box-shadow: 0 0 40px rgba(0, 0, 0, 0.15);
    }

    .sidebar-backdrop.is-open {
        display: block;
        position: fixed;
        inset: 0;
        background: rgba(0, 0, 0, 0.25);
        z-index: 55;
    }

    body.menu-open {
        overflow: hidden;
    }

    .main-viewport {
        margin-left: 0;
    }

    .main-container {
        padding: 18px 16px;
    }

    footer.app-footer {
        padding: 14px 16px;
        grid-template-columns: 1fr;
        gap: 4px;
    }
    .app-footer-center { grid-column: 1; text-align: left; white-space: normal; }
}

@media (max-width: 768px) {
    .card {
        padding: 16px 14px;
        margin-bottom: 14px;
    }

    h1 {
        font-size: 20px !important;
        line-height: 1.25;
    }

    div[style*="grid-template-columns: repeat(3, 1fr)"],
    div[style*="grid-template-columns: 1fr 1fr 1fr"] {
        display: flex !important;
        flex-direction: column !important;
        gap: 10px !important;
    }

    input[type="date"], input[type="datetime-local"], input[type="month"] {
        width: 100% !important;
        min-height: 44px !important;
        font-size: 15px !important;
    }

    .bar-chart {
        gap: 6px;
    }
}

/* ==========================================================
   EVIDENČNÍ KNIHA – vzhled vázané knihy (papír, hřbet, linky)
   ========================================================== */
.logbook-book {
    position: relative;
    background:
        linear-gradient(90deg, rgba(0, 0, 0, 0.05), transparent 22px),
        #fcf9f2;
    border: 1px solid #e6dfcf;
    border-left: 12px solid #2b2b30;
    border-radius: 4px 10px 10px 4px;
    box-shadow: 0 1px 0 #efe9db, 0 3px 0 #f6f1e4, 0 4px 0 #e6dfcf, 0 10px 24px rgba(40, 32, 14, 0.08);
    padding-left: 26px;
}
.logbook-book::before { /* stínek ve vazbě */
    content: '';
    position: absolute;
    inset: 0 auto 0 0;
    width: 10px;
    background: linear-gradient(90deg, rgba(0, 0, 0, 0.12), transparent);
    pointer-events: none;
}
.logbook-title {
    font-family: Georgia, 'Times New Roman', serif;
    font-weight: 700;
    letter-spacing: 0.2px;
    color: #23231f;
}
.logbook-title small { font-family: inherit; font-weight: 400; color: #8a8270; font-size: 13px; }
.logbook-page .table { background: transparent; }
.logbook-page .table thead th {
    background: transparent;
    border-bottom: 2px solid #c9bfa8;
    color: #6b6353;
    font-family: Georgia, 'Times New Roman', serif;
    font-weight: 700;
    text-transform: none;
    letter-spacing: 0;
}
.logbook-page .table tbody td {
    background: transparent;
    border-bottom: 1px solid #e7dfcc;
    vertical-align: top;
}
.logbook-page .table tbody tr:hover td { background: rgba(201, 191, 168, 0.12); }
.logbook-page .logbook-time {
    font-family: ui-monospace, 'SFMono-Regular', Menlo, monospace;
    font-size: 12px;
    color: #4a4538;
}
.logbook-page .logbook-text { font-size: 14px; line-height: 1.55; color: #1f1f1b; }
.logbook-sheet {
    background:
        repeating-linear-gradient(#fcf9f2, #fcf9f2 27px, #e9e1cf 28px),
        #fcf9f2;
}
.logbook-sheet textarea.form-control {
    background: repeating-linear-gradient(transparent, transparent 23px, #e3dac5 24px);
    line-height: 24px;
    border-color: #e0d7c2;
}

/* ==========================================================
   ÚKOLNÍČEK
   ========================================================== */
.task-row {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    padding: 10px 0;
    border-top: 1px solid var(--border-light);
}
.task-row:first-of-type { border-top: 0; }
.task-check {
    width: 24px;
    height: 24px;
    flex: 0 0 24px;
    margin-top: 1px;
    border: 2px solid var(--border-strong);
    border-radius: 6px;
    background: var(--bg-card);
    color: #ffffff;
    font-weight: 800;
    font-size: 14px;
    line-height: 1;
    cursor: pointer;
}
.task-check:hover { background: var(--bg-hover); }
.task-row.is-done .task-check { background: var(--success); border-color: var(--success); }
.task-body { flex: 1; min-width: 0; }
.task-title { font-size: 14px; font-weight: 600; color: var(--text-primary); overflow-wrap: anywhere; }
.task-row.is-done .task-title { text-decoration: line-through; color: var(--text-muted); font-weight: 500; }
.task-meta { display: flex; flex-wrap: wrap; gap: 10px; font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.task-row.is-overdue .task-meta { color: var(--danger); }
.task-note { font-size: 12px; color: var(--text-secondary); margin-top: 4px; }
.task-actions { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }

/* Živé aktualizace: upozornění, když uživatel něco rozepsal */
.live-banner {
    position: fixed;
    right: 16px;
    bottom: 16px;
    left: 16px;
    max-width: 420px;
    margin-left: auto;
    z-index: 1500;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 14px;
    background: var(--bg-card);
    border: 1px solid var(--border-strong);
    border-radius: 10px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
    font-size: 13px;
    color: var(--text-primary);
}

/* ==========================================================
   SNÍMÁNÍ DOKLADU V RÁMEČKU (doklady zájemce)
   ========================================================== */
.id-scanner {
    position: fixed;
    inset: 0;
    z-index: 2000;
    background: #09090b;
    color: #ffffff;
    display: flex;
    flex-direction: column;
}
.id-scanner[hidden] { display: none; }
.id-scanner-header,
.id-scanner-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
}
.id-scanner-header .btn-outline { color: #ffffff; border-color: rgba(255, 255, 255, 0.4); }
.id-scanner-stage {
    position: relative;
    flex: 1;
    min-height: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}
.id-scanner-stage video {
    max-width: 100%;
    max-height: 100%;
    display: block;
}
.id-scanner-frame {
    position: absolute;
    border: 3px solid rgba(255, 255, 255, 0.9);
    border-radius: 14px;
    box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.45);
    pointer-events: none;
    transition: border-color 0.15s ease;
}
.id-scanner-frame.is-ready { border-color: #22c55e; }
#id-scanner-status { font-size: 14px; line-height: 1.4; }

@media print {
    .sidebar, .mobile-topbar, .sidebar-backdrop, footer.app-footer {
        display: none !important;
    }

    .main-viewport {
        margin-left: 0;
    }
}

/* Očko u polí pro heslo */
.password-field {
    position: relative;
}

.password-field input {
    width: 100%;
    padding-right: 44px;
}

.password-toggle {
    position: absolute;
    top: 50%;
    right: 4px;
    transform: translateY(-50%);
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

.password-toggle:hover {
    color: var(--text-primary);
}

.password-toggle:focus-visible {
    outline: 2px solid var(--text-primary);
    outline-offset: -2px;
}

/* ==========================================================
   TMAVÝ REŽIM – <html data-theme="dark">, volba se ukládá k uživateli
   ========================================================== */
:root[data-theme="dark"] {
    color-scheme: dark;
    --bg-main: #0c0c0f;
    --bg-card: #141418;
    --bg-card-hover: #1a1a1f;
    --bg-surface: #1b1b20;
    --bg-subtle: #1b1b20;
    --bg-hover: #25252b;
    --border-color: #2a2a31;
    --border-light: #212127;
    --border-strong: #e4e4e7;

    --nero-yellow: #f4f4f5;
    --nero-yellow-hover: #d4d4d8;
    --nero-yellow-glow: rgba(255, 255, 255, 0.06);
    --nero-dark: #0c0c0f;

    --text-primary: #f4f4f5;
    --text-secondary: #b4b4bc;
    --text-muted: #8c8c96;

    --success: #34d399;
    --success-bg: rgba(16, 185, 129, 0.12);
    --success-border: rgba(52, 211, 153, 0.32);
    --danger: #f87171;
    --danger-bg: rgba(239, 68, 68, 0.12);
    --danger-border: rgba(248, 113, 113, 0.32);
    --warning: #fbbf24;
    --warning-bg: rgba(245, 158, 11, 0.12);
    --warning-border: rgba(251, 191, 36, 0.32);
    --info: #60a5fa;
    --info-bg: rgba(59, 130, 246, 0.12);
    --info-border: rgba(96, 165, 250, 0.32);
}
[data-theme="dark"] .brand-badge,
[data-theme="dark"] .nav-link.active { color: var(--bg-main); }
[data-theme="dark"] .btn-primary { color: var(--bg-main) !important; }
[data-theme="dark"] .btn-primary:hover { background: #d4d4d8; }
[data-theme="dark"] .btn-secondary,
[data-theme="dark"] .btn-outline { background: var(--bg-card); }
[data-theme="dark"] .btn-secondary:hover,
[data-theme="dark"] .btn-outline:hover { border-color: #3a3a42; }
[data-theme="dark"] .form-control,
[data-theme="dark"] select,
[data-theme="dark"] textarea,
[data-theme="dark"] input[type="text"],
[data-theme="dark"] input[type="date"],
[data-theme="dark"] input[type="month"],
[data-theme="dark"] input[type="time"],
[data-theme="dark"] input[type="number"] {
    background-color: var(--bg-surface);
    border-color: var(--border-color);
    color: var(--text-primary);
    color-scheme: dark;
}
[data-theme="dark"] .badge-tag.yellow { border-color: var(--border-color); }
[data-theme="dark"] .task-row.is-done .task-check { color: var(--bg-main); }
[data-theme="dark"] .live-banner { box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5); }
/* Evidenční kniha v noci: tmavý papír */
[data-theme="dark"] .logbook-book {
    background: linear-gradient(90deg, rgba(0, 0, 0, 0.25), transparent 22px), #1c1a16;
    border-color: #2e2a22;
    border-left-color: #050506;
    box-shadow: 0 1px 0 #24211b, 0 3px 0 #1f1c17, 0 4px 0 #2e2a22, 0 10px 24px rgba(0, 0, 0, 0.4);
}
[data-theme="dark"] .logbook-title { color: #ece6d6; }
[data-theme="dark"] .logbook-title small { color: #9a917c; }
[data-theme="dark"] .logbook-page .table thead th { border-bottom-color: #4a4334; color: #b3a98f; }
[data-theme="dark"] .logbook-page .table tbody td { border-bottom-color: #2e2a22; }
[data-theme="dark"] .logbook-page .logbook-time { color: #c9bfa6; }
[data-theme="dark"] .logbook-page .logbook-text { color: #ece6d6; }
[data-theme="dark"] .logbook-sheet { background: repeating-linear-gradient(#1c1a16, #1c1a16 27px, #2b271f 28px), #1c1a16; }
[data-theme="dark"] .logbook-sheet textarea.form-control {
    background: repeating-linear-gradient(transparent, transparent 23px, #3a3428 24px);
    border-color: #3a3428;
}

/* Přepínač vzhledu */
.theme-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    width: 100%;
    margin-bottom: 8px;
}

/* ==========================================================
   OZNÁMENÍ – zvoneček, panel, vyskakovací upozornění
   ========================================================== */
.sidebar-header { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.notify-bell {
    position: relative;
    display: inline-grid;
    place-items: center;
    width: 36px;
    height: 36px;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    background: var(--bg-card);
    color: var(--text-primary);
    cursor: pointer;
    transition: background 0.15s ease, transform 0.15s ease;
}
.notify-bell:hover { background: var(--bg-subtle); }
.notify-bell:active { transform: scale(0.96); }
.notify-bell.is-muted { color: var(--text-muted); }
.notify-bell.is-muted::after { /* přeškrtnutí při ztlumení */
    content: '';
    position: absolute;
    width: 22px;
    height: 2px;
    background: currentColor;
    transform: rotate(-40deg);
    border-radius: 2px;
}
.notify-count {
    position: absolute;
    top: -6px;
    right: -6px;
    min-width: 19px;
    height: 19px;
    padding: 0 5px;
    border-radius: 999px;
    background: #dc2626;
    color: #ffffff;
    font-size: 11px;
    font-weight: 800;
    line-height: 19px;
    text-align: center;
    box-shadow: 0 0 0 2px var(--bg-card);
}
.notify-panel {
    position: fixed;
    z-index: 1800;
    max-height: min(560px, calc(100vh - 90px));
    display: flex;
    flex-direction: column;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 14px;
    box-shadow: 0 18px 48px rgba(0, 0, 0, 0.18), 0 2px 8px rgba(0, 0, 0, 0.06);
    overflow: hidden;
    animation: notify-in 0.16s ease-out;
}
.notify-panel[hidden] { display: none; }
@keyframes notify-in { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }
.notify-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    padding: 12px 14px;
    border-bottom: 1px solid var(--border-light);
    font-size: 14px;
}
.notify-head-actions { display: flex; gap: 4px; }
.notify-link {
    border: 0;
    background: none;
    color: var(--text-secondary);
    font-size: 12px;
    font-weight: 600;
    padding: 4px 6px;
    border-radius: 6px;
    cursor: pointer;
}
.notify-link:hover { background: var(--bg-subtle); color: var(--text-primary); }
.notify-mute, .notify-muted {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    background: var(--bg-subtle);
    border-bottom: 1px solid var(--border-light);
    font-size: 12px;
    color: var(--text-secondary);
}
.notify-mute[hidden], .notify-muted[hidden] { display: none; }
.notify-mute button, .notify-muted button {
    border: 1px solid var(--border-color);
    background: var(--bg-card);
    color: var(--text-primary);
    border-radius: 999px;
    padding: 3px 10px;
    font-size: 12px;
    cursor: pointer;
}
.notify-list { overflow-y: auto; }
.notify-empty { padding: 26px 14px; text-align: center; color: var(--text-muted); font-size: 13px; }
.notify-row { display: flex; align-items: stretch; border-bottom: 1px solid var(--border-light); }
.notify-row.is-removing { opacity: 0.4; }
.notify-row .notify-item { border-bottom: 0; flex: 1; min-width: 0; }
.notify-delete { flex: 0 0 36px; border: 0; background: none; color: var(--text-muted); font-size: 13px; cursor: pointer; }
.notify-delete:hover { color: var(--danger); background: var(--bg-subtle); }
.notify-item {
    display: flex;
    gap: 10px;
    width: 100%;
    padding: 11px 14px;
    border: 0;
    border-bottom: 1px solid var(--border-light);
    background: none;
    text-align: left;
    color: var(--text-primary);
    cursor: pointer;
    font: inherit;
}
.notify-item:hover { background: var(--bg-subtle); }
.notify-dot { flex: 0 0 8px; height: 8px; margin-top: 6px; border-radius: 50%; background: transparent; }
.notify-item.is-unread .notify-dot { background: #2563eb; }
.notify-item.is-unread strong { font-weight: 800; }
.notify-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.notify-text strong { font-size: 13px; font-weight: 600; }
.notify-text span { font-size: 12px; color: var(--text-secondary); overflow-wrap: anywhere; }
.notify-text small { font-size: 11px; color: var(--text-muted); }

.notify-toasts {
    position: fixed;
    right: 16px;
    top: 16px;
    z-index: 1900;
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: min(360px, calc(100vw - 32px));
    pointer-events: none;
}
.notify-toast {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 12px 12px 14px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-left: 4px solid #2563eb;
    border-radius: 12px;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.16);
    cursor: pointer;
    pointer-events: auto;
    opacity: 0;
    transform: translateY(12px);
    transition: opacity 0.22s ease, transform 0.22s ease;
}
.notify-toast.is-visible { opacity: 1; transform: none; }
.notify-toast.is-leaving { opacity: 0; transform: translateX(24px); }
.notify-toast-icon { font-size: 18px; line-height: 1.2; }
.notify-toast-text { flex: 1; display: flex; flex-direction: column; gap: 2px; min-width: 0; font-size: 13px; color: var(--text-primary); }
.notify-toast-text span { font-size: 12px; color: var(--text-secondary); overflow-wrap: anywhere; }
.notify-toast-close { border: 0; background: none; color: var(--text-muted); cursor: pointer; font-size: 13px; padding: 2px 4px; }
[data-theme="dark"] .notify-panel, [data-theme="dark"] .notify-toast { box-shadow: 0 18px 48px rgba(0, 0, 0, 0.55); }
@media (prefers-reduced-motion: reduce) {
    .notify-panel, .notify-toast { animation: none; transition: none; }
}

/* ==========================================================
   ÚVODNÍ STRÁNKA – pozdrav a statistiky
   ========================================================== */
.welcome { margin: 0 0 18px; }
.welcome-title { font-size: 28px; font-weight: 800; letter-spacing: -0.6px; margin: 0; }
.welcome-date { margin: 4px 0 0; color: var(--text-muted); font-size: 14px; }
.welcome-date time { font-variant-numeric: tabular-nums; color: var(--text-primary); font-weight: 600; }
.stat-link { display: block; text-decoration: none; color: inherit; transition: border-color 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease; }
.stat-link:hover { border-color: var(--border-strong); transform: translateY(-1px); box-shadow: 0 6px 18px rgba(0, 0, 0, 0.06); }
.stat-link.tone-amber { border-left: 4px solid var(--warning); }
.stat-link.tone-red { border-left: 4px solid var(--danger); }
.stat-link.tone-red .stat-value { color: var(--danger); }
.dashboard-stats { grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); margin-bottom: 26px; }

/* ==========================================================
   VYHLEDÁVÁNÍ ZAMĚSTNANCE PSANÍM (static/js/searchable-select.js)
   ========================================================== */
.search-select { position: relative; width: 100%; }
.search-select-list {
    position: absolute;
    z-index: 1200;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    max-height: 260px;
    overflow-y: auto;
    margin: 0;
    padding: 4px;
    list-style: none;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.12);
}
.search-select-list[hidden] { display: none; }
.search-select-option {
    padding: 8px 10px;
    border-radius: 6px;
    font-size: 13.5px;
    color: var(--text-primary);
    cursor: pointer;
}
.search-select-option.is-active, .search-select-option:hover { background: var(--bg-subtle); }
.search-select-empty { padding: 10px; font-size: 13px; color: var(--text-muted); }
.search-list-input { margin-bottom: 8px; }

/* Kdo a kdy podepsal */
.signed-by { font-size: 12px; color: var(--text-secondary); line-height: 1.4; }
.signed-by-img { display: block; height: 60px; max-width: 220px; margin-bottom: 4px; background: #ffffff; border: 1px solid var(--border-color); border-radius: 6px; padding: 4px; }
.signed-by-when { color: var(--text-muted); }

/* ==========================================================
   LHŮTY – sloučené řádky s rozbalením (vždy jen jeden)
   ========================================================== */
.deadline-list { display: flex; flex-direction: column; gap: 8px; }
.deadline-item {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-left: 4px solid var(--info);
    border-radius: 10px;
}
.deadline-item.state-late, .deadline-item.state-today { border-left-color: var(--danger); }
.deadline-item.state-warn { border-left-color: var(--warning); }
.deadline-item summary {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    padding: 12px 14px;
    cursor: pointer;
    list-style: none;
}
.deadline-item summary::-webkit-details-marker { display: none; }
.deadline-due { flex: 0 0 auto; min-width: 110px; }
.deadline-main { flex: 1 1 220px; display: flex; flex-direction: column; min-width: 0; }
.deadline-main .deadline-name { font-size: 16px; font-weight: 800; letter-spacing: -0.2px; }
.deadline-who { font-size: 13px; color: var(--text-secondary); margin-top: 1px; }
.deadline-actions { flex: 0 0 auto; display: flex; gap: 6px; }
.deadline-chevron {
    flex: 0 0 auto;
    width: 9px;
    height: 9px;
    border-right: 2px solid var(--text-muted);
    border-bottom: 2px solid var(--text-muted);
    transform: rotate(45deg);
    margin: 0 4px 4px;
    transition: transform 0.15s ease;
}
.deadline-item[open] .deadline-chevron { transform: rotate(-135deg); margin-bottom: -4px; }
.deadline-detail { padding: 0 14px 12px 14px; border-top: 1px solid var(--border-light); }
.deadline-detail ul { list-style: none; margin: 10px 0 8px; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.deadline-detail li { display: flex; justify-content: space-between; gap: 10px; font-size: 13px; }
.deadline-detail-due { color: var(--text-muted); white-space: nowrap; }
.deadline-detail-due.is-urgent { color: var(--danger); font-weight: 600; }
.deadline-detail-link { font-size: 12.5px; }

/* ==========================================================
   ČEKACÍ PŘEKRYV (form[data-busy]) – moderní kolečko s textem
   ========================================================== */
.busy-overlay {
    position: fixed;
    inset: 0;
    z-index: 3000;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 18px;
    background: rgba(250, 250, 250, 0.82);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    animation: busy-fade 0.2s ease-out;
}
[data-theme="dark"] .busy-overlay { background: rgba(12, 12, 15, 0.82); }
.busy-spinner {
    width: 54px;
    height: 54px;
    border-radius: 50%;
    background: conic-gradient(from 0deg, transparent 0deg, var(--text-primary) 300deg, transparent 360deg);
    -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 5px), #000 calc(100% - 4px));
    mask: radial-gradient(farthest-side, transparent calc(100% - 5px), #000 calc(100% - 4px));
    animation: busy-spin 0.9s linear infinite;
}
.busy-text { margin: 0; font-size: 16px; font-weight: 700; letter-spacing: -0.2px; color: var(--text-primary); }
@keyframes busy-spin { to { transform: rotate(360deg); } }
@keyframes busy-fade { from { opacity: 0; } to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .busy-spinner { animation-duration: 2.4s; } }

.address-credit { font-size: 11px; padding: 6px 10px 4px; }

/* ==========================================================
   REKLAMACE MEZD – široká tabulka, řádky podle stavu
   ========================================================== */
.claim-table { font-size: 13px; }
.claim-table th { white-space: nowrap; }
.claim-table td, .claim-table th { padding: 7px 9px; vertical-align: top; }
.claim-table tr.claim-done td { background: var(--success-bg); }
.claim-table tr.claim-pending td, .claim-table tr.claim-approved td { background: var(--warning-bg); }
.claim-table tr.claim-rejected td { background: var(--danger-bg); }


/* ==========================================================
   PŘIHLÁŠENÍ – panel v barvách Nero (černá, žlutá z loga)
   ========================================================== */
.login-card {
    max-width: 420px;
    margin: 56px auto 0;
    padding: 34px 30px 30px;
    background: var(--bg-card);
    border: 1.5px solid #111113;
    border-top: 5px solid #f5b800;
    border-radius: 4px;
    box-shadow: 10px 10px 0 #f5b800;
}
.login-card-logo { display: flex; justify-content: center; margin-bottom: 18px; }
.login-card-logo .nero-logo { height: 56px; width: auto; color: var(--text-primary); }
.login-card-title { text-align: center; font-size: 22px; font-weight: 800; letter-spacing: -0.3px; margin: 0 0 22px; color: var(--text-primary); }
.login-card .form-control:focus { border-color: #111113; box-shadow: 0 0 0 3px rgba(245, 184, 0, 0.35); }
.login-card-btn {
    width: 100%;
    padding: 12px;
    border: 0;
    border-radius: 4px;
    background: #111113;
    color: #ffffff;
    font: inherit;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
}
.login-card-btn:hover, .login-card-btn:focus-visible { background: #f5b800; color: #111113; outline: none; }
[data-theme="dark"] .login-card { border-color: #f5b800; }
[data-theme="dark"] .login-card-btn { background: #f5b800; color: #111113; }
[data-theme="dark"] .login-card-btn:hover { background: #ffd24d; }
@media (max-width: 480px) {
    .login-card { margin-top: 24px; padding: 26px 20px 22px; box-shadow: 6px 6px 0 #f5b800; }
}


/* ==========================================================
   PODPORA – tlačítko vpravo v patičce (každá stránka aplikace)
   ========================================================== */
.support-btn {
    grid-column: 3;
    justify-self: end;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 12px;
    border-radius: 999px;
    background: #111113;
    color: #ffffff;
    font-size: 12px;
    font-weight: 700;
    text-decoration: none;
    white-space: nowrap;
    transition: background 0.2s, color 0.2s;
}
.support-btn:hover, .support-btn:focus-visible, .support-btn.is-active { background: #f5b800; color: #111113; outline: none; }
[data-theme="dark"] .support-btn { background: #f5b800; color: #111113; }
[data-theme="dark"] .support-btn:hover { background: #ffd24d; }
@media (max-width: 992px) {
    .support-btn { grid-column: 1; justify-self: start; margin-top: 4px; }
    .notify-toasts { top: 68px; }
}


/* ==========================================================
   DISPEČINK – úvodní stránka přes celou šířku
   ========================================================== */
.dash { display: flex; flex-direction: column; gap: 22px; }
/* Dlaždice v plných řadách: počet sloupců podle počtu dlaždic (--cols z šablony) */
.dash .dashboard-stats { display: grid; grid-template-columns: repeat(var(--cols, 5), minmax(0, 1fr)); gap: 12px; margin: 0; }
.dash .stat-card { min-width: 0; padding: 14px 18px; border-radius: 12px; }
.dash .stat-label { overflow-wrap: anywhere; }
@media (max-width: 1280px) { .dash .dashboard-stats { grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); } }
.dash .stat-value { font-size: 28px; }

/* Panely ve sloupcích (jako zeď) – navazují bez prázdných míst */
.dash-grid { columns: 3 340px; column-gap: 16px; }
.dash-grid > .dash-panel { break-inside: avoid; margin-bottom: 16px; }
.dash-panel {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 16px 18px 10px;
}
.dash-panel-today { border-top: 4px solid #f5b800; }
.dash-panel-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; margin-bottom: 8px; }
.dash-panel-head h2 { font-size: 15px; font-weight: 800; margin: 0; letter-spacing: -0.2px; }
.dash-panel-more { font-size: 12px; font-weight: 600; color: var(--text-muted); text-decoration: none; white-space: nowrap; }
.dash-panel-more:hover { color: var(--text-primary); }
.dash-list { list-style: none; margin: 0; padding: 0; }
.dash-list li + li { border-top: 1px solid var(--border-light); }
.dash-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 4px;
    color: inherit;
    text-decoration: none;
    border-radius: 6px;
}
.dash-item:hover { background: var(--bg-subtle); }
.dash-item-dot { flex: none; width: 8px; height: 8px; border-radius: 50%; background: var(--border-strong); }
.dash-item.tone-red .dash-item-dot { background: var(--danger); }
.dash-item.tone-amber .dash-item-dot { background: #f5b800; }
.dash-item.tone-green .dash-item-dot { background: var(--success); }
.dash-item.tone-teal .dash-item-dot { background: #14b8a6; }
.dash-item.tone-violet .dash-item-dot { background: #8b5cf6; }
.dash-item-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.dash-item-title { font-size: 13.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dash-item-sub { font-size: 12px; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dash-item-when { flex: none; font-size: 12px; font-weight: 600; color: var(--text-muted); font-variant-numeric: tabular-nums; }
.dash-item.tone-red .dash-item-when { color: var(--danger); }
.dash-empty { margin: 10px 0 14px; font-size: 13px; color: var(--text-muted); }
@media (max-width: 640px) {
    .dash-grid { columns: 1; }
    .dash .dashboard-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
    .dash .stat-card { padding: 12px 14px; }
    .dash .stat-value { font-size: 24px; }
}

/* ==========================================================
   NÁVODY – rozcestník a kroky s nakresleným iPhonem
   ========================================================== */
.guide-category { font-size: 13px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-muted); margin: 8px 0 10px; }
.guide-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; margin-bottom: 26px; }
.guide-card {
    display: flex; gap: 14px; align-items: flex-start;
    padding: 18px; border: 1px solid var(--border-color); border-radius: 12px;
    background: var(--bg-card); color: inherit; text-decoration: none;
    transition: border-color 0.2s, transform 0.2s, box-shadow 0.2s;
}
.guide-card:hover { border-color: #111113; transform: translateY(-2px); box-shadow: 6px 6px 0 #f5b800; }
.guide-card-icon { flex: none; width: 46px; height: 46px; display: grid; place-items: center; font-size: 24px; border-radius: 10px; background: var(--bg-subtle); }
.guide-card-body { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.guide-card-title { font-size: 15px; font-weight: 800; }
.guide-card-summary { font-size: 13px; color: var(--text-secondary); }
.guide-card-meta { font-size: 12px; font-weight: 600; color: var(--text-muted); margin-top: 4px; }

.guide-note { max-width: 980px; margin: 0 0 22px; padding: 12px 16px; border-left: 4px solid #f5b800; background: var(--bg-card); border-radius: 8px; font-size: 14px; }
.guide-steps { list-style: none; margin: 0; padding: 0; max-width: 980px; display: flex; flex-direction: column; gap: 18px; }
.guide-step {
    display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 30px; align-items: center;
    padding: 26px; border: 1px solid var(--border-color); border-radius: 16px; background: var(--bg-card);
}
.guide-step:nth-child(even) { grid-template-columns: auto minmax(0, 1fr); }
.guide-step:nth-child(even) .guide-step-text { order: 2; }
.guide-step-num { display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: #111113; color: #f5b800; font-weight: 800; font-size: 15px; margin-bottom: 10px; }
.guide-step h2 { font-size: 21px; font-weight: 800; letter-spacing: -0.3px; margin: 0 0 8px; }
.guide-step p { font-size: 15px; color: var(--text-secondary); margin: 0 0 8px; max-width: 520px; }
.guide-tip { font-size: 13.5px !important; padding: 8px 12px; border-radius: 8px; background: var(--bg-subtle); }

/* Telefon */
.phone { width: 236px; height: 486px; padding: 9px; border-radius: 42px; background: #1c1c1e; box-shadow: 0 0 0 2px #3a3a3c, 0 18px 40px rgba(0, 0, 0, 0.22); flex: none; }
.phone-screen { position: relative; height: 100%; border-radius: 34px; overflow: hidden; background: #ffffff; color: #111113; display: flex; flex-direction: column; font-family: -apple-system, 'SF Pro Text', system-ui, sans-serif; font-size: 11px; }
.phone-status { display: flex; justify-content: space-between; align-items: center; padding: 10px 18px 4px; font-size: 10.5px; font-weight: 600; }
.phone-status.is-light { color: #ffffff; }
.phone-island { width: 68px; height: 20px; border-radius: 12px; background: #000000; }
.phone-page { flex: 1; padding: 10px 16px; display: flex; flex-direction: column; gap: 8px; background: #f4f3ef; }
.mock-logo img { width: 34px; height: 34px; border-radius: 8px; }
.mock-line { height: 9px; border-radius: 5px; background: #d9d7d0; }
.mock-line.w70 { width: 70%; } .mock-line.w50 { width: 50%; }
.mock-card { height: 74px; border-radius: 10px; background: #ffffff; border: 1px solid #e3e1da; }
.mock-card.short { height: 48px; }
.safari-bar { padding: 8px 10px 14px; background: rgba(248, 248, 248, 0.96); border-top: 1px solid #e5e5ea; }
.safari-url { margin: 0 4px 8px; padding: 7px 10px; border-radius: 11px; background: #e9e9ee; text-align: center; font-size: 11px; color: #3a3a3c; }
.safari-tools { display: flex; justify-content: space-around; align-items: center; font-size: 17px; color: #0a84ff; }
.share-ico { position: relative; width: 16px; height: 16px; border: 2px solid #0a84ff; border-top: 0; border-radius: 2px; }
.share-ico::before { content: ''; position: absolute; left: 50%; top: -9px; width: 2px; height: 12px; background: #0a84ff; transform: translateX(-50%); }
.share-ico::after { content: ''; position: absolute; left: 50%; top: -10px; width: 6px; height: 6px; border-left: 2px solid #0a84ff; border-top: 2px solid #0a84ff; transform: translateX(-50%) rotate(45deg); }

/* Zvýraznění místa, kam klepnout */
.is-tap { position: relative; outline: 3px solid #f5b800; outline-offset: 3px; border-radius: 10px; animation: guide-tap 1.8s ease-in-out infinite; }
@keyframes guide-tap { 0%, 100% { outline-color: rgba(245, 184, 0, 1); } 50% { outline-color: rgba(245, 184, 0, 0.35); } }

/* Nabídka sdílení */
.phone-screen.is-dimmed { background: #8e8e93; }
.share-sheet { margin-top: auto; padding: 8px 12px 16px; border-radius: 16px 16px 0 0; background: #f2f2f7; }
.sheet-handle { width: 36px; height: 5px; margin: 0 auto 10px; border-radius: 3px; background: #c7c7cc; }
.sheet-head { display: flex; gap: 8px; align-items: center; padding: 8px; margin-bottom: 8px; border-radius: 10px; background: #ffffff; }
.sheet-head img { width: 30px; height: 30px; border-radius: 7px; }
.sheet-head span { display: flex; flex-direction: column; }
.sheet-head small { color: #8e8e93; }
.sheet-row { display: flex; justify-content: space-between; align-items: center; padding: 9px 12px; background: #ffffff; border-bottom: 1px solid #e5e5ea; font-size: 11.5px; }
.sheet-row:first-of-type { border-radius: 10px 10px 0 0; }
.sheet-row:last-child { border-radius: 0 0 10px 10px; border-bottom: 0; }
.sheet-row span { color: #3a3a3c; }
.sheet-row.is-tap { font-weight: 700; z-index: 1; }

/* Dialog Přidat na plochu */
.phone-screen.is-sheet-bg { background: #f2f2f7; }
.add-dialog { padding: 6px 12px; }
.add-head { display: flex; justify-content: space-between; align-items: center; gap: 4px; padding: 8px 2px 14px; font-size: 10.5px; white-space: nowrap; }
.add-cancel, .add-confirm { color: #0a84ff; }
.add-confirm { font-weight: 700; padding: 2px 6px; }
.add-card { display: flex; gap: 10px; align-items: center; padding: 10px; border-radius: 12px; background: #ffffff; }
.add-card img { width: 46px; height: 46px; border-radius: 11px; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15); }
.add-name { font-size: 13px; font-weight: 600; border-bottom: 1px solid #e5e5ea; padding-bottom: 3px; margin-bottom: 3px; }
.add-card small { color: #8e8e93; }
.add-toggle { display: flex; justify-content: space-between; align-items: center; margin-top: 10px; padding: 10px; border-radius: 12px; background: #ffffff; font-size: 11px; }
.switch { position: relative; width: 34px; height: 20px; border-radius: 10px; background: #34c759; }
.switch::after { content: ''; position: absolute; right: 2px; top: 2px; width: 16px; height: 16px; border-radius: 50%; background: #ffffff; }
.add-hint { margin: 10px 4px 0 !important; font-size: 10px !important; color: #8e8e93 !important; }

/* Plocha */
.phone-screen.is-home { background: linear-gradient(160deg, #1d2b4f, #5b3b6e 55%, #c46a4a); }
.home-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 18px 6px; padding: 22px 12px; }
.app { width: 38px; height: 38px; border-radius: 10px; background: var(--c, #8e8e93); justify-self: center; position: relative; }
.app.is-nero { background: none; display: flex; flex-direction: column; align-items: center; gap: 3px; width: auto; height: auto; }
.app.is-nero img { width: 38px; height: 38px; border-radius: 10px; }
.app.is-nero small { color: #ffffff; font-size: 9.5px; }
.app.is-nero.is-tap { outline-offset: 4px; border-radius: 13px; }
.home-dock { margin: auto 10px 12px; padding: 9px 6px; display: flex; justify-content: space-around; border-radius: 22px; background: rgba(255, 255, 255, 0.25); }

@media (max-width: 760px) {
    .guide-step, .guide-step:nth-child(even) { grid-template-columns: minmax(0, 1fr); justify-items: center; padding: 20px 16px; }
    .guide-step:nth-child(even) .guide-step-text { order: 0; }
    .guide-step-text { justify-self: stretch; }
}

/* Safari v novém iOS: plovoucí lišta dole (zpět · adresa s nabídkou ≡ · panely) */
.safari26 { display: flex; align-items: center; gap: 6px; padding: 8px 10px 16px; }
.s26-round { flex: none; width: 34px; height: 34px; display: grid; place-items: center; border-radius: 50%; background: rgba(120, 120, 128, 0.32); color: #3a3a3c; font-size: 15px; }
.s26-pill { flex: 1; min-width: 0; height: 34px; display: flex; align-items: center; gap: 6px; padding: 0 10px; border-radius: 17px; background: rgba(120, 120, 128, 0.32); color: #3a3a3c; }
.s26-pill.is-tap { border-radius: 17px; }
.s26-url { flex: 1; text-align: center; font-size: 11.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.s26-reload { font-size: 13px; }
.s26-menu { position: relative; flex: none; width: 13px; height: 9px; border-top: 2px solid #3a3a3c; border-bottom: 2px solid #3a3a3c; }
.s26-menu::after { content: ''; position: absolute; left: 0; top: 1.5px; width: 9px; height: 2px; background: #3a3a3c; }
.s26-menu.is-tap { outline-offset: 6px; border-radius: 4px; }
.phone-page.is-blurred { filter: blur(2px); opacity: 0.6; }
.s26-popover { position: absolute; left: 12px; right: 30px; bottom: 62px; padding: 4px 0; border-radius: 14px; background: rgba(250, 250, 252, 0.97); box-shadow: 0 10px 30px rgba(0, 0, 0, 0.22); }
.pop-row { display: flex; justify-content: space-between; align-items: center; padding: 9px 14px; font-size: 11.5px; border-bottom: 1px solid #e5e5ea; }
.pop-row:last-child { border-bottom: 0; }
.pop-row.is-tap { font-weight: 700; margin: 2px 4px; border-bottom: 0; }


/* ==========================================================
   KARTA ZAMĚSTNANCE – žádosti barevně podle druhu, stránkování
   ========================================================== */
.emp-request {
    --kind: var(--border-strong);
    display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap;
    padding: 9px 12px; margin-top: 6px; border-radius: 8px;
    border-left: 4px solid var(--kind); background: color-mix(in srgb, var(--kind) 8%, var(--bg-card));
    font-size: 13px;
}
/* Barva podle stavu: čeká = oranžová, zamítnuto = červená, vyřízeno = zelená */
.emp-request.status-pending, .emp-request.status-approved { --kind: #f97316; }
.emp-request.status-rejected { --kind: #dc2626; }
.emp-request.status-done { --kind: #16a34a; }
.emp-request.status-draft { --kind: #94a3b8; border-left-style: dashed; }
.emp-request-meta .status-text { font-weight: 700; color: var(--kind); }
.emp-request-main { display: flex; align-items: center; gap: 10px; min-width: 0; }
.emp-request-kind { font-weight: 700; }
.emp-request-meta { color: var(--text-muted); font-size: 12px; }
.emp-request-pages { display: flex; gap: 6px; justify-content: center; margin-top: 12px; }
.emp-request-pages a, .emp-request-pages span {
    min-width: 30px; height: 30px; display: inline-grid; place-items: center; padding: 0 8px;
    border: 1px solid var(--border-color); border-radius: 6px; font-size: 13px; text-decoration: none; color: var(--text-primary);
}
.emp-request-pages a:hover { border-color: var(--text-primary); }
.emp-request-pages .is-current { background: #111113; color: #ffffff; border-color: #111113; font-weight: 700; }
[data-theme="dark"] .emp-request-pages .is-current { background: #f5b800; color: #111113; border-color: #f5b800; }

/* Karta zaměstnance: vlevo údaje, vpravo panel žádostí */
.emp-status { display: inline-flex; align-items: center; gap: 4px; padding: 4px 12px; border-radius: 999px; font-size: 13px; font-weight: 700; }
.emp-status.is-active { background: var(--success-bg); color: var(--success); border: 1px solid var(--success-border); }
.emp-status.is-ended { background: var(--danger-bg); color: var(--danger); border: 1px solid var(--danger-border); }
.emp-status.is-inactive { background: var(--bg-subtle); color: var(--text-muted); border: 1px solid var(--border-color); }
.emp-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr); gap: 24px; align-items: start; margin-bottom: 24px; }
.emp-main { display: flex; flex-direction: column; gap: 24px; min-width: 0; }
.emp-main > .card { margin: 0; }
.emp-side { position: sticky; top: 20px; min-width: 0; }
.emp-requests-panel { margin: 0; }
.emp-side { display: flex; flex-direction: column; gap: 24px; }
.emp-cps-edit { margin-top: 6px; font-size: 12px; }
.emp-cps-edit summary { cursor: pointer; color: var(--text-muted); width: fit-content; }
.emp-cps-edit form { display: flex; gap: 6px; margin-top: 6px; max-width: 360px; }
.emp-cps-edit .form-control { padding: 6px 10px; font-size: 13px; }
.emp-cps-card { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.emp-cps-actions { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.emp-requests-panel > div:first-child { flex-direction: column; align-items: stretch !important; }
.emp-request-actions { display: flex; flex-wrap: nowrap; gap: 5px; }
@media (max-width: 1400px) { .emp-request-actions { flex-wrap: wrap; } }
.emp-requests-panel .emp-request-actions > .btn { flex: 1 1 auto; justify-content: center; white-space: nowrap; padding: 6px 8px; font-size: 12px; margin: 0; min-width: 0; }
.emp-contacts { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; }
.emp-contact-label { display: block; color: var(--text-muted); font-size: 12px; text-transform: uppercase; margin-bottom: 4px; }
.emp-contact-value { font-size: 15px; font-weight: 700; color: var(--text-primary); overflow-wrap: anywhere; }
.emp-contact-value a { color: var(--text-primary); text-decoration: none; }
.emp-request-actions .btn { justify-content: center; text-align: center; }
.emp-requests-panel .emp-request { padding: 8px 10px; flex-direction: column; align-items: flex-start; gap: 2px; }
.emp-requests-panel .emp-request-main { flex-direction: column; align-items: flex-start; gap: 0; }
@media (max-width: 1100px) {
    .emp-layout { grid-template-columns: minmax(0, 1fr); }
    .emp-side { position: static; }
}

/* Chybějící doklady na kartě zaměstnance: každý na vlastním řádku */
.missing-doc-list { display: flex; flex-direction: column; }
.missing-doc-form { margin: 0; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 10px 0; border-top: 1px solid var(--border-color); }
.missing-doc-label { font-size: 13px; font-weight: 600; min-width: 220px; flex: 1 1 220px; }

/* Karta zaměstnance: mřížka 3 sloupců. Široké bloky (zaměstnavatelé, prohlášení poplatníka)
   zabírají první dva sloupce, úzké (žádosti, kontroly, co chybí) třetí sloupec. */
.emp-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; align-items: stretch; margin-bottom: 24px; }
.emp-cell { min-width: 0; display: flex; flex-direction: column; }
/* Řádky zarovnané: karty v jednom řádku mřížky mají stejnou výšku */
.emp-cell > .card { flex: 1 1 auto; }
.emp-stack > .card:not(:last-child) { flex: 0 0 auto; }
.emp-cell:empty { display: none; }
.emp-stack { gap: 24px; }
.emp-grid .emp-cell > .card, .emp-stack > .card { margin: 0 !important; }
.emp-wide { grid-column: 1 / span 2; }
.emp-narrow { grid-column: 3; }
.emp-grid .emp-requests-panel .emp-request-actions { flex-wrap: wrap; }
.emp-grid .table-responsive { overflow-x: auto; }
/* Manažer: 2 sloupce – pracovní údaje | kontakt a co chybí; žádosti | kontroly */
.emp-grid-mgr { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.emp-grid-mgr .emp-wide, .emp-grid-mgr .emp-narrow { grid-column: auto; }
@media (max-width: 1100px) {
    .emp-grid { grid-template-columns: minmax(0, 1fr); }
    .emp-wide, .emp-narrow { grid-column: auto; }
}

.emp-grid .emp-contacts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.emp-grid .emp-contact-value { font-size: 14px; }
.emp-grid .missing-doc-label { flex: 1 1 100%; min-width: 0; }

/* Zálohy: manažerovy rozpracované a čekající žádosti */
.advance-request-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; padding: 10px 0; border-top: 1px solid var(--border-color); }
.advance-request-row:first-of-type { border-top: 0; }
.draft-status { font-size: 12px; color: var(--text-muted); }

/* Kontroly: výběr objektu pro novou kontrolu a čísla kontrolovaného zaměstnance */
.inspection-start { display: flex; gap: 12px; align-items: flex-end; flex-wrap: wrap; margin-bottom: 20px; }
.inspection-numbers { display: flex; gap: 16px; flex-wrap: wrap; margin-top: 8px; padding: 8px 12px; border-radius: 6px; background: var(--bg-subtle); font-size: 13px; color: var(--text-secondary); }
.inspection-numbers strong { color: var(--text-primary); font-family: monospace; }

/* Žádost o zasmluvnění: volba sady smluv (Správa železnic / ÚP) */
.contract-set-choices { display: flex; flex-wrap: wrap; gap: 8px; }
.contract-set-choice { display: inline-flex; align-items: center; gap: 8px; margin: 0; padding: 10px 14px; border: 1px solid var(--border-color); border-radius: 8px; background: var(--bg-subtle); cursor: pointer; font-size: 14px; font-weight: 600; color: var(--text-primary); }
.contract-set-choice:has(input:checked) { border-color: var(--text-primary); background: var(--bg-card); box-shadow: 0 0 0 1px var(--text-primary); }
.contract-set-hint { font-size: 11px; color: var(--text-muted); margin-top: 6px; }

/* Žádosti: filtr podle typu a stavu, řazení */
.request-filter { display: flex; gap: 12px; align-items: flex-end; flex-wrap: wrap; margin-bottom: 16px; padding: 14px 16px; }
.request-filter .form-group { margin: 0; min-width: 200px; }
.request-filter label { font-size: 11px; font-weight: 700; text-transform: uppercase; color: var(--text-muted); }
.request-filter-count { margin-left: auto; font-size: 12px; color: var(--text-muted); align-self: center; }
.request-actions { text-align: right; min-width: 230px; }
.request-actions-row { display: flex; gap: 6px; justify-content: flex-end; flex-wrap: wrap; }
.request-return-form { display: flex; gap: 4px; margin: 6px 0 0; justify-content: flex-end; }
.request-return-form .form-control { width: 150px; padding: 4px 8px; font-size: 12px; }

/* Objekty: hledání */
.object-search { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; padding: 12px 16px; margin-bottom: 16px; }
.object-search .form-control { flex: 1; min-width: 240px; }
.object-search-count { font-size: 12px; color: var(--text-muted); white-space: nowrap; }

/* Doklady: tlačítko „Nahrát“ se dvěma možnostmi (chytrý rámeček / Galerie a Soubory) */
.upload-menu { position: relative; display: inline-block; }
.upload-menu > summary { list-style: none; cursor: pointer; display: inline-flex; }
.upload-menu > summary::-webkit-details-marker { display: none; }
.upload-menu-list { position: absolute; z-index: 30; top: calc(100% + 4px); left: 0; min-width: 260px; display: flex; flex-direction: column; padding: 4px; border: 1px solid var(--border-color); border-radius: 8px; background: var(--bg-card); box-shadow: 0 8px 24px rgba(0, 0, 0, 0.14); }
.upload-menu-item { display: flex; align-items: center; gap: 8px; width: 100%; white-space: nowrap; margin: 0; padding: 10px 12px; border: 0; border-radius: 6px; background: none; color: var(--text-primary); font: inherit; font-size: 14px; font-weight: 600; text-align: left; cursor: pointer; }
.upload-menu-item:hover { background: var(--bg-subtle); }
.emp-cps-actions .upload-menu-list, .missing-doc-form .upload-menu-list { left: auto; right: 0; }

/* Kontakty objektu: telefon vždy viditelný, chybějící zvýrazněný */
.portal-contact-phone { display: inline-block; margin-top: 4px; color: var(--info); font-size: 13px; font-weight: 600; text-decoration: none; }
.portal-contact-missing { margin-top: 4px; font-size: 12px; font-weight: 600; color: var(--danger); }

/* Úprava údajů zaměstnance */
.employee-edit .card { margin-bottom: 16px; }
.employee-edit-title { font-size: 16px; margin: 0 0 12px; }
.employee-edit-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 0 14px; }
.employee-edit-buttons { display: flex; gap: 8px; flex-wrap: wrap; }

/* Jiná žádost: přílohy */
.request-files { margin-top: 14px; display: flex; flex-direction: column; gap: 6px; align-items: flex-start; }
.request-file { display: inline-flex; align-items: center; gap: 8px; padding: 6px 10px; border: 1px solid var(--border-color); border-radius: 6px; background: var(--bg-subtle); text-decoration: none; color: var(--text-primary); font-size: 13px; }
.request-file small { color: var(--text-muted); }

/* Kontaktní adresa: „stejná jako trvalá“ */
.contact-address { border: 1px solid var(--border-color); border-radius: 8px; padding: 12px 14px; background: var(--bg-subtle); }
.contact-same { display: inline-flex; align-items: center; gap: 8px; margin: 0; font-weight: 600; color: var(--text-primary); cursor: pointer; }
.contact-same input { width: 18px; height: 18px; }
.contact-address-fields { margin-top: 12px; }
.contact-address-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 0 14px; }
