/*
 * Budget It design tokens.
 * Brand intent: trustworthy, warm and practical. A deep ledger green carries
 * trust and money; a crust amber adds warmth from the bakery and kitchen.
 * Neutrals are warm stone so screens feel like paper, not a banking app.
 * All text pairs meet WCAG 2.2 AA contrast in both themes.
 */
:root {
  color-scheme: light;

  /* Brand */
  --green-900: #063b30;
  --green-800: #084a3d;
  --green-700: #0b5d4b;
  --green-600: #0e7560;
  --green-500: #14906f;
  --green-200: #b8e0d4;
  --green-100: #e3f2ee;
  --green-50:  #f1f8f6;

  --amber-700: #92400e;
  --amber-600: #b45309;
  --amber-500: #d97706;
  --amber-200: #f9d9a8;
  --amber-100: #fdf0dc;

  /* Warm neutrals */
  --stone-950: #12100e;
  --stone-900: #1c1917;
  --stone-800: #292524;
  --stone-700: #44403c;
  --stone-600: #57534e;
  --stone-500: #78716c;
  --stone-400: #a8a29e;
  --stone-300: #d6d3d1;
  --stone-200: #e7e5e4;
  --stone-100: #f5f5f4;
  --stone-50:  #fafaf7;

  /* Semantic: status always pairs colour with text or an icon */
  --red-700: #b42318;
  --red-100: #fde8e6;
  --blue-700: #1d4ed8;
  --blue-100: #e5edff;

  /* Roles */
  --bg: var(--stone-50);
  --surface: #ffffff;
  --surface-sunken: var(--stone-100);
  --border: var(--stone-200);
  --border-strong: var(--stone-300);
  --text: var(--stone-900);
  --text-muted: var(--stone-600);
  --text-faint: var(--stone-500);
  --brand: var(--green-700);
  --brand-hover: var(--green-800);
  --brand-contrast: #ffffff;
  --brand-soft: var(--green-100);
  --accent: var(--amber-600);
  --accent-soft: var(--amber-100);
  --positive: #15803d;
  --positive-soft: #e6f4ea;
  --negative: var(--red-700);
  --negative-soft: var(--red-100);
  --warning: var(--amber-700);
  --warning-soft: var(--amber-100);
  --info: var(--blue-700);
  --info-soft: var(--blue-100);
  --focus: #2563eb;

  /* Chart series: ordered for distinguishability, validated on both themes */
  --series-1: var(--green-600);
  --series-2: var(--amber-500);
  --series-3: #5b6bbf;
  --series-4: #b5487a;
  --series-5: var(--stone-400);

  /* Evidence states (trust model) */
  --evidence-actual: var(--green-600);
  --evidence-estimated: var(--amber-500);
  --evidence-stale: #855a22;
  --evidence-missing: var(--red-700);

  /* Type: system stack, no web font download on low-end devices */
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", Ubuntu, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --fs-xs: 0.75rem;
  --fs-sm: 0.875rem;
  --fs-md: 1rem;
  --fs-lg: 1.125rem;
  --fs-xl: 1.375rem;
  --fs-2xl: 1.75rem;
  --fs-3xl: 2.25rem;

  /* Space, radius, elevation */
  --sp-1: 4px; --sp-2: 8px; --sp-3: 12px; --sp-4: 16px; --sp-5: 20px; --sp-6: 24px; --sp-8: 32px; --sp-10: 40px;
  --radius-sm: 6px;
  --radius: 10px;
  --radius-lg: 16px;
  --shadow-1: 0 1px 2px rgb(28 25 23 / 0.06), 0 1px 1px rgb(28 25 23 / 0.04);
  --shadow-2: 0 8px 24px rgb(28 25 23 / 0.12);
  --tap: 44px;
  --nav-h: 64px;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: var(--stone-950);
    --surface: #1b1917;
    --surface-sunken: #24211f;
    --border: #34302c;
    --border-strong: #48433e;
    --text: #f5f2ee;
    --text-muted: #c2bcb5;
    --text-faint: #a39c94;
    --brand: #3fbf98;
    --brand-hover: #5fd1ad;
    --brand-contrast: #062a22;
    --brand-soft: #0f2f27;
    --accent: #f0a53a;
    --accent-soft: #3a2a12;
    --positive: #4ade80;
    --positive-soft: #11291a;
    --negative: #f87171;
    --negative-soft: #3a1513;
    --warning: #f5b955;
    --warning-soft: #352710;
    --info: #8ab4ff;
    --info-soft: #14213d;
    --focus: #8ab4ff;
    --series-1: #3fbf98;
    --series-2: #f0a53a;
    --series-3: #8f9cf0;
    --series-4: #e27aa8;
    --series-5: #7d756d;
    --evidence-actual: #3fbf98;
    --evidence-estimated: #f0a53a;
    --evidence-stale: #c9965a;
    --evidence-missing: #f87171;
    --shadow-1: 0 1px 2px rgb(0 0 0 / 0.4);
    --shadow-2: 0 8px 24px rgb(0 0 0 / 0.5);
  }
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: var(--stone-950);
  --surface: #1b1917;
  --surface-sunken: #24211f;
  --border: #34302c;
  --border-strong: #48433e;
  --text: #f5f2ee;
  --text-muted: #c2bcb5;
  --text-faint: #a39c94;
  --brand: #3fbf98;
  --brand-hover: #5fd1ad;
  --brand-contrast: #062a22;
  --brand-soft: #0f2f27;
  --accent: #f0a53a;
  --accent-soft: #3a2a12;
  --positive: #4ade80;
  --positive-soft: #11291a;
  --negative: #f87171;
  --negative-soft: #3a1513;
  --warning: #f5b955;
  --warning-soft: #352710;
  --info: #8ab4ff;
  --info-soft: #14213d;
  --focus: #8ab4ff;
  --series-1: #3fbf98;
  --series-2: #f0a53a;
  --series-3: #8f9cf0;
  --series-4: #e27aa8;
  --series-5: #7d756d;
  --evidence-actual: #3fbf98;
  --evidence-estimated: #f0a53a;
  --evidence-stale: #c9965a;
  --evidence-missing: #f87171;
  --shadow-1: 0 1px 2px rgb(0 0 0 / 0.4);
  --shadow-2: 0 8px 24px rgb(0 0 0 / 0.5);
}
