/* TabelAja design tokens — direction A "Kertas Rapi" (picked 2026-11-21).
   Source of truth for web colours, type, spacing and radii. See docs/VISUAL-SPEC.md.
   All text/background pairs checked to WCAG AA (>= 4.5:1). */

:root {
  /* Colour roles: light (default) */
  --bg: #FBF8F2;               /* warm paper */
  --surface: #FFFFFF;          /* cards, table */
  --surface-muted: #F3ECDF;    /* guest prompt, quiet panels */
  --surface-subtle: #FDFBF7;   /* table header, totals row */
  --border: #E7E0D2;
  --divider: #F0EBE0;          /* table rules, row separators */
  --text: #1E2A3A;             /* ink navy */
  --text-secondary: #3A4553;
  --text-muted: #5B6573;
  --accent: #B4501B;           /* terracotta: primary action only */
  --accent-hover: #9B4417;
  --on-accent: #FFFFFF;
  --ink: #1E2A3A;              /* secondary solid button */
  --on-ink: #FFFFFF;
  --info-bg: #E3ECF7;          /* "total cocok" status */
  --info-fg: #1E4F8A;
  --flag-check-bg: #FDF0C4;    /* yellow Flag: unsure reading */
  --flag-check-bar: #C99400;
  --flag-check-fg: #6B4A00;
  --flag-mismatch-bg: #F9DAD5; /* red Flag: Check failed */
  --flag-mismatch-bar: #C0392B;
  --flag-mismatch-fg: #8A1F14;
  --focus: #1E4F8A;

  /* Type */
  --font: 'Plus Jakarta Sans', system-ui, sans-serif;
  --fs-display: 28px;  --lh-display: 1.2;  --fw-display: 800;  /* landing headline */
  --fs-h1: 26px;       --lh-h1: 1.2;       --fw-h1: 800;       /* screen title */
  --fs-h2: 18px;       --lh-h2: 1.3;       --fw-h2: 700;
  --fs-body: 15px;     --lh-body: 1.5;     --fw-body: 400;
  --fs-body-sm: 14px;  --lh-body-sm: 1.45;
  --fs-caption: 13px;  --lh-caption: 1.4;
  --fs-label: 12px;    --fw-label: 700;    --ls-label: .06em;  /* uppercase section labels */
  --fs-table: 13px;                        /* numbers use font-variant-numeric: tabular-nums */
  --ls-tight: -.02em;                      /* display and h1 only */

  /* Spacing (4-pt steps) */
  --space-1: 4px;  --space-2: 8px;  --space-3: 12px; --space-4: 16px;
  --space-5: 20px; --space-6: 24px; --space-8: 32px; --space-12: 48px;

  /* Radii */
  --radius-sm: 8px;    /* inputs, small chips */
  --radius-md: 12px;   /* buttons, table frame */
  --radius-lg: 14px;   /* cards, panels */
  --radius-pill: 999px;

  /* Sizes */
  --tap-min: 44px;
  --page-max: 560px;   /* content column; phone-first, same order on desktop */
}

/* Dark: derived from A, not separately designed. Verify on a real screen before shipping. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #14171B; --surface: #1C2026; --surface-muted: #262B33; --surface-subtle: #20242A;
    --border: #323842; --divider: #2A2E35;
    --text: #ECE7DD; --text-secondary: #C9CDD3; --text-muted: #A9B0BA;
    --accent: #E07A45; --accent-hover: #EA8E5E; --on-accent: #14171B;
    --ink: #ECE7DD; --on-ink: #14171B;
    --info-bg: #1F3A5C; --info-fg: #9CC8FF;
    --flag-check-bg: #4A3B0F; --flag-check-bar: #FFD666; --flag-check-fg: #FFD666;
    --flag-mismatch-bg: #4D1F1A; --flag-mismatch-bar: #FF8A7A; --flag-mismatch-fg: #FFB4A8;
    --focus: #9CC8FF;
  }
}
:root[data-theme="dark"] {
  --bg: #14171B; --surface: #1C2026; --surface-muted: #262B33; --surface-subtle: #20242A;
  --border: #323842; --divider: #2A2E35;
  --text: #ECE7DD; --text-secondary: #C9CDD3; --text-muted: #A9B0BA;
  --accent: #E07A45; --accent-hover: #EA8E5E; --on-accent: #14171B;
  --ink: #ECE7DD; --on-ink: #14171B;
  --info-bg: #1F3A5C; --info-fg: #9CC8FF;
  --flag-check-bg: #4A3B0F; --flag-check-bar: #FFD666; --flag-check-fg: #FFD666;
  --flag-mismatch-bg: #4D1F1A; --flag-mismatch-bar: #FF8A7A; --flag-mismatch-fg: #FFB4A8;
  --focus: #9CC8FF;
}
