/* ==========================================================================
   DOCHÁZKA - design (terminál = tmavý, administrace = aplikace se sidebarem)
   ========================================================================== */

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

/* atribut hidden musí vyhrát i nad display:flex u tříd */
[hidden] { display: none !important; }

:root {
    --ink: #0f172a;
    --ink-2: #334155;
    --muted: #64748b;
    --line: #e2e8f0;
    --bg: #f4f6fa;
    --card: #ffffff;
    --accent: #4f46e5;
    --accent-2: #6366f1;
    --c-prace: #059669;
    --c-vikend: #7c3aed;
    --c-dovolena: #0284c7;
    --c-nemoc: #dc2626;
    --c-svatek: #d97706;
    --chart-weekend: #eef1f7;
    --chart-weekend-dot: #cbd5e1;
    --shadow: 0 1px 2px rgba(15,23,42,.05), 0 4px 16px rgba(15,23,42,.06);
    --radius: 14px;
}

body {
    font-family: 'Segoe UI Variable Text', 'Segoe UI', 'Inter', system-ui, sans-serif;
    -webkit-tap-highlight-color: transparent;
    color: var(--ink);
}

/* ==========================================================================
   TERMINÁL
   ========================================================================== */

body.terminal {
    background: radial-gradient(1200px 600px at 70% -10%, #1e2b4a 0%, #0b1120 55%);
    color: #f1f5f9;
    height: 100vh;
    height: 100dvh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.term-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    padding: clamp(10px, 2vh, 22px) 28px clamp(2px, 1vh, 8px);
    flex-shrink: 0;
}

.term-clock { font-size: clamp(30px, 6vh, 52px); font-weight: 700; line-height: 1; letter-spacing: 1px; font-variant-numeric: tabular-nums; }
.term-date { font-size: clamp(13px, 2.4vh, 18px); color: #8ea0bd; margin-top: 2px; text-transform: capitalize; }

.term-admin-link {
    color: #8ea0bd;
    text-decoration: none;
    font-size: 15px;
    padding: 10px 18px;
    border: 1px solid rgba(148,163,184,.25);
    border-radius: 12px;
    background: rgba(255,255,255,.03);
    backdrop-filter: blur(4px);
}
.term-admin-link:hover { color: #e2e8f0; border-color: rgba(148,163,184,.5); }

.term-grid {
    flex: 1;
    min-height: 0;
    display: grid;
    grid-template-columns: repeat(var(--cols, 3), 1fr);
    grid-auto-rows: 1fr;
    gap: clamp(8px, 1.6vh, 18px);
    padding: clamp(8px, 1.6vh, 18px) 28px clamp(12px, 2vh, 22px);
    width: 100%;
}

.emp-card {
    background: linear-gradient(180deg, rgba(255,255,255,.06), rgba(255,255,255,.02));
    border: 1px solid rgba(148,163,184,.18);
    border-radius: clamp(12px, 2vh, 20px);
    padding: clamp(6px, 1.4vh, 18px) 10px;
    text-align: center;
    cursor: pointer;
    color: inherit;
    font-family: inherit;
    transition: transform .1s, border-color .2s, box-shadow .2s;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: clamp(2px, 0.7vh, 7px);
    min-height: 0;
    min-width: 0;
    overflow: hidden;
}
.emp-card:active { transform: scale(.97); }
.emp-card.in {
    border-color: var(--emp-color);
    box-shadow: 0 0 0 1px var(--emp-color), 0 0 34px color-mix(in srgb, var(--emp-color) 30%, transparent);
}

.emp-avatar {
    width: clamp(34px, 8.5vh, 70px);
    height: clamp(34px, 8.5vh, 70px);
    border-radius: 50%;
    background: var(--emp-color);
    color: #fff;
    font-size: clamp(16px, 4vh, 32px);
    font-weight: 700;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
    box-shadow: 0 6px 18px color-mix(in srgb, var(--emp-color) 45%, transparent);
}

.emp-name {
    font-size: clamp(14px, 2.8vh, 23px);
    font-weight: 600;
    max-width: 100%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.emp-status {
    color: #8ea0bd;
    font-size: clamp(11px, 1.9vh, 15px);
    font-variant-numeric: tabular-nums;
    max-width: 100%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.emp-card.in .emp-status { color: #4ade80; }
.dot {
    display: inline-block; width: 9px; height: 9px; border-radius: 50%;
    background: #4ade80; margin-right: 5px;
    animation: pulse 1.6s infinite;
}
@keyframes pulse { 50% { opacity: .3; } }

.emp-action {
    font-size: clamp(9px, 1.6vh, 13px);
    font-weight: 700;
    color: #38bdf8;
    text-transform: uppercase;
    letter-spacing: 1.5px;
}
.emp-card.in .emp-action { color: #fb923c; }

.term-error { color: #f87171; font-size: 20px; grid-column: 1/-1; text-align: center; }

/* dialog: teď / jiný čas */
.term-modal-bg {
    position: fixed; inset: 0;
    background: rgba(4,8,18,.7);
    backdrop-filter: blur(4px);
    display: flex; align-items: center; justify-content: center;
    z-index: 90;
    padding: 20px;
}
.term-modal {
    background: #16233d;
    border: 1px solid rgba(148,163,184,.25);
    border-radius: 22px;
    padding: 26px 26px 20px;
    width: 100%; max-width: 420px;
    box-shadow: 0 24px 80px rgba(0,0,0,.6);
    display: flex; flex-direction: column; gap: 16px;
}
.tm-head { display: flex; align-items: center; gap: 14px; }
.tm-avatar {
    width: 54px; height: 54px; border-radius: 50%;
    color: #fff; font-size: 25px; font-weight: 700;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
}
.tm-name { font-size: 23px; font-weight: 700; }
.tm-status { font-size: 14px; color: #8ea0bd; margin-top: 2px; }

.tm-primary {
    border: none;
    font: inherit; font-size: 21px; font-weight: 700;
    color: #fff;
    padding: 18px;
    border-radius: 14px;
    cursor: pointer;
}
.tm-primary.tm-in { background: linear-gradient(90deg, #059669, #10b981); box-shadow: 0 8px 24px rgba(16,185,129,.35); }
.tm-primary.tm-out { background: linear-gradient(90deg, #d97706, #f59e0b); box-shadow: 0 8px 24px rgba(245,158,11,.35); }
.tm-primary:active { transform: scale(.98); }

.tm-alt {
    border-top: 1px solid rgba(148,163,184,.18);
    padding-top: 14px;
}
.tm-alt-label { font-size: 13.5px; color: #8ea0bd; margin-bottom: 10px; }
.tm-alt-row { display: flex; gap: 10px; }
.tm-alt-row input[type=time] {
    flex: 1;
    font: inherit; font-size: 22px; font-weight: 600;
    color: #f1f5f9;
    background: rgba(255,255,255,.06);
    border: 1px solid rgba(148,163,184,.3);
    border-radius: 12px;
    padding: 10px 14px;
    color-scheme: dark;
}
.tm-alt-btn {
    border: 1px solid rgba(148,163,184,.35);
    background: rgba(255,255,255,.06);
    font: inherit; font-size: 16px; font-weight: 600;
    color: #e2e8f0;
    padding: 10px 22px;
    border-radius: 12px;
    cursor: pointer;
}
.tm-alt-btn:hover { border-color: #8ea0bd; }

.tm-cancel {
    border: none; background: none;
    font: inherit; font-size: 15px;
    color: #64748b;
    padding: 8px;
    cursor: pointer;
}
.tm-cancel:hover { color: #cbd5e1; }

.toast {
    position: fixed;
    left: 50%; bottom: 44px;
    transform: translateX(-50%);
    display: flex; align-items: center; gap: 14px;
    background: #16233d;
    border: 1px solid #4ade80;
    border-radius: 16px;
    padding: 18px 30px;
    font-size: 22px;
    box-shadow: 0 14px 44px rgba(0,0,0,.55);
    animation: slideup .25s;
    z-index: 100;
}
.toast.out { border-color: #fb923c; }
.toast.err { border-color: #f87171; }
.toast-icon { font-size: 30px; }
@keyframes slideup { from { transform: translate(-50%, 30px); opacity: 0; } }

/* ==========================================================================
   ADMINISTRACE - layout
   ========================================================================== */

body.admin { background: var(--bg); min-height: 100vh; }

.layout { display: flex; min-height: 100vh; }

.sidebar {
    width: 232px;
    flex-shrink: 0;
    background: linear-gradient(180deg, #101a33 0%, #0b1120 100%);
    color: #cbd5e1;
    display: flex;
    flex-direction: column;
    padding: 22px 14px;
    position: sticky;
    top: 0;
    height: 100vh;
}

.brand { display: flex; align-items: center; gap: 12px; padding: 0 10px 22px; }
.brand-icon {
    width: 42px; height: 42px;
    background: linear-gradient(135deg, var(--accent), #818cf8);
    border-radius: 12px;
    display: flex; align-items: center; justify-content: center;
    font-size: 21px;
}
.brand-name { font-size: 17px; font-weight: 700; color: #fff; }
.brand-sub { font-size: 12px; color: #64748b; }

.nav { display: flex; flex-direction: column; gap: 4px; flex: 1; }
.nav-item {
    display: flex; align-items: center; gap: 12px;
    border: none; background: none;
    font: inherit; font-size: 14.5px; font-weight: 500;
    color: #94a3b8;
    padding: 11px 12px;
    border-radius: 10px;
    cursor: pointer;
    text-align: left;
}
.nav-item svg { width: 19px; height: 19px; fill: currentColor; flex-shrink: 0; }
.nav-item:hover { color: #e2e8f0; background: rgba(255,255,255,.05); }
.nav-item.active {
    color: #fff;
    background: linear-gradient(90deg, var(--accent), var(--accent-2));
    box-shadow: 0 6px 16px rgba(79,70,229,.35);
}

.nav-terminal {
    display: flex; align-items: center; gap: 10px;
    color: #94a3b8; text-decoration: none;
    font-size: 14px;
    padding: 11px 12px;
    border: 1px solid rgba(148,163,184,.2);
    border-radius: 10px;
}
.nav-terminal svg { width: 18px; height: 18px; fill: currentColor; }
.nav-terminal:hover { color: #fff; border-color: rgba(148,163,184,.45); }

.content { flex: 1; min-width: 0; padding: 22px 28px 60px; }

.topbar {
    display: flex; align-items: center; justify-content: space-between;
    gap: 16px; flex-wrap: wrap;
    margin-bottom: 20px;
}
.topbar h1 { font-size: 24px; font-weight: 700; }
.topbar-tools { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }

.month-nav {
    display: flex; align-items: center; gap: 4px;
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 4px 6px;
    box-shadow: var(--shadow);
}
.month-label { font-size: 15px; font-weight: 600; min-width: 128px; text-align: center; }
.btn-today { margin-left: 4px; }

/* --- tlačítka a ovládací prvky -------------------------------------------- */

.icon-btn {
    border: none; background: none;
    font: inherit; font-size: 16px;
    color: var(--muted);
    width: 32px; height: 32px;
    border-radius: 8px;
    cursor: pointer;
}
.icon-btn:hover { background: var(--bg); color: var(--ink); }
.icon-btn.danger:hover { color: var(--c-nemoc); }

.btn-solid {
    display: inline-flex; align-items: center; gap: 8px;
    border: none;
    background: linear-gradient(90deg, var(--accent), var(--accent-2));
    color: #fff;
    font: inherit; font-size: 14px; font-weight: 600;
    text-decoration: none;
    padding: 10px 16px;
    border-radius: 10px;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(79,70,229,.3);
}
.btn-solid:hover { filter: brightness(1.07); }
.btn-solid svg { width: 16px; height: 16px; fill: currentColor; }

.btn-outline {
    border: 1px solid var(--line);
    background: var(--card);
    font: inherit; font-size: 14px; font-weight: 500;
    color: var(--ink);
    padding: 9px 14px;
    border-radius: 10px;
    cursor: pointer;
}
.btn-outline:hover { border-color: #b6c2d4; }
.btn-outline.danger { color: var(--c-nemoc); border-color: #fecaca; }
.btn-s { padding: 6px 12px; font-size: 13px; }

.select, .input {
    font: inherit; font-size: 14px;
    padding: 9px 12px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: var(--card);
    color: var(--ink);
}
.select:focus, .input:focus { outline: 2px solid color-mix(in srgb, var(--accent) 35%, transparent); border-color: var(--accent); }
.input[type=time], .input[type=date] { padding: 7px 10px; }
.w-s { width: 76px; }
.input-color { width: 42px; height: 40px; padding: 3px; border: 1px solid var(--line); border-radius: 10px; background: var(--card); cursor: pointer; }

.check { display: inline-flex; align-items: center; gap: 7px; font-size: 14px; color: var(--ink-2); cursor: pointer; }
.lbl { display: inline-flex; align-items: center; gap: 8px; font-size: 13.5px; color: var(--muted); }

.spacer { flex: 1; }
.muted { color: var(--muted); font-weight: 400; font-size: .92em; }
.text-danger { color: var(--c-nemoc); }
.mt { margin-top: 22px; }

/* --- karty ----------------------------------------------------------------- */

.card {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 20px 22px;
    margin-bottom: 20px;
}
.card h2 { font-size: 15px; font-weight: 700; margin-bottom: 14px; color: var(--ink-2); text-transform: uppercase; letter-spacing: .4px; }

.grid-2 { display: grid; grid-template-columns: 1.7fr 1fr; gap: 20px; }
@media (max-width: 1000px) { .grid-2 { grid-template-columns: 1fr; } }

/* --- KPI ------------------------------------------------------------------- */

.kpi-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
    gap: 14px;
    margin-bottom: 20px;
}
.kpi {
    display: flex; align-items: center; gap: 13px;
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 15px 17px;
}
.kpi-icon { font-size: 25px; }
.kpi-value { font-size: 19px; font-weight: 800; font-variant-numeric: tabular-nums; line-height: 1.2; }
.kpi-label { font-size: 12.5px; color: var(--muted); margin-top: 1px; }
.kpi.warn { border-color: #fbbf24; background: #fffbeb; }
.kpi.ok .kpi-value { color: var(--c-prace); }

/* --- graf ------------------------------------------------------------------ */

.chart-svg { width: 100%; height: 190px; display: block; }
.chart-x { font-size: 9px; fill: var(--muted); }
.chart-legend { display: flex; gap: 16px; margin-top: 10px; flex-wrap: wrap; }
.cl-item { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--ink-2); }
.cl-dot { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }

/* --- kdo je v práci / svátky ---------------------------------------------- */

.live-row { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid #f1f5f9; }
.live-row:last-child { border-bottom: none; }
.live-name { font-weight: 600; flex: 1; }
.live-today { font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }
.holiday-row { padding: 6px 0; font-size: 14px; color: var(--ink-2); }

.avatar {
    width: 32px; height: 32px;
    border-radius: 50%;
    color: #fff; font-weight: 700; font-size: 14px;
    display: inline-flex; align-items: center; justify-content: center;
    vertical-align: middle;
    flex-shrink: 0;
}
.avatar.sm { width: 26px; height: 26px; font-size: 12px; margin-right: 6px; }
.avatar.lg { width: 52px; height: 52px; font-size: 23px; }

/* --- pilulky / štítky ------------------------------------------------------ */

.pill {
    display: inline-block;
    font-size: 12px; font-weight: 600;
    padding: 3px 10px;
    border-radius: 20px;
    background: #eef1f7; color: var(--ink-2);
    white-space: nowrap;
}
.pill-ok { background: #dcfce7; color: #15803d; }
.pill-warn { background: #fef3c7; color: #b45309; }
.pill-wk { background: #f3e8ff; color: var(--c-vikend); font-size: 11px; margin-left: 6px; }
.pill-prace { background: #d1fae5; color: #047857; }
.manual-mark { color: var(--c-svatek); font-size: 12px; cursor: help; }
.pill-dovolena { background: #e0f2fe; color: #0369a1; }
.pill-nemoc { background: #fee2e2; color: #b91c1c; }
.pill-svatek { background: #fef3c7; color: #b45309; }

/* --- tabulky --------------------------------------------------------------- */

.table-wrap { overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.data-table th {
    text-align: left;
    font-size: 12px; font-weight: 700;
    color: var(--muted);
    text-transform: uppercase; letter-spacing: .4px;
    padding: 9px 10px;
    border-bottom: 1px solid var(--line);
    white-space: nowrap;
}
.data-table td { padding: 10px; border-bottom: 1px solid #f1f5f9; vertical-align: middle; }
.data-table tbody tr:hover { background: #f8fafc; }
.data-table th.num, .data-table td.num { text-align: right; font-variant-numeric: tabular-nums; }
.data-table .row-problem { background: #fffbeb; }
.data-table .row-sum td { background: #f8fafc; border-top: 1px solid var(--line); }
.data-table .row-wk td { background: #faf5ff33; }
.row-actions { text-align: right; white-space: nowrap; }
.table-foot { padding: 12px 10px 2px; color: var(--muted); font-size: 14px; }

.w-bar { min-width: 130px; }
.bar { background: #eef1f7; border-radius: 20px; height: 8px; overflow: hidden; margin-bottom: 4px; }
.bar-fill { height: 100%; background: linear-gradient(90deg, var(--accent), var(--accent-2)); border-radius: 20px; }
.bar-fill.full { background: linear-gradient(90deg, #059669, #34d399); }
.bar-fill.over { background: linear-gradient(90deg, #dc2626, #f87171); }

/* --- filtry ---------------------------------------------------------------- */

.filters {
    display: flex; align-items: center; gap: 14px;
    flex-wrap: wrap;
    margin-bottom: 16px;
}
.chip-group { display: flex; gap: 6px; background: #eef1f7; border-radius: 12px; padding: 4px; }
.chip {
    border: none; background: none;
    font: inherit; font-size: 13.5px; font-weight: 500;
    color: var(--muted);
    padding: 7px 14px;
    border-radius: 9px;
    cursor: pointer;
}
.chip:hover { color: var(--ink); }
.chip.active { background: var(--card); color: var(--ink); font-weight: 600; box-shadow: 0 1px 4px rgba(15,23,42,.12); }

.legend { display: flex; gap: 8px; flex-wrap: wrap; }
.lg { font-size: 12px; padding: 3px 11px; border-radius: 20px; color: #fff; }
.lg-prace { background: var(--c-prace); }
.lg-vikend { background: var(--c-vikend); }
.lg-dovolena { background: var(--c-dovolena); }
.lg-nemoc { background: var(--c-nemoc); }
.lg-svatek { background: var(--c-svatek); }
.lg-problem { background: #f59e0b; }

/* --- kalendář --------------------------------------------------------------- */

.calendar {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 7px;
}
.cal-head { text-align: center; font-weight: 700; color: var(--muted); font-size: 12px; text-transform: uppercase; padding: 4px; }
.cal-cell {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 11px;
    min-height: 78px;
    padding: 7px;
    cursor: pointer;
    display: flex; flex-direction: column; gap: 3px;
    overflow: hidden;
    transition: border-color .15s, box-shadow .15s;
}
.cal-cell:hover { border-color: var(--accent); box-shadow: 0 2px 10px rgba(79,70,229,.14); }
.cal-cell.empty { background: none; border: none; cursor: default; box-shadow: none; }
.cal-cell.weekend { background: #f8f9fc; }
.cal-cell.today { border: 2px solid var(--accent); }
.cal-num { font-size: 13px; font-weight: 700; color: var(--muted); }
.cal-cell.weekend .cal-num { color: var(--c-vikend); }

.badge {
    font-size: 11px; font-weight: 600;
    padding: 2.5px 8px;
    border-radius: 12px;
    color: #fff;
    white-space: nowrap;
    overflow: hidden; text-overflow: ellipsis;
    font-variant-numeric: tabular-nums;
}
.b-prace { background: var(--c-prace); }
.b-vikend { background: var(--c-vikend); }
.b-missing { background: #f59e0b; }
.b-dovolena { background: var(--c-dovolena); }
.b-nemoc { background: var(--c-nemoc); }
.b-svatek { background: var(--c-svatek); }
.b-holiday { background: #fde68a; color: #92400e; }

.hint { color: var(--muted); font-size: 13px; margin-top: 12px; }

/* --- modál ------------------------------------------------------------------ */

.modal-bg {
    position: fixed; inset: 0;
    background: rgba(11,17,32,.55);
    backdrop-filter: blur(3px);
    display: flex; align-items: center; justify-content: center;
    z-index: 50;
    padding: 20px;
}
.modal {
    background: var(--card);
    border-radius: 16px;
    padding: 24px 26px;
    width: 100%; max-width: 560px;
    max-height: 90vh; overflow-y: auto;
    box-shadow: 0 24px 80px rgba(11,17,32,.4);
}
.modal h2 { font-size: 18px; margin-bottom: 16px; }
.modal hr { border: none; border-top: 1px solid var(--line); margin: 18px 0; }
.modal-actions { margin-top: 18px; text-align: right; }
.modal-row { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; flex-wrap: wrap; }

.rec-row { display: flex; align-items: center; gap: 8px; padding: 8px 0; flex-wrap: wrap; }

/* --- reporty ----------------------------------------------------------------- */

.sheet-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 20px; flex-wrap: wrap; margin-bottom: 18px; }
.sheet-title { font-size: 21px; font-weight: 800; }
.sheet-total { text-align: right; }
.sheet-summary { max-width: 520px; margin-bottom: 8px; }
.sheet-h3 { font-size: 14px; font-weight: 700; color: var(--ink-2); text-transform: uppercase; letter-spacing: .4px; margin: 22px 0 10px; }
.sheet-sign { display: flex; gap: 40px; margin-top: 42px; flex-wrap: wrap; font-size: 13.5px; color: var(--ink-2); }
.sign-line { display: inline-block; width: 220px; border-bottom: 1px solid var(--ink-2); margin-left: 10px; }

@media print {
    body.admin { background: #fff; }
    .sidebar, .topbar, .no-print, .modal-bg { display: none !important; }
    .content { padding: 0; }
    .card { border: none; box-shadow: none; padding: 0; }
    .print-area { display: block !important; }
}

/* --- zaměstnanci -------------------------------------------------------------- */

.emp-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 20px; margin-bottom: 20px; }
.emp-card-adm.inactive { opacity: .55; }
.emp-card-head { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.emp-card-head .e-name { flex: 1; font-weight: 600; }
.emp-card-body { display: flex; flex-direction: column; gap: 12px; margin-bottom: 16px; }
.emp-add { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }

/* --- mobil --------------------------------------------------------------------- */

@media (max-width: 860px) {
    .layout { flex-direction: column; }
    .sidebar { width: 100%; height: auto; position: static; flex-direction: row; align-items: center; padding: 10px 12px; gap: 8px; overflow-x: auto; }
    .brand { padding: 0 8px; }
    .brand-sub, .nav-item span { display: none; }
    .nav { flex-direction: row; }
    .nav-item { padding: 9px 10px; font-size: 13px; }
    .nav-terminal { margin-left: auto; }
    .content { padding: 16px 14px 50px; }
    .cal-cell { min-height: 58px; }
    .badge { font-size: 9px; padding: 1px 5px; }
    .term-header, .term-grid { padding-left: 14px; padding-right: 14px; }
}

/* --- odhlášení v postranním menu ------------------------------------------------ */

.nav-logout {
    width: 100%;
    background: none;
    font: inherit;
    font-size: 14px;
    cursor: pointer;
    margin-top: 8px;
}
@media (max-width: 860px) {
    .nav-logout { width: auto; margin-top: 0; margin-left: 0; }
}

/* ==========================================================================
   PŘIHLÁŠENÍ
   ========================================================================== */

body.login {
    background: radial-gradient(1200px 600px at 70% -10%, #1e2b4a 0%, #0b1120 55%);
    color: #f1f5f9;
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.login-box {
    width: 100%;
    max-width: 380px;
    background: rgba(255,255,255,.05);
    border: 1px solid rgba(148,163,184,.22);
    border-radius: 18px;
    padding: 32px 28px 26px;
    text-align: center;
    box-shadow: 0 20px 60px rgba(0,0,0,.35);
}

.login-icon {
    width: 54px; height: 54px;
    margin: 0 auto 14px;
    display: grid; place-items: center;
    font-size: 26px;
    border-radius: 15px;
    background: linear-gradient(140deg, var(--accent), var(--accent-2));
}

.login-box h1 { font-size: 24px; font-weight: 700; letter-spacing: .3px; }
.login-sub { color: #8ea0bd; font-size: 14px; margin-top: 2px; }

.login-label {
    display: block;
    text-align: left;
    margin: 26px 0 6px;
    font-size: 13px;
    color: #8ea0bd;
}

.login-input {
    width: 100%;
    padding: 13px 14px;
    font-size: 17px;
    color: #f1f5f9;
    background: rgba(15,23,42,.55);
    border: 1px solid rgba(148,163,184,.3);
    border-radius: 11px;
    outline: none;
}
.login-input:focus { border-color: var(--accent-2); box-shadow: 0 0 0 3px rgba(99,102,241,.25); }

.login-btn {
    width: 100%;
    margin-top: 14px;
    padding: 13px 14px;
    font-size: 16px; font-weight: 600;
    color: #fff;
    background: linear-gradient(140deg, var(--accent), var(--accent-2));
    border: 0; border-radius: 11px;
    cursor: pointer;
}
.login-btn:hover { filter: brightness(1.08); }
.login-btn:disabled { opacity: .6; cursor: default; }

.login-err {
    margin-top: 14px;
    padding: 10px 12px;
    font-size: 14px;
    color: #fecaca;
    background: rgba(220,38,38,.16);
    border: 1px solid rgba(248,113,113,.35);
    border-radius: 10px;
}

.login-hint {
    margin-top: 22px;
    font-size: 12.5px;
    line-height: 1.55;
    color: #7d8ca8;
}
