/* Modern GIS Dashboard Styling - Map PKB Timor Tengah Selatan */
/* Tema Terang (Light Theme) & Infografis Peta Kedinasan Bapenda TTS */
@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@300;400;500;600;700;800&family=JetBrains+Mono:wght@400;500;600;700&display=swap');

:root {
  /* Sidebar Light Theme Palette */
  --sidebar-bg: #FFFFFF;
  --sidebar-card-bg: #F8FAFC;
  --sidebar-card-hover: #F1F5F9;
  --sidebar-border: #E2E8F0;
  --sidebar-border-focus: #3B82F6;

  --text-main: #0F172A;
  --text-body: #334155;
  --text-muted: #64748B;
  --text-dim: #94A3B8;

  --primary: #1D4ED8;
  --primary-light: #3B82F6;
  --accent-cyan: #0284C7;
  --accent-emerald: #16A34A;
  --accent-amber: #D97706;
  --accent-rose: #DC2626;

  /* Map Canvas Theme */
  --map-bg: #E0F2FE;

  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.08), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
  --shadow-lg: 0 10px 25px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1);
  --shadow-blue: 0 4px 14px rgba(29, 78, 216, 0.25);

  --sidebar-w: 390px;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  background-color: var(--map-bg);
  color: var(--text-main);
  overflow: hidden;
  height: 100vh;
  width: 100vw;
  max-width: 100%;
}

/* App Container */
.app-container {
  display: flex;
  height: 100vh;
  width: 100vw;
  max-width: 100%;
  position: relative;
  overflow: hidden;
}

/* Sidebar Styling - Tema Terang */
.sidebar {
  width: var(--sidebar-w);
  height: 100vh;
  background: var(--sidebar-bg);
  border-right: 1px solid var(--sidebar-border);
  display: flex;
  flex-direction: column;
  z-index: 1000;
  box-shadow: 4px 0 20px rgba(0, 0, 0, 0.06);
  transition: margin-left 0.3s cubic-bezier(0.4, 0, 0.2, 1), transform 0.3s ease;
  flex-shrink: 0;
}

.sidebar.collapsed {
  margin-left: calc(-1 * var(--sidebar-w));
}

.sidebar-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--sidebar-border);
  background: #FFFFFF;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo-badge {
  display: flex;
  align-items: center;
  gap: 12px;
}

.logo-icon {
  width: 44px;
  height: 44px;
  background: linear-gradient(135deg, #1E3A8A 0%, #2563EB 50%, #0284C7 100%);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
  font-size: 20px;
  color: #FFFFFF;
}

.app-logo-img {
  width: 40px;
  height: 48px;
  object-fit: contain;
  filter: drop-shadow(0 2px 5px rgba(0, 0, 0, 0.16));
  flex-shrink: 0;
  transition: transform 0.2s ease;
}

.app-logo-img:hover {
  transform: scale(1.06);
}

.top-pill-logo {
  width: 18px;
  height: auto;
  object-fit: contain;
  vertical-align: middle;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.15));
  margin-right: 2px;
}

.logo-title h1 {
  font-size: 15px;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: #0F172A;
}

.logo-title p {
  font-size: 11px;
  color: #2563EB;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-top: 1px;
}

.btn-toggle-sidebar {
  background: #F1F5F9;
  border: 1px solid var(--sidebar-border);
  color: var(--text-muted);
  width: 34px;
  height: 34px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-toggle-sidebar:hover {
  background: #E2E8F0;
  color: var(--text-main);
  border-color: #CBD5E1;
}

/* Sidebar Scrollable Body */
.sidebar-content {
  flex: 1;
  overflow-y: auto;
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.sidebar-content::-webkit-scrollbar {
  width: 6px;
}

.sidebar-content::-webkit-scrollbar-thumb {
  background: #CBD5E1;
  border-radius: 4px;
}

/* Section Title */
.section-title {
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #475569;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

/* KPI Cards Grid */
.kpi-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.kpi-card {
  background: var(--sidebar-card-bg);
  border: 1px solid var(--sidebar-border);
  border-radius: 12px;
  padding: 12px 14px;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: all 0.2s ease;
}

.kpi-card:hover {
  background: #FFFFFF;
  border-color: #CBD5E1;
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}

.kpi-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
}

.kpi-card.blue::before {
  background: #2563EB;
}

.kpi-card.emerald::before {
  background: #16A34A;
}

.kpi-card.rose::before {
  background: #DC2626;
}

.kpi-card.amber::before {
  background: #D97706;
}

.kpi-label {
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 600;
  margin-bottom: 4px;
}

.kpi-value {
  font-size: 19px;
  font-weight: 800;
  font-family: 'JetBrains Mono', monospace;
  letter-spacing: -0.03em;
}

.kpi-card.blue .kpi-value {
  color: #1D4ED8;
}

.kpi-card.rose .kpi-value {
  color: #DC2626;
}

.kpi-card.emerald .kpi-value {
  color: #16A34A;
}

.kpi-card.amber .kpi-value {
  color: #B45309;
}

.kpi-sub {
  font-size: 10px;
  color: var(--text-dim);
  font-weight: 600;
  margin-top: 4px;
  display: flex;
  align-items: center;
  gap: 4px;
}

/* Wadah Data Kendaraan Belum Teridentifikasi Kecamatan (Terintegrasi KPI) */
.unidentified-box {
  background: #FFFFFF;
  border: 1px solid #E2E8F0;
  border-left: 3px solid #6366F1;
  border-radius: 12px;
  padding: 10px 12px;
  margin-top: 10px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
  transition: all 0.2s ease;
}

.unidentified-box:hover {
  border-color: #CBD5E1;
  border-left-color: #4F46E5;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.06);
}

.unidentified-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.unidentified-header-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.unidentified-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: #EFF6FF;
  color: #2563EB;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
}

.unidentified-title {
  font-size: 11.5px;
  font-weight: 800;
  color: #0F172A;
  line-height: 1.2;
}

.unidentified-sub {
  font-size: 10px;
  color: #64748B;
  font-weight: 600;
}

.unidentified-badge {
  font-size: 9.5px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 20px;
  background: #F1F5F9;
  color: #64748B;
}

.unidentified-badge.has-data {
  background: #DCFCE7;
  color: #15803D;
}

.unidentified-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  margin-bottom: 8px;
}

.u-card {
  background: #F8FAFC;
  border: 1px solid #E2E8F0;
  border-radius: 8px;
  padding: 6px 3px;
  text-align: center;
}

.u-label {
  font-size: 8.5px;
  font-weight: 700;
  color: #64748B;
  display: block;
  text-transform: uppercase;
  margin-bottom: 2px;
}

.u-val {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  font-weight: 800;
  display: block;
  white-space: nowrap;
}

.u-val.green {
  color: #15803D;
}

.u-val.red {
  color: #DC2626;
}

.u-val.emerald {
  color: #16A34A;
}

.u-val.blue {
  color: #1D4ED8;
}

.unidentified-note {
  font-size: 9.5px;
  color: #94A3B8;
  display: flex;
  align-items: center;
  gap: 5px;
  line-height: 1.3;
}

/* Mode Switcher Buttons */
.mode-switcher {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.mode-btn {
  background: var(--sidebar-card-bg);
  border: 1px solid var(--sidebar-border);
  border-radius: 10px;
  padding: 10px 14px;
  color: var(--text-body);
  font-size: 13px;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: var(--shadow-sm);
  transition: all 0.2s ease;
}

.mode-btn:hover {
  background: #FFFFFF;
  border-color: #CBD5E1;
  color: #0F172A;
}

.mode-btn.active {
  background: linear-gradient(90deg, #1D4ED8 0%, #2563EB 100%);
  border-color: #1D4ED8;
  color: #FFFFFF;
  box-shadow: var(--shadow-blue);
}

.mode-btn-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.mode-icon {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: #FFFFFF;
  border: 1px solid var(--sidebar-border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
}

.mode-btn.active .mode-icon {
  background: rgba(255, 255, 255, 0.2);
  border-color: transparent;
  color: #FFFFFF !important;
}

.mode-btn.active .mode-icon i {
  color: #FFFFFF !important;
}

/* Search Box */
.search-container {
  position: relative;
}

.search-input {
  width: 100%;
  background: #F8FAFC;
  border: 1px solid var(--sidebar-border);
  border-radius: 10px;
  padding: 10px 12px 10px 38px;
  color: #0F172A;
  font-size: 13px;
  font-weight: 500;
  outline: none;
  transition: all 0.2s ease;
}

.search-input:focus {
  background: #FFFFFF;
  border-color: #2563EB;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: #94A3B8;
  font-size: 14px;
}

/* Kecamatan Ranking List */
.rank-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.rank-item {
  background: var(--sidebar-card-bg);
  border: 1px solid var(--sidebar-border);
  border-radius: 8px;
  padding: 9px 12px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: all 0.15s ease;
}

.rank-item:hover {
  background: #FFFFFF;
  border-color: #CBD5E1;
  box-shadow: var(--shadow-sm);
  transform: translateX(3px);
}

.rank-num {
  font-size: 11px;
  font-weight: 800;
  width: 22px;
  color: #64748B;
}

.rank-info {
  flex: 1;
  padding: 0 8px;
}

.rank-name {
  font-size: 12px;
  font-weight: 700;
  color: #0F172A;
}

.rank-bar-bg {
  height: 5px;
  background: #E2E8F0;
  border-radius: 3px;
  margin-top: 4px;
  overflow: hidden;
}

.rank-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #F59E0B, #DC2626);
  border-radius: 3px;
}

.rank-val {
  font-size: 12px;
  font-family: 'JetBrains Mono', monospace;
  font-weight: 700;
  color: #DC2626;
  text-align: right;
}

/* Sidebar Footer */
.sidebar-footer {
  padding: 14px 20px;
  border-top: 1px solid var(--sidebar-border);
  background: #F8FAFC;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.btn-sidebar {
  flex: 1;
  min-width: 100px;
  background: #FFFFFF;
  border: 1px solid var(--sidebar-border);
  border-radius: 8px;
  padding: 8px 10px;
  font-size: 11px;
  font-weight: 700;
  color: #334155;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  box-shadow: var(--shadow-sm);
  transition: all 0.2s ease;
}

.btn-sidebar:hover {
  background: #F1F5F9;
  color: #0F172A;
  border-color: #CBD5E1;
}

.btn-sidebar.primary-admin {
  background: #1E293B;
  color: #FFFFFF;
  border-color: #0F172A;
  width: 100%;
  flex-basis: 100%;
  padding: 10px;
}

.btn-sidebar.primary-admin:hover {
  background: #0F172A;
}

.app-copyright {
  width: 100%;
  text-align: center;
  font-size: 11px;
  color: #64748B;
  padding-top: 8px;
  margin-top: 4px;
  border-top: 1px dashed #E2E8F0;
  letter-spacing: 0.01em;
}

.app-copyright strong {
  color: #1D4ED8;
  font-weight: 400;
}


/* Map Container */
.map-container {
  flex: 1;
  height: 100vh;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  position: relative;
  background: #E0F2FE;
  overflow: hidden;
}

#map {
  width: 100% !important;
  height: 100% !important;
  z-index: 1;
}

/* Unified Sidebar Toggle Button (Inside top-bar-left, visible when desktop sidebar is minimized or on mobile) */
.floating-sidebar-toggle {
  position: relative;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid #CBD5E1;
  color: #1D4ED8;
  border-radius: 10px;
  padding: 0 14px;
  height: 38px;
  font-size: 12px;
  font-weight: 700;
  display: none; /* Hidden on desktop when sidebar is open */
  align-items: center;
  gap: 7px;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.08);
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  pointer-events: auto !important;
  flex-shrink: 0;
  user-select: none;
  touch-action: manipulation;
}

.floating-sidebar-toggle:hover {
  background: #EFF6FF;
  border-color: #2563EB;
  color: #1D4ED8;
  transform: translateY(-1px);
}

#sidebar.collapsed ~ .map-container .floating-sidebar-toggle {
  display: inline-flex !important;
}

/* Hover Highlight on Sidebar KPI Cards */
.kpi-card.kpi-hover-active {
  border-color: #2563EB !important;
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.25), 0 8px 16px rgba(37, 99, 235, 0.12) !important;
  transform: translateY(-2px);
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Tooltip for Kabupaten Cumulative Hover */
.kabupaten-hover-tooltip {
  background: rgba(15, 23, 42, 0.94) !important;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.15) !important;
  border-radius: 10px !important;
  color: #FFFFFF !important;
  padding: 10px 14px !important;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3) !important;
  font-family: inherit;
  font-size: 11.5px;
  line-height: 1.4;
}

.kabupaten-hover-tooltip .kht-title {
  font-size: 13px;
  font-weight: 800;
  color: #FFFFFF;
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 6px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.15);
  padding-bottom: 4px;
}

.kabupaten-hover-tooltip .kht-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px 12px;
  margin-bottom: 6px;
}

.kabupaten-hover-tooltip .kht-item-label {
  font-size: 9.5px;
  color: #94A3B8;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.kabupaten-hover-tooltip .kht-item-val {
  font-size: 12px;
  font-weight: 800;
  font-family: 'JetBrains Mono', monospace;
}


/* Map Floating Top Bar (Judul di Kiri, Aksi di Kanan Peta) */
.map-top-bar {
  position: absolute;
  top: 14px;
  left: 20px;
  right: 20px;
  z-index: 1100;
  display: flex;
  justify-content: space-between;
  align-items: center;
  pointer-events: none;
}


.floating-pill {
  pointer-events: auto;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(8px);
  border: 1px solid #CBD5E1;
  border-radius: 30px;
  padding: 7px 16px;
  display: flex;
  align-items: center;
  gap: 8px;
  box-shadow: var(--shadow-md);
  font-size: 12px;
  font-weight: 700;
  color: #0F172A;
}

.map-top-actions {
  pointer-events: auto;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Offset Leaflet Zoom & Layer Switcher to prevent overlap with top buttons */
.leaflet-top.leaflet-right {
  top: 66px !important;
  right: 20px !important;
}

.live-dot {
  width: 8px;
  height: 8px;
  background: #16A34A;
  border-radius: 50%;
  box-shadow: 0 0 8px #16A34A;
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0% {
    transform: scale(0.95);
    box-shadow: 0 0 0 0 rgba(22, 163, 74, 0.7);
  }

  70% {
    transform: scale(1);
    box-shadow: 0 0 0 8px rgba(22, 163, 74, 0);
  }

  100% {
    transform: scale(0.95);
    box-shadow: 0 0 0 0 rgba(22, 163, 74, 0);
  }
}

.map-control-btn {
  background: #FFFFFF;
  border: 1px solid #CBD5E1;
  padding: 8px 14px;
  height: 38px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  color: #334155;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: var(--shadow-md);
  transition: all 0.2s ease;
}

.map-control-btn:hover {
  background: #F8FAFC;
  color: #0F172A;
  border-color: #94A3B8;
}

.map-control-btn.btn-download {
  background: #2563EB;
  color: #FFFFFF;
  border-color: #1D4ED8;
}

.map-control-btn.btn-download:hover {
  background: #1D4ED8;
}

/* North Arrow / Windrose Compass */
.compass-rose {
  position: absolute;
  top: 75px;
  left: 20px;
  z-index: 450;
  display: flex;
  flex-direction: column;
  align-items: center;
  pointer-events: none;
  opacity: 0.85;
}

.compass-rose .north-char {
  font-size: 15px;
  font-weight: 900;
  color: #0F172A;
  line-height: 1;
  margin-bottom: 2px;
}

.compass-star {
  width: 32px;
  height: 32px;
}

/* Geographic Sea & Ocean Labels */
.geographic-sea-icon {
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  pointer-events: none !important;
}

.geographic-sea-label {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 13px;
  font-weight: 700;
  font-style: italic;
  letter-spacing: 0.16em;
  color: rgba(30, 64, 175, 0.35);
  text-shadow:
    0 0 3px rgba(255, 255, 255, 0.9),
    0 0 6px rgba(255, 255, 255, 0.7);
  pointer-events: none !important;
  user-select: none;
  white-space: nowrap;
  text-align: center;
  text-transform: none !important;
}

/* =========================================================
   SIDEBAR LABEL OPTIONS (PILIHAN LABEL KECAMATAN DI MENU)
   ========================================================= */
.sidebar-label-section {
  margin-top: 14px;
}

.sidebar-label-options {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.sidebar-label-opt {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  background: #F8FAFC;
  border: 1px solid #E2E8F0;
  border-radius: 10px;
  cursor: pointer;
  user-select: none;
  transition: all 0.15s ease;
}

.sidebar-label-opt:hover {
  background: #EFF6FF;
  border-color: #BFDBFE;
}

.sidebar-label-opt input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: #2563EB;
  cursor: pointer;
  flex-shrink: 0;
}

.opt-label-content {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
}

.opt-icon {
  width: 22px;
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #FFFFFF;
  border: 1px solid #CBD5E1;
  border-radius: 6px;
  color: #2563EB;
  font-size: 10.5px;
  flex-shrink: 0;
}

.opt-text {
  display: flex;
  flex-direction: column;
}

.opt-title {
  font-size: 11.5px;
  font-weight: 700;
  color: #0F172A;
  line-height: 1.2;
}

.opt-sub {
  font-size: 9.5px;
  color: #64748B;
  line-height: 1.2;
}

/* =========================================================
   IN-POLYGON INFOGRAPHIC LABELS (Sesuai Referensi Bapenda)
   ========================================================= */
.infographic-div-icon {
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
}

.kecamatan-infographic-label {
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  text-align: center;
  white-space: normal;
  pointer-events: none !important;
  user-select: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  line-height: 1.05;
}

.triplet-all {
  font-family: 'JetBrains Mono', monospace;
  line-height: 1.1;
  text-shadow:
    0 0 2px #FFFFFF,
    0 0 4px #FFFFFF,
    -1px -1px 0 #FFFFFF,
    1px -1px 0 #FFFFFF,
    -1px 1px 0 #FFFFFF,
    1px 1px 0 #FFFFFF;
}

.label-kec-name {
  font-size: 8px;
  font-weight: 700;
  text-transform: none !important;
  color: #0F172A;
  letter-spacing: -0.01em;
  line-height: 1.08;
  text-align: center;
  word-break: break-word;
  hyphens: auto;
  text-shadow:
    0 0 2px #FFFFFF,
    0 0 4px #FFFFFF,
    -1px -1px 0 #FFFFFF,
    1px -1px 0 #FFFFFF,
    -1px 1px 0 #FFFFFF,
    1px 1px 0 #FFFFFF;
}

.label-kec-val {
  font-size: 9.5px;
  font-weight: 800;
  color: #000000;
  line-height: 1.1;
  font-family: 'JetBrains Mono', sans-serif;
  margin-top: 1px;
  text-shadow:
    0 0 2px #FFFFFF,
    0 0 4px #FFFFFF,
    -1px -1px 0 #FFFFFF,
    1px -1px 0 #FFFFFF,
    -1px 1px 0 #FFFFFF,
    1px 1px 0 #FFFFFF;
}

.label-kec-pct {
  font-size: 7.5px;
  font-weight: 700;
  color: #1E293B;
  line-height: 1;
  margin-top: 1px;
  text-shadow:
    0 0 2px #FFFFFF,
    0 0 3px #FFFFFF,
    -1px -1px 0 #FFFFFF,
    1px -1px 0 #FFFFFF;
}

/* =========================================================
   LEGENDA RESMI INFOGRAFIS (Sudut Kiri Bawah)
   ========================================================= */
/* =========================================================
   LEGENDA RESMI INFOGRAFIS (Sudut Kiri Bawah) - Minimize / Maximize
   ========================================================= */
.map-legend {
  position: absolute;
  bottom: 24px;
  left: 20px;
  z-index: 500;
  background: rgba(255, 255, 255, 0.98);
  backdrop-filter: blur(8px);
  border: 1px solid #CBD5E1;
  border-radius: 12px;
  padding: 12px 14px;
  box-shadow: var(--shadow-lg);
  min-width: 250px;
  max-width: 300px;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.map-legend.minimized {
  padding: 8px 12px;
  min-width: 190px;
  max-width: 240px;
  background: #FFFFFF;
}

.map-legend.minimized .legend-content {
  display: none !important;
}

.legend-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  user-select: none;
  gap: 8px;
}

.legend-header-left {
  display: flex;
  align-items: center;
  gap: 7px;
  overflow: hidden;
}

.legend-title {
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #0F172A;
  white-space: nowrap;
  text-overflow: ellipsis;
  overflow: hidden;
}

.legend-toggle-btn {
  background: #F1F5F9;
  border: 1px solid #E2E8F0;
  border-radius: 6px;
  width: 22px;
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #475569;
  font-size: 10px;
  cursor: pointer;
  transition: all 0.15s ease;
  flex-shrink: 0;
}

.legend-toggle-btn:hover {
  background: #E2E8F0;
  color: #0F172A;
}

.legend-content {
  margin-top: 10px;
  border-top: 1px solid #E2E8F0;
  padding-top: 9px;
  transition: all 0.2s ease;
}

.legend-scale {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 10.5px;
  color: #1E293B;
  font-weight: 700;
}

.legend-color {
  width: 20px;
  height: 12px;
  border-radius: 3px;
  border: 1px solid rgba(0, 0, 0, 0.15);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
  flex-shrink: 0;
}

/* Analisis Kepatuhan Kabupaten Berdasarkan Target Provinsi (≥ 28%) */
.legend-kab-analysis {
  background: #F8FAFC;
  border: 1px solid #E2E8F0;
  border-radius: 8px;
  padding: 8px 10px;
  margin-top: 8px;
  font-size: 10px;
}

.analysis-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 4px;
}

.analysis-label {
  font-weight: 700;
  color: #475569;
}

.analysis-badge {
  font-weight: 800;
  font-family: 'JetBrains Mono', monospace;
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 9.5px;
}

.analysis-badge.target {
  background: #EFF6FF;
  color: #1D4ED8;
  border: 1px solid #BFDBFE;
}

.analysis-badge.success {
  background: #DCFCE7;
  color: #15803D;
  border: 1px solid #86EFAC;
}

.analysis-badge.warning {
  background: #FEF3C7;
  color: #B45309;
  border: 1px solid #FDE68A;
}

.analysis-badge.danger {
  background: #FEE2E2;
  color: #B91C1C;
  border: 1px solid #FECACA;
}

.analysis-sub {
  font-size: 9px;
  color: #64748B;
  margin-top: 4px;
  line-height: 1.25;
}

/* =========================================================
   FLOATING CARD RINCIAN DATA KECAMATAN (DI LUAR SIDE MENU)
   ========================================================= */
.floating-kec-card {
  position: absolute;
  bottom: 24px;
  right: 20px;
  z-index: 500;
  width: 350px;
  max-width: calc(100vw - 40px);
  background: rgba(255, 255, 255, 0.98);
  backdrop-filter: blur(10px);
  border: 1px solid #CBD5E1;
  border-radius: 14px;
  box-shadow: 0 16px 36px rgba(15, 23, 42, 0.16);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transition: all 0.28s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Minimized State */
.floating-kec-card.minimized {
  width: 295px;
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.12);
}

.floating-kec-card.minimized .fk-body {
  display: none !important;
}

.floating-kec-card.minimized .fk-header {
  border-bottom: none;
}

/* Maximized State */
.floating-kec-card.maximized {
  width: 500px;
  height: 78vh;
  max-height: 820px;
  bottom: 24px;
  right: 20px;
  box-shadow: 0 24px 50px rgba(15, 23, 42, 0.25);
}

.floating-kec-card.maximized .kec-breakdown-list {
  max-height: none;
  flex: 1;
}

.fk-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  background: #F8FAFC;
  border-bottom: 1px solid #E2E8F0;
  user-select: none;
  gap: 8px;
}

.fk-header-left {
  display: flex;
  align-items: center;
  gap: 7px;
  cursor: pointer;
  overflow: hidden;
  flex: 1;
}

.fk-title {
  font-size: 11.5px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #0F172A;
  white-space: nowrap;
}

.fk-count-badge {
  font-size: 9.5px;
  font-weight: 700;
  color: #2563EB;
  background: #EFF6FF;
  border: 1px solid #DBEAFE;
  padding: 1px 6px;
  border-radius: 10px;
  white-space: nowrap;
}

.fk-actions {
  display: flex;
  align-items: center;
  gap: 5px;
  flex-shrink: 0;
}

.fk-action-btn {
  background: #FFFFFF;
  border: 1px solid #CBD5E1;
  border-radius: 6px;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #475569;
  font-size: 10.5px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.fk-action-btn:hover {
  background: #F1F5F9;
  color: #0F172A;
  border-color: #94A3B8;
}

.fk-body {
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  overflow: hidden;
}

.target-compliance-summary {
  background: #F8FAFC;
  border: 1px solid #E2E8F0;
  border-radius: 10px;
  padding: 8px 10px;
}

.tc-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 5px;
  font-size: 10.5px;
}

.tc-title {
  color: #1E293B;
  font-weight: 600;
}

.tc-status-pill {
  font-size: 9.5px;
  font-weight: 800;
  padding: 2px 7px;
  border-radius: 20px;
}

.tc-status-pill.success {
  background: #DCFCE7;
  color: #15803D;
}

.tc-status-pill.warning {
  background: #FEF3C7;
  color: #B45309;
}

.tc-status-pill.danger {
  background: #FEE2E2;
  color: #B91C1C;
}

.tc-bars {
  display: flex;
  justify-content: space-between;
  font-size: 10px;
  color: #475569;
}

.fk-search-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.fk-search-wrap i.fa-magnifying-glass {
  position: absolute;
  left: 9px;
  font-size: 10.5px;
  color: #94A3B8;
}

.fk-search-input {
  width: 100%;
  padding: 6px 26px 6px 26px;
  font-size: 11px;
  border: 1px solid #CBD5E1;
  border-radius: 6px;
  outline: none;
  font-family: inherit;
  background: #FFFFFF;
}

.fk-search-input:focus {
  border-color: #2563EB;
}

.fk-search-clear {
  position: absolute;
  right: 6px;
  background: none;
  border: none;
  color: #94A3B8;
  font-size: 11px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2px;
}

.fk-search-clear:hover {
  color: #0F172A;
}

.kec-breakdown-list {
  max-height: 240px;
  overflow-y: auto;
  border: 1px solid #E2E8F0;
  border-radius: 8px;
  background: #FFFFFF;
}

.kec-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 7px 10px;
  border-bottom: 1px solid #F1F5F9;
  cursor: pointer;
  transition: background 0.15s;
}

.kec-row:last-child {
  border-bottom: none;
}

.kec-row:hover {
  background: #EFF6FF;
}

.kec-row-left {
  flex: 1;
  overflow: hidden;
  padding-right: 6px;
}

.kec-row-name {
  font-size: 11px;
  font-weight: 700;
  color: #0F172A;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.kec-row-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 2px;
  font-size: 9.5px;
  font-family: 'JetBrains Mono', monospace;
}

.meta-tag {
  display: inline-flex;
  align-items: center;
  gap: 2px;
}

.meta-tag.green {
  color: #15803D;
  font-weight: 700;
}

.meta-tag.red {
  color: #DC2626;
  font-weight: 700;
}

.meta-tag.emerald {
  color: #16A34A;
}

.kec-row-right {
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

.kepatuhan-pill {
  font-size: 10px;
  font-weight: 800;
  font-family: 'JetBrains Mono', monospace;
  padding: 2px 6px;
  border-radius: 4px;
}

.kepatuhan-pill.success {
  background: #DCFCE7;
  color: #15803D;
  border: 1px solid #86EFAC;
}

.kepatuhan-pill.warning {
  background: #FEF3C7;
  color: #B45309;
  border: 1px solid #FDE68A;
}

.kepatuhan-pill.danger {
  background: #FEE2E2;
  color: #B91C1C;
  border: 1px solid #FECACA;
}

.kepatuhan-pill.empty {
  background: #F1F5F9;
  color: #64748B;
  font-size: 9px;
  font-family: inherit;
  font-weight: 600;
}

/* Row Wadah Tidak Teridentifikasi Kecamatan di Daftar Rincian */
.kec-row.kec-row-unidentified {
  background: #F8FAFC;
  border-top: 2px dashed #CBD5E1;
  border-bottom: 1px solid #E2E8F0;
  border-left: 3px solid #6366F1;
  margin-top: 4px;
}

.kec-row.kec-row-unidentified:hover {
  background: #EEF2FF;
  border-color: #818CF8;
}

.unidentified-row-badge {
  font-size: 9px;
  font-weight: 700;
  color: #4F46E5;
  background: #EEF2FF;
  border: 1px solid #C7D2FE;
  padding: 1px 6px;
  border-radius: 10px;
  margin-left: 5px;
  letter-spacing: 0.02em;
  display: inline-block;
  vertical-align: middle;
}

[data-theme="dark"] .kec-row.kec-row-unidentified {
  background: rgba(30, 41, 59, 0.7);
  border-top-color: #475569;
  border-bottom-color: #334155;
  border-left-color: #818CF8;
}

[data-theme="dark"] .kec-row.kec-row-unidentified:hover {
  background: rgba(99, 102, 241, 0.15);
}

[data-theme="dark"] .unidentified-row-badge {
  background: rgba(99, 102, 241, 0.2);
  color: #A5B4FC;
  border-color: rgba(99, 102, 241, 0.4);
}

[data-theme="dark"] .unidentified-box {
  background: var(--bg-card);
  border-color: var(--border-color);
  border-left-color: #818CF8;
}

[data-theme="dark"] .u-card {
  background: rgba(15, 23, 42, 0.6);
  border-color: var(--border-color);
}

[data-theme="dark"] .unidentified-title {
  color: var(--text-main);
}

[data-theme="dark"] .unidentified-icon {
  background: rgba(99, 102, 241, 0.15);
  color: #818CF8;
}

/* Detail Drawer (Modal Analisis Wilayah / KPI Card) */
.detail-modal {
  position: absolute;
  top: 72px; /* Positioned below top bar so it never overlaps the top bar or menus */
  left: 20px;
  z-index: 1050;
  background: rgba(255, 255, 255, 0.98);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid #CBD5E1;
  border-radius: 16px;
  padding: 18px 20px;
  width: 350px;
  max-width: calc(100vw - 40px);
  max-height: calc(100vh - 160px);
  overflow-y: auto;
  box-shadow: 0 20px 40px rgba(15, 23, 42, 0.18);
  display: none;
  animation: slideIn 0.25s ease-out;
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.detail-modal.active {
  display: block;
}

.detail-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 14px;
}

.detail-title h3 {
  font-size: 17px;
  font-weight: 800;
  color: #0F172A;
}

.detail-title span {
  font-size: 11px;
  color: #2563EB;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.btn-close {
  background: #F1F5F9;
  border: 1px solid #E2E8F0;
  color: #64748B;
  font-size: 18px;
  width: 28px;
  height: 28px;
  border-radius: 6px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.btn-close:hover {
  background: #E2E8F0;
  color: #0F172A;
}

.detail-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 14px;
}

.stat-box {
  background: #F8FAFC;
  border: 1px solid #E2E8F0;
  border-radius: 10px;
  padding: 10px;
}

.stat-box .title {
  font-size: 10px;
  color: #64748B;
  font-weight: 700;
  text-transform: uppercase;
}

.stat-box .num {
  font-size: 17px;
  font-weight: 800;
  font-family: 'JetBrains Mono', monospace;
  margin-top: 3px;
}

.progress-section {
  background: #F8FAFC;
  border-radius: 10px;
  padding: 12px;
  border: 1px solid #E2E8F0;
}

.progress-labels {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  font-weight: 700;
  margin-bottom: 6px;
}

.progress-bar-container {
  height: 8px;
  background: #E2E8F0;
  border-radius: 4px;
  overflow: hidden;
  display: flex;
}

.progress-paid {
  background: #16A34A;
  height: 100%;
}

.progress-unpaid {
  background: #DC2626;
  height: 100%;
}

.priority-tag {
  display: inline-block;
  margin-top: 10px;
  font-size: 10px;
  font-weight: 800;
  padding: 4px 10px;
  border-radius: 20px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.priority-tag.high {
  background: #FEE2E2;
  border: 1px solid #FCA5A5;
  color: #991B1B;
}

.priority-tag.medium {
  background: #FEF3C7;
  border: 1px solid #FDE68A;
  color: #92400E;
}

.priority-tag.low {
  background: #DCFCE7;
  border: 1px solid #86EFAC;
  color: #166534;
}

/* Tooltip Custom */
.custom-leaflet-tooltip {
  background: #FFFFFF !important;
  border: 1px solid #CBD5E1 !important;
  color: #0F172A !important;
  border-radius: 8px !important;
  padding: 8px 12px !important;
  box-shadow: var(--shadow-lg) !important;
  font-family: 'Plus Jakarta Sans', sans-serif !important;
}

.tooltip-title {
  font-weight: 800;
  font-size: 13px;
  color: #1D4ED8;
  margin-bottom: 4px;
}

.tooltip-body {
  font-size: 11px;
  line-height: 1.5;
  color: #334155;
  font-weight: 600;
}

.tooltip-body b {
  color: #0F172A;
  font-family: 'JetBrains Mono', monospace;
}

/* =========================================================
   MODAL ADMIN UPDATE DATA
   ========================================================= */
.admin-modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(8px);
  z-index: 2000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.admin-modal-backdrop.active {
  display: flex;
}

.admin-modal-box {
  background: #FFFFFF;
  border-radius: 16px;
  width: 100%;
  max-width: 820px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
  border: 1px solid #CBD5E1;
  overflow: hidden;
  animation: modalPop 0.25s ease-out;
}

@keyframes modalPop {
  from {
    opacity: 0;
    transform: scale(0.96);
  }

  to {
    opacity: 1;
    transform: scale(1);
  }
}

.admin-modal-header {
  padding: 16px 22px;
  border-bottom: 1px solid #E2E8F0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #F8FAFC;
}

.admin-modal-header h2 {
  font-size: 16px;
  font-weight: 800;
  color: #0F172A;
  display: flex;
  align-items: center;
  gap: 8px;
}

.admin-tabs {
  display: flex;
  border-bottom: 1px solid #E2E8F0;
  background: #FFFFFF;
  padding: 0 20px;
}

.admin-tab-btn {
  padding: 12px 18px;
  font-size: 13px;
  font-weight: 700;
  color: #64748B;
  background: transparent;
  border: none;
  border-bottom: 3px solid transparent;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  gap: 8px;
}

.admin-tab-btn.active {
  color: #2563EB;
  border-bottom-color: #2563EB;
}

.admin-modal-body {
  padding: 20px;
  overflow-y: auto;
  flex: 1;
}

/* Upload Dropzone */
.dropzone-box {
  border: 2px dashed #CBD5E1;
  border-radius: 12px;
  padding: 36px 20px;
  text-align: center;
  background: #F8FAFC;
  cursor: pointer;
  transition: all 0.2s ease;
}

.dropzone-box:hover,
.dropzone-box.dragover {
  border-color: #2563EB;
  background: #EFF6FF;
}

.dropzone-icon {
  font-size: 38px;
  color: #2563EB;
  margin-bottom: 12px;
}

.dropzone-title {
  font-size: 14px;
  font-weight: 700;
  color: #0F172A;
  margin-bottom: 4px;
}

.dropzone-desc {
  font-size: 12px;
  color: #64748B;
}

/* Admin Table Editor */
.admin-table-wrap {
  border: 1px solid #E2E8F0;
  border-radius: 10px;
  overflow-x: auto;
  max-height: 420px;
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
  text-align: left;
}

.admin-table th {
  background: #F8FAFC;
  padding: 10px 12px;
  font-weight: 800;
  color: #334155;
  border-bottom: 1px solid #E2E8F0;
  position: sticky;
  top: 0;
  z-index: 10;
}

.admin-table td {
  padding: 8px 12px;
  border-bottom: 1px solid #F1F5F9;
  color: #0F172A;
  font-weight: 600;
}

.admin-input-num {
  width: 100px;
  padding: 6px 8px;
  border: 1px solid #CBD5E1;
  border-radius: 6px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  font-weight: 700;
  text-align: right;
  outline: none;
}

.admin-input-num:focus {
  border-color: #2563EB;
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.2);
}

.admin-modal-footer {
  padding: 14px 22px;
  border-top: 1px solid #E2E8F0;
  background: #F8FAFC;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.btn-primary {
  background: #2563EB;
  color: #FFFFFF;
  border: 1px solid #1D4ED8;
  border-radius: 8px;
  padding: 9px 18px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  box-shadow: var(--shadow-sm);
  transition: all 0.2s;
}

.btn-primary:hover {
  background: #1D4ED8;
}

.btn-ghost {
  background: transparent;
  color: #64748B;
  border: 1px solid #CBD5E1;
  border-radius: 8px;
  padding: 9px 16px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-ghost:hover {
  background: #F1F5F9;
  color: #0F172A;
}

/* Toast Notification */
.toast-notice {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 3000;
  background: #0F172A;
  color: #FFFFFF;
  padding: 12px 18px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 700;
  display: none;
  align-items: center;
  gap: 10px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
  animation: slideUp 0.25s ease-out;
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(15px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.toast-notice.success {
  background: #16A34A;
}

.toast-notice.error {
  background: #DC2626;
}

/* =========================================================
   COMPREHENSIVE RESPONSIVE STYLING (MOBILE, TABLET & DESKTOP)
   Sistem Peta Tanpa Tumpang Tindih (Zero Overlap GIS Interface)
   ========================================================= */

/* Backdrop Elements: Completely hidden and disabled on Desktop PC */
.sidebar-backdrop,
.detail-modal-backdrop,
.floating-card-backdrop {
  display: none !important;
  pointer-events: none !important;
  opacity: 0 !important;
  visibility: hidden !important;
}

.sheet-drag-handle {
  width: 38px;
  height: 4px;
  background: #CBD5E1;
  border-radius: 999px;
  margin: 0 auto 10px auto;
  display: none;
}

.top-bar-left {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  pointer-events: auto;
}

.mobile-menu-btn {
  display: none;
  background: #FFFFFF;
  border: 1px solid #CBD5E1;
  color: #1D4ED8;
  height: 38px;
  padding: 0 12px;
  border-radius: 10px;
  font-size: 12px;
  font-weight: 700;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: all 0.2s ease;
  flex-shrink: 0;
  pointer-events: auto !important;
  touch-action: manipulation;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.mobile-menu-btn:hover,
.mobile-menu-btn:active {
  background: #EFF6FF;
  border-color: #2563EB;
}

/* Segmented Level Switcher (Tingkat Kabupaten vs Tingkat Kecamatan) */
.level-segmented-control {
  display: inline-flex;
  align-items: center;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid #CBD5E1;
  border-radius: 12px;
  padding: 3px;
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.08);
  pointer-events: auto;
  gap: 2px;
}

.level-seg-btn {
  border: none;
  background: transparent;
  padding: 6px 12px;
  border-radius: 9px;
  font-size: 11.5px;
  font-weight: 700;
  color: #475569;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  user-select: none;
  font-family: inherit;
}

.level-seg-btn i {
  font-size: 12px;
  color: #64748B;
  transition: color 0.2s ease;
}

.level-seg-btn .seg-badge {
  background: #E2E8F0;
  color: #475569;
  font-size: 10px;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 10px;
  font-family: 'JetBrains Mono', monospace;
  transition: all 0.2s ease;
}

.level-seg-btn .seg-text-full {
  display: inline;
}

.level-seg-btn .seg-text-short {
  display: none;
}

.level-seg-btn:hover:not(.active) {
  background: #F1F5F9;
  color: #0F172A;
}

.level-seg-btn:hover:not(.active) i {
  color: #2563EB;
}

.level-seg-btn.active {
  background: #1D4ED8;
  color: #FFFFFF;
  box-shadow: 0 2px 6px rgba(29, 78, 216, 0.35);
}

.level-seg-btn.active i {
  color: #FFFFFF;
}

.level-seg-btn.active .seg-badge {
  background: rgba(255, 255, 255, 0.25);
  color: #FFFFFF;
}

/* Kabupaten Level Map Badge Labels */
.kabupaten-map-badge {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1.5px solid #2563EB;
  border-radius: 10px;
  padding: 5px 10px;
  text-align: center;
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.18);
  pointer-events: auto;
  white-space: nowrap;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.kabupaten-map-badge:hover {
  transform: scale(1.05);
  box-shadow: 0 6px 18px rgba(37, 99, 235, 0.3);
  z-index: 1000 !important;
}

.kmb-title {
  font-size: 11px;
  font-weight: 800;
  color: #0F172A;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
}

.kmb-sub {
  font-size: 9.5px;
  font-weight: 700;
  color: #2563EB;
  margin-top: 2px;
  font-family: 'JetBrains Mono', monospace;
}



.pill-mobile-text {
  display: none;
}

.fk-title-mobile {
  display: none;
}

/* ---------------------------------------------------------
   1. TABLET VIEW (max-width: 992px)
   --------------------------------------------------------- */
@media (max-width: 992px) {
  :root {
    --sidebar-w: 320px;
  }

  .sidebar-backdrop {
    display: block !important;
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.5);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 1150;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.25s ease, visibility 0.25s ease;
    pointer-events: none;
  }

  .sidebar-backdrop.active {
    opacity: 1 !important;
    visibility: visible !important;
    pointer-events: auto !important;
  }

  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    height: 100vh;
    z-index: 1200;
    transform: translateX(-100%);
    margin-left: 0 !important;
    box-shadow: 10px 0 35px rgba(0, 0, 0, 0.22);
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .sidebar.collapsed {
    transform: translateX(-100%);
  }

  .floating-sidebar-toggle {
    display: inline-flex !important;
  }

  .mobile-menu-btn {
    display: none !important;
  }
}

/* ---------------------------------------------------------
   2. MOBILE VIEW (max-width: 768px)
   --------------------------------------------------------- */
@media (max-width: 768px) {

  .detail-modal-backdrop,
  .floating-card-backdrop {
    display: block !important;
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.45);
    backdrop-filter: blur(3px);
    -webkit-backdrop-filter: blur(3px);
    z-index: 1100;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.25s ease, visibility 0.25s ease;
    pointer-events: none;
  }

  .detail-modal-backdrop.active,
  .floating-card-backdrop.active {
    opacity: 1 !important;
    visibility: visible !important;
    pointer-events: auto !important;
  }

  /* Sidebar Mobile Drawer */
  .sidebar {
    width: min(340px, 86vw);
    max-width: 100vw;
  }

  .sidebar-header {
    padding: 14px 16px;
  }

  .sidebar-content {
    padding: 14px 16px;
    gap: 16px;
  }

  .sidebar-footer {
    padding: 12px 16px;
  }

  /* Top Navigation Bar: 2-Row Layout on Mobile (Controls on Row 1, Full-Width Search on Row 2) */
  .map-top-bar {
    top: 8px;
    left: 8px;
    right: 8px;
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 8px 6px;
    pointer-events: none;
    max-width: calc(100vw - 16px);
  }

  .top-bar-left {
    display: flex;
    align-items: center;
    gap: 6px;
    pointer-events: auto;
    flex: 1 1 auto;
    min-width: 0;
  }

  .floating-sidebar-toggle {
    height: 34px;
    padding: 0 10px;
    font-size: 11px;
    border-radius: 9px;
    flex-shrink: 0;
  }

  .level-segmented-control {
    padding: 2px;
    gap: 2px;
    flex-shrink: 0;
  }

  .level-seg-btn {
    padding: 4px 7px;
    font-size: 10.5px;
    gap: 4px;
  }

  .level-seg-btn .seg-badge {
    font-size: 8.5px;
    padding: 1px 4px;
  }

  /* Compact Action Buttons in Top Right */
  .map-top-actions {
    display: flex;
    align-items: center;
    gap: 5px;
    pointer-events: auto;
    flex-shrink: 0;
  }

  .map-control-btn {
    height: 34px;
    width: 34px;
    min-width: 34px;
    padding: 0;
    justify-content: center;
    border-radius: 9px;
  }

  .map-control-btn .btn-text {
    display: none !important;
  }

  .map-control-btn i {
    font-size: 13px;
    margin: 0;
  }

  .btn-fullscreen {
    display: none !important; /* Not needed / unsupported on mobile Safari */
  }

  .btn-action-geojson,
  .btn-action-camera,
  .btn-action-reset,
  .btn-zen-toggle {
    width: 34px;
    padding: 0;
    justify-content: center;
  }

  /* Full-width Universal Search on Mobile Row 2 */
  .universal-search-wrap {
    order: 3;
    width: 100%;
    flex: 0 0 100%;
    pointer-events: auto;
  }

  .univ-search-box {
    width: 100% !important;
    height: 36px;
    padding: 4px 10px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.98);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  }

  .univ-search-box:focus-within {
    width: 100% !important;
    box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.2), 0 4px 12px rgba(0, 0, 0, 0.12);
  }

  .univ-search-input {
    font-size: 11.5px;
  }

  .univ-search-kbd {
    display: none !important;
  }

  .univ-search-dropdown {
    width: 100% !important;
    max-width: 100% !important;
    left: 0 !important;
    right: 0 !important;
    max-height: 260px;
  }

  /* Leaflet Controls & Compass reposition below 2-row top bar */
  .leaflet-top.leaflet-right {
    top: 96px !important;
    right: 10px !important;
  }

  .leaflet-control-zoom,
  .leaflet-control-layers {
    border-radius: 8px !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15) !important;
  }

  .leaflet-control-zoom a {
    width: 32px !important;
    height: 32px !important;
    line-height: 32px !important;
    font-size: 14px !important;
  }

  .leaflet-control-layers-toggle {
    width: 32px !important;
    height: 32px !important;
  }

  .leaflet-control-attribution {
    font-size: 8.5px !important;
    padding: 1px 4px !important;
    background: rgba(255, 255, 255, 0.75) !important;
  }

  .compass-rose {
    top: 96px !important;
    left: 10px !important;
    transform: scale(0.8);
    transform-origin: top left;
  }

  /* =========================================================
     NON-OVERLAPPING BOTTOM CONTROLS (LEGENDA & DATA KECAMATAN)
     ========================================================= */

  /* MAP LEGEND (Bottom-Left) */
  .map-legend {
    bottom: 14px;
    left: 10px;
    right: auto;
    z-index: 1250;
    padding: 8px 12px;
    border-radius: 12px;
    min-width: auto;
    max-width: 145px;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.14);
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  }

  .map-legend.minimized {
    padding: 7px 12px;
    min-width: auto;
    max-width: 130px;
    border-radius: 20px;
  }

  .map-legend.minimized .legend-header {
    margin: 0;
  }

  .map-legend.minimized .legend-title {
    font-size: 10.5px;
  }

  /* Expanded State of Legend on Mobile: Opens as a Clean Floating Card */
  .map-legend:not(.minimized) {
    bottom: 64px;
    left: 10px;
    right: 10px;
    max-width: 360px;
    max-height: 65vh;
    overflow-y: auto;
    padding: 14px;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(12px);
    box-shadow: 0 16px 40px rgba(15, 23, 42, 0.25);
  }

  .map-legend:not(.minimized) .legend-title {
    font-size: 11.5px;
    white-space: normal;
  }

  /* FLOATING KECAMATAN CARD (Bottom-Right) */
  .floating-kec-card {
    position: fixed;
    bottom: 14px;
    right: 10px;
    left: auto;
    width: auto;
    max-width: 190px;
    z-index: 1260;
    border-radius: 20px;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.14);
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  }

  .fk-title-desktop {
    display: none;
  }

  .fk-title-mobile {
    display: inline;
    font-size: 11px;
    font-weight: 700;
  }

  .fk-header {
    padding: 7px 10px;
    border-bottom: none;
    gap: 6px;
  }

  .fk-count-badge {
    font-size: 9px;
    padding: 1px 5px;
  }

  /* When Minimized on Mobile: Compact Clean Button */
  .floating-kec-card.minimized {
    width: auto;
    max-width: 185px;
    border-radius: 20px;
  }

  .floating-kec-card.minimized .fk-actions {
    display: none;
  }

  .floating-kec-card.minimized .fk-header-left {
    cursor: pointer;
  }

  /* When Expanded on Mobile: Slides up as a Modern Bottom Sheet Drawer! */
  .floating-kec-card:not(.minimized) {
    bottom: 0 !important;
    left: 0 !important;
    right: 0 !important;
    width: 100vw !important;
    max-width: 100vw !important;
    height: 76vh !important;
    max-height: 85vh !important;
    border-radius: 20px 20px 0 0 !important;
    border-bottom: none !important;
    z-index: 1350 !important;
    box-shadow: 0 -12px 40px rgba(15, 23, 42, 0.28) !important;
    background: #FFFFFF !important;
  }

  .floating-kec-card:not(.minimized) .sheet-drag-handle {
    display: block;
    margin-top: 8px;
    margin-bottom: 4px;
  }

  .floating-kec-card:not(.minimized) .fk-header {
    border-bottom: 1px solid #E2E8F0;
    padding: 8px 16px 12px 16px;
  }

  .floating-kec-card:not(.minimized) .fk-actions {
    display: flex;
  }

  .floating-kec-card:not(.minimized) #btnFkMaximize {
    display: none;
    /* In bottom sheet mode, expand is unnecessary */
  }

  .floating-kec-card:not(.minimized) .fk-body {
    flex: 1;
    overflow-y: auto;
    padding: 12px 16px calc(16px + env(safe-area-inset-bottom, 0px)) 16px;
  }

  .floating-kec-card:not(.minimized) .kec-breakdown-list {
    max-height: none;
    flex: 1;
  }

  /* =========================================================
     DETAIL MODAL AS MOBILE BOTTOM SHEET DRAWER
     ========================================================= */
  .detail-modal {
    position: fixed !important;
    top: auto !important;
    bottom: 0 !important;
    left: 0 !important;
    right: 0 !important;
    width: 100vw !important;
    max-width: 100vw !important;
    border-radius: 20px 20px 0 0 !important;
    border-bottom: none !important;
    padding: 12px 18px calc(16px + env(safe-area-inset-bottom, 0px)) 18px !important;
    z-index: 1500 !important;
    max-height: 80vh !important;
    overflow-y: auto !important;
    box-shadow: 0 -14px 45px rgba(0, 0, 0, 0.28) !important;
    transform: translateY(105%);
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    display: block !important;
    visibility: hidden;
  }

  .detail-modal.active {
    visibility: visible;
    transform: translateY(0);
  }

  .detail-modal .sheet-drag-handle {
    display: block;
  }

  .detail-header {
    margin-bottom: 12px;
  }

  .detail-title h3 {
    font-size: 16px;
  }

  .stat-box {
    padding: 8px 10px;
  }

  .stat-box .num {
    font-size: 15px;
  }

  /* GeoJSON Catalog Modal Dialog */
  .geojson-modal-window {
    width: 95vw;
    max-height: 90vh;
    border-radius: 14px;
    margin: 10px;
  }

  .geojson-modal-header {
    padding: 14px 16px;
  }

  .geojson-modal-header h3 {
    font-size: 14px;
  }

  .geojson-modal-body {
    padding: 14px 16px;
  }

  .geojson-master-card {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
    padding: 14px;
  }

  .geojson-grid {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  /* Toast Notification */
  .toast-notice {
    bottom: 16px;
    right: 16px;
    left: 16px;
    justify-content: center;
    font-size: 12px;
    padding: 10px 14px;
  }
}

/* ---------------------------------------------------------
   3. ULTRA-COMPACT MOBILE VIEW (max-width: 480px)
   --------------------------------------------------------- */
@media (max-width: 480px) {
  .map-top-bar {
    top: 8px;
    left: 8px;
    right: 8px;
  }

  .mobile-menu-btn {
    padding: 0 9px;
    font-size: 11px;
    height: 34px;
  }

  .floating-pill {
    max-width: 135px;
    padding: 5px 8px;
  }

  .pill-mobile-text {
    font-size: 10.5px;
  }

  .map-control-btn {
    height: 34px;
    width: 34px;
    padding: 0;
  }

  .floating-sidebar-toggle span {
    display: none;
  }

  .floating-sidebar-toggle {
    width: 34px;
    padding: 0;
    justify-content: center;
  }

  .level-seg-btn .seg-text-full {
    display: none !important;
  }

  .level-seg-btn .seg-text-short {
    display: inline !important;
  }

  .level-seg-btn {
    padding: 4px 6px;
    font-size: 10px;
  }

  .map-legend.minimized {
    bottom: 12px;
    left: 8px;
    max-width: 120px;
  }

  .floating-kec-card.minimized {
    bottom: 12px;
    right: 8px;
    max-width: 160px;
  }

  .kpi-grid {
    gap: 8px;
  }

  .kpi-card {
    padding: 10px 12px;
  }

  .kpi-value {
    font-size: 17px;
  }
}

/* ---------------------------------------------------------
   4. ADMIN PORTAL RESPONSIVE STYLING (admin.html)
   --------------------------------------------------------- */
@media (max-width: 768px) {
  .admin-navbar {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
    padding: 12px 16px;
  }

  .admin-nav-brand {
    justify-content: flex-start;
  }

  .admin-nav-actions {
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 8px;
  }

  .admin-container {
    margin: 14px auto;
    padding: 0 12px;
  }

  .admin-card {
    padding: 16px;
    border-radius: 12px;
    margin-bottom: 16px;
  }

  .auth-gate-box {
    margin: 30px 12px;
    padding: 24px 16px;
    border-radius: 14px;
  }

  .banner-stats-grid {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    gap: 12px !important;
    width: 100% !important;
    margin-top: 10px;
    border-top: 1px solid #E2E8F0;
    padding-top: 12px;
  }

  .banner-stats-grid>div {
    text-align: left !important;
    border-left: none !important;
    padding-left: 0 !important;
  }

  .dropzone-box {
    padding: 24px 14px;
  }

  .dropzone-icon {
    font-size: 30px;
  }

  .admin-tab-btn {
    padding: 10px 12px;
    font-size: 11.5px;
  }
}

/* =========================================================
   KABUPATEN FILTER & EMPTY DATA STYLING
   ========================================================= */
.kabupaten-select {
  width: 100%;
  background: #F8FAFC;
  border: 1.5px solid #CBD5E1;
  border-radius: 10px;
  padding: 10px 14px;
  font-size: 13px;
  font-weight: 700;
  color: #0F172A;
  outline: none;
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: inherit;
}

.kabupaten-select:focus {
  border-color: #2563EB;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
  background: #FFFFFF;
}

.kabupaten-meta-info {
  font-size: 11px;
  color: #64748B;
  font-weight: 600;
  margin-top: 6px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.badge-has-data {
  background: #DCFCE7;
  color: #15803D;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 6px;
  border: 1px solid #BBF7D0;
}

.badge-no-data {
  background: #F1F5F9;
  color: #64748B;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 6px;
  border: 1px solid #E2E8F0;
}

.empty-data-alert {
  background: #F8FAFC;
  border: 1.5px dashed #CBD5E1;
  border-radius: 12px;
  padding: 20px 16px;
  text-align: center;
  margin: 14px 0;
}

.empty-data-alert i {
  font-size: 32px;
  color: #94A3B8;
  margin-bottom: 8px;
}

.empty-data-alert h4 {
  font-size: 13px;
  font-weight: 700;
  color: #334155;
  margin-bottom: 4px;
}

.empty-data-alert p {
  font-size: 11px;
  color: #64748B;
  line-height: 1.5;
}

.admin-link-badge {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 100%;
  padding: 9px 12px;
  font-size: 11.5px;
  font-weight: 700;
  color: #475569;
  text-decoration: none;
  background: #F8FAFC;
  border: 1px solid #E2E8F0;
  border-radius: 8px;
  transition: all 0.2s ease;
  cursor: pointer;
}

.admin-link-badge:hover {
  background: #1E293B;
  color: #FFFFFF;
  border-color: #0F172A;
}

/* =========================================================
   DEDICATED ADMIN PORTAL STYLING (admin.html)
   ========================================================= */
.admin-page-body {
  background: #F1F5F9;
  min-height: 100vh;
  overflow-y: auto !important;
  height: auto !important;
}

.admin-navbar {
  background: #FFFFFF;
  border-bottom: 1px solid #E2E8F0;
  padding: 14px 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.admin-nav-brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.admin-nav-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.admin-container {
  max-width: 1140px;
  margin: 28px auto;
  padding: 0 20px;
}

.admin-card {
  background: #FFFFFF;
  border: 1px solid #E2E8F0;
  border-radius: 16px;
  padding: 24px;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.04);
  margin-bottom: 24px;
}

/* PIN Security Auth Gate */
.auth-gate-box {
  max-width: 420px;
  margin: 80px auto;
  background: #FFFFFF;
  border: 1px solid #E2E8F0;
  border-radius: 18px;
  padding: 36px 30px;
  text-align: center;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.08);
}

.auth-lock-icon {
  width: 60px;
  height: 60px;
  background: #EFF6FF;
  color: #2563EB;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  margin: 0 auto 18px auto;
}

.auth-input-pin {
  width: 100%;
  padding: 12px 16px;
  font-size: 16px;
  letter-spacing: 0.2em;
  text-align: center;
  border: 2px solid #CBD5E1;
  border-radius: 10px;
  margin: 16px 0;
  outline: none;
  font-family: 'JetBrains Mono', monospace;
  font-weight: 700;
}

.auth-input-pin:focus {
  border-color: #2563EB;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

/* =========================================================
   GEOJSON CATALOG MODAL DIALOG
   ========================================================= */
.geojson-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.65);
  backdrop-filter: blur(6px);
  z-index: 9999;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.geojson-modal-backdrop.active {
  display: flex;
}

.geojson-modal-window {
  background: #FFFFFF;
  border-radius: 16px;
  width: 100%;
  max-width: 860px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
  border: 1px solid #E2E8F0;
  overflow: hidden;
  animation: modalFadeIn 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes modalFadeIn {
  from {
    opacity: 0;
    transform: translateY(16px) scale(0.98);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.geojson-modal-header {
  padding: 18px 24px;
  border-bottom: 1px solid #E2E8F0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #F8FAFC;
}

.geojson-modal-header h3 {
  font-size: 16px;
  font-weight: 800;
  color: #0F172A;
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0;
}

.geojson-modal-header p {
  font-size: 12px;
  color: #64748B;
  margin: 4px 0 0 0;
}

.geojson-modal-body {
  padding: 20px 24px;
  overflow-y: auto;
  flex: 1;
}

.geojson-master-card {
  background: linear-gradient(135deg, #EFF6FF 0%, #DBEAFE 100%);
  border: 1px solid #BFDBFE;
  border-radius: 12px;
  padding: 16px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 14px;
  margin-bottom: 20px;
}

.geojson-master-info h4 {
  font-size: 14px;
  font-weight: 800;
  color: #1E3A8A;
  margin: 0 0 4px 0;
}

.geojson-master-info p {
  font-size: 12px;
  color: #1D4ED8;
  margin: 0;
}

.geojson-filter-bar {
  display: flex;
  gap: 12px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.geojson-filter-input {
  flex: 1;
  min-width: 220px;
  padding: 10px 14px 10px 36px;
  border: 1px solid #CBD5E1;
  border-radius: 8px;
  font-size: 13px;
  outline: none;
  background: #FFFFFF url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='%2394A3B8' viewBox='0 0 512 512'%3E%3Cpath d='M416 208c0 45.9-14.9 88.3-40 122.7L502.6 457.4c12.5 12.5 12.5 32.8 0 45.3s-32.8 12.5-45.3 0L330.7 376c-34.4 25.2-76.8 40-122.7 40C93.1 416 0 322.9 0 208S93.1 0 208 0s208 93.1 208 208zM208 352a144 144 0 1 0 0-288 144 144 0 1 0 0 288z'/%3E%3C/svg%3E") no-repeat 12px center / 14px;
}

.geojson-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 12px;
}

.geojson-card {
  background: #FFFFFF;
  border: 1px solid #E2E8F0;
  border-radius: 10px;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 10px;
  transition: all 0.2s ease;
}

.geojson-card:hover {
  border-color: #93C5FD;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.08);
  transform: translateY(-1px);
}

.geojson-card-title {
  font-size: 13px;
  font-weight: 700;
  color: #0F172A;
  margin-bottom: 2px;
}

.geojson-card-meta {
  font-size: 11px;
  color: #64748B;
  display: flex;
  gap: 8px;
  align-items: center;
}

.btn-download-geojson {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 7px 12px;
  border-radius: 6px;
  background: #F1F5F9;
  color: #1E293B;
  font-size: 11.5px;
  font-weight: 700;
  text-decoration: none;
  border: 1px solid #CBD5E1;
  transition: all 0.15s ease;
}

.btn-download-geojson:hover {
  background: #2563EB;
  color: #FFFFFF;
  border-color: #2563EB;
}

/* =========================================================
   UNIVERSAL SEARCH BAR (GLOBAL SE-NTT)
   ========================================================= */
.universal-search-wrap {
  position: relative;
  pointer-events: auto;
}

.univ-search-box {
  display: flex;
  align-items: center;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid #CBD5E1;
  border-radius: 12px;
  padding: 4px 10px;
  height: 38px;
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.08);
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  width: 270px;
}

.univ-search-box:focus-within {
  width: 320px;
  border-color: #2563EB;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15), 0 6px 16px rgba(15, 23, 42, 0.1);
}

.univ-search-box .search-ico {
  color: #64748B;
  font-size: 13px;
  margin-right: 8px;
  flex-shrink: 0;
}

.univ-search-input {
  border: none;
  background: transparent;
  outline: none;
  font-family: inherit;
  font-size: 12px;
  font-weight: 600;
  color: #0F172A;
  width: 100%;
}

.univ-search-input::placeholder {
  color: #94A3B8;
  font-weight: 500;
}

.univ-search-clear {
  border: none;
  background: transparent;
  color: #94A3B8;
  cursor: pointer;
  padding: 2px 4px;
  font-size: 12px;
  display: flex;
  align-items: center;
}

.univ-search-clear:hover {
  color: #DC2626;
}

.univ-search-kbd {
  background: #F1F5F9;
  border: 1px solid #E2E8F0;
  border-radius: 6px;
  font-size: 9.5px;
  font-weight: 700;
  color: #64748B;
  padding: 2px 5px;
  margin-left: 6px;
  white-space: nowrap;
  letter-spacing: 0.03em;
  font-family: 'JetBrains Mono', monospace;
  user-select: none;
}

/* Autocomplete Dropdown */
.univ-search-dropdown {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  width: 360px;
  max-height: 380px;
  overflow-y: auto;
  background: #FFFFFF;
  border: 1px solid #CBD5E1;
  border-radius: 14px;
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.18);
  z-index: 2000;
  padding: 6px;
}

.univ-search-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 10px;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.15s ease;
  border-bottom: 1px solid #F8FAFC;
}

.univ-search-item:last-child {
  border-bottom: none;
}

.univ-search-item:hover,
.univ-search-item.selected {
  background: #EFF6FF;
}

.univ-item-left {
  display: flex;
  align-items: center;
  gap: 10px;
  overflow: hidden;
}

.univ-item-icon {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  flex-shrink: 0;
}

.univ-item-icon.kec {
  background: #EFF6FF;
  color: #2563EB;
}

.univ-item-icon.kab {
  background: #FEF3C7;
  color: #D97706;
}

.univ-item-text {
  overflow: hidden;
}

.univ-item-name {
  font-size: 12px;
  font-weight: 700;
  color: #0F172A;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.univ-item-sub {
  font-size: 10px;
  color: #64748B;
  margin-top: 1px;
}

.univ-item-badge {
  font-size: 9.5px;
  font-weight: 800;
  font-family: 'JetBrains Mono', monospace;
  padding: 2px 7px;
  border-radius: 12px;
  white-space: nowrap;
  flex-shrink: 0;
}

.univ-search-empty {
  padding: 16px;
  text-align: center;
  color: #64748B;
  font-size: 12px;
}

/* =========================================================
   ZEN MODE / TAMPILAN BERSIH (MODE PRESENTASI BEBAS GANGGUAN)
   ========================================================= */
body.zen-mode-active #sidebar,
body.zen-mode-active #mapTopBar,
body.zen-mode-active #floatingKecCard,
body.zen-mode-active #mapLegend,
body.zen-mode-active #detailModal,
body.zen-mode-active #labelControlBar,
body.zen-mode-active .compass-rose,
body.zen-mode-active .leaflet-control-zoom,
body.zen-mode-active .leaflet-control-layers,
body.zen-mode-active .leaflet-control-attribution,
body.zen-mode-active .sidebar-backdrop,
body.zen-mode-active .floating-card-backdrop {
  opacity: 0 !important;
  pointer-events: none !important;
  visibility: hidden !important;
  transition: opacity 0.3s ease, visibility 0.3s ease !important;
}

.zen-exit-pill {
  position: fixed;
  top: 18px;
  left: 50%;
  transform: translateX(-50%) translateY(-50px);
  z-index: 3000;
  background: rgba(15, 23, 42, 0.9);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  color: #FFFFFF;
  padding: 9px 20px;
  border-radius: 30px;
  font-size: 12px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.35);
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transition: all 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  user-select: none;
}

.zen-exit-pill:hover {
  background: #2563EB;
  transform: translateX(-50%) translateY(0) scale(1.04);
}

body.zen-mode-active .zen-exit-pill {
  opacity: 1;
  pointer-events: auto;
  transform: translateX(-50%) translateY(0);
}

/* Two-Way Sync Glowing Highlight Animation */
@keyframes rowPulseGlow {
  0% {
    background-color: #DBEAFE;
    box-shadow: inset 0 0 0 2px #2563EB;
  }
  50% {
    background-color: #EFF6FF;
    box-shadow: inset 0 0 0 1px #60A5FA;
  }
  100% {
    background-color: #DBEAFE;
    box-shadow: inset 0 0 0 2px #2563EB;
  }
}

.kec-row.active-highlight {
  animation: rowPulseGlow 1.2s ease-in-out infinite alternate !important;
  border-left: 4px solid #1D4ED8 !important;
  background: #EFF6FF !important;
}

/* Dark Theme Support for Search & Zen */
[data-theme="dark"] .univ-search-box {
  background: rgba(30, 41, 59, 0.92);
  border-color: #475569;
}
[data-theme="dark"] .univ-search-input {
  color: #F8FAFC;
}
[data-theme="dark"] .univ-search-dropdown {
  background: #1E293B;
  border-color: #475569;
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.5);
}
[data-theme="dark"] .univ-search-item {
  border-bottom-color: #334155;
}
[data-theme="dark"] .univ-search-item:hover,
[data-theme="dark"] .univ-search-item.selected {
  background: rgba(37, 99, 235, 0.25);
}
[data-theme="dark"] .univ-item-name {
  color: #F8FAFC;
}
[data-theme="dark"] .univ-search-kbd {
  background: #334155;
  border-color: #475569;
  color: #94A3B8;
}

/* Responsive adjustments */
@media (max-width: 992px) {
  .universal-search-wrap {
    flex: 0 1 240px;
  }
  .univ-search-box {
    width: 100%;
  }
  .univ-search-box:focus-within {
    width: 100%;
  }
  .univ-search-kbd {
    display: none;
  }
}

@media (max-width: 768px) {
  .universal-search-wrap {
    order: 3;
    width: 100% !important;
    flex: 0 0 100% !important;
  }
  .univ-search-box {
    width: 100% !important;
    height: 36px;
    padding: 4px 10px;
  }
  .univ-search-box:focus-within {
    width: 100% !important;
  }
  .univ-search-dropdown {
    width: 100% !important;
    max-width: 100% !important;
    left: 0 !important;
    right: 0 !important;
  }
  .btn-zen-toggle .btn-text {
    display: none;
  }
}