/* ---- self-hosted fonts (no external requests) ---- */
@font-face {
  font-family: 'Barlow';
  src: url('/static/fonts/Barlow-Regular.woff2') format('woff2');
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: 'Barlow';
  src: url('/static/fonts/Barlow-Medium.woff2') format('woff2');
  font-weight: 500;
  font-display: swap;
}
@font-face {
  font-family: 'Barlow';
  src: url('/static/fonts/Barlow-SemiBold.woff2') format('woff2');
  font-weight: 600;
  font-display: swap;
}
@font-face {
  font-family: 'Barlow Condensed';
  src: url('/static/fonts/BarlowCondensed-SemiBold.woff2') format('woff2');
  font-weight: 600;
  font-display: swap;
}
@font-face {
  font-family: 'Barlow Condensed';
  src: url('/static/fonts/BarlowCondensed-Bold.woff2') format('woff2');
  font-weight: 700;
  font-display: swap;
}
@font-face {
  font-family: 'JetBrains Mono';
  src: url('/static/fonts/JetBrainsMono-Regular.woff2') format('woff2');
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: 'JetBrains Mono';
  src: url('/static/fonts/JetBrainsMono-Medium.woff2') format('woff2');
  font-weight: 500;
  font-display: swap;
}
@font-face {
  font-family: 'JetBrains Mono';
  src: url('/static/fonts/JetBrainsMono-Bold.woff2') format('woff2');
  font-weight: 700;
  font-display: swap;
}
:root {
  --bg: #0a0a0d;
  --panel: #131318;
  --panel2: #1a1a21;
  --panel3: #24242e;
  --line: #2a2a36;
  --line2: #383846;
  --ink: #f2f3f7;
  --mut: #9298a8;
  --copper: #f20d12;
  --copper-hi: #ff4d4d;
  --copper-deep: #ae0408;
  --ok: #3dd68c;
  --ok-deep: #1f8f5a;
  --err: #f2555a;
  --err-deep: #c0353a;
  --blue: #5b9dff;
  --cyan: #4fd8db;
  --shp: 91, 157, 255;
  --shs: 61, 214, 140;
  --shc: 240, 0, 0;
  --she: 242, 85, 90;
  --ff-d: 'Barlow Condensed', 'Barlow', 'Segoe UI', system-ui, sans-serif;
  --ff-b: 'Barlow', 'Segoe UI', system-ui, sans-serif;
  --ff-m: 'JetBrains Mono', 'Cascadia Mono', Consolas, monospace;
  --rad: 12px;
  --rad-s: 8px;
}
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}
::selection {
  background: rgba(var(--shc), 0.28);
  color: #fff;
}
body {
  font: 1rem/1.45 var(--ff-d);
  color: var(--ink);
  min-height: 100vh;
  background: radial-gradient(1100px 520px at 85% -10%, rgba(var(--shc), 0.07), transparent 60%), radial-gradient(900px 600px at -10% 110%, rgba(var(--shp), 0.05), transparent 55%), var(--bg);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
}
body::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background-image: linear-gradient(rgba(255, 255, 255, 0.022) 1px, transparent 1px), linear-gradient(90deg, rgba(255, 255, 255, 0.022) 1px, transparent 1px);
  background-size: 44px 44px;
  -webkit-mask-image: radial-gradient(ellipse at 50% 0%, #000 30%, transparent 80%);
  mask-image: radial-gradient(ellipse at 50% 0%, #000 30%, transparent 80%);
}
.wrap {
  position: relative;
  z-index: 1;
  max-width: 1320px;
  margin: 0 auto;
  padding: 28px 20px 90px;
}

/* HEADER */
.hdr {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  background: linear-gradient(180deg, var(--panel2), var(--panel));
  border: 1px solid var(--line);
  border-radius: var(--rad);
  padding: 20px 26px;
  margin-bottom: 24px;
  position: relative;
  overflow: hidden;
}
.hdr::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, rgba(var(--shc), 0) 15%, rgba(var(--shc), 0.85) 50%, rgba(var(--shc), 0) 85%, transparent);
  background-size: 200% 100%;
  opacity: 0.55;
  animation: bus 7s linear infinite;
}
@keyframes bus {
  0% {
    background-position: 200% 0;
  }
  100% {
    background-position: -200% 0;
  }
}
.brand {
  display: flex;
  align-items: center;
  gap: 14px;
}
.brand .tick {
  width: 6px;
  height: 34px;
  border-radius: 3px;
  background: linear-gradient(180deg, var(--copper-hi), var(--copper-deep));
  box-shadow: 0 0 12px rgba(var(--shc), 0.6);
  animation: glow 2.8s ease-in-out infinite;
}
@keyframes glow {
  0%,
  100% {
    box-shadow: 0 0 6px rgba(var(--shc), 0.35);
  }
  50% {
    box-shadow: 0 0 16px rgba(var(--shc), 0.85);
  }
}
h1 {
  font: 700 1.5rem/1.1 var(--ff-d);
  letter-spacing: -0.02em;
}
.sub {
  font-family: var(--ff-m);
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--mut);
  margin-top: 3px;
}
.hbadges {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}
.badge {
  font-family: var(--ff-m);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid var(--line2);
  background: var(--panel3);
  text-transform: uppercase;
}
.badge.real {
  color: var(--ok);
  border-color: rgba(var(--shs), 0.5);
}
.badge.sim {
  color: var(--copper-hi);
  border-color: rgba(var(--shc), 0.5);
}
.dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-right: 6px;
  vertical-align: middle;
}
.dot.on {
  background: var(--ok);
  box-shadow: 0 0 8px var(--ok);
}
.dot.off {
  background: var(--err);
  box-shadow: 0 0 8px var(--err);
}

/* SECTION TITLES */
.cgt {
  color: var(--copper);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin: 0 0 16px;
  display: flex;
  align-items: center;
  gap: 14px;
}
.cgt .ico {
  font-size: 0.95rem;
  line-height: 1;
}
.cgt::after {
  content: '';
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, var(--line2), transparent);
}
.cgt .tools {
  display: flex;
  gap: 8px;
  margin-left: auto;
}

/* PANELS */
.panel {
  background: linear-gradient(180deg, var(--panel2), var(--panel));
  border: 1px solid var(--line);
  border-radius: var(--rad);
  padding: 22px 26px;
  margin-bottom: 26px;
  position: relative;
  overflow: hidden;
}
.panel::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, rgba(var(--shc), 0.6) 50%, transparent);
  opacity: 0.4;
}
.ctlgrid {
  display: grid;
  grid-template-columns: 1.1fr 1.5fr auto;
  gap: 26px;
  align-items: start;
}
@media (max-width: 900px) {
  .ctlgrid {
    grid-template-columns: 1fr;
  }
}
.lbl {
  display: block;
  font-weight: 600;
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--mut);
  margin-bottom: 10px;
}
.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.chip {
  font-family: var(--ff-m);
  font-size: 0.78rem;
  padding: 8px 12px;
  border-radius: var(--rad-s);
  border: 1px solid var(--line2);
  background: var(--panel3);
  color: var(--ink);
  cursor: pointer;
  transition: 0.15s;
  user-select: none;
  display: flex;
  align-items: center;
  gap: 8px;
}
.chip:hover {
  border-color: rgba(var(--shc), 0.5);
  transform: translateY(-1px);
}
.chip.on {
  background: linear-gradient(180deg, var(--copper), var(--copper-deep));
  border-color: var(--copper);
  color: #fff;
  box-shadow: 0 2px 10px rgba(var(--shc), 0.3);
}
.chip small {
  opacity: 0.7;
  font-size: 0.66rem;
}
.chip .swatch {
  width: 9px;
  height: 9px;
  border-radius: 2px;
  flex: none;
}
.durrow {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 4px;
}
.durrow input[type='range'] {
  flex: 1;
  accent-color: var(--copper);
}
.durval {
  font-family: var(--ff-m);
  font-weight: 600;
  min-width: 56px;
  text-align: right;
}
.btns {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 160px;
}
.btn {
  font-family: var(--ff-d);
  font-weight: 600;
  font-size: 0.92rem;
  padding: 12px 18px;
  border-radius: var(--rad-s);
  border: 1px solid var(--line2);
  background: var(--panel3);
  color: var(--ink);
  cursor: pointer;
  transition: 0.15s;
  letter-spacing: 0.02em;
}
.btn:hover:not(:disabled) {
  transform: translateY(-1px);
  border-color: rgba(var(--shc), 0.5);
}
.btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}
.btn.start {
  background: linear-gradient(180deg, var(--ok), var(--ok-deep));
  border-color: var(--ok);
  color: #06231a;
}
.btn.stop {
  background: linear-gradient(180deg, var(--err), var(--err-deep));
  border-color: var(--err);
  color: #fff;
}
.btn.sm {
  padding: 7px 13px;
  font-size: 0.78rem;
  font-family: var(--ff-m);
}
.btn.dl {
  background: var(--panel3);
}
.btn.dl:hover {
  border-color: rgba(var(--shp), 0.6);
}

/* GPU CARDS */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 18px;
  margin-bottom: 34px;
}
.gcard {
  background: linear-gradient(180deg, var(--panel2), var(--panel));
  border: 1px solid var(--line);
  border-radius: var(--rad);
  padding: 18px 20px;
  position: relative;
  overflow: hidden;
  transition: 0.2s;
}
.gcard.testing {
  box-shadow:
    0 0 0 1px rgba(var(--shc), 0.15),
    0 10px 28px rgba(0, 0, 0, 0.5);
}
.gcard::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 3px;
  background: var(--gpuc, var(--line2));
  opacity: 0.85;
}
.gcard.testing::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, transparent, #fff6 50%, transparent);
  background-size: 200% 100%;
  animation: bus 2.2s linear infinite;
  z-index: 1;
}
.gtop {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 6px;
}
.gname {
  font-weight: 700;
  font-size: 1rem;
  line-height: 1.2;
  display: flex;
  align-items: center;
  gap: 8px;
}
.gname .gdotc {
  width: 10px;
  height: 10px;
  border-radius: 3px;
  background: var(--gpuc);
  flex: none;
}
.gidx {
  font-family: var(--ff-m);
  font-size: 0.66rem;
  color: var(--mut);
  letter-spacing: 0.1em;
  margin-top: 2px;
}
.stbadge {
  font-family: var(--ff-m);
  font-size: 0.62rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 4px 9px;
  border-radius: 999px;
  border: 1px solid var(--line2);
  white-space: nowrap;
}
.stbadge.idle {
  color: var(--mut);
}
.stbadge.testing {
  color: var(--copper-hi);
  border-color: rgba(var(--shc), 0.5);
}
.stbadge.done {
  color: var(--ok);
  border-color: rgba(var(--shs), 0.5);
}
.stbadge.error {
  color: var(--err);
  border-color: rgba(var(--she), 0.5);
}
.gname-wrap {
  min-width: 0;
}
/* hero: animated util ring + temp/VRAM/power */
.ghero {
  display: flex;
  gap: 18px;
  align-items: center;
  margin: 14px 0 4px;
}
.gring-wrap {
  flex: none;
  text-align: center;
}
.gring {
  --gp: 0;
  width: 104px;
  height: 104px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  position: relative;
  background: conic-gradient(var(--gpuc, var(--blue)) calc(var(--gp) * 3.6deg), var(--panel3) 0deg);
  transition: --gp 0.6s cubic-bezier(0.22, 1, 0.36, 1);
}
.gring::before {
  content: '';
  position: absolute;
  inset: 9px;
  border-radius: 50%;
  background: var(--panel);
}
.gring::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 50%;
  box-shadow: 0 0 18px -2px var(--gpuc, transparent);
  opacity: 0.35;
  pointer-events: none;
}
.gring-v {
  position: relative;
  z-index: 1;
  font: 700 1.8rem var(--ff-m);
  font-variant-numeric: tabular-nums;
  color: var(--ink);
}
.gring-v small {
  font-size: 0.85rem;
  color: var(--mut);
}
.gring-cap {
  margin-top: 8px;
  font: 600 0.6rem var(--ff-m);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--mut);
}
.ghero-side {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 11px;
}
.gtemp {
  display: flex;
  align-items: baseline;
  gap: 9px;
}
.gtemp-v {
  font: 700 1.85rem var(--ff-d);
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
.gtemp-k {
  font: 600 0.6rem var(--ff-m);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--mut);
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.gmetric {
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.gm-top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  font-family: var(--ff-m);
}
.gm-top span {
  font-size: 0.6rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--mut);
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.gm-top b {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--ink);
}
.gm-bar {
  height: 6px;
  border-radius: 3px;
  background: var(--panel3);
  overflow: hidden;
}
.gm-bar > i {
  display: block;
  height: 100%;
  width: 0;
  border-radius: 3px;
  transition: width 0.5s cubic-bezier(0.22, 1, 0.36, 1);
}
/* live benchmark block — only while a test runs */
.glive {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}
.glive-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}
.glive-k {
  font: 0.7rem var(--ff-m);
  color: var(--copper-hi);
  letter-spacing: 0.03em;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.glive-v {
  font-family: var(--ff-m);
  white-space: nowrap;
}
.glive-v b {
  font-weight: 600;
  font-size: 1.5rem;
  letter-spacing: -0.02em;
}
.glive-v small {
  font-size: 0.75rem;
  color: var(--mut);
  margin-left: 3px;
}
.chartbox {
  position: relative;
  margin: 8px 0 10px;
}
.chartbox canvas {
  width: 100%;
  height: 70px;
  display: block;
}
.chartbox .peak {
  position: absolute;
  top: 2px;
  right: 4px;
  font: 0.62rem var(--ff-m);
  color: var(--mut);
}
.prog {
  height: 5px;
  border-radius: 3px;
  background: var(--panel3);
  overflow: hidden;
  margin-bottom: 10px;
}
.prog > i {
  display: block;
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, var(--copper-deep), var(--copper-hi));
  transition: width 0.25s;
}
/* compact secondary stats row */
.gstats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-top: 14px;
  padding-top: 13px;
  border-top: 1px solid var(--line);
}
.gstat {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.gstat .k {
  font: 0.56rem var(--ff-m);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--mut);
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.gstat b {
  font: 600 0.86rem var(--ff-m);
  color: var(--ink);
}
/* inline icons */
svg.ic {
  width: 1em;
  height: 1em;
  vertical-align: -2px;
  flex: none;
}
.cgt svg.ic {
  width: 1.05em;
  height: 1.05em;
  vertical-align: -3px;
}
.stat .k svg.ic {
  width: 0.85em;
  height: 0.85em;
  opacity: 0.7;
  margin-right: 3px;
}
/* PCIe strip */
.pcie {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
  font-family: var(--ff-m);
  font-size: 0.74rem;
  color: var(--mut);
}
.pcie .pl {
  display: flex;
  align-items: center;
  gap: 5px;
  color: var(--mut);
}
.pcie .pv {
  font-weight: 600;
  color: var(--ink);
  letter-spacing: 0.02em;
}
.pcie .pv.warn {
  color: var(--copper-hi);
}
.pcie .io {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-left: auto;
}
.pcie .io b {
  color: var(--ink);
  font-weight: 600;
}
.pcie .io.rx svg {
  color: var(--cyan);
}
.pcie .io.tx svg {
  color: var(--blue);
}

/* RESULTS BY TEST */
.testgrid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
  gap: 18px;
  margin-bottom: 34px;
}
.tpanel {
  background: linear-gradient(180deg, var(--panel2), var(--panel));
  border: 1px solid var(--line);
  border-radius: var(--rad);
  padding: 18px 20px;
}
.tpanel h4 {
  font-size: 0.95rem;
  font-weight: 700;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 4px;
}
.tpanel h4 .un {
  font-family: var(--ff-m);
  font-size: 0.7rem;
  color: var(--mut);
  font-weight: 600;
  letter-spacing: 0.06em;
}
.tpanel .desc {
  font-size: 0.74rem;
  color: var(--mut);
  margin-bottom: 12px;
}
.tpanel canvas {
  width: 100%;
  display: block;
}
.noresults {
  color: var(--mut);
  font-size: 0.86rem;
  padding: 24px;
  text-align: center;
  border: 1px dashed var(--line2);
  border-radius: var(--rad);
  background: rgba(255, 255, 255, 0.01);
}

/* TABLE */
.tbw {
  border: 1px solid var(--line);
  border-radius: var(--rad);
  overflow: hidden;
  overflow-x: auto;
}
table {
  width: 100%;
  border-collapse: collapse;
  min-width: 640px;
}
thead th {
  font-family: var(--ff-m);
  font-size: 0.64rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--mut);
  text-align: left;
  padding: 13px 16px;
  background: var(--panel2);
  border-bottom: 1px solid var(--line);
}
tbody td {
  padding: 12px 16px;
  font-size: 0.86rem;
  border-bottom: 1px solid var(--line);
  font-family: var(--ff-m);
}
tbody tr:last-child td {
  border-bottom: none;
}
tbody tr:hover {
  background: rgba(255, 255, 255, 0.02);
}
td.gpucell {
  display: flex;
  align-items: center;
  gap: 8px;
}
td.gpucell .sw {
  width: 9px;
  height: 9px;
  border-radius: 2px;
  flex: none;
}
td.res {
  font-weight: 600;
}
.empty {
  padding: 26px;
  text-align: center;
  color: var(--mut);
  font-size: 0.86rem;
}

/* TOAST */
.toast {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--panel3);
  border: 1px solid var(--line2);
  border-radius: 999px;
  padding: 11px 20px;
  font-family: var(--ff-m);
  font-size: 0.8rem;
  color: var(--ink);
  opacity: 0;
  transition: 0.3s;
  z-index: 50;
  pointer-events: none;
}
.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}
/* ---- fleet totals strip ---- */
.totals {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(155px, 1fr));
  gap: 12px;
  margin: 4px 0 20px;
}
.tstat {
  position: relative;
  background: linear-gradient(165deg, var(--panel2), var(--panel));
  border: 1px solid var(--line);
  border-radius: var(--rad);
  padding: 14px 15px 15px;
  overflow: hidden;
  transition:
    transform 0.18s ease,
    border-color 0.18s ease;
}
.tstat:hover {
  transform: translateY(-2px);
  border-color: color-mix(in srgb, var(--accent, var(--blue)) 45%, var(--line));
}
.tstat::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: var(--accent, var(--blue));
  opacity: 0.9;
}
.tstat::after {
  content: '';
  position: absolute;
  top: -40%;
  right: -30%;
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: var(--accent, var(--blue));
  opacity: 0.06;
  pointer-events: none;
}
.tstat .tlbl {
  font: 600 10px/1 var(--ff-m);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--mut);
}
.tstat .tval {
  margin-top: 10px;
  font: 700 23px/1 var(--ff-d);
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}
.tstat .tval small {
  font-size: 12px;
  font-weight: 600;
  color: var(--mut);
}
.tstat .tsub {
  margin-top: 5px;
  font: 600 11px/1.2 var(--ff-m);
  color: var(--mut);
}
.tstat .tbar {
  margin-top: 8px;
  height: 5px;
  border-radius: 3px;
  background: var(--panel3);
  overflow: hidden;
}
.tstat .tbar > i {
  display: block;
  height: 100%;
  width: 0;
  background: var(--accent, var(--blue));
  transition: width 0.4s ease;
}
.tstat.faulty {
  --accent: var(--err);
}
.tstat.faulty .tval {
  color: var(--err);
}

/* ===== TABS / VIEWS ===== */
.tabs {
  display: flex;
  gap: 6px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 4px;
}
.tab {
  font: 600 0.86rem var(--ff-d);
  color: var(--mut);
  background: transparent;
  border: none;
  padding: 8px 18px;
  border-radius: 999px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 7px;
  transition: 0.15s;
}
.tab:hover {
  color: var(--ink);
}
.tab.on {
  color: #fff;
  background: linear-gradient(180deg, var(--copper), var(--copper-deep));
  box-shadow: 0 2px 10px rgba(var(--shc), 0.3);
}
.view[hidden] {
  display: none;
}

/* ===== SYSTEM ROW (CPU / RAM / DISPLAY) ===== */
.sysrow {
  display: grid;
  grid-template-columns: 1.3fr 1fr 1fr;
  gap: 18px;
  margin-bottom: 34px;
}
@media (max-width: 1040px) {
  .sysrow {
    grid-template-columns: 1fr;
  }
}
.bigpanel {
  background: linear-gradient(180deg, var(--panel2), var(--panel));
  border: 1px solid var(--line);
  border-radius: var(--rad);
  padding: 20px 22px;
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.bigpanel::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 3px;
  opacity: 0.85;
}
.bigpanel.cpu::after {
  background: var(--blue);
}
.bigpanel.ram::after {
  background: var(--cyan);
}
.bigpanel.disp::after {
  background: var(--copper);
}

/* CPU + RAM two-up in the Monitor view */
.sysrow.two {
  grid-template-columns: 1fr 1fr;
}
@media (max-width: 900px) {
  .sysrow.two {
    grid-template-columns: 1fr;
  }
}

/* Display gets its own full-width section, laid out horizontally */
.disprow {
  margin-bottom: 34px;
}
.bigpanel.disp.wide {
  flex-direction: row;
  align-items: stretch;
  gap: 28px;
  flex-wrap: wrap;
}
.disp.wide .disp-main {
  flex: 1 1 360px;
  min-width: 0;
  display: flex;
  flex-direction: column;
}
.disp.wide .disphint {
  max-width: 640px;
}
.disp.wide .disp-actions {
  flex: 0 0 290px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 10px;
}
.disp.wide .dispbtns {
  margin-top: 0;
}
@media (max-width: 760px) {
  .bigpanel.disp.wide {
    flex-direction: column;
  }
  .disp.wide .disp-actions {
    flex-basis: auto;
  }
}

/* Combined CPU + RAM block (Test view live monitor) */
.bigpanel.combo {
  flex-direction: row;
  gap: 0;
  padding: 0;
  margin-bottom: 22px;
}
.bigpanel.combo::after {
  background: linear-gradient(90deg, var(--blue), var(--cyan));
  opacity: 0.9;
}
.combo-half {
  flex: 1 1 0;
  min-width: 0;
  padding: 20px 22px;
  display: flex;
  flex-direction: column;
}
.combo-div {
  width: 1px;
  background: var(--line);
  align-self: stretch;
  flex: 0 0 1px;
}
@media (max-width: 820px) {
  .bigpanel.combo {
    flex-direction: column;
  }
  .combo-div {
    width: auto;
    height: 1px;
    flex-basis: 1px;
  }
}
.bp-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
}
.bp-title {
  font: 700 1.05rem var(--ff-d);
  display: flex;
  align-items: center;
  gap: 9px;
}
.cpu .bp-title,
.sys-cpu .bp-title {
  color: var(--blue);
}
.ram .bp-title,
.sys-ram .bp-title {
  color: var(--cyan);
}
.disp .bp-title {
  color: var(--copper-hi);
}
.bp-name {
  font: 600 0.72rem var(--ff-m);
  color: var(--mut);
  text-align: right;
  max-width: 55%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.bp-body {
  display: flex;
  gap: 22px;
  align-items: center;
}
/* CPU ring */
.bp-ring {
  text-align: center;
  flex: none;
}
.ring {
  width: 118px;
  height: 118px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: conic-gradient(var(--blue) 0deg, var(--panel3) 0deg);
  position: relative;
}
.ring::before {
  content: '';
  position: absolute;
  inset: 10px;
  border-radius: 50%;
  background: var(--panel);
}
.ringv {
  position: relative;
  font: 700 1.9rem var(--ff-m);
  font-variant-numeric: tabular-nums;
  z-index: 1;
}
.ringv small {
  font-size: 0.9rem;
  color: var(--mut);
}
.ring-cap {
  margin-top: 8px;
  font: 600 0.6rem var(--ff-m);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--mut);
}
.bp-side {
  flex: 1;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px 14px;
}
.kv {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  font-family: var(--ff-m);
  font-size: 0.78rem;
  border-bottom: 1px solid var(--line);
  padding-bottom: 5px;
}
.kv span {
  color: var(--mut);
}
.kv b {
  font-weight: 600;
}
.kv.swap {
  border: none;
  margin-top: 10px;
  padding-bottom: 0;
}
/* core grid */
.cores {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(26px, 1fr));
  gap: 4px;
  margin-top: 16px;
}
.core {
  height: 26px;
  border-radius: 4px;
  background: var(--panel3);
  position: relative;
  overflow: hidden;
}
.core > i {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(180deg, var(--blue), #2f6fd6);
  transition:
    height 0.3s,
    background 0.3s;
}
.core.hot > i {
  background: linear-gradient(180deg, var(--copper-hi), var(--copper-deep));
}
.bp-spark {
  margin-top: auto;
  padding-top: 14px;
}
.bp-spark canvas {
  width: 100%;
  height: 60px;
  display: block;
}
/* RAM */
.ram-body {
  display: block;
}
.ram-big {
  display: flex;
  align-items: baseline;
  gap: 8px;
}
.ram-big .v {
  font: 700 2.4rem var(--ff-m);
  font-variant-numeric: tabular-nums;
  color: var(--cyan);
}
.ram-big .u {
  font: 600 0.9rem var(--ff-m);
  color: var(--mut);
}
.meter {
  height: 12px;
  border-radius: 6px;
  background: var(--panel3);
  overflow: hidden;
  margin: 12px 0 6px;
}
.meter.sm {
  height: 7px;
  margin: 6px 0 0;
}
.meter > i {
  display: block;
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, #2aa7aa, var(--cyan));
  transition: width 0.4s;
}
.meter.sm > i {
  background: linear-gradient(90deg, #7d5bd0, #a883ff);
}
.ram-sub {
  font: 600 0.74rem var(--ff-m);
  color: var(--mut);
}
/* DISPLAY control */
.dispstat {
  font: 600 0.62rem var(--ff-m);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid var(--line2);
}
.dispstat.active {
  color: var(--ok);
  border-color: rgba(var(--shs), 0.5);
}
.dispstat.inactive {
  color: var(--copper-hi);
  border-color: rgba(var(--shc), 0.5);
}
.dispstat.na {
  color: var(--mut);
}
.disphint {
  font-size: 0.78rem;
  color: var(--mut);
  line-height: 1.5;
  margin-bottom: 14px;
}
.dispmeta {
  display: grid;
  gap: 8px;
  margin-bottom: 16px;
}
.dispbtns {
  display: flex;
  flex-direction: column;
  gap: 9px;
  margin-top: auto;
}
.btn.warn {
  background: linear-gradient(180deg, #d8a200, #9c7400);
  border-color: #d8a200;
  color: #1a1400;
}
.btn.restore {
  background: linear-gradient(180deg, var(--blue), #2f6fd6);
  border-color: var(--blue);
  color: #04132e;
}
.dispwarn {
  margin-top: 12px;
  font: 600 0.72rem var(--ff-m);
  color: var(--copper-hi);
  line-height: 1.5;
  white-space: pre-line;
}
.dispwarn:empty {
  display: none;
}

/* ===== MINI MONITOR (test view) ===== */
.totals.mini .tstat .tval {
  font-size: 18px;
}
.minirow {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 16px;
  margin-bottom: 30px;
}
@media (max-width: 900px) {
  .minirow {
    grid-template-columns: 1fr;
  }
}
.minicard {
  background: linear-gradient(180deg, var(--panel2), var(--panel));
  border: 1px solid var(--line);
  border-radius: var(--rad);
  padding: 16px 18px;
}
.mlbl {
  font: 600 0.74rem var(--ff-m);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--mut);
  display: flex;
  align-items: center;
  gap: 7px;
}
.mlbl b {
  margin-left: auto;
  color: var(--ink);
  font-size: 0.92rem;
}
.mtest {
  margin-top: 12px;
  font: 600 0.74rem var(--ff-m);
  color: var(--copper-hi);
  min-height: 1em;
}
.minicard.gpus {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 10px 18px;
  align-content: start;
}
.mgpu {
  border-left: 3px solid var(--gpuc, var(--line2));
  padding: 4px 0 4px 10px;
}
.mgpu .mg-top {
  font: 600 0.72rem var(--ff-m);
  color: var(--mut);
  display: flex;
  justify-content: space-between;
  gap: 6px;
}
.mgpu .mg-val {
  font: 600 1.05rem var(--ff-m);
  font-variant-numeric: tabular-nums;
}
.mgpu .mg-sub {
  font: 600 0.66rem var(--ff-m);
  color: var(--mut);
}
/* ===== logo + logout (header) ===== */
.brand .logo {
  height: 34px;
  width: auto;
  border-radius: 7px;
  object-fit: contain;
}
.badge.logout {
  cursor: pointer;
  border: 1px solid var(--line2);
  background: var(--panel2);
  color: var(--mut);
  padding: 6px 8px;
  line-height: 0;
}
.badge.logout:hover {
  color: var(--copper-hi);
  border-color: var(--copper);
}
.badge.logout .ic {
  width: 15px;
  height: 15px;
}

/* ===== stacked settings/fleet view ===== */
.view.stack {
  display: flex;
  flex-direction: column;
  gap: 22px;
}
.ctlgrid.set {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px 18px;
  align-items: end;
}
.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.field.full {
  grid-column: 1 / -1;
}
.field .lbl {
  margin: 0;
}
.field input[type='text'],
.field input:not([type]),
.field input[type='password'],
.field input[type='number'] {
  background: var(--panel3);
  border: 1px solid var(--line2);
  color: var(--ink);
  border-radius: var(--rad-s);
  padding: 9px 11px;
  font: 500 0.9rem var(--ff-b);
  outline: none;
}
.field input.mono {
  font-family: var(--ff-m);
  font-size: 0.82rem;
}
.field input:focus {
  border-color: var(--copper);
  box-shadow: 0 0 0 2px rgba(var(--shc), 0.18);
}
.field.check {
  flex-direction: row;
  align-items: center;
  gap: 9px;
}
.field.check input {
  width: 17px;
  height: 17px;
  accent-color: var(--copper);
}
.field.check label {
  font: 500 0.82rem var(--ff-b);
  color: var(--mut);
}
.btns.row {
  display: flex;
  flex-direction: row;
  gap: 10px;
  margin-top: 16px;
  flex-wrap: wrap;
}
.cgt .right {
  margin-left: auto;
  font: 500 0.72rem var(--ff-m);
  color: var(--mut);
  text-transform: none;
  letter-spacing: 0;
}
.chip.srv .cdot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-right: 7px;
  vertical-align: middle;
}

/* ===== fleet cards ===== */
.fleetmeta {
  font: 500 0.74rem var(--ff-m);
  color: var(--mut);
  margin-right: 12px;
}
.fleetgrid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
  gap: 16px;
}
.fcard {
  background: linear-gradient(180deg, var(--panel2), var(--panel));
  border: 1px solid var(--line);
  border-radius: var(--rad);
  padding: 16px 18px;
  position: relative;
  overflow: hidden;
}
.fcard::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 3px;
  height: 100%;
  background: var(--dotc);
  opacity: 0.9;
}
.fc-head {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 6px;
}
.fc-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--dotc);
  box-shadow: 0 0 8px var(--dotc);
}
.fc-name {
  font: 700 1.05rem var(--ff-d);
  letter-spacing: 0.3px;
}
.fc-stat {
  margin-left: auto;
  font: 600 0.62rem var(--ff-m);
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--dotc);
}
.fc-host {
  font-size: 0.74rem;
  color: var(--mut);
  margin-bottom: 12px;
}
.fc-sys {
  display: flex;
  gap: 16px;
  font: 500 0.78rem var(--ff-m);
  color: var(--mut);
  margin-bottom: 12px;
}
.fc-sys b {
  color: var(--ink);
  font-weight: 700;
}
.fc-gpus {
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin-bottom: 14px;
}
.fg-gpu {
  display: grid;
  grid-template-columns: 28px 1fr auto auto auto;
  gap: 8px;
  align-items: center;
  font: 500 0.74rem var(--ff-m);
  color: var(--ink);
  background: var(--panel3);
  border-radius: 6px;
  padding: 4px 8px;
}
.fg-gi {
  color: var(--mut);
}
.fg-gn {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.fg-gm {
  color: var(--cyan);
}
.fc-act {
  display: flex;
  justify-content: flex-end;
}
.btn.sm {
  padding: 6px 12px;
  font-size: 0.78rem;
}

/* =====================================================================
   GPU STATION — layout, navigation, dashboard, servers, login
   (appended to the component base above; uses the same design tokens)
   ===================================================================== */

/* ---- top bar ---- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 12px 22px;
  background: linear-gradient(180deg, rgba(19, 19, 24, 0.96), rgba(12, 12, 16, 0.92));
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(10px);
}
.topbar .brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}
.topbar .logo {
  height: 34px;
  width: auto;
  display: block;
}
.brand-txt {
  display: flex;
  flex-direction: column;
  line-height: 1.05;
}
.brand-txt b {
  font-family: var(--ff-d);
  font-weight: 700;
  letter-spacing: 0.06em;
  font-size: 20px;
  color: var(--ink);
}
.brand-txt span {
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--mut);
}
.nav {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 0 auto;
}
.nav .tab,
.topright .tab {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 15px;
  border: 1px solid transparent;
  border-radius: var(--rad-s);
  background: transparent;
  color: var(--mut);
  font-family: var(--ff-b);
  font-weight: 600;
  font-size: 14px;
  letter-spacing: 0.01em;
  cursor: pointer;
  transition: 0.15s;
}
.nav .tab:hover,
.topright .tab:hover {
  color: var(--ink);
  background: var(--panel2);
}
.nav .tab.on {
  color: var(--ink);
  background: var(--panel3);
  border-color: var(--line2);
  box-shadow: inset 0 0 0 1px rgba(var(--shc), 0.18);
}
.nav .tab.on .tico svg {
  stroke: var(--copper-hi);
}
.tico {
  display: inline-flex;
  width: 17px;
  height: 17px;
}
.tico svg {
  width: 17px;
  height: 17px;
  stroke: currentColor;
}
.topright {
  display: flex;
  align-items: center;
  gap: 10px;
}
.logoutform {
  margin: 0;
}
.tab.out {
  color: var(--mut);
}
.tab.out:hover {
  color: var(--err);
  background: rgba(var(--she), 0.1);
}

/* selected-rig pill (back to dashboard) */
.rigpill {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid var(--line2);
  background: var(--panel2);
  color: var(--ink);
  font-family: var(--ff-b);
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
  transition: 0.15s;
}
.rigpill:hover {
  border-color: var(--copper);
  background: var(--panel3);
}
.rigpill .rp-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--ok);
  box-shadow: 0 0 8px var(--ok);
}
.rigpill .rp-x {
  color: var(--mut);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
}
.rigpill:hover .rp-x {
  color: var(--copper-hi);
}

/* ---- page scaffolding ---- */
.page {
  animation: fade 0.18s ease;
}
.page[hidden] {
  display: none;
}
@keyframes fade {
  from {
    opacity: 0;
    transform: translateY(4px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}
.pagehead {
  margin: 6px 0 20px;
}
.ph-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--ff-d);
  font-weight: 700;
  letter-spacing: 0.04em;
  font-size: 26px;
  color: var(--ink);
}
.ph-title .ico {
  display: inline-flex;
  width: 22px;
  height: 22px;
}
.ph-title .ico svg {
  width: 22px;
  height: 22px;
  stroke: var(--copper-hi);
}
.ph-sub {
  margin-top: 5px;
  color: var(--mut);
  font-size: 14px;
}

/* ---- dashboard fleet cards ---- */
.dash-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 16px;
}
.dcard {
  position: relative;
  border: 1px solid var(--line);
  border-radius: var(--rad);
  background: linear-gradient(165deg, var(--panel2), var(--panel));
  padding: 16px 16px 14px;
  cursor: pointer;
  overflow: hidden;
  transition: 0.16s;
}
.dcard::before {
  content: '';
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  background: var(--accent, var(--line2));
  opacity: 0.95;
}
.dcard:hover {
  transform: translateY(-2px);
  border-color: var(--line2);
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.45);
}
.dcard:hover .dc-go {
  color: var(--copper-hi);
}
.dc-head {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 3px;
}
.dc-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--dotc, var(--mut));
  box-shadow: 0 0 9px var(--dotc, transparent);
  flex: none;
}
.dc-name {
  font-family: var(--ff-d);
  font-weight: 600;
  font-size: 18px;
  letter-spacing: 0.02em;
  color: var(--ink);
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.dc-head .dc-stat {
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--mut);
  border: 1px solid var(--line2);
  border-radius: 999px;
  padding: 2px 9px;
}
.dc-host {
  font-size: 12px;
  color: var(--mut);
  margin-bottom: 13px;
}
.dc-tiles {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 13px;
}
.dc-tile {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--rad-s);
  padding: 8px 9px 9px;
}
.dc-tile-top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 6px;
  margin-bottom: 7px;
}
.dc-tile-top span {
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--mut);
}
.dc-tile-top b {
  font-family: var(--ff-m);
  font-weight: 600;
  font-size: 14px;
  color: var(--ink);
}
.dc-tile-bar {
  display: block;
  height: 5px;
  border-radius: 3px;
  background: var(--line);
  overflow: hidden;
}
.dc-tile-bar i {
  display: block;
  height: 100%;
  border-radius: 3px;
  transition: width 0.4s ease;
}
.dc-tile-count {
  display: flex;
  flex-direction: column;
}
.dc-tile-count .dc-tile-top {
  margin-bottom: 2px;
}
.dc-tile-sub {
  font-family: var(--ff-m);
  font-size: 11px;
  color: var(--mut);
  margin-top: auto;
}

/* ---- per-GPU breakdown ---- */
.dc-gpu-list {
  display: flex;
  flex-direction: column;
  gap: 7px;
}
.dc-gpu-row {
  display: flex;
  align-items: stretch;
  gap: 9px;
  padding: 8px 9px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--rad-s);
}
.dc-gpu-row.testing {
  border-color: color-mix(in srgb, var(--ok) 55%, var(--line));
  box-shadow: inset 2px 0 0 var(--ok);
}
.dg-badge {
  flex: none;
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  border-radius: 6px;
  background: color-mix(in srgb, var(--accent, var(--copper)) 22%, var(--panel2));
  border: 1px solid color-mix(in srgb, var(--accent, var(--copper)) 45%, var(--line));
  color: var(--ink);
  font-family: var(--ff-m);
  font-weight: 700;
  font-size: 12px;
  align-self: center;
}
.dg-body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.dg-top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}
.dg-name {
  font-family: var(--ff-d);
  font-weight: 600;
  font-size: 13px;
  color: var(--ink);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.dg-temp {
  flex: none;
  font-family: var(--ff-m);
  font-weight: 600;
  font-size: 12px;
}
.dg-metric {
  display: flex;
  align-items: center;
  gap: 7px;
}
.dg-lbl {
  flex: none;
  width: 30px;
  font-size: 9.5px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--mut);
}
.dg-bar {
  flex: 1;
  height: 6px;
  border-radius: 3px;
  background: var(--line);
  overflow: hidden;
}
.dg-bar i {
  display: block;
  height: 100%;
  border-radius: 3px;
  transition: width 0.4s ease;
}
.dg-val {
  flex: none;
  min-width: 62px;
  text-align: right;
  font-family: var(--ff-m);
  font-size: 11px;
  color: var(--ink);
}
.dc-nogpu {
  font-size: 12px;
  color: var(--mut);
  font-style: italic;
  padding: 8px 0;
}
.dc-go {
  margin-top: 12px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.03em;
  color: var(--mut);
  transition: 0.15s;
}

/* ---- offline banner ---- */
.offline-bar {
  margin: 0 0 18px;
  padding: 11px 16px;
  border-radius: var(--rad-s);
  background: rgba(var(--she), 0.12);
  border: 1px solid var(--err-deep);
  color: #ffd9da;
  font-weight: 600;
  font-size: 14px;
}
.offline-bar[hidden] {
  display: none;
}

/* ---- empty states ---- */
.empty-pane {
  border: 1px dashed var(--line2);
  border-radius: var(--rad);
  padding: 40px 24px;
  text-align: center;
  color: var(--mut);
  font-size: 15px;
  background: var(--panel);
}
.empty-pane b {
  color: var(--ink);
}

/* ---- servers form ---- */
.srvform {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px 18px;
  margin-top: 16px;
}
.srvbtns {
  display: flex;
  gap: 10px;
  margin-top: 18px;
  flex-wrap: wrap;
}
@media (max-width: 620px) {
  .srvform {
    grid-template-columns: 1fr;
  }
  .nav .tab span:not(.tico),
  .topright .tab.out {
    display: none;
  }
}

/* =====================================================================
   Login page
   ===================================================================== */
body.login {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.loginbox {
  width: 100%;
  max-width: 380px;
  background: linear-gradient(165deg, var(--panel2), var(--panel));
  border: 1px solid var(--line);
  border-radius: var(--rad);
  padding: 34px 30px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.55);
}
.loginbox .lb-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 6px;
}
.loginbox .logo {
  height: 40px;
}
.loginbox h1 {
  font-family: var(--ff-d);
  font-weight: 700;
  letter-spacing: 0.05em;
  font-size: 24px;
  color: var(--ink);
  margin: 0;
}
.loginbox .lb-sub {
  color: var(--mut);
  font-size: 13px;
  margin: 0 0 22px;
}
.loginbox .field {
  margin-bottom: 16px;
}
.loginbox .btn {
  width: 100%;
  justify-content: center;
  margin-top: 4px;
  background: linear-gradient(180deg, var(--copper), var(--copper-deep));
  box-shadow: 0 4px 18px -4px rgba(242, 13, 18, 0.45);
  border: none;
  color: #fff;
  cursor: pointer;
  transition:
    filter 0.15s,
    transform 0.15s;
}
.loginbox .btn:hover {
  background: linear-gradient(180deg, var(--copper-hi), var(--copper));
  filter: brightness(1.08);
}
.loginbox .btn:active {
  transform: scale(0.98);
}
.loginbox .btn:disabled {
  opacity: 0.6;
  cursor: wait;
}
.loginerr {
  background: rgba(var(--she), 0.12);
  border: 1px solid var(--err-deep);
  color: #ffd9da;
  border-radius: var(--rad-s);
  padding: 10px 13px;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 16px;
}
.loginerr[hidden] {
  display: none;
}

.loginerr:empty {
  display: none;
}

/* ---------- rig context bar (shown on Monitor + Test) ---------- */
.rig-context {
  --accent: var(--copper);
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 11px 16px;
  margin-bottom: 14px;
  border: 1px solid var(--line);
  border-left: 4px solid var(--accent);
  border-radius: var(--rad);
  background: linear-gradient(165deg, var(--panel2), var(--panel));
}
.rig-context .rc-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--mut);
  box-shadow: 0 0 9px currentColor;
  flex: none;
}
.rig-context .rc-name {
  font-family: var(--ff-d);
  font-weight: 600;
  font-size: 17px;
  color: var(--txt);
}
.rig-context .rc-host {
  color: var(--mut);
  font-size: 13px;
}
.rig-context .rc-stat {
  margin-left: auto;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 600;
}

/* ---------- shared run settings ---------- */
.runsettings {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 22px;
}
.runsettings .rs-item {
  min-width: 0;
}
@media (max-width: 760px) {
  .runsettings {
    grid-template-columns: 1fr;
  }
}

/* ---------- independent test panels (GPU vs CPU/RAM) ---------- */
.testpanels {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-top: 16px;
}
@media (max-width: 880px) {
  .testpanels {
    grid-template-columns: 1fr;
  }
}
.testpanel {
  display: flex;
  flex-direction: column;
}
.testpanel .tp-head {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 14px;
  font-family: var(--ff-d);
  font-size: 15px;
}
.testpanel .tp-head .ico {
  color: var(--copper-hi);
}
.testpanel .tp-head b {
  font-weight: 600;
}
.testpanel .tp-head .run-status {
  margin-left: auto;
  font-size: 11.5px;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--mut);
  font-weight: 600;
}
.testpanel .tp-foot {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: auto;
  padding-top: 16px;
}
.testpanel .tp-foot .btn {
  flex: none;
}

/* ===== Monitoring: System + Fleet-Totals two-block section ===== */
.monogrid {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr);
  gap: 16px;
  margin-bottom: 22px;
  align-items: start;
}
@media (max-width: 1000px) {
  .monogrid {
    grid-template-columns: 1fr;
  }
}
.monoblock {
  border: 1px solid var(--line);
  border-radius: var(--rad);
  background: var(--panel);
  padding: 14px 16px 16px;
}
.mb-head {
  color: var(--copper);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}
.mb-head .ico {
  font-size: 0.95rem;
  line-height: 1;
}
.mb-head::after {
  content: '';
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, var(--line2), transparent);
}
/* CPU + RAM stacked as one block (flatten the inner panels — no card-in-card) */
.sysstack {
  display: flex;
  flex-direction: column;
}
.sysstack .bigpanel {
  border: none;
  background: transparent;
  border-radius: 0;
  padding: 0;
}
.sysstack .bigpanel + .bigpanel {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}
/* Fleet-totals tiles inside their block */
.monoblock {
  margin-bottom: 22px;
}
.monoblock .mb-head {
  margin-bottom: 16px;
}
.monoblock .totals {
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
  margin: 0;
}
.totals-empty {
  color: var(--mut);
  font-size: 12px;
  font-style: italic;
  padding: 10px 2px;
}

/* smooth animated GPU utilisation ring */
@property --gp {
  syntax: '<number>';
  initial-value: 0;
  inherits: false;
}

/* ===== Test: full-width time setting + number inputs ===== */
.timeset {
  margin-bottom: 16px;
}
.mt16 {
  margin-top: 16px;
}
.setrow {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 8px;
}
.setrow input[type='range'] {
  flex: 1;
  min-width: 120px;
  accent-color: var(--copper);
}
.setval {
  font-family: var(--ff-m);
  font-weight: 600;
  min-width: 64px;
  text-align: right;
  color: var(--ink);
}
.numwrap {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: var(--panel);
  border: 1px solid var(--line2);
  border-radius: var(--rad-s);
  padding: 5px 9px;
}
.numwrap:focus-within {
  border-color: var(--copper);
}
.numwrap input[type='number'] {
  width: 56px;
  background: transparent;
  border: none;
  outline: none;
  color: var(--ink);
  font-family: var(--ff-m);
  font-weight: 600;
  font-size: 13px;
  text-align: right;
  padding: 0;
  /* hide spinners — the slider handles stepping */
  -moz-appearance: textfield;
  appearance: textfield;
}
.numwrap input[type='number']::-webkit-outer-spin-button,
.numwrap input[type='number']::-webkit-inner-spin-button {
  -webkit-appearance: none;
  appearance: none;
  margin: 0;
}
.numwrap .numunit {
  font-family: var(--ff-m);
  font-size: 12px;
  color: var(--mut);
}
/* RAM buffer inside the System Tests panel */
.rambuf {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}
@media (max-width: 560px) {
  .setrow {
    flex-wrap: wrap;
  }
  .setrow input[type='range'] {
    order: 3;
    flex-basis: 100%;
  }
}

/* ===== GPU card: util/temp history graph (inspired by CPU sparkline) ===== */
.ghist {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}
.ghist-head {
  display: flex;
  gap: 16px;
  margin-bottom: 7px;
}
.ghist-head .lg {
  font: 600 0.56rem var(--ff-m);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--mut);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.ghist-head .lg::before {
  content: '';
  width: 11px;
  height: 3px;
  border-radius: 2px;
}
.ghist-head .lg-u::before {
  background: var(--gpuc, var(--blue));
}
.ghist-head .lg-t::before {
  background: #fbbf24;
}
.ghist canvas {
  width: 100%;
  height: 66px;
  display: block;
}

/* ===== Fleet-totals tiles: icon head ===== */
.tstat .thead {
  display: flex;
  align-items: center;
  gap: 8px;
}
.tstat .ticon {
  display: inline-flex;
  align-items: center;
  color: var(--accent, var(--blue));
}
.tstat .ticon svg.ic {
  width: 1em;
  height: 1em;
}
.tstat .thead .tlbl {
  margin: 0;
}

/* ===== No-NVIDIA-GPU states (monitor + test Live GPUs) ===== */
.gpu-empty {
  grid-column: 1 / -1;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 8px;
  padding: 34px 24px;
  border: 1px dashed var(--line2);
  border-radius: var(--rad);
  background: linear-gradient(165deg, var(--panel2), var(--panel));
}
.gpu-empty .ge-ic {
  display: inline-flex;
  color: var(--mut);
  opacity: 0.7;
}
.gpu-empty .ge-ic svg.ic {
  width: 30px;
  height: 30px;
}
.gpu-empty .ge-title {
  font: 600 1rem var(--ff-d);
  letter-spacing: 0.02em;
  color: var(--ink);
}
.gpu-empty .ge-sub {
  font-size: 0.82rem;
  color: var(--mut);
  max-width: 460px;
  line-height: 1.5;
}
.gpu-others {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
  margin-top: 8px;
}
.gpu-other {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 9px 13px;
  border: 1px solid var(--line);
  border-radius: var(--rad-s);
  background: var(--panel);
  text-align: left;
}
.gpu-other .go-ic {
  display: inline-flex;
  color: var(--cyan, var(--blue));
}
.gpu-other .go-txt {
  display: flex;
  flex-direction: column;
  line-height: 1.3;
}
.gpu-other .go-txt b {
  font: 600 0.82rem var(--ff-m);
  color: var(--ink);
}
.gpu-other .go-txt span {
  font-size: 0.66rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--mut);
}

/* nicer fleet-totals empty line */
.totals-empty {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--mut);
  font-size: 12.5px;
  padding: 16px 14px;
  border: 1px dashed var(--line2);
  border-radius: var(--rad-s);
  background: var(--panel);
}
.totals-empty .te-ic {
  display: inline-flex;
  opacity: 0.7;
}
.totals-empty .te-ic svg.ic {
  width: 1.05em;
  height: 1.05em;
}

/* dashboard "integrated" tag */
.dc-tag {
  display: inline-block;
  margin-left: 6px;
  padding: 1px 7px;
  border-radius: 999px;
  border: 1px solid var(--line2);
  font: 600 0.6rem var(--ff-m);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--mut);
  vertical-align: middle;
}
