/* ============================================================
   Square Inch London - Housekeeping module
   Visual language: One Desk Assist (gold edition), per build.py.
   Author: Kamil Nagorski, ErynVorn Technologies
   ============================================================ */

:root {
    /* navy + gold, gold edition: keep in sync with demo/build.py */
    --ink-navy: #0f1c2e;
    --navy: #16283f;
    --navy-soft: #1d3450;
    --gold: #c8a55b;
    --gold-bright: #e3c98a;
    --gold-deep: #8c6d2f;
    --gold-rgb: 200, 165, 91;
    --paper: #f7f6f2;
    --white: #fff;
    --line: #e2ddd0;
    --line-soft: #ece8de;
    --text: #232323;
    --muted: #6f7480;
    --ok: #2f6b46;
    --danger: #a4302a;
    --amber: #a8791f;
    --radius: 10px;
    --shadow: 0 14px 34px rgba(15, 28, 46, 0.16);
    --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, Helvetica, Arial, sans-serif;
    --serif: Georgia, "Times New Roman", serif;
}

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

html {
    scrollbar-gutter: stable;
    overflow-x: hidden;
    background: var(--paper);
}

body {
    min-height: 100vh;
    font-family: var(--sans);
    color: var(--text);
    background: var(--paper);
    font-size: 14px;
    line-height: 1.45;
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3, .serif {
    font-family: var(--serif);
    font-weight: 600;
    letter-spacing: 0.01em;
}

button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: none; }
a { color: var(--gold-deep); text-decoration: none; }
::selection { background: rgba(var(--gold-rgb), 0.3); }

/* ---------- Brand bits ---------- */

.wordmark { display: flex; align-items: center; gap: 12px; justify-content: center; }
.wordmark img { height: auto; width: 100%; max-width: 168px; max-height: 44px; object-fit: contain; display: block; }
.brand-eyebrow {
    font-size: 10px; letter-spacing: 0.34em; text-transform: uppercase;
    color: rgba(200, 165, 91, 0.85);
}

/* ---------- Login ---------- */

.login-screen { display: grid; grid-template-columns: 1.05fr 0.95fr; min-height: 100vh; }
.login-aside {
    position: relative; padding: 56px 60px; display: flex; flex-direction: column;
    justify-content: space-between;
    background: linear-gradient(168deg, #0c1726 0%, #16283f 62%, #1b3149 100%);
    border-right: 1px solid rgba(var(--gold-rgb), 0.22);
    overflow: hidden;
}
.login-aside::after {
    content: ''; position: absolute; inset: 0;
    background: radial-gradient(620px 440px at 82% 18%, rgba(var(--gold-rgb), 0.16), transparent 66%);
    pointer-events: none;
}
.login-aside .wordmark { justify-content: flex-start; }
.login-aside .wordmark img { width: 208px; max-width: none; max-height: none; }
.login-aside__body { position: relative; z-index: 1; max-width: 460px; }
.login-aside__body h1 { font-size: 40px; line-height: 1.14; margin-bottom: 18px; color: #f6f1e3; }
.login-aside__body p { color: rgba(215, 221, 230, 0.78); font-size: 15px; max-width: 390px; }
.login-aside__meta {
    position: relative; z-index: 1; display: flex; gap: 28px; color: rgba(215, 221, 230, 0.5);
    font-size: 11px; letter-spacing: 0.16em; text-transform: uppercase;
}
.login-aside__meta span { display: flex; align-items: center; gap: 8px; }
.login-aside__meta i { width: 5px; height: 5px; border-radius: 50%; background: var(--gold); display: block; }

.login-panel { display: flex; align-items: center; justify-content: center; padding: 40px 32px; background: var(--paper); }
.login-card { width: 100%; max-width: 380px; }
.login-card h2 { font-size: 26px; margin-bottom: 6px; }
.login-card .hint { color: var(--muted); font-size: 13px; margin-bottom: 26px; }
.login-card .field { margin-bottom: 16px; }
.login-card .btn { width: 100%; justify-content: center; margin-top: 8px; padding: 11px 16px; }
.login-error {
    display: none; margin-top: 16px; padding: 10px 12px; border-radius: 8px;
    border: 1px solid rgba(164, 48, 42, 0.3); background: #fbf1ee;
    color: var(--danger); font-size: 12.5px;
}
.login-error.show { display: block; }
.demo-box {
    margin-top: 30px; padding: 14px 16px; border: 1px dashed var(--line);
    border-radius: 8px; font-size: 11.5px; color: var(--muted); background: #fbfaf5;
}
.demo-box strong { color: var(--gold-deep); font-weight: 700; display: block; margin-bottom: 6px; letter-spacing: 0.1em; text-transform: uppercase; font-size: 10px; }
.demo-box code { color: var(--text); font-family: Consolas, monospace; font-size: 11.5px; }

/* ---------- Shell ---------- */

.app { display: none; grid-template-columns: 246px minmax(0, 1fr); min-height: 100vh; }
.app.ready { display: grid; }

.sidebar {
    position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column;
    padding: 16px 13px 12px;
    background: linear-gradient(168deg, #0c1726 0%, #16283f 62%, #1b3149 100%);
    border-right: 1px solid rgba(var(--gold-rgb), 0.22);
    color: #d7dde6;
    overflow-y: auto;
    scrollbar-width: none;
}
.sidebar::-webkit-scrollbar { width: 0; height: 0; }
.sidebar .wordmark {
    padding: 2px 8px 12px; border-bottom: 1px solid rgba(var(--gold-rgb), 0.30); margin-bottom: 4px;
}
.sidebar .wordmark img { width: 132px; max-width: none; max-height: none; }
.sidebar__section {
    font-size: 9.5px; letter-spacing: 0.22em; text-transform: uppercase;
    color: var(--gold); padding: 14px 11px 7px; font-weight: 600;
}
.nav { display: flex; flex-direction: column; gap: 3px; }
.nav__item {
    display: flex; align-items: center; gap: 11px; padding: 8px 11px; border-radius: 8px;
    color: #cfd7e2; font-size: 13px; text-align: left; width: 100%;
    border: 1px solid transparent; transition: background .15s ease, color .15s ease, border-color .15s ease;
}
.nav__item svg { width: 15px; height: 15px; stroke-width: 1.6; opacity: .8; flex: none; color: var(--gold); }
.nav__item:hover { background: rgba(var(--gold-rgb), 0.07); border-color: rgba(var(--gold-rgb), 0.18); }
.nav__item:focus { outline: none; }
.nav__item:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
.nav__item.active {
    background: rgba(var(--gold-rgb), 0.12); border-color: rgba(var(--gold-rgb), 0.38);
    color: #fff; box-shadow: inset 2px 0 0 var(--gold);
}
.nav__item.active svg { opacity: 1; color: var(--gold-bright); }
.nav__item .count {
    margin-left: auto; font-size: 11px; padding: 1px 7px; border-radius: 20px;
    background: rgba(255, 255, 255, 0.10); color: #e8edf3; border: 1px solid rgba(255, 255, 255, 0.08);
}
.nav__item.active .count { background: var(--gold); color: #12233a; font-weight: 700; border-color: var(--gold); }

.sidebar__foot { margin-top: auto; padding-top: 13px; border-top: 1px solid rgba(var(--gold-rgb), 0.18); }
.user-card { display: flex; align-items: center; gap: 11px; padding: 8px 9px; border-radius: 8px; }
.user-card:hover { background: rgba(255, 255, 255, 0.06); }
.avatar {
    width: 27px; height: 27px; border-radius: 50%; display: grid; place-items: center; flex: none;
    background: var(--navy-soft); color: #fff; font-weight: 700; font-size: 10px; letter-spacing: 0.04em;
    box-shadow: 0 0 0 1px rgba(var(--gold-rgb), 0.55);
}
.user-card__meta { min-width: 0; }
.user-card__meta strong { display: block; font-size: 12.5px; font-weight: 600; color: #f2f4f7; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-card__meta span { display: block; font-size: 10px; color: #8b97a6; letter-spacing: 0.08em; text-transform: uppercase; }
.sidebar__actions { display: flex; gap: 6px; margin-top: 8px; }
.sidebar__actions .btn { flex: 1; justify-content: center; padding: 7px; font-size: 11px; }
.sidebar__actions .btn--plain { color: #cfd7e2; border-color: rgba(255, 255, 255, 0.14); background: transparent; }
.sidebar__actions .btn--plain:hover { color: #fff; background: rgba(255, 255, 255, 0.07); border-color: rgba(var(--gold-rgb), 0.3); }

.main { min-width: 0; padding: 0 0 56px; background: var(--paper); }
.view { padding: 2px 22px 0; }
.topbar {
    display: flex; align-items: center; justify-content: space-between; gap: 20px;
    padding: 13px 22px; margin-bottom: 18px; flex-wrap: wrap;
    background: var(--white); border-bottom: 1px solid var(--line);
    box-shadow: 0 1px 0 rgba(var(--gold-rgb), 0.35);
    position: sticky; top: 0; z-index: 20;
}
.topbar__title h1 { font-size: 17px; line-height: 1.3; letter-spacing: 0.02em; }
.topbar__title p { color: var(--muted); font-size: 11.5px; margin-top: 1px; }
.topbar__tools { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

/* ---------- Buttons, fields ---------- */

.btn {
    display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px; border-radius: 7px;
    font-size: 12px; font-weight: 600; letter-spacing: 0.02em; border: 1px solid var(--line);
    background: var(--white); color: var(--gold-deep); white-space: nowrap;
    transition: background .15s ease, border-color .15s ease, box-shadow .2s ease;
}
.btn svg { width: 15px; height: 15px; stroke-width: 1.8; }
.btn:hover { border-color: var(--gold); background: #fdfaf1; }
.btn--primary {
    background: linear-gradient(180deg, #d4b070, #c1974a); color: #10202f;
    border-color: #b78d43; box-shadow: 0 1px 0 rgba(255, 255, 255, 0.35) inset;
}
.btn--primary:hover { background: linear-gradient(180deg, #e3c98a, #cfae64); border-color: var(--gold); }
.btn--ghost { background: transparent; border-color: rgba(var(--gold-rgb), 0.45); color: var(--gold-deep); }
.btn--ghost:hover { background: #fdfaf1; border-color: var(--gold); }
.btn--plain { background: transparent; border-color: var(--line); color: var(--gold-deep); }
.btn--plain:hover { background: #fdfaf1; border-color: var(--gold); color: var(--gold-deep); }
.btn--danger { color: var(--danger); border-color: #eed6d1; background: #fbf1ee; }
.btn--danger:hover { background: #f7e6e2; border-color: #e0bdb7; }
.btn--icon { padding: 6px 9px; border-radius: 7px; }
.btn[disabled] { opacity: 0.45; pointer-events: none; }
.btn--sm { padding: 4px 9px; font-size: 11px; }

.field { display: flex; flex-direction: column; gap: 5px; }
.field > label {
    font-size: 9.5px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--gold-deep); font-weight: 700;
}
.field .help { font-size: 11px; color: var(--muted); }
input[type="text"], input[type="email"], input[type="password"], input[type="number"],
input[type="date"], input[type="search"], select, textarea {
    width: 100%; padding: 9px 11px; border-radius: 7px; background: #fdfcf8;
    border: 1px solid var(--line); color: var(--text); font-size: 13px;
    transition: border-color .18s ease, background .18s ease, box-shadow .18s ease;
}
input::placeholder, textarea::placeholder { color: #a7abb2; }
input:focus, select:focus, textarea:focus {
    outline: none; border-color: var(--gold); background: var(--white);
    box-shadow: 0 0 0 3px rgba(var(--gold-rgb), 0.14);
}
select {
    appearance: none;
    background-image: linear-gradient(45deg, transparent 50%, var(--gold-deep) 50%), linear-gradient(135deg, var(--gold-deep) 50%, transparent 50%);
    background-position: calc(100% - 17px) 50%, calc(100% - 12px) 50%;
    background-size: 5px 5px, 5px 5px; background-repeat: no-repeat; padding-right: 32px;
}
select option { background: var(--white); color: var(--text); }
textarea { resize: vertical; min-height: 70px; }
input[type="date"]::-webkit-calendar-picker-indicator { filter: sepia(0.5) saturate(1.6) hue-rotate(2deg); opacity: .75; }

.form-row { display: grid; gap: 14px; grid-template-columns: 1fr 1fr; }
.form-row--three { grid-template-columns: repeat(3, 1fr); }
.form-stack { display: flex; flex-direction: column; gap: 16px; }

/* ---------- Cards, KPIs ---------- */

.card {
    background: var(--white); border: 1px solid var(--line); border-radius: var(--radius);
    padding: 18px 20px; box-shadow: 0 1px 2px rgba(15, 28, 46, 0.04);
}
.card--flush { padding: 0; overflow: hidden; }
.card__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.card__head h2 { font-size: 13.5px; letter-spacing: 0.03em; color: var(--text); }
.card__head .sub { font-size: 11px; color: var(--muted); letter-spacing: 0.02em; }

.kpi-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 18px; }
.kpi {
    position: relative; overflow: hidden; padding: 16px 18px 14px; border-radius: var(--radius);
    border: 1px solid var(--line); background: linear-gradient(180deg, #fff, #fdfcf8);
    box-shadow: 0 1px 2px rgba(15, 28, 46, 0.04);
}
.kpi::after {
    content: ''; position: absolute; top: -42px; right: -32px; width: 120px; height: 120px;
    background: radial-gradient(circle, rgba(var(--gold-rgb), 0.16), transparent 66%);
}
.kpi__label { font-size: 9.5px; letter-spacing: 0.18em; text-transform: uppercase; color: var(--gold-deep); display: flex; align-items: center; gap: 8px; font-weight: 700; }
.kpi__value { font-family: var(--serif); font-size: 27px; line-height: 1.15; margin-top: 9px; color: var(--ink-navy); font-variant-numeric: tabular-nums; }
.kpi__value small { font-family: var(--sans); font-size: 12px; color: var(--muted); letter-spacing: 0.04em; }
.kpi__foot { font-size: 11.5px; color: var(--muted); margin-top: 5px; }
.kpi--accent .kpi__value { color: var(--gold-deep); }

.dash-grid { display: grid; grid-template-columns: minmax(0, 1.85fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.dash-col { display: flex; flex-direction: column; gap: 16px; }

/* ---------- Tables ---------- */

.table-wrap { overflow-x: auto; }
table.grid { width: 100%; border-collapse: collapse; font-size: 12.5px; }
table.grid thead th {
    position: sticky; top: 0; z-index: 2; text-align: left; padding: 10px 13px;
    font-size: 9.5px; letter-spacing: 0.13em; text-transform: uppercase; color: var(--gold-deep);
    font-weight: 700; background: #fbfaf5; border-bottom: 1px solid var(--line); white-space: nowrap;
}
table.grid tbody td { padding: 11px 13px; border-bottom: 1px solid var(--line-soft); vertical-align: middle; }
table.grid tbody tr:hover { background: #fcfbf6; }
table.grid tbody tr:last-child td { border-bottom: none; }
table.grid td.num, table.grid th.num { text-align: right; font-variant-numeric: tabular-nums; }
table.grid tfoot td {
    padding: 11px 13px; border-top: 1px solid var(--line); color: var(--ink-navy);
    font-weight: 700; font-size: 12px; background: #fdfcf8;
}
.cell-person { display: flex; align-items: center; gap: 10px; }
.cell-person strong { font-weight: 600; display: block; }
.cell-person span { color: var(--muted); font-size: 10.5px; letter-spacing: 0.06em; text-transform: uppercase; }
.avatar--sm { width: 28px; height: 28px; font-size: 10.5px; }

.pill {
    display: inline-flex; align-items: center; gap: 6px; padding: 3px 9px; border-radius: 30px;
    font-size: 10px; font-weight: 700; letter-spacing: 0.04em; border: 1px solid transparent; white-space: nowrap;
}
.pill::before { content: ''; width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.pill--active { color: var(--ok); background: #eef5ee; border-color: #d9e6da; }
.pill--suspended { color: var(--danger); background: #fbf1ee; border-color: #eed6d1; }
.pill--on_leave { color: var(--amber); background: #fbf6e9; border-color: #eee0c2; }
.pill--sent { color: var(--ok); background: #eef5ee; border-color: #d9e6da; }
.pill--saved { color: var(--amber); background: #fbf6e9; border-color: #eee0c2; }
.pill--failed { color: var(--danger); background: #fbf1ee; border-color: #eed6d1; }
.pill--muted { color: var(--muted); background: #fbfaf5; border-color: var(--line); }

/* ---------- Timesheet ---------- */

.timesheet { border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: var(--white); box-shadow: 0 1px 2px rgba(15, 28, 46, 0.04); }
.timesheet table { width: 100%; border-collapse: separate; border-spacing: 0; }
.timesheet thead th {
    position: sticky; top: 0; z-index: 3; padding: 11px 10px; background: #fbfaf5;
    border-bottom: 1px solid var(--line); text-align: left;
}
.timesheet thead th.employee-col { position: sticky; left: 0; z-index: 4; min-width: 196px; background: #fbfaf5; }
.timesheet thead th .day-name { font-size: 9.5px; letter-spacing: 0.13em; text-transform: uppercase; color: var(--gold-deep); font-weight: 700; }
.timesheet thead th .day-date { font-family: var(--serif); font-size: 15px; display: block; margin-top: 2px; color: var(--ink-navy); }
.timesheet thead th.weekend { background: #f5f2e8; }
.timesheet thead th.today { box-shadow: inset 0 -2px 0 var(--gold); }
.timesheet thead th.today .day-date { color: var(--gold-deep); }
.timesheet thead th.total-col { text-align: right; min-width: 74px; }
.timesheet tbody td { border-bottom: 1px solid var(--line-soft); padding: 0; vertical-align: top; }
.timesheet tbody tr:last-child td { border-bottom: none; }
.timesheet td.employee-col {
    position: sticky; left: 0; z-index: 2; background: var(--white);
    padding: 12px; min-width: 196px; border-right: 1px solid var(--line-soft);
}
.timesheet td.total-col { background: #fdfaf1; padding: 12px 10px; text-align: right; min-width: 74px; }
.timesheet td.total-col .hours { font-family: var(--serif); font-size: 16px; color: var(--ink-navy); white-space: nowrap; }
.timesheet td.total-col small { display: block; color: var(--muted); font-size: 10.5px; }
.timesheet tr.is-suspended td { opacity: 0.55; }

.day-cell {
    padding: 8px 7px 9px; min-height: 82px; min-width: 84px; cursor: pointer;
    display: flex; flex-direction: column; gap: 5px; transition: background .16s ease;
}
.day-cell:hover { background: #fdfaf1; }
.day-cell.is-weekend { background: #f9f7f1; }
.day-cell.is-off { background: #fbfaf5; }
.day-cell__hours { font-size: 12.5px; font-weight: 700; color: var(--ink-navy); letter-spacing: 0.02em; }
.day-cell__hours.none { color: #b3b7bd; font-weight: 400; }
.chip {
    display: block; padding: 3px 6px; border-radius: 5px; background: #fbf8ef;
    border-left: 2px solid rgba(var(--gold-rgb), 0.75); font-size: 10px; line-height: 1.3;
    color: var(--muted); overflow: hidden; text-overflow: ellipsis;
}
.chip b { color: var(--text); font-weight: 500; display: block; overflow-wrap: anywhere; }
.chip.warn { border-left-color: var(--amber); background: #fbf6e9; }
.travel-tag { font-size: 10px; letter-spacing: 0.05em; color: var(--gold-deep); text-transform: uppercase; }
.travel-row {
    margin-top: 14px; padding: 10px 12px; border-radius: 8px; font-size: 12px; line-height: 1.5;
    border: 1px dashed var(--line); background: #fbfaf5; color: var(--muted);
}
.travel-row b { color: var(--ink-navy); font-weight: 600; }
.flag-tag { font-size: 10px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); }
.warn-dot { color: var(--amber); font-size: 10px; }

.week-nav { display: flex; align-items: center; gap: 8px; }
.week-nav__label { min-width: 176px; text-align: center; font-size: 12.5px; letter-spacing: 0.04em; }
.week-nav__label strong { display: block; font-family: var(--serif); font-size: 14px; color: var(--ink-navy); }
.week-nav__label span { color: var(--muted); font-size: 10.5px; }
.legend { display: flex; gap: 20px; flex-wrap: wrap; font-size: 11px; color: var(--muted); margin-top: 14px; }
.legend b { color: var(--text); font-weight: 600; }

.filter-bar { display: flex; align-items: flex-end; gap: 12px; flex-wrap: wrap; margin-bottom: 18px; }
.filter-bar .field { min-width: 150px; }
.filter-bar .spacer { flex: 1; }

/* ---------- Site cards ---------- */

.site-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; }
.site-card { display: flex; flex-direction: column; gap: 10px; position: relative; }
.site-card h3 { font-size: 15px; color: var(--ink-navy); }
.site-card p { color: var(--muted); font-size: 12.5px; }
.site-card__foot { display: flex; align-items: center; justify-content: space-between; margin-top: auto; padding-top: 12px; border-top: 1px solid var(--line-soft); }
.site-card .postcode { font-family: Consolas, monospace; font-size: 11.5px; color: var(--gold-deep); letter-spacing: 0.06em; }
.site-card__hours { font-size: 11.5px; color: var(--muted); }
.site-card > .btn { align-self: flex-start; }

/* ---------- Activity & lists ---------- */

.list { display: flex; flex-direction: column; }
.list__row { display: flex; align-items: center; gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--line-soft); }
.list__row:last-child { border-bottom: none; }
.list__row .grow { flex: 1; min-width: 0; }
.list__row strong { font-weight: 600; font-size: 12.5px; display: block; }
.list__row span { color: var(--muted); font-size: 11px; display: block; }
.status-dot { width: 7px; height: 7px; border-radius: 50%; background: #c9c4b6; flex: none; }
.status-dot.on { background: #79b58f; box-shadow: 0 0 0 3px rgba(121, 181, 143, 0.16); }
.time-tag { font-family: Consolas, monospace; font-size: 11px; color: var(--muted); letter-spacing: 0.03em; }
.feed { display: flex; flex-direction: column; gap: 10px; max-height: 260px; overflow-y: auto; padding-right: 4px; }
.feed__item { display: flex; gap: 10px; font-size: 11.5px; color: var(--muted); }
.feed__item time { color: #a7abb2; white-space: nowrap; font-family: Consolas, monospace; font-size: 10.5px; padding-top: 1px; }
.feed__body { flex: 1; min-width: 0; }
.feed__body b { color: var(--text); font-weight: 600; }
.feed__action { display: block; font-size: 10px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--gold-deep); margin-top: 2px; }
.feed__detail { display: block; font-size: 11px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.bar-row { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; font-size: 12px; }
.bar-row__label { width: 128px; color: var(--text); flex: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar-track { flex: 1; height: 7px; border-radius: 20px; background: #eae6da; overflow: hidden; }
.bar-fill { display: block; height: 100%; border-radius: 20px; background: linear-gradient(90deg, #b78d43, #dcc281); }
.bar-row__value { width: 62px; text-align: right; color: var(--gold-deep); font-weight: 600; font-variant-numeric: tabular-nums; }

.empty { padding: 28px 16px; text-align: center; color: var(--muted); font-size: 12.5px; }

/* ---------- Modal ---------- */

.modal-backdrop {
    position: fixed; inset: 0; z-index: 60; display: none; align-items: flex-start; justify-content: center;
    padding: 40px 20px; background: rgba(15, 28, 46, 0.42); backdrop-filter: blur(4px); overflow-y: auto;
}
.modal-backdrop.open { display: flex; }
.modal {
    width: 100%; max-width: 640px; background: var(--white);
    border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 18px 44px rgba(15, 28, 46, 0.22);
    animation: modal-in .22s ease both;
}
.modal--wide { max-width: 760px; }
@keyframes modal-in { from { opacity: 0; transform: translateY(14px) scale(0.99); } to { opacity: 1; transform: none; } }
.modal__head {
    display: flex; align-items: flex-start; justify-content: space-between; gap: 16px;
    padding: 18px 22px 14px; border-bottom: 1px solid var(--line-soft);
    background: linear-gradient(180deg, #fff, #fdfcf8); border-radius: var(--radius) var(--radius) 0 0;
}
.modal__head h2 { font-size: 18px; color: var(--ink-navy); }
.modal__head p { color: var(--muted); font-size: 11.5px; margin-top: 3px; letter-spacing: 0.02em; }
.modal__body { padding: 20px 22px; }
.modal__foot { display: flex; align-items: center; gap: 10px; padding: 14px 22px 18px; border-top: 1px solid var(--line-soft); background: #fdfcf8; border-radius: 0 0 var(--radius) var(--radius); }
.modal__foot .spacer { flex: 1; }
.modal-close { color: #a7abb2; padding: 6px; border-radius: 6px; line-height: 1; font-size: 20px; }
.modal-close:hover { color: var(--text); background: #f5f3ec; }

.slot-box { border: 1px solid var(--line); border-radius: 8px; padding: 14px; background: #fdfcf8; }
.slot-box + .slot-box { margin-top: 12px; }
.slot-box__head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.slot-box__title { font-size: 9.5px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--gold-deep); font-weight: 700; }
.slot-box__hours { font-size: 11.5px; color: var(--muted); }
.slot-grid { display: grid; grid-template-columns: 1.5fr 0.85fr 0.85fr 36px; gap: 10px; align-items: end; }
.slot-remove { color: #a7abb2; padding: 8px; border-radius: 6px; }
.slot-remove svg { width: 16px; height: 16px; display: block; }
.slot-remove:hover { color: var(--danger); background: #fbf1ee; }
.day-status-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--line-soft); }
.day-status-row .label { font-size: 9.5px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--gold-deep); margin-right: 4px; font-weight: 700; }
.warn-box {
    display: none; margin-top: 14px; padding: 10px 12px; border-radius: 8px; font-size: 12px;
    background: #fbf6e9; border: 1px solid #eee0c2; color: #7d5a13;
}
.warn-box.show { display: block; }

/* ---------- Toasts ---------- */

.toast-stack { position: fixed; right: 22px; bottom: 22px; z-index: 90; display: flex; flex-direction: column; gap: 8px; }
.toast {
    min-width: 260px; max-width: 380px; padding: 11px 16px; border-radius: 9px; font-size: 12.5px;
    background: var(--ink-navy); color: #f6f1e3; border: 1px solid rgba(var(--gold-rgb), 0.45);
    box-shadow: 0 12px 26px rgba(15, 28, 46, 0.28); animation: toast-in .25s ease both;
}
.toast.error { border-color: rgba(164, 48, 42, 0.55); background: #3a1a17; color: #f5d9d5; }
@keyframes toast-in { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

/* ---------- Utilities ---------- */

.hidden { display: none !important; }
.muted { color: var(--muted); }
.gold { color: var(--gold-deep); }
.mono { font-family: Consolas, monospace; font-size: 11.5px; }
.row { display: flex; align-items: center; gap: 10px; }
.right { margin-left: auto; }
.divider { height: 1px; background: var(--line-soft); margin: 18px 0; }
.checkbox { display: inline-flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--text); }
.checkbox input { width: auto; accent-color: var(--gold-deep); }
.field > label.checkbox {
    display: inline-flex; margin: 0; font-size: 12px; letter-spacing: 0; text-transform: none;
    color: var(--text); font-weight: 400;
}

/* ---------- Responsive ---------- */

@media (max-width: 1240px) {
    .kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .dash-grid { grid-template-columns: 1fr; }
}

@media (max-width: 980px) {
    .app { grid-template-columns: 1fr; }
    .sidebar {
        position: static; height: auto; flex-direction: row; align-items: center; flex-wrap: wrap;
        gap: 10px; padding: 12px 14px;
    }
    .sidebar .wordmark { border: 0; padding: 0; margin: 0; }
    .sidebar .wordmark img { width: auto; height: 26px; max-width: 150px; }
    .sidebar__section, .sidebar__foot .user-card__meta { display: none; }
    .nav { flex-direction: row; overflow-x: auto; width: 100%; padding-bottom: 2px; }
    .nav__item { white-space: nowrap; }
    .nav__item.active { box-shadow: inset 0 -2px 0 var(--gold); }
    .sidebar__foot { margin: 0; padding: 0; border: 0; display: flex; align-items: center; gap: 8px; }
    .sidebar__actions { margin: 0; }
    .main { padding-bottom: 40px; }
    .topbar { padding: 12px 16px; position: static; }
    .login-screen { grid-template-columns: 1fr; }
    .login-aside { display: none; }
    .slot-grid { grid-template-columns: 1fr 1fr; }
    .slot-grid .slot-remove { grid-column: 1 / -1; justify-self: end; }
}

@media (max-width: 620px) {
    .kpi-grid { grid-template-columns: 1fr; }
    .form-row, .form-row--three { grid-template-columns: 1fr; }
    .topbar__title h1 { font-size: 15px; }
    .timesheet thead th.employee-col, .timesheet td.employee-col { min-width: 160px; }
}
