/* Beacon NMS. Steel-grey chrome; severity is the only saturated colour in the interface. */
@font-face { font-family: 'Atkinson Hyperlegible Next'; src: url('fonts/AtkinsonHyperlegibleNext.woff2') format('woff2'); font-weight: 200 800; font-display: swap; }
@font-face { font-family: 'Atkinson Hyperlegible Mono'; src: url('fonts/AtkinsonHyperlegibleNextMono.woff2') format('woff2'); font-weight: 200 800; font-display: swap; }

:root {
  color-scheme: dark;
  --bg: #14181d; --panel: #1b2027; --panel-2: #222831; --line: #2d353f; --grid: #262d36;
  --text: #e7eaee; --muted: #9aa4af; --link: #79adf6; --focus: #79adf6;
  --btn-bg: #262d36; --btn-hover: #2f3742; --primary-bg: #e7eaee; --primary-text: #14181d;
  --danger: #ef6b6b; --ok: #4cc070;
  --sev-critical: #e5484d; --sev-major: #f07a3a; --sev-minor: #f3aa3c; --sev-warning: #e6d24d; --sev-info: #5c9ef0; --sev-normal: #46b866;
  --series-1: #3987e5; --t1: #5c9ef0; --t2: #2bb3a3; --t3: #9a86ee; --t4: #e6a23c; --t5: #8d99a6;
  --shadow: 0 12px 40px rgba(0, 0, 0, .45);
  --radius: 8px; --radius-sm: 6px;
  --font: 'Atkinson Hyperlegible Next', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --mono: 'Atkinson Hyperlegible Mono', ui-monospace, 'Cascadia Mono', Consolas, monospace;
}
:root[data-theme="light"] {
  color-scheme: light;
  --bg: #eef1f4; --panel: #ffffff; --panel-2: #f6f8fa; --line: #d5dce3; --grid: #e8ecf0;
  --text: #17202a; --muted: #586474; --link: #1d5fc2; --focus: #1d5fc2;
  --btn-bg: #ffffff; --btn-hover: #f0f3f6; --primary-bg: #17202a; --primary-text: #ffffff;
  --danger: #c42b2b; --ok: #1d7f3a;
  --sev-critical: #d42f35; --sev-major: #e0621f; --sev-minor: #e8940f; --sev-warning: #d9bd12; --sev-info: #2a74d6; --sev-normal: #279447;
  --series-1: #2a78d6; --t1: #2a74d6; --t2: #14917f; --t3: #6c55d8; --t4: #c27c0c; --t5: #6b7684;
  --shadow: 0 12px 40px rgba(20, 30, 45, .18);
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { background: var(--bg); color: var(--text); font: 15px/1.45 var(--font); -webkit-font-smoothing: antialiased; font-variant-numeric: tabular-nums; }
a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 26px; line-height: 1.2; font-weight: 700; margin: 0; letter-spacing: -.01em; }
h2 { font-size: 17px; font-weight: 700; margin: 0; }
h3 { font-size: 14px; font-weight: 700; margin: 18px 0 8px; }
p { margin: 0 0 10px; }
code, .mono { font-family: var(--mono); font-size: .92em; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.nowrap { white-space: nowrap; }
.break { word-break: break-all; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 4px; }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }

/* ---------- layout ---------- */
.app { display: grid; grid-template-columns: 220px 1fr; height: 100vh; }
.sidebar { background: var(--panel); border-right: 1px solid var(--line); display: flex; flex-direction: column; padding: 14px 10px; gap: 10px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); font-weight: 800; font-size: 19px; padding: 6px 10px 14px; letter-spacing: -.01em; }
.brand:hover { text-decoration: none; }
/* The mark is a stack of severity bands: the product's colour language in miniature. */
.brand-mark { width: 22px; height: 22px; border-radius: 5px; background: linear-gradient(var(--sev-critical) 0 25%, var(--sev-major) 25% 50%, var(--sev-minor) 50% 75%, var(--sev-normal) 75%); }
.brand-mark.big { width: 44px; height: 44px; border-radius: 9px; }
.nav-links { display: flex; flex-direction: column; gap: 2px; }
.nav-link { display: flex; align-items: center; gap: 12px; padding: 9px 12px; border-radius: var(--radius-sm); color: var(--muted); font-weight: 600; }
.nav-link:hover { background: var(--panel-2); color: var(--text); text-decoration: none; }
.nav-link.active { background: var(--panel-2); color: var(--text); box-shadow: inset 3px 0 0 var(--text); }
.nav-link span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav-foot { margin-top: auto; border-top: 1px solid var(--line); padding-top: 10px; display: flex; flex-direction: column; gap: 6px; }
.nav-tools { display: flex; gap: 4px; padding: 0 6px; }
.content { display: flex; flex-direction: column; min-width: 0; height: 100vh; }
.topbar { display: flex; align-items: stretch; gap: 12px; padding: 12px 24px; border-bottom: 1px solid var(--line); background: var(--bg); }
.main { flex: 1; overflow: auto; padding: 22px 24px 48px; outline: none; }

/* ---------- severity rail ---------- */
.rail { flex: 1; display: flex; min-height: 40px; border-radius: var(--radius); overflow: hidden; gap: 2px; background: var(--line); }
.rail:hover { text-decoration: none; }
.rail-seg { display: flex; align-items: baseline; gap: 8px; padding: 0 14px; color: #12161b; align-items: center; min-width: 96px; cursor: pointer; transition: filter .15s; }
.rail-seg:hover { filter: brightness(1.08); }
.rail-num { font-size: 22px; font-weight: 800; line-height: 1; }
.rail-label { font-weight: 700; font-size: 13px; }
.rail-clear { background: var(--panel); border: 1px solid var(--line); align-items: center; padding: 0 14px; color: var(--muted); font-weight: 600; }
.rail-clear-text { display: flex; align-items: center; gap: 10px; }
.sev-bg-critical { background: var(--sev-critical); } .sev-bg-major { background: var(--sev-major); } .sev-bg-minor { background: var(--sev-minor); }
.sev-bg-warning { background: var(--sev-warning); } .sev-bg-info { background: var(--sev-info); } .sev-bg-normal { background: var(--sev-normal); }
.live { align-self: center; font-size: 13px; font-weight: 600; color: var(--muted); display: flex; align-items: center; gap: 6px; white-space: nowrap; }
.live::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: var(--muted); }
.live-live::before { background: var(--sev-normal); }
.live-offline { color: var(--danger); } .live-offline::before { background: var(--danger); }

/* ---------- severity badge: a distinct shape per level so colour is never the only cue ---------- */
.sev { display: inline-flex; align-items: center; gap: 7px; font-weight: 700; font-size: 13px; white-space: nowrap; }
.sev-glyph { width: 12px; height: 12px; flex: none; }
.sev-critical .sev-glyph { background: var(--sev-critical); clip-path: polygon(30% 0, 70% 0, 100% 30%, 100% 70%, 70% 100%, 30% 100%, 0 70%, 0 30%); }
.sev-major .sev-glyph { background: var(--sev-major); clip-path: polygon(50% 0, 100% 100%, 0 100%); }
.sev-minor .sev-glyph { background: var(--sev-minor); clip-path: polygon(50% 0, 100% 50%, 50% 100%, 0 50%); }
.sev-warning .sev-glyph { background: var(--sev-warning); border-radius: 2px; transform: scale(.85); }
.sev-info .sev-glyph { background: var(--sev-info); border-radius: 50%; transform: scale(.85); }
.sev-normal .sev-glyph { background: var(--sev-normal); border-radius: 50%; box-shadow: inset 0 0 0 3px var(--panel); outline: 2px solid var(--sev-normal); outline-offset: -2px; }

.status { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; font-size: 13px; white-space: nowrap; }
.status .dot { width: 9px; height: 9px; border-radius: 50%; background: var(--muted); }
.status-up .dot { background: var(--sev-normal); }
.status-warning .dot { background: var(--sev-warning); border-radius: 2px; }
.status-down .dot { background: var(--sev-critical); clip-path: polygon(30% 0, 70% 0, 100% 30%, 100% 70%, 70% 100%, 30% 100%, 0 70%, 0 30%); border-radius: 0; }
.status-paused .dot { background: transparent; border: 2px solid var(--muted); }

/* ---------- page furniture ---------- */
.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 18px; flex-wrap: wrap; }
.page-head .sub { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-top: 8px; color: var(--muted); align-items: center; }
.head-actions, .btn-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.crumbs { font-size: 13px; color: var(--muted); margin-bottom: 6px; }
.lead { max-width: 70ch; }
.updated { font-size: 13px; padding-top: 8px; }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; margin-bottom: 16px; min-width: 0; }
.panel-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 12px; flex-wrap: wrap; }
.panel-head a { font-size: 14px; font-weight: 600; }
.last-result { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 14px; margin-bottom: 16px; }
.notes-text { max-width: 80ch; white-space: pre-wrap; }
.error-box, .form-error { color: var(--danger); font-weight: 600; }
.ok-text { color: var(--ok); font-weight: 600; }
.empty { text-align: center; padding: 48px 16px; color: var(--muted); }
.empty h3 { color: var(--text); font-size: 17px; margin: 0 0 6px; }
.empty .btn { margin-top: 12px; }
.empty-chart { padding: 40px 0; text-align: center; }

/* ---------- buttons & forms ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; font: 600 14px var(--font); padding: 8px 14px; border-radius: var(--radius-sm);
  border: 1px solid var(--line); background: var(--btn-bg); color: var(--text); cursor: pointer; white-space: nowrap; text-decoration: none !important; }
.btn:hover { background: var(--btn-hover); }
.btn.primary { background: var(--primary-bg); color: var(--primary-text); border-color: var(--primary-bg); }
.btn.primary:hover { filter: brightness(.92); }
.btn.danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn.danger-text { color: var(--danger); }
.btn.small { padding: 4px 10px; font-size: 13px; }
.btn.block { width: 100%; padding: 11px; }
.btn:disabled { opacity: .45; cursor: default; }
.icon-btn { display: inline-flex; align-items: center; justify-content: center; width: 34px; height: 34px; border-radius: var(--radius-sm); border: 0; background: transparent; color: var(--muted); cursor: pointer; font-size: 20px; }
.icon-btn:hover { background: var(--panel-2); color: var(--text); }
.icon-btn[aria-pressed="true"] { color: var(--text); background: var(--panel-2); }
.link-btn { background: none; border: 0; color: var(--link); font: 600 14px var(--font); padding: 6px 0; cursor: pointer; }
.link-btn:disabled { color: var(--muted); cursor: default; }
input, select, textarea { font: 15px var(--font); color: var(--text); background: var(--panel-2); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 8px 10px; width: 100%; min-width: 0; }
textarea { resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: var(--focus); outline: 1px solid var(--focus); }
input[type=checkbox] { width: 17px; height: 17px; accent-color: var(--text); padding: 0; }
.field { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.field.wide { grid-column: 1 / -1; }
.field label { font-size: 13px; font-weight: 700; color: var(--muted); }
.help { color: var(--muted); font-size: 12.5px; }
.check { display: flex; align-items: center; gap: 9px; font-weight: 600; cursor: pointer; flex-wrap: wrap; align-self: end; padding: 8px 0; }
.check .help { flex-basis: 100%; padding-left: 26px; }
.check-row { display: flex; flex-wrap: wrap; gap: 4px 24px; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 14px 16px; margin-bottom: 14px; }
fieldset { border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 16px 6px; margin: 0 0 14px; min-width: 0; }
legend { font-weight: 700; padding: 0 6px; }
.help-box { background: var(--panel-2); border-radius: var(--radius-sm); padding: 10px 12px; }
.spacer { flex: 1; }

/* ---------- toolbar, tabs ---------- */
.toolbar { display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; margin-bottom: 12px; }
.tool { display: flex; flex-direction: column; gap: 4px; font-size: 12.5px; font-weight: 700; color: var(--muted); }
.tool select { width: auto; max-width: 190px; }
.tool.grow { flex: 1; min-width: 200px; }
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin-bottom: 14px; overflow-x: auto; }
.tab { background: none; border: 0; border-bottom: 3px solid transparent; color: var(--muted); font: 600 14px var(--font); padding: 9px 14px; cursor: pointer; white-space: nowrap; display: flex; gap: 8px; align-items: center; }
.tab:hover { color: var(--text); }
.tab[aria-selected="true"] { color: var(--text); border-bottom-color: var(--text); }
.tab-x { color: var(--muted); font-size: 16px; line-height: 1; padding: 0 2px; }
.tab-x:hover { color: var(--danger); }
.tab-add { color: var(--link); }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: var(--radius-sm); overflow: hidden; }
.seg button { background: var(--btn-bg); color: var(--muted); border: 0; border-right: 1px solid var(--line); padding: 5px 11px; font: 600 13px var(--font); cursor: pointer; }
.seg button:last-child { border-right: 0; }
.seg button[aria-pressed="true"] { background: var(--primary-bg); color: var(--primary-text); }

/* ---------- tables ---------- */
.table-wrap { overflow-x: auto; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); }
.panel .table-wrap, .admin-body .table-wrap { border: 0; }
table.grid { width: 100%; border-collapse: collapse; font-size: 14px; }
.grid th { text-align: left; font-size: 12.5px; font-weight: 700; color: var(--muted); padding: 9px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; position: sticky; top: 0; background: var(--panel); }
.grid td { padding: 8px 12px; border-bottom: 1px solid var(--grid); vertical-align: middle; }
.grid tbody tr:last-child td { border-bottom: 0; }
.grid tr.clickable, .grid tr.ev { cursor: pointer; }
.grid tbody tr:hover td { background: var(--panel-2); }
.grid .num, .mini .num { text-align: right; }
.grid td.msg { max-width: 560px; }
.grid td.cb, .grid th.cb { width: 34px; padding-right: 0; }
.grid td.actions { text-align: right; white-space: nowrap; }
.grid td.actions .btn { margin-left: 4px; }
.table-foot { padding: 8px 12px; margin: 0; }
table.mini { width: 100%; border-collapse: collapse; font-size: 14px; }
.mini td { padding: 7px 4px; border-bottom: 1px solid var(--grid); }
.mini tr:last-child td { border-bottom: 0; }
.mini tr.clickable { cursor: pointer; }
.mini tr.clickable:hover td { background: var(--panel-2); }
.inline { display: inline-flex; align-items: center; gap: 4px; }

/* alarm rows carry a severity edge */
tr.ev td:first-child { box-shadow: inset 4px 0 0 var(--edge, transparent); }
.edge-critical { --edge: var(--sev-critical); } .edge-major { --edge: var(--sev-major); } .edge-minor { --edge: var(--sev-minor); }
.edge-warning { --edge: var(--sev-warning); } .edge-info { --edge: var(--sev-info); } .edge-normal { --edge: var(--sev-normal); }
tr.ev.dim td { color: var(--muted); }
tr.ev.dim .sev { opacity: .8; }
tr.ev.current td { background: var(--panel-2); }
tr.ev.fresh td { animation: fresh 2.5s ease-out; }
@keyframes fresh { from { background: color-mix(in srgb, var(--edge) 22%, transparent); } to { background: transparent; } }
td.state { font-size: 13px; }

.alarm-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.alarm-item { display: flex; gap: 12px; align-items: flex-start; padding: 10px 12px; border-radius: var(--radius-sm); background: var(--panel-2); box-shadow: inset 4px 0 0 var(--edge); cursor: pointer; }
.alarm-item:hover { filter: brightness(1.06); }
.alarm-item .sev { min-width: 82px; padding-top: 1px; }
.alarm-msg { font-weight: 600; }
.alarm-text { min-width: 0; }
.alarm-list.compact .alarm-item { padding: 7px 10px; }

/* ---------- alarm browser ---------- */
.alarms-layout { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; }
.alarms-main { min-width: 0; }
.with-detail .opt { display: none; }
.alarms-layout.with-detail { grid-template-columns: minmax(0, 1fr) 360px; }
.bulk .spacer { flex: 1; }
.bulk { display: flex; gap: 8px; align-items: center; margin-bottom: 10px; flex-wrap: wrap; min-height: 36px; }
.bulk select { width: auto; }
.detail { display: none; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; align-self: start; position: sticky; top: 0; max-height: calc(100vh - 120px); overflow: auto; }
.with-detail .detail { display: block; }
.detail-head { display: flex; justify-content: space-between; align-items: center; }
.detail-title { font-size: 18px; margin: 8px 0 12px; line-height: 1.3; }
.detail-actions { display: flex; gap: 8px; margin-bottom: 14px; }
.kvs { margin: 0; display: grid; gap: 8px; }
.kvs.cols { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px 20px; }
.kv dt { font-size: 12.5px; font-weight: 700; color: var(--muted); }
.kv dd { margin: 2px 0 0; overflow-wrap: anywhere; }
.notes { list-style: none; padding: 0; margin: 0 0 10px; display: flex; flex-direction: column; gap: 10px; }
.note-form { display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }

/* ---------- dashboard ---------- */
.dash { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(300px, 1fr); gap: 16px; }
.dash > .panel, .dash-side > .panel { margin: 0; }
.dash-side { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.attention .alarm-list { max-height: 460px; overflow: auto; }
.health-figures { display: flex; gap: 32px; margin-bottom: 12px; }
.health-figures > div { display: flex; flex-direction: column; }
.big-num { font-size: 34px; font-weight: 800; line-height: 1.05; }
.health-bar { display: flex; height: 12px; border-radius: 6px; overflow: hidden; gap: 2px; margin-bottom: 10px; }
.hb-up { background: var(--sev-normal); } .hb-warning { background: var(--sev-warning); } .hb-down { background: var(--sev-critical); } .hb-unknown { background: var(--line); }
.legend-row { list-style: none; padding: 0; margin: 0; display: flex; gap: 18px; flex-wrap: wrap; }
.poller-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 8px; }
.poller-list li { display: grid; grid-template-columns: 90px 1fr auto; gap: 8px; align-items: center; }
.days { font-weight: 700; white-space: nowrap; }
.days-critical { color: var(--sev-critical); } .days-major { color: var(--sev-major); } .days-warning { color: var(--sev-minor); } .days-ok { color: var(--muted); }

/* ---------- monitor ---------- */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--radius-sm); overflow: hidden; margin-bottom: 14px; }
.stat { background: var(--panel); padding: 10px 14px; }
.stat-v { font-size: 20px; font-weight: 800; }
.stat-l { font-size: 12.5px; color: var(--muted); font-weight: 600; }
.chart { width: 100%; }
.tbar { display: flex; height: 14px; border-radius: 4px; overflow: hidden; gap: 2px; margin: 4px 0 8px; }
.tbar-0 { background: var(--t1); } .tbar-1 { background: var(--t2); } .tbar-2 { background: var(--t3); } .tbar-3 { background: var(--t4); } .tbar-4 { background: var(--t5); }
.tlegend { list-style: none; padding: 0; margin: 0 0 6px; display: flex; flex-wrap: wrap; gap: 4px 16px; font-size: 13px; }
.tlegend li { display: flex; align-items: center; gap: 6px; }
.sw { width: 10px; height: 10px; border-radius: 2px; display: inline-block; }
.problems { color: var(--sev-major); margin: 12px 0 0; }
.problem { color: var(--sev-major); font-size: 13px; }
.screenshot { max-width: 100%; border: 1px solid var(--line); border-radius: var(--radius-sm); }
.versions-layout { display: grid; grid-template-columns: 200px 1fr; gap: 16px; }
.versions { list-style: none; padding: 0; margin: 0; max-height: 420px; overflow: auto; }
.diff-body { font-family: var(--mono); font-size: 13px; max-height: 420px; overflow: auto; background: var(--panel-2); border-radius: var(--radius-sm); padding: 8px; }
.d-add { color: var(--ok); white-space: pre-wrap; } .d-del { color: var(--danger); white-space: pre-wrap; text-decoration: line-through; text-decoration-color: color-mix(in srgb, var(--danger) 50%, transparent); }
.d-same { color: var(--muted); font-style: italic; padding: 2px 0; }

/* ---------- certificates ---------- */
.cert-summary { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-bottom: 16px; }
.cert-band { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 16px; display: flex; flex-direction: column; box-shadow: inset 4px 0 0 var(--b); }
.band-critical { --b: var(--sev-critical); } .band-warning { --b: var(--sev-minor); } .band-ok { --b: var(--sev-normal); }

/* ---------- modal & toast ---------- */
.modal-backdrop { position: fixed; inset: 0; background: rgba(8, 11, 15, .6); display: flex; align-items: flex-start; justify-content: center; padding: 6vh 16px; z-index: 50; overflow: auto; }
.modal { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); width: 100%; max-width: 520px; display: flex; flex-direction: column; max-height: 88vh; }
.modal.wide { max-width: 820px; }
.modal-head { display: flex; justify-content: space-between; align-items: center; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.modal-body { padding: 16px 18px; overflow: auto; }
.modal-foot { display: flex; gap: 8px; justify-content: flex-end; padding: 12px 18px; border-top: 1px solid var(--line); align-items: center; }
.toasts { position: fixed; bottom: 18px; right: 18px; display: flex; flex-direction: column; gap: 8px; z-index: 100; }
.toast { background: var(--primary-bg); color: var(--primary-text); padding: 10px 16px; border-radius: var(--radius-sm); box-shadow: var(--shadow); font-weight: 600; max-width: 420px; transition: opacity .3s; }
.toast-error { background: var(--danger); color: #fff; }
.toast.leaving { opacity: 0; }
.test-result { margin-top: 6px; }
.test-result .result-head { display: flex; gap: 12px; align-items: center; padding: 10px 12px; background: var(--panel-2); border-radius: var(--radius-sm); margin-bottom: 8px; }
.transcript, .cmd { font-family: var(--mono); font-size: 12.5px; background: var(--panel-2); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 10px; overflow: auto; max-height: 300px; white-space: pre-wrap; word-break: break-all; }
.monitor-form fieldset .form-grid { margin-bottom: 8px; }

/* ---------- admin ---------- */
.admin-layout { display: grid; grid-template-columns: 210px 1fr; gap: 20px; align-items: start; }
.admin-nav { display: flex; flex-direction: column; gap: 2px; position: sticky; top: 0; }
.admin-nav a { padding: 8px 12px; border-radius: var(--radius-sm); color: var(--muted); font-weight: 600; }
.admin-nav a:hover { background: var(--panel); color: var(--text); text-decoration: none; }
.admin-nav a.active { background: var(--panel); color: var(--text); box-shadow: inset 3px 0 0 var(--text); }
.admin-body { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; min-width: 0; }
.admin-body > form { max-width: 920px; }

/* ---------- login ---------- */
.login { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 24px 16px; gap: 24px; }
.login-brand { display: flex; align-items: center; gap: 14px; }
.login-brand h1 { font-size: 30px; }
.login-brand p { margin: 0; color: var(--muted); }
.login-card { width: 100%; max-width: 390px; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 24px; box-shadow: var(--shadow); }
.login-card form { display: flex; flex-direction: column; gap: 14px; }
.login-card h2 { margin-bottom: 4px; }
.login-card .qr { align-self: center; background: #fff; padding: 8px; border-radius: 8px; }
.or { text-align: center; color: var(--muted); margin: 14px 0; font-size: 13px; }
.codes { columns: 2; font-size: 15px; padding-left: 22px; }
.secret code { word-break: break-all; }
details summary { cursor: pointer; color: var(--link); font-weight: 600; font-size: 14px; }

/* ---------- responsive ---------- */
@media (max-width: 1100px) {
  .dash { grid-template-columns: 1fr; }
  .alarms-layout.with-detail { grid-template-columns: 1fr; }
  .detail { position: static; max-height: none; }
}
@media (max-width: 860px) {
  .app { grid-template-columns: 64px 1fr; }
  .sidebar { padding: 12px 6px; }
  .brand span:last-child, .nav-link span { display: none; }
  .nav-link { justify-content: center; padding: 10px; }
  .nav-tools { flex-direction: column; align-items: center; padding: 0; }
  .admin-layout { grid-template-columns: 1fr; }
  .admin-nav { flex-direction: row; overflow-x: auto; position: static; }
  .admin-nav a { white-space: nowrap; }
  .versions-layout { grid-template-columns: 1fr; }
}
@media (max-width: 600px) {
  .app { grid-template-columns: 1fr; grid-template-rows: auto 1fr; height: auto; min-height: 100vh; }
  .content { height: auto; }
  .sidebar { flex-direction: row; border-right: 0; border-bottom: 1px solid var(--line); padding: 6px 8px; overflow-x: auto; align-items: center; }
  .brand { padding: 4px 8px; }
  .nav-links { flex-direction: row; }
  .nav-foot { flex-direction: row; margin: 0 0 0 auto; border: 0; padding: 0; }
  .nav-tools { flex-direction: row; }
  .topbar { padding: 10px 16px; flex-wrap: wrap; }
  .rail-seg { min-width: 64px; padding: 0 10px; }
  .rail-label { display: none; }
  .main { padding: 16px 16px 40px; overflow: visible; }
  .cert-summary { grid-template-columns: 1fr; }
  .toolbar .tool { flex: 1 1 40%; }
  .tool select { max-width: none; width: 100%; }
  .grid .opt { display: none; }
  .dash { display: flex; flex-direction: column; }
  h1 { font-size: 22px; }
}

/* ---------- customers (tenants) ---------- */
.tenant-pick { display: flex; flex-direction: column; justify-content: center; gap: 2px; font-size: 11.5px; font-weight: 700; color: var(--muted); min-width: 170px; max-width: 240px; }
.tenant-switch { padding: 7px 10px; font-weight: 700; background: var(--panel); }
.tenant-tag { display: inline-block; font-size: 11.5px; font-weight: 800; letter-spacing: .02em; padding: 1px 6px; border-radius: 4px; background: var(--panel-2); border: 1px solid var(--line); color: var(--text); white-space: nowrap; vertical-align: 1px; }
.tenant-tag.unknown { color: var(--muted); border-style: dashed; }
.cust { display: flex; align-items: center; gap: 8px; }
.sub-line { margin: 6px 0 0; }
.down-text { color: var(--sev-critical); font-weight: 700; }
.table-wrap.flat { border: 0; }
table.overview td { padding-top: 11px; padding-bottom: 11px; }
.rail-cell { width: 34%; min-width: 180px; }
.mini-rail { display: flex; height: 24px; border-radius: 5px; overflow: hidden; gap: 2px; }
.mini-rail span { display: flex; align-items: center; padding: 0 7px; font-size: 12.5px; font-weight: 800; color: #12161b; min-width: 24px; }
.mini-clear { display: inline-flex; align-items: center; gap: 8px; color: var(--muted); font-weight: 600; font-size: 13px; }
.feeds { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.feeds .panel { margin: 0; }
.feed .alarm-list { max-height: 560px; overflow: auto; }
.access-table { max-width: 520px; }
.access-table td { padding: 5px 4px; }
.access-table select { max-width: 200px; }

/* ---------- IPAM ---------- */
.mono-title { font-family: var(--mono); letter-spacing: -.01em; }
.ip-used, .ip-c-used .sw { background: var(--t1); }
.ip-reserved, .ip-c-reserved .sw { background: var(--t3); }
.ip-dhcp, .ip-c-dhcp .sw { background: var(--t2); }
.ip-offline, .ip-c-offline .sw { background: var(--t4); }
.ip-gateway { background: var(--text); }
.ip-free { background: transparent; box-shadow: inset 0 0 0 1px var(--line); }
.util { display: flex; align-items: center; gap: 10px; min-width: 220px; }
.util-bar { flex: 1; display: flex; height: 10px; border-radius: 5px; overflow: hidden; background: var(--grid); max-width: 220px; }
.util-bar span { height: 100%; }
.util-text { font-size: 13px; white-space: nowrap; }
.ip-chip { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; white-space: nowrap; }
.ip-chip .sw { width: 10px; height: 10px; border-radius: 2px; }
.ip-stats .stat-v { display: flex; align-items: center; gap: 6px; }
.ip-stats .sw { width: 12px; height: 12px; border-radius: 3px; }
.ip-map { display: grid; grid-template-columns: repeat(auto-fill, minmax(34px, 1fr)); gap: 3px; margin-bottom: 10px; }
.ip-cell { height: 26px; border: 0; border-radius: 4px; font: 600 11px var(--mono); color: var(--muted); cursor: pointer; padding: 0; }
.ip-cell.ip-used, .ip-cell.ip-reserved, .ip-cell.ip-dhcp, .ip-cell.ip-gateway { color: #fff; }
.ip-cell.ip-offline { color: #1b1408; }
:root[data-theme="dark"] .ip-cell.ip-gateway { color: var(--bg); }
.ip-cell:hover { outline: 2px solid var(--focus); outline-offset: 1px; }
@media (max-width: 1100px) { .feeds { grid-template-columns: 1fr; } }
@media (max-width: 600px) { .tenant-pick { min-width: 0; max-width: none; flex-basis: 100%; } .rail-cell { min-width: 120px; } }

/* branding */
.brand-logo { width: 26px; height: 26px; object-fit: contain; border-radius: 4px; flex: none; }
.brand-logo.big { width: 48px; height: 48px; border-radius: 8px; }
.brand span[data-brand-name] { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.brand-preview { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; padding: 14px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel-2, var(--panel)); }
.brand-preview .sample-side { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 18px; padding: 8px 12px; border-radius: 8px; background: var(--sidebar, var(--panel)); }
.brand-preview .sample-tab { display: flex; align-items: center; gap: 8px; padding: 6px 12px; border-radius: 8px 8px 0 0; background: var(--bg); border: 1px solid var(--line); border-bottom: none; font-size: 13px; max-width: 240px; }
.brand-preview .sample-tab img { width: 16px; height: 16px; }
.brand-preview .sample-side img { width: 26px; height: 26px; object-fit: contain; }
.img-pick { display: grid; grid-template-columns: 72px 1fr; gap: 14px; align-items: center; }
.img-pick .thumb { width: 72px; height: 72px; border-radius: 10px; border: 1px dashed var(--line); display: grid; place-items: center; background: repeating-conic-gradient(rgba(128,128,128,.12) 0 25%, transparent 0 50%) 0 0 / 12px 12px; }
.img-pick .thumb img { max-width: 60px; max-height: 60px; object-fit: contain; }
.help-tip { display: inline-grid; place-items: center; width: 18px; height: 18px; border-radius: 50%; border: 1px solid var(--muted); color: var(--muted); font-size: 11px; font-weight: 700; cursor: help; margin-left: 6px; vertical-align: middle; position: relative; background: none; padding: 0; }
.help-tip:hover::after, .help-tip:focus::after { content: attr(data-tip); position: absolute; left: 50%; bottom: calc(100% + 8px); transform: translateX(-50%); width: max-content; max-width: 280px; white-space: pre-line; text-align: left; font-weight: 400; font-size: 12.5px; line-height: 1.45; color: var(--text); background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; box-shadow: 0 6px 24px rgba(0,0,0,.25); z-index: 50; }
.badge-system { font-size: 11px; font-weight: 700; padding: 2px 7px; border-radius: 999px; background: color-mix(in srgb, var(--link) 18%, transparent); color: var(--link); margin-left: 6px; }
p.note { padding: 10px 12px; border-radius: var(--radius-sm); background: var(--panel-2); border-left: 3px solid var(--link); margin: 0 0 12px; font-size: 14px; }
.inline-actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.form-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 16px; }
.error-text { color: var(--danger) !important; }

/* monitor definitions */
.sub-head { font-size: 15px; margin: 18px 0 8px; }
.type-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px; margin-bottom: 18px; }
.type-card { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 12px; background: var(--panel-2); display: flex; flex-direction: column; gap: 6px; }
.type-card.active { border-color: var(--link); box-shadow: 0 0 0 1px var(--link) inset; }
.type-card p { margin: 0; flex: 1; }
.type-card-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.field .static { padding: 9px 0; color: var(--muted); }
details.overrides { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 10px 14px; margin-top: 14px; }
details.overrides[open] summary { margin-bottom: 8px; }
.mon-body section + section { margin-top: 6px; }
.status-container .dot { background: transparent; border: 2px dashed var(--link); border-radius: 3px; }
