:root {
  --bg: #0c0a12;
  --bg2: #08060d;
  --card: #13101c;
  --card2: #1a1626;
  --row: #100d17;
  --border: #241f33;
  --border2: #332b47;
  --text: #f4f1fa;
  --text2: #c9c2db;
  --muted: #8b82a3;
  --blue: #b083f8;
  --blue2: #9455f0;
  --blue3: #4a2a80;
  --red: #ef4444;
  --red2: #b91c1c;
  --green: #22c55e;
  --amber: #f5b11e;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; background: var(--bg); color: var(--text); font: 14px/1.5 Geist, Inter, -apple-system, "Segoe UI", Roboto, sans-serif; -webkit-font-smoothing: antialiased; }
a { color: var(--blue); cursor: pointer; text-decoration: none; }
code { color: var(--blue); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; }
.hidden { display: none !important; }
.muted { color: var(--muted); font-weight: 400; font-size: 12px; text-transform: none; letter-spacing: 0; }
.right { margin-left: auto; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13px; }
.err { color: var(--red); min-height: 1em; font-size: 13px; }

/* ---------- header ---------- */
header.top { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: 28px; height: 58px; padding: 0 28px; background: rgba(12, 10, 18, .9); backdrop-filter: blur(8px); border-bottom: 1px solid var(--border); }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 15px; letter-spacing: .01em; }
.brand .logo { width: 26px; height: 26px; border-radius: 7px; background: linear-gradient(135deg, #9455f0, #7c3aed); display: inline-flex; align-items: center; justify-content: center; font-size: 13px; color: #fff; }
.brand .crumb { color: var(--muted); font-weight: 500; }
.brand .crumb b { color: var(--text2); font-weight: 600; }
nav { display: flex; gap: 4px; }
nav a { color: var(--muted); padding: 19px 12px; font-weight: 500; border-bottom: 2px solid transparent; transition: color .15s; }
nav a.active, nav a:hover { color: var(--text); border-bottom-color: var(--blue2); }
.hdr-right { margin-left: auto; display: flex; gap: 8px; align-items: center; }
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 5px 11px; border-radius: 999px; border: 1px solid var(--border2); background: var(--card); font-size: 12px; font-weight: 500; color: var(--text2); }
.pill.red { color: var(--red); border-color: #5a1f23; background: #2a1215; }
.pill.green { color: var(--green); border-color: #1d4d2c; background: #0f2419; }
.pill.amber { color: var(--amber); border-color: #5a4310; background: #2b2110; }
.dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: currentColor; box-shadow: 0 0 0 3px rgba(255, 255, 255, .06); }
.dot.pulse { animation: pulse 1.4s ease-in-out infinite; }
@keyframes pulse { 0%, 100% { box-shadow: 0 0 0 3px rgba(239, 68, 68, .15); } 50% { box-shadow: 0 0 0 6px rgba(239, 68, 68, .05); } }

/* ---------- layout ---------- */
main { padding: 26px 28px 70px; max-width: 1360px; margin: 0 auto; }
.page-head { display: flex; align-items: baseline; gap: 14px; margin: 0 0 16px; }
.page-head h1 { margin: 0; font-size: 20px; font-weight: 700; }
.card { background: var(--card); border: 1px solid var(--border); border-radius: 12px; padding: 18px 20px; margin-bottom: 16px; }
.card-title { display: flex; align-items: center; gap: 12px; font-size: 11px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); margin-bottom: 14px; }
.card-title .right { margin-left: auto; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.grid4 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
@media (max-width: 960px) { .grid2, .grid4 { grid-template-columns: 1fr; } }
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 14px; margin-bottom: 16px; }
.stat { margin: 0; padding: 16px 18px; }
.stat .label { color: var(--muted); font-size: 12px; font-weight: 500; }
.stat .value { font-size: 26px; font-weight: 700; letter-spacing: -.02em; margin: 6px 0 2px; }
.stat .sub { color: var(--muted); font-size: 12px; min-height: 1.2em; }
.value.red { color: var(--red); } .value.green { color: var(--green); } .value.amber { color: var(--amber); }

/* ---------- attack list ---------- */
.table-card { background: var(--card); border: 1px solid var(--border); border-radius: 12px; overflow: hidden; margin-bottom: 18px; }
table.attacks { width: 100%; border-collapse: collapse; }
table.attacks th { text-align: left; font-size: 12px; font-weight: 600; color: var(--muted); padding: 14px 18px; background: var(--row); border-bottom: 1px solid var(--border); }
table.attacks td { padding: 16px 18px; border-bottom: 1px solid var(--border); font-size: 14px; }
table.attacks tr.row { cursor: pointer; transition: background .12s; }
table.attacks tr.row:hover td { background: #151124; }
table.attacks tr.row.open td { background: #17132a; }
table.attacks td.size { font-weight: 600; }
table.attacks td.chev { width: 44px; text-align: right; color: var(--muted); }
table.attacks tr.detail > td { padding: 0 18px 18px; background: #100d17; border-bottom: 1px solid var(--border2); }
.status-attack { color: var(--red); } .status-mitigated { color: var(--green); } .status-partial { color: var(--amber); } .status-other { color: var(--muted); }
.status-inline { display: inline-flex; align-items: center; gap: 7px; font-weight: 600; }
.tag { display: inline-block; padding: 3px 10px; border-radius: 7px; border: 1px solid #6b5a13; background: #2a2410; color: var(--amber); font-size: 12px; font-weight: 500; margin-left: 8px; vertical-align: middle; }
.empty { color: var(--muted); padding: 14px 18px; font-size: 13px; }

/* ---------- attack detail ---------- */
.detail { padding-top: 16px; }
.detail .card { background: var(--card2); }
.attack-head { display: flex; align-items: center; gap: 24px; flex-wrap: wrap; }
.attack-head h3 { margin: 0 0 4px; font-size: 18px; font-weight: 700; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.attack-head .sub { color: var(--muted); font-size: 13px; }
.attack-head .kpis { margin-left: auto; display: flex; gap: 40px; }
.attack-head .kpis .label { color: var(--muted); font-size: 12px; }
.attack-head .kpis .big { font-size: 28px; font-weight: 700; letter-spacing: -.02em; }
.chart-wrap { position: relative; height: 230px; }
.chart-wrap.tall { height: 270px; }
.legend { display: flex; gap: 16px; font-size: 12px; color: var(--muted); }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 6px; vertical-align: -1px; }

/* ---------- bars ---------- */
.bars .bar-row { display: grid; grid-template-columns: 150px 1fr 48px; gap: 12px; align-items: center; padding: 6px 0; }
.bars .name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 13px; }
.bars .name .sub { display: block; color: var(--muted); font-size: 11px; line-height: 1.2; }
.bars .bar { position: relative; height: 24px; border-radius: 6px; background: #1d1830; overflow: hidden; }
.bars .bar > i { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 6px; background: linear-gradient(90deg, #4a1a1f 0%, #b42c2c 70%, #ef4444 100%); min-width: 6px; }
.bars .bar.blue > i { background: linear-gradient(90deg, #1a3a85 0%, #9455f0 70%, #4f8cff 100%); }
.bars .bar span { position: absolute; right: 10px; top: 0; line-height: 24px; font-size: 12px; font-weight: 600; color: #fff; text-shadow: 0 1px 2px rgba(0,0,0,.6); }
.bars .pct { color: var(--muted); text-align: right; font-size: 12px; font-variant-numeric: tabular-nums; }

/* ---------- tables ---------- */
table.list { width: 100%; border-collapse: collapse; font-size: 13px; }
table.list th { text-align: left; color: var(--muted); font-weight: 500; font-size: 12px; padding: 6px 8px; border-bottom: 1px solid var(--border); }
table.list td { padding: 7px 8px; border-bottom: 1px solid #1c1729; white-space: nowrap; }
table.list tr:last-child td { border-bottom: 0; }
table.list td.num, table.list th.num { text-align: right; font-variant-numeric: tabular-nums; }
table.list td.blue { color: var(--blue); font-weight: 500; }
table.list td.dim { color: var(--muted); }
table.list tr.other td { font-weight: 600; }
table.list tr.clickable { cursor: pointer; }
table.list tr.clickable:hover td { background: var(--card2); }

/* ---------- map ---------- */
.map-row { display: grid; grid-template-columns: 1.1fr 1fr; gap: 20px; align-items: start; }
@media (max-width: 960px) { .map-row { grid-template-columns: 1fr; } }
.map { width: 100%; aspect-ratio: 2 / 1; background: #08060d; border-radius: 10px; overflow: hidden; }
.map svg { width: 100%; height: 100%; display: block; }
.map path { fill: #1a2235; stroke: #08060d; stroke-width: .6; }

/* ---------- collapsible ---------- */
.collapsible > .card-title { cursor: pointer; user-select: none; margin-bottom: 0; }
.collapsible > .card-title .chev { margin-left: auto; transition: transform .15s; font-size: 14px; }
.collapsible.open > .card-title { margin-bottom: 16px; }
.collapsible.open > .card-title .chev { transform: rotate(180deg); }
.collapsible > .body { display: none; }
.collapsible.open > .body { display: block; }
.tech .card { margin-bottom: 0; }

/* ---------- forms ---------- */
button, .btn { background: var(--blue2); color: #fff; border: 0; border-radius: 8px; padding: 8px 15px; cursor: pointer; font-size: 13px; font-weight: 600; font-family: inherit; }
button:hover { filter: brightness(1.12); }
button.small { padding: 4px 10px; font-size: 12px; font-weight: 500; }
button.ghost { background: transparent; border: 1px solid var(--border2); color: var(--muted); }
button.ghost:hover { color: var(--text); border-color: var(--blue2); filter: none; }
button.danger { background: #7f1d1d; }
button:disabled { opacity: .5; cursor: default; }
.actions { margin-top: 14px; display: flex; gap: 10px; align-items: center; }
.actions .note { color: var(--muted); font-size: 12px; }
input, select, textarea { background: #08060d; color: var(--text); border: 1px solid var(--border2); border-radius: 8px; padding: 8px 11px; font-size: 13px; font-family: inherit; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--blue2); box-shadow: 0 0 0 3px rgba(148, 85, 240, .18); }
textarea { width: 100%; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; resize: vertical; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 18px; }
.form-grid label, .limits-grid label, .block-label { display: flex; flex-direction: column; gap: 5px; color: var(--muted); font-size: 12px; }
.limits-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px 18px; }
.block-label { margin-top: 14px; }
.inline-form { display: flex; gap: 8px; margin-bottom: 14px; flex-wrap: wrap; }
.inline-form input { flex: 1; min-width: 130px; }
.toggles { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 16px; }
.toggle { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 12px; background: var(--card2); border: 1px solid var(--border); border-radius: 10px; }
.toggle .t-label { font-size: 13px; font-weight: 500; }
.toggle .t-help { color: var(--muted); font-size: 11px; }
.switch { position: relative; width: 40px; height: 22px; flex: none; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch .slider { position: absolute; inset: 0; background: #2a3553; border-radius: 22px; cursor: pointer; transition: .15s; }
.switch .slider:before { content: ""; position: absolute; width: 16px; height: 16px; left: 3px; top: 3px; background: #fff; border-radius: 50%; transition: .15s; }
.switch input:checked + .slider { background: var(--blue2); }
.switch input:checked + .slider:before { transform: translateX(18px); }
.toggle.warn input:checked + .slider { background: var(--amber); }
.banner { background: #2b2110; border: 1px solid #5a4310; color: var(--amber); border-radius: 10px; padding: 10px 14px; font-size: 13px; margin-bottom: 14px; }
pre.log { background: #08060d; border: 1px solid var(--border); border-radius: 10px; padding: 12px 14px; max-height: 280px; overflow: auto; font-size: 12px; margin: 0; white-space: pre-wrap; color: var(--text2); }
.range-sel { display: flex; gap: 2px; }
.range-sel a { color: var(--muted); padding: 3px 9px; border-radius: 6px; font-size: 12px; font-weight: 500; }
.range-sel a.active { background: var(--card2); color: var(--text); border: 1px solid var(--border2); }

/* ---------- misc ---------- */
.overlay { position: fixed; inset: 0; background: rgba(8, 6, 13, .95); display: flex; align-items: center; justify-content: center; z-index: 50; }
.login-box { background: var(--card); border: 1px solid var(--border2); border-radius: 14px; padding: 30px 34px; width: 380px; display: flex; flex-direction: column; gap: 12px; }
.login-box h2 { margin: 0; font-size: 20px; }
.toast { position: fixed; bottom: 22px; right: 22px; background: #1d1733; border: 1px solid var(--border2); padding: 11px 15px; border-radius: 10px; z-index: 40; max-width: 440px; font-size: 13px; box-shadow: 0 10px 30px rgba(0, 0, 0, .4); }
.toast.error { border-color: #7f1d1d; background: #2a1215; }


/* ======================================================================
   central panel additions (the block above is the v1 node panel stylesheet,
   kept verbatim so both panels look like one product)
   ====================================================================== */
header.top { gap: 18px; }
nav a { padding: 19px 10px; }
.brand .crumb b.tenant { color: var(--amber); }
body.role-tenant [data-admin] { display: none !important; }
body.role-admin [data-tenant-only] { display: none !important; }
.pill.blue { color: var(--blue); border-color: #4a2a80; background: #1b1330; }
.pill .dot.up { color: var(--green); } .pill .dot.down { color: var(--red); }
.pill.clickable { cursor: pointer; }
.pill.clickable:hover { border-color: var(--blue2); }

/* status dots / badges */
.st { display: inline-flex; align-items: center; gap: 7px; font-weight: 600; font-size: 13px; }
.st .dot { width: 8px; height: 8px; }
.st.up { color: var(--green); } .st.down { color: var(--red); } .st.disabled { color: var(--muted); } .st.pending { color: var(--amber); }
.badge { display: inline-block; padding: 2px 8px; border-radius: 6px; font-size: 11px; font-weight: 600; letter-spacing: .02em; border: 1px solid var(--border2); color: var(--text2); background: var(--card2); vertical-align: middle; }
.badge.red { color: var(--red); border-color: #5a1f23; background: #2a1215; }
.badge.green { color: var(--green); border-color: #1d4d2c; background: #0f2419; }
.badge.amber { color: var(--amber); border-color: #5a4310; background: #2b2110; }
.badge.blue { color: var(--blue); border-color: #4a2a80; background: #1b1330; }
.badge.dim { color: var(--muted); }

/* toolbar with filters above tables */
.toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin: 0 0 14px; }
.toolbar select, .toolbar input { min-width: 150px; }
.toolbar .spacer { flex: 1; }
.toolbar .count { color: var(--muted); font-size: 12px; }

/* generic data tables (targets, tenants, nodes) share the attacks look */
table.attacks td.actions { white-space: nowrap; text-align: right; }
table.attacks td.actions button { margin-left: 6px; }
table.attacks td .sub { display: block; color: var(--muted); font-size: 12px; }
table.attacks tr.detail > td { padding: 0 18px 18px; }
table.attacks th.num, table.attacks td.num { text-align: right; font-variant-numeric: tabular-nums; }
table.attacks td.ip { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13px; }
table.attacks tr.missing td { opacity: .6; }
.clickable { cursor: pointer; }

/* overview node cards */
.node-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; margin-bottom: 16px; }
.node-card { margin: 0; cursor: pointer; transition: border-color .12s; }
.node-card:hover { border-color: var(--blue3); }
.node-card .nc-head { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.node-card .nc-head b { font-size: 15px; }
.node-card .nc-head .loc { color: var(--muted); font-size: 12px; }
.node-card .nc-head .st { margin-left: auto; }
.node-card .nc-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.node-card .nc-stats .label { color: var(--muted); font-size: 11px; }
.node-card .nc-stats .v { font-weight: 600; font-size: 15px; font-variant-numeric: tabular-nums; }
.node-card .nc-err { color: var(--red); font-size: 12px; margin-top: 8px; word-break: break-all; }

/* policy editor */
.pol-head { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-bottom: 14px; }
.pol-head h3 { margin: 0; font-size: 17px; }
.pol-head .ips { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; color: var(--text2); }
.switches { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 10px 16px; }
.rules { width: 100%; border-collapse: collapse; font-size: 13px; }
.rules th { text-align: left; color: var(--muted); font-weight: 500; font-size: 12px; padding: 6px 8px; border-bottom: 1px solid var(--border); }
.rules td { padding: 7px 8px; border-bottom: 1px solid #1c1729; }
.rules tr.blocked td { color: var(--red); }
.rules tr.blocked td.port { text-decoration: line-through; text-decoration-color: rgba(239,68,68,.5); }
.rules td.act { text-align: right; white-space: nowrap; }
.rules td.act button { margin-left: 6px; }
.rule-form { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-top: 12px; }
.rule-form input { width: 110px; }
.rule-form select { width: 110px; }
.readonly input, .readonly select, .readonly textarea { opacity: .7; pointer-events: none; }
.small-muted { color: var(--muted); font-size: 12px; }
.inline-list { display: flex; flex-wrap: wrap; gap: 6px; }

/* modal dialogs (node / tenant / policy forms) */
.modal-bg { position: fixed; inset: 0; background: rgba(8, 6, 13, .72); display: flex; align-items: flex-start; justify-content: center; padding: 60px 16px; z-index: 45; overflow: auto; }
.modal { background: var(--card); border: 1px solid var(--border2); border-radius: 14px; padding: 22px 26px; width: 560px; max-width: 100%; }
.modal.wide { width: 860px; }
.modal h3 { margin: 0 0 14px; font-size: 17px; }
.modal .form-grid { margin-bottom: 4px; }
.modal .full { grid-column: 1 / -1; }
.modal .actions { justify-content: flex-end; }

/* token reveal */
.token-box { background: #08060d; border: 1px solid var(--border2); border-radius: 10px; padding: 12px 14px; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13px; word-break: break-all; color: var(--green); margin: 10px 0; user-select: all; }

/* key/value blocks */
.kv { display: grid; grid-template-columns: max-content 1fr; gap: 4px 16px; font-size: 13px; }
.kv dt { color: var(--muted); } .kv dd { margin: 0; word-break: break-all; }

/* tenant detail */
.tenant-detail .grid2 { align-items: start; }
.ip-form { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.ip-form input, .ip-form select { min-width: 120px; }

/* events */
tr.ev-attack td:nth-child(2) { color: var(--red); } tr.ev-node td:nth-child(2) { color: var(--amber); } tr.ev-policy td:nth-child(2) { color: var(--blue); }
table.list td.wrap { white-space: normal; }

/* login box extras */
.login-box .hint { color: var(--muted); font-size: 12px; margin: 0; }
.session-banner { background: #1b1330; border: 1px solid #4a2a80; color: var(--blue); border-radius: 10px; padding: 8px 14px; font-size: 13px; margin-bottom: 14px; }
@media (max-width: 900px) { header.top { flex-wrap: wrap; height: auto; padding: 8px 16px; } nav { flex-wrap: wrap; } nav a { padding: 10px 8px; } main { padding: 18px 16px 60px; } .attack-head .kpis { margin-left: 0; gap: 24px; } }

/* sign-in page */
.overlay { padding: 16px; }
.login-box { width: 400px; max-width: 100%; padding: 30px 32px; gap: 14px; box-shadow: 0 24px 60px rgba(0, 0, 0, .45); }
.login-box .login-brand { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 15px; color: var(--text2); }
.login-box .login-brand .logo { color: var(--blue); }
.login-box .hint { font-size: 13px; line-height: 1.5; }
.login-step { display: flex; flex-direction: column; gap: 12px; }
.login-step label { display: flex; flex-direction: column; gap: 6px; color: var(--muted); font-size: 12px; font-weight: 500; }
.login-step input { font-size: 14px; padding: 10px 12px; }
.login-box button[type=submit] { padding: 10px 15px; font-size: 14px; }
.login-box .err { margin: 0; }
.login-links { display: flex; justify-content: space-between; gap: 12px; font-size: 12px; }
.choice-list { display: flex; flex-direction: column; gap: 8px; }
.choice-list button { text-align: left; background: var(--card2); border: 1px solid var(--border2); color: var(--text); font-weight: 500; }
.choice-list button:hover { border-color: var(--blue2); }
@media (max-width: 480px) { .login-box { padding: 24px 20px; } }
.brand { white-space: nowrap; }
.login-box .err:empty { display: none; }

/* ======================================================================
   Rogue Wave Hosting theme (tokens from roguewavehosting.com)
   ====================================================================== */
:root { --accent: #b083f8; --accent-contrast: #12091f; --accent-wash: rgb(148 85 240 / .09); --accent-line: rgb(148 85 240 / .28); }
button, .btn { background: var(--accent); color: var(--accent-contrast); border-radius: 999px; }
button.small { border-radius: 999px; }
button.ghost { background: transparent; color: var(--text2); border-color: var(--border2); }
button.ghost:hover { border-color: var(--accent); color: var(--text); }
button.danger { background: #7f1d1d; color: #fff; }
input, select, textarea { border-radius: 10px; }
.card, .modal, .login-box { border-radius: 14px; }
.brand .logo { background: none; width: 28px; height: 28px; border-radius: 0; }
.brand .logo img, .login-brand .logo img { width: 100%; height: 100%; display: block; }
.login-box .login-brand .logo { width: 26px; height: 26px; display: inline-flex; }
.brand-name { background: linear-gradient(104deg, #c084fc 0%, #9455f0 58%, #7c3ce0 100%); -webkit-background-clip: text; background-clip: text; color: transparent; }
.brand .crumb { font-weight: 500; }
nav a.active, nav a:hover { border-bottom-color: var(--accent); }
.badge.blue, .pill.blue, .session-banner { color: var(--accent); border-color: var(--accent-line); background: var(--accent-wash); }
.choice-list button { border-radius: 10px; }
.session-banner.error { color: var(--red); border-color: #5a1f23; background: #2a1215; }
