/* ==========================================================
   RSRP Mobile Data Computer - v3 "real CAD" theme.

   Loaded LAST (index.html) so it restyles every existing component
   without touching their markup: the look of an in-car MDC / CAD client
   (Motorola, Tyler, Hexagon-style) - window title bar, menu bar, icon
   toolbar, navigator pane, group boxes with header bands, data grids,
   square controls, sunken fields, a status bar along the bottom.

   Two modes, both set by components/settings.js applyTheme():
     html.mdt-light  -> Day mode (default every session)
     html.mdt-night  -> Night mode (dimmed, for driving after dark)
   Token NAMES are the same ones every other stylesheet already uses.
   The accent is fixed to CAD blue here (!important beats the old
   per-officer accent picker's inline :root values).
   ========================================================== */

/* ---------------------------------------------------------------- tokens */
:root, html.mdt-light {
  --bg-0: #dfe3e8;
  --bg-1: #eceff2;
  --bg-2: #ffffff;
  --bg-3: #f3f5f7;
  --bg-4: #e4e8ed;

  --border: #a7aeb8;
  --border-soft: #d2d7de;
  --border-strong: #868e99;

  --text-0: #101318;
  --text-1: #2a2f37;
  --text-2: #565d68;
  --text-3: #858c96;

  --danger: #c42b1c;  --danger-strong: #b1261a;  --danger-soft: #fbe3e1;
  --warn: #c98500;    --warn-strong: #8f5f00;    --warn-soft: #fff1cf;
  --good: #1f7a33;    --good-strong: #1a6b2c;    --good-soft: #e1f3e4;
  --info: #0b63c1;    --info-strong: #0a58ab;    --info-soft: #e1edfb;
  --neutral-soft: #eceef1;

  --call-color: #0b63c1;

  /* CAD chrome */
  --cad-title-1: #23497f;
  --cad-title-2: #173462;
  --cad-title-text: #ffffff;
  --cad-title-sub: #c9d8ef;
  --cad-menubar: #f6f7f9;
  --cad-toolbar-1: #fbfcfd;
  --cad-toolbar-2: #e9edf2;
  --cad-head-1: #fbfcfd;
  --cad-head-2: #e3e8ee;
  --cad-head-text: #1d2a3d;
  --cad-grid-head-1: #f7f8fa;
  --cad-grid-head-2: #e6e9ed;
  --cad-row-alt: #f6f8fb;
  --cad-hover: #e7f1fc;
  --cad-sel: #cfe5fb;
  --cad-sel-border: #7fb2e6;
  --cad-field: #ffffff;
  --cad-field-border: #9aa2ad;
  --cad-btn-1: #fdfdfd;
  --cad-btn-2: #e3e6ea;
  --cad-btn-border: #9aa1ab;
  --cad-btn-hover-1: #eef6fe;
  --cad-btn-hover-2: #d6e8fb;
  --cad-btn-hover-border: #4b8fd6;
  --cad-pane-head: #d5dce5;
  --cad-led-off: #b9bec5;
  --cad-scroll-track: #eceef1;
  --cad-scroll-thumb: #c3c8cf;
  --cad-scroll-thumb-hover: #a6adb6;
}

html.mdt-night {
  --bg-0: #14171c;
  --bg-1: #1b1f25;
  --bg-2: #20242b;
  --bg-3: #272c34;
  --bg-4: #303641;

  --border: #3f4653;
  --border-soft: #2f353f;
  --border-strong: #545d6b;

  --text-0: #e4e7eb;
  --text-1: #c0c5cd;
  --text-2: #8c939e;
  --text-3: #646b76;

  --danger: #d9473d;  --danger-strong: #f07067;  --danger-soft: rgba(217, 71, 61, .18);
  --warn: #d79a1e;    --warn-strong: #eab54d;    --warn-soft: rgba(215, 154, 30, .16);
  --good: #2f9a4c;    --good-strong: #55c072;    --good-soft: rgba(47, 154, 76, .17);
  --info: #3d8fe0;    --info-strong: #6aaaf0;    --info-soft: rgba(61, 143, 224, .17);
  --neutral-soft: rgba(150, 160, 175, .12);

  --call-color: #3d8fe0;

  --cad-title-1: #13294a;
  --cad-title-2: #0c1d38;
  --cad-title-text: #e8eef8;
  --cad-title-sub: #8fa6c8;
  --cad-menubar: #1d2128;
  --cad-toolbar-1: #232831;
  --cad-toolbar-2: #1c2027;
  --cad-head-1: #2b313b;
  --cad-head-2: #232831;
  --cad-head-text: #d5dbe4;
  --cad-grid-head-1: #2a2f38;
  --cad-grid-head-2: #23272f;
  --cad-row-alt: #23272e;
  --cad-hover: rgba(90, 150, 220, .10);
  --cad-sel: rgba(61, 143, 224, .26);
  --cad-sel-border: #3d8fe0;
  --cad-field: #15181d;
  --cad-field-border: #4a5260;
  --cad-btn-1: #333944;
  --cad-btn-2: #2a2f38;
  --cad-btn-border: #515a68;
  --cad-btn-hover-1: #364457;
  --cad-btn-hover-2: #2c3949;
  --cad-btn-hover-border: #4c8fd6;
  --cad-pane-head: #262b33;
  --cad-led-off: #4a505a;
  --cad-scroll-track: #1b1f25;
  --cad-scroll-thumb: #3e4551;
  --cad-scroll-thumb-hover: #4d5563;
}

/* fixed CAD blue accent for both modes (beats the old accent picker) */
:root {
  --accent: #0b63c1 !important;
  --accent-2: #0b63c1 !important;
  --accent-strong: #0a58ab !important;
  --accent-soft: rgba(11, 99, 193, .12) !important;
  --accent-border: rgba(11, 99, 193, .55) !important;
  --on-accent: #ffffff !important;
  --glow-accent: 0 0 0 1px rgba(11, 99, 193, .55) !important;
  --chrome: #0b63c1 !important;
  --chrome-strong: #0a58ab !important;
  --chrome-soft: rgba(11, 99, 193, .12) !important;
  --chrome-border: rgba(11, 99, 193, .55) !important;

  --priority-1: var(--danger);
  --priority-2: var(--warn);
  --priority-3: #7a828d;

  --mdt-w: min(1720px, 96vw);
  --mdt-h: min(980px, 95vh);
  --sidebar-w: 196px;
  --cad-header-h: 124px;
  --queue-h: 0px;
  --queue-gap: 0px;
  --topbar-h: calc(var(--cad-header-h) + var(--queue-h) + var(--queue-gap));
  --statusbar-h: 23px;

  --radius-lg: 2px;
  --radius: 2px;
  --radius-sm: 2px;
  --radius-xs: 1px;

  --shadow-sm: none;
  --shadow-md: 0 2px 6px rgba(0, 0, 0, .22);
  --shadow-lg: 0 6px 24px rgba(0, 0, 0, .38);

  --font-ui: 'Segoe UI', Tahoma, 'Microsoft Sans Serif', Arial, sans-serif;
  --font-display: 'Segoe UI', Tahoma, Arial, sans-serif;
  --font-mono: Consolas, 'Lucida Console', 'Courier New', monospace;

  --dur-fast: 0ms;
  --dur-med: 80ms;
}
html.mdt-night {
  --accent: #3d8fe0 !important;
  --accent-2: #3d8fe0 !important;
  --accent-strong: #6aaaf0 !important;
  --accent-soft: rgba(61, 143, 224, .18) !important;
  --accent-border: rgba(61, 143, 224, .6) !important;
  --glow-accent: 0 0 0 1px rgba(61, 143, 224, .6) !important;
  --chrome: #3d8fe0 !important;
  --chrome-strong: #6aaaf0 !important;
  --chrome-soft: rgba(61, 143, 224, .18) !important;
  --chrome-border: rgba(61, 143, 224, .6) !important;
}
html.cad-max { --mdt-w: 100vw; --mdt-h: 100vh; }

/* ---------------------------------------------------------------- base */
html, body { font-size: 12px; line-height: 1.4; -webkit-font-smoothing: auto; }
#view-root > * { animation: none; }
.rec-tab-page { animation: none; }
::selection { background: #3390ff; color: #fff; }

::-webkit-scrollbar { width: 15px; height: 15px; }
::-webkit-scrollbar-track { background: var(--cad-scroll-track); border-left: 1px solid var(--border-soft); }
::-webkit-scrollbar-thumb {
  background: var(--cad-scroll-thumb); border-radius: 0;
  border: 3px solid var(--cad-scroll-track); background-clip: padding-box;
}
::-webkit-scrollbar-thumb:hover { background: var(--cad-scroll-thumb-hover); border: 3px solid var(--cad-scroll-track); background-clip: padding-box; }
::-webkit-scrollbar-corner { background: var(--cad-scroll-track); }

/* ---------------------------------------------------------------- window */
#app { transition: opacity 120ms linear; }
html.cad-max #app { top: 0; left: 0; transform: none; }
#tablet-screen {
  background: var(--bg-0);
  border: 1px solid var(--frame-2, #0b1a33);
  border-radius: 0;
  box-shadow: var(--shadow-lg), 0 0 0 1px var(--frame-2, rgba(0, 0, 0, .35));
}
html.cad-max #tablet-screen { border: none; box-shadow: none; }

/* ---------------------------------------------------------------- header block */
#topbar {
  height: var(--cad-header-h); min-height: var(--cad-header-h);
  display: flex; flex-direction: column; align-items: stretch;
  background: var(--cad-menubar);
  border-bottom: 1px solid var(--border);
}

/* title bar */
#cad-titlebar {
  height: 28px; flex: none;
  display: flex; align-items: center; gap: 8px;
  padding-left: 8px;
  background: linear-gradient(180deg, var(--cad-title-1), var(--cad-title-2));
  color: var(--cad-title-text);
  user-select: none;
}
#cad-titlebar .tb-logo {
  width: 18px; height: 18px; border: none; border-radius: 0; background: transparent; color: #ffd36b;
}
#cad-titlebar .tb-logo svg { width: 16px; height: 16px; }
#cad-titlebar .tb-badge { width: 18px; height: 18px; }
.cad-title-text { display: flex; align-items: baseline; gap: 6px; min-width: 0; flex: 1; overflow: hidden; white-space: nowrap; }
#cad-titlebar .tb-title { font-family: var(--font-ui); font-size: 12px; font-weight: 600; letter-spacing: 0; color: var(--cad-title-text); }
#cad-titlebar .tb-title span { color: inherit; }
.cad-title-sep { color: var(--cad-title-sub); }
#cad-titlebar .tb-dept-sub {
  max-width: none; margin: 0; font-size: 12px; font-weight: 400; letter-spacing: 0; text-transform: none;
  color: var(--cad-title-sub); overflow: hidden; text-overflow: ellipsis;
}
.cad-winbtns { display: flex; height: 100%; margin-left: auto; }
.cad-winbtn, #cad-titlebar .icon-btn.close {
  width: 44px; height: 28px; flex: none;
  display: flex; align-items: center; justify-content: center;
  background: transparent; border: none; border-radius: 0; color: var(--cad-title-text);
  cursor: pointer; padding: 0;
}
.cad-winbtn svg { width: 10px; height: 10px; fill: none; stroke: currentColor; stroke-width: 1.1; }
.cad-winbtn:hover { background: rgba(255, 255, 255, .14); }
#cad-titlebar .icon-btn.close .tb-btn-ico svg { width: 13px; height: 13px; }
#cad-titlebar .icon-btn.close:hover { background: #e81123; color: #fff; border: none; }

/* menu bar */
#cad-menubar {
  height: 23px; flex: none;
  display: flex; align-items: stretch;
  background: var(--cad-menubar);
  border-bottom: 1px solid var(--border-soft);
  padding: 0 4px;
}
.cad-menus { display: flex; align-items: stretch; }
.cad-menu {
  padding: 0 9px; background: transparent; border: 1px solid transparent;
  font-size: 12px; color: var(--text-0); cursor: default; line-height: 1;
}
.cad-menu u { text-decoration: underline; text-underline-offset: 2px; }
.cad-menu:hover { background: var(--cad-hover); border-color: var(--cad-sel-border); }
.cad-menu.open { background: var(--cad-sel); border-color: var(--cad-sel-border); }
.cad-menubar-right {
  margin-left: auto; display: flex; align-items: center; gap: 6px; padding-right: 6px;
  font-size: 11px; color: var(--text-2); white-space: nowrap; overflow: hidden;
}
.cad-mb-label { color: var(--text-3); }
.cad-mb-label + .cad-mb-value { margin-right: 10px; }
.cad-mb-value { color: var(--text-0); font-weight: 600; }

.cad-menu-drop {
  position: fixed; z-index: 400; min-width: 220px;
  padding: 2px;
  background: var(--bg-2); border: 1px solid var(--border-strong);
  box-shadow: 2px 3px 8px rgba(0, 0, 0, .28);
}
.cad-menu-item {
  display: grid; grid-template-columns: 22px 1fr auto; align-items: center;
  width: 100%; height: 23px; padding: 0 10px 0 2px;
  background: transparent; border: 1px solid transparent; text-align: left;
  font-size: 12px; color: var(--text-0); cursor: default;
}
.cad-menu-item:hover { background: var(--cad-sel); border-color: var(--cad-sel-border); }
.cad-mi-check { text-align: center; font-size: 11px; }
.cad-mi-key { color: var(--text-2); font-size: 11px; padding-left: 24px; }
.cad-menu-sep { height: 1px; margin: 3px 2px 3px 26px; background: var(--border-soft); }

/* toolbar */
#cad-toolbar {
  flex: 1; min-height: 0;
  display: flex; align-items: center; gap: 4px;
  padding: 0 6px;
  background: linear-gradient(180deg, var(--cad-toolbar-1), var(--cad-toolbar-2));
}
.cad-tools { display: flex; align-items: center; gap: 1px; min-width: 0; overflow: hidden; flex: 0 1 auto; }
.cad-tsep { width: 1px; height: 36px; margin: 0 5px; flex: none; background: var(--border-soft); box-shadow: 1px 0 0 rgba(255, 255, 255, .6); }
html.mdt-night .cad-tsep { box-shadow: none; }
.cad-tool {
  position: relative; flex: none;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  min-width: 52px; height: 44px; padding: 2px 6px;
  background: transparent; border: 1px solid transparent; border-radius: 2px;
  color: var(--text-0); cursor: pointer;
}
.cad-tool-ico { display: flex; color: var(--info); }
.cad-tool-ico svg { width: 20px; height: 20px; }
.cad-tool-label { font-size: 11px; line-height: 1.1; white-space: nowrap; }
.cad-tool:hover { background: linear-gradient(180deg, var(--cad-btn-hover-1), var(--cad-btn-hover-2)); border-color: var(--cad-btn-hover-border); }
.cad-tool:active, .cad-tool.active { background: var(--cad-sel); border-color: var(--cad-sel-border); box-shadow: inset 0 1px 2px rgba(0, 0, 0, .12); }
.cad-tool-badge {
  position: absolute; top: 2px; right: 4px;
  min-width: 15px; height: 14px; padding: 0 3px;
  display: flex; align-items: center; justify-content: center;
  background: #5b6470; color: #fff; font-size: 9.5px; font-weight: 700; border-radius: 0;
}
.cad-tool-badge.alert { background: var(--danger); }

/* query box (global search) */
.cad-query { display: flex; align-items: center; gap: 6px; flex: 1 1 auto; min-width: 180px; max-width: 520px; }
.cad-query-label { font-size: 11px; font-weight: 600; color: var(--text-1); text-transform: uppercase; letter-spacing: .4px; }
#topbar .tb-search { flex: 1; min-width: 0; max-width: none; margin: 0; }
#topbar .tb-search-box {
  height: 24px; gap: 6px; padding: 0 4px 0 6px;
  background: var(--cad-field); border: 1px solid var(--cad-field-border); border-radius: 0;
  box-shadow: inset 1px 1px 2px rgba(0, 0, 0, .08);
}
#topbar .tb-search-box:hover { border-color: var(--border-strong); }
#topbar .tb-search.open .tb-search-box, #topbar .tb-search-box:focus-within { border-color: var(--accent); box-shadow: inset 1px 1px 2px rgba(0, 0, 0, .08); background: var(--cad-field); }
#topbar .tb-search-box input { font-size: 12px; }
#topbar .tb-search-ico svg { width: 13px; height: 13px; }
.kbd {
  font-family: var(--font-ui); font-size: 10px; border-radius: 0; padding: 0 4px;
  background: var(--bg-3); border: 1px solid var(--border-soft); border-bottom-width: 1px; color: var(--text-2);
}

#topbar .tb-right { margin-left: auto; gap: 6px; padding: 0 2px 0 0; height: auto; }
.cad-status-group { display: flex; flex-direction: column; gap: 1px; }
.cad-status-caption { font-size: 10px; color: var(--text-2); line-height: 1; padding-left: 1px; }
#topbar .tb-status-pill {
  height: 24px; gap: 6px; padding: 0 4px 0 6px; min-width: 150px;
  background: var(--cad-field); border: 1px solid var(--cad-field-border); border-radius: 0;
  font-size: 11.5px; font-weight: 700; letter-spacing: 0;
}
#topbar .tb-status-pill:hover, #topbar .tb-status-pill.active { border-color: var(--accent); background: var(--cad-field); }
#topbar .tb-status-pill .tb-chev {
  margin-left: auto; width: 16px; height: 20px; align-items: center; justify-content: center;
  border-left: 1px solid var(--border-soft); color: var(--text-1);
}
.cad-tool-icon.icon-btn, #topbar #tb-notif-btn {
  width: 34px; height: 34px; background: transparent; border: 1px solid transparent; border-radius: 2px; color: var(--info);
}
#topbar #tb-notif-btn:hover, #topbar #tb-notif-btn.active { background: linear-gradient(180deg, var(--cad-btn-hover-1), var(--cad-btn-hover-2)); border-color: var(--cad-btn-hover-border); color: var(--info); }
#topbar #tb-notif-btn svg { width: 19px; height: 19px; }
.icon-btn .notif-count { top: 1px; right: 1px; min-width: 15px; height: 14px; border-radius: 0; font-size: 9.5px; box-shadow: none; }
#topbar .tb-user { height: 38px; gap: 7px; padding: 0 6px 0 4px; border-radius: 2px; }
#topbar .tb-user:hover, #topbar .tb-user.active { background: linear-gradient(180deg, var(--cad-btn-hover-1), var(--cad-btn-hover-2)); border-color: var(--cad-btn-hover-border); }
.tb-user-avatar, .avatar {
  border-radius: 0; background: var(--bg-4); border: 1px solid var(--border); color: var(--text-1);
  font-size: 11px; font-weight: 700;
}
#topbar .tb-user-avatar { width: 30px; height: 30px; }
.tb-user-name { font-size: 12px; font-weight: 600; }
.tb-user-sub { font-size: 10.5px; }
.tb-user-sub .mono { color: var(--info); }

/* status LEDs instead of glowing dots */
.status-dot { width: 9px; height: 9px; border-radius: 1px; background: var(--cad-led-off); box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .25); }
.status-dot.good { background: #22a33a; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .25); }
.status-dot.busy { background: #e5a100; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .25); }
.status-dot.emergency { background: #e0261b; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .25); animation: cadBlink 1s steps(2, start) infinite; }
.status-dot.info { background: #1f78d1; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .25); }
.status-dot.off { background: var(--cad-led-off); }
@keyframes cadBlink { 50% { background: #6d1510; } }

/* ---------------------------------------------------------------- navigator */
#sidebar { background: var(--bg-1); border-right: 1px solid var(--border); }
.cad-pane-head {
  flex: none; height: 22px; display: flex; align-items: center; padding: 0 8px;
  background: var(--cad-pane-head); border-bottom: 1px solid var(--border);
  font-size: 11px; font-weight: 700; color: var(--text-1); text-transform: uppercase; letter-spacing: .5px;
}
#nav { padding: 4px 4px 6px; background: var(--bg-2); border-bottom: 1px solid var(--border); }
.nav-group { gap: 0; margin-bottom: 4px; }
.nav-section-label {
  padding: 4px 6px 2px; margin-top: 2px;
  font-size: 11px; font-weight: 700; letter-spacing: 0; text-transform: none; color: var(--text-1);
  display: flex; align-items: center; gap: 5px;
}
.nav-section-label::before {
  content: ''; width: 0; height: 0; border-left: 4px solid transparent; border-right: 4px solid transparent;
  border-top: 5px solid var(--text-2);
}
.nav-item {
  height: 22px; gap: 6px; padding: 0 6px 0 16px;
  border: 1px dotted transparent; border-radius: 0;
  font-size: 12px; font-weight: 400; color: var(--text-0);
}
.nav-icon { width: 16px; height: 16px; color: var(--info); }
.nav-icon svg { width: 15px; height: 15px; }
.nav-item:hover { background: var(--cad-hover); color: var(--text-0); }
.nav-item:hover .nav-icon { color: var(--info); }
.nav-item.active { background: var(--cad-sel); border: 1px solid var(--cad-sel-border); font-weight: 600; color: var(--text-0); }
.nav-item.active::before { display: none; }
.nav-item.active .nav-icon { color: var(--info); }
.nav-group[data-group="home"] .nav-item { padding-left: 6px; }
.nav-badge { height: 15px; min-width: 18px; padding: 0 4px; border-radius: 0; font-size: 10px; background: #6b7380; color: #fff; }
.nav-badge.alert { background: var(--danger); color: #fff; }
.nav-item.active .nav-badge { background: var(--accent); color: #fff; }

/* unit box at the bottom of the navigator */
.sb-officer { margin: 6px; padding: 0; background: var(--bg-2); border: 1px solid var(--border); border-radius: 0; }
.sb-officer-top { padding: 6px; gap: 8px; background: linear-gradient(180deg, var(--cad-head-1), var(--cad-head-2)); border-bottom: 1px solid var(--border-soft); }
.sb-officer .avatar { width: 32px; height: 32px; border-radius: 0; }
.sb-officer .avatar.on { background: var(--good-soft); color: var(--good-strong); border-color: var(--good); }
.officer-name { font-size: 12px; font-weight: 700; }
.officer-sub { font-size: 10.5px; }
.sb-officer-meta { margin: 0; padding: 6px 6px 0; gap: 4px; }
.sb-meta-cell { border-radius: 0; background: var(--cad-field); border: 1px solid var(--cad-field-border); padding: 2px 5px; }
.sb-meta-label { font-size: 9px; letter-spacing: .3px; }
.sb-meta-value { font-size: 11.5px; }
.sb-meta-value.mono { color: var(--text-0); }
.sb-duty { margin: 6px 6px 0; width: calc(100% - 12px); padding: 3px 6px; border-radius: 0; background: var(--cad-field); border: 1px solid var(--cad-field-border); font-size: 11.5px; color: var(--text-0); }
.sb-actions { margin: 6px; gap: 4px; }

/* ---------------------------------------------------------------- status bar */
#statusbar {
  gap: 2px; padding: 2px 3px;
  background: var(--bg-1); border-top: 1px solid var(--border);
  font-size: 11px; letter-spacing: 0; color: var(--text-1);
}
.sbar-item {
  height: 17px; padding: 0 7px; gap: 5px;
  border: 1px solid; border-color: var(--border) rgba(255, 255, 255, .7) rgba(255, 255, 255, .7) var(--border);
}
html.mdt-night .sbar-item { border-color: #0e1013 var(--border-soft) var(--border-soft) #0e1013; }
.sbar-sep { display: none; }
.sbar-right { gap: 2px; }
.sbar-strong { color: var(--text-0); font-weight: 700; }
.sbar-item .status-dot { width: 8px; height: 8px; }
.sbar-clock { gap: 8px; min-width: 150px; justify-content: center; }
.sbar-clock .tb-clock { font-family: var(--font-mono); font-size: 11.5px; font-weight: 700; color: var(--text-0); letter-spacing: 0; }
.sbar-clock .tb-date { font-size: 11px; color: var(--text-1); text-transform: none; letter-spacing: 0; margin: 0; display: inline; }

/* ---------------------------------------------------------------- content area */
#main-col { background: var(--bg-0); }
#view-root { padding: 0 10px 12px; }
.view-header {
  align-items: center; margin: 0 -10px 10px; padding: 7px 10px; gap: 10px;
  background: linear-gradient(180deg, var(--cad-head-1), var(--cad-head-2));
  border-bottom: 1px solid var(--border);
  min-height: 42px;
}
.view-header h1 {
  font-family: var(--font-ui); font-size: 15px; font-weight: 700; letter-spacing: 0; color: var(--cad-head-text);
}
.view-sub { margin: 0; font-size: 11px; color: var(--text-2); }
.view-actions { gap: 4px; }
.eyebrow { font-size: 10px; letter-spacing: .4px; color: var(--text-2); }

/* ---------------------------------------------------------------- buttons */
.btn {
  height: 25px; padding: 0 12px; gap: 5px;
  background: linear-gradient(180deg, var(--cad-btn-1), var(--cad-btn-2));
  border: 1px solid var(--cad-btn-border); border-radius: 2px;
  color: var(--text-0); font-size: 12px; font-weight: 400;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .55);
}
html.mdt-night .btn { box-shadow: inset 0 1px 0 rgba(255, 255, 255, .05); }
.btn:hover { background: linear-gradient(180deg, var(--cad-btn-hover-1), var(--cad-btn-hover-2)); border-color: var(--cad-btn-hover-border); }
.btn:active { transform: none; background: var(--cad-sel); box-shadow: inset 0 1px 2px rgba(0, 0, 0, .18); }
.btn:focus-visible { outline: 1px dotted var(--text-0); outline-offset: -4px; box-shadow: none; }
/* the "default" button: same face, blue frame + bold caption */
.btn.primary {
  background: linear-gradient(180deg, var(--cad-btn-1), var(--cad-btn-2));
  border-color: var(--accent); color: var(--text-0); font-weight: 600;
  box-shadow: inset 0 0 0 1px var(--accent-border), inset 0 1px 0 rgba(255, 255, 255, .55);
}
.btn.primary:hover { background: linear-gradient(180deg, var(--cad-btn-hover-1), var(--cad-btn-hover-2)); border-color: var(--accent); }
.btn.danger { background: linear-gradient(180deg, var(--cad-btn-1), var(--cad-btn-2)); border-color: var(--cad-btn-border); color: var(--danger-strong); }
.btn.danger:hover { background: linear-gradient(180deg, #fff0ef, #f8d7d4); border-color: var(--danger); color: var(--danger-strong); }
html.mdt-night .btn.danger:hover { background: linear-gradient(180deg, #4a2b2b, #3a2222); }
.btn.good { background: linear-gradient(180deg, var(--cad-btn-1), var(--cad-btn-2)); border-color: var(--cad-btn-border); color: var(--good-strong); }
.btn.good:hover { background: linear-gradient(180deg, #effaf1, #d5eedb); border-color: var(--good); color: var(--good-strong); }
html.mdt-night .btn.good:hover { background: linear-gradient(180deg, #2b4a33, #223a28); }
.btn.ghost { background: transparent; border-color: transparent; box-shadow: none; color: var(--text-0); }
.btn.ghost:hover { background: linear-gradient(180deg, var(--cad-btn-hover-1), var(--cad-btn-hover-2)); border-color: var(--cad-btn-hover-border); }
.btn.sm { height: 22px; padding: 0 8px; font-size: 11.5px; border-radius: 2px; }
.btn.xs { height: 19px; padding: 0 6px; font-size: 11px; border-radius: 1px; }
.btn:disabled, .btn[disabled] { opacity: 1; color: var(--text-3); background: var(--bg-3); border-color: var(--border-soft); box-shadow: none; }
.btn-ico svg { width: 13px; height: 13px; }
.btn.primary .btn-ico, .btn .btn-ico { color: var(--info); }
.btn.danger .btn-ico { color: var(--danger-strong); }
.btn.good .btn-ico { color: var(--good-strong); }
.btn-group { gap: 4px; }

/* ---------------------------------------------------------------- fields */
.field { gap: 2px; margin-bottom: 8px; }
.field label, .field > .label { font-size: 11px; font-weight: 400; color: var(--text-1); letter-spacing: 0; }
.field .hint, .field-hint { font-size: 10.5px; color: var(--text-2); }
.input, select.input, textarea.input {
  min-height: 24px; padding: 3px 6px;
  background: var(--cad-field); color: var(--text-0);
  border: 1px solid var(--cad-field-border); border-radius: 0;
  font-size: 12px;
  box-shadow: inset 1px 1px 1px rgba(0, 0, 0, .06);
}
.input:hover { border-color: var(--border-strong); }
.input:focus { border-color: var(--accent); box-shadow: inset 1px 1px 1px rgba(0, 0, 0, .06); background: var(--cad-field); }
.input:disabled, .input[readonly] { background: var(--bg-3); color: var(--text-2); opacity: 1; }
.input::placeholder { color: var(--text-3); font-style: italic; }
select.input {
  padding-right: 22px;
  background-color: var(--cad-field);
  background-image:
    linear-gradient(180deg, var(--cad-btn-1), var(--cad-btn-2)),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 10'%3E%3Cpath d='M2 3.5h6L5 7z' fill='%23404650'/%3E%3C/svg%3E");
  background-repeat: no-repeat, no-repeat;
  background-position: right 0 center, right 3px center;
  background-size: 17px 100%, 10px 10px;
  box-shadow: inset -18px 0 0 -17px var(--cad-field-border);
}
html.mdt-night select.input {
  background-image:
    linear-gradient(180deg, var(--cad-btn-1), var(--cad-btn-2)),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 10'%3E%3Cpath d='M2 3.5h6L5 7z' fill='%23c0c5cd'/%3E%3C/svg%3E");
}
select.input option { background: var(--bg-2); color: var(--text-0); }
textarea.input { line-height: 1.45; min-height: 60px; font-family: var(--font-ui); }
html.mdt-night input[type="date"].input, html.mdt-night input[type="time"].input, html.mdt-night input[type="datetime-local"].input { color-scheme: dark; }
input[type="checkbox"], input[type="radio"] { accent-color: var(--accent); }
.field-row { gap: 8px; }
.form-section-title {
  margin: 8px 0 6px; padding: 3px 6px;
  font-size: 11px; font-weight: 700; letter-spacing: 0; text-transform: none; color: var(--cad-head-text);
  background: linear-gradient(180deg, var(--cad-head-1), var(--cad-head-2)); border: 1px solid var(--border-soft);
}
.form-section-title::after { display: none; }

.search-bar { gap: 4px; margin-bottom: 8px; }
.search-bar .input { height: 25px; min-height: 25px; padding-left: 24px; background-color: var(--cad-field); background-position: 6px center; background-size: 13px; }
.search-bar select.input { padding-left: 6px; }
.search-bar .btn { height: 25px; }
.tag-input-box { min-height: 24px; padding: 2px 3px; gap: 3px; background: var(--cad-field); border: 1px solid var(--cad-field-border); border-radius: 0; }
.tag-input-box:focus-within { border-color: var(--accent); box-shadow: none; }
.tag-chip { height: 18px; border-radius: 0; background: var(--bg-4); border-color: var(--border); font-size: 11px; }
.tag-suggest-dropdown, .gsearch-drop, .tb-popover { border-radius: 0; box-shadow: 2px 3px 8px rgba(0, 0, 0, .28); border-color: var(--border-strong); }
.tag-suggest-item { border-radius: 0; padding: 4px 8px; }
.tag-suggest-item:hover, .tag-suggest-item.active { background: var(--cad-sel); }

/* switches -> checkboxes */
.switch { width: 15px; height: 15px; }
.switch .track { border-radius: 0 !important; background: var(--cad-field) !important; border: 1px solid var(--cad-field-border) !important; }
.switch .track::before { display: none !important; }
.switch input:checked + .track {
  background: var(--cad-field) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M2.5 6.2l2.4 2.4 4.6-5' fill='none' stroke='%230b63c1' stroke-width='1.8'/%3E%3C/svg%3E") center / 11px no-repeat !important;
  border-color: var(--accent) !important;
}
.toggle-row { padding: 6px 0; }
.toggle-row-label { font-size: 12px; }

/* ---------------------------------------------------------------- group boxes */
.panel, .table-wrap, .list-pane, .detail-pane {
  background: var(--bg-2); border: 1px solid var(--border); border-radius: 0;
}
.panel-header {
  min-height: 25px; padding: 3px 4px 3px 8px; gap: 6px;
  background: linear-gradient(180deg, var(--cad-head-1), var(--cad-head-2));
  border-bottom: 1px solid var(--border);
  font-size: 11.5px; font-weight: 700; letter-spacing: 0; text-transform: none; color: var(--cad-head-text);
}
.panel-title { gap: 6px; }
.panel-title-ico { color: var(--info); }
.panel-title-ico svg { width: 14px; height: 14px; }
.panel-body { padding: 8px 10px; gap: 6px; }
.panel-link { color: var(--info); font-size: 11px; text-decoration: underline; }
.list-pane { padding: 0; }
.detail-pane { padding: 10px 12px; }
.split-panel { gap: 8px; }

.stat-row, .kpi-row { gap: 6px; margin-bottom: 8px; }
.stat-card, .kpi {
  border-radius: 0; padding: 6px 9px 7px; background: var(--bg-2); border: 1px solid var(--border);
  border-top: 3px solid #6f7884;
}
.stat-card .stat-value, .kpi-value { font-family: var(--font-mono); font-size: 22px; font-weight: 700; letter-spacing: 0; margin-top: 2px; }
.stat-card .stat-label, .kpi-label { font-size: 10.5px; letter-spacing: .2px; text-transform: uppercase; color: var(--text-2); }
.stat-card.warn { border-top-color: var(--warn); }
.stat-card.danger { border-top-color: var(--danger); }
.stat-card.good { border-top-color: var(--good); }
.stat-card.accent { border-top-color: var(--accent); }
/* separate rules: an engine without :has() then only drops these */
.kpi:has(.kpi-value.warn) { border-top-color: var(--warn); }
.kpi:has(.kpi-value.danger) { border-top-color: var(--danger); }
.kpi:has(.kpi-value.good) { border-top-color: var(--good); }
.kpi:has(.kpi-value.accent) { border-top-color: var(--accent); }
.kpi.clickable:hover { transform: none; border-color: var(--cad-btn-hover-border); background: var(--cad-hover); }
.kpi-ico { width: 22px; height: 22px; border-radius: 0; background: transparent; }
.kpi-ico svg { width: 15px; height: 15px; }
.kpi-sub { font-size: 10.5px; }
.duty-bar { border-radius: 0; background: var(--info); }

/* ---------------------------------------------------------------- badges */
.badge {
  height: 16px; padding: 0 5px; border-radius: 0; gap: 4px;
  font-size: 10px; font-weight: 700; letter-spacing: .2px;
}
.badge.b-danger { background: var(--danger); color: #fff; border-color: var(--danger); }
.badge.b-warn { background: #f2b600; color: #1d1600; border-color: #d39e00; }
.badge.b-good { background: var(--good); color: #fff; border-color: var(--good); }
.badge.b-info { background: var(--info); color: #fff; border-color: var(--info); }
.badge.b-neutral { background: var(--bg-4); color: var(--text-1); border-color: var(--border); }
.badge.b-accent { background: var(--accent); color: #fff; border-color: var(--accent); }
html.mdt-light .badge.b-warn { color: #1d1600; }
html.mdt-light .badge.b-good { color: #fff; }
.badge.dot::before { width: 5px; height: 5px; border-radius: 0; }
.priority-dot { border-radius: 1px; box-shadow: none !important; }
.prio-tag { font-size: 10.5px; letter-spacing: .2px; }

/* ---------------------------------------------------------------- data grids */
.data-table { font-size: 12px; border-collapse: collapse; }
.data-table thead th {
  padding: 3px 8px; height: 22px;
  background: linear-gradient(180deg, var(--cad-grid-head-1), var(--cad-grid-head-2));
  border-bottom: 1px solid var(--border); border-right: 1px solid var(--border-soft);
  color: var(--text-1); font-size: 11.5px; font-weight: 600; letter-spacing: 0; text-transform: none;
}
.data-table thead th:last-child { border-right: none; }
.data-table thead th.sortable:hover { background: var(--cad-hover); color: var(--text-0); }
.data-table thead th.sorted { background: linear-gradient(180deg, var(--cad-btn-hover-1), var(--cad-btn-hover-2)); }
.data-table thead th.sorted .sort-ind { color: var(--text-0); }
.data-table tbody td { padding: 3px 8px; height: 22px; border-bottom: 1px solid var(--border-soft); color: var(--text-0); }
.data-table tbody tr:nth-child(even) td { background: var(--cad-row-alt); }
html .data-table tbody tr:hover td { background: var(--cad-hover); }
html .data-table.clickable-rows tbody tr:hover td { background: var(--cad-hover); }
html .data-table tbody tr.selected td { background: var(--cad-sel); }
.data-table tbody tr.selected td:first-child { box-shadow: none; }
.data-table td .mono, .data-table td.mono { color: var(--text-0); }
.data-table tr.table-group-row td { background: var(--bg-4) !important; color: var(--text-0); font-size: 11px; letter-spacing: 0; text-transform: none; padding: 3px 8px; }
.table-toolbar { padding: 4px 6px; gap: 4px; background: var(--bg-3); border-bottom: 1px solid var(--border-soft); }
.table-footer { padding: 3px 8px; background: var(--bg-3); border-top: 1px solid var(--border-soft); font-size: 11px; }

/* list rows (record search results etc.) */
.list-item { margin: 0; padding: 5px 8px; border: none; border-bottom: 1px solid var(--border-soft); border-radius: 0; }
.list-item:hover { background: var(--cad-hover); }
.list-item.active { background: var(--cad-sel); border-color: var(--border-soft); outline: 1px solid var(--cad-sel-border); outline-offset: -1px; }
.list-item.active::before { display: none; }
.list-item-title { font-size: 12px; font-weight: 600; }
.list-item-sub { font-size: 11px; margin-top: 1px; }
.rec-avatar { border-radius: 0; }
.rec-name { font-size: 12px; }

/* ---------------------------------------------------------------- tabs */
.tabs { gap: 0; margin-bottom: 8px; border-bottom: 1px solid var(--border); padding-left: 2px; }
.tab-btn {
  height: 23px; padding: 0 12px; margin: 0 -1px -1px 0;
  background: linear-gradient(180deg, var(--cad-btn-1), var(--cad-btn-2));
  border: 1px solid var(--border); border-radius: 2px 2px 0 0;
  color: var(--text-1); font-size: 12px; font-weight: 400; letter-spacing: 0;
}
.tab-btn::after { display: none; }
.tab-btn:hover { background: linear-gradient(180deg, var(--cad-btn-hover-1), var(--cad-btn-hover-2)); color: var(--text-0); }
.tab-btn.active { position: relative; z-index: 1; height: 25px; margin-top: -2px; background: var(--bg-2); border-bottom-color: var(--bg-2); color: var(--text-0); font-weight: 600; }
.tab-btn .count, .rec-tab .count { height: 14px; min-width: 16px; border-radius: 0; font-size: 9.5px; background: #6b7380; color: #fff; }
.tab-btn.active .count { background: var(--accent); color: #fff; }
.rec-tab .count.alert { background: var(--danger); color: #fff; }

.rec-tabs { gap: 0; padding: 0 0 0 2px; margin: 0 0 8px; background: transparent; border: none; border-bottom: 1px solid var(--border); border-radius: 0; }
.rec-tab {
  height: 23px; padding: 0 11px; margin: 0 -1px -1px 0;
  background: linear-gradient(180deg, var(--cad-btn-1), var(--cad-btn-2));
  border: 1px solid var(--border); border-radius: 2px 2px 0 0;
  color: var(--text-1); font-size: 12px; font-weight: 400;
}
.rec-tab:hover { background: linear-gradient(180deg, var(--cad-btn-hover-1), var(--cad-btn-hover-2)); color: var(--text-0); }
.rec-tab.active { position: relative; z-index: 1; background: var(--bg-2); border-bottom-color: var(--bg-2); color: var(--text-0); font-weight: 600; box-shadow: none; }

.seg { padding: 0; gap: 0; background: transparent; border: none; border-radius: 0; }
.seg button {
  height: 22px; padding: 0 10px; margin-left: -1px;
  background: linear-gradient(180deg, var(--cad-btn-1), var(--cad-btn-2));
  border: 1px solid var(--cad-btn-border); border-radius: 0;
  color: var(--text-0); font-size: 11.5px; font-weight: 400;
}
.seg button:first-child { margin-left: 0; }
.seg button:hover { background: linear-gradient(180deg, var(--cad-btn-hover-1), var(--cad-btn-hover-2)); }
.seg button.active { position: relative; z-index: 1; background: var(--cad-sel); border-color: var(--cad-sel-border); box-shadow: inset 0 1px 2px rgba(0, 0, 0, .14); font-weight: 600; }
.toolbar { gap: 4px; margin-bottom: 8px; }

/* ---------------------------------------------------------------- cards -> bordered record boxes */
.alert-card, .report-card, .offence-card, .agency-card, .evidence-item, .cell-card, .msg-thread-card {
  border-radius: 0 !important; background: var(--bg-2); border: 1px solid var(--border) !important; box-shadow: none !important;
}
.alert-card { padding: 8px 10px 8px 13px; }
.alert-card::before { width: 4px; }
.alert-card:hover, .report-card:hover, .offence-card:hover { border-color: var(--cad-btn-hover-border) !important; background: var(--cad-hover); }
.alert-card-title, .report-card-title { font-size: 12.5px; }
.alert-card-id { color: var(--info); }
.alert-card-reason { font-size: 12px; margin-bottom: 6px; }
.alert-card-fields { gap: 4px 10px; margin: 6px 0; padding: 6px 0; }
.acf-label, .pf-label, .info-label, .dash-cell-label, .sb-meta-label { text-transform: uppercase; }
.alert-card-actions { gap: 4px; margin-top: 6px; }
.report-card-list { gap: 4px; }
.report-card { padding: 7px 10px; }
.report-card-meta .mono { color: var(--info); }
.note-card { border-radius: 0; padding: 6px 8px; background: var(--bg-3); }
.callout { border-radius: 0; }
.empty-state::before { border-radius: 0 !important; }
.chip { border-radius: 0 !important; }

.info-grid { border-radius: 0 !important; margin-bottom: 8px; }
.info-item { padding: 4px 7px; }
.info-item .info-label { font-size: 10px; letter-spacing: .3px; color: var(--text-2); }
.info-item .info-value { font-size: 12px; }
.profile-head { padding-bottom: 8px; margin-bottom: 8px; gap: 12px; }
.profile-photo, .profile-photo img, .record-photo-thumb, .photo-tile, .attachment-thumb { border-radius: 0 !important; }
.profile-name { font-size: 18px; }
.profile-fact { border-radius: 0 !important; }

.unit-row, .feed-row, .recent-row, .dash-unit, .cad-strip, .cad-stat { border-radius: 0 !important; }
.unit-row { background: var(--bg-2); border: 1px solid var(--border-soft); }
.feed-row.clickable:hover, .recent-row:hover { background: var(--cad-hover); }

/* ---------------------------------------------------------------- dialogs */
.modal-backdrop { background: rgba(10, 14, 22, .45); animation: none; }
.modal-box {
  border-radius: 0; border: 1px solid #10274a; background: var(--bg-1);
  box-shadow: 0 8px 28px rgba(0, 0, 0, .45); animation: none;
}
.modal-header {
  min-height: 26px; padding: 0 8px !important;
  background: linear-gradient(180deg, var(--cad-title-1), var(--cad-title-2)) !important;
  border-bottom: none !important;
  position: sticky; top: 0; z-index: 2;
}
.modal-header::before { display: none; }
.modal-header h3 { font-family: var(--font-ui); font-size: 12px; font-weight: 600; color: var(--cad-title-text); letter-spacing: 0; }
.modal-header .btn, .modal-header .badge { box-shadow: none; }
.modal-body { padding: 12px 14px; background: var(--bg-1); }
.modal-footer {
  padding: 8px 10px !important; gap: 6px !important;
  background: var(--bg-1) !important; border-top: 1px solid var(--border-soft) !important;
}
.modal-footer .btn { min-width: 76px; }

/* notifications / toasts */
.toast {
  border-radius: 0; border: 1px solid var(--border-strong); background: var(--bg-2);
  box-shadow: 2px 3px 10px rgba(0, 0, 0, .3); animation: none; padding: 8px 10px 8px 12px;
}
.toast::before { width: 4px; }
.toast-title { font-size: 12px; }
.toast-title > span:first-child { border-radius: 0 !important; }
.toast-msg { font-size: 11.5px; }

/* popovers & menus */
.tb-popover { animation: none; }
.tb-popover .panel-header { min-height: 25px; }
.tb-popover .panel-body { padding: 2px; gap: 0; }
.menu-item { border-radius: 0 !important; height: 24px; padding: 0 8px; font-size: 12px; border: 1px solid transparent; }
.menu-item:hover { background: var(--cad-sel); border-color: var(--cad-sel-border); }
.menu-item.active { background: var(--cad-sel); }
.menu-item .mi-ico { color: var(--info); }
.menu-item.danger:hover { background: var(--danger-soft); border-color: var(--danger); }
.menu-sep { margin: 2px; }
.menu-head { padding: 8px 10px; background: linear-gradient(180deg, var(--cad-head-1), var(--cad-head-2)); }
.notif-item { border-radius: 0 !important; }
.notif-ico { border-radius: 0 !important; }

/* global search drop-down */
.gsearch-drop { top: calc(100% + 2px); }
.gs-scope { border-radius: 0 !important; }
.gs-scope.active { background: var(--cad-sel) !important; border-color: var(--cad-sel-border) !important; color: var(--text-0) !important; }
.cmdk-item { border-radius: 0; padding: 5px 8px; border: 1px solid transparent; }
.cmdk-item.active { background: var(--cad-sel); box-shadow: none; border-color: var(--cad-sel-border); }
.cmdk-item-icon { border-radius: 0 !important; }
.cmdk-item-title { font-size: 12px; }

/* about box */
.cad-about { display: flex; gap: 14px; align-items: center; }
.cad-about-logo { width: 48px; height: 48px; display: flex; align-items: center; justify-content: center; color: var(--info); border: 1px solid var(--border); background: var(--bg-2); }
.cad-about-logo svg { width: 30px; height: 30px; }
.cad-about-name { font-size: 14px; font-weight: 700; }

/* ---------------------------------------------------------------- CAD / dispatch tab */
.cad-strip { border: 1px solid var(--border) !important; background: var(--bg-2) !important; gap: 0 !important; }
.cad-stat { padding: 4px 12px !important; border-right: 1px solid var(--border-soft) !important; }
.cad-stat-label { font-size: 10px !important; letter-spacing: .3px !important; color: var(--text-2) !important; text-transform: uppercase; }
.cad-stat-value { font-family: var(--font-mono); font-size: 17px !important; }
.dsp-grid { gap: 8px; }
.dsp-assign.on { background: var(--cad-sel); box-shadow: none; }
.dsp-tabs { padding: 4px 4px 0; gap: 0; background: var(--bg-3); border-bottom: 1px solid var(--border); }
.dsp-filters { padding: 5px 6px; gap: 5px; background: var(--bg-3); }
.dsp-filters .input { height: 23px; min-height: 23px; }
.dsp-list { padding: 0; gap: 0; }
.dsp-call {
  border: none; border-bottom: 1px solid var(--border-soft); border-radius: 0;
  background: var(--bg-2); color: var(--text-1);
}
.dsp-call:nth-child(even) { background: var(--cad-row-alt); }
.dsp-call:hover { background: var(--cad-hover); border-color: var(--border-soft); }
.dsp-call.sel { background: var(--cad-sel); box-shadow: inset 0 0 0 1px var(--cad-sel-border); border-color: var(--border-soft); }
.dsp-call-rail { width: 5px; background: var(--call-color); }
.dsp-call.panic .dsp-call-rail { background: var(--danger); }
.dsp-call.closed .dsp-call-rail { background: #8a919b; }
.dsp-call.mine::after { border-color: transparent var(--good) transparent transparent; }
.dsp-call-main { padding: 5px 8px 6px; gap: 2px; }
.dsp-code { border-radius: 0; height: 16px; padding: 0 4px; background: var(--bg-4); border-color: var(--border); font-size: 10.5px; }
.dsp-call.panic .dsp-code { background: var(--danger); border-color: var(--danger); color: #fff; }
.dsp-call-id { color: var(--text-1); }
.dsp-call-title { font-size: 12.5px; font-weight: 700; }
.dsp-call-loc { font-size: 11px; }
.dsp-uchip { border-radius: 0; height: 16px; padding: 0 5px; font-size: 10.5px; background: var(--bg-3); }
.dsp-uchip::before { border-radius: 0; }
.dsp-live, .dsp-req, .dsp-fire, .dsp-gtag, .dsp-utag, .dsp-mode-pill { border-radius: 0 !important; }
.dsp-unit-group-head { padding: 3px 6px; font-size: 10.5px; letter-spacing: .3px; color: var(--text-1); background: var(--bg-4); border-top: 1px solid var(--border-soft); border-bottom: 1px solid var(--border-soft); }
.dsp-unit-group { gap: 0; margin-bottom: 0; }
.dsp-unit { padding: 3px 6px; border-radius: 0; border: none; border-bottom: 1px solid var(--border-soft); font-size: 12px; }
.dsp-unit:hover { background: var(--cad-hover); border-color: var(--border-soft); }
.dsp-unit.me { background: var(--cad-sel); }
.dsp-unit-cs { color: var(--text-0); }
.dsp-dept-dot { border-radius: 0; }
.dsp-d-head { padding: 8px 10px; background: linear-gradient(180deg, var(--cad-head-1), var(--cad-head-2)); border-bottom: 1px solid var(--border); }
.dsp-d-head::before { height: 4px; background: var(--call-color); }
.dsp-d-head.panic::before { background: var(--danger); }
.dsp-d-head.panic .dsp-d-prio { color: var(--danger-strong); }
.dsp-d-title { font-family: var(--font-ui); font-size: 16px; margin-top: 4px; }
.dsp-d-loc svg { color: var(--info); }
.dsp-d-actions { padding: 5px 8px; gap: 4px; background: var(--bg-3); }
.dsp-d-actions .btn { height: 23px; font-size: 11.5px; }
.dsp-d-scroll { padding: 8px 10px; gap: 8px; }
.dsp-d-msg { border-radius: 0; background: var(--cad-field); border: 1px solid var(--border-soft); border-left: 3px solid var(--call-color); font-size: 12px; }
.dsp-sec-title { font-size: 11px; letter-spacing: 0; text-transform: none; color: var(--cad-head-text); padding: 3px 6px; background: linear-gradient(180deg, var(--cad-head-1), var(--cad-head-2)); border: 1px solid var(--border-soft); }
.dsp-sec-title::after { display: none; }
.dsp-fact-l { font-size: 10px; letter-spacing: .3px; color: var(--text-2); }
.dsp-empty-ico { border-radius: 0; }
.dst-tile, .dst-board, .dst-calls { border-radius: 0 !important; }

/* map widget pins: one color for calls, red for officer emergencies */
.mw-call .mw-pin { background: var(--call-color); }
.mw-call.panic .mw-pin { background: var(--danger); }
.mw-call .mw-pulse { border-color: var(--call-color); }
.mw-call.panic .mw-pulse { border-color: var(--danger); }
.map-legend, .map-controls, .map-tooltip { border-radius: 0 !important; }
.map-panel { border-radius: 0 !important; }

/* ---------------------------------------------------------------- small screens */
@media (max-width: 1600px) {
  :root { --sidebar-w: 184px; }
  .cad-tool { min-width: 46px; padding: 2px 4px; }
}
@media (max-width: 1440px) {
  .cad-menubar-right { display: none; }
  .cad-tool-label { font-size: 10.5px; }
  #topbar .tb-user-text { display: none; }
}
@media (max-width: 1320px) {
  :root { --sidebar-w: 172px; --cad-header-h: 116px; }
  .cad-tool { min-width: 40px; height: 40px; }
  .cad-tool-ico svg { width: 18px; height: 18px; }
  .cad-tool-label { display: none; }
  .cad-query-label { display: none; }
  #topbar .tb-status-pill { min-width: 0; }
  #view-root { padding: 0 8px 10px; }
  .view-header { margin: 0 -8px 8px; }
}
@media (max-height: 780px) {
  :root { --cad-header-h: 110px; --statusbar-h: 22px; }
  #cad-titlebar { height: 24px; }
  .cad-winbtn, #cad-titlebar .icon-btn.close { height: 24px; }
  .cad-tool { height: 38px; }
  .cad-tool-label { display: none; }
  .nav-item { height: 20px; }
}

/* camera view has no form caption band */
.camera-app-screen { margin-top: 10px; }

/* ================================================================
   Dispatch-console layout: call queue + unit board fixed across the
   top of the content area (core/cadqueue.js), records underneath.
   ================================================================ */
#cad-queue {
  flex: none; height: var(--queue-h);
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(330px, 30%);
  gap: 4px; padding: 4px 4px 0;
  background: var(--bg-0);
  overflow: hidden;
}
#cad-queue.hidden { display: none; }
.cq-calls, .cq-units {
  display: flex; flex-direction: column; min-width: 0; min-height: 0;
  background: var(--bg-2); border: 1px solid var(--border);
}
.cq-head {
  flex: none; height: 26px; display: flex; align-items: center; gap: 8px;
  padding: 0 4px 0 6px;
  background: linear-gradient(180deg, var(--cad-title-1), var(--cad-title-2));
  color: var(--cad-title-text); white-space: nowrap; overflow: hidden;
}
.cq-title { font-weight: 700; font-size: 12px; text-transform: uppercase; letter-spacing: .4px; }
.cq-count { font-size: 11px; color: var(--cad-title-sub); }
.cq-count b { color: #fff; font-family: var(--font-mono); margin-left: 2px; }
#cq-pend-wrap.hot b { color: #ffd36b; }
.cq-emerg {
  padding: 1px 6px; background: #e0261b; color: #fff; font-size: 10.5px; font-weight: 700;
  animation: cqFlash 1s steps(2, start) infinite;
}
@keyframes cqFlash { 50% { background: #7a130d; } }
.cq-collapse {
  width: 18px; height: 18px; padding: 0; display: flex; align-items: center; justify-content: center;
  background: rgba(255, 255, 255, .12); border: 1px solid rgba(255, 255, 255, .25); color: #fff;
  font-size: 8px; cursor: pointer;
}
.cq-collapse:hover { background: rgba(255, 255, 255, .25); }
.cq-head .seg button { height: 18px; padding: 0 8px; font-size: 11px; }
.cq-sel {
  flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis;
  font-size: 11px; color: var(--cad-title-sub); text-align: right;
}
.cq-actions { display: flex; gap: 3px; flex: none; }
.cq-head .btn.sm { height: 19px; padding: 0 8px; font-size: 11px; }
.cq-head .btn:disabled { background: rgba(255, 255, 255, .08); border-color: rgba(255, 255, 255, .15); color: rgba(255, 255, 255, .4); }

.cq-grid { flex: 1; min-height: 0; overflow: auto; }
.cq-table { width: 100%; border-collapse: collapse; table-layout: fixed; font-size: 11.5px; }
.cq-table thead th {
  position: sticky; top: 0; z-index: 1;
  height: 20px; padding: 0 5px; text-align: left; white-space: nowrap;
  background: linear-gradient(180deg, var(--cad-grid-head-1), var(--cad-grid-head-2));
  border-bottom: 1px solid var(--border); border-right: 1px solid var(--border-soft);
  font-weight: 600; color: var(--text-1);
}
.cq-table td {
  height: 20px; padding: 0 5px; border-bottom: 1px solid var(--border-soft);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--text-0);
}
.cq-table tbody tr { cursor: default; }
.cq-table tbody tr:nth-child(even) td { background: var(--cad-row-alt); }
.cq-table tbody tr:hover td { background: var(--cad-hover); }
.cq-table tbody tr.sel td { background: var(--accent) !important; color: #fff; }
.cq-table tbody tr.sel .cq-none { color: rgba(255, 255, 255, .7); }
.cq-table tr.cq-empty td { height: 40px; text-align: center; color: var(--text-2); font-style: italic; background: transparent !important; }

.cq-stbox {
  display: inline-block; width: 76px; text-align: center;
  font-size: 10px; font-weight: 700; letter-spacing: .2px; line-height: 15px;
  border: 1px solid rgba(0, 0, 0, .2);
}
.cq-stbox.pend { background: #f2b600; color: #1d1600; }
.cq-stbox.disp { background: #1f78d1; color: #fff; }
.cq-stbox.scene { background: #22a33a; color: #fff; }
.cq-stbox.emerg { background: #e0261b; color: #fff; animation: cqFlash 1s steps(2, start) infinite; }
.cq-row.pend .cq-code { color: var(--warn-strong); }
.cq-row.emerg td { color: var(--danger-strong); font-weight: 700; }
.cq-row.sel.emerg td { color: #fff; }
.cq-nature { font-weight: 600; }
.cq-mine { padding: 0 4px; margin-left: 4px; background: var(--good); color: #fff; font-size: 9.5px; font-weight: 700; }
.cq-none { color: var(--text-3); }
.cq-units .cq-head { justify-content: space-between; }
.cq-udept { display: inline-block; width: 6px; height: 10px; margin-right: 5px; vertical-align: -1px; }
.cq-ust { font-weight: 600; }
.cq-ust.cqs-good { color: var(--good-strong); }
.cq-ust.cqs-busy { color: var(--warn-strong); }
.cq-ust.cqs-emergency { color: var(--danger-strong); }
.cq-ust.cqs-info { color: var(--info-strong); }
.cq-ust.cqs-off { color: var(--text-2); }
.cq-urow.me td { font-weight: 700; }

/* collapsed: header bars only */
#cad-queue.collapsed { grid-template-rows: 26px; }
#cad-queue.collapsed .cq-grid { display: none; }
#cad-queue.collapsed .cq-calls, #cad-queue.collapsed .cq-units { border-bottom: none; }

#cq-splitter {
  flex: none; height: var(--queue-gap); cursor: row-resize;
  background: var(--bg-0);
  border-bottom: 1px solid var(--border);
}
#cad-queue.hidden + #cq-splitter { display: none; }
#cad-queue.collapsed + #cq-splitter { cursor: default; }
#cq-splitter:hover { background: var(--cad-sel); }
body.cq-dragging, body.cq-dragging * { cursor: row-resize !important; user-select: none !important; }

/* records area under the queue: its title band sits flush under the splitter */
#view-root { padding-top: 0; }

@media (max-width: 1440px) {
  #cad-queue { grid-template-columns: minmax(0, 1fr) 290px; }
  .cq-sel { display: none; }
}
@media (max-width: 1320px) {
  .cq-calls .cq-table th:nth-child(3), .cq-calls .cq-table td:nth-child(3), .cq-calls .cq-table th:nth-child(9), .cq-calls .cq-table td:nth-child(9) { display: none; }
}

/* the queue already shows the call / unit counts, so the CAD screen's own
   stat strip is dropped while the queue is on screen */
html.cq-on .dsp-strip, html.cq-on #dsp-strip { display: none !important; }
html.cq-on .dsp-grid { height: calc(var(--mdt-h) - var(--topbar-h) - var(--statusbar-h) - 140px); min-height: 280px; }
.cq-mute { height: 18px; padding: 0 7px; font-size: 10.5px; font-weight: 700; cursor: pointer;
  background: rgba(255, 255, 255, .12); border: 1px solid rgba(255, 255, 255, .25); color: #fff; }
.cq-mute.muted { background: #e0261b; border-color: #e0261b; }

/* ================================================================
   Command line (core/cadcommand.js)
   ================================================================ */
#cad-cmdbar {
  flex: none; height: 24px; display: flex; align-items: center; gap: 6px;
  padding: 0 6px; background: var(--bg-1); border-top: 1px solid var(--border-soft);
}
.cad-cmd-label { font-family: var(--font-mono); font-size: 12px; font-weight: 700; color: var(--accent); }
#cad-cmd-input {
  flex: 0 1 520px; min-width: 200px; height: 19px; padding: 0 6px;
  background: #0d1117; color: #7CFC9A; border: 1px solid var(--cad-field-border); border-radius: 0; outline: none;
  font-family: var(--font-mono); font-size: 12px; text-transform: uppercase; caret-color: #7CFC9A;
}
#cad-cmd-input::placeholder { color: #4d6b55; text-transform: none; font-style: normal; }
#cad-cmd-input:focus { border-color: var(--accent); }
.cad-cmd-resp { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-family: var(--font-mono); font-size: 11.5px; color: var(--text-2); }
.cad-cmd-resp.ok { color: var(--good-strong); }
.cad-cmd-resp.err { color: var(--danger-strong); }
#cad-cmdbar .btn.xs { height: 18px; }

/* ================================================================
   Incident record (core/cadincident.js)
   ================================================================ */
.modal-box.inc-modal { width: min(1060px, 94vw); }
.inc-box { display: flex; flex-direction: column; }
.inc-title { display: flex; align-items: center; gap: 8px; }
.inc-title .cq-stbox { width: auto; padding: 0 6px; }
.inc-tabs { margin: 0; padding: 6px 8px 0; background: var(--bg-1); }
.inc-body { min-height: 430px; max-height: 64vh; overflow: auto; background: var(--bg-2) !important; border-top: none; }
.inc-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px 8px; }
.inc-f label { display: block; font-size: 10px; text-transform: uppercase; letter-spacing: .3px; color: var(--text-2); margin-bottom: 1px; }
.inc-f > div {
  min-height: 21px; padding: 2px 6px; display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
  background: var(--bg-3); border: 1px solid var(--cad-field-border); font-size: 12px;
}
.inc-f.w2 { grid-column: span 2; }
.inc-sec {
  margin: 10px 0 4px; padding: 3px 6px; font-size: 11px; font-weight: 700; color: var(--cad-head-text);
  background: linear-gradient(180deg, var(--cad-head-1), var(--cad-head-2)); border: 1px solid var(--border-soft);
}
.inc-text { padding: 6px 8px; background: var(--bg-3); border: 1px solid var(--cad-field-border); white-space: pre-wrap; font-size: 12px; min-height: 40px; }
.inc-log { border: 1px solid var(--border-soft); }
.inc-log-row { display: grid; grid-template-columns: 112px 190px 1fr; gap: 8px; padding: 3px 6px; border-bottom: 1px solid var(--border-soft); font-size: 12px; }
.inc-log-row:nth-child(even) { background: var(--cad-row-alt); }
.inc-log-row b { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.inc-empty { padding: 14px; text-align: center; color: var(--text-2); font-style: italic; }
.inc-add { display: flex; gap: 6px; align-items: center; margin-top: 8px; }
.inc-add .input { flex: 1; }
.inc-add-ent .input:first-child { flex: 1.2; }
.inc-add-ent select.input { flex: 0 0 170px; }
.inc-table td, .inc-table th { white-space: normal; }
.inc-table tbody td { height: auto; padding: 3px 6px; }
.inc-foot-left { margin-right: auto; font-size: 11px; color: var(--text-2); }

/* ================================================================
   Denser, docked layout - every program window
   ================================================================ */
#tablet-screen { font-size: 11.5px; }
.cad-tool { height: 40px; min-width: 48px; }
.cad-tool-ico svg { width: 18px; height: 18px; }
.cad-tool-label { font-size: 10.5px; }
.nav-item { height: 20px; font-size: 11.5px; }
.nav-section-label { padding: 2px 6px 1px; font-size: 11px; }
#view-root { padding: 0 6px 8px; }
.view-header { margin: 0 -6px 6px; padding: 4px 8px; min-height: 34px; }
.view-header h1 { font-size: 13.5px; }
.view-sub { font-size: 10.5px; }
.eyebrow { font-size: 9.5px; margin-bottom: 1px; }
.btn { height: 22px; padding: 0 9px; font-size: 11.5px; }
.btn.sm { height: 20px; padding: 0 7px; font-size: 11px; }
.input, select.input, textarea.input { min-height: 22px; padding: 2px 5px; font-size: 11.5px; }
.search-bar .input, .search-bar .btn { height: 22px; min-height: 22px; }
.search-bar { margin-bottom: 6px; }
.field { margin-bottom: 6px; }
.panel-header { min-height: 22px; padding: 2px 4px 2px 6px; font-size: 11px; }
.panel-body { padding: 6px 8px; gap: 4px; }
.data-table { font-size: 11.5px; }
.data-table thead th { height: 20px; padding: 2px 6px; font-size: 11px; }
.data-table tbody td { height: 19px; padding: 1px 6px; }
.list-item { padding: 3px 6px; }
.list-item-title { font-size: 11.5px; }
.list-item-sub { font-size: 10.5px; }
.split-panel { gap: 6px; }
.detail-pane { padding: 6px 8px; }
.stat-card, .kpi { padding: 4px 7px 5px; }
.stat-card .stat-value, .kpi-value { font-size: 18px; }
.stat-card .stat-label, .kpi-label { font-size: 10px; }
.stat-row, .kpi-row { gap: 4px; margin-bottom: 6px; }
.tab-btn, .rec-tab { height: 21px; padding: 0 9px; font-size: 11.5px; }
.tab-btn.active { height: 23px; }
.tabs, .rec-tabs { margin-bottom: 6px; }
.info-item { padding: 2px 6px; }
.info-item .info-value { font-size: 11.5px; }
.profile-name { font-size: 15px; }
.alert-card { padding: 6px 8px 6px 11px; }
.report-card { padding: 5px 8px; }
.cad-stat { padding: 2px 10px !important; }
.cad-stat-value { font-size: 15px !important; }
.dsp-call-main { padding: 3px 7px 4px; gap: 1px; }
.dsp-call-title { font-size: 12px; }
.dsp-d-head { padding: 6px 8px; }
.dsp-d-title { font-size: 14px; margin-top: 2px; }
.dsp-d-scroll { padding: 6px 8px; gap: 6px; }
.dsp-d-actions { padding: 4px 6px; }
.dsp-unit { padding: 2px 6px; font-size: 11.5px; }
.cq-table { font-size: 11px; }
.cq-table td { height: 18px; }
.cq-table thead th { height: 18px; }
.cq-stbox { line-height: 13px; font-size: 9.5px; }
#cad-queue { gap: 3px; padding: 3px 3px 0; }
.cq-head { height: 22px; }
.sbar-item { height: 16px; font-size: 10.5px; }
