/* NexOps — dark NOC theme (default) and a light theme (html[data-theme="light"], at the end). Original design; palette tuned for wall displays and long shifts. */
:root {
  --bg: #0a0f1c; --panel: #111827; --panel-2: #0f172a; --line: #1f2a44; --line-2: #263352;
  --text: #e5e7eb; --muted: #8b96ad; --accent: #6366f1; --accent-2: #8b5cf6;
  --ok: #22c55e; --warn: #f59e0b; --major: #f97316; --crit: #ef4444; --info: #38bdf8; --unknown: #64748b;
  --text-2: #cbd5e1; --line-3: #334155; --chart-grid: #1a2540; --input-bg: #0b1324; --chip: #1e293b; --code-bg: #070b14;
  --radius: 12px; --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; --mono: "JetBrains Mono", ui-monospace, Consolas, monospace;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); font: 14px/1.45 var(--font); }
a { color: #a5b4fc; text-decoration: none; } a:hover { text-decoration: underline; }
h1 { font-size: 22px; margin: 0 0 2px; font-weight: 650; } h2 { font-size: 15px; margin: 0; font-weight: 600; } h3 { font-size: 13px; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; margin: 18px 0 8px; }
.muted { color: var(--muted); } .small { font-size: 12px; } .mono { font-family: var(--mono); font-size: 12.5px; } .lead { font-size: 16px; }

/* shell */
.shell { display: grid; grid-template-columns: 240px 1fr; min-height: 100vh; }
.sidebar { background: var(--panel-2); border-right: 1px solid var(--line); padding: 18px 12px; display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.brand { display: flex; gap: 10px; align-items: center; padding: 4px 8px 18px; color: var(--text); text-decoration: none !important; }
.brand img { width: 34px; height: 34px; } .brand-name { font-size: 20px; font-weight: 700; letter-spacing: -.01em; } .brand-sub { font-size: 11.5px; color: var(--muted); }
.sidebar nav { display: flex; flex-direction: column; gap: 2px; flex: 1; }
.nav-group { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); padding: 14px 10px 6px; }
.sidebar nav a, .nav-soon { display: flex; align-items: center; justify-content: space-between; padding: 7px 10px; border-radius: 8px; color: #cbd5e1; text-decoration: none; }
.sidebar nav a:hover { background: #16203a; text-decoration: none; }
.sidebar nav a.active { background: linear-gradient(90deg, #312e81, #1e1b4b); color: #fff; }
.nav-soon { color: #4b5875; cursor: default; } .nav-soon::after { content: "soon"; font-size: 10px; border: 1px solid #334155; border-radius: 6px; padding: 0 5px; }
.sidebar-foot { font-size: 11px; color: #4b5875; padding: 10px; }
.main { min-width: 0; }
.topbar { display: flex; align-items: center; gap: 14px; padding: 12px 24px; border-bottom: 1px solid var(--line); background: rgba(10,15,28,.85); backdrop-filter: blur(6px); position: sticky; top: 0; z-index: 5; }
.topbar .spacer { flex: 1; } .topbar form { margin: 0; } .clock { color: var(--muted); font-variant-numeric: tabular-nums; } .user { color: #cbd5e1; }
.tenant-switch { min-width: 240px; }
.content { padding: 22px 24px 40px; }
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; margin-bottom: 18px; flex-wrap: wrap; }
.actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

/* cards & grid */
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; margin-bottom: 16px; min-width: 0; }
.card-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; } .card-head a { font-size: 12.5px; }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 14px; margin-bottom: 16px; }
.kpi { display: flex; gap: 14px; align-items: center; margin: 0; }
.kpi-icon { width: 46px; height: 46px; border-radius: 12px; display: grid; place-items: center; font-size: 20px; background: #1e1b4b; color: #a5b4fc; flex-shrink: 0; }
.kpi-icon.ok { background: rgba(34,197,94,.12); color: var(--ok); } .kpi-icon.warn { background: rgba(245,158,11,.12); color: var(--warn); } .kpi-icon.crit { background: rgba(239,68,68,.14); color: var(--crit); }
.kpi-label { color: var(--muted); font-size: 12.5px; } .kpi-value { font-size: 26px; font-weight: 700; letter-spacing: -.02em; font-variant-numeric: tabular-nums; } .kpi-sub { font-size: 12px; color: var(--muted); }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; } .grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; } .span-2 { grid-column: span 2; }
@media (max-width: 1100px) { .grid-2, .grid-3 { grid-template-columns: 1fr; } .span-2 { grid-column: auto; } .shell { grid-template-columns: 1fr; } .sidebar { position: static; height: auto; } }
.chart { width: 100%; height: 260px; } .topology { width: 100%; height: 70vh; }

/* lists & tables */
.list { list-style: none; margin: 0; padding: 0; } .list li { display: flex; gap: 10px; align-items: center; padding: 10px 4px; border-bottom: 1px solid var(--line); }
.list li:last-child { border-bottom: 0; } .list .grow { flex: 1; min-width: 0; display: flex; flex-direction: column; } .list.compact li { padding: 7px 4px; }
.table { width: 100%; border-collapse: collapse; } .table th { text-align: left; font-weight: 500; color: var(--muted); font-size: 12px; padding: 8px; border-bottom: 1px solid var(--line-2); }
.table td { padding: 9px 8px; border-bottom: 1px solid var(--line); vertical-align: middle; } .table tr:hover td { background: #131d33; }
.table.compact td { padding: 6px 8px; } tr.dim td { opacity: .55; } tr.hl td { background: rgba(245,158,11,.06); }
.kv { display: grid; grid-template-columns: 140px 1fr; gap: 6px 12px; margin: 0; } .kv dt { color: var(--muted); } .kv dd { margin: 0; word-break: break-word; }

/* status */
.dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: var(--unknown); margin-right: 4px; vertical-align: middle; }
.dot.up { background: var(--ok); box-shadow: 0 0 6px rgba(34,197,94,.6); } .dot.down { background: var(--crit); box-shadow: 0 0 6px rgba(239,68,68,.7); }
.dot.unreachable { background: var(--major); } .dot.maint { background: #94a3b8; } .dot.degraded { background: var(--warn); }
.badge { display: inline-block; font-size: 11.5px; font-weight: 600; padding: 2px 8px; border-radius: 6px; border: 1px solid transparent; white-space: nowrap; }
.badge.critical { color: #fecaca; background: rgba(239,68,68,.15); border-color: rgba(239,68,68,.4); }
.badge.major { color: #fed7aa; background: rgba(249,115,22,.15); border-color: rgba(249,115,22,.4); }
.badge.minor, .badge.warning { color: #fde68a; background: rgba(245,158,11,.13); border-color: rgba(245,158,11,.35); }
.badge.info { color: #bae6fd; background: rgba(56,189,248,.12); border-color: rgba(56,189,248,.3); }
.badge.ok { color: #bbf7d0; background: rgba(34,197,94,.12); border-color: rgba(34,197,94,.35); } .badge.big { font-size: 14px; padding: 5px 12px; }
.sev { font-size: 12px; margin-right: 6px; } .sev.critical { color: var(--crit); } .sev.major { color: var(--major); } .sev.minor { color: var(--warn); }
.sev-icon { width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; font-weight: 800; flex-shrink: 0; }
.sev-icon.critical { background: rgba(239,68,68,.18); color: var(--crit); } .sev-icon.major { background: rgba(249,115,22,.18); color: var(--major); } .sev-icon.minor, .sev-icon.warning { background: rgba(245,158,11,.18); color: var(--warn); } .sev-icon.info { background: rgba(56,189,248,.15); color: var(--info); }
.pill { font-size: 11px; padding: 0 7px; border-radius: 10px; } .pill.crit { background: var(--crit); color: #fff; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; } .chip { padding: 3px 10px; border-radius: 14px; font-size: 12px; background: var(--chip); } .chip.crit { background: rgba(239,68,68,.15); color: #fecaca; }
.bar { height: 8px; background: var(--chip); border-radius: 4px; overflow: hidden; } .bar.sm { height: 5px; width: 70px; display: inline-block; vertical-align: middle; }
.bar .fill { height: 100%; background: var(--ok); } .bar .fill.warn { background: var(--warn); } .bar .fill.crit { background: var(--crit); }

/* forms */
input, select, textarea { background: var(--input-bg); color: var(--text); border: 1px solid var(--line-2); border-radius: 8px; padding: 8px 10px; font: inherit; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent); outline-offset: 0; }
label { display: flex; flex-direction: column; gap: 4px; font-size: 12.5px; color: var(--muted); margin-bottom: 10px; } label.toggle { flex-direction: row; align-items: center; gap: 8px; color: var(--text); }
textarea { width: 100%; min-height: 70px; margin: 10px 0 6px; } .search { min-width: 260px; }
.btn { background: #1e293b; color: var(--text); border: 1px solid var(--line-2); border-radius: 8px; padding: 7px 14px; font: inherit; cursor: pointer; }
.btn:hover { background: #26324a; } .btn:disabled { opacity: .45; cursor: not-allowed; }
.btn.primary { background: linear-gradient(135deg, var(--accent), var(--accent-2)); border: 0; color: #fff; } .btn.ghost { background: transparent; }
.tabs { display: flex; gap: 4px; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 4px; }
.tab { background: transparent; border: 0; color: var(--muted); padding: 6px 12px; border-radius: 7px; cursor: pointer; font: inherit; } .tab.on { background: #312e81; color: #fff; }
.alert { padding: 9px 12px; border-radius: 8px; background: #1e293b; margin: 10px 0; font-size: 13px; } .alert.crit { background: rgba(239,68,68,.15); color: #fecaca; } .alert.warn { background: rgba(245,158,11,.12); color: #fde68a; }
.code { background: var(--code-bg); border: 1px solid var(--line); border-radius: 8px; padding: 10px; font-family: var(--mono); font-size: 12px; white-space: pre-wrap; word-break: break-all; max-height: 360px; overflow: auto; }
.empty { padding: 28px; text-align: center; color: var(--muted); } .empty.ok { color: #86efac; }
.timeline { list-style: none; padding: 0; margin: 0 0 10px; border-left: 2px solid var(--line-2); } .timeline li { padding: 0 0 12px 14px; position: relative; font-size: 13px; }
.timeline li::before { content: ""; position: absolute; left: -6px; top: 5px; width: 10px; height: 10px; border-radius: 50%; background: var(--accent); }
hr { border: 0; border-top: 1px solid var(--line); margin: 18px 0; }

/* login */
.login { min-height: 100vh; display: grid; grid-template-columns: 1.1fr 1fr; }
.login-brand { background: radial-gradient(1200px 600px at 20% 20%, #312e81 0%, #0a0f1c 60%); padding: 12vh 8vw; display: flex; flex-direction: column; justify-content: center; }
.login-brand img { width: 64px; } .login-brand h1 { font-size: 46px; margin: 14px 0 6px; letter-spacing: -.03em; } .login-brand p { font-size: 17px; margin: 4px 0; }
.login-form { align-self: center; justify-self: center; width: min(380px, 90vw); padding: 28px; } .login-form h2 { font-size: 20px; margin-bottom: 14px; } .login-form .btn { width: 100%; padding: 10px; margin-top: 6px; }
@media (max-width: 800px) { .login { grid-template-columns: 1fr; } .login-brand { padding: 40px 24px; } }

/* wallboard */
.wallboard { min-height: 100vh; padding: 28px 36px; background: radial-gradient(1400px 700px at 80% -10%, #1e1b4b, var(--bg) 60%); }
.wallboard header { display: flex; align-items: center; gap: 14px; margin-bottom: 26px; } .wallboard header img { width: 44px; } .wallboard header h1 { font-size: 26px; flex: 1; } .wallboard .clock { font-size: 26px; }
.wb-kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; margin-bottom: 26px; }
.wb-kpi { background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: 22px; } .wb-kpi span { color: var(--muted); font-size: 18px; display: block; } .wb-kpi b { font-size: 54px; font-variant-numeric: tabular-nums; }
.wb-kpi.ok b { color: var(--ok); } .wb-kpi.crit b { color: var(--crit); }
.wb-incidents { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.wb-inc { background: var(--panel); border-left: 8px solid var(--warn); border-radius: 12px; padding: 18px 22px; } .wb-inc.critical { border-color: var(--crit); animation: pulse 2s infinite; } .wb-inc.major { border-color: var(--major); }
.wb-inc-title { font-size: 24px; font-weight: 650; } .wb-inc-meta { font-size: 17px; color: var(--muted); margin-top: 4px; }
.wb-allclear { grid-column: span 2; text-align: center; font-size: 34px; color: var(--ok); padding: 80px; }
@keyframes pulse { 50% { box-shadow: 0 0 0 4px rgba(239,68,68,.25); } }

#blazor-error-ui { display: none; position: fixed; bottom: 0; left: 0; right: 0; background: #7f1d1d; color: #fff; padding: 10px 20px; z-index: 100; } #blazor-error-ui a { color: #fff; text-decoration: underline; }

/* Geographic topology (M5) */
.site-marker { display: flex; flex-direction: column; align-items: center; cursor: pointer; }
.site-dot { border-radius: 50%; border: 2px solid #0a0f1c; box-shadow: 0 0 0 2px rgba(255,255,255,.15); }
.site-label { margin-top: 3px; font-size: 11px; color: #e5e7eb; text-shadow: 0 0 3px #000, 0 0 2px #000; white-space: nowrap; }
.maplibregl-popup-content { background: #111a2e; color: #e5e7eb; border: 1px solid #263352; }
.maplibregl-popup-content a { color: #a5b4fc; }
.maplibregl-popup-tip { border-top-color: #111a2e !important; }
/* M8 config diff */
pre.diff { background: var(--code-bg); border: 1px solid var(--line); border-radius: 8px; padding: 10px; font-family: var(--mono); font-size: 12px; max-height: 520px; overflow: auto; margin: 0; }
pre.diff span { display: block; white-space: pre-wrap; word-break: break-all; }
pre.diff .added { background: rgba(34,197,94,.14); color: #bbf7d0; } pre.diff .removed { background: rgba(239,68,68,.14); color: #fecaca; } pre.diff .same { color: var(--muted); }

/* Device → Config tab */
.cfg-top { display: grid; grid-template-columns: minmax(260px, 340px) 1fr; gap: 16px; } @media (max-width: 1100px) { .cfg-top { grid-template-columns: 1fr; } }
.cfg-status { padding: 0; overflow: hidden; } .cfg-status .kv { padding: 14px 16px 0; grid-template-columns: 110px 1fr; } .cfg-status .actions { padding: 0 16px 14px; }
.cfg-status-head { padding: 10px 16px; font-size: 14px; border-bottom: 1px solid var(--line); }
.cfg-status-head.ok { background: rgba(34,197,94,.14); color: #bbf7d0; } .cfg-status-head.crit { background: rgba(239,68,68,.16); color: #fecaca; } .cfg-status-head.info { background: rgba(56,189,248,.12); color: #bae6fd; }
.cfg-banner { padding: 9px 12px; border-radius: 8px; margin-bottom: 12px; font-size: 13px; border: 1px solid var(--line-2); }
.cfg-banner.ok { background: rgba(34,197,94,.10); border-color: rgba(34,197,94,.3); } .cfg-banner.info { background: rgba(56,189,248,.10); border-color: rgba(56,189,248,.3); }
.cfg-banner.crit { background: rgba(239,68,68,.12); border-color: rgba(239,68,68,.4); color: #fecaca; }
.cfg-controls { display: grid; grid-template-columns: 2fr 1fr; gap: 12px; } .cfg-controls select { width: 100%; }
pre.diff.cfg { max-height: 70vh; } pre.diff.cfg i { display: none; } pre.diff.cfg.numbered i { display: inline-block; width: 4.5em; padding-right: 1em; text-align: right; color: #475569; font-style: normal; user-select: none; }

/* Topology → Weather map */
.wm-card { padding: 0; overflow: hidden; } .topology.wm { height: 68vh; min-height: 460px; border-radius: 0; background: radial-gradient(circle at 50% 40%, #0f1a30, #0a0f1c 70%); }
.wm-tools { display: flex; align-items: center; gap: 8px; padding: 10px 14px; border-bottom: 1px solid var(--line); } .wm-tools .grow { flex: 1; }
.wm-legend { display: flex; flex-wrap: wrap; gap: 14px; align-items: center; padding: 10px 14px; border-top: 1px solid var(--line); font-size: 12px; color: var(--muted); }
.wm-legend span { display: inline-flex; align-items: center; gap: 6px; } .wm-legend i { width: 22px; height: 6px; border-radius: 3px; display: inline-block; }
.wm-legend i.dashed { background: repeating-linear-gradient(90deg, #334155 0 6px, transparent 6px 10px); }
.wm-form { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; } @media (max-width: 1100px) { .wm-form { grid-template-columns: 1fr 1fr; } }
.wm-tip { position: fixed; z-index: 50; width: 380px; background: var(--input-bg); border: 1px solid var(--line-2); border-radius: 10px; box-shadow: 0 12px 32px rgba(0,0,0,.5); pointer-events: none; overflow: hidden; }
.wm-tip-head { background: #312e81; color: #fff; font-size: 12.5px; font-weight: 600; padding: 7px 10px; } .wm-tip-chart { height: 170px; } .wm-tip-empty { padding: 14px 10px; color: var(--muted); font-size: 12.5px; }

/* Classic NOC graphs (MRTG/Cacti look): light frame, white plot, monospace legend */
.cg-stack { display: grid; grid-template-columns: minmax(0, 1fr); gap: 22px; }
.cg-stack.cols-1 .cg-wrap { max-width: 900px; }
.cg-stack.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .cg-stack.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 1500px) { .cg-stack.cols-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 1100px) { .cg-stack.cols-2, .cg-stack.cols-3 { grid-template-columns: minmax(0, 1fr); } }
.cg-wrap { width: 100%; min-width: 0; }
.cg-section { margin: 22px 0 10px; } .cg-section:first-of-type { margin-top: 4px; }
.cg-tools { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; margin-bottom: 16px; }
.cg-tools .tabs { margin: 0; } .cg-tools .lbl { color: var(--muted); font-size: 12px; }
.cg { background: #f3f3f3; border: 1px solid #c8c8c8; border-radius: 2px; padding: 8px 10px 10px; color: #000; font-family: 'DejaVu Sans Mono', Menlo, Consolas, 'Liberation Mono', monospace; }
.cg-title { text-align: center; font-family: 'DejaVu Sans', Verdana, Arial, sans-serif; font-size: 14px; color: #000; margin: 2px 0 6px; }
.cg-plot { height: 230px; background: #fff; }
.cg.compact { padding: 4px 6px 6px; } .cg.compact .cg-title { font-size: 12px; margin: 0 0 3px; } .cg.compact .cg-plot { height: 130px; }
.cg-range { text-align: center; font-size: 12px; margin: 6px 0 8px; }
.cg-legend { font-size: 12px; white-space: pre; overflow-x: auto; } .cg-legend div { display: flex; align-items: center; gap: 8px; line-height: 1.55; }
.cg-legend i { width: 10px; height: 10px; border: 1px solid #000; display: inline-block; flex: none; }
.cg.dark { background: var(--panel-2); border-color: var(--line-2); border-radius: 6px; color: #cbd5e1; }
.cg.dark .cg-title { color: var(--text); } .cg.dark .cg-plot { background: #0b1222; } .cg.dark .cg-legend i { border-color: #8b96ad; }
.cg-caption { text-align: center; font-weight: 700; font-size: 13px; margin-top: 6px; color: var(--text); }
.cg-thumbs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; } @media (max-width: 1100px) { .cg-thumbs { grid-template-columns: 1fr; } }
.port-list td a.port { font-family: var(--mono); font-weight: 600; } .port-list tr { cursor: pointer; }
.pager { display: flex; justify-content: center; align-items: center; gap: 12px; padding: 10px; color: var(--muted); font-size: 12.5px; }

/* ── Theme switch (top bar) ── */
.theme-btn { padding: 6px 10px; font-size: 15px; line-height: 1; } .theme-btn .to-dark { display: none; }
html[data-theme="light"] .theme-btn .to-light { display: none; } html[data-theme="light"] .theme-btn .to-dark { display: inline; }

/* ── Light theme: same layout, daylight palette. Status colours keep their meaning; text on tinted badges darkens. ── */
html[data-theme="light"] {
  --bg: #f3f5fa; --panel: #ffffff; --panel-2: #f8fafc; --line: #e3e8f0; --line-2: #cfd7e3;
  --text: #0f172a; --text-2: #334155; --muted: #64748b; --line-3: #94a3b8; --chart-grid: #edf1f6; --input-bg: #ffffff; --chip: #e8edf4; --code-bg: #f8fafc;
  color-scheme: light;
}
html[data-theme="light"] a { color: #4338ca; }
html[data-theme="light"] .sidebar nav a { color: #334155; } html[data-theme="light"] .sidebar nav a:hover { background: #eef2ff; }
html[data-theme="light"] .sidebar nav a.active { background: linear-gradient(90deg, #4f46e5, #6366f1); color: #fff; }
html[data-theme="light"] .nav-soon, html[data-theme="light"] .sidebar-foot { color: #94a3b8; } html[data-theme="light"] .nav-soon::after { border-color: #cfd7e3; }
html[data-theme="light"] .topbar { background: rgba(255,255,255,.88); } html[data-theme="light"] .user { color: #334155; }
html[data-theme="light"] .card { box-shadow: 0 1px 2px rgba(15,23,42,.05); }
html[data-theme="light"] .kpi-icon { background: #eef2ff; color: #4338ca; }
html[data-theme="light"] .table tr:hover td { background: #f1f5f9; }
html[data-theme="light"] .badge.critical, html[data-theme="light"] .chip.crit, html[data-theme="light"] .alert.crit, html[data-theme="light"] .cfg-banner.crit, html[data-theme="light"] .cfg-status-head.crit { color: #b91c1c; }
html[data-theme="light"] .badge.major { color: #c2410c; }
html[data-theme="light"] .badge.minor, html[data-theme="light"] .badge.warning, html[data-theme="light"] .alert.warn { color: #a16207; }
html[data-theme="light"] .badge.info, html[data-theme="light"] .cfg-status-head.info { color: #0369a1; }
html[data-theme="light"] .badge.ok, html[data-theme="light"] .cfg-status-head.ok, html[data-theme="light"] .empty.ok { color: #15803d; }
html[data-theme="light"] .alert { background: var(--chip); }
html[data-theme="light"] .btn { background: #f1f5f9; } html[data-theme="light"] .btn:hover { background: #e2e8f0; } html[data-theme="light"] .btn.ghost { background: transparent; }
html[data-theme="light"] .btn.primary { background: linear-gradient(135deg, var(--accent), var(--accent-2)); }
html[data-theme="light"] .tab.on { background: #4f46e5; }
html[data-theme="light"] pre.diff .added { color: #166534; } html[data-theme="light"] pre.diff .removed { color: #991b1b; }
html[data-theme="light"] pre.diff.cfg.numbered i { color: #94a3b8; }
html[data-theme="light"] .login-brand { background: radial-gradient(1200px 600px at 20% 20%, #c7d2fe 0%, #f3f5fa 60%); }
html[data-theme="light"] .wallboard { background: radial-gradient(1400px 700px at 80% -10%, #e0e7ff, var(--bg) 60%); }
html[data-theme="light"] .site-dot { border-color: #fff; box-shadow: 0 0 0 2px rgba(15,23,42,.15); }
html[data-theme="light"] .site-label { color: #0f172a; text-shadow: 0 0 3px #fff, 0 0 2px #fff; }
html[data-theme="light"] .maplibregl-popup-content { background: #fff; color: #0f172a; border-color: #cfd7e3; } html[data-theme="light"] .maplibregl-popup-content a { color: #4338ca; }
html[data-theme="light"] .maplibregl-popup-tip { border-top-color: #fff !important; }
html[data-theme="light"] .topology.wm { background: radial-gradient(circle at 50% 40%, #ffffff, #eef2f7 70%); }
html[data-theme="light"] .wm-legend i.dashed { background: repeating-linear-gradient(90deg, #94a3b8 0 6px, transparent 6px 10px); }
html[data-theme="light"] .wm-tip { box-shadow: 0 12px 32px rgba(15,23,42,.18); }
html[data-theme="light"] .brand { color: var(--text); }

/* Traffic Analytics (Phase A) */
.flow-bar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 14px; } .flow-bar .grow { flex: 1; }
.flow-chips { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin: -4px 0 14px; }
.flow-chip { display: inline-flex; align-items: center; gap: 6px; padding: 3px 4px 3px 10px; border-radius: 14px; font-size: 12.5px; background: rgba(99,102,241,.16); border: 1px solid rgba(99,102,241,.45); }
.flow-chip button { background: transparent; border: 0; color: inherit; cursor: pointer; font-size: 14px; line-height: 1; padding: 0 5px; border-radius: 10px; } .flow-chip button:hover { background: rgba(99,102,241,.3); }
.small-btn { padding: 3px 10px; font-size: 12px; }
.flow-table tbody tr { cursor: pointer; } .flow-table .r, .flow-table th.r { text-align: right; } .flow-table td.share { white-space: nowrap; width: 120px; color: var(--muted); font-size: 12px; }
.rxtx { display: inline-flex; width: 90px; height: 9px; border-radius: 4px; overflow: hidden; vertical-align: middle; background: #3b82f6; margin-right: 6px; } .rxtx .rx { background: #22c55e; height: 100%; }
.chart.tall { height: 320px; }
.flow-table .lbl { margin-left: 8px; }
.flow-table .bar .fill { display: block; }
.flow-search { width: 170px; padding: 4px 8px; font-size: 12.5px; }

/* Endpoints (ARP/MAC discovery) */
.ep-vendors { display: grid; grid-template-columns: minmax(240px, 340px) 1fr; gap: 18px; align-items: center; } @media (max-width: 900px) { .ep-vendors { grid-template-columns: 1fr; } }
.ep-legend { columns: 2; column-gap: 24px; } .ep-legend li { break-inside: avoid; cursor: pointer; border-radius: 6px; padding: 6px 8px; } .ep-legend li:hover, .ep-legend li.on { background: rgba(99,102,241,.14); }
.ep-legend i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; flex: none; }
.ep-table td .badge { margin-left: 6px; font-size: 10.5px; padding: 1px 6px; }
/* Device summary: three columns of panels (one column on narrow screens) */
.sum-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.sum-col { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.sum-col .card { margin: 0; } .sum-col .kv { grid-template-columns: 118px 1fr; }
.sum-col .cg-stack { gap: 12px; } .sum-sub { margin: 14px 0 4px; }
@media (max-width: 1350px) { .sum-grid { grid-template-columns: 1fr 1fr; } .sum-grid > .sum-col:nth-child(3) { grid-column: span 2; display: grid; grid-template-columns: 1fr 1fr; } }
@media (max-width: 900px) { .sum-grid, .sum-grid > .sum-col:nth-child(3) { grid-template-columns: 1fr; grid-column: auto; } }
.maint-banner { background: rgba(100,116,139,.16); border: 1px solid var(--line-3); border-radius: 10px; padding: 9px 14px; margin-bottom: 14px; }
.ok-text { color: var(--ok); } .warn-text { color: var(--warn); } .crit-text { color: var(--crit); } .center { text-align: center; }
.note-add { display: flex; gap: 8px; align-items: flex-start; margin-bottom: 8px; } .note-add textarea { flex: 1; resize: vertical; min-height: 38px; }
.note-text { white-space: pre-wrap; word-break: break-word; }

/* ── Home summary ── */
.home-grid { margin-top: 0; }
.small-tabs { margin-bottom: 10px; width: fit-content; } .small-tabs .tab { padding: 4px 10px; font-size: 12.5px; }
.tree, .tree-leaves { list-style: none; margin: 0; padding: 0; }
.tree > li { border-bottom: 1px solid var(--line); } .tree > li:last-child { border-bottom: 0; }
.tree-row { display: flex; align-items: center; gap: 8px; width: 100%; background: none; border: 0; color: var(--text); font: inherit; padding: 7px 4px; cursor: pointer; text-align: left; }
.tree-row:hover { background: var(--chip); border-radius: 6px; } .tree-row .grow { flex: 1; min-width: 0; }
.tree .caret { width: 12px; color: var(--muted); font-size: 11px; }
.tree-leaves { padding: 0 0 6px 22px; } .tree-leaves li { display: flex; align-items: center; gap: 8px; padding: 4px 4px; font-size: 13px; }
.tree-leaves .grow { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tree-leaves .hp { width: 38px; text-align: right; color: var(--text-2); }
.sev-counts { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-bottom: 10px; }
.sev-count { display: flex; align-items: center; gap: 8px; background: none; border: 1px solid var(--line); border-radius: 8px; padding: 6px 8px; color: var(--text); font: inherit; cursor: pointer; text-align: left; }
.sev-count .sev-icon { width: 24px; height: 24px; border-radius: 6px; font-size: 13px; } .sev-count b { font-size: 16px; }
.sev-count .small { line-height: 1.1; } .sev-count.on { border-color: var(--accent); background: var(--chip); }
.alert-tools { display: flex; gap: 8px; margin-bottom: 8px; } .alert-tools input { flex: 1; min-width: 0; padding: 6px 10px; }
.alert-list { list-style: none; margin: 0; padding: 0; }
.alert-list li { display: flex; align-items: center; gap: 10px; padding: 8px 6px 8px 0; border-bottom: 1px solid var(--line); }
.alert-list li:last-child { border-bottom: 0; } .alert-list .grow { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.alert-list .sev-bar { width: 4px; align-self: stretch; border-radius: 2px; background: var(--info); }
.alert-list li.critical .sev-bar { background: var(--crit); } .alert-list li.major .sev-bar { background: var(--major); }
.alert-list li.minor .sev-bar, .alert-list li.warning .sev-bar { background: var(--warn); }
.pager { display: flex; align-items: center; justify-content: center; gap: 10px; padding-top: 8px; }
.health-split { display: grid; grid-template-columns: 1fr 150px; align-items: center; gap: 8px; }
.two-lists { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
h3.mini { font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin: 0 0 6px; font-weight: 600; }
.bar-row { display: grid; grid-template-columns: minmax(0, 1fr) 90px; gap: 8px; align-items: center; padding: 3px 0; font-size: 13px; }
.bar-row a { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.meter { position: relative; display: block; height: 16px; background: var(--chip); border-radius: 4px; overflow: hidden; }
.meter-fill { position: absolute; inset: 0 auto 0 0; background: var(--ok); opacity: .75; }
.meter.warn .meter-fill { background: var(--warn); } .meter.crit .meter-fill { background: var(--crit); }
.meter-label { position: relative; display: block; text-align: center; font-size: 11px; line-height: 16px; font-weight: 600; color: var(--text); }
@media (max-width: 1350px) { .sev-counts { grid-template-columns: 1fr 1fr; } }
.table th.num, .table td.num { text-align: right; font-variant-numeric: tabular-nums; }

/* ── Alerts page ── */
.alerts-layout { display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: 16px; align-items: start; }
@media (max-width: 1000px) { .alerts-layout { grid-template-columns: 1fr; } }
.filters { position: sticky; top: 12px; }
.facet { border-top: 1px solid var(--line); padding: 6px 0; } .facet:first-of-type { border-top: 0; }
.facet-head { display: flex; align-items: center; gap: 6px; width: 100%; background: none; border: 0; color: var(--text); font: inherit; font-weight: 600; padding: 6px 2px; cursor: pointer; text-align: left; }
.facet-head .caret { width: 12px; color: var(--muted); font-size: 11px; } .pill.sel { background: var(--accent); color: #fff; margin-left: auto; }
label.facet-item { display: flex; flex-direction: row; align-items: center; gap: 8px; padding: 4px 2px 4px 18px; margin: 0; font-size: 13px; color: var(--text); cursor: pointer; } .facet-item:hover { background: var(--chip); border-radius: 6px; }
.facet-item .grow { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } .facet-item.zero { opacity: .45; }
.facet-item input, .chk input { padding: 0; width: 14px; height: 14px; } .facet-empty { padding: 2px 18px; }
.sev-icon.tiny { width: 18px; height: 18px; border-radius: 5px; font-size: 11px; display: inline-grid; }
.linkish { background: none; border: 0; color: var(--accent); cursor: pointer; font: inherit; padding: 0; }
.alerts-bar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 10px; } .alerts-bar .small-tabs { margin: 0; }
.alerts-bar input.grow { flex: 1; min-width: 220px; padding: 6px 10px; }
.bulk-bar { display: flex; gap: 8px; align-items: center; padding: 8px 10px; margin-bottom: 10px; border: 1px dashed var(--line-2); border-radius: 8px; opacity: .7; }
.bulk-bar.on { opacity: 1; border-style: solid; border-color: var(--accent); } .bulk-bar input { flex: 1; min-width: 160px; padding: 5px 9px; }
.table-scroll { overflow-x: auto; }
.alerts-table th.sortable { cursor: pointer; user-select: none; white-space: nowrap; } .alerts-table th.sortable.on { color: var(--text); }
.alerts-table .chk { width: 24px; } .alerts-table td { vertical-align: top; }
.alerts-table .alert-name { display: flex; gap: 8px; min-width: 240px; } .alerts-table .alert-name > span:last-child { display: flex; flex-direction: column; }
.alerts-table .msg { max-width: 260px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nowrap { white-space: nowrap; }
.pager select { padding: 4px 8px; font-size: 12px; }
.hw-counts { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 13px; margin-bottom: 8px; } .hw-counts b { margin-right: 3px; }

/* ── NetFlow drill-down ── */
.timerange { position: relative; } .timerange .small-tabs { margin: 0; }
.timerange-pop { position: absolute; right: 0; top: calc(100% + 6px); z-index: 30; width: 340px; padding: 12px; display: flex; flex-direction: column; gap: 6px; box-shadow: 0 12px 32px rgba(0,0,0,.35); }
.timerange-pop .tr-row { display: flex; gap: 8px; align-items: center; } .timerange-pop .tr-row input, .timerange-pop .tr-row select { padding: 5px 8px; min-width: 0; flex: 1; }
.timerange-pop label.toggle { margin: 4px 0 0; }
.flow-grid { margin-top: 4px; }
.flow-table .chk { white-space: nowrap; width: 40px; } .flow-table .chk input { width: 14px; height: 14px; padding: 0; vertical-align: middle; }
.swatch { display: inline-block; width: 11px; height: 11px; border-radius: 2px; margin-right: 6px; vertical-align: middle; }
.flow-panel .card-head h2 { margin-bottom: 0; }
span.bar { display: block; height: 8px; background: var(--chip); border-radius: 4px; overflow: hidden; } span.bar > span { display: block; height: 100%; background: var(--accent); }
.flow-table a.drill { margin-left: 8px; }

/* ── Adopt dialog ── */
.modal-back { position: fixed; inset: 0; background: rgba(2,6,23,.6); z-index: 60; display: grid; place-items: center; padding: 20px; }
.modal { width: min(620px, 100%); max-height: 90vh; overflow: auto; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 4px 12px; }
.form-grid label input, .form-grid label select { width: 100%; }
.modal .actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin: 6px 0 12px; }
.modal h3.mini { margin-top: 12px; }
.modal .banner.ok-banner { border-color: rgba(34,197,94,.45); background: rgba(34,197,94,.08); }
.modal .banner.warn-banner { border-color: rgba(245,158,11,.45); background: rgba(245,158,11,.08); }
.snmp-cell { white-space: nowrap; } .snmp-cell .btn { margin-left: 6px; }
.toast { position: fixed; right: 20px; bottom: 20px; z-index: 70; background: var(--panel); border: 1px solid var(--accent); border-radius: 10px; padding: 10px 14px; box-shadow: 0 10px 30px rgba(0,0,0,.4); }
.modal .banner { border: 1px solid var(--line-3); border-radius: 10px; padding: 9px 14px; margin: 8px 0; background: rgba(100,116,139,.12); }

/* ── Groups ── */
.group-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(360px, 1fr)); gap: 16px; align-items: start; }
.group-grid .card-head .tree-row { padding: 0; }
.group-editor { margin-bottom: 16px; } .group-editor .small-tabs { margin: 8px 0; }
.rule-row { display: grid; grid-template-columns: 180px 140px minmax(0, 1fr) auto; gap: 8px; margin-bottom: 6px; }
.pick-list { max-height: 280px; overflow: auto; border: 1px solid var(--line); border-radius: 8px; padding: 4px; }

/* ── Personal dashboards ── */
.dash-tabs { margin-top: 6px; flex-wrap: wrap; } .dash-tabs a.tab { text-decoration: none; }
.dash-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; align-items: start; }
.dash-w.w2 { grid-column: span 2; } .dash-w.w3 { grid-column: span 3; }
@media (max-width: 1100px) { .dash-grid { grid-template-columns: 1fr; } .dash-w.w2, .dash-w.w3 { grid-column: auto; } }
.dash-w .flow-panel { border: 0; padding: 0; margin: 0; background: none; box-shadow: none; } .dash-w .flow-panel > .card-head { display: none; }
.w-tools { display: flex; gap: 4px; }
.add-widget { margin-bottom: 16px; } .add-widget textarea { width: 100%; }

/* ── Reports ── */
.reports-layout { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 16px; align-items: start; }
@media (max-width: 1000px) { .reports-layout { grid-template-columns: 1fr; } }
.report-catalog h3.mini { margin-top: 12px; } .report-catalog h3.mini:first-child { margin-top: 0; }
.report-pick { display: flex; flex-direction: column; gap: 2px; width: 100%; text-align: left; background: none; border: 1px solid transparent; border-radius: 8px;
  padding: 7px 9px; color: var(--text); font: inherit; cursor: pointer; } .report-pick:hover { background: var(--chip); } .report-pick.on { border-color: var(--accent); background: var(--chip); }
.report-pick .small { line-height: 1.3; }
.saved-row { display: flex; align-items: center; gap: 6px; } .saved-row .grow { flex: 1; text-align: left; }
.report-form .actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-top: 8px; } .report-form .actions input { width: 200px; }
.schedule-box { margin-top: 10px; border-top: 1px solid var(--line, #2a3340); padding-top: 8px; } .schedule-box summary { cursor: pointer; font-weight: 600; font-size: 13px; }
.schedule-box .wide { grid-column: span 2; } .schedule-box .wide input { width: 100%; }
.saved-row .tag { font-size: 10px; padding: 1px 6px; border-radius: 8px; background: rgba(90,160,255,.15); color: #8ec1ff; }
.report-out { margin-top: 16px; }
.report-kpis { grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); margin: 4px 0 12px; }
.kpi-mini { display: flex; flex-direction: column; gap: 2px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; } .kpi-mini b { font-size: 20px; }
.kpi-mini.ok b { color: var(--ok); } .kpi-mini.warn b { color: var(--warn); } .kpi-mini.crit b { color: var(--crit); }
.account-card { max-width: 560px; } .form-grid.narrow { grid-template-columns: 1fr; } .alert.ok { background: rgba(34,197,94,.12); color: #4ade80; padding: 8px 12px; border-radius: 6px; margin-bottom: 10px; }
a.user { text-decoration: none; } a.user:hover { text-decoration: underline; }
