/*
 * SOC Dashboard - v2 layout (2026-10-15 redesign, approved showcase
 * "soc_dashboard_redesign_showcase.html").
 *
 * Linked from templates/base.html AFTER its inline <style> block, so every
 * rule here wins over the older rules of the same specificity without
 * editing them. Pages keep their own markup and class names; this sheet only
 * restyles the shared parts:
 *   1. IBM Plex Sans / Plex Mono, served from static/fonts (SIL OFL 1.1),
 *      so the app works where the internet is blocked.
 *   2. Colour tokens (same names as before, refined values) plus the dark
 *      navigation tokens.
 *   3. App shell: dark grouped sidebar, full-width top bar (breadcrumbs,
 *      search, alerts, theme, user), sticky page header under it.
 *   4. Shared parts on every dashboard: page header, KPI tiles, cards,
 *      tables, buttons, inputs, pills - and the two packaged dashboards
 *      (SOC Executive, Resource Allocation) brought onto the same look.
 *   5. Command Centre and command palette.
 * No figure, rule, permission or link is changed by anything in here.
 */

/* ---------------------------------------------------------------- fonts */
@font-face { font-family: "IBM Plex Sans"; font-style: normal; font-weight: 400; font-display: swap; src: url("../fonts/ibm-plex-sans-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Sans"; font-style: normal; font-weight: 500; font-display: swap; src: url("../fonts/ibm-plex-sans-latin-500-normal.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Sans"; font-style: normal; font-weight: 600; font-display: swap; src: url("../fonts/ibm-plex-sans-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Sans"; font-style: normal; font-weight: 700 900; font-display: swap; src: url("../fonts/ibm-plex-sans-latin-700-normal.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Mono"; font-style: normal; font-weight: 400; font-display: swap; src: url("../fonts/ibm-plex-mono-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Mono"; font-style: normal; font-weight: 500; font-display: swap; src: url("../fonts/ibm-plex-mono-latin-500-normal.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Mono"; font-style: normal; font-weight: 600; font-display: swap; src: url("../fonts/ibm-plex-mono-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Mono"; font-style: normal; font-weight: 700 900; font-display: swap; src: url("../fonts/ibm-plex-mono-latin-700-normal.woff2") format("woff2"); }

/* --------------------------------------------------------------- tokens */
:root {
  --sans: "IBM Plex Sans", "Segoe UI", system-ui, -apple-system, Roboto, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, "Cascadia Mono", Consolas, Menlo, monospace;
  --bg: #f3f5f6; --panel: #ffffff; --panel-2: #f6f8f9; --sunken: #eef2f3;
  --text: #14232a; --muted: #5a6b74; --text-faint: #8c9aa2;
  --border: #dfe5e8; --border-soft: #eaeef0; --track: #e9eef0;
  --accent: #0b5f6b; --accent-strong: #08464f; --accent-soft: #0b5f6b14; --accent-soft-2: #0b5f6b2b; --accent-ink: #ffffff;
  --ok: #1a7a4c; --good-bg: #e5f4ec; --good-border: #bfe3cf;
  --warn: #a6690a; --amber-bg: #fbf0dc; --amber-border: #f0d6a6;
  --bad: #b3261e; --bad-bg: #fbe9e7; --bad-border: #f1c4bf;
  --high: #c2410c; --high-bg: #fdeee4; --info: #2f6690; --info-bg: #e7f0f7;
  --violet: #6a4c93; --violet-bg: #f1ecf7; --violet-border: #dccbea;
  --neutral-chip-bg: #eef1f3; --neutral-chip-border: #d9dfe2;
  --side: #0f1d23; --side-2: #132730; --side-text: #c9d6db; --side-muted: #7f949c; --side-line: #ffffff12; --side-active: #16323b; --side-mark: #2bb673;
  --radius: 8px; --radius-sm: 6px; --radius-card: 12px;
  --shadow: 0 1px 2px rgba(16,30,36,.05), 0 6px 20px -12px rgba(16,30,36,.18);
  --shadow-sm: 0 1px 2px rgba(16,30,36,.05); --shadow-md: 0 2px 10px rgba(16,30,36,.08);
  --side-w: 228px; --topbar-h: 56px;
}
:root[data-theme="dark"] {
  --bg: #0d1417; --panel: #141d21; --panel-2: #111a1e; --sunken: #0f171a;
  --text: #e5eef1; --muted: #9db0b8; --text-faint: #6f838b;
  --border: #24323a; --border-soft: #1c272d; --track: #0f171a;
  --accent: #5ec0ce; --accent-strong: #8ad3dd; --accent-soft: #5ec0ce1c; --accent-soft-2: #5ec0ce38; --accent-ink: #06262b;
  --ok: #4fc489; --good-bg: #10291c; --good-border: #1d4a33;
  --warn: #dcaa4a; --amber-bg: #2e2209; --amber-border: #57401a;
  --bad: #ec7469; --bad-bg: #331512; --bad-border: #5c241f;
  --high: #f59a5c; --high-bg: #32200f; --info: #7cb8e0; --info-bg: #12242f;
  --violet: #b9a2dc; --violet-bg: #231e31; --violet-border: #3d3455;
  --neutral-chip-bg: #1b252a; --neutral-chip-border: #2c3a41;
  --side: #091013; --side-2: #0e1a1f; --side-text: #c3d1d6; --side-muted: #6d828a; --side-line: #ffffff10; --side-active: #13262d;
  --shadow: 0 1px 2px rgba(0,0,0,.3), 0 8px 24px -14px rgba(0,0,0,.6);
  --shadow-sm: 0 1px 2px rgba(0,0,0,.3); --shadow-md: 0 2px 12px rgba(0,0,0,.35);
}
:root { --sev-high: var(--high); --sev-high-bg: var(--high-bg); --sev-low: var(--info); --sev-low-bg: var(--info-bg); }
[data-theme="dark"] { --sev-high: var(--high); --sev-high-bg: var(--high-bg); --sev-low: var(--info); --sev-low-bg: var(--info-bg); }

/* ----------------------------------------------------------------- base */
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--sans); font-size: 14px; line-height: 1.45;
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
}
button, input, select, textarea { font-family: inherit; }
h1 { font-size: 21px; font-weight: 600; letter-spacing: -.01em; text-wrap: balance; }
h2 { font-size: 16px; font-weight: 650; letter-spacing: -.005em; margin: 26px 0 4px; }
h3 { font-size: 14px; font-weight: 600; }
a:hover { text-decoration: underline; text-underline-offset: 2px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.muted { color: var(--muted); }

/* ---------------------------------------------------------------- shell */
.sidebar {
  width: var(--side-w); flex: 0 0 var(--side-w); height: 100vh; min-height: 100vh; overflow-y: auto;
  background: var(--side); color: var(--side-text); border-right: 0;
  scrollbar-width: thin; scrollbar-color: #ffffff22 transparent;
}
.sidebar::before { display: none; }
.sidebar-brand { height: var(--topbar-h); padding: 0 16px; border-bottom: 1px solid var(--side-line); gap: 10px; }
.sidebar-brand .header-brand-mark { width: 30px; height: 30px; border-radius: 8px; padding: 3px; }
.sidebar-brand .header-brand-title { color: #ffffff; font-size: 14px; font-weight: 600; letter-spacing: 0; }
.sidebar-brand-sub { display: block; color: var(--side-muted); font-size: 11px; font-weight: 400; margin-top: 1px; }
.sidebar-nav { padding: 8px 10px 18px; }
.sidebar-label,
.sidebar-label:not(:first-of-type) {
  color: var(--side-muted); font-size: 10.5px; font-weight: 600; letter-spacing: .09em;
  margin: 16px 8px 5px; padding: 0; border-top: 0;
}
.sidebar-nav > .sidebar-label:first-child { margin-top: 10px; }
.sidebar-link {
  margin: 1px 0; padding: 7px 10px; gap: 10px; border-radius: 8px;
  color: var(--side-text); font-size: 13.5px; font-weight: 400;
}
.sidebar-link:hover { background: #ffffff0d; color: #ffffff; transform: none; text-decoration: none; }
.sidebar-link.active { color: #ffffff; background: var(--side-active); box-shadow: inset 3px 0 0 var(--side-mark); font-weight: 500; }
.sidebar-icon { width: 20px; height: 20px; border-radius: 0; color: inherit; opacity: .85; }
.sidebar-icon svg { width: 17px; height: 17px; }
.sidebar-link:hover .sidebar-icon, .sidebar-link.active .sidebar-icon { color: inherit; opacity: 1; }
.sidebar-sublink { margin-left: 22px; font-size: 12.5px; padding-top: 5px; padding-bottom: 5px; }
.sidebar-sublink .sidebar-icon { width: 16px; height: 16px; }
.sidebar-sublink .sidebar-icon svg { width: 14px; height: 14px; }
.sb-cnt {
  margin-left: auto; min-width: 20px; padding: 1px 7px; border-radius: 99px; text-align: center;
  font: 500 11px/1.5 var(--font-mono); background: #ffffff14; color: var(--side-text);
}
.sb-cnt.bad { background: #b3261e; color: #ffffff; }
.sb-cnt, .sb-cnt.bad, .sb-cnt.high { display: none !important; }
.sb-cnt.high { background: #c2410c; color: #ffffff; }
.sb-cnt[hidden] { display: none; }

/* Top bar: the former top-right pill, now a full-width bar beside the sidebar. */
.topright-controls {
  position: fixed; top: 0; left: var(--side-w); right: 0; height: var(--topbar-h); z-index: 60;
  display: flex; align-items: center; gap: 10px; padding: 0 20px 0 28px;
  background: var(--panel); border: 0; border-bottom: 1px solid var(--border); border-radius: 0; box-shadow: none;
}
.tb-crumbs { flex: 1 1 auto; min-width: 0; font-size: 12.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tb-crumbs b { color: var(--text); font-weight: 600; }
.tb-crumbs .tb-sep { margin: 0 6px; color: var(--text-faint); }
.tb-search {
  display: flex; align-items: center; gap: 8px; min-width: 280px; height: 34px; padding: 0 8px 0 10px;
  border: 1px solid var(--border); border-radius: 8px; background: var(--panel-2); color: var(--text-faint);
  font: inherit; font-size: 13px; cursor: pointer; text-align: left;
}
.tb-search:hover { border-color: color-mix(in srgb, var(--accent) 40%, var(--border)); color: var(--muted); }
.tb-search svg { width: 15px; height: 15px; flex-shrink: 0; }
.tb-search span { flex: 1 1 auto; }
.kbd { font: 500 11px/1.6 var(--font-mono); border: 1px solid var(--border); border-radius: 5px; padding: 0 5px; color: var(--muted); background: var(--panel); }
.topright-controls .alert-bell,
.topright-controls #themeToggle,
.topright-controls .logout-link {
  width: 34px; height: 34px; border-radius: 8px; border: 1px solid var(--border); background: var(--panel); color: var(--text);
  display: inline-grid; place-items: center; padding: 0; font-size: 14px; box-shadow: none; filter: none;
}
.topright-controls .alert-bell:hover, .topright-controls #themeToggle:hover, .topright-controls .logout-link:hover { border-color: var(--accent); }
.topright-controls .logout-link:hover { color: var(--bad); border-color: color-mix(in srgb, var(--bad) 45%, var(--border)); }
.topright-controls svg { width: 17px; height: 17px; }
.topright-controls .header-user-chip { padding-left: 6px; margin-left: 4px; border-left: 1px solid var(--border); gap: 8px; }
.topright-controls .header-avatar { width: 30px; height: 30px; background: var(--accent); color: var(--accent-ink); font-size: 11px; font-weight: 600; }
.topright-controls .header-user-name { font-size: 12.5px; font-weight: 600; }
.topright-controls .header-user-role { font-size: 10.5px; letter-spacing: .05em; }
#themeToggle .ti-sun { display: none; }
[data-theme="dark"] #themeToggle .ti-sun { display: block; }
[data-theme="dark"] #themeToggle .ti-moon { display: none; }

.layout { align-items: stretch; }
.main-wrap { min-width: 0; }
main { padding: calc(var(--topbar-h) + 20px) 28px 40px; }

/* Page header: sticky just under the top bar; title left, actions right. */
.dash-header {
  position: sticky; top: var(--topbar-h); z-index: 30;
  flex-direction: row; align-items: flex-end; justify-content: space-between; flex-wrap: wrap; gap: 6px 16px;
  margin: -20px -28px 18px; padding: 16px 28px 14px;
  background: var(--bg); border-bottom: 1px solid var(--border); box-shadow: none;
}
.dash-title-block { flex: 1 1 420px; }
.dash-title-block h1 { font-size: 21px; font-weight: 600; margin: 0 0 3px; }
.dash-subtitle { font-size: 13px; margin: 0; color: var(--muted); }
.dash-toolbar { flex: 0 0 auto; justify-content: flex-end; gap: 8px; }
.dash-toolbar .refresh-meta { font-size: 12px; }

/* ---------------------------------------------------------------- cards */
/* KPI tiles keep the original widget theme (gradient top bar, corner glow,
   hover lift, heavy mono figure) from templates/base.html - only the card
   radius/shadow and the type family come from here. */
.card { border-radius: 14px; }
.kpi-value { font-weight: 700; }

/* --------------------------------------------------------------- tables */
table { border-radius: 0; background: transparent; }
th, td { padding: 9px 12px; border-bottom: 1px solid var(--border-soft); font-size: 13px; }
th { font-size: 11px; font-weight: 600; letter-spacing: .06em; color: var(--muted); background: var(--panel-2); border-bottom: 1px solid var(--border); }
td { font-variant-numeric: tabular-nums; }
tbody tr:hover td { background: var(--panel-2); }
tbody tr:hover td:first-child { box-shadow: none; }
tbody tr:last-child td { border-bottom: 0; }
.card > table, .card .eps-table-wrap, .card > .table-wrap { border: 1px solid var(--border-soft); border-radius: 10px; overflow: hidden; }
.card .eps-table-wrap { overflow: auto; }
.eps-table-wrap { border-radius: 10px; }
.eps-table thead th { background: var(--panel-2); box-shadow: 0 1px 0 var(--border); }
.util-bar-track, .bar-track, .capacity-track, .xsiam-gb-track { background: var(--sunken); }
.util-bar-track { height: 6px; border-radius: 99px; }
.util-pct-label { font-weight: 500; font-size: 12.5px; }
table td.num, table th.num, td.num { font-family: var(--font-mono); font-size: 12.5px; }

/* -------------------------------------------------------------- controls */
a.btn, button.btn {
  background: var(--accent); color: var(--accent-ink); border: 1px solid var(--accent);
  padding: 7px 13px; border-radius: 8px; font-weight: 600; font-size: 13px; box-shadow: none; line-height: 1.3;
}
a.btn:hover, button.btn:hover { filter: none; background: var(--accent-strong); border-color: var(--accent-strong); text-decoration: none; }
a.btn.btn-secondary, button.btn.btn-secondary, .export-pdf-btn {
  background: var(--panel); border: 1px solid var(--border); color: var(--text);
}
a.btn.btn-secondary:hover, button.btn.btn-secondary:hover { background: var(--panel-2); border-color: color-mix(in srgb, var(--accent) 40%, var(--border)); }
a.btn.btn-danger, button.btn.btn-danger { background: transparent; }
.panel-input, .filter-toolbar input[type="search"], .filter-toolbar select, select, input[type="text"], input[type="number"], input[type="date"], input[type="email"], input[type="password"], input[type="search"] {
  border-radius: 8px;
}
.panel-input { background: var(--panel); }
.panel-input:focus, .filter-toolbar input:focus, .filter-toolbar select:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.badge { font-weight: 600; font-size: 11.5px; padding: 2px 9px; }
.status-pill { font-size: 11.5px; padding: 2px 9px; }
.banner { border-radius: 10px; }
.feed-health { font-weight: 500; font-size: 12px; }
.attention-item { border-radius: 10px; background: var(--panel-2); border-color: var(--border-soft); }
.donut-hole .donut-total { font-weight: 600; }

/* Alert Centre drawer: sits under nothing - above the top bar. */
.alert-sev-n { font-weight: 600; font-variant-numeric: tabular-nums; }
.alert-pill { font-weight: 600; }

/* ------------------------------------------- packaged dashboards */
/* SOC Executive / Resource Allocation keep their widget theme from their
   embed templates; only tables and the type family are aligned here. */
html body .mss-exec .mss-table tbody tr:hover td,
html body .sra-tab .sra-table tbody tr:hover td { background: var(--panel-2); }
html body .sra-tab, html body .sra-drawer, html body .mss-exec { font-family: var(--sans) !important; }

/* --------------------------------------------------------- Command Centre */
.cc-grid { display: grid; gap: 16px; margin-bottom: 16px; }
.cc-tiles { grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); }
.cc-2 { grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); align-items: start; }
.cc-card { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius-card); box-shadow: var(--shadow); padding: 16px 18px; min-width: 0; }
.cc-card-h { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.cc-card-h h2 { margin: 0; font-size: 14.5px; }
.cc-card-h .cc-sub { font-size: 12px; color: var(--muted); }
.cc-card-h a { font-size: 12.5px; font-weight: 600; white-space: nowrap; text-decoration: none; }
.cc-tile { display: flex; flex-direction: column; gap: 8px; padding: 14px 16px; color: var(--text); text-decoration: none; transition: border-color .15s ease; }
a.cc-tile:hover { text-decoration: none; border-color: color-mix(in srgb, var(--accent) 45%, var(--border)); }
.cc-tile-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.cc-tile-top { flex-wrap: wrap; row-gap: 6px; }
.cc-tile-name { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; min-width: 0; white-space: nowrap; }
.cc-ic { width: 26px; height: 26px; border-radius: 7px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); flex-shrink: 0; }
.cc-ic svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.cc-big { font: 600 26px/1.1 var(--sans); font-variant-numeric: tabular-nums; letter-spacing: -.015em; }
.cc-big small { font: 500 13px var(--sans); color: var(--muted); margin-left: 4px; letter-spacing: 0; }
.cc-cap { font-size: 12px; color: var(--muted); }
.cc-meter { height: 7px; border-radius: 99px; background: var(--sunken); position: relative; overflow: visible; }
.cc-meter i { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 99px; }
.cc-meter .cc-tick { position: absolute; top: -3px; bottom: -3px; width: 2px; border-radius: 2px; background: var(--text); opacity: .3; }
.cc-spark { display: block; width: 100%; height: 30px; overflow: visible; }
.pill { display: inline-flex; align-items: center; gap: 5px; font-size: 11px; font-weight: 600; border-radius: 99px; padding: 2px 8px; white-space: nowrap; }
.pill i { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.p-ok { color: var(--ok); background: var(--good-bg); } .p-warn { color: var(--warn); background: var(--amber-bg); }
.p-bad { color: var(--bad); background: var(--bad-bg); } .p-high { color: var(--high); background: var(--high-bg); }
.p-info { color: var(--info); background: var(--info-bg); }
.t-ok { background: var(--ok); } .t-warn { background: var(--warn); } .t-bad { background: var(--bad); }
.t-high { background: var(--high); } .t-info { background: var(--info); } .t-accent { background: var(--accent); }
.t-critical { background: var(--bad); } .t-medium { background: var(--warn); } .t-low { background: var(--info); }

.cc-att { display: flex; flex-direction: column; }
.cc-att-row { display: grid; grid-template-columns: 4px minmax(0, 1fr) auto; gap: 0 12px; align-items: center; padding: 10px 0; border-top: 1px solid var(--border-soft); }
.cc-att-row:first-child { border-top: 0; padding-top: 2px; }
.cc-att-row .cc-bar { align-self: stretch; border-radius: 3px; }
.cc-att-row b { display: block; font-size: 13.5px; font-weight: 600; }
.cc-att-row span { font-size: 12.5px; color: var(--muted); }
.cc-att-row a { font-size: 12px; font-weight: 600; white-space: nowrap; text-decoration: none; }

.cc-posture { display: grid; grid-template-columns: 120px minmax(0, 1fr); gap: 18px; align-items: center; }
.cc-ring { width: 120px; height: 120px; border-radius: 50%; display: grid; place-items: center; background: conic-gradient(var(--ring, var(--ok)) calc(var(--v) * 1%), var(--sunken) 0); }
.cc-ring > div { width: 92px; height: 92px; border-radius: 50%; background: var(--panel); display: grid; place-items: center; text-align: center; }
.cc-ring b { display: block; font: 600 28px/1 var(--sans); font-variant-numeric: tabular-nums; }
.cc-ring span { font-size: 11px; color: var(--muted); }
.cc-kv { display: grid; grid-template-columns: 1fr auto; gap: 8px 14px; margin: 0; font-size: 13px; }
.cc-kv dt { color: var(--muted); } .cc-kv dd { margin: 0; text-align: right; font-family: var(--font-mono); }
.cc-up { color: var(--warn); } .cc-down { color: var(--ok); }

.cc-tl { position: relative; height: 34px; margin: 4px 6px 6px; }
.cc-tl-axis { position: absolute; left: 0; right: 0; top: 10px; height: 2px; background: var(--border); border-radius: 2px; }
.cc-tl-m { position: absolute; top: 18px; transform: translateX(-50%); font-size: 11px; color: var(--text-faint); }
.cc-tl-m::before { content: ""; position: absolute; left: 50%; top: -11px; width: 1px; height: 6px; background: var(--border); }
.cc-tl-pin { position: absolute; top: 4px; width: 14px; height: 14px; margin-left: -7px; border-radius: 50%; border: 3px solid var(--panel); box-shadow: 0 0 0 1px var(--border); }
.cc-ren { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 0; }
.cc-ren li { display: grid; grid-template-columns: 62px minmax(0, 1fr) auto; gap: 10px; align-items: baseline; padding: 7px 0; border-top: 1px solid var(--border-soft); font-size: 13px; }
.cc-ren li:first-child { border-top: 0; }
.cc-ren .cc-date { font-family: var(--font-mono); font-size: 12px; color: var(--muted); }
.cc-ren .cc-where { font-size: 11.5px; color: var(--muted); }
.cc-ren .cc-days { font-family: var(--font-mono); font-size: 12px; }
.cc-more { font-size: 12px; color: var(--muted); margin-top: 8px; }
.cc-more a { font-weight: 600; text-decoration: none; }

.cc-feeds { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 10px; }
.cc-feed { border: 1px solid var(--border-soft); border-radius: 10px; padding: 10px 12px; background: var(--panel-2); min-width: 0; }
.cc-feed b { display: flex; align-items: center; gap: 7px; font-size: 12.5px; font-weight: 600; }
.cc-feed span { font-size: 12px; color: var(--muted); overflow-wrap: anywhere; }
.cc-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; display: inline-block; }
.cc-empty { border: 1px dashed var(--border); border-radius: 10px; padding: 18px; text-align: center; color: var(--muted); font-size: 13px; }
.cc-empty b { display: block; color: var(--text); margin-bottom: 3px; }
.cc-fresh { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); }

/* ------------------------------------------------------- command palette */
.cmdk { position: fixed; inset: 0; z-index: 9500; display: none; align-items: flex-start; justify-content: center; padding: 12vh 16px 16px; background: rgba(10,18,22,.42); }
.cmdk.open { display: flex; }
.cmdk-box { width: min(620px, 100%); background: var(--panel); color: var(--text); border: 1px solid var(--border); border-radius: 12px; box-shadow: 0 24px 60px -20px rgba(0,0,0,.45); overflow: hidden; }
.cmdk-in { display: flex; align-items: center; gap: 10px; padding: 0 14px; border-bottom: 1px solid var(--border); }
.cmdk-in svg { width: 17px; height: 17px; color: var(--muted); flex-shrink: 0; }
.cmdk-in input { flex: 1; height: 50px; border: 0; outline: none; background: transparent; color: var(--text); font: inherit; font-size: 15px; }
.cmdk-list { max-height: 52vh; overflow-y: auto; padding: 6px; }
.cmdk-group { font-size: 10.5px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); padding: 10px 10px 4px; }
.cmdk-item { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 8px; color: var(--text); text-decoration: none; font-size: 13.5px; }
.cmdk-item small { margin-left: auto; color: var(--muted); font-size: 12px; }
.cmdk-item[aria-selected="true"] { background: var(--accent-soft); color: var(--accent); text-decoration: none; }
.cmdk-item:hover { text-decoration: none; }
.cmdk-none { padding: 22px; text-align: center; color: var(--muted); font-size: 13px; }
.cmdk-foot { display: flex; gap: 14px; padding: 8px 14px; border-top: 1px solid var(--border); font-size: 11.5px; color: var(--muted); }

/* ------------------------------------------------------------ responsive */
@media (max-width: 1100px) {
  .cc-2 { grid-template-columns: 1fr; }
  .tb-search { min-width: 0; }
  .tb-search span, .tb-search .kbd { display: none; }
}
@media (max-width: 860px) {
  .sidebar { width: 100%; flex-basis: auto; height: auto; min-height: 0; position: static; overflow: visible; }
  .sidebar-brand { height: auto; padding: 10px 14px; }
  .sidebar-nav { display: flex; overflow-x: auto; padding: 6px 8px; gap: 2px; }
  .sidebar-link { white-space: nowrap; }
  .sidebar-link.active { box-shadow: inset 0 -3px 0 var(--side-mark); }
  .topright-controls { position: static; left: auto; height: 52px; padding: 0 12px; gap: 8px; }
  .topright-controls .header-user-meta { display: none; }
  .tb-crumbs { display: none; }
  .tb-search { margin-right: auto; }
  main { padding: 18px 16px 32px; }
  .dash-header { position: static; margin: -18px -16px 16px; padding: 14px 16px 12px; }
  .cc-posture { grid-template-columns: 1fr; justify-items: start; }
}
@media (prefers-reduced-motion: reduce) { .kpi-card, .cc-tile { transition: none; } }
@media print {
  .topright-controls, .cmdk, .sb-cnt { display: none !important; }
  main { padding: 0 !important; }
  .dash-header { position: static !important; margin: 0 0 12px !important; padding: 0 0 8px !important; }
  .card, .cc-card, .kpi-card { box-shadow: none !important; }
}
#themeToggle svg { width: 16px; height: 16px; display: block; }
header #themeToggle { width: 34px; height: 34px; padding: 0; display: inline-grid; place-items: center; }

/* Visited links (2026-10-15 fix): base.html's a:visited { color: accent }
   out-ranks a plain class selector, so already-opened sidebar items turned
   teal. Pin every navigation-style link's colour for :visited too. */
.sidebar-link, .sidebar-link:visited { color: var(--side-text); }
.sidebar-link:hover, .sidebar-link:visited:hover,
.sidebar-link.active, .sidebar-link.active:visited { color: #ffffff; }
a.cc-tile, a.cc-tile:visited { color: var(--text); }
a.cmdk-item, a.cmdk-item:visited { color: var(--text); }
a.cmdk-item[aria-selected="true"] { color: var(--accent); }
a.btn:visited { color: var(--accent-ink); }
a.btn.btn-secondary:visited { color: var(--text); }


/* ===================================================================
   Decorative layer (2026-10-15, second pass): depth and colour on the
   shell and the Command Centre, in the same language as the KPI widgets.
   =================================================================== */
/* Sidebar: a deep teal glow at the top fading into the navy rail, a soft
   accent rule down its right edge, and a lit "pill" for the open page. */
.sidebar {
  background:
    radial-gradient(420px 260px at 0% 0%, rgba(43,182,115,.16), transparent 70%),
    radial-gradient(360px 300px at 100% 35%, rgba(26,163,201,.10), transparent 70%),
    linear-gradient(180deg, var(--side-2), var(--side) 42%);
  box-shadow: inset -1px 0 0 rgba(255,255,255,.05);
}
.sidebar-brand { background: linear-gradient(90deg, rgba(43,182,115,.10), transparent 80%); }
.sidebar-brand .header-brand-mark { box-shadow: 0 0 0 2px rgba(43,182,115,.35), 0 6px 16px -6px rgba(43,182,115,.6); }
.sidebar-label { display: flex; align-items: center; gap: 8px; }
.sidebar-label::after { content: ""; flex: 1; height: 1px; background: linear-gradient(90deg, rgba(255,255,255,.12), transparent); }
.sidebar-link .sidebar-icon { width: 26px; height: 26px; border-radius: 7px; transition: background-color .15s ease; }
.sidebar-link:hover .sidebar-icon { background: rgba(255,255,255,.06); }
.sidebar-link.active, .sidebar-link.active:visited {
  background: linear-gradient(90deg, rgba(43,182,115,.22), rgba(26,163,201,.10) 70%, transparent);
  box-shadow: inset 3px 0 0 var(--side-mark), 0 8px 20px -14px rgba(43,182,115,.7);
}
.sidebar-link.active .sidebar-icon { background: linear-gradient(135deg, #2bb673, #1aa3c9); color: #fff; box-shadow: 0 4px 12px -4px rgba(43,182,115,.7); }
.sidebar-sublink .sidebar-icon, .sidebar-sublink.active .sidebar-icon { width: 18px; height: 18px; background: none; box-shadow: none; }

/* Top bar and page header: frosted glass over the page's ambient wash, with
   a thin brand gradient line under the top bar. */
.topright-controls {
  background: color-mix(in srgb, var(--panel) 84%, transparent);
  -webkit-backdrop-filter: saturate(1.4) blur(12px); backdrop-filter: saturate(1.4) blur(12px);
}
.topright-controls::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 2px;
  background: linear-gradient(90deg, #2bb673, #1aa3c9 45%, transparent 85%); opacity: .55;
}
.topright-controls .header-avatar { background: linear-gradient(135deg, #2bb673, #1aa3c9); color: #fff; }
.tb-search { background: color-mix(in srgb, var(--panel-2) 80%, transparent); }
.dash-header {
  background: color-mix(in srgb, var(--bg) 78%, transparent);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
}
.dash-title-block h1 { display: flex; align-items: center; gap: 10px; }
.dash-title-block h1::before {
  content: ""; width: 6px; height: 22px; border-radius: 3px; flex-shrink: 0;
  background: linear-gradient(180deg, #2bb673, #1aa3c9);
}
.export-pdf-btn:hover { box-shadow: 0 6px 16px -10px color-mix(in srgb, var(--accent) 70%, transparent); }

/* Cards: a hairline of light along the top edge for depth. */
.card, .cc-card { background-image: linear-gradient(180deg, color-mix(in srgb, var(--accent) 3%, transparent), transparent 90px); }

/* Command Centre tiles: same widget theme as the KPI cards - tone-coloured
   gradient bar along the top, a soft glow in the corner, lift on hover. */
.cc-tile { --kpi-color: var(--accent); position: relative; overflow: hidden; isolation: isolate; border-radius: 14px;
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease; }
.cc-tile.tone-ok { --kpi-color: var(--ok); } .cc-tile.tone-warn { --kpi-color: var(--warn); }
.cc-tile.tone-bad { --kpi-color: var(--bad); } .cc-tile.tone-info { --kpi-color: var(--info); }
.cc-tile::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 3px;
  background: linear-gradient(90deg, var(--kpi-color), color-mix(in srgb, var(--kpi-color) 45%, transparent)); }
.cc-tile::after { content: ""; position: absolute; top: -40px; right: -40px; width: 130px; height: 130px; z-index: -1; pointer-events: none;
  background: radial-gradient(circle, color-mix(in srgb, var(--kpi-color) 22%, transparent) 0%, transparent 72%); }
a.cc-tile:hover { transform: translateY(-2px); border-color: color-mix(in srgb, var(--kpi-color) 40%, var(--border));
  box-shadow: 0 12px 26px -14px color-mix(in srgb, var(--kpi-color) 45%, transparent), 0 1px 2px rgba(0,0,0,.06); }
.cc-tile .cc-ic { background: color-mix(in srgb, var(--kpi-color) 16%, transparent); color: var(--kpi-color); }
.cc-big { font-family: var(--font-mono); font-weight: 700; letter-spacing: -.01em; }
.cc-meter i { background-image: linear-gradient(90deg, rgba(255,255,255,.0), rgba(255,255,255,.25)); }
.cc-card-h h2 { margin: 0; }
.cc-ring { background: conic-gradient(var(--ring, var(--ok)) 0, color-mix(in srgb, var(--ring, var(--ok)) 55%, #1aa3c9) calc(var(--v) * 1%), var(--sunken) 0);
  box-shadow: 0 10px 30px -16px color-mix(in srgb, var(--ring, var(--ok)) 70%, transparent); }
.cc-att-row { border-radius: 8px; padding-left: 4px; padding-right: 6px; transition: background-color .12s ease; }
.cc-att-row:hover { background: var(--panel-2); }
.cc-side { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.cc-tl-axis { background: linear-gradient(90deg, var(--high), var(--accent) 30%, var(--border)); opacity: .6; }
@media (prefers-reduced-motion: reduce) { a.cc-tile:hover { transform: none; } }
@media print {
  .topright-controls::after, .dash-title-block h1::before { display: none !important; }
  .dash-header { -webkit-backdrop-filter: none; backdrop-filter: none; }
}
@media (max-width: 860px) { .topright-controls::after { display: none; } }

/* SOC posture inside the SOC Executive tile (2026-10-15). */
.cc-tile-kv { gap: 4px 10px; font-size: 12px; padding-top: 6px; border-top: 1px solid var(--border-soft); }
.cc-tile-kv dd { font-size: 12px; }

/* SOC Executive tile with the posture ring (2026-10-15): same width and
   height as every other tile - small ring on the left, compact figures on
   the right. Tiles share the row equally (auto-fit, no empty columns). */
.cc-tiles { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.cc-soc-body { display: grid; grid-template-columns: 74px minmax(0, 1fr); gap: 12px; align-items: center; }
.cc-ring-sm { width: 74px; height: 74px; box-shadow: none; }
.cc-ring-sm > div { width: 58px; height: 58px; }
.cc-ring-sm b { font-size: 19px; }
.cc-ring-sm span { font-size: 9.5px; }
.cc-tile-soc .cc-tile-kv { border-top: 0; padding-top: 0; gap: 2px 8px; font-size: 11.5px; line-height: 1.35; }
.cc-tile-soc .cc-tile-kv dd { font-size: 11.5px; white-space: nowrap; }

/* SOC Executive / Resource Allocation KPI tiles: the same widget theme as
   the QRadar cards (2026-10-15) - full top accent bar, the soft corner glow
   at the same size and place, the same padding and figure weight. */
html body .mss-exec .mss-kpi,
html body .sra-tab .sra-kpi {
  background:
    linear-gradient(90deg, var(--kpi-color), color-mix(in srgb, var(--kpi-color) 45%, transparent)) top / 100% 3px no-repeat,
    radial-gradient(circle 60px at calc(100% - 20px) 20px, color-mix(in srgb, var(--kpi-color) 22%, transparent) 0%, transparent 72%) no-repeat,
    var(--panel);
  border-radius: 14px; padding: 18px 20px; border: 1px solid var(--border);
}
html body .mss-exec .mss-kpi-value,
html body .sra-tab .sra-kpi-value { font-family: var(--font-mono); font-size: 28px; font-weight: 700; letter-spacing: -.01em; margin-top: 10px; }
html body .mss-exec .mss-kpi.mss-kpi-sm .mss-kpi-value { font-size: 20px; }
html body .mss-exec .mss-kpi-label,
html body .sra-tab .sra-kpi-label { font-size: 11px; font-weight: 700; letter-spacing: .06em; }

/* Resource Allocation POD cards (2026-10-15): all the same size, sharing the
   row equally, in the same widget theme as the KPI tiles above them. */
html body .sra-tab .sra-pods { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); align-items: stretch; gap: 16px; }
html body .sra-tab .sra-pod {
  --kpi-color: var(--accent);
  background:
    linear-gradient(90deg, var(--kpi-color), color-mix(in srgb, var(--kpi-color) 45%, transparent)) top / 100% 3px no-repeat,
    radial-gradient(circle 60px at calc(100% - 20px) 20px, color-mix(in srgb, var(--kpi-color) 22%, transparent) 0%, transparent 72%) no-repeat,
    var(--panel);
  border: 1px solid var(--border); border-radius: 14px; padding: 18px 20px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, .06);
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
html body .sra-tab .sra-pod.sra-drillable:hover,
html body .sra-tab .sra-pod.sra-drillable:focus-visible {
  transform: translateY(-2px);
  border-color: color-mix(in srgb, var(--kpi-color) 40%, var(--border));
  box-shadow: 0 10px 24px -12px color-mix(in srgb, var(--kpi-color) 35%, transparent), 0 1px 2px rgba(0, 0, 0, .06);
}
html body .sra-tab .sra-pod-name { font-size: 14px; font-weight: 700; }
html body .sra-tab .sra-pod-label { font-size: 11px; font-weight: 700; letter-spacing: .06em; color: var(--muted); }
html body .sra-tab .sra-pod-value { font-family: var(--font-mono); font-size: 22px; font-weight: 700; margin-top: 4px; }
@media (prefers-reduced-motion: reduce) { html body .sra-tab .sra-pod { transition: none; } html body .sra-tab .sra-pod.sra-drillable:hover { transform: none; } }


/* Data Admin (2026-10-15): grouped section cards, list toolbar, action bar. */
.panel-group { margin-bottom: 26px; }
.panel-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; }
.panel-card {
  --kpi-color: var(--accent); position: relative; display: flex; flex-direction: column; gap: 6px;
  padding: 16px 18px; border-radius: 14px; border: 1px solid var(--border); color: var(--text); text-decoration: none;
  background:
    linear-gradient(90deg, var(--kpi-color), color-mix(in srgb, var(--kpi-color) 45%, transparent)) top / 100% 3px no-repeat,
    radial-gradient(circle 60px at calc(100% - 20px) 20px, color-mix(in srgb, var(--kpi-color) 18%, transparent) 0%, transparent 72%) no-repeat,
    var(--panel);
  transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease;
}
a.panel-card:visited { color: var(--text); }
a.panel-card:hover { text-decoration: none; transform: translateY(-2px); border-color: color-mix(in srgb, var(--accent) 40%, var(--border));
  box-shadow: 0 10px 24px -14px color-mix(in srgb, var(--accent) 45%, transparent); }
.panel-card-top { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.panel-card-title { font-weight: 650; font-size: 14px; }
.panel-card-count { font-family: var(--font-mono); font-weight: 700; font-size: 18px; color: var(--muted); }
.panel-card-desc { font-size: 12.5px; color: var(--muted); flex: 1; }
.panel-card-go { font-size: 12.5px; font-weight: 600; color: var(--accent); }
.panel-toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; margin: 4px 0 12px; }
.panel-toolbar input[type="search"] { flex: 1 1 260px; max-width: 420px; }
.panel-filter { display: flex; flex-direction: column; gap: 3px; font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.panel-filter select { min-width: 150px; max-width: 240px; text-transform: none; letter-spacing: 0; }
.panel-actionbar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 10px; }
.panel-actionbar select { max-width: 380px; }
.panel-pager { display: flex; align-items: center; gap: 12px; margin-top: 12px; }
.panel-readonly { display: grid; grid-template-columns: minmax(140px, max-content) 1fr; gap: 6px 18px; margin: 0; font-size: 13px; }
.panel-readonly dt { color: var(--muted); } .panel-readonly dd { margin: 0; overflow-wrap: anywhere; }
.panel-input[type="checkbox"] { width: auto; }
select[multiple].panel-input { min-height: 160px; max-width: 520px; }
@media (prefers-reduced-motion: reduce) { .panel-card { transition: none; } a.panel-card:hover { transform: none; } }

/* Row buttons stack in a narrow column so they never run off the table. */
.panel-actions-cell { width: 1%; }
.panel-actions-cell .row-actions { display: inline-flex; flex-direction: column; flex-wrap: nowrap; align-items: stretch; gap: 6px; width: auto; margin-left: 0; }
.panel-actions-cell .row-actions .btn { padding: 5px 10px; font-size: 12px; white-space: nowrap; text-align: center; justify-content: center; }
