/* ── Variables ── */
:root {
  /* brand */
  --navy-950:     #0a1830;
  --navy-900:     #132a47;
  --blue-dark:    #132a47;
  --blue-primary: #1d4ed8;
  --blue-light:   #60a5fa;
  --gold:         #d4af37;
  --gold-light:   #f59e0b;
  --white:        #ffffff;
  --gray-light:   #f1f5f9;
  --red-alert:    #dc2626;
  --green-safe:   #16a34a;

  /* neutrals */
  --gray-50:  #f8fafc;
  --gray-100: #f1f5f9;
  --gray-200: #e2e8f0;
  --gray-300: #cbd5e1;
  --gray-400: #94a3b8;
  --gray-500: #64748b;
  --gray-700: #374151;
  --gray-900: #1e293b;

  /* type */
  --font-sans: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;

  /* radius / shadow / motion */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --shadow-sm: 0 1px 3px rgba(15,23,42,.08);
  --shadow-md: 0 4px 14px rgba(15,23,42,.08);
  --shadow-lg: 0 12px 32px rgba(15,23,42,.14);
  --transition-fast: 150ms ease;
  --transition-base: 220ms ease;

  --sidebar-w: 224px;
}

/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; font-family: var(--font-sans); background: var(--gray-light); color: #1e293b; }

/* ── Futuristic ambient background ── */
.bg-futuristic { position: fixed; inset: 0; z-index: 0; overflow: hidden; pointer-events: none; }
.bg-futuristic .blob { position: absolute; border-radius: 50%; filter: blur(100px); will-change: transform; }
.bg-futuristic .blob-1 { width: 520px; height: 520px; background: var(--blue-primary); opacity: .22; top: -140px; left: -120px; animation: blobFloat1 15s ease-in-out infinite; }
.bg-futuristic .blob-2 { width: 460px; height: 460px; background: var(--gold); opacity: .18; bottom: -160px; right: -100px; animation: blobFloat2 18s ease-in-out infinite; }
.bg-futuristic .blob-3 { width: 400px; height: 400px; background: var(--blue-light); opacity: .20; top: 42%; left: 62%; animation: blobFloat3 13s ease-in-out infinite; }

@keyframes blobFloat1 {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33%      { transform: translate(140px, 110px) scale(1.2); }
  66%      { transform: translate(220px, -40px) scale(0.9); }
}
@keyframes blobFloat2 {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33%      { transform: translate(-160px, -90px) scale(1.18); }
  66%      { transform: translate(-70px, 100px) scale(0.88); }
}
@keyframes blobFloat3 {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33%      { transform: translate(-130px, 90px) scale(1.15); }
  66%      { transform: translate(120px, 130px) scale(0.85); }
}
@media (prefers-reduced-motion: reduce) {
  .bg-futuristic .blob { animation: none; }
}

/* ── Auth Layout ── */
.auth-body { background: #e8eef7; min-height: 100vh; display: flex; align-items: center; justify-content: center; }
.auth-card { position: relative; z-index: 1; display: grid; grid-template-columns: 280px 1fr; border-radius: 16px; overflow: hidden; box-shadow: 0 8px 40px rgba(0,0,0,0.15); width: 780px; max-width: 95vw; }

@media (max-width: 639.98px) {
  .auth-card { grid-template-columns: 1fr; width: 95vw; }
  .auth-left { padding: 24px 20px; }
  .auth-right { padding: 28px 22px; }
}
.auth-left { background: linear-gradient(160deg, var(--blue-dark) 0%, #0f2240 100%); padding: 40px 28px; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; }
.auth-logo-circle { width: 80px; height: 80px; background: rgba(255,255,255,0.1); border: 2px solid rgba(212,175,55,0.4); border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 36px; margin-bottom: 18px; }
.auth-brand { color: var(--gold); font-size: 15px; font-weight: 800; letter-spacing: 1px; }
.auth-sub { color: rgba(255,255,255,0.65); font-size: 11px; margin-top: 8px; line-height: 1.6; }
.auth-right { background: #f8faff; padding: 40px 44px; }
.auth-title { font-size: 22px; font-weight: 800; color: var(--blue-dark); margin-bottom: 4px; }
.auth-desc { font-size: 13px; color: #64748b; margin-bottom: 28px; }
.form-label-custom { font-size: 11px; font-weight: 700; color: #374151; text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 5px; display: block; }
.btn-primary-custom { background: linear-gradient(135deg, var(--blue-primary), var(--blue-dark)); color: #fff; border: none; border-radius: 8px; padding: 12px; font-size: 14px; font-weight: 700; width: 100%; cursor: pointer; }
.btn-primary-custom:hover { opacity: 0.92; }

/* ── App Layout ── */
.app-wrapper { position: relative; z-index: 1; display: flex; min-height: 100vh; }

/* Sidebar */
.sidebar { width: var(--sidebar-w); background: var(--blue-dark); display: flex; flex-direction: column; flex-shrink: 0; position: fixed; top: 0; left: 0; height: 100vh; overflow-y: auto; z-index: 100; }
.sidebar-brand { padding: 18px 18px 14px; border-bottom: 1px solid rgba(255,255,255,0.08); display: flex; align-items: center; gap: 10px; }
.brand-icon { font-size: 24px; display: inline-flex; }
.brand-text { color: var(--gold); font-size: 11px; font-weight: 800; line-height: 1.3; }
.brand-sub { color: rgba(255,255,255,0.45); font-size: 9px; }
.sidebar-nav { padding: 10px 0; flex: 1; }
.nav-section-label { font-size: 9px; font-weight: 700; text-transform: uppercase; letter-spacing: 1.2px; color: rgba(255,255,255,0.3); padding: 12px 18px 5px; }
.nav-item { display: flex; align-items: center; gap: 10px; padding: 9px 18px; font-size: 12px; font-weight: 600; color: rgba(255,255,255,0.65); text-decoration: none; transition: all 0.15s; border-left: 3px solid transparent; }
.nav-item.active { background: linear-gradient(90deg,rgba(29,78,216,0.8),rgba(29,78,216,0.15)); color: #fff; border-left-color: var(--gold); }
.nav-item:hover:not(.active) { background: rgba(255,255,255,0.06); color: #fff; }
.nav-icon { width: 18px; text-align: center; font-size: 14px; }
.nav-badge { margin-left: auto; background: var(--red-alert); color: #fff; font-size: 9px; padding: 1px 6px; border-radius: 999px; font-weight: 700; }
.nav-divider { border-top: 1px solid rgba(255,255,255,0.08); margin: 10px 0; }
.nav-item-btn { background: none; border: none; width: 100%; cursor: pointer; }
.nav-logout-form { margin: 0; }

/* Main */
.main-wrapper { margin-left: var(--sidebar-w); flex: 1; display: flex; flex-direction: column; min-height: 100vh; }
.topbar { background: #fff; padding: 10px 24px; display: flex; align-items: center; justify-content: flex-start; border-bottom: 1px solid #e2e8f0; box-shadow: 0 1px 4px rgba(0,0,0,0.05); position: sticky; top: 0; z-index: 50; }
.topbar-date { font-size: 13px; color: #64748b; }
.topbar-date strong { color: var(--blue-dark); }
.topbar-right { display: flex; align-items: center; gap: 16px; margin-left: auto; }
.topbar-notif { position: relative; font-size: 20px; text-decoration: none; display: inline-flex; }
.notif-dot { position: absolute; top: 0; right: -2px; width: 9px; height: 9px; background: var(--red-alert); border-radius: 50%; border: 2px solid #fff; }
.topbar-user { display: flex; align-items: center; gap: 10px; }
.user-avatar { width: 34px; height: 34px; background: linear-gradient(135deg,var(--blue-primary),var(--blue-dark)); border-radius: 50%; color: #fff; display: flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 700; }
.user-name { font-size: 12px; font-weight: 700; color: var(--blue-dark); }
.user-role { font-size: 10px; color: #94a3b8; }
.page-content { padding: 24px; flex: 1; }

/* ── Cards ── */
.stat-card { background: #fff; border-radius: 12px; padding: 18px; display: flex; align-items: center; gap: 14px; box-shadow: 0 1px 4px rgba(0,0,0,0.06); border-left: 4px solid; }
.stat-card-red    { border-left-color: var(--red-alert); }
.stat-card-yellow { border-left-color: var(--gold-light); }
.stat-card-green  { border-left-color: var(--green-safe); }
.stat-card-blue   { border-left-color: var(--blue-primary); }
.stat-num  { font-size: 28px; font-weight: 800; color: var(--blue-dark); line-height: 1; }
.stat-label { font-size: 12px; color: #64748b; margin-top: 3px; }

/* ── Badges ── */
.badge-tinggi  { background: #fee2e2; color: var(--red-alert); font-size: 10px; font-weight: 700; padding: 2px 9px; border-radius: 999px; white-space: nowrap; }
.badge-sedang  { background: #fef9c3; color: #a16207; font-size: 10px; font-weight: 700; padding: 2px 9px; border-radius: 999px; white-space: nowrap; }
.badge-rendah  { background: #dcfce7; color: var(--green-safe); font-size: 10px; font-weight: 700; padding: 2px 9px; border-radius: 999px; white-space: nowrap; }
.badge-aktif   { background: #dcfce7; color: var(--green-safe); font-size: 10px; font-weight: 700; padding: 2px 9px; border-radius: 999px; }
.badge-nonaktif { background: #f1f5f9; color: #64748b; font-size: 10px; font-weight: 700; padding: 2px 9px; border-radius: 999px; }

/* ── Page Header ── */
.page-header { margin-bottom: 20px; }
.page-title { font-size: 20px; font-weight: 800; color: var(--blue-dark); }
.page-subtitle { font-size: 12px; color: #94a3b8; margin-top: 2px; }

/* ── Detail Page ── */
.detail-back { font-size: 12px; color: #64748b; text-decoration: none; }
.detail-back:hover { color: var(--blue-dark); }
.detail-row { display: flex; justify-content: space-between; gap: 16px; padding: 10px 0; border-bottom: 1px solid #f1f5f9; font-size: 13px; }
.detail-row:last-child { border-bottom: none; }
.detail-label { color: #94a3b8; font-weight: 600; flex-shrink: 0; }
.detail-value { color: #1e293b; font-weight: 600; text-align: right; }
.map-popup-link { display: inline-block; margin-top: 6px; font-size: 11px; font-weight: 700; color: var(--blue-primary); text-decoration: none; }
.map-popup-link:hover { text-decoration: underline; }

/* ── Trend range toggle ── */
.trend-range-toggle { display: inline-flex; gap: 3px; background: var(--gray-100); padding: 3px; border-radius: 8px; }
.trend-range-toggle button { border: none; background: transparent; font-size: 11px; font-weight: 700; color: var(--gray-500); padding: 5px 11px; border-radius: 6px; cursor: pointer; transition: all var(--transition-fast); }
.trend-range-toggle button:hover:not(.active) { color: var(--blue-dark); }
.trend-range-toggle button.active { background: #fff; color: var(--blue-dark); box-shadow: var(--shadow-sm); }

/* ── Map ── */
.map-container { border-radius: var(--radius-md); overflow: hidden; border: 1.5px solid var(--gray-200); box-shadow: var(--shadow-sm); }
#map, #map-input { background: #e8f4f8; }

/* ── Map Input (Form) ── */
.map-input-wrapper { border: 1.5px solid var(--gray-300); border-radius: var(--radius-md); overflow: hidden; box-shadow: var(--shadow-sm); }
.map-search-bar { display: flex; border-bottom: 1.5px solid #d1d5db; background: #f8fafc; }
.map-search-bar input { flex: 1; border: none; background: transparent; padding: 9px 12px; font-size: 13px; outline: none; }
.map-search-bar button { background: var(--blue-primary); color: #fff; border: none; padding: 8px 16px; font-size: 12px; font-weight: 700; cursor: pointer; }
.coord-bar { display: flex; gap: 10px; padding: 8px 14px; background: #f0f9ff; border-top: 1px solid #bae6fd; font-size: 12px; }
.coord-bar .coord-label { font-weight: 700; color: #0369a1; font-size: 10px; text-transform: uppercase; }
.coord-bar .coord-val { font-family: monospace; color: var(--blue-dark); }

/* ── Tables ── */
.table-card { background: #fff; border-radius: 12px; box-shadow: 0 1px 4px rgba(0,0,0,0.06); overflow: hidden; }
.table-card .table { margin: 0; font-size: 13px; }
.table-card .table th { background: #f8fafc; font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px; color: #64748b; padding: 10px 14px; border-bottom: 1.5px solid #e2e8f0; }
.table-card .table td { padding: 10px 14px; vertical-align: middle; border-bottom: 1px solid #f1f5f9; color: #374151; }
.table-card .table tr:last-child td { border-bottom: none; }

/* ── Filter Bar ── */
.filter-bar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.filter-bar select, .filter-bar input { font-size: 12px; padding: 6px 10px; border: 1.5px solid #d1d5db; border-radius: 7px; background: #fff; }
.btn-sm-custom { font-size: 11px; font-weight: 700; padding: 6px 14px; border-radius: 7px; border: none; cursor: pointer; }
.btn-primary-sm { background: var(--blue-primary); color: #fff; }
.btn-outline-sm { background: transparent; color: var(--blue-dark); border: 1.5px solid var(--blue-dark); }

/* ── Forms ── */
.form-card { background: #fff; border-radius: 12px; padding: 24px; box-shadow: 0 1px 4px rgba(0,0,0,0.06); }
.form-section-title { font-size: 13px; font-weight: 700; color: var(--blue-dark); margin-bottom: 14px; padding-bottom: 8px; border-bottom: 1.5px solid #e2e8f0; }

/* ── Buttons (themes Bootstrap's own .btn classes via its CSS variable API) ── */
.btn {
  --bs-btn-border-radius: var(--radius-sm);
  --bs-btn-font-weight: 700;
  --bs-btn-padding-y: 9px;
  --bs-btn-padding-x: 20px;
  --bs-btn-font-size: 13px;
  font-family: var(--font-sans);
  transition: transform var(--transition-fast), box-shadow var(--transition-fast), background-color var(--transition-fast), border-color var(--transition-fast);
}
.btn:hover { transform: translateY(-1px); box-shadow: var(--shadow-sm); }
.btn:active { transform: translateY(0); }

.btn-primary {
  --bs-btn-bg: var(--blue-primary);
  --bs-btn-border-color: var(--blue-primary);
  --bs-btn-hover-bg: var(--blue-dark);
  --bs-btn-hover-border-color: var(--blue-dark);
  --bs-btn-active-bg: var(--blue-dark);
  --bs-btn-active-border-color: var(--blue-dark);
  --bs-btn-focus-shadow-rgb: 29, 78, 216;
}
.btn-secondary {
  --bs-btn-bg: var(--gray-500);
  --bs-btn-border-color: var(--gray-500);
  --bs-btn-hover-bg: var(--gray-700);
  --bs-btn-hover-border-color: var(--gray-700);
  --bs-btn-active-bg: var(--gray-700);
  --bs-btn-active-border-color: var(--gray-700);
}
.btn-danger {
  --bs-btn-bg: var(--red-alert);
  --bs-btn-border-color: var(--red-alert);
  --bs-btn-hover-bg: #b91c1c;
  --bs-btn-hover-border-color: #b91c1c;
  --bs-btn-active-bg: #b91c1c;
  --bs-btn-active-border-color: #b91c1c;
}
.btn-success {
  --bs-btn-bg: var(--green-safe);
  --bs-btn-border-color: var(--green-safe);
  --bs-btn-hover-bg: #15803d;
  --bs-btn-hover-border-color: #15803d;
  --bs-btn-active-bg: #15803d;
  --bs-btn-active-border-color: #15803d;
}
.btn-warning {
  --bs-btn-color: #fff;
  --bs-btn-bg: var(--gold-light);
  --bs-btn-border-color: var(--gold-light);
  --bs-btn-hover-color: #fff;
  --bs-btn-hover-bg: #d97706;
  --bs-btn-hover-border-color: #d97706;
  --bs-btn-active-color: #fff;
  --bs-btn-active-bg: #d97706;
  --bs-btn-active-border-color: #d97706;
}
.btn-sm {
  --bs-btn-padding-y: 4px;
  --bs-btn-padding-x: 12px;
  --bs-btn-font-size: 11px;
  --bs-btn-border-radius: 6px;
  white-space: nowrap;
}

@media (prefers-reduced-motion: reduce) {
  .btn { transition: none; }
  .btn:hover, .btn:active { transform: none; }
}

/* ── Responsive: off-canvas sidebar ── */
.sidebar-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--blue-dark);
  padding: 4px;
  margin-right: 12px;
  cursor: pointer;
  align-items: center;
  justify-content: center;
}
.sidebar-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(10,24,48,.45);
  z-index: 199;
  opacity: 0;
  transition: opacity var(--transition-base);
}
.sidebar-backdrop.is-visible { display: block; opacity: 1; }

@media (max-width: 991.98px) {
  .sidebar {
    transform: translateX(-100%);
    transition: transform var(--transition-base);
    box-shadow: var(--shadow-lg);
    z-index: 200;
  }
  .sidebar.is-open { transform: translateX(0); }
  .main-wrapper { margin-left: 0; }
  .sidebar-toggle { display: inline-flex; }
}

@media (max-width: 575.98px) {
  .page-content { padding: 16px; }
}

@media (prefers-reduced-motion: reduce) {
  .sidebar, .sidebar-backdrop { transition: none; }
}

/* ── Component polish ── */
.stat-card {
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  transition: transform var(--transition-fast), box-shadow var(--transition-fast);
}
.stat-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }

.stat-card-icon {
  width: 44px; height: 44px; border-radius: var(--radius-md);
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.stat-card-red    .stat-card-icon { background: #fee2e2; color: var(--red-alert); }
.stat-card-yellow .stat-card-icon { background: #fef3c7; color: var(--gold-light); }
.stat-card-green  .stat-card-icon { background: #dcfce7; color: var(--green-safe); }
.stat-card-blue   .stat-card-icon { background: #dbeafe; color: var(--blue-primary); }
.stat-card-gold   { border-left-color: var(--gold); }
.stat-card-gold   .stat-card-icon { background: #faf3dc; color: var(--gold); }

/* Compact stat-card variant for narrow columns (e.g. analisa-sebaran RINGKASAN) */
.stat-card-compact { padding: 10px 12px; gap: 10px; }
.stat-card-compact .stat-card-icon { width: 32px; height: 32px; border-radius: var(--radius-sm); }
.stat-card-compact .stat-num { font-size: 18px; }
.stat-card-compact .stat-label { font-size: 10px; margin-top: 1px; }

/* ── Bidang Analysis Cards (Astagatra) ── */
.bidang-card {
  background: #fff;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  border-left: 4px solid;
  padding: 14px 16px;
  height: 100%;
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: transform var(--transition-fast), box-shadow var(--transition-fast);
}
.bidang-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.bidang-card-header { display: flex; align-items: center; gap: 10px; }
.bidang-card-icon {
  width: 36px; height: 36px; border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.bidang-card-label { font-size: 11px; font-weight: 700; letter-spacing: 0.4px; text-transform: uppercase; color: #64748b; }
.bidang-card-total { font-size: 26px; font-weight: 800; color: var(--blue-dark); line-height: 1; }
.bidang-card-insight { font-size: 11.5px; color: #475569; line-height: 1.5; font-weight: 600; }

.bidang-card-gold   { border-left-color: var(--gold); }
.bidang-card-gold   .bidang-card-icon { background: #faf3dc; color: var(--gold); }
.bidang-card-blue   { border-left-color: var(--blue-primary); }
.bidang-card-blue   .bidang-card-icon { background: #dbeafe; color: var(--blue-primary); }
.bidang-card-green  { border-left-color: var(--green-safe); }
.bidang-card-green  .bidang-card-icon { background: #dcfce7; color: var(--green-safe); }
.bidang-card-yellow { border-left-color: var(--gold-light); }
.bidang-card-yellow .bidang-card-icon { background: #fef3c7; color: var(--gold-light); }
.bidang-card-red    { border-left-color: var(--red-alert); }
.bidang-card-red    .bidang-card-icon { background: #fee2e2; color: var(--red-alert); }

.table-card {
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
}
.table-card .table tbody tr { transition: background-color var(--transition-fast); }
.table-card .table tbody tr:hover td { background: var(--gray-50); }

.form-card {
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
}
.form-card .form-control:focus,
.form-card .form-select:focus {
  border-color: var(--blue-light);
  box-shadow: 0 0 0 3px rgba(96,165,250,.25);
}

.badge-tinggi, .badge-sedang, .badge-rendah, .badge-aktif, .badge-nonaktif {
  letter-spacing: .3px;
}

/* Restyle Bootstrap alerts to match the theme */
.alert {
  border: none;
  border-left: 4px solid;
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-sm);
  animation: alert-in var(--transition-base) both;
}
.alert-success { border-left-color: var(--green-safe); }
.alert-danger  { border-left-color: var(--red-alert); }

@keyframes alert-in {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Sidebar nav: smoother active/hover transition + icon hover scale */
.nav-item {
  transition: background-color var(--transition-fast), border-color var(--transition-fast), color var(--transition-fast);
}
.nav-item .nav-icon { transition: transform var(--transition-fast); display: inline-flex; }
.nav-item:hover .nav-icon { transform: scale(1.12); }

/* Notification bell: pulse the unread dot */
.notif-dot { animation: notif-pulse 1.8s ease-in-out infinite; }
@keyframes notif-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(220,38,38,.5); }
  50%      { box-shadow: 0 0 0 4px rgba(220,38,38,0); }
}

@media (prefers-reduced-motion: reduce) {
  .stat-card, .table-card .table tbody tr, .bidang-card { transition: none; }
  .stat-card:hover, .bidang-card:hover { transform: none; }
  .alert { animation: none; }
  .nav-item, .nav-item .nav-icon { transition: none; }
  .nav-item:hover .nav-icon { transform: none; }
  .notif-dot { animation: none; }
}

/* ── Motion: spinner + entrance stagger ── */
.btn-spinner {
  display: inline-block;
  width: 13px; height: 13px;
  border: 2px solid rgba(255,255,255,.4);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin .6s linear infinite;
  vertical-align: -2px;
}
@keyframes spin { to { transform: rotate(360deg); } }

@keyframes fade-in-up {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}
.stat-card, .table-card .table tbody tr {
  animation: fade-in-up var(--transition-base) backwards;
}
.row.g-3 > div:nth-child(1) .stat-card { animation-delay: 0ms; }
.row.g-3 > div:nth-child(2) .stat-card { animation-delay: 40ms; }
.row.g-3 > div:nth-child(3) .stat-card { animation-delay: 80ms; }
.row.g-3 > div:nth-child(4) .stat-card { animation-delay: 120ms; }
.table-card .table tbody tr:nth-child(1) { animation-delay: 0ms; }
.table-card .table tbody tr:nth-child(2) { animation-delay: 30ms; }
.table-card .table tbody tr:nth-child(3) { animation-delay: 60ms; }
.table-card .table tbody tr:nth-child(4) { animation-delay: 90ms; }
.table-card .table tbody tr:nth-child(5) { animation-delay: 120ms; }
.table-card .table tbody tr:nth-child(6) { animation-delay: 150ms; }
.table-card .table tbody tr:nth-child(7) { animation-delay: 180ms; }
.table-card .table tbody tr:nth-child(8) { animation-delay: 210ms; }

@media (prefers-reduced-motion: reduce) {
  .btn-spinner { animation: none; }
  .stat-card, .table-card .table tbody tr { animation: none; }
}

/* ── Map: frame, legend, zoom control ── */
.map-frame {
  position: relative;
  border-radius: var(--radius-md) var(--radius-md) 0 0;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}
.map-legend-chip {
  position: absolute;
  top: 12px; right: 12px;
  z-index: 1000;
  background: rgba(255,255,255,.92);
  border-radius: 999px;
  padding: 6px 14px;
  font-size: 11px;
  font-weight: 600;
  color: var(--gray-700);
  display: flex;
  align-items: center;
  gap: 10px;
  box-shadow: var(--shadow-sm);
}
.map-legend-chip span { display: inline-flex; align-items: center; }
.legend-dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; margin-right: 4px; }
.legend-dot-tinggi { background: var(--red-alert); }
.legend-dot-sedang { background: var(--gold-light); }
.legend-dot-rendah { background: var(--green-safe); }

.leaflet-control-zoom { border: none !important; box-shadow: var(--shadow-sm) !important; border-radius: var(--radius-sm) !important; overflow: hidden; }
.leaflet-control-zoom a { width: 30px !important; height: 30px !important; line-height: 30px !important; background: #fff !important; color: var(--blue-dark) !important; border: none !important; font-size: 16px !important; }
.leaflet-control-zoom a:hover { background: var(--gray-100) !important; }

/* ── Map: high-risk pulse ── */
@keyframes zona-pulse {
  0%, 100% { fill-opacity: .35; stroke-opacity: 1; }
  50%      { fill-opacity: .65; stroke-opacity: .55; }
}
.zona-pulse { animation: zona-pulse 2.2s ease-in-out infinite; }

@media (prefers-reduced-motion: reduce) {
  .zona-pulse { animation: none; }
}
