/* ── Design Tokens / CSS Custom Properties ────────────────────────── */
:root {
  /* ── Spacing ─────────────────────────────────────────── */
  --space-2:  2px;
  --space-4:  4px;
  --space-8:  8px;
  --space-12: 12px;
  --space-16: 16px;
  --space-20: 20px;
  --space-24: 24px;
  --space-32: 32px;

  /* ── Border Radius ───────────────────────────────────── */
  --radius-4:  4px;
  --radius-8:  8px;
  --radius-12: 12px;
  --radius-16: 16px;
  --radius-24: 24px;
  --radius-full: 9999px;

  /* ── Typography (Outfit + Noto Sans Arabic) ───────────── */
  --font-family-sans: 'Outfit', 'Noto Sans Arabic', system-ui, -apple-system, sans-serif;
  --font-family-mono: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;

  /* Font Sizes */
  --font-size-10: 0.625rem;
  --font-size-12: 0.75rem;
  --font-size-13: 0.8125rem;
  --font-size-14: 0.875rem;
  --font-size-16: 1rem;
  --font-size-18: 1.125rem;
  --font-size-20: 1.25rem;
  --font-size-24: 1.5rem;
  --font-size-32: 2rem;

  /* Font Weights */
  --font-weight-regular: 400;
  --font-weight-medium:  500;
  --font-weight-bold:    700;

  /* ── Transitions ─────────────────────────────────────── */
  --transition-fast:   0.15s ease;
  --transition-medium: 0.2s ease;
  --transition-slow:   0.3s ease;

  /* ── Sidebar Dimensions ──────────────────────────────── */
  --sidebar-width:           260px;
  --sidebar-collapsed-width: 72px;

  /* ────────────────────────────────────────────────────── */
  /* LIGHT THEME (default)                                  */
  /* ────────────────────────────────────────────────────── */

  /* ── Background colors ───────────────────────────────── */
  --bg-canvas:  #F2F6F9;
  --bg-surface: #F2F6F9;
  --bg-card:    #F6F9FB;
  --bg-white:   #FFFFFF;
  --bg-info:    #E8EFF5;
  --bg-success: #F0F5EB;
  --bg-warning: #FDF0E6;
  --bg-error:   #FBECE8;

  /* ── Brand / action palette (Deep Navy #0E3F66) ──────────────────────────── */
  --color-primary:        #0E3F66;
  --color-primary-hover:  #0A2E4B;
  --color-primary-light:  #EBF3F9;
  --color-primary-border: #BCD4E6;
  --color-brand:          #0E3F66;  /* Deep Navy — brand accent, sidebar */

  /* hover bg for primary-tinted interactive rows */
  --bg-hover-primary: #EEF4FF;

  /* ── Semantic state palette ──────────────────────────── */
  --color-success:               #689F38;
  --color-success-light:         #F0F5EB;
  --color-success-border:        #D0E1C1;

  --color-early-warning:         #F9A825;
  --color-early-warning-light:   #FEF6E9;
  --color-early-warning-border:  #FDE4BB;

  --color-warning:               #EF6C00;
  --color-warning-light:         #FDF0E6;
  --color-warning-border:        #FAD1B0;

  --color-error:                 #D84315;
  --color-error-light:           #FBECE8;
  --color-error-border:          #F3C5B6;

  /* ── Neutral / text palette ──────────────────────────── */
  --text-primary:     #1F2937;  /* 87% dark — titles, primary text */
  --text-secondary:   #63696E;  /* 60% — body text, secondary labels */
  --text-label:       #6B7176;  /* label headers, meta */
  --text-placeholder: #9CA3AF;  /* 38% — disabled text, icons */
  --text-white:       #FFFFFF;

  /* ── Borders & Dividers ──────────────────────────────── */
  --border-default:   #E2EBF3;  /* card outlines, inputs */
  --border-divider:   #E8EFF5;  /* section separators */
  --border-focus:     #0E3F66;  /* active/focus states */
  --border-indicator: #D5E2EC;  /* left indicator line on active nav item */

  /* ── Shadows ─────────────────────────────────────────── */
  --shadow-sm:   0 1px 2px rgba(0, 0, 0, 0.05);
  --shadow-card: 0 4px 12px rgba(14, 63, 102, 0.06);
  --shadow-lg:   0 10px 25px rgba(14, 63, 102, 0.12);
}

/* ────────────────────────────────────────────────────────── */
/* DARK THEME OVERRIDES                                       */
/* ────────────────────────────────────────────────────────── */
[data-bs-theme="dark"] {
  --bg-canvas:  #0F172A;
  --bg-surface: #0F172A;
  --bg-card:    #1E293B;
  --bg-white:   #1E293B;
  --bg-info:    #334155;
  --bg-success: #143820;
  --bg-warning: #3D2312;
  --bg-error:   #3B1812;

  --color-primary:        #0E3F66;
  --color-primary-hover:  #0A2E4B;
  --color-primary-light:  #1E293B;
  --color-primary-border: #334155;
  --color-brand:          #0E3F66;

  --bg-hover-primary: #334155;

  --text-primary:     #F8FAFC;
  --text-secondary:   #94A3B8;
  --text-label:       #94A3B8;
  --text-placeholder: #64748B;
  --text-white:       #FFFFFF;

  --border-default:   #334155;
  --border-divider:   #334155;
  --border-focus:     #0E3F66;
  --border-indicator: #0E3F66;

  --shadow-sm:   0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow-card: 0 4px 12px rgba(0, 0, 0, 0.4);
  --shadow-lg:   0 10px 25px rgba(0, 0, 0, 0.5);
}
