/* ════════════════════════════════════════════════════════════
   FIRDAUS — The Living Islamic Ecosystem
   Design System v2.0 — "The Garden at Fajr"
   ════════════════════════════════════════════════════════════
   Inspired by the highest garden of Paradise.
   A celestial night transitioning into the golden light of dawn.
   Every pixel should whisper: Jannah.
   ════════════════════════════════════════════════════════════ */

/* ── CSS Custom Properties ── */
:root {
  /* ── Paradise Canvas: Warm Cream ── */
  --color-bg-primary: #faf7f0;
  --color-bg-secondary: #f0ece0;
  --color-bg-tertiary: #e8e0d0;
  --color-bg-card: rgba(255, 252, 245, 0.85);
  --color-bg-glass: rgba(27, 107, 58, 0.04);
  --color-bg-glass-hover: rgba(27, 107, 58, 0.08);
  --color-bg-elevated: #fffdf7;

  /* ── Surface ── */
  --color-surface: #f0ece0;
  --color-surface-hover: #e8e0d0;

  /* ── Sacred Gold (Ayah-inspired) ── */
  --color-gold: #C9A96E;
  --color-gold-light: #D4A843;
  --color-gold-pale: #F0D98A;
  --color-gold-glow: rgba(212, 168, 67, 0.2);
  --color-gold-subtle: rgba(212, 168, 67, 0.08);
  --color-gold-border: rgba(212, 168, 67, 0.15);

  /* ── Garden Emerald (Ayah-inspired forest) ── */
  --color-emerald: #1B6B3A;
  --color-emerald-light: #2D8A4F;
  --color-emerald-glow: rgba(27, 107, 58, 0.18);
  --color-emerald-subtle: rgba(27, 107, 58, 0.06);

  /* ── Celestial Accents ── */
  --color-teal: #2A7A6A;
  --color-teal-light: #3A9A8A;
  --color-amber: #D4A843;
  --color-rose: #8A5A4A;

  /* ── Depths ── */
  --color-navy: #1A2A1A;
  --color-navy-light: #2A3A2A;

  /* ── Divine Light ── */
  --color-fajr-top: rgba(212, 168, 67, 0.08);
  --color-fajr-center: rgba(212, 168, 67, 0.04);

  /* ── Text ── */
  --color-text-primary: #1A2A1A;
  --color-text-secondary: #5A6A5A;
  --color-text-tertiary: #8A9A8A;
  --color-text-muted: #B0BAB0;
  --color-text-gold: var(--color-gold-light);

  /* ── Accents ── */
  --color-accent: var(--color-gold);
  --color-accent-hover: var(--color-gold-light);
  --color-success: #1B6B3A;
  --color-warning: #C9A96E;
  --color-error: #B0302A;
  --color-info: #4A7A6A;

  /* ── Typography ── */
  --font-arabic: 'Noto Naskh Arabic', 'Amiri', 'Traditional Arabic', serif;
  --font-ui: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;

  /* ── Spacing ── */
  --spacing-xs: 4px;
  --spacing-sm: 8px;
  --spacing-md: 16px;
  --spacing-lg: 24px;
  --spacing-xl: 32px;
  --spacing-2xl: 48px;
  --spacing-3xl: 64px;

  /* ── Radius ── */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;
  --radius-full: 50%;

  /* ── Shadows ── */
  --shadow-sm: 0 1px 4px rgba(0,0,0,0.06);
  --shadow-md: 0 4px 16px rgba(0,0,0,0.08);
  --shadow-lg: 0 8px 32px rgba(0,0,0,0.1);
  --shadow-glow: 0 0 24px var(--color-gold-glow);
  --shadow-gold: 0 0 12px rgba(200, 148, 58, 0.12);
  --shadow-card: 0 2px 12px rgba(0,0,0,0.06), inset 0 1px 0 rgba(255,255,255,0.8);

  /* ── Transitions ── */
  --transition-fast: 0.2s ease;
  --transition-base: 0.35s ease;
  --transition-slow: 0.6s ease;

  /* ── Layout ── */
  --sidebar-width: 280px;
  --sidebar-collapsed: 0px;
  --header-height: 60px;
}

/* ── Light Theme ── */
[data-theme="dark"] {
  --color-bg-primary: #0a0a14;
  --color-bg-secondary: #101020;
  --color-bg-tertiary: #181830;
  --color-bg-card: rgba(16, 16, 32, 0.55);
  --color-bg-glass: rgba(0, 0, 0, 0.06);
  --color-bg-glass-hover: rgba(0, 0, 0, 0.12);
  --color-bg-elevated: #0F1A12;
  --color-surface: #0F1A12;
  --color-surface-hover: #1A2A1A;
  --color-navy: #0A1410;
  --color-navy-light: #162818;
  --color-text-primary: #F0F0E8;
  --color-text-secondary: #A0B0A0;
  --color-text-tertiary: #6A7A6A;
  --color-text-muted: #4A5A4A;
  --color-fajr-top: rgba(212, 168, 67, 0.1);
  --color-fajr-center: rgba(212, 168, 67, 0.05);
  --shadow-md: 0 4px 20px rgba(0,0,0,0.5);
  --shadow-lg: 0 8px 40px rgba(0,0,0,0.6);
  --shadow-card: 0 4px 24px rgba(0,0,0,0.4), inset 0 1px 0 rgba(255,255,255,0.04);
  --color-gold: #D4A843;
  --color-gold-light: #E8C65A;
  --color-gold-glow: rgba(212, 168, 67, 0.3);
}

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

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-ui);
  background: var(--color-bg-primary);
  color: var(--color-text-primary);
  min-height: 100vh;
  overflow-x: hidden;
  transition: background var(--transition-base), color var(--transition-base);
}

a { color: var(--color-accent); text-decoration: none; transition: color var(--transition-fast); }
a:hover { color: var(--color-accent-hover); }
img { max-width: 100%; height: auto; }

button {
  cursor: pointer;
  border: none;
  background: none;
  font-family: inherit;
  font-size: inherit;
  color: inherit;
}

input, textarea, select {
  font-family: var(--font-ui);
  font-size: inherit;
}

/* ── Divine Scrollbar ── */
::-webkit-scrollbar { width: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, var(--color-gold), var(--color-emerald));
  border-radius: 3px;
  opacity: 0.5;
}
::-webkit-scrollbar-thumb:hover { opacity: 1; }

/* ════════════════════════════════════════════════════════════
   CELESTIAL BACKGROUND
   A living night sky with the first light of Fajr
   ════════════════════════════════════════════════════════════ */

/* ── Main celestial gradient canvas ── */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -2;
  background:
    /* Warm golden Fajr glow at top — sunrise over Jannah */
    radial-gradient(ellipse 80% 40% at 50% 0%,
      rgba(212, 168, 67, 0.12) 0%,
      rgba(200, 148, 58, 0.06) 30%,
      transparent 70%
    ),
    /* Lush emerald at bottom — Gardens of Paradise */
    radial-gradient(ellipse 70% 30% at 50% 100%,
      rgba(27, 107, 58, 0.10) 0%,
      rgba(26, 138, 110, 0.05) 30%,
      transparent 60%
    ),
    /* Warm cream base transitioning to soft green */
    linear-gradient(180deg,
      #faf7f0 0%,
      #f0ece0 30%,
      #e8edd5 60%,
      #dce8d0 100%
    );
}

/* ── Secondary aurora layer ── */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(ellipse 50% 25% at 70% 15%,
      rgba(180, 140, 60, 0.03) 0%,
      transparent 60%
    ),
    radial-gradient(ellipse 40% 20% at 30% 20%,
      rgba(26, 138, 110, 0.02) 0%,
      transparent 50%
    );
  pointer-events: none;
}

/* ── Light theme celestial override ── */
/* ── Dark Theme background ── */
[data-theme="dark"] body::before {
  background:
    /* Golden fajr glow — stronger against dark bg */
    radial-gradient(ellipse 80% 40% at 50% 0%,
      rgba(212, 168, 67, 0.12) 0%,
      transparent 70%
    ),
    /* Emerald gardens glow at bottom */
    radial-gradient(ellipse 70% 30% at 50% 100%,
      rgba(27, 107, 58, 0.08) 0%,
      transparent 50%
    ),
    /* Dark forest paradise */
    linear-gradient(180deg,
      #0A1410 0%,
      #0F1A12 30%,
      #122418 60%,
      #0E1E14 100%
    );
}
[data-theme="dark"] body::after { display: block; }

/* ── Background Ornaments ── */
.bg-ornaments {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.ornament {
  position: absolute;
  border-radius: var(--radius-full);
  filter: blur(80px);
  opacity: 0.2;
}

.ornament-1 {
  width: 500px; height: 500px;
  background: radial-gradient(circle, rgba(212, 168, 67, 0.12) 0%, transparent 70%);
  top: -150px; right: -100px;
  animation: ornamentFloat 25s ease-in-out infinite;
}

.ornament-2 {
  width: 400px; height: 400px;
  background: radial-gradient(circle, rgba(26, 138, 110, 0.10) 0%, transparent 70%);
  bottom: -120px; left: -100px;
  animation: ornamentFloat 30s ease-in-out infinite reverse;
}

.ornament-3 {
  width: 250px; height: 250px;
  background: radial-gradient(circle, rgba(200, 148, 58, 0.08) 0%, transparent 70%);
  top: 40%; left: 5%;
  animation: ornamentFloat 35s ease-in-out infinite 5s;
}

.ornament-4 {
  width: 180px; height: 180px;
  background: radial-gradient(circle, rgba(212, 168, 67, 0.10) 0%, transparent 70%);
  bottom: 25%; right: 10%;
  animation: ornamentFloat 28s ease-in-out infinite 3s;
}

.ornament-5 {
  width: 300px; height: 300px;
  background: radial-gradient(circle, rgba(180, 140, 60, 0.06) 0%, transparent 70%);
  top: 15%; left: 50%;
  animation: ornamentFloat 22s ease-in-out infinite 7s;
}

@keyframes ornamentFloat {
  0%, 100% { transform: translate(0, 0) scale(1); }
  25% { transform: translate(40px, -35px) scale(1.08); }
  50% { transform: translate(-25px, 25px) scale(0.92); }
  75% { transform: translate(25px, 20px) scale(1.04); }
}

/* ── Stars Container ── */
.stars-container {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
  display: none; /* Replaced by canvas geometric patterns */
}

.star {
  position: absolute;
  border-radius: var(--radius-full);
  animation: starTwinkle var(--duration, 4s) ease-in-out infinite;
  animation-delay: var(--delay, 0s);
  opacity: 0;
}

/* Golden stars — primary */
.star-gold {
  width: 2px;
  height: 2px;
  background: var(--color-gold-light);
  box-shadow: 0 0 3px var(--color-gold-glow);
}

/* White stars — secondary */
.star-white {
  width: 1.5px;
  height: 1.5px;
  background: #ffffff;
  opacity: 0.6;
}

/* Bright golden stars — featured */
.star-bright {
  width: 3px;
  height: 3px;
  background: var(--color-gold);
  box-shadow: 0 0 6px var(--color-gold-glow);
}

@keyframes starTwinkle {
  0%, 100% { opacity: 0; transform: scale(0.5); }
  30% { opacity: 0.3; transform: scale(1); }
  60% { opacity: 0.1; transform: scale(0.8); }
}

[data-theme="dark"] .star {
  background: var(--color-navy-light);
  box-shadow: none;
}
[data-theme="dark"] .star {
  animation: starTwinkleLight var(--duration, 4s) ease-in-out infinite;
}

@keyframes starTwinkleLight {
  0%, 100% { opacity: 0.05; transform: scale(0.5); }
  50% { opacity: 0.25; transform: scale(1); }
}

/* ── Shooting Star ── */
.shooting-star {
  position: fixed;
  width: 2px;
  height: 2px;
  background: linear-gradient(to right, transparent, var(--color-gold-light), white, transparent);
  border-radius: 0;
  pointer-events: none;
  z-index: 1;
  animation: shootingStar 6s ease-in-out infinite;
  opacity: 0;
}

.shooting-star::after {
  content: '';
  position: absolute;
  right: 0;
  width: 60px;
  height: 1px;
  background: linear-gradient(to left, rgba(232, 198, 90, 0.6), transparent);
}

@keyframes shootingStar {
  0% { transform: translate(0, 0) rotate(-35deg); opacity: 0; }
  5% { opacity: 1; }
  15% { transform: translate(-400px, 300px) rotate(-35deg); opacity: 1; }
  20% { opacity: 0; }
  100% { opacity: 0; }
}

/* ════════════════════════════════════════════════════════════
   SIDEBAR — The Garden Path
   ════════════════════════════════════════════════════════════ */

.sidebar {
  position: fixed;
  left: 0;
  top: 0;
  bottom: 0;
  width: var(--sidebar-width);
  background: #ffffff;
  border-right: 1px solid rgba(200, 210, 220, 0.4);
  z-index: 100;
  display: flex;
  flex-direction: column;
  transition: transform var(--transition-base), background var(--transition-base);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
}

/* Golden right-edge glow on sidebar */
.sidebar::after {
  content: '';
  position: absolute;
  right: -1px;
  top: 0;
  bottom: 0;
  width: 2px;
  background: linear-gradient(180deg,
    transparent 0%,
    var(--color-gold) 20%,
    var(--color-gold-light) 50%,
    var(--color-gold) 80%,
    transparent 100%
  );
  opacity: 0.4;
  box-shadow: 2px 0 20px rgba(212, 175, 55, 0.15);
}

[data-theme="dark"] .sidebar-header {
  background: linear-gradient(135deg, rgba(100, 170, 230, 0.3), rgba(60, 140, 210, 0.15));
  border-bottom-color: rgba(120, 190, 255, 0.15);
}

[data-theme="dark"] .sidebar {
  background: linear-gradient(180deg, #060E08 0%, #0A1410 50%, #0E1E14 100%);
  border-right-color: rgba(212, 168, 67, 0.15);
}

[data-theme="dark"] .sidebar-toggle {
  color: #6A7A6A;
}
[data-theme="dark"] .sidebar-toggle:hover {
  background: rgba(212, 168, 67, 0.08);
  color: var(--color-gold-light);
}

[data-theme="dark"] .search-box input {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(212, 168, 67, 0.1);
  color: #E8E0D0;
}
[data-theme="dark"] .search-box input:focus {
  border-color: rgba(212, 168, 67, 0.3);
  background: rgba(255, 255, 255, 0.1);
  box-shadow: 0 0 0 3px rgba(212, 168, 67, 0.08);
}
[data-theme="dark"] .search-box input::placeholder {
  color: #5A6A5A;
}

[data-theme="dark"] .nav-section {
  background: rgba(212, 168, 67, 0.04);
  border-color: rgba(212, 168, 67, 0.06);
}
[data-theme="dark"] .nav-section-title {
  color: #FFE87C;
  text-shadow: 0 0 12px rgba(255, 232, 124, 0.25);
}
[data-theme="dark"] .nav-item {
  color: #FFF8E0;
  font-weight: 600;
}
[data-theme="dark"] .nav-item:hover {
  background: rgba(212, 168, 67, 0.08);
  color: #F0E8D0;
}
[data-theme="dark"] .nav-item.active {
  background: rgba(212, 168, 67, 0.1);
  color: var(--color-gold-light);
  font-weight: 600;
}

[data-theme="dark"] .sidebar-footer {
  border-top-color: rgba(212, 168, 67, 0.08);
}
[data-theme="dark"] .prayer-widget-compact {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(212, 168, 67, 0.08);
  color: #B0C0B0;
}
[data-theme="dark"] .theme-toggle {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(212, 168, 67, 0.1);
  color: var(--color-gold-light);
}
[data-theme="dark"] .theme-toggle:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--color-gold);
  border-color: rgba(212, 168, 67, 0.2);
  box-shadow: 0 0 12px rgba(212, 168, 67, 0.12);
}

.sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--spacing-lg);
  border-bottom: 1px solid rgba(120, 190, 255, 0.2);
  background: linear-gradient(135deg, rgba(135, 200, 255, 0.3), rgba(100, 180, 255, 0.15));
  box-shadow: inset 0 1px 0 rgba(135, 200, 255, 0.1);
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: var(--spacing-md);
}

.logo-icon {
  font-size: 28px;
  line-height: 1;
  filter: drop-shadow(0 0 8px rgba(212, 168, 67, 0.3));
  animation: logoGlow 4s ease-in-out infinite;
}

@keyframes logoGlow {
  0%, 100% { filter: drop-shadow(0 0 8px rgba(212, 168, 67, 0.3)); }
  50% { filter: drop-shadow(0 0 16px rgba(212, 168, 67, 0.5)); }
}

.logo-text {
  display: flex;
  flex-direction: column;
}

.logo-title {
  font-weight: 800;
  font-size: 22px;
  letter-spacing: -0.5px;
  color: #ffffff;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
  filter: drop-shadow(0 0 12px rgba(100, 180, 255, 0.3));
}

.logo-subtitle {
  font-size: 10px;
  color: var(--color-text-tertiary);
  letter-spacing: 2px;
  text-transform: uppercase;
  font-weight: 400;
}

.sidebar-toggle {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  color: #6A7A6A;
  transition: all var(--transition-fast);
}
.sidebar-toggle:hover {
  background: rgba(27, 107, 58, 0.06);
  color: var(--color-emerald);
}

/* Sidebar Search */
.sidebar-search {
  padding: var(--spacing-md) var(--spacing-lg);
}

.search-box {
  position: relative;
  display: flex;
  align-items: center;
}

.search-icon {
  position: absolute;
  left: 12px;
  color: var(--color-text-tertiary);
  pointer-events: none;
  font-size: 14px;
}

.search-box input {
  width: 100%;
  padding: 10px 12px 10px 38px;
  background: rgba(0, 0, 0, 0.04);
  border: 1px solid rgba(200, 210, 220, 0.5);
  border-radius: var(--radius-md);
  color: #2A3A2A;
  font-size: 13px;
  outline: none;
  transition: all var(--transition-fast);
}

.search-box input:focus {
  border-color: var(--color-emerald-light);
  background: rgba(0, 0, 0, 0.06);
  box-shadow: 0 0 0 3px rgba(27, 107, 58, 0.08);
}

.search-box input::placeholder {
  color: #A0AAB0;
}

/* Sidebar Navigation */
.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  padding: var(--spacing-sm) var(--spacing-md);
  scrollbar-width: thin;
}

.nav-section {
  margin-bottom: var(--spacing-sm);
  background: rgba(27, 107, 58, 0.03);
  border-radius: var(--radius-md);
  padding: 4px 6px;
  border: 1px solid rgba(27, 107, 58, 0.05);
}

.nav-section-title {
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 2.5px;
  color: #4A6A4A;
  padding: 8px var(--spacing-md) 6px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: var(--spacing-md);
  padding: 10px var(--spacing-md);
  border-radius: var(--radius-md);
  color: #2A3A2A;
  font-size: 14px;
  font-weight: 500;
  transition: all var(--transition-fast);
  cursor: pointer;
  position: relative;
}

.nav-item:hover {
  background: rgba(27, 107, 58, 0.05);
  color: var(--color-emerald);
}

.nav-item.active {
  background: rgba(27, 107, 58, 0.08);
  color: var(--color-emerald);
  font-weight: 600;
}

/* Golden "noor" (light) line on active item */
.nav-item.active::before {
  content: '';
  position: absolute;
  left: -8px;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 20px;
  background: linear-gradient(180deg, var(--color-gold), var(--color-gold-light));
  border-radius: 0 3px 3px 0;
  box-shadow: 0 0 8px rgba(212, 168, 67, 0.4);
}

.nav-item.active::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: var(--radius-md);
  box-shadow: inset 0 0 20px rgba(212, 168, 67, 0.04);
  pointer-events: none;
}

.nav-item-icon {
  width: 20px;
  text-align: center;
  font-size: 16px;
  line-height: 1;
}

.nav-item-label {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.nav-item-badge {
  margin-left: auto;
  background: rgba(212, 168, 67, 0.1);
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 10px;
  color: var(--color-gold-light);
}

/* ── Sidebar Prayer Widget ── */
.sidebar-footer {
  padding: var(--spacing-md) var(--spacing-lg);
  border-top: 1px solid rgba(200, 210, 220, 0.3);
  display: flex;
  align-items: center;
  gap: var(--spacing-md);
}

.prayer-widget-compact {
  flex: 1;
  padding: 10px 14px;
  background: rgba(27, 107, 58, 0.04);
  border: 1px solid rgba(27, 107, 58, 0.08);
  border-radius: var(--radius-md);
  font-size: 12px;
  color: #4A6A4A;
}

.theme-toggle {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-md);
  background: rgba(27, 107, 58, 0.05);
  border: 1px solid rgba(27, 107, 58, 0.1);
  color: var(--color-emerald-light);
  transition: all var(--transition-fast);
  flex-shrink: 0;
  font-size: 16px;
}

.theme-toggle:hover {
  background: rgba(27, 107, 58, 0.1);
  color: var(--color-emerald);
  border-color: rgba(27, 107, 58, 0.2);
  box-shadow: 0 0 12px rgba(27, 107, 58, 0.12);
}
.theme-toggle .sun-icon { display: none; }
.theme-toggle .moon-icon { display: block; }

[data-theme="light"] .theme-toggle .sun-icon { display: block; }
[data-theme="light"] .theme-toggle .moon-icon { display: none; }

/* ════════════════════════════════════════════════════════════
   MOBILE HEADER
   ════════════════════════════════════════════════════════════ */

.mobile-header {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--header-height);
  background: linear-gradient(90deg, #0A1410 0%, #0F1A12 100%);
  border-bottom: 1px solid rgba(212, 168, 67, 0.1);
  z-index: 90;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--spacing-md);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
}

[data-theme="dark"] .mobile-header {
  background: linear-gradient(90deg, #060E08 0%, #0A1410 100%);
}

.mobile-menu-btn {
  background: none;
  border: none;
  color: #ffffff;
  cursor: pointer;
  padding: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.mobile-logo-text {
  font-size: 20px;
  font-weight: 700;
  background: linear-gradient(135deg, var(--color-gold-pale), var(--color-gold));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.mobile-header-actions {
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
}

.mobile-btn {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-md);
  color: #4a6a8a;
  transition: all var(--transition-fast);
  font-size: 18px;
}

.mobile-btn:hover {
  background: rgba(255, 255, 255, 0.5);
  color: #2a4a7a;
}

/* ── Sidebar Overlay ── */
.sidebar-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  z-index: 99;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition-base);
}

.sidebar-overlay.show {
  opacity: 1;
  pointer-events: all;
}

/* ════════════════════════════════════════════════════════════
   MAIN CONTENT
   ════════════════════════════════════════════════════════════ */

.main-content {
  margin-left: var(--sidebar-width);
  min-height: 100vh;
  padding: var(--spacing-xl);
  position: relative;
  z-index: 1;
  padding-top: calc(var(--header-height) + var(--spacing-lg));
}

@media (max-width: 768px) {
  .main-content {
    margin-left: 0;
    padding: var(--spacing-md);
    padding-top: calc(var(--header-height) + var(--spacing-md));
  }
  .mobile-header { display: flex; }
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); }
}

/* ════════════════════════════════════════════════════════════
   HOLY LOADING SCREEN
   ════════════════════════════════════════════════════════════ */

.loading-screen {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 60vh;
  gap: var(--spacing-lg);
}

.loading-ornament {
  font-size: 48px;
  animation: loadingPulse 2s ease-in-out infinite;
  filter: drop-shadow(0 0 20px rgba(212, 168, 67, 0.3));
}

@keyframes loadingPulse {
  0%, 100% { transform: scale(1); filter: drop-shadow(0 0 20px rgba(212, 168, 67, 0.3)); }
  50% { transform: scale(1.1); filter: drop-shadow(0 0 40px rgba(212, 168, 67, 0.5)); }
}

.loading-spinner {
  width: 36px;
  height: 36px;
  border: 2px solid rgba(212, 168, 67, 0.1);
  border-top-color: var(--color-gold);
  border-radius: var(--radius-full);
  animation: spin 1s linear infinite;
}

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

.loading-text {
  font-size: 14px;
  color: var(--color-text-tertiary);
  font-weight: 400;
  letter-spacing: 1px;
}

/* ════════════════════════════════════════════════════════════
   PAGE LAYOUT
   ════════════════════════════════════════════════════════════ */

.page {
  max-width: 1100px;
  margin: 0 auto;
  animation: pageEnter 0.5s ease;
}

@keyframes pageEnter {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

.back-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  background: rgba(212, 168, 67, 0.06);
  border: 1px solid rgba(212, 168, 67, 0.08);
  border-radius: var(--radius-md);
  color: var(--color-gold-light);
  font-size: 13px;
  font-weight: 500;
  transition: all var(--transition-fast);
  margin-bottom: var(--spacing-lg);
}

.back-btn:hover {
  background: rgba(212, 168, 67, 0.12);
  border-color: rgba(212, 168, 67, 0.2);
  box-shadow: 0 0 16px rgba(212, 168, 67, 0.08);
  transform: translateX(-2px);
}

/* ════════════════════════════════════════════════════════════
   DASHBOARD HERO
   ════════════════════════════════════════════════════════════ */

.dashboard-hero {
  text-align: center;
  padding: var(--spacing-3xl) var(--spacing-xl);
  position: relative;
}

.dashboard-hero::before {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 200px;
  height: 200px;
  background: radial-gradient(circle, rgba(212, 168, 67, 0.08) 0%, transparent 70%);
  pointer-events: none;
}

.dashboard-hero-icon {
  font-size: 56px;
  display: block;
  margin-bottom: var(--spacing-lg);
  animation: heroIconFloat 6s ease-in-out infinite;
  filter: drop-shadow(0 0 30px rgba(212, 168, 67, 0.2));
}

@keyframes heroIconFloat {
  0%, 100% { transform: translateY(0) scale(1); }
  50% { transform: translateY(-8px) scale(1.05); }
}

.dashboard-hero h1 {
  font-size: clamp(32px, 5vw, 48px);
  font-weight: 700;
  letter-spacing: -1px;
  background: linear-gradient(135deg, var(--color-gold-pale), var(--color-gold), var(--color-gold-light));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: var(--spacing-md);
  filter: drop-shadow(0 0 20px rgba(212, 168, 67, 0.1));
}

.dashboard-hero p {
  font-size: clamp(14px, 2vw, 16px);
  color: var(--color-text-secondary);
  max-width: 600px;
  margin: 0 auto;
  line-height: 1.6;
  font-weight: 400;
}

/* ════════════════════════════════════════════════════════════
   LIVE BAR
   ════════════════════════════════════════════════════════════ */

.live-bar {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--spacing-md);
  margin-bottom: var(--spacing-2xl);
}

@media (max-width: 640px) {
  .live-bar { grid-template-columns: 1fr; }
}

/* ── Card Entrance Animation ── */
@keyframes cardEntrance {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

.live-bar-item {
  background: rgba(15, 26, 18, 0.5);
  border: 1px solid rgba(212, 168, 67, 0.08);
  border-radius: var(--radius-lg);
  padding: var(--spacing-lg);
  text-align: center;
  backdrop-filter: blur(12px);
  transition: all var(--transition-base);
  animation: cardEntrance 0.6s ease both;
}

.live-bar-item:nth-child(1) { animation-delay: 0.1s; }
.live-bar-item:nth-child(2) { animation-delay: 0.2s; }
.live-bar-item:nth-child(3) { animation-delay: 0.3s; }

.live-bar-item:hover {
  border-color: rgba(212, 168, 67, 0.2);
  box-shadow: 0 0 20px rgba(212, 168, 67, 0.04);
  transform: translateY(-2px);
}

.live-bar-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--color-text-tertiary);
  margin-bottom: var(--spacing-sm);
  font-weight: 500;
}

.live-bar-value {
  font-size: 24px;
  font-weight: 700;
  color: var(--color-gold-light);
  letter-spacing: -0.5px;
}

.live-bar-sub {
  font-size: 12px;
  color: var(--color-text-tertiary);
  margin-top: var(--spacing-xs);
}

[data-theme="light"] .live-bar-item {
  background: rgba(255, 255, 255, 0.6);
  border-color: rgba(212, 168, 67, 0.15);
}

/* ════════════════════════════════════════════════════════════
   SECTION TITLES
   ════════════════════════════════════════════════════════════ */

.section-title {
  font-size: 18px;
  font-weight: 600;
  color: var(--color-text-primary);
  margin-bottom: var(--spacing-lg);
  margin-top: var(--spacing-2xl);
  letter-spacing: -0.3px;
  padding-left: var(--spacing-sm);
  border-left: 3px solid var(--color-gold);
  line-height: 1.3;
  text-shadow: 0 0 12px rgba(212, 168, 67, 0.08);
}

/* ════════════════════════════════════════════════════════════
   PILLARS GRID
   ════════════════════════════════════════════════════════════ */

.pillars-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: var(--spacing-md);
  margin-bottom: var(--spacing-xl);
}

.pillar-card {
  background: rgba(15, 26, 18, 0.5);
  border: 1px solid rgba(212, 168, 67, 0.08);
  border-radius: var(--radius-lg);
  padding: var(--spacing-lg);
  cursor: pointer;
  transition: all var(--transition-base);
  position: relative;
  overflow: hidden;
  backdrop-filter: blur(12px);
  animation: cardEntrance 0.6s ease both;
}

.pillar-card:nth-child(1) { animation-delay: 0.15s; }
.pillar-card:nth-child(2) { animation-delay: 0.25s; }
.pillar-card:nth-child(3) { animation-delay: 0.35s; }
.pillar-card:nth-child(4) { animation-delay: 0.45s; }
.pillar-card:nth-child(5) { animation-delay: 0.55s; }
.pillar-card:nth-child(6) { animation-delay: 0.65s; }
.pillar-card:nth-child(7) { animation-delay: 0.75s; }

.pillar-card::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: var(--radius-lg);
  background: linear-gradient(135deg, rgba(212, 168, 67, 0.02), transparent);
  pointer-events: none;
  opacity: 0;
  transition: opacity var(--transition-base);
}

.pillar-card:hover {
  border-color: rgba(212, 168, 67, 0.25);
  transform: translateY(-4px);
  box-shadow: 0 8px 32px rgba(0,0,0,0.3), 0 0 24px rgba(212, 168, 67, 0.06);
}

.pillar-card:hover::before { opacity: 1; }

.pillar-card-icon {
  font-size: 32px;
  display: block;
  margin-bottom: var(--spacing-md);
}

.pillar-card h3 {
  font-size: 16px;
  font-weight: 600;
  color: var(--color-text-primary);
  margin-bottom: var(--spacing-sm);
  letter-spacing: -0.3px;
}

.pillar-card p {
  font-size: 13px;
  color: var(--color-text-secondary);
  line-height: 1.5;
  margin-bottom: var(--spacing-md);
}

.pillar-card-arrow {
  font-size: 14px;
  color: var(--color-gold);
  opacity: 0.5;
  transition: all var(--transition-fast);
}

.pillar-card:hover .pillar-card-arrow {
  opacity: 1;
  transform: translateX(4px);
}

[data-theme="light"] .pillar-card,
[data-theme="light"] .stat-card {
  background: rgba(245, 242, 235, 0.85);
  border-color: rgba(201, 169, 110, 0.15);
  box-shadow: 0 2px 12px rgba(0,0,0,0.04), inset 0 1px 0 rgba(255,255,255,0.8);
}

/* ════════════════════════════════════════════════════════════
   STATS GRID
   ════════════════════════════════════════════════════════════ */

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: var(--spacing-md);
  margin-bottom: var(--spacing-2xl);
}

.stat-card {
  background: rgba(15, 26, 18, 0.5);
  border: 1px solid rgba(212, 168, 67, 0.06);
  border-radius: var(--radius-lg);
  padding: var(--spacing-lg);
  text-align: center;
  transition: all var(--transition-base);
  backdrop-filter: blur(12px);
  animation: cardEntrance 0.6s ease both;
}

.stat-card:nth-child(1) { animation-delay: 0.1s; }
.stat-card:nth-child(2) { animation-delay: 0.18s; }
.stat-card:nth-child(3) { animation-delay: 0.26s; }
.stat-card:nth-child(4) { animation-delay: 0.34s; }
.stat-card:nth-child(5) { animation-delay: 0.42s; }
.stat-card:nth-child(6) { animation-delay: 0.5s; }

.stat-card:hover {
  border-color: rgba(212, 168, 67, 0.15);
  transform: translateY(-2px);
  box-shadow: 0 0 16px rgba(212, 168, 67, 0.04);
}

.stat-value {
  font-size: 28px;
  font-weight: 700;
  color: var(--color-gold-light);
  letter-spacing: -0.5px;
  margin-bottom: var(--spacing-xs);
}

.stat-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--color-text-tertiary);
  font-weight: 500;
}

.stat-loading {
  animation: statPulse 1.5s ease-in-out infinite;
  opacity: 0.4;
}

@keyframes statPulse {
  0%, 100% { opacity: 0.3; }
  50% { opacity: 0.7; }
}

/* ════════════════════════════════════════════════════════════
   PAGE HEADER
   ════════════════════════════════════════════════════════════ */

.page-header {
  text-align: center;
  padding: var(--spacing-2xl) var(--spacing-xl) var(--spacing-xl);
}

.page-header span:first-child {
  font-size: 42px;
  display: block;
  margin-bottom: var(--spacing-md);
  filter: drop-shadow(0 0 16px rgba(212, 168, 67, 0.15));
}

.page-title {
  font-size: clamp(24px, 4vw, 32px);
  font-weight: 700;
  letter-spacing: -0.5px;
  background: linear-gradient(135deg, var(--color-gold-pale), var(--color-gold), var(--color-gold-light));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: var(--spacing-sm);
}

.page-subtitle {
  font-size: 15px;
  color: var(--color-text-secondary);
  line-height: 1.5;
  max-width: 500px;
  margin: 0 auto;
}

/* ════════════════════════════════════════════════════════════
   MODULE CARDS
   ════════════════════════════════════════════════════════════ */

.module-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: var(--spacing-md);
}

.module-card {
  background: rgba(16, 16, 40, 0.5);
  border: 1px solid rgba(212, 168, 67, 0.06);
  border-radius: var(--radius-lg);
  padding: var(--spacing-lg);
  cursor: pointer;
  transition: all var(--transition-base);
  position: relative;
  overflow: hidden;
  backdrop-filter: blur(12px);
}

.module-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--color-gold), transparent);
  opacity: 0;
  transition: opacity var(--transition-base);
}

.module-card:hover {
  border-color: rgba(212, 168, 67, 0.2);
  transform: translateY(-3px);
  box-shadow: 0 8px 28px rgba(0,0,0,0.3), 0 0 20px rgba(212, 168, 67, 0.05);
}

.module-card:hover::before { opacity: 0.6; }

.module-card-icon {
  font-size: 28px;
  display: block;
  margin-bottom: var(--spacing-sm);
}

.module-card-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--color-text-primary);
  margin-bottom: var(--spacing-xs);
  letter-spacing: -0.2px;
}

.module-card-desc {
  font-size: 13px;
  color: var(--color-text-secondary);
  line-height: 1.5;
}

/* ════════════════════════════════════════════════════════════
   CONTENT CARD (Generic data display)
   ════════════════════════════════════════════════════════════ */

.content-card {
  background: rgba(16, 16, 40, 0.5);
  border: 1px solid rgba(212, 168, 67, 0.06);
  border-radius: var(--radius-lg);
  padding: var(--spacing-lg);
  backdrop-filter: blur(12px);
  transition: border-color var(--transition-fast);
}

.content-card:hover {
  border-color: rgba(212, 168, 67, 0.12);
}

/* ════════════════════════════════════════════════════════════
   TOAST SYSTEM
   ════════════════════════════════════════════════════════════ */

#toastContainer {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-width: 360px;
}

.toast {
  padding: 12px 18px;
  border-radius: var(--radius-md);
  font-size: 13px;
  font-weight: 500;
  animation: toastIn 0.3s ease;
  backdrop-filter: blur(12px);
  box-shadow: 0 4px 20px rgba(0,0,0,0.3);
}

.toast.toast-out {
  animation: toastOut 0.3s ease forwards;
}

@keyframes toastIn {
  from { opacity: 0; transform: translateX(20px); }
  to { opacity: 1; transform: translateX(0); }
}

@keyframes toastOut {
  from { opacity: 1; transform: translateX(0); }
  to { opacity: 0; transform: translateX(20px); }
}

.toast-success { background: rgba(26, 138, 110, 0.9); color: white; border: 1px solid rgba(26, 138, 110, 0.3); }
.toast-error { background: rgba(176, 48, 42, 0.9); color: white; border: 1px solid rgba(176, 48, 42, 0.3); }
.toast-info { background: rgba(74, 138, 186, 0.9); color: white; border: 1px solid rgba(74, 138, 186, 0.3); }
.toast-warning { background: rgba(200, 148, 58, 0.9); color: #1a1a2e; border: 1px solid rgba(200, 148, 58, 0.3); }

/* ════════════════════════════════════════════════════════════
   ERROR STATE
   ════════════════════════════════════════════════════════════ */

.error-state {
  text-align: center;
  padding: var(--spacing-3xl);
}

.error-state-icon {
  font-size: 48px;
  margin-bottom: var(--spacing-lg);
}

.error-state h3 {
  font-size: 20px;
  color: var(--color-text-primary);
  margin-bottom: var(--spacing-sm);
}

.error-state p {
  font-size: 14px;
  color: var(--color-text-tertiary);
  margin-bottom: var(--spacing-lg);
}

/* ════════════════════════════════════════════════════════════
   UTILITIES
   ════════════════════════════════════════════════════════════ */

.gold-text {
  background: linear-gradient(135deg, var(--color-gold-pale), var(--color-gold), var(--color-gold-light));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.glass {
  background: rgba(16, 16, 40, 0.5);
  border: 1px solid rgba(212, 168, 67, 0.06);
  backdrop-filter: blur(12px);
  border-radius: var(--radius-lg);
}

.glass:hover {
  border-color: rgba(212, 168, 67, 0.18);
  box-shadow: 0 0 20px rgba(212, 168, 67, 0.04);
}

/* ════════════════════════════════════════════════════════════
   RESPONSIVE
   ════════════════════════════════════════════════════════════ */

@media (max-width: 768px) {
  .dashboard-hero { padding: var(--spacing-2xl) var(--spacing-md); }
  .pillars-grid { grid-template-columns: 1fr; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .module-grid { grid-template-columns: 1fr; }
}

@media (max-width: 480px) {
  .stats-grid { grid-template-columns: repeat(2, 1fr); gap: var(--spacing-sm); }
  .stat-card { padding: var(--spacing-md); }
  .stat-value { font-size: 22px; }
}

/* ════════════════════════════════════════════════════════════
   PRINT
   ════════════════════════════════════════════════════════════ */

@media print {
  .sidebar, .mobile-header, .bg-ornaments, .stars-container,
  .sidebar-overlay, #toastContainer { display: none !important; }
  .main-content { margin-left: 0 !important; padding: 0 !important; }
  body { background: #fff !important; color: #000 !important; }
}
