:root {
  --bg: #000000;
  --bg2: #050607;
  --panel: #08090b;
  --panel2: #0b0d10;
  --panel3: #101318;
  --line: rgba(255, 255, 255, .07);
  --line2: rgba(255, 255, 255, .14);
  --text: #f1f4f8;
  --muted: #98a1ac;
  --dim: #626b76;
  --cyan: #00b4ff;
  --cyan2: #46c6ff;
  --blue: #2f6bff;
  --deep: #15181c;
  --ink: #020405;
  --red: #ff4d6d;
  --orange: #ff8a3d;
  --amber: #ffb020;
  --teal: #2ed3c6;
  --green: #2ee6a8;
  --violet: #a78bfa;
  --shadow: 0 18px 44px rgba(0, 0, 0, .7);
  --mono: "SFMono-Regular", "JetBrains Mono", ui-monospace, Menlo, Consolas, monospace;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background:
    radial-gradient(900px 520px at 82% -10%, rgba(0, 180, 255, .045), transparent 62%),
    radial-gradient(700px 420px at -5% 0%, rgba(255, 255, 255, .015), transparent 55%),
    var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 14px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--cyan2); text-decoration: none; }
a:hover { color: #7ad9ff; }
b { font-weight: 650; }
pre, code, .mono, .token { font-family: var(--mono); font-size: 12px; }
.muted { color: var(--muted); }
.tiny { font-size: 10.5px; letter-spacing: .02em; }
.small { font-size: 12px; color: var(--muted); }
.warn-text { color: var(--amber); }
.mono { word-break: break-all; }
.inline { display: inline; }
.nowrap { white-space: nowrap; }
.center { text-align: center; }
.svg-defs { position: absolute; width: 0; height: 0; overflow: hidden; }
.ic { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; flex: none; }

/* shell */
.shell { display: grid; grid-template-columns: 232px minmax(0, 1fr); min-height: 100vh; }
.sidebar {
  position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column;
  padding: 22px 16px 18px; border-right: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(8, 9, 11, .99), rgba(2, 3, 4, 1));
  backdrop-filter: blur(6px); z-index: 30;
}
.brand { display: flex; align-items: center; gap: 11px; padding: 2px 6px 22px; color: var(--text); }
.brand:hover { color: var(--text); }
.brand-badge {
  width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center;
  background: #fff; box-shadow: 0 6px 18px rgba(0, 180, 255, .25);
}
.brand-badge img { width: 34px; height: 34px; object-fit: contain; display: block; }
.brand-text { display: flex; flex-direction: column; line-height: 1.1; }
.brand-text b { font-size: 17px; letter-spacing: .16em; }
.brand-text span { font-size: 10.5px; letter-spacing: .22em; text-transform: uppercase; color: var(--cyan2); margin-top: 4px; }
.nav { display: flex; flex-direction: column; gap: 3px; }
.nav a {
  display: flex; align-items: center; gap: 11px; padding: 10px 12px; border-radius: 10px;
  color: var(--muted); font-weight: 550; font-size: 13.5px; border: 1px solid transparent;
}
.nav a:hover { background: rgba(255, 255, 255, .045); color: var(--text); }
.nav a.on {
  color: var(--text); background: linear-gradient(90deg, rgba(0, 180, 255, .14), rgba(0, 180, 255, .03));
  border-color: rgba(0, 180, 255, .22);
}
.nav a.on .ic { color: var(--cyan); }
.side-foot { margin-top: auto; padding: 14px 8px 0; border-top: 1px solid var(--line); color: var(--dim); font-size: 11px; }
.pulse { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; color: var(--muted); }
.dot { width: 7px; height: 7px; border-radius: 50%; background: #46627f; display: inline-block; }
.dot.live { background: var(--green); box-shadow: 0 0 0 3px rgba(46, 230, 168, .14); animation: breathe 2.6s ease-in-out infinite; }
@keyframes breathe { 50% { opacity: .55; } }
.ver { font-family: var(--mono); font-size: 10px; }

.main { min-width: 0; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 20; display: flex; align-items: center; justify-content: space-between;
  gap: 18px; padding: 18px 30px; border-bottom: 1px solid var(--line);
  background: rgba(0, 0, 0, .85); backdrop-filter: blur(12px);
}
.kicker { font-size: 10px; letter-spacing: .2em; text-transform: uppercase; color: var(--cyan2); font-weight: 650; }
.topbar h1 { margin: 3px 0 0; font-size: 24px; letter-spacing: -.02em; font-weight: 680; }
.top-actions { display: flex; align-items: center; gap: 12px; }
.mode-pill {
  font-family: var(--mono); font-size: 10.5px; letter-spacing: .12em; padding: 6px 10px;
  border-radius: 999px; border: 1px solid; white-space: nowrap;
}
.mode-pill.enforce { color: var(--green); border-color: rgba(46, 230, 168, .35); background: rgba(46, 230, 168, .08); }
.mode-pill.monitor { color: var(--amber); border-color: rgba(255, 176, 32, .35); background: rgba(255, 176, 32, .08); }
.who { display: flex; align-items: center; gap: 10px; }
.avatar {
  width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center;
  background: linear-gradient(140deg, #16181c, #090a0c); color: #fff; font-weight: 700;
  border: 1px solid rgba(0, 180, 255, .3);
}
.who-meta { display: flex; flex-direction: column; line-height: 1.15; }
.who-meta b { font-size: 12.5px; }
.who-meta span { font-size: 10px; color: var(--dim); text-transform: uppercase; letter-spacing: .1em; }

.content { padding: 22px 30px 26px; max-width: 1500px; width: 100%; margin: 0 auto; }
.foot { margin-top: auto; padding: 14px 30px 22px; color: var(--dim); font-size: 11px; }
.flash { margin: 0 30px 14px; padding: 11px 14px; border-radius: 11px; font-size: 13px; border: 1px solid; }
.flash.ok { background: rgba(46, 230, 168, .08); border-color: rgba(46, 230, 168, .3); color: #9cf5d6; }
.flash.err { background: rgba(255, 77, 109, .09); border-color: rgba(255, 77, 109, .35); color: #ffb3c0; }
.banner { display: flex; gap: 10px; align-items: center; padding: 10px 14px; border-radius: 12px; font-size: 12.5px; margin-bottom: 16px; }
.demo-banner { background: rgba(167, 139, 250, .08); border: 1px solid rgba(167, 139, 250, .28); color: #d6c9ff; }
.demo-banner.compact { padding: 8px 12px; font-size: 11.5px; margin-bottom: 14px; }
.page-lede { margin: -4px 0 16px; color: var(--muted); font-size: 13px; max-width: 76ch; }

/* status hero */
.status-hero {
  display: flex; gap: 18px; align-items: center; padding: 22px 24px; margin-bottom: 18px;
  border: 1px solid rgba(46, 230, 168, .18); border-radius: 16px;
  background: linear-gradient(140deg, rgba(46, 230, 168, .06), rgba(4, 5, 6, .98));
}
.status-hero.warn { border-color: rgba(255, 176, 32, .25); background: linear-gradient(140deg, rgba(255, 176, 32, .06), rgba(4, 5, 6, .98)); }
.status-hero .hero-icon {
  width: 58px; height: 58px; border-radius: 17px; display: grid; place-items: center;
  background: rgba(46, 230, 168, .12); color: var(--green); flex: none;
}
.status-hero.warn .hero-icon { background: rgba(255, 176, 32, .12); color: var(--amber); }
.status-hero .hero-icon .ic { width: 30px; height: 30px; }
.status-hero h2 { margin: 2px 0 5px; font-size: 25px; letter-spacing: -.02em; }
.status-hero p { margin: 0; color: var(--muted); max-width: 64ch; font-size: 13px; }
.status-hero .hero-actions { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; }
.kpis.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }

/* panels */
.panel {
  background: linear-gradient(165deg, #0e1013, #070809);
  border: 1px solid var(--line); border-radius: 14px; padding: 18px; min-width: 0;
  box-shadow: var(--shadow);
}
.panel-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; margin-bottom: 14px; }
.panel-head.wrap { flex-wrap: wrap; }
.panel-head h2 { margin: 0; font-size: 15px; letter-spacing: -.01em; }
.panel-head p { margin: 3px 0 0; color: var(--muted); font-size: 11.5px; }
.panel-head h3, .sub { margin: 14px 0 10px; font-size: 12px; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); }
.link { font-size: 12px; white-space: nowrap; }
.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 18px; }
.kpi {
  position: relative; overflow: hidden; padding: 16px; border-radius: 13px;
  background: linear-gradient(160deg, #0e1013, #060708);
  border: 1px solid var(--line); box-shadow: var(--shadow);
}
.kpi::after {
  content: ""; position: absolute; inset: 0 0 auto 0; height: 1px;
  background: linear-gradient(90deg, transparent, rgba(0, 180, 255, .4), transparent);
}
.kpi-top { display: flex; justify-content: space-between; align-items: center; color: var(--muted); font-size: 11.5px; letter-spacing: .04em; }
.kpi-top .ic { color: var(--cyan); opacity: .8; }
.kpi-val { display: flex; align-items: baseline; gap: 7px; margin: 10px 0 4px; }
.kpi-val b { font-size: 30px; font-weight: 680; letter-spacing: -.03em; line-height: 1; }
.kpi-val em { font-style: normal; font-size: 11px; color: var(--dim); text-transform: uppercase; letter-spacing: .1em; }
.kpi-sub { color: var(--muted); font-size: 11.5px; }
.small-kpi .kpi-val b { font-size: 24px; }
.grid-2 { display: grid; grid-template-columns: minmax(0, 1.42fr) minmax(0, 1fr); gap: 16px; margin-bottom: 16px; align-items: start; }
.grid-2.tight { grid-template-columns: 1fr 1fr; }
.stack { display: flex; flex-direction: column; gap: 16px; min-width: 0; }

/* chart */
.chart-panel { min-height: 0; }
.legend { display: flex; gap: 12px; font-size: 10.5px; color: var(--muted); flex-wrap: wrap; }
.lg::before { content: ""; display: inline-block; width: 8px; height: 8px; border-radius: 2px; margin-right: 5px; vertical-align: 0; }
.lg.events::before { background: rgba(0, 180, 255, .65); }
.lg.hi::before { background: var(--red); }
.lg.flow::before { background: var(--cyan); }
.chart { display: flex; align-items: flex-end; gap: 2px; height: 150px; padding: 8px 0 0; border-bottom: 1px solid var(--line); }
.chart .bar {
  flex: 1; min-height: 2px; border-radius: 2px 2px 0 0; position: relative;
  background: linear-gradient(180deg, rgba(0, 180, 255, .75), rgba(0, 180, 255, .18));
  transition: height .4s ease;
}
.chart .bar i { display: block; width: 100%; position: absolute; bottom: 0; border-radius: 2px 2px 0 0; background: linear-gradient(180deg, var(--red), rgba(255, 77, 109, .45)); }
.spark {
  display: flex; align-items: flex-end; gap: 2px; height: 96px; margin-top: 14px;
  border-bottom: 1px solid var(--line);
}
.spark span { flex: 1; min-height: 1px; background: linear-gradient(180deg, rgba(0, 180, 255, .85), rgba(0, 180, 255, .08)); border-radius: 2px 2px 0 0; }
.chart-axis { display: flex; justify-content: space-between; margin-top: 6px; color: var(--dim); font-size: 10px; font-family: var(--mono); }

/* threat */
.threat-panel .threat-level { font-size: 34px; font-weight: 700; letter-spacing: -.02em; margin: 2px 0 10px; }
.level-critical .threat-level { color: var(--red); }
.level-high .threat-level { color: var(--orange); }
.level-elevated .threat-level { color: var(--amber); }
.level-guarded .threat-level { color: var(--green); }
.meter { height: 7px; border-radius: 999px; background: rgba(255, 255, 255, .08); overflow: hidden; margin-bottom: 16px; }
.meter span { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--teal), var(--amber), var(--red)); transition: width .5s; }
.sev-list { display: flex; flex-direction: column; gap: 7px; }
.sev-row { display: grid; grid-template-columns: 22px 1fr 36px; gap: 9px; align-items: center; }
.sev-bar { height: 5px; border-radius: 999px; background: rgba(255, 255, 255, .08); overflow: hidden; }
.sev-bar i { display: block; height: 100%; background: var(--cyan); border-radius: inherit; }
.sev-row b { text-align: right; font-size: 11.5px; font-family: var(--mono); color: var(--muted); }
.facts { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 18px; margin: 16px 0 0; }
.facts.cols { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.facts > div { min-width: 0; }
.facts dt { font-size: 10.5px; text-transform: uppercase; letter-spacing: .09em; color: var(--dim); margin-bottom: 2px; }
.facts dd { margin: 0; font-size: 12.5px; }
.notes { margin: 12px 0 0; padding-left: 16px; color: var(--amber); font-size: 11.5px; }
.notes li { margin: 3px 0; }

/* severities + status */
.sev {
  display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 6px;
  font-family: var(--mono); font-size: 11px; font-weight: 700; flex: none;
}
.sev-5 { color: #ffc0cb; background: rgba(255, 77, 109, .16); border: 1px solid rgba(255, 77, 109, .4); }
.sev-4 { color: #ffd2ad; background: rgba(255, 138, 61, .14); border: 1px solid rgba(255, 138, 61, .36); }
.sev-3 { color: #bfe3ff; background: rgba(0, 180, 255, .12); border: 1px solid rgba(0, 180, 255, .3); }
.sev-2 { color: #b8f3ec; background: rgba(46, 211, 198, .1); border: 1px solid rgba(46, 211, 198, .28); }
.sev-1 { color: var(--muted); background: rgba(255, 255, 255, .06); border: 1px solid var(--line); }
.status {
  display: inline-block; font-size: 10px; letter-spacing: .07em; text-transform: uppercase;
  padding: 3px 7px; border-radius: 5px; border: 1px solid var(--line); color: var(--muted); white-space: nowrap;
}
.status.ok, .status.blocked { color: var(--green); border-color: rgba(46, 230, 168, .3); background: rgba(46, 230, 168, .07); }
.status.monitored, .status.warn { color: var(--amber); border-color: rgba(255, 176, 32, .3); background: rgba(255, 176, 32, .07); }
.status.muted { color: var(--dim); }
.chip { display: inline-block; font-size: 9.5px; text-transform: uppercase; letter-spacing: .08em; padding: 2px 6px; border-radius: 4px; border: 1px solid var(--line); color: var(--muted); }
.chip.demo { color: #cbb8ff; border-color: rgba(167, 139, 250, .3); background: rgba(167, 139, 250, .08); }
.chip.src { color: #a8d9ff; border-color: rgba(0, 180, 255, .2); background: rgba(0, 180, 255, .05); }
.chip-btn { display: inline-block; font-size: 11px; padding: 5px 9px; border-radius: 7px; border: 1px solid var(--line); color: var(--muted); }
.chip-btn:hover { color: var(--text); border-color: var(--line2); }
.chip-btn.on { color: var(--text); border-color: rgba(0, 180, 255, .4); background: rgba(0, 180, 255, .1); }
.sev.mobile-only, .status.mobile-only { display: none; }

/* lists */
.list { display: flex; flex-direction: column; }
.list-row { display: grid; grid-template-columns: 26px minmax(0, 1fr) auto auto; gap: 10px; align-items: center; padding: 10px 2px; border-top: 1px solid var(--line); }
.list-row:first-child { border-top: 0; }
.list-main { min-width: 0; }
.list-title { font-size: 12.5px; font-weight: 600; text-transform: capitalize; }
.list-sub { color: var(--muted); font-size: 11px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.list-row time { font-size: 10.5px; color: var(--dim); white-space: nowrap; font-family: var(--mono); }
.talkers { display: flex; flex-direction: column; gap: 12px; }
.talker-top { display: flex; justify-content: space-between; gap: 10px; font-size: 11.5px; }
.talker-top b { color: var(--text); font-family: var(--mono); font-size: 11px; }
.talker-bar { height: 6px; border-radius: 999px; background: rgba(255, 255, 255, .08); overflow: hidden; margin: 5px 0 3px; }
.talker-bar i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #0a5f8f, var(--cyan)); }
.talker-bar.slim { margin: 0; width: 70px; height: 4px; }
.talker-sub { color: var(--dim); font-size: 10.5px; font-family: var(--mono); }
.stream { display: flex; flex-direction: column; max-height: 380px; overflow: auto; }
.stream-row { display: grid; grid-template-columns: 26px minmax(0, 1fr); gap: 10px; padding: 9px 2px; border-top: 1px solid var(--line); }
.stream-row:first-child { border-top: 0; }
.stream-sum { font-size: 11.5px; line-height: 1.35; color: #cfe2f7; overflow-wrap: anywhere; }
.stream-meta { display: flex; gap: 8px; align-items: center; margin-top: 4px; color: var(--dim); font-size: 10px; flex-wrap: wrap; }
.edge-state { display: flex; flex-wrap: wrap; gap: 6px; }
.health-list { display: flex; flex-direction: column; }
.health-row { display: flex; gap: 10px; align-items: flex-start; padding: 10px 0; border-top: 1px solid var(--line); }
.health-row:first-child { border-top: 0; padding-top: 0; }
.health-row .dot { margin-top: 5px; flex: none; }
.health-row b { display: block; font-size: 12.5px; font-weight: 600; }
.health-row span { display: block; color: var(--muted); font-size: 11.5px; margin-top: 2px; }
.dot.warn { background: var(--amber); box-shadow: 0 0 0 3px rgba(255, 176, 32, .14); }
.system-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; margin-top: 16px; }
.system-card { display: flex; gap: 14px; align-items: flex-start; color: var(--text); transition: border-color .15s ease, background .15s ease; }
.system-card:hover { color: var(--text); border-color: rgba(0, 180, 255, .32); background: linear-gradient(165deg, #0d0f12, #08090b); }
.system-card h3 { margin: 2px 0 4px; font-size: 14.5px; }
.system-card p { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.5; }
.system-icon {
  width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; flex: none;
  background: rgba(0, 180, 255, .09); color: var(--cyan); border: 1px solid rgba(0, 180, 255, .18);
}
.panel-details { padding: 0; overflow: hidden; margin-top: 16px; }
.panel-details > summary {
  cursor: pointer; list-style: none; padding: 16px 18px; font-size: 13px; font-weight: 600; color: var(--text);
  display: flex; align-items: center; gap: 8px;
}
.panel-details > summary::-webkit-details-marker { display: none; }
.panel-details > summary::before { content: "+"; color: var(--cyan2); font-weight: 400; width: 12px; }
.panel-details[open] > summary::before { content: "−"; }
.panel-details > summary:hover { color: var(--cyan2); }
.details-body { padding: 0 18px 18px; }
.details-split { display: flex; gap: 16px; align-items: flex-end; justify-content: space-between; flex-wrap: wrap; margin-top: 12px; }
.save-row { margin-bottom: 0; }
.mini-blocks, .mini-list { display: flex; flex-direction: column; gap: 2px; }
.mini-blocks > div, .mini-row { display: flex; align-items: center; gap: 9px; padding: 7px 0; border-top: 1px solid var(--line); font-size: 11.5px; }
.mini-blocks > div:first-child, .mini-row:first-child { border-top: 0; }
.mini-blocks em { margin-left: auto; font-style: normal; color: var(--dim); font-size: 10px; white-space: nowrap; }
.mini-row b { margin-left: auto; }
.empty { padding: 30px 14px; text-align: center; color: var(--dim); font-size: 12px; }
.empty.sm { padding: 14px 4px; text-align: left; }

/* tables */
.table-wrap { overflow: auto; border: 1px solid var(--line); border-radius: 12px; }
.table-wrap.tall { max-height: 620px; }
.table { width: 100%; border-collapse: collapse; font-size: 12px; }
.table th {
  position: sticky; top: 0; z-index: 2; text-align: left; font-size: 10px; text-transform: uppercase;
  letter-spacing: .1em; color: var(--dim); font-weight: 600; padding: 10px 12px;
  background: #0d0f12; border-bottom: 1px solid var(--line); white-space: nowrap;
}
.table td { padding: 10px 12px; border-top: 1px solid var(--line); vertical-align: top; }
.table td.mono { white-space: nowrap; word-break: normal; }
.table tbody tr:hover { background: rgba(0, 180, 255, .028); }
.table.compact td { padding: 8px 10px; }
.table tr.dim { opacity: .55; }
.table .actions, .table form { white-space: nowrap; }
.ev { margin-top: 3px; }
.ev summary { cursor: pointer; color: var(--cyan2); font-size: 10.5px; list-style: none; }
.ev summary::-webkit-details-marker { display: none; }
.ev summary::before { content: "+ "; }
.ev[open] summary::before { content: "− "; }
.ev pre {
  max-height: 220px; overflow: auto; background: #050607; border: 1px solid var(--line);
  padding: 9px; border-radius: 8px; font-size: 10.5px; color: #b9d4ee; margin: 6px 0 0; white-space: pre-wrap;
}
.footnote { margin: 12px 0 0; }
.filters { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.filter-row { display: flex; gap: 6px; flex-wrap: wrap; }
.filter-row.rules { margin-bottom: 14px; }
.search { min-width: 200px; }

/* forms */
input, select, textarea, button { font-family: inherit; font-size: 12.5px; }
input, select, textarea {
  width: 100%; background: #050607; color: var(--text); border: 1px solid var(--line2);
  border-radius: 9px; padding: 9px 11px; outline: none;
}
textarea::placeholder, input::placeholder { color: var(--dim); opacity: .62; }
input:focus, select:focus, textarea:focus { border-color: rgba(0, 180, 255, .55); box-shadow: 0 0 0 3px rgba(0, 180, 255, .12); }
textarea { resize: vertical; line-height: 1.5; }
.filters input, .filters select { width: auto; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; align-items: end; }
.form-grid.compact { gap: 10px; }
.form-grid label, .field { display: flex; flex-direction: column; gap: 6px; }
.form-grid label > span, .field > span { font-size: 10.5px; text-transform: uppercase; letter-spacing: .09em; color: var(--muted); }
.span2 { grid-column: span 2; }
.actions { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 4px; }
.actions.wrap { flex-wrap: wrap; }
.mt { margin-top: 12px; }
.btn {
  border: 1px solid var(--cyan); background: var(--cyan); color: var(--ink);
  padding: 9px 14px; border-radius: 9px; font-weight: 650; cursor: pointer; white-space: nowrap;
  transition: filter .15s, transform .05s;
}
.btn:hover { filter: brightness(1.08); }
.btn:active { transform: translateY(1px); }
.btn.ghost { background: transparent; color: var(--text); border-color: var(--line2); font-weight: 550; }
.btn.ghost:hover { border-color: rgba(0, 180, 255, .4); background: rgba(0, 180, 255, .06); }
.btn.sm { padding: 7px 11px; font-size: 11.5px; }
.btn.xs { padding: 4px 8px; font-size: 10.5px; border-radius: 7px; }
.btn.block { width: 100%; padding: 12px; font-size: 13.5px; }
.radio-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 14px; }
.radio-card {
  position: relative; display: flex; flex-direction: column; gap: 5px; padding: 13px;
  border: 1px solid var(--line); border-radius: 12px; cursor: pointer; background: rgba(255, 255, 255, .03);
}
.radio-card input { position: absolute; opacity: 0; }
.radio-card b { font-size: 13px; }
.radio-card span { font-size: 11px; color: var(--muted); }
.radio-card.on, .radio-card:has(input:checked) { border-color: rgba(0, 180, 255, .5); background: rgba(0, 180, 255, .07); }
.rules-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-bottom: 14px; }
.rule-card { border: 1px solid var(--line); border-radius: 12px; padding: 13px; background: rgba(255, 255, 255, .03); }
.rule-card header { display: flex; justify-content: space-between; gap: 10px; align-items: flex-start; margin-bottom: 11px; }
.rule-card h3 { margin: 0; font-size: 13px; }
.rule-card p { margin: 2px 0 0; font-size: 10.5px; color: var(--muted); }
.rule-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.rule-fields label { display: flex; flex-direction: column; gap: 4px; }
.rule-fields span { font-size: 9.5px; text-transform: uppercase; letter-spacing: .08em; color: var(--dim); }
.switch { position: relative; width: 38px; height: 21px; flex: none; }
.switch input { position: absolute; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.switch span { position: absolute; inset: 0; background: rgba(255, 255, 255, .16); border-radius: 999px; transition: .2s; }
.switch span::after { content: ""; position: absolute; width: 15px; height: 15px; border-radius: 50%; background: #cfe2f7; top: 3px; left: 3px; transition: .2s; }
.switch input:checked + span { background: rgba(46, 230, 168, .5); }
.switch input:checked + span::after { transform: translateX(17px); background: #fff; }
.steps { margin: 0; padding-left: 18px; color: var(--muted); font-size: 12px; line-height: 1.6; }
.steps b { color: var(--text); }
.code {
  background: #050607; border: 1px solid var(--line); border-radius: 10px; padding: 11px;
  overflow: auto; color: #b9d4ee; font-size: 10.5px; line-height: 1.6;
  white-space: pre-wrap; overflow-wrap: anywhere; margin: 0;
}
.token { display: block; overflow: auto; background: #050607; border: 1px solid var(--line); border-radius: 9px; padding: 9px 10px; color: #a9c3d9; }
.copy-row { display: flex; gap: 8px; align-items: center; }
.copy-row .token { flex: 1; min-width: 0; }
.listener-note { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; font-size: 10.5px; color: var(--muted); }
.listener-note code { max-width: 420px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* login */
.login-body { background: var(--bg); }
.login-shell { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, .95fr); min-height: 100vh; }
.login-aside {
  position: relative; overflow: hidden; display: flex; flex-direction: column; padding: 38px 46px;
  background:
    radial-gradient(700px 400px at 15% 8%, rgba(0, 180, 255, .06), transparent 60%),
    linear-gradient(155deg, #0b0d10, #050607 55%, #000000);
  border-right: 1px solid var(--line);
}
.login-aside::after {
  content: ""; position: absolute; inset: auto -20% -30% -20%; height: 60%;
  background: radial-gradient(closest-side, rgba(0, 180, 255, .12), transparent);
}
.login-aside .brand { padding: 0; position: relative; z-index: 2; }
.login-aside .brand-badge { width: 48px; height: 48px; border-radius: 13px; }
.login-aside .brand-badge img { width: 38px; height: 38px; }
.login-aside .brand-text b { color: #fff; font-size: 18px; }
.login-copy { position: relative; z-index: 2; margin: auto 0; max-width: 520px; padding: 40px 0; }
.login-copy h1 { font-size: clamp(32px, 4.2vw, 52px); line-height: 1.04; letter-spacing: -.035em; margin: 12px 0 18px; font-weight: 700; }
.login-copy p { color: #aeb6c0; font-size: 14px; line-height: 1.6; max-width: 460px; }
.checks { list-style: none; padding: 0; margin: 26px 0 0; display: flex; flex-direction: column; gap: 10px; color: #d6dae0; font-size: 12.5px; }
.checks li { display: flex; gap: 10px; align-items: flex-start; }
.checks li::before { content: ""; width: 7px; height: 7px; margin-top: 5px; border-radius: 50%; background: var(--cyan); box-shadow: 0 0 0 3px rgba(0, 180, 255, .16); flex: none; }
.login-foot { position: relative; z-index: 2; color: #7d8792; font-size: 11px; display: flex; align-items: center; gap: 8px; letter-spacing: .04em; }
.login-main { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 34px 22px; }
.pin-card {
  width: min(400px, 100%); padding: 26px; border-radius: 16px; border: 1px solid var(--line);
  background: linear-gradient(170deg, #0d0f12, #050607);
  box-shadow: 0 30px 80px rgba(0, 0, 0, .7);
}
.pin-head { display: flex; gap: 13px; align-items: center; margin-bottom: 20px; }
.pin-head h2 { margin: 3px 0 0; font-size: 22px; letter-spacing: -.02em; }
.shield { width: 46px; height: 46px; border-radius: 13px; display: grid; place-items: center; color: var(--cyan); background: rgba(0, 180, 255, .1); border: 1px solid rgba(0, 180, 255, .3); }
.shield .ic { width: 24px; height: 24px; }
.pin-card .field { margin-bottom: 14px; }
.pin-card .field input { font-size: 14px; }
.pin-dots { display: flex; gap: 11px; padding: 15px 4px 6px; justify-content: center; }
.pin-dots i { width: 13px; height: 13px; border-radius: 50%; border: 1px solid var(--line2); background: rgba(255, 255, 255, .05); transition: .15s; }
.pin-dots i.on { background: var(--cyan); border-color: var(--cyan); box-shadow: 0 0 12px rgba(0, 180, 255, .5); }
.pin-dots.shake { animation: shake .35s; }
@keyframes shake { 20%, 60% { transform: translateX(-6px); } 40%, 80% { transform: translateX(6px); } }
.keypad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 8px 0 16px; }
.keypad button {
  padding: 14px 0; border-radius: 11px; border: 1px solid var(--line); color: var(--text);
  background: linear-gradient(180deg, rgba(20, 23, 28, .95), rgba(8, 9, 11, .97));
  font-size: 17px; font-weight: 600; cursor: pointer; font-family: var(--mono);
}
.keypad button:hover { border-color: rgba(0, 180, 255, .4); background: rgba(0, 180, 255, .08); }
.keypad button:active { transform: translateY(1px); }
.keypad .key-fn { font-size: 11px; font-family: var(--sans); color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.login-footer { margin-top: 20px; color: var(--dim); font-size: 10.5px; text-align: center; }

@media (max-width: 1180px) {
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-2, .grid-2.tight { grid-template-columns: minmax(0, 1fr); }
  .facts.cols { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 860px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .kpis.three { grid-template-columns: 1fr; }
  .status-hero { flex-wrap: wrap; padding: 18px; gap: 14px; }
  .status-hero .hero-actions { margin-left: 0; width: 100%; }
  .status-hero h2 { font-size: 22px; }
  .system-grid { grid-template-columns: 1fr; }
  .sidebar {
    position: sticky; top: 0; height: auto; padding: 10px 14px 0; border-right: 0; border-bottom: 1px solid var(--line);
    flex-direction: row; flex-wrap: wrap; align-items: center; gap: 8px; overflow: visible;
    min-width: 0; max-width: 100vw;
  }
  .brand { padding: 0; flex: none; }
  .brand-badge { width: 34px; height: 34px; border-radius: 9px; }
  .brand-badge img { width: 27px; height: 27px; }
  .brand-text b { font-size: 13px; }
  .brand-text span { font-size: 9px; }
  .nav { flex-direction: row; flex-wrap: wrap; gap: 2px; width: 100%; min-width: 0; flex: 1 1 100%; padding-bottom: 8px; }
  .nav a { padding: 8px 9px; font-size: 11.5px; white-space: nowrap; gap: 6px; }
  .nav a .ic { width: 15px; height: 15px; }
  .side-foot { display: none; }
  .topbar { position: static; padding: 14px 16px; flex-wrap: wrap; }
  .topbar h1 { font-size: 21px; }
  .who-meta, .mode-pill { display: none; }
  .content { padding: 16px; }
  .flash { margin: 0 16px 12px; }
  .foot { padding: 12px 16px 20px; }
  .login-shell { grid-template-columns: 1fr; }
  .login-aside { padding: 26px 22px; min-height: 0; border-right: 0; border-bottom: 1px solid var(--line); }
  .login-copy { padding: 22px 0 6px; margin: 0; }
  .login-copy h1 { font-size: 32px; margin: 8px 0 12px; }
  .checks { display: none; }
  .login-foot { display: none; }
  .login-main { padding: 22px 16px 30px; }
  .pin-card { padding: 20px; }
  .rules-grid { grid-template-columns: 1fr; }
  .form-grid { grid-template-columns: 1fr; }
  .span2 { grid-column: span 1; }
  .radio-row { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .kpis { gap: 10px; }
  .kpi-val b { font-size: 25px; }
  .chart { height: 110px; }
  .spark { height: 72px; }
  .facts, .facts.cols { grid-template-columns: 1fr 1fr; }
  .table th, .table td, .table.compact th, .table.compact td { padding: 7px; }
  .table .col-extra, .table .col-sev, .table .col-action, .mobile-only { display: none; }
  .sev.mobile-only { display: inline-grid; margin-right: 6px; vertical-align: middle; }
  .status.mobile-only { display: inline-block; margin-top: 5px; }
  .list-row { grid-template-columns: 26px minmax(0, 1fr) auto; }
  .list-row time { display: none; }
  .keypad button { padding: 12px 0; }
}
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}
