/* Panel styles that Tailwind utilities don't cover: type roles, rack units, LEDs, meters. */

:root {
  --alu: #e4e8ec;
  --alu-line: #cfd5db;
  --card: #f9fafb;
  --ink: #111820;
  --muted: #5a6672;
  --face: #1a2027;
  --face-2: #232b33;
  --face-line: #2f3943;
  --face-text: #e8edf1;
  --face-muted: #8a97a3;
  --signal: #2e6be6;
  --led-green: #2fd483;
  --led-amber: #f6b73c;
  --led-red: #ff5b4f;
  --led-blue: #5aa2ff;
  --led-off: #3a454f;
}

body {
  font-family: "Archivo", system-ui, sans-serif;
  background: var(--alu);
  color: var(--ink);
}

:focus-visible {
  outline: 2px solid var(--signal);
  outline-offset: 2px;
  border-radius: 6px;
}

/* ---------- Type roles ---------- */

.t-display {
  font-stretch: 118%;
  font-weight: 760;
  letter-spacing: -0.015em;
  line-height: 1.1;
}

.t-label {
  font-stretch: 72%;
  font-weight: 650;
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.t-mono {
  font-family: "JetBrains Mono", ui-monospace, monospace;
}

/* ---------- Rack ---------- */

.rack {
  background: linear-gradient(#0f1419, #151b21);
  border-radius: 14px;
  padding: 6px;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.6), 0 10px 30px -18px rgba(17, 24, 32, 0.6);
}

.unit {
  position: relative;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 18px;
  padding: 14px 34px;
  background: linear-gradient(180deg, var(--face-2), var(--face));
  border: 1px solid var(--face-line);
  border-radius: 9px;
  color: var(--face-text);
  text-decoration: none;
  transition: border-color 0.15s, transform 0.15s;
}

.unit + .unit {
  margin-top: 5px;
}

.unit:hover {
  border-color: #4a5865;
}

/* rack screws */
.unit::before,
.unit::after {
  content: "";
  position: absolute;
  top: 50%;
  width: 9px;
  height: 9px;
  margin-top: -4.5px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #6b7782, #2a333b 70%);
  box-shadow: inset 0 0 0 1px #0c1014;
}

.unit::before { left: 12px; }
.unit::after { right: 12px; }

/* Fixed status column so meters line up from unit to unit */
@media (min-width: 1024px) {
  .unit { grid-template-columns: auto minmax(0, 1fr) auto 210px; }
}

.unit-meters {
  display: flex;
  gap: 22px;
  align-items: center;
}

.unit-meters.stale { opacity: 0.35; }

@media (max-width: 900px) {
  .unit {
    grid-template-columns: auto minmax(0, 1fr);
    padding: 14px 30px;
  }
  .unit-meters,
  .unit-side {
    grid-column: 1 / -1;
  }
  .unit-meters {
    flex-wrap: wrap;
    gap: 14px 22px;
  }
}

/* ---------- LEDs ---------- */

.leds {
  display: flex;
  gap: 10px;
}

.led-cell {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.led-cell .t-label {
  font-size: 9px;
  color: var(--face-muted);
}

.led {
  display: inline-block;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--led-off);
  box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.5);
}

.led-green { background: var(--led-green); box-shadow: 0 0 8px 1px color-mix(in srgb, var(--led-green) 60%, transparent); }
.led-amber { background: var(--led-amber); box-shadow: 0 0 8px 1px color-mix(in srgb, var(--led-amber) 60%, transparent); }
.led-red   { background: var(--led-red);   box-shadow: 0 0 8px 1px color-mix(in srgb, var(--led-red) 60%, transparent); }
.led-blue  { background: var(--led-blue);  box-shadow: 0 0 8px 1px color-mix(in srgb, var(--led-blue) 60%, transparent); }
.led-blink { animation: led-blink 0.9s steps(2, jump-none) infinite; }

@keyframes led-blink {
  50% { opacity: 0.25; }
}

/* ---------- Segmented meters ---------- */

.meter {
  display: flex;
  flex-direction: column;
  gap: 5px;
  min-width: 96px;
}

.meter-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
}

.meter-head .t-label { color: var(--face-muted); }
.meter-head .t-mono { font-size: 11px; color: var(--face-text); }

.segments {
  display: grid;
  grid-template-columns: repeat(10, 1fr);
  gap: 2px;
}

.segments i {
  height: 6px;
  border-radius: 1px;
  background: #2c353e;
}

.segments i.on { background: var(--led-green); }
.segments.warn i.on { background: var(--led-amber); }
.segments.crit i.on { background: var(--led-red); }

/* Light-surface variant (server page cards) */
.light .segments i { background: var(--alu-line); }
.light .meter-head .t-label { color: var(--muted); }
.light .meter-head .t-mono { color: var(--ink); }

/* ---------- Misc ---------- */

.card {
  background: var(--card);
  border: 1px solid var(--alu-line);
  border-radius: 14px;
}

.choice {
  cursor: pointer;
  border: 1.5px solid var(--alu-line);
  border-radius: 12px;
  background: #fff;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.choice:hover { border-color: #a9b3bd; }

.choice:has(input:checked) {
  border-color: var(--signal);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--signal) 15%, transparent);
}

.choice input[type="radio"],
.choice input[type="checkbox"] {
  accent-color: var(--signal);
}

.terminal {
  background: #0d1216;
  color: #c9d4dc;
  border-radius: 12px;
  border: 1px solid #1f272e;
}

.terminal .step { color: #7fb2ff; font-weight: 600; }
.terminal .warn { color: var(--led-amber); }
.terminal .err { color: var(--led-red); }

details > summary { list-style: none; cursor: pointer; }
details > summary::-webkit-details-marker { display: none; }

@media (prefers-reduced-motion: reduce) {
  .led-blink { animation: none; }
  .unit { transition: none; }
}
