/* Centralized dashboard styles */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&family=Cairo:wght@300;400;600;700;900&family=Tajawal:wght@300;500;700;800;900&display=swap');
@import url('https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.5.1/css/all.min.css');

/* Import Enhanced Theme System */
@import './theme-enhanced.css';
@import './layout-system.css';
@import './components.css';

/* Import Ghost Design System (Emerald/Gold Glassmorphism) */
@import './ghost-design-system.css';
@import './ghost-components.css';

:root {
  /* Brand accent tokens (light-first) */
  --atlas-accent: #2563EB; /* Blue */
  --atlas-accent-2: #F97316; /* Orange */
  --atlas-accent-contrast: #1e3a8a;
  --atlas-accent-ring: 0 0 0 3px rgba(37, 99, 235, 0.35);
  --atlas-accent-gradient: linear-gradient(135deg, #2563EB 0%, #F97316 100%);
  --font-base: 'Inter', 'Cairo', 'Tajawal', 'system-ui', sans-serif;
  --font-arabic: 'Tajawal', 'Cairo', 'Amiri', 'system-ui', sans-serif;

  /* Base palette values default to dark theme */
  --atlas-color-slate-950-rgb: 2, 6, 23;
  --atlas-color-slate-900-rgb: 15, 23, 42;
  --atlas-color-slate-800-rgb: 30, 41, 59;
  --atlas-color-slate-700-rgb: 51, 65, 85;
  --atlas-color-slate-600-rgb: 71, 85, 105;
  --atlas-color-slate-500-rgb: 100, 116, 139;

  --atlas-body-bg: rgb(var(--atlas-color-slate-950-rgb));
  --atlas-body-text: #f8fafc;
  --atlas-muted-text: #cbd5f5;

  --atlas-surface-root: rgba(var(--atlas-color-slate-950-rgb), 1);
  --atlas-surface-layer: rgba(var(--atlas-color-slate-900-rgb), 0.94);
  --atlas-surface-panel: rgba(var(--atlas-color-slate-900-rgb), 0.88);
  --atlas-surface-card: rgba(var(--atlas-color-slate-800-rgb), 0.8);
  --atlas-border-muted: rgba(var(--atlas-color-slate-700-rgb), 0.6);
  --atlas-border-strong: rgba(var(--atlas-color-slate-600-rgb), 0.8);
  --atlas-shadow-elevated: 0 24px 48px -28px rgba(2, 6, 23, 0.72);
  --atlas-shadow-elevated-hover: 0 36px 72px -34px rgba(2, 6, 23, 0.78);
  /* Default dark hero gradient (will be overridden in light section) */
  --atlas-gradient-hero: linear-gradient(135deg, #1e3a8a 0%, #1e40af 100%);
  --atlas-gradient-panel: linear-gradient(135deg, rgba(15, 23, 42, 0.95), rgba(15, 23, 42, 0.86));
  --atlas-gradient-accent-horizontal: linear-gradient(90deg, #1e293b 25%, #334155 50%, #1e293b 75%);
  --atlas-gradient-accent-vertical: linear-gradient(180deg, #0f172a 0%, #1e293b 100%);
  --atlas-scrollbar-track: rgba(var(--atlas-color-slate-800-rgb), 0.55);
  --atlas-scrollbar-thumb: rgba(var(--atlas-color-slate-600-rgb), 0.7);

  --atlas-surface-root: rgba(var(--atlas-color-slate-950-rgb), 1);
  --atlas-surface-layer: rgba(var(--atlas-color-slate-900-rgb), 0.94);
  --atlas-surface-panel: rgba(var(--atlas-color-slate-900-rgb), 0.88);
  --atlas-surface-card: rgba(var(--atlas-color-slate-800-rgb), 0.8);
  --atlas-border-muted: rgba(var(--atlas-color-slate-700-rgb), 0.6);
  --atlas-border-strong: rgba(var(--atlas-color-slate-600-rgb), 0.8);
  --atlas-shadow-elevated: 0 24px 48px -28px rgba(2, 6, 23, 0.72);
  --atlas-shadow-elevated-hover: 0 36px 72px -34px rgba(2, 6, 23, 0.78);
  --atlas-gradient-hero: linear-gradient(135deg, #1e3a8a 0%, #1e40af 100%);
  --atlas-gradient-panel: linear-gradient(135deg, rgba(15, 23, 42, 0.95), rgba(15, 23, 42, 0.86));
  --atlas-gradient-accent-horizontal: linear-gradient(90deg, #1e293b 25%, #334155 50%, #1e293b 75%);
  --atlas-gradient-accent-vertical: linear-gradient(180deg, #0f172a 0%, #1e293b 100%);
  --atlas-scrollbar-track: rgba(var(--atlas-color-slate-800-rgb), 0.55);
  --atlas-scrollbar-thumb: rgba(var(--atlas-color-slate-600-rgb), 0.7);

  --atlas-popover-bg: rgba(15, 23, 42, 0.92);
  --atlas-popover-text: #f8fafc;
}

html.dark {
  color-scheme: dark;
  --atlas-color-slate-950-rgb: 2, 6, 23;
  --atlas-color-slate-900-rgb: 15, 23, 42;
  --atlas-color-slate-800-rgb: 30, 41, 59;
  --atlas-color-slate-700-rgb: 51, 65, 85;
  --atlas-color-slate-600-rgb: 71, 85, 105;
  --atlas-color-slate-500-rgb: 100, 116, 139;

  --atlas-body-bg: rgb(var(--atlas-color-slate-950-rgb));
  --atlas-body-text: #f8fafc;
  --atlas-muted-text: #cbd5f5;

  --atlas-text-slate-100: #f1f5f9;
  --atlas-text-slate-200: #e2e8f0;
  --atlas-text-slate-300: #cbd5f5;
  --atlas-text-slate-400: #94a3b8;
  --atlas-text-slate-500: #64748b;
  --atlas-text-slate-600: #475569;
  --atlas-text-slate-700: #334155;
  --atlas-text-slate-800: #1e293b;
}

html.light {
  color-scheme: light;
  --atlas-color-slate-950-rgb: 247, 249, 252;
  --atlas-color-slate-900-rgb: 233, 239, 247;
  --atlas-color-slate-800-rgb: 218, 226, 239;
  --atlas-color-slate-700-rgb: 199, 210, 227;
  --atlas-color-slate-600-rgb: 178, 191, 212;
  --atlas-color-slate-500-rgb: 156, 172, 197;

  --atlas-body-bg: #f1f5f9;
  --atlas-body-text: #0f172a;
  --atlas-muted-text: #475569;

  --atlas-surface-root: #f1f5f9;
  --atlas-surface-layer: #ffffff;
  --atlas-surface-panel: #ffffff;
  --atlas-surface-card: #ffffff;
  --atlas-border-muted: rgba(148, 163, 184, 0.3);
  --atlas-border-strong: rgba(100, 116, 139, 0.6);
  --atlas-shadow-elevated: 0 24px 48px -28px rgba(15, 23, 42, 0.22);
  --atlas-shadow-elevated-hover: 0 36px 72px -34px rgba(15, 23, 42, 0.28);
  /* Light hero gradient updated to Blue/Orange feel */
  --atlas-gradient-hero: linear-gradient(135deg, #dbeafe 0%, #ffedd5 100%);
  --atlas-gradient-panel: linear-gradient(135deg, rgba(255, 255, 255, 0.98), rgba(238, 242, 255, 0.9));
  --atlas-gradient-accent-horizontal: linear-gradient(90deg, #dbe6fb 25%, #eef2ff 50%, #dbe6fb 75%);
  --atlas-gradient-accent-vertical: linear-gradient(180deg, #f1f5ff 0%, #dbeafe 100%);
  --atlas-scrollbar-track: rgba(226, 232, 240, 0.85);
  --atlas-scrollbar-thumb: rgba(148, 163, 184, 0.65);

  --atlas-popover-bg: rgba(255, 255, 255, 0.96);
  --atlas-popover-text: #1e293b;

  --atlas-text-slate-100: #0f172a;
  --atlas-text-slate-200: #1e293b;
  --atlas-text-slate-300: #2f3c52;
  --atlas-text-slate-400: #42536d;
  --atlas-text-slate-500: #5a6a82;
  --atlas-text-slate-600: #74849c;
  --atlas-text-slate-700: #93a3ba;
  --atlas-text-slate-800: #d7deeb;
}

html,
body {
  -ms-overflow-style: none;
  scrollbar-width: none;
}

body {
  font-family: var(--font-base) !important;
  background-color: var(--atlas-body-bg) !important;
  color: var(--atlas-body-text);
  transition: background-color 0.3s ease, color 0.3s ease;
}

header.sticky {
  z-index: 70 !important;
}

/* Header layout with user info, centered menu, and mobile toggle */
header .flex.items-center.justify-between {
  gap: 1rem;
}

/* Ensure center section (logo + menu) stays centered */
@media (min-width: 768px) {
  header .flex-1.justify-center {
    max-width: 95%;
  }
  header .flex.items-center.justify-between > .flex.flex-1.justify-start {
    flex: 1.6 1 0%;
  }
  header .flex.items-center.justify-between > .flex.flex-1.justify-end {
    flex: 0.8 1 0%;
  }
}

/* User info section responsive styles */
#user-info-section {
  flex-shrink: 0;
}

#current-username {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body.font-arabic,
.font-arabic {
  font-family: var(--font-arabic) !important;
}

.fa,
.fas,
.far,
.fal,
.fab {
  font-family: 'Font Awesome 6 Free', 'Font Awesome 6 Brands' !important;
}

::-webkit-scrollbar {
  display: none;
}

/* Theme-aware overrides */
html[data-theme] .text-slate-100,
html[data-theme] .hover\:text-slate-100:hover {
  color: var(--atlas-text-slate-100);
}

html[data-theme] .text-slate-200,
html[data-theme] .hover\:text-slate-200:hover {
  color: var(--atlas-text-slate-200);
}

html[data-theme] .text-slate-300,
html[data-theme] .hover\:text-slate-300:hover {
  color: var(--atlas-text-slate-300);
}

html[data-theme] .text-slate-400,
html[data-theme] .hover\:text-slate-400:hover {
  color: var(--atlas-text-slate-400);
}

html[data-theme] .text-slate-500,
html[data-theme] .hover\:text-slate-500:hover {
  color: var(--atlas-text-slate-500);
}

html[data-theme] .text-slate-600,
html[data-theme] .hover\:text-slate-600:hover {
  color: var(--atlas-text-slate-600);
}

html[data-theme] .text-slate-700,
html[data-theme] .hover\:text-slate-700:hover {
  color: var(--atlas-text-slate-700);
}

html[data-theme] .text-slate-800,
html[data-theme] .hover\:text-slate-800:hover {
  color: var(--atlas-text-slate-800);
}

html[data-theme] .border-slate-500,
html[data-theme] .hover\:border-slate-500:hover {
  border-color: rgb(var(--atlas-color-slate-500-rgb));
}

html[data-theme] .border-slate-600,
html[data-theme] .hover\:border-slate-600:hover {
  border-color: rgb(var(--atlas-color-slate-600-rgb));
}

html[data-theme] .border-slate-700,
html[data-theme] .hover\:border-slate-700:hover {
  border-color: rgb(var(--atlas-color-slate-700-rgb));
}

html[data-theme] .border-slate-800,
html[data-theme] .hover\:border-slate-800:hover {
  border-color: rgb(var(--atlas-color-slate-800-rgb));
}

html[data-theme] .border-slate-900,
html[data-theme] .hover\:border-slate-900:hover {
  border-color: rgb(var(--atlas-color-slate-900-rgb));
}

html[data-theme] .bg-slate-950,
html[data-theme] .hover\:bg-slate-950:hover {
  background-color: rgb(var(--atlas-color-slate-950-rgb));
}

html[data-theme] .bg-slate-950\/40,
html[data-theme] .hover\:bg-slate-950\/40:hover {
  background-color: rgba(var(--atlas-color-slate-950-rgb), 0.4);
}

html[data-theme] .bg-slate-950\/60,
html[data-theme] .hover\:bg-slate-950\/60:hover {
  background-color: rgba(var(--atlas-color-slate-950-rgb), 0.6);
}

html[data-theme] .bg-slate-950\/70,
html[data-theme] .hover\:bg-slate-950\/70:hover {
  background-color: rgba(var(--atlas-color-slate-950-rgb), 0.7);
}

html[data-theme] .bg-slate-950\/80,
html[data-theme] .hover\:bg-slate-950\/80:hover {
  background-color: rgba(var(--atlas-color-slate-950-rgb), 0.8);
}

html[data-theme] .bg-slate-900,
html[data-theme] .hover\:bg-slate-900:hover {
  background-color: rgb(var(--atlas-color-slate-900-rgb));
}

html[data-theme] .bg-slate-900\/20,
html[data-theme] .hover\:bg-slate-900\/20:hover {
  background-color: rgba(var(--atlas-color-slate-900-rgb), 0.2);
}

html[data-theme] .bg-slate-900\/30,
html[data-theme] .hover\:bg-slate-900\/30:hover {
  background-color: rgba(var(--atlas-color-slate-900-rgb), 0.3);
}

html[data-theme] .bg-slate-900\/40,
html[data-theme] .hover\:bg-slate-900\/40:hover {
  background-color: rgba(var(--atlas-color-slate-900-rgb), 0.4);
}

html[data-theme] .bg-slate-900\/50,
html[data-theme] .hover\:bg-slate-900\/50:hover {
  background-color: rgba(var(--atlas-color-slate-900-rgb), 0.5);
}

html[data-theme] .bg-slate-900\/60,
html[data-theme] .hover\:bg-slate-900\/60:hover {
  background-color: rgba(var(--atlas-color-slate-900-rgb), 0.6);
}

html[data-theme] .bg-slate-900\/70,
html[data-theme] .hover\:bg-slate-900\/70:hover {
  background-color: rgba(var(--atlas-color-slate-900-rgb), 0.7);
}

html[data-theme] .bg-slate-900\/80,
html[data-theme] .hover\:bg-slate-900\/80:hover {
  background-color: rgba(var(--atlas-color-slate-900-rgb), 0.8);
}

html[data-theme] .bg-slate-900\/90,
html[data-theme] .hover\:bg-slate-900\/90:hover {
  background-color: rgba(var(--atlas-color-slate-900-rgb), 0.9);
}

html[data-theme] .bg-slate-900\/85,
html[data-theme] .hover\:bg-slate-900\/85:hover {
  background-color: rgba(var(--atlas-color-slate-900-rgb), 0.85);
}

/* -------------------------------------------------------------------------- */
/* Theme overrides for utility classes commonly hardcoded in pages             */
/* -------------------------------------------------------------------------- */

/* Dark theme - Ensure white backgrounds adapt */
html.dark .bg-white { background-color: rgb(var(--atlas-color-slate-900-rgb)) !important; }
html.dark .bg-white\/10 { background-color: rgba(var(--atlas-color-slate-900-rgb), 0.10) !important; }
html.dark .bg-white\/20 { background-color: rgba(var(--atlas-color-slate-900-rgb), 0.20) !important; }
html.dark .bg-white\/30 { background-color: rgba(var(--atlas-color-slate-900-rgb), 0.30) !important; }
html.dark .bg-white\/40 { background-color: rgba(var(--atlas-color-slate-900-rgb), 0.40) !important; }
html.dark .bg-white\/50 { background-color: rgba(var(--atlas-color-slate-900-rgb), 0.50) !important; }
html.dark .bg-white\/60 { background-color: rgba(var(--atlas-color-slate-900-rgb), 0.60) !important; }
html.dark .bg-white\/70 { background-color: rgba(var(--atlas-color-slate-900-rgb), 0.70) !important; }
html.dark .bg-white\/75 { background-color: rgba(var(--atlas-color-slate-900-rgb), 0.75) !important; }
html.dark .bg-white\/80 { background-color: rgba(var(--atlas-color-slate-900-rgb), 0.80) !important; }
html.dark .bg-white\/85 { background-color: rgba(var(--atlas-color-slate-900-rgb), 0.85) !important; }
html.dark .bg-white\/90 { background-color: rgba(var(--atlas-color-slate-900-rgb), 0.90) !important; }
html.dark .bg-white\/95 { background-color: rgba(var(--atlas-color-slate-900-rgb), 0.95) !important; }

/* Dark theme - Input backgrounds that default to white should remain readable */
html.dark input.bg-white, html.dark textarea.bg-white, html.dark select.bg-white {
  background-color: rgba(var(--atlas-color-slate-900-rgb), 0.9) !important;
  color: var(--atlas-text-slate-200);
}

/* Light theme - Ensure proper contrast for overlays */
html.light .bg-black\/50 { background-color: rgba(0, 0, 0, 0.45) !important; }
html.light .bg-black\/60 { background-color: rgba(0, 0, 0, 0.55) !important; }

/* Light theme - Ensure gray backgrounds are properly light */
html.light .bg-gray-50 { background-color: #f8fafc !important; }
html.light .bg-gray-100 { background-color: #f1f5f9 !important; }
html.light .bg-gray-200 { background-color: #e2e8f0 !important; }
html.light .bg-gray-800 { background-color: #ffffff !important; }
html.light .bg-gray-900 { background-color: #f8fafc !important; }

/* Light theme - Text colors for readability */
html.light .text-white { color: #0f172a !important; }
html.light .text-gray-100 { color: #1e293b !important; }
html.light .text-gray-200 { color: #334155 !important; }
html.light .text-gray-300 { color: #475569 !important; }
html.light .text-gray-400 { color: #64748b !important; }
html.light .text-gray-500 { color: #64748b !important; }
html.light .text-gray-600 { color: #475569 !important; }
html.light .text-gray-700 { color: #334155 !important; }
html.light .text-gray-800 { color: #1e293b !important; }
html.light .text-gray-900 { color: #0f172a !important; }

/* Ensure proper text color inheritance */
html.light div, html.light span, html.light p, html.light a {
  color: inherit;
}

/* Specific overrides for light mode text */
html.light {
  color: #0f172a;
}

/* Light theme - Border colors */
html.light .border-gray-700 { border-color: #e5e7eb !important; }
html.light .border-gray-800 { border-color: #d1d5db !important; }

/* Light theme - Hover states */
html.light .hover\:bg-gray-700:hover { background-color: #f3f4f6 !important; }
html.light .hover\:bg-gray-800:hover { background-color: #e5e7eb !important; }
html.light .hover\:text-white:hover { color: #111827 !important; }

html[data-theme] .bg-slate-900\/95,
html[data-theme] .hover\:bg-slate-900\/95:hover {
  background-color: rgba(var(--atlas-color-slate-900-rgb), 0.95);
}

html[data-theme] .bg-slate-800,
html[data-theme] .hover\:bg-slate-800:hover {
  background-color: rgb(var(--atlas-color-slate-800-rgb));
}

html[data-theme] .bg-slate-800\/30,
html[data-theme] .hover\:bg-slate-800\/30:hover {
  background-color: rgba(var(--atlas-color-slate-800-rgb), 0.3);
}

html[data-theme] .bg-slate-800\/35,
html[data-theme] .hover\:bg-slate-800\/35:hover {
  background-color: rgba(var(--atlas-color-slate-800-rgb), 0.35);
}

html[data-theme] .bg-slate-800\/40,
html[data-theme] .hover\:bg-slate-800\/40:hover {
  background-color: rgba(var(--atlas-color-slate-800-rgb), 0.4);
}

html[data-theme] .bg-slate-800\/45,
html[data-theme] .hover\:bg-slate-800\/45:hover {
  background-color: rgba(var(--atlas-color-slate-800-rgb), 0.45);
}

html[data-theme] .bg-slate-800\/50,
html[data-theme] .hover\:bg-slate-800\/50:hover {
  background-color: rgba(var(--atlas-color-slate-800-rgb), 0.5);
}

html[data-theme] .bg-slate-800\/60,
html[data-theme] .hover\:bg-slate-800\/60:hover {
  background-color: rgba(var(--atlas-color-slate-800-rgb), 0.6);
}

html[data-theme] .bg-slate-800\/70,
html[data-theme] .hover\:bg-slate-800\/70:hover {
  background-color: rgba(var(--atlas-color-slate-800-rgb), 0.7);
}

html[data-theme] .bg-slate-800\/80,
html[data-theme] .hover\:bg-slate-800\/80:hover {
  background-color: rgba(var(--atlas-color-slate-800-rgb), 0.8);
}

html[data-theme] .bg-slate-700,
html[data-theme] .hover\:bg-slate-700:hover {
  background-color: rgb(var(--atlas-color-slate-700-rgb));
}

html[data-theme] .bg-slate-700\/30,
html[data-theme] .hover\:bg-slate-700\/30:hover {
  background-color: rgba(var(--atlas-color-slate-700-rgb), 0.3);
}

html[data-theme] .bg-slate-700\/40,
html[data-theme] .hover\:bg-slate-700\/40:hover {
  background-color: rgba(var(--atlas-color-slate-700-rgb), 0.4);
}

html[data-theme] .bg-slate-700\/50,
html[data-theme] .hover\:bg-slate-700\/50:hover {
  background-color: rgba(var(--atlas-color-slate-700-rgb), 0.5);
}

html[data-theme] .bg-slate-700\/60,
html[data-theme] .hover\:bg-slate-700\/60:hover {
  background-color: rgba(var(--atlas-color-slate-700-rgb), 0.6);
}

html[data-theme] .bg-slate-600,
html[data-theme] .hover\:bg-slate-600:hover {
  background-color: rgb(var(--atlas-color-slate-600-rgb));
}

html[data-theme] .bg-slate-600\/20,
html[data-theme] .hover\:bg-slate-600\/20:hover {
  background-color: rgba(var(--atlas-color-slate-600-rgb), 0.2);
}

html[data-theme] .bg-slate-600\/90,
html[data-theme] .hover\:bg-slate-600\/90:hover {
  background-color: rgba(var(--atlas-color-slate-600-rgb), 0.9);
}

html[data-theme] .bg-slate-500,
html[data-theme] .hover\:bg-slate-500:hover {
  background-color: rgb(var(--atlas-color-slate-500-rgb));
}

html[data-theme] .bg-slate-500\/10,
html[data-theme] .hover\:bg-slate-500\/10:hover {
  background-color: rgba(var(--atlas-color-slate-500-rgb), 0.1);
}

html[data-theme] .text-muted {
  color: var(--atlas-muted-text);
}

html.light [class*="bg-slate-9"].text-white,
html.light [class*="bg-slate-9"] .text-white,
html.light [class*="bg-slate-8"].text-white,
html.light [class*="bg-slate-8"] .text-white,
html.light [class*="bg-slate-7"].text-white,
html.light [class*="bg-slate-7"] .text-white,
html.light [class*="bg-slate-6"].text-white,
html.light [class*="bg-slate-6"] .text-white,
html.light [class*="bg-slate-5"].text-white,
html.light [class*="bg-slate-5"] .text-white {
  color: var(--atlas-text-slate-100) !important;
}

html.light .hover\:text-white:hover {
  color: var(--atlas-text-slate-200);
}

/* -------------------------------------------------------------------------- */
/* Light theme adjustments for shared hero and glass sections                 */
/* -------------------------------------------------------------------------- */
html.light #page-title {
  color: var(--atlas-text-slate-200);
}

html.light #page-title :is(h1, h2, h3, h4, h5, h6) {
  color: var(--atlas-text-slate-200) !important;
}

html.light #page-title p {
  color: var(--atlas-muted-text) !important;
}

html.light #page-title :is(span, .badge-soft, .subnav-divider) {
  color: var(--atlas-text-slate-400) !important;
}

html.light #page-title i {
  color: #2563EB !important;
}

html.light .gradient-border {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.12) 0%, rgba(168, 85, 247, 0.12) 100%);
  border-color: rgba(156, 172, 197, 0.4);
  color: var(--atlas-text-slate-200);
}

html.light .gradient-border :is(.text-white, [class*='text-white/']) {
  color: var(--atlas-text-slate-200) !important;
}

html.light .gradient-border :is(.text-blue-100, .text-indigo-100, [class*='text-white/']) {
  color: var(--atlas-text-slate-400) !important;
}

html.light [class*='bg-white/'] {
  color: var(--atlas-text-slate-300);
  border-color: rgba(199, 210, 227, 0.65);
  box-shadow: 0 18px 36px -28px rgba(15, 23, 42, 0.12);
}

html.light [class*='bg-white/'] :is(.text-white, [class*='text-white/']) {
  color: inherit !important;
}

html.light [class*='bg-white/'] :is(.text-blue-100, .text-indigo-100, .text-slate-200) {
  color: var(--atlas-text-slate-400) !important;
}

.theme-dark-surface,
.theme-surface-layer {
  background: var(--atlas-surface-layer) !important;
  color: var(--atlas-body-text);
  border-color: var(--atlas-border-muted);
  box-shadow: var(--atlas-shadow-elevated);
  transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}

.theme-surface-root {
  background: var(--atlas-surface-root);
  color: var(--atlas-body-text);
}

.theme-surface-panel {
  background: var(--atlas-surface-panel);
  color: var(--atlas-body-text);
}

.theme-card {
  background: var(--atlas-surface-card);
  border: 1px solid var(--atlas-border-muted);
  box-shadow: var(--atlas-shadow-elevated);
  transition: background-color 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}

.theme-card:hover {
  box-shadow: var(--atlas-shadow-elevated-hover);
}

.theme-border-muted {
  border-color: var(--atlas-border-muted) !important;
}

.theme-border-strong {
  border-color: var(--atlas-border-strong) !important;
}

.theme-gradient-hero {
  background: var(--atlas-gradient-hero);
}

.theme-gradient-horizontal {
  background: var(--atlas-gradient-accent-horizontal);
}

.theme-gradient-vertical {
  background: var(--atlas-gradient-accent-vertical);
}

.theme-scrollbar {
  scrollbar-color: var(--atlas-scrollbar-thumb) var(--atlas-scrollbar-track);
}

.theme-scrollbar::-webkit-scrollbar-track {
  background: var(--atlas-scrollbar-track);
}

.theme-scrollbar::-webkit-scrollbar-thumb {
  background: var(--atlas-scrollbar-thumb);
  border-radius: 999px;
}

.theme-scrollbar::-webkit-scrollbar-thumb:hover {
  background: var(--atlas-scrollbar-thumb);
}

/* Styles sourced from data_sources.html */
      summary { list-style: none; }
      summary::-webkit-details-marker { display: none; }
      .glass-card {
        background: linear-gradient(145deg, rgba(255, 255, 255, 0.92), rgba(255, 255, 255, 0.8));
        backdrop-filter: blur(18px);
        border: 1px solid rgba(148, 163, 184, 0.18);
        box-shadow: 0 20px 45px -25px rgba(15, 23, 42, 0.25);
      }
      .dark .glass-card {
        background: linear-gradient(145deg, rgba(15, 23, 42, 0.92), rgba(15, 23, 42, 0.88));
        border: 1px solid rgba(51, 65, 85, 0.6);
        box-shadow: 0 20px 45px -25px rgba(15, 23, 42, 0.65);
      }
      table {
        border-collapse: collapse;
        width: 100%;
        table-layout: fixed;
      }
      thead tr {
        background: rgba(148, 163, 184, 0.12);
      }
      th, td {
        padding: 0.85rem 1rem;
        border-bottom: 1px solid rgba(148, 163, 184, 0.15);
        text-align: right;
        overflow: hidden;
        text-overflow: ellipsis;
      }
      tbody tr:hover {
        background: rgba(148, 163, 184, 0.08);
      }
      .dark thead tr { background: rgba(94, 234, 212, 0.06); }
      .dark tbody tr:hover { background: rgba(71, 85, 105, 0.5); }
      
      /* Data sources table specific column widths */
      .data-sources-table th:nth-child(1),
      .data-sources-table td:nth-child(1) { width: 15%; min-width: 120px; }
      .data-sources-table th:nth-child(2),
      .data-sources-table td:nth-child(2) { width: 30%; min-width: 200px; word-break: break-all; }
      .data-sources-table th:nth-child(3),
      .data-sources-table td:nth-child(3) { width: 8%; min-width: 60px; }
      .data-sources-table th:nth-child(4),
      .data-sources-table td:nth-child(4) { width: 12%; min-width: 90px; }
      .data-sources-table th:nth-child(5),
      .data-sources-table td:nth-child(5) { width: 10%; min-width: 70px; }
      .data-sources-table th:nth-child(6),
      .data-sources-table td:nth-child(6) { width: 8%; min-width: 60px; }
      .data-sources-table th:nth-child(7),
      .data-sources-table td:nth-child(7) { width: 12%; min-width: 90px; }

/* Styles sourced from enriched_statistics_dashboard.html */
body {
        font-family: 'Inter', sans-serif !important;
      }

      .fa, .fas, .far, .fal, .fab {
        font-family: "Font Awesome 6 Free", "Font Awesome 6 Brands" !important;
      }

      ::-webkit-scrollbar {
        display: none;
      }

      html, body {
        -ms-overflow-style: none;
        scrollbar-width: none;
      }

      .glass-card {
        background: linear-gradient(145deg, rgba(255, 255, 255, 0.92), rgba(255, 255, 255, 0.75));
        backdrop-filter: blur(16px);
        border: 1px solid rgba(255, 255, 255, 0.35);
        box-shadow: 0 25px 45px rgba(15, 23, 42, 0.08);
      }

      .dark .glass-card {
        background: linear-gradient(145deg, rgba(30, 41, 59, 0.8), rgba(15, 23, 42, 0.85));
        border: 1px solid rgba(148, 163, 184, 0.25);
      }

      .loading-spinner {
        border: 3px solid rgba(148, 163, 184, 0.25);
        border-top: 3px solid #3b82f6;
        border-radius: 50%;
        width: 36px;
        height: 36px;
        animation: spin 0.8s linear infinite;
      }

      @keyframes spin {
        0% { transform: rotate(0deg); }
        100% { transform: rotate(360deg); }
      }

      summary {
        list-style: none;
      }

      summary::-webkit-details-marker {
        display: none;
      }

/* Styles sourced from indices_dashboard.html */
body {
        font-family: 'Inter', sans-serif !important;
      }
      .fa, .fas, .far, .fal, .fab {
        font-family: 'Font Awesome 6 Free', 'Font Awesome 6 Brands' !important;
      }
      ::-webkit-scrollbar {
        display: none;
      }
      html, body {
        -ms-overflow-style: none;
        scrollbar-width: none;
      }
      .gradient-border {
        position: relative;
        border-radius: 1rem;
        overflow: hidden;
      }
      .gradient-border::before {
        content: '';
        position: absolute;
        inset: 0;
        padding: 1px;
        border-radius: inherit;
        background: linear-gradient(135deg, rgba(59,130,246,0.35), rgba(139,92,246,0.35));
        -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
        mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
        -webkit-mask-composite: xor;
        mask-composite: exclude;
        pointer-events: none;
      }
      .shadow-soft {
        box-shadow: 0 20px 45px -25px rgba(15, 23, 42, 0.45);
      }

      summary {
        list-style: none;
      }

      summary::-webkit-details-marker {
        display: none;
      }

/* Styles sourced from job_scheduler.html */
      summary { list-style: none; }
      summary::-webkit-details-marker { display: none; }
      .glass-card {
        background: linear-gradient(145deg, rgba(255, 255, 255, 0.92), rgba(255, 255, 255, 0.8));
        backdrop-filter: blur(18px);
        border: 1px solid rgba(148, 163, 184, 0.18);
        box-shadow: 0 25px 45px -25px rgba(15, 23, 42, 0.25);
      }
      .dark .glass-card {
        background: linear-gradient(145deg, rgba(15, 23, 42, 0.92), rgba(15, 23, 42, 0.88));
        border: 1px solid rgba(51, 65, 85, 0.6);
        box-shadow: 0 20px 45px -25px rgba(15, 23, 42, 0.65);
      }
      .badge {
        display: inline-flex;
        align-items: center;
        gap: 0.4rem;
        padding: 0.3rem 0.75rem;
        border-radius: 9999px;
        font-size: 0.7rem;
      }
      .badge-info {
        background: rgba(99, 102, 241, 0.12);
        color: #4338ca;
      }
      .badge-warn {
        background: rgba(251, 191, 36, 0.16);
        color: #b45309;
      }
      .badge-ok {
        background: rgba(52, 211, 153, 0.16);
        color: #047857;
      }
      .payload-grid {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
        gap: 0.5rem;
      }
      .payload-item {
        border-radius: 0.75rem;
        padding: 0.6rem 0.75rem;
        background: rgba(148, 163, 184, 0.15);
        font-size: 0.75rem;
      }
      .dark .payload-item {
        background: rgba(71, 85, 105, 0.4);
      }

/* Styles sourced from landing.html */
body {
        font-family: 'Inter', sans-serif !important;
      }

      .fa, .fas, .far, .fal, .fab {
        font-family: "Font Awesome 6 Free", "Font Awesome 6 Brands" !important;
      }

      ::-webkit-scrollbar {
        display: none;
      }

      html, body {
        -ms-overflow-style: none;
        scrollbar-width: none;
      }

      .glass-card {
        background: linear-gradient(145deg, rgba(255, 255, 255, 0.92), rgba(255, 255, 255, 0.78));
        backdrop-filter: blur(18px);
        border: 1px solid rgba(148, 163, 184, 0.18);
        box-shadow: 0 25px 45px -20px rgba(15, 23, 42, 0.25);
        border-radius: 1.5rem;
      }

      .dark .glass-card {
        background: linear-gradient(145deg, rgba(30, 41, 59, 0.88), rgba(15, 23, 42, 0.92));
        border: 1px solid rgba(148, 163, 184, 0.3);
        box-shadow: 0 25px 55px -24px rgba(15, 23, 42, 0.75);
      }

      summary {
        list-style: none;
      }

      summary::-webkit-details-marker {
        display: none;
      }

/* Styles sourced from news_dashboard.html */
body {
        font-family: 'Inter', sans-serif !important;
      }

      .fa, .fas, .far, .fal, .fab {
        font-family: "Font Awesome 6 Free", "Font Awesome 6 Brands" !important;
      }

      ::-webkit-scrollbar {
        display: none;
      }

      html, body {
        -ms-overflow-style: none;
        scrollbar-width: none;
      }

      .gradient-border {
        position: relative;
        border-radius: 1.25rem;
        overflow: hidden;
      }

      .gradient-border::before {
        content: '';
        position: absolute;
        inset: 0;
        padding: 1px;
        border-radius: inherit;
        background: linear-gradient(135deg, rgba(37, 99, 235, 0.45), rgba(249, 115, 22, 0.35));
        -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
        mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
        -webkit-mask-composite: xor;
        mask-composite: exclude;
        pointer-events: none;
      }

      .glass-card {
        border-radius: 1.25rem;
        background: linear-gradient(145deg, rgba(255, 255, 255, 0.92), rgba(255, 255, 255, 0.78));
        backdrop-filter: blur(18px);
        border: 1px solid rgba(148, 163, 184, 0.18);
        box-shadow: 0 25px 45px -20px rgba(15, 23, 42, 0.25);
      }

      .dark .glass-card {
        background: linear-gradient(145deg, rgba(30, 41, 59, 0.88), rgba(15, 23, 42, 0.92));
        border: 1px solid rgba(148, 163, 184, 0.2);
        box-shadow: 0 25px 45px -25px rgba(15, 23, 42, 0.8);
      }

      .hero-card {
        position: relative;
        border-radius: 1.5rem;
        overflow: hidden;
        background: linear-gradient(125deg, #1e40af, #2563eb 35%, #f97316);
        color: white;
      }

      .hero-card::after {
        content: '';
        position: absolute;
        inset: 0;
        background: radial-gradient(circle at 20% 20%, rgba(255, 255, 255, 0.15), transparent 55%),
                    radial-gradient(circle at 80% 30%, rgba(59, 130, 246, 0.35), transparent 60%),
                    linear-gradient(135deg, rgba(255, 255, 255, 0.06), transparent 65%);
        pointer-events: none;
      }

      .hero-card > * {
        position: relative;
        z-index: 1;
      }

      .hero-metric {
        background: rgba(255, 255, 255, 0.14);
        backdrop-filter: blur(14px);
        border-radius: 1rem;
        padding: 1rem 1.25rem;
        display: flex;
        flex-direction: column;
        gap: 0.25rem;
        min-width: 10rem;
      }

      .hero-metric span {
        font-size: 0.75rem;
        color: rgba(255, 255, 255, 0.8);
      }

      .hero-metric strong {
        font-size: 1.5rem;
        line-height: 2rem;
      }

      .badge-soft {
        display: inline-flex;
        align-items: center;
        gap: 0.5rem;
        padding: 0.35rem 0.75rem;
        border-radius: 9999px;
        border: 1px solid rgba(148, 163, 184, 0.3);
        background: rgba(255, 255, 255, 0.12);
        font-size: 0.75rem;
        letter-spacing: 0.01em;
      }

      .section-title {
        font-size: 1.5rem;
        font-weight: 700;
        color: #0f172a;
      }

      .dark .section-title {
        color: #e2e8f0;
      }

      .section-subtitle {
        font-size: 0.9rem;
        color: #64748b;
      }

      .dark .section-subtitle {
        color: #94a3b8;
      }

      .chip {
        display: inline-flex;
        align-items: center;
        gap: 0.4rem;
        padding: 0.35rem 0.75rem;
        border-radius: 9999px;
        background-color: rgba(99, 102, 241, 0.1);
        color: #4338ca;
        font-size: 0.75rem;
        font-weight: 500;
      }

      .dark .chip {
        background-color: rgba(79, 70, 229, 0.25);
        color: #c7d2fe;
      }

      .highlighted-section {
        outline: 1px solid rgba(37, 99, 235, 0.35);
        background-color: rgba(37, 99, 235, 0.08);
      }

      .edit-button {
        position: absolute;
        z-index: 1000;
      }

      .arabic-expanded-content {
        position: relative;
        direction: rtl;
        text-align: justify;
        line-height: 1.8;
        font-size: 1rem;
        letter-spacing: 0.01em;
        word-spacing: 0.1em;
        transition: all 0.3s ease-in-out;
        animation: fadeInArabic 0.4s ease-out;
        font-family: 'Cairo', 'Tajawal', 'Amiri', 'Tahoma', sans-serif;
        font-feature-settings: 'liga' 1, 'kern' 1;
        text-rendering: optimizeLegibility;
        -webkit-font-smoothing: antialiased;
        -moz-osx-font-smoothing: grayscale;
      }

      .arabic-expanded-content p {
        margin-bottom: 1rem;
        text-align: justify;
      }

      .ltr-expanded-content {
        position: relative;
        direction: ltr;
        text-align: left;
        line-height: 1.7;
        font-size: 0.95rem;
        transition: all 0.3s ease-in-out;
        animation: fadeInArabic 0.4s ease-out;
      }

      .ltr-expanded-content p {
        margin-bottom: 1rem;
        text-align: left;
      }

      @keyframes fadeInArabic {
        from {
          opacity: 0;
          transform: translateY(-10px);
        }
        to {
          opacity: 1;
          transform: translateY(0);
        }
      }

      summary {
        list-style: none;
      }

      summary::-webkit-details-marker {
        display: none;
      }

      .content-expanded {
        border-color: rgba(37, 99, 235, 0.35);
        box-shadow: 0 16px 40px -25px rgba(37, 99, 235, 0.55);
        transition: all 0.3s ease-in-out;
      }

      .toggle-button-enhanced {
        transition: all 0.2s ease-in-out;
        position: relative;
        border-radius: 0.5rem;
        padding: 0.35rem 0.65rem;
      }

      .toggle-button-enhanced:hover {
        color: #2563eb;
        background-color: rgba(37, 99, 235, 0.08);
        transform: translateX(2px);
      }

      .toggle-button-enhanced .fa-chevron-down,
      .toggle-button-enhanced .fa-chevron-up {
        transition: transform 0.2s ease-in-out;
      }

      .arabic-expanded-content::before,
      .ltr-expanded-content::before {
        content: "";
        position: absolute;
        top: 0;
        right: 0;
        width: 3px;
        height: 100%;
        background: linear-gradient(180deg, #2563eb, #f97316);
        border-radius: 1.5px;
      }

      .article-card-enhanced {
        transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        border-radius: 1.25rem;
        border: 1px solid rgba(148, 163, 184, 0.18);
        background: rgba(255, 255, 255, 0.85);
        min-width: 0;
        width: 100%;
        height: auto;
        display: flex;
        flex-direction: column;
        position: relative;
        z-index: 1;
        margin-bottom: 0;
        overflow: hidden;
      }

      .article-card-enhanced .article-content {
        padding: 1rem;
        flex: 1;
        display: flex;
        flex-direction: column;
        gap: 0.75rem;
      }

      .article-card-enhanced .article-content > * {
        margin: 0;
      }

      .dark .article-card-enhanced {
        background: rgba(15, 23, 42, 0.85);
        border-color: rgba(148, 163, 184, 0.18);
      }

      .article-card-enhanced:hover {
        transform: translateY(-2px);
        box-shadow: 0 20px 30px -15px rgba(15, 23, 42, 0.35);
        z-index: 10;
        border-color: rgba(37, 99, 235, 0.3);
      }

      /* Ensure proper stacking context for articles */
      .article-card-enhanced {
        isolation: isolate;
      }

      .entity-badge {
        transition: all 0.2s ease-in-out;
        cursor: pointer;
        border-radius: 9999px;
        border: 1px solid rgba(148, 163, 184, 0.18);
        padding: 0.35rem 0.75rem;
      }

      .entity-badge:hover {
        transform: translateY(-1px);
        box-shadow: 0 8px 16px -12px rgba(15, 23, 42, 0.45);
      }

      .uae-sentiment-card {
        border-radius: 1rem;
        border: 1px solid rgba(249, 115, 22, 0.2);
        background: linear-gradient(135deg, rgba(249, 115, 22, 0.08), rgba(249, 115, 22, 0.02));
        padding: 1rem;
        display: flex;
        flex-direction: column;
        gap: 0.85rem;
        color: rgba(120, 53, 15, 0.9);
      }

      .dark .uae-sentiment-card {
        background: linear-gradient(135deg, rgba(249, 115, 22, 0.16), rgba(15, 23, 42, 0.75));
        border-color: rgba(249, 115, 22, 0.35);
        color: rgba(254, 215, 170, 0.9);
      }

      .uae-sentiment-card__header {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 1rem;
      }

      .uae-sentiment-card__title {
        display: flex;
        align-items: center;
        gap: 0.55rem;
        font-weight: 600;
      }

      .uae-sentiment-card__title i {
        color: rgba(251, 146, 60, 0.9);
      }

      .dark .uae-sentiment-card__title i {
        color: rgba(254, 215, 170, 0.9);
      }

      .uae-sentiment-card__chip {
        display: inline-flex;
        align-items: center;
        gap: 0.35rem;
        border-radius: 9999px;
        padding: 0.35rem 0.75rem;
        font-size: 0.75rem;
        font-weight: 600;
        white-space: nowrap;
      }

      .uae-sentiment-card__progress {
        display: flex;
        align-items: center;
        gap: 0.75rem;
      }

      .uae-sentiment-card__progress-bar {
        flex: 1;
        height: 0.45rem;
        border-radius: 9999px;
        background: rgba(249, 115, 22, 0.15);
        overflow: hidden;
      }

      .dark .uae-sentiment-card__progress-bar {
        background: rgba(255, 255, 255, 0.12);
      }

      .uae-sentiment-card__progress-bar > div {
        height: 100%;
        border-radius: 9999px;
        box-shadow: 0 6px 16px -10px rgba(249, 115, 22, 0.6);
      }

      .uae-sentiment-card__progress-value {
        font-weight: 600;
        font-size: 0.8rem;
      }

      .uae-sentiment-card__excerpt {
        font-size: 0.8rem;
        line-height: 1.7;
        color: rgba(55, 48, 37, 0.85);
      }

      .uae-sentiment-card__excerpt--full {
        font-size: 0.85rem;
      }

      .dark .uae-sentiment-card__excerpt {
        color: rgba(255, 255, 255, 0.78);
      }

      .uae-sentiment-card__footer {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 0.75rem;
        font-size: 0.75rem;
      }

      .uae-sentiment-card__action {
        color: rgba(249, 115, 22, 0.9);
        font-weight: 600;
        display: inline-flex;
        align-items: center;
        gap: 0.45rem;
      }

      .uae-sentiment-card__action i {
        font-size: 0.7rem;
      }

      .uae-sentiment-card__action:hover {
        text-decoration: underline;
      }

      .dark .uae-sentiment-card__action {
        color: rgba(253, 224, 171, 0.95);
      }

      .uae-sentiment-card__meta {
        color: rgba(68, 64, 60, 0.7);
        font-weight: 500;
      }

      .dark .uae-sentiment-card__meta {
        color: rgba(255, 255, 255, 0.65);
      }

      .uae-sentiment-card--modal {
        gap: 1rem;
      }

      .uae-sentiment-card__stats {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
        gap: 0.75rem;
      }

      .uae-sentiment-card__stat {
        border-radius: 0.85rem;
        border: 1px solid rgba(249, 115, 22, 0.16);
        background: rgba(255, 255, 255, 0.55);
        padding: 0.75rem;
        display: flex;
        flex-direction: column;
        gap: 0.35rem;
      }

      .dark .uae-sentiment-card__stat {
        background: rgba(15, 23, 42, 0.65);
        border-color: rgba(249, 115, 22, 0.35);
      }

      .uae-sentiment-card__stat-label {
        font-size: 0.7rem;
        text-transform: uppercase;
        letter-spacing: 0.05em;
        color: rgba(68, 64, 60, 0.65);
      }

      .dark .uae-sentiment-card__stat-label {
        color: rgba(255, 255, 255, 0.55);
      }

      .uae-sentiment-card__stat-value {
        font-size: 1.05rem;
        font-weight: 700;
        color: rgba(124, 45, 18, 0.95);
      }

      .dark .uae-sentiment-card__stat-value {
        color: #fcd34d;
      }

      .uae-sentiment-card__chips {
        display: flex;
        flex-wrap: wrap;
        gap: 0.45rem;
      }

      .uae-sentiment-card__chip-pill {
        display: inline-flex;
        align-items: center;
        padding: 0.35rem 0.75rem;
        border-radius: 9999px;
        font-size: 0.7rem;
        font-weight: 600;
        background: rgba(249, 115, 22, 0.15);
        color: rgba(120, 53, 15, 0.85);
      }

      .dark .uae-sentiment-card__chip-pill {
        background: rgba(255, 255, 255, 0.08);
        color: rgba(253, 224, 171, 0.95);
      }

      .uae-sentiment-card__aspects {
        border-top: 1px solid rgba(249, 115, 22, 0.14);
        padding-top: 0.85rem;
        display: flex;
        flex-direction: column;
        gap: 0.65rem;
      }

      .uae-sentiment-card__aspects-list {
        display: flex;
        flex-direction: column;
        gap: 0.55rem;
      }

      .uae-sentiment-card__aspects-title {
        font-weight: 600;
        font-size: 0.9rem;
      }

      .uae-sentiment-card__aspect {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 1rem;
        border-radius: 0.75rem;
        background: rgba(255, 255, 255, 0.6);
        padding: 0.65rem 0.85rem;
      }

      .dark .uae-sentiment-card__aspect {
        background: rgba(15, 23, 42, 0.6);
      }

      .uae-sentiment-card__aspect-title {
        font-weight: 600;
        font-size: 0.85rem;
        color: rgba(30, 26, 22, 0.85);
      }

      .dark .uae-sentiment-card__aspect-title {
        color: rgba(255, 255, 255, 0.82);
      }

      .uae-sentiment-card__aspect-meta {
        display: flex;
        align-items: center;
        gap: 0.55rem;
      }

      .uae-sentiment-card__aspect-impact {
        font-size: 0.75rem;
        color: rgba(68, 64, 60, 0.7);
      }

      .dark .uae-sentiment-card__aspect-impact {
        color: rgba(255, 255, 255, 0.6);
      }

      .modal-content-enhanced {
        scroll-behavior: smooth;
      }

      .text-enhanced {
        line-height: 1.7;
        letter-spacing: 0.01em;
      }

      .button-enhanced {
        transition: all 0.2s ease-in-out;
        position: relative;
        overflow: hidden;
      }

      .button-enhanced::before {
        content: '';
        position: absolute;
        top: 50%;
        left: 50%;
        width: 0;
        height: 0;
        background: rgba(255, 255, 255, 0.15);
        border-radius: 50%;
        transition: all 0.3s ease-out;
        transform: translate(-50%, -50%);
      }

      .button-enhanced:hover::before {
        width: 100%;
        height: 100%;
      }

      .gradient-text {
        background: linear-gradient(135deg, #2563eb 0%, #f97316 100%);
        -webkit-background-clip: text;
        -webkit-text-fill-color: transparent;
        background-clip: text;
      }

      .loading-shimmer {
        background: linear-gradient(90deg, #f1f5f9 25%, #e2e8f0 50%, #f1f5f9 75%);
        background-size: 200% 100%;
        animation: shimmer 1.5s infinite;
      }

      @keyframes shimmer {
        0% { background-position: -200% 0; }
        100% { background-position: 200% 0; }
      }

      .sidebar-scroll {
        scrollbar-width: thin;
        scrollbar-color: rgba(37, 99, 235, 0.4) transparent;
        overscroll-behavior: contain;
      }

      .sidebar-scroll::-webkit-scrollbar {
        width: 6px;
        display: block;
      }

      .sidebar-scroll::-webkit-scrollbar-track {
        background: rgba(148, 163, 184, 0.15);
        border-radius: 9999px;
      }

      .sidebar-scroll::-webkit-scrollbar-thumb {
        background: rgba(37, 99, 235, 0.4);
        border-radius: 9999px;
      }

      /* Enhanced Article Layout Styles */
      .article-header {
        border-bottom: 1px solid rgba(148, 163, 184, 0.1);
        padding-bottom: 0.75rem;
        margin-bottom: 0.75rem;
      }

      .article-title {
        margin: 0.5rem 0;
        line-height: 1.3;
      }

      .article-summary {
        margin: 0.75rem 0;
      }

      .article-meta-section {
        margin: 0.5rem 0;
      }

      .article-meta-section:empty {
        display: none;
        margin: 0;
      }

      .article-analysis {
        margin: 0.75rem 0;
      }

      .article-actions {
        margin-top: 0.75rem;
        padding-top: 0.75rem;
        border-top: 1px solid rgba(148, 163, 184, 0.1);
      }

      /* Ensure consistent spacing for entity badges */
      .entity-badges-container {
        display: flex;
        flex-wrap: wrap;
        gap: 0.375rem;
        margin: 0.5rem 0;
      }

      /* Improve responsive grid behavior */
      @media (max-width: 768px) {
        #news-grid {
          grid-template-columns: 1fr;
          gap: 1rem;
        }
        
        .article-card-enhanced {
          margin-bottom: 1rem;
        }

        .article-header {
          flex-direction: column;
          gap: 1rem;
        }

        .article-header > div:last-child {
          align-self: stretch;
          align-items: start;
        }

        .article-actions {
          flex-direction: column;
          gap: 0.5rem;
        }

        .article-actions > div {
          width: 100%;
          justify-content: space-between;
        }

        .article-content {
          padding: 0.875rem;
        }
      }

      @media (min-width: 769px) and (max-width: 1024px) {
        #news-grid {
          gap: 1.25rem;
        }
        
        .article-content {
          padding: 1.125rem;
        }
      }

      @media (min-width: 1025px) {
        #news-grid {
          gap: 1.5rem;
        }
        
        .article-content {
          padding: 1.25rem;
        }
      }

      /* Fix for small screens to prevent horizontal overflow */
      @media (max-width: 640px) {
        .article-card-enhanced {
          margin-left: 0;
          margin-right: 0;
        }

        .entity-badges-container {
          gap: 0.25rem;
        }

        .entity-badges-container span {
          font-size: 0.625rem;
          padding: 0.25rem 0.5rem;
        }

        .article-actions button {
          font-size: 0.625rem !important;
          padding: 0.375rem 0.75rem !important;
        }
      }

/* Styles sourced from operations_readme.html */
      summary { list-style: none; }
      summary::-webkit-details-marker { display: none; }
      .glass-card {
        background: linear-gradient(145deg, rgba(255, 255, 255, 0.92), rgba(255, 255, 255, 0.8));
        backdrop-filter: blur(18px);
        border: 1px solid rgba(148, 163, 184, 0.18);
        box-shadow: 0 25px 45px -25px rgba(15, 23, 42, 0.25);
      }
      .dark .glass-card {
        background: linear-gradient(145deg, rgba(15, 23, 42, 0.92), rgba(15, 23, 42, 0.88));
        border: 1px solid rgba(51, 65, 85, 0.6);
        box-shadow: 0 20px 45px -25px rgba(15, 23, 42, 0.65);
      }
      .markdown-body {
        direction: rtl;
        font-family: 'Cairo', sans-serif;
      }
      .markdown-body h1, .markdown-body h2, .markdown-body h3, .markdown-body h4 {
        font-weight: 800;
        color: rgb(15 23 42 / 1);
        margin-top: 2.5rem;
        margin-bottom: 1rem;
      }
      .dark .markdown-body h1,
      .dark .markdown-body h2,
      .dark .markdown-body h3,
      .dark .markdown-body h4 {
        color: rgb(226 232 240 / 1);
      }
      .markdown-body p {
        margin-bottom: 1rem;
        line-height: 2;
        color: rgb(71 85 105 / 1);
      }
      .dark .markdown-body p {
        color: rgb(148 163 184 / 1);
      }
      .markdown-body pre {
        direction: ltr;
        text-align: left;
        background: rgba(15,23,42,0.9);
        color: #f8fafc;
        padding: 1rem 1.25rem;
        border-radius: 1rem;
        overflow-x: auto;
        margin: 1.5rem 0;
      }
      .markdown-body code {
        direction: ltr;
        font-family: 'JetBrains Mono', 'Courier New', monospace;
        font-size: 0.85rem;
        background: rgba(148, 163, 184, 0.15);
        padding: 0.2rem 0.4rem;
        border-radius: 0.5rem;
      }
      .markdown-body pre code {
        background: transparent;
        padding: 0;
        border-radius: 0;
      }
      .markdown-body ul,
      .markdown-body ol {
        margin-bottom: 1rem;
        padding-right: 1.5rem;
      }
      .markdown-body blockquote {
        border-right: 4px solid rgba(99, 102, 241, 0.4);
        padding: 0.5rem 1rem;
        border-radius: 1rem;
        background: rgba(129,140,248,0.08);
        color: inherit;
        margin: 1.5rem 0;
      }
      .markdown-body table {
        width: 100%;
        border-collapse: collapse;
        margin: 1.5rem 0;
        overflow: hidden;
        border-radius: 1rem;
      }
      .markdown-body th,
      .markdown-body td {
        border: 1px solid rgba(148, 163, 184, 0.35);
        padding: 0.75rem 1rem;
      }
      .markdown-body th {
        background: rgba(99, 102, 241, 0.1);
        text-align: right;
      }

/* Styles sourced from user_profile.html */
body {
        font-family: 'Inter', sans-serif !important;
      }

      .fa, .fas, .far, .fal, .fab {
        font-family: "Font Awesome 6 Free", "Font Awesome 6 Brands" !important;
      }

      ::-webkit-scrollbar {
        display: none;
      }

      html, body {
        -ms-overflow-style: none;
        scrollbar-width: none;
      }

      .glass-card {
        border-radius: 1.5rem;
        background: linear-gradient(145deg, rgba(255, 255, 255, 0.92), rgba(255, 255, 255, 0.78));
        backdrop-filter: blur(18px);
        border: 1px solid rgba(148, 163, 184, 0.18);
        box-shadow: 0 25px 45px -18px rgba(15, 23, 42, 0.25);
      }

      .dark .glass-card {
        background: linear-gradient(145deg, rgba(30, 41, 59, 0.88), rgba(15, 23, 42, 0.92));
        border: 1px solid rgba(148, 163, 184, 0.28);
        box-shadow: 0 25px 55px -20px rgba(15, 23, 42, 0.75);
      }

      .bot-indicator {
        animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
      }

      @keyframes pulse {
        0%, 100% {
          opacity: 1;
        }
        50% {
          opacity: 0.7;
        }
      }

      summary {
        list-style: none;
      }

      summary::-webkit-details-marker {
        display: none;
      }

/* Styles sourced from x_enriched_statistics.html */
body {
        font-family: 'Inter', sans-serif !important;
      }

      .fa, .fas, .far, .fal, .fab {
        font-family: "Font Awesome 6 Free", "Font Awesome 6 Brands" !important;
      }

      ::-webkit-scrollbar {
        display: none;
      }

      html, body {
        -ms-overflow-style: none;
        scrollbar-width: none;
      }

      .glass-card {
        background: linear-gradient(145deg, rgba(255, 255, 255, 0.92), rgba(255, 255, 255, 0.78));
        backdrop-filter: blur(18px);
        border: 1px solid rgba(148, 163, 184, 0.18);
        box-shadow: 0 25px 45px -18px rgba(15, 23, 42, 0.25);
        border-radius: 1.5rem;
      }

      .dark .glass-card {
        background: linear-gradient(145deg, rgba(30, 41, 59, 0.88), rgba(15, 23, 42, 0.92));
        border: 1px solid rgba(148, 163, 184, 0.28);
        box-shadow: 0 25px 55px -20px rgba(15, 23, 42, 0.75);
      }

      .chart-container {
        position: relative;
        height: 280px;
      }

      summary {
        list-style: none;
      }

      summary::-webkit-details-marker {
        display: none;
      }

/* Styles sourced from x_indices_dashboard.html */
body {
        font-family: 'Inter', sans-serif !important;
      }

      .fa, .fas, .far, .fal, .fab {
        font-family: "Font Awesome 6 Free", "Font Awesome 6 Brands" !important;
      }

      ::-webkit-scrollbar {
        display: none;
      }

      html, body {
        -ms-overflow-style: none;
        scrollbar-width: none;
      }

      .glass-card {
        background: linear-gradient(145deg, rgba(255, 255, 255, 0.92), rgba(255, 255, 255, 0.78));
        backdrop-filter: blur(18px);
        border: 1px solid rgba(148, 163, 184, 0.18);
        box-shadow: 0 25px 45px -18px rgba(15, 23, 42, 0.25);
        border-radius: 1.5rem;
      }

      .dark .glass-card {
        background: linear-gradient(145deg, rgba(30, 41, 59, 0.88), rgba(15, 23, 42, 0.92));
        border: 1px solid rgba(148, 163, 184, 0.28);
        box-shadow: 0 25px 55px -20px rgba(15, 23, 42, 0.75);
      }

      summary {
        list-style: none;
      }

      summary::-webkit-details-marker {
        display: none;
      }

/* Styles sourced from x_tweets.html */
body {
        font-family: 'Inter', sans-serif !important;
      }

      .fa, .fas, .far, .fal, .fab {
        font-family: "Font Awesome 6 Free", "Font Awesome 6 Brands" !important;
      }

      ::-webkit-scrollbar {
        display: none;
      }

      html, body {
        -ms-overflow-style: none;
        scrollbar-width: none;
      }

      .glass-card {
        background: linear-gradient(145deg, rgba(255, 255, 255, 0.92), rgba(255, 255, 255, 0.78));
        backdrop-filter: blur(18px);
        border: 1px solid rgba(148, 163, 184, 0.18);
        box-shadow: 0 25px 45px -18px rgba(15, 23, 42, 0.25);
      }

      .dark .glass-card {
        background: linear-gradient(145deg, rgba(30, 41, 59, 0.88), rgba(15, 23, 42, 0.92));
        border: 1px solid rgba(148, 163, 184, 0.28);
        box-shadow: 0 25px 55px -20px rgba(15, 23, 42, 0.75);
      }

      .tweet-card {
        transition: all 0.25s ease;
      }

      .tweet-card:hover {
        transform: translateY(-2px);
        box-shadow: 0 16px 30px -20px rgba(15, 23, 42, 0.45);
      }

      .enriched-tweet-card {
        border-width: 2px !important;
        border-color: rgba(251, 191, 36, 0.45) !important;
        background: linear-gradient(135deg, rgba(251, 191, 36, 0.08), rgba(253, 230, 138, 0.04));
      }

      .dark .enriched-tweet-card {
        border-color: rgba(245, 158, 11, 0.35) !important;
        background: linear-gradient(135deg, rgba(251, 191, 36, 0.12), rgba(15, 23, 42, 0.25));
      }

      .tweet-enrichment {
        margin-top: 1.5rem;
        padding-top: 1.5rem;
        border-top: 1.5px solid rgba(251, 191, 36, 0.35);
      }

      .dark .tweet-enrichment {
        border-color: rgba(251, 191, 36, 0.25);
      }

      .tweet-enrichment__header {
        display: flex;
        align-items: center;
        justify-content: space-between;
      }

      .tweet-enrichment__toggle {
        display: inline-flex;
        align-items: center;
        gap: 0.35rem;
        padding: 0.25rem 0.75rem;
        border-radius: 9999px;
        color: rgba(226, 232, 240, 0.85);
        background: rgba(15, 23, 42, 0.25);
        border: 1px solid rgba(15, 23, 42, 0.35);
        transition: all 0.2s ease;
      }

      .tweet-enrichment__toggle i {
        font-size: 0.7rem;
      }

      .tweet-enrichment__toggle:hover {
        color: #f8fafc;
        border-color: rgba(148, 163, 184, 0.45);
      }

      .dark .tweet-enrichment__toggle {
        background: rgba(15, 23, 42, 0.55);
        border-color: rgba(71, 85, 105, 0.5);
      }

      .enrichment-entity-card {
        padding: 1.25rem;
        border-radius: 1.15rem;
        border-width: 1.5px;
        box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.04);
      }

      .dark .enrichment-entity-card {
        box-shadow: inset 0 0 0 1px rgba(15, 23, 42, 0.35);
      }

      .enrichment-chip {
        padding: 0.45rem 0.9rem;
        border-radius: 9999px;
        font-weight: 600;
      }

      .enrichment-chip i {
        font-size: 0.75rem;
      }

      .engagement-metric {
        font-size: 0.85rem;
      }

      /* Fix chart container heights to prevent infinite scrolling */
      #x-timeline-chart,
      #x-engagement-chart,
      #x-language-chart,
      #x-types-chart {
        max-height: 200px !important;
        height: 200px !important;
      }

      canvas {
        max-height: 100% !important;
      }

      summary {
        list-style: none;
      }

      summary::-webkit-details-marker {
        display: none;
      }

/* Styles sourced from x_user_profile.html */
body { font-family: 'Cairo', sans-serif; }
        .glass-card {
            background: linear-gradient(145deg, rgba(30, 41, 59, 0.88), rgba(15, 23, 42, 0.92));
            backdrop-filter: blur(18px);
            border: 1px solid rgba(148, 163, 184, 0.28);
        }
        .network-node { cursor: pointer; }
        .network-node:hover { opacity: 0.8; }
        .topic-badge { transition: all 0.3s ease; }
        .topic-badge:hover { transform: scale(1.05); }

/* Styles sourced from x_user_profiles_browser.html */
body { font-family: 'Cairo', sans-serif; }
        .glass-card {
            background: linear-gradient(145deg, rgba(30, 41, 59, 0.88), rgba(15, 23, 42, 0.92));
            backdrop-filter: blur(18px);
            border: 1px solid rgba(148, 163, 184, 0.28);
        }
        .profile-card {
            transition: all 0.3s ease;
            cursor: pointer;
        }
        .profile-card:hover {
            transform: translateY(-4px);
            box-shadow: 0 20px 40px -15px rgba(59, 130, 246, 0.4);
        }
        summary {
            list-style: none;
        }
        summary::-webkit-details-marker {
            display: none;
        }

/* Embedded layout adjustments */
body[data-embedded='true'] {
  background-color: transparent !important;
  padding-top: 0 !important;
  min-height: auto !important;
}
body[data-embedded='true'] header { display: none !important; }
body[data-embedded='true'] main { padding-top: 0 !important; }
body[data-embedded='true'] .sticky { position: static !important; }

/* -------------------------------------------------------------------------- */
/* Button Theme Improvements                                                  */
/* -------------------------------------------------------------------------- */

/* Primary button theme awareness */
.btn-primary {
  background: linear-gradient(135deg, #2563EB 0%, #3B82F6 100%);
  color: white !important;
  border: none;
  box-shadow: 0 4px 14px 0 rgba(37, 99, 235, 0.35);
}

.btn-primary:hover {
  background: linear-gradient(135deg, #1E40AF 0%, #2563EB 100%);
  box-shadow: 0 6px 20px 0 rgba(37, 99, 235, 0.45);
}

html.light .btn-primary {
  background: linear-gradient(135deg, #3B82F6 0%, #60A5FA 100%);
  box-shadow: 0 4px 14px 0 rgba(59, 130, 246, 0.35);
}

html.light .btn-primary:hover {
  background: linear-gradient(135deg, #2563EB 0%, #3B82F6 100%);
  box-shadow: 0 6px 20px 0 rgba(37, 99, 235, 0.45);
}

/* Secondary button theme awareness */
.btn-secondary {
  background: rgba(148, 163, 184, 0.15);
  color: var(--atlas-body-text);
  border: 1px solid rgba(148, 163, 184, 0.3);
}

.btn-secondary:hover {
  background: rgba(148, 163, 184, 0.25);
  border-color: rgba(148, 163, 184, 0.5);
}

html.light .btn-secondary {
  background: rgba(148, 163, 184, 0.08);
  color: #374151;
  border: 1px solid rgba(148, 163, 184, 0.25);
}

html.light .btn-secondary:hover {
  background: rgba(148, 163, 184, 0.15);
  border-color: rgba(148, 163, 184, 0.4);
}

/* Card theme awareness improvements */
html.light .card,
html.light [class*="card"]:not(.platform-badge):not(.enriched-tweet-card):not(.uae-sentiment-card):not(.entity-badge):not(.stat-card):not(.performance-card):not(.article-card-enhanced) {
  background: white !important;
  border: 2px solid #cbd5e1 !important;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06) !important;
}

html.light .card:hover,
html.light [class*="card"]:not(.platform-badge):not(.enriched-tweet-card):not(.uae-sentiment-card):not(.entity-badge):not(.stat-card):not(.performance-card):not(.article-card-enhanced):hover {
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.15), 0 4px 6px -2px rgba(0, 0, 0, 0.1) !important;
  border-color: #3b82f6 !important;
}

/* Ensure white cards have proper borders in light mode */
html.light .bg-white {
  border-color: #cbd5e1;
}

/* Data cards specific improvements for light mode */
html.light .data-card {
  background: white !important;
  border: 2px solid #94a3b8 !important;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1), 0 1px 2px rgba(0, 0, 0, 0.06) !important;
}

html.light .data-card:hover {
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.12), 0 4px 8px rgba(0, 0, 0, 0.08) !important;
  border-color: #3b82f6 !important;
}

/* Modal theme awareness */
html.light .modal-content {
  background: white;
  color: #1f2937;
  border: 1px solid #e5e7eb;
}

html.dark .modal-content {
  background: #1f2937;
  color: #f3f4f6;
  border: 1px solid #374151;
}

/* Input theme awareness */
html.light input,
html.light textarea,
html.light select {
  background: white;
  color: #1f2937;
  border-color: #d1d5db;
}

html.light input:focus,
html.light textarea:focus,
html.light select:focus {
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

html.dark input,
html.dark textarea,
html.dark select {
  background: #374151;
  color: #f3f4f6;
  border-color: #4b5563;
}

html.dark input:focus,
html.dark textarea:focus,
html.dark select:focus {
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
}

/* -------------------------------------------------------------------------- */
/* Custom Light Theme Utility Support                                         */
/* Tailwind doesn't support light: prefix, so we handle it with CSS          */
/* -------------------------------------------------------------------------- */

/* Light theme utilities - these match our light: prefixed classes in HTML */
html.light [class*="light:text-gray-900"] { color: #111827 !important; }
html.light [class*="light:text-gray-700"] { color: #374151 !important; }
html.light [class*="light:text-gray-600"] { color: #4b5563 !important; }
html.light [class*="light:bg-white"] { background-color: #ffffff !important; }
html.light [class*="light:bg-gray-100"] { background-color: #f3f4f6 !important; }
html.light [class*="light:bg-blue-500"] { background-color: #3b82f6 !important; }
html.light [class*="light:border-gray-200"] { border-color: #e5e7eb !important; }

/* Light theme hover utilities */
html.light [class*="light:hover:text-gray-900"]:hover { color: #111827 !important; }
html.light [class*="light:hover:text-white"]:hover { color: #111827 !important; }
html.light [class*="light:hover:bg-gray-100"]:hover { background-color: #f3f4f6 !important; }

/* -------------------------------------------------------------------------- */
/* Unified Atlas Layout System                                                */
/* -------------------------------------------------------------------------- */

:root {
  --atlas-surface-dark: rgba(15, 23, 42, 0.78);
  --atlas-surface-dark-hover: rgba(30, 41, 59, 0.82);
  --atlas-surface-light: rgba(255, 255, 255, 0.9);
  --atlas-surface-light-hover: rgba(255, 255, 255, 0.96);
  --atlas-border-dark: rgba(148, 163, 184, 0.26);
  --atlas-border-light: rgba(148, 163, 184, 0.35);
  --atlas-shadow-dark: 0 30px 60px -32px rgba(2, 6, 23, 0.9);
  --atlas-shadow-light: 0 36px 60px -28px rgba(15, 23, 42, 0.2);
  --atlas-subnav-bg-dark: rgba(var(--atlas-color-slate-900-rgb), 0.62);
  --atlas-subnav-bg-light: rgba(var(--atlas-color-slate-800-rgb), 0.52);
  --atlas-subnav-border-dark: rgba(var(--atlas-color-slate-700-rgb), 0.65);
  --atlas-subnav-border-light: rgba(var(--atlas-color-slate-600-rgb), 0.4);
  --atlas-radius-lg: 1.5rem;
}

body {
  font-family: var(--font-base) !important;
  background-color: var(--atlas-body-bg) !important;
  color: var(--atlas-body-text);
}

.glass-card {
  position: relative;
  border-radius: var(--atlas-radius-lg);
  border: 1px solid var(--atlas-border-dark);
  background: var(--atlas-surface-dark);
  box-shadow: var(--atlas-shadow-dark);
  transition:
    transform 0.2s ease,
    box-shadow 0.2s ease,
    border-color 0.2s ease,
    background 0.2s ease;
}

.glass-card:hover {
  transform: translateY(-2px);
  border-color: rgba(37, 99, 235, 0.45);
  background: var(--atlas-surface-dark-hover);
  box-shadow: 0 40px 70px -40px rgba(2, 6, 23, 0.95);
}

html.light .glass-card {
  background: #ffffff;
  border: 2px solid #d1d5db;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

html.light .glass-card:hover {
  background: #ffffff;
  border-color: rgba(37, 99, 235, 0.5);
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.15), 0 4px 6px -2px rgba(0, 0, 0, 0.1);
}

.glass-card::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  background: linear-gradient(
    135deg,
    rgba(37, 99, 235, 0.12),
    transparent
  );
  opacity: 0;
  transition: opacity 0.2s ease;
}

.glass-card:hover::after {
  opacity: 1;
}

main[data-page-wrapper] {
  width: 100%;
  max-width: none;
  margin-inline: 0;
  margin-left: 0;
  margin-right: 0;
  padding-inline: clamp(1.25rem, 3vw, 2.75rem);
  padding-block: clamp(2rem, 2.5vw + 1.25rem, 3rem);
}

main[data-page-wrapper='wide'],
main[data-page-wrapper='full'] {
  width: 100%;
  max-width: none;
}

[data-page-subnav] {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
  width: 100%;
  max-width: none;
  margin: clamp(1rem, 2vw, 1.75rem) 0;
  padding: 0.85rem 1.25rem;
  border-radius: 1.25rem;
  background: var(--atlas-subnav-bg-dark);
  border: 1px solid var(--atlas-subnav-border-dark);
  backdrop-filter: blur(18px);
  position: sticky;
  top: var(--page-subnav-offset, 5rem);
  z-index: 30;
}

html.light [data-page-subnav] {
  background: var(--atlas-subnav-bg-light);
  border-color: var(--atlas-subnav-border-light);
}

[data-page-subnav='static'] {
  position: relative;
  top: auto;
}

[data-page-subnav='inline'] {
  position: static;
  width: auto;
  margin: 0;
  padding: 0.35rem 0;
  background: transparent;
  border: 0;
  backdrop-filter: none;
  box-shadow: none;
}

[data-page-subnav='inline']::before {
  display: none;
}

[data-page-subnav='inline'] [data-page-subnav-link] {
  padding: 0.4rem 0.85rem;
  border-radius: 0.95rem;
  border: 1px solid transparent;
}

[data-page-subnav='inline'] [data-page-subnav-link].is-active {
  background: rgba(37, 99, 235, 0.2);
  border-color: rgba(37, 99, 235, 0.4);
  box-shadow: none;
}

[data-page-subnav]::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(
    120deg,
    rgba(37, 99, 235, 0.12),
    transparent 55%
  );
  opacity: 0;
  transition: opacity 0.2s ease;
  pointer-events: none;
}

[data-page-subnav]:focus-within::before,
[data-page-subnav]:hover::before {
  opacity: 1;
}

[data-page-subnav] [data-page-subnav-link] {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1.05rem;
  border-radius: 9999px;
  font-size: 0.85rem;
  font-weight: 600;
  color: rgba(226, 232, 240, 0.78);
  border: 1px solid transparent;
  transition:
    color 0.2s ease,
    border-color 0.2s ease,
    background-color 0.2s ease,
    box-shadow 0.2s ease;
}

[data-page-subnav] [data-page-subnav-link]:hover {
  color: #f8fafc;
  border-color: rgba(148, 163, 184, 0.4);
  background: rgba(var(--atlas-color-slate-800-rgb), 0.55);
  box-shadow: 0 14px 30px -20px rgba(15, 23, 42, 0.7);
}

[data-page-subnav] [data-page-subnav-link].is-active {
  color: #fefefe;
  background: rgba(37, 99, 235, 0.22);
  border-color: rgba(37, 99, 235, 0.45);
  box-shadow: 0 16px 32px -22px rgba(37, 99, 235, 0.55);
}

html.light [data-page-subnav] [data-page-subnav-link] {
  color: rgba(30, 41, 59, 0.75);
}

html.light [data-page-subnav] [data-page-subnav-link]:hover {
  color: rgb(15, 23, 42);
  background: rgba(148, 163, 184, 0.16);
  border-color: rgba(37, 99, 235, 0.35);
}

html.light [data-page-subnav] [data-page-subnav-link].is-active {
  color: rgb(15, 23, 42);
  background: rgba(37, 99, 235, 0.18);
  border-color: rgba(37, 99, 235, 0.38);
}

[data-page-subnav] .subnav-divider {
  width: 1px;
  height: 1.25rem;
  background: rgba(148, 163, 184, 0.2);
}

html.light [data-page-subnav] .subnav-divider {
  background: rgba(100, 116, 139, 0.24);
}

.surface-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.35rem 0.85rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 600;
  color: rgba(226, 232, 240, 0.78);
  background: rgba(var(--atlas-color-slate-800-rgb), 0.5);
  border: 1px solid rgba(var(--atlas-color-slate-700-rgb), 0.55);
}

html.light .surface-pill {
  color: rgba(15, 23, 42, 0.8);
  background: rgba(var(--atlas-color-slate-200-rgb, 226, 232, 240), 0.75);
  border-color: rgba(var(--atlas-color-slate-400-rgb, 148, 163, 184), 0.45);
}

/* ========================================
   REPUTATION ALERT SYSTEM STYLES
   ======================================== */

/* Alert bell animation */
@keyframes pulse {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.5;
  }
}

@keyframes slide-in-right {
  from {
    transform: translateX(100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

.animate-slide-in-right {
  animation: slide-in-right 0.3s ease-out;
}

/* Alert dropdown scrollbar */
#alerts-list::-webkit-scrollbar {
  width: 6px;
}

#alerts-list::-webkit-scrollbar-track {
  background: rgba(51, 65, 85, 0.5);
  border-radius: 3px;
}

#alerts-list::-webkit-scrollbar-thumb {
  background: rgba(148, 163, 184, 0.5);
  border-radius: 3px;
}

#alerts-list::-webkit-scrollbar-thumb:hover {
  background: rgba(148, 163, 184, 0.8);
}

/* Line clamp utility */
.line-clamp-2 {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* -------------------------------------------------------------------------- */
/* Main Content Layout - Prevent overlap with fixed navbar                   */
/* -------------------------------------------------------------------------- */

.main-content {
  padding-top: 4rem; /* 64px to account for fixed navbar height (h-16) */
  min-height: 100vh;
}

/* For pages with no additional top margin needed */
.main-content > .bg-white:first-child,
.main-content > .bg-gray-800:first-child {
  margin-top: 0;
}
