/* Vigil RMM — Ultimate Solutions console theme.
   Dark navy, cobalt actions, cyan only on the reticle and focus. */

:root {
  color-scheme: dark;
  --bg: #04060d;
  --bg-2: #070b16;
  --surface: #0d1528;
  --surface-2: #141e36;
  --line: rgba(150, 180, 255, 0.2);
  --line-strong: rgba(110, 160, 255, 0.72);
  --text: #f4f7ff;
  --muted: #a9b7d0;
  --faint: #7d8eae;
  --cobalt: #4c7dff;
  --cobalt-deep: #2f5bff;
  --cyan: #8ee7ff;
  --ink: #07101f;
  --ok: #3ddc97;
  --warn: #f0b429;
  --crit: #ff5c7a;
  --shadow: 0 22px 50px rgba(0, 0, 0, 0.38);
  --radius: 16px;
  --radius-sm: 12px;
  --sidebar: 252px;
  --font: "Segoe UI", "Avenir Next", "Helvetica Neue", ui-sans-serif, system-ui, sans-serif;
  --mono: ui-monospace, "Cascadia Mono", "Segoe UI Mono", monospace;
  --account-slot: 0px;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; min-height: 100%; }
body {
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.5;
  background: var(--bg);
}
img { max-width: 100%; }
button, input, select, textarea { font: inherit; }
a { color: #b9cdff; }
a:hover { color: #fff; }

body.auth,
body.portal,
body.support {
  background-color: var(--bg);
  background-image:
    radial-gradient(900px 420px at 50% -14%, rgba(70, 120, 255, 0.34), transparent 60%),
    radial-gradient(520px 240px at 100% 100%, rgba(142, 231, 255, 0.08), transparent 55%),
    linear-gradient(rgba(120, 160, 255, 0.07) 1px, transparent 1px),
    linear-gradient(90deg, rgba(120, 160, 255, 0.07) 1px, transparent 1px);
  background-size: auto, auto, 48px 48px, 48px 48px;
  background-attachment: fixed;
}
body.console {
  background-color: var(--bg);
  background-image:
    radial-gradient(1100px 420px at 100% -12%, rgba(61, 107, 255, 0.28), transparent 58%),
    radial-gradient(640px 280px at 0% 0%, rgba(142, 231, 255, 0.08), transparent 50%),
    linear-gradient(rgba(120, 160, 255, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(120, 160, 255, 0.045) 1px, transparent 1px);
  background-size: auto, auto, 52px 52px, 52px 52px;
}

h1 {
  margin: 0 0 6px;
  font-size: 28px;
  font-weight: 760;
  letter-spacing: -0.045em;
  line-height: 1.08;
}
h2 {
  margin: 0 0 8px;
  font-size: 18px;
  font-weight: 680;
  letter-spacing: -0.02em;
  color: var(--text);
}
h3 {
  margin: 16px 0 8px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--faint);
}
p { margin: 0 0 10px; }
.sub, .muted { color: var(--muted); line-height: 1.55; }
.kicker {
  margin: 0 0 6px;
  color: #9eb6ff;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-size: 11px;
  font-weight: 700;
}

.brand { display: flex; gap: 12px; align-items: center; min-width: 0; text-decoration: none; color: inherit; }
.logo {
  display: block;
  width: min(220px, 100%);
  height: auto;
  background: transparent;
}
.mark {
  width: 44px;
  height: 44px;
  flex: none;
  display: block;
}
.lockup { min-width: 0; }
.wordmark {
  margin: 0;
  font-weight: 800;
  letter-spacing: 0.16em;
  font-size: 15px;
  line-height: 1;
}
.vigil { color: #fff; }
.rmm { color: #9ec0ff; margin-left: 0.35em; letter-spacing: 0.18em; text-shadow: 0 0 12px rgba(76, 125, 255, 0.55); }
.byline {
  margin: 5px 0 0;
  color: var(--faint);
  font-size: 12px;
  letter-spacing: 0.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Buttons and fields */
button, .btn {
  border-radius: var(--radius-sm);
  cursor: pointer;
}
button:not(.password-toggle):not(.ghost):not(.tab):not(.nav-toggle):not(.account-control):not(.end):not(.danger):not(.back-link):not(.report-open):not(.topo-node):not(.fleet-chip):not(.machine-card):not(.auth-tab):not(.toast-x):not(.pick),
a.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 0;
  border-radius: var(--radius-sm);
  padding: 10px 16px;
  min-height: 44px;
  background: linear-gradient(180deg, #6d94ff 0%, #3d66f2 100%);
  color: #fff;
  font-weight: 750;
  letter-spacing: 0.01em;
  text-decoration: none;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.22),
    0 1px 0 rgba(8, 16, 40, 0.25),
    0 8px 18px rgba(47, 91, 255, 0.28);
}
button:not(.password-toggle):not(.ghost):not(.tab):not(.nav-toggle):not(.account-control):not(.end):not(.danger):not(.back-link):not(.report-open):not(.topo-node):not(.fleet-chip):not(.machine-card):not(.auth-tab):not(.toast-x):not(.pick):hover,
a.btn:hover { filter: brightness(1.08); color: #fff; }
button.danger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 0;
  border-radius: var(--radius-sm);
  padding: 10px 16px;
  min-height: 44px;
  background: linear-gradient(180deg, #ff8aa0 0%, #e23d5c 55%, #b42340 100%);
  color: #fff;
  font-weight: 750;
  letter-spacing: 0.01em;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.28),
    0 0 0 1px rgba(255, 150, 170, 0.4),
    0 8px 24px rgba(180, 40, 70, 0.42);
}
button.danger:hover { filter: brightness(1.08); color: #fff; }
button.ghost.delete-device {
  color: #ffd0da;
  border-color: rgba(255, 92, 122, 0.55);
}
button.ghost.delete-device:hover { background: rgba(255, 92, 122, 0.16); color: #fff; }
button.ghost, a.btn.ghost {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(20, 36, 78, 0.55);
  color: #e7efff;
  border: 1px solid rgba(150, 186, 255, 0.55);
  box-shadow: 0 0 16px rgba(76, 125, 255, 0.18);
  font-weight: 700;
  min-height: 44px;
  padding: 10px 14px;
  text-decoration: none;
}
button.ghost:hover, a.btn.ghost:hover { background: rgba(61, 107, 255, 0.22); color: #fff; }
a.btn.ghost.top-link {
  flex: none;
  min-height: 34px;
  padding: 6px 12px;
  font-size: 13px;
  white-space: nowrap;
}
button.th-sort {
  background: none;
  border: 0;
  color: inherit;
  font: inherit;
  font-weight: 700;
  padding: 0;
  cursor: pointer;
  text-align: left;
}
button.th-sort.on { color: #fff; }
.tool-row { margin: 0 0 10px; }
.tool-param { display: block; margin: 0 0 6px; }
a.dl {
  display: inline-flex;
  align-items: center;
  margin: 0 6px 0 0;
  padding: 4px 9px;
  border-radius: 999px;
  border: 1px solid rgba(150, 186, 255, 0.55);
  background: rgba(47, 91, 255, 0.14);
  color: #e7f2ff;
  font-size: 12px;
  font-weight: 750;
  letter-spacing: 0.04em;
  text-decoration: none;
  text-transform: uppercase;
  box-shadow: 0 0 14px rgba(76, 125, 255, 0.22);
}
a.dl:hover { background: rgba(76, 125, 255, 0.32); color: #fff; }
.downloads { margin: 12px 0 4px; }
.ready-client {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}
.ready-client .downloads { margin: 0; }
.downloads.compact { display: inline-flex; gap: 6px; flex-wrap: wrap; }
button.end {
  border: 0;
  background: #e11d48;
  color: #fff;
  font-weight: 700;
  min-height: 44px;
  padding: 10px 14px;
}
button:disabled { opacity: 0.45; cursor: not-allowed; }
button.tab {
  background: transparent;
  color: var(--muted);
  border: 0;
  border-radius: 9px;
  padding: 8px 12px;
  min-height: 40px;
  font-weight: 650;
}
button.tab.on { color: #fff; background: var(--cobalt-deep); }
.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  width: fit-content;
  max-width: 100%;
  margin: 14px 0;
  padding: 4px;
  background: rgba(8, 12, 22, 0.45);
  border: 1px solid var(--line);
  border-radius: 12px;
}
.device-tabs { width: 100%; }
.page-actions, .actions { display: flex; flex-wrap: wrap; gap: 8px; }

label {
  display: block;
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 650;
}
label.row { color: var(--text); font-size: 15px; font-weight: 550; }
input:not([type="checkbox"]):not([type="file"]),
select,
textarea {
  width: 100%;
  margin-top: 6px;
  background: #0a1220;
  color: var(--text);
  border: 1px solid rgba(130, 158, 230, 0.28);
  border-radius: 10px;
  padding: 12px 14px;
  font-size: 16px;
}
textarea { min-height: 88px; resize: vertical; }
input[type="checkbox"] { width: 18px; height: 18px; accent-color: var(--cobalt); flex: none; }
input:focus, select:focus, textarea:focus, button:focus-visible, a:focus-visible, summary:focus-visible {
  outline: 2px solid var(--cyan);
  outline-offset: 2px;
}
.err { color: var(--crit); min-height: 1.2em; }
.token {
  font-family: var(--mono);
  color: var(--cyan);
  word-break: break-all;
}

.card, table.grid {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.card { padding: 18px 18px 16px; margin: 0 0 14px; box-shadow: inset 0 1px 0 rgba(180, 205, 255, 0.08); }
.list { display: grid; gap: 12px; }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.row > input,
.row > select,
.row > textarea { width: auto; flex: 1 1 160px; min-width: 0; margin-top: 0; }
.row > button, .row > .btn { flex: 0 0 auto; }

table { width: 100%; border-collapse: separate; border-spacing: 0; }
th, td {
  text-align: left;
  padding: 13px 14px;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
  font-size: 15px;
}
th {
  color: var(--faint);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-weight: 700;
  background: rgba(255, 255, 255, 0.02);
}
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover td { background: rgba(61, 107, 255, 0.06); }
.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.table-scroll table.grid { margin-top: 12px; }

.pill {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 3px 8px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  background: rgba(255, 255, 255, 0.05);
  color: var(--muted);
}
.pill.ok, .pill.installed { color: var(--ok); background: rgba(61, 220, 151, 0.12); }
.pill.warning, .pill.pending, .pill.open { color: var(--warn); background: rgba(240, 180, 41, 0.14); }
.pill.critical, .pill.offline, .pill.failed { color: var(--crit); background: rgba(255, 92, 122, 0.14); }
.pill.sample, .pill.approved, .pill.waiting, .pill.closed, .pill.none, .pill.info, .pill.unsupported { color: var(--muted); }
.pill.queued, .pill.running { color: #dce6ff; background: rgba(61, 107, 255, 0.18); }
.pill.done { color: var(--ok); background: rgba(61, 220, 151, 0.12); }

.metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin: 18px 0;
}
.count {
  background: linear-gradient(180deg, rgba(28, 44, 84, 0.72), var(--surface));
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 16px 16px 14px;
  border-top: 2px solid rgba(158, 190, 255, 0.7);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.22);
}
.count span { display: block; color: var(--muted); font-size: 13px; }
.count strong {
  display: block;
  margin-top: 8px;
  font-size: 30px;
  font-weight: 720;
  font-variant-numeric: tabular-nums;
  font-family: var(--mono);
  line-height: 1;
}
.count.ok { border-top-color: var(--ok); }
.count.ok strong { color: var(--ok); }
.count.warn { border-top-color: var(--warn); }
.count.warn strong { color: var(--warn); }
.count.crit { border-top-color: var(--crit); }
.count.crit strong { color: var(--crit); }
.metrics.secondary { margin-top: 0; }
.metrics.secondary .count { background: transparent; padding: 12px 14px; }
.metrics.secondary .count strong { font-size: 22px; color: var(--text); }
.metrics.secondary .count.ok strong,
.metrics.secondary .count.warn strong { color: var(--text); }
.metrics-pair { grid-template-columns: 1fr 1fr; }
a.count { color: inherit; text-decoration: none; display: block; }
a.count:hover { border-color: var(--line-strong); color: inherit; }
.count em {
  display: block;
  margin-top: 8px;
  color: var(--faint);
  font-style: normal;
  font-size: 12px;
  letter-spacing: 0.04em;
}
.banner {
  margin: 14px 0;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-left: 3px solid var(--cobalt);
  border-radius: var(--radius-sm);
  background: rgba(47, 91, 255, 0.12);
}
.banner strong { letter-spacing: 0.08em; text-transform: uppercase; font-size: 12px; color: #c9d8ff; }
.banner p { margin: 6px 0 0; }
.banner.warn { border-left-color: var(--warn); background: rgba(240, 180, 41, 0.08); }
.banner.crit { border-left-color: var(--crit); background: rgba(255, 92, 122, 0.08); }

.section-back { margin: 0 0 8px; }
button.back-link,
a.back-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 36px;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
  color: #b9cdff;
  font: inherit;
  font-weight: 700;
  font-size: 14px;
  letter-spacing: 0;
  text-decoration: none;
  text-transform: none;
  cursor: pointer;
}
button.back-link::before,
a.back-link::before { content: "←"; font-size: 16px; line-height: 1; }
button.back-link:hover,
a.back-link:hover { color: #fff; background: transparent; }
.report-group { margin-top: 18px; }
.report-group h3 { margin-bottom: 8px; }
.report-menu {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 12px;
}
button.report-open {
  display: block;
  width: 100%;
  margin: 0;
  text-align: left;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
  min-height: 72px;
  box-shadow: inset 0 1px 0 rgba(180, 205, 255, 0.08);
  font-weight: 650;
}
button.report-open:hover { border-color: var(--line-strong); background: rgba(47, 91, 255, 0.12); color: #fff; }
.page-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 16px 24px;
  flex-wrap: wrap;
}
.page-head h1 { margin: 0 0 6px; }
.page-head .sub { margin: 0; max-width: 62ch; }
#screen > .sub { max-width: 68ch; }
#screen > form.row {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px;
  margin: 16px 0;
}
.hits a { margin-right: 12px; }
a.link { color: #b9cdff; text-decoration: none; font-weight: 650; }
a.link:hover { color: #fff; }

.stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin: 12px 0;
}
.stats div {
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px;
}
.stats span {
  display: block;
  color: var(--faint);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.stats strong { font-family: var(--mono); font-size: 20px; }

.week { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; margin: 10px 0; }
.day {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 8px;
  min-height: 64px;
  font-size: 12px;
  color: var(--muted);
  background: rgba(8, 12, 22, 0.28);
}
.day strong { display: block; color: var(--text); font-size: 12px; letter-spacing: 0.04em; }
.day.on {
  border-color: rgba(61, 107, 255, 0.7);
  background: rgba(61, 107, 255, 0.14);
  color: #dce6ff;
}

.unifi-panel { width: min(1200px, 100%); }
#unifi-frame { width: 100%; height: min(70vh, 720px); border: 1px solid var(--line); border-radius: 12px; background: #000; }
.topo-customer { margin: 18px 0 6px; }
.topo-customer-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 12px 18px;
  margin-bottom: 10px;
}
.topo-customer-head h2 { margin: 0; }
.topo-customer-head p { margin: 0; }
.topo-site .cmd-head { align-items: flex-start; }
.topo-site-title { margin: 0 0 2px; font-size: 18px; }
.topo-site-meta { margin: 0 0 8px; }
.topo-stats { display: flex; flex-wrap: wrap; gap: 6px; margin: 0; }
.topo-stats .pill { margin: 0; }
.topo-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  margin: 2px 0 14px;
  color: var(--muted);
  font-size: 12px;
}
.topo-legend span { display: inline-flex; align-items: center; gap: 6px; }
.topo-legend .topo-dot { position: static; }
.topo-swatch { width: 10px; height: 10px; border-radius: 3px; background: #7d8eae; }
.topo-swatch.gateway { background: var(--warn); }
.topo-swatch.switch { background: var(--cobalt); }
.topo-swatch.ap { background: var(--ok); }
.topo-swatch.camera { background: var(--cyan); }
.topo-swatch.pc { background: #9eb6ff; }
.topo-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}
.topo-hint { margin: 0; color: var(--faint); font-size: 12px; }
.topo-tools { display: flex; gap: 6px; flex: none; }
.topo-tools .ghost { min-height: 32px; padding: 4px 10px; }
.topo-body { display: grid; grid-template-columns: minmax(0, 1fr) 260px; gap: 12px; align-items: stretch; }
.topo-body:not(:has(.topo-inspector)) { grid-template-columns: minmax(0, 1fr); }
.topo-viewport {
  position: relative;
  height: 420px;
  overflow: hidden;
  border-radius: 14px;
  border: 1px solid var(--line);
  background-color: #070b14;
  background-image:
    radial-gradient(480px 180px at 50% 0%, rgba(76, 125, 255, 0.2), transparent 70%),
    linear-gradient(rgba(120, 160, 255, 0.07) 1px, transparent 1px),
    linear-gradient(90deg, rgba(120, 160, 255, 0.07) 1px, transparent 1px);
  background-size: auto, 32px 32px, 32px 32px;
  cursor: grab;
  touch-action: none;
  user-select: none;
}
.topo-viewport:active { cursor: grabbing; }
.topo-stage { position: absolute; left: 0; top: 0; transform-origin: 0 0; }
.topo-links { position: absolute; inset: 0; overflow: visible; pointer-events: none; }
.topo-links path { fill: none; stroke: rgba(168, 196, 255, 0.82); stroke-width: 1.75; }
.topo-tier {
  position: absolute;
  left: 10px;
  width: 88px;
  text-align: right;
  transform: translateY(-50%);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #9eb6ff;
}
.topo-node {
  position: absolute;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: 1px;
  margin: 0;
  padding: 10px 26px 10px 12px;
  text-align: left;
  text-decoration: none;
  color: var(--text);
  background: linear-gradient(180deg, rgba(24, 38, 72, 0.98), rgba(10, 16, 32, 0.98));
  border: 1px solid rgba(150, 180, 255, 0.32);
  border-left: 3px solid #7d8eae;
  border-radius: 12px;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.32);
  min-height: 0;
  font-weight: 600;
  letter-spacing: 0;
  cursor: default;
}
button.topo-node, a.topo-node { cursor: pointer; }
button.topo-node:hover, a.topo-node:hover {
  border-color: rgba(186, 210, 255, 0.75);
  color: var(--text);
  filter: none;
}
.topo-node.role-wan { border-left-color: var(--cyan); border-style: dashed; border-left-style: solid; }
.topo-node.role-gateway { border-left-color: var(--warn); }
.topo-node.role-switch { border-left-color: var(--cobalt); }
.topo-node.role-ap { border-left-color: var(--ok); }
.topo-node.role-camera { border-left-color: var(--cyan); }
.topo-node.role-pc { border-left-color: #9eb6ff; }
.topo-node.on {
  border-color: var(--cyan);
  box-shadow: 0 0 0 1px var(--cyan), 0 0 22px rgba(142, 231, 255, 0.28), 0 12px 28px rgba(0, 0, 0, 0.32);
}
.topo-node strong {
  display: block;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 14px;
  font-weight: 730;
  letter-spacing: -0.02em;
  line-height: 1.2;
}
.topo-kicker {
  color: var(--faint);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.topo-meta {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 11px;
}
.topo-dot {
  position: absolute;
  top: 12px;
  right: 10px;
  width: 8px;
  height: 8px;
  border-radius: 99px;
  background: #7d8eae;
}
.topo-dot.ok { background: var(--ok); box-shadow: 0 0 8px rgba(61, 220, 151, 0.85); }
.topo-dot.crit { background: var(--crit); box-shadow: 0 0 8px rgba(255, 92, 122, 0.85); }
.topo-dot.warn { background: var(--warn); box-shadow: 0 0 8px rgba(240, 180, 41, 0.75); }
.topo-inspector {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(8, 12, 24, 0.55);
  padding: 14px 14px 12px;
}
.topo-inspector-name {
  margin: 0 0 8px;
  font-size: 18px;
  font-weight: 730;
  letter-spacing: -0.03em;
  line-height: 1.2;
}
.topo-facts { display: grid; gap: 8px; margin: 10px 0 12px; }
.topo-facts div { display: grid; gap: 1px; }
.topo-facts dt {
  color: var(--faint);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.topo-facts dd { margin: 0; font-family: var(--mono); font-size: 13px; word-break: break-word; }
.topo-empty {
  border: 1px dashed rgba(150, 180, 255, 0.35);
  border-radius: 14px;
  padding: 22px 18px;
  margin: 0 0 12px;
  background: rgba(8, 12, 24, 0.35);
}
.topo-empty strong { display: block; margin-bottom: 4px; }
.topo-empty p { margin: 0; }
.topo-list { margin-top: 12px; }
.topo-list summary {
  cursor: pointer;
  font-weight: 700;
  color: var(--text);
}
.topo-list summary .muted { font-weight: 600; margin-left: 6px; }
.topo-foot { margin: 12px 0 0; font-size: 13px; }
@media (max-width: 980px) {
  .topo-body { grid-template-columns: 1fr; }
  .topo-viewport { height: 440px; }
  .topo-customer-head { align-items: flex-start; flex-direction: column; }
}
.stale-card { border-color: rgba(240, 180, 41, 0.45); }
.stale-list { display: grid; gap: 6px; margin: 10px 0; }
.check-line small { display: block; color: var(--faint); font-weight: 500; }
.soft-actions { display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end; }
.work-note { margin: 0 0 12px; }

.overlay {
  position: fixed;
  inset: 0;
  background:
    radial-gradient(900px 420px at 50% 0%, rgba(47, 91, 255, 0.22), transparent 60%),
    rgba(2, 4, 10, 0.88);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 18px;
  z-index: 20;
}
.overlay.open { display: flex; }
.remote-panel {
  width: min(1100px, 100%);
  max-height: min(920px, 100%);
  overflow: auto;
  background: #070b14;
  border-radius: 18px;
  padding: 14px 14px 16px;
  border: 1px solid var(--line-strong);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.55);
}
.rdp {
  position: relative;
  width: min(1180px, 100%);
  background:
    linear-gradient(180deg, rgba(76, 125, 255, 0.16), transparent 90px),
    #070b14;
  border-color: rgba(142, 231, 255, 0.45);
  box-shadow:
    0 0 0 1px rgba(76, 125, 255, 0.25),
    0 30px 90px rgba(0, 0, 0, 0.62),
    0 0 40px rgba(47, 91, 255, 0.18);
}
.rdp-bar {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 4px 6px 12px;
}
.rdp-mark {
  width: 14px;
  height: 14px;
  flex: none;
  border: 2px solid var(--cyan);
  border-radius: 50%;
  box-shadow: 0 0 12px rgba(142, 231, 255, 0.8);
}
.rdp-id { min-width: 0; }
.rdp-id h2 { margin: 0; }
.rdp-meta {
  margin: 2px 0 0;
  color: var(--cyan);
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.04em;
}
.rdp-phase {
  margin: 0;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(76, 125, 255, 0.16);
  color: #d5e4ff;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.02em;
}
.rdp-phase[data-phase="live"] {
  background: rgba(61, 220, 151, 0.16);
  color: #d9ffe9;
  box-shadow: 0 0 16px rgba(61, 220, 151, 0.25);
}
.rdp-phase[data-phase="view"],
.rdp-phase[data-phase="stalled"] { background: rgba(240, 180, 41, 0.16); color: #ffe7ad; }
.rdp-phase[data-phase="waiting"] { background: rgba(76, 125, 255, 0.2); }
.rdp-phase[data-phase="off"] { background: rgba(255, 255, 255, 0.06); color: var(--muted); }
.rdp-actions { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; }
#rdp-cad { border-color: rgba(240, 180, 41, 0.75); color: #ffe7a8; font-weight: 750; }
.rdp-tools, .rdp-file-bar, .rdp-clip-actions, .rdp-confirm-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}
.rdp-tools { margin: 0 0 10px; }
.rdp-tools label, .rdp-file-bar label { color: var(--muted); font-size: 13px; font-weight: 650; }
.rdp-tools select, .rdp-file-bar select { margin-left: 6px; min-height: 34px; }
.rdp-keys { display: flex; flex-wrap: wrap; gap: 6px; }
.rdp-keys button, .rdp-file-list button, .rdp-transfers button { min-height: 32px; padding: 4px 8px; font-size: 12px; }
.rdp-caps { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 10px; }
.rdp-chip {
  border: 1px solid rgba(140, 170, 255, 0.28);
  border-radius: 999px;
  padding: 3px 8px;
  color: var(--faint);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.rdp-chip.on {
  color: #e8fff4;
  border-color: rgba(61, 220, 151, 0.55);
  background: rgba(61, 220, 151, 0.12);
}
.rdp-cad { flex-basis: 100%; margin: 2px 0 0; color: var(--faint); font-size: 12px; }
.rdp-clip { display: flex; flex-direction: column; gap: 8px; margin: 0 0 10px; }
.rdp-clip textarea { min-height: 64px; margin-top: 0; }
.rdp-files {
  margin: 0 0 10px;
  padding: 10px;
  border: 1px solid rgba(142, 231, 255, 0.28);
  border-radius: 12px;
  background: rgba(8, 14, 28, 0.72);
}
.rdp-path { margin: 8px 0 4px; font-family: var(--mono); color: var(--cyan); font-size: 12px; }
.rdp-file-list, .rdp-transfers { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 6px; }
.rdp-transfers li, .rdp-file-list li { display: flex; gap: 8px; align-items: center; justify-content: space-between; }
.rdp-upload input { margin-left: 8px; }
.rdp-note { margin-top: 10px; }
.rdp-limits { margin-top: 8px; color: var(--muted); }
.rdp-limits summary { cursor: pointer; color: var(--cyan); font-weight: 700; }
.view {
  position: relative;
  margin-top: 4px;
  min-height: 360px;
  border-radius: 12px;
  background:
    radial-gradient(500px 180px at 50% 0%, rgba(76, 125, 255, 0.16), transparent 70%),
    #05080f;
  border: 1px solid rgba(142, 231, 255, 0.35);
  display: grid;
  place-items: center;
  overflow: auto;
  outline: none;
  box-shadow: inset 0 0 40px rgba(47, 91, 255, 0.12);
}
.view::before, .view::after {
  content: "";
  position: absolute;
  width: 18px;
  height: 18px;
  pointer-events: none;
  border: 2px solid var(--cyan);
}
.view::before { top: 8px; left: 8px; border-right: 0; border-bottom: 0; }
.view::after { right: 8px; bottom: 8px; border-left: 0; border-top: 0; }
.view:focus-visible, .view.has-keys { outline: 2px solid var(--cyan); outline-offset: 2px; }
.view img { width: 100%; height: auto; display: block; cursor: crosshair; background: #000; }
.view.scale-100 { place-items: start; }
.view.scale-100 img { width: auto; max-width: none; }
.view.scale-75 img { width: 75%; }
.view.scale-50 img { width: 50%; }
.rdp-confirm {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background: rgba(2, 6, 14, 0.72);
  border-radius: 18px;
  z-index: 3;
}
.rdp-confirm-card {
  width: min(460px, calc(100% - 32px));
  padding: 18px;
  border-radius: 16px;
  border: 1px solid rgba(142, 231, 255, 0.45);
  background: #0c1426;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.45);
}
.rdp-confirm-card h3 { margin: 0 0 8px; }
.rdp-confirm-actions { margin-top: 12px; }
.rdp:fullscreen { width: 100%; max-height: none; height: 100%; border-radius: 0; }
.rdp:fullscreen .view { min-height: calc(100vh - 220px); }
.rdp:fullscreen .rdp-confirm { border-radius: 0; }
.empty-state {
  margin: 8px 0;
  padding: 32px 20px;
  text-align: center;
  border: 1px dashed rgba(150, 180, 255, 0.28);
  border-radius: 16px;
  background: rgba(8, 14, 28, 0.35);
}
.empty-state strong { display: block; font-size: 16px; letter-spacing: -0.02em; }
.empty-state strong::before {
  content: "";
  display: block;
  width: 36px;
  height: 36px;
  margin: 0 auto 12px;
  border-radius: 12px;
  background:
    radial-gradient(circle at 50% 45%, rgba(142, 231, 255, 0.55), transparent 42%),
    rgba(76, 125, 255, 0.16);
  box-shadow: inset 0 0 0 1px rgba(150, 180, 255, 0.28);
}
.empty-state p { margin: 6px auto 0; max-width: 46ch; color: var(--muted); }
.dash-table { margin-top: 14px; }
.cmd-jumps { display: flex; flex-wrap: wrap; gap: 8px; margin: 14px 0 4px; }
.cmd-jumps a {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 4px 12px;
  border-radius: 999px;
  border: 1px solid rgba(140, 170, 255, 0.35);
  background: rgba(20, 36, 78, 0.45);
  color: #d5e2ff;
  text-decoration: none;
  font-size: 13px;
  font-weight: 700;
}
.cmd-jumps a:hover { border-color: var(--line-strong); color: #fff; background: rgba(47, 91, 255, 0.28); }
.cmd-kpis {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin: 12px 0;
}
.cmd-kpis .count { min-height: 108px; }
.cmd-kpis .count strong { font-size: 32px; }
.cmd-board {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(200px, 0.8fr) minmax(220px, 0.95fr);
  gap: 12px;
  margin-bottom: 12px;
}
.cmd-panel h2 { margin-bottom: 12px; }
.cmd-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-bottom: 8px; }
.cmd-head h2 { margin: 0; }
.cmd-figure {
  margin: 0 0 8px;
  font-family: var(--mono);
  font-size: 40px;
  font-weight: 720;
  letter-spacing: -0.04em;
  line-height: 1;
  color: #fff;
}
.cmd-figure span { color: var(--muted); font-size: 22px; }
.mix {
  display: flex;
  height: 10px;
  border-radius: 99px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.06);
}
.mix span { display: block; height: 100%; min-width: 0; }
.mix-ok { background: var(--ok); }
.mix-warn { background: var(--warn); }
.mix-crit { background: var(--crit); box-shadow: 0 0 12px rgba(255, 92, 122, 0.45); }
.mix-legend { display: flex; flex-wrap: wrap; gap: 8px 14px; margin: 10px 0 6px; color: var(--muted); font-size: 13px; }
.cmd-security .count {
  background: transparent;
  border: 0;
  box-shadow: none;
  padding: 0;
  min-height: 0;
}
.tile-board {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 12px;
  margin: 12px 0 4px;
}
.tile-board > .tile { min-width: 0; display: flex; flex-direction: column; }
.tile-board > .tile > .count,
.tile-board > .tile > .card { flex: 1 1 auto; }
.tile-board .card,
.tile-board .dash-table,
.tile-board .meter-grid { margin: 0; }
.tile.span-kpi { grid-column: span 4; }
.tile.span-fleet { grid-column: span 5; }
.tile.span-cov { grid-column: span 3; }
.tile.span-sec { grid-column: span 4; }
.tile.span-main { grid-column: span 8; }
.tile.span-side { grid-column: span 4; }
.tile.span-half { grid-column: span 6; }
.tile.span-full { grid-column: span 12; }
.tile.editing {
  outline: 1px dashed rgba(76, 125, 255, 0.7);
  outline-offset: 4px;
  border-radius: 16px;
  cursor: grab;
}
.tile.dragging { opacity: 0.55; }
.tile-tools { display: flex; justify-content: flex-end; gap: 6px; margin: 0 0 8px; }
.tile-tools .ghost { min-height: 28px; padding: 2px 10px; font-size: 12px; }
.tile-catalog h2 { margin-bottom: 6px; }
.tile-catalog-list { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0; }
.tile-catalog-list .ghost { min-height: 32px; }
.device-panel .tile-board { margin-top: 0; }
.tile .fold { margin: 0; }
.cmd .attention-row, .split .attention-row { text-decoration: none; color: inherit; }
@media (min-width: 1280px) {
  .cmd-kpis { grid-template-columns: repeat(6, minmax(0, 1fr)); }
  .tile.span-kpi { grid-column: span 2; }
}
@media (max-width: 1100px) {
  .cmd-board { grid-template-columns: 1fr; }
  .tile.span-fleet,
  .tile.span-cov,
  .tile.span-sec,
  .tile.span-main,
  .tile.span-side { grid-column: span 12; }
}
@media (max-width: 640px) {
  .cmd-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cmd-kpis .count { min-height: 0; padding: 12px; }
  .cmd-kpis .count strong { font-size: 26px; }
  .tile.span-kpi { grid-column: span 6; }
  .cmd-figure { font-size: 34px; }
}
.rule-switch { display: inline-flex; align-items: center; gap: 8px; margin: 0; color: var(--text); font-weight: 650; }
table.roster select.assign-monitor, .device-pack select { width: 100%; max-width: 280px; margin-top: 0; }
.device-pack { margin-top: 14px; }
.card h2 { margin-bottom: 10px; }
.tag {
  color: #9eb6ff;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-size: 11px;
  font-weight: 700;
  margin: 0 0 4px;
}

body.role-tech .admin-only,
body.role-dispatcher .admin-only,
body.role-user .admin-only { display: none !important; }
body.role-manager .users-admin { display: none !important; }
body.role-tech button:not(#logout):not(.tab):not(#nav-toggle):not(.account-control):not(.flow-btn):not(.unifi-device):not(.open-site-manager):not(.pick):not(.staff-edit):not(.topo-tool):not(.staff-action):not(.toast-x),
body.role-dispatcher button:not(#logout):not(.tab):not(#nav-toggle):not(.account-control):not(.flow-btn):not(.unifi-device):not(.open-site-manager):not(.pick):not(.staff-edit):not(.topo-tool):not(.staff-action):not(.toast-x),
body.role-user button:not(#logout):not(.tab):not(#nav-toggle):not(.account-control):not(.toast-x) { display: none !important; }
body.role-tech textarea:not(.staff-edit),
body.role-dispatcher textarea:not(.staff-edit),
body.role-user textarea:not(.staff-edit),
body.role-tech select:not(#filter-customer):not(#filter-status):not(#filter-presence):not(#filter-os):not(#filter-alert):not(#filter-soft-customer):not(#filter-network):not(#filter-network-kind):not(#filter-network-status):not(#filter-repo-kind):not(#filter-security):not(#report-kind):not(#report-customer):not(.staff-edit),
body.role-dispatcher select:not(#filter-customer):not(#filter-status):not(#filter-presence):not(#filter-os):not(#filter-alert):not(#filter-soft-customer):not(#filter-network):not(#filter-network-kind):not(#filter-network-status):not(#filter-repo-kind):not(#filter-security):not(#report-kind):not(#report-customer):not(.staff-edit),
body.role-user select:not(#filter-customer):not(#filter-status):not(#filter-presence):not(#filter-os):not(#filter-alert):not(#filter-soft-customer):not(#filter-network):not(#filter-network-kind):not(#filter-network-status):not(#filter-repo-kind):not(#filter-security):not(#report-kind):not(#report-customer):not(.staff-edit),
body.role-tech input:not(#global-search):not(#customer-filter):not(#device-filter):not(#staff-filter):not(#soft-search):not(#device-soft-search):not(#ticket-filter):not(#activity-filter):not(#patch-filter):not(#script-filter):not(#auto-filter):not(#repo-filter):not(#policy-filter):not(#rule-filter):not(#connect-filter):not(#network-filter):not(#alert-filter):not(.account-field):not(.staff-edit),
body.role-dispatcher input:not(#global-search):not(#customer-filter):not(#device-filter):not(#staff-filter):not(#soft-search):not(#device-soft-search):not(#ticket-filter):not(#activity-filter):not(#patch-filter):not(#script-filter):not(#auto-filter):not(#repo-filter):not(#policy-filter):not(#rule-filter):not(#connect-filter):not(#network-filter):not(#alert-filter):not(.account-field):not(.staff-edit),
body.role-user input:not(#global-search):not(#customer-filter):not(#device-filter):not(#staff-filter):not(#soft-search):not(#device-soft-search):not(#ticket-filter):not(#activity-filter):not(#patch-filter):not(#script-filter):not(#auto-filter):not(#repo-filter):not(#policy-filter):not(#rule-filter):not(#connect-filter):not(#network-filter):not(#alert-filter):not(.account-field):not(.staff-edit) { pointer-events: none; }

/* Staff console shell */
.shell { display: grid; grid-template-columns: var(--sidebar) 1fr; min-height: 100vh; }
nav.side {
  border-right: 1px solid rgba(120, 160, 255, 0.22);
  background: #070b16;
  padding: 18px 14px 16px;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow: auto;
  display: flex;
  flex-direction: column;
}
.nav-head { display: flex; align-items: flex-start; gap: 8px; margin-bottom: 16px; }
.top-meta { max-width: 280px; }
#updated { max-width: 260px; overflow: hidden; text-overflow: ellipsis; font-size: 12px; }
.nav-head .brand { display: flex; flex: 1; justify-content: center; padding: 2px 10px 8px; }
body.console .logo { width: 118px; max-width: 118px; height: auto; }
.nav-actions { display: flex; align-items: center; gap: 8px; flex: none; }
.nav-toggle { display: none; }
#logout { min-height: 36px; padding: 6px 10px; font-size: 13px; }
.nav-links { display: flex; flex-direction: column; gap: 2px; }
.nav-group + .nav-group { margin-top: 14px; }
.nav-label {
  margin: 0 12px 6px;
  color: var(--faint);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
nav.side .nav-links a {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  text-decoration: none;
  padding: 8px 10px;
  border-radius: 10px;
  font-size: 14.5px;
  font-weight: 600;
  min-height: 38px;
}
.nav-ico { width: 18px; height: 18px; flex: none; }
.nav-count {
  margin-left: auto;
  min-width: 20px;
  height: 18px;
  padding: 0 6px;
  border-radius: 999px;
  background: rgba(255, 92, 122, 0.16);
  color: #ffd0d8;
  font-size: 11px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
nav.side .nav-links a.active, nav.side .nav-links a:hover {
  background: rgba(61, 107, 255, 0.16);
  color: #fff;
}
nav.side .nav-links a.active {
  background: linear-gradient(90deg, rgba(61, 107, 255, 0.42), rgba(61, 107, 255, 0.08));
  box-shadow: inset 3px 0 0 var(--cyan), 0 0 18px rgba(61, 107, 255, 0.22);
}
.nav-more { margin-top: 12px; border-top: 1px solid var(--line); padding-top: 8px; }
.nav-more summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 40px;
  padding: 8px 12px;
  border-radius: 10px;
  color: var(--muted);
  font-weight: 700;
}
.nav-more summary::-webkit-details-marker { display: none; }
.nav-more summary::after {
  content: "";
  width: 7px;
  height: 7px;
  border-right: 1.6px solid currentColor;
  border-bottom: 1.6px solid currentColor;
  transform: rotate(45deg) translateY(-2px);
  flex: none;
}
.nav-more[open] summary::after { transform: rotate(225deg) translateY(-1px); }
.nav-more summary:hover { background: rgba(61, 107, 255, 0.1); color: #fff; }
.nav-more a { padding-left: 22px; font-weight: 550; }

.workspace { min-width: 0; }
.topbar {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: center;
  padding: 14px 24px;
  position: sticky;
  top: 0;
  z-index: 3;
  border-bottom: 1px solid rgba(130, 166, 255, 0.24);
  background: rgba(5, 8, 16, 0.88);
  backdrop-filter: blur(14px);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.18);
}
.search { flex: 1; min-width: 0; }
.search-label {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.search input { margin-top: 0; background: #0c1424; }
.top-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
  flex: none;
  text-align: right;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
}
.clock, #updated, .status-user { white-space: nowrap; }
.clock { color: var(--text); font-family: var(--mono); font-size: 12px; letter-spacing: 0.01em; }
.status-user { display: flex; justify-content: flex-end; gap: 8px; }
#who { color: var(--text); }
.locale { color: var(--faint); }
main { padding: 22px 28px 48px; max-width: none; }
.page-head { margin-bottom: 4px; }
.split {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(280px, 0.8fr);
  gap: 14px;
  align-items: start;
}
.deploy-form, .deploy-card {
  box-shadow:
    inset 0 1px 0 rgba(190, 215, 255, 0.16),
    0 0 0 1px rgba(90, 140, 255, 0.28),
    0 12px 36px rgba(30, 70, 200, 0.18);
}
.deploy-form {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 18px 28px;
  flex-wrap: wrap;
  background:
    linear-gradient(180deg, rgba(36, 62, 130, 0.35), rgba(13, 21, 40, 0.2)),
    var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  padding: 16px;
  margin: 16px 0 14px;
}
.deploy-copy { flex: 1 1 260px; min-width: 0; }
.deploy-copy h2 { margin: 0 0 4px; font-size: 16px; }
.deploy-copy p { margin: 0; }
.deploy-fields { display: flex; flex-wrap: wrap; gap: 8px; flex: 2 1 360px; align-items: center; }
.deploy-fields input,
.deploy-fields select { margin: 0; width: auto; flex: 1 1 160px; min-width: 0; }
.deploy-fields button { flex: 0 0 auto; }
pre.cmd {
  margin: 0 0 10px;
  padding: 10px 12px;
  background: #070d18;
  border: 1px solid var(--line);
  border-radius: 10px;
  color: #d7e6ff;
  font-family: var(--mono);
  font-size: 12.5px;
  line-height: 1.45;
  overflow-x: auto;
  white-space: pre-wrap;
  word-break: break-word;
}
.cmd-label {
  margin: 10px 0 4px;
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--faint);
  font-weight: 700;
}
.empty { margin: 6px 0 0; color: var(--muted); }
.filters { margin: 4px 0 12px; }
.filters select { margin-top: 0; width: auto; min-width: 180px; flex: 0 1 240px; }
.attention-row {
  display: flex;
  gap: 8px;
  align-items: baseline;
  flex-wrap: wrap;
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
}
.attention-row:last-child { border-bottom: 0; }
body.console th, body.console td { padding: 10px 12px; font-size: 14px; }
body.console th { white-space: nowrap; }
body.console td .link { font-weight: 700; }
.deploy-link { margin-left: 8px; white-space: nowrap; font-weight: 650; }

/* Auth, portal, support */
body.auth {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: max(24px, env(safe-area-inset-top)) 18px max(24px, env(safe-area-inset-bottom));
}
.auth-card {
  width: min(440px, 100%);
  background: rgba(10, 16, 32, 0.94);
  border: 1px solid rgba(140, 176, 255, 0.35);
  border-radius: 22px;
  box-shadow: var(--shadow), 0 0 48px rgba(47, 91, 255, 0.22);
  padding: 32px 28px 24px;
}
.auth-card .brand { display: block; margin-bottom: 8px; }
.auth-card .logo { width: min(268px, 92%); margin: 0 auto; }
.auth-card h1, .auth-card .lead { text-align: center; }
.auth-card .lead { color: var(--muted); margin-bottom: 6px; }
.auth-card button[type="submit"], .auth-card .btn { width: 100%; margin-top: 18px; }
.auth-card .foot { text-align: center; margin-top: 8px; }
.auth-narrow { max-width: 460px; margin: 12px auto; }
.auth-narrow button[type="submit"] { width: 100%; margin-top: 14px; }

.site-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  max-width: 1040px;
  margin: 0 auto;
  padding: 20px 22px 8px;
}
.site-main .site-bar { max-width: none; margin: 0 0 8px; padding: 4px 0 12px; }
.site-bar .logo { width: 148px; }
.site-tag {
  color: var(--faint);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.site-main { max-width: 1040px; margin: 0 auto; padding: 12px 22px 48px; }
.auth-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; align-items: start; }
.auth-grid .card h2 { margin-bottom: 4px; }
.portal-head, .support-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}
.desk {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  align-items: start;
}
.chat {
  min-height: 220px;
  max-height: 360px;
  overflow: auto;
  display: grid;
  gap: 10px;
  align-content: start;
  margin: 8px 0 14px;
  padding: 12px;
  border-radius: 12px;
  background: #0a1220;
  border: 1px solid var(--line);
}
.bubble { border-radius: 12px; padding: 12px 14px; background: rgba(61, 107, 255, 0.08); }
.bubble.you { background: rgba(122, 215, 255, 0.08); }
.prompts { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 8px; }
.prompts button { margin: 0; }
.proposal { margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--line); }
ol { margin: 8px 0 0; padding-left: 18px; }

@media (min-width: 901px) {
  body.console main { padding-bottom: calc(var(--account-slot, 0px) + 28px); }
  body.console .nav-head { flex-direction: column; align-items: stretch; gap: 10px; }
  body.console .nav-head .brand { justify-content: center; padding: 0 4px; max-width: 100%; }
  body.console .logo { width: min(148px, 100%); max-width: 100%; height: auto; }
  body.console .nav-actions { width: 100%; justify-content: stretch; }
  body.console #logout { width: 100%; align-self: stretch; margin: 0; }
}

@media (max-width: 900px) {
  h1 { font-size: 24px; }
  .metrics, .stats { grid-template-columns: 1fr 1fr; }
  .week { grid-template-columns: 1fr 1fr; }
  .auth-grid, .desk, .split { grid-template-columns: 1fr; }
  .top-meta { flex-direction: column; align-items: flex-end; gap: 1px; }
  body.console { height: 100dvh; overflow: hidden; }
  body.console .shell {
    display: flex;
    flex-direction: column;
    height: calc(100% - var(--account-slot, 0px));
    max-height: calc(100% - var(--account-slot, 0px));
    min-height: 0;
    overflow: hidden;
  }
  body.console nav.side {
    position: relative;
    top: auto;
    flex: 0 0 auto;
    height: auto;
    min-height: max-content;
    overflow: visible;
    padding: 0;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }
  body.console .nav-head {
    flex: 0 0 auto;
    padding: calc(10px + env(safe-area-inset-top, 0px)) max(12px, env(safe-area-inset-right, 0px)) 10px max(12px, env(safe-area-inset-left, 0px));
    margin: 0;
    align-items: center;
    overflow: visible;
  }
  body.console .nav-head .brand { justify-content: flex-start; padding: 0; min-width: 0; }
  body.console .logo {
    width: 56px;
    max-width: 56px;
    height: 56px;
    object-fit: contain;
  }
  body.console .nav-toggle, body.console #logout {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 40px;
    padding: 8px 12px;
    background: var(--surface);
    color: #d5e1ff;
    border: 1px solid rgba(140, 166, 240, 0.45);
    border-radius: 10px;
    font-size: 14px;
    font-weight: 700;
  }
  body.console .nav-links { display: none; }
  body.console nav.side.menu-open {
    flex: 0 0 auto;
    max-height: calc(100% - 120px);
    overflow: hidden;
  }
  body.console nav.side.menu-open .nav-head { flex: 0 0 auto; }
  body.console nav.side.menu-open .nav-links { max-height: min(52dvh, 420px); }
  body.console nav.side.menu-open .nav-links {
    display: flex;
    flex: 1 1 auto;
    min-height: 0;
    max-height: min(68dvh, 520px);
    margin: 0;
    padding: 4px 10px 12px;
    overflow: auto;
    overscroll-behavior: contain;
  }
  body.console nav.side .nav-links a { min-height: 44px; }
  body.console .workspace { flex: 1 1 auto; min-height: 0; overflow: auto; }
  body.console .topbar {
    position: static;
    flex-wrap: wrap;
    gap: 8px;
    padding: 10px max(12px, env(safe-area-inset-right, 0px)) 10px max(12px, env(safe-area-inset-left, 0px));
  }
  body.console .search { flex: 1 1 100%; }
  body.console .top-meta {
    max-width: 100%;
    width: 100%;
    font-size: 12px;
    align-items: flex-end;
  }
  body.console #updated { display: none; }
  body.console .clock, body.console #updated, body.console .status-user, body.console #who, body.console .locale {
    white-space: normal;
    font-size: 12px;
  }
  body.console main { padding: 16px 14px calc(var(--account-slot, 76px) + 56px); }
  .remote-panel { max-height: 100%; }
  .site-main, .site-bar { padding-left: 16px; padding-right: 16px; }
}

@media (max-width: 640px) {
  .status-user .locale { display: none; }
  .page-actions { width: 100%; }
  .page-actions .btn, .page-actions a.btn { flex: 1 1 auto; }
}

.flow-back {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: flex;
  justify-content: flex-end;
  background: rgba(4, 6, 13, 0.62);
}
.flow-back[hidden] { display: none !important; }
.flow-panel {
  width: min(440px, 100%);
  height: 100%;
  overflow: auto;
  background: #0c1426;
  color: var(--text);
  border-left: 1px solid rgba(140, 176, 255, 0.35);
  box-shadow: -18px 0 48px rgba(0, 0, 0, 0.45);
  padding: 22px 22px 32px;
}
.flow-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.flow-head-actions { display: flex; align-items: center; gap: 12px; flex: none; }
.flow-head h2 { margin: 0; font-size: 24px; letter-spacing: -0.03em; }
.flow-steps { display: flex; gap: 8px; margin: 16px 0; padding: 0; list-style: none; }
.flow-steps li {
  flex: 1;
  height: 4px;
  border-radius: 99px;
  background: rgba(150, 180, 255, 0.18);
}
.flow-steps li.on { background: var(--cobalt); }
.flow-steps li.done { background: rgba(142, 231, 255, 0.7); }
.flow-panel label { display: block; margin: 14px 0 0; color: var(--muted); font-size: 13px; }
.flow-panel input, .flow-panel select, .flow-panel textarea { width: 100%; margin-top: 6px; }
.flow-panel textarea { min-height: 96px; }
.flow-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 22px; }
.flow-choices { display: grid; gap: 10px; margin-top: 14px; }
.flow-choice {
  text-align: left;
  width: 100%;
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 14px;
}
.flow-choice.on, .flow-choice:hover { border-color: var(--line-strong); background: rgba(47, 91, 255, 0.16); }
.flow-choice strong { display: block; }
.flow-choice span { color: var(--muted); font-size: 14px; }
.flow-note { min-height: 1.2em; color: var(--crit); }
.flow-success h3 { margin: 8px 0; font-size: 22px; letter-spacing: -0.03em; text-transform: none; color: var(--text); }
.flow-device-name {
  margin: 4px 0 12px;
  font-size: 22px;
  font-weight: 760;
  letter-spacing: -0.03em;
  color: var(--text);
}
.token { font-family: var(--mono); letter-spacing: 0.04em; }
.list-toolbar { display: flex; align-items: center; flex-wrap: wrap; gap: 10px 14px; margin-top: 16px; }
.list-toolbar input, .list-toolbar select { flex: 1 1 180px; width: auto; max-width: 460px; min-width: 0; margin-top: 0; }
.list-toolbar select { flex-basis: 180px; max-width: 240px; }
.list-count { color: var(--muted); font-size: 13px; white-space: nowrap; }
@media (min-width: 720px) {
  .list-count { margin-left: auto; }
}
@media (max-width: 640px) {
  .list-toolbar input, .list-toolbar select { flex-basis: 100%; max-width: none; width: 100%; }
}
table.roster th, table.roster td { padding: 16px 18px; }
table.roster td { vertical-align: middle; }
table.roster .cust-name { display: block; font-size: 16px; font-weight: 650; letter-spacing: -0.02em; }
table.roster .cust-meta, table.roster .cust-person { display: block; }
table.roster .cust-person { color: var(--text); }
table.roster .cust-meta { color: var(--muted); font-size: 13px; margin-top: 3px; }
table.roster .cust-tags {
  display: inline-flex;
  margin-top: 6px;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(61, 107, 255, 0.14);
  color: #c9d6ff;
  font-size: 12px;
}
table.roster .cust-actions { white-space: nowrap; text-align: right; }
table.roster .cust-actions .ghost, table.roster .cust-actions .btn { margin-left: 6px; }
table.roster .cust-actions .ghost:first-child, table.roster .cust-actions .btn:first-child { margin-left: 0; }
table.roster tbody tr:hover td { background: rgba(61, 107, 255, 0.08); }
table.roster .pill { margin-top: 2px; }
body.role-tech #flow-drawer input,
body.role-tech #flow-drawer select,
body.role-tech #flow-drawer textarea { pointer-events: auto; }
@media (max-width: 640px) {
  .flow-panel { width: 100%; padding: 18px 16px 28px; }
}
.flow-panel input[type="checkbox"] { width: 18px; height: 18px; margin: 0; }
.flow-check {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-top: 12px;
  color: var(--text);
  font-size: 15px;
  font-weight: 600;
}
.flow-check span { color: var(--text); }
.flow-inline {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 8px 0 0 28px;
  color: var(--muted);
  font-weight: 550;
}
.flow-panel .flow-inline input { width: 88px; margin-top: 0; }
.device-panel { margin-top: 4px; }
.panel-kicker {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px 18px;
  flex-wrap: wrap;
  margin: 2px 0 12px;
}
.panel-kicker h2, .device-packs h2 { margin: 0; }
.panel-kicker p { margin: 0; }
.meter-grid, .spec-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin: 0 0 14px;
}
.spec-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.meter, .spec {
  background: linear-gradient(180deg, rgba(28, 44, 84, 0.72), var(--surface));
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 14px 16px 16px;
  border-top: 2px solid rgba(158, 190, 255, 0.7);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.18);
  min-width: 0;
}
.meter span, .spec span {
  display: block;
  color: var(--faint);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-weight: 700;
}
.meter strong, .spec strong {
  display: block;
  margin-top: 8px;
  font-family: var(--mono);
  font-size: 22px;
  font-weight: 720;
  letter-spacing: -0.03em;
  line-height: 1.2;
  overflow-wrap: anywhere;
}
.meter.ok { border-top-color: var(--ok); }
.meter.warn { border-top-color: var(--warn); }
.meter.crit { border-top-color: var(--crit); }
.meter-track {
  margin-top: 12px;
  height: 6px;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.06);
  overflow: hidden;
}
.meter-track i {
  display: block;
  height: 100%;
  border-radius: 99px;
  background: var(--cobalt);
}
.meter.ok .meter-track i { background: var(--ok); }
.meter.warn .meter-track i { background: var(--warn); }
.meter.crit .meter-track i { background: var(--crit); }
.spec-hero {
  margin-bottom: 12px;
  background: linear-gradient(180deg, rgba(36, 58, 112, 0.55), var(--surface));
  border-top: 2px solid var(--cobalt);
}
.spec-hero h2 { margin: 0; font-size: 26px; letter-spacing: -0.04em; }
.spec em {
  display: block;
  margin-top: 6px;
  color: var(--faint);
  font-style: normal;
  font-size: 12px;
  letter-spacing: 0.04em;
}
.spec-version { font-family: var(--mono); color: var(--muted); }
.device-split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  align-items: start;
}
.flag-list { list-style: none; margin: 0; padding: 0; }
.flag-list > li {
  display: grid;
  grid-template-columns: minmax(108px, 150px) minmax(0, 1fr);
  gap: 8px 16px;
  align-items: center;
  padding: 11px 0;
  border-bottom: 1px solid var(--line);
}
.flag-list > li:last-child { border-bottom: 0; padding-bottom: 0; }
.flag-list > li > span {
  color: var(--faint);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-weight: 700;
}
.flag-list > li > div { min-width: 0; line-height: 1.35; }
.flag-list.org-facts > li > div { white-space: nowrap; }
.pack-chips { display: flex; flex-wrap: wrap; gap: 8px; list-style: none; margin: 0; padding: 0; }
.pack-chips li {
  display: inline-flex;
  grid-template-columns: none;
  border: 0;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(61, 107, 255, 0.16);
  color: #dce6ff;
  font-size: 13px;
  font-weight: 650;
}
.alert-summary {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 13px;
  letter-spacing: 0.02em;
}
.alert-card button:disabled { opacity: 0.55; cursor: not-allowed; }
.job-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.activity-list { list-style: none; margin: 0; padding: 0; }
.activity-list li {
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}
.device-packs { margin-top: 14px; }
.emsisoft-card { margin-top: 14px; border-top: 2px solid var(--cobalt); }
.emsisoft-card h3 { margin: 16px 0 8px; font-size: 14px; }
.vuln-overview { margin-bottom: 12px; }
.vuln-overview .cmd-figure { font-size: 28px; }
.confirm-card { margin-bottom: 12px; border-top: 2px solid var(--crit); }
.toasts {
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 80;
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: min(360px, calc(100vw - 32px));
  pointer-events: none;
}
.toast {
  pointer-events: auto;
  position: relative;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
  overflow: hidden;
  padding: 12px 10px 14px 16px;
  border-radius: 12px;
  border: 1px solid rgba(140, 170, 255, 0.35);
  background: #121a2e;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.35);
}
.toast p { margin: 0; flex: 1; }
.toast-x {
  flex: none;
  width: 28px;
  height: 28px;
  margin: -4px 0 0;
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #d5e2ff;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
}
.toast-x:hover { background: rgba(76, 125, 255, 0.22); color: #fff; }
.toast-meter {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  background: rgba(255, 255, 255, 0.08);
  pointer-events: none;
}
.toast-meter i {
  display: block;
  width: 100%;
  height: 100%;
  background: var(--cobalt);
  transform-origin: bottom center;
  animation: toast-drain linear forwards;
}
.toast.err .toast-meter i { background: var(--crit); }
.toast.ok .toast-meter i { background: var(--ok); }
@keyframes toast-drain {
  from { transform: scaleY(1); }
  to { transform: scaleY(0); }
}
.section-picks { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 12px; }
.section-picks button, .section-picks a {
  border: 1px solid rgba(140, 170, 255, 0.35);
  background: rgba(20, 36, 78, 0.45);
  color: #d5e2ff;
  border-radius: 999px;
  min-height: 34px;
  padding: 4px 12px;
  font-weight: 700;
}
.section-picks button.on { background: rgba(47, 91, 255, 0.35); color: #fff; }
button.count {
  text-align: left;
  width: 100%;
  cursor: pointer;
  font: inherit;
  color: inherit;
}
button.count.on { outline: 2px solid var(--cobalt); outline-offset: 2px; }
.ticket-kpis { margin-bottom: 12px; }
.ticket-fields {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}
.tool-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.tool-card h2 { font-size: 16px; }
.tool-card p { min-height: 3.2em; }
.tool-results li { display: grid; gap: 4px; }
@media (max-width: 800px) {
  .ticket-fields, .tool-grid { grid-template-columns: 1fr; }
}
.check-line {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 6px 0;
  color: var(--text);
  font-weight: 600;
}
.check-line input { width: auto; margin: 0; }
@media (max-width: 980px) {
  .meter-grid, .device-split { grid-template-columns: 1fr 1fr; }
  .spec-grid { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .meter-grid, .spec-grid, .device-split { grid-template-columns: 1fr; }
  .flag-list > li { grid-template-columns: 1fr; gap: 4px; }
}

.mono { font-family: var(--mono); letter-spacing: -0.02em; }
.faint { color: var(--faint); }
.fleet-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin: 16px 0 4px;
}
.fleet-chip {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  text-align: left;
  color: var(--muted);
  background:
    linear-gradient(180deg, rgba(28, 44, 84, 0.55), rgba(8, 12, 24, 0.2)),
    var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  box-shadow: inset 0 1px 0 rgba(180, 205, 255, 0.08);
  cursor: pointer;
}
.fleet-chip span {
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-weight: 700;
}
.fleet-chip strong {
  font-family: var(--mono);
  font-size: 22px;
  letter-spacing: -0.04em;
  color: var(--text);
}
.fleet-chip.on {
  border-color: rgba(142, 231, 255, 0.55);
  color: var(--cyan);
  box-shadow: inset 0 0 0 1px rgba(142, 231, 255, 0.18), 0 0 24px rgba(76, 125, 255, 0.18);
}
.fleet-chip.on strong { color: #fff; }
table.roster.devices th, table.roster.devices td { padding: 12px 14px; vertical-align: top; }
table.roster.devices .device-signal {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
}
table.roster.devices .signal-line {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}
table.roster.devices .device-signal .pill { margin: 0; }
table.roster.devices .mini-meters { margin: 0; }
table.roster.devices tbody td:first-child { box-shadow: inset 3px 0 0 transparent; }
/* Staff Devices list. One grid for the header and every row so name, customer,
   status, health, check-in, and actions share left edges. The status cell stays
   a grid item; display:flex on it was pulling the pills toward the meters. */
@media (min-width: 901px) {
  table.device-fleet {
    display: block;
    width: 100%;
    min-width: 1020px;
  }
  table.device-fleet thead,
  table.device-fleet tbody { display: block; }
  table.device-fleet thead tr,
  table.device-fleet tbody tr {
    display: grid;
    grid-template-columns:
      minmax(160px, 1.25fr)
      minmax(140px, 0.9fr)
      minmax(320px, 1.2fr)
      minmax(230px, 1fr)
      108px
      148px;
    align-items: stretch;
  }
  table.device-fleet tbody tr:has(td[colspan]) { display: block; }
  table.device-fleet th,
  table.device-fleet td {
    display: block;
    width: auto;
    min-width: 0;
  }
  table.device-fleet td.device-signal { text-align: left; }
  table.device-fleet .signal-line {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-start;
    align-items: center;
    align-content: flex-start;
    gap: 6px;
    width: auto;
    max-width: 100%;
  }
  table.device-fleet .signal-line .pill { white-space: nowrap; }
  table.device-fleet td:nth-child(2) .cust-person {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    overflow-wrap: normal;
  }
  table.device-fleet td:nth-child(5),
  table.device-fleet td.cust-actions { white-space: nowrap; }
  table.device-fleet .mini-meters { flex-wrap: nowrap; }
}
table.roster.devices tbody td:first-child { box-shadow: inset 3px 0 0 transparent; }
table.roster.devices tr[data-tone="ok"] td:first-child { box-shadow: inset 3px 0 0 var(--ok); }
table.roster.devices tr[data-tone="warning"] td:first-child { box-shadow: inset 3px 0 0 var(--warn); }
table.roster.devices tr[data-tone="critical"] td:first-child { box-shadow: inset 3px 0 0 var(--crit); }
.device-signal .pill, .backup-line .pill { margin: 0 4px 6px 0; }
.security-actions { display: inline-flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.security-row { align-items: center; }
.mini-meters {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin: 6px 0;
}
.mini-meter {
  position: relative;
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
  align-self: flex-start;
  width: max-content;
  min-width: 72px;
  max-width: none;
  min-height: 18px;
  height: auto;
  padding: 2px 10px;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.06);
  box-sizing: border-box;
  overflow: hidden;
  white-space: nowrap;
}
.mini-meter i {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  height: auto;
  max-width: 100%;
  background: var(--cobalt);
  opacity: 0.85;
  pointer-events: none;
}
.mini-meter.ok i { background: var(--ok); }
.mini-meter.warn i { background: var(--warn); }
.mini-meter.crit i { background: var(--crit); }
.mini-meter em {
  position: relative;
  z-index: 1;
  display: block;
  margin: 0;
  padding: 0;
  font-style: normal;
  font-size: 10px;
  line-height: 14px;
  letter-spacing: 0.04em;
  font-weight: 700;
  color: #fff;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.65);
  white-space: nowrap;
}
.device-net .mono { display: block; color: var(--cyan); font-size: 13px; }
.device-hero {
  padding-bottom: 8px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 8px;
}
.device-hero h1 {
  font-size: 30px;
  text-shadow: 0 0 28px rgba(142, 231, 255, 0.16);
}
.device-panel { display: grid; gap: 12px; }
.device-panel > .card,
.device-panel > .device-mosaic,
.device-panel > .meter-grid { margin: 0; }
.fold {
  margin: 12px 0;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: rgba(13, 21, 40, 0.72);
  padding: 0 14px;
}
.fold > summary {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 12px 0;
  cursor: pointer;
  font-weight: 720;
  list-style: none;
}
.fold > summary::-webkit-details-marker { display: none; }
.fold > summary em {
  color: var(--muted);
  font-style: normal;
  font-weight: 620;
  font-size: 13px;
}
.fold[open] { padding-bottom: 12px; }
.fold .card { margin-top: 0; }
.row-more { display: inline-block; margin-left: 8px; vertical-align: middle; }
.row-more > summary {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid var(--line);
  color: var(--text);
  cursor: pointer;
  list-style: none;
  font-size: 13px;
  font-weight: 700;
}
.row-more > summary::-webkit-details-marker { display: none; }
.row-more-menu {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}
.device-hero-meta { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; margin: 0; }
.device-hero-meta .mono { color: var(--cyan); }
.device-facts { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0 0; }
.device-facts span {
  border: 1px solid var(--line);
  background: rgba(12, 20, 40, 0.72);
  border-radius: 999px;
  padding: 3px 10px;
  color: var(--muted);
  font-size: 12px;
  letter-spacing: 0.02em;
}
.device-mosaic, .device-tools {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  align-items: start;
  margin-bottom: 12px;
}
.device-model {
  margin: 0 0 8px;
  font-size: 22px;
  font-weight: 720;
  letter-spacing: -0.03em;
}
.net-card { border-top: 2px solid var(--cyan); margin-bottom: 12px; }
.net-card .flag-list { margin-bottom: 12px; }
table.adapters { width: 100%; border-collapse: collapse; }
table.adapters th, table.adapters td {
  padding: 8px 10px;
  text-align: left;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
  font-size: 13px;
}
table.adapters th {
  color: var(--faint);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
table.adapters .cust-name, table.adapters .cust-meta { display: block; }
table.adapters .cust-meta { color: var(--muted); font-size: 12px; margin-top: 2px; }
.net-rate { font-family: var(--mono); color: var(--cyan); line-height: 1.35; }
.net-live { margin: 10px 0 0; color: var(--faint); font-size: 12px; }
.soft-preview { list-style: none; margin: 0 0 10px; padding: 0; }
.soft-preview li {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 7px 0;
  border-bottom: 1px solid var(--line);
}
.soft-preview span { color: var(--muted); font-family: var(--mono); font-size: 12px; }
.signal-card { margin-bottom: 12px; border-top: 2px solid var(--warn); }
.device-tools .card { margin-top: 0; }
.device-tools { margin-top: 14px; }
@media (max-width: 980px) {
  .fleet-strip, .device-mosaic, .device-tools { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 720px) {
  .fleet-strip, .device-mosaic, .device-tools { grid-template-columns: 1fr; }
  .tile.span-half { grid-column: span 12; }
  .device-hero h1 { font-size: 28px; }
}

/* Console rhythm: more air between groups, softer toolbars, clearer panes. */
body.console main { padding: 28px 32px 72px; }
body.console .page-head { margin-bottom: 18px; align-items: flex-start; }
body.console .page-head .sub { max-width: 68ch; }
body.console .card { padding: 20px 20px 18px; margin-bottom: 16px; }
body.console .cmd-kpis { gap: 14px; margin-bottom: 18px; }
body.console .list-toolbar {
  margin: 14px 0 12px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(8, 14, 28, 0.42);
}
body.console .table-scroll {
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(8, 12, 24, 0.28);
}
body.console .table-scroll table.grid { margin-top: 0; }
body.console nav.side { padding: 18px 14px 12px; }
body.console .nav-group + .nav-group { margin-top: 12px; }
body.console .section-picks { gap: 8px; margin: 4px 0 14px; }
body.console .attention-row { padding: 10px 0; }
.pane-switch {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 16px;
}
.pane-switch .pane-tab { min-height: 40px; }
.pane-switch .pane-tab.on {
  background: rgba(61, 107, 255, 0.28);
  color: #fff;
  border-color: rgba(150, 186, 255, 0.7);
  box-shadow: inset 0 0 0 1px rgba(142, 231, 255, 0.18);
}
.ticket-compose label { display: block; margin-top: 12px; color: var(--muted); font-size: 13px; }
.ticket-compose input,
.ticket-compose select,
.ticket-compose textarea { width: 100%; margin-top: 6px; }
.ticket-compose textarea { min-height: 120px; }
.alert-card .row + p,
.alert-card p + .row { margin-top: 8px; }
.alert-card .row:last-child { margin-top: 12px; }

/* Keep logos, badges, and labels inside their boxes. */
body.console .nav-head .brand { min-width: 0; max-width: 100%; }
body.console .topbar { flex-wrap: wrap; align-items: center; }
body.console .top-meta { max-width: min(340px, 100%); min-width: 0; }
body.console #who,
body.console .locale,
body.console #updated {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
}
.page-head > div { min-width: 0; flex: 1 1 260px; }
.page-head h1, .page-head .sub, .cust-name, .cust-person, .cust-meta, .attention-row span {
  overflow-wrap: anywhere;
  min-width: 0;
}
.page-actions { min-width: 0; }
.page-actions-end { margin-left: auto; justify-content: flex-end; }
.page-actions .btn, .page-actions a.btn { max-width: 100%; }
.pill { max-width: 100%; white-space: normal; line-height: 1.25; text-align: center; }
.device-signal { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; }
.mini-meter { max-width: 100%; }
.mini-meter em { max-width: 140px; overflow: hidden; text-overflow: ellipsis; }
.count, .fleet-chip, .cmd-panel, .card, .org-lockup { min-width: 0; }
.org-lockup h1, .count strong, .count em, .fleet-chip span { overflow-wrap: anywhere; }
.org-mark, .account-avatar, .logo { object-fit: contain; }
.watch-card { margin: 4px 0 16px; }
.watch-row span { min-width: 0; }
nav.side .nav-links { padding-bottom: 12px; }
nav.side .nav-links a { min-width: 0; }
nav.side .nav-links a span.nav-count { flex: none; }

/* Phone and tablet only. Every override below is inside a max-width query
   so the sidebar, cards, and button chrome from 901px up stay as they are.
   .nav-current is a label mobile.js inserts; it is hidden on the desktop sidebar. */
@media (min-width: 901px) {
  body.console .nav-current { display: none; }
}
@media (max-width: 900px) {
  body.console nav.side { padding: 0; z-index: 12; }
  body.console .nav-head { position: relative; z-index: 2; gap: 10px; }
  body.console .nav-head .brand {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 10px;
    min-width: 0;
  }
  body.console .logo {
    width: 44px;
    max-width: 44px;
    height: 44px;
  }
  body.console .nav-current {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: #fff;
    font-size: 16px;
    font-weight: 750;
    letter-spacing: -0.03em;
    line-height: 1.2;
  }
  body.console .nav-actions { gap: 6px; }
  body.console .nav-toggle,
  body.console #logout {
    gap: 8px;
    min-height: 44px;
    padding: 8px 12px;
    white-space: nowrap;
  }
  body.console .nav-toggle::before {
    content: "";
    width: 16px;
    height: 2px;
    border-radius: 1px;
    background: currentColor;
    box-shadow: 0 -5px 0 currentColor, 0 5px 0 currentColor;
    flex: none;
  }
  body.console .nav-toggle[aria-expanded="true"]::before {
    width: 14px;
    height: 14px;
    background:
      linear-gradient(currentColor, currentColor) center/14px 2px no-repeat,
      linear-gradient(currentColor, currentColor) center/2px 14px no-repeat;
    box-shadow: none;
    transform: rotate(45deg);
  }
  body.console nav.side.menu-open { overflow: visible; max-height: none; }
  body.console nav.side.menu-open::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: 1;
    background: rgba(2, 6, 14, 0.62);
  }
  body.console nav.side.menu-open .nav-links {
    position: fixed;
    z-index: 2;
    left: 0;
    right: 0;
    top: var(--mobile-nav-top, 68px);
    bottom: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
    max-height: none;
    margin: 0;
    padding: 8px 12px calc(20px + env(safe-area-inset-bottom));
    overflow: auto;
    overscroll-behavior: contain;
    background: #070b16;
    border-top: 1px solid rgba(120, 160, 255, 0.22);
    box-shadow: 0 24px 48px rgba(0, 0, 0, 0.45);
  }
  body.console nav.side.menu-open ~ .workspace { overflow: hidden; }
  body.console nav.side .nav-links a {
    min-height: 48px;
    padding: 10px 12px;
    font-size: 16px;
  }
  body.console .nav-more summary { min-height: 48px; font-size: 16px; }
  body.console .topbar {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 8px 12px;
    padding: 10px 14px;
  }
  body.console .search { grid-column: 1 / -1; }
  body.console .search input { min-height: 44px; }
  body.console a.top-link { min-height: 40px; justify-self: start; }
  body.console .top-meta {
    width: auto;
    max-width: none;
    margin-left: auto;
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: flex-end;
    align-items: center;
    gap: 2px 8px;
  }
  body.console #who {
    display: inline-block;
    max-width: min(220px, 54vw);
    vertical-align: bottom;
  }
  body.portal.console .top-meta {
    grid-column: 1 / -1;
    width: 100%;
    margin-left: 0;
  }
  body.portal.console #who { max-width: min(100%, 70vw); }
  body.console main { padding: 16px 14px 32px; }
  body.console .page-head { align-items: stretch; gap: 12px; }
  body.console .page-head > * { flex: 1 1 100%; }
  body.console .page-actions { justify-content: flex-start; }
  body.console .cmd-jumps a,
  body.console .section-picks button,
  body.console .section-picks a,
  body.console .pane-switch .pane-tab {
    min-height: 44px;
    padding: 8px 14px;
    font-size: 14px;
  }
  body.console .table-scroll {
    position: relative;
    overflow: visible;
    border: 0;
    border-radius: 0;
    background: transparent;
  }
  body.console .table-scroll table.grid {
    display: block;
    width: 100%;
    background: transparent;
    border: 0;
    box-shadow: none;
  }
  body.console .table-scroll table.grid thead {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
  }
  body.console .table-scroll table.grid thead:has(.th-sort) {
    position: static;
    display: block;
    width: auto;
    height: auto;
    margin: 0 0 10px;
    overflow: visible;
    clip: auto;
    white-space: normal;
  }
  body.console .table-scroll table.grid thead:has(.th-sort) tr {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    overflow: visible;
    box-shadow: none;
  }
  body.console .table-scroll table.grid thead:has(.th-sort) th {
    display: inline-flex;
    width: fit-content;
    flex: 0 0 auto;
    max-width: 100%;
    padding: 0;
    border: 0;
    background: transparent;
  }
  body.console .table-scroll table.grid thead:has(.th-sort) th:empty,
  body.console .table-scroll table.grid thead:has(.th-sort) th:not(:has(button)) { display: none; }
  body.console .table-scroll table.grid thead:has(.th-sort) button.th-sort {
    min-height: 44px;
    padding: 8px 12px;
    border-radius: 999px;
    border: 1px solid rgba(140, 170, 255, 0.45) !important;
    background: rgba(20, 36, 78, 0.72) !important;
    box-shadow: none !important;
    color: #d5e2ff !important;
    font-size: 13px;
    font-weight: 700;
  }
  body.console .table-scroll table.grid thead:has(.th-sort) button.th-sort.on {
    background: rgba(61, 107, 255, 0.4) !important;
    color: #fff !important;
  }
  body.console .table-scroll table.grid tbody { display: block; }
  body.console .table-scroll table.grid tr {
    display: block;
    margin: 0 0 10px;
    padding: 6px 0 8px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: rgba(13, 21, 40, 0.9);
    overflow: hidden;
  }
  body.console .table-scroll table.grid tr:hover td { background: transparent; }
  body.console .table-scroll table.grid td {
    display: block;
    width: auto;
    padding: 6px 14px;
    border: 0;
    overflow-wrap: break-word;
  }
  body.console .table-scroll table.grid td[data-label]::before {
    content: attr(data-label);
    display: block;
    margin-bottom: 2px;
    color: var(--faint);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
  }
  body.console .table-scroll table.grid td .cust-name { font-size: 17px; }
  body.console .table-scroll table.grid .cust-actions,
  body.console table.roster .cust-actions {
    white-space: normal;
    text-align: left;
  }
  body.console .table-scroll table.grid td:not([data-label]) .ghost,
  body.console .table-scroll table.grid td:not([data-label]) .btn,
  body.console .table-scroll table.grid td:not([data-label]) button {
    width: 100%;
    margin: 4px 0 0;
  }
  body.console table.roster.devices tbody td:first-child { box-shadow: none; }
  body.console table.roster.devices tr[data-tone="ok"] { border-color: rgba(61, 220, 151, 0.45); }
  body.console table.roster.devices tr[data-tone="warning"] { border-color: rgba(240, 180, 41, 0.55); }
  body.console table.roster.devices tr[data-tone="critical"] { border-color: rgba(255, 92, 122, 0.6); }
  .flag-list.org-facts > li > div { white-space: normal; overflow-wrap: anywhere; }
}
@media (max-width: 720px) {
  .fleet-strip { grid-template-columns: 1fr 1fr; }
  .fleet-chip { min-height: 52px; }
  .overlay { padding: 0; align-items: stretch; }
  .overlay .remote-panel {
    width: 100%;
    max-width: none;
    height: 100%;
    max-height: none;
    border-radius: 0;
  }
  .rdp > .rdp-bar {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 8px 10px;
  }
  .rdp > .rdp-bar .rdp-actions {
    grid-column: 1 / -1;
    margin: 0;
    display: grid;
    grid-template-columns: 1fr 1fr;
    width: 100%;
  }
  .rdp > .rdp-bar .rdp-actions .end { grid-column: 1 / -1; }
  .rdp-id h2, .rdp-meta { overflow-wrap: anywhere; }
  .rdp-tools { display: grid; grid-template-columns: 1fr 1fr; align-items: end; }
  .rdp-tools label { display: flex; flex-direction: column; align-items: stretch; gap: 4px; }
  .rdp-tools select { width: 100%; margin-left: 0; min-height: 44px; }
  .rdp-keys { grid-column: 1 / -1; }
  .rdp-keys button { min-height: 44px; padding: 8px 12px; font-size: 14px; }
  .view { min-height: 220px; }
  .unifi-panel .rdp-bar { flex-wrap: wrap; }
  .unifi-panel .end { min-height: 44px; }
  .site-bar { padding-left: 14px; padding-right: 14px; }
  .site-bar .logo { width: 120px; }
}
@media (max-width: 640px) {
  body.console .page-head { align-items: stretch; gap: 12px; }
  body.console .page-actions { flex-direction: column; align-items: stretch; }
  body.console .page-actions .btn,
  body.console .page-actions a.btn,
  body.console .page-actions button { width: 100%; }
  .filters { display: flex; flex-wrap: wrap; gap: 8px; }
  .filters select { flex: 1 1 100%; width: 100%; min-width: 0; }
  body.auth .auth-card { padding: 22px 16px 18px; }
  body.auth .auth-card .logo { width: min(188px, 76%); }
  .flow-actions > button,
  .flow-actions > .btn { flex: 1 1 100%; }
}

/* Side panels stay scrollable. The bar is a thin overlay instead of the
   default chunky slider, on the drawer, the desktop sidebar, and slide-overs. */
nav.side,
.nav-links,
.flow-panel,
.remote-panel,
#account-panel {
  scrollbar-width: thin;
  scrollbar-color: rgba(150, 176, 230, 0.35) transparent;
}
nav.side::-webkit-scrollbar,
.nav-links::-webkit-scrollbar,
.flow-panel::-webkit-scrollbar,
.remote-panel::-webkit-scrollbar,
#account-panel::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
nav.side::-webkit-scrollbar-track,
.nav-links::-webkit-scrollbar-track,
.flow-panel::-webkit-scrollbar-track,
.remote-panel::-webkit-scrollbar-track,
#account-panel::-webkit-scrollbar-track {
  background: transparent;
}
nav.side::-webkit-scrollbar-thumb,
.nav-links::-webkit-scrollbar-thumb,
.flow-panel::-webkit-scrollbar-thumb,
.remote-panel::-webkit-scrollbar-thumb,
#account-panel::-webkit-scrollbar-thumb {
  background: rgba(150, 176, 230, 0.35);
  border-radius: 99px;
}

.pane-switch a.pane-tab {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 4px 14px;
  border-radius: 999px;
  border: 1px solid rgba(140, 170, 255, 0.35);
  background: rgba(20, 36, 78, 0.45);
  color: #d5e2ff;
  text-decoration: none;
  font-size: 13px;
  font-weight: 700;
}
.pane-switch a.pane-tab.on {
  background: rgba(61, 107, 255, 0.28);
  color: #fff;
  border-color: rgba(150, 186, 255, 0.7);
  box-shadow: inset 0 0 0 1px rgba(142, 231, 255, 0.18);
}

/* Dashboard figures glow only while that tile has something to show. */
.count.live strong,
.cmd-figure.live {
  text-shadow: 0 0 8px rgba(186, 214, 255, 0.28);
  animation: number-glow 4.6s ease-in-out infinite;
}
.count.crit.live {
  animation: crit-card 2.8s ease-in-out infinite;
}
.count.crit.live strong {
  text-shadow: 0 0 8px rgba(255, 92, 122, 0.45);
  animation: crit-text 2.8s ease-in-out infinite;
}
.pill.critical,
.alert-card:has(.pill.critical) {
  animation: crit-text 2.8s ease-in-out infinite;
}
.alert-card:has(.pill.critical) {
  animation-name: crit-card;
}
@keyframes number-glow {
  0%, 100% { text-shadow: 0 0 6px rgba(186, 214, 255, 0.18); }
  50% { text-shadow: 0 0 16px rgba(142, 231, 255, 0.72); }
}
@keyframes crit-text {
  0%, 100% { text-shadow: 0 0 4px rgba(255, 92, 122, 0.2); }
  50% { text-shadow: 0 0 14px rgba(255, 92, 122, 0.85); }
}
@keyframes crit-card {
  0%, 100% { box-shadow: 0 10px 28px rgba(0, 0, 0, 0.22); }
  50% { box-shadow: 0 0 0 1px rgba(255, 92, 122, 0.38), 0 0 22px rgba(255, 92, 122, 0.32); }
}
@media (prefers-reduced-motion: reduce) {
  .count.live strong,
  .cmd-figure.live,
  .count.crit.live,
  .count.crit.live strong,
  .pill.critical,
  .alert-card:has(.pill.critical) {
    animation: none;
  }
}
.pill.watch { color: #d5e4ff; background: rgba(61, 107, 255, 0.16); }
.soft-group { margin-top: 14px; }
.soft-group summary { cursor: pointer; }
.soft-hosts { display: flex; flex-wrap: wrap; gap: 6px 12px; margin-top: 8px; }
.toolkit-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; }
.field-tools {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 18px;
  margin-top: 14px;
  padding: 8px 12px;
  border: 1px solid rgba(140, 170, 255, 0.16);
  border-radius: 10px;
  background: rgba(8, 12, 24, 0.28);
}
.field-tools p {
  margin: 0;
  max-width: 68ch;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
}
.field-tools strong {
  display: block;
  margin-bottom: 1px;
  color: var(--faint);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.field-tools-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.field-tools-actions .ghost,
.field-tools-actions a.btn.ghost {
  min-height: 32px;
  padding: 4px 10px;
  font-size: 13px;
  font-weight: 650;
}
.rule-edit { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.rule-edit select, .rule-edit input { width: auto; margin: 0; }
