/* ============================================================================
   Astu Design System — Dark-First Tokens
   Source of truth: .stitch/DESIGN.md
   Dark mode is the DEFAULT. Light mode is optional via [data-theme="light"].
   ============================================================================ */

:root {
  /* ========================================
     Backgrounds (Dark Slate — the foundation)
     ======================================== */
  --bg-void: #0a0f1a;
  --bg-surface: #0f172a;
  --bg-card: #1e293b;
  --bg-elevated: #334155;
  --bg-glass: rgba(15,23,42,0.75);

  /* ========================================
     Borders & Dividers
     ======================================== */
  --border-subtle: rgba(148,163,184,0.06);
  --border-default: rgba(148,163,184,0.1);
  --border-strong: rgba(148,163,184,0.2);
  --border-glass: rgba(148,163,184,0.1);

  /* ========================================
     Text
     ======================================== */
  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --text-tertiary: #64748b;
  --text-inverse: #0f172a;

  /* ========================================
     Brand
     ======================================== */
  --color-primary: #6366f1;
  --color-primary-hover: #818cf8;
  --color-primary-dim: #4f46e5;
  --color-primary-ghost: rgba(99,102,241,0.1);
  --color-ai: #14b8a6;
  --color-ai-ghost: rgba(20,184,166,0.1);

  /* ========================================
     Module Accents
     ======================================== */
  --module-references: #a855f7;
  --module-agreements: #3b82f6;
  --module-contracts: #06b6d4;
  --module-financial: #22c55e;
  --module-soe: #f59e0b;
  --module-assets: #ec4899;
  --module-monitoring: #14b8a6;
  --module-users: #6366f1;
  --module-admin: #64748b;

  /* ========================================
     Status (consistent across ALL modules)
     ======================================== */
  --status-active: #22c55e;
  --status-pending: #f59e0b;
  --status-urgent: #ef4444;
  --status-draft: #64748b;

  /* ========================================
     Semantic (backward compat)
     ======================================== */
  --color-success: #22c55e;
  --color-warning: #f59e0b;
  --color-error: #ef4444;
  --color-info: #3b82f6;

  /* ========================================
     Typography
     ======================================== */
  --font-heading: 'Outfit', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'JetBrains Mono', 'SF Mono', Consolas, monospace;

  /* Font Sizes */
  --text-xs: 0.6875rem;    /* 11px */
  --text-sm: 0.8125rem;    /* 13px */
  --text-base: 0.875rem;   /* 14px */
  --text-lg: 0.9375rem;    /* 15px */
  --text-xl: 1rem;         /* 16px */
  --text-2xl: 1.25rem;     /* 20px */
  --text-3xl: 1.5rem;      /* 24px */
  --text-4xl: 2rem;        /* 32px */

  /* ========================================
     Spacing
     ======================================== */
  --space-xs: 4px;
  --space-sm: 8px;
  --space-md: 12px;
  --space-lg: 16px;
  --space-xl: 20px;
  --space-2xl: 24px;
  --space-3xl: 32px;
  --space-4xl: 48px;

  /* ========================================
     Border Radius
     ======================================== */
  --radius-sm: 4px;
  --radius-md: 6px;
  --radius-lg: 8px;
  --radius-xl: 12px;
  --radius-pill: 9999px;

  /* ========================================
     Shadows
     ======================================== */
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.2);
  --shadow-md: 0 2px 8px rgba(0,0,0,0.25);
  --shadow-lg: 0 4px 16px rgba(0,0,0,0.3);

  /* ========================================
     Transitions
     ======================================== */
  --transition-fast: 150ms ease;
  --transition-base: 200ms ease;
  --transition-slow: 300ms ease;

  /* ========================================
     Layout
     ======================================== */
  --sidebar-width: 240px;
  --sidebar-collapsed: 64px;
  --topbar-height: 56px;
  --content-max: 1400px;
  --content-padding: 24px;

  /* ========================================
     Z-index
     ======================================== */
  --z-sidebar: 100;
  --z-topbar: 90;
  --z-dropdown: 200;
  --z-modal: 1000;
  --z-toast: 1100;

  /* ========================================
     Backward compat aliases
     ======================================== */
  --color-surface: var(--bg-card);
  --color-surface-dim: var(--bg-surface);
  --color-text-primary: var(--text-primary);
  --color-text-secondary: var(--text-secondary);
  --card-bg: var(--bg-card);
  --font-family-base: var(--font-body);
  --font-family-heading: var(--font-heading);
  --font-family-mono: var(--font-mono);
  --border-radius-sm: var(--radius-sm);
  --border-radius-md: var(--radius-md);
  --border-radius-lg: var(--radius-lg);
  --border-radius-xl: var(--radius-xl);
  --border-radius-full: var(--radius-pill);

  /* ========================================
     National Identity — Gambian flag
     ======================================== */
  --flag-stripe: linear-gradient(90deg, #CE1126 33%, #0C2340 33% 66%, #3A7728 66%);
}

/* ============================================================================
   Optional Light Mode
   ============================================================================ */

[data-theme="light"] {
  --bg-void: #f1f5f9;
  --bg-surface: #ffffff;
  --bg-card: #ffffff;
  --bg-elevated: #f8fafc;
  --border-subtle: rgba(0,0,0,0.04);
  --border-default: rgba(0,0,0,0.08);
  --border-strong: rgba(0,0,0,0.15);
  --text-primary: #0f172a;
  --text-secondary: #64748b;
  --text-tertiary: #94a3b8;
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
  --shadow-md: 0 2px 8px rgba(0,0,0,0.08);
  --shadow-lg: 0 4px 16px rgba(0,0,0,0.1);
}