/* Aurora control room — theme tokens */
:root {
  color-scheme: light;
  --bg: #f4f5f9;
  --bg-glow-1: #34d8a622;
  --bg-glow-2: #a78bfa1f;
  --surface: #ffffff;
  --surface-2: #f6f7fb;
  --surface-3: #eceef5;
  --sidebar: #ffffffcc;
  --line: #e3e6ef;
  --line-strong: #d3d8e4;
  --ink: #141722;
  --ink-2: #3b4152;
  --muted: #6b7285;
  --accent: #0e9f75;
  --accent-ink: #0b7a5a;
  --accent-soft: #0e9f7514;
  --violet: #6d5ce8;
  --violet-soft: #6d5ce814;
  --good: #16a34a;
  --good-soft: #16a34a14;
  --warn: #b7791f;
  --warn-soft: #d9770614;
  --bad: #dc2626;
  --bad-soft: #dc262612;
  --primary-bg: #141722;
  --primary-ink: #ffffff;
  --shadow: 0 1px 2px #1417220a, 0 8px 24px -12px #14172214;
  --shadow-lg: 0 24px 60px -20px #14172230;
  --code-bg: #f3f4f8;
  --term-bg: #0d1117;
  --term-ink: #d6deeb;
  --radius: 16px;
  --radius-sm: 10px;
  --gradient: linear-gradient(120deg, #34d8a6, #5cb8ff 55%, #a78bfa);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #080a10;
    --bg-glow-1: #34d8a614;
    --bg-glow-2: #a78bfa14;
    --surface: #10131b;
    --surface-2: #151924;
    --surface-3: #1c2130;
    --sidebar: #0c0f16cc;
    --line: #ffffff0f;
    --line-strong: #ffffff1c;
    --ink: #eef1f8;
    --ink-2: #c3c9d8;
    --muted: #8b93a7;
    --accent: #3ee0ae;
    --accent-ink: #5cf0c1;
    --accent-soft: #3ee0ae17;
    --violet: #a78bfa;
    --violet-soft: #a78bfa1a;
    --good: #4ade80;
    --good-soft: #4ade8017;
    --warn: #fbbf24;
    --warn-soft: #fbbf2417;
    --bad: #f87171;
    --bad-soft: #f8717117;
    --primary-bg: #eef1f8;
    --primary-ink: #0b0d13;
    --shadow: 0 1px 0 #ffffff08 inset, 0 10px 30px -18px #000000cc;
    --shadow-lg: 0 30px 80px -30px #000000;
    --code-bg: #0b0e15;
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #080a10;
  --bg-glow-1: #34d8a614;
  --bg-glow-2: #a78bfa14;
  --surface: #10131b;
  --surface-2: #151924;
  --surface-3: #1c2130;
  --sidebar: #0c0f16cc;
  --line: #ffffff0f;
  --line-strong: #ffffff1c;
  --ink: #eef1f8;
  --ink-2: #c3c9d8;
  --muted: #8b93a7;
  --accent: #3ee0ae;
  --accent-ink: #5cf0c1;
  --accent-soft: #3ee0ae17;
  --violet: #a78bfa;
  --violet-soft: #a78bfa1a;
  --good: #4ade80;
  --good-soft: #4ade8017;
  --warn: #fbbf24;
  --warn-soft: #fbbf2417;
  --bad: #f87171;
  --bad-soft: #f8717117;
  --primary-bg: #eef1f8;
  --primary-ink: #0b0d13;
  --shadow: 0 1px 0 #ffffff08 inset, 0 10px 30px -18px #000000cc;
  --shadow-lg: 0 30px 80px -30px #000000;
  --code-bg: #0b0e15;
}

/* Base */
* {
  box-sizing: border-box;
}
html {
  background: var(--bg);
}
body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(900px 500px at 85% -10%, var(--bg-glow-2), transparent 60%),
    radial-gradient(800px 480px at 20% -15%, var(--bg-glow-1), transparent 60%),
    var(--bg);
  background-attachment: fixed;
  color: var(--ink);
  font:
    14px/1.55 -apple-system,
    BlinkMacSystemFont,
    "SF Pro Text",
    "Inter",
    "Segoe UI",
    sans-serif;
  -webkit-font-smoothing: antialiased;
  font-variant-numeric: tabular-nums;
}
::selection {
  background: var(--accent-soft);
}
.sprite {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}
.icon {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.logo {
  width: 28px;
  height: 28px;
  flex: 0 0 auto;
}
button,
input,
select {
  font: inherit;
}
button,
select {
  cursor: pointer;
}
button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 9px 15px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--ink);
  font-size: 13px;
  font-weight: 600;
  line-height: 1.3;
  transition:
    background 0.15s,
    border-color 0.15s,
    color 0.15s,
    transform 0.08s,
    box-shadow 0.15s;
}
button:hover {
  background: var(--surface-3);
}
button:active:not(:disabled) {
  transform: translateY(1px);
}
button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}
button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
summary:focus-visible,
.log-view:focus-visible {
  outline: 2px solid var(--violet);
  outline-offset: 2px;
}
input,
select {
  min-width: 0;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  padding: 9px 12px;
  color: var(--ink);
  font-size: 13px;
  transition:
    border-color 0.15s,
    box-shadow 0.15s,
    background 0.15s;
}
input::placeholder {
  color: var(--muted);
  opacity: 0.8;
}
input:focus,
select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
  background: var(--surface);
}
input {
  width: 100%;
}
input[type="checkbox"] {
  accent-color: var(--accent);
  width: 16px;
  height: 16px;
}
label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-2);
  margin: 14px 0 6px;
}
.primary {
  background: var(--primary-bg);
  color: var(--primary-ink);
  border-color: var(--primary-bg);
}
.primary:hover {
  background: var(--primary-bg);
  box-shadow: 0 6px 20px -8px var(--accent);
  opacity: 0.92;
}
.danger {
  background: var(--bad);
  border-color: var(--bad);
  color: #fff;
}
.danger:hover {
  background: var(--bad);
  opacity: 0.9;
}
.danger-text {
  color: var(--bad) !important;
}
.quiet {
  border-color: transparent;
  background: transparent;
  color: var(--muted);
}
.quiet:hover {
  background: var(--surface-3);
  color: var(--ink);
}
.muted {
  color: var(--muted);
}
.fine,
small {
  font-size: 12px;
}
.eyebrow {
  font-size: 10.5px;
  letter-spacing: 1.4px;
  font-weight: 700;
  color: var(--muted);
  margin: 0 0 10px;
  text-transform: uppercase;
}
h1,
h2,
h3,
p {
  margin-top: 0;
}
h1 {
  font-size: 34px;
  line-height: 1.15;
  letter-spacing: -1.2px;
  margin-bottom: 0;
  font-weight: 700;
}
h2 {
  font-size: 18px;
  letter-spacing: -0.3px;
  line-height: 1.35;
  margin-bottom: 6px;
  font-weight: 650;
}
h3 {
  font-size: 14px;
  font-weight: 650;
  margin-bottom: 6px;
}
.accent {
  background: var(--gradient);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.gradient-text {
  background: var(--gradient);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
[hidden] {
  display: none !important;
}
code {
  font:
    12px ui-monospace,
    SFMono-Regular,
    Menlo,
    monospace;
  background: var(--surface-3);
  padding: 2px 6px;
  border-radius: 6px;
}
pre {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font:
    12px/1.65 ui-monospace,
    SFMono-Regular,
    Menlo,
    monospace;
  background: var(--code-bg);
  border: 1px solid var(--line);
  color: var(--ink-2);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  max-height: 420px;
  overflow: auto;
}

/* Status dot */
.dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  background: var(--good);
  border-radius: 50%;
  margin-right: 8px;
  box-shadow: 0 0 0 3px var(--good-soft);
  vertical-align: 1px;
}

/* Sidebar */
aside {
  position: fixed;
  inset: 0 auto 0 0;
  width: 248px;
  padding: 26px 16px 20px;
  background: var(--sidebar);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  z-index: 10;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 10px;
  margin-bottom: 30px;
  font-size: 22px;
  letter-spacing: -0.8px;
  color: var(--ink);
  font-weight: 750;
  text-decoration: none;
}
nav {
  display: grid;
  gap: 2px;
}
.nav-label {
  font-size: 10px;
  letter-spacing: 1.3px;
  font-weight: 700;
  color: var(--muted);
  margin: 18px 12px 8px;
  opacity: 0.8;
}
.nav-label:first-child {
  margin-top: 0;
}
.nav {
  position: relative;
  justify-content: flex-start;
  text-align: left;
  border: 1px solid transparent;
  background: transparent;
  color: var(--muted);
  font-weight: 550;
  font-size: 13.5px;
  gap: 12px;
  padding: 9px 12px;
}
.nav:hover {
  background: var(--surface-3);
  color: var(--ink);
}
.nav.active {
  background: var(--surface);
  border-color: var(--line);
  color: var(--ink);
  box-shadow: var(--shadow);
}
.nav.active::before {
  content: "";
  position: absolute;
  left: -16px;
  top: 9px;
  bottom: 9px;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background: var(--gradient);
}
.nav.active .icon {
  color: var(--accent);
}
.sidebar-bottom {
  margin-top: auto;
  display: grid;
  gap: 12px;
  padding: 14px 10px 0;
  border-top: 1px solid var(--line);
}
.host {
  font-size: 12px;
  color: var(--muted);
}
.sidebar-actions {
  display: flex;
  gap: 6px;
  align-items: center;
}
.sidebar-actions #logout {
  flex: 1;
  justify-content: flex-start;
  padding: 8px 10px;
}
.icon-button {
  padding: 8px;
}

/* Main layout */
main {
  margin-left: 248px;
  padding: 36px 44px 24px;
  max-width: 1760px;
}
header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 20px;
  margin-bottom: 32px;
}
.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  padding: 7px 14px;
  background: var(--surface);
  color: var(--muted);
  white-space: nowrap;
  box-shadow: var(--shadow);
}
.pill.good {
  color: var(--good);
  border-color: color-mix(in srgb, var(--good) 35%, transparent);
  background: var(--good-soft);
}
.tab {
  animation: rise 0.25s ease-out;
}
@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(4px);
  }
}
@media (prefers-reduced-motion: reduce) {
  .tab {
    animation: none;
  }
  * {
    transition: none !important;
  }
}
.section-heading {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: flex-end;
  margin-bottom: 20px;
}
.section-heading p {
  margin-bottom: 0;
}
.section-heading > span {
  font-size: 12px;
  text-align: right;
}

/* Panels & stats */
.panel {
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: var(--radius);
  padding: 22px 24px;
  box-shadow: var(--shadow);
}
.panel.compact {
  padding: 12px 14px;
}
.summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin: 0 0 20px;
}
.summary:empty {
  display: none;
}
.stat {
  position: relative;
  padding: 18px 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
  overflow: hidden;
  min-width: 0;
}
.stat::after {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 2px;
  background: var(--gradient);
  opacity: 0;
  transition: opacity 0.2s;
}
.stat:hover::after {
  opacity: 0.9;
}
.stat small {
  color: var(--muted);
  display: block;
  margin-bottom: 6px;
  font-weight: 550;
}
.stat strong {
  display: block;
  font-weight: 700;
  font-size: 26px;
  letter-spacing: -0.8px;
  line-height: 1.2;
  overflow-wrap: anywhere;
}

/* Node cards */
.node-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}
.node-card {
  position: relative;
  padding: 22px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  min-width: 0;
  display: flex;
  flex-direction: column;
}
.node-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 3px;
  background: var(--gradient);
}
.node-card.offline::before {
  background: var(--bad);
  opacity: 0.6;
}
.node-card.offline {
  background:
    linear-gradient(var(--bad-soft), transparent 40%),
    var(--surface);
}
.node-top {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-bottom: 18px;
}
.node-title {
  flex: 1;
  min-width: 0;
}
.node-title h2 {
  margin: 0;
  font-size: 16px;
}
.machine-icon {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  background: var(--accent-soft);
  border: 1px solid color-mix(in srgb, var(--accent) 22%, transparent);
  border-radius: 12px;
  color: var(--accent);
  flex: 0 0 auto;
}
.machine-icon .icon {
  width: 22px;
  height: 22px;
}
.offline .machine-icon {
  background: var(--surface-3);
  border-color: var(--line);
  color: var(--muted);
}
.node-role {
  font-size: 12px;
  color: var(--muted);
  margin: 2px 0 0;
}
.node-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: -4px 0 14px;
}
.tag {
  font-size: 10.5px;
  font-weight: 650;
  letter-spacing: 0.3px;
  padding: 3px 8px;
  border-radius: 6px;
  background: var(--violet-soft);
  color: var(--violet);
}
.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 650;
  padding: 4px 10px 4px 8px;
  border-radius: 999px;
  background: var(--good-soft);
  color: var(--good);
  white-space: nowrap;
  flex: 0 0 auto;
}
.chip::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}
.chip.offline {
  background: var(--bad-soft);
  color: var(--bad);
}
.chip.paused {
  background: var(--violet-soft);
  color: var(--violet);
}
.chip.setup {
  background: var(--warn-soft);
  color: var(--warn);
}
.gauges {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 12px;
}
.gauge {
  padding: 11px 12px 12px;
  border-radius: 12px;
  background: var(--surface-2);
  border: 1px solid var(--line);
}
.gauge-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-size: 11.5px;
  color: var(--muted);
}
.gauge-head strong {
  font-size: 18px;
  color: var(--ink);
  letter-spacing: -0.4px;
}
.row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 7px 0;
  font-size: 12.5px;
  border-bottom: 1px dashed var(--line);
}
.row:last-child {
  border-bottom: 0;
}
.row span {
  color: var(--muted);
}
.row strong {
  font-weight: 600;
  text-align: right;
  min-width: 0;
  overflow-wrap: anywhere;
}
.row strong.good {
  color: var(--good);
}
.row strong.warn {
  color: var(--warn);
}
.row strong.bad {
  color: var(--bad);
}
.meter {
  height: 5px;
  border-radius: 9px;
  background: var(--surface-3);
  overflow: hidden;
  margin-top: 8px;
}
.meter i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--gradient);
  transition: width 0.4s ease;
}
.meter.warn i {
  background: var(--warn);
}
.meter.bad i {
  background: var(--bad);
}
.card-actions {
  display: flex;
  gap: 8px;
  margin-top: auto;
  padding-top: 16px;
}
.card-actions button {
  font-size: 12px;
  flex: 1;
  padding: 8px 6px;
}
.offline-note {
  padding: 18px;
  border-radius: 12px;
  background: var(--surface-2);
  border: 1px dashed var(--line-strong);
  margin-bottom: 16px;
}

/* Overview extras */
.bottom-grid {
  display: grid;
  grid-template-columns: 1.25fr 1fr;
  gap: 16px;
  margin-top: 16px;
}
.flow {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 20px;
  font-size: 13px;
  font-weight: 600;
}
.flow span {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  column-gap: 10px;
  padding: 11px 12px;
  border-radius: 12px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  flex: 1;
  min-width: 0;
}
.flow i {
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 7px;
  background: var(--gradient);
  color: #0b0d13;
  font-style: normal;
  font-size: 11px;
  font-weight: 750;
  grid-row: span 2;
}
.flow small {
  display: block;
  color: var(--muted);
  font-size: 11px;
  font-weight: 500;
}
.flow b {
  color: var(--muted);
  font-weight: 400;
}
.health-note {
  position: relative;
  padding: 11px 0 11px 20px;
  font-size: 12.5px;
  border-bottom: 1px solid var(--line);
}
.health-note:last-child {
  border: 0;
}
.health-note::before {
  content: "";
  position: absolute;
  left: 2px;
  top: 17px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--good);
  box-shadow: 0 0 0 3px var(--good-soft);
}
.health-note.warn::before {
  background: var(--warn);
  box-shadow: 0 0 0 3px var(--warn-soft);
}
.health-note.bad::before {
  background: var(--bad);
  box-shadow: 0 0 0 3px var(--bad-soft);
}
.health-note.paused::before {
  background: var(--violet);
  box-shadow: 0 0 0 3px var(--violet-soft);
}
.health-note strong {
  display: block;
  font-weight: 650;
}
.health-note span {
  color: var(--muted);
}

/* Toolbars */
.toolbar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
}
.toolbar label {
  margin: 0;
}
.toolbar input {
  flex: 1;
  min-width: 160px;
  width: auto;
}
.toolbar .muted {
  font-size: 12px;
  margin-left: auto;
}

/* Remote desktop */
.screen-wrap {
  background:
    radial-gradient(600px 300px at 50% 0%, #5cb8ff14, transparent 70%),
    #07090e;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  min-height: 440px;
  display: flex;
  justify-content: center;
  align-items: center;
  overflow: hidden;
  margin-bottom: 16px;
  position: relative;
  box-shadow: var(--shadow-lg);
}
#screen-placeholder {
  text-align: center;
  color: #8b93a7;
  padding: 50px;
}
#screen-placeholder h3 {
  color: #eef1f8;
  font-size: 17px;
}
#screen-placeholder .icon {
  width: 56px;
  height: 56px;
  stroke-width: 1.2;
  color: #5cb8ff;
  margin-bottom: 16px;
}
#screen {
  max-width: 100%;
  max-height: 75vh;
  object-fit: contain;
  display: block;
  touch-action: none;
  cursor: crosshair;
}
#screen:focus {
  outline: 2px solid var(--violet);
  outline-offset: -2px;
}

/* Management */
.manage-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr);
  gap: 16px;
  align-items: start;
}
.records {
  display: grid;
  gap: 6px;
}
.record {
  display: block;
  text-align: left;
  font-weight: 550;
  overflow-wrap: anywhere;
  background: var(--surface-2);
  border-color: var(--line);
  padding: 10px 14px;
}
.record:hover {
  border-color: var(--accent);
  background: var(--accent-soft);
}
.record.selected {
  border-color: var(--accent);
  background: var(--accent-soft);
  box-shadow: inset 3px 0 0 var(--accent);
}
.record small {
  display: block;
  color: var(--muted);
  font-weight: 450;
  margin-top: 2px;
}
#action,
#action-fields input {
  width: 100%;
}
#action-form > button {
  margin-top: 18px;
}
#action-form > .primary {
  width: 100%;
  padding: 11px;
}
#retry-action {
  width: 100%;
  margin-top: 8px !important;
}

/* Setup */
.setup-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
dl {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 12px 20px;
  margin: 20px 0;
  padding: 16px;
  border-radius: 12px;
  background: var(--surface-2);
  border: 1px solid var(--line);
}
dt {
  font-size: 12.5px;
  color: var(--muted);
}
dd {
  margin: 0;
  font-size: 12.5px;
}

footer {
  border-top: 1px solid var(--line);
  margin-top: 36px;
  padding: 18px 0 0;
  display: flex;
  justify-content: space-between;
  color: var(--muted);
  font-size: 11px;
}
#notice {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  border: 1px solid color-mix(in srgb, var(--violet) 30%, transparent);
  border-radius: 12px;
  background: var(--violet-soft);
  color: var(--ink-2);
  margin-bottom: 20px;
  font-size: 13px;
}
#notice::before {
  content: "i";
  display: grid;
  place-items: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--violet);
  color: var(--surface);
  font-size: 12px;
  font-weight: 800;
  font-family: Georgia, serif;
  flex: 0 0 auto;
}

/* Login */
.login {
  min-height: 100vh;
  display: grid;
  place-content: center;
  justify-items: center;
  position: relative;
  overflow: hidden;
  padding: 24px 16px;
}
.aurora-glow {
  position: absolute;
  inset: -20%;
  background:
    radial-gradient(40% 35% at 30% 30%, #34d8a633, transparent 70%),
    radial-gradient(35% 30% at 70% 25%, #5cb8ff2e, transparent 70%),
    radial-gradient(40% 35% at 60% 75%, #a78bfa2e, transparent 70%);
  filter: blur(40px);
  animation: drift 18s ease-in-out infinite alternate;
  pointer-events: none;
}
@keyframes drift {
  to {
    transform: translate3d(3%, -4%, 0) rotate(6deg);
  }
}
@media (prefers-reduced-motion: reduce) {
  .aurora-glow {
    animation: none;
  }
}
.login-card {
  position: relative;
  width: min(420px, 100%);
  background: color-mix(in srgb, var(--surface) 82%, transparent);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--line-strong);
  border-radius: 22px;
  padding: 40px;
  box-shadow: var(--shadow-lg);
}
.mark {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 22px;
  font-weight: 750;
  letter-spacing: -0.8px;
  margin-bottom: 30px;
}
.mark .logo {
  width: 34px;
  height: 34px;
}
.login h1 {
  font-size: 40px;
  line-height: 1.08;
  letter-spacing: -1.5px;
  margin-bottom: 12px;
}
.input-icon {
  position: relative;
}
.input-icon .icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted);
  pointer-events: none;
}
.input-icon input {
  padding: 12px 12px 12px 40px;
}
.login .primary {
  justify-content: space-between;
  width: 100%;
  margin-top: 14px;
  padding: 12px 16px;
  font-size: 14px;
}
.login-caption {
  position: relative;
  text-align: center;
  color: var(--muted);
  font-size: 12px;
  margin-top: 22px;
}
#login-error {
  font-size: 12.5px;
  color: var(--bad);
  margin: 12px 0 0;
}
#login-error:empty {
  display: none;
}

/* Dialog */
dialog {
  width: min(560px, calc(100vw - 32px));
  border: 1px solid var(--line-strong);
  border-radius: 20px;
  padding: 26px;
  background: var(--surface);
  color: var(--ink);
  box-shadow: var(--shadow-lg);
}
dialog::backdrop {
  background: #05070bb3;
  backdrop-filter: blur(4px);
}
.dialog-actions {
  justify-content: flex-end;
  margin: 18px 0 0;
}

/* Fleet activity and diagnostics */
.services-panel {
  margin-top: 16px;
}
.service-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}
.service-node {
  min-width: 0;
  padding: 14px 16px;
  border-radius: 12px;
  background: var(--surface-2);
  border: 1px solid var(--line);
}
.service-node h3 {
  margin-bottom: 2px;
}
.service-node .row {
  font-size: 12px;
}
.filter-grid {
  display: grid;
  grid-template-columns: minmax(180px, 2fr) repeat(3, minmax(115px, 1fr)) auto;
  gap: 12px;
  align-items: end;
  margin-bottom: 16px;
}
.filter-grid.panel {
  padding: 16px;
}
.filter-grid label {
  margin: 0;
  font-size: 11.5px;
  color: var(--muted);
}
.filter-grid input,
.filter-grid select {
  display: block;
  width: 100%;
  margin-top: 6px;
}
.logs-filters {
  grid-template-columns: 1fr 1.5fr 1fr 1.5fr;
}
.activity-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}
.request-panel {
  padding: 10px;
}
.request-list {
  display: grid;
  gap: 6px;
  max-height: 760px;
  overflow: auto;
  padding: 2px;
}
.request-item {
  display: block;
  text-align: left;
  font-weight: 400;
  padding: 13px 15px;
  min-width: 0;
  background: var(--surface-2);
  border-color: var(--line);
}
.request-item:hover {
  border-color: var(--line-strong);
}
.request-item.selected {
  border-color: var(--accent);
  background: var(--accent-soft);
  box-shadow: inset 3px 0 0 var(--accent);
}
.request-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
}
.request-top strong {
  font-size: 13.5px;
}
.request-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 3px 12px;
  font-size: 11px;
  color: var(--muted);
  margin-bottom: 6px;
}
.request-item code {
  display: block;
  font-size: 11px;
  overflow-wrap: anywhere;
  background: transparent;
  padding: 0;
  color: var(--ink-2);
}
.request-item small {
  color: var(--muted);
  font-size: 11px;
  display: block;
  margin-top: 6px;
}
.status-label {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  font-weight: 650;
  padding: 3px 9px;
  border-radius: 999px;
  background: var(--surface-3);
  color: var(--muted);
  flex-shrink: 0;
}
.status-label::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}
.status-label.good {
  background: var(--good-soft);
  color: var(--good);
}
.status-label.bad {
  background: var(--bad-soft);
  color: var(--bad);
}
.status-label.waiting {
  background: var(--warn-soft);
  color: var(--warn);
}
.request-inspector {
  min-width: 0;
  position: sticky;
  top: 20px;
}
.request-inspector h2 {
  overflow-wrap: anywhere;
  font-size: 16px;
}
.request-inspector pre {
  max-height: 350px;
}
.request-inspector h3 {
  margin-top: 20px;
  font-size: 11px;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: var(--muted);
}
#request-timeline {
  padding: 4px 14px;
  border-radius: 12px;
  background: var(--surface-2);
  border: 1px solid var(--line);
}
#request-timeline:empty {
  display: none;
}
.request-inspector details {
  margin: 14px 0;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
}
.request-inspector details pre {
  margin: 10px 0 0;
}
.request-inspector summary {
  cursor: pointer;
  font-size: 12.5px;
  font-weight: 600;
}
#request-timeline .row {
  font-size: 12px;
}
.pagination {
  margin: 12px 4px 4px;
}
.pagination button {
  font-size: 12px;
}
.empty-state {
  padding: 32px 24px;
  color: var(--muted);
  text-align: center;
}
.log-view {
  background: var(--term-bg);
  color: var(--term-ink);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  height: 65vh;
  min-height: 350px;
  overflow: auto;
  padding: 12px 0;
  box-shadow: var(--shadow-lg);
  font:
    11.5px/1.75 ui-monospace,
    SFMono-Regular,
    Menlo,
    monospace;
}
.log-line {
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr);
  padding: 1px 16px;
  gap: 12px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  border-left: 2px solid transparent;
}
.log-line:hover {
  background: #ffffff08;
}
.log-line.warning {
  color: #f5d38a;
  border-left-color: #fbbf24;
}
.log-line.error,
.log-line.critical {
  color: #ffb4a8;
  background: #f871710f;
  border-left-color: #f87171;
}
.log-node {
  color: #5cb8ff;
  user-select: none;
}
.log-view .empty-state {
  color: #8b93a7;
}
.inline-label {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 12.5px;
  font-weight: 500;
}
.inline-label input {
  width: auto;
  min-width: 0;
  flex: 0 0 auto;
}
#logs-nodes {
  overflow-wrap: anywhere;
}
.table-scroll {
  overflow-x: auto;
  margin: 0 -8px;
}
.usage-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 12.5px;
}
.usage-table th {
  font-size: 11px;
  font-weight: 650;
  letter-spacing: 0.4px;
  color: var(--muted);
  white-space: nowrap;
  background: var(--surface-2);
}
.usage-table th:first-child {
  border-radius: 8px 0 0 8px;
}
.usage-table th:last-child {
  border-radius: 0 8px 8px 0;
}
.usage-table th,
.usage-table td {
  padding: 11px 12px;
}
.usage-table td {
  border-bottom: 1px solid var(--line);
}
.usage-table tbody tr:hover td {
  background: var(--surface-2);
}
.usage-table tr:last-child td {
  border-bottom: 0;
}
.usage-table td:first-child {
  overflow-wrap: anywhere;
  min-width: 110px;
  font-weight: 600;
}
.usage-table button {
  padding: 5px 10px;
  font-size: 12px;
}
#activity-filters {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
#usage .panel {
  min-width: 0;
}
#usage .summary strong {
  font-size: 22px;
}

/* Responsive */
@media (min-width: 1500px) {
  main {
    padding: 44px 64px 28px;
  }
}
@media (max-width: 1200px) {
  .filter-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .filter-grid button {
    justify-self: start;
  }
  .activity-grid {
    grid-template-columns: 1fr;
  }
  .request-inspector {
    position: static;
  }
  .request-list {
    max-height: 480px;
  }
  .node-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (max-width: 1100px) {
  aside {
    width: 212px;
  }
  main {
    margin-left: 212px;
    padding: 30px 26px;
  }
  .bottom-grid {
    grid-template-columns: 1fr;
  }
  .summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .service-grid {
    grid-template-columns: 1fr;
  }
}
@media (max-width: 800px) {
  aside {
    position: sticky;
    top: 0;
    width: auto;
    padding: 12px 16px 8px;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }
  .brand {
    margin: 0;
    padding: 0;
    font-size: 19px;
  }
  .brand .logo {
    width: 24px;
    height: 24px;
  }
  aside nav {
    order: 3;
    width: 100%;
    display: flex;
    gap: 2px;
    justify-content: space-between;
  }
  .nav-label {
    display: none;
  }
  aside .nav {
    padding: 9px 10px;
    flex: 1;
    justify-content: center;
  }
  aside .nav span {
    display: none;
  }
  .nav.active::before {
    left: 20%;
    right: 20%;
    top: auto;
    bottom: -9px;
    width: auto;
    height: 2px;
    border-radius: 2px;
  }
  aside .sidebar-bottom {
    margin: 0 0 0 auto;
    padding: 0;
    border: 0;
  }
  aside .sidebar-bottom .host {
    display: none;
  }
  .sidebar-actions #logout {
    padding: 7px 10px;
    font-size: 12px;
  }
  main {
    margin: 0;
    padding: 22px 16px;
  }
  header {
    margin-bottom: 22px;
    align-items: flex-start;
    flex-direction: column;
    gap: 12px;
  }
  h1 {
    font-size: 28px;
  }
  .node-grid,
  .manage-grid,
  .setup-grid {
    grid-template-columns: 1fr;
  }
  .summary {
    gap: 10px;
  }
  .stat {
    padding: 14px 16px;
  }
  .stat strong {
    font-size: 21px;
  }
  .section-heading {
    align-items: start;
  }
  .section-heading > span {
    display: none;
  }
  .flow {
    flex-direction: column;
    align-items: stretch;
  }
  .flow b {
    text-align: center;
    transform: rotate(90deg);
  }
  .screen-wrap {
    min-height: 260px;
  }
  .toolbar select {
    max-width: 100%;
  }
  .toolbar button {
    font-size: 12px;
    padding: 8px 11px;
  }
  footer span:last-child {
    display: none;
  }
  .filter-grid {
    gap: 10px;
  }
  .filter-grid label:first-child {
    grid-column: 1/-1;
  }
  .logs-filters label:last-child {
    grid-column: 1/-1;
  }
  #activity-filters {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .log-line {
    padding: 2px 9px;
    grid-template-columns: 38px minmax(0, 1fr);
    gap: 7px;
    font-size: 10.5px;
  }
  .request-inspector,
  .panel {
    padding: 16px;
  }
  #activity-state,
  #logs-state {
    display: block;
  }
  #usage-filters input {
    width: 100%;
  }
  .login-card {
    padding: 28px 22px;
  }
  .login h1 {
    font-size: 34px;
  }
}
