/* stbflash: dark theme. Tokens and chrome copied from stats/site/static/styles.css (SPEC S65-S68). */
/* Fonts: fonts/fonts.css, self-hosted (S66). */

:root {
  --bg-0: #08020f;
  --bg-1: #110522;
  --bg-2: #1a0a30;
  --bg-3: #261142;

  --ink-0: #f5f3ff;
  --ink-1: #c8bdda;
  --ink-2: #8b7fa6;

  --brand: #5d2e87;
  --brand-hi: #6f399f;
  --violet: #a855f7;
  --violet-hi: #c084fc;
  --ok: #10b981;
  --warn: #f59e0b;
  --down: #f87171;

  --rule: #3b1f6b;
  --rule-bright: #5b21b6;
  --field: #7a6ca6;
  --grid: #24113f;

  --mono: 'JetBrains Mono', 'IBM Plex Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --sans: 'Manrope', -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;

  --t: 120ms;
}

* { box-sizing: border-box; }

html { color-scheme: dark; }

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg-0);
  color: var(--ink-0);
  font-family: var(--sans);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

[hidden] { display: none !important; }

a { color: var(--violet); text-decoration: none; }
a:hover { color: var(--violet-hi); text-decoration: underline; }

:focus-visible { outline: 2px solid var(--violet-hi); outline-offset: 2px; }

/* ===== brand (ETA logo) ===== */
.brand { display: flex; align-items: center; gap: 12px; color: var(--ink-0); flex: none; }
.brand__logo {
  width: 38px; height: 38px; flex: none;
  display: grid; place-items: center;
  border: 1px solid var(--violet);
  background: var(--bg-1);
}
.brand__logo img { width: 30px; height: 30px; object-fit: cover; display: block; }
.brand__wordmark {
  font-family: var(--mono); font-weight: 700; font-size: 12px;
  letter-spacing: 0.16em; text-transform: uppercase; white-space: nowrap;
}
.brand__wordmark .sep { color: var(--violet); margin: 0 5px; font-weight: 400; }

/* ===== section heading ===== */
.section-h {
  font-family: var(--mono); font-size: 11px; font-weight: 500;
  letter-spacing: 0.24em; text-transform: uppercase;
  color: var(--ink-2);
  margin: 28px 0 14px;
  display: flex; align-items: center; gap: 12px;
}
.content > .section-h:first-child, .login > .section-h { margin-top: 0; }
.section-h .rule {
  flex: 1; height: 1px;
  background: linear-gradient(90deg, var(--rule) 0%, transparent 100%);
}

/* ===== pill ===== */
.pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 2px 9px;
  border: 1px solid var(--rule-bright); border-radius: 999px;
  color: var(--ink-1);
  font-family: var(--mono); font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase;
  white-space: nowrap;
}
.pill b { color: var(--ink-0); font-weight: 500; text-transform: none; letter-spacing: 0.04em; }

/* ===== buttons, fields ===== */
button {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 32px; padding: 0 14px;
  border: 1px solid var(--field); border-radius: 0;
  background: transparent; color: var(--ink-0);
  font-family: var(--sans); font-size: 13px; font-weight: 600;
  cursor: pointer; white-space: nowrap;
  transition: background var(--t), border-color var(--t);
}
button:hover { background: var(--bg-2); border-color: var(--violet); }
button:disabled { color: var(--ink-2); border-color: var(--rule); cursor: default; background: transparent; }
button.primary { background: var(--brand); border-color: var(--brand); margin-top: 14px; }
button.primary:hover { background: var(--brand-hi); border-color: var(--brand-hi); }
button.ghost { border-color: var(--rule); color: var(--ink-1); }
button.danger { border-color: var(--down); }
button.danger:hover { border-color: var(--down); background: var(--bg-3); }
button.block { width: 100%; height: 38px; }

label, .field-h {
  display: flex; flex-direction: column; gap: 5px;
  font-family: var(--mono); font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--ink-2);
}
label.chk {
  display: inline-flex; flex-direction: row; align-items: center; gap: 6px;
  margin: 0 12px 6px 0; color: var(--ink-1); letter-spacing: 0.06em; text-transform: none;
}
input {
  height: 32px; padding: 0 10px;
  border: 1px solid var(--field); border-radius: 0;
  background: var(--bg-0); color: var(--ink-0);
  font-family: var(--sans); font-size: 13px; letter-spacing: normal; text-transform: none;
  transition: border-color var(--t);
}
input:hover { border-color: var(--violet); }
input::placeholder { color: var(--ink-2); }
input[type="checkbox"] { width: 16px; height: 16px; padding: 0; accent-color: var(--violet); }
form.inline { display: inline-flex; align-items: center; gap: 6px; flex-wrap: wrap; }

/* ===== shell ===== */
.shell { min-height: 100vh; display: flex; flex-direction: column; }

.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px;
  min-height: 56px; padding: 8px 24px;
  background: var(--bg-0); border-bottom: 1px solid var(--rule);
}
.topnav { display: flex; flex-wrap: wrap; gap: 2px; margin-left: auto; }
.topnav a {
  display: flex; align-items: center;
  height: 34px; padding: 0 12px;
  color: var(--ink-1); font-weight: 600; font-size: 13px;
  border-bottom: 2px solid transparent;
  transition: background var(--t);
}
.topnav a:hover { background: var(--bg-2); color: var(--ink-0); text-decoration: none; border-bottom-color: var(--violet-hi); }
.userbox {
  display: flex; align-items: center; gap: 8px; flex: none;
  padding-left: 16px; border-left: 1px solid var(--rule);
  color: var(--ink-1);
}
.userbox__name {
  font-family: var(--mono); font-size: 12px; color: var(--ink-0);
  max-width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

.content { flex: 1; padding: 20px 24px 8px; min-width: 0; }

.footer {
  margin: 24px 24px 0; padding: 14px 0 18px;
  border-top: 1px solid var(--rule);
  font-family: var(--mono); font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--ink-2);
  display: flex; flex-wrap: wrap; align-items: center; gap: 6px 22px; justify-content: space-between;
}
.footer b { color: var(--ink-1); font-weight: 500; }

/* ===== cards, notes ===== */
.card { background: var(--bg-1); border: 1px solid var(--rule); padding: 20px; max-width: 420px; }
.card label { margin-bottom: 12px; }
.card input { width: 100%; }
.card input[type="checkbox"] { width: 16px; }
.field-h { margin: 0 0 6px; }
.login { margin: 48px auto; max-width: 360px; padding: 28px 28px 22px; }
.note {
  margin: 0 0 14px; padding: 8px 12px;
  background: var(--bg-1); border: 1px solid var(--rule); border-left: 3px solid var(--violet);
  color: var(--ink-1);
}
.note--err { border-left-color: var(--down); }
.scan-bar { display: flex; flex-wrap: wrap; gap: 8px; }

/* ===== VLAN control banner (S11b) ===== */
.control-bar { display: flex; flex-direction: column; gap: 8px; }
.banner {
  display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px;
  padding: 8px 12px;
  background: var(--bg-1); border: 1px solid var(--rule); border-left: 3px solid var(--warn);
  color: var(--ink-1);
}
.banner--free { border-left-color: var(--ok); }
.banner__vlan {
  font-family: var(--mono); font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--ink-2);
}
.banner__text b { color: var(--ink-0); font-weight: 700; font-family: var(--mono); font-size: 12px; }
.scan-bar .note { margin: 0; }
.more { margin: 12px 0 0; }

/* ===== help page (S21a) ===== */
.card.help { max-width: 760px; color: var(--ink-1); }
.help ol, .help ul { margin: 0 0 12px; padding-left: 22px; }
.help ul { margin-bottom: 0; }
.help li + li { margin-top: 6px; }
.help code { font-family: var(--mono); font-size: 12px; color: var(--ink-0); }
.tbl.help code { overflow-wrap: anywhere; }

/* ===== tables ===== */
.table-wrap { background: var(--bg-1); border: 1px solid var(--rule); overflow: auto; max-width: 100%; }
.tbl { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 13px; }
.tbl th, .tbl td {
  padding: 6px 10px; text-align: left; vertical-align: middle;
  border-bottom: 1px solid var(--grid);
  white-space: nowrap;
}
.tbl thead th {
  font-family: var(--mono); font-size: 11px; font-weight: 500;
  letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--ink-2); background: var(--bg-1);
  border-bottom: 1px solid var(--rule);
}
.tbl tbody tr:last-child td { border-bottom: 0; }
.tbl tbody tr:hover td { background: var(--bg-2); }
.tbl.users td, .tbl.audit td:last-child, .tbl.help th, .tbl.help td { white-space: normal; }
.tbl.audit td { font-size: 12px; }
.boxes td { font-family: var(--mono); font-size: 12px; }
.boxes .pickcol { width: 32px; }
.boxes .state { color: var(--ink-0); }

/* ===== flash log (S22d) ===== */
.flashlog-filter { margin: 12px 0 14px; max-width: 760px; }
.flashlog-filter input[type="datetime-local"] { max-width: 260px; }
.flashlog td { font-family: var(--mono); font-size: 12px; }

/* ===== progress ===== */
.meter { display: inline-flex; align-items: center; gap: 8px; margin-left: 10px; vertical-align: middle; }
progress {
  -webkit-appearance: none; appearance: none;
  width: 140px; height: 8px; border: 1px solid var(--rule); border-radius: 0;
  background: var(--bg-0); color: var(--violet); vertical-align: middle;
}
progress::-webkit-progress-bar { background: var(--bg-0); }
progress::-webkit-progress-value { background: var(--violet); }
progress::-moz-progress-bar { background: var(--violet); }
.pct { min-width: 40px; text-align: right; color: var(--ink-1); font-variant-numeric: tabular-nums; }
.waiting, .hold, .set-missing, .recovery, .no-boot { margin-left: 8px; color: var(--warn); }
.booted { margin-left: 8px; color: var(--ok); }

/* ===== MinevPro mark. Rules copied from stats/site/static/styles.css; `.brand` is the ETA logo. ===== */
.mp-brand {
  justify-self: center; align-self: center;
  display: inline-flex; align-items: center;
  line-height: 0;
  opacity: 0.62;
  transition: opacity 0.25s ease, filter 0.25s ease;
}
.mp-brand:hover,
.mp-brand:focus-visible {
  opacity: 1;
  filter: drop-shadow(0 0 10px rgba(255, 179, 71, 0.45));
}
.mp-brand__mark { display: block; }
.mp-brand__slab { fill: #ffb347; }
.mp-brand__cursor { fill: #22d3ee; animation: mp-brand-blink 1.4s steps(2) infinite; }
.mp-brand__minev,
.mp-brand__pro {
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 700;
}
.mp-brand__minev { fill: var(--ink-1); }
.mp-brand__pro { fill: #ffb347; }
@keyframes mp-brand-blink {
  50% { opacity: 0; }
}

/* ===== narrow screens (S67) ===== */
@media (max-width: 700px) {
  .topbar { padding: 8px 16px; position: static; }
  .topnav { margin-left: 0; }
  .userbox { margin-left: auto; padding-left: 10px; }
  .content { padding: 16px 16px 8px; }
  .footer { margin: 20px 16px 0; }
  .login { margin: 24px auto; padding: 22px 18px 18px; }

  /* Boxes: 1 card per row, label beside each value. */
  .table-wrap:has(.boxes) { background: transparent; border: 0; overflow: visible; }
  .boxes, .boxes tbody, .boxes tr, .boxes td { display: block; width: 100%; }
  .boxes thead tr { display: flex; align-items: center; gap: 8px; padding: 6px 10px;
                    background: var(--bg-1); border: 1px solid var(--rule); margin-bottom: 8px; }
  .boxes thead th { display: none; border: 0; padding: 0; background: transparent; }
  .boxes thead th.pickcol { display: block; width: auto; }
  .boxes thead th.pickcol:empty { display: none; }
  .boxes thead tr:has(th.pickcol:empty) { display: none; }
  .boxes thead th.pickcol::after { content: "Select all"; margin-left: 8px; vertical-align: middle; }
  .boxes tbody tr { margin-bottom: 8px; padding: 6px 10px; background: var(--bg-1); border: 1px solid var(--rule); }
  .boxes tbody tr:hover td { background: transparent; }
  .boxes td { display: flex; gap: 10px; padding: 3px 0; border: 0; white-space: normal; overflow-wrap: anywhere; }
  .boxes td::before {
    content: attr(data-label); flex: 0 0 64px;
    font-size: 10px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-2);
  }
  .boxes td.pickcol { width: auto; }
  .boxes td.pickcol:empty { display: none; }
  .boxes td.pickcol::before { content: none; }
  .boxes td.statecol { flex-wrap: wrap; align-items: center; }
  .meter { margin-left: 0; flex: 1 1 100%; padding-left: 74px; }
  progress { flex: 1; width: auto; min-width: 0; }
  .waiting, .hold, .set-missing, .recovery, .booted, .no-boot { margin-left: 74px; }

  /* Flash log (S22d, S67): 1 card per job, label beside each value. */
  .table-wrap:has(.flashlog) { background: transparent; border: 0; overflow: visible; }
  .flashlog, .flashlog tbody, .flashlog tr, .flashlog td { display: block; width: 100%; }
  .flashlog thead { display: none; }
  .flashlog tbody tr { margin-bottom: 8px; padding: 6px 10px; background: var(--bg-1); border: 1px solid var(--rule); }
  .flashlog tbody tr:hover td { background: transparent; }
  .flashlog td { display: flex; gap: 10px; padding: 3px 0; border: 0; white-space: normal; overflow-wrap: anywhere; }
  .flashlog td::before {
    content: attr(data-label); flex: 0 0 84px;
    font-size: 10px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-2);
  }
  .flashlog td[colspan]::before { content: none; }
}
