/* ==========================================================================
   Invoice Chaser (Round Three) -- Design Tokens
   Visual direction: Warm Shophouse Ledger + Nudge's Singapore Studio Desk
   Accessibility: WCAG AA (>= 4.5:1 text, >= 3:1 UI), strict 14px text floor
   Motion: Transform-first, <= 300ms standard (500ms paid-tray flight on click)
   ========================================================================== */

:root {
  /* Paper & Desk Surface Palette */
  --paper-bg: #F6F5F1;          /* Warm desk paper canvas */
  --surface: #FFFDF8;           /* Cotton ledger sheet & Nudge paper base */
  --surface-tint: #ECE7DC;      /* Warm linen secondary surface */
  --surface-shade: #E9E4D8;     /* Nudge paper shade tone */
  --surface-hover: #E5DFD2;     /* Interactive hover tint */

  /* Ink & Hairline Dividers */
  --ink-primary: #1F1D1A;       /* Charcoal ink (15.4:1 on paper, 16.4:1 on sheet) */
  --ink-secondary: #575148;     /* Warm slate ink (7.5:1 on sheet) */
  --border-subtle: #DDD5C7;     /* Single hairline ledger rule */
  --border-strong: #787063;     /* Form controls & crisp dividers (4.7:1 on sheet) */

  /* Brand -- Deep Shophouse Green (#075C50) */
  --brand: #075C50;             /* Primary actions (7.8:1 with #FFFDF8) */
  --brand-hover: #05443B;       /* Hover / pressed state */
  --brand-soft: #E5F3EF;        /* Selected nav / subtle paid highlight */
  --brand-border: #92C2B8;      /* Accent edge */
  --brand-on: #FFFDF8;          /* Paper white text on deep green */

  /* Shared Webby SG Family Spark */
  --spark: #F5B84B;             /* Amber wax-seal dot */
  --spark-soft: #FDF3DB;

  /* Money Line Semantic Tones */
  --paid-ink: #075C50;          /* Deep green settled (7.8:1 on sheet) */
  --paid-track: #075C50;
  --paid-bg: #E5F3EF;

  --due-ink: #7A4B0B;           /* Warm ochre ink (6.8:1 on due-bg) */
  --due-track: #C88B1D;         /* Distinct warm amber segment on money line */
  --due-bg: #FDF4E3;

  --overdue-ink: #A62C1E;       /* Stamp vermilion (6.7:1 on sheet, 5.9:1 on bg) */
  --overdue-track: #A62C1E;
  --overdue-bg: #FDF0EE;

  /* Offline / Notice Banner */
  --offline-ink: #78350F;       /* Deep amber ink (9.1:1 on offline-bg) */
  --offline-bg: #FEF3C7;
  --offline-border: #C47F17;

  /* Typography -- 100% Offline-Safe Stacks (No Inter, No External CDN) */
  --font-display: "Iowan Old Style", "Palatino Linotype", "Book Antiqua", Palatino, Georgia, serif;
  --font-sans: "Segoe UI Variable", "Segoe UI", -apple-system, BlinkMacSystemFont, "Helvetica Neue", Arial, sans-serif;
  --font-mono: "Cascadia Mono", "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;

  /* Type Scale -- Strict 14px (0.875rem) Minimum Floor Everywhere */
  --text-sm: 0.875rem;          /* 14px -- minimum allowed size everywhere */
  --text-base: 1rem;            /* 16px -- primary body copy */
  --text-md: 1.125rem;          /* 18px -- section subheads & figures */
  --text-lg: 1.375rem;          /* 22px -- section headings */
  --text-xl: 1.75rem;           /* 28px -- page headings */
  --text-2xl: 2.25rem;          /* 36px -- desktop hero figures */

  --leading-tight: 1.2;
  --leading-normal: 1.5;
  --leading-relaxed: 1.6;

  /* Spacing Scale */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-8: 32px;
  --space-10: 40px;

  /* Shape -- Tactile Stationery */
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-pill: 999px;

  /* Depth from Soft Desk Shadow & Tint (Avoids Double Outlines) */
  --shadow-sheet: 0 1px 2px rgba(31, 29, 26, 0.06), 0 6px 18px rgba(31, 29, 26, 0.05);
  --shadow-raised: 0 2px 4px rgba(31, 29, 26, 0.08), 0 10px 26px rgba(31, 29, 26, 0.09);

  /* Focus Ring -- Unmistakable WCAG AA Keyboard Visibility */
  --focus-ring: 3px solid #075C50;
  --focus-offset: 2px;

  /* Motion -- Transform-only accent, strictly <= 300ms (paid flight = 500ms) */
  --motion-fast: 140ms;
  --motion-base: 220ms;
  --motion-flight: 500ms;
  --motion-ease: cubic-bezier(0.2, 0.8, 0.2, 1);

  /* Layout */
  --sidebar-width: 256px;
  --content-max: 1040px;
  --mobile-tab-height: 70px;
}

@media (prefers-reduced-motion: reduce) {
  :root {
    --motion-fast: 0.01ms;
    --motion-base: 0.01ms;
    --motion-flight: 0.01ms;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
