/* ==========================================================================
   SELANGOR DISASTER ANALYTICS & SITUATION HUB (SEDASH)
   VERSION 3.0 - WORLD-CLASS UI/UX, MOBILE PERFECTION & PUSH NOTIFICATIONS
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700;800;900&family=Inter:wght@300;400;500;600;700&family=JetBrains+Mono:wght@400;500;600;700&display=swap');

/* ==========================================================================
   DESIGN TOKENS & COLOR PALETTE
   ========================================================================== */

:root {
  /* Premium Dark Palette */
  --bg-primary: #0a0e1a;
  --bg-secondary: #111827;
  --bg-card: rgba(17, 24, 39, 0.85);
  --bg-card-hover: rgba(30, 41, 59, 0.95);
  --bg-glass: rgba(255, 255, 255, 0.04);
  --border-subtle: rgba(255, 255, 255, 0.1);
  --border-hover: rgba(59, 130, 246, 0.4);
  --border-highlight: rgba(14, 165, 233, 0.5);

  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;

  /* State & Theme Accents */
  --accent-blue: #38bdf8;
  --accent-blue-deep: #0284c7;
  --accent-cyan: #06b6d4;
  --accent-emerald: #10b981;
  --accent-amber: #f59e0b;
  --accent-rose: #f43f5e;
  --accent-purple: #8b5cf6;
  --accent-indigo: #6366f1;

  /* Disaster Specific Colors */
  --color-flood: #0ea5e9;
  --color-flashflood: #38bdf8;
  --color-fire: #f97316;
  --color-forestfire: #ef4444;
  --color-storm: #eab308;
  --color-landslide: #b45309;
  --color-hazmat: #a855f7;

  /* Elevation & Shadows */
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.2);
  --shadow-md: 0 4px 14px rgba(0, 0, 0, 0.35);
  --shadow-lg: 0 12px 32px rgba(0, 0, 0, 0.5);
  --shadow-glow-blue: 0 0 25px rgba(14, 165, 233, 0.35);
  --shadow-glow-cyan: 0 0 25px rgba(6, 182, 212, 0.35);
  --shadow-glow-rose: 0 0 25px rgba(244, 63, 94, 0.35);

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;
  --radius-full: 9999px;

  --transition-fast: 0.15s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-normal: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Light Theme Variables */
[data-theme="light"] {
  --bg-primary: #f1f5f9;
  --bg-secondary: #ffffff;
  --bg-card: #ffffff;
  --bg-card-hover: #f8fafc;
  --bg-glass: rgba(0, 0, 0, 0.03);
  --border-subtle: #cbd5e1;
  --border-hover: #94a3b8;
  --border-highlight: rgba(14, 165, 233, 0.6);

  --text-primary: #0f172a;
  --text-secondary: #334155;
  --text-muted: #64748b;

  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.08);
  --shadow-md: 0 4px 14px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 12px 32px rgba(0, 0, 0, 0.12);
  --shadow-glow-blue: 0 0 20px rgba(14, 165, 233, 0.2);
}

/* Global Reset & Base */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
  max-width: 100vw;
  width: 100%;
  overflow-x: hidden;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background-color: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.5;
  min-height: 100vh;
  max-width: 100vw;
  width: 100%;
  overflow-x: hidden !important;
  position: relative;
  background-image: 
    radial-gradient(circle at 10% 15%, rgba(14, 165, 233, 0.06) 0%, transparent 45%),
    radial-gradient(circle at 90% 85%, rgba(244, 63, 94, 0.05) 0%, transparent 45%);
  background-attachment: fixed;
  padding-bottom: 72px; /* Space for Mobile Bottom Nav on small screens */
}

@media (min-width: 769px) {
  body {
    padding-bottom: 0;
  }
}

h1, h2, h3, h4, h5, h6 {
  font-family: 'Outfit', sans-serif;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.02em;
}

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

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

/* ==========================================================================
   APP CONTAINER & TOP NAVBAR
   ========================================================================== */

.app-container {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  width: 100%;
  max-width: 100vw;
  overflow-x: hidden;
}

.top-navbar {
  position: sticky;
  top: 0;
  z-index: 1000;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  background: rgba(10, 14, 26, 0.88);
  border-bottom: 1px solid var(--border-subtle);
  padding: 0.65rem 1.25rem;
  transition: all var(--transition-normal);
}

[data-theme="light"] .top-navbar {
  background: rgba(255, 255, 255, 0.92);
  border-bottom-color: #cbd5e1;
}

.nav-content {
  max-width: 1680px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.brand-section {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-shrink: 0;
}

.brand-logo {
  width: 42px;
  height: 42px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border: 1.5px solid rgba(56, 189, 248, 0.5);
  box-shadow: 0 4px 16px rgba(14, 165, 233, 0.4);
  flex-shrink: 0;
  transition: transform var(--transition-fast), box-shadow var(--transition-fast);
  background: var(--bg-card);
}

.brand-logo:hover {
  transform: scale(1.05);
  box-shadow: 0 6px 22px rgba(56, 189, 248, 0.6);
}

.brand-logo-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.jarvis-avatar-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: var(--radius-md);
  display: block;
}

.brand-text h1 {
  font-size: 1.15rem;
  line-height: 1.2;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 800;
}

.brand-text p {
  font-size: 0.74rem;
  color: var(--text-secondary);
  font-weight: 500;
  line-height: 1.2;
}

.badge-live {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.15rem 0.5rem;
  font-size: 0.62rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  background: rgba(14, 165, 233, 0.15);
  color: #38bdf8;
  border: 1px solid rgba(14, 165, 233, 0.35);
  border-radius: var(--radius-full);
}

.badge-live::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #38bdf8;
  box-shadow: 0 0 8px #38bdf8;
  animation: pulse 1.5s infinite;
}

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

.nav-actions {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  flex-shrink: 0;
  flex-wrap: nowrap;
}

/* Common Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  padding: 0.42rem 0.72rem;
  font-size: 0.8rem;
  font-weight: 600;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--transition-fast);
  border: 1px solid transparent;
  white-space: nowrap;
  min-height: 36px;
}

.btn:active {
  transform: scale(0.97);
}

.btn-primary {
  background: linear-gradient(135deg, #0284c7, #026ca3);
  color: white;
  box-shadow: 0 3px 12px rgba(2, 132, 199, 0.35);
}

.btn-primary:hover {
  background: linear-gradient(135deg, #0369a1, #075985);
  box-shadow: 0 4px 16px rgba(2, 132, 199, 0.5);
  transform: translateY(-1px);
}

.btn-secondary {
  background: var(--bg-card);
  color: var(--text-primary);
  border: 1px solid var(--border-subtle);
}

.btn-secondary:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-hover);
  color: var(--accent-blue);
}

.btn-icon-only {
  width: 38px;
  height: 38px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* Notification Bell */
.btn-notification-bell {
  position: relative;
  border-radius: var(--radius-md);
  color: var(--text-primary);
}

.notif-pulse-dot {
  position: absolute;
  top: 5px;
  right: 5px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #f59e0b;
  box-shadow: 0 0 8px #f59e0b;
}

/* View Switcher Button in Navbar */
.btn-switch-view {
  background: linear-gradient(135deg, rgba(2, 132, 199, 0.15), rgba(6, 182, 212, 0.15));
  border: 1px solid rgba(6, 182, 212, 0.4);
  color: var(--accent-cyan);
  font-weight: 700;
  box-shadow: 0 2px 8px rgba(6, 182, 212, 0.2);
}

.btn-switch-view:hover {
  background: linear-gradient(135deg, rgba(2, 132, 199, 0.3), rgba(6, 182, 212, 0.3));
  border-color: #38bdf8;
  color: #fff;
  transform: translateY(-1px);
}

/* Navbar JARVIS Button (Desktop only) */
.btn-jarvis {
  background: linear-gradient(135deg, #0284c7 0%, #06b6d4 100%);
  color: #ffffff;
  position: relative;
  overflow: hidden;
  box-shadow: 0 0 15px rgba(6, 182, 212, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.25);
  font-weight: 700;
}

.btn-jarvis:hover {
  box-shadow: 0 0 25px rgba(6, 182, 212, 0.7);
  transform: translateY(-1px);
}

.jarvis-pulse-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #a5f3fc;
  box-shadow: 0 0 8px #a5f3fc;
  display: inline-block;
  animation: pulse 1.2s infinite;
}

/* Theme & Language Dropdowns */
.theme-selector-dropdown,
.lang-selector-dropdown {
  position: relative;
}

.btn-theme-trigger {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.42rem 0.65rem;
  font-size: 0.78rem;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.btn-theme-trigger:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-hover);
}

.chevron-icon {
  font-size: 0.62rem;
  opacity: 0.7;
  transition: transform 0.2s ease;
}

.theme-selector-dropdown.open .chevron-icon,
.lang-selector-dropdown.open .chevron-icon {
  transform: rotate(180deg);
}

.theme-menu-popover {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  width: 220px;
  background: rgba(15, 23, 42, 0.96);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 0.4rem;
  display: none;
  flex-direction: column;
  gap: 0.25rem;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  z-index: 1050;
  animation: fadeIn 0.15s ease;
}

[data-theme="light"] .theme-menu-popover {
  background: rgba(255, 255, 255, 0.96);
  border-color: #cbd5e1;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.12);
}

.theme-selector-dropdown.open .theme-menu-popover,
.lang-selector-dropdown.open .theme-menu-popover {
  display: flex;
}

.theme-opt-btn {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.45rem 0.6rem;
  border-radius: var(--radius-sm);
  background: transparent;
  border: none;
  color: var(--text-primary);
  cursor: pointer;
  text-align: left;
  width: 100%;
  transition: background 0.15s ease;
}

.theme-opt-btn:hover {
  background: var(--bg-card-hover);
}

.theme-opt-text strong {
  display: block;
  font-size: 0.76rem;
}

.theme-opt-text small {
  display: block;
  font-size: 0.64rem;
  color: var(--text-muted);
}

.check-mark {
  margin-left: auto;
  font-size: 0.72rem;
  color: var(--accent-emerald);
  display: none;
}

.theme-opt-btn.active .check-mark {
  display: inline-block;
}

/* Toast Notification */
.sedash-toast {
  position: fixed;
  top: 65px;
  left: 50%;
  transform: translateX(-50%) translateY(-25px);
  background: rgba(10, 14, 26, 0.96);
  border: 1px solid var(--accent-cyan);
  color: #fff;
  padding: 0.75rem 1.25rem;
  border-radius: var(--radius-lg);
  font-size: 0.82rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.65rem;
  box-shadow: 0 12px 35px rgba(0, 0, 0, 0.6);
  z-index: 3000;
  opacity: 0;
  pointer-events: none;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  max-width: 90vw;
  text-align: center;
}

.sedash-toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
  pointer-events: auto;
}

[data-theme="light"] .sedash-toast {
  background: #ffffff;
  color: #0f172a;
  border-color: #0284c7;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
}

/* Real-time Ticker Bar */
.ticker-bar {
  background: rgba(15, 23, 42, 0.92);
  border-bottom: 1px solid var(--border-subtle);
  padding: 0.45rem 1.25rem;
  font-size: 0.76rem;
  color: var(--text-secondary);
}

[data-theme="light"] .ticker-bar {
  background: #e2e8f0;
  border-bottom-color: #cbd5e1;
}

.ticker-content {
  max-width: 1680px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.ticker-items {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  flex-wrap: wrap;
}

.ticker-item {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.ticker-item strong {
  color: var(--text-primary);
}

/* ==========================================================================
   VIEW SWITCHING SYSTEM
   ========================================================================== */

.view-section {
  display: none;
  width: 100%;
}

.view-section.active {
  display: block;
  animation: fadeInView 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

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

/* ==========================================================================
   VIEW 1: PORTAL AWAM RAKYAT (CITIZEN LANDING PAGE)
   ========================================================================== */

.citizen-hero {
  padding: clamp(2rem, 5vw, 4rem) 1.25rem clamp(2rem, 4vw, 3rem);
  text-align: center;
  background: radial-gradient(circle at 50% 0%, rgba(14, 165, 233, 0.15) 0%, transparent 65%),
              linear-gradient(180deg, var(--bg-primary) 0%, var(--bg-secondary) 100%);
  border-bottom: 1px solid var(--border-subtle);
  margin-bottom: 2.5rem;
  position: relative;
}

[data-theme="light"] .citizen-hero {
  background: radial-gradient(circle at 50% 0%, rgba(14, 165, 233, 0.1) 0%, transparent 65%),
              linear-gradient(180deg, #ffffff 0%, #f1f5f9 100%);
  border-bottom-color: #cbd5e1;
}

.citizen-hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.4rem 1.1rem;
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(16, 185, 129, 0.35);
  border-radius: var(--radius-full);
  font-size: clamp(0.7rem, 2vw, 0.78rem);
  font-weight: 700;
  color: #34d399;
  letter-spacing: 0.05em;
  margin-bottom: 1.25rem;
}

[data-theme="light"] .citizen-hero-badge {
  background: #ecfdf5;
  border-color: #a7f3d0;
  color: #059669;
}

.pulse-beacon {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 10px #10b981;
  animation: beaconPulse 1.5s infinite;
}

@keyframes beaconPulse {
  0% { transform: scale(0.85); opacity: 1; }
  50% { transform: scale(1.4); opacity: 0.5; }
  100% { transform: scale(0.85); opacity: 1; }
}

.citizen-hero h2 {
  font-family: 'Outfit', sans-serif;
  font-size: clamp(1.6rem, 4vw, 2.6rem);
  font-weight: 800;
  line-height: 1.2;
  color: var(--text-primary);
  max-width: 850px;
  margin: 0 auto 1rem;
}

.citizen-hero-desc {
  font-size: clamp(0.88rem, 2vw, 1.05rem);
  color: var(--text-secondary);
  max-width: 720px;
  margin: 0 auto 2rem;
  line-height: 1.6;
}

.citizen-hero-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.85rem;
  flex-wrap: wrap;
  margin-bottom: 2.5rem;
}

.btn-hero-lg {
  padding: 0.75rem 1.4rem;
  font-size: 0.9rem;
  font-weight: 600;
  border-radius: var(--radius-md);
  min-height: 44px;
}

/* Quick Status Grid */
.citizen-quick-status-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1rem;
  max-width: 1150px;
  margin: 0 auto;
  text-align: left;
}

.c-stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 1.15rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: var(--shadow-sm);
  transition: all var(--transition-normal);
}

[data-theme="light"] .c-stat-card {
  background: #ffffff;
  border-color: #cbd5e1;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.05);
}

.c-stat-card:hover {
  transform: translateY(-2px);
  border-color: var(--border-hover);
  box-shadow: var(--shadow-md);
}

.c-stat-icon {
  width: 46px;
  height: 46px;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  flex-shrink: 0;
}

[data-theme="light"] .c-stat-icon {
  background: #f8fafc;
  border-color: #e2e8f0;
}

.c-stat-title {
  font-size: 0.75rem;
  color: var(--text-secondary);
  font-weight: 600;
}

.c-stat-val {
  font-size: 1rem;
  font-weight: 800;
  color: var(--text-primary);
  line-height: 1.3;
}

.c-stat-card small {
  font-size: 0.7rem;
  color: var(--text-muted);
}

/* Citizen Sections Common */
.citizen-section {
  max-width: 1150px;
  margin: 0 auto 3rem;
  padding: 0 1.25rem;
}

.section-title-box {
  text-align: center;
  margin-bottom: 2rem;
}

.section-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.3rem 0.85rem;
  background: rgba(14, 165, 233, 0.12);
  border: 1px solid rgba(14, 165, 233, 0.3);
  border-radius: var(--radius-full);
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--accent-blue);
  letter-spacing: 0.05em;
  margin-bottom: 0.6rem;
}

.section-badge.badge-red {
  background: rgba(239, 68, 68, 0.12);
  border-color: rgba(239, 68, 68, 0.3);
  color: #f87171;
}

.section-title-box h3 {
  font-family: 'Outfit', sans-serif;
  font-size: clamp(1.35rem, 3vw, 1.8rem);
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
}

.section-title-box p {
  font-size: 0.88rem;
  color: var(--text-secondary);
  max-width: 650px;
  margin: 0 auto;
  line-height: 1.55;
}

/* District Checker Card */
.district-checker-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  padding: clamp(1.25rem, 3vw, 2rem);
  box-shadow: var(--shadow-md);
}

[data-theme="light"] .district-checker-card {
  background: #ffffff;
  border-color: #cbd5e1;
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.06);
}

.checker-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid var(--border-subtle);
  flex-wrap: wrap;
}

[data-theme="light"] .checker-header {
  border-bottom-color: #e2e8f0;
}

.checker-header label {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.select-lg {
  padding: 0.65rem 1.2rem;
  font-size: 0.9rem;
  min-width: 280px;
  font-weight: 600;
  min-height: 44px;
}

.checker-result-box {
  padding-top: 1.5rem;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
}

.chk-status-col {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.chk-risk-pill {
  padding: 0.9rem 1.25rem;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.85rem;
}

.chk-risk-pill.high {
  background: rgba(239, 68, 68, 0.12);
  border: 1px solid rgba(239, 68, 68, 0.35);
  color: #fca5a5;
}

.chk-risk-pill.med {
  background: rgba(245, 158, 11, 0.12);
  border: 1px solid rgba(245, 158, 11, 0.35);
  color: #fcd34d;
}

.chk-risk-pill.normal {
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(16, 185, 129, 0.35);
  color: #6ee7b7;
}

.chk-stat-item {
  background: var(--bg-secondary);
  padding: 1rem 1.15rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
}

[data-theme="light"] .chk-stat-item {
  background: #f8fafc;
  border-color: #e2e8f0;
}

.chk-stat-item h4 {
  font-size: 0.8rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 0.35rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.chk-stat-item p {
  font-size: 0.86rem;
  color: var(--text-primary);
  line-height: 1.45;
}

.chk-pps-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  max-height: 220px;
  overflow-y: auto;
}

.chk-pps-item {
  background: var(--bg-card);
  padding: 0.6rem 0.85rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.78rem;
}

/* SOS Hotlines */
.hotline-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.25rem;
}

.hotline-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  padding: 1.4rem;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  color: inherit;
  transition: all var(--transition-normal);
  position: relative;
  box-shadow: var(--shadow-sm);
}

[data-theme="light"] .hotline-card {
  background: #ffffff;
  border-color: #cbd5e1;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.05);
}

.hotline-card:hover {
  transform: translateY(-3px);
  border-color: var(--accent-blue);
  box-shadow: var(--shadow-md);
}

.hotline-card.hotline-main {
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.15), rgba(220, 38, 38, 0.05));
  border-color: rgba(239, 68, 68, 0.4);
}

[data-theme="light"] .hotline-card.hotline-main {
  background: linear-gradient(135deg, #fef2f2 0%, #fee2e2 100%);
  border-color: #fca5a5;
}

.hotline-icon {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: rgba(239, 68, 68, 0.15);
  color: #ef4444;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
}

.hotline-agency {
  font-size: 0.8rem;
  color: var(--text-secondary);
  font-weight: 600;
}

.hotline-num {
  font-family: 'JetBrains Mono', monospace;
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--text-primary);
}

.hotline-card.hotline-main .hotline-num {
  color: #ef4444;
  font-size: 1.8rem;
}

.hotline-desc {
  font-size: 0.72rem;
  color: var(--text-muted);
}

.hotline-call-btn {
  display: inline-block;
  text-align: center;
  padding: 0.5rem 0.85rem;
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--accent-blue);
  margin-top: auto;
  transition: all var(--transition-fast);
}

.hotline-card:hover .hotline-call-btn {
  background: #0284c7;
  color: #fff;
  border-color: #0284c7;
}

/* Safety Guides */
.guide-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 1.25rem;
}

.guide-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  transition: all var(--transition-normal);
}

[data-theme="light"] .guide-card {
  background: #ffffff;
  border-color: #cbd5e1;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.05);
}

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

.guide-step {
  font-family: 'Outfit', sans-serif;
  font-size: 1.8rem;
  font-weight: 800;
  color: rgba(255, 255, 255, 0.12);
  line-height: 1;
}

[data-theme="light"] .guide-step {
  color: rgba(0, 0, 0, 0.12);
}

.guide-icon {
  font-size: 1.7rem;
}

.guide-card h4 {
  font-size: 0.95rem;
  font-weight: 700;
}

.guide-card p {
  font-size: 0.82rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

/* Citizen AI Banner */
.citizen-ai-banner {
  max-width: 1150px;
  margin: 0 auto 3rem;
  padding: 0 1.25rem;
}

.ai-banner-content {
  background: linear-gradient(135deg, rgba(2, 132, 199, 0.18) 0%, rgba(6, 182, 212, 0.1) 100%);
  border: 1px solid rgba(6, 182, 212, 0.35);
  border-radius: var(--radius-xl);
  padding: 2rem;
  display: flex;
  align-items: center;
  gap: 1.75rem;
  box-shadow: 0 15px 40px rgba(0, 0, 0, 0.2);
}

[data-theme="light"] .ai-banner-content {
  background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
  border-color: #7dd3fc;
  box-shadow: 0 6px 20px rgba(14, 165, 233, 0.1);
}

.ai-banner-avatar {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: linear-gradient(135deg, #0284c7, #06b6d4);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.8rem;
  flex-shrink: 0;
  box-shadow: 0 0 20px rgba(6, 182, 212, 0.5);
}

.ai-banner-text {
  flex: 1;
}

.ai-banner-text h3 {
  font-size: 1.25rem;
  font-weight: 800;
  margin-bottom: 0.4rem;
}

.ai-banner-text p {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-bottom: 0.85rem;
  line-height: 1.45;
}

.ai-banner-prompts {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

/* Admin Access Card */
.admin-access-card {
  background: var(--bg-card);
  border: 1px dashed var(--border-subtle);
  border-radius: var(--radius-xl);
  padding: 1.5rem 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  flex-wrap: wrap;
}

[data-theme="light"] .admin-access-card {
  background: #ffffff;
  border: 1px dashed #94a3b8;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.04);
}

.admin-access-left {
  display: flex;
  align-items: center;
  gap: 1.25rem;
}

.admin-access-left i {
  font-size: 1.8rem;
}

.admin-access-left h4 {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 0.25rem;
}

.admin-access-left p {
  font-size: 0.8rem;
  color: var(--text-secondary);
  max-width: 600px;
}

/* ==========================================================================
   VIEW 2: PAPAN PEMUKA EKSEKUTIF / ADMIN (EXECUTIVE ANALYTICS HUB)
   ========================================================================== */

.main-content {
  max-width: 1680px;
  margin: 0 auto;
  padding: 1.25rem;
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

/* Filter Panel */
.filter-panel {
  background: var(--bg-card);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 1rem 1.25rem;
  box-shadow: var(--shadow-md);
}

[data-theme="light"] .filter-panel {
  background: #ffffff;
  border-color: #cbd5e1;
}

.filter-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
}

.year-tabs {
  display: flex;
  align-items: center;
  background: rgba(0, 0, 0, 0.25);
  padding: 0.25rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
  overflow-x: auto;
  scrollbar-width: none;
}

.year-tabs::-webkit-scrollbar {
  display: none;
}

[data-theme="light"] .year-tabs {
  background: #e2e8f0;
  border-color: #cbd5e1;
}

.year-tab {
  padding: 0.45rem 1rem;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-secondary);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition-fast);
  border: none;
  background: transparent;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  white-space: nowrap;
  min-height: 36px;
}

.year-tab.active {
  background: linear-gradient(135deg, #0284c7, #026ca3);
  color: #fff;
  box-shadow: 0 2px 6px rgba(2, 132, 199, 0.4);
}

.dropdown-filters {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.filter-group {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.filter-group label {
  font-size: 0.75rem;
  color: var(--text-secondary);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  white-space: nowrap;
}

.select-custom {
  background: var(--bg-secondary);
  color: var(--text-primary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 0.45rem 0.85rem;
  font-size: 0.82rem;
  font-weight: 600;
  outline: none;
  cursor: pointer;
  transition: all var(--transition-fast);
  min-height: 38px;
}

[data-theme="light"] .select-custom {
  background: #ffffff;
  border-color: #cbd5e1;
}

.select-custom:focus {
  border-color: var(--accent-blue);
  box-shadow: 0 0 0 2px rgba(14, 165, 233, 0.25);
}

/* Metric Cards Grid */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 1rem;
}

.kpi-card {
  background: var(--bg-card);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 1.15rem;
  position: relative;
  overflow: hidden;
  transition: all var(--transition-normal);
  box-shadow: var(--shadow-sm);
}

[data-theme="light"] .kpi-card {
  background: #ffffff;
  border-color: #cbd5e1;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.05);
}

.kpi-card:hover {
  transform: translateY(-2px);
  border-color: var(--border-highlight);
  box-shadow: var(--shadow-md);
}

.kpi-card::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, #0284c7, #06b6d4);
}

.kpi-card.card-victims::after {
  background: linear-gradient(90deg, #f43f5e, #fb7185);
}

.kpi-card.card-pps::after {
  background: linear-gradient(90deg, #f59e0b, #fbbf24);
}

.kpi-card.card-risk::after {
  background: linear-gradient(90deg, #8b5cf6, #c084fc);
}

.kpi-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.6rem;
}

.kpi-title {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.kpi-icon {
  width: 34px;
  height: 34px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  background: rgba(14, 165, 233, 0.15);
  color: #38bdf8;
}

.kpi-card.card-victims .kpi-icon {
  background: rgba(244, 63, 94, 0.15);
  color: var(--accent-rose);
}

.kpi-card.card-pps .kpi-icon {
  background: rgba(245, 158, 11, 0.15);
  color: var(--accent-amber);
}

.kpi-card.card-risk .kpi-icon {
  background: rgba(139, 92, 246, 0.15);
  color: var(--accent-purple);
}

.kpi-value {
  font-size: clamp(1.4rem, 2.5vw, 1.9rem);
  font-weight: 800;
  line-height: 1.1;
  margin-bottom: 0.3rem;
  font-family: 'Outfit', sans-serif;
  color: var(--text-primary);
}

.kpi-trend {
  font-size: 0.72rem;
  font-weight: 600;
}

.trend-up { color: #f87171; }
.trend-down { color: #34d399; }
.trend-neutral { color: var(--text-secondary); }

/* Dashboard Cards Common */
.dashboard-card {
  background: var(--bg-card);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

[data-theme="light"] .dashboard-card {
  background: #ffffff;
  border-color: #cbd5e1;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.05);
}

.card-header-flex {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.card-title-group {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.card-title-group h3 {
  font-size: 1.02rem;
  font-weight: 700;
}

.card-subtitle {
  font-size: 0.74rem;
  color: var(--text-secondary);
}

/* Grids */
.analytics-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 1.25rem;
}

.grid-two-cols {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
}

/* Map Wrapper */
.map-wrapper {
  position: relative;
  width: 100%;
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid var(--border-subtle);
}

#disasterMap {
  width: 100%;
  height: 380px;
  background: #0f172a;
  z-index: 1;
}

.map-chip-group {
  display: flex;
  gap: 0.35rem;
  flex-wrap: wrap;
}

.map-chip {
  padding: 0.3rem 0.65rem;
  font-size: 0.72rem;
  font-weight: 600;
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.map-chip.active {
  background: #0284c7;
  color: #fff;
  border-color: #0284c7;
}

.map-overlay-controls {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 10;
}

.map-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  font-size: 0.72rem;
  color: var(--text-secondary);
  padding: 0.5rem 0.25rem 0;
}

.legend-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
  margin-right: 0.3rem;
}

/* AI Insights List */
.insight-pills {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.insight-item {
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 0.85rem;
  display: flex;
  gap: 0.75rem;
}

[data-theme="light"] .insight-item {
  background: #f8fafc;
  border-color: #e2e8f0;
}

.insight-icon {
  font-size: 1.1rem;
  flex-shrink: 0;
  margin-top: 2px;
}

.insight-body h4 {
  font-size: 0.84rem;
  font-weight: 700;
  margin-bottom: 0.2rem;
}

.insight-body p {
  font-size: 0.76rem;
  color: var(--text-secondary);
  line-height: 1.45;
}

/* Chart Box */
.chart-box {
  width: 100%;
  height: 270px;
  position: relative;
}

/* Strategy Roadmap */
.strategy-tabs {
  display: flex;
  gap: 0.4rem;
  overflow-x: auto;
  padding-bottom: 0.25rem;
  scrollbar-width: none;
}

.strategy-tabs::-webkit-scrollbar {
  display: none;
}

.strat-tab {
  padding: 0.4rem 0.85rem;
  font-size: 0.78rem;
  font-weight: 600;
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  border-radius: var(--radius-full);
  cursor: pointer;
  white-space: nowrap;
}

.strat-tab.active {
  background: #0284c7;
  color: #fff;
  border-color: #0284c7;
}

.strategy-content {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1rem;
}

.action-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

[data-theme="light"] .action-card {
  background: #f8fafc;
  border-color: #e2e8f0;
}

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

.action-title {
  font-size: 0.84rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.badge-tag {
  font-size: 0.65rem;
  font-weight: 700;
  padding: 0.15rem 0.45rem;
  border-radius: 4px;
  background: rgba(14, 165, 233, 0.15);
  color: #38bdf8;
}

.action-desc {
  font-size: 0.76rem;
  color: var(--text-secondary);
  line-height: 1.4;
}

.action-list {
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-left: 1rem;
}

/* Smart Calculator */
.calc-container {
  display: grid;
  grid-template-columns: 1.1fr 1.3fr;
  gap: 1.5rem;
}

.calc-inputs {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.calc-field {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.calc-field label {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-secondary);
}

.calc-results-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.calc-result-box {
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 1.15rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
}

[data-theme="light"] .calc-result-box {
  background: #f8fafc;
  border-color: #e2e8f0;
}

.calc-result-box .num {
  font-family: 'Outfit', sans-serif;
  font-size: 1.7rem;
  font-weight: 800;
  color: #38bdf8;
}

.calc-result-box .label {
  font-size: 0.74rem;
  color: var(--text-secondary);
  font-weight: 600;
}

/* Master Data Table */
.table-controls {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.search-input-box {
  position: relative;
  min-width: 240px;
}

.search-input-box input {
  width: 100%;
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 0.5rem 0.85rem 0.5rem 2.2rem;
  color: var(--text-primary);
  font-size: 0.82rem;
  outline: none;
  min-height: 38px;
}

[data-theme="light"] .search-input-box input {
  background: #ffffff;
  border-color: #cbd5e1;
}

.search-input-box .search-icon {
  position: absolute;
  left: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
}

.table-responsive {
  width: 100%;
  overflow-x: auto;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
  -webkit-overflow-scrolling: touch;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.78rem;
  text-align: left;
}

.data-table th {
  background: rgba(15, 23, 42, 0.95);
  color: var(--text-secondary);
  font-weight: 700;
  padding: 0.75rem 0.85rem;
  text-transform: uppercase;
  font-size: 0.68rem;
  letter-spacing: 0.05em;
  border-bottom: 1px solid var(--border-subtle);
  white-space: nowrap;
}

[data-theme="light"] .data-table th {
  background: #e2e8f0;
  color: #334155;
}

.data-table td {
  padding: 0.7rem 0.85rem;
  border-bottom: 1px solid var(--border-subtle);
  color: var(--text-primary);
}

.data-table tbody tr:hover {
  background: var(--bg-card-hover);
}

.badge-disaster {
  display: inline-block;
  padding: 0.2rem 0.5rem;
  border-radius: var(--radius-sm);
  font-size: 0.68rem;
  font-weight: 700;
}

.badge-flood { background: rgba(14, 165, 233, 0.2); color: #38bdf8; }
.badge-fire { background: rgba(249, 115, 22, 0.2); color: #fb923c; }
.badge-storm { background: rgba(234, 179, 8, 0.2); color: #facc15; }
.badge-landslide { background: rgba(180, 83, 9, 0.2); color: #fde047; }
.badge-hazmat { background: rgba(168, 85, 247, 0.2); color: #c084fc; }

.badge-tahap1 { background: rgba(59, 130, 246, 0.15); color: #60a5fa; font-weight: 700; padding: 0.15rem 0.45rem; border-radius: 4px; }
.badge-tahap2 { background: rgba(239, 68, 68, 0.2); color: #f87171; font-weight: 700; padding: 0.15rem 0.45rem; border-radius: 4px; }

/* Pagination */
.pagination-wrapper {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.78rem;
  color: var(--text-secondary);
}

.page-buttons {
  display: flex;
  gap: 0.35rem;
}

.page-btn {
  padding: 0.35rem 0.75rem;
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  cursor: pointer;
  font-size: 0.75rem;
  min-height: 34px;
}

.page-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* ==========================================================================
   MOBILE BOTTOM NAVIGATION (ERGONOMIC THUMB BAR)
   ========================================================================== */

.mobile-bottom-nav {
  display: none; /* Hidden on Desktop */
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 60px;
  background: rgba(10, 14, 26, 0.95);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-top: 1px solid var(--border-subtle);
  z-index: 1200;
  align-items: center;
  justify-content: space-around;
  padding: 0 0.5rem;
  padding-bottom: env(safe-area-inset-bottom, 0px);
}

[data-theme="light"] .mobile-bottom-nav {
  background: rgba(255, 255, 255, 0.96);
  border-top-color: #cbd5e1;
  box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.08);
}

.mb-nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.15rem;
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-size: 0.68rem;
  font-weight: 600;
  cursor: pointer;
  padding: 0.3rem;
  border-radius: var(--radius-sm);
  transition: all var(--transition-fast);
  flex: 1;
}

.mb-nav-item i {
  font-size: 1.1rem;
}

.mb-nav-item.active {
  color: #38bdf8;
}

.mb-nav-item.mb-nav-sos {
  color: #f87171;
}

.mb-nav-item.mb-nav-jarvis {
  position: relative;
  top: -10px;
}

.mb-jarvis-icon {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: linear-gradient(135deg, #0284c7, #06b6d4);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  box-shadow: 0 4px 15px rgba(6, 182, 212, 0.6);
  border: 2px solid rgba(255, 255, 255, 0.3);
}

/* Floating JARVIS Desktop Button */
.floating-jarvis-btn {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 58px;
  height: 58px;
  border-radius: 50%;
  background: linear-gradient(135deg, #0284c7, #06b6d4);
  color: white;
  border: 2px solid rgba(255, 255, 255, 0.3);
  box-shadow: 0 8px 30px rgba(6, 182, 212, 0.5);
  cursor: pointer;
  z-index: 1500;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.45rem;
  transition: all var(--transition-normal);
}

.floating-jarvis-btn:hover {
  transform: scale(1.08) translateY(-2px);
}

.jarvis-pulse-ring {
  position: absolute;
  top: -4px;
  left: -4px;
  right: -4px;
  bottom: -4px;
  border-radius: 50%;
  border: 2px solid #38bdf8;
  animation: ringPulse 2s cubic-bezier(0.24, 0, 0.38, 1) infinite;
  pointer-events: none;
}

@keyframes ringPulse {
  0% { transform: scale(0.95); opacity: 0.9; }
  100% { transform: scale(1.4); opacity: 0; }
}

.jarvis-tooltip {
  position: absolute;
  right: 70px;
  background: rgba(15, 23, 42, 0.92);
  color: #fff;
  padding: 0.35rem 0.75rem;
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
  font-weight: 600;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transform: translateX(10px);
  transition: all var(--transition-normal);
  border: 1px solid var(--border-subtle);
}

.floating-jarvis-btn:hover .jarvis-tooltip {
  opacity: 1;
  transform: translateX(0);
}

/* ==========================================================================
   JARVIS AI CHATBOT DRAWER (DESKTOP & MOBILE RESPONSIVE)
   ========================================================================== */

.jarvis-drawer {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 440px;
  max-width: calc(100vw - 32px);
  height: 640px;
  max-height: calc(100vh - 48px);
  background: rgba(10, 14, 26, 0.96);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(6, 182, 212, 0.35);
  border-radius: var(--radius-xl);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.7), 0 0 30px rgba(6, 182, 212, 0.2);
  z-index: 1600;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transform: translateY(20px) scale(0.95);
  opacity: 0;
  pointer-events: none;
  transition: all var(--transition-slow);
}

.jarvis-drawer.open {
  transform: translateY(0) scale(1);
  opacity: 1;
  pointer-events: auto;
}

[data-theme="light"] .jarvis-drawer {
  background: rgba(255, 255, 255, 0.98);
  border-color: rgba(6, 182, 212, 0.5);
}

.jarvis-header {
  padding: 0.85rem 1.15rem;
  background: linear-gradient(135deg, rgba(6, 182, 212, 0.12), rgba(59, 130, 246, 0.12));
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.jarvis-brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.jarvis-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, #0284c7, #06b6d4);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  box-shadow: 0 0 12px rgba(6, 182, 212, 0.6);
}

.jarvis-title-info h3 {
  font-size: 0.92rem;
  font-weight: 800;
  line-height: 1.2;
}

.jarvis-title-info p {
  font-size: 0.68rem;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.jarvis-status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #10b981;
}

.jarvis-header-actions {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.jarvis-icon-btn {
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-secondary);
  padding: 0.4rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 0.85rem;
  min-width: 32px;
  min-height: 32px;
}

.jarvis-icon-btn.active {
  color: #38bdf8;
  background: rgba(6, 182, 212, 0.15);
  border-color: rgba(6, 182, 212, 0.3);
}

.jarvis-speech-visualizer {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1.15rem;
  background: rgba(6, 182, 212, 0.1);
  border-bottom: 1px solid rgba(6, 182, 212, 0.2);
  font-size: 0.75rem;
  color: #38bdf8;
  font-weight: 600;
}

/* JARVIS Bilingual Language Selector */
.jarvis-lang-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.45rem 1rem;
  background: rgba(14, 165, 233, 0.06);
  border-bottom: 1px solid var(--border-subtle);
}

.jarvis-lang-label {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.jarvis-lang-pills {
  display: flex;
  gap: 0.35rem;
}

.lang-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.25rem 0.6rem;
  font-size: 0.72rem;
  font-weight: 600;
  border-radius: var(--radius-full);
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.lang-pill:hover {
  border-color: var(--accent-blue);
  color: var(--text-primary);
}

.lang-pill.active {
  background: linear-gradient(135deg, #0284c7, #0369a1);
  border-color: transparent;
  color: #ffffff;
  box-shadow: 0 2px 8px rgba(2, 132, 199, 0.4);
}

.lang-pill .flag-emoji {
  font-size: 0.85rem;
}

.vis-bar {
  width: 3px;
  height: 14px;
  background: #38bdf8;
  border-radius: 2px;
  animation: waveBar 0.8s ease-in-out infinite alternate;
}

.vis-bar:nth-child(1) { animation-delay: 0.1s; height: 8px; }
.vis-bar:nth-child(2) { animation-delay: 0.3s; height: 16px; }
.vis-bar:nth-child(3) { animation-delay: 0.2s; height: 12px; }
.vis-bar:nth-child(4) { animation-delay: 0.4s; height: 18px; }
.vis-bar:nth-child(5) { animation-delay: 0.15s; height: 10px; }

@keyframes waveBar {
  0% { transform: scaleY(0.4); }
  100% { transform: scaleY(1.3); }
}

.btn-stop-speech {
  margin-left: auto;
  padding: 0.2rem 0.5rem;
  font-size: 0.68rem;
  background: rgba(239, 68, 68, 0.2);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.3);
  border-radius: var(--radius-sm);
  cursor: pointer;
}

.jarvis-quick-prompts {
  display: flex;
  gap: 0.4rem;
  padding: 0.6rem 1rem;
  overflow-x: auto;
  background: rgba(0, 0, 0, 0.15);
  border-bottom: 1px solid var(--border-subtle);
  scrollbar-width: none;
}

.jarvis-quick-prompts::-webkit-scrollbar {
  display: none;
}

.prompt-pill {
  padding: 0.35rem 0.75rem;
  font-size: 0.72rem;
  font-weight: 600;
  white-space: nowrap;
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  border-radius: var(--radius-full);
  cursor: pointer;
  min-height: 32px;
}

[data-theme="light"] .prompt-pill {
  background: #ffffff;
  border-color: #cbd5e1;
}

.jarvis-messages {
  flex: 1;
  padding: 1.15rem;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.msg-bubble {
  display: flex;
  gap: 0.65rem;
  max-width: 90%;
}

.msg-bubble.msg-user {
  margin-left: auto;
  flex-direction: row-reverse;
}

.msg-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: linear-gradient(135deg, #0284c7, #06b6d4);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  flex-shrink: 0;
}

.msg-content {
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 0.75rem 0.95rem;
  font-size: 0.8rem;
  line-height: 1.45;
}

[data-theme="light"] .msg-content {
  background: #f8fafc;
  border-color: #e2e8f0;
}

.msg-bubble.msg-user .msg-content {
  background: linear-gradient(135deg, #0284c7, #0369a1);
  color: white;
  border: none;
}

.msg-time {
  font-size: 0.65rem;
  color: var(--text-muted);
  margin-top: 0.35rem;
}

.jarvis-input-area {
  padding: 0.85rem 1rem;
  background: rgba(10, 14, 26, 0.95);
  border-top: 1px solid var(--border-subtle);
}

[data-theme="light"] .jarvis-input-area {
  background: #ffffff;
  border-top-color: #cbd5e1;
}

.jarvis-form {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 0.25rem 0.5rem;
  min-height: 42px;
}

[data-theme="light"] .jarvis-form {
  background: #f8fafc;
  border-color: #cbd5e1;
}

.btn-mic {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-size: 1rem;
  padding: 0.4rem;
  cursor: pointer;
}

.btn-mic.listening {
  color: #ef4444;
  animation: pulse 1s infinite;
}

.jarvis-form input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  font-size: 0.82rem;
  color: var(--text-primary);
}

.btn-send {
  background: linear-gradient(135deg, #0284c7, #06b6d4);
  border: none;
  color: white;
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.jarvis-input-hint {
  font-size: 0.65rem;
  color: var(--text-muted);
  text-align: center;
  margin-top: 0.35rem;
}

/* ==========================================================================
   MODALS (INFOGRAPHIC STUDIO & VOICE TUNING)
   ========================================================================== */

.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition-normal);
}

.modal-overlay.open {
  opacity: 1;
  pointer-events: auto;
}

.modal-box {
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  max-width: 600px;
  width: 100%;
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
}

[data-theme="light"] .modal-box {
  background: #ffffff;
  border-color: #cbd5e1;
}

.modal-header {
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-body {
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  overflow-y: auto;
}

.modal-footer {
  padding: 1rem 1.25rem;
  border-top: 1px solid var(--border-subtle);
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
}

.btn-icon {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 1rem;
  padding: 0.35rem;
}

/* Infographic Studio Modal */
.modal-infographic-box {
  max-width: 1050px !important;
  width: 95vw !important;
  max-height: 94vh !important;
}

.infographic-controls-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.85rem 1.25rem;
  background: rgba(0, 0, 0, 0.2);
  border-bottom: 1px solid var(--border-subtle);
  flex-wrap: wrap;
  gap: 0.75rem;
}

.info-ctrl-group {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-secondary);
}

.info-actions {
  display: flex;
  gap: 0.5rem;
}

.infographic-preview-scroll {
  padding: 1.5rem;
  overflow-y: auto;
  background: rgba(0, 0, 0, 0.4);
  display: flex;
  justify-content: center;
}

.infographic-poster {
  width: 880px;
  max-width: 100%;
  background: #0f172a;
  color: #f8fafc;
  border-radius: var(--radius-lg);
  padding: 2rem;
  border: 2px solid rgba(6, 182, 212, 0.4);
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  font-family: 'Inter', sans-serif;
}

.poster-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 2px solid rgba(255, 255, 255, 0.1);
  padding-bottom: 1rem;
}

.poster-logo-box {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.poster-crest {
  width: 48px;
  height: 48px;
  background: linear-gradient(135deg, #0284c7, #06b6d4);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  color: #fff;
  flex-shrink: 0;
}

.poster-logo-box h2 {
  font-size: 1.1rem;
  font-weight: 800;
}

.poster-logo-box h3 {
  font-size: 0.95rem;
  color: #38bdf8;
}

.poster-logo-box p {
  font-size: 0.75rem;
  color: #94a3b8;
}

.poster-date-badge span {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.25rem 0.65rem;
  background: rgba(14, 165, 233, 0.15);
  border: 1px solid rgba(14, 165, 233, 0.35);
  border-radius: var(--radius-full);
  color: #38bdf8;
  white-space: nowrap;
}

.poster-kpis {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.75rem;
}

.poster-kpi-card {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-md);
  padding: 0.9rem;
  text-align: center;
}

.poster-kpi-card .p-num {
  font-family: 'Outfit', sans-serif;
  font-size: 1.55rem;
  font-weight: 800;
  color: #38bdf8;
}

.poster-kpi-card.danger .p-num { color: #f43f5e; }
.poster-kpi-card.warning .p-num { color: #f59e0b; }

.poster-kpi-card .p-lbl {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
}

.poster-kpi-card .p-sub {
  font-size: 0.62rem;
  color: #94a3b8;
}

.poster-grid {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: 1.25rem;
}

.poster-col {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.poster-section-title {
  font-size: 0.8rem;
  font-weight: 700;
  color: #38bdf8;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.poster-stat-bars {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.p-bar-header {
  display: flex;
  justify-content: space-between;
  font-size: 0.7rem;
  margin-bottom: 0.2rem;
}

.p-bar-track {
  width: 100%;
  height: 6px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 3px;
  overflow: hidden;
}

.p-bar-fill {
  height: 100%;
  border-radius: 3px;
}

.poster-hotspots-list {
  font-size: 0.7rem;
  color: #cbd5e1;
  margin-left: 1rem;
}

.poster-strategy-cards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.6rem;
}

.p-strat-card {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-sm);
  padding: 0.6rem;
  display: flex;
  gap: 0.5rem;
}

.p-strat-num {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #0284c7;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  font-weight: 800;
  flex-shrink: 0;
}

.p-strat-card h4 {
  font-size: 0.72rem;
  font-weight: 700;
  color: #fff;
}

.p-strat-card p {
  font-size: 0.62rem;
  color: #94a3b8;
}

.poster-alert-box {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  background: rgba(244, 63, 94, 0.12);
  border: 1px solid rgba(244, 63, 94, 0.3);
  padding: 0.6rem;
  border-radius: var(--radius-md);
  font-size: 0.68rem;
  color: #fca5a5;
}

.poster-footer {
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding-top: 0.75rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.65rem;
  color: #64748b;
}

/* 3-Way Theme Popover */
.theme-selector-dropdown {
  position: relative;
}

.btn-theme-trigger {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.5rem 0.75rem;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  border-radius: var(--radius-md);
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  color: var(--text-primary);
  min-height: 38px;
}

.theme-menu-popover {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 240px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  padding: 0.35rem;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  z-index: 2000;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  opacity: 0;
  transform: translateY(-8px) scale(0.96);
  pointer-events: none;
  transition: all var(--transition-normal);
}

[data-theme="light"] .theme-menu-popover {
  background: #ffffff;
  border-color: #cbd5e1;
}

.theme-selector-dropdown.open .theme-menu-popover {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

.theme-opt-btn {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.55rem 0.75rem;
  border-radius: var(--radius-sm);
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-primary);
  cursor: pointer;
  text-align: left;
  width: 100%;
}

.theme-opt-btn:hover {
  background: var(--bg-card-hover);
}

.theme-opt-btn.active {
  background: rgba(14, 165, 233, 0.15);
  border-color: rgba(14, 165, 233, 0.3);
}

.theme-opt-text strong {
  display: block;
  font-size: 0.78rem;
  font-weight: 700;
}

.theme-opt-text small {
  display: block;
  font-size: 0.66rem;
  color: var(--text-secondary);
}

/* App Footer */
.app-footer {
  margin-top: auto;
  border-top: 1px solid var(--border-subtle);
  padding: 1.5rem 1rem;
  text-align: center;
  font-size: 0.75rem;
  color: var(--text-muted);
}

.footer-links {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.footer-nav-btn {
  background: transparent;
  border: none;
  color: var(--accent-blue);
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
}

.footer-nav-btn:hover {
  text-decoration: underline;
}

/* ==========================================================================
   COMPREHENSIVE RESPONSIVE MEDIA QUERIES (MOBILE FIRST & DESKTOP TUNING)
   ========================================================================= */

/* Large Tablets & Small Laptops (<= 1200px) */
@media (max-width: 1200px) {
  .kpi-grid {
    grid-template-columns: repeat(3, 1fr);
  }
  .kpi-card:nth-child(4), .kpi-card:nth-child(5) {
    grid-column: span 1;
  }
  .analytics-grid {
    grid-template-columns: 1fr;
  }
  .calc-container {
    grid-template-columns: 1fr;
  }
}

/* Standard Tablets (<= 992px) */
@media (max-width: 992px) {
  .grid-two-cols {
    grid-template-columns: 1fr;
  }
}

/* Desktop-only elements control */
.btn-hamburger-trigger {
  display: none !important;
}

/* ==========================================================================
   MOBILE DEVICES & SMALL TABLETS (<= 768px)
   ========================================================================== */
@media (max-width: 768px) {
  /* STRICT GLOBAL MOBILE OVERFLOW FIX */
  html, body, .app-container, .top-navbar, .ticker-bar, .view-section, 
  .citizen-hero, .citizen-main-content, .admin-main-content, .citizen-section {
    max-width: 100vw !important;
    overflow-x: hidden !important;
    box-sizing: border-box !important;
  }

  /* Show Mobile Bottom Navigation */
  .mobile-bottom-nav {
    display: flex;
  }

  /* Hide Desktop Floating Button on Mobile to avoid overlapping Bottom Nav */
  .floating-jarvis-btn {
    display: none !important;
  }

  /* STRICT 1-ROW TOP NAVBAR ON MOBILE - NO WRAPPING AT ALL */
  .top-navbar {
    padding: 0.45rem 0.75rem;
    height: 52px;
    display: flex;
    align-items: center;
    width: 100% !important;
    max-width: 100vw !important;
    box-sizing: border-box !important;
  }

  .nav-content {
    flex-wrap: nowrap !important;
    gap: 0.4rem;
    height: 100%;
    width: 100% !important;
    max-width: 100% !important;
    align-items: center;
    justify-content: space-between;
    box-sizing: border-box !important;
  }

  .brand-section {
    min-width: 0;
    flex: 1;
    display: flex;
    align-items: center;
    gap: 0.45rem;
    overflow: hidden;
  }

  .brand-logo {
    width: 32px;
    height: 32px;
    font-size: 1rem;
    flex-shrink: 0;
  }

  .brand-text {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    min-width: 0;
    overflow: hidden;
  }

  .brand-text h1 {
    font-size: 0.92rem;
    font-weight: 800;
    white-space: nowrap;
  }

  .brand-text p {
    display: none !important;
  }

  .badge-live {
    font-size: 0.52rem;
    padding: 0.1rem 0.35rem;
    white-space: nowrap;
  }

  .nav-actions {
    display: flex !important;
    align-items: center !important;
    gap: 0.35rem !important;
    flex-shrink: 0 !important;
    flex-wrap: nowrap !important;
  }

  /* HIDE ALL DESKTOP BUTTONS ON MOBILE */
  .nav-item-desktop,
  .btn-switch-view,
  .nav-jarvis-desktop,
  .admin-only-btn,
  .nav-theme-desktop {
    display: none !important;
  }

  /* MOBILE ICONS: EXACTLY 3 NEAT 34x34px BUTTONS */
  .btn-notification-bell {
    width: 34px !important;
    height: 34px !important;
    min-height: 34px !important;
    padding: 0 !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    flex-shrink: 0 !important;
  }

  .btn-auth-pill {
    width: 34px !important;
    height: 34px !important;
    min-height: 34px !important;
    padding: 0 !important;
    border-radius: 50% !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    flex-shrink: 0 !important;
  }

  .btn-auth-pill .nav-btn-text {
    display: none !important;
  }

  .btn-hamburger-trigger {
    width: 34px !important;
    height: 34px !important;
    min-height: 34px !important;
    padding: 0 !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    flex-shrink: 0 !important;
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    color: var(--text-primary);
  }

  /* Ticker Bar on Mobile */
  .ticker-bar {
    padding: 0.35rem 0.75rem;
    font-size: 0.7rem;
    overflow-x: auto;
    white-space: nowrap;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
    width: 100% !important;
    max-width: 100vw !important;
    box-sizing: border-box !important;
  }

  .ticker-bar::-webkit-scrollbar {
    display: none;
  }

  .ticker-content {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: nowrap !important;
    width: auto;
    max-width: none;
  }

  .ticker-items {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    flex-wrap: nowrap !important;
  }

  .ticker-item {
    flex-shrink: 0;
    white-space: nowrap;
  }

  /* Hero Section Mobile Perfection */
  .citizen-hero {
    padding: 1.5rem 0.85rem 1.25rem !important;
    margin-bottom: 1.25rem !important;
    width: 100% !important;
    max-width: 100vw !important;
    box-sizing: border-box !important;
  }

  .citizen-hero-badge {
    max-width: 100% !important;
    white-space: normal !important;
    text-align: center !important;
    line-height: 1.35 !important;
    padding: 0.35rem 0.75rem !important;
    font-size: 0.68rem !important;
    box-sizing: border-box !important;
    margin-bottom: 0.85rem !important;
  }

  .citizen-hero h2 {
    font-size: 1.35rem !important;
    line-height: 1.25 !important;
    word-break: break-word !important;
    overflow-wrap: break-word !important;
    max-width: 100% !important;
    margin-bottom: 0.75rem !important;
  }

  .citizen-hero-desc {
    font-size: 0.84rem !important;
    line-height: 1.5 !important;
    word-break: break-word !important;
    overflow-wrap: break-word !important;
    max-width: 100% !important;
    margin-bottom: 1.25rem !important;
  }

  .citizen-hero-actions {
    flex-direction: column !important;
    width: 100% !important;
    max-width: 100% !important;
    gap: 0.5rem !important;
    box-sizing: border-box !important;
    margin-bottom: 1.5rem !important;
  }

  .btn-hero-lg {
    width: 100% !important;
    max-width: 100% !important;
    justify-content: center !important;
    white-space: normal !important;
    text-align: center !important;
    box-sizing: border-box !important;
    padding: 0.7rem 0.9rem !important;
    font-size: 0.85rem !important;
    min-height: 42px !important;
  }

  /* Quick Status Grid on Mobile */
  .citizen-quick-status-grid {
    grid-template-columns: 1fr !important;
    gap: 0.65rem !important;
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
  }

  .c-stat-card {
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
    min-width: 0 !important;
  }

  /* District Checker */
  .district-checker-card {
    padding: 1.15rem 0.85rem;
  }
  .checker-header {
    flex-direction: column;
    align-items: stretch;
  }
  .select-lg {
    width: 100%;
    min-width: unset;
  }
  .checker-result-box {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  /* SOS Hotlines */
  .hotline-grid {
    grid-template-columns: 1fr;
  }

  /* Safety Guides */
  .guide-grid {
    grid-template-columns: 1fr;
  }

  /* AI Banner */
  .ai-banner-content {
    flex-direction: column;
    text-align: center;
    padding: 1.25rem 0.85rem;
  }
  .ai-banner-prompts {
    justify-content: center;
  }

  /* Admin KPI Cards on Mobile */
  .kpi-grid {
    grid-template-columns: 1fr 1fr;
    gap: 0.65rem;
  }
  .kpi-card:last-child {
    grid-column: span 2; /* 5th card spans full width */
  }
  .kpi-card {
    padding: 0.85rem;
  }
  .kpi-value {
    font-size: 1.4rem;
  }

  /* Filter Panel on Mobile */
  .filter-panel {
    padding: 0.85rem 0.75rem;
  }

  .filter-row {
    flex-direction: column;
    align-items: stretch;
    gap: 0.75rem;
  }

  .year-tabs {
    width: 100%;
    overflow-x: auto;
    white-space: nowrap;
    scrollbar-width: none;
    padding: 0.25rem;
    justify-content: flex-start;
    -webkit-overflow-scrolling: touch;
  }

  .year-tabs::-webkit-scrollbar {
    display: none;
  }

  .year-tab {
    flex-shrink: 0;
    padding: 0.4rem 0.75rem;
    font-size: 0.78rem;
  }

  .dropdown-filters {
    flex-direction: column;
    width: 100%;
    gap: 0.5rem;
  }

  .filter-group {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
  }

  .filter-group label {
    font-size: 0.72rem;
    min-width: 80px;
    flex-shrink: 0;
  }

  .filter-group .select-custom {
    flex: 1;
    width: 100%;
    min-width: 0;
    min-height: 38px;
    box-sizing: border-box;
  }

  /* Map on Mobile */
  #disasterMap {
    height: 300px;
  }

  /* Calculator on Mobile */
  .calc-results-grid {
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
  }
  .calc-result-box {
    padding: 0.75rem;
  }
  .calc-result-box .num {
    font-size: 1.3rem;
  }

  /* Table Controls */
  .table-controls {
    flex-direction: column;
    align-items: stretch;
    width: 100%;
  }
  .search-input-box {
    width: 100%;
  }

  /* Mobile Bottom Sheet for JARVIS AI */
  .jarvis-drawer {
    bottom: 0;
    right: 0;
    left: 0;
    width: 100%;
    max-width: 100%;
    height: 85vh;
    max-height: 85vh;
    border-radius: 20px 20px 0 0;
    border-bottom: none;
  }

  /* ==========================================================================
     INFOGRAPHIC STUDIO MODAL ON MOBILE (FULL SCREEN RESPONSIVE POSTER)
     ========================================================================== */

  .modal-infographic-box {
    width: 100vw !important;
    height: 100vh !important;
    max-width: 100vw !important;
    max-height: 100vh !important;
    border-radius: 0;
  }

  .infographic-controls-bar {
    flex-direction: column;
    align-items: stretch;
    gap: 0.5rem;
    padding: 0.65rem 0.85rem;
  }

  .info-ctrl-group {
    width: 100%;
    justify-content: space-between;
  }

  .info-ctrl-group select {
    flex: 1;
  }

  .info-actions {
    width: 100%;
    display: flex;
    gap: 0.4rem;
  }

  .info-actions .btn {
    flex: 1;
    font-size: 0.74rem;
    padding: 0.45rem 0.5rem;
  }

  .infographic-preview-scroll {
    padding: 0.65rem 0.4rem;
    background: rgba(0, 0, 0, 0.6);
  }

  .infographic-poster {
    width: 100% !important;
    max-width: 100% !important;
    padding: 1.15rem 0.85rem;
    gap: 0.85rem;
    border-radius: var(--radius-md);
  }

  .poster-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.6rem;
    padding-bottom: 0.65rem;
  }

  .poster-logo-box {
    flex-direction: row;
    align-items: center;
    gap: 0.65rem;
  }

  .poster-crest {
    width: 38px;
    height: 38px;
    font-size: 1.15rem;
    flex-shrink: 0;
  }

  .poster-logo-box h2 {
    font-size: 0.92rem;
    line-height: 1.2;
  }

  .poster-logo-box h3 {
    font-size: 0.78rem;
  }

  .poster-logo-box p {
    font-size: 0.68rem;
  }

  .poster-date-badge span {
    font-size: 0.62rem;
    padding: 0.15rem 0.5rem;
  }

  .poster-kpis {
    grid-template-columns: 1fr 1fr;
    gap: 0.45rem;
  }

  .poster-kpi-card {
    padding: 0.6rem 0.45rem;
  }

  .poster-kpi-card .p-num {
    font-size: 1.3rem;
  }

  .poster-kpi-card .p-lbl {
    font-size: 0.58rem;
  }

  .poster-kpi-card .p-sub {
    font-size: 0.54rem;
  }

  .poster-grid {
    grid-template-columns: 1fr;
    gap: 0.85rem;
  }

  .poster-strategy-cards {
    grid-template-columns: 1fr;
    gap: 0.45rem;
  }

  .poster-footer {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.35rem;
    font-size: 0.62rem;
  }
}

/* Small Phones (<= 480px) */
@media (max-width: 480px) {
  .brand-logo {
    width: 32px;
    height: 32px;
    font-size: 1rem;
  }
  .brand-text h1 {
    font-size: 0.9rem;
  }
  .btn-switch-view {
    padding: 0.35rem 0.5rem;
    font-size: 0.68rem;
  }
}

/* ==========================================================================
   AUTHENTICATION, RBAC, AUDIT TRAIL & MOBILE DRAWER STYLES (v3.2)
   ========================================================================== */

/* Google SSO Button */
.btn-google-sso {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  width: 100%;
  padding: 0.75rem 1.25rem;
  background: #ffffff;
  color: #1f2937;
  border: 1px solid #d1d5db;
  border-radius: var(--radius-md);
  font-weight: 700;
  font-size: 0.88rem;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
  transition: all var(--transition-fast);
}

.btn-google-sso:hover {
  background: #f9fafb;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  transform: translateY(-1px);
}

/* Demo Profile Options in Auth Modal */
.demo-auth-opt {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.65rem 0.85rem;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  cursor: pointer;
  transition: all var(--transition-fast);
  width: 100%;
}

.demo-auth-opt:hover {
  background: var(--bg-card-hover);
  border-color: var(--accent-blue);
  transform: translateX(3px);
}

.demo-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  flex-shrink: 0;
}

.demo-auth-opt strong {
  display: block;
  font-size: 0.82rem;
}

.demo-auth-opt small {
  display: block;
  font-size: 0.68rem;
  color: var(--text-secondary);
}

/* Role Badges */
.badge-role {
  display: inline-block;
  padding: 0.2rem 0.55rem;
  border-radius: var(--radius-full);
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.role-super {
  background: rgba(245, 158, 11, 0.15);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.35);
}

.role-officer {
  background: rgba(14, 165, 233, 0.15);
  color: #38bdf8;
  border: 1px solid rgba(14, 165, 233, 0.35);
}

.role-viewer {
  background: rgba(16, 185, 129, 0.15);
  color: #6ee7b7;
  border: 1px solid rgba(16, 185, 129, 0.35);
}

/* Nav Auth Pill */
.btn-auth-pill {
  padding: 0.45rem 0.8rem;
  font-size: 0.76rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  border-radius: var(--radius-full);
}

.btn-auth-pill.logged-in {
  background: rgba(16, 185, 129, 0.12);
  border-color: rgba(16, 185, 129, 0.4);
  color: #34d399;
}

/* PIC Banner in Data Entry */
.entry-pic-banner {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  background: rgba(14, 165, 233, 0.12);
  border: 1px solid rgba(14, 165, 233, 0.35);
  padding: 0.65rem 0.95rem;
  border-radius: var(--radius-md);
  font-size: 0.78rem;
  color: #38bdf8;
}

/* Mobile Off-Canvas Drawer */
.mobile-drawer-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 2500;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.mobile-drawer-overlay.open {
  opacity: 1;
  pointer-events: auto;
}

.mobile-drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: 310px;
  max-width: 85vw;
  background: var(--bg-secondary);
  border-left: 1px solid var(--border-subtle);
  box-shadow: -10px 0 30px rgba(0, 0, 0, 0.5);
  z-index: 2600;
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  overflow-y: auto;
}

[data-theme="light"] .mobile-drawer {
  background: #ffffff;
  border-left-color: #cbd5e1;
}

.mobile-drawer.open {
  transform: translateX(0);
}

.mobile-drawer-header {
  padding: 1rem 1.15rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border-subtle);
}

.drawer-user-box {
  padding: 1rem 1.15rem;
  background: var(--bg-card);
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.drawer-user-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: linear-gradient(135deg, #0284c7, #06b6d4);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  flex-shrink: 0;
}

.drawer-user-info {
  flex: 1;
  min-width: 0;
}

.drawer-user-info strong {
  display: block;
  font-size: 0.84rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.drawer-menu-list {
  padding: 0.85rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  flex: 1;
}

.drawer-section-label {
  font-size: 0.65rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin-top: 0.65rem;
  margin-bottom: 0.2rem;
  padding: 0 0.5rem;
}

.drawer-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.6rem 0.75rem;
  border-radius: var(--radius-md);
  color: var(--text-primary);
  background: transparent;
  border: 1px solid transparent;
  cursor: pointer;
  font-size: 0.82rem;
  font-weight: 600;
  text-align: left;
  transition: all var(--transition-fast);
}

.drawer-link:hover {
  background: var(--bg-card);
  border-color: var(--border-subtle);
  color: var(--accent-blue);
}

.drawer-link.drawer-sos {
  color: #f87171;
  background: rgba(239, 68, 68, 0.08);
  border-color: rgba(239, 68, 68, 0.25);
  margin-top: 0.35rem;
}

.drawer-footer {
  padding: 1rem;
  border-top: 1px solid var(--border-subtle);
  text-align: center;
  font-size: 0.65rem;
  color: var(--text-muted);
}

/* Executive Security Lock Screen Barrier */
.admin-auth-lock-screen {
  min-height: 70vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem 1.25rem;
}

.lock-card {
  max-width: 520px;
  width: 100%;
  background: var(--bg-card);
  border: 1px solid rgba(239, 68, 68, 0.4);
  border-radius: var(--radius-xl);
  padding: 2.5rem 2rem;
  text-align: center;
  box-shadow: 0 15px 40px rgba(0, 0, 0, 0.5), 0 0 30px rgba(239, 68, 68, 0.15);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
}

[data-theme="light"] .lock-card {
  background: #ffffff;
  border-color: #fca5a5;
  box-shadow: 0 10px 30px rgba(239, 68, 68, 0.1);
}

.lock-icon {
  width: 68px;
  height: 68px;
  border-radius: 50%;
  background: rgba(239, 68, 68, 0.12);
  color: #ef4444;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  box-shadow: 0 0 25px rgba(239, 68, 68, 0.3);
}

.lock-card h2 {
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--text-primary);
}

.lock-card p {
  font-size: 0.88rem;
  color: var(--text-secondary);
  line-height: 1.55;
}

.lock-actions {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  width: 100%;
  margin-top: 0.5rem;
}

/* ==========================================================================
   CAD-AI MODULE: CITIZEN ADUAN & EXECUTIVE INTELLIGENCE HUB STYLING
   ========================================================================== */

/* Citizen Aduan Section */
.citizen-aduan-grid {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 1.25rem;
  margin-top: 1rem;
}

.aduan-form-card,
.aduan-feed-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
}

.aduan-card-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1.15rem;
  padding-bottom: 0.85rem;
  border-bottom: 1px solid var(--border-subtle);
}

.aduan-header-icon {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-md);
  background: rgba(14, 165, 233, 0.15);
  color: var(--accent-blue);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  flex-shrink: 0;
}

.aduan-card-header h4 {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 2px;
}

.aduan-card-header p {
  font-size: 0.72rem;
  color: var(--text-secondary);
}

.aduan-form-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-top: 1rem;
  padding-top: 0.85rem;
  border-top: 1px solid var(--border-subtle);
}

.aduan-dispatch-hint {
  font-size: 0.72rem;
  color: var(--accent-cyan);
  background: rgba(6, 182, 212, 0.08);
  border: 1px solid rgba(6, 182, 212, 0.2);
  padding: 0.35rem 0.65rem;
  border-radius: var(--radius-sm);
}

.btn-submit-aduan {
  padding: 0.55rem 1.15rem;
  font-size: 0.82rem;
  font-weight: 700;
}

.aduan-search-box {
  display: flex;
  gap: 0.4rem;
  margin-bottom: 1rem;
}

.aduan-search-box input {
  flex: 1;
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 0.45rem 0.75rem;
  font-size: 0.78rem;
  color: var(--text-primary);
}

.aduan-feed-title {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-secondary);
  text-transform: uppercase;
  margin-bottom: 0.65rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.aduan-feed-list {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  overflow-y: auto;
  max-height: 480px;
  padding-right: 2px;
}

.aduan-feed-item {
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  transition: all var(--transition-fast);
  cursor: pointer;
}

.aduan-feed-item:hover {
  border-color: var(--accent-blue);
  transform: translateY(-1px);
}

.aduan-feed-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.72rem;
}

.aduan-feed-ref {
  font-weight: 700;
  color: var(--accent-cyan);
}

.aduan-feed-badge {
  padding: 0.15rem 0.45rem;
  font-size: 0.65rem;
  font-weight: 700;
  border-radius: var(--radius-full);
}

.aduan-badge-pending {
  background: rgba(234, 179, 8, 0.15);
  color: var(--accent-amber);
  border: 1px solid rgba(234, 179, 8, 0.3);
}

.aduan-badge-progress {
  background: rgba(14, 165, 233, 0.15);
  color: var(--accent-blue);
  border: 1px solid rgba(14, 165, 233, 0.3);
}

.aduan-badge-resolved {
  background: rgba(16, 185, 129, 0.15);
  color: var(--accent-emerald);
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.aduan-feed-category {
  font-weight: 600;
  font-size: 0.8rem;
  color: var(--text-primary);
}

.aduan-feed-loc {
  font-size: 0.72rem;
  color: var(--text-muted);
}

.aduan-feed-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.68rem;
  color: var(--text-muted);
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  padding-top: 0.35rem;
  margin-top: 0.2rem;
}

/* Executive CAD-AI Hub */
.cad-ai-command-card {
  border: 1px solid rgba(56, 189, 248, 0.3);
  background: radial-gradient(circle at top right, rgba(14, 165, 233, 0.06), transparent 70%), var(--bg-card);
}

.cad-header-banner {
  padding-bottom: 1.25rem;
  border-bottom: 1px solid var(--border-subtle);
  margin-bottom: 1.25rem;
}

.cad-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.68rem;
  font-weight: 800;
  color: var(--accent-cyan);
  background: rgba(6, 182, 212, 0.12);
  border: 1px solid rgba(6, 182, 212, 0.3);
  padding: 0.2rem 0.6rem;
  border-radius: var(--radius-full);
  text-transform: uppercase;
  margin-bottom: 0.4rem;
}

.cad-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.cad-title-row h2 {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: 2px;
}

.cad-title-row p {
  font-size: 0.75rem;
  color: var(--text-secondary);
}

.cad-header-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* CAD-AI KPI Grid */
.cad-kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.cad-kpi-box {
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 1rem;
  display: flex;
  align-items: center;
  gap: 0.85rem;
  transition: all var(--transition-normal);
}

.cad-kpi-box.highlight-glow {
  border-color: rgba(234, 179, 8, 0.4);
  background: radial-gradient(circle at center, rgba(234, 179, 8, 0.08), transparent 70%), var(--bg-secondary);
}

.cad-kpi-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  flex-shrink: 0;
}

.cad-kpi-info {
  flex: 1;
}

.cad-kpi-num {
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--text-primary);
  line-height: 1.2;
}

.cad-kpi-label {
  font-size: 0.65rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  margin-top: 2px;
}

.cad-kpi-sub {
  font-size: 0.68rem;
  color: var(--text-secondary);
  margin-top: 2px;
}

/* CAD Tabs */
.cad-tab-filters {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
  border-bottom: 1px solid var(--border-subtle);
  padding-bottom: 0.75rem;
}

.cad-tabs {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
}

.cad-tab {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.35rem 0.75rem;
  font-size: 0.75rem;
  font-weight: 600;
  border-radius: var(--radius-full);
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.cad-tab:hover {
  border-color: var(--accent-blue);
  color: var(--text-primary);
}

.cad-tab.active {
  background: linear-gradient(135deg, #0284c7, #0369a1);
  border-color: transparent;
  color: white;
  box-shadow: 0 2px 8px rgba(2, 132, 199, 0.4);
}

/* CAD Subcards Grid */
.cad-two-col-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
}

.cad-subcard {
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 1.15rem;
  display: flex;
  flex-direction: column;
}

.cad-subcard-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 1rem;
  padding-bottom: 0.65rem;
  border-bottom: 1px solid var(--border-subtle);
}

.cad-subcard-title {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.cad-subcard-title h4 {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 1px;
}

.cad-subcard-title small {
  font-size: 0.68rem;
  color: var(--text-muted);
}

/* Staffing District List */
.staffing-district-list {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.staffing-row {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr 1.5fr 1fr;
  align-items: center;
  gap: 0.5rem;
  background: var(--bg-card);
  padding: 0.45rem 0.65rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
  font-size: 0.75rem;
}

.staffing-row.shortage {
  border-color: rgba(239, 68, 68, 0.4);
  background: rgba(239, 68, 68, 0.05);
}

.staffing-meter-track {
  width: 100%;
  height: 6px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 3px;
  overflow: hidden;
  position: relative;
}

.staffing-meter-fill {
  height: 100%;
  border-radius: 3px;
  transition: width 0.4s ease;
}

.cad-recommendation-box {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  background: rgba(234, 179, 8, 0.08);
  border: 1px solid rgba(234, 179, 8, 0.3);
  border-radius: var(--radius-md);
  padding: 0.75rem;
  margin-top: 0.85rem;
  font-size: 0.72rem;
  color: var(--text-secondary);
}

.cad-recommendation-box strong {
  color: var(--accent-amber);
  display: block;
  margin-bottom: 2px;
}

/* Savings Cards */
.savings-cards-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
  margin-bottom: 0.85rem;
}

.saving-card-item {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 0.85rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.saving-type-label {
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.saving-val-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
}

.s-amt {
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--accent-emerald);
}

.s-lbl {
  font-size: 0.65rem;
  color: var(--text-muted);
}

.s-cost-box {
  font-size: 0.68rem;
  color: var(--text-muted);
  text-align: right;
}

.s-cost-box strong {
  color: var(--text-primary);
  display: block;
}

.s-desc {
  font-size: 0.68rem;
  color: var(--text-secondary);
  line-height: 1.35;
  margin-top: 0.2rem;
}

.roi-summary-box {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 0.75rem 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.roi-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.roi-lbl {
  font-size: 0.65rem;
  color: var(--text-muted);
}

.roi-val {
  font-size: 0.85rem;
  font-weight: 700;
}

.roi-item.highlight {
  background: rgba(14, 165, 233, 0.1);
  border: 1px solid rgba(14, 165, 233, 0.3);
  padding: 0.35rem 0.75rem;
  border-radius: var(--radius-sm);
}

/* Recurrence & Awards Tables */
.recurrence-risk-table-wrap {
  overflow-x: auto;
}

.recurrence-table th,
.recurrence-table td {
  padding: 0.5rem 0.65rem;
  font-size: 0.75rem;
}

.officer-awards-list {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  margin-bottom: 0.85rem;
}

.officer-award-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 0.65rem 0.85rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.award-officer-info {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.award-rank-badge {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 0.8rem;
  flex-shrink: 0;
}

.rank-1 { background: linear-gradient(135deg, #f59e0b, #d97706); color: white; }
.rank-2 { background: linear-gradient(135deg, #94a3b8, #64748b); color: white; }
.rank-3 { background: linear-gradient(135deg, #b45309, #78350f); color: white; }

.award-stars {
  color: var(--accent-amber);
  font-size: 0.75rem;
  display: flex;
  gap: 2px;
}

.top-agency-showcase {
  background: rgba(16, 185, 129, 0.08);
  border: 1px solid rgba(16, 185, 129, 0.25);
  border-radius: var(--radius-md);
  padding: 0.75rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.75rem;
}

/* Responsive CAD-AI Media Queries */
@media (max-width: 992px) {
  .citizen-aduan-grid,
  .cad-two-col-grid {
    grid-template-columns: 1fr;
  }
  .cad-kpi-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .savings-cards-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .cad-kpi-grid {
    grid-template-columns: 1fr;
  }
  .cad-title-row {
    flex-direction: column;
    align-items: flex-start;
  }
  .staffing-row {
    grid-template-columns: 1fr;
    gap: 0.25rem;
  }
  .aduan-form-footer {
    flex-direction: column;
    align-items: stretch;
  }
}

/* ==========================================================================
   INTERACTIVE CALCULATION HOVER POPOVERS & TOOLTIPS (CAD-AI SAVINGS & RISK)
   ========================================================================== */

.calc-tooltip-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  cursor: help;
}

.calc-info-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 17px;
  height: 17px;
  border-radius: 50%;
  background: rgba(14, 165, 233, 0.18);
  color: var(--accent-cyan);
  font-size: 0.65rem;
  border: 1px solid rgba(14, 165, 233, 0.4);
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.calc-tooltip-wrap:hover .calc-info-badge,
.calc-tooltip-wrap:focus-within .calc-info-badge {
  background: var(--accent-cyan);
  color: #0f172a;
  transform: scale(1.15);
  box-shadow: 0 0 10px rgba(6, 182, 212, 0.5);
}

.calc-popover {
  visibility: hidden;
  opacity: 0;
  position: absolute;
  bottom: calc(100% + 10px);
  left: 50%;
  transform: translateX(-50%) translateY(6px);
  width: 300px;
  background: rgba(15, 23, 42, 0.97);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(56, 189, 248, 0.45);
  border-radius: var(--radius-md);
  padding: 0.85rem;
  color: var(--text-primary);
  font-size: 0.72rem;
  line-height: 1.45;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.7), 0 0 20px rgba(14, 165, 233, 0.25);
  z-index: 1050;
  pointer-events: none;
  transition: opacity 0.25s ease, transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.25s;
  white-space: normal;
  text-align: left;
}

.calc-popover::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border-width: 6px;
  border-style: solid;
  border-color: rgba(56, 189, 248, 0.45) transparent transparent transparent;
}

.calc-tooltip-wrap:hover .calc-popover,
.calc-tooltip-wrap:focus .calc-popover,
.calc-tooltip-wrap.active .calc-popover {
  visibility: visible;
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* Right / Left aligned popovers when near table edges */
.calc-popover.popover-right {
  left: auto;
  right: -10px;
  transform: translateY(6px);
}
.calc-popover.popover-right::after {
  left: auto;
  right: 24px;
}
.calc-tooltip-wrap:hover .calc-popover.popover-right {
  transform: translateY(0);
}

.calc-popover.popover-left {
  left: -10px;
  transform: translateY(6px);
}
.calc-popover.popover-left::after {
  left: 24px;
}
.calc-tooltip-wrap:hover .calc-popover.popover-left {
  transform: translateY(0);
}

.calc-popover-header {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-weight: 700;
  color: var(--accent-cyan);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  padding-bottom: 0.4rem;
  margin-bottom: 0.45rem;
  font-size: 0.74rem;
  text-transform: uppercase;
}

.calc-formula-box {
  background: rgba(0, 0, 0, 0.4);
  border: 1px dashed rgba(56, 189, 248, 0.4);
  border-radius: 4px;
  padding: 0.35rem 0.5rem;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.68rem;
  color: #38bdf8;
  margin: 0.35rem 0;
}

.calc-param-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-top: 0.35rem;
  font-size: 0.68rem;
  color: var(--text-secondary);
}

.calc-param-item {
  display: flex;
  justify-content: space-between;
}

.calc-source-tag {
  display: block;
  font-size: 0.62rem;
  color: var(--text-muted);
  margin-top: 0.4rem;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  padding-top: 0.3rem;
}

/* ==========================================================================
   RESPONSIVE NAVBAR BUTTON SCALING (PREVENTS BUTTON CUT-OFF)
   ========================================================================== */

@media (max-width: 1480px) {
  .nav-actions {
    gap: 0.3rem;
  }
  .btn {
    padding: 0.38rem 0.6rem;
    font-size: 0.76rem;
    min-height: 34px;
  }
  .brand-text p {
    max-width: 280px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
}

@media (max-width: 1320px) {
  .nav-actions {
    gap: 0.25rem;
  }
  .brand-text p {
    max-width: 200px;
  }
  /* Collapse button text for secondary tools on tighter desktop screens */
  .admin-only-btn.nav-item-desktop .nav-btn-text,
  a.nav-item-desktop .nav-btn-text {
    display: none;
  }
  .admin-only-btn.nav-item-desktop,
  a.nav-item-desktop {
    padding: 0.38rem 0.5rem;
  }
}

@media (max-width: 1140px) {
  .brand-text p {
    display: none;
  }
  .btn-switch-view .nav-btn-text {
    display: inline-block;
    max-width: 90px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .btn-jarvis .nav-btn-text {
    display: none;
  }
}

@media (max-width: 860px) {
  .nav-item-desktop {
    display: none !important;
  }
}

/* ==========================================================================
   PWA OFFLINE BANNER & INSTALL PROMPT STYLES
   ========================================================================== */

.offline-banner {
  background: linear-gradient(90deg, #dc2626, #b91c1c);
  color: white;
  text-align: center;
  padding: 0.45rem 1rem;
  font-size: 0.78rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  position: sticky;
  top: 0;
  z-index: 1001;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
  animation: slideDown 0.3s ease;
}

@keyframes slideDown {
  from { transform: translateY(-100%); }
  to { transform: translateY(0); }
}

/* Floating PWA Install Prompt Banner */
.pwa-install-banner {
  position: fixed;
  bottom: 64px;
  left: 50%;
  transform: translateX(-50%);
  width: calc(100% - 2rem);
  max-width: 480px;
  background: rgba(15, 23, 42, 0.95);
  backdrop-filter: blur(16px);
  border: 1px solid var(--accent-cyan);
  border-radius: var(--radius-lg);
  padding: 0.75rem 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  z-index: 999;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6), 0 0 20px rgba(6, 182, 212, 0.25);
  animation: popIn 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes popIn {
  from { opacity: 0; transform: translate(-50%, 20px) scale(0.95); }
  to { opacity: 1; transform: translate(-50%, 0) scale(1); }
}

.pwa-banner-content {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  flex: 1;
}

.pwa-banner-icon {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-md);
  object-fit: cover;
  border: 1px solid var(--accent-cyan);
  flex-shrink: 0;
}

.pwa-banner-text strong {
  font-size: 0.82rem;
  color: var(--text-primary);
  display: block;
}

.pwa-banner-text p {
  font-size: 0.68rem;
  color: var(--text-secondary);
  line-height: 1.2;
}

.pwa-banner-actions {
  display: flex;
  gap: 0.35rem;
  flex-shrink: 0;
}

/* Notification Status Card & Bulletins */
.notif-status-card {
  background: var(--bg-primary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 0.85rem;
}

.bulletin-item {
  background: var(--bg-primary);
  border-left: 3px solid var(--accent-blue);
  border-radius: 6px;
  padding: 0.55rem 0.75rem;
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
}

.bulletin-item.danger {
  border-left-color: var(--accent-rose);
  background: rgba(239, 68, 68, 0.05);
}

.bulletin-item.warning {
  border-left-color: var(--accent-amber);
  background: rgba(245, 158, 11, 0.05);
}

.bulletin-item strong {
  font-size: 0.76rem;
  color: var(--text-primary);
  display: block;
}

.bulletin-item p {
  font-size: 0.7rem;
  color: var(--text-secondary);
  margin-top: 1px;
  line-height: 1.3;
}

.bulletin-item small {
  font-size: 0.64rem;
  color: var(--text-muted);
  display: block;
  margin-top: 2px;
}


