/* Shared by every console built here: datahub, notifier, and the next one. Each module keeps an identical copy in its
   static/ folder, and CI fails when they differ (tools/check-console-base.sh). Change one, then copy it to the others.
   A module's own console.css loads after this, for the components only it has. See docs/style-guide.md. */

/* ── Tokens ───────────────────────────────────────────────────────────────── */
:root {
  --bg: #fafaf8; --fg: #1d1d1b; --muted: #6b6b66; --line: #deded8; --accent: #2457a6; --accent-fg: #fff; --card: #fff;
  --bad: #b3261e; --bad-bg: #fbeae9; --good: #1a7f37; --good-bg: #e6f4ea; --warn: #8a5300; --warn-bg: #fdf1dc; --note: #eef4fb;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #151514; --fg: #e8e8e3; --muted: #a0a09a; --line: #34342f; --accent: #8ab4f8; --accent-fg: #10213d; --card: #1e1e1c;
    --bad: #f2a29b; --bad-bg: #3a1d1b; --good: #8fd19e; --good-bg: #1b3022; --warn: #f0c27a; --warn-bg: #382a14; --note: #1c2633;
  }
}

/* ── Page ─────────────────────────────────────────────────────────────────── */
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; font: 15px/1.5 system-ui, sans-serif; background: var(--bg); color: var(--fg); }
header { display: flex; align-items: center; justify-content: space-between; gap: 8px 16px; padding: 12px 24px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.brand { font-weight: 700; color: var(--fg); text-decoration: none; }
nav { display: flex; gap: 4px 16px; align-items: center; flex-wrap: wrap; }
nav a { text-decoration: none; white-space: nowrap; }
nav a[aria-current] { color: var(--fg); font-weight: 600; }
nav form { margin: 0; }
main { padding: 24px; max-width: 1200px; margin: 0 auto; }
footer { padding: 24px; color: var(--muted); font-size: 13px; text-align: center; }
a { color: var(--accent); }
h1 { font-size: 24px; margin: 0 0 12px; }
h2 { font-size: 18px; margin: 32px 0 8px; }
h3 { font-size: 14px; margin: 16px 0 6px; }
code { font-size: 13px; }
input:focus-visible, select:focus-visible, textarea:focus-visible, button:focus-visible, a:focus-visible, summary:focus-visible,
[contenteditable]:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
@media (max-width: 720px) {
  header { padding: 12px 16px; }
  nav { gap: 4px 12px; }
  main { padding: 16px; }
}

/* ── Page header: kind of thing, title, one-line description, actions on the right ── */
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px 24px; flex-wrap: wrap; margin-bottom: 16px; }
.page-head h1 { margin: 0; }
.page-head .actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: flex-start; }
.page-head .actions form { margin: 0; }
.eyebrow { font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.desc { color: var(--muted); margin: 4px 0 0; white-space: pre-line; }

/* ── Tables ───────────────────────────────────────────────────────────────── */
table { border-collapse: collapse; width: 100%; background: var(--card); }
th, td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: 13px; color: var(--muted); font-weight: 600; }
.num { text-align: right; font-variant-numeric: tabular-nums; }
.scroll { overflow-x: auto; }
.nowrap { white-space: nowrap; }
.empty, td.empty { color: var(--muted); }

/* ── Cards and notices ────────────────────────────────────────────────────── */
.card { background: var(--card); border: 1px solid var(--line); border-radius: 8px; padding: 16px 20px; }
.card.narrow { max-width: 380px; margin: 48px auto; }
.notice { background: var(--note); border: 1px solid var(--line); border-radius: 8px; padding: 12px 16px; margin-bottom: 16px; }
.notice.warn { background: var(--warn-bg); }
.notice p { margin: 0 0 8px; }
.danger-zone { margin-top: 40px; padding-top: 16px; border-top: 1px solid var(--line); }

/* ── Forms ────────────────────────────────────────────────────────────────── */
label { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--muted); margin-bottom: 12px; }
input, select, textarea { font: inherit; color: var(--fg); padding: 6px 8px; border: 1px solid var(--line); border-radius: 6px; background: var(--bg); }
textarea { resize: vertical; }
.row { display: flex; gap: 12px; flex-wrap: wrap; align-items: flex-end; }
.row label { margin: 0; }
.grow { flex: 1 1 220px; }
.hint { font-size: 13px; color: var(--muted); }
.error { color: var(--bad); }

/* ── Buttons ──────────────────────────────────────────────────────────────── */
button, .button { font: inherit; display: inline-block; padding: 6px 14px; border-radius: 6px; border: 1px solid var(--accent); background: var(--accent);
  color: var(--accent-fg); cursor: pointer; text-decoration: none; line-height: 1.5; }
summary.button { list-style: none; }
summary.button::-webkit-details-marker { display: none; }
button.secondary, .button.secondary { background: transparent; color: var(--accent); }
button.danger { color: var(--bad); border-color: var(--bad); }
button.link { background: none; border: none; color: var(--accent); padding: 0; }
button.link.danger { color: var(--bad); }
button.small { font-size: 13px; padding: 2px 10px; }
button:disabled { opacity: .5; cursor: progress; }

/* ── Badges: a short state, always with a word ────────────────────────────── */
.badge { display: inline-block; font-size: 12px; font-weight: 600; padding: 1px 8px; border-radius: 999px; background: var(--note); color: var(--fg);
  white-space: nowrap; vertical-align: 2px; }
.badge-good, .badge-sent, .badge-current { background: var(--good-bg); color: var(--good); }
.badge-bad, .badge-failed { background: var(--bad-bg); color: var(--bad); }
.badge-warn, .badge-pending { background: var(--warn-bg); color: var(--warn); }
