/* tokens.css — design system for the Church CMS
   Redesigned after Orbit CRM (Uxerflow) and Script AI's layout language: icon-forward
   sidebar, trend-badge stat cards, rounded card surfaces, a warmer neutral palette. */

:root {
  /* Color */
  --color-bg: #F7F8FA;
  --color-surface: #FFFFFF;
  --color-surface-sunken: #F1F3F5;
  --color-ink: #16181D;
  --color-ink-muted: #676C76;
  --color-ink-faint: #9AA0AB;
  --color-primary: #2F4F3E;
  --color-primary-hover: #263F32;
  --color-primary-tint: #E7EEE9;
  --color-gold: #B08D57;
  --color-gold-tint: #F4EEE2;
  --color-border: #E9EBEF;
  --color-danger: #E5484D;
  --color-danger-tint: #FDECEC;
  --color-success: #2FA36B;
  --color-success-tint: #E4F6ED;
  --color-warning: #D97706;
  --color-warning-tint: #FEF3E2;

  /* Type — Sora for display (bold, distinctive, avoids Space Grotesk's quirky numerals),
     Inter for body/UI (clean, dense-friendly, industry-standard for data-heavy screens) */
  --font-display: 'Sora', 'Inter', sans-serif;
  --font-body: 'Inter', -apple-system, sans-serif;
  --font-mono: 'Inter', ui-monospace, monospace;

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

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

  /* Shape — tight, enterprise-tool radii: 4px on controls, 7px on containers */
  --radius-sm: 4px;
  --radius-md: 7px;
  --radius-lg: 7px;
  --shadow-card: 0 1px 2px rgba(16, 24, 40, 0.04), 0 1px 3px rgba(16, 24, 40, 0.03);
  --shadow-raised: 0 8px 24px rgba(16, 24, 40, 0.09);

  /* Motion */
  --ease: cubic-bezier(0.4, 0, 0.2, 1);
  --duration-fast: 120ms;
  --duration-base: 200ms;
}

/* Dark theme — same variable names, different values, so every page/component that already
   uses var(--color-*) picks this up automatically with zero markup changes. Toggled via
   data-theme="dark" on <html>, set by src/js/components/theme.js (persisted in localStorage). */
html[data-theme="dark"] {
  --color-bg: #12140F;
  --color-surface: #191C15;
  --color-surface-sunken: #21251B;
  --color-ink: #F2F3EE;
  --color-ink-muted: #A9AE9F;
  --color-ink-faint: #767C6B;
  --color-primary: #5B9277;
  --color-primary-hover: #6DA688;
  --color-primary-tint: #1E2B22;
  --color-gold: #D3B078;
  --color-gold-tint: #2E2717;
  --color-border: #2C3025;
  --color-danger: #F1786A;
  --color-danger-tint: #3A2019;
  --color-success: #5CC490;
  --color-success-tint: #17281E;
  --color-warning: #EAB05B;
  --color-warning-tint: #332711;
  --shadow-card: 0 1px 2px rgba(0, 0, 0, 0.3), 0 1px 3px rgba(0, 0, 0, 0.2);
  --shadow-raised: 0 8px 24px rgba(0, 0, 0, 0.4);
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--color-bg);
  color: var(--color-ink);
  font-family: var(--font-body);
  font-size: var(--text-base);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 600;
  letter-spacing: -0.01em;
  margin: 0;
  color: var(--color-ink);
}

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

p { margin: 0; }

a { color: var(--color-primary); text-decoration: none; }
a:hover { text-decoration: underline; }

button, input, select, textarea { font-family: inherit; font-size: inherit; }

:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}

.mono { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
.text-muted { color: var(--color-ink-muted); }
.text-faint { color: var(--color-ink-faint); }
