/* ==========================================================================
   VICC v63 — design system

   LAYOUT THESIS
   The v61 UI had ~50 navigation items across 10 sections for a fleet of 13
   handsets. That is feature-centric navigation: you had to know which of
   fifty tools did the thing you wanted. v63 is device-centric. The fleet is
   the home screen, a handset is a workspace, and everything you can do to a
   phone lives inside that phone's tabs.

   Chrome:  a full-width command bar on top, a narrow rail beneath it, and
            one content column. The bar spans everything so global search
            and fleet state are always in the same place.

   VISUAL LANGUAGE
   Taken from the hardware. A BLF key has four lamp states — dark, green
   idle, amber ringing, red busy — and those four signals are the entire
   palette. Everything else is anodised equipment grey, so the only things
   that glow are the things reporting state.
   ========================================================================== */

:root {
  /* Chassis */
  --bg:        #0C1116;
  --bg-deep:   #070A0E;
  --surface:   #131A22;
  --surface-2: #1A222C;
  --surface-3: #222C38;
  --line:      #283443;
  --line-soft: #1E2732;

  /* Ink */
  --ink:     #E8EFF7;
  --ink-dim: #B2C1D2;
  --muted:   #8395A8;
  --faint:   #5A6979;

  /* Lamp signals — the whole palette */
  --idle: #35D07F;
  --ring: #FFB020;
  --busy: #F2555A;
  --off:  #37424E;
  --acc:  #4CC2FF;

  --idle-bg: rgba(53,208,127,.10);  --idle-br: rgba(53,208,127,.30);
  --ring-bg: rgba(255,176,32,.10);  --ring-br: rgba(255,176,32,.30);
  --busy-bg: rgba(242,85,90,.10);   --busy-br: rgba(242,85,90,.30);
  --acc-bg:  rgba(76,194,255,.10);  --acc-br:  rgba(76,194,255,.32);

  /* Metrics */
  --bar:  62px;   /* command bar height */
  --rail: 258px;  /* navigation rail   */
  --r:    7px;
  --r-sm: 4px;

  --sans: ui-sans-serif, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", "JetBrains Mono", "Cascadia Mono", Menlo, Consolas, monospace;

  --shadow:    0 1px 2px rgba(0,0,0,.4), 0 8px 24px rgba(0,0,0,.26);
  --shadow-lg: 0 4px 12px rgba(0,0,0,.5), 0 24px 64px rgba(0,0,0,.4);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scrollbar-color: var(--line) transparent; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 15.5px/1.62 var(--sans);
  letter-spacing: -.006em;
}

a { color: var(--acc); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
:focus-visible { outline: 2px solid var(--acc); outline-offset: 2px; border-radius: var(--r-sm); }
code, pre, .mono { font-family: var(--mono); }
h1, h2, h3 { margin: 0; letter-spacing: -.02em; }

/* ==========================================================================
   LAMP — the signature
   ========================================================================== */
.lamp {
  --c: var(--off);
  display: inline-block; width: 9px; height: 9px; border-radius: 50%;
  background: var(--c); flex: none;
  box-shadow: 0 0 0 1px rgba(0,0,0,.55) inset, 0 0 9px var(--c);
}
.lamp.dark { --c: var(--off); box-shadow: 0 0 0 1px rgba(0,0,0,.6) inset; }
.lamp.idle { --c: var(--idle); }
.lamp.ring { --c: var(--ring); }
.lamp.busy { --c: var(--busy); }
.lamp.acc  { --c: var(--acc); }
.lamp.lg   { width: 11px; height: 11px; }
.lamp.blink { animation: blink 1.2s steps(1, end) infinite; }
@keyframes blink { 0%,55% { opacity: 1 } 56%,100% { opacity: .25 } }

/* ==========================================================================
   CHROME — command bar, rail, content
   ========================================================================== */
.bar {
  position: fixed; inset: 0 0 auto 0; height: var(--bar); z-index: 50;
  display: flex; align-items: center; gap: 14px; padding: 0 16px;
  background: var(--bg-deep);
  border-bottom: 1px solid var(--line);
}
.bar-brand {
  display: flex; align-items: center; gap: 9px;
  width: calc(var(--rail) - 16px); flex: none;
  font: 800 15px/1 var(--sans); letter-spacing: .13em; text-transform: uppercase;
  color: var(--ink);
}
.bar-logo {
  width: 34px; height: 34px; object-fit: contain; flex: none;
  border-radius: 6px;
}
.bar-name { display: flex; flex-direction: column; gap: 2px; line-height: 1; min-width: 0; }
.bar-brand small {
  font: 500 9.5px/1 var(--mono); letter-spacing: .06em;
  color: var(--faint); text-transform: none;
}
.bar-brand:hover { text-decoration: none; }

/* Global search / command palette trigger */
.omni {
  flex: 1 1 auto; max-width: 540px;
  display: flex; align-items: center; gap: 10px;
  height: 38px; padding: 0 15px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-sm);
  color: var(--muted); font-size: 14px; cursor: pointer;
  transition: border-color .12s ease, background .12s ease;
}
.omni:hover { border-color: var(--surface-3); background: var(--surface-2); }
.omni kbd {
  margin-left: auto; padding: 2px 6px;
  background: var(--surface-3); border: 1px solid var(--line); border-radius: 3px;
  font: 600 10.5px/1.4 var(--mono); color: var(--faint);
}

.bar-right { margin-left: auto; display: flex; align-items: center; gap: 9px; }

.who {
  display: flex; align-items: center; gap: 7px; padding: 5px 11px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 99px;
  font: 500 12px/1 var(--mono); color: var(--ink-dim); white-space: nowrap;
}
.who b { color: var(--ink); font-weight: 600; }

/* Fleet pulse: live lamp strip in the bar, the whole fleet at a glance */
.pulse { display: flex; align-items: center; gap: 4px; padding: 0 4px; }
.pulse .lamp { width: 7px; height: 7px; }

.rail {
  position: fixed; top: var(--bar); bottom: 0; left: 0; width: var(--rail); z-index: 40;
  background: var(--bg-deep); border-right: 1px solid var(--line);
  overflow-y: auto; padding: 12px 0 24px; scrollbar-width: thin;
}
/* Collapsible sections. With 60+ links the rail must fold, or it becomes
   the same wall of items the old UI had. Sections holding the current page
   open automatically. */
.rail-group { margin-bottom: 2px; }
.rail-group > summary.rail-label {
  display: flex; align-items: center; gap: 7px; cursor: pointer;
  padding: 9px 16px 7px; list-style: none;
  font: 700 10.5px/1 var(--mono); letter-spacing: .16em; text-transform: uppercase; color: var(--muted);
  transition: color .12s ease;
}
.rail-group > summary::-webkit-details-marker { display: none; }
.rail-group > summary.rail-label:hover { color: var(--ink-dim); }
.rail-group > summary.rail-label::before {
  content: "▸"; font-size: 9px; color: var(--faint);
  transition: transform .12s ease; display: inline-block; flex: none;
}
.rail-group[open] > summary.rail-label::before { transform: rotate(90deg); }
.rail-group[open] > summary.rail-label { color: var(--muted); }
.rail-n {
  margin-left: auto; font: 600 9px/1 var(--mono); color: var(--faint);
  background: var(--surface-2); border: 1px solid var(--line);
  border-radius: 99px; padding: 2px 6px;
}
.rail a .tag {
  font: 700 8.5px/1 var(--mono); letter-spacing: .1em; text-transform: uppercase;
  color: var(--acc); background: var(--acc-bg); border: 1px solid var(--acc-br);
  border-radius: 3px; padding: 2px 4px; flex: none;
}
.rail-label {
  padding: 14px 16px 5px;
  font: 700 9px/1 var(--mono); letter-spacing: .16em; text-transform: uppercase; color: var(--faint);
}
.rail a {
  display: flex; align-items: center; gap: 9px; padding: 7px 18px 7px 30px;
  color: var(--ink-dim); font-size: 14px; border-left: 3px solid transparent;
  transition: background .12s ease, color .12s ease, border-color .12s ease;
}
.rail a:hover { background: rgba(255,255,255,.035); color: var(--ink); text-decoration: none; }
.rail a.on {
  background: linear-gradient(90deg, var(--acc-bg), transparent 80%);
  border-left-color: var(--acc); color: #fff; font-weight: 600;
}
.rail a .count {
  margin-left: auto; font: 600 11px/1 var(--mono); color: var(--faint);
  font-variant-numeric: tabular-nums;
}

.page { margin: var(--bar) 0 0 var(--rail); padding: 30px 34px 80px; min-width: 0; }

.head { display: flex; align-items: flex-start; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
.head h1 { font-size: 30px; font-weight: 750; letter-spacing: -.028em; }
.eyebrow {
  font: 700 10.5px/1 var(--mono); letter-spacing: .18em;
  text-transform: uppercase; color: var(--acc); margin-bottom: 10px; opacity: .8;
}
.head-sub { color: var(--muted); font-size: 13px; margin-top: 6px; }
.head .right { margin-left: auto; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

/* ==========================================================================
   PANELS
   ========================================================================== */
.panel {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: 10px; box-shadow: var(--shadow); margin-bottom: 20px; overflow: hidden;
}
.panel-head {
  display: flex; align-items: center; gap: 12px; padding: 15px 20px;
  border-bottom: 1px solid var(--line-soft);
  background: linear-gradient(180deg, rgba(255,255,255,.022), transparent);
}
.panel-head h2 { font-size: 15px; font-weight: 650; letter-spacing: -.012em; }
.panel-head .right { margin-left: auto; display: flex; gap: 7px; align-items: center; }
.panel-body { padding: 20px; }
.panel-body > :first-child { margin-top: 0 }
.panel-body > :last-child  { margin-bottom: 0 }

/* ==========================================================================
   RACK — the fleet as a row of devices. The home screen.
   ========================================================================== */
.rack { display: flex; flex-direction: column; }
.rack-row {
  display: grid;
  grid-template-columns: 14px 62px minmax(150px, 1.4fr) 128px 1fr 106px 96px;
  align-items: center; gap: 14px;
  padding: 15px 20px; border-bottom: 1px solid var(--line-soft);
  color: inherit; transition: background .1s ease;
}
.rack-row:last-child { border-bottom: 0 }
.rack-row:hover { background: rgba(255,255,255,.026); text-decoration: none; }
.rack-head {
  font: 700 9px/1 var(--mono); letter-spacing: .13em; text-transform: uppercase;
  color: var(--muted); background: var(--surface-2);
  border-bottom: 1px solid var(--line); padding: 9px 16px;
}
.rack-ext {
  font: 650 20px/1 var(--mono); color: var(--ink); font-variant-numeric: tabular-nums;
  letter-spacing: -.02em;
}
.rack-name { min-width: 0; }
.rack-name b { display: block; font-weight: 600; font-size: 15px; }
.rack-name span {
  display: block; font: 400 11px/1.4 var(--mono); color: var(--faint);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.rack-keys { display: flex; gap: 3px; align-items: center; }
.rack-keys i {
  width: 6px; height: 6px; border-radius: 1px; background: var(--off); flex: none;
}
.rack-keys i.on { background: var(--idle); box-shadow: 0 0 5px var(--idle); }
.rack-keys i.sd { background: var(--acc); box-shadow: 0 0 5px var(--acc); }
.rack-when { font: 400 11.5px/1 var(--mono); color: var(--muted); text-align: right; }

/* ==========================================================================
   METRICS
   ========================================================================== */
.metrics {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(184px, 1fr));
  gap: 14px; margin-bottom: 24px;
}
.metric {
  position: relative; overflow: hidden;
  background: linear-gradient(165deg, var(--surface-2), var(--surface) 62%);
  border: 1px solid var(--line);
  border-radius: 10px; padding: 18px 19px 17px;
  transition: border-color .15s ease, transform .15s ease;
}
.metric:hover { border-color: #35424F; transform: translateY(-1px); }
.metric::before {
  content: ""; position: absolute; inset: 0 0 auto 0; height: 2px; background: var(--off);
}
.metric.idle::before { background: var(--idle); box-shadow: 0 0 12px var(--idle) }
.metric.ring::before { background: var(--ring); box-shadow: 0 0 12px var(--ring) }
.metric.busy::before { background: var(--busy); box-shadow: 0 0 12px var(--busy) }
.metric.acc::before  { background: var(--acc);  box-shadow: 0 0 12px var(--acc) }
.metric dt {
  font: 700 10px/1 var(--mono); letter-spacing: .15em;
  text-transform: uppercase; color: var(--faint); margin-bottom: 8px;
}
.metric dd {
  margin: 0; font: 650 40px/1 var(--mono); letter-spacing: -.04em;
  color: var(--ink); font-variant-numeric: tabular-nums;
}
.metric dd small { font-size: 13px; color: var(--muted); margin-left: 4px; letter-spacing: 0 }
.metric p { margin: 7px 0 0; font-size: 11.5px; color: var(--muted) }

/* ==========================================================================
   TABS — the phone workspace
   ========================================================================== */
.tabs {
  display: flex; gap: 2px; border-bottom: 1px solid var(--line);
  margin-bottom: 20px; overflow-x: auto; scrollbar-width: none;
}
.tabs::-webkit-scrollbar { display: none }
.tabs a {
  padding: 9px 15px; color: var(--muted); font-size: 13.5px; font-weight: 500;
  border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap;
  transition: color .12s ease, border-color .12s ease;
}
.tabs a:hover { color: var(--ink); text-decoration: none }
.tabs a.on { color: var(--ink); border-bottom-color: var(--acc); font-weight: 600 }
.tabs a .lamp { margin-left: 7px }

/* Phone identity strip */
.ident {
  display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
  padding: 16px; background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r); margin-bottom: 18px;
}
.ident-ext {
  font: 600 30px/1 var(--mono); letter-spacing: -.03em;
  color: var(--ink); font-variant-numeric: tabular-nums;
}
.ident-meta { display: flex; flex-direction: column; gap: 3px; min-width: 0 }
.ident-meta b { font-size: 15px; font-weight: 600 }
.ident-meta span { font: 400 11.5px/1.4 var(--mono); color: var(--faint) }
.ident .right { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap }

/* ==========================================================================
   TABLES
   ========================================================================== */
.tw { overflow-x: auto }
table { width: 100%; border-collapse: collapse; font-size: 14.5px }
th {
  text-align: left; padding: 12px 18px; background: var(--surface-2);
  border-bottom: 1px solid var(--line);
  font: 700 10px/1 var(--mono); letter-spacing: .13em; text-transform: uppercase;
  color: var(--muted); white-space: nowrap;
}
td { padding: 13px 18px; border-bottom: 1px solid var(--line-soft); vertical-align: middle }
tr:last-child td { border-bottom: 0 }
tbody tr:hover { background: rgba(255,255,255,.022) }
td.num, th.num { text-align: right; font-family: var(--mono); font-variant-numeric: tabular-nums }
.mac { font: 400 12px/1 var(--mono); color: var(--ink-dim) }

/* ==========================================================================
   PILLS / BUTTONS
   ========================================================================== */
.pill {
  display: inline-flex; align-items: center; gap: 6px; padding: 3px 9px;
  border-radius: 99px; border: 1px solid var(--line); background: var(--surface-2);
  color: var(--ink-dim); font: 600 11px/1.5 var(--mono); white-space: nowrap;
}
.pill.idle { background: var(--idle-bg); border-color: var(--idle-br); color: var(--idle) }
.pill.ring { background: var(--ring-bg); border-color: var(--ring-br); color: var(--ring) }
.pill.busy { background: var(--busy-bg); border-color: var(--busy-br); color: var(--busy) }
.pill.acc  { background: var(--acc-bg);  border-color: var(--acc-br);  color: var(--acc) }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  padding: 9px 17px; border: 1px solid var(--line); border-radius: 6px;
  background: var(--surface-2); color: var(--ink);
  font: 600 14px/1 var(--sans); cursor: pointer; text-decoration: none;
  transition: background .12s ease, border-color .12s ease, transform .06s ease;
}
.btn:hover { background: var(--surface-3); border-color: #33404F; text-decoration: none; color: var(--ink) }
.btn:active { transform: translateY(1px) }
.btn[disabled] { opacity: .45; pointer-events: none }
.btn.primary { background: var(--acc-bg); border-color: var(--acc-br); color: var(--acc) }
.btn.primary:hover { background: rgba(76,194,255,.17); border-color: var(--acc) }
.btn.go { background: var(--idle-bg); border-color: var(--idle-br); color: var(--idle) }
.btn.go:hover { background: rgba(53,208,127,.17); border-color: var(--idle) }
.btn.danger { background: var(--busy-bg); border-color: var(--busy-br); color: var(--busy) }
.btn.danger:hover { background: rgba(242,85,90,.17); border-color: var(--busy) }
.btn.mini { padding: 4px 10px; font-size: 12px }
.actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center }

/* ==========================================================================
   FORMS
   ========================================================================== */
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 14px }
.grid3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(185px, 1fr)); gap: 13px }

.field { display: flex; flex-direction: column; gap: 6px }
.field > span {
  font: 700 9px/1 var(--mono); letter-spacing: .13em; text-transform: uppercase; color: var(--muted);
}
.field .hint { font: 400 11.5px/1.45 var(--sans); color: var(--faint); letter-spacing: 0; text-transform: none }

input[type=text], input[type=password], input[type=number], input[type=search],
input[type=email], select, textarea {
  width: 100%; padding: 10px 13px;
  background: var(--bg-deep); border: 1px solid var(--line); border-radius: var(--r-sm);
  color: var(--ink); font: 400 14.5px/1.5 var(--sans);
  transition: border-color .12s ease, box-shadow .12s ease;
}
input.mono, textarea { font-family: var(--mono); font-size: 12.5px }
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--acc); background: #0A0F14;
  box-shadow: 0 0 0 3px rgba(76,194,255,.12);
}
textarea { resize: vertical; min-height: 72px }
select {
  appearance: none; padding-right: 28px;
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%),
                    linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 14px) 15px, calc(100% - 9px) 15px;
  background-size: 5px 5px, 5px 5px; background-repeat: no-repeat;
}
.check { display: flex; align-items: center; gap: 9px; font-size: 13.5px; color: var(--ink-dim); cursor: pointer }
.check input { width: 15px; height: 15px; accent-color: var(--acc); cursor: pointer }

/* ==========================================================================
   NOTICES
   ========================================================================== */
.note {
  display: flex; gap: 11px; align-items: flex-start; padding: 11px 14px;
  border: 1px solid var(--line); border-radius: var(--r-sm);
  background: var(--surface-2); font-size: 13.5px; margin-bottom: 16px; line-height: 1.55;
}
.note.ok   { background: var(--idle-bg); border-color: var(--idle-br) }
.note.warn { background: var(--ring-bg); border-color: var(--ring-br) }
.note.bad  { background: var(--busy-bg); border-color: var(--busy-br) }
.note .lamp { margin-top: 5px }
.note b { display: block; margin-bottom: 2px }

.empty { text-align: center; padding: 44px 20px; color: var(--muted) }
.empty h3 { margin-bottom: 7px; font-size: 15px; color: var(--ink-dim); font-weight: 600 }
.empty p { margin: 0 auto 16px; font-size: 13.5px; max-width: 42ch }

/* ==========================================================================
   SIDECAR / LINE KEYS
   ========================================================================== */
.sidecar {
  display: inline-block; padding: 12px; border-radius: 9px;
  background: linear-gradient(180deg, #0F151C, #0A0E13);
  border: 1px solid var(--line);
  box-shadow: var(--shadow), inset 0 1px 0 rgba(255,255,255,.04);
}
.sidecar-head {
  display: flex; align-items: center; gap: 8px; padding-bottom: 10px; margin-bottom: 10px;
  border-bottom: 1px solid var(--line-soft);
  font: 700 9px/1 var(--mono); letter-spacing: .15em; text-transform: uppercase; color: var(--faint);
}
.keys { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px }
.keys.one { grid-template-columns: minmax(0, 1fr) }
.key {
  display: flex; align-items: center; gap: 11px; padding: 10px 13px; min-width: 178px;
  background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--r-sm);
  transition: border-color .12s ease, background .12s ease;
}
.key:hover { border-color: #33404F; background: var(--surface-3) }
.key.off { opacity: .45 }
.key-n {
  font: 600 10px/1 var(--mono); color: var(--faint);
  min-width: 16px; text-align: right; flex: none; font-variant-numeric: tabular-nums;
}
.key-body { min-width: 0; flex: 1 1 auto }
.key-body b {
  display: block; font: 500 14px/1.3 var(--mono); color: var(--ink);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.key-body span {
  display: block; margin-top: 2px; font: 400 10.5px/1.3 var(--mono); color: var(--faint);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

/* Phone LCD */
.lcd {
  max-width: 320px; padding: 13px; border-radius: var(--r-sm);
  background: linear-gradient(180deg, #091317, #06100E);
  border: 1px solid var(--line); font-family: var(--mono);
  box-shadow: inset 0 0 26px rgba(0,0,0,.6);
}
.lcd-top {
  display: flex; justify-content: space-between; font-size: 10px; color: var(--faint);
  border-bottom: 1px solid var(--line-soft); padding-bottom: 7px; margin-bottom: 10px;
}
.lcd-name { font-size: 15px; color: var(--ink); font-weight: 600 }
.lcd-ext  { font-size: 12px; color: var(--idle); margin-top: 3px }
.lcd-keys {
  display: flex; justify-content: space-around; gap: 5px; font-size: 10px; color: var(--muted);
  border-top: 1px solid var(--line-soft); padding-top: 9px; margin-top: 12px;
}

/* ==========================================================================
   CHECKS
   ========================================================================== */
.checks { list-style: none; margin: 0; padding: 0 }
.checks li {
  display: flex; align-items: flex-start; gap: 11px; padding: 9px 0;
  border-bottom: 1px solid var(--line-soft); font-size: 13.5px;
}
.checks li:last-child { border-bottom: 0 }
.checks .lamp { margin-top: 5px }
.checks .why { color: var(--faint); font: 400 12px/1.5 var(--mono); margin-top: 2px }

pre.xml {
  background: var(--bg-deep); border: 1px solid var(--line); border-radius: var(--r-sm);
  padding: 14px; overflow: auto; max-height: 440px; margin: 0;
  font: 400 12px/1.65 var(--mono); color: var(--ink-dim); scrollbar-width: thin;
}

/* ==========================================================================
   COMMAND PALETTE — jump to any phone or page
   ========================================================================== */
.cmdk {
  position: fixed; inset: 0; z-index: 200; display: none;
  background: rgba(4,7,10,.72); backdrop-filter: blur(3px);
  align-items: flex-start; justify-content: center; padding: 12vh 20px 20px;
}
.cmdk.open { display: flex }
.cmdk-box {
  width: 100%; max-width: 560px; background: var(--surface);
  border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow-lg);
  overflow: hidden;
}
.cmdk-box input {
  width: 100%; padding: 15px 17px; border: 0; border-bottom: 1px solid var(--line);
  background: transparent; color: var(--ink); font-size: 15px; border-radius: 0;
}
.cmdk-box input:focus { outline: none; box-shadow: none; background: transparent }
.cmdk-list { max-height: 340px; overflow-y: auto; padding: 6px }
.cmdk-item {
  display: flex; align-items: center; gap: 11px; padding: 9px 12px;
  border-radius: var(--r-sm); color: var(--ink-dim); font-size: 13.5px; cursor: pointer;
}
.cmdk-item:hover, .cmdk-item.sel { background: var(--surface-3); color: var(--ink); text-decoration: none }
.cmdk-item .k {
  font: 600 12px/1 var(--mono); color: var(--ink);
  min-width: 46px; font-variant-numeric: tabular-nums;
}
.cmdk-item .t { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap }
.cmdk-item .g {
  font: 600 9px/1 var(--mono); letter-spacing: .12em; text-transform: uppercase; color: var(--faint);
}
.cmdk-empty { padding: 26px; text-align: center; color: var(--muted); font-size: 13.5px }

/* ==========================================================================
   UTILITIES
   ========================================================================== */
.muted { color: var(--muted) } .faint { color: var(--faint) }
.small { font-size: 12px } .nowrap { white-space: nowrap }
.row { display: flex; align-items: center; gap: 9px; flex-wrap: wrap }
.stack > * + * { margin-top: 12px }
.right { margin-left: auto }
hr.sep { border: 0; border-top: 1px solid var(--line-soft); margin: 18px 0 }
.bar-meter { height: 4px; background: var(--surface-3); border-radius: 99px; overflow: hidden }
.bar-meter i { display: block; height: 100%; background: var(--acc); border-radius: 99px }
.skip {
  position: absolute; left: -9999px; background: var(--acc); color: #04121C;
  padding: 10px 16px; border-radius: var(--r-sm); font-weight: 700; z-index: 300;
}
.skip:focus { left: 12px; top: 12px }

/* ==========================================================================
   AUTH
   ========================================================================== */
.auth { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px }
.auth-box { width: 100%; max-width: 380px }
.auth-head { text-align: center; margin-bottom: 22px }
.auth-head .mark {
  display: inline-flex; align-items: center; gap: 9px;
  font: 800 16px/1 var(--sans); letter-spacing: .12em; text-transform: uppercase;
}
.auth-head p { margin: 9px 0 0; color: var(--muted); font-size: 13px }
.auth-box .field { margin-bottom: 14px }
.auth-box .btn { width: 100%; padding: 10px }
.auth-foot {
  margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--line-soft);
  font-size: 11.5px; color: var(--faint); text-align: center; line-height: 1.6;
}
.codes { display: grid; grid-template-columns: repeat(auto-fit, minmax(126px, 1fr)); gap: 8px }
.codes span {
  padding: 8px 11px; background: var(--bg-deep); border: 1px solid var(--line);
  border-radius: var(--r-sm); font: 400 13.5px/1 var(--mono); letter-spacing: .05em; text-align: center;
}

/* ==========================================================================
   PRESENCE
   The layout above is correct but flat. This block adds depth, light and
   hierarchy — the difference between "a working admin panel" and something
   you actually want to look at. Every effect is tied to state, so it stays
   informative rather than decorative.
   ========================================================================== */

/* Content stops drifting on ultrawide monitors, but still uses real width. */
.page > * { max-width: 1680px; }

/* Ambient light. Two soft sources, fixed, so scrolling feels like a surface
   rather than a scrolling document. */
body::before {
  content: ""; position: fixed; inset: 0; pointer-events: none; z-index: 0;
  background:
    radial-gradient(1100px 620px at 78% -10%, rgba(76,194,255,.07), transparent 60%),
    radial-gradient(820px 520px at 4% 108%, rgba(53,208,127,.055), transparent 58%);
}
/* z-index only. Setting position here would override the fixed positioning
   declared above and drop the bar and rail into normal flow. */
.page { position: relative; z-index: 1; }
.bar  { z-index: 50; }
.rail { z-index: 40; }

/* Command bar sits above the content with real separation. */
.bar {
  background: linear-gradient(180deg, #0A0E13, #070A0E);
  box-shadow: 0 1px 0 rgba(255,255,255,.03), 0 4px 20px rgba(0,0,0,.45);
}
.bar-brand { padding-right: 14px; border-right: 1px solid var(--line-soft); }

/* Fleet pulse: bigger, and it breathes. */
.pulse {
  padding: 7px 12px; border-radius: 99px;
  background: rgba(255,255,255,.03); border: 1px solid var(--line-soft);
}
.pulse .lamp { width: 8px; height: 8px; }
.pulse .lamp.idle { animation: pulse-breathe 3.4s ease-in-out infinite; }
.pulse .lamp:nth-child(2n) { animation-delay: .5s }
.pulse .lamp:nth-child(3n) { animation-delay: 1.1s }
@keyframes pulse-breathe { 0%,100% { opacity: .82 } 50% { opacity: 1 } }

/* Rail: active item gets a lit edge, not just a tint. */
.rail a.on {
  box-shadow: inset 3px 0 0 var(--acc), inset 0 0 30px rgba(76,194,255,.06);
}
.rail a.on::before {
  content: ""; position: absolute; left: 0; width: 3px; height: 100%;
  background: var(--acc); box-shadow: 0 0 12px var(--acc);
}
.rail a { position: relative; }
.rail-group[open] > summary.rail-label { color: var(--ink-dim); }

/* Panels: a hairline of light on the top edge, like a bezel catching a lamp. */
.panel {
  background: linear-gradient(180deg, var(--surface-2) 0%, var(--surface) 120px);
  position: relative;
}
.panel::after {
  content: ""; position: absolute; inset: 0 0 auto 0; height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.07) 18%,
              rgba(255,255,255,.07) 82%, transparent);
  pointer-events: none;
}
.panel-head {
  background: linear-gradient(180deg, rgba(255,255,255,.035), transparent);
}
.panel-head h2::before {
  content: ""; display: inline-block; width: 3px; height: 13px;
  background: var(--acc); border-radius: 2px; margin-right: 10px;
  vertical-align: -2px; box-shadow: 0 0 9px var(--acc); opacity: .85;
}

/* Metric numerals glow faintly in their own signal colour. */
.metric.idle dd { color: #DFF7EA; text-shadow: 0 0 26px rgba(53,208,127,.4); }
.metric.ring dd { color: #FFEBC9; text-shadow: 0 0 26px rgba(255,176,32,.4); }
.metric.busy dd { color: #FFD9DA; text-shadow: 0 0 26px rgba(242,85,90,.4); }
.metric.acc  dd { color: #D6EEFF; text-shadow: 0 0 26px rgba(76,194,255,.4); }
.metric::after {
  content: ""; position: absolute; inset: auto -30% -60% auto;
  width: 150px; height: 150px; border-radius: 50%;
  background: radial-gradient(circle, rgba(255,255,255,.035), transparent 70%);
  pointer-events: none;
}

/* Page title: heavier, with the eyebrow reading as a live label. */
.head h1 {
  background: linear-gradient(180deg, #FFFFFF, #BCCBDB);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
}
.head { padding-bottom: 20px; border-bottom: 1px solid var(--line-soft); margin-bottom: 26px; }

/* Rack rows: a lit left edge on hover, so scanning feels physical. */
.rack-row { position: relative; }
.rack-row::before {
  content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 0;
  background: var(--acc); transition: width .12s ease;
}
.rack-row:hover::before { width: 3px; box-shadow: 0 0 12px var(--acc); }
.rack-row:hover { background: linear-gradient(90deg, rgba(76,194,255,.05), transparent 40%); }

/* Lamps burn a little brighter now that there is more room around them. */
.lamp { box-shadow: 0 0 0 1px rgba(0,0,0,.55) inset, 0 0 12px var(--c), 0 0 3px var(--c); }
.lamp.lg { width: 13px; height: 13px; }

/* Buttons get a lift. */
.btn { box-shadow: 0 1px 2px rgba(0,0,0,.3); }
.btn.primary { box-shadow: 0 1px 2px rgba(0,0,0,.3), 0 0 22px rgba(76,194,255,.16); }
.btn.go      { box-shadow: 0 1px 2px rgba(0,0,0,.3), 0 0 22px rgba(53,208,127,.16); }
.btn:hover   { box-shadow: 0 2px 8px rgba(0,0,0,.4); }

/* Sidecar reads as moulded plastic rather than a div. */
.sidecar {
  background: linear-gradient(180deg, #131A22, #0A0E13);
  box-shadow: var(--shadow), inset 0 1px 0 rgba(255,255,255,.06),
              inset 0 -1px 0 rgba(0,0,0,.5);
  padding: 16px; border-radius: 12px;
}
.key { box-shadow: inset 0 1px 0 rgba(255,255,255,.03); }

/* Notices carry a coloured edge. */
.note { border-left-width: 3px; padding: 14px 17px; font-size: 14.5px; }
.note.ok   { border-left-color: var(--idle) }
.note.warn { border-left-color: var(--ring) }
.note.bad  { border-left-color: var(--busy) }
.note b { font-size: 15px; }

/* Tabs feel like a real control surface. */
.tabs a.on { box-shadow: 0 2px 14px rgba(76,194,255,.18); }
.tabs { gap: 4px; margin-bottom: 26px; }
.tabs a { padding: 11px 18px; font-size: 14.5px; }

/* Identity strip is the hero of a handset page. */
.ident {
  background: linear-gradient(150deg, var(--surface-2), var(--surface) 60%);
  border-radius: 12px; padding: 22px; gap: 20px;
}
.ident-ext { font-size: 40px; }
.ident-meta b { font-size: 17px; }

/* Empty states stop looking like an error. */
.empty { padding: 64px 24px; }
.empty h3 { font-size: 17px; }

@media (prefers-reduced-motion: reduce) {
  .pulse .lamp.idle { animation: none }
}
@media (max-width: 900px) {
  .page > * { max-width: none; }
  .bar-brand { border-right: 0; padding-right: 0; }
  .head h1 { font-size: 22px; }
  .metric dd { font-size: 30px; }
  .ident-ext { font-size: 30px; }
}

/* ==========================================================================
   GLOSS
   Depth done with light rather than decoration: translucent chrome that
   blurs what is behind it, a specular highlight along the top edge of every
   raised surface, and gradient borders that catch the accent. The rule is
   that every glow means something — a lamp state, a live value, focus.
   ========================================================================== */

/* ---- Chrome: frosted glass over the content ---- */
.bar {
  background: rgba(10, 14, 19, .82);
  -webkit-backdrop-filter: blur(20px) saturate(160%);
  backdrop-filter: blur(20px) saturate(160%);
  border-bottom: 1px solid rgba(255,255,255,.07);
  box-shadow: 0 1px 0 rgba(255,255,255,.05) inset,
              0 10px 34px rgba(0,0,0,.55);
}
.rail {
  background: rgba(9, 12, 17, .88);
  -webkit-backdrop-filter: blur(18px) saturate(140%);
  backdrop-filter: blur(18px) saturate(140%);
  border-right: 1px solid rgba(255,255,255,.055);
}

/* ---- Raised surfaces get a specular top edge ---- */
.panel, .metric, .ident, .sidecar, .key, .cmdk-box {
  background-image: linear-gradient(180deg, rgba(255,255,255,.055), rgba(255,255,255,0) 90px);
  box-shadow:
    0 1px 0 rgba(255,255,255,.07) inset,
    0 -1px 0 rgba(0,0,0,.35) inset,
    0 2px 5px rgba(0,0,0,.32),
    0 14px 40px rgba(0,0,0,.34);
}
.key { box-shadow: 0 1px 0 rgba(255,255,255,.06) inset, 0 1px 3px rgba(0,0,0,.3); }

/* Panels get a gradient hairline border that picks up the accent. */
.panel { border: 1px solid transparent; background-clip: padding-box; position: relative; }
.panel::before {
  content: ""; position: absolute; inset: 0; border-radius: inherit; padding: 1px;
  background: linear-gradient(160deg, rgba(76,194,255,.32), rgba(255,255,255,.07) 32%,
              rgba(255,255,255,.03) 68%, rgba(0,0,0,.25));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude;
  pointer-events: none; z-index: 2;
}

/* ---- Metrics: glass tiles that light from within ---- */
.metric {
  background:
    linear-gradient(180deg, rgba(255,255,255,.07), rgba(255,255,255,0) 55%),
    linear-gradient(158deg, var(--surface-2), var(--surface) 64%);
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 12px;
}
.metric::before { height: 3px; border-radius: 12px 12px 0 0; }
.metric.idle { box-shadow: 0 1px 0 rgba(255,255,255,.07) inset, 0 0 0 1px rgba(53,208,127,.14), 0 16px 40px rgba(0,0,0,.35); }
.metric.ring { box-shadow: 0 1px 0 rgba(255,255,255,.07) inset, 0 0 0 1px rgba(255,176,32,.14), 0 16px 40px rgba(0,0,0,.35); }
.metric.busy { box-shadow: 0 1px 0 rgba(255,255,255,.07) inset, 0 0 0 1px rgba(242,85,90,.16), 0 16px 40px rgba(0,0,0,.35); }
.metric.acc  { box-shadow: 0 1px 0 rgba(255,255,255,.07) inset, 0 0 0 1px rgba(76,194,255,.16), 0 16px 40px rgba(0,0,0,.35); }
.metric:hover { transform: translateY(-2px); }
.metric dd { font-weight: 700; }

/* ---- Lamps: a real bloom with a bright core ---- */
.lamp {
  background: radial-gradient(circle at 35% 30%, #fff 0%, var(--c) 42%, var(--c) 100%);
  box-shadow:
    0 0 0 1px rgba(0,0,0,.5) inset,
    0 0 6px var(--c), 0 0 16px var(--c), 0 0 30px color-mix(in srgb, var(--c) 45%, transparent);
}
.lamp.dark {
  background: radial-gradient(circle at 35% 30%, #4A5663 0%, var(--off) 60%);
  box-shadow: 0 0 0 1px rgba(0,0,0,.6) inset;
}

/* ---- Buttons: glossy, with a light sweep on hover ---- */
.btn {
  position: relative; overflow: hidden;
  background-image: linear-gradient(180deg, rgba(255,255,255,.09), rgba(255,255,255,0));
  box-shadow: 0 1px 0 rgba(255,255,255,.09) inset, 0 2px 6px rgba(0,0,0,.34);
}
.btn::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(105deg, transparent 30%, rgba(255,255,255,.14) 48%, transparent 62%);
  transform: translateX(-120%); transition: transform .55s ease; pointer-events: none;
}
.btn:hover::after { transform: translateX(120%); }
.btn.primary { border-color: rgba(76,194,255,.5); box-shadow: 0 1px 0 rgba(255,255,255,.12) inset, 0 0 26px rgba(76,194,255,.26), 0 2px 8px rgba(0,0,0,.4); }
.btn.go      { border-color: rgba(53,208,127,.5); box-shadow: 0 1px 0 rgba(255,255,255,.12) inset, 0 0 26px rgba(53,208,127,.26), 0 2px 8px rgba(0,0,0,.4); }
.btn.danger  { border-color: rgba(242,85,90,.5);  box-shadow: 0 1px 0 rgba(255,255,255,.12) inset, 0 0 26px rgba(242,85,90,.22), 0 2px 8px rgba(0,0,0,.4); }

/* ---- Pills: small glass capsules ---- */
.pill {
  background-image: linear-gradient(180deg, rgba(255,255,255,.09), rgba(255,255,255,0));
  box-shadow: 0 1px 0 rgba(255,255,255,.07) inset;
}

/* ---- The omni bar reads as inset glass ---- */
.omni {
  background: rgba(0,0,0,.34);
  border: 1px solid rgba(255,255,255,.08);
  box-shadow: 0 2px 10px rgba(0,0,0,.4) inset;
}
.omni:hover { border-color: rgba(76,194,255,.4); box-shadow: 0 2px 10px rgba(0,0,0,.4) inset, 0 0 22px rgba(76,194,255,.14); }

/* ---- Inputs: recessed, with a lit focus ring ---- */
input[type=text], input[type=password], input[type=number], input[type=search],
input[type=email], select, textarea {
  background: rgba(0,0,0,.32);
  border: 1px solid rgba(255,255,255,.09);
  box-shadow: 0 2px 8px rgba(0,0,0,.32) inset;
  border-radius: 6px;
}
input:focus, select:focus, textarea:focus {
  border-color: var(--acc); background: rgba(0,0,0,.42);
  box-shadow: 0 2px 8px rgba(0,0,0,.32) inset, 0 0 0 3px rgba(76,194,255,.16), 0 0 26px rgba(76,194,255,.14);
}

/* ---- Rack: glass rows, lit on hover ---- */
.rack-row:hover {
  background: linear-gradient(90deg, rgba(76,194,255,.09), rgba(76,194,255,.02) 45%, transparent);
  box-shadow: 0 1px 0 rgba(255,255,255,.05) inset;
}
.rack-keys i { box-shadow: 0 0 5px currentColor; border-radius: 2px; }
.rack-keys i.on { background: var(--idle); box-shadow: 0 0 7px var(--idle); }
.rack-keys i.sd { background: var(--acc);  box-shadow: 0 0 7px var(--acc); }

/* ---- Rail: active row glows along its edge ---- */
.rail a.on {
  background: linear-gradient(90deg, rgba(76,194,255,.16), rgba(76,194,255,.03) 55%, transparent);
}
.rail a .tag { box-shadow: 0 0 12px rgba(76,194,255,.28); }

/* ---- Sidecar: moulded plastic with a screen-lit face ---- */
.sidecar {
  background:
    linear-gradient(180deg, rgba(255,255,255,.06), rgba(255,255,255,0) 70px),
    linear-gradient(180deg, #161E27, #0A0E13);
  border: 1px solid rgba(255,255,255,.09);
  border-radius: 14px;
}

/* ---- LCD: a real backlit panel ---- */
.lcd {
  background:
    radial-gradient(120% 80% at 50% 0%, rgba(53,208,127,.09), transparent 60%),
    linear-gradient(180deg, #0B1619, #05100E);
  border: 1px solid rgba(255,255,255,.09);
  box-shadow: inset 0 0 40px rgba(0,0,0,.7), 0 0 26px rgba(53,208,127,.09);
  border-radius: 8px;
}
.lcd-ext { text-shadow: 0 0 14px rgba(53,208,127,.6); }

/* ---- Tabs: lit underline ---- */
.tabs a.on { border-bottom-color: var(--acc); box-shadow: 0 3px 18px rgba(76,194,255,.22); }

/* ---- Command palette: heavy frosted glass ---- */
.cmdk { background: rgba(4,7,10,.62); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); }
.cmdk-box {
  background: rgba(24,31,40,.94);
  -webkit-backdrop-filter: blur(26px) saturate(170%);
  backdrop-filter: blur(26px) saturate(170%);
  border: 1px solid rgba(255,255,255,.11);
  border-radius: 14px;
}
.cmdk-item.sel, .cmdk-item:hover {
  background: linear-gradient(90deg, rgba(76,194,255,.18), rgba(76,194,255,.04));
  box-shadow: 0 0 0 1px rgba(76,194,255,.22) inset;
}

/* ---- Notices: tinted glass ---- */
.note {
  background-image: linear-gradient(180deg, rgba(255,255,255,.05), rgba(255,255,255,0));
  box-shadow: 0 1px 0 rgba(255,255,255,.05) inset, 0 6px 22px rgba(0,0,0,.28);
  border-radius: 8px;
}

/* ---- Tables: header reads as a machined strip ---- */
th {
  background: linear-gradient(180deg, rgba(255,255,255,.06), rgba(255,255,255,.01));
  box-shadow: 0 1px 0 rgba(255,255,255,.05) inset;
}

/* Fall back gracefully where backdrop-filter is unsupported. */
@supports not (backdrop-filter: blur(1px)) {
  .bar  { background: #0A0E13; }
  .rail { background: #090C11; }
  .cmdk-box { background: #181F28; }
}

/* ==========================================================================
   RESPONSIVE
   ========================================================================== */
@media (max-width: 900px) {
  :root { --rail: 0px }
  .bar { padding: 0 12px; gap: 10px }
  .bar-brand { width: auto }
  .bar-brand small { display: none }
  .rail {
    position: static; width: auto; height: auto; top: auto;
    border-right: 0; border-bottom: 1px solid var(--line);
    display: flex; flex-wrap: wrap; gap: 2px; padding: 8px 12px 12px; margin-top: var(--bar);
  }
  .rail-group { display: contents }
  .rail-group > summary.rail-label { display: none }
  .rail-label { display: none }
  .rail a {
    border-left: 0; border: 1px solid var(--line); border-radius: 99px;
    padding: 6px 12px; font-size: 12.5px;
  }
  .rail a.on { background: var(--acc-bg); border-color: var(--acc-br) }
  .page { margin: 0; padding: 18px 14px 44px }
  .head h1 { font-size: 19px }
  .rack-row {
    grid-template-columns: 12px 54px 1fr auto; gap: 10px; padding: 12px;
  }
  .rack-row > :nth-child(n+5) { display: none }
  .rack-head { display: none }
  .keys { grid-template-columns: minmax(0, 1fr) }
  .metric dd { font-size: 24px }
  .omni { max-width: none }
  .who { display: none }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important; animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
  }
}

@media print {
  .bar, .rail, .actions, .tabs, .cmdk { display: none !important }
  .page { margin: 0; padding: 0 }
  body { background: #fff; color: #000 }
  .panel { border-color: #ccc; box-shadow: none }
}
