/* ---------- fontes (hospedadas localmente — nada chama fora deste domínio) ---------- */
@font-face {
  font-family: 'Space Grotesk';
  font-weight: 500;
  font-style: normal;
  font-display: swap;
  src: url('/fonts/space-grotesk-500.ttf') format('truetype');
}
@font-face {
  font-family: 'Space Grotesk';
  font-weight: 600;
  font-style: normal;
  font-display: swap;
  src: url('/fonts/space-grotesk-600.ttf') format('truetype');
}
@font-face {
  font-family: 'Space Grotesk';
  font-weight: 700;
  font-style: normal;
  font-display: swap;
  src: url('/fonts/space-grotesk-700.ttf') format('truetype');
}
@font-face {
  font-family: 'IBM Plex Sans';
  font-weight: 400;
  font-style: normal;
  font-display: swap;
  src: url('/fonts/ibm-plex-sans-400.ttf') format('truetype');
}
@font-face {
  font-family: 'IBM Plex Sans';
  font-weight: 500;
  font-style: normal;
  font-display: swap;
  src: url('/fonts/ibm-plex-sans-500.ttf') format('truetype');
}
@font-face {
  font-family: 'IBM Plex Sans';
  font-weight: 600;
  font-style: normal;
  font-display: swap;
  src: url('/fonts/ibm-plex-sans-600.ttf') format('truetype');
}

/* ---------- tokens ---------- */
:root {
  --bg: #eef2f4; --card: #fff; --fg: #0f2436; --muted: #5b6b78; --line: #d7dee3;
  --accent: #b8822c; --accent-ink: #8a5f1e; --accent-fg: #1a1203;
  --danger: #b3261e; --ok: #1f7a4d;
  --font-display: 'Space Grotesk', system-ui, sans-serif;
  --font-body: 'IBM Plex Sans', system-ui, -apple-system, "Segoe UI", sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0b1420; --card: #121c2a; --fg: #e7ecf0; --muted: #8fa0ad; --line: #233244;
    --accent: #d9a438; --accent-ink: #d9a438; --accent-fg: #1a1203;
    --danger: #ff8a80; --ok: #4caf7d;
    color-scheme: dark;
  }
}
@media (prefers-reduced-motion: reduce) {
  * { transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; }
}

/* ---------- base ---------- */
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--fg); font: 16px/1.55 var(--font-body); }
main { max-width: 900px; margin: 0 auto; padding: 32px 16px 64px; }
h1, h2 { font-family: var(--font-display); font-weight: 600; margin: 0; }
h2 { font-size: 1.05rem; margin-bottom: 16px; }

/* ---------- marca ---------- */
.brand { display: flex; align-items: center; gap: 12px; margin: 0 0 28px; }
.seal { width: 34px; height: 34px; flex-shrink: 0; color: var(--accent); }
.brand h1 { font-size: 1.2rem; letter-spacing: 0.01em; }
.tagline { font-size: 0.82rem; margin: 2px 0 0; }

/* ---------- cartões ---------- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: 8px; padding: 20px 22px; margin-bottom: 16px; }
#v-login, #v-forgot, #v-reset, #v-loading { max-width: 380px; margin-inline: auto; }
#v-login .card, #v-forgot .card, #v-reset .card {
  padding: 26px 24px;
  box-shadow: 0 10px 30px -14px rgb(15 36 54 / 0.22);
}
#admin .card.ledger { border-top: 3px solid var(--accent); }

/* ---------- formulários ---------- */
label { display: block; margin-bottom: 14px; font-size: 0.88rem; color: var(--muted); }
input, select {
  display: block; width: 100%; margin-top: 5px; padding: 10px 11px;
  font: inherit; color: var(--fg); background: var(--bg);
  border: 1px solid var(--line); border-radius: 6px;
}
input:focus-visible, select:focus-visible, button:focus-visible {
  outline: 2px solid var(--accent-ink); outline-offset: 1px;
}
button {
  font: inherit; font-weight: 500; cursor: pointer; padding: 10px 16px;
  border-radius: 6px; border: 1px solid var(--accent); background: var(--accent);
  color: var(--accent-fg); transition: filter 0.15s ease;
}
button:hover:not(:disabled) { filter: brightness(1.06); }
button.secondary { background: transparent; color: var(--fg); border-color: var(--line); }
button.danger { background: transparent; color: var(--danger); border-color: var(--danger); }
button.link { background: none; border: 0; padding: 0; color: var(--accent-ink); text-decoration: underline; font-weight: 400; }
button:disabled { opacity: 0.55; cursor: default; }

.muted { color: var(--muted); }
.msg { min-height: 1.4em; margin: 10px 0 0; font-size: 0.88rem; color: var(--danger); }
.msg.ok { color: var(--ok); }

/* ---------- painel logado ---------- */
.bar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; gap: 12px; padding-bottom: 16px; border-bottom: 1px solid var(--line); }
.bar-id { display: flex; align-items: center; gap: 10px; }
.bar .seal { width: 26px; height: 26px; }
.row { display: flex; gap: 14px; align-items: flex-end; flex-wrap: wrap; }
.row label { flex: 1 1 200px; margin: 0; }
.scroll { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 0.88rem; }
th, td { text-align: left; padding: 10px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
th { color: var(--muted); font-weight: 500; font-size: 0.8rem; }
td.actions { display: flex; gap: 6px; flex-wrap: wrap; }
td.actions button { padding: 5px 10px; font-size: 0.85rem; }

/* selo de status, no espírito de um carimbo de manifesto */
.badge {
  display: inline-block; padding: 2px 10px; border-radius: 3px;
  border: 1.5px solid var(--ok); color: var(--ok);
  font-family: var(--font-display); font-weight: 600; font-size: 0.72rem;
  letter-spacing: 0.04em; text-transform: uppercase;
}
.badge.off { border-color: var(--danger); color: var(--danger); }

/* ---------- monitor ---------- */
.mon-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.mon-head h2 { margin: 0; }
.mon-head .muted { font-size: 0.82rem; }
label.inline { display: flex; align-items: center; gap: 8px; margin: 0; }
label.inline select { margin: 0; width: auto; padding: 6px 10px; }
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 10px; }
.tile { border: 1px solid var(--line); border-radius: 6px; padding: 12px 14px; display: flex; flex-direction: column; background: var(--bg); }
.tile strong { font-family: var(--font-display); font-size: 1.6rem; line-height: 1.1; font-weight: 600; }
.tile span { font-size: 0.78rem; }
.tile.bad strong { color: var(--danger); }
td.cut { max-width: 280px; overflow: hidden; text-overflow: ellipsis; }
.badge.dim { border-color: var(--muted); color: var(--muted); }
