/* Vitals admin.
 *
 * Same tokens as the app, deliberately: this is the same product seen from the
 * other side, and a second visual language would be two things to maintain and
 * one more chance to drift.
 *
 * It is not, however, dressed up. There are no gauges, no rings and no accent
 * fills on data, because none of the numbers here are about a body. Accent is
 * reserved for the one control that does something.
 */

*, *::before, *::after { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--color-paper);
  color: var(--color-ink);
  font-family: var(--font-body);
  font-size: var(--text-base);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

h1 {
  margin: 0;
  font-family: var(--font-display);
  font-size: var(--text-2xl);
  font-weight: 700;
  font-stretch: 95%;
  letter-spacing: -0.02em;
}

/* Layout ------------------------------------------------------------------ */

.screen {
  max-width: 1040px;
  margin: 0 auto;
  padding: var(--space-xl) var(--space-md) var(--space-2xl);
  display: flex;
  flex-direction: column;
  gap: var(--space-lg);
}

.screen--centred {
  max-width: 400px;
  justify-content: center;
  min-height: 100dvh;
}

.stack { display: flex; flex-direction: column; gap: var(--space-md); }
.row { display: flex; align-items: center; gap: var(--space-sm); }
.row--between { justify-content: space-between; }
.grow { flex: 1; min-width: 0; }
.centre { text-align: center; }
.hidden { display: none !important; }

.muted { color: var(--color-muted); }
.faint { color: var(--color-neutral); }
.small { font-size: var(--text-sm); }
.tiny  { font-size: var(--text-xs); }

.masthead__date {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--color-neutral);
  margin-top: var(--space-2xs);
}

/* Cards and forms --------------------------------------------------------- */

.card {
  background: var(--color-paper-2);
  border: var(--rule);
  border-radius: var(--radius);
  padding: var(--space-md);
}

.card--table { padding: 0; overflow: hidden; }

label {
  display: block;
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--color-neutral);
  margin-bottom: var(--space-xs);
}

input[type='text'], input[type='password'] {
  width: 100%;
  min-height: 48px;
  padding: var(--space-sm) var(--space-md);
  background: var(--color-paper-3);
  border: 1px solid var(--color-rule);
  border-radius: var(--radius-sm);
  color: var(--color-ink);
  font-family: var(--font-body);
  font-size: var(--text-field);
  outline: 2px solid transparent;
}

input:focus-visible {
  outline: 2px solid var(--color-focus);
  outline-offset: 1px;
  border-color: transparent;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 48px;
  padding: var(--space-sm) var(--space-lg);
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  background: var(--color-accent);
  color: var(--color-on-accent);
  font-family: var(--font-body);
  font-size: var(--text-base);
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: background var(--dur-micro) var(--ease-out);
}

.btn:hover { background: var(--color-accent-hot); }
.btn:focus-visible { outline: 2px solid var(--color-focus); outline-offset: 2px; }
.btn:disabled { opacity: 0.45; cursor: default; }

.btn--ghost {
  background: transparent;
  color: var(--color-ink);
  border-color: var(--color-rule);
}
.btn--ghost:hover { background: var(--color-paper-3); }

.btn--inline {
  width: auto;
  min-height: 36px;
  padding: var(--space-2xs) var(--space-sm);
  font-size: var(--text-sm);
}

.notice {
  padding: var(--space-sm) var(--space-md);
  border-radius: var(--radius-sm);
  font-size: var(--text-sm);
}
.notice--error {
  background: color-mix(in oklab, var(--color-signal-low) 16%, transparent);
  color: var(--color-signal-low);
}

/* Tiles ------------------------------------------------------------------- */

.tiles {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: var(--space-sm);
}

.tile {
  background: var(--color-paper-2);
  border: var(--rule);
  border-radius: var(--radius);
  padding: var(--space-md);
}

.tile__value {
  font-family: var(--font-display);
  font-size: var(--text-2xl);
  font-weight: 700;
  font-stretch: 90%;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.tile__label {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-neutral);
  margin-top: var(--space-xs);
}

/* Table ------------------------------------------------------------------- *
 * Wide content scrolls inside its own container rather than making the page
 * scroll sideways, which on a phone is the difference between a table and a
 * mess. */

.table-scroll { overflow-x: auto; }

.grid {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--text-sm);
  white-space: nowrap;
}

.grid th {
  text-align: left;
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  font-weight: 500;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--color-neutral);
  padding: var(--space-sm) var(--space-md);
  border-bottom: 1px solid var(--color-rule);
  position: sticky;
  top: 0;
  background: var(--color-paper-2);
}

.grid td {
  padding: var(--space-sm) var(--space-md);
  border-bottom: 1px solid var(--color-rule-soft);
  font-variant-numeric: tabular-nums;
}

.grid tbody tr:last-child td { border-bottom: none; }
.grid tbody tr:hover { background: var(--color-paper-3); }

.num { text-align: right; }
.grid td.num { text-align: right; }

/* A masked address is the default state, and revealing one is a decision.
 * Styled as a control rather than as text so that is obvious. */
.email {
  display: inline-flex;
  align-items: center;
  gap: var(--space-xs);
  font-family: var(--font-mono);
  font-size: var(--text-xs);
}

.reveal {
  background: none;
  border: 1px solid var(--color-rule);
  border-radius: var(--radius-pill);
  padding: 2px var(--space-xs);
  color: var(--color-muted);
  font-family: var(--font-mono);
  font-size: var(--text-2xs);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  cursor: pointer;
}

.reveal:hover { background: var(--color-paper-3); color: var(--color-ink); }
.reveal:focus-visible { outline: 2px solid var(--color-focus); outline-offset: 2px; }

/* State words, never a bare colour: this panel gets read at a glance and a hue
 * on its own is not a message everyone receives. */
.state { font-family: var(--font-mono); font-size: var(--text-xs); letter-spacing: 0.05em; }
.state--on  { color: var(--color-signal-good); }
.state--off { color: var(--color-neutral); }

.empty {
  padding: var(--space-xl);
  text-align: center;
  color: var(--color-neutral);
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 0.01ms !important; }
}
