/* Obelsk console — dark theme */
:root {
  --bg: #090c11;
  --bg-2: #0d121a;
  --panel: #111823;
  --panel-2: #161f2c;
  --line: #1f2a39;
  --line-2: #2a3749;
  --text: #e7edf5;
  --muted: #8a97a8;
  --dim: #5f6c7e;
  --gold: #ffc857;
  --gold-2: #f0a92e;
  --accent: #5cc8ff;
  --good: #3ddc97;
  --critical: #ff4d6d;
  --high: #ff8a3d;
  --medium: #f5c542;
  --low: #5cc8ff;
  --info: #7d8a9c;
  --radius: 12px;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: radial-gradient(1200px 600px at 80% -10%, #142033 0%, transparent 60%), var(--bg);
  background-attachment: fixed;
  color: var(--text);
  font: 14px/1.5 -apple-system, BlinkMacSystemFont, "Inter", "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
code, pre, .mono { font-family: var(--mono); font-size: 12.5px; }
h1, h2, h3 { margin: 0; font-weight: 650; letter-spacing: -.01em; }
h1 { font-size: 22px; }
h2 { font-size: 15px; }
h3 { font-size: 14px; }
p { margin: 0 0 10px; }

/* ---------- shell ---------- */
.shell { display: grid; grid-template-columns: 232px 1fr; min-height: 100vh; }
.side {
  position: sticky; top: 0; height: 100vh; padding: 20px 14px; display: flex; flex-direction: column;
  background: linear-gradient(180deg, #0c1119, #0a0e14); border-right: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px 22px; color: var(--text); }
.brand:hover { text-decoration: none; }
.brand img { width: 34px; height: 34px; }
.wordmark { font-weight: 750; letter-spacing: .28em; font-size: 15px; }
.wordmark small { display: block; font-weight: 500; letter-spacing: .08em; font-size: 10.5px; color: var(--muted); text-transform: lowercase; }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav a {
  display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 8px; color: var(--muted); font-weight: 500;
}
.nav a:hover { background: var(--panel); color: var(--text); text-decoration: none; }
.nav a.on { background: linear-gradient(90deg, rgba(255,200,87,.14), rgba(255,200,87,.02)); color: var(--text); box-shadow: inset 2px 0 0 var(--gold); }
.nav svg { width: 17px; height: 17px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.nav .sep { height: 1px; background: var(--line); margin: 12px 6px; }
.side-foot { margin-top: auto; padding: 12px 8px 0; border-top: 1px solid var(--line); color: var(--muted); font-size: 12.5px; }
.side-foot .who { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.avatar { width: 28px; height: 28px; border-radius: 50%; background: var(--panel-2); border: 1px solid var(--line-2); display: grid; place-items: center; font-weight: 700; color: var(--gold); }
.main { padding: 26px 32px 60px; max-width: 1360px; width: 100%; }
.top { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 22px; }
.top .sub { color: var(--muted); margin-top: 4px; }
.crumbs { color: var(--muted); font-size: 12.5px; margin-bottom: 6px; }
.crumbs a { color: var(--muted); }

/* ---------- panels ---------- */
.grid { display: grid; gap: 16px; }
.g-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.g-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g-hero { grid-template-columns: 340px 1fr; }
.g-wide { grid-template-columns: 2fr 1fr; }
.panel {
  background: linear-gradient(180deg, rgba(255,255,255,.018), transparent 40%), var(--panel);
  border: 1px solid var(--line); border-radius: var(--radius); padding: 18px;
}
.panel-h { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.panel-h .hint { color: var(--muted); font-size: 12.5px; }
.stack > * + * { margin-top: 16px; }

.stat { display: flex; flex-direction: column; gap: 4px; }
.stat .k { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .08em; }
.stat .v { font-size: 28px; font-weight: 700; letter-spacing: -.02em; }
.stat .v small { font-size: 13px; color: var(--muted); font-weight: 500; margin-left: 4px; }
.stat .d { color: var(--muted); font-size: 12.5px; }

/* posture gauge */
.gauge { display: flex; align-items: center; gap: 20px; }
.gauge svg { width: 132px; height: 132px; flex: none; }
.gauge .track { stroke: var(--line-2); fill: none; }
.gauge svg circle.arc { fill: none; transition: stroke-dasharray .6s; }
.gauge text.score { font-size: 32px; font-weight: 750; fill: var(--text); }
.gauge text.of { font-size: 10px; fill: var(--muted); letter-spacing: .1em; }
.grade { font-size: 13px; color: var(--muted); }
.grade b { font-size: 26px; color: var(--text); margin-right: 6px; }
.verdict { font-size: 15px; font-weight: 600; margin: 6px 0; }

/* severity colours */
.sev-critical { --c: var(--critical); }
.sev-high { --c: var(--high); }
.sev-medium { --c: var(--medium); }
.sev-low { --c: var(--low); }
.sev-info { --c: var(--info); }
.good { --c: var(--good); }
svg .sev-critical, svg .sev-high, svg .sev-medium, svg .sev-low, svg .sev-info, svg .good { fill: var(--c); stroke: var(--c); }
svg rect.sev-critical, svg rect.sev-high, svg rect.sev-medium, svg rect.sev-low { stroke: none; }

.pill {
  display: inline-flex; align-items: center; gap: 6px; padding: 2px 9px; border-radius: 999px; font-size: 11.5px; font-weight: 650;
  color: var(--c, var(--muted)); background: color-mix(in srgb, var(--c, var(--muted)) 14%, transparent);
  border: 1px solid color-mix(in srgb, var(--c, var(--muted)) 35%, transparent); white-space: nowrap;
}
.pill.dot::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--c); box-shadow: 0 0 8px var(--c); }
.tag {
  display: inline-flex; align-items: center; gap: 5px; padding: 2px 8px; border-radius: 6px; font-size: 11.5px; font-weight: 550;
  background: var(--panel-2); border: 1px solid var(--line-2); color: #c3cedb; white-space: nowrap;
}
.tag svg { width: 12px; height: 12px; stroke: currentColor; fill: none; stroke-width: 1.8; }
.cat-software { color: #9fb7ff; } .cat-network { color: #6fd6ff; } .cat-behaviour { color: #c59bff; }
.cat-credential { color: #ffb36b; } .cat-identity { color: #ff8fb1; } .cat-content { color: #8ee6b7; }
.actor-external { color: var(--critical); border-color: color-mix(in srgb, var(--critical) 40%, transparent); }
.actor-agent { color: var(--gold); }
.actor-user { color: #b8c4d4; }

.status { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--muted); }
.status::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--dim); }
.status.online::before { background: var(--good); box-shadow: 0 0 10px var(--good); }
.status.offline::before { background: var(--medium); }
.status.stale::before { background: var(--critical); }

/* severity strip */
.sevstrip { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.sevbox { border: 1px solid var(--line); border-radius: 10px; padding: 12px; background: var(--bg-2); position: relative; overflow: hidden; }
.sevbox::after { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--c); }
.sevbox .n { font-size: 24px; font-weight: 750; color: var(--c); }
.sevbox .l { font-size: 12px; color: var(--muted); }

/* bars */
.bars { display: flex; flex-direction: column; gap: 10px; }
.bar-row { display: grid; grid-template-columns: 130px 1fr 40px; align-items: center; gap: 10px; font-size: 13px; }
.bar-row .l { color: #c3cedb; }
.bar-row .n { text-align: right; color: var(--muted); font-variant-numeric: tabular-nums; }
.bar { height: 8px; background: var(--bg-2); border-radius: 99px; overflow: hidden; border: 1px solid var(--line); }
.bar span { display: block; height: 100%; border-radius: 99px; background: linear-gradient(90deg, var(--gold-2), var(--gold)); }
.bar.ext span { background: linear-gradient(90deg, #c2304b, var(--critical)); }
.bar.agt span { background: linear-gradient(90deg, #d08a12, var(--gold)); }
.bar.usr span { background: linear-gradient(90deg, #3a7fb0, var(--accent)); }

/* chart */
.chart svg { width: 100%; height: auto; display: block; }
.chart .axis { stroke: var(--line-2); }
.chart .lbl { fill: var(--muted); font-size: 10px; }
.chart .grid-l { stroke: var(--line); stroke-dasharray: 2 4; }
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12px; color: var(--muted); }
.legend i { display: inline-block; width: 9px; height: 9px; border-radius: 2px; background: var(--c); margin-right: 6px; vertical-align: -1px; }

/* tables */
table { width: 100%; border-collapse: collapse; }
th { text-align: left; font-size: 11.5px; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); font-weight: 600; padding: 10px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; }
td { padding: 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
tr:last-child td { border-bottom: 0; }
tbody tr { transition: background .12s; }
tbody tr:hover { background: rgba(255,255,255,.02); }
tr.clickable { cursor: pointer; }
.t-panel { padding: 0; overflow: hidden; }
.t-panel .panel-h { padding: 16px 18px 0; }
.host { display: flex; align-items: center; gap: 10px; }
.host .ico { width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center; background: var(--panel-2); border: 1px solid var(--line-2); }
.host .ico svg { width: 18px; height: 18px; stroke: #b8c4d4; fill: none; stroke-width: 1.6; }
.host b { display: block; color: var(--text); }
.host small { color: var(--muted); }
.num { font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.dim { color: var(--dim); }
.right { text-align: right; }
.nowrap { white-space: nowrap; }
.risk-meter { display: flex; align-items: center; gap: 8px; }
.risk-meter .bar { width: 80px; }
.risk-meter .bar span { background: var(--c); }

/* activity feed */
.feed { display: flex; flex-direction: column; }
.ev {
  display: grid; grid-template-columns: 4px 1fr auto; gap: 14px; padding: 13px 18px; border-bottom: 1px solid var(--line); color: var(--text);
}
.ev:hover { background: rgba(255,255,255,.025); text-decoration: none; }
.ev:last-child { border-bottom: 0; }
.ev .rail { border-radius: 4px; background: var(--c); box-shadow: 0 0 12px color-mix(in srgb, var(--c) 50%, transparent); }
.ev .title { font-weight: 600; }
.ev .meta { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 6px; font-size: 12px; color: var(--muted); }
.ev .when { text-align: right; color: var(--muted); font-size: 12px; white-space: nowrap; }
.ev .when .score { display: block; font-size: 18px; font-weight: 750; color: var(--c); }
.ev.closed { opacity: .55; }
.empty { padding: 34px; text-align: center; color: var(--muted); }
.empty svg { width: 36px; height: 36px; stroke: var(--good); fill: none; stroke-width: 1.6; margin-bottom: 8px; }

/* filters */
.filters { display: flex; flex-wrap: wrap; gap: 14px; align-items: center; margin-bottom: 16px; }
.seg { display: inline-flex; background: var(--bg-2); border: 1px solid var(--line); border-radius: 9px; padding: 3px; gap: 2px; }
.seg a { padding: 5px 10px; border-radius: 6px; color: var(--muted); font-size: 12.5px; font-weight: 550; }
.seg a:hover { color: var(--text); text-decoration: none; }
.seg a.on { background: var(--panel-2); color: var(--text); box-shadow: 0 0 0 1px var(--line-2); }
.flabel { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--dim); margin-right: 4px; }
.pager { display: flex; justify-content: space-between; align-items: center; padding: 12px 18px; border-top: 1px solid var(--line); color: var(--muted); font-size: 12.5px; }

/* forms */
input[type=text], input[type=password], input[type=search], textarea, select {
  width: 100%; background: var(--bg-2); color: var(--text); border: 1px solid var(--line-2); border-radius: 9px; padding: 10px 12px; font: inherit;
}
input:focus, textarea:focus { outline: none; border-color: var(--gold); box-shadow: 0 0 0 3px rgba(255,200,87,.15); }
label { display: block; font-size: 12.5px; color: var(--muted); margin: 0 0 6px; }
.field { margin-bottom: 14px; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 9px 15px; border-radius: 9px; font: inherit; font-weight: 600;
  background: var(--panel-2); color: var(--text); border: 1px solid var(--line-2); cursor: pointer;
}
.btn:hover { border-color: var(--dim); text-decoration: none; }
.btn.primary { background: linear-gradient(180deg, var(--gold), var(--gold-2)); color: #1a1205; border-color: transparent; }
.btn.primary:hover { filter: brightness(1.06); }
.btn.danger { color: var(--critical); border-color: color-mix(in srgb, var(--critical) 40%, transparent); background: transparent; }
.btn.sm { padding: 6px 11px; font-size: 12.5px; }
.btn-row { display: flex; gap: 8px; flex-wrap: wrap; }
.inline { display: inline; }
.flash { padding: 11px 14px; border-radius: 10px; margin-bottom: 18px; border: 1px solid; }
.flash.ok { color: var(--good); border-color: color-mix(in srgb, var(--good) 35%, transparent); background: color-mix(in srgb, var(--good) 8%, transparent); }
.flash.err { color: var(--critical); border-color: color-mix(in srgb, var(--critical) 35%, transparent); background: color-mix(in srgb, var(--critical) 8%, transparent); }

/* key/value */
.kv { display: grid; grid-template-columns: 140px 1fr; gap: 8px 16px; font-size: 13px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; word-break: break-word; }
.code {
  background: #070a0f; border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; overflow-x: auto; white-space: pre-wrap; word-break: break-all;
  font-family: var(--mono); font-size: 12.5px; color: #d6e2f0;
}
.chain { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-family: var(--mono); font-size: 12px; }
.chain span { padding: 3px 8px; border-radius: 6px; background: var(--bg-2); border: 1px solid var(--line-2); }
.chain span.hot { border-color: var(--gold); color: var(--gold); }
.chain span.self { border-color: var(--c, var(--accent)); color: var(--c, var(--accent)); }
.chain i { color: var(--dim); font-style: normal; }

/* event hero */
.ev-hero { display: grid; grid-template-columns: 1fr 200px; gap: 18px; align-items: center; }
.threat { text-align: center; padding: 16px; border-radius: 12px; border: 1px solid color-mix(in srgb, var(--c) 40%, transparent);
  background: radial-gradient(circle at 50% 0%, color-mix(in srgb, var(--c) 22%, transparent), transparent 70%); }
.threat .s { font-size: 40px; font-weight: 800; color: var(--c); line-height: 1; }
.threat .w { font-size: 12px; letter-spacing: .1em; text-transform: uppercase; color: var(--c); margin-top: 6px; font-weight: 700; }
.threat .c { font-size: 12px; color: var(--muted); margin-top: 6px; }

/* inventory */
.inv { display: flex; flex-direction: column; gap: 16px; }
.inv h3 { font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin-bottom: 8px; }
.inv ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.inv li { display: flex; justify-content: space-between; gap: 12px; padding: 8px 10px; border-radius: 8px; background: var(--bg-2); border: 1px solid var(--line); font-size: 13px; }
.inv li span:last-child { color: var(--muted); text-align: right; font-size: 12px; word-break: break-word; }

/* signals page */
.sig-cat { margin-top: 26px; }
.sig-cat > h2 { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; font-size: 16px; }
.rule { border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); margin-bottom: 12px; overflow: hidden; }
.rule summary { list-style: none; cursor: pointer; display: grid; grid-template-columns: 74px 1fr auto; gap: 14px; align-items: center; padding: 15px 18px; }
.rule summary::-webkit-details-marker { display: none; }
.rule summary:hover { background: rgba(255,255,255,.02); }
.rule .rid { font-family: var(--mono); color: var(--gold); font-weight: 650; }
.rule .rlooks { color: var(--muted); font-size: 13px; margin-top: 3px; }
.rule .body { padding: 4px 18px 18px 106px; display: grid; grid-template-columns: 1.4fr 1fr; gap: 22px; }
.rule ol { margin: 0; padding-left: 18px; }
.rule ol li { margin-bottom: 6px; color: #c9d4e1; }
.rule h4 { margin: 0 0 8px; font-size: 11.5px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.rule .box { padding: 12px; border-radius: 10px; background: var(--bg-2); border: 1px solid var(--line); margin-bottom: 10px; font-size: 13px; }
.scale { display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; }
.scale .lvl { border-radius: 10px; padding: 12px; border: 1px solid color-mix(in srgb, var(--c) 35%, transparent); background: color-mix(in srgb, var(--c) 7%, transparent); }
.scale .lvl b { color: var(--c); display: block; margin-bottom: 4px; }
.scale .lvl span { font-size: 12.5px; color: #c3cedb; }
.formula { font-family: var(--mono); background: #070a0f; border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; color: var(--gold); font-size: 13px; }

/* login */
.login-wrap { min-height: 100vh; display: grid; grid-template-columns: 1.1fr 1fr; }
.login-art {
  position: relative; overflow: hidden; display: flex; flex-direction: column; justify-content: flex-end; padding: 48px;
  background: radial-gradient(600px 400px at 50% 35%, rgba(255,200,87,.16), transparent 70%), linear-gradient(180deg, #0b1018, #070a0f);
  border-right: 1px solid var(--line);
}
.login-art .monolith { position: absolute; left: 50%; top: 14%; transform: translateX(-50%); width: 220px; height: auto; filter: drop-shadow(0 0 40px rgba(255,200,87,.25)); }
.login-art h2 { font-size: 28px; font-weight: 700; letter-spacing: -.02em; max-width: 460px; }
.login-art p { color: var(--muted); max-width: 460px; margin-top: 10px; }
.login-form { display: grid; place-items: center; padding: 40px; }
.login-card { width: 100%; max-width: 360px; }
.login-card .brand { padding: 0 0 30px; }
.login-card h1 { margin-bottom: 6px; }
.login-card .sub { color: var(--muted); margin-bottom: 24px; }
.login-card .btn { width: 100%; padding: 11px; margin-top: 6px; }
.fine { color: var(--dim); font-size: 12px; margin-top: 22px; }

.steps { counter-reset: s; list-style: none; padding: 0; margin: 0; }
.steps > li { counter-increment: s; position: relative; padding: 0 0 22px 44px; }
.steps > li::before { content: counter(s); position: absolute; left: 0; top: -2px; width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; color: var(--gold); border: 1px solid color-mix(in srgb, var(--gold) 45%, transparent); background: rgba(255,200,87,.08); }
.steps h3 { margin-bottom: 6px; }

@media (max-width: 1100px) {
  .g-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .g-hero, .g-wide, .g-3, .g-2 { grid-template-columns: 1fr; }
  .rule .body { grid-template-columns: 1fr; padding-left: 18px; }
}
@media (max-width: 760px) {
  .shell { grid-template-columns: 1fr; }
  .side { position: static; height: auto; }
  .main { padding: 18px 16px 40px; }
  .login-wrap { grid-template-columns: 1fr; }
  .login-art { display: none; }
  .sevstrip, .scale { grid-template-columns: repeat(2, 1fr); }
  .ev-hero { grid-template-columns: 1fr; }
  .kv { grid-template-columns: 1fr; }
}
.bar-row .tag { justify-self: start; }
