/* The ops panel: one stylesheet, no framework, no web font.
 *
 * The same visual language as the shop - a night ground, the crust accent - but built for somebody
 * reading numbers rather than choosing a package: tight rows, small type, bars and pips instead of
 * sentences, and colour used for meaning only (a state that is wrong, a bar that is filling).
 */

:root {
  --bg: #14110E; --panel: #1B1815; --line: #2A251F; --ink: #F3F0E8; --dim: #9C978F;
  --accent: #E2703A; --good: #6FBF73; --warn: #E2B23A; --bad: #E2503A; --cool: #6FA8DC;
  --row: #221E1A;
}
@media (prefers-color-scheme: light) {
  :root { --bg: #EAE5DA; --panel: #F5F2EA; --line: #D8D2C6; --ink: #161310; --dim: #6E6960;
          --row: #EFEBE2; }
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; background: var(--bg); color: var(--ink);
  font: 14px/1.5 -apple-system, "Segoe UI", system-ui, Roboto, sans-serif; }
main { max-width: 1180px; margin: 0 auto; padding: 22px 18px 60px; }
h2 { font-size: 13px; letter-spacing: .16em; text-transform: uppercase; margin: 0; font-weight: 600; }
a { color: var(--accent); }
.quiet { color: var(--dim); font-size: 12px; }
.grow { flex: 1; }
.brand { letter-spacing: .3em; font-weight: 300; text-transform: uppercase; }
.brand b { font-weight: 600; color: var(--accent); }

/* -- cards ---------------------------------------------------------------------------------- */
.grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
/* A grid item defaults to `min-width: auto`, which means it grows to fit its content instead of
   letting the content scroll inside it - the reason a wide table pushed the whole page sideways on a
   phone rather than scrolling within its card. */
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 14px 16px;
  min-width: 0; }
.card.wide { grid-column: 1 / -1; }
.card .hd { display: flex; align-items: baseline; gap: 10px; margin-bottom: 10px; }
@media (max-width: 860px) { .grid { grid-template-columns: 1fr; } }

.top { display: flex; align-items: center; gap: 12px; padding-bottom: 14px; }
.top .who { color: var(--dim); font-size: 12px; }
.foot { margin-top: 18px; text-align: center; }

/* -- controls ------------------------------------------------------------------------------- */
button { font: inherit; border-radius: 8px; padding: 9px 14px; border: 1px solid var(--line);
  background: var(--row); color: var(--ink); cursor: pointer; }
button:hover { border-color: var(--dim); }
button.primary { background: var(--accent); border-color: var(--accent); color: #161310; font-weight: 600;
  width: 100%; padding: 12px; }
button.danger { background: var(--bad); border-color: var(--bad); color: #161310; font-weight: 600; }
button.ghost { background: transparent; }
button.small { padding: 5px 9px; font-size: 12px; }
input, select { font: inherit; background: var(--row); color: var(--ink); border: 1px solid var(--line);
  border-radius: 8px; padding: 9px 11px; width: 100%; }
label { display: block; margin: 10px 0 4px; color: var(--dim); font-size: 12px; }
details.fold { margin-top: 14px; border-top: 1px solid var(--line); padding-top: 10px; }
details.fold > summary { cursor: pointer; color: var(--dim); font-size: 12px; }
.action { display: grid; grid-template-columns: 1fr 1.4fr auto; gap: 8px; align-items: center; }
@media (max-width: 640px) { .action { grid-template-columns: 1fr; } }
.msg { min-height: 18px; margin: 8px 0 0; font-size: 12px; color: var(--dim); }
.msg.bad { color: var(--bad); }
.msg.good { color: var(--good); }
.lede { color: var(--dim); margin: 4px 0 15px; }
.warn { background: rgba(226,80,58,.10); border-left: 3px solid var(--bad); border-radius: 4px;
  padding: 8px 10px; font-size: 12px; margin: 0 0 12px; }
.card.signin { max-width: 420px; margin: 12vh auto; }

/* A wide table scrolls inside its own card rather than pushing the page sideways: the rows are
   numbers and must not be wrapped, and a panel read on a phone should still fit the screen. */
.scroller { overflow-x: auto; }
.scroller > table { min-width: 620px; }

/* -- rows and bars -------------------------------------------------------------------------- */
table.rows { width: 100%; border-collapse: collapse; }
table.rows td, table.rows th { padding: 6px 6px; text-align: left; border-bottom: 1px solid var(--line);
  font-size: 13px; white-space: nowrap; }
table.rows th { color: var(--dim); font-weight: 500; font-size: 11px; letter-spacing: .1em;
  text-transform: uppercase; }
table.rows tr:last-child td { border-bottom: 0; }
table.rows.compact td { padding: 3px 6px; font-size: 12px; }
table.rows td.num { text-align: right; font-variant-numeric: tabular-nums; }
table.rows tr.badrow td { color: var(--bad); }

.pips { display: inline-flex; gap: 4px; }
.pip { width: 9px; height: 9px; border-radius: 50%; background: var(--line); display: inline-block; }
.pip.on { background: var(--good); }
.pip.off { background: var(--bad); }

/* A bar is a span, and a span is inline - where `width` and `height` do nothing at all. Inline-block
   is what makes it a shape in both places it is used: as a grid item beside a label, and inside a
   table cell on the nodes card. */
.bar { position: relative; height: 8px; background: var(--line); border-radius: 4px; overflow: hidden;
  min-width: 70px; display: inline-block; vertical-align: middle; width: 100%; }
.bar > i { position: absolute; inset: 0 auto 0 0; background: var(--accent); display: block; }
.bar > i.good { background: var(--good); }
.bar > i.warn { background: var(--warn); }
.bar > i.bad { background: var(--bad); }
.bar > i.cool { background: var(--cool); }
.barline { display: grid; grid-template-columns: 88px 1fr 84px; gap: 10px; align-items: center;
  padding: 4px 0; font-size: 13px; }
.barline .val { text-align: right; color: var(--dim); font-variant-numeric: tabular-nums; }
.split { display: flex; gap: 2px; height: 8px; border-radius: 4px; overflow: hidden; }
.split > span { display: block; height: 100%; }
.key { display: flex; gap: 12px; color: var(--dim); font-size: 11px; margin-top: 6px; }
.key i { display: inline-block; width: 9px; height: 9px; border-radius: 2px; margin-right: 4px; }
.tag { border: 1px solid var(--line); border-radius: 999px; padding: 1px 8px; font-size: 11px; color: var(--dim); }
