/* OHS Management — site office theme
   Colour follows ISO 7010 / SANS 1186 safety sign semantics:
   red = prohibition, danger, overdue   yellow = caution
   green = safe condition, closed        blue = mandatory action           */

:root {
    --concrete: #E2E4E1;
    --board: #FBFBF9;
    --board-2: #F0F1EE;
    --board-3: #E7E9E6;
    --ink: #1D2124;
    --ink-2: #474F55;
    --ink-3: #6B7379;
    --rule: #CDD1CE;
    --rule-strong: #9EA5A8;
    --plate: #1D2124;
    --plate-text: #FFFFFF;

    --red: #C4161C;      --red-ink: #A11217;    --red-tint: #FBE6E5;
    --orange: #D2600E;   --orange-ink: #93430A; --orange-tint: #FCEBDD;
    --yellow: #F5C400;   --amber-ink: #6F5300;  --amber-tint: #FFF3BF;
    --green: #1E7A46;    --green-ink: #17603A;  --green-tint: #E1F1E7;
    --blue: #1B5CA8;     --blue-ink: #174D8C;   --blue-tint: #E2EBF6;
    --grey-tint: #ECEDEB;

    --focus: #1B5CA8;
    --sidebar-w: 248px;
    --font-head: 'Barlow Condensed', 'Arial Narrow', sans-serif;
    --font-body: 'Atkinson Hyperlegible', 'Segoe UI', system-ui, sans-serif;
    color-scheme: light;
}

@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
        --concrete: #15181A; --board: #1E2225; --board-2: #252A2D; --board-3: #2D3337;
        --ink: #ECEEED; --ink-2: #B8BFC2; --ink-3: #8B9398;
        --rule: #353B3F; --rule-strong: #535B60;
        --plate: #0E1011; --plate-text: #F4F5F4;
        --red: #F0534B; --red-ink: #FF8A83; --red-tint: #3A1D1D;
        --orange: #F0873F; --orange-ink: #FFB07A; --orange-tint: #3A2718;
        --yellow: #F5C400; --amber-ink: #FFD95A; --amber-tint: #3A3214;
        --green: #3DAA6C; --green-ink: #7FD6A2; --green-tint: #183327;
        --blue: #5B9BE6; --blue-ink: #9CC4F5; --blue-tint: #1A2A3F;
        --grey-tint: #2A2F32; --focus: #8CBBF5;
        color-scheme: dark;
    }
}
:root[data-theme="dark"] {
    --concrete: #15181A; --board: #1E2225; --board-2: #252A2D; --board-3: #2D3337;
    --ink: #ECEEED; --ink-2: #B8BFC2; --ink-3: #8B9398;
    --rule: #353B3F; --rule-strong: #535B60;
    --plate: #0E1011; --plate-text: #F4F5F4;
    --red: #F0534B; --red-ink: #FF8A83; --red-tint: #3A1D1D;
    --orange: #F0873F; --orange-ink: #FFB07A; --orange-tint: #3A2718;
    --yellow: #F5C400; --amber-ink: #FFD95A; --amber-tint: #3A3214;
    --green: #3DAA6C; --green-ink: #7FD6A2; --green-tint: #183327;
    --blue: #5B9BE6; --blue-ink: #9CC4F5; --blue-tint: #1A2A3F;
    --grey-tint: #2A2F32; --focus: #8CBBF5;
    color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
    margin: 0;
    background: var(--concrete);
    color: var(--ink);
    font-family: var(--font-body);
    font-size: 15px;
    line-height: 1.5;
}
h1, h2, h3, p { margin: 0; }
a { color: var(--blue-ink); text-underline-offset: 2px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 2px; }
code { font-size: 0.92em; background: var(--board-2); padding: 1px 5px; border-radius: 3px; }

.skip-link {
    position: absolute; left: 12px; top: -48px; z-index: 50;
    background: var(--ink); color: var(--board); padding: 8px 14px; border-radius: 4px;
}
.skip-link:focus { top: 12px; }

/* ── APP SHELL ─────────────────────────────────────────── */
.app { display: grid; grid-template-columns: var(--sidebar-w) minmax(0, 1fr); min-height: 100vh; }

.sidebar {
    background: var(--board);
    border-right: 1px solid var(--rule);
    display: flex; flex-direction: column;
    position: sticky; top: 0; height: 100vh; overflow-y: auto;
}
.brand {
    display: flex; gap: 12px; align-items: center;
    padding: 20px 20px 16px;
    color: var(--ink); text-decoration: none;
}
.brand-mark {
    width: 40px; height: 40px; flex: none; border-radius: 4px;
    background: var(--green); position: relative;
}
.brand-mark::before, .brand-mark::after {
    content: ""; position: absolute; background: #fff; border-radius: 1px;
    left: 50%; top: 50%; transform: translate(-50%, -50%);
}
.brand-mark::before { width: 22px; height: 7px; }
.brand-mark::after { width: 7px; height: 22px; }
.brand-name { font-family: var(--font-head); font-weight: 700; font-size: 22px; line-height: 1; letter-spacing: 0.2px; }
.brand-org { font-size: 13px; color: var(--ink-3); margin-top: 3px; }

.sidebar-cta { padding: 4px 20px 16px; }
.sidebar-cta .btn { width: 100%; justify-content: center; }

.nav { padding: 4px 12px 16px; flex: 1; }
.nav-group + .nav-group { margin-top: 18px; }
.nav-heading {
    font-size: 13px; font-weight: 700; color: var(--ink-3);
    padding: 0 10px 6px; margin: 0;
}
.nav a {
    display: flex; align-items: center; justify-content: space-between;
    padding: 7px 10px; border-radius: 4px;
    color: var(--ink-2); text-decoration: none; font-size: 15px;
    border-left: 4px solid transparent;
}
.nav a:hover { background: var(--board-2); color: var(--ink); }
.nav a.active {
    background: var(--board-2); color: var(--ink); font-weight: 700;
    border-left-color: var(--ink); border-radius: 0 4px 4px 0;
}
.sidebar-foot {
    border-top: 1px solid var(--rule); padding: 14px 20px 18px;
    font-size: 14px; color: var(--ink-3);
    display: grid; gap: 8px;
}
.sidebar-foot .who { color: var(--ink); font-weight: 700; }
.sidebar-foot-links { display: flex; gap: 14px; flex-wrap: wrap; }
.link-button {
    background: none; border: 0; padding: 0; font: inherit; color: var(--blue-ink);
    text-decoration: underline; text-underline-offset: 2px; cursor: pointer;
}

.topbar { display: none; }
.main { min-width: 0; padding: 28px 36px 64px; }
.main-inner { max-width: 1320px; margin: 0 auto; }

/* ── PAGE HEAD ─────────────────────────────────────────── */
.page-head {
    display: flex; gap: 16px 24px; align-items: flex-end; justify-content: space-between;
    flex-wrap: wrap; margin-bottom: 22px;
}
.page-head h1 {
    font-family: var(--font-head); font-weight: 600; font-size: 36px; line-height: 1.05;
    letter-spacing: 0.1px;
}
.page-head .lede { color: var(--ink-2); margin-top: 6px; max-width: 70ch; }
.page-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.crumb { font-size: 14px; margin-bottom: 6px; display: inline-block; }

/* ── BUTTONS ───────────────────────────────────────────── */
.btn {
    display: inline-flex; align-items: center; gap: 6px;
    font: 700 14px/1.2 var(--font-body);
    padding: 9px 14px; border-radius: 4px; border: 2px solid transparent;
    text-decoration: none; cursor: pointer; white-space: nowrap;
    transition: background-color .12s, border-color .12s;
}
.btn-primary { background: var(--blue); color: #fff; border-color: var(--blue); }
.btn-primary:hover { background: var(--blue-ink); border-color: var(--blue-ink); }
:root[data-theme="dark"] .btn-primary { color: #0E1011; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .btn-primary { color: #0E1011; } }
.btn-outline { background: var(--board); color: var(--ink); border-color: var(--rule-strong); }
.btn-outline:hover { border-color: var(--ink); }
.btn-danger { background: transparent; color: var(--red-ink); border-color: transparent; padding-left: 8px; padding-right: 8px; }
.btn-danger:hover { background: var(--red-tint); }
.btn-quiet { background: transparent; color: var(--blue-ink); border-color: transparent; padding-left: 8px; padding-right: 8px; }
.btn-quiet:hover { background: var(--blue-tint); }
.btn-sm { padding: 6px 10px; font-size: 13.5px; }
.btn-alarm { background: var(--red); color: #fff; border-color: var(--red); }
.btn-alarm:hover { background: var(--red-ink); border-color: var(--red-ink); }
.row-actions { display: flex; gap: 2px 4px; align-items: center; flex-wrap: wrap; }
.row-actions form { display: inline; margin: 0; }

/* ── PANELS ────────────────────────────────────────────── */
.panel {
    background: var(--board); border: 1px solid var(--rule); border-radius: 4px;
    margin-bottom: 20px; min-width: 0;
}
.panel-head {
    display: flex; gap: 12px; align-items: baseline; justify-content: space-between; flex-wrap: wrap;
    padding: 14px 18px 12px; border-bottom: 1px solid var(--rule);
}
.panel-head h2 { font-family: var(--font-head); font-weight: 600; font-size: 21px; line-height: 1.1; }
.panel-head .meta { color: var(--ink-3); font-size: 14px; }
.panel-body { padding: 16px 18px; }
.panel-foot { padding: 10px 18px 14px; border-top: 1px solid var(--rule); font-size: 14px; }
.panel--alarm { border: 2px solid var(--red); }
.panel--alarm .panel-head { background: var(--red-tint); border-bottom-color: var(--red); }
.panel--alarm .panel-head h2 { color: var(--red-ink); }

/* ── TABLES ────────────────────────────────────────────── */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.table { width: 100%; border-collapse: collapse; font-size: 14.5px; }
.table th {
    text-align: left; font-weight: 700; font-size: 13.5px; color: var(--ink-2);
    background: var(--board-2); padding: 9px 12px; border-bottom: 1px solid var(--rule-strong);
    white-space: nowrap; vertical-align: bottom;
}
.table td { padding: 10px 12px; border-bottom: 1px solid var(--rule); vertical-align: top; }
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr:hover td { background: color-mix(in srgb, var(--board-2) 60%, transparent); }
.table .wrap { min-width: 240px; max-width: 420px; }
.table .nowrap { white-space: nowrap; }
.table th.num, .table td.num { text-align: right; }
.table td.center, .table th.center { text-align: center; }
.table .empty { text-align: center; color: var(--ink-3); padding: 28px 12px; }
.table tr.is-overdue td:first-child { box-shadow: inset 4px 0 0 var(--red); }
.table tr.is-due td:first-child { box-shadow: inset 4px 0 0 var(--yellow); }

.fig {
    font-family: var(--font-head); font-weight: 600; font-size: 17px; line-height: 1.2;
    font-variant-numeric: tabular-nums; letter-spacing: 0.2px;
}
.ref {
    font-family: var(--font-head); font-weight: 600; font-size: 16.5px; letter-spacing: 0.3px;
    white-space: nowrap; color: var(--ink);
}
a.ref { color: var(--blue-ink); }
.date { white-space: nowrap; font-variant-numeric: tabular-nums; }
.sub { display: block; color: var(--ink-3); font-size: 13.5px; }
.muted { color: var(--ink-3); }
.strong { font-weight: 700; }
.t-red { color: var(--red-ink); font-weight: 700; }
.t-amber { color: var(--amber-ink); font-weight: 700; }
.t-green { color: var(--green-ink); font-weight: 700; }

/* ── TAGS (sign plates) ────────────────────────────────── */
.tag {
    display: inline-flex; align-items: center; gap: 6px;
    font-size: 13px; font-weight: 700; line-height: 1;
    padding: 4px 8px 4px 5px; border-radius: 3px; white-space: nowrap;
    background: var(--grey-tint); color: var(--ink-2); border: 1px solid var(--rule);
}
.tag::before { content: ""; width: 9px; height: 9px; border-radius: 1px; background: var(--rule-strong); flex: none; }
.tag-red    { background: var(--red-tint);    color: var(--red-ink);    border-color: color-mix(in srgb, var(--red) 35%, transparent); }
.tag-red::before { background: var(--red); }
.tag-orange { background: var(--orange-tint); color: var(--orange-ink); border-color: color-mix(in srgb, var(--orange) 35%, transparent); }
.tag-orange::before { background: var(--orange); }
.tag-amber  { background: var(--amber-tint);  color: var(--amber-ink);  border-color: color-mix(in srgb, #C79C00 45%, transparent); }
.tag-amber::before { background: var(--yellow); box-shadow: inset 0 0 0 1px rgba(0,0,0,.25); }
.tag-blue   { background: var(--blue-tint);   color: var(--blue-ink);   border-color: color-mix(in srgb, var(--blue) 35%, transparent); }
.tag-blue::before { background: var(--blue); }
.tag-green  { background: var(--green-tint);  color: var(--green-ink);  border-color: color-mix(in srgb, var(--green) 35%, transparent); }
.tag-green::before { background: var(--green); }
.tag-grey::before { background: var(--rule-strong); }

.s24 {
    display: inline-flex; align-items: center; gap: 5px; font-weight: 700; font-size: 13px; color: var(--ink);
    white-space: nowrap;
}
.s24::before {
    content: "!"; display: inline-grid; place-items: center;
    width: 18px; height: 16px; font-size: 11px; font-weight: 700; color: #1D2124;
    background: var(--yellow); clip-path: polygon(50% 0, 100% 100%, 0 100%); padding-top: 4px;
}

/* ── ALERTS ────────────────────────────────────────────── */
.alert {
    display: flex; gap: 12px; align-items: flex-start;
    padding: 12px 16px; border-radius: 4px; margin-bottom: 18px;
    border: 1px solid var(--rule); background: var(--board);
}
.alert strong { display: block; }
.alert-danger { border: 2px solid var(--red); background: var(--red-tint); color: var(--ink); }
.alert-danger strong { color: var(--red-ink); }
.alert-info { border-color: color-mix(in srgb, var(--blue) 45%, transparent); background: var(--blue-tint); }
.alert-success { border-color: color-mix(in srgb, var(--green) 45%, transparent); background: var(--green-tint); }
.alert-icon {
    flex: none; width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center;
    font-weight: 700; font-size: 14px; color: #fff; background: var(--blue);
}
.alert-danger .alert-icon { background: var(--red); }
.alert-success .alert-icon { background: var(--green); }

/* ── FORMS ─────────────────────────────────────────────── */
.filters {
    display: flex; flex-wrap: wrap; gap: 12px 14px; align-items: flex-end;
    background: var(--board); border: 1px solid var(--rule); border-radius: 4px;
    padding: 14px 16px; margin-bottom: 16px;
}
.filters .field { min-width: 150px; flex: 1 1 150px; max-width: 240px; margin: 0; }
.filters .filter-buttons { display: flex; gap: 8px; }
.field { display: grid; gap: 6px; margin-bottom: 16px; min-width: 0; }
.field label, .field .label { font-weight: 700; font-size: 14px; color: var(--ink); }
.field .hint { font-size: 13.5px; color: var(--ink-3); }
.control {
    width: 100%; font: 15px/1.4 var(--font-body); color: var(--ink);
    background: var(--board); border: 1.5px solid var(--rule-strong); border-radius: 4px;
    padding: 8px 10px; min-height: 40px;
}
.control:hover { border-color: var(--ink-3); }
.control:focus-visible { outline: 3px solid var(--focus); outline-offset: 1px; border-color: var(--ink); }
textarea.control { resize: vertical; min-height: 84px; }
select.control { appearance: auto; }
.check {
    display: flex; gap: 10px; align-items: flex-start; font-size: 15px; cursor: pointer;
    padding: 10px 12px; border: 1.5px solid var(--rule-strong); border-radius: 4px; background: var(--board);
}
.check input { width: 18px; height: 18px; margin: 2px 0 0; accent-color: var(--blue); flex: none; }
.check .sub { margin-top: 2px; }

.sheet { max-width: 820px; }
.sheet-section { padding: 18px 20px 4px; border-bottom: 1px solid var(--rule); }
.sheet-section:last-of-type { border-bottom: 0; }
.sheet-section h2 {
    font-family: var(--font-head); font-weight: 600; font-size: 19px; margin-bottom: 12px; color: var(--ink);
    display: flex; gap: 10px; align-items: center;
}
.step {
    display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 50%;
    border: 2px solid var(--ink); font-size: 13px; font-family: var(--font-head); font-weight: 700;
}
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0 16px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)) auto; gap: 0 12px; align-items: end; }
.span-all { grid-column: 1 / -1; }
.sheet-actions {
    display: flex; gap: 10px; align-items: center; flex-wrap: wrap;
    padding: 16px 20px; background: var(--board-2); border-top: 1px solid var(--rule); border-radius: 0 0 4px 4px;
}

/* ── SUMMARY COUNTS (non-dashboard pages) ──────────────── */
.counts { display: flex; flex-wrap: wrap; gap: 0; margin-bottom: 18px; background: var(--board); border: 1px solid var(--rule); border-radius: 4px; }
.count { padding: 12px 20px; border-right: 1px solid var(--rule); min-width: 150px; }
.count:last-child { border-right: 0; }
.count .n { font-family: var(--font-head); font-weight: 700; font-size: 30px; line-height: 1; font-variant-numeric: tabular-nums; }
.count .l { font-size: 14px; color: var(--ink-2); margin-top: 4px; display: flex; gap: 6px; align-items: center; }
.count .l::before { content: ""; width: 9px; height: 9px; border-radius: 1px; background: var(--rule-strong); }
.count.red .n { color: var(--red-ink); }   .count.red .l::before { background: var(--red); }
.count.amber .l::before { background: var(--yellow); box-shadow: inset 0 0 0 1px rgba(0,0,0,.25); }
.count.green .l::before { background: var(--green); }
.count.blue .l::before { background: var(--blue); }

/* ── DEFINITION LIST (detail pages) ────────────────────── */
.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px 24px; margin: 0; }
.facts dt { font-size: 13.5px; color: var(--ink-3); font-weight: 700; }
.facts dd { margin: 2px 0 0; font-size: 15px; }

/* ── SITE SAFETY BOARD (dashboard) ─────────────────────── */
.board {
    --bolt: radial-gradient(circle at 50% 50%, #C9CCCB 0 3px, #7B8286 3.5px 5px, transparent 5.5px);
    position: relative;
    background: #FFFFFF;
    color: #1D2124;
    border: 7px solid #2B3134;
    border-radius: 6px;
    margin-bottom: 22px;
    overflow: hidden;
    box-shadow: 0 1px 0 #fff inset;
}
:root[data-theme="dark"] .board { background: #F1F2EF; border-color: #0B0D0E; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .board { background: #F1F2EF; border-color: #0B0D0E; } }
.board::before {
    content: ""; position: absolute; inset: 6px; pointer-events: none;
    background: var(--bolt) left top / 12px 12px no-repeat, var(--bolt) right top / 12px 12px no-repeat;
}
.board-head {
    background: #1E7A46; color: #fff;
    display: flex; flex-wrap: wrap; gap: 4px 16px; align-items: baseline; justify-content: space-between;
    padding: 12px 28px 10px;
}
.board-head h2 {
    font-family: var(--font-head); font-weight: 700; font-size: 26px; letter-spacing: 1.5px; text-transform: uppercase;
}
.board-head p { font-size: 14px; opacity: .92; }
.board-body { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); }
.board-record { padding: 22px 28px 24px; border-right: 3px solid #2B3134; }
.board-words {
    font-family: var(--font-head); font-weight: 700; text-transform: uppercase;
    font-size: 23px; letter-spacing: 1.2px; line-height: 1.1;
}
.plates { display: flex; gap: 8px; margin: 14px 0; flex-wrap: nowrap; }
.plate {
    position: relative; display: grid; place-items: center;
    width: 76px; height: 104px; border-radius: 5px;
    background: #1D2124; color: #fff;
    font-family: var(--font-head); font-weight: 700; font-size: 84px; line-height: 1;
    font-variant-numeric: tabular-nums;
    box-shadow: inset 0 -3px 0 rgba(255,255,255,.08), 0 2px 0 rgba(0,0,0,.25);
}
.plate::before {
    content: ""; position: absolute; top: 7px; left: 50%; width: 8px; height: 8px; margin-left: -4px;
    border-radius: 50%; background: #FFFFFF; box-shadow: inset 0 1px 2px rgba(0,0,0,.5);
}
.plate--sep { width: 18px; background: transparent; box-shadow: none; color: #1D2124; }
.plate--sep::before { display: none; }
.board-best { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; margin-top: 14px; padding-top: 14px; border-top: 2px solid #D5D8D6; }
.board-best .board-words { font-size: 18px; }
.board-best .plates { margin: 0; gap: 5px; }
.board-best .plate { width: 36px; height: 50px; font-size: 38px; }
.board-best .plate::before { top: 4px; width: 5px; height: 5px; margin-left: -2.5px; }
.board-note { font-size: 14px; color: #4A5157; margin-top: 12px; }
.board-note a { color: #174D8C; }

.board-rows { display: grid; grid-auto-rows: 1fr; }
.board-row {
    display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 16px; align-items: center;
    padding: 14px 24px; border-bottom: 2px solid #D5D8D6; color: inherit; text-decoration: none;
}
.board-row:last-child { border-bottom: 0; }
a.board-row:hover { background: #F4F5F3; }
.board-row .plates { margin: 0; gap: 5px; }
.board-row .plate { width: 44px; height: 60px; font-size: 46px; }
.board-row .plate::before { top: 5px; width: 6px; height: 6px; margin-left: -3px; }
.board-row .plate--sep { width: 12px; }
.plates--red .plate:not(.plate--sep) { background: #C4161C; }
.plates--green .plate:not(.plate--sep) { background: #1E7A46; }
.board-row .label { font-family: var(--font-head); font-weight: 700; font-size: 21px; line-height: 1.1; text-transform: uppercase; letter-spacing: .8px; }
.board-row .detail { font-size: 14px; color: #4A5157; margin-top: 3px; }
.board-row .detail.warn { color: #A11217; font-weight: 700; }
.board-tape {
    height: 14px;
    background: repeating-linear-gradient(-45deg, #F5C400 0 16px, #1D2124 16px 32px);
    border-top: 3px solid #2B3134;
}

/* ── DASHBOARD LOWER GRID ──────────────────────────────── */
.dash-grid { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(300px, 1fr); gap: 0 20px; align-items: start; }
.worklist { list-style: none; margin: 0; padding: 0; }
.worklist li { display: grid; grid-template-columns: 84px minmax(0, 1fr); gap: 14px; padding: 12px 18px; border-bottom: 1px solid var(--rule); }
.worklist li:last-child { border-bottom: 0; }
.worklist .late { font-family: var(--font-head); font-weight: 700; font-size: 26px; line-height: 1; color: var(--red-ink); font-variant-numeric: tabular-nums; }
.worklist .late small { display: block; font-family: var(--font-body); font-size: 12.5px; font-weight: 700; margin-top: 3px; }
.worklist .what { font-size: 15px; }
.worklist .who { font-size: 13.5px; color: var(--ink-3); margin-top: 3px; display: flex; flex-wrap: wrap; gap: 4px 12px; }
.worklist .empty-ok { grid-template-columns: 1fr; color: var(--green-ink); font-weight: 700; }

.side-list { list-style: none; margin: 0; padding: 0; }
.side-list li { padding: 10px 18px; border-bottom: 1px solid var(--rule); display: flex; justify-content: space-between; gap: 12px; align-items: baseline; }
.side-list li:last-child { border-bottom: 0; }
.side-list .primary { font-weight: 700; }
.side-list .secondary { font-size: 13.5px; color: var(--ink-3); }
.side-list .right { text-align: right; white-space: nowrap; flex: none; }
.side-empty { padding: 12px 18px; color: var(--ink-3); }

/* Incident trend chart */
.chart { padding: 16px 18px 12px; }
.chart-legend { display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: 13.5px; color: var(--ink-2); margin-bottom: 12px; }
.chart-legend span { display: inline-flex; align-items: center; gap: 6px; }
.chart-legend i { width: 12px; height: 12px; border-radius: 2px; display: inline-block; }
.bars { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 10px; height: 180px; align-items: end; border-bottom: 1px solid var(--rule-strong); position: relative; }
.bar { height: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: stretch; gap: 2px; position: relative; }
.bar .seg { display: block; min-height: 3px; }
.bar .seg:first-of-type { border-radius: 4px 4px 0 0; }
.bar .total { text-align: center; font-family: var(--font-head); font-weight: 600; font-size: 15px; color: var(--ink-2); margin-bottom: 2px; }
.bar:hover .seg { filter: brightness(1.08); }
.seg-lti { background: var(--red); }
.seg-mti { background: var(--orange); }
.seg-fa { background: var(--ink-3); }
.seg-other { background: var(--rule-strong); }
.bar-labels { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 10px; margin-top: 6px; font-size: 13px; color: var(--ink-3); text-align: center; }
.bar-labels .yr { display: block; font-size: 12px; color: var(--ink-2); font-weight: 700; }

/* ── LOGIN ─────────────────────────────────────────────── */
.login {
    min-height: 100vh; display: grid; place-items: center; padding: 24px 16px;
}
.login-card { width: 100%; max-width: 420px; background: var(--board); border: 1px solid var(--rule); border-radius: 6px; overflow: hidden; }
.login-head { background: #1E7A46; color: #fff; padding: 22px 26px 20px; display: flex; gap: 14px; align-items: center; }
.login-head .brand-mark { background: #fff; }
.login-head .brand-mark::before, .login-head .brand-mark::after { background: #1E7A46; }
.login-head h1 { font-family: var(--font-head); font-weight: 700; font-size: 28px; line-height: 1; }
.login-head p { font-size: 14px; opacity: .92; margin-top: 4px; }
.login-body { padding: 24px 26px 8px; }
.login-body .btn { width: 100%; justify-content: center; padding: 11px 14px; font-size: 15px; }
.login-foot { padding: 14px 26px 20px; font-size: 13.5px; color: var(--ink-3); }

/* ── RESPONSIVE ────────────────────────────────────────── */
@media (max-width: 1180px) {
    .dash-grid { grid-template-columns: minmax(0, 1fr); }
    .board-body { grid-template-columns: minmax(0, 1fr); }
    .board-record { border-right: 0; border-bottom: 3px solid #2B3134; }
}
@media (max-width: 900px) {
    .app { grid-template-columns: minmax(0, 1fr); }
    .topbar {
        display: flex; align-items: center; justify-content: space-between; gap: 12px;
        position: sticky; top: 0; z-index: 30;
        background: var(--board); border-bottom: 1px solid var(--rule); padding: 10px 16px;
    }
    .topbar .brand { padding: 0; }
    .topbar .brand-mark { width: 32px; height: 32px; }
    .topbar .brand-mark::before { width: 18px; height: 6px; }
    .topbar .brand-mark::after { width: 6px; height: 18px; }
    .sidebar {
        position: fixed; inset: 0 auto 0 0; width: min(300px, 86vw); z-index: 40;
        transform: translateX(-102%); transition: transform .2s ease;
        box-shadow: 8px 0 24px rgba(0,0,0,.18);
    }
    body.nav-open .sidebar { transform: none; }
    .scrim { display: none; }
    body.nav-open .scrim { display: block; position: fixed; inset: 0; background: rgba(0,0,0,.35); z-index: 35; }
    .main { padding: 20px 16px 48px; }
    .page-head h1 { font-size: 30px; }
    .grid-3, .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .grid-4 > .btn { grid-column: 1 / -1; justify-self: start; }
}
@media (max-width: 560px) {
    body { font-size: 15px; }
    .grid-2, .grid-3, .grid-4 { grid-template-columns: minmax(0, 1fr); }
    .filters .field { max-width: none; flex-basis: 100%; }
    .board-head { padding: 10px 18px; }
    .board-head h2 { font-size: 21px; }
    .board-record { padding: 18px 16px 18px; }
    .board-words { font-size: 18px; }
    .plates { gap: 6px; }
    .plate { width: 60px; height: 82px; font-size: 64px; }
    .board-row { padding: 12px 16px; gap: 12px; }
    .board-row .plate { width: 36px; height: 50px; font-size: 38px; }
    .board-row .label { font-size: 17px; }
    .bars, .bar-labels { gap: 4px; }
    .bar .total { font-size: 13px; }
    .bar-labels { font-size: 11.5px; }
    .worklist li { grid-template-columns: 64px minmax(0, 1fr); padding: 12px 14px; }
    .counts .count { flex: 1 1 45%; border-bottom: 1px solid var(--rule); }
    .panel-head, .panel-body { padding-left: 14px; padding-right: 14px; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
}

@media print {
    .sidebar, .topbar, .page-actions, .filters, .row-actions { display: none !important; }
    .app { display: block; }
    body { background: #fff; }
}
