/* =========================================
   ULTRON UI - GERENCIA MODULE (v56.0 UNIFIED)
   Theme: Neon Command (Fully Standardized)
   ========================================= */
:root {
  --bg-deep: #070b11;
  --bg-soft: #0e141d;
  --panel: #121a24;
  --panel-strong: #161f2b;
  --neon: #00ff41;
  /* Verde */
  --danger: #ff3333;
  /* Rojo */
  --warning: #ffcc00;
  /* Naranjo/Amarillo */
  --info: #00f3ff;
  /* Azul Cian */
  --text: #f5f7f8;
  --text-soft: #a5adb4;
  --border: #1f2935;
  --header-bg: #0c1119;
  --header-height: 60px;
  --sidebar-width: 260px;
  --max-content-width: 1200px;
  --base-font-size: 12px;
  --font-main: 'Space Grotesk', 'Sora', sans-serif;
}

html {
  font-size: var(--base-font-size);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: var(--font-main);
}

body {
  background-color: var(--bg-deep);
  background-image: radial-gradient(circle at 12% 10%, rgba(0, 255, 65, 0.12), transparent 45%),
    radial-gradient(circle at 88% 12%, rgba(0, 243, 255, 0.1), transparent 45%),
    radial-gradient(circle at 90% 90%, rgba(255, 51, 51, 0.08), transparent 40%),
    linear-gradient(180deg, rgba(7, 11, 17, 0.9), rgba(4, 7, 11, 0.98));
  color: var(--text);
  height: 100vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  background: linear-gradient(180deg, rgba(8, 12, 18, 0.05), rgba(0, 0, 0, 0.8));
  pointer-events: none;
  z-index: 0;
}

/* Scrollbar */
main {
  scrollbar-width: thin;
  scrollbar-color: rgba(0, 255, 65, 0.6) rgba(10, 12, 14, 0.85);
}

main::-webkit-scrollbar {
  width: 10px;
}

main::-webkit-scrollbar-track {
  background: rgba(10, 12, 14, 0.85);
  border-radius: 999px;
}

main::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, rgba(0, 255, 65, 0.75), rgba(0, 243, 255, 0.45));
  border-radius: 999px;
  border: 2px solid rgba(10, 12, 14, 0.85);
}

main::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, rgba(0, 255, 65, 0.95), rgba(0, 243, 255, 0.7));
}

/* --- HEADER UNIFICADO (Pixel Perfect Copy from Supervisor) --- */
header {
  background: var(--header-bg);
  border-right: 1px solid var(--border);
  padding: 24px 18px;
  width: var(--sidebar-width);
  height: 100vh;
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 20px;
  z-index: 2000;
  box-shadow: 10px 0 30px rgba(0, 0, 0, 0.55);
  transition: width 0.3s ease;
}

header h1 {
  font-size: 1.1rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 10px;
}

header h1::before {
  content: '';
  width: 12px;
  height: 12px;
  border-radius: 4px;
  background: var(--neon);
  box-shadow: 0 0 12px rgba(0, 255, 65, 0.7);
}

.header-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
}

#sidebar-toggle {
  background: transparent;
  border: none;
  color: var(--text-soft);
  font-size: 1.2rem;
  cursor: pointer;
  padding: 5px;
  border-radius: 4px;
  transition: 0.2s;
}

#sidebar-toggle:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.05);
}

/* SIDE NAV */
.side-nav {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.side-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 12px;
  text-decoration: none;
  color: var(--text-soft);
  font-weight: 600;
  letter-spacing: 0.3px;
  transition: 0.2s ease;
  background: transparent;
  border: none;
  font: inherit;
  text-align: left;
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
  width: 100%;
  justify-content: flex-start;
}

.side-link i {
  color: var(--neon);
  opacity: 0.75;
  min-width: 20px;
  text-align: center;
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 1.2rem;
  /* Explicit Standard Size */
}

.side-link:hover,
.side-link.active {
  color: #fff;
  background: rgba(0, 255, 65, 0.12);
  box-shadow: inset 0 0 0 1px rgba(0, 255, 65, 0.2);
}

/* FOOTER BUTTONS */
.header-actions {
  margin-top: auto;
  padding-top: 20px;
  border-top: 1px solid #333;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.footer-buttons-container {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 100%;
}

.btn-account,
.btn-logout {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-weight: 800;
  text-transform: uppercase;
  padding: 12px;
  border-radius: 8px;
  cursor: pointer;
  transition: 0.2s;
  font-size: 0.8rem;
  color: #fff;
  background: transparent;
  white-space: nowrap;
  width: 100%;
}

.btn-account {
  background: rgba(6, 10, 14, 0.9);
  border: 1px solid var(--neon);
  color: var(--neon);
}

.btn-account:hover {
  background: var(--neon);
  color: #000;
  box-shadow: 0 0 20px rgba(0, 255, 65, 0.4);
}

.btn-logout {
  background: linear-gradient(180deg, #2a0e0e, #1a0505);
  border: 1px solid var(--danger);
  color: var(--danger);
}

.btn-logout:hover {
  background: var(--danger);
  color: #fff;
  box-shadow: 0 0 15px rgba(255, 51, 51, 0.4);
}

.user-avatar-small {
  width: 24px;
  height: 24px;
  background: #333;
  color: #fff;
  border-radius: 50%;
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 0.65rem;
  font-weight: bold;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.pill {
  background: rgba(6, 10, 14, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.12);
  padding: 10px 14px;
  border-radius: 12px;
  font-size: 0.9rem;
  color: #fff;
  font-weight: 700;
  text-align: center;
  white-space: nowrap;
}

/* SIDEBAR COLLAPSED */
body.sidebar-collapsed header {
  width: 72px;
  /* Reduced */
  padding: 24px 0;
  align-items: center;
  transition: width 0.5s cubic-bezier(0.2, 0.8, 0.2, 1);
}

body.sidebar-collapsed .header-top {
  justify-content: center;
  padding: 0;
  width: 100%;
}

body.sidebar-collapsed #sidebar-toggle {
  margin: 0 auto;
  display: flex;
  justify-content: center;
}

body.sidebar-collapsed header h1,
body.sidebar-collapsed .side-link span {
  display: none !important;
}

/* Initials Logic for #who - HIDDEN BY USER REQUEST */
body.sidebar-collapsed #who {
  display: none !important;
}

body.sidebar-collapsed #who::before {
  content: attr(data-initials);
  font-size: 0.9rem;
  font-weight: bold;
  color: var(--text-soft);
  display: block;
}

body.sidebar-collapsed header h1::before {
  display: block;
  margin: 0 auto;
}

body.sidebar-collapsed .side-nav {
  width: 100%;
  align-items: center;
}

body.sidebar-collapsed .side-link {
  justify-content: center;
  padding: 10px;
  width: 42px;
  height: 42px;
  border-radius: 10px;
}

body.sidebar-collapsed .side-link i {
  margin: 0;
  font-size: 1.2rem;
  /* Explicit Collapsed Size */
}

body.sidebar-collapsed .header-actions {
  width: 100%;
  align-items: center;
  border-top: none;
  padding-top: 10px;
}

body.sidebar-collapsed .footer-buttons-container {
  gap: 10px;
  align-items: center;
}

body.sidebar-collapsed .btn-account,
body.sidebar-collapsed .btn-logout {
  width: 42px;
  height: 42px;
  padding: 0;
  border-radius: 50%;
  justify-content: center;
  font-size: 12.25px !important;
  line-height: 1;
}

body.sidebar-collapsed .btn-logout {
  border-radius: 10px !important;
}

body.sidebar-collapsed .btn-account span,
body.sidebar-collapsed .btn-logout span {
  display: none;
}

body.sidebar-collapsed main {
  margin-left: 72px;
  padding-left: 2rem;
  transition: margin-left 0.5s cubic-bezier(0.2, 0.8, 0.2, 1);
}

/* MOBILE RESPONSIVE TOP BAR */
@media (max-width: 768px) {
  body {
    padding-top: 60px;
    overflow-y: auto !important;
  }

  /* Reset Main Layout */
  main,
  body.sidebar-collapsed main {
    margin-left: 0 !important;
    padding: 20px 16px !important;
    width: 100% !important;
    padding-top: 80px !important;
  }

  /* Header */
  header {
    width: 100% !important;
    height: 60px !important;
    flex-direction: row !important;
    justify-content: space-between !important;
    padding: 0 10px !important;
    align-items: center !important;
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    border-right: none !important;
    border-bottom: 1px solid var(--border) !important;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
  }

  header h1,
  .header-top {
    display: none !important;
  }

  /* Hide Sidebar Toggle on Mobile */
  #sidebar-toggle {
    display: none !important;
  }

  /* Side Nav becomes Top Nav */
  .side-nav {
    flex-direction: row !important;
    align-items: center !important;
    width: auto !important;
    gap: 8px !important;
    margin-left: 0 !important;
    margin-right: auto !important;
  }

  .side-link {
    width: auto !important;
    height: auto !important;
    padding: 8px !important;
    background: transparent !important;
    box-shadow: none !important;
    border: none !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
  }

  .side-link i {
    font-size: 1.2rem !important;
    margin: 0 !important;
  }

  .side-link span {
    display: none !important;
  }

  .side-link.active i {
    color: #fff;
    text-shadow: 0 0 10px var(--neon);
  }

  /* Actions */
  .header-actions {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    width: auto !important;
    margin-top: 0 !important;
    padding-top: 0 !important;
    border-top: none !important;
    gap: 8px !important;
  }

  #who {
    display: none !important;
  }

  .footer-buttons-container {
    flex-direction: row !important;
    gap: 8px !important;
    width: auto !important;
  }

  .btn-account,
  .btn-logout {
    width: 36px !important;
    height: 36px !important;
    padding: 0 !important;
    border-radius: 8px !important;
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    font-size: 1rem !important;
  }

  .btn-account span,
  .btn-logout span {
    display: none !important;
  }
}

/* MAIN */
main {
  margin-left: var(--sidebar-width);
  height: 100vh;
  padding-top: 2rem;
  padding-right: 2.5rem;
  padding-bottom: 2.5rem;
  padding-left: 2.5rem;
  width: auto;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  position: relative;
  z-index: 1;
  transition:
    padding-left 0.3s ease,
    margin-left 0.3s ease;
}

/* Main inner content styles remain below */

main .main-inner {
  width: 100%;
  max-width: var(--max-content-width);
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

/* INTRO */
.page-intro {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  padding: 18px 22px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: linear-gradient(140deg, rgba(0, 0, 0, 0.8), rgba(10, 16, 12, 0.95));
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.6);
  animation: float-in 0.6s ease both;
}

.intro-copy h2 {
  font-size: 1.6rem;
  font-weight: 700;
  margin: 6px 0 8px;
}

.intro-sub {
  color: var(--text-soft);
  font-size: 0.95rem;
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 2px;
  font-size: 0.75rem;
  color: var(--neon);
  font-weight: 700;
}

.intro-status {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: 12px;
  border: 1px solid rgba(0, 255, 65, 0.3);
  background: rgba(0, 0, 0, 0.6);
  min-width: 190px;
}

.live-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--neon);
  box-shadow: 0 0 12px rgba(0, 255, 65, 0.8);
  animation: pulse 1.6s ease-in-out infinite;
}

.status-label {
  color: var(--text-soft);
  text-transform: uppercase;
  font-size: 0.7rem;
  letter-spacing: 1px;
}

.status-value {
  font-size: 0.95rem;
  font-weight: 700;
}

.section-block {
  display: flex;
  flex-direction: column;
  gap: 16px;
  background: linear-gradient(160deg, rgba(18, 24, 33, 0.95), rgba(12, 17, 24, 0.9));
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 22px;
  box-shadow: 0 18px 30px rgba(0, 0, 0, 0.45);
  animation: float-in 0.6s ease both;
}

.page-intro,
.section-block {
  scroll-margin-top: 20px;
}

.section-header h3 {
  font-size: 1.1rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.section-header p {
  color: var(--text-soft);
  margin-top: 4px;
}

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

/* KPI CARDS (Base) */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 20px;
}

.kpi-card {
  background: linear-gradient(150deg, rgba(9, 12, 14, 0.95), rgba(6, 8, 9, 0.9));
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 22px;
  text-align: left;
  position: relative;
  overflow: hidden;
  transition: 0.3s;
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.55);
}

.kpi-card:hover {
  transform: translateY(-5px);
}

.kpi-card::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 4px;
}

/* La barra de color se define abajo */

.kpi-value {
  font-size: 2.6rem;
  font-weight: 700;
  color: #fff;
  margin: 10px 0;
}

.kpi-label {
  font-size: 0.8rem;
  color: #9aa3aa;
  text-transform: uppercase;
  letter-spacing: 1.2px;
}

/* --- COLORES KPI (AQUI ESTA EL CAMBIO) --- */

/* AZUL (Info) */
.kpi-blue {
  border-color: var(--info);
}

.kpi-blue::after {
  background: var(--info);
}

.kpi-blue:hover {
  box-shadow: 0 0 20px var(--info);
}

.kpi-blue .kpi-value {
  color: var(--info);
}

/* VERDE (Exito) */
.kpi-green {
  border-color: var(--neon);
}

.kpi-green::after {
  background: var(--neon);
}

.kpi-green:hover {
  box-shadow: 0 0 20px var(--neon);
}

.kpi-green .kpi-value {
  color: var(--neon);
}

/* ROJO (Peligro) */
.kpi-red {
  border-color: var(--danger);
}

.kpi-red::after {
  background: var(--danger);
}

.kpi-red:hover {
  box-shadow: 0 0 20px var(--danger);
}

.kpi-red .kpi-value {
  color: var(--danger);
}

/* NARANJO (Advertencia) */
.kpi-orange {
  border-color: var(--warning);
}

.kpi-orange::after {
  background: var(--warning);
}

.kpi-orange:hover {
  box-shadow: 0 0 20px var(--warning);
}

.kpi-orange .kpi-value {
  color: var(--warning);
}

/* CHARTS GRID */
.charts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 20px;
}

.chart-container {
  background: linear-gradient(160deg, rgba(9, 12, 14, 0.96), rgba(5, 6, 7, 0.9));
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 20px;
  height: 400px;
  position: relative;
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.5);
  animation: float-in 0.6s ease both;
}

.chart-title {
  color: #fff;
  margin-bottom: 15px;
  text-align: left;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.chart-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 12px;
}

.chart-sub {
  color: var(--text-soft);
  font-size: 0.8rem;
  margin-top: 4px;
}

.segmented {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.5);
}

.segmented button {
  border: none;
  background: transparent;
  color: var(--text-soft);
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  cursor: pointer;
  transition: 0.2s ease;
}

.segmented button.active {
  background: rgba(0, 255, 65, 0.18);
  border: 1px solid rgba(0, 255, 65, 0.5);
  color: var(--neon);
  box-shadow: 0 0 12px rgba(0, 255, 65, 0.2);
}

.segmented button:hover {
  color: #fff;
}

/* INSIGHTS */
.insight-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 20px;
}

.insight-card {
  background: linear-gradient(150deg, rgba(9, 12, 14, 0.95), rgba(6, 8, 9, 0.9));
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 20px;
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.5);
  position: relative;
  overflow: hidden;
}

.insight-card .card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  gap: 10px;
}

.insight-card h4 {
  text-transform: uppercase;
  letter-spacing: 1px;
  font-size: 0.95rem;
}

.card-tag {
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid var(--border);
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-soft);
  background: rgba(0, 0, 0, 0.6);
}

.storage-metric {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 12px;
}

.storage-value {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--text);
}

.storage-sub {
  color: var(--text-soft);
  font-size: 0.8rem;
}

.progress {
  width: 100%;
  height: 8px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.6);
  overflow: hidden;
}

.progress-bar {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--info), var(--neon));
  transition: width 0.6s ease;
}

.progress-bar.bar-warning {
  background: linear-gradient(90deg, var(--warning), #ffd36a);
}

.progress-bar.bar-danger {
  background: linear-gradient(90deg, var(--danger), #ff7a7a);
}

.sla-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 12px;
}

.sla-item {
  background: rgba(0, 0, 0, 0.5);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 10px;
}

.sla-label {
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-soft);
  display: block;
  margin-bottom: 6px;
}

.sla-value {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--neon);
}

.sla-meta {
  margin-top: 10px;
  font-size: 0.75rem;
  color: var(--text-soft);
}

.risk-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.risk-item {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.6);
}

.risk-title {
  font-weight: 700;
  font-size: 0.85rem;
  margin-bottom: 4px;
}

.risk-detail {
  color: var(--text-soft);
  font-size: 0.78rem;
}

.risk-pill {
  padding: 4px 8px;
  border-radius: 999px;
  border: 1px solid;
  font-size: 0.6rem;
  letter-spacing: 1px;
  text-transform: uppercase;
  white-space: nowrap;
  font-weight: 700;
}

.risk-high {
  border-color: rgba(255, 51, 51, 0.6);
  box-shadow: 0 0 18px rgba(255, 51, 51, 0.2);
}

.risk-high .risk-pill {
  color: var(--danger);
  border-color: var(--danger);
}

.risk-mid {
  border-color: rgba(255, 204, 0, 0.5);
}

.risk-mid .risk-pill {
  color: var(--warning);
  border-color: var(--warning);
}

.risk-low {
  border-color: rgba(0, 255, 65, 0.45);
}

.risk-low .risk-pill {
  color: var(--neon);
  border-color: var(--neon);
}

/* MAPA */
.map-card {
  background: linear-gradient(160deg, rgba(9, 12, 14, 0.96), rgba(5, 6, 7, 0.9));
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 16px;
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.5);
}

.map-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: flex-end;
  margin-bottom: 12px;
}

.map-controls .field-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 140px;
}

.map-controls label {
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-soft);
}

.map-controls input,
.map-controls select {
  background: #000;
  border: 1px solid var(--border);
  color: #fff;
  padding: 8px 10px;
  border-radius: 8px;
  font-weight: 600;
}

.btn-refresh {
  border: 1px solid var(--neon);
  background: #000;
  color: var(--neon);
  padding: 8px 14px;
  border-radius: 999px;
  text-transform: uppercase;
  letter-spacing: 1px;
  font-weight: 800;
  cursor: pointer;
  transition: 0.2s ease;
}

.btn-refresh:hover {
  background: var(--neon);
  color: #000;
  box-shadow: 0 0 18px rgba(0, 255, 65, 0.3);
}

.map-canvas {
  height: 380px;
  border-radius: 12px;
  border: 1px solid var(--border);
  overflow: hidden;
}

.map-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 10px;
  color: var(--text-soft);
  font-size: 0.8rem;
}

.leaflet-container {
  background: #07090b;
  font-family: var(--font-main);
}

.leaflet-control-zoom a {
  background: #0b0e10;
  color: #fff;
  border: 1px solid var(--border);
}

.leaflet-control-zoom a:hover {
  background: #0f1418;
}

.leaflet-control-attribution {
  background: rgba(0, 0, 0, 0.6);
  color: var(--text-soft);
  border-radius: 8px;
  padding: 4px 8px;
  border: 1px solid var(--border);
}

.leaflet-control-attribution a {
  color: var(--neon);
}

/* MODALES */
.modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.95);
  z-index: 2000;
  display: none;
  justify-content: center;
  align-items: center;
}

.modal-content {
  background: rgba(12, 16, 22, 0.85);
  backdrop-filter: blur(25px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  padding: 30px;
  border-radius: 20px;
  width: 95%;
  max-width: 600px;
  max-height: 95vh;
  overflow-y: auto;
  box-shadow:
    0 30px 60px rgba(0, 0, 0, 0.6),
    inset 0 0 0 1px rgba(255, 255, 255, 0.05);
}

.modal-body {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

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

.modal-header h2 {
  color: #fff;
  font-weight: 900;
  text-transform: uppercase;
  font-size: 1.2rem;
  margin: 0;
}

.modal-close-btn {
  background: none;
  border: none;
  color: #fff;
  font-size: 2rem;
  cursor: pointer;
}

#modal-change-password .modal-content {
  max-width: 450px;
  padding: 30px;
}

.field {
  text-align: left;
}

.field label {
  display: block;
  color: #ffffff;
  font-size: 0.8rem;
  margin-bottom: 8px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.field input,
.field select {
  width: 100%;
  background: rgba(8, 12, 18, 0.9);
  border: 1px solid #263140;
  color: #fff;
  padding: 12px;
  min-height: 44px;
  border-radius: 8px;
  outline: none;
  transition: 0.3s;
  font-weight: 600;
  font-size: 0.95rem;
}

.field input:focus,
.field select:focus {
  border-color: var(--neon);
  box-shadow: 0 0 15px rgba(0, 255, 65, 0.2);
}

.btn-principal {
  display: inline-block;
  padding: 10px 15px;
  background: #000;
  border: 2px solid var(--neon);
  color: var(--neon);
  font-weight: 800;
  text-transform: uppercase;
  border-radius: 6px;
  cursor: pointer;
  transition: 0.3s;
  text-align: center;
  font-size: 0.8rem;
  min-width: 100px;
}

.btn-principal:hover {
  background: var(--neon);
  color: #000;
  box-shadow: 0 0 15px rgba(0, 255, 65, 0.5);
}

.modal-footer {
  margin-top: 20px;
  text-align: center;
}

.modal-status {
  margin: 10px 0;
  text-align: center;
  font-weight: bold;
  min-height: 20px;
}

.modal-status.loading {
  color: #fff;
}

.modal-status.error {
  color: var(--danger);
}

.modal-status.success {
  color: var(--neon);
}

/* PROJECTS GRID */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
  margin-top: 10px;
}

.project-card {
  background: linear-gradient(150deg, rgba(9, 12, 14, 0.95), rgba(6, 8, 9, 0.9));
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: 0.3s;
}

.project-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.5);
  border-color: var(--neon);
}

.pc-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.pc-header h4 {
  font-size: 1rem;
  color: #fff;
  text-transform: uppercase;
  font-weight: 700;
}

.pc-meta {
  font-size: 0.8rem;
  color: var(--text-soft);
}

.pc-actions {
  display: flex;
  gap: 8px;
  margin-top: auto;
  padding-top: 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.btn-sm {
  padding: 6px 10px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border);
  color: var(--text-soft);
  font-size: 0.7rem;
  text-transform: uppercase;
  cursor: pointer;
  transition: 0.2s;
}

.btn-sm:hover {
  background: #fff;
  color: #000;
}

.btn-danger:hover {
  background: var(--danger);
  color: #fff;
  border-color: var(--danger);
}

.empty-state {
  grid-column: 1 / -1;
  text-align: center;
  padding: 40px;
  background: rgba(0, 0, 0, 0.3);
  border-radius: 12px;
  border: 1px dashed var(--border);
  color: var(--text-soft);
}

/* Responsive */
@media (max-width: 768px) {
  :root {
    --sidebar-width: 0px;
    --base-font-size: 11px;
    --max-content-width: 100%;
  }

  body {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    height: auto;
    overflow-y: auto;
    overflow-x: hidden;
  }

  header {
    width: 100%;
    height: auto;
    position: sticky;
    top: 0;
    padding: 12px 14px;
    gap: 12px;
    flex-direction: column;
    align-items: flex-start;
    border-right: none;
    border-bottom: 1px solid var(--border);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.45);
  }

  header h1 {
    font-size: 1rem;
  }

  .side-nav {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 8px;
    width: 100%;
    overflow-x: auto;
    padding-bottom: 4px;
  }

  .side-link {
    padding: 8px 10px;
    font-size: 0.85rem;
    white-space: nowrap;
  }

  .header-actions {
    width: 100%;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 0;
  }

  header .pill,
  #who {
    padding: 6px 10px !important;
    font-size: 0.8rem !important;
    flex: 1 1 160px;
  }

  .btn-account,
  .btn-logout {
    padding: 8px 10px;
    font-size: 0.75rem;
    width: auto;
    flex: 1 1 120px;
  }

  main {
    margin-left: 0;
    width: 100%;
    height: auto;
    flex: 1;
    padding: 1rem;
    overflow: visible;
  }

  .page-intro {
    flex-direction: column;
    align-items: flex-start;
  }

  .intro-status {
    width: 100%;
  }

  .section-block {
    padding: 16px;
  }

  .charts-grid {
    grid-template-columns: 1fr;
  }

  .kpi-grid {
    gap: 12px;
  }

  .kpi-card {
    padding: 15px;
  }

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

  .chart-container {
    padding: 15px;
  }

  .chart-header {
    flex-direction: column;
    align-items: flex-start;
  }

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

  .insight-grid {
    grid-template-columns: 1fr;
  }

  .map-controls {
    flex-direction: column;
    align-items: stretch;
  }

  .map-canvas {
    height: 300px;
  }
}

/* Loader */
#global-loader {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: #000;
  z-index: 3000;
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}

.loader-spinner {
  width: 60px;
  height: 60px;
  border: 6px solid #222;
  border-top: 6px solid var(--neon);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin-bottom: 20px;
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }

  100% {
    transform: rotate(360deg);
  }
}

@keyframes float-in {
  0% {
    opacity: 0;
    transform: translateY(12px);
  }

  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes pulse {
  0% {
    transform: scale(1);
    opacity: 0.7;
  }

  50% {
    transform: scale(1.1);
    opacity: 1;
  }

  100% {
    transform: scale(1);
    opacity: 0.7;
  }
}
