/* Dark Ops, carried over from the Project Hellgate panel so this one is
   the same panel wearing a different name. Token values are copied from
   that stylesheet verbatim - they are the settled ones, and a second
   opinion about the accent colour here would make two panels instead of
   one look. */

:root {
  --page: #0a0c12;
  --surface: #10131b;
  --surface-2: #171b26;
  --surface-3: #1e2331;
  --ink: #e8eaf2;
  --ink-2: #a8adbd;
  --muted: #6d7385;
  --hairline: #232837;
  --baseline: #333a4e;
  --accent: #9085e9;
  --series: #3987e5;
  --good: #0ca30c;
  --good-text: #35c435;
  --warn: #fab219;
  --crit: #d03b3b;
  --crit-text: #e66767;
  --radius: 10px;
  --radius-sm: 6px;
  --ui: "Segoe UI Variable Text", "Segoe UI", system-ui, sans-serif;
  --num: "Cascadia Mono", Consolas, ui-monospace, monospace;
  --mono: "Cascadia Mono", Consolas, ui-monospace, SFMono-Regular, monospace;
  --fs: 13px;
  --fs-h1: 19px;
  --fs-h2: 15px;
  --fs-table: 12px;
  --fs-small: 11px;
  --lh: 1.5;
  --card-bg: var(--surface);
  --card-pad: 14px;
  --plate-lit: inset 0 1px 0 rgba(255, 255, 255, 0.045);
  --card-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.045),
                 0 1px 2px rgba(0, 0, 0, 0.35),
                 0 10px 28px rgba(0, 0, 0, 0.16);
  --cell-pad: 8px 10px;
  --gap: 14px;
  --main-pad: 20px;
  --main-max: 1180px;
  --pill-radius: 999px;
  --head-transform: uppercase;
  --head-spacing: 0.06em;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--page);
  color: var(--ink);
  font: var(--fs)/var(--lh) var(--ui);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a { color: var(--accent); }

/* ---- the badge. Full width, every page, including login. ---- */

.badge {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 7px 12px;
  font-weight: 700;
  font-size: 12px;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: #08120a;
}

.badge--live { background: var(--good); }
.badge--down { background: var(--crit); color: #1a0606; }
.badge__instance { opacity: 0.75; font-weight: 600; }

/* ---- shell ---- */

.nav {
  display: flex;
  align-items: center;
  gap: 3px;
  flex-wrap: wrap;
  padding: 9px 18px;
  background: var(--surface);
  border-bottom: 1px solid var(--hairline);
  position: sticky;
  top: 0;
  z-index: 20;
}

.brand { display: inline-flex; align-items: baseline; gap: 8px; margin-right: 10px; }

.brand__mark {
  font-weight: 800;
  letter-spacing: 0.10em;
  font-size: 13px;
  color: var(--accent) !important;
  text-decoration: none;
  padding: 0 !important;
  background: none !important;
}

.brand__name {
  color: var(--muted);
  font-size: var(--fs-small);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.nav a {
  padding: 7px 11px;
  border-radius: var(--radius-sm);
  color: var(--ink-2);
  text-decoration: none;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  white-space: nowrap;
}

.nav a:hover { color: var(--ink); background: var(--surface-2); text-decoration: none; }
.nav a.is-active { color: var(--accent); background: var(--surface-2); }
.nav__spacer { flex: 1; }
.nav__me { display: inline-flex; align-items: center; gap: 8px; }

.nav__user { color: var(--muted); font-size: 11px; letter-spacing: 0.05em; }

main { max-width: var(--main-max); margin: 0 auto; padding: var(--main-pad); }

h1 {
  font-size: var(--fs-h1);
  margin: 0 0 14px;
  letter-spacing: 0.02em;
}

h2 {
  font-size: var(--fs-h2);
  margin: 0 0 10px;
  letter-spacing: var(--head-spacing);
  text-transform: var(--head-transform);
  color: var(--ink-2);
  font-weight: 600;
}

/* ---- cards ---- */

.card {
  background: var(--card-bg);
  border: 1px solid var(--hairline);
  border-radius: var(--radius);
  padding: var(--card-pad);
  box-shadow: var(--card-shadow);
}

.grid { display: grid; gap: var(--gap); }
.grid--2 { grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); }
.grid--3 { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.stack > * + * { margin-top: var(--gap); }

/* ---- the verdict plate. The first thing on the page says up or down,
   in words, at a size you can read from across the room. ---- */

.verdict {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 18px var(--card-pad);
  border-radius: var(--radius);
  border: 1px solid var(--hairline);
  box-shadow: var(--card-shadow);
  background: var(--surface);
}

.verdict--up { border-color: #1d4a1d; }
.verdict--down { border-color: #5a2020; }

.verdict__dot {
  width: 14px; height: 14px; border-radius: 999px; flex: none;
  box-shadow: 0 0 0 4px rgba(255,255,255,0.03);
}
.verdict--up .verdict__dot { background: var(--good-text); }
.verdict--down .verdict__dot { background: var(--crit-text); }

.verdict__word {
  font-size: 26px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.verdict--up .verdict__word { color: var(--good-text); }
.verdict--down .verdict__word { color: var(--crit-text); }
.verdict__detail { color: var(--ink-2); }
.verdict__spacer { flex: 1; }

/* ---- key/value rows ---- */

.kv { display: flex; justify-content: space-between; gap: 12px; padding: 5px 0; }
.kv + .kv { border-top: 1px solid var(--hairline); }
.kv__k { color: var(--muted); }
.kv__v { color: var(--ink); text-align: right; }

.mono, .num { font-family: var(--num); font-size: var(--fs-table); }
.dim { color: var(--muted); }
.big { font-family: var(--num); font-size: 22px; font-weight: 600; letter-spacing: -0.01em; }

/* ---- stat tiles ---- */

.stat { text-align: left; }
.stat__k {
  color: var(--muted);
  font-size: var(--fs-small);
  letter-spacing: var(--head-spacing);
  text-transform: var(--head-transform);
}
.stat__v { font-family: var(--num); font-size: 22px; font-weight: 600; margin-top: 2px; }
.stat__sub { color: var(--muted); font-size: var(--fs-small); }

/* ---- meters. A bar is the only honest way to show "how full". ---- */

.meter {
  height: 6px;
  background: var(--surface-3);
  border-radius: 999px;
  overflow: hidden;
  margin-top: 7px;
}
.meter__fill { height: 100%; background: var(--series); border-radius: 999px; }
.meter__fill--warn { background: var(--warn); }
.meter__fill--crit { background: var(--crit); }

/* ---- tables ---- */

table { width: 100%; border-collapse: collapse; font-size: var(--fs-table); }
th {
  text-align: left;
  color: var(--muted);
  font-weight: 600;
  font-size: var(--fs-small);
  letter-spacing: var(--head-spacing);
  text-transform: var(--head-transform);
  padding: var(--cell-pad);
  border-bottom: 1px solid var(--hairline);
}
td { padding: var(--cell-pad); border-bottom: 1px solid var(--hairline); vertical-align: middle; }
tr:last-child td { border-bottom: none; }
.tbl-wrap { overflow-x: auto; }

/* ---- status pills. Always icon plus text, never colour alone. ---- */

.pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 8px;
  border-radius: var(--pill-radius);
  font-size: var(--fs-small);
  font-weight: 600;
  letter-spacing: 0.04em;
  border: 1px solid;
  white-space: nowrap;
}
.pill--good { color: var(--good-text); border-color: #1d4a1d; background: #0d1a0d; }
.pill--warn { color: var(--warn); border-color: #4a3a10; background: #1a1408; }
.pill--crit { color: var(--crit-text); border-color: #5a2020; background: #1a0d0d; }
.pill--idle { color: var(--muted); border-color: var(--hairline); background: var(--surface-2); }

/* ---- buttons ---- */

button, .linkbtn {
  font: inherit;
  font-size: var(--fs-small);
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-2);
  background: var(--surface-2);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-sm);
  padding: 6px 12px;
  cursor: pointer;
}
button:hover { color: var(--ink); background: var(--surface-3); }
button:disabled { opacity: 0.35; cursor: not-allowed; }
button.primary { color: #0a0c12; background: var(--accent); border-color: var(--accent); }
button.primary:hover { filter: brightness(1.1); color: #0a0c12; }
button.danger { color: var(--crit-text); border-color: #5a2020; }
button.danger:hover { color: #fff; background: var(--crit); border-color: var(--crit); }

.btnrow { display: flex; gap: 6px; flex-wrap: wrap; }

/* ---- console / log tail ---- */

.console {
  background: #06080d;
  border: 1px solid var(--hairline);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  font-family: var(--mono);
  font-size: var(--fs-table);
  line-height: 1.45;
  color: var(--ink-2);
  max-height: 520px;
  overflow: auto;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.console .l-err { color: var(--crit-text); }
.console .l-warn { color: var(--warn); }
.console .l-ok { color: var(--good-text); }

/* ---- flash messages ---- */

.flash {
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid;
  margin-bottom: var(--gap);
  font-weight: 600;
}
.flash--ok { color: var(--good-text); border-color: #1d4a1d; background: #0d1a0d; }
.flash--err { color: var(--crit-text); border-color: #5a2020; background: #1a0d0d; }

/* ---- login ---- */

.login-wrap { max-width: 340px; margin: 12vh auto; }
input[type=text], input[type=password] {
  width: 100%;
  font: inherit;
  color: var(--ink);
  background: var(--surface-2);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-sm);
  padding: 9px 11px;
  margin-top: 4px;
}
input:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
label { display: block; color: var(--muted); font-size: var(--fs-small);
        letter-spacing: var(--head-spacing); text-transform: var(--head-transform);
        margin-top: 12px; }

@media (max-width: 720px) {
  th, td { overflow-wrap: anywhere; }
  .kv__v { overflow-wrap: anywhere; }
  main { padding: 12px; }
  .verdict__word { font-size: 20px; }
}

/* ---------------------------------------------------------------------
   UTILITIES, and they exist because of a measured defect rather than a
   preference.

   The CSP on every page is `style-src 'self'`, which blocks a style=""
   attribute outright. The first build of this panel used inline styles for
   spacing and for the meter widths, and the browser refused all 22 of them:
   the page still LOOKED styled, because every class still worked, and the
   four meters silently rendered full-width - so an idle box read as a
   machine at 100% CPU, memory and disk.

   Looking at a page cannot tell a rule that is missing from a rule that is
   subtle. It was caught by reading the console, not by looking.

   So: no inline styles anywhere, and the meter width is a class.
   --------------------------------------------------------------------- */

.mt { margin-top: var(--gap); }
.mt-sm { margin-top: 10px; }
.mt-tight { margin-top: -4px; }
.mb-xs { margin-bottom: 6px; }
.mb-sm { margin-bottom: 10px; }
.mb-lg { margin-bottom: 18px; }
.normal { font-weight: 400; }
.bold { font-weight: 600; }
.center { text-align: center; }
.inline { display: inline; }
.fs-10 { font-size: 10px; }
.fs-16 { font-size: 16px; }
.fs-17 { font-size: 17px; }
.fs-small { font-size: var(--fs-small); }
.sub { color: var(--muted); font-size: var(--fs-small);
       letter-spacing: var(--head-spacing); text-transform: var(--head-transform); }
.logo { font-weight: 800; letter-spacing: 0.10em; color: var(--accent); }
.wide { width: 100%; margin-top: 16px; padding: 10px; }
.linkbtn { text-decoration: none; display: inline-block; }
.linkbtn.is-here { color: var(--accent); border-color: var(--accent); }

/* Meter widths in 2% steps. A 2% step on a 330px bar is 6.6px, which is
   below what the eye resolves on a 6px-high bar, and it keeps the whole
   thing inside the CSP with no nonce and no 'unsafe-inline'. */
.w0{width:0%}.w2{width:2%}.w4{width:4%}.w6{width:6%}.w8{width:8%}
.w10{width:10%}.w12{width:12%}.w14{width:14%}.w16{width:16%}.w18{width:18%}
.w20{width:20%}.w22{width:22%}.w24{width:24%}.w26{width:26%}.w28{width:28%}
.w30{width:30%}.w32{width:32%}.w34{width:34%}.w36{width:36%}.w38{width:38%}
.w40{width:40%}.w42{width:42%}.w44{width:44%}.w46{width:46%}.w48{width:48%}
.w50{width:50%}.w52{width:52%}.w54{width:54%}.w56{width:56%}.w58{width:58%}
.w60{width:60%}.w62{width:62%}.w64{width:64%}.w66{width:66%}.w68{width:68%}
.w70{width:70%}.w72{width:72%}.w74{width:74%}.w76{width:76%}.w78{width:78%}
.w80{width:80%}.w82{width:82%}.w84{width:84%}.w86{width:86%}.w88{width:88%}
.w90{width:90%}.w92{width:92%}.w94{width:94%}.w96{width:96%}.w98{width:98%}
.w100{width:100%}

/* ---------------------------------------------------------------------
   THE SECOND ROW. Top tabs are the games; these are the sub tabs of the
   one you are on. Carried over from the Project Hellgate panel's
   .subtabs/.subtab so the two panels are one look and not two.
   --------------------------------------------------------------------- */

.subbar {
  background: var(--page);
  border-bottom: 1px solid var(--hairline);
  position: sticky;
  top: 0;
  z-index: 19;
}
.subbar__inner {
  max-width: var(--main-max);
  margin: 0 auto;
  padding: 8px var(--main-pad);
}
.subtabs { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.subtab {
  display: inline-block;
  padding: 6px 14px;
  border-radius: var(--radius-sm);
  color: var(--ink-2);
  text-decoration: none;
  font-size: 12.5px;
  font-weight: 600;
  border: 1px solid transparent;
}
.subtab:hover { background: var(--surface-2); color: var(--ink); }

/* THE CURRENT TAB CARRIES THE ACCENT AND A BORDER, not just a colour. A tab
   distinguished only by hue is a tab somebody cannot find. */
.subtab--here {
  background: color-mix(in srgb, var(--accent) 12%, transparent);
  border-color: var(--accent);
  color: var(--accent);
}
.subtabs__aside {
  margin-left: auto;
  color: var(--muted);
  font-family: var(--num);
  font-size: var(--fs-small);
}

/* ---- the space breakdown. HIS CONSTRAINT: "space is the bigger
   constraint on this vps". A bar per folder, biggest first, so the answer
   to "what do I delete" is on the screen and not a du command away. ---- */

.bars { display: flex; flex-direction: column; gap: 9px; }
.bar { display: flex; align-items: center; gap: 10px; }
.bar__label { flex: 0 0 210px; color: var(--ink-2); }
.bar__path { color: var(--muted); font-family: var(--mono); font-size: 10px; }
/* BOTH OF THESE ARE display:block AND THAT IS NOT COSMETIC. They were spans,
   and width does not apply to an inline element - so every fill carried a
   correct width class and rendered at exactly 0 pixels. The page looked like
   a tidy list of empty tracks and nobody could tell the 2 GB row from the
   2 MB one. Measured with getBoundingClientRect, not by looking. */
.bar__track { display: block; flex: 1; height: 10px; background: var(--surface-3);
              border-radius: 999px; overflow: hidden; }
.bar__fill { display: block; height: 100%; background: var(--series);
             border-radius: 999px; min-width: 2px; }
.bar__fill--big { background: var(--accent); }
.bar__val { flex: 0 0 90px; text-align: right; font-family: var(--num);
            font-size: var(--fs-table); }

@media (max-width: 720px) {
  .bar { flex-wrap: wrap; }
  .bar__label { flex: 1 1 100%; }
  .subbar__inner { padding: 8px 12px; }
}
