/* ByteFusion ops dashboard — palette taken from the approved mockups. */

:root {
  /* Dark, but lifted: surfaces sit above the ground with a top-edge highlight
     and real shadow, rather than being flat blocks separated by borders. */
  --bg-top:#0d1526; --bg-bot:#070c17;
  --panel:#121c30; --panel-2:#0e1728; --sidebar:#0e1728;
  --line:#22304a; --line-soft:#1b2740; --line-2:#2c3d5c;
  --text:#eaf0f9; --text-2:#c6d0e0; --muted:#8fa0b8; --dim:#63748f;

  --cyan:#22d3ee; --cyan-solid:#22d3ee;
  --blue:#60a5fa; --green:#34d399; --amber:#fbbf24; --red:#f87171;

  --active:#17293f;
  --hover:#16223a;
  --hover-2:#1b2a44;
  --chip-bg:#1a2436;

  /* The gloss: a hairline of light along the top edge, then depth beneath. */
  --sheen:linear-gradient(180deg, rgba(255,255,255,.055), rgba(255,255,255,0) 42%);
  --edge:inset 0 1px 0 rgba(255,255,255,.06);
  --shadow-sm:0 1px 2px rgba(0,0,0,.3);
  --shadow:0 2px 4px rgba(0,0,0,.25), 0 12px 32px rgba(0,0,0,.35);
  --shadow-lg:0 18px 48px rgba(0,0,0,.55);

  --radius:12px;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

* { box-sizing:border-box; }

body {
  margin:0;
  font:14px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
  color:var(--text);
  background:linear-gradient(180deg, var(--bg-top), var(--bg-bot)) fixed;
  min-height:100vh;
  -webkit-font-smoothing:antialiased;
}

a { color:var(--cyan); text-decoration:none; }
a:hover { text-decoration:underline; }
a.plain { color:var(--text); }
h1 { font-size:22px; margin:0 0 4px; letter-spacing:-.2px; }
h2 { font-size:13px; margin:0 0 14px; letter-spacing:.02em; }
h2.spaced { margin-top:26px; }
code { font-family:var(--mono); font-size:.92em; color:var(--cyan); }

/* ---------- shell ---------- */

.shell { display:flex; flex-direction:column; min-height:100vh; }

/* ---------- top bar: brand, dashboard switch, settings ---------- */

.topbar {
  height:64px; background:rgba(255,255,255,.86); backdrop-filter:saturate(1.6) blur(10px); border-bottom:1px solid var(--line);
  display:flex; align-items:center; gap:32px;
  padding:0 24px 0 22px; position:sticky; top:0; z-index:20;
}

.brand { display:flex; align-items:center; gap:11px; font-weight:700; font-size:17px; flex:0 0 auto; }
/* The mark is a transparent PNG cut from the real logo, so it sits directly on
   the panel with no plate behind it. */
.brand .mark { height:32px; width:auto; flex:0 0 auto; display:block; }
.brand.big { flex-direction:column; gap:12px; justify-content:center; padding:0 0 4px; font-size:21px; }
.brand.big .mark { height:62px; }

/* The two dashboards. This is the only place they are switched. */
.switch { display:flex; align-items:center; gap:4px; }
.switch a {
  display:block; padding:8px 18px; border-radius:8px;
  font-size:13px; font-weight:600; letter-spacing:.02em; color:var(--muted);
}
.switch a:hover { color:var(--text); background:var(--hover); text-decoration:none; }
.switch a.on { background:var(--active); color:var(--text); }

.topright { display:flex; align-items:center; gap:20px; margin-left:auto; }

.live { display:inline-flex; align-items:center; gap:7px; color:var(--green); font-size:12px; font-weight:700; }
.live b, .dot {
  width:8px; height:8px; border-radius:50%; background:var(--green); display:inline-block;
}
.live.small { font-weight:600; margin-left:10px; text-transform:none; }
#pulse-dot { transition:opacity .3s; }
#pulse-dot.beat { opacity:.25; }
.clock { font-size:12px; color:var(--muted); }
.clock em { font-style:normal; color:var(--dim); }

.avatar {
  width:32px; height:32px; border-radius:50%; background:rgba(34,211,238,.16);
  color:var(--cyan); font-weight:700; font-size:12px;
  display:flex; align-items:center; justify-content:center; text-transform:uppercase;
}

/* Settings menu. <details> rather than JS so it keyboard-toggles for free. */
.menu { position:relative; }
.menu summary {
  list-style:none; cursor:pointer; display:flex; align-items:center; gap:7px;
  padding:4px; border-radius:20px;
}
.menu summary::-webkit-details-marker { display:none; }
.menu summary:focus-visible { outline:2px solid var(--cyan); outline-offset:2px; }
.caret {
  width:0; height:0; border-left:4px solid transparent; border-right:4px solid transparent;
  border-top:5px solid var(--muted);
}
.menu[open] .caret { transform:rotate(180deg); }
.menu-panel {
  position:absolute; right:0; top:calc(100% + 10px); min-width:210px;
  background:var(--panel); border:1px solid var(--line); border-radius:var(--radius);
  box-shadow:var(--shadow-lg);
  display:flex; flex-direction:column; padding:6px; gap:2px; z-index:30;
}
.menu-who {
  display:flex; flex-direction:column; line-height:1.3;
  padding:10px 12px 12px; border-bottom:1px solid var(--line); margin-bottom:4px;
}
.menu-who strong { font-size:12px; font-weight:600; }
.menu-who span { font-size:11px; color:var(--muted); }
.menu-panel a {
  padding:9px 12px; border-radius:8px; color:var(--muted); font-size:13px;
}
.menu-panel a:hover { background:var(--hover); color:var(--text); text-decoration:none; }
.menu-panel a.on { background:var(--active); color:var(--text); }
.menu-soon {
  padding:8px 12px; font-size:11px; color:var(--dim); font-style:italic;
}
.menu-out {
  margin:4px 0 2px; padding:9px 12px; width:100%; text-align:left;
  background:none; border:0; border-top:1px solid var(--line);
  color:var(--muted); font-size:12px; cursor:pointer; font-family:inherit;
}
.menu-out:hover { color:var(--red); }

/* ---------- body: contextual sidebar + page ---------- */

.body-row { display:flex; flex:1; min-height:0; }

.sidebar {
  width:200px; flex:0 0 200px; background:var(--sidebar);
  border-right:1px solid var(--line);
  display:flex; flex-direction:column; position:sticky; top:64px;
  height:calc(100vh - 64px); padding-top:18px;
}

/* Names the dashboard these sections belong to, so the sidebar is never
   mistaken for the top-level switch. */
.side-label {
  padding:0 20px 10px; font-size:10px; letter-spacing:.14em; text-transform:uppercase;
  color:var(--dim); font-weight:700;
}

.sidebar nav { display:flex; flex-direction:column; gap:6px; padding:0 14px; }
.sidebar nav a {
  display:block; padding:10px 20px; border-radius:8px;
  color:var(--muted); font-size:13px; position:relative;
}
.sidebar nav a:hover { color:var(--text); background:var(--hover); text-decoration:none; }
.sidebar nav a.on { background:var(--active); color:var(--text); }
.sidebar nav a.on::before {
  content:""; position:absolute; left:0; top:0; bottom:0; width:3px;
  background:var(--cyan); border-radius:3px 0 0 3px;
}

.linkish {
  background:none; border:0; color:var(--muted); font-size:11px;
  cursor:pointer; padding:0; text-decoration:underline;
}
.linkish:hover { color:var(--red); }

main { flex:1; min-width:0; }

.crumb-row { padding:18px 32px 0; }
.crumb { font-size:13px; color:var(--dim); }
.crumb a { color:var(--dim); }

.content { padding:28px 32px 60px; max-width:1560px; }
.lede { color:var(--muted); font-size:13px; margin:0 0 20px; }

/* ---------- cards & layout ---------- */

.card {
  background:var(--panel); border:1px solid var(--line);
  border-radius:var(--radius); padding:18px 20px; margin-bottom:20px;
  box-shadow:var(--shadow-sm);
}
.card.flush { padding:0; overflow:hidden; }
.cols { display:grid; grid-template-columns:1fr 1fr; gap:20px; align-items:start; }
.cols.detail { grid-template-columns:1.55fr 1fr; }
.stack > .card:last-child { margin-bottom:20px; }
@media (max-width:1100px) { .cols, .cols.detail { grid-template-columns:1fr; } }

.ro, .ours {
  font-size:10px; font-weight:600; padding:2px 7px; border-radius:9px;
  margin-left:8px; vertical-align:middle; letter-spacing:.03em;
}
.ro   { background:var(--chip-bg); color:var(--dim); }
.ours { background:rgba(34,211,238,.14); color:var(--cyan); }

/* ---------- tiles ---------- */

.tiles { display:grid; grid-template-columns:repeat(auto-fit,minmax(190px,1fr)); gap:20px; margin-bottom:20px; }
.tile {
  background:var(--panel); border:1px solid var(--line); border-radius:var(--radius);
  padding:16px 18px; display:flex; flex-direction:column; gap:6px;
}
.tile .k { font-size:12px; color:var(--muted); }
.tile .v { font-size:30px; font-weight:700; line-height:1.1; }
.tile .s { font-size:11px; }
.v.red, .s.red, .red { color:var(--red); }
.v.amber { color:var(--amber); }
.v.cyan { color:var(--cyan); }
.s.blue { color:var(--blue); }
.s.muted, .muted { color:var(--muted); }

/* ---------- bars ---------- */

.bars { display:flex; flex-direction:column; gap:9px; }
.bar-row { display:grid; grid-template-columns:130px 1fr 32px; align-items:center; gap:12px; }
.bar-label { font-size:12px; color:var(--text-2); overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.bar-track { background:var(--hover); border-radius:5px; height:10px; overflow:hidden; }
.bar-track i { display:block; height:100%; background:var(--cyan); border-radius:5px; }
.bar-track i.alt  { background:var(--blue); }
.bar-track i.ok   { background:var(--green); }
.bar-track i.warn { background:var(--amber); }
.bar-n { font-size:12px; color:var(--muted); text-align:right; font-family:var(--mono); }

.spark { display:flex; align-items:flex-end; gap:10px; height:150px; padding-top:10px; }
.spark-col { flex:1; display:flex; flex-direction:column; justify-content:flex-end; align-items:center; height:100%; gap:6px; }
.spark-col i { width:100%; background:linear-gradient(180deg, var(--cyan), rgba(34,211,238,.25)); border-radius:4px 4px 0 0; min-height:3px; }
.spark-col span { font-size:10px; color:var(--dim); font-family:var(--mono); }

/* ---------- tables ---------- */

.grid { width:100%; border-collapse:collapse; }
.grid th {
  text-align:left; font-size:11px; font-weight:700; color:var(--muted);
  letter-spacing:.04em; text-transform:uppercase;
  padding:14px 14px 10px; border-bottom:1px solid var(--line); white-space:nowrap;
}
.grid td { padding:11px 14px; border-bottom:1px solid var(--line-soft); font-size:12.5px; vertical-align:middle; }
.grid tbody tr:last-child td { border-bottom:0; }
.grid tbody tr:hover { background:var(--hover); }
.grid.tight td { padding:8px 14px; }
.grid .right { text-align:right; }
.board tr.flagged td:first-child { box-shadow:inset 3px 0 0 var(--red); }

.mono { font-family:var(--mono); }
.strong { font-weight:600; display:block; }
.sub2 { color:var(--dim); font-size:11px; display:block; }
.truncate { max-width:260px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.truncate.wide { max-width:340px; }
.comment { color:var(--text-2); max-width:280px; }
.comment .count { color:var(--cyan); font-size:11px; margin-left:6px; }
.empty { color:var(--dim); }
.pad { padding:24px 14px !important; text-align:center; }

.chip {
  display:inline-block; padding:3px 10px; border-radius:11px; font-size:11px;
  background:var(--chip-bg); color:var(--muted); white-space:nowrap;
}
.chip + .chip { margin-left:5px; }
.chip.warn { background:rgba(251,191,36,.15); color:var(--amber); }
.chip.ok   { background:rgba(52,211,153,.15); color:var(--green); }
.chip.bad  { background:rgba(248,113,113,.15); color:var(--red); }
.status-new,.status-assigned      { background:#152238; color:var(--blue); }
.status-in-progress               { background:rgba(34,211,238,.16); color:var(--cyan); }
.status-on-hold                   { background:rgba(251,191,36,.15); color:var(--amber); }
.status-resolved,.status-completed,.status-closed { background:rgba(52,211,153,.15); color:var(--green); }

/* two voices: tech and management */
.mgmt-tag { background:rgba(168,85,247,.16); color:#c084fc; }
.tech-tag { background:rgba(34,211,238,.14); color:var(--cyan); }
/* correspondence that came from MSP Manager itself, not typed here */
.mspm-tag { background:rgba(59,130,246,.16); color:#7ab0f8; }
.thread li.mspm .av { color:#7ab0f8; background:rgba(59,130,246,.16); }
.thread li.mspm .bubble { background:rgba(59,130,246,.05); border-color:#22375c; }
.mgmt-card { border-color:#3b2a55; }
.mgmt-card h2 { color:#c084fc; }
.quote {
  margin:0 0 10px; padding:10px 14px; border-left:3px solid #a855f7;
  background:rgba(168,85,247,.07); color:var(--text-2); font-size:13px;
  border-radius:0 6px 6px 0; white-space:pre-wrap;
}
.big-fact { font-size:19px; font-weight:600; margin:0 0 4px; }
.posting-as { font-size:11px; color:var(--dim); margin-left:auto; margin-right:14px; }
.posting-as strong { padding:2px 8px; border-radius:9px; font-size:10px; }
tr.row-changed { animation:flash 1.8s ease-out; }

/* ---------- forms ---------- */

input, select, textarea {
  background:var(--panel-2); border:1px solid var(--line-2); color:var(--text);
  border-radius:6px; padding:8px 10px; font-size:12.5px; font-family:inherit; width:100%;
}
input:focus, select:focus, textarea:focus { outline:2px solid rgba(34,211,238,.45); outline-offset:1px; border-color:var(--cyan); }
select { cursor:pointer; }
textarea { resize:vertical; }

button, .btn {
  background:var(--hover); border:1px solid var(--line-2); color:var(--text-2);
  border-radius:6px; padding:8px 16px; font-size:12.5px; cursor:pointer;
  font-family:inherit; width:auto; display:inline-block;
}
button:hover, .btn:hover { border-color:var(--cyan); color:var(--text); text-decoration:none; }
button.primary, .primary.btn { background:rgba(34,211,238,.16); border-color:var(--cyan); color:var(--cyan); font-weight:600; }

.card form { display:flex; gap:10px; align-items:center; }
.card form select, .card form input[type=date] { flex:1; }
.check { display:inline-flex; align-items:center; gap:7px; font-size:12px; color:var(--muted); cursor:pointer; }
.check input { width:auto; }

.toolbar { display:flex; justify-content:space-between; align-items:center; gap:16px; margin-bottom:16px; flex-wrap:wrap; }
.tabs { display:flex; gap:10px; flex-wrap:wrap; }
.tabs a {
  padding:7px 15px; border-radius:6px; background:var(--hover);
  border:1px solid var(--line-2); color:var(--muted); font-size:12px;
}
.tabs a:hover { color:var(--text); text-decoration:none; }
.tabs a.on { background:var(--active); border-color:var(--cyan); color:var(--cyan); }
.search { display:flex; gap:8px; }
.search input { width:280px; }

/* ---------- detail ---------- */

.badges { margin:0 0 18px; }
.facts { display:grid; grid-template-columns:1fr 1fr; gap:14px 24px; margin:0; }
.facts div { min-width:0; }
.facts dt { font-size:10.5px; color:var(--muted); text-transform:uppercase; letter-spacing:.05em; margin-bottom:3px; }
.facts dd { margin:0; font-size:13px; overflow-wrap:anywhere; }

.thread { list-style:none; margin:0 0 18px; padding:0; display:flex; flex-direction:column; gap:14px; }
.thread li { display:flex; gap:12px; align-items:flex-start; }
.av {
  width:32px; height:32px; flex:0 0 32px; border-radius:50%; background:var(--chip-bg);
  color:var(--cyan); font-size:10.5px; font-weight:700;
  display:flex; align-items:center; justify-content:center;
}
.thread li.system .av { color:var(--blue); }
.thread li.internal .av { color:var(--amber); }
.thread li.mgmt .av { color:#c084fc; background:rgba(168,85,247,.14); }
.bubble { flex:1; background:var(--panel-2); border:1px solid var(--line); border-radius:8px; padding:10px 13px; min-width:0; }
.thread li.internal .bubble { background:#12100a; border-color:#332108; }
.thread li.system .bubble { background:transparent; border-style:dashed; }
.thread li.mgmt .bubble { background:rgba(168,85,247,.07); border-color:#3b2a55; }
.bubble .meta { display:flex; align-items:center; gap:9px; font-size:11px; color:var(--muted); margin-bottom:5px; flex-wrap:wrap; }
.bubble .meta time { color:var(--dim); margin-left:auto; font-family:var(--mono); }
.bubble .tag { font-style:normal; background:rgba(251,191,36,.15); color:var(--amber); padding:1px 7px; border-radius:8px; font-size:10px; }
.bubble p { margin:0; color:var(--text-2); font-size:13px; white-space:pre-wrap; overflow-wrap:anywhere; }

.composer { flex-direction:column; align-items:stretch !important; gap:10px !important; }
.composer-row { display:flex; justify-content:space-between; align-items:center; }

.notes { margin:0; padding-left:18px; color:var(--muted); font-size:12px; line-height:1.9; }
.notes strong { color:var(--text-2); }

/* ---------- feed ---------- */

.feed { list-style:none; margin:0; padding:0; }
.feed li {
  display:flex; align-items:center; gap:12px;
  padding:11px 2px; border-bottom:1px solid var(--line-soft); font-size:12.5px;
}
.feed li:last-child { border-bottom:0; }
.feed .msg { flex:1; color:var(--text); min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.feed .cust { color:var(--muted); width:180px; flex:0 0 auto; text-align:right; }
.feed .when { color:var(--dim); width:110px; flex:0 0 auto; text-align:right; font-family:var(--mono); font-size:11px; }
.feed .dot.info { background:var(--blue); }
.feed .dot.warn { background:var(--amber); }
.feed .dot.crit { background:var(--red); }
.feed li.fresh { animation:flash 1.6s ease-out; }
@keyframes flash {
  0%   { background:rgba(34,211,238,.16); }
  100% { background:transparent; }
}
@media (max-width:800px) { .feed .cust { display:none; } }

/* ---------- login ---------- */

body.centered { display:flex; align-items:center; justify-content:center; padding:24px; }
.login { width:100%; max-width:370px; display:flex; flex-direction:column; gap:16px; padding:32px; margin:0; }
.login .sub { text-align:center; color:var(--muted); font-size:12.5px; margin:-8px 0 4px; }
.login label { display:flex; flex-direction:column; gap:6px; font-size:12px; color:var(--muted); }
.login button { width:100%; padding:11px; font-size:13px; }

.fineprint { font-size:11px; color:var(--dim); line-height:1.6; margin:12px 0 0; }
.flash { padding:10px 14px; border-radius:6px; font-size:12.5px; margin-bottom:14px; }
.flash.error { background:rgba(248,113,113,.15); color:var(--red); border:1px solid #5b1f26; }
.flash.ok    { background:rgba(52,211,153,.15); color:var(--green); border:1px solid #1d4a35; }

.centre-card { text-align:center; padding:60px 20px; }
.big-code { font-size:52px; color:var(--dim); margin-bottom:8px; }

@media (max-width:760px) {
  .shell { flex-direction:column; }
  .sidebar { width:100%; flex:none; height:auto; position:static; flex-direction:row;
             flex-wrap:wrap; align-items:center; }
  .sidebar nav { flex-direction:row; flex:1; }
  .who { margin:8px 14px; }
  .content, .topbar { padding-left:16px; padding-right:16px; }
  .search input { width:100%; }
}

/* ---------- RMM failing-checks table ----------
   Fixed layout so one check returning a full software inventory cannot push
   the other columns out of alignment. Widths are percentages so the table
   still adapts, but the ratios stay put. */

.grid.checks { table-layout:fixed; width:100%; }
.grid.checks col.c-client { width:16%; }
.grid.checks col.c-device { width:18%; }
.grid.checks col.c-check  { width:22%; }
.grid.checks col.c-result { width:30%; }
.grid.checks col.c-since  { width:14%; }

/* Every cell in a row sits on the same line, whatever its content height.
   Top-alignment left a one-line "4 Missing" and a three-line dump starting at
   different heights from the date beside them, so rows read as ragged. */
.grid.checks th, .grid.checks td { vertical-align:middle; }
.grid.checks td { padding-top:10px; padding-bottom:10px; }
.grid.checks th, .grid.checks td { padding-left:14px; padding-right:14px; }
.grid.checks th.right, .grid.checks td.right { text-align:right; }
.grid.checks td.right { font-variant-numeric:tabular-nums; white-space:nowrap; }
.grid.checks td.nowrap { white-space:nowrap; font-variant-numeric:tabular-nums; }

/* Two-line identity cell: name on top, qualifier beneath. */
.grid.checks .cell-main { display:block; }
.grid.checks .cell-sub  { display:block; font-size:11px; color:var(--dim); margin-top:2px; }

/* The long one. Clamp to three lines; the full text is the cell's tooltip. */
/* The clamp lives on an inner div. Putting display:-webkit-box on the <td>
   itself stops it being a table cell, which breaks the row's borders and
   pulls the column out of the grid. */
.grid.checks td.result { font-size:12px; color:var(--muted); line-height:1.45; }
.grid.checks td.result .clamp {
  overflow:hidden; overflow-wrap:anywhere;
  display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical;
}

/* Panel padding that does not centre its contents — unlike .pad, which is for
   empty-state messages and was silently centring every table cell. */
.panel-pad { padding:0 0 4px; }
.panel-pad .grid th, .panel-pad .grid td { text-align:left; }
.panel-pad .grid th.right, .panel-pad .grid td.right { text-align:right; }
.panel-pad > p { padding:0 14px 12px; }

.grid.checks .cell-main { display:inline; }
.grid.checks .chip { margin-left:6px; vertical-align:baseline; }

@media (max-width:1100px) {
  .grid.checks { table-layout:auto; min-width:820px; }
}

/* ================= management service report =================
   Screen view is the dashboard's dark theme; print is a clean white
   one-pager. The filter bar never prints — a report should show what it
   was filtered to, not the controls. */

.filters {
  display:flex; flex-wrap:wrap; align-items:flex-end; gap:12px;
  background:var(--panel); border:1px solid var(--line);
  border-radius:var(--radius); padding:14px 16px; margin-bottom:20px;
}
.filters label {
  display:flex; flex-direction:column; gap:5px;
  font-size:11px; color:var(--muted); text-transform:uppercase; letter-spacing:.06em;
}
.filters select {
  background:var(--panel-2); color:var(--text); border:1px solid var(--line);
  border-radius:7px; padding:7px 10px; font-size:13px; font-family:inherit; min-width:150px;
}
.btn {
  border:1px solid var(--line); background:var(--panel-2); color:var(--text);
  border-radius:7px; padding:8px 16px; font-size:13px; cursor:pointer;
  font-family:inherit; text-decoration:none; display:inline-block;
}
.btn:hover { background:var(--hover-2); text-decoration:none; }
.btn.primary { background:var(--cyan-solid); border-color:var(--cyan); color:#06121f; font-weight:600; }
.btn.ghost { color:var(--muted); }

.report {
  background:var(--panel); border:1px solid var(--line);
  border-radius:var(--radius); padding:28px 30px 22px;
}
.report-head {
  display:flex; justify-content:space-between; align-items:flex-start;
  gap:20px; padding-bottom:18px; border-bottom:2px solid var(--cyan); flex-wrap:wrap;
}
.rh-brand { display:flex; align-items:center; gap:13px; }
.rh-brand .mark { height:40px; width:auto; }
.rh-brand strong { display:block; font-size:19px; letter-spacing:-.01em; }
.rh-brand span { display:block; font-size:12px; color:var(--muted); }
.rh-meta { text-align:right; display:flex; flex-direction:column; gap:3px; }
.rh-date { font-size:12px; color:var(--muted); }
.rh-scope { font-size:12px; color:var(--cyan); font-weight:600; }

.report-kpis { display:grid; grid-template-columns:repeat(4,1fr); gap:14px; margin:22px 0; }
.kpi {
  background:var(--panel-2); border:1px solid var(--line); border-radius:var(--radius);
  padding:16px 18px; display:flex; flex-direction:column; gap:4px;
}
.kpi-n { font-size:30px; font-weight:700; line-height:1; font-variant-numeric:tabular-nums; }
.kpi-k { font-size:11px; color:var(--muted); text-transform:uppercase; letter-spacing:.06em; }

.report-split { display:grid; grid-template-columns:1fr 1fr; gap:26px; margin-bottom:24px; }
.rs-block h3, .report-tickets h3 {
  font-size:12px; text-transform:uppercase; letter-spacing:.08em;
  color:var(--muted); margin:0 0 12px; font-weight:700;
}
.rt-note { text-transform:none; letter-spacing:0; font-weight:400; color:var(--dim); margin-left:8px; }

.barlist { list-style:none; margin:0; padding:0; display:flex; flex-direction:column; gap:8px; }
.barlist li { display:grid; grid-template-columns:1fr 96px 30px; gap:10px; align-items:center; font-size:12.5px; }
.bl-bar { background:var(--panel-2); border-radius:4px; height:8px; overflow:hidden; }
.bl-bar i { display:block; height:100%; background:linear-gradient(90deg,var(--cyan-solid),var(--cyan)); border-radius:4px; }
.bl-n { text-align:right; font-variant-numeric:tabular-nums; color:var(--muted); }

.report-grid { table-layout:fixed; }
.report-grid col.r-id     { width:8%; }
.report-grid col.r-client { width:17%; }
.report-grid col.r-title  { width:27%; }
.report-grid col.r-status { width:13%; }
.report-grid col.r-update { width:35%; }
.report-grid th, .report-grid td { text-align:left; vertical-align:top; }
.report-grid .chip.status { background:rgba(34,211,238,.14); color:var(--cyan); border:1px solid rgba(34,211,238,.28); }
.report-grid .update { font-size:12px; color:var(--text-2); }
.up-body { display:block; }
.up-by { display:block; color:var(--dim); font-size:11px; margin-top:3px; }
.up-none { color:var(--dim); font-style:italic; }

.report-foot {
  display:flex; justify-content:space-between; gap:14px; flex-wrap:wrap;
  border-top:1px solid var(--line); margin-top:20px; padding-top:14px;
  font-size:11px; color:var(--dim);
}

@media print {
  @page { size:A4; margin:12mm; }
  .no-print, .topbar, .sidebar, .crumb-row { display:none !important; }
  body, .shell, .body-row, main, .content { background:#fff !important; display:block !important; }
  .content { padding:0 !important; max-width:none !important; }
  .report { background:#fff; border:0; padding:0; color:#111; }
  .report * { color:#111 !important; }
  .rh-scope, .bl-bar i { color:#0b7285 !important; }
  .bl-bar i { background:#0b7285 !important; }
  .kpi, .bl-bar { background:#f4f6f8 !important; border-color:#d9e0e6 !important; }
  .report-head { border-bottom-color:#0b7285 !important; }
  .grid td, .grid th { border-color:#d9e0e6 !important; }
  .grid tbody tr:hover { background:transparent !important; }
  .report-grid .chip.status { background:#eef4f7 !important; border:1px solid #d9e0e6; }
  .up-by, .up-none, .kpi-k, .rh-brand span { color:#5b6b78 !important; }
  tr, .kpi, .rs-block { break-inside:avoid; }
  thead { display:table-header-group; }
}

/* ================= gloss pass =================
   Every static panel gets the same treatment: the panel colour, a sheen along
   its top edge, a hairline inset highlight, and depth beneath. Applied in one
   place so surfaces stay consistent instead of each page inventing its own. */

.card,
.tile,
.panel,
.kpi,
.report,
.filters,
.menu-panel {
  background-image: var(--sheen);
  background-color: var(--panel);
  box-shadow: var(--edge), var(--shadow);
  border-color: var(--line);
}

/* Glass: content scrolls under the bar rather than colliding with it. */
.topbar {
  background: rgba(13, 21, 38, .72);
  backdrop-filter: saturate(150%) blur(14px);
  -webkit-backdrop-filter: saturate(150%) blur(14px);
  box-shadow: 0 1px 0 rgba(255,255,255,.04), 0 6px 22px rgba(0,0,0,.35);
}

.sidebar {
  background: linear-gradient(180deg, rgba(255,255,255,.03), rgba(255,255,255,0) 220px),
              var(--sidebar);
}

/* Selected nav reads as a raised pill, not a flat swatch. */
.sidebar nav a.on,
.switch a.on {
  background-image: linear-gradient(180deg, rgba(34,211,238,.16), rgba(34,211,238,.05));
  box-shadow: var(--edge), 0 2px 10px rgba(0,0,0,.3);
}

/* KPI numerals: the one place a little shine is worth it. */
.kpi-n, .tile .v {
  background: linear-gradient(180deg, var(--text), #9fb3cc);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
}
.tile .v.ok   { background:none; -webkit-text-fill-color: var(--green); }
.tile .v.warn { background:none; -webkit-text-fill-color: var(--amber); }
.tile .v.amber{ background:none; -webkit-text-fill-color: var(--amber); }

.grid tbody tr:hover { background: var(--hover); }
.chip { box-shadow: var(--edge); }
.btn { box-shadow: var(--edge), var(--shadow-sm); }
.btn.primary { box-shadow: 0 2px 12px rgba(34,211,238,.28); }

/* The print sheet must stay white — the gloss is a screen treatment only. */
@media print {
  .card, .tile, .panel, .kpi, .report, .filters {
    background-image: none !important; box-shadow: none !important;
  }
  .kpi-n, .tile .v { background: none !important; -webkit-text-fill-color: #111 !important; }
}

/* ---------- live heart-rate trace ----------
   Sits behind the brand and the dashboard switch, running the full width of
   the bar. Not decoration for its own sake: the trace scrolls constantly and
   spikes on real polls, so a flat line means the feed has stopped. */

/* Deliberately NOT setting position or overflow here: the bar is already
   `position:sticky`, which both keeps it pinned and gives the ECG canvas its
   positioning context. An earlier `position:relative; overflow:hidden` here
   un-stuck the bar and clipped the settings dropdown. */
.ecg {
  position:absolute; inset:0; width:100%; height:100%;
  z-index:0; pointer-events:none; opacity:.6;
}
/* Above the page, below the dropdown. */
.topbar { z-index:40; }
.menu-panel { z-index:60; }
.topbar > .brand,
.topbar > .switch,
.topbar > .topright { position:relative; z-index:1; }

/* The bar is glass, so the trace must not fight the text above it. */
.topbar > .brand::before,
.topbar > .topright::before {
  content:""; position:absolute; inset:-10px -16px; z-index:-1;
  background:radial-gradient(ellipse at center, rgba(13,21,38,.92), rgba(13,21,38,0) 72%);
}

@media (prefers-reduced-motion: reduce) { .ecg { display:none; } }

/* ---------- live status frame ----------
   The ECG runs the full width of the bar, including behind this. A frosted
   pill keeps the trace visible through it while giving the status and clock
   enough ground to stay legible. */

.live-frame {
  display:inline-flex; align-items:center; gap:12px;
  padding:7px 14px; border-radius:999px;
  background:linear-gradient(180deg, rgba(255,255,255,.07), rgba(255,255,255,.02)),
             rgba(11,18,32,.72);
  border:1px solid rgba(255,255,255,.09);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.10),
              0 2px 10px rgba(0,0,0,.35);
  backdrop-filter: saturate(160%) blur(8px);
  -webkit-backdrop-filter: saturate(160%) blur(8px);
}
.live-frame .divider {
  width:1px; height:14px; background:rgba(255,255,255,.14); display:inline-block;
}
.live-frame .clock { color:var(--text-2); }
.live-frame .live { letter-spacing:.06em; }
.live-frame .live b { box-shadow:0 0 8px rgba(52,211,153,.8); }

/* The frame now does this job, so the wash behind the right-hand cluster is
   no longer needed — it was dimming the trace for no gain. */
.topbar > .topright::before { content:none; }


/* The Since column carries a full timestamp. At 12% it was narrower than its
   own content, so `nowrap` pushed the text out of the cell and it stopped
   lining up under the header. Date over time, right-aligned, with the column
   widened to fit. */
.grid.checks td.when { text-align:right; white-space:nowrap; font-variant-numeric:tabular-nums; }
.grid.checks td.when .cell-main { display:block; font-size:12px; color:var(--muted); }
.grid.checks td.when .cell-sub  { display:block; font-size:11px; color:var(--dim); margin-top:2px; }


/* Signed-in avatar: same frosted treatment as the live frame, so the two
   right-hand elements read as one family. */
.menu summary .avatar {
  background:linear-gradient(180deg, rgba(34,211,238,.30), rgba(34,211,238,.12));
  border:1px solid rgba(255,255,255,.14);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.22), 0 2px 10px rgba(0,0,0,.35);
  color:#d8fbff;
  backdrop-filter: saturate(160%) blur(8px);
  -webkit-backdrop-filter: saturate(160%) blur(8px);
}
.menu summary:hover .avatar { box-shadow: inset 0 1px 0 rgba(255,255,255,.28), 0 0 14px rgba(34,211,238,.4); }
.menu summary { border:1px solid transparent; }
.menu[open] summary { border-color:rgba(255,255,255,.10); background:rgba(255,255,255,.04); }

/* ---------- RMM device detail ---------- */

.checklist { list-style:none; margin:0; padding:0; display:flex; flex-direction:column; gap:16px; }
.checklist li { border-bottom:1px solid var(--line-soft); padding-bottom:14px; }
.checklist li:last-child { border-bottom:0; padding-bottom:0; }
.cl-head { display:flex; align-items:center; gap:10px; justify-content:space-between; }
.cl-name { font-weight:600; font-size:13.5px; }
.cl-meta { color:var(--dim); font-size:11.5px; margin-top:3px; }
.cl-out {
  margin:10px 0 0; padding:11px 13px; border-radius:8px;
  background:var(--panel-2); border:1px solid var(--line-soft);
  color:var(--text-2); font-family:var(--mono); font-size:11.5px; line-height:1.55;
  white-space:pre-wrap; overflow-wrap:anywhere; max-height:320px; overflow:auto;
}

/* Spec sheet: label left, value right, aligned down the column. */
.spec { display:grid; grid-template-columns:auto 1fr; gap:9px 18px; margin:0; }
.spec dt { color:var(--muted); font-size:11px; text-transform:uppercase; letter-spacing:.05em; }
.spec dd { margin:0; font-size:13px; color:var(--text); overflow-wrap:anywhere; }

/* The read-only note belongs before the table, not after it — it explains why
   the Status and Assigned columns cannot be clicked. */
.fineprint.top { margin:0 0 16px; }

/* A row that navigates should look like it does. */
.row-link { cursor:pointer; }
.row-link:hover { background:var(--hover); }
.row-link:focus-visible { outline:2px solid var(--cyan); outline-offset:-2px; }
.row-link td:first-child { position:relative; }
.row-link:hover td:first-child::before {
  content:""; position:absolute; left:0; top:0; bottom:0; width:2px; background:var(--cyan);
}

/* Feed down: the frame turns red alongside the flatlined trace, so the state
   is legible even at a glance across the room. */
.live-frame.down {
  border-color:rgba(248,113,113,.45);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.08), 0 0 16px rgba(248,113,113,.25);
}
.live-frame.down .live { color:var(--red); }
.live-frame.down .live b { background:var(--red); box-shadow:0 0 8px rgba(248,113,113,.9); }

/* ---------- Cove backup table ---------- */
.grid.cove { table-layout:fixed; }
.grid.cove col.v-client { width:20%; }
.grid.cove col.v-device { width:28%; }
.grid.cove col.v-last   { width:24%; }
.grid.cove col.v-size   { width:14%; }
.grid.cove col.v-plan   { width:14%; }
.grid.cove th, .grid.cove td { text-align:left; vertical-align:middle; }
.grid.cove th.right, .grid.cove td.right { text-align:right; }
.grid.cove td.nowrap { white-space:nowrap; font-variant-numeric:tabular-nums; }
.grid.cove .cell-main { display:block; }
.grid.cove .cell-sub  { display:block; font-size:11px; color:var(--dim); margin-top:2px; }
.grid.cove tr.flagged td:first-child { box-shadow:inset 3px 0 0 var(--red); }
.grid.cove .chip.bad { margin-left:8px; }

/* ---------- hosting estate ---------- */
.grid.hosting { table-layout:fixed; }
.grid.hosting col.h-domain { width:24%; }
.grid.hosting col.h-acct   { width:19%; }
.grid.hosting col.h-site   { width:19%; }
.grid.hosting col.h-cert   { width:13%; }
.grid.hosting col.h-dom    { width:13%; }
.grid.hosting col.h-disk   { width:12%; }
.grid.hosting th, .grid.hosting td { text-align:left; vertical-align:middle; }
.grid.hosting th.right, .grid.hosting td.right { text-align:right; }
.grid.hosting td.nowrap { white-space:nowrap; font-variant-numeric:tabular-nums; }
.grid.hosting .cell-main { display:block; }
.grid.hosting .cell-sub { display:block; font-size:11px; color:var(--dim); margin-top:2px; }
.grid.hosting tr.flagged td:first-child { box-shadow:inset 3px 0 0 var(--red); }
.grid.hosting .red { color:var(--red); font-weight:600; }

.alertlist { list-style:none; margin:0; padding:0 14px; display:flex; flex-direction:column; gap:9px; }
.alertlist li { display:grid; grid-template-columns:8px 1fr auto auto; gap:12px; align-items:center; font-size:13px; }
.al-dot { width:8px; height:8px; border-radius:50%; background:var(--amber); }
.al-down .al-dot, .al-domain-expired .al-dot { background:var(--red); }
.al-cert .al-dot { background:var(--amber); }
.al-backup .al-dot { background:var(--dim); }
.alertlist .al-domain { font-weight:600; }
.alertlist .al-text { color:var(--text-2); }
.alertlist .al-user { font-size:11.5px; }

/* ---------- Sophos ---------- */
.grid.sophos th, .grid.sophos td { text-align:left; vertical-align:middle; }
.grid.sophos th.right, .grid.sophos td.right { text-align:right; }
.grid.sophos td.nowrap { white-space:nowrap; }
.grid.sophos .cell-main { display:block; }
.grid.sophos .cell-sub { display:block; font-size:11px; color:var(--dim); margin-top:2px; }
.grid.sophos tr.flagged td:first-child { box-shadow:inset 3px 0 0 var(--red); }
.grid.sophos .chip { margin-right:5px; }
.sub-head { font-size:11px; text-transform:uppercase; letter-spacing:.08em;
            color:var(--muted); margin:20px 0 10px; padding:0 14px; font-weight:700; }
.al-high .al-dot { background:var(--red); }
.al-medium .al-dot { background:var(--amber); }
.al-low .al-dot { background:var(--dim); }
