/* ==========================================================================
   MAPA PREMIUM DARK - GERENCIA VALLE (FINAL OPTIMIZADO)
   ========================================================================== */

:root {
  --bg-dark: #05070c;
  /* Efecto Vidrio: Fondo oscuro translúcido */
  --panel-glass: rgba(15, 23, 42, 0.9); 
  --text-light: rgba(255, 255, 255, 0.95);
  --muted: rgba(255, 255, 255, 0.6);
  --border-glass: rgba(255, 255, 255, 0.1);
  --shadow-lg: 0 20px 50px rgba(0, 0, 0, 0.5);
  --radius-lg: 20px;

  /* Identidad Corporativa */
  --primary: #c8102e; 
  --primary-hover: #a00d25;
  --accent: #f2c200; /* Amarillo Cashless */
  
  --input-bg: rgba(255, 255, 255, 0.07);
}

/* Reset y Base */
* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: 'SF Pro Display', system-ui, -apple-system, sans-serif;
  background-color: var(--bg-dark);
  color: var(--text-light);
  height: 100vh;
  overflow: hidden; 
}

/* PANEL DE CONTROL */
.panel {
  position: absolute;
  top: 20px;
  left: 20px;
  width: 380px;
  z-index: 1000;
  padding: 25px;
  background: var(--panel-glass);
  backdrop-filter: blur(15px);
  -webkit-backdrop-filter: blur(15px);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
  gap: 15px;
}

/* Filas y Controles */
.fila { display: flex; flex-direction: column; gap: 8px; }

/* FIX SELECTORES */
select {
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 16px;
  padding-right: 40px !important;
}

input[type="text"], select, textarea, input[type="file"] {
  background: var(--input-bg);
  border: 1px solid var(--border-glass);
  color: white;
  padding: 12px;
  border-radius: 12px;
  font-size: 14px;
  outline: none;
  transition: all 0.3s ease;
}

select option {
  background-color: #1a202c;
  color: white;
  padding: 10px;
}

input:focus, select:focus {
  border-color: var(--primary);
  background: rgba(255,255,255,0.15);
  box-shadow: 0 0 0 3px rgba(200, 16, 46, 0.2);
}

/* BOTONES */
button {
  height: 46px;
  background: var(--primary);
  color: white;
  border: none;
  border-radius: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

button:hover {
  transform: translateY(-2px);
  filter: brightness(1.2);
  box-shadow: 0 8px 20px rgba(200, 16, 46, 0.3);
}

#btnLimpiar {
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--border-glass);
  color: var(--muted);
}

/* MAPA */
#map { width: 100%; height: 100vh; z-index: 1; }

/* POPUPS DE LEAFLET */
.leaflet-popup-content-wrapper {
  background: var(--panel-glass) !important;
  color: white !important;
  backdrop-filter: blur(10px);
  border: 1px solid var(--border-glass);
  border-radius: 15px;
}

.leaflet-popup-tip { background: var(--panel-glass) !important; }

/* ==========================================================================
   RESALTADOS (NPS / COBRO / VOLUMEN) 
   ========================================================================== */
.hl { 
  display: inline-block;
  padding: 2px 8px; 
  border-radius: 4px; 
  font-weight: 900; 
  font-size: 11px;
  text-transform: uppercase;
  margin: 2px 0;
}

/* Colores Dinámicos */
.hl-yellow { background: rgba(242, 194, 0, 0.2); color: #f2c200; border: 1px solid #f2c200; }
.hl-green  { background: rgba(34, 197, 94, 0.2); color: #4ade80; border: 1px solid #22c55e; }
.hl-red    { background: rgba(239, 68, 68, 0.2); color: #f87171; border: 1px solid #ef4444; }
.hl-blue   { background: rgba(56, 189, 248, 0.2); color: #38bdf8; border: 1px solid #38bdf8; }
.hl-orange { background: rgba(251, 146, 60, 0.2); color: #fb923c; border: 1px solid #fb923c; }

/* ===== MÓVIL ===== */
.togglePanel {
  position: fixed; left: 15px; top: 15px; z-index: 2000; height: 48px;
  padding: 0 20px; border-radius: 99px; background: var(--primary);
  color: white; font-weight: 800; display: none; cursor: pointer;
}

@media (max-width: 768px) {
  .togglePanel { display: block; }
  .panel { width: calc(100% - 40px); top: 80px; left: 20px; transition: 0.4s ease; }
  .panel.is-collapsed { transform: translateY(-150%); opacity: 0; pointer-events: none; }
}