:root {
  /* Color Palette - Midnight Slate & Enterprise Fintech */
  --bg-app: #0b0f17;
  --bg-surface: #111827;
  --bg-card: #162032;
  --bg-card-hover: #1e293b;
  --bg-card-active: #233147;
  --bg-input: #0e1522;
  
  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-default: rgba(255, 255, 255, 0.14);
  --border-strong: rgba(255, 255, 255, 0.24);
  
  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --text-inverse: #0f172a;
  
  /* Brand Accents */
  --accent-primary: #0284c7; /* Sky Blue */
  --accent-primary-hover: #0369a1;
  --accent-primary-glow: rgba(2, 132, 199, 0.25);
  
  --accent-emerald: #10b981; /* Success / Balanced */
  --accent-emerald-glow: rgba(16, 185, 129, 0.2);
  --accent-amber: #f59e0b;   /* Warning / In Review */
  --accent-amber-glow: rgba(245, 158, 11, 0.2);
  --accent-rose: #f43f5e;    /* Error / Cancelled */
  --accent-rose-glow: rgba(244, 63, 94, 0.2);
  --accent-violet: #8b5cf6;  /* Special / GOSI / Policies */
  --accent-cyan: #06b6d4;    /* Outbox */
  
  /* Radii */
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-full: 9999px;
  
  /* Shadows */
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.4), 0 2px 4px -2px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.5), 0 4px 6px -4px rgba(0, 0, 0, 0.4);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.6), 0 8px 10px -6px rgba(0, 0, 0, 0.5);
  
  /* Layout Dimensions */
  --sidebar-width: 270px;
  --header-height: 68px;
  
  /* Transitions */
  --transition-fast: 0.15s ease;
  --transition-normal: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  
  /* Fonts */
  --font-arabic: 'Cairo', system-ui, -apple-system, sans-serif;
  --font-latin: 'Inter', system-ui, -apple-system, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
}

/* Light Theme Variables (Switchable) */
body.theme-light {
  --bg-app: #f1f5f9;
  --bg-surface: #ffffff;
  --bg-card: #ffffff;
  --bg-card-hover: #f8fafc;
  --bg-card-active: #f1f5f9;
  --bg-input: #f8fafc;
  
  --border-subtle: #e2e8f0;
  --border-default: #cbd5e1;
  --border-strong: #94a3b8;
  
  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-muted: #64748b;
  --text-inverse: #f8fafc;
}

/* Base Reset */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  width: 100%;
  height: 100%;
  background-color: var(--bg-app);
  color: var(--text-primary);
  font-family: var(--font-arabic);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

[dir="ltr"] {
  font-family: var(--font-latin);
}

/* Scrollbars */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
  border-radius: var(--radius-full);
}
::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.25);
}

/* Typography Helpers */
h1, h2, h3, h4, h5, h6 {
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.25;
}

a {
  color: var(--accent-primary);
  text-decoration: none;
  transition: color var(--transition-fast);
}
a:hover {
  color: var(--accent-primary-hover);
}

button, input, select, textarea {
  font: inherit;
  color: inherit;
}

.mono {
  font-family: var(--font-mono);
  direction: ltr;
  display: inline-block;
}

/* Initial Fullscreen Loader */
.initial-loader {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100vh;
  gap: 16px;
  color: var(--text-secondary);
}
.spinner {
  width: 44px;
  height: 44px;
  border: 3px solid rgba(255, 255, 255, 0.1);
  border-radius: 50%;
  border-top-color: var(--accent-primary);
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}
