/* Console styling.
 *
 * Same tokens as gbnexus.id after P2 — the land→sea ramp, the ink scale, the
 * type scale — so the operational surface reads as the same institution rather
 * than as a different tool that happens to share a database. System fonts
 * rather than the web font: this is an internal screen on a venue network and
 * should not wait on a download to become legible.
 */

:root {
  --land: #1e7a46;
  --nexus: #12897e;
  --sea: #0f5e9c;
  --ink: #16323f;
  --ink-500: #3f5f6c;
  --ink-400: #64828d;
  --ink-100: #dae2e5;
  --ink-50: #edf1f2;
  --line: #d9e1e3;
  --paper: #f7f5f0;
  --white: #fff;
  --alarm: #a8431e;
  --alarm-bg: #f6e6de;
  --warn: #8a6415;
  --warn-bg: #f3ebda;
  --ok-bg: #dfeee6;
  --sans: "Plus Jakarta Sans", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, monospace;
}

* {
  box-sizing: border-box;
}

/* Any rule that sets `display` outranks the browser default for [hidden], so
 * the drawer (display:flex) and the tab bar (display:flex) both rendered on
 * load despite carrying the attribute. Everything here toggles visibility
 * through `hidden`, so it has to win. */
[hidden] {
  display: none !important;
}
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.55;
}

.rail {
  height: 3px;
  background: linear-gradient(90deg, var(--land) 0%, var(--nexus) 50%, var(--sea) 100%);
}
.top {
  background: var(--white);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 20;
}
.topbar {
  max-width: 1180px;
  margin: 0 auto;
  padding: 14px 24px;
  display: flex;
  gap: 16px;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
}
.topright {
  display: flex;
  gap: 10px;
  align-items: center;
}
h1 {
  font-size: 1.3rem;
  letter-spacing: -0.02em;
  margin: 2px 0 0;
}
h2 {
  font-size: 1.15rem;
  letter-spacing: -0.015em;
  margin: 32px 0 12px;
}
h3 {
  font-size: 0.95rem;
  margin: 26px 0 8px;
}
.eyebrow {
  margin: 0;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--nexus);
}
.muted {
  color: var(--ink-500);
  font-size: 0.88rem;
  max-width: 68ch;
}
.error {
  color: var(--alarm);
  font-weight: 700;
}
code {
  font-family: var(--mono);
  font-size: 0.85em;
  background: var(--ink-50);
  padding: 0.1em 0.35em;
  border-radius: 3px;
}

nav {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  gap: 4px;
  overflow-x: auto;
}
.tab {
  background: none;
  border: 0;
  border-bottom: 3px solid transparent;
  padding: 10px 14px;
  font: inherit;
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--ink-400);
  cursor: pointer;
  white-space: nowrap;
}
.tab[aria-current="true"] {
  color: var(--nexus);
  border-bottom-color: var(--nexus);
}
.tab:hover {
  color: var(--nexus);
}

main {
  max-width: 1180px;
  margin: 0 auto;
  padding: 24px 24px 96px;
}

.btn,
.btn-quiet {
  font: inherit;
  font-weight: 700;
  font-size: 0.88rem;
  border-radius: 999px;
  padding: 9px 18px;
  cursor: pointer;
  border: 1px solid transparent;
  display: inline-block;
  text-decoration: none;
}
.btn {
  background: var(--nexus);
  color: var(--white);
}
.btn:hover {
  background: #0f7268;
}
.btn-quiet {
  background: transparent;
  border-color: var(--line);
  color: var(--ink-500);
}
.btn-quiet:hover {
  border-color: var(--nexus);
  color: var(--nexus);
}

.chip {
  display: inline-flex;
  align-items: center;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 4px 10px;
  border-radius: 999px;
  white-space: nowrap;
}
.chip-idle {
  background: var(--ink-50);
  color: var(--ink-400);
}
.chip-ok {
  background: var(--ok-bg);
  color: var(--land);
}
.chip-warn {
  background: var(--warn-bg);
  color: var(--warn);
}
.chip-bad {
  background: var(--alarm-bg);
  color: var(--alarm);
}

#gate {
  max-width: 460px;
  margin: 48px auto;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 28px;
}
#gate h2 {
  margin-top: 0;
}
form label {
  display: block;
  font-size: 0.8rem;
  font-weight: 700;
  margin: 14px 0 5px;
}
input,
select,
textarea {
  font: inherit;
  width: 100%;
  padding: 9px 11px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--white);
  color: var(--ink);
}
textarea {
  resize: vertical;
}
#gate .btn {
  margin-top: 18px;
}

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 2px;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
}
.card {
  background: var(--white);
  padding: 16px 18px;
}
.card .n {
  font-size: 1.9rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.05;
  font-variant-numeric: tabular-nums;
}
.card .n.bad {
  color: var(--alarm);
}
.card .n.warn {
  color: var(--warn);
}
.card .n.go {
  color: var(--land);
}
.card .k {
  font-size: 0.8rem;
  color: var(--ink-500);
  margin-top: 4px;
}
.card.click {
  cursor: pointer;
}
.card.click:hover {
  background: var(--ink-50);
}

.tablewrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--white);
}
table {
  border-collapse: collapse;
  width: 100%;
  min-width: 640px;
  font-size: 0.9rem;
}
th {
  text-align: left;
  font-size: 0.68rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-400);
  padding: 11px 14px;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
td {
  padding: 11px 14px;
  border-bottom: 1px solid var(--ink-50);
  vertical-align: top;
}
tr:last-child td {
  border-bottom: 0;
}
tbody tr.click {
  cursor: pointer;
}
tbody tr.click:hover {
  background: var(--ink-50);
}
td.num {
  font-variant-numeric: tabular-nums;
  text-align: right;
}
td .sub {
  display: block;
  color: var(--ink-400);
  font-size: 0.82rem;
}

.filters {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 14px;
}
.filters label {
  margin: 0;
}
.filters select {
  width: auto;
  min-width: 180px;
}

.note {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 20px 22px;
  margin-top: 16px;
}
.note p {
  max-width: 72ch;
  color: var(--ink-500);
  font-size: 0.92rem;
}
.note p:first-child {
  margin-top: 0;
}

.alert {
  border-radius: 10px;
  padding: 12px 16px;
  margin-bottom: 10px;
  font-size: 0.9rem;
  font-weight: 600;
}
.alert-bad {
  background: var(--alarm-bg);
  color: var(--alarm);
}
.alert-warn {
  background: var(--warn-bg);
  color: var(--warn);
}

.drawer {
  position: fixed;
  inset: 0;
  background: rgba(22, 50, 63, 0.4);
  display: flex;
  justify-content: flex-end;
  z-index: 40;
}
.drawer-panel {
  background: var(--paper);
  width: min(560px, 100%);
  height: 100%;
  overflow-y: auto;
  padding: 24px;
  border-left: 1px solid var(--line);
}
.drawer-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}
.drawer-head h2 {
  margin: 0;
}
.drawer dl {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 6px 16px;
  margin: 18px 0;
  font-size: 0.9rem;
}
.drawer dt {
  font-weight: 700;
  color: var(--ink-500);
}
.drawer dd {
  margin: 0;
  overflow-wrap: anywhere;
}
.drawer form {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 18px;
}
.drawer form .btn {
  margin-top: 16px;
}

.history {
  list-style: none;
  padding: 0;
  margin: 10px 0 0;
  border-left: 2px solid var(--line);
}
.history li {
  padding: 0 0 16px 16px;
  position: relative;
  font-size: 0.88rem;
}
.history li::before {
  content: "";
  position: absolute;
  left: -5px;
  top: 6px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--nexus);
}
.history time {
  display: block;
  color: var(--ink-400);
  font-size: 0.78rem;
}
.history .move {
  font-weight: 700;
}

@media (prefers-reduced-motion: reduce) {
  * {
    transition: none !important;
    animation: none !important;
  }
}
