/* ==========================================================
   PROJECT WEST MIDLANDS - THEME
   One set of colours for the whole site, in light and dark.
   The <html> element gets data-theme="light" or "dark"
   (set in each page's <head>, changed with the toggle in the
   top bar). Load this AFTER every other stylesheet.
========================================================== */

:root,
:root[data-theme="dark"] {
    color-scheme: dark;

    --bg:          #121417;
    --surface:     #1B1F24;
    --surface-2:   #232830;
    --surface-3:   #2B313A;
    --hover:       rgba(255, 255, 255, .04);
    --line:        #2A3038;
    --line-2:      #3A414B;
    --text:        #DDE2E8;
    --text-strong: #F4F6F8;
    --muted:       #A7B0BB;

    --nav-bg:      #171A1F;
    --nav-line:    #0E1013;
    --subnav-bg:   #1B1F24;

    --ok:   #5BD38A;  --ok-bg:   rgba(91, 211, 138, .12);  --ok-line:   rgba(91, 211, 138, .32);
    --warn: #F1B84B;  --warn-bg: rgba(241, 184, 75, .12);  --warn-line: rgba(241, 184, 75, .34);
    --bad:  #F27C7C;  --bad-bg:  rgba(242, 124, 124, .12); --bad-line:  rgba(242, 124, 124, .34);
    --info: #7FA8F5;  --info-bg: rgba(127, 168, 245, .13); --info-line: rgba(127, 168, 245, .34);
    --neutral-bg: rgba(146, 154, 165, .14);
    --primary-light: var(--accent-l, #F3A46E);
    --accent-bg: rgba(var(--primary-rgb), .12);
    --accent-line: rgba(var(--primary-rgb), .35);

    --shadow: none;
    --shadow-lg: 0 10px 28px rgba(0, 0, 0, .5);
}

:root[data-theme="light"] {
    color-scheme: light;

    --bg:          #EDF0F4;
    --surface:     #FFFFFF;
    --surface-2:   #F5F7FA;
    --surface-3:   #E6EAF0;
    --hover:       rgba(20, 40, 75, .045);
    --line:        #D5DBE3;
    --line-2:      #BCC5D1;
    --text:        #1B2330;
    --text-strong: #0F1724;
    --muted:       #586273;

    --nav-bg:      #14284B;
    --nav-line:    #0E1E3A;
    --subnav-bg:   #FFFFFF;

    --ok:   #17803D;  --ok-bg:   #E2F4E8;  --ok-line:   #A9DDB9;
    --warn: #9A5B05;  --warn-bg: #FCF1DA;  --warn-line: #EDCB8A;
    --bad:  #B42323;  --bad-bg:  #FBE8E8;  --bad-line:  #F0B9B9;
    --info: #1F4FC4;  --info-bg: #E6EDFC;  --info-line: #B4C7F2;
    --neutral-bg: #ECEEF1;
    --primary-light: var(--accent-d, #C86D37);
    --accent-bg: rgba(var(--primary-rgb), .1);
    --accent-line: rgba(var(--primary-rgb), .35);

    --shadow: none;
    --shadow-lg: 0 10px 28px rgba(15, 30, 58, .18);
}

/* Older names used around the stylesheets - all point at the tokens above. */
:root {
    --primary: #E2834D;
    --primary-dark: #C86D37;
    --primary-rgb: 226, 131, 77;

    --background: var(--bg);
    --text-light: var(--muted);
    --border: var(--line);
    --ink: var(--text-strong);
    --navy: var(--nav-bg);
    --navy-dark: var(--nav-line);
    --success: var(--ok);
    --warning: var(--warn);
    --danger: var(--bad);

    --d-bg: var(--bg);
    --d-card: var(--surface);
    --d-card-2: var(--surface-2);
    --d-line: var(--line);
    --d-line-2: var(--line-2);
    --d-text: var(--text);
    --d-muted: var(--muted);

    --mdt-bg: var(--bg);
    --mdt-panel: var(--surface);
    --mdt-panel-2: var(--surface-2);
    --mdt-line: var(--line);
    --mdt-text: var(--text);
    --mdt-muted: var(--muted);

    --card: var(--surface);

    --radius: 6px;
    --font: "Inter", "Segoe UI", Roboto, Arial, sans-serif;
    --font-head: "Inter", "Segoe UI", Roboto, Arial, sans-serif;
    --check-blue: #1D4FA3;    /* PNC search buttons */
    --brand-line: 3px;         /* the PWM orange rule under the header */
    --mono: "IBM Plex Mono", ui-monospace, "Cascadia Mono", Consolas, monospace;
}

/* ---------- Base ---------- */



body { font-family: var(--font); }

/* App pages (the login page and homepage keep their own backgrounds) */
body.dark-app,
body.picker-page,
body[data-nav] {
    background: var(--bg);
    color: var(--text);
}

.mono, code, .dark-app .mono { font-family: var(--mono); }

input, select, textarea, button { font-family: inherit; }

::selection { background: rgba(var(--primary-rgb), .3); }

/* ---------- Shared header in both themes ---------- */

.topbar { background: var(--surface); border-bottom: 1px solid var(--line); }
.brand-text strong { color: var(--text-strong); }
.brand-text small { color: var(--muted); }
.topbar-link { color: var(--text); }
.topbar-link:hover { background: var(--hover); }
.mainnav { background: var(--nav-bg); border-bottom: 1px solid var(--nav-line); }
.search input { background: var(--surface); color: var(--text); border: 1px solid transparent; color-scheme: inherit; }
.search input::placeholder { color: var(--muted); }
.dropdown-menu { background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-lg); }
.dropdown-menu > a { color: var(--text); }
.dropdown-menu > a:hover { background: var(--hover); color: var(--text-strong); }
.dropdown-user strong { color: var(--text-strong); }
.dropdown-user span, .dropdown-head { color: var(--muted); }
.notification { color: var(--text); border-color: var(--line); }
.notification.unread { background: var(--accent-bg); }
.search-results { background: var(--surface); border-color: var(--line); box-shadow: var(--shadow-lg); }
.search-item:hover, .search-item.active { background: var(--hover); }

.theme-toggle { width: 38px; justify-content: center; padding: 0; }

.mode-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    height: 32px;
    padding: 0 12px;
    border: 1px solid var(--line);
    border-radius: 999px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
    white-space: nowrap;
}
.mode-chip:hover { border-color: var(--line-2); background: var(--hover); }
.mode-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--muted); }
.mode-civilian .mode-dot { background: #8A94A3; }
.mode-wmp .mode-dot { background: #2F5FD0; }
.mode-wmas .mode-dot { background: #1E9E52; }
.mode-wmfs .mode-dot { background: #D23B3B; }
.mode-nh .mode-dot { background: #E59A1C; }
.mode-none { border-style: dashed; color: var(--muted); }

/* ---------- Plain surfaces: no glows, no glass ---------- */

.panel, .d-card, .mdt-card, .in-stat, .d-stat, .civ-stat {
    box-shadow: var(--shadow);
}

.panel-head {
    background: var(--surface-2);
    color: var(--text-strong);
    border-bottom: 1px solid var(--line);
}
.panel-head .head-action { background: var(--primary); color: #fff; }
.panel-head .head-link { color: var(--primary); }

.toast { background: var(--surface); color: var(--text); border: 1px solid var(--line); box-shadow: var(--shadow-lg); }

.modal, .in-modal-box { background: var(--surface); color: var(--text); border: 1px solid var(--line); }
.modal-head { background: var(--surface-2); color: var(--text-strong); border-bottom: 1px solid var(--line); }
.overlay { background: rgba(5, 8, 12, .55); }

.field input, .field select, .field textarea,
.input, .mdt-input, .in-form input, .in-form select, .in-form textarea, .d-form input {
    background: var(--surface);
    color: var(--text);
    border-color: var(--line-2);
}

.table th { background: var(--surface-2); color: var(--muted); border-color: var(--line); }
.table td { border-color: var(--line); }

.message-page { padding-top: 40px; }

@media (max-width: 980px) {
    .mode-chip { padding: 0 10px; font-size: 12px; }
}

@media (max-width: 640px) {
    .mode-chip { max-width: 120px; overflow: hidden; text-overflow: ellipsis; }
}

/* Homepage nav toggle */
.home-theme { background: none; border: 1px solid rgba(255, 255, 255, .35); color: #fff; width: 34px; height: 34px; border-radius: 6px; cursor: pointer; }
.home-theme:hover { border-color: #fff; }

.mode-short { display: none; }
@media (max-width: 640px) {
    .brand-text { display: none; }
    .mode-long { display: none; }
    .mode-short { display: inline; }
    .mode-chip { max-width: none; padding: 0 9px; }
    .topbar-actions { gap: 4px; }
    .theme-toggle { width: 32px; }
}

/* Footer sits at the bottom on short pages */
body > main { flex: 1 0 auto; }

/* Busy (purple) readable on light backgrounds */
:root[data-theme="light"] .u-busy { color: #5B21B6; background: #EDE9FE; }
:root[data-theme="light"] .status-btn.u-busy:not(.active) { color: #5B21B6; }

/* ---------- Live alerts (panic / backup / control) ---------- */

.ops-alerts {
    position: fixed;
    top: 12px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 900;
    width: min(620px, calc(100vw - 24px));
    display: flex;
    flex-direction: column;
    gap: 8px;
    pointer-events: none;
}

.ops-alert {
    pointer-events: auto;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    border-radius: 8px;
    background: var(--surface);
    color: var(--text);
    border: 1px solid var(--line-2);
    border-left: 5px solid var(--info);
    box-shadow: var(--shadow-lg);
    font-size: 14px;
}

.ops-alert > i { font-size: 20px; color: var(--info); flex-shrink: 0; }
.ops-alert-text { flex: 1; min-width: 0; }
.ops-alert-text strong { display: block; font-size: 14px; color: var(--text-strong); }
.ops-alert-text span { display: block; font-size: 13px; color: var(--text); margin-top: 2px; }
.ops-alert-actions { display: flex; gap: 6px; align-items: center; flex-shrink: 0; }
.ops-alert-actions a,
.ops-alert-actions button {
    font: inherit; font-size: 12px; font-weight: 600; padding: 6px 10px; border-radius: 6px; cursor: pointer;
    border: 1px solid var(--line-2); background: var(--surface-2); color: var(--text);
}
.ops-alert-actions [data-dismiss] { font-size: 18px; line-height: 1; padding: 2px 8px; }

.ops-alert.warn   { border-left-color: var(--warn); } .ops-alert.warn > i { color: var(--warn); }
.ops-alert.ok     { border-left-color: var(--ok); }   .ops-alert.ok > i { color: var(--ok); }
.ops-alert.urgent { border-left-color: var(--bad); }  .ops-alert.urgent > i { color: var(--bad); }

.ops-alert.panic {
    background: #B91C1C;
    border-color: #7F1D1D;
    color: #fff;
    animation: panicPulse 1s ease-in-out infinite;
}
.ops-alert.panic > i, .ops-alert.panic strong, .ops-alert.panic span { color: #fff; }
.ops-alert.panic .ops-alert-actions button { background: #fff; color: #7F1D1D; border-color: #fff; }

@keyframes panicPulse { 50% { background: #7F1D1D; } }

.ops-alerts.compact { top: 6px; width: calc(100vw - 12px); }
.ops-alerts.compact .ops-alert { padding: 8px 10px; font-size: 12px; gap: 8px; }
.ops-alerts.compact .ops-alert-text strong { font-size: 12px; }
.ops-alerts.compact .ops-alert-text span { font-size: 11px; }

@media (prefers-reduced-motion: reduce) { .ops-alert.panic { animation: none; } }
.appeal-text { margin: 4px 0 0; font-size: 13px; color: var(--text); white-space: pre-wrap; }
#tipForm, .panel-body > .form-hint + form { margin-top: 10px; }

/* ==========================================================
   PURSUITS / CUSTODY / POUND (MDT + CAD)
========================================================== */

.pursuit-card { border: 1px solid var(--bad-line); border-left: 4px solid var(--bad); background: var(--surface); border-radius: 4px; padding: 12px 14px; margin-bottom: 12px; }
.pursuit-card header { display: flex; gap: 12px; align-items: flex-start; }
.pursuit-card header > div { flex: 1; min-width: 0; }
.pursuit-card header strong { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; color: var(--text-strong); }
.pursuit-card header small { display: block; color: var(--muted); font-size: 12px; margin-top: 3px; }
.pursuit-live { display: inline-flex; align-items: center; gap: 6px; font: 700 11px/1 var(--mono, monospace); letter-spacing: .08em; color: var(--bad); padding: 5px 7px; border: 1px solid var(--bad-line); border-radius: 3px; background: var(--bad-bg); white-space: nowrap; }
.pursuit-live span { width: 8px; height: 8px; border-radius: 50%; background: var(--bad); animation: pwm-blink 1s steps(2) infinite; }
@keyframes pwm-blink { 50% { opacity: .2; } }
.pursuit-tactics { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.tactic { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; padding: 4px 8px; border-radius: 3px; border: 1px solid var(--line); background: var(--surface-2); }
.tactic.requested { border-color: var(--warn-line); background: var(--warn-bg); color: var(--warn); }
.tactic.authorised { border-color: var(--ok-line); background: var(--ok-bg); color: var(--ok); }
.tactic.refused { border-color: var(--line); color: var(--muted); text-decoration: line-through; }
.pursuit-log { list-style: none; margin: 10px 0 0; padding: 0; font-size: 13px; max-height: 190px; overflow: auto; }
.pursuit-log li { padding: 4px 0; border-bottom: 1px dashed var(--line); }
.pursuit-log li:last-child { border-bottom: 0; }
.pursuit-log time { font-family: var(--mono, monospace); color: var(--muted); font-size: 12px; margin-right: 4px; }
.pursuit-update { display: flex; gap: 8px; margin-top: 10px; }
.pursuit-update .mdt-input { flex: 1; }
.pursuit-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; align-items: center; }
.pursuit-actions .mdt-input { width: auto; flex: 1 1 170px; padding: 6px 8px; font-size: 13px; }
.pursuit-none { display: flex; gap: 10px; align-items: center; padding: 8px 0; }

.mdt-tabs em.hot { background: var(--bad); color: #fff; }

.custody-row { display: grid; grid-template-columns: auto 1fr auto auto; gap: 12px; align-items: start; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.custody-row:last-child { border-bottom: 0; }
.custody-row.due { background: var(--warn-bg); }
.cell-no { font: 700 14px/1 var(--mono, monospace); padding: 8px 9px; border-radius: 3px; background: var(--surface-3); color: var(--text-strong); }
.custody-main strong { color: var(--text-strong); }
.custody-main small { display: block; color: var(--muted); font-size: 12px; margin-top: 2px; }
.custody-main details { margin-top: 6px; font-size: 13px; }
.custody-main summary { cursor: pointer; color: var(--muted); font-size: 12px; }
.custody-clock { text-align: right; font-family: var(--mono, monospace); }
.custody-clock b { display: block; font-size: 16px; color: var(--text-strong); }
.custody-clock .marker { margin-top: 4px; display: inline-block; }
.custody-actions { display: flex; flex-direction: column; gap: 6px; }
.custody-form { grid-column: 1 / -1; display: grid; gap: 8px; padding: 10px; border: 1px solid var(--line); border-radius: 4px; background: var(--surface-2); }
.custody-form[hidden] { display: none; }
.custody-form .row { display: flex; gap: 8px; justify-content: flex-end; }
.custody-form [hidden] { display: none; }
.mdt-card-body .pad, p.pad { padding: 16px; margin: 0; }
#view-custody .mdt-card { margin-bottom: 16px; }

@media (max-width: 700px) {
    .custody-row { grid-template-columns: auto 1fr; }
    .custody-clock { text-align: left; }
    .custody-actions { flex-direction: row; grid-column: 1 / -1; }
}

/* CAD has no MDT stylesheet - give the shared pursuit widgets the basics. */
.cad-pursuits { margin-bottom: 18px; border-color: var(--bad-line); }
.cad-pursuits .mdt-btn { display: inline-flex; align-items: center; gap: 6px; padding: 6px 10px; font: 700 12px/1.2 inherit; border-radius: 3px; border: 1px solid var(--line-2); background: var(--surface-2); color: var(--text); cursor: pointer; }
.cad-pursuits .mdt-btn.primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.cad-pursuits .mdt-btn.danger { color: var(--bad); border-color: var(--bad-line); background: var(--bad-bg); }
.cad-pursuits .mdt-input { padding: 7px 9px; font: inherit; font-size: 13px; color: var(--text); background: var(--surface); border: 1px solid var(--line-2); border-radius: 3px; }
.cad-pursuits .plate { font-family: var(--mono, monospace); font-weight: 700; background: #F4C430; color: #111; padding: 1px 6px; border-radius: 3px; border: 1.5px solid #111; font-size: 12px; }
.cad-pursuits .sub-head { margin: 14px 0 6px; font-size: 12px; font-weight: 700; color: var(--muted); }
.cad-pursuits .pnc-records { list-style: none; margin: 0; padding: 0; }
.cad-pursuits .pnc-records li { display: flex; gap: 10px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--line); }
.cad-pursuits .pnc-records small { display: block; color: var(--muted); font-size: 12px; }
.cad-pursuits .rec-type { font: 700 11px/1 var(--mono, monospace); padding: 4px 6px; border-radius: 3px; background: var(--surface-3); }
.cad-pursuits .mdt-muted { color: var(--muted); }

/* ==========================================================
   CIVILIAN: pound, court, news
========================================================== */

.seized-box { display: flex; gap: 10px; align-items: flex-start; margin: 10px 0 4px; padding: 10px 12px; border: 1px solid var(--bad-line); background: var(--bad-bg); border-radius: 4px; color: var(--text); }
.seized-box > i { color: var(--bad); margin-top: 3px; }
.seized-box b { color: var(--bad); }
.seized-box small { display: block; color: var(--muted); font-size: 12px; margin: 2px 0 8px; }
.hearing-line { color: var(--info) !important; font-weight: 600; }
.hearing-line i { margin-right: 3px; }

.news-layout { grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); }
.news-item { padding: 14px 0; border-bottom: 1px solid var(--line); }
.news-item:first-child { padding-top: 0; }
.news-item:last-child { border-bottom: 0; }
.news-item header { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.news-item header small { color: var(--muted); font-size: 12px; margin-left: auto; }
.news-kind { font-size: 11px; font-weight: 700; color: var(--muted); }
.news-item.kind-police .news-kind, .news-item.kind-appeal .news-kind { color: var(--info); }
.news-item.kind-business .news-kind { color: var(--primary-light); }
.news-item h3 { margin: 6px 0 4px; font-size: 16px; color: var(--text-strong); }
.news-item p { margin: 0 0 8px; white-space: pre-wrap; color: var(--text); font-size: 14px; line-height: 1.5; }
@media (max-width: 860px) { .news-layout { grid-template-columns: 1fr; } }

/* ==========================================================
   DUTY: shift report chips + complaints
========================================================== */

.shift-chips { flex-basis: 100%; display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.shift-chip { font-size: 12px; padding: 2px 8px; border-radius: 10px; background: var(--surface-3); color: var(--muted); }
.shift-chip b { color: var(--text-strong); }
.d-list li:has(.shift-chips) { flex-wrap: wrap; }
.d-list.complaints li { align-items: flex-start; gap: 14px; }
.complaint-main { flex: 1; min-width: 0; }
.complaint-main p { margin: 6px 0; white-space: pre-wrap; }
.complaint-main small { display: block; color: var(--muted); font-size: 12px; }
.complaint-form { margin-top: 10px; padding: 10px; border: 1px solid var(--line); border-radius: 4px; background: var(--surface-2); }

/* ==========================================================
   HOMEPAGE: live status strip
========================================================== */

.live-status { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 0; max-width: 1200px; margin: 0 auto;
    background: var(--surface); border: 1px solid var(--line); border-radius: 6px; box-shadow: var(--shadow-lg); padding: 0; }
.ls-wrap { position: relative; z-index: 2; margin-top: -36px; padding: 0 16px; background: linear-gradient(to bottom, transparent 36px, var(--surface) 36px); }
.ls-item { padding: 16px 20px; border-right: 1px solid var(--line); min-width: 0; }
.ls-item:last-child { border-right: 0; }
.ls-item small { display: block; font-size: 11px; color: var(--muted); font-weight: 700; }
.ls-item strong { display: block; margin-top: 4px; font-size: 18px; color: var(--text-strong); font-weight: 700; overflow: hidden; text-overflow: ellipsis; }
.ls-sub { display: block; font-size: 12px; font-weight: 500; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ls-server { display: flex; gap: 12px; align-items: center; }
.ls-dot { width: 12px; height: 12px; border-radius: 50%; background: var(--muted); flex-shrink: 0; }
.ls-dot.on { background: var(--ok); box-shadow: 0 0 0 4px var(--ok-bg); }
.ls-dot.off { background: var(--bad); box-shadow: 0 0 0 4px var(--bad-bg); }
.news-meta { display: block; margin-top: 10px; font-size: 12px; color: var(--muted); }
@media (max-width: 900px) {
    .live-status { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .ls-wrap { margin-top: -24px; background: linear-gradient(to bottom, transparent 24px, var(--surface) 24px); }
    .ls-item { border-bottom: 1px solid var(--line); }
    .ls-item:nth-child(2n) { border-right: 0; }
    .ls-next { grid-column: 1 / -1; border-bottom: 0; }
}

/* Homepage: stop the about image / reveal animation pushing the page sideways on phones */
.about { overflow-x: clip; }
.about-image img { max-width: 100%; height: auto; }

/* ==========================================================
   DESIGN SYSTEM (Nov 2026 overhaul)
   Force navy + a PWM orange rule, square edges, no shadows,
   Barlow type. Everything below overrides the older sheets.
========================================================== */

body { font-family: var(--font); font-size: 15px; line-height: 1.5; -webkit-font-smoothing: antialiased; }
h1, h2, h3, h4, .page-title h1, .civ-head h1, .in-main h1 { font-family: var(--font-head); letter-spacing: 0; }
h1 { font-weight: 700; }
h2, h3 { font-weight: 600; }
:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }

/* ---------- Header: one navy block with a thin orange rule under it ---------- */

#pwm-header { position: relative; z-index: 120; }
.topbar { background: var(--nav-bg); border-bottom: 1px solid rgba(255, 255, 255, .08); }
.topbar-inner { height: 60px; }
.brand-mark { width: 38px; height: 38px; border-radius: 3px; background: rgba(255, 255, 255, .08); }
.brand-mark img { width: 26px; height: 26px; }
.brand-text strong { color: #fff; font-family: var(--font-head); font-size: 17px; font-weight: 700; letter-spacing: 0; }
.brand-text small { color: rgba(255, 255, 255, .62); font-size: 12.5px; }
.topbar-link { color: rgba(255, 255, 255, .88); padding: 8px 12px; border-radius: 3px; font-weight: 500; }
.topbar-link:hover { background: rgba(255, 255, 255, .08); color: #fff; }
.topbar-link .caret { color: rgba(255, 255, 255, .55); }
.notify, .notify:hover { background: transparent; border: 0; color: rgba(255, 255, 255, .88); }
.badge { border-radius: 3px; min-width: 18px; height: 18px; font-size: 11px; }
.avatar { border-radius: 3px; }
.mode-chip { height: 30px; border-radius: 3px; border-color: rgba(255, 255, 255, .22); color: #fff; font-weight: 600; }
.mode-chip:hover { border-color: rgba(255, 255, 255, .5); background: rgba(255, 255, 255, .06); }
.mode-none { color: rgba(255, 255, 255, .7); }

.mainnav { background: var(--nav-line); box-shadow: none; border-bottom: 0; position: sticky; }
.mainnav::after { content: ""; position: absolute; left: 0; right: 0; bottom: calc(var(--brand-line) * -1); height: var(--brand-line); background: var(--primary); }
.mainnav-inner { height: 46px; }
.nav-links > li > a { font-weight: 600; font-size: 14.5px; padding: 0 14px; color: rgba(255, 255, 255, .85); }
.nav-links > li > a:hover { background: rgba(255, 255, 255, .06); color: #fff; }
.nav-links > li > a.active { background: transparent; color: #fff; }
.nav-links > li > a.active::after { height: 3px; background: var(--primary); left: 14px; right: 14px; }
.search { height: 32px; }
.search input { border-radius: 3px 0 0 3px; border: 0; }
.search button { border-radius: 0 3px 3px 0; }
.dropdown-menu { border-radius: 3px; }
.nav-links .dropdown-menu { border-radius: 0 0 3px 3px; margin-top: 5px; }

/* Everything below the header starts after the orange rule. */
#pwm-header + * { margin-top: var(--brand-line); }

/* ---------- Footer ---------- */
.footer { background: var(--nav-bg); color: rgba(255, 255, 255, .7); font-size: 13.5px; position: relative; border-top: 0; }
.footer::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: var(--brand-line); background: var(--primary); }
.footer-inner { padding-top: 6px; }

/* ---------- Page titles ---------- */
.page-title h1, .civ-head h1 { font-size: 30px; font-weight: 700; color: var(--text-strong); }

/* ---------- Panels: flat, square, white ---------- */

.panel, .d-card, .mdt-card, .in-card, .in-stat, .d-stat, .civ-stat, .d-hero, .stat-row > * {
    border-radius: 3px !important;
    box-shadow: none !important;
}
.panel, .d-card, .mdt-card, .in-card { border: 1px solid var(--line); background: var(--surface); }
.panel-head, .d-card-head, .mdt-card-head, .in-card-head {
    background: transparent;
    color: var(--text-strong);
    font-family: var(--font-head);
    font-size: 16.5px;
    font-weight: 600;
    letter-spacing: 0;
    border-bottom: 1px solid var(--line);
}
.panel-head .head-action { border-radius: 3px; }

/* Stats: quiet numbers, not tiles */
.in-stat, .d-stat, .civ-stat { background: var(--surface); border: 1px solid var(--line); border-top: 3px solid var(--nav-bg); }
:root[data-theme="dark"] .in-stat, :root[data-theme="dark"] .d-stat, :root[data-theme="dark"] .civ-stat { border-top-color: var(--line-2); }
.in-stat strong, .d-stat strong, .civ-stat strong { font-family: var(--font-head); font-weight: 700; }
.in-stat small, .d-stat small, .civ-stat small { letter-spacing: 0; font-size: 13px; font-weight: 600; }

/* ---------- Buttons ---------- */
.btn, .d-btn, .mdt-btn, .in-btn, .head-action {
    border-radius: 3px !important;
    font-weight: 600;
    box-shadow: none;
    letter-spacing: 0;
}
.btn-primary, .d-btn.primary, .mdt-btn.primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.d-btn.big { border-radius: 3px; }
.btn:active, .d-btn:active, .mdt-btn:active { transform: none; }

/* ---------- Inputs ---------- */
.field input, .field select, .field textarea, .input, .mdt-input, .pnc-input,
.in-form input, .in-form select, .in-form textarea, .d-form input, .d-form select, .d-form textarea {
    border-radius: 3px !important;
}
.field label, .d-form label, .in-form label { font-size: 13.5px; font-weight: 600; color: var(--text); letter-spacing: 0; }

/* ---------- Tags (statuses) - small, square, readable ---------- */
.status, .cpill, .d-pill, .tag, .in-tag, .u-tag {
    border-radius: 2px !important;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0;
    padding: 2px 7px;
}

/* ---------- Tabs: underline, not pills ---------- */
.civ-tabs { background: transparent; border: 0; border-bottom: 1px solid var(--line); border-radius: 0; padding: 0; gap: 2px; box-shadow: none; }
.civ-tabs a { border-radius: 0; padding: 11px 14px; color: var(--muted); font-weight: 600; font-size: 14.5px; border-bottom: 3px solid transparent; margin-bottom: -1px; background: transparent; }
.civ-tabs a:hover { background: transparent; color: var(--text-strong); }
.civ-tabs a.active { background: transparent; color: var(--text-strong); border-bottom-color: var(--primary); }
.civ-tabs em, .in-menu em { border-radius: 2px; }

.d-toggle { background: transparent; border: 0; padding: 0; gap: 4px; border-radius: 0; }
.d-toggle button { border-radius: 0; background: transparent; border-bottom: 2px solid transparent; padding: 6px 8px; color: var(--muted); font-weight: 600; }
.d-toggle button.active { background: transparent; color: var(--text-strong); border-bottom-color: var(--primary); }

/* Intranet side menu: a rule, not a highlight blob */
.in-menu a { border-radius: 0; border-left: 3px solid transparent; padding: 8px 12px; font-weight: 500; }
.in-menu a:hover { background: var(--hover); }
.in-menu a.active { background: var(--hover); border-left-color: var(--primary); font-weight: 600; }
.in-menu-title { font-size: 12.5px; font-weight: 700; color: var(--muted); }

/* ---------- Modals, toasts, empty states ---------- */
.modal, .in-modal-box, .toast, .dropdown-menu, .search-results { border-radius: 3px; }
.modal-head { background: var(--surface); font-family: var(--font-head); font-size: 18px; }
.toast { border-left: 4px solid var(--nav-bg); }
.empty, .d-empty, .mdt-empty { color: var(--muted); }

/* ---------- Tables ---------- */
.table th, .d-table th { font-weight: 600; font-size: 13px; letter-spacing: 0; background: var(--surface-2); color: var(--muted); }

/* ---------- Plates stay plates ---------- */
.plate { border-radius: 2px; }

/* ---------- Misc quieting ---------- */
.ops-alert { border-radius: 3px; }
.ops-alert-actions a, .ops-alert-actions button { border-radius: 3px; }
.home-theme { border-radius: 3px; }

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

/* ---------- Stat strips: one bordered row with dividers, not a row of tiles ---------- */
.d-stats, .in-stats, .stat-row, .civ-stats {
    gap: 0 !important;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 3px;
}
.d-stats > *, .in-stats > *, .stat-row > *, .civ-stats > * {
    border: 0 !important;
    border-right: 1px solid var(--line) !important;
    border-radius: 0 !important;
    background: transparent !important;
    padding: 16px 20px !important;
}
.d-stats > :last-child, .in-stats > :last-child, .stat-row > :last-child, .civ-stats > :last-child { border-right: 0 !important; }
.d-stat span, .stat-card span { font-size: 13.5px; font-weight: 600; letter-spacing: 0; }
.d-stat strong, .stat-card strong, .in-stat strong { font-family: var(--font-head); font-size: 30px; }
.stat-card { position: relative; }
.stat-card.red strong { color: var(--bad); }
.stat-card.green strong { color: var(--ok); }
@media (max-width: 760px) {
    .d-stats, .in-stats, .stat-row, .civ-stats { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
    .d-stats > :nth-child(2n), .in-stats > :nth-child(2n), .stat-row > :nth-child(2n), .civ-stats > :nth-child(2n) { border-right: 0 !important; }
    .d-stats > :nth-child(-n+2), .in-stats > :nth-child(-n+2), .stat-row > :nth-child(-n+2), .civ-stats > :nth-child(-n+2) { border-bottom: 1px solid var(--line) !important; }
}

/* ---------- Duty hero: a status board ---------- */
.d-hero { border: 1px solid var(--line); border-left: 6px solid var(--line-2); }
.d-hero.on { border-color: var(--line); border-left-color: var(--ok); }
.d-pill { border-radius: 2px; }
.d-timer { font-family: var(--mono); font-weight: 600; letter-spacing: 0; }
.shift-chip { border-radius: 2px; }
.d-dept-tag, .d-rank { border-radius: 2px; }

/* ---------- Civilian ---------- */
.civ-switch .char-tab { border-radius: 3px; }
.civ-stats > a:hover { background: var(--hover) !important; }
.civ-stat.warn strong { color: var(--bad); }

/* Footer sits at the bottom of short pages */
body[data-nav]:not(.dark-app), body.picker-page { min-height: 100vh; display: flex; flex-direction: column; }
body[data-nav]:not(.dark-app) > main, body.picker-page > main { flex: 1 0 auto; width: 100%; }
.footer-inner { padding-top: 22px !important; padding-bottom: 16px; }

/* ---------- PNC: check selector as tabs with the PNC colour codes ---------- */
.pnc-check { flex-direction: row; justify-content: flex-start; text-align: left; gap: 12px; padding: 14px 16px; background: var(--surface) !important; border: 1px solid var(--line); border-top: 4px solid var(--pnc-c); color: var(--text-strong); }
.pnc-check.person  { --pnc-c: #208A3A; }
.pnc-check.vehicle { --pnc-c: #B42335; }
.pnc-check.address { --pnc-c: #B8691A; }
.pnc-check > i { order: -1; color: var(--pnc-c); font-size: 20px; width: 22px; text-align: center; }
.pnc-check h3 { flex: 1; font-size: 18px; font-family: var(--font-head); }
.pnc-check .pnc-blue { padding: 7px 12px; font-size: 13px; }
.pnc-check.active { box-shadow: none; background: var(--surface-2) !important; border-color: var(--pnc-c); }
.pnc-heading { text-align: left; font-size: 22px; font-family: var(--font-head); font-weight: 700; letter-spacing: .02em; color: var(--text-strong); margin: 18px 0 10px; }
.pnc-blue { background: var(--check-blue); border-radius: 3px; }
.pnc-blue:hover { background: #163E84; }
.pnc-idbar .pnc-blue, .pnc-row .pnc-blue { border-radius: 0 3px 3px 0; }

/* MDT status buttons and tools: square */
.status-btn, .tool-btn, .bwv-btn { border-radius: 3px !important; }

/* Book-on screen heading */
.bookon h1, .bookon-head h1 { font-family: var(--font-head); }

@media (max-width: 760px) {
    .civ-tabs { overflow-x: auto; flex-wrap: nowrap; scrollbar-width: none; }
    .civ-tabs a span { display: inline !important; }
    .civ-tabs a { padding: 10px 11px; white-space: nowrap; }
    body[data-nav] > main.page, body[data-nav] > main.container { padding-top: 20px; }
}

/* Register a vehicle: pick your car from ER:LC */
.ingame-cars { margin-bottom: 14px; }
.ingame-cars:empty { display: none; }
.ingame-title { margin: 0 0 6px; font-size: 13.5px; font-weight: 600; color: var(--muted); }
.ingame-car { width: 100%; display: flex; align-items: center; gap: 10px; padding: 10px 12px; margin-bottom: 6px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 3px; color: var(--text); font: inherit; text-align: left; cursor: pointer; }
.ingame-car:hover { border-color: var(--line-2); }
.ingame-car span:nth-child(2) { flex: 1; }
.ingame-car b { color: var(--primary); font-size: 13px; }
.ingame-car.chosen { border-color: var(--primary); }
.ingame-car .plate { font-family: var(--mono); font-weight: 700; background: #F4C430; color: #111; padding: 1px 6px; border: 1.5px solid #111; font-size: 12px; }

/* ---------- Service tools (patients, fire reports, roads) ---------- */
.svc-grid { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.svc-form { display: grid; gap: 12px; }
.svc-row { display: flex; gap: 12px; flex-wrap: wrap; }
.svc-row > .svc-field { flex: 1 1 160px; }
.svc-row > .svc-field.wide { flex: 2 1 260px; }
.svc-field { display: grid; gap: 5px; font-size: 13px; font-weight: 600; color: var(--text); }
.svc-field[hidden] { display: none; }
.svc-obs { border: 1px solid var(--line); border-radius: 3px; padding: 10px 12px 12px; margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 8px; }
.svc-obs legend { padding: 0 6px; font-size: 13px; font-weight: 600; color: var(--muted); }
.svc-obs label { display: grid; gap: 4px; font-size: 12px; font-weight: 600; color: var(--muted); }
.svc-actions { display: flex; justify-content: flex-end; }
.svc-matches { display: grid; gap: 4px; }
.svc-matches:empty { display: none; }
.svc-match { display: flex; gap: 8px; align-items: baseline; padding: 8px 10px; border: 1px solid var(--line); border-radius: 3px; background: var(--surface-2); color: var(--text); font: inherit; text-align: left; cursor: pointer; }
.svc-match:hover { border-color: var(--primary); }
.svc-match span { color: var(--muted); font-size: 12.5px; }
.svc-patient { padding: 10px 12px; border-left: 4px solid var(--ok); background: var(--surface-2); border-radius: 2px; }
.svc-patient dl { display: grid; grid-template-columns: max-content 1fr; gap: 4px 14px; margin: 0; font-size: 13px; }
.svc-patient dt { color: var(--muted); font-weight: 600; }
.svc-patient dd { margin: 0; color: var(--text-strong); }
.svc-patient dd.bad { color: var(--bad); font-weight: 700; }
.svc-inline { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; margin-bottom: 12px; }
.svc-inline[hidden] { display: none; }
.svc-inline .mdt-input { padding: 8px 10px; font-size: 13px; }
#view-roads .mdt-card, #view-patients .mdt-card, #view-firereports .mdt-card { margin: 0; }
@media (max-width: 960px) { .svc-grid { grid-template-columns: 1fr; } }
.cad-roads { border-color: var(--line); }
.cad-roads > summary { cursor: pointer; list-style: none; display: flex; }
.cad-roads > summary::-webkit-details-marker { display: none; }
.cad-roads > summary em { font-style: normal; color: var(--muted); font-weight: 500; margin-left: 4px; }
.cad-roads .svc-grid { grid-template-columns: 1fr 1fr; }
.cad-roads .mdt-card { border: 0; }
.cad-roads .mdt-card-head { padding: 0 0 8px; border: 0; font-size: 15px; }
.cad-roads .mdt-card-body { padding: 0; }
.cad-roads .live-tag { display: none; }
@media (max-width: 900px) { .cad-roads .svc-grid { grid-template-columns: 1fr; } }

/* ---------- Intranet: careers pipeline, conduct, staff records ---------- */
.in-tag.danger { color: var(--bad); background: var(--bad-bg); }
.in-steps { list-style: none; display: flex; gap: 0; margin: 10px 0 4px; padding: 0; counter-reset: s; flex-wrap: wrap; }
.in-steps li { counter-increment: s; font-size: 12.5px; font-weight: 600; color: var(--muted); padding: 4px 12px 4px 0; display: flex; align-items: center; gap: 6px; }
.in-steps li::before { content: counter(s); width: 18px; height: 18px; display: grid; place-items: center; border-radius: 2px; background: var(--surface-3); color: var(--muted); font-size: 11px; }
.in-steps li + li { border-left: 0; }
.in-steps li.done::before { background: var(--ok); color: #fff; content: "\2713"; }
.in-steps li.now { color: var(--text-strong); }
.in-steps li.now::before { background: var(--primary); color: #fff; }
.in-callout { margin: 8px 0 0; padding: 8px 10px; border-left: 3px solid var(--primary); background: var(--accent-bg); border-radius: 2px; }
.in-qa { margin: 10px 0 0; }
.in-qa b { display: block; font-size: 13.5px; color: var(--text-strong); }
.in-qa p { margin: 3px 0 0; white-space: pre-wrap; }
.in-notes { margin-top: 10px; padding: 8px 10px; background: var(--surface-2); border: 1px dashed var(--line-2); border-radius: 3px; font-size: 13.5px; }
.in-notes p { margin: 4px 0; white-space: pre-wrap; }
details.in-app { display: block; padding: 0; }
details.in-app > summary { display: flex; align-items: center; gap: 12px; padding: 14px 18px; cursor: pointer; list-style: none; }
details.in-app > summary::-webkit-details-marker { display: none; }
details.in-app > summary small { color: var(--muted); }
details.in-app[open] > summary { border-bottom: 1px dashed var(--line); }
.in-app-body { padding: 4px 18px 16px; }
.in-timeline { list-style: none; margin: 0; padding: 0 0 0 16px; border-left: 2px solid var(--line-2); }
.in-timeline li { position: relative; padding: 0 0 14px 10px; }
.in-timeline li::before { content: ""; position: absolute; left: -22px; top: 5px; width: 10px; height: 10px; border-radius: 2px; background: var(--primary); }
.in-timeline small { display: block; color: var(--muted); font-size: 12.5px; }
.in-alert { padding: 10px 14px; border-left: 4px solid var(--warn); background: var(--warn-bg); border-radius: 2px; }
.in-alert.danger { border-left-color: var(--bad); background: var(--bad-bg); }
.in-row.faded { opacity: .6; }
.in-staff { display: grid; grid-template-columns: minmax(240px, 320px) minmax(0, 1fr); gap: 18px; align-items: start; }
.in-staff #staffDetail { display: grid; gap: 18px; }
.in-search { padding: 10px 12px; border-bottom: 1px solid var(--line); }
.in-search input { width: 100%; padding: 8px 10px; border: 1px solid var(--line-2); border-radius: 3px; background: var(--surface); color: var(--text); font: inherit; }
.in-member { text-decoration: none; color: inherit; }
.in-member:hover { background: var(--hover); }
.in-member.active { background: var(--hover); box-shadow: inset 3px 0 0 var(--primary); }
#staffList { max-height: 70vh; overflow-y: auto; }
@media (max-width: 900px) { .in-staff { grid-template-columns: 1fr; } }

/* ==========================================================
   DEPARTMENT CADs
========================================================== */
.cad-page { --dept: var(--primary); }
.cad-page[data-dept="wmp"]  { --dept: #3B6FD8; }
.cad-page[data-dept="wmas"] { --dept: #2E9E5B; }
.cad-page[data-dept="wmfs"] { --dept: #D9473A; }
.cad-page[data-dept="nh"]   { --dept: #E0A21B; }
.cad-title { align-items: flex-end; border-bottom: 3px solid var(--dept); padding-bottom: 12px; margin-bottom: 18px; }
.cad-dept { margin: 0 0 2px; font-size: 13px; font-weight: 600; color: var(--dept); }
.cad-title-actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.cad-view { min-width: 170px; }
.cad-noaccess { margin-bottom: 18px; }
.cad-broadcast select { padding: 7px 8px; font: inherit; font-size: 13px; border: 1px solid var(--line-2); border-radius: 3px; background: var(--bg); color: var(--text); }

.cad-requests, .cad-notices, .dept-panel { margin-bottom: 18px; }
.cad-requests { border-color: var(--dept); }
.cad-notices .panel-head, .dept-panel .panel-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.cad-notices .panel-head em { font-style: normal; color: var(--muted); font-weight: 500; }
.cad-notice-form { display: flex; gap: 8px; flex-wrap: wrap; padding: 10px 14px; border-bottom: 1px solid var(--line); background: var(--surface-2); }
.cad-notice-form input, .cad-notice-form select { padding: 7px 9px; font: inherit; font-size: 13px; color: var(--text); background: var(--surface); border: 1px solid var(--line-2); border-radius: 3px; min-width: 0; }
.cad-notice-form #nRoad, .cad-notice-form #nDetails { flex: 1 1 180px; }
.cad-notice-form #nSpeed { width: 80px; }
.cad-notice-list { list-style: none; margin: 0; padding: 0 14px; }
.cad-notice-list li { display: flex; gap: 10px; align-items: center; padding: 9px 0; border-bottom: 1px solid var(--line); }
.cad-notice-list li:last-child { border-bottom: 0; }
.cad-notice-list li > div { flex: 1; min-width: 0; }
.cad-notice-list small { display: block; color: var(--muted); font-size: 12px; }
.cad-notice-list .rec-type, .svc-notices .rec-type { font: 700 11px/1 var(--mono); padding: 4px 6px; border-radius: 3px; background: var(--surface-3); white-space: nowrap; }
.cad-notice-list .rec-arrest { background: var(--bad-bg); color: var(--bad); }
.cad-notice-list .rec-caution { background: var(--warn-bg); color: var(--warn); }
.cad-notice-list .mdt-btn { padding: 5px 10px; font: 700 12px/1.2 var(--font); border-radius: 3px; border: 1px solid var(--line-2); background: var(--surface-2); color: var(--text); cursor: pointer; }
.svc-notices { margin-bottom: 14px; }

.req-row { display: flex; gap: 12px; align-items: center; justify-content: space-between; padding: 10px 14px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.req-row:last-child { border-bottom: 0; }
.req-row.req-new { box-shadow: inset 3px 0 0 var(--dept); background: var(--accent-bg); }
.req-main { min-width: 0; flex: 1 1 300px; }
.req-main strong { display: block; color: var(--text-strong, var(--ink)); }
.req-main small { display: block; color: var(--muted); font-size: 12px; margin-top: 2px; }
.req-main a { color: var(--primary); font-family: var(--mono); font-weight: 600; }
.req-actions { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.req-actions .input { width: 180px; padding: 6px 8px; font-size: 13px; }
.req-status { font: 700 11px/1 var(--mono); padding: 4px 7px; border-radius: 3px; background: var(--surface-3); }
.req-accepted { background: var(--ok-bg); color: var(--ok); }
.req-declined { background: var(--bad-bg); color: var(--bad); }
.req-pending { background: var(--warn-bg); color: var(--warn); }
.erlc-tag.req-tag { background: var(--info-bg); color: var(--info); border-color: var(--info-line); }
.erlc-tag.link-tag { background: var(--surface-3); color: var(--muted); }

.request-form { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr); gap: 8px; }
.request-form #rqNote { grid-column: 1 / -1; }
.request-form button { grid-column: 1 / -1; justify-self: start; }
.linked-line { margin: 8px 0 0; }

/* Ambulance */
.hosp-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 10px; }
.hosp { display: flex; flex-direction: column; gap: 6px; padding: 10px 12px; border: 1px solid var(--line); border-left: 4px solid var(--ok); border-radius: 3px; background: var(--surface-2); }
.hosp-busy { border-left-color: var(--warn); }
.hosp-diverting { border-left-color: var(--bad); background: var(--bad-bg); }
.hosp strong { font-size: 13.5px; }
.hosp small { color: var(--muted); font-size: 11.5px; }
.hosp .input { padding: 5px 8px; font-size: 13px; }
.hosp .stat-dot { font-size: 12px; font-weight: 700; text-transform: capitalize; }
.triage-strip { display: flex; gap: 8px; flex-wrap: wrap; margin: 14px 0 10px; }
.triage { display: inline-flex; gap: 6px; align-items: baseline; padding: 4px 9px; border-radius: 3px; font-size: 12.5px; font-weight: 600; background: var(--surface-3); }
.triage-red { background: var(--bad-bg); color: var(--bad); }
.triage-amber { background: var(--warn-bg); color: var(--warn); }
.triage-green { background: var(--ok-bg); color: var(--ok); }
.cad-mini-table { width: 100%; font-size: 13px; }
.cad-mini-table td small { display: block; color: var(--muted); font-size: 12px; }

/* Fire + Highways jobs */
.fire-job { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 10px 14px; border-bottom: 1px solid var(--line); }
.fire-job-main { display: flex; gap: 10px; align-items: flex-start; min-width: 0; }
.fire-job-main strong { display: block; }
.fire-job-main a { color: var(--primary); font-family: var(--mono); }
.fire-job-main small { display: block; color: var(--muted); font-size: 12px; }
.fire-apps { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.makeup-tag { font: 700 11.5px/1 var(--mono); padding: 5px 7px; border-radius: 3px; background: var(--bad-bg); color: var(--bad); }
.fire-makeup { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.fire-makeup label { display: flex; gap: 6px; align-items: center; font-size: 12.5px; font-weight: 600; white-space: nowrap; }
.fire-makeup input[type=number] { width: 62px; padding: 5px 6px; }
.fire-makeup input[name=special] { width: 170px; padding: 5px 8px; font-size: 13px; }
.dept-quick { display: flex; gap: 6px; flex-wrap: wrap; }
.map-scope-pick[hidden], .map-scope[hidden] { display: none; }

@media (max-width: 800px) {
    .fire-job { grid-template-columns: minmax(0, 1fr); }
    .request-form { grid-template-columns: minmax(0, 1fr); }
    .req-actions .input { width: 100%; }
    .cad-title { flex-wrap: wrap; }
}
.cad-page .stat-row { grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); }
@media (min-width: 801px) { .cad-title-actions { flex-wrap: nowrap; } }
@media (max-width: 640px) { .cad-broadcast #broadcastText { flex: 1 1 100%; } .cad-broadcast > i { display: none; } }

/* ---------- PNC: vehicle warning markers ---------- */
.veh-warnings { display: flex; flex-direction: column; gap: 8px; margin: 4px 0 12px; }
.veh-warning { display: flex; gap: 10px; align-items: center; padding: 8px 10px; border: 1px solid var(--bad-line); border-left-width: 4px; background: var(--bad-bg); border-radius: 3px; }
.veh-warning.lvl-medium { border-color: var(--warn-line); background: var(--warn-bg); }
.veh-warning.lvl-low { border-color: var(--line-2); background: var(--surface-2); }
.veh-warning > div { flex: 1; min-width: 0; }
.veh-warning strong { display: block; font-size: 13px; }
.veh-warning small { display: block; font-size: 12px; opacity: .8; }
.veh-mark-form { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 2fr) minmax(0, 1fr) auto; gap: 6px; align-items: center; }
@media (max-width: 700px) { .veh-mark-form { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } .veh-mark-form input { grid-column: 1 / -1; } }

/* ---------- Alert sounds (speaker button, bottom left) ---------- */
.pwm-sound { position: fixed; left: 12px; bottom: 12px; z-index: 900; font-family: var(--font); }
.pwm-sound-btn { display: inline-flex; align-items: center; justify-content: center; width: 34px; height: 34px; padding: 0; border-radius: 50%; opacity: .85; border: 1px solid var(--line-2); background: var(--surface); color: var(--text); font: 600 12.5px/1 var(--font); cursor: pointer; }
.pwm-sound-btn.off { color: var(--bad); border-color: var(--bad-line); background: var(--bad-bg); }
.pwm-sound-panel { position: absolute; left: 0; bottom: calc(100% + 8px); width: 320px; max-width: calc(100vw - 24px); max-height: min(70vh, 560px); overflow: auto; padding: 12px 14px; background: var(--surface); border: 1px solid var(--line-2); border-radius: 3px; color: var(--text); }
.pwm-sound-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.pwm-sound-mute, .pwm-sound-vol { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.pwm-sound-vol input { flex: 1; }
.pwm-sound-group { margin: 12px 0 4px; font: 700 11px/1 var(--font); letter-spacing: .04em; text-transform: uppercase; color: var(--muted); }
.pwm-sound-row { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 4px 0; font-size: 13px; }
.pwm-sound-row label { display: flex; gap: 8px; align-items: center; }
.pwm-sound-row button { padding: 3px 8px; font: 600 11.5px/1.2 var(--font); border: 1px solid var(--line-2); border-radius: 3px; background: var(--surface-2); color: var(--text); cursor: pointer; }
.pwm-sound-note { margin: 10px 0 0; font-size: 11.5px; color: var(--muted); }
@media print { .pwm-sound { display: none; } }

/* ---------- MDT: request another service ---------- */
.svc-request { display: flex; flex-direction: column; gap: 8px; margin-bottom: 6px; }
.svc-request-btns { display: flex; gap: 6px; flex-wrap: wrap; }
.svc-request-btns .mdt-btn.active { outline: 2px solid var(--primary); outline-offset: 1px; }
.svc-request-form { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.6fr) auto; gap: 6px; }
@media (max-width: 640px) { .svc-request-form { grid-template-columns: minmax(0, 1fr); } }

/* ---------- CAD: major incident banner + fleet strip ---------- */
.cad-major { display: flex; flex-direction: column; gap: 3px; padding: 12px 16px; margin-bottom: 12px; border-radius: 3px; background: var(--bad); color: #fff; text-decoration: none; }
.cad-major strong { font: 700 15px/1.2 var(--font-head); letter-spacing: .03em; }
.cad-major span { font-size: 13px; opacity: .92; }
.cad-fleet { display: flex; gap: 18px; flex-wrap: wrap; align-items: center; padding: 9px 14px; margin-bottom: 18px; border: 1px solid var(--line); border-radius: 3px; background: var(--surface); color: inherit; text-decoration: none; font-size: 13px; }
.cad-fleet:hover { border-color: var(--line-2); }

.pwm-sound-btn:hover { opacity: 1; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }


/* ==========================================================
   2026 REFRESH (from the MDT app feedback)
   Inter everywhere, fewer borders, softer corners, orange kept
   for headings / navigation / primary buttons, clear focus,
   calmer tables and consistent buttons.
========================================================== */

body { -webkit-font-smoothing: antialiased; font-feature-settings: "cv11", "ss01"; }
h1, h2, h3, .picker-heading, .page-title { letter-spacing: -.015em; }

/* Panels: no heavy navy head bar, fewer lines */
.panel, .mdt-card, .d-card { border-radius: 8px; }
:root:not([data-theme="light"]) .panel,
:root:not([data-theme="light"]) .mdt-card,
:root:not([data-theme="light"]) .d-card { border-color: transparent; }
.panel-head { background: transparent; color: var(--text-strong); border-bottom: 1px solid var(--line); padding: 14px 16px; font-size: 15px; font-weight: 600; }
.panel-head .head-action { border-radius: 6px; }
.mdt-card-head { font-size: 13px; font-weight: 600; }
.d-card-head { font-weight: 600; }

/* Buttons: one height, one radius, real states */
.btn, .mdt-btn { min-height: 36px; padding: 0 14px; border-radius: 6px; font-weight: 600; font-size: 13.5px; line-height: 1; transition: background .12s, border-color .12s, color .12s, transform .06s; }
.btn-sm, .mdt-btn.sm { min-height: 30px; padding: 0 10px; font-size: 12.5px; }
.btn:active:not(:disabled), .mdt-btn:active:not(:disabled) { transform: translateY(1px); }
.btn:disabled, .mdt-btn:disabled { opacity: .45; cursor: not-allowed; }
.btn-primary:hover:not(:disabled), .mdt-btn.primary:hover:not(:disabled) { filter: brightness(1.06); }
.head-action, .tactic, .cell-no, .pursuit-live { border-radius: 4px; }

/* Inputs: orange focus, same radius */
.field input, .field select, .field textarea, .input, .mdt-input,
.in-form input, .in-form select, .in-form textarea, .d-form input, .search input {
    border-radius: 6px;
    transition: border-color .12s, box-shadow .12s;
}
.field input:focus, .field select:focus, .field textarea:focus, .input:focus, .mdt-input:focus,
.in-form input:focus, .in-form select:focus, .in-form textarea:focus, .d-form input:focus, .search input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(var(--primary-rgb), .18);
}
::placeholder { color: var(--muted); opacity: .8; }

/* Keyboard focus everywhere */
a:focus-visible, button:focus-visible, [tabindex]:focus-visible, summary:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
    border-radius: 4px;
}

/* Tables: header, row height, hover, subtle selection */
.table th, .mdt-table th { font-size: 12px; font-weight: 600; letter-spacing: 0; text-transform: none; }
.table td { padding: 13px 14px; }
.table tbody tr, .mdt-table tbody tr { transition: background .1s; }
.table tbody tr:hover, .mdt-table tbody tr:hover { background: var(--hover); }
.table tr.selected, .table tr.active, .mdt-table tr.selected, .mdt-table tr.active { background: var(--accent-bg); box-shadow: inset 3px 0 0 var(--primary); }
.table td:first-child { font-weight: 600; }

/* Toasts and live alerts: same look as the MDT terminal */
.toast { border-radius: 8px; border-color: transparent; box-shadow: var(--shadow-lg), inset 3px 0 0 var(--ok); }
.ops-alert { border: 0; border-radius: 8px; box-shadow: var(--shadow-lg), inset 4px 0 0 var(--info); padding: 12px 14px 12px 18px; }
.ops-alert.warn { box-shadow: var(--shadow-lg), inset 4px 0 0 var(--warn); }
.ops-alert.ok { box-shadow: var(--shadow-lg), inset 4px 0 0 var(--ok); }
.ops-alert.urgent { box-shadow: var(--shadow-lg), inset 4px 0 0 var(--bad); }
.ops-alert-actions a, .ops-alert-actions button { border-radius: 6px; }

/* Modals */
.modal, .in-modal-box { border-radius: 10px; overflow: hidden; }
.modal-head { background: transparent; }

/* Scrollbars */
* { scrollbar-width: thin; scrollbar-color: var(--line-2) transparent; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--line-2); border: 3px solid var(--bg); border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: var(--muted); }

@media (prefers-reduced-motion: reduce) {
    .btn, .mdt-btn, .table tbody tr { transition: none; }
}


/* ==========================================================
   DEPARTMENTS - each service gets its own look
   <html data-dept="wmp|wmas|wmfs|nh|civilian"> is set by layout.js.
   Header colour, a livery stripe under the navigation (Sillitoe
   check, ambulance and fire Battenburg, Highways chequer), and a
   tinted page background.
========================================================== */

:root[data-dept="wmp"]  { --dept: #2F5FD0; --dept-rgb: 47, 95, 208;  --nav-bg: #0B1F45; --nav-line: #06142E;
    --livery: conic-gradient(#FFFFFF 25%, #12357E 0 50%, #FFFFFF 0 75%, #12357E 0) 0 0 / 8px 8px; }
:root[data-dept="wmas"] { --dept: #0E8A4A; --dept-rgb: 14, 138, 74;  --nav-bg: #0A3324; --nav-line: #062218;
    --livery: conic-gradient(#0B7A3B 25%, #F2D500 0 50%, #0B7A3B 0 75%, #F2D500 0) 0 0 / 24px 8px; }
:root[data-dept="wmfs"] { --dept: #D2232A; --dept-rgb: 210, 35, 42;  --nav-bg: #3E0A0E; --nav-line: #2A0609;
    --livery: conic-gradient(#C8102E 25%, #FFD100 0 50%, #C8102E 0 75%, #FFD100 0) 0 0 / 24px 8px; }
:root[data-dept="nh"]   { --dept: #F2B300; --dept-rgb: 242, 179, 0;  --nav-bg: #141518; --nav-line: #0A0B0D;
    --livery: conic-gradient(#F6C400 25%, #141414 0 50%, #F6C400 0 75%, #141414 0) 0 0 / 24px 8px; }
:root[data-dept="rnli"] { --dept: #F26B21; --dept-rgb: 242, 107, 33; --nav-bg: #0B2545; --nav-line: #061833;
    --livery: conic-gradient(#F26B21 25%, #0B2545 0 50%, #F26B21 0 75%, #0B2545 0) 0 0 / 24px 8px; }
:root[data-dept="civilian"] { --dept: #8A94A3; --dept-rgb: 138, 148, 163;
    --livery: linear-gradient(90deg, #E2834D, #C9673A); }

/* Livery stripe under the navigation */
:root[data-dept] #pwm-header::after { content: ""; display: block; height: 8px; background: var(--livery, transparent); }
:root[data-dept="none"] #pwm-header::after { display: none; }
:root[data-dept="civilian"] #pwm-header::after { height: 3px; }

/* Tinted page background, strongest just under the header */
:root[data-dept="wmp"] body,
:root[data-dept="wmas"] body,
:root[data-dept="wmfs"] body,
:root[data-dept="nh"] body,
:root[data-dept="rnli"] body {
    background-image: radial-gradient(1400px 520px at 50% -120px, rgba(var(--dept-rgb), .16), transparent 70%);
    background-repeat: no-repeat;
}
:root[data-theme="light"][data-dept] body { background-image: radial-gradient(1400px 460px at 50% -120px, rgba(var(--dept-rgb), .10), transparent 70%); }

/* Department logo in the header chip */
.mode-chip .mode-logo { width: 20px; height: 20px; object-fit: contain; flex: 0 0 auto; }
:root[data-dept="nh"] .mode-chip .mode-logo { width: 34px; }
:root[data-dept]:not([data-dept="none"]):not([data-dept="civilian"]) .mode-chip { border-color: rgba(var(--dept-rgb), .55); }

/* Card and panel heads pick up a thin department line */
:root[data-dept="wmp"] .d-card-head, :root[data-dept="wmas"] .d-card-head,
:root[data-dept="wmfs"] .d-card-head, :root[data-dept="nh"] .d-card-head, :root[data-dept="rnli"] .d-card-head { box-shadow: inset 0 -1px 0 rgba(var(--dept-rgb), .35); }


/* ---------- Duty hub: department banner ---------- */
.dept-banner {
    position: relative; overflow: hidden; border-radius: 10px; margin-bottom: 16px;
    min-height: 150px; display: flex; align-items: center; gap: 20px; padding: 22px 26px 28px;
    color: #fff; background: #111 center / cover no-repeat;
}
.dept-banner::before { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(8, 10, 14, .92) 0%, rgba(8, 10, 14, .78) 45%, rgba(8, 10, 14, .35) 100%); }
.dept-banner::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 8px; background: var(--livery, transparent); }
.dept-banner > * { position: relative; z-index: 1; }
.dept-banner-logo { width: 84px; height: 84px; object-fit: contain; flex: 0 0 auto; filter: drop-shadow(0 4px 12px rgba(0, 0, 0, .5)); }
:root[data-dept="nh"] .dept-banner-logo { width: 150px; }
.dept-banner-text { min-width: 0; }
.dept-banner-text small { display: block; font-size: 12.5px; font-weight: 600; color: rgba(255, 255, 255, .7); letter-spacing: .02em; }
.dept-banner-text h1 { margin: 2px 0 4px; font-size: 26px; font-weight: 700; line-height: 1.2; color: #fff; }
.dept-banner-text p { margin: 0; font-size: 13.5px; color: rgba(255, 255, 255, .8); max-width: 560px; }
.dept-banner-side { margin-left: auto; text-align: right; display: flex; flex-direction: column; gap: 6px; align-items: flex-end; }
.dept-banner-side span { font-size: 12.5px; color: rgba(255, 255, 255, .75); }
.dept-banner-side b { font-size: 15px; color: #fff; font-weight: 600; }
.dept-tag { display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 10px; border-radius: 999px; background: rgba(var(--dept-rgb), .9); color: #fff; font-size: 12.5px; font-weight: 600; }
:root[data-dept="nh"] .dept-tag { color: #141414; }
@media (max-width: 700px) {
    .dept-banner { flex-wrap: wrap; padding: 18px 18px 24px; }
    .dept-banner-logo { width: 56px; height: 56px; }
    :root[data-dept="nh"] .dept-banner-logo { width: 110px; }
    .dept-banner-text h1 { font-size: 21px; }
    .dept-banner-side { margin-left: 0; align-items: flex-start; text-align: left; }
}

/* Duty hero picks up the department colour */
:root[data-dept] .d-hero.on { box-shadow: inset 4px 0 0 var(--dept, var(--ok)); }
.dept-board { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; }
.dept-board-item { padding: 12px 14px; border-radius: 8px; background: var(--surface-2); display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.dept-board-item small { font-size: 12px; color: var(--muted); }
.dept-board-item strong { font-size: 15px; color: var(--text-strong); overflow-wrap: anywhere; }
.dept-board-item .pill-ok { color: var(--ok); } .dept-board-item .pill-warn { color: var(--warn); } .dept-board-item .pill-bad { color: var(--bad); }
:root[data-dept="rnli"] .dept-banner { background-color: #0B2545; }


/* ---------- Roblox verification box ---------- */
.rbl { display: flex; flex-direction: column; gap: 10px; padding: 14px 16px; border-radius: 8px; background: var(--surface-2); border: 1px solid var(--line); text-align: left; }
.rbl-head { display: flex; align-items: center; gap: 12px; }
.rbl-head strong { display: block; font-size: 14.5px; color: var(--text-strong); }
.rbl-head small, .rbl-who small { display: block; font-size: 12.5px; color: var(--muted); }
.rbl-icon { width: 36px; height: 36px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; background: rgba(var(--primary-rgb), .15); color: var(--primary); flex: 0 0 auto; }
.rbl-oauth { align-self: flex-start; }
.rbl-small { margin: 0; font-size: 12px; color: var(--muted); }
.rbl-alt summary { cursor: pointer; font-size: 13px; color: var(--muted); }
.rbl-alt[open] summary { margin-bottom: 10px; }
.rbl-form { display: flex; gap: 8px; flex-wrap: wrap; }
.rbl-form .input { flex: 1 1 180px; min-width: 0; }
.rbl-steps { margin: 0; padding-left: 20px; font-size: 13.5px; display: flex; flex-direction: column; gap: 8px; }
.rbl-code { display: inline-flex; align-items: center; gap: 8px; margin-left: 6px; }
.rbl-code code { padding: 3px 8px; border-radius: 4px; background: var(--surface); font-weight: 700; letter-spacing: .03em; }
.rbl-linked { flex-direction: row; align-items: center; gap: 12px; }
.rbl-linked img, .rbl-avatar { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; flex: 0 0 auto; background: var(--surface); display: inline-flex; align-items: center; justify-content: center; font-weight: 700; }
.rbl-who { flex: 1 1 auto; min-width: 0; }
.rbl-who strong { color: var(--text-strong); }
.rbl-who .fa-circle-check { color: var(--ok); }
.bookon-roblox:empty, .d-roblox:empty { display: none; }
.bookon-roblox { margin-bottom: 16px; }
.d-roblox { margin-top: 14px; max-width: 560px; }
/* Book on stays grey and unclickable until Roblox is verified */
.needs-roblox .bookon-btn, .needs-roblox .bookon-btn:hover,
.d-btn.is-locked, .d-btn.is-locked:hover {
    background: var(--surface-3, #3A414B) !important; border-color: transparent !important; color: var(--muted) !important;
    cursor: not-allowed; opacity: 1; pointer-events: none; box-shadow: none !important; transform: none !important;
}
.needs-roblox .bookon-btn i, .d-btn.is-locked i { margin-right: 6px; }
.needs-roblox select:disabled, .needs-roblox input:disabled { opacity: .5; cursor: not-allowed; }


/* ---------- Admin: content review ---------- */
.adm-badge { font-style: normal; margin-left: 6px; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; background: var(--primary); color: #fff; font-size: 11px; display: inline-flex; align-items: center; justify-content: center; }
.mod-tabs { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 14px; }
.mod-tabs > button { height: 34px; padding: 0 14px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); color: var(--muted); font: 600 13.5px var(--font); cursor: pointer; }
.mod-tabs > button.on { background: var(--accent-bg); border-color: rgba(var(--primary-rgb), .5); color: var(--text-strong); }
.mod-tabs .btn { margin-left: auto; }
.mod-count { margin: 10px 0; font-size: 13px; }
.mod-list { display: flex; flex-direction: column; gap: 8px; }
.mod-item { display: flex; gap: 14px; align-items: flex-start; padding: 12px 14px; border-radius: 8px; background: var(--surface-2); }
.mod-thumb img { width: 120px; height: 76px; object-fit: cover; border-radius: 6px; display: block; background: var(--surface-3); }
.mod-main { flex: 1 1 auto; min-width: 0; }
.mod-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: 12.5px; }
.mod-author { border: 0; padding: 0; background: none; color: var(--primary); font: 600 13px var(--font); cursor: pointer; }
.mod-author:hover { text-decoration: underline; }
.mod-main h4 { margin: 6px 0 2px; font-size: 14.5px; color: var(--text-strong); overflow-wrap: anywhere; }
.mod-text { margin: 4px 0 0; font-size: 13.5px; color: var(--text); overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }
.mod-extra { margin: 2px 0 0; font-size: 12.5px; }
.mod-actions { display: flex; flex-direction: column; gap: 6px; flex: 0 0 auto; }
@media (max-width: 640px) { .mod-item { flex-wrap: wrap; } .mod-actions { flex-direction: row; width: 100%; } }
.adm-dialog { position: fixed; inset: 0; margin: auto; height: fit-content; max-height: calc(100vh - 32px); overflow: auto; border: 0; border-radius: 10px; padding: 0; width: min(440px, calc(100vw - 32px)); background: var(--surface); color: var(--text); box-shadow: var(--shadow-lg); }
.adm-dialog::backdrop { background: rgba(0, 0, 0, .5); }
.adm-dialog form { display: flex; flex-direction: column; gap: 12px; padding: 20px; }
.adm-dialog h3 { margin: 0; font-size: 17px; color: var(--text-strong); }
.adm-dialog .field { display: flex; flex-direction: column; gap: 6px; font-size: 13px; font-weight: 600; }
.adm-dialog .field input, .adm-dialog .field select { height: 36px; padding: 0 10px; border: 1px solid var(--line-2); border-radius: 6px; background: var(--bg); color: var(--text); font: 400 14px var(--font); }
.adm-dialog .check-row { display: flex; align-items: center; gap: 8px; font-size: 13.5px; }
.adm-dialog .btn-row { display: flex; justify-content: flex-end; gap: 8px; margin-top: 4px; }


/* ==========================================================
   SHARED HEADER (layout.js) - one compact bar on every page
   brand | menus | search | department, theme, alerts, account
========================================================== */

#pwm-header { position: relative; z-index: 120; }   /* scrolls away, so pages with their own pinned bars (MDT) keep their space */
/* No stripe under the header - the bar stands on its own. */
:root #pwm-header::after, :root[data-dept] #pwm-header::after { display: none; }
#pwm-header + * { margin-top: 0; }
.sh { background: var(--nav-bg); color: #E9EDF2; border-bottom: 1px solid rgba(255, 255, 255, .07); }
.sh-inner { display: flex; align-items: center; gap: 8px; height: 56px; padding: 0 16px; max-width: 1920px; margin: 0 auto; }

.sh-brand { display: flex; align-items: center; gap: 10px; color: #fff; text-decoration: none; flex-shrink: 0; margin-right: 6px; }
.sh-logo { width: 34px; height: 34px; border-radius: 4px; background: rgba(255, 255, 255, .08); display: grid; place-items: center; }
.sh-logo img { width: 24px; height: 24px; object-fit: contain; }
.sh-brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.sh-brand-text strong { font-size: 15px; font-weight: 800; letter-spacing: .04em; }
.sh-brand-text small { font-size: 11.5px; color: rgba(255, 255, 255, .6); white-space: nowrap; }

.sh-nav { flex: 1; min-width: 0; height: 100%; }
.sh .nav-links { display: flex; align-items: stretch; gap: 2px; height: 100%; margin: 0; padding: 0; list-style: none; position: static; background: none; border: 0; flex-direction: row; }
.sh .nav-links > li { position: relative; display: flex; align-items: center; height: 100%; }
.sh .nav-links > li > a {
    display: flex; align-items: center; gap: 7px; height: 36px; padding: 0 11px; border-radius: 4px;
    color: rgba(255, 255, 255, .82); font: 600 13.5px var(--font); text-decoration: none; white-space: nowrap; background: none;
}
.sh .nav-links > li > a:hover, .sh .nav-links > li.open > a { background: rgba(255, 255, 255, .08); color: #fff; }
.sh .nav-links > li > a.active { color: #fff; background: rgba(var(--primary-rgb), .16); box-shadow: inset 0 -2px 0 var(--primary); }
.sh .nav-links > li > a.active::after { display: none; }
.sh .nav-links > li > a .caret { font-size: 9px; color: rgba(255, 255, 255, .5); margin-left: 1px; }
.sh .nav-links .sh-ico { font-size: 12.5px; color: rgba(255, 255, 255, .55); width: 14px; text-align: center; }
.sh .nav-links > li > a.active .sh-ico { color: var(--primary-light, #F3A46E); }
.sh-drawer-head { display: none !important; }

/* Menus */
.sh .sh-panel { padding: 8px; min-width: 240px; border-radius: 6px; margin-top: 0; top: calc(100% - 4px); }
.sh .sh-panel.wide { display: grid; gap: 4px 10px; }
.sh .sh-panel.wide.cols-2 { grid-template-columns: repeat(2, minmax(220px, 1fr)); min-width: 500px; }
.sh .sh-panel.wide.cols-3 { grid-template-columns: repeat(3, minmax(200px, 1fr)); min-width: 660px; }
.dropdown.open > .sh-panel.wide { display: grid; }
.sh-col { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.sh-col h6 { margin: 4px 10px 4px; font: 700 10.5px var(--font); text-transform: uppercase; letter-spacing: .07em; color: var(--muted); }
.sh-col > a { display: flex; align-items: flex-start; gap: 10px; padding: 8px 10px; border-radius: 4px; color: var(--text); text-decoration: none; font: 500 13.5px var(--font); }
.sh-col > a i { width: 16px; margin-top: 2px; color: var(--muted); text-align: center; flex-shrink: 0; }
.sh-col > a span { min-width: 0; }
.sh-col > a small { display: block; font-size: 11.5px; color: var(--muted); margin-top: 1px; font-weight: 400; }
.sh-col > a:hover { background: var(--hover); color: var(--text-strong); }
.sh-col > a:hover i { color: var(--primary-light); }
.sh-col > a.current { background: var(--accent-bg); color: var(--text-strong); }
.sh-col > a.current i { color: var(--primary-light); }
.sh-col > a.sh-logout { border-top: 1px solid var(--line); border-radius: 0 0 4px 4px; margin-top: 4px; padding-top: 10px; }

/* Search */
.sh .sh-search {
    position: relative; display: flex; align-items: center; gap: 8px; width: 300px; height: 36px; padding: 0 6px 0 11px; flex-shrink: 1; min-width: 160px;
    background: rgba(255, 255, 255, .07); border: 1px solid rgba(255, 255, 255, .1); border-radius: 5px; max-width: none;
}
.sh .sh-search:focus-within { background: rgba(255, 255, 255, .12); border-color: rgba(var(--primary-rgb), .6); }
.sh .sh-search > i { color: rgba(255, 255, 255, .55); font-size: 12.5px; }
.sh .sh-search input { flex: 1; min-width: 0; height: 100%; padding: 0; background: none !important; border: 0 !important; color: #fff; font: 13.5px var(--font); outline: none; box-shadow: none !important; border-radius: 0; }
.sh .sh-search input::placeholder { color: rgba(255, 255, 255, .5); }
.sh .sh-search kbd { font: 600 11px var(--mono); color: rgba(255, 255, 255, .55); border: 1px solid rgba(255, 255, 255, .2); border-radius: 3px; padding: 0 5px; }
.sh .sh-search:focus-within kbd { display: none; }
.sh .sh-search-go { display: none; width: 26px; height: 26px; border-radius: 4px; border: 0; background: var(--primary); color: #15100C; cursor: pointer; }
.sh .sh-search:focus-within .sh-search-go { display: grid; place-items: center; }
.sh .search-results { top: calc(100% + 6px); left: 0; right: auto; width: max(100%, 380px); }

/* Right-hand actions */
.sh-actions { display: flex; align-items: center; gap: 4px; flex-shrink: 0; margin-left: 4px; }
.sh-icon {
    position: relative; display: grid; place-items: center; width: 36px; height: 36px; border-radius: 5px;
    background: none; border: 0; color: rgba(255, 255, 255, .82); cursor: pointer; font-size: 15px;
}
.sh-icon:hover { background: rgba(255, 255, 255, .08); color: #fff; }
.sh-icon .badge { position: absolute; top: 3px; right: 2px; min-width: 16px; height: 16px; padding: 0 4px; font-size: 10px; line-height: 16px; border-radius: 8px; }
.sh-search-btn { display: none; }
.sh-dept {
    display: inline-flex; align-items: center; gap: 7px; height: 30px; padding: 0 10px 0 6px; margin: 0 4px; border-radius: 15px;
    background: rgba(255, 255, 255, .08); border: 1px solid rgba(255, 255, 255, .14); color: #fff; font: 700 12px var(--font); text-decoration: none; letter-spacing: .03em;
}
.sh-dept:hover { background: rgba(255, 255, 255, .14); }
.sh-dept img { width: 20px; height: 20px; object-fit: contain; }
.sh-dept .mode-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--primary); margin-left: 4px; }
.sh-me { display: flex; align-items: center; gap: 9px; height: 40px; padding: 0 8px 0 4px; border-radius: 5px; background: none; border: 0; color: #fff; cursor: pointer; text-align: left; }
.sh-me:hover { background: rgba(255, 255, 255, .08); }
.sh-me .avatar { width: 30px; height: 30px; font-size: 12px; }
.sh-me-text { display: flex; flex-direction: column; line-height: 1.2; max-width: 140px; }
.sh-me-text strong { font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sh-me-text small { font-size: 11px; color: rgba(255, 255, 255, .6); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sh-me .caret { font-size: 9px; color: rgba(255, 255, 255, .5); }
.sh .dropdown-menu.right { top: calc(100% + 8px); }
.sh .dropdown-user { padding: 8px 10px 10px; border-bottom: 1px solid var(--line); margin-bottom: 4px; }

.sh-burger { display: none; width: 38px; height: 38px; border-radius: 5px; background: none; border: 0; color: #fff; font-size: 17px; cursor: pointer; }
.sh-burger:hover { background: rgba(255, 255, 255, .08); }
.sh-scrim { position: fixed; inset: 0; z-index: 140; background: rgba(5, 8, 12, .55); }

/* Medium screens: icons only for some menus, smaller search */
@media (max-width: 1360px) {
    .sh .sh-search { width: 220px; }
    .sh-me-text { display: none; }
}
@media (max-width: 1180px) {
    .sh .nav-links .sh-ico { display: none; }
    .sh-brand-text small { display: none; }
    .sh .sh-search { width: 180px; }
}

/* Small screens: slide-in drawer + search icon */
@media (max-width: 1024px) {
    .sh-inner { padding: 0 8px; gap: 4px; }
    .sh-burger { display: grid; place-items: center; }
    .sh-nav { flex: 1; }
    .sh .nav-links {
        position: fixed; top: 0; bottom: 0; left: 0; z-index: 150; width: min(320px, 86vw); height: 100dvh;
        flex-direction: column; align-items: stretch; gap: 0; padding: 0 0 24px; overflow-y: auto;
        background: var(--surface); color: var(--text); box-shadow: var(--shadow-lg);
        transform: translateX(-105%); transition: transform .2s ease; display: flex;
    }
    .sh .nav-links.open { transform: none; }
    .sh-drawer-head { display: flex !important; align-items: center; justify-content: space-between; height: 56px !important; padding: 0 12px 0 18px; background: var(--nav-bg); color: #fff; flex-shrink: 0; }
    .sh-drawer-close { width: 36px; height: 36px; border-radius: 5px; background: none; border: 0; color: #fff; font-size: 18px; cursor: pointer; }
    .sh .nav-links > li { height: auto; flex-direction: column; align-items: stretch; border-bottom: 1px solid var(--line); }
    .sh .nav-links > li > a { height: 48px; padding: 0 18px; border-radius: 0; color: var(--text-strong); font-size: 14.5px; }
    .sh .nav-links > li > a:hover, .sh .nav-links > li.open > a { background: var(--hover); color: var(--text-strong); }
    .sh .nav-links > li > a.active { background: var(--accent-bg); box-shadow: inset 3px 0 0 var(--primary); }
    .sh .nav-links .sh-ico { display: inline-block; color: var(--muted); }
    .sh .nav-links > li > a .caret { margin-left: auto; color: var(--muted); }
    .sh .nav-links .sh-panel, .sh .nav-links .sh-panel.wide {
        position: static; display: none; min-width: 0; width: auto; padding: 0 10px 10px; margin: 0; border: 0; box-shadow: none; border-radius: 0;
        opacity: 1; visibility: visible; transform: none; background: transparent; grid-template-columns: 1fr !important;
    }
    .sh .nav-links .dropdown.open > .sh-panel { display: block; }
    .sh .nav-links .sh-col > a small { display: none; }
    body.sh-drawer-open { overflow: hidden; }
    .sh .sh-search { display: none; position: absolute; left: 8px; right: 8px; top: 10px; width: auto; z-index: 160; background: var(--nav-bg); border-color: rgba(var(--primary-rgb), .6); }
    .sh .sh-search.show { display: flex; }
    .sh .sh-search kbd { display: none; }
    .sh .search-results { position: fixed; top: 56px; left: 8px; right: 8px; width: auto; }
    .sh-search-btn { display: grid; }
    .sh-brand { margin-right: 0; }
}
@media (max-width: 480px) {
    .sh-brand-text { display: none; }
    .sh-dept span { display: none; }
    .sh-dept { padding: 0 6px; }
    .sh .dropdown-menu.notifications { position: fixed; top: 60px; left: 8px; right: 8px; width: auto; }
}


/* Incident escalation + control flags (MDT, CAD, terminal) */
.inc-flags { display: flex; gap: 5px; flex-wrap: wrap; margin: 2px 0 10px; }
.inc-flag { display: inline-flex; align-items: center; gap: 5px; padding: 2px 8px; border-radius: 3px; font: 600 11.5px var(--font); background: var(--neutral-bg); color: var(--text); }
.inc-flag.crit { background: #E5484D; color: #fff; }
.inc-flag.elev { background: rgba(240, 140, 46, .18); color: #F5A35A; }
.inc-flag.f-intel { background: rgba(169, 139, 255, .16); color: #B9A2FF; }
.inc-flag.f-evidential { background: rgba(95, 183, 232, .16); color: #6FC1EE; }
.inc-flag.f-priority { background: rgba(240, 140, 46, .16); color: #F5A35A; }
.inc-flag.rev { background: var(--warn-bg); color: var(--warn); }
:root[data-theme="light"] .inc-flag.f-intel { color: #5B3FD6; }
:root[data-theme="light"] .inc-flag.f-evidential { color: #1C6E9C; }
:root[data-theme="light"] .inc-flag.elev, :root[data-theme="light"] .inc-flag.f-priority { color: #B3550E; }

/* Control's instruction to a unit (MDT) */
.mdt-directive { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; margin-bottom: 12px; border-radius: 4px; background: rgba(76, 141, 246, .12); border: 1px solid rgba(76, 141, 246, .4); }
.mdt-directive > i { color: #4C8DF6; font-size: 18px; margin-top: 2px; }
.mdt-directive strong { display: block; color: var(--text-strong); }
.mdt-directive small { color: var(--muted); }

/* Use more of wide screens on the standard pages */
@media (min-width: 1500px) { .container { max-width: 1440px; } }


/* ==========================================================
   SCREEN SIZES - big monitors use the space; small screens stay tidy
========================================================== */
@media (min-width: 2000px) {
    .container { max-width: 1840px; }
    .sh-inner { max-width: none; padding: 0 28px; }
    .cad-v2, .duty-v2, .mdt-screen { max-width: none !important; }
}
@media (min-width: 2400px) {
    .container { max-width: 2160px; }
}
/* Wide tables never push the page sideways: they scroll inside their box */
.panel-body:has(> table), .mdt-card-body:has(> table), .d-card-body:has(> table) { overflow-x: auto; }

/* Footer policy links */
.footer-links { display: flex; gap: 16px; flex-wrap: wrap; }
.footer-links a { color: rgba(255, 255, 255, .7); text-decoration: none; }
.footer-links a:hover { color: #fff; text-decoration: underline; }
@media (max-width: 640px) { .footer-inner { flex-direction: column; gap: 8px; align-items: flex-start; } }
