@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&family=JetBrains+Mono:wght@400;700&family=Noto+Sans+Devanagari:wght@400;700&family=Noto+Sans+Telugu:wght@400;700&family=Noto+Sans+Tamil:wght@400;700&family=Noto+Sans+Bengali:wght@400;700&family=Noto+Sans+Kannada:wght@400;700&family=Noto+Sans+Malayalam:wght@400;700&family=Noto+Sans+Gujarati:wght@400;700&family=Noto+Sans+Gurmukhi:wght@400;700&display=swap');

/* ================================================================
   RESOLVIT — Ultra-Futuristic Civic intelligence
   Cyber-Premium Design System v2
   ================================================================ */

:root {
  --font-main: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
  
  /* Indian Scripts */
  --font-hi: 'Noto Sans Devanagari', sans-serif;
  --font-te: 'Noto Sans Telugu', sans-serif;
  --font-ta: 'Noto Sans Tamil', sans-serif;
  --font-bn: 'Noto Sans Bengali', sans-serif;
  --font-kn: 'Noto Sans Kannada', sans-serif;
  --font-ml: 'Noto Sans Malayalam', sans-serif;
  --font-gu: 'Noto Sans Gujarati', sans-serif;
  --font-pa: 'Noto Sans Gurmukhi', sans-serif;

  /* Neon Core Palette */
  --bg-primary: #020617;
  --bg-secondary: #0f172a;
  --bg-tertiary: #1e293b;
  --accent: #6366f1;
  --accent-glow: rgba(99, 102, 241, 0.4);
  --accent-gradient: linear-gradient(135deg, #6366f1 0%, #a855f7 100%);

  --red: #ff3e3e;
  --red-glow: rgba(255, 62, 62, 0.5);
  --orange: #f97316;
  --orange-glow: rgba(249, 115, 22, 0.4);
  --yellow: #eab308;
  --green: #10b981;
  --green-glow: rgba(16, 185, 129, 0.4);
  --blue: #3b82f6;

  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --border: rgba(255, 255, 255, 0.08);
  --glass: rgba(15, 23, 42, 0.7);
  --glass-border: rgba(255, 255, 255, 0.12);

  /* Container & Spacing */
  --container: 1280px;
  --transition: all 0.4s cubic-bezier(0.2, 0.8, 0.2, 1);
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 24px;
  --shadow-lg: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

/* --- LIGHT THEME OVERRIDES --- */
[data-theme="light"] {
  --bg-primary: #f8fafc;
  --bg-secondary: #ffffff;
  --bg-tertiary: #f1f5f9;
  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-muted: #64748b;
  --border: rgba(0, 0, 0, 0.08);
  --glass: rgba(255, 255, 255, 0.85);
  --glass-border: rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);

  --accent-glow: rgba(99, 102, 241, 0.2);
}

/* --- THEME TOGGLE UI --- */
.theme-toggle {
  transition: transform 0.3s ease;
}

.theme-toggle:hover {
  transform: rotate(15deg) scale(1.1);
}

.theme-toggle:active {
  transform: scale(0.9);
}

[data-theme="dark"] .theme-toggle .moon {
  display: none;
}

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

[data-theme="dark"] .theme-toggle .sun {
  display: inline-block;
}

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

/* --- THE GLASS ENGINE (PERFORMANCE OPTIMIZED) --- */
.glass {
  background: var(--glass);
  backdrop-filter: blur(8px) saturate(160%);
  -webkit-backdrop-filter: blur(8px) saturate(160%);
  border: 1px solid var(--glass-border);
  box-shadow: var(--shadow-lg);
  transition: var(--transition);
  will-change: transform, opacity;
}

.glass-premium {
  background: rgba(15, 23, 42, 0.25) !important;
  backdrop-filter: blur(8px) saturate(160%) !important;
  -webkit-backdrop-filter: blur(8px) saturate(160%) !important;
  border: 1px solid rgba(255, 255, 255, 0.08) !important;
  border-radius: var(--radius-lg);
  box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.3) !important;
  will-change: transform, opacity;
}

.glass-card-premium {
  background: rgba(255, 255, 255, 0.03) !important;
  backdrop-filter: blur(12px) saturate(180%) !important;
  -webkit-backdrop-filter: blur(12px) saturate(180%) !important;
  border: 1px solid rgba(255, 255, 255, 0.1) !important;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2) !important;
  transition: all 0.3s cubic-bezier(0.2, 0.8, 0.2, 1) !important;
  will-change: transform;
}

.glass-hover:hover, .glass-card-premium:hover {
  transform: translateY(-4px);
  border-color: var(--accent);
  background: rgba(255, 255, 255, 0.06) !important;
  box-shadow: 0 12px 48px rgba(0, 0, 0, 0.6), 0 0 20px var(--accent-glow);
}

/* --- CLUSTER & MAP NEON ANIMATIONS --- */
@keyframes cluster-pulse-low {

  0%,
  100% {
    transform: scale(1);
    box-shadow: 0 0 10px var(--green-glow);
  }

  50% {
    transform: scale(1.05);
    box-shadow: 0 0 20px var(--green-glow);
  }
}

@keyframes cluster-pulse-medium {

  0%,
  100% {
    transform: scale(1);
    box-shadow: 0 0 15px var(--orange-glow);
  }

  50% {
    transform: scale(1.1);
    box-shadow: 0 0 30px var(--orange-glow);
  }
}

@keyframes cluster-pulse-high {

  0%,
  100% {
    transform: scale(1);
    box-shadow: 0 0 20px var(--red-glow);
    opacity: 0.9;
  }

  50% {
    transform: scale(1.15);
    box-shadow: 0 0 40px var(--red-glow);
    opacity: 1;
  }
}

@keyframes cluster-blink-critical {

  0%,
  100% {
    opacity: 1;
    filter: brightness(1.2) drop-shadow(0 0 10px var(--red));
  }

  50% {
    opacity: 0.7;
    filter: brightness(1.8) drop-shadow(0 0 25px var(--red));
    transform: scale(1.2);
  }
}

.cluster-pulse-low {
  animation: cluster-pulse-low 2s infinite ease-in-out;
}

.cluster-pulse-medium {
  animation: cluster-pulse-medium 1.2s infinite ease-in-out;
}

.cluster-pulse-high {
  animation: cluster-pulse-high 0.8s infinite ease-in-out;
}

.cluster-blink-critical {
  animation: cluster-blink-critical 0.4s infinite ease-in-out;
}

.cluster-pulse-low:hover {
  animation-duration: 1s;
}

.cluster-pulse-medium:hover {
  animation-duration: 0.6s;
}

.cluster-pulse-high:hover {
  animation-duration: 0.4s;
}

/* Exploding Effect Tokens */
.cluster-exploding {
  transform: scale(2) !important;
  opacity: 0 !important;
  transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

/* Slide-in Intelligence Panel */
.intel-panel {
  position: fixed;
  top: 0;
  right: -450px;
  width: 420px;
  height: 100vh;
  z-index: 10000;
  padding: 40px 24px;
  transition: right 0.6s cubic-bezier(0.2, 0.8, 0.2, 1);
  border-left: 1px solid var(--border);
  overflow-y: auto;
}

.intel-panel.open {
  right: 0;
}

@keyframes mapPulse {
  0% {
    transform: scale(1);
    opacity: 1;
    filter: brightness(1);
  }

  50% {
    transform: scale(1.3);
    opacity: 0.8;
    filter: brightness(1.5);
  }

  100% {
    transform: scale(1);
    opacity: 1;
    filter: brightness(1);
  }
}

/* --- RESET & BASE --- */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  background: var(--bg-primary);
  color: var(--text-primary);
  font-family: var(--font-main);
  line-height: 1.6;
  overflow-x: hidden;
  background-image:
    radial-gradient(circle at 10% 20%, rgba(99, 102, 241, 0.05) 0%, transparent 40%),
    radial-gradient(circle at 90% 80%, rgba(16, 185, 129, 0.05) 0%, transparent 40%);
  overscroll-behavior: none;
  /* Native momentum scrolling prevention for Lenis */
}

/* ── CINEMATIC LANDING ENGINE ────────────────────────── */
.home-bg {
  position: relative;
}

.home-bg::before {
  content: "";
  position: fixed;
  inset: 0;
  background: url('https://raw.githubusercontent.com/LIKITH-3012-MAC/PORTFOLIO-LIKITH/main/A_breathtaking_ultrawide_cinematic_landscape_photo_delpmaspu.png') no-repeat center center;
  background-size: cover;
  z-index: -2;
  transform: translate3d(0,0,0);
  will-change: transform;
  pointer-events: none;
}

.home-bg::after {
  content: "";
  position: fixed;
  inset: 0;
  background: rgba(2, 6, 23, 0.4);
  z-index: -1;
  pointer-events: none;
  transition: background 0.5s ease;
}

[data-theme="light"] .home-bg::after {
  background: rgba(255, 255, 255, 0.15);
}

/* --- GPU ACCELERATED HARDWARE TRICKS --- */
.gpu-accelerate {
  will-change: transform, opacity;
  transform: translate3d(0, 0, 0);
  /* Force GPU handling */
  -webkit-transform: translate3d(0, 0, 0);
  perspective: 1000px;
  -webkit-font-smoothing: subpixel-antialiased;
  backface-visibility: hidden;
}


@media (max-width: 768px) {
  .glass, .glass-premium, .glass-card-premium, .navbar, footer {
    backdrop-filter: blur(4px) saturate(120%) !important;
    -webkit-backdrop-filter: blur(4px) saturate(120%) !important;
    background: rgba(15, 23, 42, 0.9) !important; /* Higher opacity, less blur for mobile perf */
  }

  /* One-finger scroll fix: ensure map doesn't swallow body touch if not targeted */
  #map-container, #personal-map, #simulation-map {
    touch-action: pan-x pan-y !important;
  }

  .glass, .glass-premium, .glass-card-premium {
    padding: 1.25rem !important;
  }
  
  .section {
    padding: 2.5rem 0;
  }
  
  /* Remove 2-finger scroll requirement */
  * {
    -webkit-overflow-scrolling: touch !important;
  }
  
  body {
    overflow-y: auto !important;
    overscroll-behavior: auto !important;
  }
}

html.lenis {
  height: auto;
}

.lenis.lenis-smooth {
  scroll-behavior: auto !important;
}

.lenis.lenis-smooth [data-lenis-prevent] {
  overscroll-behavior: contain;
}

.lenis.lenis-stopped {
  overflow: hidden;
}

.lenis.lenis-scrolling iframe {
  pointer-events: none;
}

h1,
h2,
h3,
h4,
h5 {
  font-family: 'Inter', sans-serif;
  letter-spacing: -0.02em;
}

a {
  text-decoration: none;
  color: inherit;
  transition: var(--transition);
}

button {
  cursor: pointer;
  border: none;
  background: none;
  transition: var(--transition);
}

/* ── Typography ────────────────────────────────────────────── */
h1 {
  font-size: clamp(2.5rem, 5vw, 5rem);
  font-weight: 900;
  line-height: 1.05;
  letter-spacing: -0.03em;
}

h2 {
  font-size: clamp(1.75rem, 3vw, 3rem);
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.02em;
}

h3 {
  font-size: clamp(1.25rem, 2vw, 1.75rem);
  font-weight: 700;
}

h4 {
  font-size: 1.125rem;
  font-weight: 600;
}

/* ── Layout Utilities ──────────────────────────────────────── */
.container {
  width: 100%;
  max-width: var(--container);
  margin-left: auto;
  margin-right: auto;
  padding-left: 1.5rem;
  padding-right: 1.5rem;
}

@media (max-width: 640px) {
  .container {
    padding-left: 1rem;
    padding-right: 1rem;
  }
}

.flex { display: flex; }
.flex-col { display: flex; flex-direction: column; }
.flex-wrap { flex-wrap: wrap; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }

.grid {
  display: grid;
  gap: 1.5rem;
}

.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

@media (max-width: 1024px) {
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
  .grid-3, .grid-2 { grid-template-columns: 1fr; }
  .grid-4 { grid-template-columns: 1fr; }
}

.gap-4 { gap: 1rem; }
.gap-6 { gap: 1.5rem; }
.gap-8 { gap: 2rem; }

/* ── Navigation ────────────────────────────────────────────── */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  height: 72px;
  background: var(--glass);
  -webkit-backdrop-filter: blur(20px);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.05), 0 4px 6px -1px rgba(0, 0, 0, 0.5);
  transition: var(--transition);
}

.navbar.scrolled {
  background: rgba(255, 255, 255, 0.98);
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.1), 0 10px 15px -3px rgba(0, 0, 0, 0.5);
}

.navbar-inner {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 24px;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1.5rem;
  font-weight: 900;
  letter-spacing: -0.04em;
  color: var(--accent);
}

.nav-logo-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--accent), var(--blue-500));
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 1.1rem;
  box-shadow: 0 4px 12px rgba(30, 58, 138, 0.3);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 8px;
}

.nav-link {
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-secondary);
  transition: var(--transition);
}

.nav-link:hover,
.nav-link.active {
  color: var(--accent);
  background: var(--blue-50);
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* ── Elite Buttons ────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 12px 24px;
  border-radius: var(--radius-md);
  font-weight: 600;
  font-size: 0.95rem;
  transition: var(--transition);
  cursor: pointer;
  white-space: nowrap;
  position: relative;
  overflow: hidden;
}

.btn-primary {
  background: var(--accent-gradient);
  color: white;
  box-shadow: 0 4px 15px var(--accent-glow);
  border: none;
}

.btn-primary:hover {
  transform: translateY(-2px) scale(1.02);
  box-shadow: 0 8px 25px var(--accent-glow);
  filter: brightness(1.1);
}

.btn-primary:active {
  transform: translateY(0) scale(0.98);
}

.btn-outline {
  border: 1px solid var(--border);
  color: var(--text-primary);
  background: var(--glass);
}

.btn-outline:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--bg-tertiary);
}

.btn-ghost {
  color: var(--text-secondary);
}

.btn-ghost:hover {
  color: var(--accent);
  background: var(--blue-50);
}

.btn-danger {
  background: var(--red);
  color: white;
}

.btn-success {
  background: var(--green);
  color: white;
}

.btn-warning {
  background: var(--yellow);
  color: white;
}

.btn-lg {
  padding: 18px 36px;
  font-size: 1.1rem;
  border-radius: var(--radius-lg);
}

.btn-sm {
  padding: 8px 16px;
  font-size: 0.8rem;
  border-radius: var(--radius-sm);
}

.btn-xl {
  padding: 22px 48px;
  font-size: 1.2rem;
  font-weight: 700;
  border-radius: var(--radius-lg);
}

/* Ripple effect */
.btn::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(rgba(255, 255, 255, 0), rgba(255, 255, 255, 0.2));
  opacity: 0;
  transition: opacity 0.3s;
}

.btn:active::after {
  opacity: 1;
}

/* ── Cyber-Premium Cards ───────────────────────────────────── */
.card {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  transition: var(--transition);
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-md);
}

.card:hover {
  transform: translateY(-5px);
  border-color: var(--accent);
  box-shadow: var(--shadow-lg);
}

.card::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: radial-gradient(circle at top right, var(--accent-glow), transparent 70%);
  opacity: 0;
  transition: var(--transition);
  pointer-events: none;
}

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

.card-glass {
  background: var(--glass);
  -webkit-backdrop-filter: blur(20px);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.6);
}

/* ── Issue Card ────────────────────────────────────────────── */
.issue-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.05), 0 4px 6px -1px rgba(0, 0, 0, 0.5);
  transition: var(--transition);
  cursor: pointer;
  position: relative;
  overflow: hidden;

  /* Virtualization */
  content-visibility: auto;
  contain-intrinsic-size: 0 160px;
  /* approximates average card height to prevent scrollbar jumping */
}

.issue-card::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  background: var(--accent);
  border-radius: 0 2px 2px 0;
  transition: width 0.25s ease;
}

.issue-card:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-3px);
  border-color: var(--blue-100);
}

.issue-card:hover::before {
  width: 6px;
}

.issue-card.priority-critical::before {
  background: var(--red);
}

.issue-card.priority-high::before {
  background: var(--orange);
}

.issue-card.priority-medium::before {
  background: var(--yellow);
}

.issue-card.priority-low::before {
  background: var(--green);
}

/* ── Status Badges ─────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.badge-reported {
  background: var(--bg-tertiary);
  color: #475569;
}

.badge-verified {
  background: #e0f2fe;
  color: #0369a1;
}

.badge-clustered {
  background: #f3e8ff;
  color: #7c3aed;
}

.badge-assigned {
  background: #fef3c7;
  color: #92400e;
}

.badge-in_progress {
  background: #fff7ed;
  color: #c2410c;
}

.badge-escalated {
  background: #fee2e2;
  color: #b91c1c;
  animation: pulse 2s infinite;
}

.badge-resolved {
  background: #dcfce7;
  color: #15803d;
}

.badge-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}

/* ── Category Badges ────────────────────────────────────────── */
.cat-badge {
  padding: 3px 10px;
  border-radius: var(--radius-sm);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.cat-Roads {
  background: #fef3c7;
  color: #92400e;
}

.cat-Water {
  background: #e0f2fe;
  color: #0369a1;
}

.cat-Electricity {
  background: #fef9c3;
  color: #854d0e;
}

.cat-Sanitation {
  background: #fce7f3;
  color: #9d174d;
}

.cat-Safety {
  background: #fee2e2;
  color: #b91c1c;
}

.cat-Environment {
  background: #dcfce7;
  color: #15803d;
}

.cat-Other {
  background: var(--bg-tertiary);
  color: #475569;
}

/* ── Priority Score ─────────────────────────────────────────── */
.priority-score {
  font-size: 1.5rem;
  font-weight: 800;
  font-family: 'JetBrains Mono', monospace;
}

.priority-critical {
  color: var(--red);
}

.priority-high {
  color: var(--orange);
}

.priority-medium {
  color: var(--yellow);
}

.priority-low {
  color: var(--green);
}

.priority-bar {
  height: 6px;
  border-radius: 3px;
  background: var(--bg-tertiary);
  overflow: hidden;
}

.priority-bar-fill {
  height: 100%;
  border-radius: 3px;
  transition: width 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ── Forms ─────────────────────────────────────────────────── */
.form-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.form-label {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-primary);
}

.form-label span {
  color: var(--red);
  margin-left: 2px;
}

.form-input,
.form-select,
.form-textarea {
  width: 100%;
  padding: 13px 16px;
  border: 2px solid var(--border);
  border-radius: var(--radius-md);
  font-family: inherit;
  font-size: 0.95rem;
  color: var(--text-primary);
  background: var(--bg-secondary);
  transition: var(--transition);
  outline: none;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  border-color: var(--blue-500);
  box-shadow: 0 0 0 4px var(--accent-glow);
}

.form-input::placeholder {
  color: var(--text-muted);
}

.form-textarea {
  resize: vertical;
  min-height: 120px;
}

.form-select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' fill='%2394a3b8' viewBox='0 0 20 20'%3E%3Cpath d='M5 7l5 5 5-5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
}

/* Urgency Slider */
.slider-container {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.slider {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 6px;
  border-radius: 3px;
  background: var(--bg-tertiary);
  outline: none;
}

.slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--accent);
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(30, 58, 138, 0.4);
  transition: var(--transition);
}

.slider::-webkit-slider-thumb:hover {
  transform: scale(1.2);
}

.slider-labels {
  display: flex;
  justify-content: space-between;
  font-size: 0.75rem;
  color: var(--text-muted);
}

.slider-value {
  font-size: 1.5rem;
  font-weight: 800;
  font-family: 'JetBrains Mono', monospace;
  color: var(--accent);
}

/* ── Hero Section ───────────────────────────────────────────── */
.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  position: relative;
  overflow: hidden;
  background: radial-gradient(circle at top, var(--bg-tertiary) 0%, var(--bg-primary) 100%);
  padding-top: 72px;
}

.hero-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
  background:
    radial-gradient(ellipse 80% 60% at 60% 40%, rgba(59, 130, 246, 0.15) 0%, transparent 70%),
    radial-gradient(ellipse 60% 80% at 20% 70%, rgba(139, 92, 246, 0.1) 0%, transparent 60%);
}

.hero-grid {
  position: absolute;
  inset: 0;
  z-index: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
  background-size: 60px 60px;
}

.hero-content {
  position: relative;
  z-index: 1;
  max-width: var(--container);
  margin: 0 auto;
  padding: 80px 24px;
  width: 100%;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 18px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: rgba(255, 255, 255, 0.9);
  font-size: 0.85rem;
  font-weight: 500;
  margin-bottom: 32px;
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
}

.hero-badge-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--green);
  animation: pulse 2s infinite;
}

.hero h1 {
  color: white;
  margin-bottom: 24px;
  background: linear-gradient(135deg, #ffffff 0%, rgba(255, 255, 255, 0.85) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-tagline {
  font-size: clamp(2rem, 4vw, 3.5rem);
  font-weight: 900;
  color: var(--blue-400);
  margin-bottom: 8px;
  letter-spacing: -0.02em;
}

.hero-subtitle {
  font-size: 1.2rem;
  color: rgba(255, 255, 255, 0.7);
  max-width: 600px;
  line-height: 1.7;
  margin-bottom: 48px;
}

.hero-cta {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 80px;
}

.btn-hero {
  padding: 20px 44px;
  font-size: 1.12rem;
  font-weight: 700;
  border-radius: var(--radius-xl);
  background: linear-gradient(135deg, var(--blue-500), var(--blue-600));
  color: white;
  box-shadow: 0 8px 32px rgba(59, 130, 246, 0.4);
  transition: var(--transition-bounce);
}

.btn-hero:hover {
  transform: translateY(-4px) scale(1.02);
  box-shadow: 0 16px 48px rgba(59, 130, 246, 0.5);
}

.btn-hero-outline {
  padding: 20px 44px;
  font-size: 1.12rem;
  font-weight: 700;
  border-radius: var(--radius-xl);
  border: 2px solid rgba(255, 255, 255, 0.3);
  color: white;
  background: rgba(255, 255, 255, 0.05);
  transition: var(--transition);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
}

.btn-hero-outline:hover {
  border-color: rgba(255, 255, 255, 0.6);
  background: rgba(255, 255, 255, 0.1);
  transform: translateY(-2px);
}

/* ── Stats Counter Strip ────────────────────────────────────── */
.hero-stats {
  display: flex;
  gap: 48px;
  flex-wrap: wrap;
  padding-top: 48px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.stat-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.stat-number {
  font-size: 2.5rem;
  font-weight: 900;
  color: white;
  font-family: 'JetBrains Mono', monospace;
  letter-spacing: -0.04em;
}

.stat-label {
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.6);
  font-weight: 500;
}

/* ── Section Styles ─────────────────────────────────────────── */
.section {
  padding: 100px 0;
}

.section-header {
  margin-bottom: 64px;
}

.section-label {
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--blue-600);
  margin-bottom: 16px;
  padding: 6px 14px;
  border-radius: 999px;
  background: var(--blue-50);
  border: 1px solid var(--blue-100);
}

/* ── Timeline ───────────────────────────────────────────────── */
.timeline {
  position: relative;
  padding: 24px 0;
}

.timeline::before {
  content: '';
  position: absolute;
  left: 20px;
  top: 0;
  bottom: 0;
  width: 2px;
  background: linear-gradient(to bottom, var(--blue-500), var(--border));
}

.timeline-step {
  display: flex;
  gap: 20px;
  align-items: flex-start;
  margin-bottom: 32px;
  position: relative;
}

.timeline-dot {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  flex-shrink: 0;
  z-index: 1;
  background: var(--bg-secondary);
  border: 2px solid var(--border);
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.05), 0 4px 6px -1px rgba(0, 0, 0, 0.5);
  transition: var(--transition);
}

.timeline-dot.active {
  background: var(--accent);
  border-color: var(--accent);
  color: white;
  box-shadow: 0 0 0 4px var(--accent-glow);
}

.timeline-dot.completed {
  background: var(--green);
  border-color: var(--green);
  color: white;
}

.timeline-dot.escalated {
  background: var(--red);
  border-color: var(--red);
  color: white;
  animation: pulse 2s infinite;
}

.timeline-content {
  flex: 1;
}

.timeline-title {
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--text-primary);
}

.timeline-time {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 2px;
}

.timeline-note {
  margin-top: 8px;
  padding: 12px 16px;
  background: var(--bg-secondary);
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  color: var(--text-secondary);
  border-left: 3px solid var(--blue-500);
}

/* ── SLA / Resolution Timer ─────────────────────────────────── */
.resolution-timer {
  padding: 20px 24px;
  border-radius: var(--radius-lg);
  background: linear-gradient(135deg, var(--bg-tertiary), var(--bg-secondary));
  border: 1px solid var(--blue-100);
  display: flex;
  align-items: center;
  gap: 16px;
}

.timer-display {
  font-family: 'JetBrains Mono', monospace;
  font-size: 2rem;
  font-weight: 800;
  color: var(--accent);
  letter-spacing: -0.02em;
}

.timer-label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* Escalation warning */
.escalation-banner {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 20px;
  border-radius: var(--radius-md);
  background: #fff1f2;
  border: 1px solid #fecdca;
  color: #b91c1c;
  animation: pulse-border 2s infinite;
}

/* ── Metrics / Leaderboard ──────────────────────────────────── */
.metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 20px;
  margin-bottom: 40px;
}

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

.metric-card {
  padding: 24px;
  border-radius: var(--radius-lg);
  background: var(--bg-secondary);
  border: 1px solid var(--glass-border);
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.05), 0 4px 6px -1px rgba(0, 0, 0, 0.5);
  text-align: center;
}

.metric-value {
  font-size: 2.5rem;
  font-weight: 900;
  font-family: 'JetBrains Mono', monospace;
  color: var(--accent);
  letter-spacing: -0.04em;
  margin-bottom: 4px;
}

.metric-label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* Leaderboard Table */
.leaderboard-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--bg-secondary);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.1), 0 10px 15px -3px rgba(0, 0, 0, 0.5);
}

.leaderboard-table th {
  padding: 16px 20px;
  text-align: left;
  background: var(--bg-secondary);
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-bottom: 1px solid var(--border);
}

.leaderboard-table td {
  padding: 16px 20px;
  border-bottom: 1px solid var(--bg-secondary);
  font-size: 0.9rem;
  transition: var(--transition);
}

.leaderboard-table tr:hover td {
  background: var(--bg-secondary);
}

.leaderboard-table tr:last-child td {
  border-bottom: none;
}

.rank-badge {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  font-weight: 800;
}

.rank-1 {
  background: #fef9c3;
  color: #854d0e;
}

.rank-2 {
  background: var(--bg-tertiary);
  color: #475569;
}

.rank-3 {
  background: #fff7ed;
  color: #c2410c;
}

.rank-n {
  background: var(--bg-secondary);
  color: var(--text-muted);
}

/* Performance Bar */
.perf-bar {
  width: 100px;
  height: 8px;
  border-radius: 4px;
  background: var(--bg-tertiary);
  overflow: hidden;
}

.perf-bar-fill {
  height: 100%;
  border-radius: 4px;
  background: linear-gradient(90deg, var(--green), var(--accent));
  transition: width 1s ease;
}

/* ── Skeleton Loaders ───────────────────────────────────────── */
.skeleton {
  border-radius: var(--radius-md);
  background: linear-gradient(90deg, #f1f5f9 25%, #e2e8f0 50%, #f1f5f9 75%);
  background-size: 200% 100%;
  animation: skeleton-shimmer 1.5s infinite linear;
}

.skeleton-card {
  height: 220px;
  border-radius: var(--radius-lg);
  margin-bottom: 16px;
}

.skeleton-text {
  height: 14px;
  margin-bottom: 10px;
}

.skeleton-text.w-3-4 {
  width: 75%;
}

.skeleton-text.w-1-2 {
  width: 50%;
}

/* ── Map Container ──────────────────────────────────────────── */
#map {
  height: 320px;
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 2px solid var(--border);
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.1), 0 10px 15px -3px rgba(0, 0, 0, 0.5);
}

/* ── Modal ─────────────────────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 10000;
  background: rgba(15, 23, 42, 0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  opacity: 0;
  animation: fadeIn 0.3s ease forwards;
}

.modal-box {
  background: var(--bg-secondary);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 550px;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
  box-shadow: 0 30px 60px -12px rgba(0, 0, 0, 0.8);
  padding: clamp(1.5rem, 5vw, 3rem);
  animation: slideUp 0.3s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

@media (max-width: 480px) {
  .modal-overlay { padding: 0.75rem; }
  .modal-box { padding: 1.5rem; border-radius: var(--radius-md); }
}

/* ── Alerts ─────────────────────────────────────────────────── */
.alert {
  padding: 16px 20px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: flex-start;
  gap: 12px;
  font-size: 0.9rem;
  margin-bottom: 16px;
}

.alert-success {
  background: #dcfce7;
  color: #15803d;
  border: 1px solid #bbf7d0;
}

.alert-error {
  background: #fee2e2;
  color: #b91c1c;
  border: 1px solid #fecaca;
}

.alert-warning {
  background: #fef3c7;
  color: #92400e;
  border: 1px solid #fde68a;
}

.alert-info {
  background: #dbeafe;
  color: #1d4ed8;
  border: 1px solid #bfdbfe;
}

/* ── Filter/Sort Bar ────────────────────────────────────────── */
.filter-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  padding: 16px 20px;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  margin-bottom: 24px;
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.05), 0 4px 6px -1px rgba(0, 0, 0, 0.5);
}

.filter-btn {
  padding: 8px 16px;
  border-radius: var(--radius-md);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-secondary);
  border: 2px solid var(--border);
  background: var(--bg-secondary);
  transition: var(--transition);
  cursor: pointer;
}

.filter-btn:hover,
.filter-btn.active {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--blue-50);
}

.search-input {
  flex: 1;
  min-width: 200px;
  padding: 10px 16px;
  border: 2px solid var(--border);
  border-radius: var(--radius-md);
  font-family: inherit;
  font-size: 0.9rem;
  outline: none;
  transition: var(--transition);
}

.search-input:focus {
  border-color: var(--blue-500);
  box-shadow: 0 0 0 4px var(--accent-glow);
}

/* ── Page Header ────────────────────────────────────────────── */
.page-header {
  padding: 120px 0 60px;
  background: linear-gradient(135deg, var(--bg-secondary) 0%, var(--blue-50) 100%);
  border-bottom: 1px solid var(--border);
}

/* ── Footer ─────────────────────────────────────────────────── */
footer {
  background: var(--blue-900);
  color: rgba(255, 255, 255, 0.6);
  padding: 60px 0 40px;
  margin-top: 80px;
}

.footer-brand {
  font-size: 1.5rem;
  font-weight: 900;
  color: white;
  letter-spacing: -0.03em;
  margin-bottom: 8px;
}

.footer-tagline {
  font-size: 0.85rem;
  margin-bottom: 40px;
}

.footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding-top: 24px;
  margin-top: 40px;
  font-size: 0.8rem;
}

/* ── Auth Section ───────────────────────────────────────────── */
.auth-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  background: var(--bg-primary);
  padding: 80px 24px;
}

.auth-card {
  max-width: 440px;
  width: 100%;
  margin: 0 auto;
  background: var(--bg-secondary);
  border-radius: var(--radius-xl);
  padding: 48px;
  box-shadow: var(--shadow-xl);
}

/* ── Dashboard Layout ───────────────────────────────────────── */
.dashboard-layout {
  display: grid;
  grid-template-columns: 280px 1fr;
  min-height: 100vh;
  padding-top: 72px;
}

.sidebar {
  background: var(--bg-secondary);
  border-right: 1px solid var(--border);
  padding: 32px 16px;
  position: sticky;
  top: 72px;
  height: calc(100vh - 72px);
  overflow-y: auto;
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  border-radius: var(--radius-md);
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-secondary);
  transition: var(--transition);
}

.sidebar-link:hover,
.sidebar-link.active {
  color: var(--accent);
  background: var(--blue-50);
}

.sidebar-link svg {
  width: 18px;
  height: 18px;
}

.main-content {
  padding: 32px;
  overflow-x: hidden;
}

/* ── Urgency Indicator ──────────────────────────────────────── */
.urgency-dots {
  display: flex;
  gap: 4px;
}

.urgency-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--border);
}

.urgency-dot.filled {
  background: var(--accent);
}

/* ── Live Indicator ─────────────────────────────────────────── */
.live-indicator {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--green);
}

.live-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--green);
  animation: pulse 2s infinite;
}

/* ── Heatmap Placeholder ────────────────────────────────────── */
.heatmap-placeholder {
  height: 400px;
  border-radius: var(--radius-xl);
  background: linear-gradient(135deg, #0f172a 0%, #1e3a8a 50%, #1e293b 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 16px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  position: relative;
  overflow: hidden;
  color: white;
  text-align: center;
}

/* ── Animations ─────────────────────────────────────────────── */
@keyframes pulse {

  0%,
  100% {
    opacity: 1;
    transform: scale(1);
  }

  50% {
    opacity: 0.7;
    transform: scale(0.95);
  }
}

@keyframes pulse-border {

  0%,
  100% {
    box-shadow: 0 0 0 0 rgba(185, 28, 28, 0.2);
  }

  50% {
    box-shadow: 0 0 0 6px rgba(185, 28, 28, 0);
  }
}

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

  100% {
    background-position: -200% 0;
  }
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(20px) scale(0.96);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes countUp {
  from {
    opacity: 0;
    transform: translateY(10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes scoreFlash {
  0% {
    color: var(--blue-500);
  }

  50% {
    color: var(--red);
    transform: scale(1.1);
  }

  100% {
    color: inherit;
    transform: scale(1);
  }
}

.animate-in {
  opacity: 0;
  animation: slideUp 0.4s ease forwards;
}

/* ── Dividers ───────────────────────────────────────────────── */
.divider {
  height: 1px;
  background: var(--border);
  margin: 32px 0;
}

.divider-v {
  width: 1px;
  background: var(--border);
}

/* ── Chip / Tag ─────────────────────────────────────────────── */
.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 600;
  background: var(--bg-secondary);
  color: var(--text-secondary);
  border: 1px solid var(--border);
}

/* ── Empty State ────────────────────────────────────────────── */
.empty-state {
  text-align: center;
  padding: 80px 24px;
  color: var(--text-muted);
}

.empty-state-icon {
  font-size: 4rem;
  margin-bottom: 16px;
}

.empty-state h3 {
  font-size: 1.25rem;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

/* ── Toast Notification ─────────────────────────────────────── */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 9999;
}

.toast {
  padding: 16px 20px;
  border-radius: var(--radius-md);
  background: var(--blue-900);
  color: white;
  display: flex;
  align-items: center;
  gap: 12px;
  box-shadow: var(--shadow-lg);
  font-size: 0.9rem;
  font-weight: 500;
  animation: slideInRight 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  min-width: 280px;
  max-width: 400px;
}

@keyframes slideInRight {
  from {
    transform: translateX(110%);
    opacity: 0;
  }

  to {
    transform: translateX(0);
    opacity: 1;
  }
}

/* ── Responsive ─────────────────────────────────────────────── */
@media (max-width: 1024px) {
  .dashboard-layout {
    grid-template-columns: 1fr;
  }

  .sidebar {
    display: flex;
    flex-wrap: wrap;
    flex-direction: row;
    position: static;
    height: auto;
    width: 100%;
    margin-bottom: 24px;
    border-right: none;
    border-bottom: 1px solid var(--border);
    padding-bottom: 24px;
    gap: 16px;
  }

  .sidebar>div {
    flex: 1;
    min-width: 250px;
  }

  .admin-sidebar {
    display: none;
    /* Hide admin sidebar for now or handle via mobile menu later */
  }
}

@media (max-width: 768px) {
  .hero-stats {
    gap: 28px;
  }

  .hero-cta {
    flex-direction: column;
    max-width: 320px;
  }

  .btn-hero,
  .btn-hero-outline {
    text-align: center;
    width: 100%;
  }

  .grid-3 {
    grid-template-columns: 1fr;
  }

  .metrics-grid {
    grid-template-columns: 1fr;
  }

  h1 {
    font-size: clamp(2rem, 8vw, 2.5rem);
  }

  /* ── Mobile Navigation System ── */
  .mobile-menu-btn {
    display: block !important;
    background: none;
    border: none;
    font-size: 1.8rem;
    color: var(--text-primary);
    cursor: pointer;
    margin-left: auto;
    z-index: 1001;
  }

  .nav-links,
  .desktop-actions {
    display: none !important;
  }

  /* When menu is active */
  .navbar.mobile-menu-open {
    background: var(--bg-secondary);
  }

  .navbar.mobile-menu-open .nav-links,
  .navbar.mobile-menu-open .desktop-actions {
    display: flex !important;
    flex-direction: column;
    width: 100%;
    align-items: center !important;
    gap: 16px;
    padding: 16px;
  }

  .navbar.mobile-menu-open .navbar-inner {
    flex-direction: column;
    height: auto;
    background: var(--bg-secondary);
    position: absolute;
    top: 72px;
    left: 0;
    width: 100%;
    box-shadow: var(--shadow-lg);
    border-bottom: 2px solid var(--accent);
    padding-bottom: 24px;
    z-index: 1000;
  }

  .navbar.mobile-menu-open .desktop-actions {
    border-top: 1px solid var(--border);
    padding-top: 16px;
  }

  /* ── Mobile Layout Adjustments ── */
  .container {
    padding: 0 16px;
  }

  .page-header .flex {
    flex-direction: column;
    align-items: flex-start !important;
    gap: 16px;
  }

  /* ── Touch Optimization ── */
  .btn,
  .btn-primary,
  .btn-outline,
  .btn-ghost,
  .btn-sm {
    min-height: 44px;
    /* Apple UI Guideline */
  }

  /* ── Converting tables into mobile cards ── */
  .leaderboard-table,
  .leaderboard-table thead,
  .leaderboard-table tbody,
  .leaderboard-table th,
  .leaderboard-table td,
  .leaderboard-table tr {
    display: block;
  }

  .leaderboard-table thead tr {
    display: none;
    /* Hide headers */
  }

  .leaderboard-table tr {
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    margin-bottom: 16px;
    padding: 12px;
    background: var(--bg-secondary);
  }

  .leaderboard-table td {
    border: none !important;
    position: relative;
    padding: 8px 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.95rem;
  }

  .leaderboard-table td::before {
    content: attr(data-label);
    font-weight: bold;
    color: var(--text-muted);
    font-size: 0.8rem;
    text-transform: uppercase;
  }
}

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

  .auth-card {
    padding: 32px 24px;
  }

  .stat-number {
    font-size: 2rem;
  }
}

/* ── World-Class Navbar Enhancements ───────────────────────── */
.theme-toggle {
  background: var(--bg-tertiary);
  border: 1px solid var(--glass-border);
  color: var(--text-primary);
  width: 40px;
  height: 40px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  transition: var(--transition);
  margin: 0 10px;
  backdrop-filter: blur(8px);
}

/* ── Floating Theme Toggle ──────────────────────────────────── */
.floating-toggle {
  position: fixed;
  bottom: 30px;
  right: 30px;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-lg), 0 0 20px var(--accent-glow);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 2000;
  transition: var(--transition);
  font-size: 1.5rem;
  overflow: hidden;
}

.floating-toggle:hover {
  transform: scale(1.1) rotate(15deg);
  border-color: var(--accent);
}

.floating-toggle .icon-sun {
  display: none;
}

.floating-toggle .icon-moon {
  display: block;
}

.floating-toggle.light .icon-sun {
  display: block;
}

.floating-toggle.light .icon-moon {
  display: none;
}

.floating-toggle.light {
  background: white;
  color: #f59e0b;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

/* ── Backend Status Indicator ────────────────────────────────── */
.status-box {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  transition: var(--transition);
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.status-box.online {
  color: var(--green);
}

.status-box.waking {
  color: var(--yellow);
}

.status-box.offline {
  color: var(--red);
}

@keyframes pulse {
  0% {
    transform: scale(1);
    opacity: 1;
    box-shadow: 0 0 0 currentColor;
  }

  50% {
    transform: scale(1.4);
    opacity: 0.3;
    box-shadow: 0 0 10px currentColor;
  }

  100% {
    transform: scale(1);
    opacity: 1;
    box-shadow: 0 0 0 currentColor;
  }
}

/* Loading Spinner */
.loader-spinner {
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  border-top-color: #fff;
  animation: spin 0.8s linear infinite;
}

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

.nav-username {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0 8px;
  white-space: nowrap;
}

/* ── Elite Admin Portal Design System ───────────────────────── */
.admin-layout {
  display: flex;
  height: 100vh;
  background: #020617;
  color: #f8fafc;
  overflow: hidden;
}



.admin-sidebar {
  width: 280px;
  background: #0f172a;
  border-right: 1px solid rgba(255, 255, 255, 0.05);
  display: flex;
  flex-direction: column;
  padding: 24px 0;
  flex-shrink: 0;
  overflow-y: auto;
}

.admin-sidebar .logo {
  padding: 0 24px 32px;
  font-size: 1.4rem;
  font-weight: 900;
  color: #6366f1;
  letter-spacing: -0.04em;
}

.sidebar-link {
  padding: 12px 24px;
  font-size: 0.9rem;
  font-weight: 500;
  color: #94a3b8;
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  transition: all 0.2s;
  border-right: 3px solid transparent;
}

.sidebar-link:hover {
  background: rgba(99, 102, 241, 0.05);
  color: white;
}

.sidebar-link.active {
  background: rgba(99, 102, 241, 0.1);
  color: #818cf8;
  border-right-color: #6366f1;
  font-weight: 700;
}

.admin-main {
  flex: 1;
  padding: 40px;
  overflow-y: auto;
  position: relative;
  min-width: 0;
}

.admin-header {
  margin-bottom: 40px;
}

.admin-header h1 {
  font-size: 2rem;
  font-weight: 800;
  margin-bottom: 8px;
  color: white;
}

.admin-header p {
  color: #64748b;
  font-size: 0.95rem;
}

/* KPI Grid */
.ctrl-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
  margin-bottom: 40px;
}

.ctrl-card {
  background: #0f172a;
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 20px;
  padding: 24px;
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.4);
  transition: transform 0.3s;
}

.ctrl-card:hover {
  transform: translateY(-4px);
  border-color: rgba(99, 102, 241, 0.3);
}

.ctrl-val {
  font-size: 2.2rem;
  font-weight: 900;
  margin-bottom: 6px;
  font-family: 'JetBrains Mono', monospace;
}

.ctrl-lbl {
  font-size: 0.8rem;
  font-weight: 700;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* Panels */
.panel {
  background: #0f172a;
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 24px;
  padding: 32px;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.5);
  animation: panelIn 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

.panel h3 {
  margin-bottom: 24px;
  font-size: 1.25rem;
  font-weight: 800;
  color: white;
}

.panel.hidden {
  display: none;
}

@keyframes panelIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Heatmap container in admin */
#heatmap {
  height: 500px;
  border-radius: 20px;
  background: #020617;
}

/* Escalation Table */
.esc-table {
  width: 100%;
  border-collapse: collapse;
}

.esc-table th {
  text-align: left;
  padding: 16px;
  font-size: 0.75rem;
  font-weight: 800;
  text-transform: uppercase;
  color: #64748b;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.esc-table td {
  padding: 16px;
  font-size: 0.9rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.03);
  color: #e2e8f0;
}

/* Performance Rows */
.perf-row {
  display: flex;
  gap: 20px;
  align-items: center;
  padding: 24px;
  background: rgba(255, 255, 255, 0.02);
  border-radius: 16px;
  margin-bottom: 16px;
  border: 1px solid rgba(255, 255, 255, 0.03);
}

.perf-rank {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  font-weight: 900;
  flex-shrink: 0;
}

.perf-bar-wrap {
  flex: 1;
}

.perf-bar-bg {
  height: 8px;
  background: #1e293b;
  border-radius: 4px;
  margin-top: 12px;
  overflow: hidden;
}

.perf-bar-fill {
  height: 100%;
  border-radius: 4px;
  transition: width 1s ease;
}

/* Charts Placeholder */
#category-chart {
  margin-top: 32px;
}

/* Radar Overlay */
#radar-overlay {
  animation: radarFadeIn 0.4s ease;
}

@keyframes radarFadeIn {
  from { opacity: 0; transform: scale(1.05); }
  to { opacity: 1; transform: scale(1); }
}

/* Dashboard Layout Engine */
.dashboard-grid {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 2.5rem;
}

@media (max-width: 1024px) {
  .dashboard-grid {
    grid-template-columns: 1fr;
    gap: 2rem;
  }
}

/* ── Cyber-Responsive Engine & Safety Nets ────────────────── */
html, body {
  max-width: 100%;
  overflow-x: hidden;
  position: relative;
}

/* Responsive Table Engine */
.table-responsive {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin-bottom: 1.5rem;
  border-radius: var(--radius-md);
  background: var(--glass);
  border: 1px solid var(--glass-border);
}

.table-responsive::-webkit-scrollbar {
  height: 6px;
}

.table-responsive::-webkit-scrollbar-thumb {
  background: var(--accent);
  border-radius: 10px;
}

/* Mobile Alignment Fixes */
@media (max-width: 768px) {
  .perf-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
    padding: 16px;
  }
  
  .perf-rank { width: 40px; height: 40px; font-size: 1.2rem; }
}

/* Script Overrides */
body.script-devanagari { font-family: var(--font-hi), var(--font-main) !important; }
body.script-telugu     { font-family: var(--font-te), var(--font-main) !important; }
body.script-tamil      { font-family: var(--font-ta), var(--font-main) !important; }
body.script-bengali    { font-family: var(--font-bn), var(--font-main) !important; }
body.script-kannada    { font-family: var(--font-kn), var(--font-main) !important; }
body.script-malayalam  { font-family: var(--font-ml), var(--font-main) !important; }
body.script-gujarati   { font-family: var(--font-gu), var(--font-main) !important; }
body.script-gurmukhi   { font-family: var(--font-pa), var(--font-main) !important; }

/* ================================================================
   MOBILE SCROLL PERFORMANCE ENGINE
   Backbone fix for smooth touch scrolling across all devices.
   ================================================================ */

/* Native momentum scroll */
html {
  -webkit-overflow-scrolling: touch;
  scroll-behavior: smooth;
}

body {
  -webkit-overflow-scrolling: touch;
}

/* ── On mobile: disable GPU-expensive backdrop-filter (biggest perf win) ── */
@media (max-width: 768px) {
  /* Replace blur-glass with solid fallback — visually similar, zero GPU cost */
  .glass,
  .glass-premium,
  .glass-card-premium,
  .glass-hover,
  .modal-box,
  #navbar {
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    background: rgba(15, 23, 42, 0.92) !important;
  }

  /* Pause expensive cluster animations during scroll (re-enabled on idle) */
  .cluster-pulse-low,
  .cluster-pulse-medium,
  .cluster-pulse-high,
  .cluster-blink-critical {
    animation-play-state: paused;
  }

  /* Prevent fixed-position home background from compositing constantly */
  .home-bg::before {
    position: absolute !important;
    background-attachment: scroll;
  }

  /* Contain layout for issue cards — prevents paint storms */
  .issue-card-v2, .glass-card-premium {
    contain: layout style;
    content-visibility: auto;
    contain-intrinsic-size: 0 180px;
  }

  /* Remove box-shadow depth stacking on mobile */
  .panel,
  .ctrl-card,
  .glass-card-premium {
    box-shadow: 0 2px 8px rgba(0,0,0,0.3) !important;
  }

  /* Simplify hover transforms — eliminate jank */
  .glass-card-premium:hover,
  .ctrl-card:hover,
  .issue-card-v2:hover {
    transform: none !important;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3) !important;
  }

  /* Auth modal scrollable on small screens */
  .modal-overlay {
    align-items: flex-start !important;
    padding-top: 20px;
    overflow-y: auto !important;
  }

  .modal-box {
    max-height: unset !important;
    overflow-y: visible !important;
    margin-bottom: 20px;
  }
}

/* ── Respect system preference for reduced motion ──────────────── */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}

/* ── Scrollbar styling ───────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--accent); border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: #818cf8; }

/* ================================================================
   STABLE SELECTION & PERFORMANCE HARDENING
   ================================================================ */

.active-selection-glow {
  border-color: var(--accent) !important;
  box-shadow: 0 0 30px var(--accent-glow), inset 0 0 10px var(--accent-glow) !important;
  background: rgba(99,102,241,0.08) !important;
  transform: translateY(-4px) scale(1.01) !important;
  z-index: 10;
}

/* Card Containment for high-performance scrolling */
.issue-card-v2 {
  contain: layout paint !important;
  content-visibility: auto;
  will-change: transform, opacity;
}

/* --- MOBILE OPTIMIZATION OVERRIDES --- */
@media (max-width: 768px) {
  /* Reduce expensive blur/shadow for 60fps scrolling */
  .glass, .glass-premium, .glass-card-premium {
    backdrop-filter: blur(6px) !important;
    -webkit-backdrop-filter: blur(6px) !important;
    box-shadow: 0 4px 12px rgba(0,0,0,0.5) !important;
  }
  
  .active-selection-glow {
    box-shadow: 0 0 15px var(--accent-glow) !important;
    animation: none !important; /* Save CPU */
  }

  /* GPU optimization */
  .gpu-accelerate {
    perspective: none !important;
    backface-visibility: hidden;
  }

  /* Fix nested scroll containers */
  .detail-drawer .drawer-body {
    -webkit-overflow-scrolling: touch;
  }
  
  /* Tap Target Optimization */
  .btn, .filter-btn, .nav-link {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
  }

  /* Remove heavy animations */
  .pulse-critical, .badge-escalated {
    animation-duration: 2s !important;
  }
}

/* ── Resolution Hub Refined Engineering ── */
#resolution-hub-drawer .evidence-tag {
    position: absolute;
    top: 8px;
    left: 8px;
    background: rgba(15, 23, 42, 0.85);
    color: white;
    font-size: 0.6rem;
    font-weight: 800;
    padding: 3px 6px;
    border-radius: var(--radius-sm);
    text-transform: uppercase;
    backdrop-filter: blur(4px);
    border: 1px solid rgba(255,255,255,0.1);
    letter-spacing: 0.05em;
    z-index: 2;
}

#resolution-hub-drawer .hub-select {
    width: 100%;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 10px 14px;
    color: var(--text-primary);
    font-size: 0.85rem;
    outline: none;
    transition: var(--transition);
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' fill='%2394a3b8' viewBox='0 0 20 20'%3E%3Cpath d='M5 7l5 5 5-5'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
}

#resolution-hub-drawer .hub-select:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-glow);
}

#resolution-hub-drawer .evidence-item {
    position: relative;
    border: 1px solid var(--border);
    transition: transform 0.2s ease;
}

#resolution-hub-drawer .evidence-item:hover {
    transform: scale(1.02);
}
