/**
 * SmartCFO Design Tokens — Sakūn + Wāʿī (polished)
 * v1.1 · muted · layered · no neon
 */

:root {
  /* ── Background & surface ── */
  --color-bg-base: #0d0f14;
  --color-bg-elevated: #161922;
  --color-bg-elevated-soft: #13161e;
  --color-bg-sunken: #0a0c10;
  --color-bg-overlay: rgba(10, 12, 16, 0.78);
  --color-bg-hover: rgba(255, 255, 255, 0.035);
  --color-bg-active: rgba(255, 255, 255, 0.055);
  --color-bg-warm: #181612;
  --color-bg-warm-elevated: #1e1b17;

  /* ── Text ── */
  --color-text-primary: #dfe4ed;
  --color-text-secondary: #8b93a3;
  --color-text-tertiary: #5c6370;
  --color-text-disabled: #454b56;
  --color-text-inverse: #0d0f14;
  --color-text-warm: #ddd5c8;

  /* ── Accent — muted Sakūn ── */
  --color-accent-primary: #6284c4;
  --color-accent-primary-muted: rgba(98, 132, 196, 0.1);
  --color-accent-secondary: #6f9982;
  --color-accent-secondary-muted: rgba(111, 153, 130, 0.1);

  /* ── Semantic — Wāʿī warmth ── */
  --color-income: #6f9982;
  --color-income-muted: rgba(111, 153, 130, 0.12);
  --color-expense: #b89a72;
  --color-expense-muted: rgba(184, 154, 114, 0.1);
  --color-savings: #6284c4;
  --color-warning: #c49a58;
  --color-warning-muted: rgba(196, 154, 88, 0.1);
  --color-danger: #b07a7a;
  --color-danger-muted: rgba(176, 122, 122, 0.1);

  /* ── Border ── */
  --color-border-subtle: rgba(255, 255, 255, 0.045);
  --color-border-default: rgba(255, 255, 255, 0.075);
  --color-border-strong: rgba(255, 255, 255, 0.12);
  --color-border-accent: rgba(98, 132, 196, 0.22);
  --color-border-warm: rgba(184, 154, 114, 0.16);

  /* ── WhatsApp (channel only) ── */
  --color-wa-brand: #25d366;
  --color-wa-muted: rgba(37, 211, 102, 0.08);
  --color-wa-border: rgba(37, 211, 102, 0.2);

  /* ── Category dots ── */
  --color-cat-food: #9a8870;
  --color-cat-fuel: #7a8ea3;
  --color-cat-sub: #8f85a8;
  --color-cat-shop: #a08870;

  /* ── Atmospheric — disabled by default (use solid surfaces) ── */
  --gradient-atmosphere: none;
  --gradient-warm: none;

  /* ── Typography ── */
  --font-ui: "Tajawal", "Inter", system-ui, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, monospace;

  --text-display-size: 1.75rem;
  --text-display-weight: 700;
  --text-display-leading: 1.2;
  --text-display-tracking: -0.015em;

  --text-h1-size: 1.375rem;
  --text-h1-weight: 700;
  --text-h1-leading: 1.3;
  --text-h1-tracking: -0.01em;

  --text-h2-size: 1.125rem;
  --text-h2-weight: 600;
  --text-h2-leading: 1.35;

  --text-h3-size: 1rem;
  --text-h3-weight: 600;
  --text-h3-leading: 1.4;

  --text-body-size: 1rem;
  --text-body-weight: 400;
  --text-body-leading: 1.7;

  --text-body-medium-weight: 500;

  --text-small-size: 0.875rem;
  --text-small-weight: 400;
  --text-small-leading: 1.6;

  --text-caption-size: 0.75rem;
  --text-caption-weight: 500;
  --text-caption-leading: 1.5;
  --text-caption-tracking: 0.01em;

  --text-overline-size: 0.6875rem;
  --text-overline-weight: 600;
  --text-overline-leading: 1.4;
  --text-overline-tracking: 0.06em;

  --text-figure-hero-size: 1.625rem;
  --text-figure-hero-weight: 600;

  --text-figure-md-size: 1.0625rem;
  --text-figure-md-weight: 600;

  --text-figure-sm-size: 0.875rem;
  --text-figure-sm-weight: 600;

  /* ── Spacing ── */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-8: 32px;
  --space-10: 40px;
  --space-12: 48px;
  --space-16: 64px;

  /* ── Layout ── */
  --layout-padding-x: var(--space-5);
  --layout-max-read: 680px;
  --layout-max-app: 960px;
  --layout-row-min: 56px;
  --layout-touch-min: 44px;
  --layout-section-gap: var(--space-5);

  /* ── Radius ── */
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 12px;
  --radius-xl: 16px;
  --radius-full: 9999px;

  /* ── Borders ── */
  --border-width: 1px;
  --border-hairline: var(--border-width) solid var(--color-border-subtle);
  --border-default: var(--border-width) solid var(--color-border-default);
  --border-strong: var(--border-width) solid var(--color-border-strong);
  --border-accent: var(--border-width) solid var(--color-border-accent);
  --border-warm: var(--border-width) solid var(--color-border-warm);

  /* ── Shadows ── */
  --shadow-none: none;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.18);
  --shadow-md: 0 2px 12px rgba(0, 0, 0, 0.22);
  --shadow-lg: 0 4px 24px rgba(0, 0, 0, 0.28);

  /* ── Motion ── */
  --motion-fast: 120ms;
  --motion-base: 200ms;
  --motion-slow: 280ms;
  --motion-insight: 320ms;
  --ease-out: ease-out;
  --ease-in-out: ease-in-out;
  --ease-insight: cubic-bezier(0.22, 1, 0.36, 1);
  --transition-fast: var(--motion-fast) var(--ease-out);
  --transition-base: var(--motion-base) var(--ease-out);
  --transition-slow: var(--motion-slow) var(--ease-in-out);

  /* ── Focus ── */
  --focus-ring: 2px solid rgba(98, 132, 196, 0.55);
  --focus-offset: 2px;

  /* ── Z-index ── */
  --z-base: 0;
  --z-sticky: 10;
  --z-nav: 50;
  --z-sheet: 100;
  --z-modal: 200;
  --z-toast: 300;
}

@media (min-width: 768px) {
  :root {
    --layout-padding-x: var(--space-6);
    --layout-section-gap: var(--space-6);
  }
}

@media (prefers-reduced-motion: reduce) {
  :root {
    --motion-fast: 0ms;
    --motion-base: 0ms;
    --motion-slow: 0ms;
    --motion-insight: 150ms;
  }
}
