/* Darteeb design tokens. Source of truth: brand/DARTEEB_Brand_Guidelines.md
 * Light = :root. Dark = [data-theme='dark'] (and [data-theme='auto'] follows the OS).
 * Names match the existing app/src/styles/tokens.css (--bg, --surface, --ink, --brand ...) so
 * the app can adopt this file by replacing values, not renaming.
 * Contrast ratios (WCAG 2.x) are in tokens.json under "contrast". All recommended text pairs >= 4.5:1.
 * --brand-mark (#048686) is the LOGO teal: graphics and large text only (>= 3:1).
 * --brand (#037A7A in light) is the ACTION/text teal: white on it is 5.16:1.
 */
:root {
  color-scheme: light;
  --sx: 1; /* +1 LTR, -1 RTL: multiply horizontal translations */

  /* Brand primitives */
  --darteeb-navy: #0D1C3B;
  --darteeb-teal: #048686;
  --darteeb-cream: #FFF8EE;

  /* navy scale (neutrals are navy-tinted, hue ~222) */
  --navy-50: #F4F6FA;
  --navy-100: #E8EBF2;
  --navy-200: #D2D8E4;
  --navy-300: #AEB8CE;
  --navy-400: #8190AF;
  --navy-500: #5A6B92;
  --navy-600: #3A4D78;
  --navy-700: #26385F;
  --navy-800: #17294D;
  --navy-900: #0D1C3B;
  --navy-950: #070F23;

  /* teal scale (neutrals are navy-tinted, hue ~222) */
  --teal-50: #EBFAF8;
  --teal-100: #D3F4F0;
  --teal-200: #A6E8E0;
  --teal-300: #6FD6CB;
  --teal-400: #2FC2B4;
  --teal-500: #0FA19B;
  --teal-600: #048686;
  --teal-700: #037A7A;
  --teal-800: #055F5F;
  --teal-900: #073F40;
  --teal-950: #032527;

  /* neutral scale (neutrals are navy-tinted, hue ~222) */
  --neutral-0: #FFFFFF;
  --neutral-50: #F6F7FA;
  --neutral-100: #EEF0F5;
  --neutral-200: #E1E5EC;
  --neutral-300: #CDD3DE;
  --neutral-400: #9AA4B8;
  --neutral-500: #6D7891;
  --neutral-600: #525D77;
  --neutral-700: #3A4560;
  --neutral-800: #222C45;
  --neutral-900: #131B30;
  --neutral-950: #0A1226;

  /* Semantic: light */
  --bg: #F6F7FA;
  --surface: #FFFFFF;
  --surface-2: #EEF0F5;
  --surface-3: #E1E5EC;
  --sidebar: #F1F3F8;
  --cream: #FFF8EE;
  --ink: #0D1C3B;
  --ink-2: #3A4560;
  --ink-3: #525D77;
  --ink-4: #9AA4B8;
  --line: #E1E5EC;
  --line-2: #CDD3DE;
  --line-input: #7F8AA3;
  --brand: #037A7A;
  --brand-ink: #FFFFFF;
  --brand-hover: #037A7A;
  --brand-text: #037A7A;
  --brand-soft: #EBFAF8;
  --brand-line: #A6E8E0;
  --accent: #048686;
  --brand-mark: #048686;
  --success: #17703F;
  --success-bg: #E7F5EC;
  --warning: #8F5400;
  --warning-bg: #FDF1DC;
  --danger: #B3261E;
  --danger-bg: #FCEBEA;
  --info: #1F55C4;
  --info-bg: #E8F0FD;

  --ring: color-mix(in srgb, var(--brand) 40%, transparent);

  /* Typography */
  /* Typography: ONE family, Readex Pro (Latin + Arabic), the closest free match to the logo wordmark.
   * Load: https://fonts.googleapis.com/css2?family=Readex+Pro:wght@300..700&display=swap
   * or self-host brand/fonts/ReadexPro-latin.woff + ReadexPro-arabic.woff (variable wght 300-700).
   * Readex Pro has NO tabular-figure feature: use --font-num (Figtree, tnum) on numeric table columns/money. */
  --font-ui: 'Readex Pro', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-ar: 'Readex Pro', 'Noto Sans Arabic', 'Segoe UI', Tahoma, sans-serif;
  --font-display: 'Readex Pro', ui-sans-serif, system-ui, sans-serif;
  --font-num: 'Figtree', 'Readex Pro', ui-sans-serif, system-ui, sans-serif;
  --font-mono: 'IBM Plex Mono', ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
  --font: var(--font-ui); /* alias used by the app */

  --text-2xs: 0.6875rem;  /* 11 badges */
  --text-xs: 0.75rem;     /* 12 labels */
  --text-sm: 0.8125rem;   /* 13 dense body */
  --text-base: 0.875rem;  /* 14 UI default */
  --text-md: 1rem;        /* 16 docs/marketing body */
  --text-lg: 1.125rem;    /* 18 */
  --text-xl: 1.375rem;    /* 22 page title */
  --text-2xl: 1.75rem;    /* 28 */
  --text-3xl: 2.25rem;    /* 36 */
  --text-4xl: 3rem;       /* 48 marketing h1 */
  --leading-tight: 1.2;
  --leading-snug: 1.35;
  --leading-body: 1.5;
  --leading-ar: 1.75;
  --weight-regular: 400; --weight-medium: 500; --weight-semibold: 600; --weight-bold: 700;

  --r-xs: 4px; --r-sm: 6px; --r-md: 8px; --r-lg: 12px; --r-xl: 16px; --r-pill: 999px;

  --space-0: 0; --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; --space-24: 96px;

  --sh-1: 0 1px 2px rgb(13 28 59 / 0.06);
  --sh-2: 0 1px 2px rgb(13 28 59 / 0.06), 0 6px 20px rgb(13 28 59 / 0.07);
  --sh-pop: 0 16px 48px rgb(13 28 59 / 0.22);

  --sidebar-w: 232px; --sidebar-w-collapsed: 56px; --topbar-h: 52px;
  --container: 1200px; --container-narrow: 720px;

  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --dur-fast: 120ms; --dur: 200ms;
}

[data-theme='dark'] {
  color-scheme: dark;
  --bg: #09112A;
  --surface: #101A33;
  --surface-2: #16223F;
  --surface-3: #1E2C4D;
  --sidebar: #0C1530;
  --cream: #17213A;
  --ink: #EDF0F7;
  --ink-2: #C3CBDD;
  --ink-3: #9BA6BF;
  --ink-4: #6E7A96;
  --line: #1E2A47;
  --line-2: #2C3A5C;
  --line-input: #7080A0;
  --brand: #2FC2B4;
  --brand-ink: #070F23;
  --brand-hover: #6FD6CB;
  --brand-text: #6FD6CB;
  --brand-soft: #0F2B33;
  --brand-line: #16525A;
  --accent: #2FC2B4;
  --brand-mark: #2FC2B4;
  --success: #5FC58A;
  --success-bg: #12261B;
  --warning: #E3B25A;
  --warning-bg: #2B2210;
  --danger: #F0877F;
  --danger-bg: #311917;
  --info: #8DB1F5;
  --info-bg: #15213A;
  --sh-1: 0 1px 2px rgb(0 0 0 / 0.4);
  --sh-2: 0 1px 2px rgb(0 0 0 / 0.4), 0 6px 20px rgb(0 0 0 / 0.35);
}

@media (prefers-color-scheme: dark) {
  [data-theme='auto'] {
    color-scheme: dark;
    --bg: #09112A;
    --surface: #101A33;
    --surface-2: #16223F;
    --surface-3: #1E2C4D;
    --sidebar: #0C1530;
    --cream: #17213A;
    --ink: #EDF0F7;
    --ink-2: #C3CBDD;
    --ink-3: #9BA6BF;
    --ink-4: #6E7A96;
    --line: #1E2A47;
    --line-2: #2C3A5C;
    --line-input: #7080A0;
    --brand: #2FC2B4;
    --brand-ink: #070F23;
    --brand-hover: #6FD6CB;
    --brand-text: #6FD6CB;
    --brand-soft: #0F2B33;
    --brand-line: #16525A;
    --accent: #2FC2B4;
    --brand-mark: #2FC2B4;
    --success: #5FC58A;
    --success-bg: #12261B;
    --warning: #E3B25A;
    --warning-bg: #2B2210;
    --danger: #F0877F;
    --danger-bg: #311917;
    --info: #8DB1F5;
    --info-bg: #15213A;
  }
}

[dir='rtl'] { --sx: -1; --font: var(--font-ar); line-height: var(--leading-ar); }
:lang(ar) { font-family: var(--font-ar); }
