      /* KPI Drill-down panels */
      .kpi-drilldown-card { position: relative; }
      .kpi-pct { font-size: 0.85rem; font-weight: 600; color: #6b7280; }
      .kpi-drill-btn { font-size: 0.75rem; padding: 2px 10px; }
      .kpi-drilldown-panel {
        position: absolute; left: 0; right: 0; top: 100%;
        background: #fff; border: 1px solid #e5e7eb; border-radius: 0 0 12px 12px;
        box-shadow: 0 8px 24px rgba(0,0,0,0.12); z-index: 100;
        max-height: 350px; overflow-y: auto; text-align: left;
      }
      .kpi-drilldown-panel .table { font-size: 0.78rem; margin: 0; }
      .kpi-drilldown-panel .table th { background: #fef9e7; position: sticky; top: 0; z-index: 1; }
      .kpi-drilldown-panel .drill-row:hover { background: #fff8e1; }
      .drill-loading { text-align: center; padding: 12px; color: #999; font-size: 0.8rem; }
      .drill-table { padding: 4px; }

      /* Bootstrap Button Overrides for Yellow/Orange Theme */
      .btn-warning {
        background: linear-gradient(135deg, var(--accent-yellow), var(--accent-orange));
        border: none;
        color: #fff;
        font-weight: 600;
        box-shadow: 0 4px 15px rgba(230, 168, 23, 0.3);
      }
      .btn-warning:hover, .btn-warning:focus {
        background: linear-gradient(135deg, var(--accent-yellow-dark), var(--accent-orange-deep));
        color: #fff;
        box-shadow: 0 6px 20px rgba(230, 168, 23, 0.4);
        transform: translateY(-1px);
      }
      .btn-outline-warning {
        border: 2px solid var(--accent-yellow);
        color: var(--accent-yellow-dark);
        background: transparent;
        font-weight: 600;
      }
      .btn-outline-warning:hover, .btn-outline-warning:focus {
        background: var(--accent-yellow);
        color: #fff;
        border-color: var(--accent-yellow);
      }

      .orange {
        color: var(--accent-orange);
      }

      /* Header Layout - Similar to 108 FMS */
      .header {
        position: relative;
        background: #ffffff;
        padding: 1.2rem 1rem;
        border-bottom: 3px solid var(--accent-yellow);
        text-align: center;
        overflow: hidden;
      }

      .header .logos-left,
      .header .logos-right {
        position: absolute;
        top: 50%;
        transform: translateY(-50%);
        display: flex;
        gap: 0.5rem;
      }

      .header .logos-left {
        left: 1rem;
      }

      .header .logos-right {
        right: 1rem;
      }

      .header .logos-left img,
      .header .logos-right img {
        height: 70px;
        width: 70px;
        border-radius: 50%;
        object-fit: cover;
        border: 3px solid #fff;
        box-shadow: 0 8px 20px rgba(15, 23, 42, 0.15);
        background: #fff;
      }

      .header .title {
        font-weight: 900;
        font-size: 1.5rem;
        color: var(--text-dark);
        margin-bottom: 0.25rem;
      }

      .header .subtitle {
        font-weight: 600;
        font-size: 0.95rem;
        color: var(--text-muted);
        margin-top: 0.15rem;
      }

      @media (max-width: 992px) {
        .header {
          padding: 1rem 0.75rem;
        }
        .header .logos-left,
        .header .logos-right {
          display: none;
        }
        .header .title {
          font-size: 1.2rem;
        }
        .header .subtitle {
          font-size: 0.85rem;
        }
      }

      /* Toolbar - Navigation Bar Below Header */
      .toolbar-fms {
        background: #fff;
        display: flex;
        justify-content: space-between;
        align-items: center;
        gap: 1rem;
        padding: 0.55rem 1rem;
        box-shadow: 0 4px 12px rgba(15, 23, 42, 0.08);
      }

      .toolbar-fms .fms-nav {
        display: flex;
        gap: 0.5rem;
        align-items: center;
        flex-wrap: wrap;
      }

      .toolbar-fms .fms-nav a {
        border: 1px solid var(--accent-yellow);
        border-radius: 999px;
        padding: 0.35rem 1rem;
        font-weight: 700;
        font-size: 0.85rem;
        text-decoration: none;
        color: var(--accent-yellow-dark);
        transition: all 0.2s ease;
        white-space: nowrap;
      }

      .toolbar-fms .fms-nav a.active,
      .toolbar-fms .fms-nav a:hover {
        background: var(--accent-yellow);
        color: #fff;
      }

      .toolbar-fms .toolbar-controls {
        display: flex;
        gap: 0.5rem;
        align-items: center;
      }

      .toolbar-fms .toolbar-controls input[type="date"] {
        max-width: 160px;
      }

      @media (max-width: 1024px) {
        .toolbar-fms {
          flex-wrap: wrap;
          justify-content: center;
        }
        .toolbar-fms .fms-nav,
        .toolbar-fms .toolbar-controls {
          flex-wrap: wrap;
        }
      }

      html,
      body {
        height: 100%;
      }

      /* Global typography and button polish */
      body {
        font-family: Inter, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
        color: var(--text-main);
        background: var(--bg-main);
      }

      .btn {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        gap: 8px;
        padding: 8px 12px;
        border-radius: 8px;
        font-weight: 700;
        font-size: 0.9rem;
        text-decoration: none;
        border: none;
        cursor: pointer;
      }

      .btn-sm {
        padding: 6px 10px;
        font-size: 0.85rem;
      }

      .table-responsive table tbody tr:hover {
        background: rgba(13, 154, 106, 0.03);
      }

      /* Tighten card spacing globally */
      .card-shell,
      .analytics-card,
      .kpi-card-pro,
      .analytics-stat-card {
        transition: transform 0.18s ease, box-shadow 0.18s ease;
      }

      @media (hover: hover) {
        .card-shell:hover,
        .analytics-card:hover,
        .kpi-card-pro:hover {
          transform: translateY(-4px);
          box-shadow: 0 28px 40px rgba(11, 31, 46, 0.08);
        }
      }

      /* Bootstrap Card Styling - Similar to 108 FMS */
      .card {
        background: var(--card-bg);
        border: 1px solid rgba(230, 168, 23, 0.15);
        border-radius: 16px;
        box-shadow: 0 6px 18px rgba(230, 168, 23, 0.12);
        color: var(--text-main);
        transition: transform 0.2s ease, box-shadow 0.2s ease;
      }

      @media (hover: hover) {
        .card:hover {
          transform: translateY(-2px);
          box-shadow: 0 12px 28px rgba(230, 168, 23, 0.18);
        }
      }

      /* OLD HERO STYLES - Kept for reference but not in use with new layout
      .header-card {
        background: var(--card-bg);
        border-radius: 16px;
        padding: 28px;
        box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
        border: 1px solid var(--card-border);
        margin-bottom: 24px;
      }

      .hero-card {
        position: relative;
        overflow: hidden;
      }

.hero-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 32px;
  align-items: stretch;
}

.hero-content {
  display: flex;
  gap: 24px;
  align-items: flex-start;
}

.hero-logo {
  flex-shrink: 0;
}

.logo-circle {
  width: 140px;
  height: 140px;
  border-radius: 50%;
  border: 4px solid var(--accent-orange);
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 20px 45px rgba(12, 43, 29, 0.22);
}

.logo-circle img {
  width: 110px;
  height: 110px;
  object-fit: contain;
}

.hero-copy {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
}

.hero-eyebrow {
  text-transform: uppercase;
  font-size: 2.2rem;
  font-weight: 900;
  letter-spacing: 0.1em;
  color: var(--accent-green);
  margin: 0;
}

.hero-title {
  margin: 6px 0 0;
  font-size: 1.25rem;
  font-weight: 900;
  color: var(--text-dark);
  line-height: 1.4;
}

.hero-description {
  margin: 0;
  font-size: 0.95rem;
  color: var(--text-muted);
  line-height: 1.5;
}

.hero-partners {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-end;
  gap: 14px;
}

.partner-label {
  text-transform: uppercase;
  letter-spacing: 0.3em;
  font-size: 0.75rem;
  color: var(--text-muted);
  margin: 0;
}

.partner-grid {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
  width: 100%;
}

.partner-badge {
  width: 110px;
  height: 110px;
  border-radius: 24px;
  background: var(--card-bg);
  border: 2px solid rgba(15, 23, 42, 0.08);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 16px 30px rgba(9, 22, 13, 0.12);
}

.partner-badge img {
  max-width: 80px;
  max-height: 80px;
  object-fit: contain;
}

@media (max-width: 1150px) {
  .hero-layout {
    grid-template-columns: 1fr;
  }
  .hero-partners {
    align-items: flex-start;
  }
}
.hero-visual-card {
  display: none;
}
END OLD HERO STYLES */

/* Stacked KPI styles used on analytics page */
.kpi-stack {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.kpi-card-pro.stacked {
  padding: 14px;
  border-radius: 12px;
}

/* Live GPS toggle button active state */
#btn-toggle-live-gps.active {
  background: linear-gradient(120deg, var(--accent-green), var(--accent-orange));
  color: #fff;
  border: none;
}

/* Small pulsing helper when JS toggles paint */
.map-pulse {
  animation: pulse 1.2s infinite ease-in-out;
}

@keyframes pulse {
  0% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.15); opacity: 0.6; }
  100% { transform: scale(1); opacity: 1; }
}

/* =====================================================
   LOADING STATES & SKELETON LOADERS
   ===================================================== */

/* Map Loading Overlay */
.map-loading-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  border-radius: 18px;
}

.loading-spinner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.spinner-ring {
  width: 48px;
  height: 48px;
  border: 4px solid rgba(13, 154, 106, 0.2);
  border-top-color: var(--accent-green);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

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

.loading-text {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-muted);
  letter-spacing: 0.02em;
}

/* Skeleton Loader */
.skeleton-loader {
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.skeleton-line {
  height: 14px;
  background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  animation: skeleton-shimmer 1.5s infinite;
  border-radius: 6px;
}

.skeleton-line.skeleton-title {
  height: 18px;
  width: 70%;
}

.skeleton-line.skeleton-subtitle {
  height: 24px;
  width: 50%;
}

.skeleton-line.skeleton-short {
  width: 40%;
}

.skeleton-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin: 6px 0;
}

.skeleton-box {
  height: 50px;
  background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  animation: skeleton-shimmer 1.5s infinite;
  border-radius: 10px;
}

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

/* =====================================================
   REAL-TIME UPDATE BADGE
   ===================================================== */

.map-header-left {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.realtime-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(245, 197, 24, 0.12);
  border: 1px solid rgba(245, 197, 24, 0.25);
  border-radius: 20px;
  padding: 4px 12px;
  font-size: 0.75rem;
  color: var(--accent-yellow-dark);
  transition: all 0.3s ease;
}

.realtime-badge.updating {
  background: rgba(255, 134, 44, 0.15);
  border-color: rgba(255, 134, 44, 0.3);
  color: var(--accent-orange-deep);
}

.realtime-badge.error {
  background: rgba(220, 53, 69, 0.1);
  border-color: rgba(220, 53, 69, 0.2);
  color: #dc3545;
}

.realtime-badge .badge-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent-yellow);
  animation: badge-pulse 2s infinite ease-in-out;
}

.realtime-badge.updating .badge-dot {
  background: var(--accent-orange);
  animation: badge-spin 1s linear infinite;
}

.realtime-badge.error .badge-dot {
  background: #dc3545;
  animation: none;
}

@keyframes badge-pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(0.8); }
}

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

.realtime-badge .badge-text {
  font-weight: 600;
  white-space: nowrap;
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .realtime-badge {
    font-size: 0.7rem;
    padding: 3px 8px;
  }
  
  .map-header-left {
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
  }
}

/* OLD REFRESH BUTTON - Now using Bootstrap classes
.btn-refresh {
  border-radius: 999px;
  padding: 6px 18px;
  border: none;
  font-size: 12px;
  font-weight: 600;
  background: linear-gradient(120deg, var(--accent-orange), var(--accent-green));
  color: #ffffff;
  cursor: pointer;
}

.btn-refresh:hover {
  opacity: 0.95;
}
END OLD REFRESH BUTTON */

/* OLD BUTTON STYLES - Commented out, now using Bootstrap buttons in toolbar
.hero-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}

.btn-logout,
.btn-manage {
  border-radius: 999px;
  padding: 6px 16px;
  border: none;
  font-size: 12px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  background: var(--accent-orange-soft);
  color: var(--accent-orange-deep);
}

.btn-manage {
  background: var(--accent-green-soft);
  color: var(--accent-green-dark);
}

.btn-analytics {
  border-radius: 999px;
  padding: 6px 18px;
  font-size: 12px;
  font-weight: 600;
  background: linear-gradient(120deg, var(--accent-green), var(--accent-orange));
  color: #fff;
  text-decoration: none;
  border: none;
  cursor: pointer;
}

.btn-analytics:hover {
  color: #fff;
  opacity: 0.9;
}
END OLD BUTTON STYLES */

footer {
  border-top: 1px solid rgba(0, 0, 0, 0.05);
  background: #fff;
}

.analytics-wrapper h1 {
  font-size: 1.75rem;
  font-weight: 700;
}

.analytics-card {
  border-radius: 16px;
  background: #fff;
  padding: 12px;
  box-shadow: var(--shadow-soft);
  border: 1px solid rgba(15, 23, 42, 0.04);
}

.analytics-card .card-title {
  font-weight: 800;
  margin-bottom: 6px;
}

.analytics-stat-card {
  border-radius: 14px;
  padding: 12px 14px;
  background: #f4f4f5;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.stat-icon {
  width: 52px;
  height: 52px;
  border-radius: 16px;
  background: rgba(15, 23, 42, 0.05);
  display: flex;
  align-items: center;
  justify-content: center;
  color: inherit;
  margin-bottom: 6px;
}

.stat-icon i {
  font-size: 22px;
}

.stat-icon.large {
  width: 80px;
  height: 80px;
  font-size: 32px;
}

.analytics-stat-card .label {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  font-weight: 800;
  margin-bottom: 1px;
}

.analytics-stat-card .value {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--accent-orange-deep);
}

.op-master-card {
  padding: 14px 18px;
  border-radius: 28px;
  box-shadow: 0 25px 60px rgba(13, 154, 106, 0.18);
  min-height: 200px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.op-master-card .value {
  font-size: 3.6rem;
  line-height: 1;
}

.gender-card {
  min-height: 110px;
  align-items: center;
}

.gender-card .stat-icon {
  margin-right: 12px;
}

.chart-compact {
  max-height: 230px;
  width: 100%;
}

.analytics-stat-card .label {
  font-size: 12px;
  text-transform: uppercase;
  color: var(--text-muted);
  letter-spacing: 0.08em;
}

.analytics-stat-card.accent-green {
  background: var(--accent-green-soft);
  color: var(--accent-green-dark);
}

.analytics-stat-card.accent-blue {
  background: rgba(255, 134, 44, 0.16);
  color: var(--accent-orange-deep);
}

.analytics-stat-card.accent-amber {
  background: linear-gradient(135deg, rgba(255, 134, 44, 0.22), rgba(13, 154, 106, 0.08));
  color: var(--accent-orange-deep);
}

.analytics-stat-card.accent-slate {
  background: #f5efe5;
  color: #3f4642;
}

.analytics-stat-card.accent-teal {
  background: linear-gradient(135deg, rgba(13, 154, 106, 0.16), rgba(13, 154, 106, 0.06));
  color: var(--accent-green);
}

.analytics-stat-card.accent-purple {
  background: linear-gradient(135deg, rgba(255, 134, 44, 0.15), rgba(13, 154, 106, 0.1));
  color: var(--accent-green-dark);
}

.analytics-stat-card.accent-rose {
  background: linear-gradient(135deg, rgba(227, 107, 29, 0.2), rgba(255, 190, 59, 0.22));
  color: var(--accent-orange-deep);
}

.analytics-table th {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  border-top: none;
}

.analytics-table td {
  font-size: 13px;
  vertical-align: middle;
}

.analytics-table tbody tr:not(:last-child) td {
  border-bottom: 1px solid rgba(15, 23, 42, 0.05);
}

      .kpi-section {
        display: flex;
        flex-direction: column;
        gap: 12px;
      }

      .section-heading {
        display: flex;
        justify-content: space-between;
        align-items: baseline;
      }

      .kpi-hero-grid {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
        gap: 18px;
      }

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
}

.kpi-grid.two-rows {
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

.kpi-grid-compact .kpi-card {
  min-height: 140px;
  align-items: flex-start;
  padding: 10px 12px;
}

.kpi-card {
        background: var(--card-bg);
        border-radius: 14px;
        padding: 10px 12px;
        border: 1px solid var(--card-border);
        position: relative;
        overflow: hidden;
        transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s;
        display: flex;
        align-items: center;
        gap: 10px;
        box-shadow: 0 12px 18px rgba(13, 41, 33, 0.08);
      }

.kpi-card.hero {
  justify-content: space-between;
  gap: 10px;
}

      .kpi-card:hover {
        transform: translateY(-3px);
        border-color: var(--accent-yellow);
        box-shadow: 0 30px 45px rgba(230, 168, 23, 0.18);
      }

      .kpi-secondary .kpi-card {
        flex-direction: column;
        align-items: flex-start;
      }

      .kpi-card button,
      .kpi-card.hero {
        cursor: pointer;
      }

.kpi-icon {
        width: 40px;
        height: 40px;
        border-radius: 12px;
        background: linear-gradient(140deg, rgba(13, 154, 106, 0.18), rgba(255, 134, 44, 0.16));
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 24px;
        box-shadow: inset 0 0 12px rgba(255, 255, 255, 0.4);
      }

      .kpi-icon i {
        font-size: 20px;
        color: var(--accent-green-dark);
      }

      .kpi-icon .emoji-icon {
        font-size: 26px;
        line-height: 1;
      }

      .kpi-icon.small {
        width: 40px;
        height: 40px;
        font-size: 18px;
      }

.kpi-label {
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.kpi-heading {
  font-size: 14px;
  letter-spacing: 0.06em;
  color: var(--text-main);
  font-weight: 800;
}

.kpi-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  border-radius: 999px;
  padding: 2px 10px;
  font-size: 0.75rem;
  font-weight: 600;
  margin-top: 4px;
}

.kpi-pill.positive {
  background: rgba(245, 197, 24, 0.15);
  color: #e6a817;
}

.kpi-pill.negative {
  background: rgba(239, 68, 68, 0.15);
  color: #b91c1c;
}

.kpi-value {
        font-size: 30px;
        font-weight: 900;
        line-height: 1.08;
      }

      .kpi-value.green {
        color: var(--accent-green);
      }

      .kpi-value.red {
        color: var(--accent-red);
      }

      .kpi-meta {
        font-size: 12px;
        color: var(--text-muted);
        margin-top: 4px;
      }

      .kpi-trend {
        font-size: 12px;
        font-weight: 700;
        text-transform: uppercase;
        letter-spacing: 0.1em;
        display: inline-flex;
        gap: 4px;
        align-items: center;
      }

      .kpi-trend.positive {
        color: var(--accent-green);
      }

      .kpi-trend.negative {
        color: var(--accent-red);
      }

      .kpi-trend.neutral {
        color: var(--text-muted);
      }

      .kpi-progress {
        margin-top: 10px;
        width: 100%;
        height: 6px;
        border-radius: 999px;
        background: var(--accent-green-soft);
      }

      .kpi-progress-bar {
        height: 100%;
        border-radius: 999px;
        background: var(--accent-green);
      }

      .kpi-card.kpi-green {
        border-color: rgba(13, 154, 106, 0.3);
      }

      .kpi-card.kpi-green .kpi-icon {
        background: linear-gradient(135deg, var(--accent-green), var(--accent-green-dark));
        color: #fff;
      }

      .kpi-card.kpi-yellow {
        border-color: rgba(227, 107, 29, 0.35);
      }

      .kpi-card.kpi-yellow .kpi-icon {
        background: linear-gradient(135deg, var(--accent-orange), var(--accent-saffron));
        color: var(--accent-orange-deep);
      }

      .kpi-card.kpi-red {
        border-color: rgba(240, 82, 60, 0.35);
      }

      .kpi-card.kpi-red .kpi-icon {
        background: linear-gradient(135deg, rgba(239, 68, 68, 0.9), rgba(248, 113, 113, 0.8));
        color: #ffffff;
      }

      .kpi-card.kpi-teal {
        border-color: rgba(13, 154, 106, 0.35);
      }

      .kpi-card.kpi-teal .kpi-icon {
        background: linear-gradient(135deg, var(--accent-green), var(--accent-orange));
        color: #ffffff;
      }

      .kpi-card.kpi-outline {
        border-style: dashed;
        box-shadow: none;
        padding-left: 16px;
        padding-right: 16px;
      }

      .kpi-card.kpi-outline .kpi-icon {
        background: var(--accent-orange-soft);
        color: var(--accent-orange-deep);
      }

      .dashboard-kpis {
        margin-top: 24px;
      }

      .dashboard-kpi-grid {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
        gap: 20px;
        margin-top: 12px;
      }

      .kpi-card-pro {
        background: #fff;
        border-radius: 20px;
        padding: 18px 20px;
        border: 1px solid rgba(13, 154, 106, 0.08);
        box-shadow: 0 18px 30px rgba(11, 31, 46, 0.06);
        display: flex;
        flex-direction: column;
        gap: 10px;
        min-height: 140px;
        justify-content: space-between;
      }

      /* icon removed - keep body layout consistent */
      .kpi-card-pro__body {
        display: flex;
        flex-direction: column;
        gap: 6px;
      }

      .kpi-card-pro__label {
        font-size: 0.8rem;
        text-transform: uppercase;
        letter-spacing: 0.25em;
        color: var(--accent-green);
        font-weight: 700;
      }

      .kpi-card-pro__value {
        font-size: 2.4rem;
        font-weight: 800;
        color: var(--accent-orange);
      }

      .kpi-card-pro__meta {
        font-size: 0.9rem;
        color: var(--text-muted);
      }

      .kpi-card-pro__tagline {
        font-size: 0.85rem;
        font-weight: 600;
        letter-spacing: 0.08em;
        text-transform: uppercase;
        color: var(--text-main);
      }

      .tagline-pill {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        padding: 2px 10px;
        border-radius: 999px;
        border: 1px solid rgba(0, 0, 0, 0.08);
        margin-left: 12px;
        font-size: 0.65rem;
        letter-spacing: 0.1em;
      }

      .tagline-pill.accent-orange {
        border-color: rgba(227, 107, 29, 0.45);
        color: var(--accent-orange-deep);
      }

      .tagline-pill.accent-green {
        border-color: rgba(13, 154, 106, 0.45);
        color: var(--accent-green-dark);
      }

      .dashboard-call-grid {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
        gap: 16px;
      }

      .call-kpi-card {
        background: #fff;
        border-radius: 18px;
        padding: 18px 16px;
        border: 1px solid rgba(15, 23, 42, 0.08);
        box-shadow: 0 20px 40px rgba(11, 31, 46, 0.08);
        display: flex;
        flex-direction: column;
        gap: 6px;
      }

      .call-kpi-card__label {
        font-size: 0.8rem;
        text-transform: uppercase;
        letter-spacing: 0.25em;
        color: var(--text-muted);
      }

      .call-kpi-card__value {
        font-size: 2.2rem;
        font-weight: 800;
        color: var(--accent-orange);
      }

      .call-kpi-card__value.accent-muted {
        color: rgba(15, 23, 42, 0.7);
      }

      .kpi-card-pro__tagline.accent-green {
        color: var(--accent-green);
      }

      .call-kpi-card__meta {
        font-size: 0.85rem;
        color: var(--text-muted);
      }

      .positive-pill,
      .negative-pill {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        padding: 4px 10px;
        border-radius: 999px;
        font-size: 0.7rem;
        letter-spacing: 0.12em;
        font-weight: 700;
        margin-top: 2px;
      }

      .positive-pill {
        background: rgba(16, 185, 129, 0.15);
        color: #047857;
      }

      .negative-pill {
        background: rgba(240, 82, 60, 0.16);
        color: #b91c1c;
      }

      /* Map + districts layout */

.map-section {
  display: block;
  margin-top: 0;
  margin-bottom: 0;
}

  .card-shell {
        background: var(--card-bg);
        border-radius: var(--radius-xl);
        box-shadow: var(--shadow-soft);
        border: 1px solid var(--card-border);
        padding: 14px 18px 16px;
        display: flex;
        flex-direction: column;
        min-height: 380px;
      }

      .card-shell-title {
        font-size: 14px;
        font-weight: 600;
        margin-bottom: 4px;
      }

      .card-shell-subtitle {
        font-size: 12px;
        color: var(--text-muted);
        margin-bottom: 10px;
      }

      .map-shell {
        min-height: auto;
      }

      .map-header {
        display: flex;
        justify-content: space-between;
        gap: 16px;
        flex-wrap: wrap;
        align-items: center;
      }

      .btn-clear-map {
        border: 1px solid rgba(13, 154, 106, 0.35);
        background: var(--accent-orange-soft);
        color: var(--accent-orange-deep);
        border-radius: 999px;
        padding: 6px 18px;
        font-size: 12px;
        font-weight: 600;
      }

      .map-selection {
        display: inline-flex;
        gap: 6px;
        align-items: baseline;
        font-size: 0.9rem;
        margin-bottom: 8px;
      }

      #map {
        width: 100%;
        height: 480px;
        border-radius: 24px;
        overflow: hidden;
      }

      .legend {
        display: flex;
        align-items: center;
        gap: 14px;
        font-size: 11px;
        color: var(--text-muted);
        margin-top: 8px;
      }

      .legend-item {
        display: inline-flex;
        align-items: center;
        gap: 4px;
      }

.district-summary-card {
  background: var(--card-bg);
  border-radius: var(--radius-xl);
  border: 1px solid var(--card-border);
  box-shadow: var(--shadow-soft);
  padding: 18px;
}

.district-summary-head {
  display: flex;
  justify-content: space-between;
        flex-wrap: wrap;
        gap: 12px;
        align-items: baseline;
      }

      .district-summary-list {
        margin-top: 16px;
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
        gap: 12px;
      }

.mmu-summary-row {
  border-radius: 18px;
  border: 1px solid var(--card-border);
  background: #fff;
  padding: 12px 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  transition: border-color 0.15s ease, transform 0.12s ease;
        cursor: pointer;
      }

      .mmu-summary-row:hover {
        border-color: var(--accent-yellow);
        transform: translateY(-1px);
      }

      .mmu-summary-row.active {
        border-color: var(--accent-yellow);
        background: var(--accent-yellow-soft);
      }

      .mmu-summary-row .name {
        font-weight: 600;
        font-size: 0.95rem;
      }

.mmu-summary-row .muted {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.district-detail-panel {
  margin-top: 16px;
  border-radius: 18px;
  border: 1px dashed rgba(227, 107, 29, 0.35);
  background: var(--accent-orange-soft);
  padding: 14px;
  min-height: 60px;
}

.vehicle-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
  margin-top: 8px;
}

.vehicle-card {
  border: 1px solid rgba(230, 168, 23, 0.2);
  border-radius: 14px;
  padding: 10px 12px;
  background: #ffffff;
  font-size: 0.9rem;
}

.vehicle-card strong {
  display: block;
  font-size: 1rem;
}

.vehicle-card span {
  display: block;
  font-size: 0.8rem;
  color: var(--text-muted);
}

      .dot {
        width: 8px;
        height: 8px;
        border-radius: 999px;
      }

      .dot-online {
        background: var(--accent-green);
      }

      .dot-moving {
        background: var(--accent-orange);
      }

      .dot-offline {
        background: rgba(26, 44, 38, 0.35);
      }

      .districts-wrapper {
        display: flex;
        flex-direction: column;
        height: 100%;
      }

      .district-selected {
        background: var(--accent-orange-soft);
        border-radius: 999px;
        padding: 6px 12px;
        font-size: 12px;
        display: flex;
        justify-content: space-between;
        align-items: center;
        margin-bottom: 8px;
      }

      .district-selected span.label {
        font-weight: 600;
      }

      .district-list {
        flex: 1;
        overflow-y: auto;
        margin-top: 4px;
        padding-right: 4px;
      }

      .district-summary {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
        gap: 8px;
        margin-top: 10px;
      }

      .district-summary-card {
        border-radius: 16px;
        background: var(--accent-orange-soft);
        padding: 10px 12px;
        text-align: center;
        border: 1px solid rgba(227, 107, 29, 0.28);
      }

      .district-summary-card .label {
        font-size: 11px;
        text-transform: uppercase;
        letter-spacing: 0.08em;
        color: var(--text-muted);
      }

      .district-summary-card .value {
        font-weight: 700;
        font-size: 18px;
      }

      .district-row {
        border-radius: 999px;
        padding: 8px 12px;
        font-size: 13px;
        display: flex;
        align-items: center;
        justify-content: space-between;
        margin-bottom: 6px;
        cursor: pointer;
        transition: background 0.12s ease, transform 0.05s ease;
      }

      .district-row:hover {
        background: #ffe8c8;
        transform: translateY(-1px);
      }

      .district-row.active {
        background: #ffd294;
        font-weight: 600;
      }

      .district-row-sub {
        font-size: 11px;
        color: var(--text-muted);
      }

      .district-arrow {
        font-size: 13px;
        color: var(--text-muted);
      }

      .btn-clear {
        border: none;
        background: transparent;
        font-size: 11px;
        text-transform: uppercase;
        font-weight: 600;
        letter-spacing: 0.12em;
        color: var(--text-muted);
      }

      .gps-summary-grid {
        margin-top: 12px;
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
        gap: 8px;
      }

      .gps-summary-card {
        border-radius: 16px;
        padding: 10px 12px;
        background: var(--accent-green-soft);
        border: 1px solid rgba(13, 154, 106, 0.22);
      }

      .gps-summary-card .label {
        font-size: 11px;
        text-transform: uppercase;
        letter-spacing: 0.08em;
        color: var(--text-muted);
      }

      .gps-summary-card .value {
        font-weight: 700;
        font-size: 18px;
        color: var(--accent-green-dark);
      }

      .gps-error {
        background: #fff2f2;
        border: 1px solid rgba(220, 38, 38, 0.25);
        border-radius: 12px;
        padding: 10px 12px;
        color: var(--accent-red);
        font-size: 12px;
        margin-top: 10px;
      }

      .api-warning {
        background: #fff7ed;
        border: 1px solid rgba(251, 146, 60, 0.5);
        border-radius: 14px;
        padding: 10px 14px;
        font-size: 13px;
        color: #9a3412;
        margin-bottom: 12px;
      }

      @media (max-width: 1200px) {
        .kpi-grid {
          grid-template-columns: repeat(2, minmax(0, 1fr));
        }

        #map {
          height: 420px;
        }
      }

      @media (max-width: 768px) {
        .kpi-grid {
          grid-template-columns: minmax(0, 1fr);
        }

        .top-bar {
          flex-direction: column;
          align-items: flex-start;
        }

        .map-section {
          display: block;
        }
      }
/* Map layout enhancements */
.map-overview {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  margin-bottom: 12px;
}

.map-stat {
  border-radius: 16px;
  padding: 14px;
  background: var(--accent-orange-soft);
  display: flex;
  flex-direction: column;
  gap: 4px;
  box-shadow: inset 0 1px 4px rgba(15, 23, 42, 0.05);
  border: 1px solid var(--card-border);
}

.map-stat .label {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-muted);
}

.map-stat .value {
  font-size: 1.8rem;
  font-weight: 600;
  color: var(--text-main);
}

.map-stat .muted {
  font-size: 12px;
  color: var(--text-muted);
}

.map-layout {
  position: relative;
  display: block;
  gap: 0;
  margin-top: 4px;
}

.map-main {
  width: 100%;
}

.map-shell {
  padding: 8px 10px 12px;
}

.map-header {
  padding: 8px 6px 4px;
}

.map-layout {
  padding: 0;
}

.map-main #map {
  height: 520px;
  border-radius: 18px;
  box-shadow: inset 0 0 60px rgba(255, 255, 255, 0.9);
}

.map-side {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 230px;
  max-width: 90vw;
  display: flex;
  flex-direction: column;
  gap: 12px;
  pointer-events: none;
}

.map-side-card {
  border-radius: 18px;
  padding: 14px;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  box-shadow: 0 16px 32px rgba(13, 41, 33, 0.08);
  display: flex;
  flex-direction: column;
  gap: 4px;
  pointer-events: auto;
}

.map-side-card .last-ping-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin-top: 4px;
}

.map-side-card.indicator {
  flex-direction: row;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
}

.indicator-icon {
  font-size: 1.6rem;
}

.map-side-card .label {
  font-size: 12px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.map-side-card .muted {
  font-size: 12px;
  color: var(--text-muted);
}

.map-side-card .value {
  font-size: 2rem;
  font-weight: 600;
  color: var(--text-main);
}

.map-side-card .vehicle-name-display {
  color: var(--accent-yellow-dark) !important;
}

.map-side-card .vehicle-speed-row,
.map-side-card .vehicle-coords-row {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.95rem;
  margin-top: 0.25rem;
}

.map-side-card .speed-label,
.map-side-card .coords-label {
  font-weight: 600;
  color: var(--text-muted);
}

.map-side-card .coords-label.ml-2 {
  margin-left: 0.75rem;
}

.map-side-card .vehicle-speed-display {
  color: var(--text-main) !important;
  font-weight: 700;
  font-size: 1rem;
}

.map-side-card .speed-unit {
  color: var(--text-muted);
  font-size: 0.85rem;
}

.map-side-card .vehicle-lat-display,
.map-side-card .vehicle-lng-display {
  color: var(--accent-orange) !important;
  font-weight: 600;
  font-size: 0.95rem;
}

.map-side-card.moving {
  border-color: rgba(227, 107, 29, 0.35);
  background: var(--accent-orange-soft);
}

.map-side-card.online {
  border-color: rgba(245, 197, 24, 0.3);
  background: var(--accent-yellow-soft);
}

.map-side-card.offline {
  border-color: rgba(26, 44, 38, 0.2);
  background: #f7eee5;
}

.map-side-card.total {
  border-color: rgba(245, 197, 24, 0.35);
  background: linear-gradient(135deg, rgba(245, 197, 24, 0.12), rgba(255, 134, 44, 0.1));
}

.map-side-card.moving .value,
.map-side-card.moving .indicator-icon {
  color: var(--accent-orange-deep);
}

.map-side-card.online .value,
.map-side-card.online .indicator-icon {
  color: var(--accent-yellow-dark);
}

.map-side-card.offline .value,
.map-side-card.offline .indicator-icon {
  color: #a03e1b;
}

.map-side-card.total .value,
.map-side-card.total .indicator-icon {
  color: var(--accent-yellow-dark);
}

.map-side-card.indicator.moving {
  border-color: rgba(227, 107, 29, 0.35);
}

.map-side-card.indicator.online {
  border-color: rgba(245, 197, 24, 0.3);
}

.map-side-card.indicator.offline {
  border-color: rgba(26, 44, 38, 0.2);
}

.map-side-card.indicator.total {
  border-color: rgba(245, 197, 24, 0.35);
}

.map-side-card.status {
  border-color: var(--card-border);
  gap: 6px;
}

/* Enhanced Vehicle Panel Styles */
.map-side-card .panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(0,0,0,0.06);
}

.map-side-card .panel-header .label {
  margin: 0;
  font-weight: 700;
}

.map-side-card .vehicle-name-row {
  margin-bottom: 10px;
}

.map-side-card .vehicle-name-display {
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--accent-green) !important;
  display: block;
}

.map-side-card .vehicle-info-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 12px;
}

.map-side-card .info-item {
  background: rgba(0,0,0,0.02);
  border-radius: 10px;
  padding: 8px 10px;
}

.map-side-card .info-item:first-child {
  grid-column: span 2;
}

.map-side-card .info-label {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 4px;
}

.map-side-card .info-label i {
  font-size: 0.75rem;
}

.map-side-card .info-value {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text-main);
  display: flex;
  align-items: baseline;
  gap: 4px;
}

.map-side-card .info-value .unit {
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--text-muted);
}

.map-side-card .vehicle-coords-section {
  background: linear-gradient(135deg, rgba(245, 197, 24, 0.08), rgba(255, 134, 44, 0.05));
  border-radius: 12px;
  padding: 10px 12px;
  margin-bottom: 10px;
}

.map-side-card .coords-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.map-side-card .coords-title {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 4px;
}

.map-side-card .coords-display {
  display: flex;
  gap: 12px;
}

.map-side-card .coord-item {
  display: flex;
  align-items: center;
  gap: 4px;
}

.map-side-card .coord-label {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
}

.map-side-card .coord-value {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--accent-orange);
  font-family: 'SF Mono', 'Monaco', 'Consolas', monospace;
}

.map-side-card .vehicle-actions {
  margin-top: 4px;
}

/* Google Maps Button */
.btn-google-maps {
  background: linear-gradient(135deg, #4285F4, #34A853);
  color: #fff !important;
  border: none;
  font-size: 0.7rem;
  padding: 4px 10px;
  border-radius: 6px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 4px;
  transition: all 0.2s ease;
}

.btn-google-maps:hover:not(:disabled) {
  background: linear-gradient(135deg, #3367D6, #2E8B47);
  color: #fff;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(66, 133, 244, 0.3);
}

.btn-google-maps:disabled {
  background: #ccc;
  color: #888;
  cursor: not-allowed;
}

.btn-google-maps i {
  font-size: 0.75rem;
}

/* =====================================================
   VEHICLE OP STATS SECTION
   ===================================================== */

.vehicle-op-stats {
  margin-top: 12px;
  padding: 10px 12px;
  background: linear-gradient(135deg, rgba(245, 197, 24, 0.1), rgba(255, 134, 44, 0.06));
  border-radius: 12px;
  border: 1px solid rgba(245, 197, 24, 0.18);
}

.op-stats-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

.op-stats-title {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--accent-yellow-dark);
  display: flex;
  align-items: center;
  gap: 6px;
}

.op-stats-title i {
  font-size: 0.9rem;
  color: var(--accent-yellow);
}

.op-stats-loading .spinner-border {
  width: 14px;
  height: 14px;
  border-width: 2px;
  color: var(--accent-orange);
}

.op-stats-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}

.op-stat-item {
  text-align: center;
  padding: 8px 6px;
  background: rgba(255, 255, 255, 0.7);
  border-radius: 10px;
  border: 1px solid rgba(0, 0, 0, 0.04);
  transition: all 0.2s ease;
}

.op-stat-item:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.op-stat-value {
  display: block;
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--accent-yellow-dark);
  line-height: 1.2;
}

.op-stat-label {
  display: block;
  font-size: 0.65rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  margin-top: 2px;
}

/* Animated count update for OP stats */
.op-stat-value.updating {
  animation: op-count-pulse 0.3s ease;
}

@keyframes op-count-pulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.15); color: var(--accent-orange); }
  100% { transform: scale(1); }
}

/* History Panel Styles */
.map-side-card.history .panel-header {
  border-bottom: none;
  padding-bottom: 0;
  margin-bottom: 4px;
}

.map-side-card.history .history-status {
  font-size: 0.85rem;
  color: var(--text-muted);
  padding: 6px 10px;
  background: rgba(0,0,0,0.02);
  border-radius: 8px;
}

/* Map Header Controls */
.map-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  padding: 10px 12px 8px;
}

.map-header-controls {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.vehicle-search-wrapper {
  display: flex;
  gap: 4px;
  align-items: center;
}

.vehicle-search-wrapper input {
  width: 150px;
  font-size: 0.85rem;
}

/* GPS Live Button Enhanced */
.gps-live-btn {
  border-color: var(--accent-yellow);
  color: var(--accent-yellow-dark);
}

.gps-live-btn.active {
  background: linear-gradient(135deg, var(--accent-yellow), var(--accent-orange));
  color: #fff !important;
  border: none;
  animation: gps-pulse 2s infinite ease-in-out;
}

@keyframes gps-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(230, 168, 23, 0.4); }
  50% { box-shadow: 0 0 0 8px rgba(230, 168, 23, 0); }
}

/* Map Legend */
.map-legend {
  position: absolute;
  bottom: 20px;
  left: 10px;
  background: rgba(255, 255, 255, 0.95);
  border-radius: 10px;
  padding: 10px 14px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
  font-size: 0.75rem;
  z-index: 10;
}

.map-legend .legend-title {
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin-bottom: 6px;
  font-size: 0.7rem;
}

.map-legend .legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 4px;
}

.map-legend .legend-item:last-child {
  margin-bottom: 0;
}

.map-legend .legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  border: 2px solid #fff;
  box-shadow: 0 0 3px rgba(0,0,0,0.2);
}

.map-legend .legend-dot.moving {
  background: #22c55a;
}

.map-legend .legend-dot.idle {
  background: #3b82f6;
}

.map-side-card.history {
  border-color: rgba(245, 197, 24, 0.22);
}

.map-side-card.history.loading {
  position: relative;
}

.map-side-card.history.loading::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(255, 255, 255, 0.7);
  border-radius: inherit;
  display: flex;
  align-items: center;
  justify-content: center;
}

.map-side-card.history .history-body {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.map-side-card.history button {
  border-radius: 999px;
  padding: 2px 16px;
  font-size: 0.9rem;
}

.map-side-card.status .value {
  font-size: 1.5rem;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  padding: 2px 12px;
  font-size: 0.85rem;
  font-weight: 600;
  background: var(--accent-orange-soft);
  color: var(--accent-orange-deep);
  width: fit-content;
}

.status-pill.moving {
  background: rgba(34, 197, 90, 0.18);
  color: #15803d;
}

.status-pill.idle {
  background: rgba(59, 130, 246, 0.18);
  color: #1d4ed8;
}

.map-side-card.status .speed::after {
  content: " km/h";
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-left: 4px;
}

.map-side-card.status .coords {
  font-size: 0.9rem;
  color: var(--text-muted);
}

/* Analytics layout */
.analytics-section {
  margin-bottom: 1.25rem;
}

.analytics-section .row.g-3 > [class*="col-"] {
  display: flex;
}

.analytics-section .row.g-3 > [class*="col-"] > .analytics-card {
  width: 100%;
  min-height: 100%;
}

.analytics-card {
  border-radius: 18px;
  padding: 14px;
  background: #fff;
  box-shadow: var(--shadow-soft);
  border: 1px solid var(--card-border);
  height: 100%;
  display: flex;
  flex-direction: column;
}

.stacked-charts {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.stacked-chart {
  background: linear-gradient(180deg, #fff, #fffefb);
  border: 1px solid rgba(13, 154, 106, 0.08);
  border-radius: 16px;
  padding: 6px 8px 10px;
}

.stacked-chart canvas {
  width: 100% !important;
  display: block;
}

.analytics-card .card-title {
  font-weight: 800;
  margin-bottom: 12px;
  color: var(--text-main);
}

.analytics-grid-two {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 18px;
  margin-bottom: 1.5rem;
}

.pyramid-legend {
  display: flex;
  gap: 12px;
  font-size: 12px;
  color: var(--text-muted);
}

.pyramid-legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  display: inline-block;
}

.legend-dot.female {
  background: var(--accent-orange);
}

.legend-dot.male {
  background: var(--accent-yellow);
}

.trend-highlight {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-radius: 16px;
  padding: 12px 16px;
  background: var(--accent-orange-soft);
  margin-bottom: 12px;
  font-weight: 600;
}

.trend-highlight .delta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.trend-highlight.up {
  color: var(--accent-green);
}

.trend-highlight.down {
  color: var(--accent-orange-deep);
}

.trend-highlight.flat {
  color: var(--text-muted);
}

.complaint-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid rgba(15, 23, 42, 0.05);
}

.complaint-item .bar {
  flex: 1;
  background: rgba(52, 211, 153, 0.2);
  height: 6px;
  border-radius: 999px;
  margin-left: 12px;
  position: relative;
}

.complaint-item .bar::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  bottom: 0;
  background: var(--accent-green);
  border-radius: 999px;
  width: var(--bar-width, 0%);
}

.leaderboard {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.leaderboard-row {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 12px;
  align-items: center;
}

.leaderboard-bar {
  background: rgba(15, 23, 42, 0.08);
  border-radius: 999px;
  height: 8px;
  overflow: hidden;
}

.leaderboard-bar span {
  display: block;
  height: 8px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--accent-yellow), var(--accent-orange));
}

.lb-name {
  font-weight: 600;
}

.lb-value {
  font-weight: 600;
  color: var(--text-main);
}

.mandal-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.mandal-list li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px dashed rgba(15, 23, 42, 0.08);
  padding-bottom: 8px;
}

.mandal-list li:last-child {
  border-bottom: none;
}


.mapboxgl-canvas-container {
  background: #fff;
}

.admin-shell {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 24px;
  padding-bottom: 2rem;
}

.admin-header {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  flex-wrap: wrap;
  align-items: flex-start;
}

.admin-eyebrow {
  font-size: 12px;
  letter-spacing: 0.3em;
}

.admin-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.admin-panels {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 24px;
}

.admin-card {
  background: var(--card-bg);
  border-radius: var(--radius-xl);
  border: 1px solid var(--card-border);
  box-shadow: var(--shadow-soft);
  padding: 24px;
}

.admin-card-head h3 {
  margin-bottom: 4px;
  font-weight: 700;
}

.admin-form .form-label {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
}

.admin-form .form-control {
  border-radius: 16px;
  padding: 0.95rem 1.1rem;
  border: 1px solid rgba(15, 23, 42, 0.12);
  box-shadow: none;
}

.admin-form .form-control:focus {
  border-color: rgba(13, 154, 106, 0.5);
  box-shadow: 0 0 0 0.2rem rgba(13, 154, 106, 0.15);
}

.admin-form .form-check-input {
  width: 2.5rem;
  height: 1.2rem;
}

.admin-table th {
  border-top: none;
  color: var(--text-muted);
  letter-spacing: 0.08em;
  font-size: 0.75rem;
  text-transform: uppercase;
}

.admin-table td {
  border-color: rgba(15, 23, 42, 0.06);
  font-weight: 500;
}

.admin-table .btn-link {
  font-weight: 600;
}

@media (max-width: 576px) {
  .admin-card {
    padding: 18px;
  }
}

/* Analytics Page Styles */
.analytics-wrapper {
  background: var(--bg-main);
}

.analytics-section {
  display: block;
}

.analytics-card {
  background: white;
  border-radius: 8px;
  padding: 24px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
  border: 1px solid #f0f0f0;
}

.card-title {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-dark);
}

.analytics-stat-card {
  background: white;
  border-radius: 8px;
  border: 1px solid #f0f0f0;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
  transition: all 0.3s ease;
}

.analytics-stat-card:hover {
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.12);
  transform: translateY(-2px);
}

.analytics-stat-card .label {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  font-weight: 600;
}

.analytics-stat-card .value {
  color: var(--text-dark);
  font-weight: 700;
  line-height: 1.1;
}

.stat-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  background: rgba(59, 130, 246, 0.1);
}

.stat-icon.large {
  background: rgba(59, 130, 246, 0.08);
}

.pyramid-legend {
  display: flex;
  gap: 20px;
  font-size: 0.85rem;
}

.legend-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 2px;
  margin-right: 6px;
}

.legend-dot.female {
  background: #ff862c;
}

.legend-dot.male {
  background: var(--accent-yellow);
}

/* Leaderboard Styling */
.leaderboard {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.leaderboard-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 0;
  border-bottom: 1px solid #f5f5f5;
  font-size: 0.9rem;
}

.leaderboard-row:last-child {
  border-bottom: none;
}

.lb-name {
  font-weight: 500;
  color: var(--text-dark);
}

.leaderboard-bar {
  background: #f5f5f5;
  border-radius: 3px;
  height: 20px;
  position: relative;
  overflow: hidden;
}

.leaderboard-bar span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--accent-yellow), var(--accent-orange));
  border-radius: 3px;
  transition: width 0.3s ease;
}

.lb-value {
  font-weight: 600;
  color: var(--text-dark);
}

/* Mandal List */
/* Analytics Table */
.analytics-table {
  font-size: 0.9rem;
}

.analytics-table thead {
  background: #f8f9fa;
  font-weight: 600;
}

.analytics-table th {
  border-bottom: 2px solid #f0f0f0;
  color: var(--text-dark);
  font-weight: 600;
}

.analytics-table td {
  border-bottom: 1px solid #f5f5f5;
  color: var(--text-dark);
}

.analytics-table tbody tr:hover {
  background: #f8f9fa;
}

.stacked-chart {
  position: relative;
  height: auto;
}

/* Ensure chart containers have enough space to avoid visual overlap */
.stacked-chart canvas.chart-compact {
  display: block;
  width: 100% !important;
  height: 350px !important;
  max-height: 520px;
}

/* District pie chart should use full available height */
.stacked-chart canvas#districtPieChart.chart-compact {
  height: 350px !important;
  max-height: 400px !important;
}

/* Make the main top charts area use a 2-column layout with consistent gaps */
.analytics-section.charts-grid {
  display: grid;
  grid-template-columns: 1.8fr 1fr;
  gap: 24px;
  align-items: start;
}

/* Ensure stacked-chart boxes do not overflow */
.analytics-card .stacked-chart {
  overflow: hidden;
  padding: 8px;
}

/* Pyramid and district pie size tuning */
.stacked-chart canvas#pyramidChart.chart-compact {
  height: 280px !important;
}

@media (max-width: 1024px) {
  .analytics-section.charts-grid {
    grid-template-columns: 1fr;
  }
  .stacked-chart canvas#pyramidChart.chart-compact {
    height: 280px !important;
  }
  .stacked-chart canvas#districtPieChart.chart-compact {
    height: 320px !important;
  }
}

@media (max-width: 1024px) {
  .stacked-chart canvas.chart-compact {
    height: 260px !important;
  }
}

.chart-compact {
  max-width: 100%;
}

.table-responsive {
  overflow-x: auto;
}

.accent-blue {
  border-left: 4px solid var(--accent-blue);
}

.accent-green {
  border-left: 4px solid var(--accent-green);
}

.accent-amber {
  border-left: 4px solid #ff862c;
}

.accent-slate {
  border-left: 4px solid #999;
}

@media (max-width: 1200px) {
  .analytics-section {
    display: block !important;
  }

  .analytics-section > div {
    margin-bottom: 20px;
  }
}

@media (max-width: 768px) {
  .op-master-card {
    padding: 12px;
  }
  .op-master-card .value {
    font-size: 2.6rem;
  }
  .chart-compact {
    max-height: 180px;
  }
  .gender-card {
    min-height: 110px;
  }
  .analytics-card {
    padding: 16px;
  }
  .pyramid-legend {
    flex-direction: column;
    gap: 8px;
  }
}

/* Map layout adjustments: make map fill available area on desktop */
.map-shell .map-layout {
  display: flex;
  gap: 16px;
}

.map-main {
  flex: 1 1 auto;
}

#map {
  width: 100%;
  height: 720px; /* default desktop height */
  border-radius: 8px;
  overflow: hidden;
}

@media (min-width: 1400px) {
  #map {
    height: calc(100vh - 300px); /* larger screens: let map expand */
  }
}

@media (max-width: 1024px) {
  #map {
    height: 420px;
  }
}

/* Professional green/orange/white theme refinements */
body {
  background: var(--bg-main);
  color: var(--text-main);
}

.page-wrap {
  background: transparent;
  padding-top: 32px;
  padding-bottom: 72px;
}

.header-card,
.hero-card,
.card-shell,
.analytics-card,
.district-summary-card,
.admin-card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-card);
}

.hero-card {
  padding: 30px;
  overflow: visible;
  background: linear-gradient(135deg, rgba(15, 142, 92, 0.08), rgba(255, 122, 44, 0.1));
}

.hero-toolbar {
  border-top: 1px solid rgba(15, 23, 42, 0.08);
  margin-top: 24px;
  padding-top: 20px;
}

.toolbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.hero-toolbar input,
.hero-toolbar button,
.hero-toolbar a {
  font-size: 0.85rem;
  border-radius: 999px;
  border: 1px solid rgba(15, 142, 92, 0.3);
  background: #fff;
  color: var(--text-dark);
  padding: 6px 18px;
}

.hero-eyebrow {
  color: var(--accent-green);
}

.hero-title {
  color: var(--text-dark);
}

.hero-description {
  color: var(--text-muted);
}

.btn-refresh,
.btn-analytics,
.btn-auth,
.btn-clear-map {
  background: linear-gradient(120deg, var(--accent-yellow), var(--accent-orange));
  color: #fff;
  border: none;
  box-shadow: 0 15px 35px rgba(230, 168, 23, 0.25);
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.btn-refresh:hover,
.btn-analytics:hover,
.btn-auth:hover,
.btn-clear-map:hover {
  transform: translateY(-1px);
  opacity: 0.95;
}

.btn-manage {
  background: #fff;
  color: var(--accent-yellow-dark);
  border: 1px solid rgba(230, 168, 23, 0.5);
  box-shadow: 0 4px 20px rgba(230, 168, 23, 0.15);
}

.btn-logout {
  background: #fff;
  color: var(--accent-red);
  border: 1px solid rgba(221, 75, 37, 0.35);
}

.analytics-card {
  padding: 24px;
}

.analytics-section {
  margin-bottom: 32px;
}

.analytics-stat-card {
  background: var(--card-secondary);
  border: 1px solid var(--card-border);
  color: var(--text-dark);
  border-radius: 16px;
  padding: 18px 16px;
}

.analytics-stat-card .label {
  color: var(--text-muted);
}

.analytics-stat-card.accent-green {
  border-left: 4px solid var(--accent-green);
}

.analytics-stat-card.accent-blue,
.analytics-stat-card.accent-amber,
.analytics-stat-card.accent-rose {
  border-left: 4px solid var(--accent-orange);
}

.analytics-table thead,
.analytics-table tbody tr {
  border-color: rgba(6, 21, 8, 0.08);
}

.mandal-list li {
  border-bottom: 1px solid rgba(15, 23, 42, 0.08);
}

.district-summary-card {
  background: var(--card-bg);
}

.mmu-summary-row {
  background: var(--card-secondary);
  border-color: var(--card-border);
}

.vehicle-card {
  border-color: rgba(15, 142, 92, 0.15);
  background: #ffffff;
}

.admin-shell {
  padding: 0 10px 60px;
}

.admin-card {
  box-shadow: var(--shadow-card);
}

.admin-form .form-control {
  border-color: rgba(230, 168, 23, 0.28);
}

.admin-form .form-control:focus {
  border-color: var(--accent-yellow);
  box-shadow: 0 0 0 0.2rem rgba(230, 168, 23, 0.2);
}

.app-footer {
  background: transparent;
  padding-bottom: 24px;
}

.footer-badge { background: transparent; }



/* Fleet and Call KPI Cards Alignment */
.dashboard-kpis .fleet-kpi-card,
.dashboard-call-kpis .call-kpi-card {
  min-height: 130px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}

.dashboard-kpis .fleet-kpi-card .h3,
.dashboard-call-kpis .call-kpi-card .h3 {
  line-height: 1.2;
}

/* Hide Mapbox attribution - cleaner map view */
.mapboxgl-ctrl-attrib {
  display: none !important;
}

.mapboxgl-ctrl-logo {
  display: none !important;
}

.mapboxgl-ctrl-bottom-left,
.mapboxgl-ctrl-bottom-right {
  display: none !important;
}

/* Pre-login landing */
.prelogin-header {
  margin-bottom: 1rem;
}

.login-header {
  position: relative;
  background: linear-gradient(120deg, #fff, #fef7e0);
  padding: 1.4rem 1rem;
  border-bottom: 4px solid var(--accent-yellow);
  text-align: center;
  overflow: hidden;
}

.login-header .logos-left,
.login-header .logos-right {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  gap: 0.65rem;
}

.login-header .logos-left { left: 1rem; }
.login-header .logos-right { right: 1rem; }

.login-header .logos-left img,
.login-header .logos-right img {
  height: 78px;
  width: 78px;
  border-radius: 50%;
  object-fit: cover;
  border: 4px solid #fff;
  box-shadow: 0 12px 30px rgba(17, 24, 39, 0.15);
  background: #fff;
}

.login-header .header-title {
  font-weight: 900;
  font-size: 1.35rem;
  color: var(--text-dark);
}

.login-header .header-subtitle {
  font-weight: 700;
  color: var(--text-muted);
  font-size: 0.95rem;
}

@media (max-width: 992px) {
  .login-header {
    padding: 1rem 0.8rem;
  }
  .login-header .logos-left,
  .login-header .logos-right {
    display: none;
  }
}

.prelogin-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
  margin: 1rem 0 1.25rem;
  flex-wrap: wrap;
}

.prelogin-kpis {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
  margin-bottom: 2rem;
}

.prelogin-kpi {
  background: #ffffff;
  border: 1px solid rgba(230, 168, 23, 0.18);
  border-radius: 18px;
  padding: 1rem 1.2rem;
  box-shadow: 0 10px 24px rgba(230, 168, 23, 0.12);
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.prelogin-kpi-label {
  font-weight: 700;
  color: var(--text-muted);
}

.prelogin-kpi-value {
  font-size: 1.6rem;
  font-weight: 900;
  color: var(--accent-yellow-dark);
}

.prelogin-districts {
  margin-bottom: 2rem;
}

.prelogin-section-title {
  font-weight: 800;
  color: var(--text-dark);
  margin-bottom: 1rem;
}

/* Daily OP Cards */
.daily-op-section {
  margin: 1.5rem 0 2rem;
}

.daily-op-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}

.daily-op-title {
  font-weight: 800;
  font-size: 1.35rem;
  color: var(--text-dark);
  margin: 0;
}

.daily-op-subtitle {
  margin: 0.25rem 0 0;
  color: var(--text-muted);
  font-weight: 600;
}

.daily-op-meta {
  font-weight: 700;
  color: var(--accent-green-dark);
  background: var(--accent-green-soft);
  padding: 0.4rem 0.8rem;
  border-radius: 999px;
}

.daily-op-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
}

.daily-op-reports {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 0.8rem;
  align-items: end;
  margin-bottom: 1.2rem;
  background: #ffffff;
  border: 1px solid rgba(230, 168, 23, 0.15);
  border-radius: 16px;
  padding: 0.9rem;
  box-shadow: 0 8px 18px rgba(230, 168, 23, 0.1);
}

.daily-op-report-field {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  font-weight: 600;
  color: var(--text-muted);
}

.daily-op-report-field label {
  font-size: 0.85rem;
}

.daily-op-report-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.daily-op-card {
  background: var(--card-bg);
  border: 1px solid rgba(230, 168, 23, 0.2);
  border-radius: 16px;
  padding: 16px;
  box-shadow: 0 10px 24px rgba(230, 168, 23, 0.12);
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.daily-op-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 18px 32px rgba(230, 168, 23, 0.18);
}

.daily-op-card.active {
  border-color: var(--accent-yellow);
  box-shadow: 0 0 0 3px rgba(230, 168, 23, 0.2), 0 18px 32px rgba(230, 168, 23, 0.22);
}

.daily-op-card-title {
  font-weight: 800;
  font-size: 1rem;
  color: var(--text-dark);
  margin-bottom: 0.4rem;
}

.daily-op-card-count {
  font-weight: 900;
  font-size: 1.5rem;
  color: var(--accent-yellow-dark);
  margin-bottom: 0.35rem;
}

.daily-op-card-subtitle {
  color: var(--text-muted);
  font-weight: 600;
  font-size: 0.9rem;
}

/* Recent 3 Days Breakdown */
.daily-op-card-recent {
  display: flex;
  gap: 10px;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid rgba(230, 168, 23, 0.18);
}

.recent-day {
  display: inline-flex;
  align-items: center;
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 700;
  transition: all 0.3s ease;
}

.recent-day.today {
  background: rgba(255, 134, 44, 0.18);
  color: var(--accent-orange-deep);
  border: 1px solid rgba(255, 134, 44, 0.35);
}

.recent-day.yesterday {
  background: rgba(245, 197, 24, 0.18);
  color: var(--accent-yellow-dark);
  border: 1px solid rgba(245, 197, 24, 0.35);
}

.recent-day.day-before {
  background: rgba(108, 117, 125, 0.12);
  color: #5a6268;
  border: 1px solid rgba(108, 117, 125, 0.25);
}

@keyframes countGlow {
  0% {
    box-shadow: 0 0 0 0 rgba(255, 190, 59, 0.35);
  }
  100% {
    box-shadow: 0 0 0 18px rgba(255, 190, 59, 0);
  }
}

.count-glow {
  animation: countGlow 1.2s ease;
}

@keyframes todayPulse {
  0%, 100% {
    transform: scale(1);
    box-shadow: 0 0 0 0 rgba(255, 134, 44, 0.4);
  }
  50% {
    transform: scale(1.2);
    box-shadow: 0 0 12px 6px rgba(255, 134, 44, 0.4);
  }
}

.today-pulse {
  animation: todayPulse 0.8s ease;
}

/* Enhanced Today Ticking Animation - Bigger Effect */
@keyframes todayTick {
  0% {
    transform: scale(1);
    background: rgba(255, 134, 44, 0.15);
    box-shadow: 0 0 0 0 rgba(255, 134, 44, 0.5);
  }
  25% {
    transform: scale(1.25);
    background: rgba(255, 134, 44, 0.35);
    box-shadow: 0 0 15px 8px rgba(255, 134, 44, 0.4);
  }
  50% {
    transform: scale(1.3);
    background: rgba(255, 134, 44, 0.5);
    box-shadow: 0 0 20px 10px rgba(255, 134, 44, 0.3);
  }
  75% {
    transform: scale(1.15);
    background: rgba(255, 134, 44, 0.3);
  }
  100% {
    transform: scale(1);
    background: rgba(255, 134, 44, 0.15);
    box-shadow: 0 0 0 0 rgba(255, 134, 44, 0);
  }
}

.today-tick {
  animation: todayTick 1s ease forwards;
}

.today-changed {
  position: relative;
}

.today-changed::after {
  content: '⬆';
  position: absolute;
  top: -8px;
  right: -8px;
  font-size: 0.7rem;
  color: var(--accent-orange);
  animation: tickBounce 1.5s ease infinite;
}

@keyframes tickBounce {
  0%, 100% { transform: translateY(0); opacity: 1; }
  50% { transform: translateY(-4px); opacity: 0.7; }
}

/* Vehicle Today Animation */
.vehicle-today-tick {
  animation: vehicleTodayPulse 1s ease forwards;
}

@keyframes vehicleTodayPulse {
  0% {
    transform: scale(1);
    background: rgba(255, 134, 44, 0.15);
  }
  30% {
    transform: scale(1.2);
    background: rgba(255, 134, 44, 0.4);
    box-shadow: 0 0 15px rgba(255, 134, 44, 0.5);
  }
  100% {
    transform: scale(1);
    background: rgba(255, 134, 44, 0.15);
  }
}

/* ── Responsive grid classes for analytics ── */
.analytics-kpi-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}
.analytics-chart-pair {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  margin-bottom: 24px;
}
@media (max-width: 768px) {
  .analytics-kpi-row { grid-template-columns: 1fr; }
  .analytics-chart-pair { grid-template-columns: 1fr; }
}
@media (max-width: 1024px) {
  .analytics-chart-pair { grid-template-columns: 1fr; }
}

/* ── Skip navigation link ── */
.skip-link {
  position: absolute;
  top: -100%;
  left: 16px;
  z-index: 9999;
  padding: 8px 16px;
  background: var(--accent-yellow);
  color: #000;
  font-weight: 700;
  border-radius: 0 0 8px 8px;
  text-decoration: none;
  transition: top 0.2s ease;
}
.skip-link:focus {
  top: 0;
}

/* ── Keyboard focus styles ── */
.district-row:focus-visible,
.vehicle-card:focus-visible,
.daily-op-card:focus-visible {
  outline: 2px solid var(--accent-yellow);
  outline-offset: 2px;
  border-radius: 8px;
}

/* ── Reduced motion ── */
@media (prefers-reduced-motion: reduce) {
  .count-glow,
  .today-tick,
  .today-changed,
  .map-pulse,
  .gps-live-btn.active,
  .spinner-ring,
  .badge-dot {
    animation: none !important;
  }
  .card-shell,
  .analytics-card,
  .kpi-card-pro,
  .card,
  .district-row,
  .btn {
    transition: none !important;
  }
}

/* ── District list bounded scroll ── */
.district-list {
  max-height: 480px;
  scrollbar-width: thin;
  scrollbar-color: var(--accent-yellow) transparent;
}

/* ── Call KPI color classes (replacing inline styles) ── */
.text-call-valid { color: var(--accent-yellow) !important; }
.text-call-invalid { color: #dc2626 !important; }

/* ── Export button styling ── */
.btn-export-csv {
  border: 1px solid var(--accent-yellow);
  color: var(--accent-yellow-dark);
  background: transparent;
  font-weight: 600;
}
.btn-export-csv:hover {
  background: var(--accent-yellow);
  color: #fff;
}

/* ── Leaderboard overflow toggle ── */
.leaderboard-overflow { display: none; }

/* ── Daily OP summary banner ── */
.daily-op-summary {
  display: flex;
  gap: 24px;
  align-items: center;
  justify-content: center;
  padding: 14px 20px;
  margin-bottom: 16px;
  background: linear-gradient(135deg, rgba(245,197,24,0.08), rgba(255,122,44,0.08));
  border: 1px solid rgba(230,168,23,0.2);
  border-radius: 12px;
  font-size: 0.95rem;
}
.daily-op-summary strong {
  font-size: 1.3rem;
  color: var(--accent-yellow-dark);
  margin-right: 4px;
}

/* ── MMU KPI card icon styling ── */
.fleet-kpi-icon {
  font-size: 1.4rem;
  margin-bottom: 6px;
  opacity: 0.85;
}
.fleet-kpi-icon.total { color: var(--accent-yellow-dark); }
.fleet-kpi-icon.scheduled { color: var(--accent-orange); }
.fleet-kpi-icon.onroad { color: #22c55a; }

/* ── Coverage sub-metric ── */
.fleet-kpi-coverage {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 4px;
  font-weight: 600;
}

/* ── Skeleton cards for daily op ── */
.skeleton-card {
  padding: 16px;
  border-radius: 12px;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
}
.skeleton-line {
  height: 14px;
  background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  animation: skeleton-shimmer 1.5s infinite;
  border-radius: 6px;
  margin-bottom: 10px;
}
.skeleton-line.skeleton-title { width: 60%; height: 18px; }
.skeleton-line.skeleton-subtitle { width: 40%; }
.skeleton-line:last-child { margin-bottom: 0; }
@keyframes skeleton-shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ── Pre-login KPI sublabel ── */
.prelogin-kpi-sublabel {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 2px;
  display: block;
}

/* ── Trend indicator for district cards ── */
.trend-indicator {
  font-size: 0.75rem;
  font-weight: 700;
  margin-left: 6px;
}
.trend-indicator.up { color: #22c55a; }
.trend-indicator.down { color: #dc2626; }

/* =====================================================
   DISTRICT HEALTH EXPLORER
   ===================================================== */

.disease-explorer-card {
  min-height: 520px;
}

.disease-explorer-card .card-title {
  display: flex;
  align-items: center;
  gap: 8px;
}

.explorer-hint {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--accent-orange);
  margin-left: auto;
  opacity: 0.8;
}

/* 3-column explorer: Diseases | Map | Drugs */
.disease-explorer-3col {
  display: grid;
  grid-template-columns: 280px 1fr 280px;
  gap: 14px;
  min-height: 0;
}

.explorer-map-panel {
  display: flex;
  flex-direction: column;
  gap: 0;
  min-height: 0;
  position: relative;
}

.explorer-district-label {
  text-align: center;
  font-weight: 800;
  font-size: 1rem;
  color: #92400e;
  min-height: 28px;
  line-height: 28px;
  letter-spacing: 0.02em;
}

.explorer-side-panel {
  display: flex;
  flex-direction: column;
  max-height: 520px;
  overflow-y: auto;
  border-radius: 14px;
  border: 1px solid rgba(245, 197, 24, 0.15);
}

.explorer-diseases {
  background: linear-gradient(180deg, rgba(255,243,224,0.6) 0%, #fff 40%);
}

.explorer-drugs {
  background: linear-gradient(180deg, rgba(227,242,253,0.6) 0%, #fff 40%);
}

.explorer-side-panel::-webkit-scrollbar {
  width: 4px;
}
.explorer-side-panel::-webkit-scrollbar-thumb {
  background: rgba(0,0,0,0.12);
  border-radius: 4px;
}

.explorer-panel-header {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 12px 14px 8px;
  display: flex;
  align-items: center;
  gap: 6px;
  position: sticky;
  top: 0;
  z-index: 1;
}

.explorer-diseases .explorer-panel-header {
  color: #e65100;
  background: rgba(255,243,224,0.95);
}

.explorer-drugs .explorer-panel-header {
  color: #1565c0;
  background: rgba(227,242,253,0.95);
}

.explorer-panel-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex: 1;
  min-height: 200px;
  color: var(--text-muted);
  text-align: center;
  padding: 20px;
  font-size: 0.8rem;
  gap: 8px;
  opacity: 0.5;
}

.explorer-panel-placeholder i {
  font-size: 1.5rem;
}

.explorer-panel-content {
  padding: 8px 12px 14px;
}

.detail-animate-in {
  animation: detailSlideIn 0.35s ease-out;
}

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

.detail-district-header {
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: 2px solid rgba(245, 197, 24, 0.25);
}

.detail-district-name {
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--text-main);
  margin: 0;
  line-height: 1.2;
}

.detail-section {
  margin-bottom: 16px;
}

.detail-section:last-child {
  margin-bottom: 0;
}

.detail-section-title {
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.detail-section-title i {
  font-size: 0.9rem;
}

/* Horizontal bar rows */
.detail-bar-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 0;
}

.detail-bar-row + .detail-bar-row {
  border-top: 1px solid rgba(0,0,0,0.04);
}

.detail-bar-rank {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: rgba(245, 197, 24, 0.15);
  color: var(--accent-yellow-dark);
  font-size: 0.7rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.detail-bar-info {
  flex: 1;
  min-width: 0;
}

.detail-bar-label {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 3px;
}

.detail-bar-track {
  height: 6px;
  background: rgba(0,0,0,0.04);
  border-radius: 3px;
  overflow: hidden;
}

.detail-bar-fill {
  height: 100%;
  border-radius: 3px;
  transition: width 0.5s ease-out;
}

.detail-bar-value {
  font-size: 0.75rem;
  font-weight: 800;
  color: var(--text-main);
  white-space: nowrap;
  min-width: 55px;
  text-align: right;
}

.detail-bar-unit {
  font-weight: 500;
  font-size: 0.65rem;
  color: var(--text-muted);
}

.detail-no-data {
  color: var(--text-muted);
  font-size: 0.8rem;
  padding: 12px;
  text-align: center;
  opacity: 0.7;
}

/* Mapbox popup styling for district map */
#diseaseMap .mapboxgl-popup-content {
  padding: 8px 12px;
  border-radius: 10px;
  font-size: 0.82rem;
  font-family: Inter, "Segoe UI", sans-serif;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
  border: 1px solid rgba(0, 0, 0, 0.06);
}

/* Responsive: stack on smaller screens */
@media (max-width: 1000px) {
  .disease-explorer-3col {
    grid-template-columns: 1fr;
  }

  .explorer-side-panel {
    max-height: none;
  }

  .disease-explorer-3col .explorer-map-panel {
    order: -1;
  }
}

/* ========== INSPECTIONS PAGE (light yellow + white) ========== */
.insp-page {
  max-width: 960px;
  margin: 0 auto;
  padding: 24px 20px 60px;
}

.insp-page-header {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 20px;
  padding: 24px 28px;
  background: linear-gradient(135deg, #fffdf5 0%, #fff9e6 50%, #fff4d6 100%);
  border-radius: 16px;
  border: 1px solid rgba(230, 168, 23, 0.12);
}

.insp-header-icon {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  background: linear-gradient(135deg, #fef3c7, #fde68a);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  color: #b45309;
  flex-shrink: 0;
}

.insp-page-title {
  font-size: 1.4rem;
  font-weight: 800;
  color: #1e293b;
  margin: 0;
  line-height: 1.2;
}

.insp-page-subtitle {
  font-size: 0.82rem;
  color: #78716c;
  margin: 2px 0 0;
}

.insp-header-stats {
  display: flex;
  gap: 20px;
  margin-left: auto;
}

.insp-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 8px 18px;
  background: #fff;
  border-radius: 12px;
  border: 1px solid rgba(230, 168, 23, 0.15);
}

.insp-stat-value {
  font-size: 1.3rem;
  font-weight: 800;
  color: #b45309;
}

.insp-stat-label {
  font-size: 0.7rem;
  color: #78716c;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  font-weight: 600;
}

/* Breadcrumb bar */
.insp-breadcrumb-bar {
  padding: 10px 20px;
  margin-bottom: 16px;
  background: #fff;
  border-radius: 10px;
  border: 1px solid #f0ebe0;
  font-size: 0.88rem;
}

.insp-bc-label {
  font-weight: 700;
  color: #1e293b;
}

.insp-bc-back {
  color: #b45309;
  text-decoration: none;
  font-weight: 600;
  transition: color 0.15s;
}

.insp-bc-back:hover {
  color: #92400e;
  text-decoration: underline;
}

.insp-bc-sep {
  margin: 0 8px;
  color: #d6d3d1;
  font-size: 0.7rem;
}

.insp-bc-current {
  font-weight: 700;
  color: #1e293b;
}

/* Main card */
.insp-card {
  background: #fff;
  border-radius: 16px;
  border: 1px solid #f0ebe0;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

/* Loading state */
.insp-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 60px 20px;
  color: #a8a29e;
  font-size: 0.9rem;
}

.insp-spinner {
  width: 22px;
  height: 22px;
  border: 3px solid #fde68a;
  border-top-color: #b45309;
  border-radius: 50%;
  animation: inspSpin 0.7s linear infinite;
}

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

/* Table */
.insp-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}

.insp-table thead th {
  background: linear-gradient(180deg, #fffdf7 0%, #fef9ee 100%);
  font-weight: 700;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #92400e;
  padding: 12px 16px;
  border-bottom: 2px solid #fde68a;
  position: sticky;
  top: 0;
  z-index: 1;
}

.insp-table tbody td {
  padding: 12px 16px;
  vertical-align: middle;
  border-bottom: 1px solid #faf5eb;
  color: #44403c;
}

.insp-sno {
  color: #a8a29e;
  font-weight: 600;
  font-size: 0.82rem;
}

.insp-name {
  font-weight: 600;
  color: #1e293b;
}

.insp-vehicle {
  font-weight: 700;
  color: #1e293b;
  font-family: 'Fira Code', 'Consolas', monospace;
  letter-spacing: 0.02em;
}

/* Count pill */
.insp-count {
  display: inline-block;
  background: linear-gradient(135deg, #fef3c7, #fde68a);
  color: #92400e;
  font-weight: 700;
  font-size: 0.82rem;
  padding: 4px 14px;
  border-radius: 20px;
  min-width: 50px;
  text-align: center;
  border: 1px solid rgba(180, 83, 9, 0.1);
}

/* Chevron */
.insp-chevron {
  color: #d6d3d1;
  font-size: 0.8rem;
  transition: all 0.2s;
}

/* District row hover */
.insp-district-row {
  cursor: pointer;
  transition: background 0.15s ease;
}

.insp-district-row:hover {
  background: #fffdf5;
}

.insp-district-row:hover .insp-count {
  background: linear-gradient(135deg, #fde68a, #fbbf24);
  color: #78350f;
}

.insp-district-row:hover .insp-chevron {
  color: #b45309;
  transform: translateX(2px);
}

/* Drill row hover */
.insp-drill-row {
  transition: background 0.15s ease;
}

.insp-drill-row:hover {
  background: #fffdf5;
}

/* Total row */
.insp-total-row {
  background: linear-gradient(180deg, #fffdf7 0%, #fef9ee 100%);
  border-top: 2px solid #fde68a;
}

.insp-total-row td {
  padding: 14px 16px;
  font-size: 0.9rem;
}

.insp-total-row strong {
  color: #92400e;
  font-weight: 800;
}

/* Responsive */
@media (max-width: 640px) {
  .insp-page {
    padding: 12px 12px 40px;
  }

  .insp-page-header {
    flex-wrap: wrap;
    padding: 16px;
    gap: 12px;
  }

  .insp-header-stats {
    margin-left: 0;
    width: 100%;
    justify-content: center;
  }

  .insp-table {
    font-size: 0.82rem;
  }

  .insp-table thead th,
  .insp-table tbody td {
    padding: 10px 12px;
  }

  .insp-count {
    font-size: 0.75rem;
    padding: 3px 10px;
  }
}