/* RMM dashboard 0.9: light Windows-admin console. Cobalt is the only accent;
   status colours are reserved for state. LED meters stay the signature element. */
:root {
  --paper: #f3f5f8;
  --panel: #ffffff;
  --panel-2: #f7f8fa;
  --line: #e4e7ec;
  --line-strong: #d0d5dd;
  --ink: #101828;
  --ink-2: #475467;
  --muted: #667085;
  --rail: #ffffff;
  --rail-ink: #344054;
  --rail-muted: #98a2b3;
  --rail-hover: #f2f4f7;
  --rail-active: #edf2fe;
  --rail-line: #e4e7ec;
  --accent: #2b5cd6;
  --accent-hover: #2149b4;
  --accent-ink: #ffffff;
  --accent-soft: #edf2fe;
  --accent-line: #c7d6fb;
  --ok: #128054;
  --ok-soft: #e7f6ee;
  --warn: #b54708;
  --warn-soft: #fef4e6;
  --bad: #d92d20;
  --bad-soft: #fdeceb;
  --off: #98a2b3;
  --seg-off: #e4e7ec;
  --code-bg: #0f1729;
  --code-ink: #dbe4f3;
  --hero: #0f1b33;
  --shadow-sm: 0 1px 2px rgba(16, 24, 40, .05);
  --shadow: 0 2px 4px rgba(16, 24, 40, .04), 0 12px 32px rgba(16, 24, 40, .10);
  --r-sm: 7px;
  --r: 12px;
  --font: "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, "Helvetica Neue", sans-serif;
  --font-display: "Segoe UI Variable Display", "Segoe UI", system-ui, -apple-system, sans-serif;
  --mono: "Cascadia Mono", Consolas, ui-monospace, monospace;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --paper: #0b1018;
    --panel: #121925;
    --panel-2: #172031;
    --line: #232d3f;
    --line-strong: #314058;
    --ink: #e6ebf3;
    --ink-2: #b4bfd0;
    --muted: #8593a8;
    --rail: #0f1520;
    --rail-ink: #c9d2e0;
    --rail-muted: #6e7c92;
    --rail-hover: #182233;
    --rail-active: #1b2a48;
    --rail-line: #1f2a3c;
    --accent: #7096ff;
    --accent-hover: #8aa9ff;
    --accent-ink: #0b1220;
    --accent-soft: #1a2747;
    --accent-line: #2c427a;
    --ok: #3fbf86;
    --ok-soft: #12291f;
    --warn: #f0a63c;
    --warn-soft: #2f2210;
    --bad: #f97066;
    --bad-soft: #351816;
    --off: #667085;
    --seg-off: #26324a;
    --code-bg: #080c13;
    --hero: #0a1222;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, .3);
    --shadow: 0 2px 6px rgba(0, 0, 0, .3), 0 14px 36px rgba(0, 0, 0, .35);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; height: 100%; }
body { background: var(--paper); color: var(--ink); font: 14px/1.5 var(--font); -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
svg.ic { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.boot { padding: 48px; color: var(--muted); }
.muted { color: var(--muted); }
.mono { font-family: var(--mono); font-size: 12.5px; }
.num { font-variant-numeric: tabular-nums; }
.spacer { flex: 1; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.mt { margin-top: 16px; }
.stack > * + * { margin-top: 16px; }

/* ---------- app frame ---------- */
.app { display: grid; grid-template-columns: 216px 1fr; min-height: 100vh; }
.rail { background: var(--rail); color: var(--rail-ink); display: flex; flex-direction: column; padding: 14px 10px; position: sticky; top: 0; height: 100vh; }
.brand { display: flex; align-items: center; gap: 10px; padding: 6px 10px 18px; color: #fff; font: 600 17px/1 var(--font-display); letter-spacing: .2px; }
.brand-mark { width: 26px; height: 26px; border-radius: 6px; background: var(--accent); display: grid; place-items: center; }
.brand-mark i { display: block; width: 12px; height: 2px; background: var(--rail); box-shadow: 0 -4px 0 var(--rail), 0 4px 0 var(--rail); }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav button { display: flex; align-items: center; gap: 12px; width: 100%; padding: 9px 12px; border: 0; background: none; color: inherit; border-radius: var(--r-sm); cursor: pointer; text-align: left; }
.nav button:hover { background: var(--rail-hover); color: #fff; }
.nav button.active { background: var(--rail-active); color: #fff; box-shadow: inset 3px 0 0 var(--accent); }
.nav .count { margin-left: auto; min-width: 20px; padding: 0 6px; border-radius: 10px; background: var(--bad); color: #fff; font-size: 11.5px; font-weight: 700; line-height: 20px; text-align: center; }
.nav .count.warn { background: var(--warn); }
.rail-foot { margin-top: auto; border-top: 1px solid rgba(255, 255, 255, .08); padding-top: 12px; }
.rail-foot .who { padding: 4px 12px 8px; font-size: 12.5px; color: var(--rail-ink); opacity: .8; }

.main { min-width: 0; display: flex; flex-direction: column; }
.topbar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 18px 28px 0; min-height: 54px; }
.topbar h1 { margin: 0; font: 600 22px/1.25 var(--font-display); letter-spacing: -.2px; }
.content { padding: 18px 28px 40px; }

/* ---------- controls ---------- */
.btn { display: inline-flex; align-items: center; gap: 7px; border: 1px solid var(--line-strong); background: var(--panel); padding: 7px 14px; border-radius: var(--r-sm); cursor: pointer; white-space: nowrap; line-height: 1.3; }
.btn:hover { border-color: var(--ink-2); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); font-weight: 600; }
.btn.primary:hover { filter: brightness(1.07); }
.btn.danger { color: var(--bad); }
.btn.danger:hover { border-color: var(--bad); }
.btn.ghost { border-color: transparent; background: none; }
.btn.ghost:hover { background: var(--panel-2); border-color: transparent; }
.btn.small { padding: 4px 10px; font-size: 13px; }
.btn.icon { padding: 5px; }
.btn:disabled { opacity: .5; cursor: default; }
input, select, textarea { background: var(--panel); border: 1px solid var(--line-strong); border-radius: var(--r-sm); padding: 7px 10px; min-width: 0; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent); outline-offset: -1px; border-color: transparent; }
input[type=checkbox] { width: 16px; height: 16px; accent-color: var(--accent); margin: 0; cursor: pointer; }
label.field { display: flex; flex-direction: column; gap: 5px; font-size: 13px; color: var(--ink-2); }
label.field input, label.field select, label.field textarea { color: var(--ink); }
label.field small { color: var(--muted); font-size: 12px; }
label.field.wide { grid-column: 1 / -1; }
.check-inline { display: inline-flex; align-items: center; gap: 8px; margin: 10px 18px 0 0; cursor: pointer; }
.search { position: relative; display: flex; align-items: center; }
.search svg { position: absolute; left: 9px; color: var(--muted); pointer-events: none; }
.search input { padding-left: 32px; width: 260px; }

/* ---------- panels & forms ---------- */
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); padding: 18px; }
.panel h2, h2.sec { font: 600 15px/1.3 var(--font-display); margin: 0 0 12px; }
h2.sec { margin-top: 28px; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; }
.grid + .grid { margin-top: 14px; }
.grid-2 { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; }
.grid.cards { grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); }
.btn.back { margin-left: -10px; }
dl.kv { display: grid; grid-template-columns: 140px 1fr; gap: 7px 14px; margin: 0; }
dl.kv dt { color: var(--muted); }
dl.kv dd { margin: 0; word-break: break-word; }
.notice { border-left: 3px solid var(--warn); background: var(--warn-soft); padding: 10px 14px; border-radius: 0 var(--r-sm) var(--r-sm) 0; margin: 14px 0; }
.lead { color: var(--ink-2); margin: 0 0 16px; max-width: 70ch; }

/* ---------- tables ---------- */
.table-wrap { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); overflow: auto; }
table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { font-size: 12.5px; font-weight: 600; color: var(--muted); background: var(--panel-2); position: sticky; top: 0; z-index: 1; white-space: nowrap; }
tr:last-child td { border-bottom: 0; }
tr.click { cursor: pointer; }
tr.click:hover td { background: var(--panel-2); }
td.empty { text-align: center; color: var(--muted); padding: 40px 20px; }
td.sel, th.sel { width: 36px; padding-right: 0; }
.cell-main { font-weight: 600; }
.cell-sub { color: var(--muted); font-size: 12.5px; margin-top: 1px; }
pre.cell-out { margin: 4px 0 0; font-family: var(--mono); font-size: 12px; white-space: pre-wrap; word-break: break-word; max-height: 90px; overflow: auto; color: var(--muted); }

/* device rows: the left edge carries the state */
.dev-table td { white-space: nowrap; padding-top: 9px; padding-bottom: 9px; }
.dev-table th, .dev-table td { padding-left: 9px; padding-right: 9px; }
.name-line { display: flex; align-items: center; gap: 8px; }
.name-cell { max-width: 260px; }
.name-cell .cell-sub { padding-left: 16px; overflow: hidden; text-overflow: ellipsis; }
.group-cell { max-width: 170px; }
.clip { overflow: hidden; text-overflow: ellipsis; }
tr.dev td:first-child { box-shadow: inset 4px 0 0 var(--ok); }
tr.dev.offline td:first-child { box-shadow: inset 4px 0 0 var(--off); }
tr.dev.warning td:first-child { box-shadow: inset 4px 0 0 var(--warn); }
tr.dev.error td:first-child { box-shadow: inset 4px 0 0 var(--bad); }
tr.dev.offline .cell-main { color: var(--ink-2); }
tr.dev.selected td { background: var(--accent-soft); }

/* ---------- LED meter ---------- */
.meter { display: inline-flex; align-items: center; gap: 7px; white-space: nowrap; }
.segs { display: inline-grid; grid-template-columns: repeat(10, 3px); gap: 2px; }
.segs i { height: 14px; border-radius: 1px; background: var(--seg-off); }
.segs i.on { background: var(--accent); }
.meter.warn .segs i.on { background: var(--warn); }
.meter.bad .segs i.on { background: var(--bad); }
.meter b { font-weight: 500; min-width: 30px; font-size: 13px; }
.meter.na { color: var(--muted); }

/* ---------- badges & dots ---------- */
.badge { display: inline-flex; align-items: center; gap: 6px; padding: 1px 9px; border-radius: 999px; font-size: 12.5px; font-weight: 600; white-space: nowrap; }
.badge.ok { color: var(--ok); background: var(--ok-soft); }
.badge.warn { color: var(--warn); background: var(--warn-soft); }
.badge.bad { color: var(--bad); background: var(--bad-soft); }
.badge.neutral { color: var(--muted); background: var(--panel-2); }
.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; flex: none; background: var(--ok); }
.dot.off { background: var(--off); }
.dot.warn { background: var(--warn); }
.dot.bad { background: var(--bad); }

/* ---------- devices: groups tree + list ---------- */
.devices { display: grid; grid-template-columns: 236px minmax(0, 1fr); gap: 20px; align-items: start; }
.tree { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); padding: 10px 6px; position: sticky; top: 16px; max-height: calc(100vh - 32px); overflow: auto; }
.tree-head { display: flex; align-items: center; padding: 2px 8px 8px; font-weight: 600; }
.node { display: flex; align-items: center; gap: 8px; padding: 6px 8px; border-radius: var(--r-sm); cursor: pointer; position: relative; }
.node:hover { background: var(--panel-2); }
.node.active { background: var(--accent-soft); color: var(--ink); font-weight: 600; }
.node .name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.node .n { color: var(--muted); font-size: 12.5px; font-variant-numeric: tabular-nums; }
.node .more { display: none; padding: 1px; margin: -2px 0; }
.node:hover .more, .node:focus-within .more { display: inline-flex; }
.node:hover .n, .node:focus-within .n { display: none; }
.node .caret-btn { padding: 1px; margin: -2px -4px -2px -6px; }
.node.site { padding-left: 34px; }
.node .caret { width: 14px; height: 14px; transition: transform .15s; color: var(--muted); }
.node .caret.open { transform: rotate(90deg); }
.tree-sep { height: 1px; background: var(--line); margin: 6px 8px; }
.list-tools { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 12px; }
.seg-ctl { display: inline-flex; border: 1px solid var(--line-strong); border-radius: var(--r-sm); overflow-x: auto; max-width: 100%; }
.seg-ctl button { white-space: nowrap; }
.seg-ctl button { border: 0; background: var(--panel); padding: 6px 12px; cursor: pointer; }
.seg-ctl button + button { border-left: 1px solid var(--line-strong); }
.seg-ctl button.active { background: var(--ink); color: var(--panel); }
.bulkbar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 8px 12px; margin-bottom: 12px; border-radius: var(--r); background: var(--ink); color: var(--panel); }
.bulkbar .btn { background: transparent; color: inherit; border-color: rgba(255, 255, 255, .35); }
.bulkbar .btn:hover { border-color: currentColor; }
.bulkbar > b { white-space: nowrap; }
.group-select { display: none; }

/* ---------- popover menu ---------- */
.menu { position: fixed; z-index: 40; min-width: 190px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow); padding: 5px; }
.menu button { display: flex; width: 100%; gap: 10px; align-items: center; border: 0; background: none; padding: 7px 10px; border-radius: var(--r-sm); cursor: pointer; text-align: left; }
.menu button:hover { background: var(--panel-2); }
.menu button.danger { color: var(--bad); }

/* ---------- home ---------- */
.state-line { display: flex; gap: 18px; align-items: flex-start; margin: 4px 0 26px; }
.state-ring { width: 46px; height: 46px; border-radius: 50%; border: 6px solid var(--ok); flex: none; margin-top: 4px; }
.state-ring.warn { border-color: var(--warn); }
.state-ring.bad { border-color: var(--bad); }
.state-line h2 { font: 600 30px/1.2 var(--font-display); letter-spacing: -.4px; margin: 0; max-width: 28ch; }
.state-line p { margin: 6px 0 0; color: var(--ink-2); font-size: 15px; }
.attn { list-style: none; margin: 0; padding: 0; }
.attn li { display: flex; gap: 12px; align-items: flex-start; padding: 11px 4px; border-bottom: 1px solid var(--line); cursor: pointer; }
.attn li:last-child { border-bottom: 0; }
.attn li:hover { background: var(--panel-2); }
.attn .dot { margin-top: 7px; }
.attn .what { flex: 1; min-width: 0; }
.attn .what b { font-weight: 600; }
.attn .what div { color: var(--muted); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.attn .when { color: var(--muted); font-size: 12.5px; white-space: nowrap; }
.ratio { height: 6px; border-radius: 3px; background: var(--seg-off); overflow: hidden; min-width: 80px; }
.ratio i { display: block; height: 100%; background: var(--ok); }
.osbar { display: grid; grid-template-columns: minmax(0, 1fr) 120px 32px; gap: 10px 14px; align-items: center; }
.osbar .num { text-align: right; }
.osbar .ratio i { background: var(--accent); }
.osbar span { font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- device detail ---------- */
.dev-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.dev-head h1 { margin: 0; font: 600 24px/1.2 var(--font-display); }
.live { display: flex; flex-wrap: wrap; gap: 28px; padding: 14px 18px; margin: 16px 0 18px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); }
.live .k { color: var(--muted); font-size: 12.5px; margin-bottom: 3px; }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 18px; overflow-x: auto; }
.tabs button { background: none; border: 0; padding: 9px 14px; cursor: pointer; color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tabs button:hover { color: var(--ink); }
.tabs button.active { color: var(--ink); border-bottom-color: var(--accent); font-weight: 600; }
.disk { margin-bottom: 12px; }
.bar { height: 8px; background: var(--seg-off); border-radius: 4px; overflow: hidden; margin-top: 5px; }
.bar > i { display: block; height: 100%; background: var(--accent); }
.bar > i.high { background: var(--bad); }
.w0{width:0}.w5{width:5%}.w10{width:10%}.w15{width:15%}.w20{width:20%}.w25{width:25%}.w30{width:30%}.w35{width:35%}.w40{width:40%}.w45{width:45%}.w50{width:50%}.w55{width:55%}.w60{width:60%}.w65{width:65%}.w70{width:70%}.w75{width:75%}.w80{width:80%}.w85{width:85%}.w90{width:90%}.w95{width:95%}.w100{width:100%}

/* ---------- script console ---------- */
textarea.script { width: 100%; min-height: 220px; font-family: var(--mono); font-size: 13px; resize: vertical; }
textarea.small-script { min-height: 140px; }
textarea.rcpts { min-height: 64px; resize: vertical; }
pre.out { background: var(--code-bg); color: var(--code-ink); padding: 12px 14px; border-radius: var(--r-sm); margin: 10px 0 0; font-family: var(--mono); font-size: 12.5px; white-space: pre-wrap; word-break: break-word; max-height: 480px; overflow: auto; }
pre.out.err { color: #ffb4ab; }
.snips { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 12px; align-items: center; }
.copybox { display: flex; gap: 8px; align-items: stretch; }
.copybox code { flex: 1; background: var(--code-bg); color: var(--code-ink); padding: 10px 12px; border-radius: var(--r-sm); font-family: var(--mono); font-size: 12.5px; word-break: break-all; }

/* ---------- login ---------- */
.login .err { color: var(--bad); min-height: 20px; font-size: 13px; }

/* ---------- modal, toast ---------- */
.modal-bg { position: fixed; inset: 0; background: rgba(14, 20, 27, .5); display: grid; place-items: center; z-index: 50; padding: 20px; }
.modal { background: var(--panel); border-radius: var(--r); box-shadow: var(--shadow); padding: 22px; width: min(560px, 100%); max-height: 90vh; overflow: auto; }
.modal.wide { width: min(900px, 100%); }
.modal-head { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.modal-head h2 { margin: 0; font: 600 18px/1.3 var(--font-display); flex: 1; }
.modal-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 20px; }
.toast { position: fixed; bottom: 22px; right: 22px; background: var(--ink); color: var(--panel); padding: 11px 16px; border-radius: var(--r-sm); z-index: 60; max-width: 440px; box-shadow: var(--shadow); }
.toast.error { background: var(--bad); color: #fff; }

/* ---------- v0.4 ---------- */
.nav-sec { padding: 14px 12px 4px; font-size: 12px; color: var(--rail-ink); opacity: .6; }
.nav-sec:first-child { padding-top: 0; }
.rail-foot .who small { display: block; font-size: 11.5px; opacity: .75; }
.caret-down { transform: rotate(90deg); width: 14px; height: 14px; }
.small { font-size: 13px; }
.nowrap { white-space: nowrap; }
.wrap { white-space: normal; }
.row.nowrap { flex-wrap: nowrap; }
.clip-1 { display: block; max-width: 520px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.check-inline.flush { margin: 0; }
td.actions { white-space: nowrap; text-align: right; }
td.actions .btn + .btn { margin-left: 6px; }
.script-cat + .script-cat { margin-top: 8px; }
.script-cat table { table-layout: fixed; }
.script-cat td:nth-child(2) { width: 130px; }
.script-cat td:nth-child(3) { width: 90px; }
.script-cat td.actions { width: 170px; }
@media (max-width: 760px) { .script-cat td.actions { width: 130px; } }
h2.sec .n { font-weight: 400; margin-left: 8px; font-size: 13px; }
tr.paused td { opacity: .6; }
pre.cell-out.expanded { max-height: none; }
.spin { display: inline-block; width: 12px; height: 12px; border-radius: 50%; border: 2px solid var(--line-strong); border-top-color: var(--accent); vertical-align: -1px; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.days { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 2px; }
.day { display: inline-flex; align-items: center; gap: 5px; padding: 5px 10px; border: 1px solid var(--line-strong); border-radius: var(--r-sm); color: var(--ink); cursor: pointer; }
.day:has(input:checked) { background: var(--accent-soft); border-color: var(--accent); }
ol.steps { margin: 0; padding-left: 20px; }
ol.steps li + li { margin-top: 14px; }
.mt-s { margin-top: 8px; }
.note-input { width: 100%; min-height: 80px; resize: vertical; }
.notes { margin-top: 16px; }
.note { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); padding: 12px 16px; }
.note + .note { margin-top: 10px; }
.note p { margin: 6px 0 0; white-space: pre-wrap; }
.modal .seg-ctl { margin-bottom: 4px; }

/* ---------- v0.5 ---------- */
.notice.ok { border-left-color: var(--ok); background: var(--ok-soft); }
.ml { margin-left: 8px; }
svg.ic.flip { transform: rotate(180deg); }
.upload input[type=file] { max-width: 100%; }
code { font-family: var(--mono); font-size: 12.5px; background: var(--panel-2); padding: 1px 6px; border-radius: 4px; }
.copybox code { background: var(--code-bg); padding: 10px 12px; }

/* ---------- responsive ---------- */
@media (max-width: 1600px) {
  .hide-lg { display: none; }
}
@media (max-width: 1100px) {
  .devices { grid-template-columns: minmax(0, 1fr); }
  .tree { display: none; }
  .group-select { display: block; width: 100%; margin-bottom: 12px; }
  .hide-md { display: none; }
}
@media (max-width: 760px) {
  .app { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto 1fr; }
  .grid.cards { grid-template-columns: minmax(0, 1fr); }
  .grid { grid-template-columns: minmax(0, 1fr); }
  .rail { position: sticky; top: 0; height: auto; flex-direction: row; align-items: center; padding: 6px 8px; z-index: 20; overflow-x: auto; }
  .brand { padding: 0 8px 0 4px; }
  .rail .brand .brand-name { display: none; }
  .nav { flex-direction: row; }
  .nav-sec { display: none; }
  .nav button { padding: 9px; }
  .nav button .lbl { display: none; }
  .nav button.active { box-shadow: inset 0 -3px 0 var(--accent); }
  .rail-foot { margin: 0 0 0 auto; border: 0; padding: 0; display: flex; }
  .rail-foot .who { display: none; }
  .topbar, .content { padding-left: 16px; padding-right: 16px; }
  .search input { width: 100%; }
  .search { flex: 1; }
  .hide-sm { display: none; }
  .grid-2 { grid-template-columns: minmax(0, 1fr); }
  dl.kv { grid-template-columns: 1fr; }
  .state-line h2 { font-size: 24px; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }

/* 0.6: software, files, remote desktop */
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.field.grow { flex: 1; margin: 0; }
table.fixed { table-layout: fixed; width: 100%; }
table.fixed td { overflow: hidden; text-overflow: ellipsis; }
table.sw .c-ver { width: 130px; } table.sw .c-date { width: 100px; } table.sw .c-act { width: 130px; }
table.files .c-size { width: 150px; } table.files .c-date { width: 190px; } table.files .c-act { width: 170px; }
table.files td.num { white-space: nowrap; }
td.fname { white-space: nowrap; }
td.fname svg { width: 16px; height: 16px; vertical-align: -3px; margin-right: 8px; color: var(--muted); }
tr.click td.fname svg { color: var(--accent); }
.crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; min-width: 0; }
.crumbs .sep { color: var(--muted); }
.linkish { border: 0; background: none; padding: 2px 4px; color: var(--accent); cursor: pointer; font: inherit; border-radius: 4px; }
.linkish:hover { background: var(--accent-soft); }
.remote-card { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; padding: 16px; background: var(--panel-2); border: 1px solid var(--line); border-radius: var(--r); }
.remote-card .k { color: var(--muted); font-size: 12.5px; margin-bottom: 4px; }
.remote-card .big { font-size: 22px; font-weight: 600; letter-spacing: .02em; margin-bottom: 6px; word-break: break-all; }
.btn.block { display: flex; justify-content: center; width: 100%; }
details summary { cursor: pointer; color: var(--accent); }
@media (max-width: 720px) {
  .remote-card { grid-template-columns: 1fr; }
  table.fixed { table-layout: auto; }
  table.fixed th[class^='c-'] { width: auto; }
  td.fname { white-space: normal; word-break: break-word; }
  table.files td.actions .btn.ghost:not(.danger) { padding: 4px 6px; }
}

/* 0.7: two-step login */
.tfa-setup { display: grid; grid-template-columns: 200px minmax(0, 1fr); gap: 20px; align-items: start; }
.tfa-qr { background: #fff; border: 1px solid var(--line); border-radius: var(--r); padding: 6px; }
svg.qr { display: block; width: 100%; height: auto; shape-rendering: crispEdges; }
.tfa-setup .steps { margin: 0; }
.tfa-setup input[inputmode=numeric] { width: 9ch; font: 600 18px/1 var(--mono); letter-spacing: .15em; }
.codes { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px 24px; padding: 14px 18px;
  background: var(--panel-2); border: 1px solid var(--line); border-radius: var(--r); font-size: 16px; }
.login-form.wide { max-width: none; }
.login-form .lead { margin: 0; }
@media (max-width: 720px) {
  .tfa-setup { grid-template-columns: 1fr; }
  .tfa-qr { max-width: 220px; }
}
.login-form .tfa-setup { grid-template-columns: 1fr; gap: 12px; }
.login-form .tfa-qr { width: 190px; }
.codes span { font-family: var(--mono); }

/* 0.7: reports, fields, keys */
.report-picker { display: grid; grid-template-columns: repeat(auto-fill, minmax(175px, 1fr)); gap: 10px; margin-bottom: 16px; }
.report-card { display: flex; flex-direction: column; gap: 4px; text-align: left; padding: 12px 14px; border: 1px solid var(--line);
  border-radius: var(--r); background: var(--panel); color: var(--ink); cursor: pointer; font: inherit; }
.report-card span { color: var(--muted); font-size: 12.5px; line-height: 1.4; }
.report-card:hover { border-color: var(--accent); }
.report-card.active { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); background: var(--accent-soft); }
.report-filters { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px; margin-bottom: 16px; }
.report-filters .field { margin: 0; min-width: 160px; }
.report-filters .field input[type=number] { width: 110px; }
.report-table { max-height: 60vh; overflow: auto; }
.report-table td, .report-table th { white-space: nowrap; }
.report-table thead th { position: sticky; top: 0; background: var(--panel); z-index: 1; }
h2.flush { margin: 0; }
details.vars summary { color: var(--accent); cursor: pointer; font-size: 13px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.chip { border: 1px solid var(--line); background: var(--panel-2); color: var(--ink); border-radius: 999px; padding: 3px 10px; font-size: 12px; cursor: pointer; }
.chip:hover { border-color: var(--accent); }
pre.code-sample { margin: 0; padding: 10px 12px; background: var(--panel-2); border: 1px solid var(--line); border-radius: var(--r);
  font: 12px/1.5 var(--mono); white-space: pre-wrap; word-break: break-all; }
@media (max-width: 720px) {
  .report-picker { grid-template-columns: 1fr 1fr; gap: 8px; }
  .report-card { padding: 10px 12px; }
  .report-card span { display: none; }
  .report-filters .field { min-width: 0; flex: 1 1 140px; }
}

/* 0.8: live metrics */
.live-dot { display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--ok, #2f9e6b); margin-left: 6px; vertical-align: 1px; animation: livepulse 2.5s ease-in-out infinite; }
@keyframes livepulse { 0%, 100% { opacity: 1; } 50% { opacity: .25; } }
@media (prefers-reduced-motion: reduce) { .live-dot { animation: none; } }
.cert-opts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.cert-opt { border: 1px solid var(--line); border-radius: var(--r); padding: 14px; background: var(--panel-2); display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.cert-opt h3, .how h3 { margin: 0; font-size: 14px; }
.cert-opt .field { margin: 0; }
.cert-opt textarea { min-height: 70px; }
.cert-opt .steps { margin: 0; padding-left: 18px; }
.cert-opt .row { margin-top: auto; }
.how p { margin: 6px 0; }
@media (max-width: 1100px) { .cert-opts { grid-template-columns: minmax(0, 1fr); } }


/* ===================================================================
   0.9 visual refresh (overrides the rules above)
   =================================================================== */
body { font-size: 14px; letter-spacing: .005em; }
h1, h2, h3 { color: var(--ink); }

/* rail: light, quiet, cobalt for the current page */
.rail { border-right: 1px solid var(--rail-line); padding: 18px 12px 14px; }
.brand { color: var(--ink); padding: 2px 10px 22px; font: 650 17px/1 var(--font-display); letter-spacing: -.1px; }
.brand-mark { width: 30px; height: 30px; border-radius: 8px; background: var(--accent); box-shadow: inset 0 -2px 0 rgba(0, 0, 0, .18); }
.brand-mark i { background: #fff; box-shadow: 0 -4px 0 #fff, 0 4px 0 #fff; width: 13px; }
.nav { gap: 1px; }
.nav-sec { color: var(--rail-muted); opacity: 1; font-size: 11.5px; font-weight: 600; letter-spacing: .02em; padding: 16px 12px 6px; }
.nav button { padding: 8px 12px; border-radius: 8px; color: var(--rail-ink); font-weight: 500; }
.nav button svg.ic { color: var(--rail-muted); }
.nav button:hover { background: var(--rail-hover); color: var(--ink); }
.nav button.active { background: var(--rail-active); color: var(--accent); box-shadow: none; font-weight: 600; }
.nav button.active svg.ic { color: var(--accent); }
.rail-foot { border-top: 1px solid var(--rail-line); }
.rail-foot .who { color: var(--ink); opacity: 1; font-weight: 600; }
.rail-foot .who small { color: var(--muted); font-weight: 400; }

/* page frame */
.topbar { padding: 26px 32px 0; }
.topbar h1 { font: 650 24px/1.25 var(--font-display); letter-spacing: -.35px; }
.content { padding: 20px 32px 48px; }

/* surfaces */
.panel, .table-wrap, .tree, .live { border-color: var(--line); border-radius: var(--r); box-shadow: var(--shadow-sm); }
.panel { padding: 20px 22px; }
.panel h2, h2.sec { font: 650 15.5px/1.3 var(--font-display); letter-spacing: -.1px; }
.lead { color: var(--ink-2); line-height: 1.55; }
.notice { border: 1px solid #f8d9b4; border-left: 3px solid var(--warn); border-radius: var(--r-sm); }
.notice.ok { border-color: #bfe6d1; border-left-color: var(--ok); background: var(--ok-soft); }
@media (prefers-color-scheme: dark) {
  .notice { border-color: #4a3416; }
  .notice.ok { border-color: #1d4a35; }
}

/* controls */
.btn { border-radius: 8px; padding: 7px 14px; font-weight: 500; border-color: var(--line-strong); box-shadow: var(--shadow-sm); transition: background-color .12s, border-color .12s; }
.btn:hover { border-color: var(--line-strong); background: var(--panel-2); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); filter: none; }
.btn.ghost { box-shadow: none; }
.btn.ghost:hover { background: var(--rail-hover); }
.btn.danger:hover { border-color: var(--bad); background: var(--bad-soft); }
.btn.small { padding: 4px 10px; border-radius: 7px; }
input, select, textarea { border-radius: 8px; border-color: var(--line-strong); padding: 8px 11px; box-shadow: var(--shadow-sm); }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
input[type=checkbox] { box-shadow: none; }
label.field { color: var(--ink-2); font-weight: 500; }
label.field small { font-weight: 400; }
.seg-ctl { border-radius: 9px; padding: 3px; gap: 2px; background: var(--panel-2); border-color: var(--line); }
.seg-ctl button { background: none; border-radius: 7px; padding: 5px 12px; color: var(--ink-2); font-weight: 500; }
.seg-ctl button + button { border-left: 0; }
.seg-ctl button.active { background: var(--panel); color: var(--ink); box-shadow: 0 1px 3px rgba(16, 24, 40, .12); }

/* tabs */
.tabs { gap: 2px; }
.tabs button { padding: 10px 14px; font-weight: 500; color: var(--muted); }
.tabs button.active { color: var(--accent); border-bottom-color: var(--accent); }

/* tables */
th { background: var(--panel); color: var(--muted); font-size: 12px; font-weight: 600; letter-spacing: .01em; border-bottom-color: var(--line); }
th, td { padding: 11px 14px; }
tr.click:hover td { background: var(--panel-2); }
tr.dev.selected td { background: var(--accent-soft); }

/* badges and dots */
.badge { padding: 2px 9px; font-weight: 600; font-size: 12px; border: 1px solid transparent; }
.badge.ok { border-color: #bfe6d1; }
.badge.warn { border-color: #f8d9b4; }
.badge.bad { border-color: #f9c7c2; }
.badge.neutral { border-color: var(--line); }
@media (prefers-color-scheme: dark) {
  .badge.ok, .badge.warn, .badge.bad { border-color: transparent; }
}
.dot { box-shadow: 0 0 0 3px var(--ok-soft); }
.dot.off { box-shadow: 0 0 0 3px var(--panel-2); }
.dot.warn { box-shadow: 0 0 0 3px var(--warn-soft); }
.dot.bad { box-shadow: 0 0 0 3px var(--bad-soft); }

/* LED meters: cobalt segments */
.segs i { border-radius: 1.5px; }
.segs i.on { background: var(--accent); }

/* groups tree */
.node { border-radius: 8px; }
.node.active { background: var(--accent-soft); color: var(--accent); }
.node.active .n { color: var(--accent); }

/* bulk bar: cobalt band instead of black */
.bulkbar { background: var(--accent); color: #fff; border-radius: var(--r); box-shadow: var(--shadow-sm); }
.bulkbar .btn { box-shadow: none; color: #fff; background: rgba(255, 255, 255, .08); border-color: rgba(255, 255, 255, .35); }
.bulkbar .btn:hover { background: rgba(255, 255, 255, .18); border-color: #fff; }
@media (prefers-color-scheme: dark) { .bulkbar, .bulkbar .btn { color: var(--accent-ink); } .bulkbar .btn { border-color: rgba(0, 0, 0, .3); } }

/* device header strip */
.live { padding: 16px 22px; gap: 34px; }
.live .k { font-size: 12px; font-weight: 500; }
.dev-head h1 { font: 650 26px/1.2 var(--font-display); letter-spacing: -.4px; }

/* home */
.state-line h2 { font: 650 30px/1.2 var(--font-display); letter-spacing: -.6px; }
.state-ring { border-width: 5px; box-shadow: 0 0 0 6px var(--ok-soft); }
.state-ring.warn { box-shadow: 0 0 0 6px var(--warn-soft); }
.state-ring.bad { box-shadow: 0 0 0 6px var(--bad-soft); }

/* overlays */
.menu { border-radius: 10px; padding: 6px; box-shadow: var(--shadow); }
.menu button { border-radius: 7px; }
.modal-bg { background: rgba(16, 24, 40, .45); backdrop-filter: blur(2px); }
.modal { border-radius: 14px; padding: 24px 26px; border: 1px solid var(--line); }
.modal-head h2 { font: 650 18px/1.3 var(--font-display); letter-spacing: -.2px; }
.toast { border-radius: 10px; background: var(--ink); }

/* login: the only dark surface, a rack of status lights */
.login-form .btn.primary { justify-content: center; padding: 10px 14px; }

/* report cards and cert options follow the same surfaces */
.report-card { border-radius: var(--r); box-shadow: var(--shadow-sm); }
.report-card.active { box-shadow: inset 0 0 0 1px var(--accent); }
.cert-opt { border-radius: var(--r); }
.chip { background: var(--panel); }

@media (max-width: 760px) {
  .rail { border-right: 0; border-bottom: 1px solid var(--rail-line); padding: 6px 8px; }
  .brand { padding: 0 8px 0 4px; }
  .nav button.active { box-shadow: inset 0 -2px 0 var(--accent); }
  .topbar { padding: 18px 16px 0; }
  .content { padding: 16px 16px 40px; }
}

/* 0.10: device list columns, OS badge, quick power */
.os-badge { display: inline-flex; align-items: center; justify-content: center; min-width: 38px; height: 20px; padding: 0 6px; border-radius: 5px;
  font: 700 10.5px/1 var(--font); letter-spacing: .02em; border: 1px solid; }
.os-badge.win { color: #1d4ed8; background: #eff4ff; border-color: #c8d7fe; }
.os-badge.lnx { color: #92400e; background: #fff7e6; border-color: #fbd9a5; }
.os-badge.mac { color: #374151; background: #f3f4f6; border-color: #d1d5db; }
.os-badge.other { color: var(--muted); background: var(--panel-2); border-color: var(--line); }
@media (prefers-color-scheme: dark) {
  .os-badge.win { color: #9db8ff; background: #172446; border-color: #2a3f73; }
  .os-badge.lnx { color: #f5c06f; background: #2d220f; border-color: #5a4219; }
  .os-badge.mac { color: #d1d5db; background: #1f2937; border-color: #374151; }
}
.dev-head .os-badge { margin-left: -2px; }
.dev-desc { margin-top: 4px; color: var(--ink-2); display: flex; gap: 10px; align-items: baseline; }
.dev-desc .linkish { padding: 0; }
.linkish.small { font-size: 12.5px; }
.c-os { width: 64px; }
.c-wide { max-width: 220px; overflow: hidden; text-overflow: ellipsis; }
.clip-1 { display: inline-block; max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; vertical-align: bottom; }
.c-power { width: 84px; }
.row-actions { display: flex; gap: 2px; }
.row-actions .btn.icon { padding: 5px; }
.row-actions .btn.danger { color: var(--bad); }
.row-actions .btn.danger:hover { background: var(--bad-soft); border-color: transparent; }
.col-list { list-style: none; margin: 8px 0 0; padding: 0; border: 1px solid var(--line); border-radius: 10px; }
.col-list li { display: flex; align-items: center; gap: 4px; padding: 4px 6px 4px 12px; border-bottom: 1px solid var(--line); }
.col-list li:last-child { border-bottom: 0; }
.col-list .check-inline { margin: 0; }
svg.ic.rot-up { transform: rotate(-90deg); }
svg.ic.rot-down { transform: rotate(90deg); }
.btn.primary.danger-fill { background: var(--bad); border-color: var(--bad); color: #fff; }
.btn.primary.danger-fill:hover { filter: brightness(.95); background: var(--bad); }
.modal-actions .spacer { flex: 1; }

/* the restart/shutdown buttons stay visible when the chosen columns are wider than the screen */
.dev-table th.c-power, .dev-table td.c-power { position: sticky; right: 0; background: var(--panel); box-shadow: -1px 0 0 var(--line); }

/* ---------- 0.10.1 brand: SCM RMM ---------- */
.brand-name { display: inline-flex; align-items: baseline; gap: 5px; white-space: nowrap; }
.brand-name b { font-weight: 700; letter-spacing: .6px; }
.brand-name span { font-weight: 500; opacity: .62; letter-spacing: .3px; }

/* ---------- 0.10.2 sign-in page: centred card on the dark backdrop ---------- */
.login {
  min-height: 100vh; display: grid; place-items: center; padding: 48px 16px;
  background-color: var(--hero); color: #9fb0cc;
  background-image:
    radial-gradient(70% 55% at 50% 0%, rgba(59, 110, 240, .32), transparent 70%),
    radial-gradient(rgba(255, 255, 255, .075) 1px, transparent 1.3px);
  background-size: 100% 100%, 22px 22px;
}
.login-wrap { width: min(100%, 420px); display: flex; flex-direction: column; gap: 28px; }
.login-wrap:has(.login-form.wide) { width: min(100%, 760px); }
.login-head { text-align: center; }
.login-head .brand { justify-content: center; color: #fff; padding: 0 0 22px; font-size: 18px; }
.login-head .slogan { margin: 0 auto; max-width: 18ch; color: #fff; font: 650 clamp(28px, 4.2vw, 40px)/1.1 var(--font-display); letter-spacing: -.9px; text-wrap: balance; }
.login-head .sub { margin: 12px auto 0; max-width: 40ch; font-size: 15px; line-height: 1.55; }
.login-card { background: var(--panel); color: var(--ink); border-radius: 14px; box-shadow: 0 0 0 1px rgba(255, 255, 255, .06), 0 28px 70px rgba(2, 8, 23, .5); }
.login-form { display: flex; flex-direction: column; gap: 14px; padding: 32px; background: none; }
.login-form h1 { font: 650 22px/1.2 var(--font-display); letter-spacing: -.3px; margin: 0 0 4px; }
.login-foot { display: flex; justify-content: center; gap: 4px; }
.login-foot button { background: none; border: 0; color: #9fb0cc; font: 600 12.5px/1 var(--font); letter-spacing: .4px; padding: 7px 10px; border-radius: 6px; cursor: pointer; }
.login-foot button:hover { color: #fff; }
.login-foot button[aria-pressed="true"] { color: #fff; background: rgba(255, 255, 255, .09); }
.login-foot button:focus-visible { outline: 2px solid #8fb0ff; outline-offset: 2px; }
@media (max-width: 760px) {
  .login { padding: 32px 16px; align-items: start; }
  .login-form { padding: 24px 20px; }
  .login-head .sub { display: none; }
}
.login .err:empty { display: none; }

/* ---------- 0.11 Let's Encrypt from the dashboard ---------- */
.cert-opt.acme { margin-top: 16px; background: var(--panel); border-color: var(--accent-line); gap: 10px; padding: 18px; }
.cert-opt.acme.on { border-color: #bfe6d1; }
.cert-opt.acme h3 { font-size: 15px; }
.cert-opt.acme .row { margin-top: 0; gap: 10px; }
.cert-opt.acme .grid { max-width: 460px; }
.acme-req { list-style: none; margin: 2px 0; padding: 0; display: grid; gap: 6px; font-size: 13.5px; }
.acme-req li { display: flex; gap: 8px; align-items: baseline; }
.acme-req .mark { flex: none; width: 18px; height: 18px; border-radius: 50%; display: inline-grid; place-items: center; font-size: 11px; font-weight: 700; transform: translateY(3px); }
.acme-req .ok .mark { background: var(--ok-soft); color: var(--ok); }
.acme-req .no .mark { background: var(--warn-soft); color: var(--warn); }
.acme-req .info .mark { background: var(--accent-soft); color: var(--accent); font-style: italic; font-family: Georgia, serif; }
.acme-run { display: flex; gap: 12px; align-items: flex-start; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--panel-2); }
.acme-run ol { margin: 0; padding-left: 18px; font-size: 13.5px; display: grid; gap: 3px; }
.acme-run li:last-child { font-weight: 600; }
.spin { flex: none; width: 16px; height: 16px; margin-top: 2px; border-radius: 50%; border: 2px solid var(--accent-line); border-top-color: var(--accent); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spin { animation-duration: 2.4s; } }
.notice.bad { border-left-color: var(--bad); background: var(--bad-soft, #fdecec); }
.notice.bad ul { margin: 6px 0 0; padding-left: 18px; }
.cert-more { margin: 22px 0 10px; font-size: 13px; color: var(--muted); font-weight: 600; }

/* ---------- 0.12 Network page ---------- */
.net-places { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px; margin-bottom: 18px; }
.net-place { text-align: left; display: flex; flex-direction: column; gap: 3px; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--r);
  background: var(--panel); color: var(--ink); cursor: pointer; font: inherit; }
.net-place:hover { border-color: var(--accent-line); }
.net-place.active { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); background: var(--accent-soft); }
.net-place:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.net-place-where { font: 600 15px/1.3 var(--font-display); }
.net-place .mono { font-size: 12.5px; color: var(--ink-2); }
.net-place-n { font-size: 13px; color: var(--ink-2); }
.net-table td { vertical-align: top; }
.net-table td.mono div + div { margin-top: 2px; }
.net-note { margin-top: 18px; }
.net-note ul { margin: 8px 0 0; padding-left: 18px; color: var(--ink-2); display: grid; gap: 4px; }

/* ---------- 0.13 moving agents ---------- */
.move-status { border: 1px solid var(--line); border-radius: var(--r-sm); padding: 12px 14px; background: var(--panel-2); margin-top: 12px; }
.move-status p { margin: 0 0 6px; }
.move-list { margin: 0 0 10px; padding-left: 18px; columns: 2; }
.bad-text { color: var(--bad); }
@media (max-width: 760px) { .move-list { columns: 1; } }
