/* Sentinel UI — dark, Roweb red accent. No inline styles anywhere (CSP: style-src 'self'). */
@font-face {
  font-family: "Inter"; font-style: normal; font-weight: 100 900; font-display: swap;
  src: url("/static/fonts/inter-var.woff2") format("woff2");
}
:root {
  --bg: #080c17; --bg2: #0b1120; --panel: #0f1628; --panel2: #131c32; --line: #1d2842; --line2: #2a3758;
  --text: #e8edf6; --muted: #8592ab; --dim: #5d6a85;
  --brand: #ed4142; --brand2: #ff5a5b; --link: #8ab4ff;
  --p1: #ff4d5e; --p2: #ff9a3c; --p3: #f2c94c; --p4: #5d7bb5; --ok: #2dd4a7; --none: #46506a;
  --radius: 14px; --shadow: 0 1px 0 rgba(255,255,255,.03) inset, 0 10px 30px -12px rgba(0,0,0,.6);
}
* { box-sizing: border-box; }
html { background: var(--bg); color: var(--text); font: 14px/1.5 "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
       font-feature-settings: "cv11", "ss01"; -webkit-font-smoothing: antialiased; }
body { margin: 0; min-height: 100vh; }
a { color: var(--link); text-decoration: none; }
a:hover { color: #b5cfff; }
code, .mono { font-family: ui-monospace, "JetBrains Mono", "SFMono-Regular", Menlo, monospace; font-size: 12.5px; }
.num { font-variant-numeric: tabular-nums; }
h1 { font-size: 26px; line-height: 1.2; margin: 0; font-weight: 750; letter-spacing: -.02em; }
h2 { font-size: 15px; margin: 0; font-weight: 650; letter-spacing: -.01em; }
h3 { font-size: 11.5px; margin: 0; font-weight: 650; color: var(--dim); text-transform: uppercase; letter-spacing: .1em; }
p { margin: 0; }
.muted { color: var(--muted); }
.dim { color: var(--dim); }
.small { font-size: 12px; }
.tiny { font-size: 11px; }
.error { color: var(--p1); }
.ok { color: var(--ok); }
.hot { color: var(--p1); font-weight: 650; }
.warm { color: var(--p2); }
.clip { max-width: 440px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nowrap { white-space: nowrap; }
.right { text-align: right; }
.row { display: flex; align-items: center; gap: 10px; }
.stack { display: flex; flex-direction: column; gap: 4px; }

/* ---------- shell ---------- */
.shell { display: grid; grid-template-columns: 248px 1fr; min-height: 100vh; }
.side { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; gap: 6px; padding: 20px 14px 16px;
        background: linear-gradient(180deg, #0c1222 0%, #090e1a 100%); border-right: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 11px; padding: 2px 8px 18px; color: var(--text); }
.brand:hover { color: var(--text); }
.brand img { width: 34px; height: 34px; }
.brand b { display: block; font-size: 19px; font-weight: 800; letter-spacing: -.03em; line-height: 1.05; }
.brand small { display: block; font-size: 9.5px; font-weight: 600; letter-spacing: .16em; color: var(--muted); text-transform: uppercase; }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav .group { margin: 14px 10px 6px; font-size: 10.5px; font-weight: 650; letter-spacing: .12em; text-transform: uppercase; color: var(--dim); }
.nav a { display: flex; align-items: center; gap: 11px; padding: 8px 10px; border-radius: 9px; color: #aab5ca; font-weight: 500; }
.nav a svg { width: 18px; height: 18px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; opacity: .85; }
.nav a:hover { background: rgba(255,255,255,.04); color: var(--text); }
.nav a.on { background: linear-gradient(90deg, rgba(237,65,66,.16), rgba(237,65,66,.04)); color: #fff; box-shadow: inset 2px 0 0 var(--brand); }
.nav a.on svg { stroke: var(--brand2); opacity: 1; }
.nav a .count { margin-left: auto; font-size: 11px; font-weight: 700; padding: 1px 7px; border-radius: 20px; background: rgba(255,77,94,.16); color: #ff9aa4; }
.side .foot { margin-top: auto; display: flex; flex-direction: column; gap: 14px; }
.me { display: flex; align-items: center; gap: 10px; padding: 10px; border: 1px solid var(--line); border-radius: 12px; background: rgba(255,255,255,.02); }
.avatar { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; font-size: 13px;
          background: linear-gradient(135deg, #ff5a5b, #a8232b); color: #fff; flex: none; text-transform: uppercase; }
.avatar.sm { width: 28px; height: 28px; font-size: 11.5px; }
.avatar.alt { background: linear-gradient(135deg, #6b86c4, #34477a); }
.me .who { flex: 1; min-width: 0; line-height: 1.25; }
.me .who b { display: block; font-size: 13px; overflow: hidden; text-overflow: ellipsis; }
.me .who span { font-size: 11px; color: var(--muted); }
.me form { margin: 0; }
.iconbtn { background: none; border: 1px solid transparent; color: var(--muted); padding: 6px; border-radius: 8px; cursor: pointer; display: grid; place-items: center; box-shadow: none; }
.iconbtn:hover { color: var(--text); border-color: var(--line2); background: rgba(255,255,255,.03); filter: none; }
.iconbtn svg { width: 17px; height: 17px; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.partof { display: flex; align-items: center; gap: 9px; padding: 0 8px; font-size: 9.5px; color: var(--dim); letter-spacing: .1em; text-transform: uppercase; }
.partof img { height: 24px; width: auto; opacity: .92; }

.main { min-width: 0; display: flex; flex-direction: column; }
.topbar { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: 16px; padding: 13px 32px;
          background: rgba(8,12,23,.85); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.crumbs { font-size: 13px; color: var(--muted); display: flex; gap: 8px; align-items: center; min-width: 0; white-space: nowrap; }
.crumbs a { color: var(--muted); }
.crumbs a:hover { color: var(--text); }
.crumbs b { color: var(--text); font-weight: 600; overflow: hidden; text-overflow: ellipsis; }
.search { margin: 0 0 0 auto; position: relative; }
.search input { width: 300px; padding: 7px 12px 7px 34px; border-radius: 10px; background: var(--panel); }
.search svg { position: absolute; left: 11px; top: 50%; width: 15px; height: 15px; transform: translateY(-50%); stroke: var(--muted); fill: none; stroke-width: 2; stroke-linecap: round; }
.serverswitch { display: flex; align-items: center; gap: 8px; margin: 0; }
.serverswitch svg { width: 15px; height: 15px; stroke: var(--muted); fill: none; stroke-width: 2; stroke-linecap: round; }
.serverswitch select { padding: 6px 10px; border-radius: 10px; background: var(--panel); }
.scanchip { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--muted); padding: 6px 12px; border: 1px solid var(--line); border-radius: 20px; white-space: nowrap; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 3px rgba(45,212,167,.15); flex: none; }
.dot.stale { background: var(--p2); box-shadow: 0 0 0 3px rgba(255,154,60,.15); }
.content { padding: 28px 32px 60px; max-width: 1480px; width: 100%; }
.pagehead { display: flex; align-items: flex-end; gap: 20px; margin-bottom: 24px; flex-wrap: wrap; }
.pagehead .stack { gap: 6px; max-width: 760px; }
.pagehead .actions { margin-left: auto; display: flex; gap: 10px; align-items: center; }
.eyebrow { font-size: 11.5px; font-weight: 650; letter-spacing: .12em; text-transform: uppercase; color: var(--brand2); }

/* ---------- cards & grid ---------- */
.grid12 { display: grid; grid-template-columns: repeat(12, 1fr); gap: 16px; }
.c3 { grid-column: span 3; } .c4 { grid-column: span 4; } .c5 { grid-column: span 5; } .c6 { grid-column: span 6; }
.c7 { grid-column: span 7; } .c8 { grid-column: span 8; } .c12 { grid-column: span 12; }
.card { background: linear-gradient(180deg, var(--panel2) 0%, var(--panel) 100%); border: 1px solid var(--line); border-radius: var(--radius);
        padding: 20px; box-shadow: var(--shadow); min-width: 0; }
.card.flush { padding: 0; overflow: hidden; }
.cardhead { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.card.flush > .cardhead { padding: 18px 20px 14px; margin: 0; }
.cardhead .sub { font-size: 12px; color: var(--muted); }
.cardhead .more { margin-left: auto; font-size: 12.5px; font-weight: 550; white-space: nowrap; }
.section { margin-top: 28px; }
.section > .cardhead { align-items: baseline; margin-bottom: 12px; }

/* hero */
.hero { position: relative; overflow: hidden; display: grid; grid-template-columns: 1.3fr 1fr; gap: 24px; align-items: center; padding: 28px;
        background: radial-gradient(800px 320px at 0% 0%, rgba(237,65,66,.2), transparent 60%),
                    radial-gradient(600px 300px at 100% 100%, rgba(93,123,181,.14), transparent 60%),
                    linear-gradient(180deg, #141d35, #0f1628); }
.hero::after { content: ""; position: absolute; right: -50px; top: -50px; width: 280px; height: 280px; opacity: .045;
               background: url("/static/img/sentinel-mark.svg") no-repeat center / contain; pointer-events: none; }
.hero .label { font-size: 12px; color: var(--muted); font-weight: 600; letter-spacing: .1em; text-transform: uppercase; }
.hero .big { display: flex; align-items: baseline; gap: 14px; margin: 6px 0 10px; }
.hero .big b { font-size: 68px; font-weight: 800; letter-spacing: -.045em; line-height: 1; font-variant-numeric: tabular-nums; }
.hero .big .of { font-size: 14px; color: var(--muted); }
.hero .verdict { font-size: 15px; color: #c9d2e3; max-width: 600px; }
.hero .verdict strong { color: #fff; }
.hero .chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; }
.chip { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; padding: 4px 10px; border-radius: 20px; background: rgba(255,255,255,.05);
        border: 1px solid var(--line2); color: #c3cbdb; white-space: nowrap; }
.chip.warn { border-color: rgba(255,154,60,.45); color: #ffc08a; background: rgba(255,154,60,.08); }
.chip.bad { border-color: rgba(255,77,94,.45); color: #ff9aa4; background: rgba(255,77,94,.08); }
.chip.good { border-color: rgba(45,212,167,.4); color: #7fe8cb; background: rgba(45,212,167,.07); }
.donutwrap { display: flex; align-items: center; gap: 26px; justify-content: flex-end; position: relative; z-index: 1; }
.donut { width: 172px; height: 172px; flex: none; }
.donut .track { stroke: rgba(255,255,255,.06); }
.donut text.n { font-size: 25px; font-weight: 800; fill: var(--text); letter-spacing: -.03em; text-anchor: middle; }
.donut text.l { font-size: 8.5px; fill: var(--muted); letter-spacing: .14em; text-anchor: middle; font-weight: 600; }
.legend { display: flex; flex-direction: column; gap: 10px; min-width: 200px; }
.legend a { display: grid; grid-template-columns: 12px 1fr auto; align-items: center; gap: 10px; color: #c3cbdb; font-size: 13px; }
.legend a:hover { color: #fff; }
.legend b { font-variant-numeric: tabular-nums; font-weight: 700; }
.legend small { display: block; font-size: 11px; color: var(--dim); }
.sw { width: 10px; height: 10px; border-radius: 3px; }

/* KPI tiles */
.kpis { display: grid; grid-template-columns: repeat(6, 1fr); gap: 16px; margin-top: 16px; }
.kpi { display: flex; flex-direction: column; gap: 6px; padding: 16px 18px; color: var(--text); position: relative; overflow: hidden; }
a.kpi:hover { border-color: var(--line2); color: var(--text); }
.kpi .k { font-size: 12px; color: var(--muted); font-weight: 550; }
.kpi .v { font-size: 30px; font-weight: 780; letter-spacing: -.03em; line-height: 1.05; font-variant-numeric: tabular-nums; }
.kpi .d { font-size: 11.5px; color: var(--dim); }
.kpi::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: transparent; }
.kpi.k1::before { background: var(--p1); } .kpi.k2::before { background: var(--p2); } .kpi.k3::before { background: var(--p3); }
.kpi.kok::before { background: var(--ok); } .kpi.kb::before { background: var(--p4); }

/* layer cards */
.layers { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.layer { display: flex; flex-direction: column; gap: 12px; color: var(--text); }
a.layer:hover, a.area:hover { border-color: #34436a; color: var(--text); }
.layer .top { display: flex; align-items: flex-start; gap: 12px; }
.ico { width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; background: rgba(255,255,255,.05); border: 1px solid var(--line2); flex: none; }
.ico svg { width: 20px; height: 20px; stroke: #c3cbdb; fill: none; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.layer .desc { font-size: 12px; color: var(--muted); }

/* score badge */
.score { margin-left: auto; display: inline-flex; flex-direction: column; align-items: flex-end; line-height: 1; flex: none; }
.score b { font-size: 24px; font-weight: 800; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.score span { font-size: 9px; letter-spacing: .14em; text-transform: uppercase; color: var(--dim); margin-top: 4px; font-weight: 650; }
.lv-p1 { color: var(--p1); } .lv-p2 { color: var(--p2); } .lv-p3 { color: var(--p3); } .lv-p4 { color: #8fa7d8; }
.lv-ok { color: var(--ok); } .lv-none { color: var(--dim); }
.pill { display: inline-flex; align-items: center; justify-content: center; min-width: 38px; padding: 2px 9px; border-radius: 20px; font-size: 12px; font-weight: 780;
        font-variant-numeric: tabular-nums; border: 1px solid transparent; }
.pill.lv-p1 { background: rgba(255,77,94,.14); border-color: rgba(255,77,94,.38); }
.pill.lv-p2 { background: rgba(255,154,60,.13); border-color: rgba(255,154,60,.35); }
.pill.lv-p3 { background: rgba(242,201,76,.12); border-color: rgba(242,201,76,.32); }
.pill.lv-p4 { background: rgba(93,123,181,.14); border-color: rgba(93,123,181,.38); }
.pill.lv-ok { background: rgba(45,212,167,.12); border-color: rgba(45,212,167,.32); }
.pill.lv-none { background: rgba(255,255,255,.04); border-color: var(--line2); }

/* priority counters */
.counts { display: flex; gap: 6px; flex-wrap: wrap; }
.cnt { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-variant-numeric: tabular-nums; padding: 2px 8px 2px 7px; border-radius: 7px;
       background: rgba(255,255,255,.035); border: 1px solid var(--line); color: #c3cbdb; white-space: nowrap; }
.cnt i { width: 7px; height: 7px; border-radius: 2px; display: inline-block; }
.cnt.zero { opacity: .35; }
.cnt b { font-weight: 700; }
.bg-p1 { background: var(--p1); } .bg-p2 { background: var(--p2); } .bg-p3 { background: var(--p3); } .bg-p4 { background: var(--p4); }
.bg-ok { background: var(--ok); } .bg-none { background: var(--none); }

/* svg bars */
svg.bar { display: block; width: 100%; height: 8px; border-radius: 4px; }
svg.bar .track { fill: rgba(255,255,255,.055); }
.f-p1 { fill: var(--p1); } .f-p2 { fill: var(--p2); } .f-p3 { fill: var(--p3); } .f-p4 { fill: var(--p4); }
.f-ok { fill: var(--ok); } .f-none { fill: var(--none); }
.s-p1 { stroke: var(--p1); } .s-p2 { stroke: var(--p2); } .s-p3 { stroke: var(--p3); } .s-p4 { stroke: var(--p4); }

/* hotspot list */
.hot-list { display: flex; flex-direction: column; }
.hot-item { display: grid; grid-template-columns: 22px minmax(130px, 1fr) minmax(120px, 1.6fr) auto; align-items: center; gap: 16px; padding: 11px 20px; color: var(--text);
            border-top: 1px solid var(--line); }
.hot-item:hover { background: rgba(255,255,255,.025); color: var(--text); }
.hot-item .rank { font-size: 12px; color: var(--dim); font-weight: 700; font-variant-numeric: tabular-nums; }
.hot-item .name { min-width: 0; }
.hot-item .name b { display: block; font-weight: 650; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hot-item .name span { font-size: 11.5px; color: var(--muted); }
.hot-item .bars { display: flex; flex-direction: column; gap: 6px; }

/* trend */
.trend { width: 100%; height: 170px; display: block; }
.trend .gl { stroke: rgba(255,255,255,.05); }
.trend .ax { fill: var(--dim); font-size: 10px; }
.trend .area { fill: url(#tg); }
.trend .line { fill: none; stroke: var(--brand2); stroke-width: 2.2; stroke-linejoin: round; stroke-linecap: round; }
.trend .line2 { fill: none; stroke: var(--p2); stroke-width: 1.6; stroke-dasharray: 3 4; }
.trend .pt { fill: var(--bg); stroke: var(--brand2); stroke-width: 2; }
.trend .stop1 { stop-color: var(--brand2); stop-opacity: .35; }
.trend .stop2 { stop-color: var(--brand2); stop-opacity: 0; }
.empty { padding: 28px; text-align: center; color: var(--muted); font-size: 13px; }

/* tables */
table.grid { width: 100%; border-collapse: separate; border-spacing: 0; }
.grid th, .grid td { padding: 10px 14px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: middle; }
.grid th { color: var(--dim); font-weight: 650; font-size: 10.5px; text-transform: uppercase; letter-spacing: .08em; background: rgba(0,0,0,.2); white-space: nowrap; }
.grid tr:last-child td { border-bottom: 0; }
.grid tbody tr:hover { background: rgba(255,255,255,.022); }
.grid td.vid a { font-weight: 650; color: var(--text); }
.grid td.vid a:hover { color: var(--link); }
.grid td.vid .clip { max-width: 520px; margin-top: 2px; }
.tablewrap { background: linear-gradient(180deg, var(--panel2), var(--panel)); border: 1px solid var(--line); border-radius: var(--radius); overflow: auto; box-shadow: var(--shadow); }
.prio { display: inline-flex; align-items: center; justify-content: center; min-width: 30px; border-radius: 7px; padding: 2px 7px; font-weight: 800; font-size: 11.5px; letter-spacing: .02em; }
.prio.p1 { background: var(--p1); color: #fff; box-shadow: 0 0 0 3px rgba(255,77,94,.16); }
.prio.p2 { background: var(--p2); color: #2a1300; }
.prio.p3 { background: var(--p3); color: #2a2000; }
.prio.p4 { background: #26334f; color: #9fb0cf; }
.sev { font-size: 11.5px; font-weight: 650; letter-spacing: .02em; }
.sev.critical { color: var(--p1); } .sev.high { color: var(--p2); } .sev.medium { color: var(--p3); }
.sev.low, .sev.unknown { color: var(--muted); }
.kev { display: inline-block; background: rgba(255,77,94,.15); color: #ffb0b8; border: 1px solid rgba(255,77,94,.55); border-radius: 6px; padding: 0 6px; font-size: 10px; font-weight: 800; letter-spacing: .06em; vertical-align: 1px; }
.tag { display: inline-block; font-size: 11px; padding: 1px 7px; border-radius: 6px; background: rgba(255,255,255,.05); border: 1px solid var(--line2); color: #b7c1d4; white-space: nowrap; }
.tag.red { color: #ff9aa4; border-color: rgba(255,77,94,.45); background: rgba(255,77,94,.08); }
.tag.green { color: #7fe8cb; border-color: rgba(45,212,167,.4); background: rgba(45,212,167,.07); }
.tag.blue { color: #a9c3f5; border-color: rgba(93,123,181,.5); background: rgba(93,123,181,.1); }
.tag.orange { color: #ffc08a; border-color: rgba(255,154,60,.45); background: rgba(255,154,60,.08); }
.tags { display: flex; gap: 5px; flex-wrap: wrap; }
.kevbox { background: rgba(255,77,94,.08); border: 1px solid rgba(255,77,94,.45); border-radius: 12px; padding: 12px 16px; color: #ffd0d5; margin-top: 16px; }
.xpl { display: inline-block; background: rgba(255,154,60,.12); color: #ffc08a; border: 1px solid rgba(255,154,60,.5); border-radius: 6px; padding: 0 6px; font-size: 10px; font-weight: 800; letter-spacing: .06em; vertical-align: 1px; }
.xplbox { background: rgba(255,154,60,.07); border: 1px solid rgba(255,154,60,.4); border-radius: 12px; padding: 12px 16px; color: #ffd9b8; margin-top: 16px; }
.xplbox a { color: #ffc08a; }
.eol-eol { color: var(--p1); font-weight: 650; } .eol-ending { color: var(--p2); font-weight: 650; }
.eol-supported { color: #7fe8cb; } .eol-unknown { color: var(--muted); }

/* forms */
label { display: flex; flex-direction: column; gap: 6px; color: var(--muted); font-size: 12.5px; font-weight: 550; }
label.check { flex-direction: row; align-items: center; gap: 8px; color: #c3cbdb; padding-bottom: 9px; }
input, select { background: #0a1020; color: var(--text); border: 1px solid var(--line2); border-radius: 9px; padding: 9px 12px; font: inherit; font-size: 14px; }
input::placeholder { color: var(--dim); }
input:focus, select:focus { outline: none; border-color: rgba(237,65,66,.7); box-shadow: 0 0 0 3px rgba(237,65,66,.15); }
input[type=checkbox] { accent-color: var(--brand); width: 15px; height: 15px; padding: 0; }
button, .btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; background: linear-gradient(180deg, #f04b4c, #d63435); color: #fff; border: 0;
               border-radius: 10px; padding: 9px 16px; font: inherit; font-weight: 650; font-size: 13.5px; cursor: pointer; white-space: nowrap;
               box-shadow: 0 1px 0 rgba(255,255,255,.15) inset, 0 6px 16px -6px rgba(237,65,66,.6); }
button:hover, .btn:hover { filter: brightness(1.08); color: #fff; }
button.ghost, .btn.ghost { background: rgba(255,255,255,.04); border: 1px solid var(--line2); color: #d4dbea; box-shadow: none; }
button.ghost:hover, .btn.ghost:hover { background: rgba(255,255,255,.08); }
button.danger { background: rgba(255,77,94,.1); border: 1px solid rgba(255,77,94,.5); color: #ff9aa4; box-shadow: none; }
button.sm, .btn.sm { padding: 5px 10px; font-size: 12px; border-radius: 8px; }
button.link { background: none; color: var(--link); padding: 0; font-weight: 500; box-shadow: none; }
.filters { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px; padding: 16px 18px; margin-bottom: 16px; }
.filters .q { flex: 1; min-width: 220px; }
.filters .q input { width: 100%; }
.inline { display: inline-flex; margin: 0; }
.actions-cell { display: flex; gap: 6px; justify-content: flex-end; flex-wrap: wrap; }
.formgrid { display: grid; grid-template-columns: 1fr 1.4fr 160px auto; gap: 12px; align-items: end; }
.notice { padding: 12px 16px; border-radius: 12px; border: 1px solid rgba(45,212,167,.4); background: rgba(45,212,167,.07); color: #a8f0dc; margin-bottom: 16px; font-size: 13.5px; }
.notice.bad { border-color: rgba(255,77,94,.45); background: rgba(255,77,94,.08); color: #ffc2c8; }
.notice .copy { display: flex; gap: 8px; margin-top: 10px; }
.notice .copy input { flex: 1; font-family: ui-monospace, monospace; font-size: 12px; }

/* facts */
.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 18px; }
.fact { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.fact .k { font-size: 10.5px; color: var(--dim); text-transform: uppercase; letter-spacing: .09em; font-weight: 650; }
.fact .v { font-size: 18px; font-weight: 720; font-variant-numeric: tabular-nums; overflow: hidden; text-overflow: ellipsis; }
.links { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 18px; }

/* warnings */
.warnlist { display: flex; flex-direction: column; gap: 10px; margin: 0; padding: 0; list-style: none; }
.warnlist li { display: flex; gap: 10px; align-items: flex-start; font-size: 13px; color: #d4dbea; }
.warnlist li::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--p2); margin-top: 7px; flex: none; }
.warnlist li.bad::before { background: var(--p1); }
.warnlist li.good::before { background: var(--ok); }

/* area cards */
.areas { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 16px; }
.area { display: flex; flex-direction: column; gap: 14px; color: var(--text); }
.area .top { display: flex; gap: 12px; align-items: flex-start; }
.area .name { min-width: 0; }
.area .name b { display: block; font-size: 16px; font-weight: 720; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; letter-spacing: -.01em; }
.area .name span { font-size: 11.5px; color: var(--muted); }
.area .meta { display: flex; gap: 14px; font-size: 12px; color: var(--muted); flex-wrap: wrap; }
.area .meta b { color: var(--text); font-weight: 650; }
.area.idle { opacity: .5; }

/* infrastructure map */
.mapcard { padding: 0; overflow: auto; }
.mapbar { display: flex; gap: 18px; align-items: center; padding: 14px 20px; border-bottom: 1px solid var(--line); flex-wrap: wrap; font-size: 12px; color: var(--muted); }
.mapbar .lg { display: inline-flex; align-items: center; gap: 7px; }
.mapbar .sep { width: 1px; height: 16px; background: var(--line2); }
.lnk { width: 22px; height: 2px; display: inline-block; background: rgba(237,65,66,.7); }
.lnk.int { background: none; border-top: 2px dashed #4a5878; height: 0; }
svg.map { display: block; min-width: 1180px; width: 100%; height: auto; font-family: "Inter", system-ui, sans-serif; }
svg.map .colh { fill: var(--dim); font-size: 10.5px; font-weight: 700; letter-spacing: .14em; }
svg.map .colsub { fill: #48546f; font-size: 10px; }
svg.map .edge { fill: none; stroke: #33415f; stroke-width: 1.4; }
svg.map .edge.pub { stroke: rgba(237,65,66,.6); stroke-width: 1.8; }
svg.map .edge.ssh { stroke: rgba(255,154,60,.55); stroke-width: 1.6; }
svg.map .edge.wk { stroke: #27324d; stroke-width: 1.1; }
svg.map .edge.bus { stroke: #34405e; stroke-width: 1.4; stroke-dasharray: 2 5; }
svg.map .box { fill: #111a30; stroke: #27334f; stroke-width: 1.2; }
svg.map a:hover .box { fill: #17223f; stroke: #44557f; }
svg.map .dashed .box { stroke-dasharray: 5 4; }
svg.map .t { fill: var(--text); font-size: 13px; font-weight: 650; }
svg.map .s { fill: var(--muted); font-size: 10.5px; }
svg.map .wk .t { font-size: 11.5px; font-weight: 550; }
svg.map .wk .box { fill: #0e1629; }
svg.map .sc { stroke-width: 2.2; fill: #0a1120; }
svg.map .scn { font-size: 11px; font-weight: 800; text-anchor: middle; }
svg.map .internet .box { fill: rgba(237,65,66,.09); stroke: rgba(237,65,66,.55); }
svg.map .found .box { fill: #101a33; stroke: #2e3c60; }
svg.map .vh { fill: #8e9bb6; font-size: 9.5px; }
svg.map .st-p1 { stroke: var(--p1); } svg.map .st-p2 { stroke: var(--p2); } svg.map .st-p3 { stroke: var(--p3); }
svg.map .st-p4 { stroke: var(--p4); } svg.map .st-ok { stroke: var(--ok); } svg.map .st-none, svg.map .st-host { stroke: var(--none); }
svg.map .fl-p1 { fill: var(--p1); } svg.map .fl-p2 { fill: var(--p2); } svg.map .fl-p3 { fill: var(--p3); }
svg.map .fl-p4 { fill: #8fa7d8; } svg.map .fl-ok { fill: var(--ok); } svg.map .fl-none, svg.map .fl-host { fill: var(--muted); }
svg.map .glow { filter: drop-shadow(0 0 5px rgba(255,77,94,.6)); }

/* auth pages */
.auth { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 24px;
        background: radial-gradient(900px 520px at 50% -10%, rgba(237,65,66,.17), transparent 60%), var(--bg); }
.authcard { width: 100%; max-width: 400px; display: flex; flex-direction: column; gap: 16px; padding: 32px; }
.authcard .brand { padding: 0 0 6px; justify-content: center; }
.authcard .brand img { width: 44px; height: 44px; }
.authcard .brand b { font-size: 24px; }
.authcard h1 { font-size: 19px; text-align: center; }
.authcard p.lead { text-align: center; color: var(--muted); font-size: 13px; }
.authcard button { width: 100%; padding: 11px; }
.authfoot { margin-top: 22px; display: flex; justify-content: center; align-items: center; gap: 9px; font-size: 10px; color: var(--dim); letter-spacing: .1em; text-transform: uppercase; }
.authfoot img { height: 22px; }
.qr { width: 210px; height: 210px; align-self: center; border-radius: 12px; border: 1px solid var(--line2); }

/* helpers used by the page templates */
.grid td.nowrapc .counts { flex-wrap: nowrap; }
.grid td.nowrapc { min-width: 250px; }
.grid td.clip { max-width: 260px; }
.center { text-align: center; }
.row.between { justify-content: space-between; }
.row.gap { gap: 8px; }
.stack.gap { gap: 10px; }
.mt { margin-top: 22px; }
.spacer { height: 20px; } .spacer.sm { height: 10px; }
.lg { display: inline-flex; align-items: center; gap: 7px; }
.lnk.ssh { background: rgba(255,154,60,.75); }
.lnk.dashed2 { background: none; border-top: 2px dashed var(--p2); height: 0; }
.empty.big { padding: 60px 28px; display: flex; flex-direction: column; align-items: center; gap: 10px; }
.emptymark { width: 64px; height: 64px; opacity: .8; }
.ico.sm { width: 26px; height: 26px; border-radius: 8px; }
.ico.sm svg { width: 15px; height: 15px; }
.grid td.bars { min-width: 200px; }
.grid td.bars .counts { margin-top: 6px; }
.split { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line); }
.split > div { display: flex; flex-direction: column; gap: 8px; }
.split .k { display: inline-flex; align-items: center; gap: 7px; font-size: 12px; color: var(--muted); font-weight: 600; }
.split .k svg { width: 15px; height: 15px; stroke: var(--muted); fill: none; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
dl.kv { display: grid; grid-template-columns: 110px 1fr; gap: 10px 14px; margin: 0; font-size: 13px; }
dl.kv dt { color: var(--dim); font-size: 11.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; padding-top: 2px; }
dl.kv dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.authcard.wide { max-width: 440px; }
.authcard code { font-size: 13px; letter-spacing: .06em; color: var(--text); word-break: break-all; }
input.otp { font-size: 22px; letter-spacing: .4em; text-align: center; font-variant-numeric: tabular-nums; padding: 10px; }
input[readonly] { color: var(--muted); }
.section0 { margin-top: 0; }
.section0 .cardhead { margin-bottom: 14px; }

/* ---------- server / threats (phase 2-3) ---------- */
.pagehead + .kpis { margin-top: 0; }
.kpi .v.small-v { font-size: 19px; padding: 6px 0 5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kpi .v small { font-size: 15px; color: var(--muted); font-weight: 600; }
a.linkcard { color: var(--text); display: block; transition: border-color .15s; }
a.linkcard:hover { border-color: var(--line2); color: var(--text); }
.cardhead h3 + .pill, .cardhead h3 + .tag { margin-left: auto; }
.cardhead.pad { padding: 18px 20px 0; margin-bottom: 12px; }
.pad { padding: 14px 20px 18px; }
.minikpis { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 14px; }
.minikpis > div { display: flex; flex-direction: column; gap: 2px; padding: 10px 12px; border-radius: 10px; background: rgba(255,255,255,.03); border: 1px solid var(--line); }
.minikpis .v { font-size: 22px; font-weight: 780; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.minikpis .k { font-size: 11px; color: var(--muted); }
.plainlist { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; font-size: 13px; }
.plainlist li { display: flex; gap: 8px; align-items: center; }
.plainlist li b { margin-left: auto; font-variant-numeric: tabular-nums; }
.eventlist { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; font-size: 13px; }
.eventlist li { display: grid; grid-template-columns: auto 1fr auto; gap: 10px; align-items: start; padding: 9px 0; border-top: 1px solid var(--line); }
.eventlist li:first-child { border-top: 0; padding-top: 0; }
.eventlist li:last-child { padding-bottom: 0; }
.eventlist li.muted { display: block; }
.eventlist a { color: var(--text); font-weight: 600; }
.eventlist a:hover { color: var(--link); }
.eventlist .tag { text-transform: uppercase; font-size: 10px; font-weight: 750; letter-spacing: .05em; margin-top: 1px; }
.eventlist .clip { max-width: 100%; display: block; }
.card .eventlist li > .tiny { text-align: right; }
.checklist { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.checklist li { display: flex; gap: 12px; align-items: flex-start; padding: 9px 10px; border-radius: 10px; }
.checklist li.bad { background: rgba(255,77,94,.07); }
.checklist li.warn { background: rgba(255,154,60,.05); }
.checklist .mark { width: 18px; height: 18px; border-radius: 50%; flex: none; margin-top: 1px; display: grid; place-items: center; font-size: 11px; font-weight: 900; }
.checklist li.bad .mark { background: var(--p1); }
.checklist li.bad .mark::after { content: "!"; color: #fff; }
.checklist li.warn .mark { background: var(--p2); }
.checklist li.warn .mark::after { content: "!"; color: #2a1300; }
.checklist li.good .mark { background: rgba(45,212,167,.18); border: 1px solid rgba(45,212,167,.5); }
.checklist li.good .mark::after { content: "✓"; color: var(--ok); font-size: 10px; }
.checklist .body { display: flex; flex-direction: column; gap: 2px; font-size: 13px; min-width: 0; }
.checklist li.good .body b { font-weight: 550; color: #c5cee0; }
.checklist .detail { font-size: 12px; color: var(--muted); overflow-wrap: anywhere; }
svg.bars { display: block; width: 100%; height: auto; }
svg.bars rect.hot { fill: var(--brand); opacity: .85; }
svg.bars rect.hot:hover { opacity: 1; }
svg.bars rect.zero { fill: rgba(255,255,255,.07); }
svg.bars text { fill: var(--dim); font-size: 10px; font-family: inherit; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
h3.mini { font-size: 11px; text-transform: uppercase; letter-spacing: .09em; color: var(--dim); margin: 0 0 8px; font-weight: 650; }
table.mini { width: 100%; border-collapse: collapse; font-size: 12.5px; }
table.mini td { padding: 5px 0; border-bottom: 1px solid var(--line); }
table.mini tr:last-child td { border-bottom: 0; }
.grid td.wide { max-width: 340px; }
.grid td.bars .row { flex-wrap: nowrap; align-items: center; }
.grid td.bars svg.bar { width: 120px; flex: none; }
.warnlist.scroll { max-height: 420px; overflow: auto; padding-right: 6px; }
.notice code { color: inherit; }

/* user page: mail alert checkboxes, known-IP label */
label.check.strong { color: var(--text); font-weight: 650; font-size: 13.5px; }
.checkcols { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 0 14px; margin: 6px 0 4px; padding: 10px 0 2px; border-top: 1px solid var(--line); }
.checkcols label.check { font-size: 13px; font-weight: 500; }
.actions-cell.left { justify-content: flex-start; }
.tag.iplabel { margin-left: 4px; font-family: Inter, sans-serif; }

@media (max-width: 1280px) {
  .kpis { grid-template-columns: repeat(3, 1fr); }
  .layers { grid-template-columns: repeat(2, 1fr); }
  .hero { grid-template-columns: 1fr; }
  .donutwrap { justify-content: flex-start; }
  .c4, .c5, .c7, .c8 { grid-column: span 12; }
}
@media (max-width: 900px) {
  .shell { grid-template-columns: 1fr; }
  .side { position: static; height: auto; }
  .topbar { padding: 12px 16px; }
  .search input { width: 170px; }
  .content { padding: 18px 14px 40px; }
  .kpis, .layers { grid-template-columns: 1fr 1fr; }
  .c3, .c6 { grid-column: span 12; }
  .formgrid { grid-template-columns: 1fr; }
  .split { grid-template-columns: 1fr; }
}

/* SSH key notes (Access page) */
.grid td.note { min-width: 260px; }
.notefield { display: flex; gap: 6px; align-items: center; }
.notefield input { flex: 1; min-width: 0; padding: 5px 9px; font-size: 13px; }

/* Overview: P4 is counted but not drawn in the donut / layer bars */
.legend a.offchart { color: var(--muted); }
.legend a.offchart .sw { opacity: .45; }
.legend a.offchart b { font-weight: 600; }

/* AI text boxes (phase 4) */
.aibox { border-color: #2b3563; background: linear-gradient(180deg, rgba(122, 108, 255, .07), transparent 140px), var(--panel); }
.aibox .cardhead h2 svg { width: 18px; height: 18px; margin-right: 8px; vertical-align: -3px; fill: none; stroke: #a99cff; stroke-width: 1.8; stroke-linejoin: round; }
.aitext { line-height: 1.6; font-size: 14px; }
.aitext:empty { display: none; }
.aitext h4 { margin: 14px 0 4px; font-size: 13px; text-transform: uppercase; letter-spacing: .04em; color: #c9c2ff; }
.aitext h4:first-child { margin-top: 0; }
.aitext p { margin: 6px 0; }
.aitext ul { margin: 6px 0; padding-left: 20px; }
.aitext li { margin: 3px 0; }
.aitext code { background: var(--panel2); border: 1px solid var(--line); border-radius: 5px; padding: 0 5px; font-size: 12.5px; }
.aitext pre { background: var(--bg); border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; overflow-x: auto; }
.aitext pre code { background: none; border: 0; padding: 0; }
.aifoot { margin-top: 12px; gap: 12px; align-items: center; }
.aistate { margin: 0; font-size: 12.5px; }

/* Actions (phase 5) */
.prewrap { white-space: pre-wrap; overflow-wrap: anywhere; }
pre.result { white-space: pre-wrap; overflow-wrap: anywhere; background: var(--bg); border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; font-size: 12.5px; }
pre.result.bad { border-color: rgba(255, 77, 94, .5); }
.grid td.actions-cell form + form { margin-left: 4px; }
.actnotes { margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--line); }
.whyhead { margin-top: 18px; }
.fact .v.mono { overflow-wrap: anywhere; white-space: normal; text-overflow: clip; }
.aiwait { display: grid; gap: 10px; padding: 6px 0 4px; }
.aiwait i { display: block; height: 11px; border-radius: 6px; background: linear-gradient(90deg, rgba(255,255,255,.04), rgba(255,255,255,.10), rgba(255,255,255,.04)); background-size: 200% 100%; animation: aiwait 1.6s linear infinite; }
.aiwait i:nth-child(2) { width: 82%; } .aiwait i:nth-child(3) { width: 58%; }
@keyframes aiwait { from { background-position: 200% 0; } to { background-position: -200% 0; } }
@media (prefers-reduced-motion: reduce) { .aiwait i { animation: none; } }
[hidden] { display: none !important; }

/* ---------- long tables: own scroll box, sticky header, filter / sort / pages ---------- */
.tblscroll { max-height: min(70vh, 760px); overflow: auto; overscroll-behavior: contain; }
.tblscroll > table.grid thead th { position: sticky; top: 0; z-index: 2; background: var(--panel2); box-shadow: inset 0 -1px 0 var(--line); }
.card.flush > .tblscroll { border-radius: inherit; }
.tbltools { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin: 0 0 10px; }
.card.flush > .tbltools, .card > .tbltools { padding: 12px 16px 0; }
.tblfilter { width: 240px; max-width: 100%; padding: 7px 11px; font-size: 13px; }
.tblpages, .pager .pages { display: inline-flex; gap: 4px; align-items: center; margin-left: auto; flex-wrap: wrap; }
.pg { min-width: 30px; height: 30px; padding: 0 9px; display: inline-flex; align-items: center; justify-content: center;
  border-radius: 8px; border: 1px solid var(--line); background: transparent; color: var(--text); font-size: 13px;
  font-weight: 500; text-decoration: none; cursor: pointer; box-shadow: none; }
.pg:hover { border-color: rgba(255,255,255,.22); text-decoration: none; }
.pg.on { background: var(--brand); border-color: var(--brand); color: #fff; }
.pg.off, .pg:disabled { opacity: .35; cursor: default; }
.pg.ghostpg { color: var(--muted); }
.pager { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin: 12px 0; }
.pager .gap { color: var(--muted); padding: 0 2px; }
.pager .per a { color: var(--muted); }
.pager .per b { color: var(--text); }
th.sortable { cursor: pointer; user-select: none; white-space: nowrap; }
th.sortable::after { content: "↕"; opacity: .3; margin-left: 5px; font-size: 11px; }
th.sortable.asc::after { content: "▲"; opacity: .9; }
th.sortable.desc::after { content: "▼"; opacity: .9; }
th.sortable:hover, th.sortable:focus-visible { color: var(--text); }
a.sortlink { color: inherit; text-decoration: none; white-space: nowrap; }
a.sortlink .arrow { margin-left: 5px; font-size: 11px; opacity: .3; }
th.sorted a.sortlink { color: var(--text); }
th.sorted a.sortlink .arrow { opacity: .9; }
.tablewrap > .tbltools { padding: 12px 16px 2px; }
.grid td.vid { max-width: 340px; } .grid td.vid .clip { max-width: 340px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.grid td.clip.mono { max-width: 220px; }

/* drill-downs (part 1b): filter chips, clickable bars and checks, poll history */
.chips { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0 0 12px; }
a.chip:hover { border-color: rgba(255,255,255,.3); color: #fff; text-decoration: none; }
a.chip .x { color: var(--muted); font-weight: 700; }
svg.bars rect.hit { fill: transparent; }
svg.bars a:hover rect.hot { opacity: 1; }
svg.bars a:hover rect.zero { fill: rgba(255,255,255,.14); }
.checklist a.title { font-weight: 650; color: inherit; }
.checklist li.good a.title { font-weight: 550; color: #c5cee0; }
.checklist a.title:hover { text-decoration: underline; }
table.mini a { color: inherit; }
table.mini a:hover { color: #fff; }
table.mini tr.on td { font-weight: 700; }
.polls { margin-top: 6px; font-size: 11.5px; color: var(--dim); }
.polls li { display: flex; justify-content: space-between; gap: 8px; }
.me a.mylink { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0; color: inherit; text-decoration: none; }
.me a.mylink:hover b { text-decoration: underline; }
/* fix plan / status: a foldable section without JS */
details.fold > summary { cursor: pointer; list-style: none; }
details.fold > summary::-webkit-details-marker { display: none; }
details.fold > summary h2::before { content: "▸ "; color: var(--muted); }
details.fold[open] > summary h2::before { content: "▾ "; }
