/* index.css - Premium Light Mode & Professional WebGIS Theme */

/* ==========================================================================
   1. DESIGN TOKENS & VARIABLES (PREMIUM LIGHT MODE)
   ========================================================================== */
:root {
  /* Colors */
  --bg-dark: #f1f5f9;             /* Light Slate Grey */
  --bg-primary: #f8fafc;          /* Off-white */
  --bg-surface: rgba(255, 255, 255, 0.85); /* Pristine White Card */
  --bg-surface-opaque: #ffffff;
  --bg-surface-hover: #f1f5f9;
  --border-glow: rgba(59, 130, 246, 0.08);
  --border-light: rgba(0, 0, 0, 0.06);
  
  /* Text */
  --text-main: #0f172a;           /* Deep Slate Black */
  --text-muted: #334155;          /* Slate Dark Grey */
  --text-dim: #64748b;            /* Cool Muted Grey */
  
  /* Categories & Vibrant Accents */
  --color-kuliner: #dc2626;       /* Warm Crimson Red */
  --color-produksi: #16a34a;      /* Forest Green */
  --color-perdagangan: #d97706;   /* Deep Amber/Orange */
  --color-jasa: #0284c7;          /* Sky Blue */
  --color-active: #2563eb;        /* Corporate Navy Blue */
  
  /* Shadow & Radii */
  --shadow-premium: 0 10px 30px -5px rgba(15, 23, 42, 0.05), 0 4px 12px -2px rgba(15, 23, 42, 0.03);
  --shadow-hover: 0 20px 40px -10px rgba(15, 23, 42, 0.12), 0 0 20px -2px rgba(59, 130, 246, 0.05);
  
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  
  --transition-fast: 0.2s ease;
  --transition-normal: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ==========================================================================
   2. GLOBAL STYLES
   ========================================================================== */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Inter', sans-serif;
  background-color: var(--bg-primary);
  color: var(--text-muted);
  min-height: 100vh;
  overflow-x: hidden;
  position: relative;
  line-height: 1.6;
}

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

.hide {
  display: none !important;
}

/* Ambient Soft Pastel Backgrounds (Light Mode) */
.glow-bg-1 {
  position: fixed;
  width: 500px;
  height: 500px;
  top: -100px;
  left: -100px;
  background: radial-gradient(circle, rgba(59, 130, 246, 0.06) 0%, rgba(0, 0, 0, 0) 70%);
  z-index: -1;
  pointer-events: none;
  filter: blur(40px);
}

.glow-bg-2 {
  position: fixed;
  width: 600px;
  height: 600px;
  bottom: -200px;
  right: -100px;
  background: radial-gradient(circle, rgba(22, 163, 74, 0.04) 0%, rgba(0, 0, 0, 0) 70%);
  z-index: -1;
  pointer-events: none;
  filter: blur(50px);
}

/* Scrollbars */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: var(--bg-primary);
}

::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.1);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(0, 0, 0, 0.2);
}

/* Glassmorphism / Premium Card base class */
.glass {
  background: var(--bg-surface);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border-light);
  box-shadow: var(--shadow-premium);
  border-radius: var(--radius-md);
  transition: all var(--transition-normal);
}

.glass:hover {
  border-color: rgba(59, 130, 246, 0.15);
  box-shadow: var(--shadow-hover);
}

/* ==========================================================================
   3. HEADER & NAVIGATION STYLING
   ========================================================================== */
.app-header {
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-light);
  position: sticky;
  top: 0;
  z-index: 1000;
  height: 80px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.02);
}

.header-container {
  max-width: 1600px;
  height: 100%;
  margin: 0 auto;
  padding: 0 30px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

/* Logo Area */
.logo-area {
  display: flex;
  align-items: center;
  gap: 15px;
}

.logo-icon {
  width: 44px;
  height: 44px;
  background: linear-gradient(135deg, #1e3a8a 0%, #3b82f6 100%);
  border-radius: 10px;
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 20px;
  color: white;
  box-shadow: 0 4px 15px rgba(30, 58, 138, 0.2);
}

.logo-text h1 {
  font-size: 18px;
  font-weight: 800;
  color: #1e293b;
  letter-spacing: 0.02em;
  line-height: 1.2;
}

.logo-text p {
  font-size: 11px;
  color: var(--text-dim);
}

/* Navigation Links */
.nav-menu {
  display: flex;
  gap: 10px;
  background: rgba(0, 0, 0, 0.03);
  padding: 5px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(0, 0, 0, 0.04);
}

.nav-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  padding: 10px 20px;
  font-family: 'Inter', sans-serif;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  border-radius: 6px;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: all var(--transition-fast);
}

.nav-btn i {
  font-size: 14px;
}

.nav-btn:hover {
  color: var(--text-main);
  background: rgba(0, 0, 0, 0.03);
}

.nav-btn.active {
  color: white;
  background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.2);
}

/* Village Badge */
.village-badge {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(0, 0, 0, 0.02);
  border: 1px solid var(--border-light);
  padding: 8px 15px;
  border-radius: var(--radius-sm);
}

.badge-img {
  height: 28px;
  width: auto;
}

.badge-text {
  display: flex;
  flex-direction: column;
}

.badge-top {
  font-family: 'Outfit', sans-serif;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-main);
  line-height: 1.1;
}

.badge-bottom {
  font-size: 9px;
  color: var(--text-dim);
}

/* ==========================================================================
   4. LAYOUT GRID & PANELS (TAB 1)
   ========================================================================== */
.app-main-content {
  max-width: 1600px;
  margin: 0 auto;
  padding: 30px;
  position: relative;
}

.tab-pane {
  display: none;
}

.tab-pane.active {
  display: block;
  animation: fadeIn var(--transition-normal);
}

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

/* Stats Cards Bar */
.stats-row {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 20px;
  margin-bottom: 30px;
}

.stat-card {
  display: flex;
  align-items: center;
  gap: 15px;
  padding: 20px;
}

.stat-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 20px;
  color: white;
}

.theme-gradient-blue { background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%); box-shadow: 0 4px 14px rgba(37, 99, 235, 0.2); }
.theme-gradient-red { background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%); box-shadow: 0 4px 14px rgba(239, 68, 68, 0.2); }
.theme-gradient-green { background: linear-gradient(135deg, #10b981 0%, #16a34a 100%); box-shadow: 0 4px 14px rgba(16, 185, 129, 0.2); }
.theme-gradient-yellow { background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%); box-shadow: 0 4px 14px rgba(245, 158, 11, 0.2); }
.theme-gradient-sky { background: linear-gradient(135deg, #0ea5e9 0%, #0284c7 100%); box-shadow: 0 4px 14px rgba(14, 165, 233, 0.2); }

.stat-info {
  display: flex;
  flex-direction: column;
}

.stat-label {
  font-size: 11px;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 600;
}

.stat-value {
  font-size: 24px;
  font-weight: 800;
  color: var(--text-main);
  line-height: 1.1;
  margin: 2px 0;
}

.stat-sub {
  font-size: 10px;
  color: var(--text-dim);
}

/* GIS Grid Panel Layout */
.gis-grid {
  display: grid;
  grid-template-columns: 380px 1fr;
  gap: 25px;
  margin-bottom: 40px;
}

/* Sidebar and filters */
.gis-sidebar {
  display: flex;
  flex-direction: column;
  gap: 25px;
}

.filter-panel {
  padding: 24px;
}

.panel-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.panel-title i {
  color: var(--color-active);
}

.filter-group {
  margin-bottom: 18px;
}

.filter-group label {
  display: block;
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 600;
  margin-bottom: 8px;
}

.filter-group label i {
  margin-right: 5px;
  color: var(--text-dim);
}

.filter-input {
  width: 100%;
  background: #ffffff;
  border: 1px solid #cbd5e1;
  color: var(--text-main);
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  font-family: 'Inter', sans-serif;
  font-size: 13px;
  transition: all var(--transition-fast);
}

.filter-input::placeholder {
  color: var(--text-dim);
}

.filter-input:focus {
  outline: none;
  border-color: var(--color-active);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
  background: #ffffff;
}

.filter-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 15px;
}

/* Reset button & main buttons */
.btn-primary {
  background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
  border: none;
  color: white;
  font-family: 'Inter', sans-serif;
  font-weight: 600;
  font-size: 13px;
  padding: 12px 24px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.2);
  transition: all var(--transition-fast);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(37, 99, 235, 0.3);
}

.btn-excel {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  border: none;
  color: white;
  font-family: 'Inter', sans-serif;
  font-weight: 600;
  font-size: 13px;
  padding: 12px 24px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.2);
  transition: all var(--transition-fast);
}

.btn-excel:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(16, 185, 129, 0.3);
}

.btn-secondary {
  width: 100%;
  background: #ffffff;
  border: 1px solid #cbd5e1;
  color: var(--text-muted);
  font-family: 'Inter', sans-serif;
  font-weight: 600;
  font-size: 13px;
  padding: 12px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: inline-flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  transition: all var(--transition-fast);
}

.btn-secondary:hover {
  color: var(--text-main);
  background: #f8fafc;
  border-color: #94a3b8;
}

.btn-primary-sm {
  background: #2563eb;
  border: none;
  color: white;
  font-family: 'Inter', sans-serif;
  font-size: 11px;
  font-weight: 600;
  padding: 8px 12px;
  border-radius: 6px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  transition: background var(--transition-fast);
}

.btn-primary-sm:hover {
  background: #1d4ed8;
}

/* Sidebar dynamic statistics list */
.sidebar-stats {
  padding: 24px;
}

.dusun-stats-container {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-height: 250px;
  overflow-y: auto;
  padding-right: 5px;
}

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

.dusun-stat-label-row {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  font-weight: 600;
}

.dusun-stat-name { color: var(--text-muted); }
.dusun-stat-val { color: var(--color-active); font-weight: 700; }

.dusun-stat-bar-bg {
  width: 100%;
  height: 6px;
  background: #e2e8f0;
  border-radius: 3px;
  overflow: hidden;
}

.dusun-stat-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #2563eb, #0ea5e9);
  border-radius: 3px;
  width: 0%;
  transition: width 1s ease;
}

/* ==========================================================================
   5. MAP & GIS COMPONENT STYLING (LIGHT THEME VOYAGER)
   ========================================================================== */
.gis-map-container {
  height: 600px;
  position: relative;
  overflow: hidden;
  border: 1px solid var(--border-light);
}

.main-map-canvas {
  width: 100%;
  height: 100%;
  background-color: #f1f5f9;
  z-index: 1;
}

/* Floating Legend on Map */
.map-legend-overlay {
  position: absolute;
  bottom: 20px;
  left: 20px;
  z-index: 500;
  padding: 15px;
  border-radius: var(--radius-sm);
  background: #ffffff;
  border: 1px solid rgba(0, 0, 0, 0.08);
  pointer-events: auto;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
}

.legend-title {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 10px;
  border-bottom: 1px solid #cbd5e1;
  padding-bottom: 5px;
}

.legend-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.legend-list li {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 600;
}

.legend-color-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  box-shadow: 0 0 4px var(--dot-glow);
}

.dot-kuliner { background-color: var(--color-kuliner); --dot-glow: rgba(220, 38, 38, 0.2); }
.dot-produksi { background-color: var(--color-produksi); --dot-glow: rgba(22, 163, 74, 0.2); }
.dot-perdagangan { background-color: var(--color-perdagangan); --dot-glow: rgba(217, 119, 6, 0.2); }
.dot-jasa { background-color: var(--color-jasa); --dot-glow: rgba(2, 132, 199, 0.2); }

.legend-boundary-line {
  width: 16px;
  height: 3px;
  background-color: #0284c7;
  border-radius: 1px;
  box-shadow: 0 0 3px rgba(2, 132, 199, 0.3);
}

/* Map custom zoom controls styling override */
.leaflet-control-zoom {
  border: 1px solid rgba(0, 0, 0, 0.08) !important;
  box-shadow: 0 4px 15px rgba(0,0,0,0.05) !important;
  border-radius: var(--radius-sm) !important;
  overflow: hidden;
}

.leaflet-control-zoom-in, .leaflet-control-zoom-out {
  background: #ffffff !important;
  color: var(--text-muted) !important;
  border: none !important;
  border-bottom: 1px solid #e2e8f0 !important;
  transition: all var(--transition-fast) !important;
}

.leaflet-control-zoom-in:hover, .leaflet-control-zoom-out:hover {
  background: #f8fafc !important;
  color: var(--color-active) !important;
}

.leaflet-bar {
  border: none !important;
}

/* Custom pulsing map marker */
.custom-pulsing-marker {
  position: relative;
}

.marker-pin {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--marker-color);
  border: 2px solid white;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15), 0 0 8px var(--marker-color);
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 2;
}

.marker-pulse {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--marker-color);
  opacity: 0.35;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  animation: pulse-ring 1.8s infinite ease-out;
  z-index: 1;
  pointer-events: none;
}

@keyframes pulse-ring {
  0% { transform: translate(-50%, -50%) scale(0.4); opacity: 0.8; }
  100% { transform: translate(-50%, -50%) scale(1.5); opacity: 0; }
}

/* Dark themed Leaflet Popup */
.leaflet-popup-content-wrapper {
  background: #ffffff !important;
  backdrop-filter: blur(10px);
  border: 1px solid #cbd5e1 !important;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1) !important;
  border-radius: var(--radius-md) !important;
  color: var(--text-main) !important;
  padding: 0 !important;
  overflow: hidden;
}

.leaflet-popup-content {
  margin: 0 !important;
  width: 240px !important;
  font-family: 'Inter', sans-serif !important;
}

.leaflet-popup-tip {
  background: #ffffff !important;
  border: 1px solid #cbd5e1 !important;
  border-top: none;
  border-left: none;
}

.leaflet-container a.leaflet-popup-close-button {
  color: #334155 !important;
  background: rgba(255, 255, 255, 0.75) !important;
  backdrop-filter: blur(4px) !important;
  border-radius: 50% !important;
  width: 20px !important;
  height: 20px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  box-shadow: 0 2px 6px rgba(0,0,0,0.1) !important;
  padding: 0 !important;
  font-size: 14px !important;
  top: 8px !important;
  right: 8px !important;
  z-index: 1000 !important;
  border: 1px solid rgba(0,0,0,0.05) !important;
  transition: all var(--transition-fast) !important;
}

.leaflet-container a.leaflet-popup-close-button:hover {
  background: #ffffff !important;
  color: #000000 !important;
  transform: scale(1.05);
}

/* Popup content elements */
.popup-card {
  display: flex;
  flex-direction: column;
}

.popup-img {
  width: 100%;
  height: 85px;
  object-fit: cover;
  display: block;
}

.popup-details {
  padding: 10px 12px;
}

.popup-category-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 5px;
}

.popup-category {
  font-family: 'Outfit', sans-serif;
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  padding: 2px 6px;
  border-radius: 4px;
  display: inline-block;
  color: white;
}

.popup-cat-kuliner { background-color: var(--color-kuliner); }
.popup-cat-produksi { background-color: var(--color-produksi); }
.popup-cat-perdagangan { background-color: var(--color-perdagangan); }
.popup-cat-jasa { background-color: var(--color-jasa); }

.popup-dusun {
  font-size: 9px;
  font-weight: 600;
  color: var(--text-dim);
}

.popup-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 5px;
  line-height: 1.3;
}

.popup-owner-row {
  display: flex;
  flex-direction: column;
  gap: 3px;
  margin-bottom: 6px;
}

.popup-owner-detail {
  font-size: 10px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 5px;
  margin: 0;
}

.popup-owner-detail i {
  color: var(--color-active);
  font-size: 10px;
  width: 12px;
  text-align: center;
}

.popup-address {
  font-size: 9.5px;
  color: var(--text-dim);
  margin-bottom: 8px;
  line-height: 1.35;
}

.popup-actions {
  display: flex;
  gap: 6px;
  border-top: 1px solid #e2e8f0;
  padding-top: 8px;
  margin-top: 6px;
}

.popup-btn-route {
  flex: 1;
  background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
  color: white !important;
  text-decoration: none;
  font-size: 10px;
  font-weight: 600;
  padding: 6px 8px;
  border-radius: 4px;
  text-align: center;
  border: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  transition: all var(--transition-fast);
}

.popup-btn-route:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 10px rgba(37, 99, 235, 0.2);
}

.popup-btn-contact {
  background: #25d366; /* WA Green */
  color: white !important;
  text-decoration: none;
  font-size: 11px;
  width: 26px;
  height: 26px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--transition-fast);
}

.popup-btn-contact:hover {
  background: #128c7e;
}

/* Custom styling for origin marker popup */
.origin-popup-card {
  padding: 8px 10px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 140px;
}

.origin-popup-header {
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: 'Outfit', sans-serif;
  font-size: 11px;
  font-weight: 700;
  color: #3b82f6; /* Premium Blue representing origin start */
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.origin-popup-header i {
  font-size: 11px;
}

.origin-popup-body {
  font-size: 10.5px;
  font-weight: 600;
  color: var(--text-main);
  line-height: 1.35;
}

/* Styled Leaflet Layer Control - Collapsed Button Style */
.leaflet-control-layers {
  background: #ffffff !important;
  border: 1px solid #cbd5e1 !important;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08) !important;
  border-radius: 8px !important;
  transition: all var(--transition-normal) !important;
}

.leaflet-control-layers-toggle {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%232563eb' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 2L2 7l10 5 10-5-10-5zM2 17l10 5 10-5M2 12l10 5 10-5'/%3E%3C/svg%3E") !important;
  background-size: 20px 20px !important;
  background-position: center !important;
  background-repeat: no-repeat !important;
  width: 36px !important;
  height: 36px !important;
  border-radius: 8px !important;
}

.leaflet-control-layers:hover {
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.12) !important;
}

/* Expanded state */
.leaflet-control-layers-expanded {
  padding: 10px 14px !important;
  border-radius: var(--radius-md) !important;
  background: #ffffff !important;
}

.leaflet-control-layers-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.leaflet-control-layers-base {
  display: flex;
  flex-direction: column;
  gap: 6px;
  border-bottom: 1px solid #e2e8f0;
  padding-bottom: 8px;
  margin-bottom: 4px;
}

.leaflet-control-layers-overlays {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.layer-control-item {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-main);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
}

.layer-control-item i {
  color: var(--color-active);
  font-size: 11px;
  width: 14px;
  text-align: center;
}

/* Custom styles for radios and checkboxes inside leaflet controls */
.leaflet-control-layers label {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 0;
  padding: 2px 0;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.leaflet-control-layers label:hover {
  transform: translateX(2px);
}

.leaflet-control-layers input[type="radio"],
.leaflet-control-layers input[type="checkbox"] {
  cursor: pointer;
  accent-color: var(--color-active);
  width: 13px;
  height: 13px;
  margin: 0;
}

/* ==========================================================================
   6. FLOATING ROUTING WIDGET
   ========================================================================== */
.routing-widget {
  position: absolute;
  top: 20px;
  right: 20px;
  z-index: 500;
  width: 330px;
  max-height: 480px;
  background: #ffffff;
  border: 1px solid #cbd5e1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
  animation: slideIn var(--transition-normal);
}

@keyframes slideIn {
  from { transform: translateX(50px); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

.routing-widget.hide {
  display: none !important;
}

.routing-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15px;
  border-bottom: 1px solid #cbd5e1;
}

.routing-header h4 {
  font-size: 13px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-main);
}

.routing-header h4 i {
  color: var(--color-active);
}

.btn-icon-close {
  background: transparent;
  border: none;
  color: var(--text-dim);
  font-size: 16px;
  cursor: pointer;
  transition: color var(--transition-fast);
}

.btn-icon-close:hover {
  color: var(--text-main);
}

.routing-body {
  padding: 15px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.routing-instruction {
  font-size: 11px;
  color: var(--text-muted);
  line-height: 1.5;
  background: rgba(37, 99, 235, 0.05);
  padding: 10px;
  border-radius: 6px;
  border-left: 3px solid var(--color-active);
}

.routing-actions {
  display: flex;
  justify-content: center;
}

.routing-directions-steps {
  border-top: 1px solid #e2e8f0;
  padding-top: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.routing-directions-steps.hide {
  display: none !important;
}

.route-meta {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  font-weight: 700;
  color: var(--color-produksi);
  background: rgba(22, 163, 74, 0.08);
  padding: 8px;
  border-radius: 4px;
}

.route-target-info {
  font-size: 11px;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.target-label {
  color: var(--text-dim);
}

.steps-list {
  padding-left: 0;
  list-style: none;
  font-size: 11px;
  color: var(--text-muted);
  max-height: 200px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.steps-list li {
  padding-left: 5px;
  line-height: 1.4;
  border-bottom: 1px solid #e2e8f0;
  padding-bottom: 5px;
}

/* ==========================================================================
   7. UMKM CARD LIST COMPONENT
   ========================================================================== */
.umkm-cards-section {
  margin-top: 10px;
}

.section-title-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.section-title-bar h3 {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 10px;
}

.section-title-bar h3 i {
  color: var(--color-active);
}

.result-count {
  font-size: 12px;
  color: var(--text-muted);
  background: #ffffff;
  padding: 4px 12px;
  border-radius: 20px;
  border: 1px solid var(--border-light);
  box-shadow: 0 2px 8px rgba(0,0,0,0.02);
}

.cards-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
}

/* Dynamic UMKM card glass styling */
.umkm-card {
  overflow: hidden;
  display: flex;
  flex-direction: column;
  height: 330px;
  background: #ffffff;
  border: 1px solid var(--border-light);
  box-shadow: var(--shadow-premium);
  border-radius: var(--radius-md);
  transition: all var(--transition-normal);
}

.umkm-card:hover {
  transform: translateY(-5px);
  border-color: var(--card-glow);
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.08), 0 0 15px var(--card-glow-soft);
}

.card-img-container {
  height: 110px;
  position: relative;
  overflow: hidden;
  border-bottom: 1px solid #e2e8f0;
}

.card-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--transition-normal);
}

.umkm-card:hover .card-img {
  transform: scale(1.08);
}

.card-category-badge {
  position: absolute;
  top: 12px;
  left: 12px;
  font-family: 'Outfit', sans-serif;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 4px 10px;
  border-radius: 4px;
  color: white;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
  background-color: #64748b;
}

.badge-kuliner { background-color: var(--color-kuliner); }
.badge-produksi { background-color: var(--color-produksi); }
.badge-perdagangan { background-color: var(--color-perdagangan); }
.badge-jasa { background-color: var(--color-jasa); }

.card-dusun-badge {
  position: absolute;
  top: 12px;
  right: 12px;
  font-size: 9px;
  font-weight: 600;
  padding: 4px 8px;
  border-radius: 4px;
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(0, 0, 0, 0.05);
}

.card-body {
  padding: 12px;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}

.card-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 4px;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  height: 34px;
}

.card-owner-info {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 10.5px;
  color: var(--text-dim);
  margin-bottom: 6px;
}

.card-owner-info i {
  color: var(--card-glow);
}

.card-desc {
  font-size: 10.5px;
  color: var(--text-muted);
  line-height: 1.4;
  margin-bottom: 8px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  flex-grow: 1;
}

.card-footer {
  border-top: 1px solid #e2e8f0;
  padding-top: 8px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.btn-card-map {
  background: #ffffff;
  border: 1px solid #cbd5e1;
  color: var(--text-muted);
  font-family: 'Inter', sans-serif;
  font-size: 11px;
  font-weight: 600;
  padding: 8px 12px;
  border-radius: 6px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  transition: all var(--transition-fast);
}

.btn-card-map:hover {
  color: var(--card-glow);
  border-color: var(--card-glow);
  background: var(--card-glow-soft);
}

.btn-card-wa {
  background: #25d366;
  color: white;
  text-decoration: none;
  font-size: 11px;
  font-weight: 600;
  padding: 8px 12px;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  transition: background var(--transition-fast);
}

.btn-card-wa:hover {
  background: #128c7e;
}

/* ==========================================================================
   8. ADMIN DASHBOARD PANEL (TAB 2)
   ========================================================================== */
.admin-header-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 25px;
}

.admin-title h2 {
  font-size: 20px;
  font-weight: 800;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 10px;
}

.admin-title h2 i {
  color: var(--color-active);
}

.admin-title p {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 4px;
}

/* Admin search bar in admin panel */
.admin-search-bar {
  display: flex;
  gap: 15px;
  padding: 15px 20px;
  margin-bottom: 25px;
  align-items: center;
}

.admin-search-box {
  flex: 1;
  position: relative;
}

.admin-search-box i {
  position: absolute;
  left: 15px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-dim);
  font-size: 13px;
}

.admin-search-box input {
  width: 100%;
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: var(--radius-sm);
  color: var(--text-main);
  padding: 10px 15px 10px 42px;
  font-family: 'Inter', sans-serif;
  font-size: 13px;
  transition: all var(--transition-fast);
}

.admin-search-box input:focus {
  outline: none;
  border-color: var(--color-active);
}

.filter-input-sm {
  background: #ffffff;
  border: 1px solid #cbd5e1;
  color: var(--text-main);
  padding: 10px 15px;
  border-radius: var(--radius-sm);
  font-family: 'Inter', sans-serif;
  font-size: 13px;
  width: 180px;
}

/* Admin data table styling */
.admin-table-container {
  overflow-x: auto;
  border: 1px solid var(--border-light);
  padding: 10px;
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 13px;
}

.admin-table th {
  background: #f8fafc;
  color: var(--text-main);
  font-family: 'Outfit', sans-serif;
  font-weight: 700;
  padding: 15px;
  border-bottom: 2px solid #e2e8f0;
}

.admin-table td {
  padding: 15px;
  border-bottom: 1px solid #e2e8f0;
  color: var(--text-muted);
  vertical-align: middle;
}

.admin-table tr:hover td {
  background: #f8fafc;
  color: var(--text-main);
}

.admin-table-img {
  width: 44px;
  height: 44px;
  object-fit: cover;
  border-radius: 6px;
  border: 1px solid #cbd5e1;
}

.admin-cat-tag {
  font-family: 'Outfit', sans-serif;
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 3px 8px;
  border-radius: 4px;
  display: inline-block;
  background: rgba(148, 163, 184, 0.15);
  border: 1px solid rgba(148, 163, 184, 0.3);
  color: #64748b !important;
}

.admin-cat-kuliner { background: rgba(220, 38, 38, 0.1); border: 1px solid rgba(220, 38, 38, 0.2); color: var(--color-kuliner) !important; }
.admin-cat-produksi { background: rgba(22, 163, 74, 0.1); border: 1px solid rgba(22, 163, 74, 0.2); color: var(--color-produksi) !important; }
.admin-cat-perdagangan { background: rgba(217, 119, 6, 0.1); border: 1px solid rgba(217, 119, 6, 0.2); color: var(--color-perdagangan) !important; }
.admin-cat-jasa { background: rgba(2, 132, 199, 0.1); border: 1px solid rgba(2, 132, 199, 0.2); color: var(--color-jasa) !important; }

.admin-action-cell {
  display: flex;
  justify-content: center;
  gap: 8px;
}

.btn-admin-edit {
  background: rgba(37, 99, 235, 0.08);
  border: 1px solid rgba(37, 99, 235, 0.2);
  color: var(--color-active);
  font-size: 11px;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: 6px;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.btn-admin-edit:hover {
  background: var(--color-active);
  color: white;
}

.btn-admin-delete {
  background: rgba(220, 38, 38, 0.08);
  border: 1px solid rgba(220, 38, 38, 0.2);
  color: var(--color-kuliner);
  font-size: 11px;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: 6px;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.btn-admin-delete:hover {
  background: var(--color-kuliner);
  color: white;
}

.empty-table-view {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 50px;
  color: var(--text-dim);
  gap: 15px;
}

.empty-table-view i {
  font-size: 40px;
}

.empty-table-view.hide {
  display: none !important;
}

/* ==========================================================================
   9. TENTANG SISTEM PAGE (TAB 3)
   ========================================================================== */
.about-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 30px;
}

.about-card {
  padding: 30px;
  background: #ffffff;
}

.about-section-title {
  font-size: 18px;
  font-weight: 800;
  color: var(--text-main);
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 10px;
  border-bottom: 1px solid #cbd5e1;
  padding-bottom: 12px;
}

.about-section-title i {
  color: var(--color-active);
}

.about-content p {
  margin-bottom: 15px;
  font-size: 13.5px;
  color: var(--text-muted);
  text-align: justify;
}

.about-content strong {
  color: var(--text-main);
}

.subsection-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-main);
  margin: 25px 0 15px 0;
  display: flex;
  align-items: center;
  gap: 8px;
}

.subsection-title i {
  color: var(--color-active);
}

/* Info Box / Alert block */
.info-alert {
  display: flex;
  gap: 15px;
  background: rgba(37, 99, 235, 0.05);
  border: 1px solid rgba(37, 99, 235, 0.15);
  border-left: 4px solid var(--color-active);
  padding: 16px;
  border-radius: var(--radius-sm);
  margin: 20px 0;
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.5;
}

.info-alert i {
  font-size: 16px;
  color: var(--color-active);
  margin-top: 2px;
}

/* Dynamic timeline styles for RAD method */
.rad-timeline {
  display: flex;
  flex-direction: column;
  gap: 20px;
  margin-top: 20px;
  position: relative;
  padding-left: 20px;
}

.rad-timeline::before {
  content: '';
  position: absolute;
  top: 15px;
  left: 31px;
  bottom: 15px;
  width: 2px;
  background: #cbd5e1;
}

.rad-step {
  display: flex;
  gap: 20px;
  position: relative;
}

.rad-icon {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #ffffff;
  border: 2px solid var(--color-active);
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 10px;
  color: var(--color-active);
  z-index: 5;
  box-shadow: 0 0 8px rgba(37, 99, 235, 0.2);
}

.rad-info {
  flex: 1;
}

.rad-info h4 {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 4px;
}

.rad-info p {
  font-size: 11px;
  color: var(--text-dim);
  margin-bottom: 0;
}

/* Right side: Village profiles styling */
.village-hero-image {
  position: relative;
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid var(--border-light);
  height: 200px;
  margin-bottom: 20px;
}

.village-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.image-caption {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  background: linear-gradient(to top, rgba(0,0,0,0.6), rgba(0,0,0,0));
  padding: 10px 15px;
  font-size: 10.5px;
  color: white;
  font-weight: 500;
}

.potency-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 15px 0 25px 0;
}

.potency-list li {
  display: flex;
  gap: 12px;
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.5;
}

.potency-list i {
  font-size: 13px;
  margin-top: 3px;
  width: 14px;
}

.text-red { color: var(--color-kuliner); }
.text-green { color: var(--color-produksi); }
.text-yellow { color: var(--color-perdagangan); }
.text-sky { color: var(--color-jasa); }

.about-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12.5px;
  border: 1px solid #cbd5e1;
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.about-table td {
  padding: 12px 16px;
  border-bottom: 1px solid #e2e8f0;
}

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

.about-table tr td:first-child {
  background: #f8fafc;
  font-weight: 600;
  color: var(--text-main);
  width: 40%;
}

.about-table tr td:second-child {
  color: var(--text-muted);
}

/* ==========================================================================
   10. MODAL FORM OVERLAY DIALOG (ADMIN CRUD)
   ========================================================================== */
.modal-dialog {
  border: none;
  background: transparent;
  width: 90%;
  max-width: 950px;
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  outline: none;
  z-index: 2000;
}

.modal-dialog::backdrop {
  background: rgba(15, 23, 42, 0.4);
  backdrop-filter: blur(8px);
}

.modal-wrapper {
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: var(--radius-lg);
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.15);
  display: flex;
  flex-direction: column;
  max-height: 90vh;
  overflow: hidden;
  animation: modalScale var(--transition-normal);
}

@keyframes modalScale {
  from { transform: scale(0.95); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 30px;
  border-bottom: 1px solid #cbd5e1;
}

.modal-header h3 {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 10px;
}

.modal-header h3 i {
  color: var(--color-active);
}

.modal-form {
  overflow-y: auto;
  padding: 30px;
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 30px;
}

.form-column {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.form-group label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
}

.required {
  color: var(--color-kuliner);
}

.form-group input, 
.form-group select, 
.form-group textarea {
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: var(--radius-sm);
  color: var(--text-main);
  padding: 10px 14px;
  font-family: 'Inter', sans-serif;
  font-size: 13px;
  transition: all var(--transition-fast);
}

.form-group textarea {
  resize: vertical;
}

.form-group input:focus, 
.form-group select:focus, 
.form-group textarea:focus {
  outline: none;
  border-color: var(--color-active);
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 15px;
}

/* Coordinate picker and mini map */
.coordinate-helper-text {
  font-size: 10.5px;
  color: var(--text-muted);
  background: rgba(37, 99, 235, 0.05);
  padding: 8px 12px;
  border-radius: 6px;
  border-left: 3px solid var(--color-active);
  line-height: 1.4;
  margin-bottom: 2px;
}

.mini-map-container {
  height: 180px;
  position: relative;
  border-radius: var(--radius-sm);
  overflow: hidden;
  border: 1px solid #cbd5e1;
}

.picker-map-canvas {
  width: 100%;
  height: 100%;
  background: #f1f5f9;
}

.btn-picker-toggle {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 500;
  background: #ffffff;
  border: 1px solid #cbd5e1;
  color: var(--text-muted);
  font-family: 'Inter', sans-serif;
  font-size: 11px;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: 6px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 5px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.05);
  transition: all var(--transition-fast);
}

.btn-picker-toggle.active {
  background: var(--color-active);
  color: white;
  border-color: var(--color-active);
  box-shadow: 0 0 10px rgba(37, 99, 235, 0.3);
}

#btn-focus-village {
  background: #2563eb;
  color: white;
  border-color: #2563eb;
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.2);
}

#btn-focus-village:hover {
  background: #1d4ed8;
  border-color: #1d4ed8;
}

/* Photo uploader with preview */
.photo-upload-container {
  position: relative;
  min-height: 120px;
}

.photo-file-input {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
  z-index: 10;
}

.upload-trigger-area {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 25px;
  min-height: 120px;
  border: 2px dashed #cbd5e1;
  border-radius: var(--radius-sm);
  background: #f8fafc;
  text-align: center;
  transition: all var(--transition-fast);
  box-sizing: border-box;
}

.photo-upload-container:hover .upload-trigger-area {
  background: #f1f5f9;
  border-color: var(--color-active);
}

.upload-trigger-area i {
  font-size: 24px;
  color: var(--text-dim);
}

.upload-text {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
}

.upload-sub {
  font-size: 10px;
  color: var(--text-dim);
}

.photo-preview-box {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: #ffffff;
  border-radius: var(--radius-sm);
  border: 1px solid #cbd5e1;
  overflow: hidden;
  z-index: 15;
}

.photo-preview-box.hide {
  display: none !important;
}

.upload-preview-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.btn-remove-photo-badge {
  position: absolute;
  bottom: 10px;
  right: 10px;
  background: rgba(220, 38, 38, 0.9);
  border: none;
  color: white;
  font-family: 'Inter', sans-serif;
  font-size: 10px;
  font-weight: 600;
  padding: 5px 10px;
  border-radius: 4px;
  cursor: pointer;
  z-index: 20;
}

.modal-footer-actions {
  display: flex;
  justify-content: flex-end;
  gap: 15px;
  border-top: 1px solid #cbd5e1;
  padding-top: 20px;
  margin-top: 20px;
}

/* ==========================================================================
   11. APP FOOTER STYLING
   ========================================================================== */
.app-footer {
  background: #ffffff;
  border-top: 1px solid var(--border-light);
  padding: 20px 0;
  margin-top: 50px;
  box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.02);
}

.footer-container {
  max-width: 1600px;
  margin: 0 auto;
  padding: 0 30px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 11px;
  color: var(--text-dim);
}

.footer-meta {
  display: flex;
  gap: 10px;
  font-weight: 600;
  color: var(--text-muted);
}

/* ==========================================================================
   12. RESPONSIVENESS MEDIA QUERIES
   ========================================================================== */
@media (max-width: 1200px) {
  .stats-row {
    grid-template-columns: repeat(3, 1fr);
  }
  .gis-grid {
    display: flex;
    flex-direction: column;
    gap: 25px;
  }
  .gis-map-container {
    order: -1;
    height: 450px;
  }
  .cards-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .about-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .app-header {
    height: auto;
  }
  .header-container {
    flex-direction: column;
    height: auto;
    padding: 15px;
    gap: 15px;
  }
  .nav-menu {
    width: 100%;
    justify-content: space-between;
    display: flex;
    gap: 6px;
  }
  .nav-btn {
    padding: 8px 10px;
    font-size: 11px;
    gap: 4px;
    flex: 1;
    justify-content: center;
  }
  .nav-btn span {
    display: inline !important;
    font-size: 11px;
  }
  .village-badge {
    display: none;
  }
  .stats-row {
    display: flex;
    overflow-x: auto;
    gap: 12px;
    margin-bottom: 20px;
    padding: 5px 2px 12px 2px;
    scrollbar-width: none; /* Hide scrollbar for Firefox */
    -ms-overflow-style: none;  /* Hide scrollbar for IE/Edge */
  }
  .stats-row::-webkit-scrollbar {
    display: none; /* Hide scrollbar for Chrome/Safari/Opera */
  }
  .stat-card {
    flex: 0 0 165px; /* fixed width for cards in horizontal scroll */
    padding: 12px 14px;
    gap: 10px;
  }
  .stat-icon {
    width: 38px;
    height: 38px;
    font-size: 16px;
    border-radius: 8px;
    flex-shrink: 0;
  }
  .stat-value {
    font-size: 18px;
  }
  .stat-label {
    font-size: 9.5px;
  }
  .filter-panel {
    padding: 16px;
  }
  .filter-row {
    grid-template-columns: 1fr;
    gap: 12px;
  }
  .map-legend-overlay {
    bottom: 10px;
    left: 10px;
    padding: 10px;
  }
  .routing-widget {
    top: 10px;
    right: 10px;
    left: 10px;
    width: auto;
    max-height: 380px;
  }
  .steps-list {
    max-height: 160px;
  }
  .cards-grid {
    grid-template-columns: 1fr;
  }
  .form-grid {
    grid-template-columns: 1fr;
  }
  .form-row {
    grid-template-columns: 1fr;
    gap: 12px;
  }
  .modal-dialog {
    width: 95%;
  }
  .footer-container {
    flex-direction: column;
    text-align: center;
    gap: 10px;
  }
}

/* ==========================================================================
   TOAST NOTIFICATION SYSTEM
   ========================================================================== */
#toast-container {
  position: fixed;
  top: 24px;
  right: 24px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}

.custom-toast {
  pointer-events: auto;
  min-width: 280px;
  max-width: 380px;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
  padding: 12px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  transform: translateX(120%);
  opacity: 0;
  transition: all 0.35s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.custom-toast.show {
  transform: translateX(0);
  opacity: 1;
}

.custom-toast.hide {
  transform: translateY(-20px);
  opacity: 0;
  transition: all 0.25s ease-in;
}

.toast-content {
  display: flex;
  align-items: center;
  gap: 10px;
}

.toast-content i {
  font-size: 18px;
}

.toast-message {
  font-family: 'Inter', sans-serif;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--text-main);
  line-height: 1.4;
}

.toast-close-btn {
  background: none;
  border: none;
  color: var(--text-dim);
  font-size: 18px;
  cursor: pointer;
  padding: 0;
  line-height: 1;
  transition: color var(--transition-fast);
}

.toast-close-btn:hover {
  color: var(--text-main);
}

/* Toast types colors */
.toast-success {
  border-left: 4px solid #10b981;
}
.toast-success i {
  color: #10b981;
}

.toast-error {
  border-left: 4px solid #ef4444;
}
.toast-error i {
  color: #ef4444;
}

.toast-warning {
  border-left: 4px solid #f59e0b;
}
.toast-warning i {
  color: #f59e0b;
}

.toast-info {
  border-left: 4px solid #3b82f6;
}
.toast-info i {
  color: #3b82f6;
}

/* ==========================================================================
   CUSTOM CONFIRM MODAL DIALOG
   ========================================================================== */
.custom-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(15, 23, 42, 0.4);
  backdrop-filter: blur(4px);
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease-out;
}

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

.custom-modal-box {
  width: 90%;
  max-width: 360px;
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: var(--radius-md);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.15);
  padding: 24px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  transform: scale(0.9);
  transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.custom-modal-overlay.show .custom-modal-box {
  transform: scale(1);
}

.custom-modal-icon {
  width: 48px;
  height: 48px;
  background: rgba(239, 68, 68, 0.1);
  color: #ef4444;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  margin-bottom: 16px;
}

.custom-modal-title {
  font-family: 'Outfit', sans-serif;
  font-size: 16px;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 8px;
}

.custom-modal-message {
  font-family: 'Inter', sans-serif;
  font-size: 11.5px;
  color: var(--text-muted);
  line-height: 1.5;
  margin-bottom: 20px;
}

.custom-modal-actions {
  display: flex;
  gap: 12px;
  width: 100%;
}

.modal-btn {
  flex: 1;
  padding: 8px 16px;
  font-family: 'Inter', sans-serif;
  font-size: 11.5px;
  font-weight: 600;
  border-radius: 6px;
  cursor: pointer;
  border: none;
  transition: all var(--transition-fast);
}

.btn-cancel {
  background: #f1f5f9;
  color: var(--text-muted);
  border: 1px solid #e2e8f0;
}

.btn-cancel:hover {
  background: #e2e8f0;
  color: var(--text-main);
}

.btn-ok {
  background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
  color: white;
  box-shadow: 0 4px 10px rgba(239, 68, 68, 0.2);
}

.btn-ok:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 14px rgba(239, 68, 68, 0.3);
}
