
:root {
    --bg: #f1f5f9;
    --panel: #ffffff;
    --surface: #ffffff;
    --ink: #0f172a;
    --muted: #64748b;
    --muted-strong: #475569;
    --line: #e2e8f0;
    --brand: #0ea5e9;
    --brand-ink: #0369a1;
    --brand-hover: #075985;
    --brand-soft: rgba(14, 165, 233, .18);
    --brand-halo: rgba(14, 165, 233, .14);
    --brand-ring: rgba(14, 165, 233, .35);
    --sidebar: #0f172a;
    --sidebar-ink: #94a3b8;
    --sidebar-strong: #ffffff;
    --sidebar-hover: rgba(255, 255, 255, .06);
    --sidebar-line: rgba(255, 255, 255, .09);
    --on-dark: #ffffff;
    --danger: #dc2626;
    --danger-hover: #b91c1c;
    --ok: #15803d;
    --ok-bright: #22c55e;
    --warn: #b45309;
    --warn-bright: #f59e0b;
    --table-head: #f8fafc;
    --row-hover: #f8fafc;
    --ghost-hover: #f8fafc;
    --badge-bg: #e2e8f0;
    --badge-ink: #334155;
    --alert-error-bg: #fef2f2;
    --alert-error-ink: #991b1b;
    --alert-error-line: #fecaca;
    --alert-info-bg: #f0f9ff;
    --alert-info-ink: #075985;
    --alert-info-line: #bae6fd;
    --deep: #0b1220;
    --glow-a: rgba(14, 165, 233, .22);
    --glow-b: rgba(37, 99, 235, .18);
    --stamp-bg: rgba(2, 6, 23, .72);
    --stamp-ink: #e2e8f0;
    --modal-backdrop: rgba(2, 6, 23, .55);
    --radius: 14px;
    --shadow: 0 1px 2px rgba(15, 23, 42, .06), 0 10px 30px -16px rgba(15, 23, 42, .35);
}

/* Seasonal palettes are applied by /assets/app.js from the current month. */
html[data-season="spring"] {
    --bg: #f0fdf4;
    --panel: #ffffff;
    --surface: #ffffff;
    --ink: #14532d;
    --muted: #4d7c5a;
    --muted-strong: #365b41;
    --line: #d5f2df;
    --brand: #22c55e;
    --brand-ink: #15803d;
    --brand-hover: #166534;
    --brand-soft: rgba(34, 197, 94, .18);
    --brand-halo: rgba(34, 197, 94, .14);
    --brand-ring: rgba(34, 197, 94, .35);
    --sidebar: #14532d;
    --sidebar-ink: #bbf7d0;
    --sidebar-hover: rgba(255, 255, 255, .08);
    --sidebar-line: rgba(255, 255, 255, .14);
    --danger: #dc2626;
    --danger-hover: #b91c1c;
    --ok: #15803d;
    --ok-bright: #4ade80;
    --warn: #b45309;
    --warn-bright: #fbbf24;
    --table-head: #ecfdf5;
    --row-hover: #f0fdf4;
    --ghost-hover: #f0fdf4;
    --badge-bg: #dcfce7;
    --badge-ink: #166534;
    --alert-info-bg: #f0fdf4;
    --alert-info-ink: #166534;
    --alert-info-line: #bbf7d0;
    --deep: #052e16;
    --glow-a: rgba(34, 197, 94, .24);
    --glow-b: rgba(16, 185, 129, .18);
    --stamp-bg: rgba(5, 46, 22, .75);
}
html[data-season="summer"] {
    --bg: #eff6ff;
    --panel: #ffffff;
    --surface: #ffffff;
    --ink: #0c2340;
    --muted: #52657f;
    --muted-strong: #334155;
    --line: #d7e8fb;
    --brand: #0284c7;
    --brand-ink: #0369a1;
    --brand-hover: #075985;
    --brand-soft: rgba(2, 132, 199, .18);
    --brand-halo: rgba(2, 132, 199, .14);
    --brand-ring: rgba(2, 132, 199, .35);
    --sidebar: #0c4a6e;
    --sidebar-ink: #bae6fd;
    --sidebar-hover: rgba(255, 255, 255, .08);
    --sidebar-line: rgba(255, 255, 255, .14);
    --danger: #dc2626;
    --danger-hover: #b91c1c;
    --ok: #15803d;
    --ok-bright: #34d399;
    --warn: #c2410c;
    --warn-bright: #fbbf24;
    --table-head: #e0f2fe;
    --row-hover: #f0f9ff;
    --ghost-hover: #eff6ff;
    --badge-bg: #dbeafe;
    --badge-ink: #1e40af;
    --alert-info-bg: #eff6ff;
    --alert-info-ink: #075985;
    --alert-info-line: #bae6fd;
    --deep: #082f49;
    --glow-a: rgba(14, 165, 233, .26);
    --glow-b: rgba(251, 191, 36, .18);
    --stamp-bg: rgba(8, 47, 73, .75);
}
html[data-season="fall"] {
    --bg: #fffbeb;
    --panel: #fffdf7;
    --surface: #ffffff;
    --ink: #431407;
    --muted: #78550f;
    --muted-strong: #57534e;
    --line: #f3dfa6;
    --brand: #d97706;
    --brand-ink: #b45309;
    --brand-hover: #92400e;
    --brand-soft: rgba(217, 119, 6, .18);
    --brand-halo: rgba(217, 119, 6, .14);
    --brand-ring: rgba(217, 119, 6, .35);
    --sidebar: #431407;
    --sidebar-ink: #fed7aa;
    --sidebar-strong: #fff7ed;
    --sidebar-hover: rgba(255, 255, 255, .08);
    --sidebar-line: rgba(255, 255, 255, .14);
    --danger: #b91c1c;
    --danger-hover: #991b1b;
    --ok: #4d7c0f;
    --ok-bright: #a3e635;
    --warn: #c2410c;
    --warn-bright: #fb923c;
    --table-head: #fef3c7;
    --row-hover: #fffbeb;
    --ghost-hover: #fffbeb;
    --badge-bg: #fef3c7;
    --badge-ink: #92400e;
    --alert-info-bg: #fffbeb;
    --alert-info-ink: #92400e;
    --alert-info-line: #fde68a;
    --deep: #2a1003;
    --glow-a: rgba(217, 119, 6, .24);
    --glow-b: rgba(180, 83, 9, .18);
    --stamp-bg: rgba(42, 16, 3, .75);
}
html[data-season="winter"] {
    --bg: #f8fafc;
    --panel: #ffffff;
    --surface: #ffffff;
    --ink: #0f172a;
    --muted: #526076;
    --muted-strong: #334155;
    --line: #dde5ef;
    --brand: #6366f1;
    --brand-ink: #4338ca;
    --brand-hover: #3730a3;
    --brand-soft: rgba(99, 102, 241, .18);
    --brand-halo: rgba(99, 102, 241, .14);
    --brand-ring: rgba(99, 102, 241, .35);
    --sidebar: #1e293b;
    --sidebar-ink: #cbd5e1;
    --sidebar-hover: rgba(255, 255, 255, .08);
    --sidebar-line: rgba(255, 255, 255, .14);
    --danger: #dc2626;
    --danger-hover: #b91c1c;
    --ok: #0f766e;
    --ok-bright: #2dd4bf;
    --warn: #b45309;
    --warn-bright: #fbbf24;
    --table-head: #f1f5f9;
    --row-hover: #f8fafc;
    --ghost-hover: #f8fafc;
    --badge-bg: #e2e8f0;
    --badge-ink: #334155;
    --alert-info-bg: #f8fafc;
    --alert-info-ink: #4338ca;
    --alert-info-line: #c7d2fe;
    --deep: #0f172a;
    --glow-a: rgba(99, 102, 241, .22);
    --glow-b: rgba(56, 189, 248, .18);
    --stamp-bg: rgba(15, 23, 42, .75);
}
* { box-sizing: border-box; }
html { height: 100%; }
body {
    margin: 0;
    min-height: 100%;
    font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background: var(--bg);
    color: var(--ink);
    -webkit-font-smoothing: antialiased;
}
a { color: var(--brand-ink); }
h1 { margin: 0 0 1.25rem; font-size: 1.55rem; letter-spacing: -.02em; }
h3 { margin: 0 0 .85rem; font-size: 1.02rem; letter-spacing: -.01em; }
p { line-height: 1.55; }
.muted { color: var(--muted); }

/* ---- app shell ------------------------------------------------------- */
.layout { display: flex; min-height: 100vh; }
.sidebar {
    width: 248px;
    flex: 0 0 248px;
    display: flex;
    flex-direction: column;
    gap: 22px;
    padding: 22px 16px;
    background: var(--sidebar);
    color: var(--sidebar-ink);
    position: sticky;
    top: 0;
    height: 100vh;
}
.brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 0 8px;
    color: var(--on-dark);
    text-decoration: none;
    font-size: .82rem;
    font-weight: 700;
    letter-spacing: .12em;
}
.brand .dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: var(--brand);
    box-shadow: 0 0 0 4px var(--brand-soft);
}
.nav { display: flex; flex-direction: column; gap: 4px; }
.nav a {
    padding: 10px 12px;
    border-radius: 10px;
    color: var(--sidebar-ink);
    text-decoration: none;
    font-size: .92rem;
    font-weight: 500;
}
.nav a:hover { background: var(--sidebar-hover); color: var(--on-dark); }
.nav a[aria-current="page"] {
    color: var(--on-dark);
    background: linear-gradient(90deg, var(--brand-soft), transparent);
    box-shadow: inset 3px 0 0 var(--brand);
}
.sidebar-footer {
    margin-top: auto;
    padding-top: 16px;
    border-top: 1px solid var(--sidebar-line);
    font-size: .85rem;
}
.who { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 10px; }
.who-name { color: var(--on-dark); font-weight: 600; overflow: hidden; text-overflow: ellipsis; }
.signout { color: var(--sidebar-ink); text-decoration: none; font-size: .85rem; }
.signout:hover { color: var(--on-dark); }
.content { flex: 1; min-width: 0; padding: 30px 34px 52px; }
.wrap { max-width: 1120px; margin: 0 auto; }

/* ---- surfaces -------------------------------------------------------- */
.panel {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 22px;
    margin-bottom: 22px;
}
.grid { display: grid; gap: 16px; }
.grid.stats { grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); }
.stat { position: relative; overflow: hidden; }
.stat .label { font-size: .72rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.stat .value { margin-top: 8px; font-size: 1.9rem; font-weight: 700; letter-spacing: -.02em; }
.stat .value.ok { color: var(--ok); }
.stat::after {
    content: "";
    position: absolute;
    inset: auto 0 0 0;
    height: 3px;
    background: linear-gradient(90deg, var(--brand), transparent);
}
.stat.ok::after { background: linear-gradient(90deg, var(--ok-bright), transparent); }
.stat.warn::after { background: linear-gradient(90deg, var(--warn-bright), transparent); }
.stat.danger::after { background: linear-gradient(90deg, var(--danger), transparent); }

/* ---- forms ----------------------------------------------------------- */
label { display: block; margin-bottom: 6px; color: var(--muted); font-size: .85rem; font-weight: 600; }
input, select, button { font: inherit; }
.form-group { margin-bottom: 14px; }
.form-group input, .form-group select {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--line);
    border-radius: 9px;
    background: var(--surface);
    color: var(--ink);
}
.form-group input:focus, .form-group select:focus, td input:focus, td select:focus {
    outline: 2px solid var(--brand-ring);
    outline-offset: 1px;
    border-color: var(--brand);
}
.search-bar { display: flex; gap: 8px; margin-bottom: 20px; }
.search-bar input { flex: 1; max-width: 340px; padding: 9px 12px; border: 1px solid var(--line); border-radius: 9px; background: var(--surface); }

/* ---- buttons --------------------------------------------------------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 9px 16px;
    border: 1px solid transparent;
    border-radius: 9px;
    background: var(--brand-ink);
    color: var(--on-dark);
    text-decoration: none;
    font-size: .9rem;
    font-weight: 600;
    cursor: pointer;
    transition: background .15s ease, transform .05s ease;
}
.btn:hover { background: var(--brand-hover); }
.btn:active { transform: translateY(1px); }
.btn-danger { background: var(--danger); }
.btn-danger:hover { background: var(--danger-hover); }
.btn-muted { background: var(--muted); }
.btn-muted:hover { background: var(--muted-strong); }
.btn-ghost { background: transparent; color: var(--brand-ink); border-color: var(--line); }
.btn-ghost:hover { background: var(--ghost-hover); }
.btn-sm { padding: 6px 11px; font-size: .82rem; }
.actions { display: flex; gap: 6px; white-space: nowrap; }
.actions .btn[hidden] { display: none; }

/* ---- tables ---------------------------------------------------------- */
.table-wrap {
    overflow-x: auto;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--panel);
    box-shadow: var(--shadow);
}
table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: .92rem; }
th {
    position: sticky;
    top: 0;
    z-index: 1;
    padding: 11px 14px;
    text-align: left;
    background: var(--table-head);
    border-bottom: 1px solid var(--line);
    color: var(--muted);
    font-size: .72rem;
    font-weight: 700;
    letter-spacing: .07em;
    text-transform: uppercase;
}
td { padding: 10px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: var(--row-hover); }
td input, td select {
    width: 100%;
    padding: 7px 9px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
    color: var(--ink);
}
td input:disabled, td select:disabled {
    padding-left: 0;
    border-color: transparent;
    background: transparent;
    color: var(--ink);
    cursor: default;
    appearance: none;
    -webkit-appearance: none;
}
.empty { padding: 26px 14px !important; text-align: center; color: var(--muted); }

/* ---- badges & alerts -------------------------------------------------- */
.badge {
    display: inline-block;
    padding: 2px 9px;
    border-radius: 999px;
    font-size: .7rem;
    font-weight: 700;
    letter-spacing: .06em;
    text-transform: uppercase;
    background: var(--badge-bg);
    color: var(--badge-ink);
}
.badge-admin { background: #fee2e2; color: #991b1b; }
.badge-operator { background: #dbeafe; color: #1e40af; }
.badge-viewer { background: var(--badge-bg); color: var(--badge-ink); }
.alert { padding: 11px 14px; border-radius: 10px; font-size: .9rem; margin-bottom: 16px; }
.alert-error { background: var(--alert-error-bg); color: var(--alert-error-ink); border: 1px solid var(--alert-error-line); }
.alert-info { background: var(--alert-info-bg); color: var(--alert-info-ink); border: 1px solid var(--alert-info-line); }

/* ---- login ------------------------------------------------------------ */
.login-page {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 24px;
    background:
        radial-gradient(700px 400px at 15% 0%, var(--glow-a), transparent 60%),
        radial-gradient(600px 500px at 90% 100%, var(--glow-b), transparent 60%),
        var(--deep);
}
.login-card {
    width: min(400px, 100%);
    background: var(--panel);
    border-radius: 18px;
    box-shadow: 0 30px 70px -30px rgba(0, 0, 0, .65);
    padding: 30px 30px 26px;
}
.login-card .brand { color: var(--ink); padding: 0; margin-bottom: 6px; }
.login-card .brand .dot { box-shadow: 0 0 0 4px var(--brand-halo); }
.login-card h1 { font-size: 1.35rem; margin: 4px 0 4px; }
.login-card .btn { width: 100%; padding: 11px; margin-top: 4px; }
.login-hint { margin-top: 16px; font-size: .78rem; color: var(--muted); text-align: center; }

/* ---- public landing --------------------------------------------------- */
.public-header { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 28px; }
.public-header .brand { color: var(--ink); padding: 0; }
.public-hero { padding: 34px; }
.public-hero h1 { font-size: 2rem; margin-bottom: .5rem; }
.public-hero .lede { font-size: 1.02rem; color: var(--muted); max-width: 60ch; margin-top: 0; }
.public-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 22px; }
.public-grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); margin-top: 22px; }
.public-grid .panel { margin: 0; }

/* ---- operator console ------------------------------------------------- */
.op-cameras {
    display: grid;
    gap: 14px;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    margin-bottom: 10px;
}
.cam-tile {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 12px;
    overflow: hidden;
}
.cam-frame { position: relative; background: var(--deep); aspect-ratio: 16 / 9; }
.cam-frame img { width: 100%; height: 100%; object-fit: cover; display: block; }
.cam-stamp {
    position: absolute; left: 8px; top: 8px;
    background: var(--stamp-bg); color: var(--stamp-ink);
    padding: 3px 8px; border-radius: 6px; font-size: .72rem;
}
.cam-meta {
    display: flex; align-items: center; justify-content: space-between;
    gap: 8px; padding: 8px 10px; font-size: .8rem; color: var(--muted);
}
.op-form { display: flex; flex-wrap: wrap; gap: 14px; align-items: flex-end; }
.op-form .form-group { flex: 1 1 160px; margin-bottom: 0; }
.op-actions { display: flex; flex-wrap: wrap; gap: 5px; min-width: 240px; }
.op-actions form { margin: 0; }
.op-sms { display: flex; gap: 4px; }
.op-sms input[type="text"] { width: 130px; }

/* ---- toolbar, paging & modals ---------------------------------------- */
.toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 16px;
}
.filter-bar {
    display: flex;
    flex: 1 1 320px;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 10px;
}
.filter-bar input, .filter-bar select {
    padding: 8px 10px;
    border: 1px solid var(--line);
    border-radius: 9px;
    background: var(--surface);
    color: var(--ink);
}
.filter-bar input { max-width: 260px; }
.filter-bar label { margin-bottom: 0; }
.toolbar-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}
/* ---- searchable device picker (Issue Command popup) ------------------- */
.device-picker-row { display: flex; gap: 6px; }
.device-picker-row .js-device-search { flex: 1; }
.device-picker-row .js-device-toggle { flex: 0 0 auto; width: auto; padding: 8px 12px; }
.device-menu {
    position: absolute;
    z-index: 25;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    max-height: 300px;
    overflow: auto;
    padding: 6px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: var(--panel);
    box-shadow: var(--shadow);
}
.device-menu[hidden] { display: none; }
.device-option {
    display: flex;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 3px 8px;
    width: 100%;
    padding: 8px 10px;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: var(--ink);
    text-align: left;
    cursor: pointer;
}
.device-option:hover { background: var(--row-hover); }
.device-option[hidden] { display: none; }
.device-option strong { min-width: 3ch; }
.device-option .muted { font-size: .76rem; }

/* ---- searchable location picker (access page) ------------------------- */
.location-picker { margin-bottom: 16px; }
.location-menu {
    position: absolute;
    z-index: 20;
    top: calc(100% + 6px);
    left: 0;
    width: min(360px, 85vw);
    padding: 10px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--panel);
    box-shadow: var(--shadow);
}
.location-menu input[type="text"] {
    width: 100%;
    padding: 8px 10px;
    margin-bottom: 8px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
    color: var(--ink);
}
.location-list {
    max-height: 320px;
    overflow: auto;
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.location-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 7px 8px;
    border-radius: 8px;
    cursor: pointer;
}
.location-item:hover { background: var(--row-hover); }
.location-item[hidden] { display: none; }
.location-item input { width: auto; }
.location-item .muted { margin-left: auto; font-size: .75rem; }

.page-size {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: .82rem;
    color: var(--muted);
}
.page-size select {
    padding: 6px 8px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
    color: var(--ink);
}
.pager {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    padding: 14px 2px 0;
    font-size: .85rem;
    color: var(--muted);
}
.pager a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 32px;
    padding: 6px 10px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
    color: var(--brand-ink);
    text-decoration: none;
}
.pager a:hover { background: var(--brand-soft); border-color: var(--brand); }
.pager a.active {
    background: var(--brand-ink);
    border-color: var(--brand-ink);
    color: var(--on-dark);
    font-weight: 700;
}
.pager .disabled { padding: 6px 10px; opacity: .55; }

dialog.modal {
    width: min(560px, calc(100vw - 32px));
    max-height: calc(100vh - 48px);
    padding: 0;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--panel);
    color: var(--ink);
    box-shadow: var(--shadow);
    overflow: auto;
}
.modal::backdrop { background: var(--modal-backdrop); backdrop-filter: blur(2px); }
.modal form { margin: 0; padding: 22px; }
.modal h1, .modal h2, .modal h3 { margin-bottom: 16px; }
.modal-actions {
    display: flex;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 18px;
}
.modal-error {
    padding: 10px 12px;
    margin-bottom: 14px;
    border-radius: 9px;
    background: var(--alert-error-bg);
    color: var(--alert-error-ink);
    border: 1px solid var(--alert-error-line);
    font-size: .85rem;
}

/* ---- printing & export sheets ---------------------------------------- */
@page { size: A4; margin: 18mm 12mm; }
.print-sheet {
    max-width: 1000px;
    margin: 0 auto;
}
.print-sheet h1 {
    font-size: 1.5rem;
    margin-bottom: 6px;
}
.print-sheet .muted {
    margin: 0 0 18px;
    font-size: .85rem;
    color: var(--muted);
}
.print-sheet .report-brand {
    margin: 0 0 12px;
    text-align: center;
    font-size: 1rem;
    font-weight: 800;
    letter-spacing: .06em;
    color: var(--brand-ink);
}
.print-sheet .report-footer {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    margin-top: 18px;
    padding-top: 8px;
    border-top: 1px solid var(--line);
    font-size: .8rem;
    color: var(--muted);
}
.print-sheet .table-wrap {
    overflow: visible;
}

@media print {
    @page { size: A4; margin: 18mm 12mm; }
    html, body {
        background: #fff !important;
        color: #000 !important;
    }
    .sidebar, .toolbar, .pager, .page-size, .location-menu, .device-menu,
    dialog.modal, .modal, .btn, button,
    .js-print, .export-actions {
        display: none !important;
    }
    .layout, .wrap, .content {
        display: block !important;
        width: 100% !important;
        max-width: none !important;
        margin: 0 !important;
        padding: 0 !important;
        box-shadow: none !important;
        background: #fff !important;
    }
    .panel, .table-wrap {
        box-shadow: none !important;
        border: 0 !important;
        overflow: visible !important;
        background: #fff !important;
    }
    h1, h2, h3 { color: #000 !important; }
    table {
        width: 100% !important;
        min-width: 0 !important;
        border-collapse: collapse !important;
    }
    th, td {
        border: 1px solid #999 !important;
        padding: 4px 6px !important;
        color: #000 !important;
        background: #fff !important;
        font-size: 9pt;
        overflow-wrap: anywhere;
    }
    th { font-weight: 700 !important; }
    .print-sheet { max-width: none; padding: 8mm 0 10mm; }
    .print-sheet .muted { color: #444 !important; }
    .report-brand {
        position: fixed !important;
        top: 0;
        left: 0;
        right: 0;
        margin: 0 !important;
        color: #000 !important;
        font-size: 12pt !important;
        text-align: center !important;
    }
    /* Printed footers use @page margin boxes so the page counter is accurate;
       the on-screen flex footer would otherwise duplicate them. */
    .report-footer { display: none !important; }
    a[href]:after { content: "" !important; }
}

/* ---- responsive ------------------------------------------------------- */
@media (max-width: 860px) {
    .layout { flex-direction: column; }
    .sidebar {
        position: static;
        width: auto;
        height: auto;
        flex: none;
        flex-direction: row;
        flex-wrap: wrap;
        align-items: center;
        gap: 10px;
        padding: 14px 16px;
    }
    .brand { margin-right: 8px; }
    .nav { flex-direction: row; flex-wrap: wrap; }
    .nav a { padding: 8px 10px; font-size: .85rem; }
    .sidebar-footer { margin: 0 0 0 auto; padding: 0; border: 0; display: flex; align-items: center; gap: 12px; }
    .who { margin: 0; gap: 8px; }
    .content { padding: 22px 16px 44px; }
    table { min-width: 760px; }
    .public-hero { padding: 24px; }
}
