/* GovernIT console. Light and dark palettes; chart series/status colors are validated
   (dataviz validator) against --panel in both modes: keep them in sync if surfaces change. */
:root {
  color-scheme: light;
  --bg: #f4f6f5; --bg-2: #eaeeec; --panel: #ffffff; --panel-2: #f6f8f7; --ink: #0f1613; --ink-2: #475650; --muted: #6b7a73;
  --line: #e1e7e4; --line-2: #cfd8d3; --hover: #eff3f1; --sidebar: #fafcfb;
  --accent: #1e7f52; --accent-2: #176b45; --accent-btn: #1e7f52; --accent-btn-2: #176b45; --accent-ink: #fff; --accent-soft: #e4f3ea; --ring: rgb(30 127 82 / .3);
  --brand-a: #2f9a68; --brand-b: #0f3d2a;
  --forest: #14532d; --forest-glow: #2e8b57; --mtn-1: #d9e1dd; --mtn-2: #c3cfc8; --mtn-3: #a9b9b1;
  --series-1: #1e7f52; --series-2: #4f6fd6; --series-3: #d9534f; --series-4: #eda100;
  --good: #0ca30c; --warning: #fab219; --serious: #ec835a; --critical: #d03b3b;
  --good-bg: #e3f4e3; --warning-bg: #fdf1d6; --serious-bg: #fbe7de; --critical-bg: #f8e1e1; --neutral-bg: #eef0f4;
  --shadow-sm: 0 1px 2px rgb(16 24 40 / .05);
  --shadow: 0 1px 3px rgb(16 24 40 / .06), 0 1px 2px rgb(16 24 40 / .04);
  --shadow-lg: 0 24px 48px -12px rgb(16 24 40 / .22), 0 2px 6px rgb(16 24 40 / .06);
  --radius: 12px; --radius-sm: 8px;
  --sb-w: 248px;
  --font: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #0b1017; --bg-2: #0f161f; --panel: #121a24; --panel-2: #172130; --ink: #e9eeec; --ink-2: #b3bfb9; --muted: #8794a0;
    --line: #223040; --line-2: #2d3d4f; --hover: #18222e; --sidebar: #0d141c;
    --accent: #3aa672; --accent-2: #4ab67f; --accent-btn: #237a52; --accent-btn-2: #2b8c5f; --accent-soft: #11302a; --ring: rgb(58 166 114 / .4);
    --forest: #2a7a52; --forest-glow: #3fa36e; --mtn-1: #16202b; --mtn-2: #1c2937; --mtn-3: #243444;
    --series-1: #34a56f; --series-2: #6273d9; --series-3: #d9534f; --series-4: #bf8a10;
    --good-bg: #12291a; --warning-bg: #33280e; --serious-bg: #351f15; --critical-bg: #361719; --neutral-bg: #1f2531;
    --shadow-sm: 0 1px 2px rgb(0 0 0 / .4); --shadow: 0 1px 3px rgb(0 0 0 / .45); --shadow-lg: 0 24px 60px -12px rgb(0 0 0 / .7);
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0b1017; --bg-2: #0f161f; --panel: #121a24; --panel-2: #172130; --ink: #e9eeec; --ink-2: #b3bfb9; --muted: #8794a0;
  --line: #223040; --line-2: #2d3d4f; --hover: #18222e; --sidebar: #0d141c;
  --accent: #3aa672; --accent-2: #4ab67f; --accent-btn: #237a52; --accent-btn-2: #2b8c5f; --accent-soft: #11302a; --ring: rgb(58 166 114 / .4);
  --forest: #2a7a52; --forest-glow: #3fa36e; --mtn-1: #16202b; --mtn-2: #1c2937; --mtn-3: #243444;
  --series-1: #34a56f; --series-2: #6273d9; --series-3: #d9534f; --series-4: #bf8a10;
  --good-bg: #12291a; --warning-bg: #33280e; --serious-bg: #351f15; --critical-bg: #361719; --neutral-bg: #1f2531;
  --shadow-sm: 0 1px 2px rgb(0 0 0 / .4); --shadow: 0 1px 3px rgb(0 0 0 / .45); --shadow-lg: 0 24px 60px -12px rgb(0 0 0 / .7);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 14px/1.5 var(--font); -webkit-font-smoothing: antialiased; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 24px; line-height: 1.2; margin: 0 0 4px; letter-spacing: -.02em; font-weight: 700; }
h2 { font-size: 14px; margin: 0 0 14px; font-weight: 650; letter-spacing: -.005em; display: flex; align-items: center; gap: 8px; }
h2 .muted { font-weight: 500; }
h3 { font-size: 13px; margin: 0 0 6px; font-weight: 650; }
.muted { color: var(--muted); } .ink2 { color: var(--ink-2); }
.small { font-size: 12px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
code, .mono { font-family: var(--mono); font-size: 12px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
svg.i { width: 16px; height: 16px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
kbd { font: 600 11px var(--mono); padding: 1px 6px; border-radius: 5px; border: 1px solid var(--line-2); border-bottom-width: 2px; background: var(--panel); color: var(--ink-2); }

/* ---------- shell ---------- */
.shell { display: grid; grid-template-columns: var(--sb-w) minmax(0, 1fr); min-height: 100vh; }
.sidebar { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; gap: 10px; padding: 16px 12px 12px;
  background: var(--sidebar); border-right: 1px solid var(--line); overflow-y: auto; z-index: 30; }
.logo { display: flex; align-items: center; gap: 10px; padding: 4px 8px; color: var(--ink); }
.logo:hover { text-decoration: none; }
.logo svg { width: 30px; height: 30px; flex: none; filter: drop-shadow(0 3px 8px rgb(30 127 82 / .3)); }
.logo b { display: block; font-size: 14px; line-height: 1.15; max-width: 170px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.logo small { display: block; font-size: 11px; color: var(--muted); letter-spacing: .04em; text-transform: uppercase; font-weight: 600; }
.client-btn { display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px 10px; border-radius: 10px; border: 1px solid var(--line);
  background: var(--panel); box-shadow: var(--shadow-sm); text-align: left; cursor: pointer; color: var(--ink); font: inherit; }
.client-btn:hover { border-color: var(--line-2); }
.client-btn .ava { width: 28px; height: 28px; border-radius: 8px; display: grid; place-items: center; font-size: 11px; font-weight: 700; color: #fff; flex: none;
  background: linear-gradient(135deg, var(--brand-a), var(--brand-b)); }
.client-btn .ava.all { background: var(--ink); color: var(--panel); }
.client-btn .t { flex: 1; min-width: 0; }
.client-btn .t b { display: block; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.client-btn .t small { display: block; font-size: 11px; color: var(--muted); }
.client-btn svg.i { color: var(--muted); }
.client-btn[disabled] { cursor: default; } .client-btn[disabled] svg.i { display: none; }
#nav { display: flex; flex-direction: column; gap: 1px; margin-top: 4px; }
#nav .grp { font-size: 10.5px; font-weight: 700; color: var(--muted); letter-spacing: .08em; text-transform: uppercase; padding: 14px 10px 6px; }
#nav a { display: flex; align-items: center; gap: 10px; padding: 7px 10px; border-radius: 8px; color: var(--ink-2); font-weight: 500; position: relative; }
#nav a:hover { background: var(--hover); color: var(--ink); text-decoration: none; }
#nav a.active { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
#nav a.active::before { content: ""; position: absolute; left: -12px; top: 8px; bottom: 8px; width: 3px; border-radius: 0 3px 3px 0; background: var(--accent); }
#nav a .badge { margin-left: auto; }
.sb-foot { margin-top: auto; display: grid; gap: 8px; padding-top: 12px; border-top: 1px solid var(--line); }
.me { display: flex; align-items: center; gap: 8px; padding: 4px; }
.me .avatar { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; font-size: 12px; font-weight: 700; background: var(--neutral-bg); color: var(--ink-2); flex: none; }
.me .who { flex: 1; min-width: 0; } .me .who b { display: block; font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.me .who small { display: block; font-size: 11px; color: var(--muted); text-transform: capitalize; }
.icon-btn { display: inline-grid; place-items: center; width: 32px; height: 32px; padding: 0; border-radius: 8px; border: 1px solid transparent; background: none; color: var(--ink-2); cursor: pointer; box-shadow: none; }
.icon-btn:hover { background: var(--hover); color: var(--ink); border-color: var(--line); }

.main-col { min-width: 0; display: flex; flex-direction: column; }
.topbar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 12px; padding: 10px 28px; min-height: 58px;
  background: color-mix(in srgb, var(--bg) 82%, transparent); backdrop-filter: saturate(1.4) blur(12px); -webkit-backdrop-filter: saturate(1.4) blur(12px);
  border-bottom: 1px solid var(--line); }
#crumbs { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); min-width: 0; flex: 1; }
#crumbs b { color: var(--ink); font-weight: 600; white-space: nowrap; }
#crumbs .sep { opacity: .5; }
#crumbs span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.top-actions { display: flex; align-items: center; gap: 10px; }
.search-pill { display: inline-flex; align-items: center; gap: 10px; min-width: 260px; padding: 6px 8px 6px 10px; border-radius: 10px; border: 1px solid var(--line);
  background: var(--panel); color: var(--muted); font: inherit; font-size: 13px; cursor: pointer; box-shadow: var(--shadow-sm); font-weight: 450; }
.search-pill:hover { border-color: var(--line-2); color: var(--ink-2); background: var(--panel); }
.search-pill kbd { margin-left: auto; }
.live { display: inline-flex; align-items: center; gap: 7px; font-size: 12px; font-weight: 600; color: var(--ink-2); padding: 4px 10px; border-radius: 999px; background: var(--panel); border: 1px solid var(--line); white-space: nowrap; }
.live i { width: 8px; height: 8px; border-radius: 50%; background: var(--good); animation: pulse 2s infinite; }
.live.off i { background: var(--muted); animation: none; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgb(12 163 12 / .45); } 70% { box-shadow: 0 0 0 7px rgb(12 163 12 / 0); } 100% { box-shadow: 0 0 0 0 rgb(12 163 12 / 0); } }
.only-mobile { display: none; }
main#view { width: 100%; max-width: 1440px; margin: 0 auto; padding: 26px 28px 60px; }
#view > * { animation: rise .28s cubic-bezier(.2, .8, .2, 1) both; }
#view > *:nth-child(2) { animation-delay: .03s; } #view > *:nth-child(3) { animation-delay: .06s; } #view > *:nth-child(4) { animation-delay: .09s; } #view > *:nth-child(n+5) { animation-delay: .12s; }
@keyframes rise { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

/* ---------- layout ---------- */
.page-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 14px; margin-bottom: 22px; }
.page-head p { margin: 0; max-width: 760px; }
.eyebrow { font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--accent); margin-bottom: 6px; display: flex; gap: 6px; align-items: center; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.grid { display: grid; gap: 18px; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); }
.grid-2 { display: grid; gap: 18px; grid-template-columns: 2fr 1fr; }
.grid-3 { display: grid; gap: 18px; grid-template-columns: 1.25fr 1fr 1fr; }
@media (max-width: 1180px) { .grid-3 { grid-template-columns: 1fr 1fr; } .grid-3 > :first-child { grid-column: 1 / -1; } }
@media (max-width: 900px) { .grid-2, .grid-3 { grid-template-columns: 1fr; } .grid { grid-template-columns: 1fr; } }
.mt { margin-top: 18px; }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; min-width: 0; box-shadow: var(--shadow); }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 14px; }
.panel-head h2 { margin: 0; }
.stack > * + * { margin-top: 18px; }

/* ---------- controls ---------- */
button, .btn { font: inherit; font-weight: 550; font-size: 13px; padding: 7px 13px; border-radius: var(--radius-sm); border: 1px solid var(--line-2); background: var(--panel); color: var(--ink);
  cursor: pointer; display: inline-flex; align-items: center; gap: 7px; white-space: nowrap; box-shadow: var(--shadow-sm); transition: background .12s, border-color .12s, transform .06s; }
button:hover, .btn:hover { border-color: var(--muted); text-decoration: none; background: var(--panel-2); }
button:active, .btn:active { transform: translateY(1px); }
button.primary, .btn.primary { background: var(--accent-btn); border-color: var(--accent-btn); color: var(--accent-ink); box-shadow: 0 1px 2px rgb(16 24 40 / .1), inset 0 1px 0 rgb(255 255 255 / .15); }
button.primary:hover, .btn.primary:hover { background: var(--accent-btn-2); border-color: var(--accent-btn-2); }
button.danger { color: var(--critical); }
button.danger:hover { border-color: var(--critical); background: var(--critical-bg); }
button.ghost { border-color: transparent; background: none; color: var(--ink-2); box-shadow: none; }
button.ghost:hover { background: var(--hover); }
button.link { border: 0; background: none; padding: 0; color: var(--accent); box-shadow: none; }
button.lg, .btn.lg { padding: 10px 18px; font-size: 14px; border-radius: 10px; }
button:disabled { opacity: .5; cursor: not-allowed; }
input, select, textarea { font: inherit; font-size: 13.5px; color: var(--ink); background: var(--panel); border: 1px solid var(--line-2); border-radius: var(--radius-sm); padding: 7px 10px; max-width: 100%;
  transition: border-color .12s, box-shadow .12s; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--ring); }
textarea { width: 100%; min-height: 80px; resize: vertical; }
input[type=checkbox], input[type=radio] { accent-color: var(--accent); width: 15px; height: 15px; vertical-align: -2px; }

/* ---------- tables ---------- */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { font-size: 11px; color: var(--muted); font-weight: 650; white-space: nowrap; text-transform: uppercase; letter-spacing: .05em; background: var(--panel-2); }
thead tr th:first-child { border-top-left-radius: 8px; } thead tr th:last-child { border-top-right-radius: 8px; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr.click { cursor: pointer; transition: background .1s; }
tbody tr.click:hover { background: var(--hover); }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }

/* ---------- chips & tags: color + icon + label, never color alone ---------- */
.chip { display: inline-flex; align-items: center; gap: 5px; padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 600; white-space: nowrap; background: var(--neutral-bg); color: var(--ink-2); line-height: 1.5; }
.chip::before { font-size: 9px; }
.chip.good { background: var(--good-bg); } .chip.good::before { content: "●"; color: var(--good); }
.chip.warning { background: var(--warning-bg); } .chip.warning::before { content: "▲"; color: var(--warning); }
.chip.serious { background: var(--serious-bg); } .chip.serious::before { content: "◆"; color: var(--serious); }
.chip.critical { background: var(--critical-bg); } .chip.critical::before { content: "■"; color: var(--critical); }
.chip.neutral::before { content: "○"; color: var(--muted); }
.tag { display: inline-flex; align-items: center; gap: 4px; padding: 1px 7px; border: 1px solid var(--line-2); border-radius: 6px; font-size: 11px; color: var(--ink-2); white-space: nowrap; background: var(--panel); font-weight: 550; }
.badge { display: inline-block; min-width: 19px; padding: 0 6px; border-radius: 10px; background: var(--critical); color: #fff; font-size: 11px; text-align: center; font-weight: 700; line-height: 18px; }

/* ---------- hero / posture ---------- */
.hero { position: relative; overflow: hidden; display: grid; grid-template-columns: auto 1fr auto; gap: 28px; align-items: center; padding: 24px 26px; margin-bottom: 18px; }
.hero .art { position: absolute; inset: 0; z-index: 0; pointer-events: none; mask-image: linear-gradient(90deg, transparent 28%, #000 62%); -webkit-mask-image: linear-gradient(90deg, transparent 28%, #000 62%); }
.hero > * { position: relative; z-index: 1; }
.hero > .art { z-index: 0; }
/* mountain ridge with the forest-green line; reused by the hero, sign-in and the agent panel */
.ridge { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.ridge .m1 { fill: var(--mtn-1); } .ridge .m2 { fill: var(--mtn-2); } .ridge .m3 { fill: var(--mtn-3); }
.ridge .line { fill: none; stroke: var(--forest); stroke-width: 3; stroke-linecap: round; vector-effect: non-scaling-stroke; }
.ridge .glow { fill: none; stroke: var(--forest-glow); stroke-width: 9; stroke-linecap: round; opacity: .28; vector-effect: non-scaling-stroke; filter: blur(3px); }
.hero h1 { font-size: 28px; }
.hero .lede { font-size: 15px; color: var(--ink-2); margin: 6px 0 12px; max-width: 660px; }
.hero .lede b { color: var(--ink); font-variant-numeric: tabular-nums; }
.hero .facts { display: flex; flex-wrap: wrap; gap: 8px; }
.hero-actions { display: flex; flex-direction: column; gap: 8px; align-items: stretch; }
@media (max-width: 900px) { .hero { grid-template-columns: auto 1fr; } .hero-actions { grid-column: 1 / -1; flex-direction: row; flex-wrap: wrap; } }
@media (max-width: 560px) { .hero { grid-template-columns: 1fr; justify-items: start; } }
.ring { position: relative; width: 128px; height: 128px; flex: none; }
.ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring .track { stroke: var(--line); }
.ring .arc { transition: stroke-dashoffset 1s cubic-bezier(.2, .8, .2, 1); }
.ring .lbl { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; }
.ring .lbl b { display: block; font-size: 30px; letter-spacing: -.03em; line-height: 1; font-variant-numeric: tabular-nums; }
.ring .lbl small { display: block; font-size: 10px; color: var(--muted); font-weight: 650; margin-top: 4px; text-transform: uppercase; letter-spacing: .05em; }
.ring.sm { width: 50px; height: 50px; } .ring.sm .lbl b { font-size: 12.5px; letter-spacing: 0; }

/* ---------- KPI tiles ---------- */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 14px; margin-bottom: 18px; }
.kpi { position: relative; overflow: hidden; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px 12px; box-shadow: var(--shadow); min-width: 0; }
.kpi .k-label { display: flex; align-items: center; gap: 7px; color: var(--ink-2); font-size: 12.5px; font-weight: 550; }
.kpi .k-label svg.i { width: 15px; height: 15px; color: var(--muted); }
.kpi b { display: block; font-size: 28px; font-weight: 700; font-variant-numeric: tabular-nums; letter-spacing: -.03em; margin: 4px 0 0; line-height: 1.15; }
.kpi span { color: var(--ink-2); font-size: 12px; }
.kpi .sub { color: var(--muted); font-size: 11.5px; display: block; margin-top: 2px; }
.kpi .spark { display: block; width: 100%; height: 34px; margin-top: 8px; color: var(--accent); overflow: visible; }

/* ---------- client cards ---------- */
.cards { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }
.ccard { display: grid; gap: 12px; text-align: left; padding: 16px; border-radius: var(--radius); border: 1px solid var(--line); background: var(--panel); box-shadow: var(--shadow);
  cursor: pointer; color: var(--ink); font: inherit; transition: transform .15s, box-shadow .15s, border-color .15s; white-space: normal; }
.ccard:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); border-color: var(--line-2); background: var(--panel); }
.ccard .top { display: flex; align-items: center; gap: 12px; }
.ccard .top .t { flex: 1; min-width: 0; }
.ccard .top b { display: block; font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ccard .top small { display: block; color: var(--muted); font-size: 12px; }
.ccard .stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; padding-top: 12px; border-top: 1px dashed var(--line); }
.ccard .stats b { display: block; font-size: 17px; font-variant-numeric: tabular-nums; }
.ccard .stats small { color: var(--muted); font-size: 11px; }
.ccard .foot { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; justify-content: space-between; }

/* ---------- live feed ---------- */
.feed { display: grid; }
.feed-item { display: grid; grid-template-columns: 34px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 9px 6px; border-bottom: 1px solid var(--line); cursor: pointer; border-radius: 8px; }
.feed-item:last-child { border-bottom: 0; }
.feed-item:hover { background: var(--hover); }
.feed-item.new { animation: flash 1.8s ease-out; }
@keyframes flash { from { background: var(--accent-soft); } to { background: transparent; } }
.feed-item .t div { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.feed-item .when { font-size: 11.5px; color: var(--muted); white-space: nowrap; font-variant-numeric: tabular-nums; }
.act-ico { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; }
.act-ico svg.i { width: 17px; height: 17px; }
.act-ico.block { background: var(--critical-bg); color: var(--critical); }
.act-ico.redact { background: var(--serious-bg); color: var(--serious); }
.act-ico.warn { background: var(--warning-bg); color: color-mix(in srgb, var(--warning) 65%, var(--ink)); }
.act-ico.monitor, .act-ico.allow { background: var(--neutral-bg); color: var(--ink-2); }

/* ---------- tabs & filters ---------- */
.tabs { display: flex; flex-wrap: wrap; gap: 2px; margin-bottom: 18px; padding: 3px; border-radius: 10px; background: var(--bg-2); width: fit-content; max-width: 100%; border: 1px solid var(--line); }
.tabs a { padding: 6px 14px; color: var(--ink-2); border-radius: 8px; font-weight: 550; font-size: 13px; }
.tabs a:hover { color: var(--ink); text-decoration: none; }
.tabs a.active { color: var(--ink); background: var(--panel); box-shadow: var(--shadow); text-decoration: none; }
.filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; align-items: center; }
.filters input[type=search] { min-width: 220px; flex: 1; }

/* ---------- charts ---------- */
.chart { width: 100%; height: 190px; display: block; overflow: visible; }
.chart .grid-line { stroke: var(--line); stroke-width: 1; stroke-dasharray: 2 3; }
.chart .axis { fill: var(--muted); font-size: 10px; }
.chart .hit { fill: transparent; }
.chart g.col:hover .hit { fill: var(--hover); }
.legend { display: flex; flex-wrap: wrap; gap: 4px 16px; font-size: 12px; color: var(--ink-2); margin-bottom: 8px; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.legend b { color: var(--ink); font-variant-numeric: tabular-nums; }
.hbar { display: grid; grid-template-columns: minmax(90px, 40%) 1fr auto; gap: 9px 12px; align-items: center; font-size: 13px; }
.hbar > div:nth-child(3n+1) { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hbar .track { height: 8px; border-radius: 4px; background: var(--bg-2); overflow: hidden; }
.hbar .fill { height: 8px; border-radius: 0 4px 4px 0; background: var(--series-1); min-width: 3px; transform-origin: left; animation: grow .7s cubic-bezier(.2, .8, .2, 1) both; }
@keyframes grow { from { transform: scaleX(0); } }
.hbar .val { font-variant-numeric: tabular-nums; color: var(--ink); font-weight: 600; font-size: 12px; text-align: right; }
#tooltip { position: fixed; z-index: 90; pointer-events: none; background: var(--ink); color: var(--panel); border-radius: 8px;
  padding: 7px 11px; font-size: 12px; box-shadow: var(--shadow-lg); max-width: 260px; line-height: 1.45; }
#tooltip b { display: block; }

/* ---------- empty & skeleton ---------- */
.empty { padding: 32px 20px; text-align: center; color: var(--muted); display: grid; justify-items: center; gap: 8px; }
.empty .e-ico { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; background: var(--bg-2); color: var(--muted); }
.empty .e-ico svg.i { width: 22px; height: 22px; }
.sk { border-radius: 8px; background: linear-gradient(90deg, var(--bg-2) 25%, var(--hover) 50%, var(--bg-2) 75%); background-size: 200% 100%; animation: shimmer 1.2s infinite linear; }
@keyframes shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }

/* ---------- dialogs, drawers, palette ---------- */
dialog { border: 1px solid var(--line); border-radius: 16px; background: var(--panel); color: var(--ink); padding: 0; width: min(760px, calc(100vw - 32px)); box-shadow: var(--shadow-lg); }
dialog[open] { animation: pop .18s cubic-bezier(.2, .8, .2, 1); }
@keyframes pop { from { opacity: 0; transform: translateY(8px) scale(.98); } }
dialog::backdrop { background: rgb(8 10 16 / .5); backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px); }
#modal-form { padding: 22px; display: grid; gap: 14px; max-height: 88vh; overflow-y: auto; }
#modal-form > h2 { font-size: 17px; margin: 0; }
dialog.drawer { margin: 0 0 0 auto; height: 100vh; max-height: 100vh; width: min(560px, 100vw); border-radius: 16px 0 0 16px; border-right: 0; }
dialog.drawer[open] { animation: slide .24s cubic-bezier(.2, .8, .2, 1); }
@keyframes slide { from { transform: translateX(40px); opacity: 0; } }
dialog.drawer #modal-form { max-height: 100vh; height: 100%; align-content: start; }
.field { display: grid; gap: 5px; }
.field > span { font-size: 12px; color: var(--ink-2); font-weight: 600; }
.field .hint { font-size: 11px; color: var(--muted); font-weight: 400; }
.row { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 14px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 4px; }
.checks { display: flex; flex-wrap: wrap; gap: 6px 16px; }
.checks.cols { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 6px 12px; max-height: 260px; overflow-y: auto; padding: 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel-2); }
.error-box { background: var(--critical-bg); color: var(--ink); border-left: 3px solid var(--critical); padding: 9px 12px; border-radius: 8px; }
.note-box { background: var(--panel-2); border: 1px solid var(--line); padding: 10px 12px; border-radius: 8px; font-size: 13px; }

#palette { width: min(620px, calc(100vw - 24px)); margin-top: 12vh; padding: 0; overflow: hidden; }
#palette .p-in { display: flex; align-items: center; gap: 10px; padding: 14px 16px; border-bottom: 1px solid var(--line); }
#palette .p-in svg.i { color: var(--muted); width: 18px; height: 18px; }
#palette input { border: 0; box-shadow: none; padding: 2px 0; font-size: 16px; flex: 1; background: none; }
#palette ul { list-style: none; margin: 0; padding: 6px; max-height: 52vh; overflow-y: auto; }
#palette li.h { font-size: 10.5px; font-weight: 700; color: var(--muted); letter-spacing: .08em; text-transform: uppercase; padding: 10px 10px 4px; }
#palette li.o { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 8px; cursor: pointer; color: var(--ink-2); }
#palette li.o svg.i { color: var(--muted); }
#palette li.o .hint { margin-left: auto; font-size: 11.5px; color: var(--muted); }
#palette li.o.sel { background: var(--accent-soft); color: var(--ink); }
#palette li.o.sel svg.i { color: var(--accent); }
#palette li.none { padding: 18px; text-align: center; color: var(--muted); }
#palette .p-foot { display: flex; gap: 14px; padding: 8px 14px; border-top: 1px solid var(--line); font-size: 11.5px; color: var(--muted); background: var(--panel-2); }

.popover { position: fixed; z-index: 80; width: 300px; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow-lg); padding: 6px; animation: pop .14s ease-out; }
.popover input { width: 100%; margin-bottom: 6px; }
.popover .opts { max-height: 340px; overflow-y: auto; display: grid; gap: 1px; }
.popover .opt { display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: 8px; cursor: pointer; border: 0; background: none; box-shadow: none; width: 100%; text-align: left; font-weight: 500; }
.popover .opt:hover, .popover .opt.sel { background: var(--hover); }
.popover .opt .t { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.dot { width: 8px; height: 8px; border-radius: 50%; flex: none; background: var(--muted); }
.dot.good { background: var(--good); } .dot.warning { background: var(--warning); } .dot.critical { background: var(--critical); }

#toasts { position: fixed; right: 20px; bottom: 20px; z-index: 95; display: grid; gap: 8px; justify-items: end; max-width: calc(100vw - 40px); }
.toast { display: flex; align-items: center; gap: 10px; background: var(--ink); color: var(--panel); padding: 10px 14px; border-radius: 10px; box-shadow: var(--shadow-lg); font-weight: 550; font-size: 13px;
  animation: toastin .25s cubic-bezier(.2, .8, .2, 1); transition: opacity .2s, transform .2s; }
.toast svg.i { color: var(--good); }
.toast.out { opacity: 0; transform: translateY(6px); }
@keyframes toastin { from { opacity: 0; transform: translateY(10px) scale(.97); } }

/* ---------- auth ---------- */
.auth { min-height: 100vh; display: grid; grid-template-columns: 1.1fr 1fr; }
.auth-hero { position: relative; overflow: hidden; padding: 48px 56px; display: flex; flex-direction: column; justify-content: space-between; gap: 32px;
  background: linear-gradient(180deg, #0a1410 0%, #0c1a15 55%, #0f241b 100%); color: #e9eeec;
  --mtn-1: #132019; --mtn-2: #182a21; --mtn-3: #1f372b; --forest: #2e8b57; --forest-glow: #4fc48a; }
.auth-hero .art { position: absolute; inset: 0; pointer-events: none; mask-image: linear-gradient(180deg, transparent 18%, #000 60%); -webkit-mask-image: linear-gradient(180deg, transparent 18%, #000 60%); }
.auth-hero .logo { color: #fff; } .auth-hero .logo small { color: #93a79d; }
.auth-hero h1 { font-size: clamp(30px, 3.4vw, 46px); line-height: 1.06; letter-spacing: -.035em; max-width: 560px; margin: 0; }
.auth-hero h1 em { font-style: normal; color: #6fd39d; }
.auth-hero p { color: #a9b8b1; font-size: 15px; max-width: 520px; margin: 14px 0 0; }
.auth-hero ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 16px; max-width: 520px; }
.auth-hero li { display: grid; grid-template-columns: 36px 1fr; gap: 12px; align-items: start; color: #a9b8b1; font-size: 13.5px; }
.auth-hero li b { color: #fff; display: block; font-size: 14px; }
.auth-hero li .hi { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; background: rgb(255 255 255 / .06); border: 1px solid rgb(255 255 255 / .1); color: #8fdcb3; }
.auth-hero > * { position: relative; }
.auth-side { display: grid; place-items: center; padding: 40px 24px; background: var(--bg); }
.auth-card { width: min(400px, 100%); display: grid; gap: 14px; }
.auth-card h2 { font-size: 24px; margin: 0; letter-spacing: -.02em; display: block; }
.auth-card input:not([type=checkbox]) { width: 100%; padding: 10px 12px; }
.auth-card button.primary { justify-content: center; padding: 11px; font-size: 14px; }
.auth-foot { font-size: 12px; color: var(--muted); text-align: center; }
@media (max-width: 900px) { .auth { grid-template-columns: 1fr; } .auth-hero { padding: 28px 24px; } .auth-hero ul { display: none; } }

/* ---------- misc components ---------- */
.kv { display: grid; grid-template-columns: max-content 1fr; gap: 8px 18px; font-size: 13px; }
.kv dt { color: var(--muted); } .kv dd { margin: 0; word-break: break-word; }
.redacted { background: var(--panel-2); border: 1px solid var(--line); padding: 10px 12px; border-radius: 8px; white-space: pre-wrap; word-break: break-word; font: 12.5px/1.6 var(--mono); }
pre.code { position: relative; background: #0b0e14; color: #d6deeb; border: 1px solid #1d2330; border-radius: 10px; padding: 12px 70px 12px 14px; overflow-x: auto; white-space: pre-wrap; word-break: break-all; margin: 4px 0 12px; font: 12.5px/1.6 var(--mono); }
pre.code .copy { position: absolute; top: 7px; right: 7px; padding: 3px 9px; font: 600 11px var(--font); background: rgb(255 255 255 / .08); color: #c9d1e0; border-color: rgb(255 255 255 / .14); box-shadow: none; }
pre.code .copy:hover { background: rgb(255 255 255 / .16); }
.dev { display: flex; align-items: center; gap: 10px; }
.os { width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; background: var(--bg-2); color: var(--ink-2); flex: none; }
.os svg.i { width: 16px; height: 16px; }
.split-bar { display: flex; height: 10px; border-radius: 5px; overflow: hidden; gap: 2px; background: var(--bg-2); margin: 6px 0 10px; }
.split-bar span { display: block; height: 100%; }

/* deploy */
.step-n { width: 26px; height: 26px; border-radius: 50%; display: inline-grid; place-items: center; font-size: 12px; font-weight: 700; background: var(--accent); color: var(--accent-ink); flex: none; }
.installers { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); margin-bottom: 10px; }
.installer { position: relative; border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; display: flex; flex-direction: column; gap: 8px; align-items: flex-start; background: var(--panel-2); transition: border-color .15s, transform .15s; }
.installer:hover { border-color: var(--accent); transform: translateY(-1px); }
.installer .os { width: 40px; height: 40px; border-radius: 10px; background: var(--panel); border: 1px solid var(--line); }
.installer .os svg.i { width: 20px; height: 20px; color: var(--accent); }
.installer h3 { margin: 0; font-size: 15px; }
.installer .btn { word-break: break-all; white-space: normal; }
.keybox { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 10px; }
.keybox code { font-size: 15px; letter-spacing: .05em; padding: 9px 12px; background: var(--panel-2); border: 1px dashed var(--line-2); border-radius: 8px; word-break: break-all; font-weight: 600; }
code.cid { font-size: 12.5px; letter-spacing: .04em; font-weight: 600; padding: 2px 7px; border-radius: 6px; background: var(--bg-2); }

/* ---------- responsive shell ---------- */
@media (max-width: 1000px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .sidebar { position: fixed; left: 0; top: 0; bottom: 0; width: min(290px, 86vw); transform: translateX(-102%); transition: transform .22s cubic-bezier(.2, .8, .2, 1); box-shadow: var(--shadow-lg); }
  .shell.sb-open .sidebar { transform: none; }
  .scrim { position: fixed; inset: 0; background: rgb(8 10 16 / .45); z-index: 25; }
  .only-mobile { display: inline-grid; }
  .search-pill { min-width: 0; } .search-pill .lbl, .search-pill kbd { display: none; }
  .topbar { padding: 10px 16px; }
  main#view { padding: 20px 16px 48px; }
}
@media (max-width: 560px) { .live { display: none; } .hero h1 { font-size: 22px; } .ring:not(.sm) { width: 104px; height: 104px; } }
.avatar-sm { width: 24px; height: 24px; border-radius: 50%; display: inline-grid; place-items: center; font-size: 10px; font-weight: 700; background: var(--neutral-bg); color: var(--ink-2); flex: none; }
.ccard .top > svg.i { color: var(--muted); transition: transform .15s; }
.ccard:hover .top > svg.i { transform: translateX(3px); color: var(--accent); }
a.chip:hover { text-decoration: none; filter: brightness(.97); }
.kpi b span, .ring .lbl b span { font-size: inherit; color: inherit; }
.panel:has(> table) { overflow-x: auto; }
.ccard { grid-template-columns: minmax(0, 1fr); width: 100%; min-width: 0; }
.live.off { display: none; }
.shell[hidden] { display: none; }

/* Sign-in card: fields toggled by the SSO discovery step. */
.auth-card [hidden] { display: none !important; }

/* Access page */
.grid2{display:grid;grid-template-columns:1fr 1fr;gap:12px}
@media (max-width:640px){.grid2{grid-template-columns:1fr}}
tr.dim td{opacity:.55}
fieldset.stack{border:1px solid var(--line);border-radius:10px;padding:12px 14px;margin:4px 0;display:grid;gap:10px}
fieldset.stack legend{font-size:12px;font-weight:600;color:var(--ink2);padding:0 6px}

.field[hidden]{display:none}

/* Data protection */
.seg { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 10px; }
.seg label { display: grid; gap: 4px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel-2); cursor: pointer; }
.seg label.on, .seg label:has(input:checked) { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent) inset; }
.seg label input { position: absolute; opacity: 0; pointer-events: none; }
.seg label b { font-size: 13.5px; }
.seg label span { font-size: 12px; color: var(--muted); }
.wc { padding: 10px 0; border-top: 1px solid var(--line); }
.wc:first-of-type { border-top: 0; }
.wc .tag { margin: 4px 4px 0 0; }

/* Mail Gate */
.gate-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 10px; margin-top: 4px; }
.gate-stats div { padding: 10px 12px; background: var(--panel-2); border: 1px solid var(--line); border-radius: 10px; display: grid; gap: 2px; }
.gate-stats b { font-size: 18px; letter-spacing: -.01em; }
.gate-stats span { font-size: 11.5px; color: var(--muted); }
ol.steps { padding-left: 20px; display: grid; gap: 12px; margin: 6px 0 0; }
ol.steps li { line-height: 1.45; }
.kv2 { display: grid; grid-template-columns: max-content 1fr; gap: 6px 12px; align-items: center; margin-top: 6px; }
.kv2 > span:nth-child(odd) { font-size: 12px; color: var(--muted); font-weight: 600; }
.kv2 pre.code { margin: 0; }
