@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@500;600;700;800&family=Tajawal:wght@400;500;700;800;900&display=swap');

:root {
  /* Royal Omani Luxury Theme Tokens */
  --emerald-950: #022019;
  --emerald-900: #063e2e;
  --emerald-800: #0b5944;
  --emerald-700: #047857;
  --emerald-600: #059669;
  --emerald-500: #10b981;
  --emerald-50: #ecfdf5;

  --gold-600: #b45309;
  --gold-500: #d97706;
  --gold-400: #f59e0b;
  --gold-300: #fbbf24;
  --gold-50: #fffbeb;

  --slate-950: #0a0f1d;
  --slate-900: #0f172a;
  --slate-800: #1e293b;
  --slate-700: #334155;
  --slate-600: #475569;
  --slate-400: #94a3b8;
  --slate-300: #cbd5e1;
  --slate-200: #e2e8f0;
  --slate-100: #f1f5f9;
  --slate-50: #f8fafc;

  --bg-page: #f8faf9;
  --card-bg: #ffffff;
  --line: #e2e8f0;
  --text-main: #0f172a;
  --text-muted: #64748b;
  --danger: #ef4444;
  --danger-bg: #fef2f2;
  --success: #10b981;
  --success-bg: #ecfdf5;
  --warning: #f59e0b;

  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-xl: 28px;

  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 10px 30px -5px rgba(6, 62, 46, 0.07);
  --shadow-lg: 0 20px 40px -10px rgba(6, 62, 46, 0.12);
  --shadow-gold: 0 12px 30px rgba(217, 119, 6, 0.25);
  --font-arabic: 'Tajawal', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-arabic);
  background-color: var(--bg-page);
  color: var(--text-main);
  min-height: 100vh;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

button, input, select, textarea {
  font-family: inherit;
  font-size: inherit;
}

button {
  cursor: pointer;
  border: none;
  background: none;
}

a {
  text-decoration: none;
  color: inherit;
}

/* ==========================================================================
   LUXURY BACKDROP & LOGIN PAGE
   ========================================================================== */
.login-page {
  min-height: 100vh;
  position: relative;
  overflow: hidden;
  background: #061e16;
}

.luxury-backdrop {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

.blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(100px);
  opacity: 0.25;
}

.blob-1 {
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, var(--emerald-500), transparent 70%);
  top: -200px;
  left: -150px;
}

.blob-2 {
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, var(--gold-400), transparent 70%);
  bottom: -150px;
  right: -100px;
}

.grid-pattern {
  position: absolute;
  inset: 0;
  background-image: radial-gradient(rgba(255, 255, 255, 0.08) 1px, transparent 1px);
  background-size: 32px 32px;
}

.login-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  position: relative;
  z-index: 1;
}

.brand-panel {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: clamp(40px, 6vw, 90px);
  color: white;
  border-left: 1px solid rgba(255, 255, 255, 0.08);
}

.brand-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand-badge {
  display: flex;
  align-items: center;
  gap: 16px;
}

.brand-mark {
  width: 56px;
  height: 56px;
  border-radius: 18px;
  background: linear-gradient(135deg, var(--gold-400), var(--gold-600));
  color: var(--emerald-950);
  display: grid;
  place-items: center;
  font-size: 30px;
  font-weight: 900;
  box-shadow: 0 10px 25px rgba(217, 119, 6, 0.35);
}

.brand-mark.small {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  font-size: 22px;
  box-shadow: none;
}

.brand-text .brand-name {
  display: block;
  font-size: 26px;
  font-weight: 900;
  letter-spacing: -0.5px;
  color: #ffffff;
}

.brand-text .brand-tagline {
  display: block;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 2px;
  color: var(--gold-400);
}

.version-pill {
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 700;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #a7f3d0;
}

.brand-hero {
  max-width: 620px;
  margin: 40px 0;
}

.hero-chip {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 6px 16px;
  border-radius: 20px;
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid rgba(16, 185, 129, 0.3);
  color: #6ee7b7;
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 24px;
}

.pulse-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--emerald-400);
  box-shadow: 0 0 10px var(--emerald-400);
  animation: pulseAnimation 2s infinite;
}

.pulse-dot-green {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 8px #10b981;
  animation: pulseAnimation 2s infinite;
  display: inline-block;
}

@keyframes pulseAnimation {
  0% { transform: scale(0.95); opacity: 0.8; }
  50% { transform: scale(1.3); opacity: 1; }
  100% { transform: scale(0.95); opacity: 0.8; }
}

.brand-hero h1 {
  font-size: clamp(34px, 3.5vw, 54px);
  font-weight: 900;
  line-height: 1.25;
  margin-bottom: 20px;
  color: #ffffff;
}

.brand-copy {
  font-size: 17px;
  line-height: 1.85;
  color: #cbd5e1;
  margin-bottom: 36px;
}

.brand-stats-row {
  display: flex;
  align-items: center;
  gap: 28px;
  padding: 22px 28px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-lg);
  backdrop-filter: blur(10px);
}

.mini-stat .stat-number {
  display: block;
  font-size: 20px;
  font-weight: 800;
  color: var(--gold-400);
}

.mini-stat .stat-label {
  display: block;
  font-size: 13px;
  color: #94a3b8;
}

.stat-divider {
  width: 1px;
  height: 36px;
  background: rgba(255, 255, 255, 0.12);
}

.brand-footer .brand-line {
  width: 80px;
  height: 3px;
  background: linear-gradient(90deg, var(--gold-400), transparent);
  margin-bottom: 16px;
}

.brand-footer .copyright {
  font-size: 13px;
  color: #64748b;
}

.login-panel {
  display: grid;
  place-items: center;
  padding: clamp(24px, 4vw, 60px);
  background: rgba(6, 30, 22, 0.4);
}

.glass-panel {
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.35);
  border-radius: var(--radius-xl);
}

.login-card {
  width: min(460px, 100%);
  padding: clamp(32px, 5vw, 48px);
}

.card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
}

.mobile-brand {
  display: none;
  align-items: center;
  gap: 12px;
  font-weight: 900;
  font-size: 22px;
}

.mobile-brand small {
  font-size: 12px;
  color: var(--text-muted);
  display: block;
}

.badge-role {
  padding: 4px 12px;
  background: var(--gold-50);
  border: 1px solid #fed7aa;
  color: var(--gold-600);
  font-size: 12px;
  font-weight: 800;
  border-radius: 20px;
}

.welcome-heading h2 {
  font-size: 30px;
  font-weight: 900;
  color: var(--slate-950);
  margin-bottom: 6px;
}

.muted {
  color: var(--text-muted);
  font-size: 14px;
}

.input-group {
  margin-bottom: 20px;
}

.input-group label {
  display: block;
  font-weight: 700;
  font-size: 14px;
  color: var(--slate-800);
  margin-bottom: 8px;
}

.input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.input-icon {
  position: absolute;
  right: 16px;
  font-size: 18px;
  pointer-events: none;
}

.input-wrapper input {
  width: 100%;
  height: 52px;
  padding: 0 48px 0 16px;
  border: 1.5px solid var(--slate-200);
  border-radius: var(--radius-md);
  background: #f8fafc;
  color: var(--slate-900);
  outline: none;
  transition: all 0.2s ease;
  font-size: 15px;
}

.input-wrapper input:focus {
  border-color: var(--emerald-600);
  background: #ffffff;
  box-shadow: 0 0 0 4px rgba(5, 150, 105, 0.12);
}

.icon-button {
  position: absolute;
  left: 14px;
  font-size: 16px;
}

.quick-credentials {
  margin-bottom: 20px;
}

.text-button {
  font-size: 13px;
  color: var(--emerald-700);
  font-weight: 700;
  text-decoration: underline;
  transition: color 0.2s;
}

.text-button:hover {
  color: var(--emerald-800);
}

.primary-button {
  width: 100%;
  height: 54px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  background: linear-gradient(135deg, var(--emerald-800), var(--emerald-950));
  color: white;
  border-radius: var(--radius-md);
  font-size: 16px;
  font-weight: 800;
  box-shadow: var(--shadow-md);
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.primary-button:hover {
  background: linear-gradient(135deg, var(--emerald-700), var(--emerald-900));
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.form-error {
  padding: 12px 16px;
  background: var(--danger-bg);
  border: 1px solid #fecaca;
  color: var(--danger);
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 18px;
}

.login-footer {
  margin-top: 28px;
  text-align: center;
}

.security-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: #64748b;
}

/* ==========================================================================
   DASHBOARD CORE SHELL & SIDEBAR
   ========================================================================== */
.dashboard-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 280px 1fr;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--emerald-950);
  color: white;
  padding: 24px 18px;
  border-left: 1px solid rgba(255, 255, 255, 0.07);
  z-index: 100;
}

.sidebar-top {
  margin-bottom: 24px;
  padding-bottom: 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 14px;
}

.brand-info .brand-title {
  display: block;
  font-size: 22px;
  font-weight: 900;
  letter-spacing: -0.5px;
  color: white;
}

.brand-info .brand-subtitle {
  display: block;
  font-size: 11px;
  color: #a7f3d0;
  font-weight: 600;
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
  overflow-y: auto;
  flex: 1;
  padding-left: 4px;
}

.sidebar-nav::-webkit-scrollbar {
  width: 4px;
}
.sidebar-nav::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 4px;
}

.nav-group-label {
  font-size: 11px;
  font-weight: 800;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 1px;
  padding: 14px 12px 6px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 12px 14px;
  border-radius: var(--radius-md);
  color: #94a3b8;
  font-weight: 700;
  font-size: 14px;
  transition: all 0.2s ease;
  position: relative;
}

.nav-item:hover {
  background: rgba(255, 255, 255, 0.06);
  color: white;
}

.nav-item.active {
  background: linear-gradient(135deg, var(--emerald-800), var(--emerald-900));
  color: white;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
}

.nav-item.active::before {
  content: "";
  position: absolute;
  right: 0;
  top: 8px;
  bottom: 8px;
  width: 4px;
  border-radius: 4px 0 0 4px;
  background: var(--gold-400);
}

.nav-icon {
  font-size: 17px;
  width: 24px;
  display: grid;
  place-items: center;
}

.nav-text {
  flex: 1;
  text-align: right;
}

.nav-badge {
  padding: 2px 8px;
  border-radius: 12px;
  background: var(--gold-500);
  color: white;
  font-size: 11px;
  font-weight: 800;
}

.nav-arrow {
  font-size: 12px;
  opacity: 0.6;
}

.sidebar-footer {
  margin-top: auto;
  padding-top: 18px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.server-status-pill {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  background: rgba(255, 255, 255, 0.04);
  border-radius: var(--radius-sm);
  font-size: 12px;
  color: #a7f3d0;
  font-weight: 600;
}

.logout-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  border: 1px solid rgba(239, 68, 68, 0.3);
  background: rgba(239, 68, 68, 0.08);
  color: #fca5a5;
  border-radius: var(--radius-md);
  font-size: 13px;
  font-weight: 700;
  transition: all 0.2s;
}

.logout-btn:hover {
  background: rgba(239, 68, 68, 0.2);
  color: #fee2e2;
}

/* ==========================================================================
   MAIN DASHBOARD LAYOUT & TOPBAR
   ========================================================================== */
.dashboard-main {
  min-width: 0;
  padding: 30px clamp(24px, 4vw, 50px) 80px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 30px;
  gap: 20px;
}

.breadcrumbs {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.crumb-active {
  color: var(--emerald-700);
  font-weight: 700;
}

.topbar h1 {
  font-size: 26px;
  font-weight: 900;
  color: var(--slate-900);
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 16px;
}

.search-bar-wrap {
  position: relative;
  width: 280px;
}

.search-bar-wrap .search-icon {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 14px;
  color: var(--slate-400);
}

.search-bar-wrap input {
  width: 100%;
  height: 44px;
  padding: 0 40px 0 16px;
  border: 1px solid var(--slate-200);
  border-radius: var(--radius-md);
  background: white;
  font-size: 14px;
  outline: none;
  transition: all 0.2s;
}

.search-bar-wrap input:focus {
  border-color: var(--emerald-600);
  box-shadow: 0 0 0 3px rgba(5, 150, 105, 0.1);
}

.icon-action-btn {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  border: 1px solid var(--slate-200);
  background: white;
  display: grid;
  place-items: center;
  font-size: 16px;
  transition: all 0.2s;
}

.icon-action-btn:hover {
  background: var(--slate-50);
  border-color: var(--slate-300);
}

.admin-profile-pill {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 6px 14px 6px 8px;
  background: white;
  border: 1px solid var(--slate-200);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}

.admin-avatar {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--emerald-700), var(--emerald-900));
  color: white;
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 15px;
}

.admin-details strong {
  display: block;
  font-size: 13px;
  color: var(--slate-900);
}

.role-badge {
  display: inline-block;
  font-size: 10px;
  font-weight: 800;
  color: var(--emerald-700);
  background: var(--emerald-50);
  padding: 1px 6px;
  border-radius: 4px;
}

.global-alert-error {
  padding: 16px 20px;
  background: var(--danger-bg);
  border: 1px solid #fecaca;
  color: var(--danger);
  border-radius: var(--radius-md);
  font-weight: 700;
  margin-bottom: 24px;
}

/* ==========================================================================
   HERO BANNER & KPI CARDS
   ========================================================================== */
.hero-banner {
  background: linear-gradient(135deg, var(--emerald-900), var(--emerald-950));
  color: white;
  border-radius: var(--radius-xl);
  padding: clamp(24px, 4vw, 40px);
  margin-bottom: 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-md);
}

.hero-banner::after {
  content: "";
  position: absolute;
  right: -50px;
  bottom: -50px;
  width: 250px;
  height: 250px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(217, 119, 6, 0.18), transparent 70%);
  pointer-events: none;
}

.hero-badge {
  display: inline-block;
  padding: 4px 12px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 20px;
  font-size: 12px;
  font-weight: 700;
  margin-bottom: 12px;
}

.hero-content h2 {
  font-size: clamp(22px, 2.5vw, 32px);
  font-weight: 900;
  margin-bottom: 6px;
}

.hero-content p {
  color: #cbd5e1;
  font-size: 15px;
  max-width: 580px;
}

.hero-time {
  margin-top: 14px;
  font-size: 13px;
  color: #94a3b8;
}

.primary-btn-gold {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 12px 24px;
  background: linear-gradient(135deg, var(--gold-400), var(--gold-500));
  color: var(--slate-950);
  border-radius: var(--radius-md);
  font-weight: 800;
  font-size: 14px;
  box-shadow: var(--shadow-gold);
  transition: all 0.2s;
  white-space: nowrap;
}

.primary-btn-gold:hover {
  transform: translateY(-2px);
  box-shadow: 0 16px 35px rgba(217, 119, 6, 0.35);
}

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  margin-bottom: 28px;
}

.glass-card {
  background: white;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-sm);
  transition: all 0.25s ease;
}

.glass-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
  border-color: var(--slate-300);
}

.kpi-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.kpi-icon-wrap {
  width: 46px;
  height: 46px;
  border-radius: var(--radius-md);
  display: grid;
  place-items: center;
  font-size: 20px;
}

.kpi-icon-wrap.emerald { background: var(--emerald-50); color: var(--emerald-700); }
.kpi-icon-wrap.blue { background: #eff6ff; color: #2563eb; }
.kpi-icon-wrap.amber { background: var(--gold-50); color: var(--gold-600); }
.kpi-icon-wrap.purple { background: #faf5ff; color: #9333ea; }

.kpi-trend {
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 800;
}

.kpi-trend.positive { background: var(--emerald-50); color: var(--emerald-700); }
.kpi-trend.neutral { background: var(--slate-100); color: var(--slate-600); }

.kpi-label {
  display: block;
  font-size: 13px;
  font-weight: 700;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.kpi-value-wrap {
  display: flex;
  align-items: baseline;
  gap: 6px;
  margin-bottom: 8px;
}

.kpi-value-wrap strong {
  font-size: 32px;
  font-weight: 900;
  color: var(--slate-950);
  line-height: 1.1;
}

.kpi-unit {
  font-size: 15px;
  font-weight: 700;
  color: var(--slate-600);
}

.kpi-hint {
  font-size: 12px;
  color: var(--slate-400);
}

/* ==========================================================================
   ANALYTICS GRID, LUXURY CHART & HEALTH CARD
   ========================================================================== */
.analytics-grid {
  display: grid;
  grid-template-columns: 1.85fr 1fr;
  gap: 24px;
  margin-bottom: 30px;
}

.chart-card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 28px;
}

.chart-header-info {
  display: flex;
  align-items: center;
  gap: 12px;
}

.chart-title-flex {
  display: flex;
  align-items: center;
  gap: 14px;
}

.chart-icon-badge {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  background: var(--emerald-50);
  border: 1px solid #a7f3d0;
  color: var(--emerald-700);
  display: grid;
  place-items: center;
  font-size: 20px;
}

.chart-controls-group {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.chart-metrics-ribbon {
  display: flex;
  align-items: center;
  background: linear-gradient(135deg, #f8fafc, #f1f5f9);
  border: 1px solid var(--slate-200);
  border-radius: var(--radius-md);
  padding: 16px 20px;
  margin: 18px 0 24px;
  gap: 20px;
}

.ribbon-metric {
  flex: 1;
}

.ribbon-label {
  display: block;
  font-size: 12px;
  font-weight: 700;
  color: var(--slate-500);
  margin-bottom: 4px;
}

.ribbon-val {
  display: flex;
  align-items: baseline;
  gap: 6px;
}

.ribbon-val strong {
  font-size: 22px;
  font-weight: 900;
  color: var(--slate-900);
}

.ribbon-val small {
  font-size: 13px;
  font-weight: 700;
  color: var(--slate-500);
}

.growth-chip.positive {
  padding: 2px 8px;
  border-radius: 12px;
  background: #dcfce7;
  color: #15803d;
  font-size: 11px;
  font-weight: 800;
}

.day-tag {
  padding: 2px 8px;
  border-radius: 12px;
  background: var(--gold-50);
  border: 1px solid #fde68a;
  color: var(--gold-600);
  font-size: 11px;
  font-weight: 800;
}

.ribbon-divider {
  width: 1px;
  height: 36px;
  background: var(--slate-300);
}

.chart-canvas-container {
  width: 100%;
  height: 280px;
  position: relative;
}

.chart-insights-footer {
  margin-top: 20px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
}

.chart-legend-custom {
  display: flex;
  align-items: center;
  gap: 18px;
  font-size: 13px;
  font-weight: 700;
  color: var(--slate-700);
}

.custom-legend-item {
  display: flex;
  align-items: center;
  gap: 8px;
}

.legend-indicator {
  width: 12px;
  height: 12px;
  border-radius: 4px;
}

.legend-indicator.emerald-glow {
  background: var(--emerald-600);
  box-shadow: 0 0 10px rgba(5, 150, 105, 0.4);
}

.legend-indicator.gold-glow {
  background: var(--gold-400);
  box-shadow: 0 0 10px rgba(245, 158, 11, 0.4);
}

.legend-indicator.indigo-glow {
  background: #6366f1;
  box-shadow: 0 0 10px rgba(99, 102, 241, 0.4);
}

.mini-progress-stats {
  display: flex;
  gap: 20px;
}

.prog-item {
  min-width: 140px;
}

.prog-labels {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  font-weight: 700;
  color: var(--slate-600);
  margin-bottom: 4px;
}

.prog-bar-wrap {
  width: 100%;
  height: 6px;
  background: var(--slate-100);
  border-radius: 4px;
  overflow: hidden;
}

.prog-bar-fill.emerald {
  height: 100%;
  background: linear-gradient(90deg, var(--emerald-600), #34d399);
  border-radius: 4px;
}

.prog-bar-fill.gold {
  height: 100%;
  background: linear-gradient(90deg, var(--gold-500), #fcd34d);
  border-radius: 4px;
}

/* Donut Breakdown Card */
.analytics-side-col {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.donut-card {
  padding: 24px;
}

.donut-container {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-top: 14px;
}

.donut-canvas-wrap {
  width: 130px;
  height: 130px;
  position: relative;
  flex-shrink: 0;
}

.donut-center-label {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

.donut-center-label strong {
  font-size: 18px;
  font-weight: 900;
  color: var(--slate-900);
  line-height: 1;
}

.donut-center-label small {
  font-size: 11px;
  color: var(--text-muted);
}

.donut-legend-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex: 1;
}

.d-legend-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 13px;
  padding: 6px 10px;
  background: var(--slate-50);
  border-radius: var(--radius-sm);
}

.d-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
  margin-left: 6px;
}

.d-dot.emerald { background: var(--emerald-600); }
.d-dot.gold { background: var(--gold-400); }
.d-dot.indigo { background: #6366f1; }

.d-name {
  flex: 1;
  color: var(--slate-700);
  font-weight: 600;
}

.d-pct {
  font-weight: 800;
  color: var(--slate-900);
}

.dashboard-card {
  background: white;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 26px;
  box-shadow: var(--shadow-sm);
}

.card-title-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.card-heading {
  font-size: 18px;
  font-weight: 800;
  color: var(--slate-900);
}

.card-subheading {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 2px;
}

.pill-selector {
  display: flex;
  background: var(--slate-100);
  padding: 4px;
  border-radius: var(--radius-sm);
  gap: 4px;
}

.pill-btn {
  padding: 6px 14px;
  font-size: 12px;
  font-weight: 700;
  border-radius: 6px;
  color: var(--slate-600);
}

.pill-btn.active {
  background: white;
  color: var(--emerald-800);
  box-shadow: var(--shadow-sm);
}

.badge-status-green {
  padding: 4px 12px;
  background: var(--emerald-50);
  border: 1px solid #a7f3d0;
  color: var(--emerald-700);
  border-radius: 20px;
  font-size: 12px;
  font-weight: 800;
}

.services-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.service-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: var(--slate-50);
  border-radius: var(--radius-md);
  border: 1px solid var(--slate-100);
}

.service-meta {
  display: flex;
  align-items: center;
  gap: 12px;
}

.service-icon {
  font-size: 22px;
}

.service-meta strong {
  display: block;
  font-size: 14px;
  color: var(--slate-900);
}

.service-meta small {
  display: block;
  font-size: 12px;
  color: var(--text-muted);
}

.status-tag.active {
  padding: 4px 10px;
  background: #dcfce7;
  color: #15803d;
  border-radius: 16px;
  font-size: 12px;
  font-weight: 800;
}

/* ==========================================================================
   DATA TABLES & LIST SECTIONS
   ========================================================================== */
.section-header-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
  gap: 20px;
}

.section-header-bar h2 {
  font-size: 22px;
  font-weight: 900;
  color: var(--slate-900);
  margin-bottom: 4px;
}

.section-header-bar p {
  color: var(--text-muted);
  font-size: 14px;
}

.custom-select {
  height: 44px;
  padding: 0 16px;
  border: 1px solid var(--slate-200);
  border-radius: var(--radius-md);
  background: white;
  color: var(--slate-800);
  font-size: 14px;
  font-weight: 600;
  outline: none;
}

.secondary-btn {
  padding: 10px 18px;
  border: 1px solid var(--slate-200);
  background: white;
  border-radius: var(--radius-md);
  font-size: 14px;
  font-weight: 700;
  color: var(--slate-700);
  transition: all 0.2s;
}

.secondary-btn:hover {
  background: var(--slate-50);
  border-color: var(--slate-300);
}

.table-card {
  padding: 0;
  overflow: hidden;
}

.table-responsive {
  width: 100%;
  overflow-x: auto;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  text-align: right;
}

.data-table th {
  padding: 16px 20px;
  background: var(--slate-50);
  border-bottom: 1px solid var(--line);
  color: var(--slate-600);
  font-size: 13px;
  font-weight: 800;
  white-space: nowrap;
}

.data-table td {
  padding: 16px 20px;
  border-bottom: 1px solid var(--line);
  font-size: 14px;
  color: var(--slate-800);
  white-space: nowrap;
}

.data-table tbody tr {
  transition: background-color 0.15s ease;
}

.data-table tbody tr:hover {
  background-color: #f8fafc;
}

.loading-state, .empty-state {
  text-align: center;
  padding: 50px 20px !important;
  color: var(--text-muted);
  font-size: 15px;
}

/* Status Badges */
.badge {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 800;
}

.badge-active { background: #dcfce7; color: #15803d; }
.badge-pending { background: #fef3c7; color: #b45309; }
.badge-suspended, .badge-rejected, .badge-danger { background: #fee2e2; color: #b91c1c; }
.badge-info { background: #e0f2fe; color: #0369a1; }

.action-btn-group {
  display: flex;
  gap: 8px;
}

.btn-action {
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-weight: 700;
  transition: all 0.2s;
}

.btn-action.approve { background: var(--emerald-50); color: var(--emerald-700); border: 1px solid #a7f3d0; }
.btn-action.approve:hover { background: var(--emerald-100); }
.btn-action.reject { background: var(--danger-bg); color: var(--danger); border: 1px solid #fecaca; }
.btn-action.reject:hover { background: #fee2e2; }
.btn-action.view { background: var(--slate-100); color: var(--slate-700); border: 1px solid var(--slate-200); }
.btn-action.view:hover { background: var(--slate-200); }

/* ==========================================================================
   MODAL WINDOWS & TOAST NOTIFICATIONS
   ========================================================================== */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.65);
  backdrop-filter: blur(8px);
  z-index: 1000;
  display: grid;
  place-items: center;
  padding: 20px;
}

.modal-card {
  width: min(580px, 100%);
  max-height: 90vh;
  overflow-y: auto;
  padding: 32px;
  background: white;
  border-radius: var(--radius-xl);
  box-shadow: 0 30px 70px rgba(0, 0, 0, 0.35);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line);
}

.modal-header h3 {
  font-size: 20px;
  font-weight: 900;
  color: var(--slate-900);
}

.close-modal-btn {
  font-size: 20px;
  color: var(--slate-400);
  transition: color 0.2s;
}

.close-modal-btn:hover {
  color: var(--slate-700);
}

.modal-form-group {
  margin-bottom: 18px;
}

.modal-form-group label {
  display: block;
  font-weight: 700;
  font-size: 14px;
  color: var(--slate-800);
  margin-bottom: 8px;
}

.modal-input, .modal-select, .modal-textarea {
  width: 100%;
  padding: 12px 16px;
  border: 1.5px solid var(--slate-200);
  border-radius: var(--radius-md);
  background: #f8fafc;
  font-size: 14px;
  outline: none;
}

.modal-input:focus, .modal-select:focus, .modal-textarea:focus {
  border-color: var(--emerald-600);
  background: white;
}

.modal-footer-btns {
  display: flex;
  gap: 12px;
  margin-top: 24px;
}

.toast-container {
  position: fixed;
  bottom: 28px;
  left: 28px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 2000;
}

.toast {
  padding: 14px 20px;
  border-radius: var(--radius-md);
  font-size: 14px;
  font-weight: 700;
  color: white;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
  transform: translateY(20px);
  opacity: 0;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  align-items: center;
  gap: 10px;
}

.toast.show {
  transform: translateY(0);
  opacity: 1;
}

.toast-success { background: linear-gradient(135deg, #059669, #047857); }
.toast-error { background: linear-gradient(135deg, #dc2626, #b91c1c); }
.toast-info { background: linear-gradient(135deg, #0284c7, #0369a1); }

[hidden] {
  display: none !important;
}

/* ==========================================================================
   RESPONSIVE DESIGN
   ========================================================================== */
@media (max-width: 1150px) {
  .kpi-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .analytics-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 860px) {
  .login-shell {
    grid-template-columns: 1fr;
  }
  .brand-panel {
    display: none;
  }
  .mobile-brand {
    display: flex;
  }
  .dashboard-shell {
    grid-template-columns: 1fr;
  }
  .sidebar {
    position: static;
    height: auto;
    padding: 16px;
  }
  .sidebar-nav {
    flex-direction: row;
    overflow-x: auto;
    padding-bottom: 8px;
  }
  .nav-group-label {
    display: none;
  }
  .nav-item {
    white-space: nowrap;
    width: auto;
  }
  .dashboard-main {
    padding: 20px 16px;
  }
  .topbar {
    flex-direction: column;
    align-items: flex-start;
  }
  .topbar-right {
    width: 100%;
    justify-content: space-between;
  }
  .search-bar-wrap {
    flex: 1;
  }
  .hero-banner {
    flex-direction: column;
    align-items: flex-start;
    gap: 20px;
  }
}

@media (max-width: 540px) {
  .kpi-grid {
    grid-template-columns: 1fr;
  }
}
