/* css/base.css
   Design tokens for the whole system. Every color/spacing/type decision
   made anywhere in the app should trace back to a variable defined here —
   no ad-hoc hex codes or magic pixel values in page-level CSS.

   Direction: a working counter tool, not a marketing page. Read in bright
   shop lighting, used one-handed on a cheap Android phone, money figures
   have to be unmistakable at a glance. Palette pulls from ledger-book
   ink-and-paper rather than generic SaaS blue/purple — deep bottle-green
   ink as the primary action color, a warm copper for anything that means
   "money" or "attention", high-contrast paper background. No decorative
   webfont dependency: system font stack only, so first paint never waits
   on a network request — consistent with this system being offline-first
   from day one.
*/

:root {
  /* ---- Color ---- */
  --color-bg: #eef1ec;              /* soft paper, faint green cast */
  --color-surface: #ffffff;
  --color-surface-sunken: #e4e8e1;
  --color-border: #cdd3c6;

  --color-ink: #1b2621;             /* primary text — near-black bottle green */
  --color-ink-muted: #56635b;

  --color-primary: #0b6e4f;         /* ledger-ink green — primary actions */
  --color-primary-dark: #084f39;
  --color-primary-contrast: #ffffff;

  --color-accent: #b5762a;          /* copper — money, highlights, badges */
  --color-accent-contrast: #ffffff;

  --color-danger: #a3271f;
  --color-danger-bg: #fbe9e7;
  --color-success: #0b6e4f;
  --color-success-bg: #e5f2ec;
  --color-warning: #8a5a00;
  --color-warning-bg: #fbf1dc;

  /* ---- Type ---- */
  --font-ui: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-mono: ui-monospace, "SF Mono", "JetBrains Mono", Menlo, Consolas, monospace;

  --text-xs: 0.75rem;
  --text-sm: 0.875rem;
  --text-base: 1rem;
  --text-lg: 1.125rem;
  --text-xl: 1.375rem;
  --text-2xl: 1.75rem;

  --weight-regular: 400;
  --weight-medium: 500;
  --weight-bold: 700;

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

  /* ---- Shape ---- */
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;

  /* ---- Elevation ---- */
  --shadow-sm: 0 1px 2px rgba(27, 38, 33, 0.08);
  --shadow-md: 0 4px 12px rgba(27, 38, 33, 0.12);

  /* ---- Layout ---- */
  --bottom-nav-height: 64px;
  --touch-target: 44px;             /* minimum tappable size, counter use */
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  height: 100%;
  background: var(--color-bg);
  color: var(--color-ink);
  font-family: var(--font-ui);
  font-size: var(--text-base);
  -webkit-tap-highlight-color: transparent;
}

body {
  padding-bottom: calc(var(--bottom-nav-height) + var(--space-4));
}

h1, h2, h3 {
  margin: 0 0 var(--space-3);
  font-weight: var(--weight-bold);
  letter-spacing: -0.01em;
}

h1 { font-size: var(--text-2xl); }
h2 { font-size: var(--text-xl); }
h3 { font-size: var(--text-lg); }

p { margin: 0 0 var(--space-3); color: var(--color-ink-muted); }

a { color: var(--color-primary); }

/* Money and any tabular figure always uses tabular-nums + mono so digits
   align in lists — the ledger-legibility detail that matters most here. */
.figure,
.money {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  font-weight: var(--weight-medium);
}

/* Visible keyboard focus everywhere — counter staff may use a paired
   keyboard/scanner, and accessibility is a quality floor, not a feature. */
:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}

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