/**
 * Borsat design tokens — ONLY place for colors, spacing, radii, type, elevation.
 * One Door UX Module 1. Themes: theme-public | theme-app.
 * Tenant accent injected as --accent (default Borsat teal).
 */
:root {
  /* ── Neutral graphite core ─────────────────────────────────────────── */
  --gray-950: #070b12;
  --gray-900: #0c1220;
  --gray-850: #111827;
  --gray-800: #1a2332;
  --gray-700: #2a3548;
  --gray-600: #3d4a63;
  --gray-500: #64748b;
  --gray-400: #94a3b8;
  --gray-300: #cbd5e1;
  --gray-200: #e2e8f0;
  --gray-100: #f1f5f9;
  --gray-50: #f8fafc;
  --white: #ffffff;

  /* ── Brand / accent (overridable per tenant) ───────────────────────── */
  --accent: #0d9488;
  --accent-hover: #0f766e;
  --accent-muted: rgba(13, 148, 136, 0.14);
  --accent-contrast: #ffffff;

  /* Legacy aliases (borsat-* names used by existing CSS) */
  --borsat-navy: var(--gray-900);
  --borsat-blue: #2563eb;
  --borsat-blue-light: #3b82f6;
  --borsat-teal: var(--accent);
  --borsat-teal-light: #14b8a6;
  --borsat-good: #16a34a;
  --borsat-warn: #d97706;
  --borsat-bad: #dc2626;
  --borsat-gray-900: var(--gray-900);
  --borsat-gray-700: var(--gray-700);
  --borsat-gray-600: var(--gray-600);
  --borsat-gray-500: var(--gray-500);
  --borsat-gray-300: var(--gray-300);
  --borsat-gray-100: var(--gray-100);
  --borsat-white: var(--white);
  --borsat-bg-dark: var(--gray-950);
  --borsat-panel-dark: var(--gray-900);
  --borsat-line-dark: rgba(255, 255, 255, 0.08);

  /* ── Semantic ──────────────────────────────────────────────────────── */
  --good: #16a34a;
  --warn: #d97706;
  --bad: #dc2626;
  --info: #2563eb;

  /* Soft surfaces (alerts / badges) */
  --surface-good: #dcfce7;
  --surface-good-border: #bbf7d0;
  --surface-bad: #fef2f2;
  --surface-bad-border: #fecaca;
  --surface-warn: #fef3c7;
  --surface-warn-border: #fde68a;
  --surface-info: #eff6ff;
  --surface-info-border: #bfdbfe;
  --surface-info-text: #1e40af;
  --blue-800: #1e40af;
  --blue-200: #93c5fd;
  --blue-100: #dbeafe;

  /* ── Spacing scale ─────────────────────────────────────────────────── */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.25rem;
  --space-6: 1.5rem;
  --space-8: 2rem;
  --space-10: 2.5rem;
  --space-12: 3rem;

  /* ── Radii ─────────────────────────────────────────────────────────── */
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --borsat-radius-sm: var(--radius-sm);
  --borsat-radius-md: var(--radius-md);
  --borsat-radius-lg: var(--radius-lg);

  /* ── Type ──────────────────────────────────────────────────────────── */
  --font-display: "Sora", "IBM Plex Sans", "Noto Sans Arabic", sans-serif;
  --font-sans: "IBM Plex Sans", "Noto Sans Arabic", "Segoe UI", sans-serif;
  --font-mono: "IBM Plex Mono", "SFMono-Regular", Consolas, monospace;
  --borsat-font: var(--font-sans);
  --borsat-mono: var(--font-mono);
  --text-xs: 0.75rem;
  --text-sm: 0.875rem;
  --text-base: 1rem;
  --text-lg: 1.125rem;
  --text-xl: 1.35rem;
  --text-2xl: 1.75rem;
  --text-3xl: 2.25rem;
  --text-4xl: 2.75rem;
  --text-5xl: 3.25rem;
  --leading-tight: 1.25;
  --leading-normal: 1.55;

  /* ── Elevation ─────────────────────────────────────────────────────── */
  --shadow-sm: 0 1px 2px rgba(7, 11, 18, 0.08);
  --shadow-md: 0 4px 16px rgba(7, 11, 18, 0.12);
  --shadow-lg: 0 12px 40px rgba(7, 11, 18, 0.18);

  /* ── Motion ────────────────────────────────────────────────────────── */
  --transition: 0.15s ease;
  --borsat-transition: var(--transition);

  /* ── Theme-app defaults (workspace density) ────────────────────────── */
  --bg: var(--gray-50);
  --panel: var(--white);
  --panel-2: var(--gray-100);
  --line: var(--gray-200);
  --text: var(--gray-900);
  --muted: var(--gray-500);
  --header-bg: var(--white);
  --header-border: var(--gray-200);
  --nav-link: var(--gray-600);
  --nav-link-active: var(--accent);
  --blue: var(--info);
  --teal: var(--accent);
}

/* Public marketing: institutional light shell (enterprise surfaces) */
html.theme-public,
body.theme-public {
  --bg: #f6f8fb;
  --panel: var(--white);
  --panel-2: #eef2f7;
  --line: #d7dee8;
  --text: #0f172a;
  --muted: #5b6b7c;
  --header-bg: rgba(246, 248, 251, 0.92);
  --header-border: rgba(15, 23, 42, 0.08);
  --nav-link: #334155;
  --nav-link-active: var(--accent-hover);
}

/* App / workspace: light dense shell */
html.theme-app,
body.theme-app {
  --bg: var(--gray-50);
  --panel: var(--white);
  --panel-2: var(--gray-100);
  --line: var(--gray-200);
  --text: var(--gray-900);
  --muted: var(--gray-500);
  --header-bg: var(--white);
  --header-border: var(--gray-200);
}

/* RTL foundation */
[dir="rtl"] body {
  font-family: "Noto Sans Arabic", var(--font-sans);
}
