/* Silent Sentinel dashboard - operator console design system. */

@font-face { font-family: "Geist"; src: url("/assets/fonts/geist.woff2") format("woff2"); font-weight: 100 900; font-display: swap; }
@font-face { font-family: "Geist Mono"; src: url("/assets/fonts/geist-mono.woff2") format("woff2"); font-weight: 100 900; font-display: swap; }

:root {
  --bg-deep: #0B0E13;
  --bg: #10141B;
  --surface: #161C26;
  --surface-2: #1A212B;
  --surface-3: #1E2530;
  --line: #232B37;
  --line-2: #2D3543;
  --line-3: #3A4453;
  --text-strong: #F5F2EC;
  --text: #ECEFF4;
  --text-2: #A8AFBA;
  --muted: #6B7480;
  --faint: #5A616B;
  --accent: #22D4FF;
  --accent-soft: rgba(34, 212, 255, .12);
  --accent-glow: 0 0 24px rgba(34, 212, 255, .28);
  --crit: #FF4D5A;
  --high: #FF8A3D;
  --med: #F5B027;
  --low: #8FB4D9;
  --info: #6B7480;
  --ok: #4ADE80;
  --mono: "Geist Mono", ui-monospace, "JetBrains Mono", Menlo, monospace;
  --sans: "Geist", system-ui, -apple-system, sans-serif;
  --r-sm: 3px;
  --r: 6px;
  --r-lg: 10px;
  --sidebar: 236px;
  --header: 56px;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--bg);
  color: var(--text);
  font: 14px/1.5 var(--sans);
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
button, input, select, textarea { font: inherit; color: inherit; }
::selection { background: rgba(34, 212, 255, .3); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ---------- type helpers ---------- */
.mono { font-family: var(--mono); }
.label {
  font-family: var(--mono); font-size: 10.5px; font-weight: 500;
  letter-spacing: .1em; text-transform: uppercase; color: var(--muted);
}
.muted { color: var(--muted); }
.dim { color: var(--text-2); }
.strong { color: var(--text-strong); font-weight: 600; }
.num { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.trunc { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sep::before { content: "·"; margin: 0 .5em; color: var(--faint); }

/* ---------- app shell ---------- */
.shell { display: grid; grid-template-columns: var(--sidebar) 1fr; min-height: 100vh; }
.sidebar {
  position: sticky; top: 0; height: 100vh; overflow-y: auto;
  background: var(--bg-deep); border-right: 1px solid var(--line);
  display: flex; flex-direction: column; padding: 18px 14px;
}
.brand { display: flex; align-items: center; gap: 10px; padding: 2px 8px 18px; }
.brand img { width: 26px; height: 26px; }
.brand-name { font-family: var(--mono); font-size: 12px; letter-spacing: .14em; text-transform: uppercase; color: var(--text-strong); font-weight: 600; }
.brand-sub { font-family: var(--mono); font-size: 10px; letter-spacing: .1em; color: var(--muted); text-transform: uppercase; }
.tenant {
  margin: 0 4px 18px; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--r);
  background: var(--surface);
}
.tenant .who { font-size: 13px; color: var(--text-strong); }
.nav-group { margin: 6px 0 14px; }
.nav-group .label { padding: 0 10px 6px; display: block; }
.nav a {
  display: flex; align-items: center; gap: 10px; padding: 7px 10px; margin: 1px 0;
  border-radius: var(--r); color: var(--text-2); font-size: 13.5px; text-decoration: none;
  border: 1px solid transparent; transition: background .15s, color .15s, border-color .15s;
}
.nav a:hover { background: var(--surface); color: var(--text); }
.nav a.active { background: var(--surface-2); color: var(--text-strong); border-color: var(--line-2); }
.nav a.active .ico { color: var(--accent); }
.nav .ico { width: 16px; height: 16px; color: var(--muted); flex: none; }
.nav .count {
  margin-left: auto; font-family: var(--mono); font-size: 10.5px; padding: 1px 6px; border-radius: 10px;
  background: var(--accent-soft); color: var(--accent);
}
.nav .count.hot { background: rgba(255, 77, 90, .14); color: var(--crit); }
.sidebar-foot { margin-top: auto; padding: 12px 10px 2px; border-top: 1px solid var(--line); }
.status-line { display: flex; align-items: center; gap: 8px; font-family: var(--mono); font-size: 11px; color: var(--text-2); }

.main { min-width: 0; display: flex; flex-direction: column; }
.header {
  position: sticky; top: 0; z-index: 20; height: var(--header);
  display: flex; align-items: center; gap: 16px; padding: 0 24px;
  background: rgba(16, 20, 27, .86); backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.header h1 { margin: 0; font-size: 16px; font-weight: 600; color: var(--text-strong); letter-spacing: -.01em; }
.header .crumb { font-family: var(--mono); font-size: 10.5px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.header .spacer { flex: 1; }
.clock { font-family: var(--mono); font-size: 11.5px; color: var(--text-2); letter-spacing: .04em; }
.clock b { color: var(--text-strong); font-weight: 500; }
.content { padding: 22px 24px 48px; display: grid; gap: 16px; align-content: start; }

/* ---------- primitives ---------- */
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); min-width: 0; }
.panel-h { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-bottom: 1px solid var(--line); min-height: 46px; }
.panel-h .label { color: var(--text-2); }
.panel-h .spacer { flex: 1; }
.panel-b { padding: 16px; }
.panel-b.flush { padding: 0; overflow-x: auto; }
.list-item .sev { min-width: 76px; }
.grid { display: grid; gap: 16px; }
.g-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.g-main { grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); }
.row { display: flex; align-items: center; gap: 10px; }
.wrap { flex-wrap: wrap; }
.stack { display: grid; gap: 10px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 32px; padding: 0 13px; border-radius: var(--r);
  border: 1px solid var(--line-2); background: var(--surface-2); color: var(--text);
  font-size: 13px; font-weight: 500; cursor: pointer; white-space: nowrap;
  transition: transform .15s, border-color .15s, background .15s, box-shadow .2s;
}
.btn:hover { border-color: var(--line-3); background: var(--surface-3); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn.primary { background: var(--text-strong); color: var(--bg); border-color: var(--text-strong); font-weight: 600; }
.btn.primary:hover { box-shadow: var(--accent-glow); }
.btn.accent { background: var(--accent); color: #062029; border-color: var(--accent); font-weight: 600; }
.btn.accent:hover { box-shadow: var(--accent-glow); }
.btn.danger { color: var(--crit); border-color: rgba(255, 77, 90, .35); background: rgba(255, 77, 90, .06); }
.btn.danger:hover { background: rgba(255, 77, 90, .12); }
.btn.ghost { background: transparent; border-color: transparent; color: var(--text-2); }
.btn.ghost:hover { background: var(--surface-2); color: var(--text); }
.btn.sm { height: 26px; padding: 0 9px; font-size: 12px; }
.btn .ico { width: 14px; height: 14px; }

.input, .select, .textarea {
  height: 32px; padding: 0 10px; border-radius: var(--r); border: 1px solid var(--line-2);
  background: var(--bg-deep); color: var(--text); font-size: 13px; transition: border-color .15s;
}
.textarea { height: auto; min-height: 76px; padding: 8px 10px; resize: vertical; line-height: 1.45; }
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.input.mono, .textarea.mono { font-family: var(--mono); font-size: 12.5px; }
.select { padding-right: 26px; appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 13px) 14px, calc(100% - 9px) 14px; background-size: 4px 4px; background-repeat: no-repeat; }
.field { display: grid; gap: 6px; }
.check { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text-2); cursor: pointer; }
.check input { accent-color: var(--accent); width: 14px; height: 14px; margin: 0; }

/* severity + status badges */
.sev {
  display: inline-flex; align-items: center; justify-content: center; min-width: 62px;
  font-family: var(--mono); font-size: 10px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase;
  padding: 3px 7px; border-radius: var(--r-sm); color: var(--bg);
}
.sev.critical { background: var(--crit); }
.sev.high { background: var(--high); }
.sev.medium { background: var(--med); }
.sev.low { background: var(--low); }
.sev.info { background: var(--line-3); color: var(--text-2); }
.tag {
  display: inline-flex; align-items: center; gap: 5px; font-family: var(--mono); font-size: 10.5px; letter-spacing: .06em;
  padding: 2px 7px; border-radius: var(--r-sm); border: 1px solid var(--line-2); color: var(--text-2); background: var(--surface-2);
  white-space: nowrap;
}
.tag.kev { color: var(--crit); border-color: rgba(255, 77, 90, .4); background: rgba(255, 77, 90, .08); }
.tag.accent { color: var(--accent); border-color: rgba(34, 212, 255, .35); background: var(--accent-soft); }
.tag.ok { color: var(--ok); border-color: rgba(74, 222, 128, .35); background: rgba(74, 222, 128, .07); }
.tag.warn { color: var(--med); border-color: rgba(245, 176, 39, .35); background: rgba(245, 176, 39, .07); }
a.tag:hover { text-decoration: none; border-color: var(--accent); color: var(--accent); }
.tag .ico { width: 11px; height: 11px; flex: none; }
.dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; flex: none; background: var(--muted); }
.dot.ok { background: var(--ok); box-shadow: 0 0 8px rgba(74, 222, 128, .6); }
.dot.warn { background: var(--med); }
.dot.bad { background: var(--crit); }
.dot.live { background: var(--accent); box-shadow: 0 0 0 0 rgba(34, 212, 255, .6); animation: pulse 1.8s infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(34, 212, 255, .55); } 70% { box-shadow: 0 0 0 7px rgba(34, 212, 255, 0); } 100% { box-shadow: 0 0 0 0 rgba(34, 212, 255, 0); } }
.status { font-family: var(--mono); font-size: 11px; letter-spacing: .06em; color: var(--text-2); display: inline-flex; align-items: center; gap: 6px; text-transform: lowercase; }

/* chips (filters) */
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  display: inline-flex; align-items: center; gap: 7px; height: 28px; padding: 0 10px; border-radius: 14px;
  border: 1px solid var(--line-2); background: transparent; color: var(--text-2); cursor: pointer;
  font-family: var(--mono); font-size: 11.5px; letter-spacing: .04em; transition: all .15s;
}
.chip:hover { border-color: var(--line-3); color: var(--text); }
.chip.on { background: var(--surface-3); border-color: var(--accent); color: var(--text-strong); }
.chip .n { color: var(--muted); }
.chip .sw { width: 8px; height: 8px; border-radius: 2px; }

/* tables */
.table { width: 100%; border-collapse: collapse; font-size: 13px; }
.table th {
  text-align: left; font-family: var(--mono); font-size: 10px; font-weight: 500; letter-spacing: .1em; text-transform: uppercase;
  color: var(--muted); padding: 9px 14px; border-bottom: 1px solid var(--line); background: var(--surface);
}
.table td { padding: 10px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr { transition: background .12s; }
.table tbody tr.click { cursor: pointer; }
.table tbody tr.click:hover { background: var(--surface-2); }
.table tbody tr.sel { background: var(--surface-3); box-shadow: inset 2px 0 0 var(--accent); }
.table .sub { font-family: var(--mono); font-size: 11.5px; color: var(--muted); margin-top: 2px; }
.table .t-title { color: var(--text-strong); }
.table td.r, .table th.r { text-align: right; }

/* KPI / annunciator tiles */
.tile {
  position: relative; padding: 14px 16px 15px; background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-lg); overflow: hidden; min-width: 0; display: grid; gap: 4px;
}
.tile::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--line-3); }
.tile.crit::before { background: var(--crit); }
.tile.warn::before { background: var(--med); }
.tile.info::before { background: var(--accent); }
.tile.ok::before { background: var(--ok); }
.tile .big { font-family: var(--mono); font-size: 34px; line-height: 1.05; color: var(--text-strong); font-weight: 500; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.tile .note { font-size: 12.5px; color: var(--text-2); }
.tile a.cover { position: absolute; inset: 0; }
.tile:hover { border-color: var(--line-2); }

/* risk gauge */
.risk { display: grid; grid-template-columns: auto 1fr; gap: 22px; align-items: center; }
.risk-score { font-family: var(--mono); font-size: 64px; line-height: 1; font-weight: 500; letter-spacing: -.04em; color: var(--text-strong); font-variant-numeric: tabular-nums; }
.risk-score small { font-size: 18px; color: var(--muted); letter-spacing: 0; }
.risk-band { font-family: var(--mono); font-size: 11px; letter-spacing: .12em; text-transform: uppercase; margin-top: 8px; }
.meter { position: relative; height: 8px; border-radius: 4px; background: linear-gradient(90deg, var(--ok) 0%, var(--med) 50%, var(--crit) 100%); opacity: .9; }
.meter .needle { position: absolute; top: -5px; width: 3px; height: 18px; border-radius: 2px; background: var(--text-strong); box-shadow: 0 0 10px rgba(245, 242, 236, .6); transform: translateX(-50%); transition: left .6s ease; }
.meter-scale { display: flex; justify-content: space-between; margin-top: 6px; }
.contrib { display: grid; gap: 6px; margin-top: 14px; }
.contrib-row { display: grid; grid-template-columns: 1fr auto; gap: 10px; font-size: 12.5px; color: var(--text-2); }
.contrib-row .num { color: var(--text-strong); }

/* stacked severity bar */
.stackbar { display: flex; height: 12px; border-radius: 4px; overflow: hidden; background: var(--surface-3); gap: 2px; }
.stackbar span { display: block; min-width: 3px; transition: flex-grow .5s; }
.legend { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; margin-top: 14px; }
.legend .k { display: flex; align-items: center; gap: 6px; }
.legend .v { font-family: var(--mono); font-size: 20px; color: var(--text-strong); font-variant-numeric: tabular-nums; }
.hbar { display: grid; grid-template-columns: 150px 1fr 56px; align-items: center; gap: 10px; font-size: 12.5px; padding: 5px 0; }
.hbar .track { display: block; height: 6px; background: var(--surface-3); border-radius: 3px; overflow: hidden; }
.hbar .fill { display: block; height: 100%; background: var(--accent); border-radius: 3px; }
.hbar:hover .fill { box-shadow: var(--accent-glow); }

/* lists */
.list { display: grid; }
.list-item { display: grid; grid-template-columns: auto 1fr auto; gap: 12px; align-items: center; padding: 11px 16px; border-bottom: 1px solid var(--line); }
.list-item:last-child { border-bottom: 0; }
.list-item.click { cursor: pointer; transition: background .12s; }
.list-item.click:hover { background: var(--surface-2); }
.prompt { font-family: var(--mono); color: var(--accent); font-size: 12px; }

/* decision cards */
.decision { border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface); padding: 14px 16px; display: grid; gap: 10px; }
.decision-h { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.decision-t { color: var(--text-strong); font-weight: 600; font-size: 14px; }
.decision-actions { display: flex; gap: 8px; justify-content: flex-end; }

/* code / pre */
.pre {
  margin: 0; padding: 12px 14px; background: var(--bg-deep); border: 1px solid var(--line); border-radius: var(--r);
  font-family: var(--mono); font-size: 12px; line-height: 1.55; color: var(--text-2); overflow: auto; max-height: 360px; white-space: pre;
}
.pre.wrap { white-space: pre-wrap; word-break: break-word; }
.cmd {
  display: flex; align-items: center; gap: 10px; padding: 10px 12px; background: var(--bg-deep);
  border: 1px solid var(--line-2); border-radius: var(--r); font-family: var(--mono); font-size: 12.5px; color: var(--text);
}
.cmd code { flex: 1; overflow-x: auto; white-space: nowrap; }
.cmd .p { color: var(--accent); }
.diff-add { color: var(--ok); }
.diff-del { color: var(--crit); }

/* drawer */
.drawer-bg { position: fixed; inset: 0; background: rgba(5, 7, 10, .55); z-index: 40; animation: fade .15s ease; }
.drawer {
  position: fixed; top: 0; right: 0; bottom: 0; width: min(620px, 100vw); z-index: 41;
  background: var(--bg); border-left: 1px solid var(--line-2); box-shadow: -30px 0 60px rgba(0, 0, 0, .45);
  display: flex; flex-direction: column; animation: slide .2s ease;
}
.drawer-h { display: flex; align-items: flex-start; gap: 12px; padding: 18px 20px; border-bottom: 1px solid var(--line); }
.drawer-h h2 { margin: 6px 0 0; font-size: 16px; line-height: 1.35; color: var(--text-strong); font-weight: 600; }
.drawer-b { flex: 1; overflow-y: auto; padding: 18px 20px 40px; display: grid; gap: 18px; align-content: start; }
@keyframes slide { from { transform: translateX(24px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
.kv { display: grid; grid-template-columns: 130px 1fr; gap: 7px 14px; font-size: 13px; }
.kv dt { font-family: var(--mono); font-size: 10.5px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); padding-top: 2px; }
.kv dd { margin: 0; color: var(--text); word-break: break-word; }
.section-t { font-family: var(--mono); font-size: 10.5px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); margin-bottom: 8px; }
.callout { padding: 11px 14px; border: 1px solid rgba(34, 212, 255, .25); background: var(--accent-soft); border-radius: var(--r); color: var(--text); font-size: 13px; }
.seg { display: inline-flex; border: 1px solid var(--line-2); border-radius: var(--r); overflow: hidden; }
.seg button { height: 30px; padding: 0 11px; border: 0; border-right: 1px solid var(--line-2); background: var(--surface-2); color: var(--text-2); cursor: pointer; font-size: 12.5px; }
.seg button:last-child { border-right: 0; }
.seg button.on { background: var(--accent); color: #062029; font-weight: 600; }

/* timeline */
.timeline { display: grid; gap: 0; position: relative; }
.tl-item { display: grid; grid-template-columns: 76px 18px 1fr; gap: 10px; padding: 7px 0; font-size: 12.5px; }
.tl-time { font-family: var(--mono); font-size: 11px; color: var(--muted); text-align: right; padding-top: 1px; }
.tl-rail { position: relative; }
.tl-rail::before { content: ""; position: absolute; left: 8px; top: 0; bottom: -14px; width: 1px; background: var(--line-2); }
.tl-item:last-child .tl-rail::before { display: none; }
.tl-node { position: relative; display: block; width: 9px; height: 9px; margin: 4px 0 0 4px; border-radius: 50%; background: var(--line-3); border: 2px solid var(--bg); }
.tl-node.tool { background: var(--accent); }
.tl-node.err { background: var(--crit); }
.tl-node.text { background: var(--text-strong); }
.tl-body { min-width: 0; }
.tl-body .mono { font-size: 12px; }

/* markdown report */
.md { font-size: 14px; line-height: 1.62; color: var(--text); }
.md h1, .md h2, .md h3 { color: var(--text-strong); letter-spacing: -.01em; margin: 1.3em 0 .5em; line-height: 1.3; }
.md h1 { font-size: 19px; } .md h2 { font-size: 16.5px; } .md h3 { font-size: 14.5px; }
.md > :first-child { margin-top: 0; }
.md p { margin: .55em 0; }
.md ul, .md ol { margin: .45em 0; padding-left: 1.3em; }
.md li { margin: .25em 0; }
.md li::marker { color: var(--muted); }
.md code { font-family: var(--mono); font-size: 12.3px; padding: 1px 5px; border-radius: var(--r-sm); background: var(--surface-3); color: var(--text-strong); }
.md pre { margin: .7em 0; }
.md strong { color: var(--text-strong); }
.md hr { border: 0; border-top: 1px solid var(--line); margin: 1.2em 0; }

/* misc */
.empty { padding: 34px 16px; text-align: center; color: var(--muted); font-size: 13px; }
.empty .prompt { display: block; margin-bottom: 6px; }
.skeleton { height: 14px; border-radius: 4px; background: linear-gradient(90deg, var(--surface-2), var(--surface-3), var(--surface-2)); background-size: 200% 100%; animation: shimmer 1.2s infinite; }
@keyframes shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }
.toast-wrap { position: fixed; right: 20px; bottom: 20px; z-index: 60; display: grid; gap: 8px; }
.toast { padding: 10px 14px; border-radius: var(--r); background: var(--surface-3); border: 1px solid var(--line-2); box-shadow: 0 12px 30px rgba(0, 0, 0, .4); font-size: 13px; animation: slide .2s ease; display: flex; gap: 10px; align-items: center; }
.toast.err { border-color: rgba(255, 77, 90, .45); }
.pager { display: flex; align-items: center; gap: 10px; justify-content: flex-end; padding: 10px 14px; border-top: 1px solid var(--line); }
.progress { height: 6px; border-radius: 3px; background: var(--surface-3); overflow: hidden; }
.progress > span { display: block; height: 100%; background: var(--accent); }
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); padding: 0 6px; }
.tabs button { height: 40px; padding: 0 12px; background: none; border: 0; border-bottom: 2px solid transparent; color: var(--text-2); cursor: pointer; font-size: 13px; margin-bottom: -1px; }
.tabs button.on { color: var(--text-strong); border-bottom-color: var(--accent); }
.tabs .n { font-family: var(--mono); font-size: 11px; color: var(--muted); margin-left: 5px; }

/* login */
.login { min-height: 100vh; display: grid; place-items: center; padding: 24px;
  background: radial-gradient(700px 380px at 50% 0%, rgba(34, 212, 255, .10), transparent 70%), var(--bg); }
.login-card { width: min(400px, 100%); background: var(--surface); border: 1px solid var(--line-2); border-radius: 14px; padding: 30px 28px; box-shadow: 0 0 90px rgba(34, 212, 255, .08), 0 30px 60px rgba(0, 0, 0, .5); display: grid; gap: 18px; }
.login-card h1 { margin: 0; font-size: 22px; letter-spacing: -.02em; color: var(--text-strong); }
.err-text { color: var(--crit); font-size: 13px; }

@media (max-width: 1200px) {
  .g-main, .g-3 { grid-template-columns: minmax(0, 1fr); }
  .g-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 860px) {
  .shell { grid-template-columns: 1fr; }
  /* Sidebar becomes one horizontally scrollable nav row. */
  .sidebar { position: sticky; top: 0; z-index: 30; height: auto; flex-direction: row; flex-wrap: nowrap; align-items: center;
    gap: 4px; padding: 8px 12px; overflow-x: auto; border-right: 0; border-bottom: 1px solid var(--line); scrollbar-width: none; }
  .sidebar::-webkit-scrollbar { display: none; }
  .sidebar .tenant, .sidebar .nav-group .label, .sidebar-foot, .brand-sub, .brand-name { display: none; }
  .brand { padding: 0 6px 0 0; flex: none; }
  .nav-group, .nav-group .nav { margin: 0; display: flex; flex-wrap: nowrap; gap: 2px; flex: none; }
  .nav a { white-space: nowrap; padding: 6px 9px; }
  .header { padding: 0 16px; top: 49px; }
  .header .clock { display: none; }
  /* Long list rows: tags and actions wrap below the title. */
  .list-item { grid-template-columns: auto minmax(0, 1fr); }
  .list-item > .row, .list-item > .status { grid-column: 2; justify-self: start; }
  .content { padding: 16px; }
  .g-2, .g-4 { grid-template-columns: minmax(0, 1fr); }
  .table th:nth-child(n+4), .table td:nth-child(n+4) { display: none; }
  .legend { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }
