/* ============================================================
   BUSINESS PRESTIGE - Staff & Site Dashboard
   Deep bottle green + gold, matching the company identity.
   ============================================================ */

@font-face {
    font-family: 'Exo 2';
    src: url('fonts/Exo2-VariableFont_wght.ttf') format('truetype');
    font-weight: 100 900;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Mansion';
    src: url('fonts/MANSION.ttf') format('truetype');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

:root {
    --green: #1a3c34;
    --green-rgb: 26, 60, 52;
    --green-deep: #0d1f1a;
    --green-deep-rgb: 13, 31, 26;
    --surface: #122a23;
    --surface-2: #16332b;
    --gold: #C9A84C;
    --gold-soft: #e0c884;
    --gold-muted: #b5984b;
    --gold-rgb: 201, 168, 76;
    --text: #f4f1e8;
    --text-soft: rgba(244, 241, 232, 0.66);
    --text-faint: rgba(244, 241, 232, 0.42);
    --line: rgba(201, 168, 76, 0.18);
    --line-soft: rgba(255, 255, 255, 0.07);
    --danger: #d9736a;
    --ok: #79c9a4;
    --amber: #e0b464;
    --radius: 14px;
    --shadow: 0 24px 60px rgba(0, 0, 0, 0.38);
}

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

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

body {
    min-height: 100vh;
    font-family: 'Exo 2', 'Segoe UI', system-ui, sans-serif;
    color: var(--text);
    background:
        radial-gradient(1100px 620px at 82% -10%, rgba(var(--gold-rgb), 0.10), transparent 62%),
        radial-gradient(900px 600px at -12% 100%, rgba(var(--green-rgb), 0.55), transparent 60%),
        var(--green-deep);
    font-size: 14px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3, .serif {
    font-family: 'Cinzel', Georgia, 'Times New Roman', serif;
    font-weight: 500;
    letter-spacing: 0.02em;
}

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

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

.wordmark { display: flex; align-items: center; gap: 12px; }
.wordmark img { height: 34px; width: auto; display: block; }
.brand-eyebrow {
    font-size: 10px; letter-spacing: 0.34em; text-transform: uppercase;
    color: var(--text-faint);
}

/* ---------- 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(160deg, rgba(var(--green-rgb), 0.85), rgba(var(--green-deep-rgb), 0.96)),
        url('img/bg.jpg') center/cover no-repeat;
    border-right: 1px solid var(--line);
    overflow: hidden;
}
.login-aside::after {
    content: ''; position: absolute; inset: 0;
    background: radial-gradient(600px 420px at 80% 20%, rgba(var(--gold-rgb), 0.16), transparent 65%);
    pointer-events: none;
}
.login-aside .wordmark img { height: auto; width: 100%; max-width: 300px; max-height: 46px; object-fit: contain; }
.login-aside__body { position: relative; z-index: 1; max-width: 460px; }
.login-aside__body h1 { font-size: 42px; line-height: 1.12; margin-bottom: 18px; }
.login-aside__body p { color: var(--text-soft); font-size: 15px; max-width: 380px; }
.login-aside__meta {
    position: relative; z-index: 1; display: flex; gap: 28px; color: var(--text-faint);
    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; }
.login-card { width: 100%; max-width: 380px; }
.login-card h2 { font-size: 26px; margin-bottom: 6px; }
.login-card .hint { color: var(--text-soft); font-size: 13px; margin-bottom: 28px; }
.login-card .field { margin-bottom: 16px; }
.login-card .btn { width: 100%; justify-content: center; margin-top: 8px; }
.login-error {
    display: none; margin-top: 16px; padding: 10px 12px; border-radius: 8px;
    border: 1px solid rgba(217, 115, 106, 0.4); background: rgba(217, 115, 106, 0.1);
    color: #f0b6b0; font-size: 12.5px;
}
.login-error.show { display: block; }
.demo-box {
    margin-top: 30px; padding: 14px 16px; border: 1px dashed rgba(var(--gold-rgb), 0.3);
    border-radius: 10px; font-size: 11.5px; color: var(--text-soft); background: rgba(var(--gold-rgb), 0.04);
}
.demo-box strong { color: var(--gold); font-weight: 600; 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: 252px minmax(0, 1fr); min-height: 100vh; }
.app.ready { display: grid; }

.sidebar {
    position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column;
    padding: 26px 18px 20px; border-right: 1px solid var(--line-soft);
    background: linear-gradient(180deg, rgba(18, 42, 35, 0.92), rgba(13, 31, 26, 0.96));
    backdrop-filter: blur(8px);
}
.sidebar .wordmark { padding: 0 0 20px; border-bottom: 1px solid var(--line-soft); margin-bottom: 18px; justify-content: center; }
.sidebar .wordmark img { height: auto; width: 100%; max-width: 196px; max-height: 32px; object-fit: contain; display: block; }
.sidebar__section {
    font-size: 9.5px; letter-spacing: 0.26em; text-transform: uppercase;
    color: var(--text-faint); padding: 16px 12px 8px;
}
.nav { display: flex; flex-direction: column; gap: 3px; }
.nav__item {
    display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 9px;
    color: var(--text-soft); font-size: 13.5px; text-align: left; width: 100%;
    border: 1px solid transparent; transition: background .18s ease, color .18s ease, border-color .18s ease;
}
.nav__item svg { width: 17px; height: 17px; stroke-width: 1.6; opacity: .8; flex: none; }
.nav__item:hover { background: rgba(255, 255, 255, 0.04); color: var(--text); }
.nav__item.active {
    background: linear-gradient(90deg, rgba(var(--gold-rgb), 0.16), rgba(var(--gold-rgb), 0.03));
    border-color: rgba(var(--gold-rgb), 0.22); color: var(--gold-soft);
}
.nav__item.active svg { opacity: 1; }
.nav__item .count {
    margin-left: auto; font-size: 10.5px; padding: 1px 7px; border-radius: 20px;
    background: rgba(255, 255, 255, 0.06); color: var(--text-soft);
}

.sidebar__foot { margin-top: auto; padding-top: 16px; border-top: 1px solid var(--line-soft); }
.user-card { display: flex; align-items: center; gap: 11px; padding: 10px; border-radius: 10px; }
.user-card:hover { background: rgba(255, 255, 255, 0.04); }
.avatar {
    width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; flex: none;
    background: linear-gradient(145deg, rgba(var(--gold-rgb), 0.9), rgba(var(--gold-rgb), 0.45));
    color: #1a2e27; font-weight: 700; font-size: 12px; letter-spacing: 0.04em;
}
.user-card__meta { min-width: 0; }
.user-card__meta strong { display: block; font-size: 12.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-card__meta span { display: block; font-size: 10.5px; color: var(--text-faint); 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: 8px; font-size: 11px; }

.main { min-width: 0; padding: 30px 34px 56px; }
.topbar { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 26px; flex-wrap: wrap; }
.topbar__title h1 { font-size: 27px; line-height: 1.2; }
.topbar__title p { color: var(--text-soft); font-size: 12.5px; margin-top: 6px; }
.topbar__tools { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

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

.btn {
    display: inline-flex; align-items: center; gap: 8px; padding: 9px 16px; border-radius: 8px;
    font-size: 12.5px; font-weight: 600; letter-spacing: 0.03em; border: 1px solid transparent;
    transition: transform .15s ease, box-shadow .2s ease, background .2s ease, border-color .2s ease;
    white-space: nowrap;
}
.btn svg { width: 15px; height: 15px; stroke-width: 1.8; }
.btn--primary {
    background: linear-gradient(135deg, #ddc169, #b8973f); color: #14261f;
    box-shadow: 0 6px 20px rgba(var(--gold-rgb), 0.22);
}
.btn--primary:hover { transform: translateY(-1px); box-shadow: 0 10px 26px rgba(var(--gold-rgb), 0.3); }
.btn--ghost { border-color: rgba(var(--gold-rgb), 0.28); color: var(--gold-soft); background: rgba(var(--gold-rgb), 0.05); }
.btn--ghost:hover { background: rgba(var(--gold-rgb), 0.12); }
.btn--plain { color: var(--text-soft); border-color: var(--line-soft); }
.btn--plain:hover { color: var(--text); background: rgba(255, 255, 255, 0.04); }
.btn--danger { color: #f0b6b0; border-color: rgba(217, 115, 106, 0.35); background: rgba(217, 115, 106, 0.08); }
.btn--danger:hover { background: rgba(217, 115, 106, 0.16); }
.btn--icon { padding: 8px; border-radius: 8px; }
.btn[disabled] { opacity: 0.45; pointer-events: none; }
.btn--sm { padding: 6px 11px; font-size: 11.5px; }

.field { display: flex; flex-direction: column; gap: 6px; }
.field > label {
    font-size: 10px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--text-faint); font-weight: 600;
}
.field .help { font-size: 11px; color: var(--text-faint); }
input[type="text"], input[type="email"], input[type="password"], input[type="number"],
input[type="date"], input[type="search"], select, textarea {
    width: 100%; padding: 10px 12px; border-radius: 8px; background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(var(--gold-rgb), 0.16); color: var(--text); font-size: 13px;
    transition: border-color .18s ease, background .18s ease;
}
input:focus, select:focus, textarea:focus {
    outline: none; border-color: rgba(var(--gold-rgb), 0.6); background: rgba(255, 255, 255, 0.06);
}
select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--gold) 50%), linear-gradient(135deg, var(--gold) 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: #122a23; color: var(--text); }
textarea { resize: vertical; min-height: 70px; }
input[type="date"]::-webkit-calendar-picker-indicator { filter: invert(0.8) sepia(1) saturate(3) hue-rotate(5deg); }

.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: linear-gradient(180deg, rgba(22, 51, 43, 0.85), rgba(18, 42, 35, 0.92));
    border: 1px solid var(--line-soft); border-radius: var(--radius); padding: 20px 22px;
    box-shadow: 0 12px 34px rgba(0, 0, 0, 0.16);
}
.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: 15px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--gold-soft); }
.card__head .sub { font-size: 11.5px; color: var(--text-faint); }

.kpi-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 20px; }
.kpi {
    position: relative; overflow: hidden; padding: 18px 20px 16px; border-radius: var(--radius);
    border: 1px solid var(--line); background: linear-gradient(150deg, rgba(22, 51, 43, 0.9), rgba(15, 35, 29, 0.92));
}
.kpi::after {
    content: ''; position: absolute; top: -40px; right: -30px; width: 120px; height: 120px;
    background: radial-gradient(circle, rgba(var(--gold-rgb), 0.14), transparent 65%);
}
.kpi__label { font-size: 10px; letter-spacing: 0.2em; text-transform: uppercase; color: var(--text-faint); display: flex; align-items: center; gap: 8px; }
.kpi__value { font-family: 'Cinzel', Georgia, serif; font-size: 30px; line-height: 1.15; margin-top: 10px; }
.kpi__value small { font-family: 'Exo 2', sans-serif; font-size: 12px; color: var(--text-soft); letter-spacing: 0.04em; }
.kpi__foot { font-size: 11.5px; color: var(--text-soft); margin-top: 6px; }
.kpi--accent .kpi__value { color: var(--gold-soft); }

.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: separate; border-spacing: 0; font-size: 12.5px;
}
table.grid thead th {
    position: sticky; top: 0; z-index: 2; text-align: left; padding: 10px 12px;
    font-size: 9.5px; letter-spacing: 0.18em; text-transform: uppercase; color: var(--text-faint);
    font-weight: 600; background: #122a23; border-bottom: 1px solid var(--line);
    white-space: nowrap;
}
table.grid tbody td { padding: 11px 12px; border-bottom: 1px solid var(--line-soft); vertical-align: middle; }
table.grid tbody tr:hover { background: rgba(255, 255, 255, 0.025); }
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 12px; border-top: 1px solid var(--line); color: var(--gold-soft);
    font-weight: 600; font-size: 12px;
}
.cell-person { display: flex; align-items: center; gap: 10px; }
.cell-person strong { font-weight: 600; display: block; }
.cell-person span { color: var(--text-faint); 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: 10.5px; letter-spacing: 0.05em; border: 1px solid transparent; white-space: nowrap;
}
.pill::before { content: ''; width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.pill--active { color: #9fe0c1; background: rgba(121, 201, 164, 0.1); border-color: rgba(121, 201, 164, 0.3); }
.pill--suspended { color: #f0c1ad; background: rgba(217, 115, 106, 0.1); border-color: rgba(217, 115, 106, 0.32); }
.pill--on_leave { color: #e7d39a; background: rgba(224, 180, 100, 0.1); border-color: rgba(224, 180, 100, 0.32); }
.pill--sent { color: #9fe0c1; background: rgba(121, 201, 164, 0.1); border-color: rgba(121, 201, 164, 0.3); }
.pill--saved { color: #e7d39a; background: rgba(224, 180, 100, 0.1); border-color: rgba(224, 180, 100, 0.32); }
.pill--failed { color: #f0b6b0; background: rgba(217, 115, 106, 0.1); border-color: rgba(217, 115, 106, 0.32); }
.pill--muted { color: var(--text-faint); background: rgba(255, 255, 255, 0.04); border-color: var(--line-soft); }

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

.timesheet { border: 1px solid var(--line-soft); border-radius: var(--radius); overflow: hidden; background: rgba(18, 42, 35, 0.72); }
.timesheet table { width: 100%; border-collapse: separate; border-spacing: 0; }
.timesheet thead th {
    position: sticky; top: 0; z-index: 3; padding: 12px 10px; background: #10251f;
    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: #10251f; }
.timesheet thead th .day-name { font-size: 10px; letter-spacing: 0.18em; text-transform: uppercase; color: var(--text-faint); }
.timesheet thead th .day-date { font-family: 'Cinzel', Georgia, serif; font-size: 15px; display: block; margin-top: 2px; }
.timesheet thead th.weekend { background: #0d201a; }
.timesheet thead th.today { box-shadow: inset 0 -2px 0 var(--gold); }
.timesheet thead th.today .day-date { color: var(--gold-soft); }
.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: #122a23; padding: 12px 12px; min-width: 196px; border-right: 1px solid var(--line-soft); }
.timesheet td.total-col { background: rgba(201, 168, 76, 0.05); padding: 12px 10px; text-align: right; min-width: 74px; }
.timesheet td.total-col .hours { font-family: 'Cinzel', Georgia, serif; font-size: 16px; color: var(--gold-soft); white-space: nowrap; }
.timesheet td.total-col small { display: block; color: var(--text-faint); 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: rgba(var(--gold-rgb), 0.06); }
.day-cell.is-weekend { background: rgba(0, 0, 0, 0.14); }
.day-cell.is-off { background: rgba(255, 255, 255, 0.02); }
.day-cell__hours { font-size: 12.5px; font-weight: 600; color: var(--gold-soft); letter-spacing: 0.02em; }
.day-cell__hours.none { color: var(--text-faint); font-weight: 400; }
.chip {
    display: block; padding: 3px 5px; border-radius: 5px; background: rgba(255, 255, 255, 0.05);
    border-left: 2px solid rgba(var(--gold-rgb), 0.55); font-size: 10px; line-height: 1.3;
    color: var(--text-soft); 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); }
.travel-tag { font-size: 10px; letter-spacing: 0.05em; color: var(--gold-muted); text-transform: uppercase; }
.travel-row {
    margin-top: 14px; padding: 10px 12px; border-radius: 8px; font-size: 12px; line-height: 1.5;
    border: 1px dashed rgba(var(--gold-rgb), 0.3); background: rgba(var(--gold-rgb), 0.05);
    color: var(--text-soft);
}
.travel-row b { color: var(--gold-soft); font-weight: 600; }
.flag-tag { font-size: 10px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--text-faint); }
.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.06em; }
.week-nav__label strong { display: block; font-family: 'Cinzel', Georgia, serif; font-size: 14px; }
.week-nav__label span { color: var(--text-faint); font-size: 10.5px; }
.legend { display: flex; gap: 20px; flex-wrap: wrap; font-size: 11px; color: var(--text-faint); margin-top: 14px; }
.legend b { color: var(--text-soft); font-weight: 500; }

.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: 16px; }
.site-card p { color: var(--text-soft); 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-muted); letter-spacing: 0.06em; }
.site-card__hours { font-size: 11.5px; color: var(--text-faint); }
.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(--text-faint); font-size: 11px; display: block; }
.status-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--text-faint); flex: none; }
.status-dot.on { background: var(--ok); box-shadow: 0 0 0 3px rgba(121, 201, 164, 0.14); }
.time-tag { font-family: 'Consolas', monospace; font-size: 11px; color: var(--text-soft); 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(--text-soft); }
.feed__item time { color: var(--text-faint); 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: 500; }
.feed__action { display: block; font-size: 10px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--text-faint); margin-top: 2px; }
.feed__detail { display: block; font-size: 11px; color: var(--text-soft); 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-soft); flex: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar-track { flex: 1; height: 7px; border-radius: 4px; background: rgba(255, 255, 255, 0.06); overflow: hidden; }
.bar-fill { display: block; height: 100%; border-radius: 4px; background: linear-gradient(90deg, rgba(var(--gold-rgb), 0.55), var(--gold)); }
.bar-row__value { width: 62px; text-align: right; color: var(--gold-soft); font-variant-numeric: tabular-nums; }

.empty {
    padding: 28px 16px; text-align: center; color: var(--text-faint); 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(8, 20, 16, 0.72); backdrop-filter: blur(6px); overflow-y: auto;
}
.modal-backdrop.open { display: flex; }
.modal {
    width: 100%; max-width: 640px; background: linear-gradient(180deg, #16332b, #122a23);
    border: 1px solid rgba(var(--gold-rgb), 0.28); border-radius: 16px; box-shadow: var(--shadow);
    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: 22px 24px 16px; border-bottom: 1px solid var(--line-soft); }
.modal__head h2 { font-size: 19px; }
.modal__head p { color: var(--text-soft); font-size: 11.5px; margin-top: 4px; letter-spacing: 0.04em; }
.modal__body { padding: 22px 24px; }
.modal__foot { display: flex; align-items: center; gap: 10px; padding: 16px 24px 22px; border-top: 1px solid var(--line-soft); }
.modal__foot .spacer { flex: 1; }
.modal-close { color: var(--text-faint); padding: 6px; border-radius: 6px; line-height: 1; font-size: 20px; }
.modal-close:hover { color: var(--text); background: rgba(255, 255, 255, 0.05); }

.slot-box { border: 1px solid var(--line-soft); border-radius: 10px; padding: 14px; background: rgba(255, 255, 255, 0.015); }
.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: 10px; letter-spacing: 0.18em; text-transform: uppercase; color: var(--gold-muted); }
.slot-box__hours { font-size: 11.5px; color: var(--text-soft); }
.slot-grid { display: grid; grid-template-columns: 1.5fr 0.85fr 0.85fr 36px; gap: 10px; align-items: end; }
.slot-remove { color: var(--text-faint); padding: 8px; border-radius: 6px; }
.slot-remove svg { width: 16px; height: 16px; display: block; }
.slot-remove:hover { color: var(--danger); background: rgba(217, 115, 106, 0.1); }
.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: 10px; letter-spacing: 0.18em; text-transform: uppercase; color: var(--text-faint); margin-right: 4px; }
.warn-box {
    display: none; margin-top: 14px; padding: 10px 12px; border-radius: 8px; font-size: 12px;
    background: rgba(224, 180, 100, 0.08); border: 1px solid rgba(224, 180, 100, 0.3); color: #ecd39a;
}
.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: 12px 16px; border-radius: 10px; font-size: 12.5px;
    background: #16332b; border: 1px solid rgba(var(--gold-rgb), 0.35); color: var(--text);
    box-shadow: var(--shadow); animation: toast-in .25s ease both;
}
.toast.error { border-color: rgba(217, 115, 106, 0.5); background: #2a1c19; color: #f4d4d0; }
@keyframes toast-in { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

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

.hidden { display: none !important; }
.muted { color: var(--text-faint); }
.gold { color: var(--gold-soft); }
.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-soft); }
.checkbox input { width: auto; accent-color: var(--gold); }
.field > label.checkbox {
    display: inline-flex; margin: 0; font-size: 12px; letter-spacing: 0; text-transform: none;
    color: var(--text-soft); 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: 14px 16px; }
    .sidebar .wordmark { border: 0; padding: 0; margin: 0; }
    .sidebar .wordmark img { width: auto; height: 26px; max-width: 170px; }
    .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; }
    .sidebar__foot { margin: 0; padding: 0; border: 0; display: flex; align-items: center; gap: 8px; }
    .sidebar__actions { margin: 0; }
    .main { padding: 22px 18px 40px; }
    .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: 22px; }
    .timesheet thead th.employee-col, .timesheet td.employee-col { min-width: 160px; }
}
