/*
  The console's own stylesheet.

  Its own, and not the product's: this page is read by two or three people who
  operate the server, and the thing it has to do is show a machine's state at a
  glance. Borrowing the admin's stylesheet would mean every change to how a
  customer's screens look could move something here, for no gain to anybody.

  Dark, because the console it replaces was dark and the people who open it
  open it at night.
*/
:root {
  --bg: #0f1719;
  --surface: #16211f;
  --surface-2: #1e2c29;
  --hairline: #273a36;
  --text: #e8efec;
  --muted: #92a8a2;
  --brand: #4fd1b5;
  --warm: #e0a33c;
  --hot: #e0674f;
  --radius: 12px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.6 system-ui, -apple-system, "Segoe UI", Tahoma, sans-serif;
}

a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 0.9em; }

.appbar {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 14px 20px;
  background: var(--surface);
  border-bottom: 1px solid var(--hairline);
}
.appbar__brand { color: var(--text); font-weight: 700; letter-spacing: 0.01em; }
.appbar__brand span { color: var(--muted); font-weight: 400; margin-inline-start: 8px; font-size: 0.85em; }
.appbar__spacer { flex: 1; }
.appbar__who { color: var(--muted); font-size: 0.88em; }

.content { max-width: 1100px; margin: 0 auto; padding: 22px 16px 60px; }

.card {
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-radius: var(--radius);
  overflow: hidden;
}
.card + .card { margin-top: 18px; }
.card__head {
  display: flex;
  align-items: baseline;
  gap: 12px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--hairline);
}
.card__head h2 { margin: 0; font-size: 1rem; font-weight: 650; }
.card__body { padding: 16px 18px; }
.card__body--flush { padding: 0; }

.muted { color: var(--muted); }
.small { font-size: 0.86em; }
.tiny { font-size: 0.78em; }
.bold { font-weight: 650; }
.mb-2 { margin-bottom: 18px; }
.mt-2 { margin-top: 18px; }

.alert {
  padding: 12px 16px;
  border-radius: var(--radius);
  border: 1px solid var(--hairline);
  background: var(--surface-2);
}
.alert--error { border-color: #5b2a24; background: #2a1a18; }
.alert--warning { border-color: #54401d; background: #272017; }
.alert--ok { border-color: #1f4a40; background: #15241f; }

.btn {
  display: inline-block;
  padding: 8px 14px;
  border-radius: 9px;
  border: 1px solid var(--hairline);
  background: var(--surface-2);
  color: var(--text);
  font: inherit;
  font-size: 0.9em;
  cursor: pointer;
}
.btn:hover { border-color: var(--brand); text-decoration: none; }
.btn--primary { background: var(--brand); border-color: var(--brand); color: #07211c; font-weight: 650; }
.btn--danger { border-color: #5b2a24; color: #f0a99c; }
.btn--sm { padding: 5px 10px; font-size: 0.82em; }

.field { display: flex; flex-direction: column; gap: 5px; }
.field label { font-size: 0.85em; color: var(--muted); }
.field input, .field select {
  padding: 8px 10px;
  border-radius: 9px;
  border: 1px solid var(--hairline);
  background: var(--bg);
  color: var(--text);
  font: inherit;
}
.row { display: flex; flex-wrap: wrap; gap: 14px; align-items: flex-end; }
.grow { flex: 1; min-width: 180px; }

.table { width: 100%; border-collapse: collapse; }
.table th, .table td { padding: 11px 14px; text-align: start; border-bottom: 1px solid var(--hairline); }
.table th { font-size: 0.78em; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); font-weight: 600; }
.table tr:last-child td { border-bottom: 0; }
.table .num { text-align: end; font-variant-numeric: tabular-nums; }
.empty { padding: 28px; text-align: center; color: var(--muted); }

.badge {
  display: inline-block;
  padding: 2px 9px;
  border-radius: 999px;
  font-size: 0.75em;
  font-weight: 650;
  border: 1px solid var(--hairline);
  background: var(--surface-2);
  color: var(--muted);
}
.badge--live { border-color: #1f4a40; background: #15241f; color: var(--brand); }
.badge--paused { border-color: #54401d; background: #272017; color: var(--warm); }
.badge--gone { border-color: #5b2a24; background: #2a1a18; color: #f0a99c; }

/* The server's gauges. Three bars rather than three numbers: the question is
   "how close to full", and a bar answers it at a glance where 71.4% has to be
   read and then compared against a limit nobody remembers. */
.gauges { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 22px; }
.gauge__head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 7px; }
.gauge__name { font-weight: 600; font-size: 0.86em; }
.gauge__figure { font-size: 1.2rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.gauge__track { height: 9px; border-radius: 999px; background: var(--surface-2); overflow: hidden; }
.gauge__fill { height: 100%; border-radius: 999px; background: var(--brand); transition: width 0.4s ease; }
/* Amber then red, at the points where somebody should act rather than where a
   number happens to look large. */
.gauge__fill--warm { background: var(--warm); }
.gauge__fill--hot { background: var(--hot); }
.gauge__note { margin-top: 6px; font-size: 0.78em; color: var(--muted); }

.spin {
  display: inline-block;
  width: 13px; height: 13px;
  margin-inline-end: 8px;
  vertical-align: -2px;
  border: 2px solid currentColor;
  border-top-color: transparent;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
/* Somebody watching a build for three minutes should not have to watch a
   wheel turn as well if their machine is set to keep still. */
@media (prefers-reduced-motion: reduce) { .spin { animation: none; opacity: 0.5; } }

.output {
  margin: 0;
  padding: 12px 14px;
  background: var(--bg);
  border: 1px solid var(--hairline);
  border-radius: 9px;
  max-height: 22rem;
  overflow: auto;
  white-space: pre-wrap;
  word-break: break-word;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.78rem;
  direction: ltr;
  text-align: left;
}

.login { max-width: 23rem; margin: 12vh auto; }

.actions { display: flex; flex-wrap: wrap; gap: 10px; }
.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 16px; }
.fact__label { font-size: 0.78em; color: var(--muted); }
.fact__value { font-weight: 650; }
