@import url("https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700&display=swap");

:root {
  --primary: #3b82f6;
  --primary-glow: rgba(59, 130, 246, 0.3);
  --secondary: #2563eb;
  --accent: #10b981;
  --success-color: #10b981;
  --bg-dark: #f8fafc;
  --glass-bg: rgba(255, 255, 255, 0.75);
  --glass-border: rgba(255, 255, 255, 0.8);
  --text-main: #0f172a;
  --text-muted: #64748b;
  --font-main: "Outfit", sans-serif;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  overflow: hidden;
  background-color: var(--bg-dark);
  font-family: var(--font-main);
  color: var(--text-main);
}

#container {
  width: 100vw;
  height: 100vh;
  position: absolute;
  top: 0;
  left: 0;
  z-index: 1;
}

/* UI Overlay */
#ui-root {
  position: absolute;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 10;
  display: flex;
  pointer-events: none; /* Let clicks pass through to 3D canvas */
}

/* Left Navigation */
.left-nav {
  width: 64px;
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid rgba(148, 163, 184, 0.22);
  border-radius: 30px;
  backdrop-filter: blur(24px) saturate(160%);
  -webkit-backdrop-filter: blur(24px) saturate(160%);
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 24px 0;
  gap: 24px;
  pointer-events: auto;
  margin-top: 30px;
  box-shadow:
    0 24px 70px rgba(15, 23, 42, 0.16),
    0 2px 10px rgba(15, 23, 42, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.9);
  position: relative;
}

.nav-bottom-status {
  margin-top: auto;
  padding-bottom: 20px;
}

.status-indicator {
  width: 36px;
  height: 36px;
  border-radius: 12px;
  background: rgba(16, 185, 129, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(16, 185, 129, 0.2);
}

.status-indicator .status-dot {
  margin: 0;
  width: 10px;
  height: 10px;
}

.nav-brand {
  color: var(--primary);
  margin-bottom: 20px;
  filter: drop-shadow(0 0 10px var(--primary-glow));
}

.nav-icon {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  color: #64748b;
  background: rgba(248, 250, 252, 0.58);
  border: 1px solid transparent;
}

.nav-icon.active {
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  color: white;
  box-shadow: 0 4px 20px var(--primary-glow);
}

.nav-icon.history-active {
  background: linear-gradient(135deg, #f59e0b, #ef4444);
  color: white;
  box-shadow: 0 4px 20px rgba(245, 158, 11, 0.3);
}

/* History Panel Styling (Simulador de Operación) */
.history-panel {
  position: fixed;
  top: 100px;
  right: 420px;
  width: 320px;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(40px) saturate(220%);
  -webkit-backdrop-filter: blur(40px) saturate(220%);
  border: 1px solid rgba(255, 255, 255, 1);
  border-radius: 32px;
  z-index: 2500;
  box-shadow: 0 40px 100px rgba(0, 0, 0, 0.1);
  overflow: hidden;
  transition: all 0.6s cubic-bezier(0.16, 1, 0.3, 1);
  pointer-events: auto;
}

.history-panel.hidden {
  opacity: 0;
  visibility: hidden;
  transform: translateX(60px) scale(0.92);
}

.history-panel-header {
  padding: 24px;
  background: rgba(255, 255, 255, 0.4);
  border-bottom: 1px solid rgba(0, 0, 0, 0.03);
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}

.history-panel-body {
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.history-time-display {
  text-align: center;
  padding: 15px;
  background: rgba(0, 0, 0, 0.03);
  border-radius: 16px;
}

.time-main {
  font-size: 2.2rem;
  font-weight: 800;
  color: var(--text-main);
  letter-spacing: -1px;
}

.date-sub {
  font-size: 0.9rem;
  color: var(--text-muted);
  font-weight: 500;
}
.prediction-info {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 18px;
  background: rgba(255, 255, 255, 0.5);
  border: 1px solid rgba(0, 0, 0, 0.03);
  border-radius: 16px;
}

.info-label {
  font-size: 9px;
  font-weight: 800;
  color: #94a3b8;
}

#hist-avg-occ {
  font-size: 11px;
  font-weight: 900;
  color: #10b981;
  background: rgba(16, 185, 129, 0.1);
  padding: 2px 10px;
  border-radius: 100px;
}

/* CYBER SLIDER */
.slider-container {
  width: 100%;
  position: relative;
  margin: 10px 0;
}

.cyber-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 6px;
  background: #f1f5f9;
  border-radius: 10px;
  outline: none;
  cursor: pointer;
}

.cyber-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 20px;
  height: 20px;
  background: var(--primary);
  border-radius: 50%;
  cursor: pointer;
  box-shadow: 0 0 15px var(--primary-glow);
  border: 3px solid white;
}

.slider-labels {
  display: flex;
  justify-content: space-between;
  margin-top: 10px;
  font-size: 10px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
}

.history-stats-preview {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.h-stat {
  padding: 12px;
  background: rgba(255, 255, 255, 0.4);
  border-radius: 12px;
  display: flex;
  flex-direction: column;
}

.h-label {
  font-size: 9px;
  text-transform: uppercase;
  font-weight: 700;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.h-value {
  font-size: 1.1rem;
  font-weight: 700;
}

.h-value.success {
  color: var(--success-color);
}

/* MONITOR MÓVIL EN HEADER */
.header-monitor-mobile {
  display: none;
  flex: 1;
  justify-content: center;
  gap: 15px;
  padding: 0 10px;
}

.h-mini-card {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.h-mini-label {
  font-size: 8px;
  font-weight: 800;
  color: var(--text-muted);
}

.h-mini-val {
  font-size: 11px;
  font-weight: 800;
  color: var(--primary);
}

/* WEATHER DROPDOWN SYSTEM */
.weather-dropdown-container {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.weather-dropdown-content {
  display: none;
  position: absolute;
  left: 70px;
  top: 0;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(0, 0, 0, 0.05);
  border-radius: 20px;
  padding: 15px;
  flex-direction: column;
  gap: 10px;
  z-index: 5000;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
  min-width: 180px;
}

.weather-dropdown-container.active .weather-dropdown-content {
  display: flex;
}

.dropdown-title {
  font-size: 10px;
  font-weight: 800;
  color: var(--text-muted);
  letter-spacing: 1px;
  margin-bottom: 8px;
  padding: 0 5px;
}

.dropdown-row {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.weather-btn.mini {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.2s;
  background: rgba(0, 0, 0, 0.03);
}

.weather-btn.mini:hover {
  background: rgba(59, 130, 246, 0.1);
  transform: translateX(4px);
}

.weather-btn.mini.active {
  background: var(--primary);
  color: white;
}

.w-icon {
  font-size: 16px;
}
.w-text {
  font-size: 11px;
  font-weight: 600;
}

.dropdown-divider {
  height: 1px;
  background: rgba(0, 0, 0, 0.05);
  margin: 8px 0;
}

.sync-weather-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px;
  border: none;
  border-radius: 12px;
  background: rgba(16, 185, 129, 0.1);
  color: #059669;
  font-size: 9px;
  font-weight: 800;
  cursor: pointer;
  transition: all 0.2s;
  width: 100%;
}

.sync-weather-btn:hover {
  background: #059669;
  color: white;
}

.nav-label-mini {
  font-size: 8px;
  font-weight: 800;
  margin-top: 2px;
}

@media screen and (max-width: 800px) {
  .weather-dropdown-content {
    left: 50%;
    transform: translateX(-50%);
    bottom: 80px;
    top: auto;
    flex-direction: column; /* Cambiado a columna para que quepa el titulo y el boton */
    width: 220px;
    padding: 15px;
  }

  .dropdown-row {
    flex-direction: row;
    justify-content: space-between;
  }

  .weather-btn.mini {
    flex-direction: column;
    gap: 4px;
    padding: 10px;
    flex: 1;
    background: rgba(0, 0, 0, 0.05);
  }

  .weather-btn.mini .w-text {
    font-size: 9px;
  }
  .weather-btn.mini:hover {
    transform: translateY(-3px);
  }
}

.close-btn-circle {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: none;
  background: rgba(0, 0, 0, 0.05);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s;
}

.close-btn-circle:hover {
  background: rgba(239, 64, 64, 0.1);
  color: #ef4444;
}

#btn-back-to-live.hidden {
  display: none;
}

/* ==========================================================================
   MEDIA QUERIES - OPTIMIZACIÓN MÓVIL Y TABLET REFINADA
   ========================================================================== */

/* TABLETS (< 1024px) */
@media screen and (max-width: 1024px) {
  .left-nav {
    margin-top: 15px;
  }
  .glass-panel {
    width: 320px;
  }
}

/* SMARTPHONES (< 500px) */
@media screen and (max-width: 800px) {
  .mobile-only {
    display: flex !important;
  }
  .mobile-hide {
    display: none !important;
  }

  #ui-root {
    flex-direction: column;
  }

  /* BARRA SUPERIOR FIJA MÓVIL (PREMIUM BAR) */
  .top-header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 60px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    padding: 0 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 5000;
    pointer-events: auto !important; /* REPARADO: AHORA SÍ SE PUEDE HACER CLIC */
  }

  .header-left .page-title {
    font-size: 1.1rem;
    font-weight: 800;
    color: var(--primary);
    margin: 0;
  }

  .header-left .subtitle {
    display: none;
  }

  .system-status {
    padding: 2px 8px;
    border-radius: 8px;
    background: rgba(16, 185, 129, 0.05);
    border: 1px solid rgba(16, 185, 129, 0.1);
  }

  .status-text {
    font-size: 0.65rem;
    font-weight: 800;
  }
  .status-dot {
    width: 6px;
    height: 6px;
  }

  /* SIDEBAR COMO DRAWER - FIJADO EL SELECTOR */
  .sidebar {
    position: fixed !important;
    top: 0 !important;
    left: -110% !important; /* Desplazado fuera */
    width: 100% !important; /* Full width en móvil para mejor usabilidad */
    height: 100vh !important;
    border-radius: 0 !important;
    margin: 0 !important;
    z-index: 3000 !important;
    transition: left 0.4s cubic-bezier(0.19, 1, 0.22, 1) !important;
    display: block !important;
    background: white !important;
    padding-top: 70px !important; /* Espacio para el header de cerrar */
  }

  .sidebar .glass-panel {
    width: 100% !important;
    height: 100% !important;
    border: none !important;
    border-radius: 0 !important;
    background: white !important;
    box-shadow: none !important;
    padding: 20px !important;
  }

  .sidebar.mobile-visible {
    left: 0 !important;
    visibility: visible !important;
  }

  /* NAV INFERIOR COMPACTA */
  .left-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 65px;
    flex-direction: row;
    justify-content: space-around;
    padding: 0 10px;
    margin: 0;
    border-radius: 0;
    border-top: 1px solid rgba(0, 0, 0, 0.05);
    z-index: 2200;
    background: white;
    overflow: visible !important; /* REPARADO: PARA QUE SE VEA EL CLIMA */
  }

  .header-monitor-mobile {
    display: flex !important;
  }

  .nav-brand {
    transform: scale(0.8);
    margin: 0;
  }

  .nav-separator,
  .nav-bottom-status {
    display: none;
  }

  .nav-icon {
    width: 45px;
    height: 45px;
  }

  /* PANELES COMPACTOS */
  .history-panel,
  #info-card,
  .heatmap-panel {
    width: calc(100% - 20px) !important;
    left: 10px !important;
    bottom: 85px !important;
    top: auto !important;
    right: auto !important;
    border-radius: 25px !important;
  }

  .heatmap-panel {
    bottom: 85px !important;
  }

  .time-main {
    font-size: 1.6rem;
  }
}

.mobile-only {
  display: none;
}

.nav-icon:hover:not(.active) {
  background: rgba(59, 130, 246, 0.1);
  border-color: rgba(59, 130, 246, 0.18);
  color: var(--primary);
  transform: translateY(-2px);
}

.nav-separator {
  width: 30px;
  height: 1px;
  background: rgba(0, 0, 0, 0.1);
  margin: 10px 0;
}

.weather-btn.active {
  background: rgba(30, 41, 59, 0.1);
  color: var(--primary);
  box-shadow: 0 0 15px rgba(59, 130, 246, 0.2);
}

/* Main Content Area */
.main-overlay {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 15px 40px; /* Reducido de 30px a 15px */
  gap: 10px; /* Reducido de 20px a 10px */
}

.top-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px; /* Reducido drásticamente para subir monitoreo */
}

.header-left .page-title {
  font-size: 2.2rem;
  font-weight: 700;
  letter-spacing: -0.5px;
  margin-bottom: 5px;
  color: var(--text-main);
}

.header-left .subtitle {
  color: var(--primary);
  font-size: 1rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 2px;
}

.system-status {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.2);
  padding: 8px 16px;
  border-radius: 30px;
  backdrop-filter: blur(8px);
}

.status-dot {
  width: 8px;
  height: 8px;
  background: var(--success-color);
  border-radius: 50%;
  box-shadow: 0 0 10px var(--success-color);
  animation: blink 2s infinite ease-in-out;
}

.status-text {
  color: var(--success-color);
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.5px;
}

/* Panels */
.panels-container {
  display: flex;
  flex: 1;
  justify-content: flex-end; /* Align sidebar to right */
  align-items: flex-start;
}

.glass-panel {
  background: var(--glass-bg);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid var(--glass-border);
  border-radius: 30px;
  padding: 24px;
  width: 380px;
  max-height: calc(100vh - 80px);
  overflow-y: auto;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.04);
  pointer-events: auto;
  display: flex;
  flex-direction: column;
}

.panel-title {
  font-size: 1.2rem;
  font-weight: 600;
  margin-bottom: 5px;
}

.panel-desc {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-bottom: 20px;
  line-height: 1.5;
}

/* Metrics Grid */
.metrics-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 25px;
}

.metric-card {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 16px;
  padding: 15px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  transition: all 0.3s ease;
}

.metric-card.full-width {
  grid-column: span 2;
  flex-direction: row;
  justify-content: space-between;
  align-items: center;
  background: linear-gradient(
    90deg,
    rgba(99, 102, 241, 0.1),
    rgba(255, 255, 255, 0.05)
  );
}

.metric-label {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 1.5px;
  color: #000000; /* Negro */
}

.metric-label-mini {
  font-size: 8px;
  font-weight: 900;
  letter-spacing: 1px;
  color: #64748b;
  text-transform: uppercase;
  margin-bottom: 4px;
  display: block;
}

.metric-value {
  font-size: 1.3rem; /* Reducido de 1.5rem */
  font-weight: 700;
  color: #000000; /* Negro */
}

.population-card {
  position: relative;
  overflow: hidden;
  flex-direction: column !important;
  align-items: stretch;
  justify-content: flex-start !important;
  gap: 13px;
  background:
    radial-gradient(circle at 92% 8%, rgba(14, 165, 233, 0.2), transparent 35%),
    linear-gradient(135deg, rgba(248, 250, 252, 0.94), rgba(225, 239, 249, 0.8));
  border-color: rgba(15, 23, 42, 0.08);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.72),
    0 18px 42px rgba(15, 23, 42, 0.08);
}

.population-card::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(90deg, rgba(14, 165, 233, 0.2), transparent 42%);
  opacity: 0.45;
}

.population-topline,
.population-main,
.population-breakdown {
  position: relative;
  z-index: 1;
}

.population-topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.population-main {
  display: flex;
  align-items: flex-end;
  justify-content: flex-start;
  gap: 10px;
}

.live-pill {
  border: 1px solid rgba(20, 184, 166, 0.35);
  border-radius: 999px;
  padding: 4px 7px;
  color: #0f766e;
  background: rgba(20, 184, 166, 0.1);
  font-size: 0.55rem;
  font-weight: 900;
  letter-spacing: 0.1em;
}

.population-subtitle {
  display: block;
  color: #64748b;
  font-size: 0.62rem;
  font-weight: 800;
  line-height: 1.15;
}

.population-copy {
  padding-bottom: 6px;
}

.population-unit {
  display: block;
  color: #0f172a;
  font-size: 0.78rem;
  font-weight: 900;
  line-height: 1;
}

.population-total {
  min-width: 42px;
  color: #020617;
  font-size: 3.05rem;
  font-weight: 900;
  line-height: 0.82;
  letter-spacing: 0;
}

.population-breakdown {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.population-chip {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  min-width: 0;
  min-height: 48px;
  border: 1px solid rgba(15, 23, 42, 0.07);
  border-radius: 8px;
  padding: 8px;
  color: #475569;
  background: rgba(255, 255, 255, 0.72);
  font-size: 0.56rem;
  font-weight: 900;
  letter-spacing: 0.06em;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.65);
}

.population-chip small {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
}

.population-chip b {
  color: #020617;
  margin-top: 4px;
  font-size: 1.08rem;
  line-height: 1;
  letter-spacing: 0;
}

.population-chip.gym {
  border-left: 3px solid #6366f1;
}

.population-chip.pool {
  border-left: 3px solid #0ea5e9;
}

.population-chip.canchas {
  border-left: 3px solid #f59e0b;
}

.time-detection-card {
  position: relative;
  overflow: hidden;
  flex-direction: column !important;
  align-items: stretch !important;
  gap: 14px;
  background:
    radial-gradient(circle at 92% 18%, rgba(99, 102, 241, 0.18), transparent 35%),
    linear-gradient(135deg, rgba(248, 250, 252, 0.95), rgba(230, 235, 248, 0.82));
  border-color: rgba(99, 102, 241, 0.14);
}

.detection-row,
.time-row {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
}

.detection-row {
  gap: 10px;
}

.detection-dot {
  width: 12px;
  height: 12px;
  flex: 0 0 auto;
  border-radius: 999px;
  background: #22c55e;
  box-shadow: 0 0 0 5px rgba(34, 197, 94, 0.12);
}

.detection-copy {
  min-width: 0;
}

.detection-label {
  display: block;
  color: #64748b;
  font-size: 0.56rem;
  font-weight: 900;
  letter-spacing: 0.16em;
}

.time-row {
  justify-content: space-between;
  gap: 12px;
}

.sensor-detection {
  display: block;
  color: #020617;
  font-size: 1.05rem;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.time-detection-card .metric-value {
  color: #020617;
  font-size: clamp(1.35rem, 4vw, 1.9rem);
  line-height: 1;
  text-align: right;
}

.time-detection-card[data-detection="OSCURO"] .detection-dot {
  background: #334155;
  box-shadow: 0 0 0 5px rgba(51, 65, 85, 0.14);
}

.time-detection-card[data-detection="NUBLADO"] .detection-dot {
  background: #64748b;
  box-shadow: 0 0 0 5px rgba(100, 116, 139, 0.14);
}

.time-detection-card[data-detection="LLUVIA"] .detection-dot {
  background: #0ea5e9;
  box-shadow: 0 0 0 5px rgba(14, 165, 233, 0.14);
}

.time-detection-card[data-detection="SOLEADO"] .detection-dot {
  background: #f59e0b;
  box-shadow: 0 0 0 5px rgba(245, 158, 11, 0.16);
}

/* Layer Controls */
.layer-controls {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.layer-group {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding-bottom: 24px;
  margin-bottom: 12px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.layer-group:last-child {
  border-bottom: none;
  padding-bottom: 0;
  margin-bottom: 0;
}

.group-title {
  font-size: 0.7rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1.5px;
  font-weight: 700;
  margin-bottom: 4px;
  padding-left: 5px;
}

.layer-btn {
  background: rgba(255, 255, 255, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.5);
  padding: 14px 18px;
  border-radius: 18px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  text-align: left;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.02);
}

.layer-btn::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  opacity: 0;
  transition: opacity 0.3s ease;
  z-index: 0;
}

.layer-info {
  display: flex;
  flex-direction: column;
  position: relative;
  z-index: 1;
}

.layer-name {
  color: var(--text-main);
  font-weight: 600;
  font-size: 1rem;
  margin-bottom: 4px;
}

.layer-desc {
  color: var(--text-muted);
  font-size: 0.8rem;
  transition: color 0.3s ease;
}

.layer-status {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 2px solid var(--text-muted);
  position: relative;
  z-index: 1;
  transition: all 0.3s ease;
}

/* Layer Button States */
.layer-btn:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.1);
  transform: translateX(-5px);
}

.layer-btn.active {
  border-color: transparent;
  transform: translateX(-10px);
  box-shadow: 0 10px 25px rgba(14, 165, 233, 0.25);
}

.layer-btn.active::before {
  opacity: 1;
}

.layer-btn.active .layer-desc {
  color: rgba(255, 255, 255, 0.9);
}

.layer-btn.active .layer-status {
  border-color: white;
  background: white;
  box-shadow: 0 0 10px rgba(255, 255, 255, 0.5);
}

/* Loading Overlay */
.loader-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: var(--bg-dark);
  z-index: 9999;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 20px;
  transition:
    opacity 1s ease,
    visibility 1s ease;
}

.loader-overlay.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none; /* ASEGURAR QUE NO BLOQUEE AL FINALIZAR CARGA */
}

.spinner {
  width: 50px;
  height: 50px;
  border: 3px solid rgba(255, 255, 255, 0.1);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

.loader-text {
  font-weight: 500;
  color: var(--text-muted);
  letter-spacing: 2px;
  animation: pulse-text 2s infinite ease-in-out;
}

/* Keyframes */
@keyframes spin {
  100% {
    transform: rotate(360deg);
  }
}
@keyframes blink {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.4;
  }
}
@keyframes pulse-text {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.5;
  }
}

/* --- PREMIUM GLASSMORPHISM INTERFACE --- */
.info-card.hidden {
  opacity: 0;
  visibility: hidden;
  transform: translateY(20px) scale(0.95);
}

/* Cabecera Premium */
.card-header {
  padding: 20px 24px;
  background: rgba(255, 255, 255, 0.4);
  border-bottom: 1px solid rgba(0, 0, 0, 0.03);
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}

.title-group h3 {
  font-size: 20px;
  font-weight: 800;
  flex-direction: column;
  gap: 12px;
  padding-bottom: 24px;
  margin-bottom: 12px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.layer-group:last-child {
  border-bottom: none;
  padding-bottom: 0;
  margin-bottom: 0;
}

.group-title {
  font-size: 0.7rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1.5px;
  font-weight: 700;
  margin-bottom: 4px;
  padding-left: 5px;
}

.layer-btn {
  background: rgba(255, 255, 255, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.5);
  padding: 14px 18px;
  border-radius: 18px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  text-align: left;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.02);
}

.layer-btn::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  opacity: 0;
  transition: opacity 0.3s ease;
  z-index: 0;
}

.layer-info {
  display: flex;
  flex-direction: column;
  position: relative;
  z-index: 1;
}

.layer-name {
  color: var(--text-main);
  font-weight: 600;
  font-size: 1rem;
  margin-bottom: 4px;
}

.layer-desc {
  color: var(--text-muted);
  font-size: 0.8rem;
  transition: color 0.3s ease;
}

.layer-status {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 2px solid var(--text-muted);
  position: relative;
  z-index: 1;
  transition: all 0.3s ease;
}

/* Layer Button States */
.layer-btn:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.1);
  transform: translateX(-5px);
}

.layer-btn.active {
  border-color: transparent;
  transform: translateX(-10px);
  box-shadow: 0 10px 25px rgba(14, 165, 233, 0.25);
}

.layer-btn.active::before {
  opacity: 1;
}

.layer-btn.active .layer-desc {
  color: rgba(255, 255, 255, 0.9);
}

.layer-btn.active .layer-status {
  border-color: white;
  background: white;
  box-shadow: 0 0 10px rgba(255, 255, 255, 0.5);
}

/* Loading Overlay */
.loader-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: var(--bg-dark);
  z-index: 9999;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 20px;
  transition:
    opacity 1s ease,
    visibility 1s ease;
}

.loader-overlay.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none; /* ASEGURAR QUE NO BLOQUEE AL FINALIZAR CARGA */
}

.spinner {
  width: 50px;
  height: 50px;
  border: 3px solid rgba(255, 255, 255, 0.1);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

.loader-text {
  font-weight: 500;
  color: var(--text-muted);
  letter-spacing: 2px;
  animation: pulse-text 2s infinite ease-in-out;
}

/* Keyframes */
@keyframes spin {
  100% {
    transform: rotate(360deg);
  }
}
@keyframes blink {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.4;
  }
}
@keyframes pulse-text {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.5;
  }
}

/* --- PREMIUM GLASSMORPHISM INTERFACE --- */
.info-card.hidden {
  opacity: 0;
  visibility: hidden;
  transform: translateY(20px) scale(0.95);
}

/* Cabecera Premium */
.history-panel-header {
  padding: 24px;
  background: rgba(255, 255, 255, 0.4);
  border-bottom: 1px solid rgba(0, 0, 0, 0.03);
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}

.panel-tag {
  display: inline-block;
  font-size: 9px;
  font-weight: 800;
  color: #3b82f6;
  background: rgba(59, 130, 246, 0.1);
  padding: 2px 8px;
  border-radius: 100px;
  letter-spacing: 1px;
  margin-bottom: 6px;
}

.history-panel-header h3 {
  font-size: 1.1rem;
  font-weight: 900;
  color: #0f172a;
  margin: 0;
}

.history-panel-body {
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.history-time-display {
  text-align: center;
  padding: 20px;
  background: linear-gradient(
    135deg,
    rgba(59, 130, 246, 0.04),
    rgba(139, 92, 246, 0.04)
  );
  border: 1px solid rgba(59, 130, 246, 0.08);
  border-radius: 20px;
}

.time-main {
  font-size: 2.5rem;
  font-weight: 900;
  color: #0f172a;
  letter-spacing: -2px;
  line-height: 1;
}

.date-sub {
  font-size: 0.85rem;
  margin-top: 8px;
  color: #64748b;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.title-group h3 {
  font-size: 20px;
  font-weight: 800;
  color: #1e293b;
  margin: 0;
  letter-spacing: -0.5px;
}

.area-badge {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  color: #6366f1;
  letter-spacing: 1px;
  margin-bottom: 4px;
}
/* Banner de Alerta Dinámico */
.alert-banner {
  background: #fff1f2;
  padding: 10px 24px;
  display: flex;
  align-items: center;
  gap: 10px;
  border-bottom: 1px solid rgba(239, 68, 68, 0.1);
  display: none; /* Solo se muestra bajo demanda */
}
.alert-banner.active {
  display: flex;
  animation: slideIn 0.3s ease;
}
.alert-banner span {
  font-size: 11px;
  font-weight: 700;
  color: #e11d48;
}

/* Cuerpo de la Tarjeta */
.card-body {
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.stats-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

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

.stat-label {
  font-size: 11px;
  color: #64748b;
  font-weight: 500;
  margin-bottom: 4px;
}
.stat-value {
  font-size: 22px;
  font-weight: 800;
  color: #0f172a;
}

/* Grilla de Sensores */
.sensor-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

.sensor-card {
  background: rgba(255, 255, 255, 0.5);
  border: 1px solid rgba(0, 0, 0, 0.02);
  padding: 12px;
  border-radius: 12px;
  display: flex;
  flex-direction: column;
}

.sensor-label {
  font-size: 10px;
  color: #94a3b8;
  margin-bottom: 2px;
}
.sensor-value {
  font-weight: 700;
  color: #334155;
  font-size: 15px;
}

/* Gráfico de Tendencia Mini */
.trend-section {
  margin-top: 10px;
}
.trend-header {
  font-size: 11px;
  font-weight: 600;
  color: #64748b;
  margin-bottom: 10px;
  display: block;
}
.mini-chart {
  height: 60px;
  display: flex;
  align-items: flex-end;
  gap: 6px;
}
.trend-bar {
  flex: 1;
  background: #e2e8f0;
  border-radius: 4px;
  transition:
    height 1s cubic-bezier(0.16, 1, 0.3, 1),
    background 0.3s;
}
.trend-bar.high {
  background: #6366f1;
}

.close-btn {
  cursor: pointer;
  color: #94a3b8;
  font-size: 18px;
  transition: color 0.2s;
}
.close-btn:hover {
  color: #475569;
}

/* Grid de Datos Limpio */
.card-body {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.data-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 14px;
}

.data-label {
  color: #64748b;
  font-weight: 500;
}

.data-value {
  color: #0f172a;
  font-weight: 700;
}

.status-box {
  background: #f1f5f9;
  padding: 12px;
  border-radius: 8px;
  margin-top: 8px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-right: 8px;
  display: inline-block;
}

.status-good .status-dot {
  background: #22c55e;
  box-shadow: 0 0 10px rgba(34, 197, 94, 0.4);
}
.status-warning .status-dot {
  background: #eab308;
  box-shadow: 0 0 10px rgba(234, 179, 8, 0.4);
}
.status-danger .status-dot {
  background: #ef4444;
  box-shadow: 0 0 10px rgba(239, 68, 68, 0.4);
}

.area-badge {
  font-size: 0.65rem;
  font-weight: 700;
  background: rgba(59, 130, 246, 0.1);
  color: var(--primary);
  padding: 2px 8px;
  border-radius: 4px;
  text-transform: uppercase;
  width: fit-content;
}

.close-btn {
  background: rgba(0, 0, 0, 0.05);
  border: none;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  color: var(--text-muted);
  transition: all 0.2s ease;
}

.close-btn:hover {
  background: rgba(239, 68, 68, 0.1);
  color: #ef4444;
}

.card-body {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.info-item {
  display: flex;
  flex-direction: column;
  gap: 8px; /* Un poco más de espacio */
}

.info-header {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text-muted);
}

.info-header svg {
  opacity: 0.7;
}

/* PREMIUM INFO CARD ENHANCEMENTS */
.live-visual {
  width: 100%;
  height: 120px;
  background: #000;
  border-radius: 12px;
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.1);
  margin-bottom: 20px; /* Keep existing margin-bottom */
}

.lidar-simulation {
  position: absolute;
  inset: 0;
  background: radial-gradient(circle, #062006 0%, #000 100%);
}

.lidar-radar {
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(
      circle,
      transparent 30%,
      rgba(0, 255, 0, 0.05) 31%,
      transparent 32%
    ),
    radial-gradient(
      circle,
      transparent 60%,
      rgba(0, 255, 0, 0.05) 61%,
      transparent 62%
    );
  z-index: 1;
}

.lidar-sweep {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 200%;
  height: 200%;
  background: conic-gradient(
    from 0deg,
    rgba(0, 255, 0, 0.4) 0deg,
    transparent 90deg
  );
  transform-origin: center;
  animation: sweep 3s linear infinite;
  z-index: 2;
}

.lidar-points {
  position: absolute;
  inset: 0;
  z-index: 3;
  background-image: radial-gradient(circle, #0f0 1.5px, transparent 1.5px);
  background-size: 15px 15px;
  opacity: 0.3;
  animation: pulsePoints 2s ease-in-out infinite alternate;
}

@keyframes sweep {
  from {
    transform: translate(-50%, -50%) rotate(0deg);
  }
  to {
    transform: translate(-50%, -50%) rotate(360deg);
  }
}

@keyframes pulsePoints {
  from {
    opacity: 0.2;
    transform: scale(1);
  }
  to {
    opacity: 0.5;
    transform: scale(1.05);
  }
}

.sensor-diag-panel {
  background: rgba(0, 0, 0, 0.03);
  border-radius: 12px;
  padding: 12px;
  margin-bottom: 20px;
}

.diag-rows {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 10px;
}

.diag-row {
  display: flex;
  flex-direction: column;
}

.diag-value {
  font-size: 13px;
  font-weight: 700;
  color: #1e293b;
}

.diag-bar-container {
  width: 100%;
  height: 6px;
  background: #e2e8f0;
  border-radius: 3px;
  overflow: hidden;
  margin-top: 4px;
}

.diag-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #6366f1, #22d3ee);
  transition: width 0.5s ease;
}

.labels-container {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 5;
}

.holo-label {
  position: absolute;
  padding: 10px 22px;
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(255, 255, 255, 1);
  border-radius: 30px;
  font-size: 15px;
  font-weight: 800;
  color: #000;
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 8px;
  backdrop-filter: blur(8px);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
  transform: translate(-50%, -50%);
  pointer-events: auto;
  cursor: pointer;
  transition: all 0.3s ease;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.holo-label:hover {
  transform: translate(-50%, -55%) scale(1.1);
  background: rgba(255, 255, 255, 0.95);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

/* Indicador de Línea hacia el punto */
.holo-label::after {
  content: "";
  position: absolute;
  bottom: -40px;
  left: 50%;
  width: 2px;
  height: 40px;
  background: linear-gradient(to bottom, rgba(0, 0, 0, 0.3), transparent);
}

.holo-label i {
  font-size: 14px;
}

.holo-label.sensor {
  border-color: #22d3ee;
}
.holo-label.gym {
  border-color: #6366f1;
}
.holo-label.pool {
  border-color: #0ea5e9;
}
.holo-label.canchas {
  border-color: #fbbf24;
}

.holo-label.closed {
  background: rgba(239, 68, 68, 0.2) !important;
  border-color: #ef4444 !important;
  color: #ef4444 !important;
  box-shadow: 0 0 20px rgba(239, 68, 68, 0.4);
  animation: pulse-danger 1.5s infinite !important;
}

@keyframes pulse-danger {
  0% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.05); opacity: 0.8; }
  100% { transform: scale(1); opacity: 1; }
}

.hidden {
  display: none !important;
}

.live-tag {
  position: absolute;
  top: 10px;
  left: 10px;
  background: rgba(239, 68, 68, 0.8);
  color: white;
  font-size: 8px;
  font-weight: 900;
  padding: 2px 6px;
  border-radius: 4px;
  z-index: 2;
  letter-spacing: 1px;
}

.visual-placeholder {
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, #1e293b, #0f172a);
  display: flex;
  align-items: center;
  justify-content: center;
}

.scan-line {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 2px;
  background: rgba(99, 102, 241, 0.3);
  box-shadow: 0 0 10px rgba(99, 102, 241, 0.5);
  animation: scan 3s linear infinite;
  z-index: 1;
}

@keyframes scan {
  0% {
    top: 0;
  }
  100% {
    top: 100%;
  }
}

.static-noise {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0.05;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E");
  background-size: 150px 150px;
  background-repeat: repeat;
}

.status-box-premium {
  margin-top: 10px;
  padding: 16px;
  background: rgba(255, 255, 255, 0.6);
  backdrop-filter: blur(10px);
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 1);
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.03);
}

.status-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 4px;
}

.status-row span#area-status {
  font-weight: 800;
  font-size: 13px;
  color: #0f172a;
}

.action-btn {
  background: var(--text-main);
  color: white;
  border: none;
  padding: 8px 16px;
  border-radius: 10px;
  font-size: 10px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
}

.action-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.info-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  font-weight: 600;
}

.info-value {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-main);
}

.status-good {
  color: var(--success-color);
}
.status-warning {
  color: #f59e0b;
}
.status-danger {
  color: #ef4444;
}

/* Dashboard Components in Card */
.sensor-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin: 10px 0;
}

.sensor-card {
  background: rgba(0, 0, 0, 0.03);
  border-radius: 12px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.sensor-label {
  font-size: 0.65rem;
  color: var(--text-muted);
  text-transform: uppercase;
  font-weight: 600;
}

.sensor-value {
  font-size: 1rem;
  font-weight: 700;
  color: var(--primary);
}

.trend-section {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 5px;
}

.mini-chart {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  height: 60px;
  padding: 5px 0;
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.bar {
  width: 14%;
  background: var(--primary);
  border-radius: 4px 4px 0 0;
  min-height: 4px;
  transition: height 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
  opacity: 0.8;
}

.bar:hover {
  opacity: 1;
  filter: brightness(1.1);
}

.bar-alert {
  background: #ef4444 !important;
  animation: blink-danger 1.5s infinite ease-in-out;
  box-shadow: 0 0 10px rgba(239, 68, 68, 0.4);
}

@keyframes blink-danger {
  0%,
  100% {
    opacity: 0.8;
    transform: scaleY(1);
  }
  50% {
    opacity: 1;
    transform: scaleY(1.05);
  }
}

/* Alert Banner in Card */
.alert-banner {
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.3);
  padding: 10px 14px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 20px;
  color: #ef4444;
  font-size: 0.8rem;
  font-weight: 600;
  display: none; /* Hide by default */
}

.alert-banner.active {
  display: flex;
  animation: slide-down 0.4s ease-out;
}

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

/* Etiquetas de color en la tarjeta */
.task-labels {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.label-pill {
  padding: 4px 12px;
  border-radius: 6px;
  font-size: 10px;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  font-weight: 800;
  color: white;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

.bg-priority-high {
  background: linear-gradient(135deg, #f43f5e, #be123c);
  border: 1px solid #fb7185;
}
.bg-priority-mid {
  background: linear-gradient(135deg, #f59e0b, #b45309);
  border: 1px solid #fbbf24;
}
.bg-priority-low {
  background: linear-gradient(135deg, #10b981, #047857);
  border: 1px solid #34d399;
}

/* SISTEMA DE NOTIFICACIONES (TOASTS) */
.notification-container {
  position: fixed;
  top: 100px; /* Debajo de la cabecera */
  right: 40px;
  z-index: 2000;
  display: flex;
  flex-direction: column;
  gap: 12px;
  pointer-events: none;
}

.toast {
  width: 300px;
  background: rgba(15, 23, 42, 0.8);
  backdrop-filter: blur(15px);
  -webkit-backdrop-filter: blur(15px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  padding: 14px;
  color: white;
  pointer-events: auto;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
  animation: slideInToast 0.4s cubic-bezier(0.18, 0.89, 0.32, 1.28);
  transition: all 0.3s ease;
  border-left: 4px solid #6366f1;
}

.toast.danger {
  border-left-color: #ef4444;
  background: rgba(239, 68, 68, 0.15);
}
.toast.success {
  border-left-color: #10b981;
  background: rgba(16, 185, 129, 0.15);
}

.toast-header {
  display: flex;
  justify-content: space-between;
  margin-bottom: 4px;
}

.toast-title {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 1px;
  text-transform: uppercase;
  opacity: 0.8;
}

.toast-time {
  font-size: 9px;
  opacity: 0.5;
}

.toast-body {
  font-size: 12px;
  font-weight: 500;
  line-height: 1.4;
}

@keyframes slideInToast {
  from {
    transform: translateX(100%) scale(0.9);
    opacity: 0;
  }
  to {
    transform: translateX(0) scale(1);
    opacity: 1;
  }
}

.toast.hidden {
  transform: scale(0.9) translateY(-10px);
  opacity: 0;
}

/* Menú Contextual Moderno */
#context-menu {
  position: fixed;
  z-index: 9999;
  background: rgba(15, 23, 42, 0.9);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 12px;
  padding: 8px 0;
  width: 200px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6);
  display: none;
  animation: fadeIn 0.2s ease-out;
}

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

.menu-item {
  padding: 10px 20px;
  font-size: 14px;
  color: #e2e8f0;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: all 0.2s;
  position: relative;
}

.menu-item:hover {
  background: rgba(59, 130, 246, 0.4);
  color: #fff;
  padding-left: 25px;
}

.notif-badge {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 8px;
  height: 8px;
  background: #ef4444;
  border-radius: 50%;
  border: 2px solid var(--bg-nav);
  box-shadow: 0 0 10px rgba(239, 68, 68, 0.5);
}

.notif-badge.hidden {
  display: none;
}

/* NOTIF PANEL FLYOUT */
.notif-panel {
  position: fixed;
  top: 15px;
  left: 80px;
  width: 320px;
  height: calc(100vh - 30px);
  background: rgba(255, 255, 255, 0.4); /* Glassmorfismo claro */
  backdrop-filter: blur(25px) saturate(180%);
  -webkit-backdrop-filter: blur(25px) saturate(180%);
  border: 1px solid rgba(255, 255, 255, 0.8);
  border-radius: 24px;
  padding: 24px;
  z-index: 1500;
  transition: all 0.5s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 20px 0 50px rgba(0, 0, 0, 0.05);
  display: flex;
  flex-direction: column;
}

.notif-panel.hidden {
  transform: translateX(-40px);
  opacity: 0;
  pointer-events: none;
}

.notif-panel-header {
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 2.5px;
  color: #1e293b; /* Texto oscuro */
  margin-bottom: 24px;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

.notif-list {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.notif-item {
  background: rgba(255, 255, 255, 0.6);
  border-radius: 14px;
  padding: 15px;
  border-left: 3px solid #6366f1;
  color: #1e293b;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.03);
}

.notif-item.danger {
  border-left-color: #ef4444;
}
.notif-item.success {
  border-left-color: #10b981;
}

.notif-item-header {
  display: flex;
  justify-content: space-between;
  font-size: 9px;
  font-weight: 700;
  opacity: 0.5;
  margin-bottom: 4px;
}

.notif-item-body {
  font-size: 12px;
  font-weight: 500;
  line-height: 1.4;
}

/* Scrollbar para la lista */
.notif-list::-webkit-scrollbar {
  width: 4px;
}
.notif-list::-webkit-scrollbar-track {
  background: transparent;
}
.notif-list::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 10px;
}

.menu-item.has-submenu::after {
  content: "→";
  font-size: 14px;
  opacity: 0.5;
}

/* Submenú */
.submenu {
  position: absolute;
  left: 100%;
  top: -8px;
  background: rgba(15, 23, 42, 0.95);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 12px;
  padding: 8px 0;
  width: 180px;
  display: none;
  box-shadow: 10px 10px 30px rgba(0, 0, 0, 0.4);
  margin-left: 5px;
}

.menu-item:hover > .submenu {
  display: block;
}

@keyframes pulse-ring {
  0% {
    transform: scale(1);
    opacity: 0.8;
  }
  100% {
    transform: scale(3);
    opacity: 0;
  }
}

/* --- CYBERPUNK OPS DASHBOARD (MODO MAESTRO) --- */
.dashboard-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(255, 255, 255, 0.4); /* Glass claro suave */
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 5000;
  padding: 20px;
  opacity: 1;
  visibility: visible;
  transition: all 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.dashboard-overlay.hidden {
  opacity: 0 !important;
  visibility: hidden !important;
  pointer-events: none !important;
  transform: scale(1.05); /* Zoom out effect when hidden */
}

.admin-dashboard {
  width: 1200px;
  height: 750px;
  background: rgba(255, 255, 255, 0.85) !important;
  border: 1px solid rgba(255, 255, 255, 1);
  border-radius: 40px !important;
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: 0 40px 100px rgba(0, 0, 0, 0.08);
  color: #0f172a;
}

/* Scanline Effect */
.dash-scan-line {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 4px;
  background: linear-gradient(
    to bottom,
    transparent,
    rgba(99, 102, 241, 0.2),
    transparent
  );
  z-index: 10;
  pointer-events: none;
  animation: scan-dash 8s linear infinite;
}

@keyframes scan-dash {
  0% {
    transform: translateY(-100px);
  }
  100% {
    transform: translateY(850px);
  }
}

.dash-top {
  padding: 30px 40px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(255, 255, 255, 0.4);
  border-bottom: 1px solid rgba(0, 0, 0, 0.03);
}

.dash-title-area h1 {
  font-size: 1.4rem;
  font-weight: 900;
  letter-spacing: 4px;
  color: #0f172a;
  margin: 0;
}

.dash-id-tag {
  font-size: 10px;
  color: var(--primary);
  font-weight: 800;
  letter-spacing: 2px;
  margin-top: 4px;
}

.system-time {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  font-family: "Courier New", Courier, monospace;
  font-weight: 700;
  margin-right: 20px;
}
#dash-time-val {
  font-size: 1.2rem;
  color: #0f172a;
}
#dash-date-val {
  font-size: 0.8rem;
  color: #64748b;
}

/* Dashboard Cards - Cyber Style */
.dash-main-grid {
  display: grid;
  grid-template-columns: 280px 1.4fr 280px;
  padding: 20px 30px;
  gap: 25px;
  height: calc(100% - 100px);
}

.dash-column {
  display: flex;
  flex-direction: column;
  gap: 25px;
}

.dash-card {
  background: white;
  border: 1px solid rgba(0, 0, 0, 0.04);
  border-radius: 20px;
  padding: 20px;
  position: relative;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.02);
}

.dash-card:hover {
  background: #fdfdfd;
  border-color: rgba(99, 102, 241, 0.3);
  transform: translateY(-2px);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.05);
}

.card-corner {
  position: absolute;
  width: 10px;
  height: 10px;
  border: 2px solid var(--primary);
  opacity: 0.5;
}
.card-corner.tl {
  top: -1px;
  left: -1px;
  border-right: none;
  border-bottom: none;
}
.card-corner.tr {
  top: -1px;
  right: -1px;
  border-left: none;
  border-bottom: none;
}

.card-label {
  font-size: 10px;
  font-weight: 800;
  color: #94a3b8;
  letter-spacing: 1.5px;
  margin-bottom: 15px;
  text-transform: uppercase;
}

/* KPI Visuals */
.kpi-main {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
}
.kpi-value {
  font-size: 2rem;
  font-weight: 900;
  color: #0f172a; /* Texto KPI oscuro */
}

.glow-text {
  text-shadow: none; /* Quitamos brillo en modo claro */
}

.mini-sparkline {
  width: 80px;
  height: 30px;
  opacity: 0.6;
}

/* Center Radial Status */
.center-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: 30px;
  padding-top: 10px;
}

.core-status-container {
  width: 280px;
  height: 280px;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.radial-ring {
  position: absolute;
  border-radius: 50%;
  border: 2px solid transparent;
}
.radial-ring.outer {
  width: 100%;
  height: 100%;
  border: 2px dashed rgba(99, 102, 241, 0.2);
  animation: spin 20s linear infinite;
}
.radial-ring.mid {
  width: 80%;
  height: 80%;
  border: 4px solid rgba(99, 102, 241, 0.1);
  border-top-color: var(--primary);
  animation: spin-reverse 10s linear infinite;
}
.radial-ring.inner {
  width: 60%;
  height: 60%;
  background: radial-gradient(
    circle,
    rgba(99, 102, 241, 0.1) 0%,
    transparent 70%
  );
  border: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.core-data {
  text-align: center;
}
.core-label {
  font-size: 10px;
  font-weight: 800;
  opacity: 0.6;
  display: block;
}
.core-percent {
  font-size: 2.2rem;
  font-weight: 900;
  color: #0f172a;
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}
@keyframes spin-reverse {
  0% {
    transform: rotate(360deg);
  }
  100% {
    transform: rotate(0deg);
  }
}

/* Terminal Content */
.telemetry-log {
  width: 100%;
  flex: none;
  height: 220px;
}
.log-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 15px;
}
.log-header .dot {
  width: 8px;
  height: 8px;
  background: #22c55e;
  border-radius: 50%;
  animation: blink 1s infinite;
}
.terminal-content {
  font-family: "Courier New", Courier, monospace;
  font-size: 12px;
  color: #334155; /* Texto terminal más oscuro */
  line-height: 1.6;
  height: 120px;
  overflow-y: auto;
  background: rgba(0, 0, 0, 0.03);
  padding: 10px;
  border-radius: 10px;
}
.log-line {
  margin: 2px 0;
}
.log-line.success {
  color: #10b981;
}

/* Infrastructure List */
.maint-list-pro {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.m-item {
  display: flex;
  gap: 15px;
  background: rgba(255, 255, 255, 0.02);
  padding: 12px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.05);
}
.m-bar {
  width: 4px;
  border-radius: 4px;
}
.priority-high .m-bar {
  background: #ef4444;
  box-shadow: 0 0 10px rgba(239, 68, 68, 0.3);
}
.priority-ok .m-bar {
  background: #10b981;
}

.m-content {
  display: flex;
  flex-direction: column;
}
.m-title {
  font-size: 11px;
  font-weight: 700;
  color: #1e293b;
}
.m-status {
  font-size: 9px;
  opacity: 0.6;
}

/* Connectivity Mini */
.health-grid-mini {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.health-item-mini {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.h-label {
  font-size: 9px;
  font-weight: 800;
  opacity: 0.5;
}
.h-bar {
  height: 4px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 4px;
  overflow: hidden;
}
.h-bar .fill {
  height: 100%;
  background: var(--primary);
}

/* Buttons & Close */
.cyber-btn {
  background: transparent;
  border: 1px solid var(--primary);
  color: var(--primary);
  padding: 10px 20px;
  border-radius: 100px;
  font-size: 11px;
  font-weight: 800;
  cursor: pointer;
  transition: all 0.3s;
  text-transform: uppercase;
  letter-spacing: 1px;
}
.cyber-btn:hover {
  background: var(--primary);
  color: white;
  box-shadow: 0 0 20px var(--primary-glow);
}

.close-btn-circle {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.05); /* Botón X oscuro suave */
  border: none;
  color: #0f172a;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.3s;
}
.close-btn-circle:hover {
  background: #ef4444;
  transform: rotate(90deg);
}

.system-status-pill .blink-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  background: #10b981;
  border-radius: 50%;
  margin-right: 8px;
  animation: blink 2s infinite;
}

/* Custom Scrollbar */
.terminal-content::-webkit-scrollbar {
  width: 4px;
}
.terminal-content::-webkit-scrollbar-track {
  background: transparent;
}
.terminal-content::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 10px;
}

@media screen and (max-width: 800px) {
  .dashboard-overlay {
    padding: 10px;
    overflow-y: auto;
  }

  .dashboard-content {
    min-height: 100%;
    height: auto;
    padding-bottom: 40px;
  }

  .dash-main-grid {
    grid-template-columns: 1fr;
    padding: 15px;
    gap: 20px;
    height: auto;
  }

  .dash-top {
    flex-direction: column;
    align-items: flex-start;
    gap: 15px;
    padding: 20px;
  }

  .dash-actions {
    width: 100%;
    justify-content: space-between;
  }

  .core-status-container {
    width: 180px !important;
    height: 180px !important;
    margin: 20px auto;
  }

  .dash-column {
    gap: 15px;
  }

  .kpi-main {
    flex-direction: column;
    align-items: flex-start;
    gap: 5px;
  }

  .kpi-value {
    font-size: 1.5rem;
  }
}

/* ==========================================================================
   INTERACTIVE INFO CARD - PREMIUM LIGHT GLASS (RESTORED & FIXED)
   ========================================================================== */
.info-card {
  position: fixed;
  top: 100px;
  left: 100px;
  width: 340px;
  background: rgba(255, 255, 255, 0.8) !important;
  backdrop-filter: blur(40px) saturate(200%) !important;
  -webkit-backdrop-filter: blur(40px) saturate(200%) !important;
  border: 1px solid rgba(255, 255, 255, 1);
  border-radius: 30px;
  z-index: 2000;
  box-shadow: 0 40px 80px rgba(0, 0, 0, 0.1);
  overflow: hidden;
  pointer-events: auto;
  color: #0f172a;
}

.info-card.hidden {
  opacity: 0;
  visibility: hidden;
  transform: translateX(-30px) scale(0.95);
}

.card-header {
  padding: 20px;
  background: rgba(255, 255, 255, 0.4);
  border-bottom: 1px solid rgba(0, 0, 0, 0.03);
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.card-header h3 {
  font-weight: 800;
  font-size: 16px;
  margin: 0;
}

.alert-banner {
  background: #fef2f2;
  color: #ef4444;
  padding: 8px;
  font-size: 10px;
  font-weight: 800;
  text-align: center;
  display: none;
  border-bottom: 1px solid rgba(239, 68, 68, 0.1);
}
.alert-banner.active {
  display: block;
}

.card-visual {
  height: 140px;
  background: #000;
  position: relative;
  overflow: hidden;
}

.camera-noise {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: url("https://grainy-gradients.vercel.app/noise.svg");
  opacity: 0.1;
  pointer-events: none;
}

.card-body {
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.stat-value {
  font-size: 1.6rem;
  font-weight: 800;
  color: #0f172a;
}
.stat-label {
  font-size: 10px;
  font-weight: 800;
  color: #64748b;
  text-transform: uppercase;
  margin-bottom: 4px;
}

.tech-info {
  background: rgba(0, 0, 0, 0.03);
  padding: 12px;
  border-radius: 14px;
}
.tech-row {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  margin: 4px 0;
}
.tech-row strong {
  color: #0f172a;
}

.sensor-advanced {
  background: white;
  border: 1px solid rgba(0, 0, 0, 0.05);
  border-radius: 16px;
  padding: 15px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.02);
}
.diag-title {
  font-size: 10px;
  font-weight: 800;
  color: #64748b;
  margin-bottom: 10px;
}
.diag-item {
  margin-bottom: 10px;
}
.diag-label {
  font-size: 11px;
  font-weight: 600;
  color: #475569;
}
.diag-value-bold {
  font-size: 12px;
  font-weight: 800;
  color: #0f172a;
}

.diag-bar-container {
  width: 100%;
  height: 6px;
  background: #f1f5f9;
  border-radius: 3px;
  overflow: hidden;
  margin-top: 4px;
}
.diag-bar-fill {
  height: 100%;
  background: var(--primary);
  transition: width 0.5s ease;
}

.cyber-btn {
  background: #0f172a;
  color: white;
  border: none;
  padding: 10px;
  border-radius: 10px;
  font-size: 10px;
  font-weight: 800;
  cursor: pointer;
  width: 100%;
}

/* --- MODAL DE RESERVACIONES PREMIUM --- */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(15, 23, 42, 0.85);
  backdrop-filter: blur(12px);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

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

.modal-content {
  background: linear-gradient(
    135deg,
    rgba(30, 41, 59, 0.95),
    rgba(15, 23, 42, 0.98)
  );
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
  border-radius: 2rem;
  padding: 2.5rem;
  width: 100%;
  max-width: 500px;
  transform: scale(0.9) translateY(20px);
  transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
  overflow: hidden;
}

.modal-overlay.active .modal-content {
  transform: scale(1) translateY(0);
}

.modal-header {
  margin-bottom: 2rem;
  text-align: center;
}

.modal-header h2 {
  font-size: 1.75rem;
  font-weight: 800;
  letter-spacing: -0.025em;
  background: linear-gradient(to right, #60a5fa, #a78bfa);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.form-group {
  margin-bottom: 1.5rem;
}

.form-label {
  display: block;
  font-size: 0.75rem;
  font-weight: 700;
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.5rem;
  margin-left: 0.5rem;
}

.form-input {
  width: 100%;
  background: rgba(15, 23, 42, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 1rem;
  padding: 0.875rem 1rem;
  color: white;
  font-family: inherit;
  transition: all 0.2s;
}

.form-input:focus {
  outline: none;
  border-color: #3b82f6;
  background: rgba(15, 23, 42, 0.8);
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2);
}

.prime-btn {
  width: 100%;
  padding: 1rem;
  border-radius: 1rem;
  background: linear-gradient(135deg, #3b82f6, #8b5cf6);
  color: white;
  font-weight: 700;
  font-size: 1rem;
  border: none;
  cursor: pointer;
  transition: all 0.2s;
  box-shadow: 0 10px 15px -3px rgba(59, 130, 246, 0.3);
}

.prime-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 20px 25px -5px rgba(59, 130, 246, 0.4);
}

.close-modal {
  position: absolute;
  top: 1.25rem;
  right: 1.25rem;
  color: #94a3b8;
  cursor: pointer;
  transition: color 0.2s;
}

.close-modal:hover {
  color: white;
}

/* Glass Card en el Dashboard */
.new-res-dash-btn {
  text-align: center;
  margin-top: 1rem;
  padding: 0.75rem;
  border: 1px dashed rgba(255, 255, 255, 0.2);
  border-radius: 1rem;
  cursor: pointer;
  transition: all 0.2s;
  color: #94a3b8;
  font-weight: 600;
}

.new-res-dash-btn:hover {
  background: rgba(59, 130, 246, 0.1);
  border-color: #3b82f6;
  color: #60a5fa;
}

/* --- SIMULATION LAB STYLES --- */
.sim-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 15px;
}

.sim-lab-status {
  margin-top: 10px;
  padding: 8px 10px;
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 10px;
  background: rgba(15, 23, 42, 0.04);
  color: #475569;
  font-size: 9px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

body.simulation-lab-mode .sim-lab-status {
  border-color: rgba(245, 158, 11, 0.35);
  background: rgba(245, 158, 11, 0.12);
  color: #b45309;
}

.sim-btn {
  background: rgba(15, 23, 42, 0.05);
  border: 1px solid rgba(15, 23, 42, 0.1);
  border-radius: 12px;
  padding: 10px;
  font-size: 10px;
  font-weight: 800;
  color: #0f172a;
  cursor: pointer;
  transition: all 0.2s;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.sim-btn:hover {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px var(--primary-glow);
}

.sim-btn.active {
  background: #f59e0b;
  color: #0f172a;
  border-color: rgba(245, 158, 11, 0.9);
  box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.18);
}

.sim-btn.reset {
  background: rgba(16, 185, 129, 0.1);
  color: #059669;
  border-color: rgba(16, 185, 129, 0.2);
}

.sim-btn.reset:hover {
  background: #10b981;
  color: white;
}

.pulse-dot-small {
  width: 8px;
  height: 8px;
  background: #f59e0b;
  border-radius: 50%;
  animation: pulse-simple 1.5s infinite;
}

@keyframes pulse-simple {
  0% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.3); opacity: 0.5; }
  100% { transform: scale(1); opacity: 1; }
}

/* --- ZONE NAVIGATION DOCK --- */
.zone-navigation-dock {
  position: fixed;
  bottom: 100px; /* Separado del fondo para flotar */
  left: 50%;
  transform: translateX(-50%);
  background: rgba(15, 23, 42, 0.7);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 8px;
  border-radius: 24px;
  display: flex;
  gap: 8px;
  z-index: 2000;
  pointer-events: auto;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.3);
}

.nav-dock-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 65px;
  height: 65px;
  border-radius: 18px;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  color: white;
  background: rgba(255, 255, 255, 0.05);
}

.nav-dock-item:hover {
  background: var(--primary);
  transform: translateY(-10px) scale(1.1);
  box-shadow: 0 10px 20px var(--primary-glow);
}

.nav-dock-item.active {
  background: var(--primary);
  box-shadow: 0 0 20px var(--primary-glow);
}

.dock-icon {
  font-size: 1.4rem;
  margin-bottom: 2px;
}

.dock-label {
  font-size: 8px;
  font-weight: 800;
  letter-spacing: 1px;
  opacity: 0.7;
}

.nav-dock-item:hover .dock-label {
  opacity: 1;
}

@media screen and (max-width: 800px) {
  .zone-navigation-dock {
    bottom: 80px;
    padding: 6px;
    gap: 6px;
    width: auto;
    border-radius: 20px;
  }
  .nav-dock-item {
    width: 55px;
    height: 55px;
  }
  .dock-icon {
    font-size: 1.2rem;
  }
}

/* --- EXIT WALKTHROUGH BUTTON --- */
.exit-walk-btn {
  position: fixed;
  top: 30px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(239, 68, 68, 0.9);
  color: white;
  border: none;
  padding: 12px 24px;
  border-radius: 100px;
  font-weight: 800;
  font-size: 12px;
  letter-spacing: 1px;
  cursor: pointer;
  z-index: 5000;
  display: flex;
  align-items: center;
  gap: 10px;
  box-shadow: 0 10px 30px rgba(239, 68, 68, 0.4);
  transition: all 0.3s cubic-bezier(0.19, 1, 0.22, 1);
  pointer-events: auto;
}

.exit-walk-btn:hover {
  transform: translateX(-50%) translateY(-5px);
  background: #dc2626;
  box-shadow: 0 15px 40px rgba(239, 68, 68, 0.6);
}

.exit-walk-btn span {
  background: rgba(0, 0, 0, 0.2);
  padding: 2px 8px;
  border-radius: 6px;
  font-size: 10px;
}

.exit-walk-btn.hidden {
  display: none;
}

/* --- DOCK GROUPS & MINI ENTER --- */
.dock-group {
  display: flex;
  flex-direction: column;
  gap: 5px;
  align-items: center;
}

.mini-enter-btn {
  background: rgba(99, 102, 241, 0.2);
  border: 1px solid rgba(99, 102, 241, 0.4);
  color: #818cf8;
  font-size: 7px;
  font-weight: 900;
  padding: 2px 8px;
  border-radius: 6px;
  cursor: pointer;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  transition: all 0.2s;
  pointer-events: auto;
}

.mini-enter-btn:hover {
  background: #6366f1;
  color: white;
  transform: scale(1.05);
  box-shadow: 0 0 10px rgba(99, 102, 241, 0.5);
}
