/* ==========================================================================
   DocuAlert Design Tokens — "Swiss Vault: Deep Navy & Secure Emerald"
   Light Theme (Default) + Dark Theme ([data-theme="dark"])
   All foreground/background pairs verified WCAG 2.1 AA / AAA.
   ========================================================================== */

:root {
  color-scheme: light;

  /* Typography */
  --font-display: 'Plus Jakarta Sans', 'Segoe UI', system-ui, -apple-system, sans-serif;
  --font-body: 'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif;
  --font-mono: 'JetBrains Mono', 'Cascadia Code', Consolas, monospace;

  /* Brand Identity — Deep Vault Navy + Secure Emerald Teal */
  --color-primary: #0f3d5e;
  --color-primary-hover: #0b2e47;
  --color-primary-soft: #eaf4fb;
  --color-primary-border: #b8d8ee;

  --color-accent: #059669;
  --color-accent-hover: #047857;
  --color-accent-soft: #ecfdf5;
  --color-accent-border: #a7f3d0;

  --color-vault: #0f766e;
  --color-vault-soft: #f0fdfa;
  --color-vault-border: #99f6e4;

  --brand-gradient: linear-gradient(135deg, #0f3d5e 0%, #0f6870 58%, #059669 100%);
  --hero-gradient: linear-gradient(135deg, #0b253c 0%, #0f3d5e 52%, #0d6a68 100%);

  /* Neutral Surfaces & Borders (Crisp Swiss Alabaster) */
  --bg-app: #f4f7fa;
  --bg-surface: #ffffff;
  --bg-surface-subtle: #edf2f7;
  --bg-overlay: rgba(11, 25, 44, 0.56);
  --border-default: #e2e8f0;
  --border-strong: #cbd5e1;

  /* Text Hierarchy (WCAG AAA/AA) */
  --text-primary: #0b192c;
  --text-secondary: #425466;
  --text-muted: #64748b;
  --text-on-primary: #ffffff;

  /* Semantic Expiry Status Colors */
  --status-expired: #be123c;
  --status-expired-bg: #fff1f2;
  --status-expired-border: #fecdd3;

  --status-soon: #b45309;
  --status-soon-bg: #fffbeb;
  --status-soon-border: #fde68a;

  --status-valid: #047857;
  --status-valid-bg: #ecfdf5;
  --status-valid-border: #a7f3d0;

  --status-sensitive: #6d28d9;
  --status-sensitive-bg: #f5f3ff;
  --status-sensitive-border: #ddd6fe;

  /* Priority Badge Palette */
  --priority-high: #be123c;
  --priority-high-bg: #ffe4e6;
  --priority-high-border: #fecdd3;

  --priority-medium: #b45309;
  --priority-medium-bg: #fef3c7;
  --priority-medium-border: #fde68a;

  --priority-low: #0369a1;
  --priority-low-bg: #e0f2fe;
  --priority-low-border: #bae6fd;

  /* Spacing Scale (4px Base) */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-8: 32px;

  /* Border Radii */
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-xl: 18px;
  --radius-full: 9999px;

  /* Refined Elevation */
  --shadow-card: 0 1px 2px rgba(11, 25, 44, 0.04), 0 2px 6px rgba(11, 25, 44, 0.03);
  --shadow-card-hover: 0 10px 24px -8px rgba(15, 61, 94, 0.14), 0 2px 6px rgba(11, 25, 44, 0.04);
  --shadow-modal: 0 24px 48px -12px rgba(11, 25, 44, 0.22), 0 8px 16px -6px rgba(11, 25, 44, 0.1);

  /* Shell Dimensions & Motion */
  --sidebar-width: 232px;
  --topbar-height: 60px;
  --mobile-nav-height: 64px;
  --content-max-width: 1260px;
  --transition-fast: 160ms cubic-bezier(0.2, 0, 0, 1);
  --transition-base: 220ms cubic-bezier(0.2, 0, 0, 1);
}

[data-theme="dark"] {
  color-scheme: dark;

  /* Brand Identity — Obsidian Navy + Luminous Vault Teal/Sky */
  --color-primary: #38bdf8;
  --color-primary-hover: #7dd3fc;
  --color-primary-soft: rgba(56, 189, 248, 0.14);
  --color-primary-border: rgba(56, 189, 248, 0.34);

  --color-accent: #10b981;
  --color-accent-hover: #34d399;
  --color-accent-soft: rgba(16, 185, 129, 0.15);
  --color-accent-border: rgba(16, 185, 129, 0.34);

  --color-vault: #2dd4bf;
  --color-vault-soft: rgba(45, 212, 191, 0.12);
  --color-vault-border: rgba(45, 212, 191, 0.3);

  --brand-gradient: linear-gradient(135deg, #0ea5e9 0%, #0d9488 60%, #10b981 100%);
  --hero-gradient: linear-gradient(135deg, #0b1c31 0%, #10324d 52%, #0a4a48 100%);

  /* Obsidian Surfaces */
  --bg-app: #09111e;
  --bg-surface: #101b2d;
  --bg-surface-subtle: #17263d;
  --bg-overlay: rgba(3, 8, 18, 0.76);
  --border-default: rgba(148, 163, 184, 0.14);
  --border-strong: rgba(148, 163, 184, 0.28);

  --text-primary: #f8fafc;
  --text-secondary: #9fb1c8;
  --text-muted: #70849f;
  --text-on-primary: #062033;

  --status-expired: #fda4af;
  --status-expired-bg: rgba(244, 63, 94, 0.16);
  --status-expired-border: rgba(244, 63, 94, 0.36);

  --status-soon: #fcd34d;
  --status-soon-bg: rgba(245, 158, 11, 0.16);
  --status-soon-border: rgba(245, 158, 11, 0.36);

  --status-valid: #6ee7b7;
  --status-valid-bg: rgba(16, 185, 129, 0.16);
  --status-valid-border: rgba(16, 185, 129, 0.36);

  --status-sensitive: #c4b5fd;
  --status-sensitive-bg: rgba(139, 92, 246, 0.16);
  --status-sensitive-border: rgba(139, 92, 246, 0.36);

  --priority-high: #fda4af;
  --priority-high-bg: rgba(225, 29, 72, 0.2);
  --priority-high-border: rgba(225, 29, 72, 0.38);

  --priority-medium: #fcd34d;
  --priority-medium-bg: rgba(217, 119, 6, 0.2);
  --priority-medium-border: rgba(217, 119, 6, 0.38);

  --priority-low: #7dd3fc;
  --priority-low-bg: rgba(14, 165, 233, 0.18);
  --priority-low-border: rgba(14, 165, 233, 0.36);

  --shadow-card: 0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow-card-hover: 0 12px 28px -8px rgba(0, 0, 0, 0.6);
  --shadow-modal: 0 24px 48px rgba(0, 0, 0, 0.68);
}

/* Prevents staggered color transitions / visual jumping during instant theme toggle */
html.theme-switching,
html.theme-switching *,
html.theme-switching *::before,
html.theme-switching *::after {
  transition: none !important;
  animation: none !important;
}
