/* Light/Dark theme system using CSS custom properties */
:root,
[data-theme="light"] {
  --bg-primary: #f1f5f9;
  --bg-secondary: #ffffff;
  --bg-sidebar: #1e293b;
  --bg-sidebar-hover: #334155;
  --bg-sidebar-active: #0f172a;
  --bg-input: #ffffff;
  --bg-card: #ffffff;
  --bg-card-alt: #f8fafc;
  --bg-modal-overlay: rgba(0, 0, 0, 0.4);
  --bg-tooltip: #1e293b;

  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-muted: #94a3b8;
  --text-sidebar: #cbd5e1;
  --text-sidebar-active: #ffffff;
  --text-inverse: #ffffff;
  --text-tooltip: #f1f5f9;

  --border: #e2e8f0;
  --border-focus: #2563eb;
  --border-input: #cbd5e1;

  --accent: #2563eb;
  --accent-hover: #1d4ed8;
  --accent-light: #dbeafe;
  --accent-text: #ffffff;

  --success: #16a34a;
  --success-light: #dcfce7;
  --success-text: #15803d;

  --warning: #d97706;
  --warning-light: #fef3c7;
  --warning-text: #b45309;

  --danger: #dc2626;
  --danger-light: #fee2e2;
  --danger-text: #b91c1c;

  --military: #4d7c0f;
  --military-light: #ecfccb;
  --medical: #1d4ed8;
  --medical-light: #dbeafe;

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.1), 0 1px 2px rgba(0, 0, 0, 0.06);
  --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.07), 0 2px 4px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.1), 0 4px 6px rgba(0, 0, 0, 0.05);

  --radius-sm: 6px;
  --radius: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;

  --chart-line-1: #2563eb;
  --chart-line-2: #16a34a;
  --chart-line-3: #d97706;
  --chart-line-4: #dc2626;
  --chart-line-5: #7c3aed;
  --chart-fill-1: rgba(37, 99, 235, 0.1);
  --chart-fill-2: rgba(22, 163, 74, 0.1);
  --chart-grid: #e2e8f0;
  --chart-text: #64748b;
}

[data-theme="dark"] {
  --bg-primary: #0f172a;
  --bg-secondary: #1e293b;
  --bg-sidebar: #0f172a;
  --bg-sidebar-hover: #1e293b;
  --bg-sidebar-active: #1e293b;
  --bg-input: #1e293b;
  --bg-card: #1e293b;
  --bg-card-alt: #162033;
  --bg-modal-overlay: rgba(0, 0, 0, 0.6);
  --bg-tooltip: #334155;

  --text-primary: #f1f5f9;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --text-sidebar: #94a3b8;
  --text-sidebar-active: #f1f5f9;
  --text-inverse: #0f172a;
  --text-tooltip: #f1f5f9;

  --border: #334155;
  --border-focus: #3b82f6;
  --border-input: #475569;

  --accent: #3b82f6;
  --accent-hover: #2563eb;
  --accent-light: rgba(59, 130, 246, 0.15);
  --accent-text: #ffffff;

  --success: #22c55e;
  --success-light: rgba(34, 197, 94, 0.15);
  --success-text: #4ade80;

  --warning: #f59e0b;
  --warning-light: rgba(245, 158, 11, 0.15);
  --warning-text: #fbbf24;

  --danger: #ef4444;
  --danger-light: rgba(239, 68, 68, 0.15);
  --danger-text: #f87171;

  --military: #84cc16;
  --military-light: rgba(132, 204, 22, 0.15);
  --medical: #60a5fa;
  --medical-light: rgba(96, 165, 250, 0.15);

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.5);

  --bg-card: #1e293b;

  --chart-line-1: #3b82f6;
  --chart-line-2: #22c55e;
  --chart-line-3: #f59e0b;
  --chart-line-4: #ef4444;
  --chart-line-5: #a78bfa;
  --chart-fill-1: rgba(59, 130, 246, 0.15);
  --chart-fill-2: rgba(34, 197, 94, 0.15);
  --chart-grid: #334155;
  --chart-text: #94a3b8;
}

/* Transition for smooth theme switching */
body,
.sidebar,
.main-content,
.card,
input, select, textarea, button {
  transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}
