:root {
  --primary: #1d6ef2; /* Uqda Blue */
  --primary-dark: #1758c2;
  /* Light Mode Glassmorphism */
  --bg-gradient: linear-gradient(-45deg, #ff9a9e, #fecfef, #a1c4fd, #c2e9fb);
  --glass-bg: rgba(255, 255, 255, 0.35);
  --glass-border: rgba(255, 255, 255, 0.4);
  --glass-sidebar: rgba(255, 255, 255, 0.25);
  --text-main: #0f172a;
  --text-muted: #475569;
  --border: rgba(0, 0, 0, 0.05);
  --shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.07);
  --th-bg: rgba(0, 0, 0, 0.03);
}

body.dark-mode {
  --bg-gradient: linear-gradient(-45deg, #0f2027, #203a43, #2c5364, #120E1F);
  --glass-bg: rgba(15, 23, 42, 0.35);
  --glass-border: rgba(255, 255, 255, 0.08);
  --glass-sidebar: rgba(15, 23, 42, 0.25);
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --border: rgba(255, 255, 255, 0.05);
  --shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.3);
  --th-bg: rgba(255, 255, 255, 0.05);
}

* { margin: 0; padding: 0; box-sizing: border-box; font-family: 'Inter', sans-serif; transition: background 0.3s, color 0.3s, border-color 0.3s; }

body { 
  background: var(--bg-gradient);
  background-size: 400% 400%;
  animation: gradientBG 15s ease infinite;
  color: var(--text-main); 
  display: flex; height: 100vh; overflow: hidden; 
}

@keyframes gradientBG {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

/* Glass Elements */
.glass-panel {
  background: var(--glass-bg);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid var(--glass-border);
  box-shadow: var(--shadow);
}

/* Sidebar */
.sidebar { width: 260px; background: var(--glass-sidebar); backdrop-filter: blur(20px); border-right: 1px solid var(--glass-border); display: flex; flex-direction: column; z-index: 10; }
.sidebar-header { padding: 24px; border-bottom: 1px solid var(--border); display: flex; align-items: center; gap: 12px; }
.sidebar-header .logo-icon { color: var(--primary); }
.sidebar-header h2 { font-size: 1.2rem; font-weight: 700; color: var(--text-main); }
.nav-links { flex: 1; padding: 20px 0; overflow-y: auto; }
.nav-item { padding: 12px 24px; display: flex; align-items: center; gap: 12px; color: var(--text-muted); text-decoration: none; font-weight: 500; border-left: 3px solid transparent; }
.nav-item:hover, .nav-item.active { background: rgba(29, 110, 242, 0.1); color: var(--primary); border-left: 3px solid var(--primary); }

/* Main Content */
.main-content { flex: 1; display: flex; flex-direction: column; overflow-y: auto; }
.header { height: 70px; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: flex-end; padding: 0 30px; background: var(--glass-sidebar); backdrop-filter: blur(20px); position: sticky; top: 0; z-index: 5; }
.user-profile { display: flex; align-items: center; gap: 15px; }
.avatar { width: 36px; height: 36px; border-radius: 8px; background: var(--primary); color: white; display: flex; align-items: center; justify-content: center; font-weight: bold; }
.theme-toggle { background: none; border: none; color: var(--text-muted); cursor: pointer; display: flex; align-items: center; justify-content: center; width: 36px; height: 36px; border-radius: 50%; transition: 0.2s; }
.theme-toggle:hover { background: rgba(0,0,0,0.05); color: var(--text-main); }

.dashboard-container { padding: 30px; }

/* Disclaimer Banner */
.disclaimer-banner {
  background: rgba(29, 110, 242, 0.1);
  border: 1px solid rgba(29, 110, 242, 0.3);
  border-radius: 12px;
  padding: 16px 20px;
  margin-bottom: 30px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.disclaimer-banner h4 { color: #1d6ef2; font-size: 0.95rem; display: flex; align-items: center; gap: 8px; }
.disclaimer-banner p { color: var(--text-main); font-size: 0.85rem; line-height: 1.5; }

/* Stats Grid */
.stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; margin-bottom: 30px; }
.stat-card { border-radius: 16px; padding: 20px; transition: transform 0.3s; }
.stat-card:hover { transform: translateY(-5px); }
.stat-card .stat-title { color: var(--text-muted); font-size: 0.85rem; margin-bottom: 8px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px;}
.stat-card .stat-value { font-size: 1.8rem; font-weight: 700; color: var(--text-main); }
.stat-card .stat-trend { font-size: 0.8rem; color: #10b981; margin-top: 8px; display: flex; align-items: center; gap: 4px; font-weight: 600;}
.stat-card .stat-trend.negative { color: #ef4444; }

/* Charts & Tables */
.content-grid { display: grid; grid-template-columns: 2fr 1fr; gap: 20px; }
.card { border-radius: 16px; padding: 24px; transition: transform 0.3s; }
.card-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; }
.card-title { font-size: 1.1rem; font-weight: 700; color: var(--text-main); }

table { width: 100%; border-collapse: collapse; }
th, td { padding: 14px 12px; text-align: left; border-bottom: 1px solid var(--border); font-size: 0.9rem; }
th { color: var(--text-muted); font-weight: 600; background: var(--th-bg); border-top-left-radius: 8px; border-top-right-radius: 8px; }
tbody tr:hover { background: rgba(29, 110, 242, 0.05); }

.btn { background:var(--primary); border:none; color:white; padding:8px 16px; border-radius:8px; cursor:pointer; font-weight: 500; transition: 0.2s; box-shadow: 0 4px 12px rgba(29,110,242,0.3); display: inline-flex; align-items: center; gap: 6px; }
.btn:hover { background: var(--primary-dark); transform: translateY(-2px); box-shadow: 0 6px 16px rgba(29,110,242,0.4); }

.badge { padding: 4px 8px; border-radius: 6px; font-size: 0.75rem; font-weight: 600; }
.badge.warning { background: rgba(245, 158, 11, 0.15); color: #f59e0b; }
.badge.success { background: rgba(16, 185, 129, 0.15); color: #10b981; }
.badge.danger { background: rgba(239, 68, 68, 0.15); color: #ef4444; }

/* Page Views */
.page-view { display: none; } .page-view.active { display: block; }
/* Mobile Responsiveness */
@media (max-width: 768px) {
  body { flex-direction: column; overflow: auto; height: auto; }
  .sidebar { position: fixed; left: -100%; top: 0; bottom: 0; transition: left 0.3s; z-index: 50; }
  .sidebar.mobile-open { left: 0; }
  .mobile-menu-btn { display: flex !important; align-items: center; justify-content: center; width: 40px; height: 40px; color: var(--text-main); }
  .header { justify-content: space-between; padding: 0 15px; }
  .content-grid { grid-template-columns: 1fr; }
  .stats-grid { grid-template-columns: 1fr; gap: 15px; }
  .dashboard-container { padding: 15px; }
  .card { padding: 15px; }
  table { display: block; overflow-x: auto; white-space: nowrap; }
}


/* Sidebar Backdrop */
.sidebar-backdrop {
  display: none;
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0, 0, 0, 0.4);
  z-index: 40;
  backdrop-filter: blur(4px);
  opacity: 0;
  transition: opacity 0.3s;
}
.sidebar-backdrop.active {
  display: block;
  opacity: 1;
}
