/* The operator console's only stylesheet.
 *
 * No framework and no build step: the shell is one page (sign in, then the platform's current state), so a token
 * block, a handful of blocks and a form is the whole of it. A design system arrives with MR-13's review queue, which
 * is the first page with enough surface to need one. */

:root {
  --bg: #0b1017;
  --panel: #121a24;
  --panel-2: #16202c;
  --line: #223040;
  --ink: #e8eef5;
  --muted: #94a6b8;
  --ok: #4ade80;
  --bad: #f87171;
  --accent: #58c4f0;
  --radius: 14px;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  min-height: 100%;
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

body {
  background-image:
    radial-gradient(900px 420px at 12% -10%, rgba(88, 196, 240, 0.10), transparent 60%),
    radial-gradient(700px 380px at 100% 0%, rgba(74, 222, 128, 0.06), transparent 55%);
  background-repeat: no-repeat;
}

.app { min-height: 100vh; }

/* ---------- sign in ---------- */

.signin {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.signin__card {
  width: 100%;
  max-width: 420px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 28px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.45);
}

.signin__head {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  margin-bottom: 22px;
}

.signin__title {
  margin: 0;
  font-size: 22px;
  letter-spacing: -0.01em;
}

.signin__lede {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 14px;
}

.signin__foot {
  margin: 18px 0 0;
  color: var(--muted);
  font-size: 13px;
  border-top: 1px solid var(--line);
  padding-top: 14px;
}

.mark {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  flex: 0 0 40px;
  border-radius: 10px;
  background: linear-gradient(160deg, var(--accent), #2b7fa8);
  color: #04121a;
  font-weight: 700;
  font-size: 14px;
  letter-spacing: 0.04em;
}

.form { display: grid; gap: 14px; }

.field { display: grid; gap: 6px; }

.field__label {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
}

.field__input {
  width: 100%;
  padding: 11px 12px;
  border-radius: 9px;
  border: 1px solid var(--line);
  background: #0d141d;
  color: var(--ink);
  font: inherit;
  font-size: 15px;
}

.field__input:focus {
  outline: 2px solid rgba(88, 196, 240, 0.45);
  outline-offset: 1px;
  border-color: var(--accent);
}

.field__input--code { font-family: var(--mono); letter-spacing: 0.22em; }

.btn {
  appearance: none;
  border: 1px solid transparent;
  border-radius: 9px;
  padding: 11px 16px;
  font: inherit;
  font-weight: 600;
  font-size: 15px;
  background: var(--accent);
  color: #04121a;
  cursor: pointer;
}

.btn:hover { filter: brightness(1.08); }

.btn--busy { opacity: 0.6; cursor: progress; }

.btn--ghost {
  background: transparent;
  border-color: var(--line);
  color: var(--ink);
  font-weight: 500;
  font-size: 14px;
  padding: 8px 12px;
}

.btn--ghost:hover { border-color: var(--accent); color: var(--accent); filter: none; }

.form__error {
  min-height: 20px;
  color: var(--bad);
  font-size: 14px;
}

/* ---------- console ---------- */

.console {
  max-width: 1080px;
  margin: 0 auto;
  padding: 28px 20px 48px;
  display: grid;
  gap: 22px;
}

.top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.top__brand { display: flex; align-items: center; gap: 12px; }

.top__title { margin: 0; font-size: 19px; letter-spacing: -0.01em; }

.top__sub {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.top__right { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }

.chip {
  font-family: var(--mono);
  font-size: 12px;
  padding: 5px 9px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--panel-2);
  color: var(--ink);
}

.chip--dim { color: var(--muted); }

.who { color: var(--muted); font-size: 14px; }

.panels { display: grid; gap: 16px; }

.grid {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
}

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px 20px;
}

.panel--quiet { display: flex; justify-content: center; }

.panel--bad { border-color: rgba(248, 113, 113, 0.45); }

.panel__title {
  margin: 0 0 12px;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted);
  font-weight: 600;
}

.panel__body { display: grid; gap: 10px; }

.row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  padding: 6px 0;
  border-bottom: 1px solid rgba(34, 48, 64, 0.55);
}

.row:last-child { border-bottom: 0; }

.row__label { color: var(--muted); font-size: 14px; }

.row__value {
  font-family: var(--mono);
  font-size: 13px;
  text-align: right;
  word-break: break-word;
}

.row__value--ok { color: var(--ok); }
.row__value--bad { color: var(--bad); }

.deps { display: grid; gap: 8px; }

.dep {
  display: grid;
  grid-template-columns: 10px 1fr auto;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 9px;
  background: var(--panel-2);
}

.dep__dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--muted);
}

.dep--ok .dep__dot { background: var(--ok); box-shadow: 0 0 10px rgba(74, 222, 128, 0.5); }
.dep--bad .dep__dot { background: var(--bad); box-shadow: 0 0 10px rgba(248, 113, 113, 0.5); }

.dep__name { font-family: var(--mono); font-size: 13px; }

.dep__state { font-size: 12px; color: var(--muted); }

.dep--bad .dep__state { color: var(--bad); }

.endpoints { display: flex; flex-wrap: wrap; gap: 8px; }

.endpoint {
  font-family: var(--mono);
  font-size: 12px;
  padding: 4px 8px;
  border-radius: 7px;
  background: var(--panel-2);
  border: 1px solid var(--line);
}

.muted { color: var(--muted); margin: 0; }
.small { font-size: 13px; }
.warn { color: var(--bad); margin: 0; }
.reason { margin: 0 0 12px; font-family: var(--mono); font-size: 13px; color: var(--bad); }

.foot {
  color: var(--muted);
  font-size: 12px;
  border-top: 1px solid var(--line);
  padding-top: 16px;
}

@media (max-width: 560px) {
  .console { padding: 20px 14px 36px; }
  .row { flex-direction: column; gap: 2px; }
  .row__value { text-align: left; }
}
