/* ==========================================================================
   EasyEG — Multi-Brand Design Tokens (variables.css)
   تغيير الألوان والخطوط للمنصة بالكامل أو لأي قسم فرعي يتم من هذا الملف فقط.
   ========================================================================== */

:root {
  /* Typography */
  --font-sans: 'Cairo', 'Tajawal', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-mono: ui-monospace, 'Cascadia Code', monospace;

  /* Spacing & Layout */
  --container-max: 1200px;
  --header-height: 64px;
  --bottom-nav-height: 64px;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 18px;
  --radius-full: 9999px;

  /* Shadows */
  --shadow-sm: 0 1px 3px rgba(15, 23, 42, 0.08);
  --shadow-md: 0 6px 18px rgba(15, 23, 42, 0.10);
  --shadow-lg: 0 14px 32px rgba(15, 23, 42, 0.14);

  /* Shared Semantic Colors */
  --bg-page: #f8fafc;
  --bg-surface: #ffffff;
  --bg-muted: #f1f5f9;
  --text-main: #0f172a;
  --text-muted: #475569;
  --text-inverse: #ffffff;
  --border-color: #e2e8f0;

  --success: #15803d;
  --success-bg: #dcfce7;
  --warning: #b45309;
  --warning-bg: #fef3c7;
  --danger: #b91c1c;
  --danger-bg: #fee2e2;
  --info: #0369a1;
  --info-bg: #e0f2fe;

  /* Default Brand: EasyEG (Umbrella Portal) */
  --brand-primary: #1e3a8a;
  --brand-primary-hover: #172554;
  --brand-accent: #f59e0b;
  --brand-soft: #eff6ff;
  --brand-gradient: linear-gradient(135deg, #1e3a8a 0%, #0f172a 100%);
}

/* Brand 1: EasyEG (Main Portal) */
[data-brand="group"] {
  --brand-primary: #1e3a8a;
  --brand-primary-hover: #172554;
  --brand-accent: #f59e0b;
  --brand-soft: #eff6ff;
  --brand-gradient: linear-gradient(135deg, #1e3a8a 0%, #0f172a 100%);
}

/* Brand 2: Easy Market (Snacks & Grocery Store) */
[data-brand="market"] {
  --brand-primary: #ea580c;
  --brand-primary-hover: #c2410c;
  --brand-accent: #dc2626;
  --brand-soft: #fff7ed;
  --brand-gradient: linear-gradient(135deg, #ea580c 0%, #b91c1c 100%);
}

/* Brand 3: Easy Money (Airtime, Scratch/Fakka Cards & E-Wallets) */
[data-brand="money"] {
  --brand-primary: #047857;
  --brand-primary-hover: #065f46;
  --brand-accent: #0f766e;
  --brand-soft: #ecfdf5;
  --brand-gradient: linear-gradient(135deg, #047857 0%, #0f172a 100%);
}

/* Brand 4: Easy Books (Google Drive PDF Library & Reader) */
[data-brand="books"] {
  --bg-page: #faf8f5;
  --brand-primary: #4338ca;
  --brand-primary-hover: #312e81;
  --brand-accent: #7c3aed;
  --brand-soft: #eef2ff;
  --brand-gradient: linear-gradient(135deg, #312e81 0%, #4c1d95 100%);
}

/* Admin Panel Theme */
[data-brand="admin"] {
  --brand-primary: #0f172a;
  --brand-primary-hover: #1e293b;
  --brand-accent: #2563eb;
  --brand-soft: #f1f5f9;
  --brand-gradient: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
}

/* Global Dark Mode Theme (V5 Complete) */
html[data-theme="dark"],
html[data-theme="dark"][data-brand="books"],
html[data-theme="dark"][data-brand="market"],
html[data-theme="dark"][data-brand="money"],
html[data-theme="dark"][data-brand="group"],
html[data-theme="dark"][data-brand="admin"] {
  --bg-body: #0b1120;
  --bg-page: #0b1120;
  --bg-surface: #111827;
  --bg-muted: #1f2937;
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --border-color: #273549;
  --brand-soft: rgba(99, 102, 241, 0.16);
  --success-bg: rgba(16, 185, 129, 0.16);
  --warning-bg: rgba(245, 158, 11, 0.16);
  --danger-bg: rgba(239, 68, 68, 0.16);
  --info-bg: rgba(14, 165, 233, 0.16);
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.35);
  --shadow-md: 0 10px 28px rgba(0, 0, 0, 0.45);
}
html[data-theme="dark"] body {
  background: var(--bg-page);
  color: var(--text-main);
}
html[data-theme="dark"] .card,
html[data-theme="dark"] .kpi-card,
html[data-theme="dark"] .empty-state,
html[data-theme="dark"] .admin-sidebar,
html[data-theme="dark"] .admin-table-wrap,
html[data-theme="dark"] .cat-circle__img {
  background: var(--bg-surface);
  border-color: var(--border-color);
  color: var(--text-main);
}
html[data-theme="dark"] .admin-table th {
  background: var(--bg-muted);
  color: var(--text-main);
}
html[data-theme="dark"] .admin-table td {
  border-color: var(--border-color);
}
html[data-theme="dark"] .grace-box {
  background: rgba(245, 158, 11, 0.12);
  border-color: rgba(245, 158, 11, 0.4);
  color: #fde68a;
}
html[data-theme="dark"] .site-header {
  background: rgba(17, 24, 39, 0.92);
}
html[data-theme="dark"] .mobile-bottom-nav,
html[data-theme="dark"] .mobile-drawer {
  background: #111827;
}
html[data-theme="dark"] .form-control {
  background: #0f172a;
  color: #f8fafc;
  border-color: #334155;
}

/* V6: High-Contrast Brand Accents & Buttons in Dark Mode */
html[data-theme="dark"][data-brand="group"] { --brand-primary: #60a5fa; --brand-primary-hover: #3b82f6; }
html[data-theme="dark"][data-brand="market"] { --brand-primary: #fb923c; --brand-primary-hover: #f97316; }
html[data-theme="dark"][data-brand="money"] { --brand-primary: #34d399; --brand-primary-hover: #10b981; }
html[data-theme="dark"][data-brand="books"] { --brand-primary: #818cf8; --brand-primary-hover: #6366f1; }
html[data-theme="dark"][data-brand="admin"] { --brand-primary: #60a5fa; --brand-primary-hover: #3b82f6; }
html[data-theme="dark"] .btn-primary { color: #0b1120; font-weight: 800; }
html[data-theme="dark"] .btn-outline { color: var(--text-main); border-color: var(--border-color); }
html[data-theme="dark"] .btn-soft { background: var(--bg-muted); color: var(--text-main); }
html[data-theme="dark"] .site-brand__name { color: var(--brand-primary); }
html[data-theme="dark"] .money-tab { background: var(--bg-muted); color: var(--text-main); border-color: var(--border-color); }
html[data-theme="dark"] .money-tab.is-active { background: var(--brand-primary); color: #0b1120; border-color: var(--brand-primary); }
html[data-theme="dark"] .amount-chip { background: var(--bg-muted); color: var(--text-main); border-color: var(--border-color); }
html[data-theme="dark"] .amount-chip.is-active { background: var(--brand-primary); color: #0b1120; border-color: var(--brand-primary); }
html[data-theme="dark"] .wallet-box,
html[data-theme="dark"] .fee-box { background: rgba(15, 23, 42, 0.75); border-color: var(--border-color); color: var(--text-main); }
