/* ==========================================================================
   PORTAL DE INDUCCIÓN Y MONITOREO - DNP COLOMBIA
   Sistema de Diseño CSS - Enfoque "Pastel Harmony" (Alta Fidelidad)
   ========================================================================== */

/* Importación de Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=Nunito:wght@300;400;500;600;700;800&display=swap');

/* --- variables del sistema de diseño --- */
:root {
  /* Fuentes */
  --font-global: 'Nunito', sans-serif;

  /* Colores Base Corporativos DATAUM */
  --bg-main: #f8f9fa;        
  --bg-card: #ffffff;
  --text-main: #374151;      
  --text-muted: #6D6E71;     
  --text-light: #9ca3af;     
  --border-color: rgba(109, 110, 113, 0.2);   
  --border-hover: rgba(76, 121, 140, 0.35);
  --border-active: #4C798C;

  /* Identidad Visual Oficial DATAUM */
  --color-primary: #4C798C;        /* Azul Corporativo DATAUM */
  --color-primary-dark: #3b6070;   
  --color-primary-light: rgba(76, 121, 140, 0.12);
  --color-primary-glow: rgba(76, 121, 140, 0.25);
  
  --color-accent: #6D6E71;         /* Gris Corporativo DATAUM */
  --color-accent-dark: #4B4C4E;
  --color-accent-light: rgba(109, 110, 113, 0.15);
  
  /* Paleta Complementaria Institucional */
  --mint: #e8f5e9;           /* Menta suave */
  --mint-dark: #1b5e20;
  --lavender: #f3e5f5;       /* Lavanda suave */
  --lavender-dark: #4a148c;
  --peach: #fff3e0;          /* Durazno suave */
  --peach-dark: #e65100;
  --sky: #f0f5f8;            /* Azul institucional tenue */
  --sky-dark: #345563;
  --coral: #4C798C;          /* Acento principal unificado a DATAUM */
  --coral-dark: #3b6070;
  
  /* Sombras y Efectos */
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.02);
  --shadow-md: 0 8px 20px rgba(0, 0, 0, 0.03);
  --shadow-lg: 0 15px 35px rgba(0, 0, 0, 0.05);
  --shadow-glow: 0 4px 15px rgba(76, 121, 140, 0.25);
  
  /* Radios de borde extremadamente redondeados */
  --radius-sm: 0.75rem;
  --radius-md: 1.25rem;
  --radius-lg: 1.75rem;
  --radius-xl: 2.5rem;
  --radius-2xl: 3.5rem;
  
  /* Transiciones */
  --transition-fast: 0.15s ease;
  --transition-normal: 0.35s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  --transition-slow: 0.5s cubic-bezier(0.15, 0.85, 0.35, 1);

  /* Tamaños */
  --sidebar-width: 290px;
}

/* --- reset moderno --- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-global);
  background-color: var(--bg-main);
  color: var(--text-main);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow: hidden;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  height: 100vh;
  width: 100vw;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-global);
  font-weight: 700;
  line-height: 1.25;
  color: #1e272e;
}

a {
  color: var(--color-primary);
  text-decoration: none;
  transition: color var(--transition-fast);
}

a:hover {
  color: var(--color-primary-dark);
}

/* --- personalización de barra de desplazamiento --- */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: var(--bg-main);
}
::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 999px;
}
::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}

/* ==========================================================================
   ESTRUCTURA SPA Y DISEÑO DE LAYOUT (CLARO & GLASSMORPHIC)
   ========================================================================== */

.app-container {
  display: flex;
  min-height: 100vh;
  position: relative;
}

/* --- barra lateral flotante glassmorphic --- */
.sidebar {
  width: var(--sidebar-width);
  background-color: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(15px);
  border-right: 1px solid rgba(0, 0, 0, 0.05);
  color: var(--text-main);
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  z-index: 100;
  display: flex;
  flex-direction: column;
  box-shadow: 4px 0 25px rgba(0, 0, 0, 0.02);
  transition: transform var(--transition-normal);
}

.sidebar-header {
  padding: 1.75rem;
  border-bottom: 1px solid rgba(0, 0, 0, 0.03);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
}

.sidebar-logo {
  max-width: 100%;
  height: 80px;
  object-fit: contain;
  /* Nota: Mostramos el logotipo en sus colores patrios reales, no forzamos invert */
}

.sidebar-titles {
  text-align: center;
}

.sidebar-title-main {
  font-family: var(--font-global);
  font-weight: 800;
  font-size: 1.2rem;
  color: #1e272e;
  letter-spacing: -0.2px;
  display: block;
}

.sidebar-title-sub {
  font-size: 0.68rem;
  color: var(--text-light);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  display: block;
  margin-top: 0.25rem;
}

.sidebar-nav {
  flex-grow: 1;
  padding: 1.5rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  overflow-y: auto;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.75rem 1.15rem;
  color: var(--text-muted);
  font-family: var(--font-global);
  font-weight: 600;
  font-size: 0.9rem;
  border-radius: var(--radius-md);
  border: none;
  background: transparent;
  cursor: pointer;
  width: 100%;
  text-align: left;
  transition: all var(--transition-fast);
}

.nav-item:hover {
  background-color: rgba(0, 0, 0, 0.02);
  color: #1e272e;
  transform: translateX(4px);
}

.nav-item.active {
  background-color: #ffffff;
  color: #1e272e;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.04);
  border-left: 4px solid var(--coral);
}

.nav-item-badge {
  margin-left: auto;
  background-color: var(--coral);
  color: #ffffff;
  font-size: 0.65rem;
  font-weight: 700;
  padding: 0.15rem 0.45rem;
  border-radius: 9999px;
  text-transform: uppercase;
}

.sidebar-footer {
  padding: 1.25rem;
  border-top: 1px solid rgba(0, 0, 0, 0.03);
  font-size: 0.7rem;
  color: var(--text-light);
  text-align: center;
  line-height: 1.4;
}

/* --- contenido principal --- */
.main-wrapper {
  margin-left: 0;
  flex-grow: 1;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  width: 100%;
  transition: margin var(--transition-normal), width var(--transition-normal);
}

/* --- cabecera superior glassmorphic --- */
.app-topbar {
  background-color: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(0, 0, 0, 0.04);
  padding: 1rem 2.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: sticky;
  top: 0;
  z-index: 50;
  height: 70px;
}

.menu-toggle {
  display: none;
  background: transparent;
  border: none;
  font-size: 1.5rem;
  color: #1e272e;
  cursor: pointer;
}

.topbar-title-section {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.topbar-subtitle {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-weight: 600;
  background-color: #ffffff;
  padding: 0.25rem 0.85rem;
  border-radius: 9999px;
  border: 1px solid rgba(0,0,0,0.04);
  box-shadow: var(--shadow-sm);
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.btn-patrio {
  background-color: var(--color-primary);
  color: #ffffff;
  font-family: var(--font-global);
  font-weight: 700;
  font-size: 0.8rem;
  padding: 0.6rem 1.15rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--color-primary);
  cursor: pointer;
  box-shadow: 0 4px 15px var(--color-primary-glow);
  transition: all var(--transition-fast);
}

.btn-patrio:hover:not(:disabled) {
  background-color: var(--color-primary-dark);
  border-color: var(--color-primary-dark);
  box-shadow: 0 6px 20px rgba(76, 121, 140, 0.35);
  transform: translateY(-1px);
}

.btn-patrio:disabled {
  background-color: #e2e8f0;
  border-color: #e2e8f0;
  color: #94a3b8;
  cursor: not-allowed;
  box-shadow: none;
  transform: none;
}

.input-premium {
  border: 1px solid var(--border-color);
  background-color: #ffffff;
  color: var(--text-main);
  border-radius: var(--radius-sm);
  font-family: var(--font-global);
  transition: all var(--transition-fast);
}

.input-premium:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px var(--color-primary-light);
}

.input-premium:disabled {
  background-color: #f1f5f9;
  color: var(--text-light);
  cursor: not-allowed;
}

/* --- contenedor de las vistas SPA --- */
.content-viewport {
  padding: 2.5rem;
  flex-grow: 1;
}

.spa-view {
  display: none;
  animation: viewFadeIn var(--transition-slow) forwards;
}

.spa-view.active {
  display: block;
}

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

/* ==========================================================================
   COMPONENTES UI "PASTEL HARMONY"
   ========================================================================== */

/* --- tarjetas premium redondeadas --- */
.card-premium {
  background: var(--bg-card);
  border: 1px solid rgba(0, 0, 0, 0.03);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  padding: 2rem;
  margin-bottom: 1.75rem;
  transition: transform var(--transition-normal), box-shadow var(--transition-normal);
  position: relative;
  overflow: hidden;
}

.card-premium:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-lg);
}

/* --- variantes pastel para fondos de tarjetas --- */
.bg-pastel-blue { background-color: var(--sky) !important; color: var(--sky-dark) !important; }
.bg-pastel-rose { background-color: #fff0f0 !important; color: #c0392b !important; }
.bg-pastel-green { background-color: var(--mint) !important; color: var(--mint-dark) !important; }
.bg-pastel-yellow { background-color: var(--peach) !important; color: var(--peach-dark) !important; }
.bg-pastel-lavender { background-color: var(--lavender) !important; color: var(--lavender-dark) !important; }

/* --- grids y layouts flexibles --- */
.grid-container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(310px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2rem;
}

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

/* --- insignias y etiquetas pastel --- */
.badge-ui {
  display: inline-flex;
  align-items: center;
  padding: 0.3rem 0.85rem;
  border-radius: 9999px;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
}

.badge-blue { background-color: rgba(76, 121, 140, 0.12); color: var(--color-primary); }
.badge-green { background-color: rgba(27, 94, 32, 0.08); color: var(--mint-dark); }
.badge-yellow { background-color: rgba(230, 81, 0, 0.08); color: var(--peach-dark); }
.badge-red { background-color: rgba(185, 28, 28, 0.08); color: var(--dnp-red); }

/* --- pestañas glassmorphism redondeadas --- */
.glass-tabs {
  display: flex;
  gap: 0.4rem;
  background-color: rgba(226, 232, 240, 0.5);
  backdrop-filter: blur(10px);
  padding: 0.4rem;
  border-radius: var(--radius-md);
  border: 1px solid rgba(0, 0, 0, 0.03);
  margin-bottom: 2rem;
  width: fit-content;
  max-width: 100%;
  flex-wrap: wrap;
}

.glass-tab-btn {
  background: transparent;
  border: none;
  font-family: var(--font-global);
  font-weight: 600;
  font-size: 0.85rem;
  color: var(--text-muted);
  padding: 0.6rem 1.35rem;
  border-radius: 0.95rem;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.glass-tab-btn:hover {
  color: #1e272e;
  background-color: rgba(255, 255, 255, 0.4);
}

.glass-tab-btn.active {
  background-color: #ffffff;
  color: #1e272e;
  box-shadow: 0 4px 15px rgba(0,0,0,0.06);
  border-bottom: 3px solid var(--coral);
}

/* --- texto con degradado elegante --- */
.gradient-text {
  background: linear-gradient(135deg, #1e272e 0%, #485460 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* ==========================================================================
   VISTAS Y SECCIONES ESPECÍFICAS
   ========================================================================== */

/* --- view: inicio / hero --- */
.welcome-hero {
  background: linear-gradient(135deg, #2c3e50 0%, #0f172a 100%);
  color: #ffffff;
  border-radius: var(--radius-xl);
  padding: 4rem 3rem;
  margin-bottom: 2rem;
  box-shadow: var(--shadow-sm);
  position: relative;
  overflow: hidden;
}

.welcome-hero h1 {
  color: #ffffff;
  font-size: 2.8rem;
  font-weight: 800;
  letter-spacing: -0.5px;
  margin-bottom: 1rem;
}

.welcome-hero p {
  color: rgba(255, 255, 255, 0.75);
  font-size: 1.1rem;
  max-width: 820px;
  line-height: 1.7;
}

.welcome-grid-status {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1.25rem;
  margin-top: 3rem;
}

.status-counter-card {
  background: rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(5px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  text-align: center;
  transition: transform var(--transition-fast);
}

.status-counter-card:hover {
  transform: translateY(-3px);
  background: rgba(255, 255, 255, 0.08);
}

.status-count-value {
  display: block;
  font-family: var(--font-global);
  font-size: 2.2rem;
  font-weight: 800;
  color: #ffffff;
  line-height: 1;
}

.status-count-label {
  display: block;
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.5);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-top: 0.5rem;
}

/* --- view: introducción conceptual (enfoque de resultados) --- */
.triada-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(310px, 1fr));
  gap: 1.5rem;
  margin: 2rem 0;
}

.scope-title-label {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-light);
  letter-spacing: 1.5px;
}

/* --- view: cadena de valor (Líneas de tiempo) --- */
.ui-timeline {
  position: relative;
  max-width: 950px;
  margin: 2.5rem auto;
  padding: 1rem 0;
}

.ui-timeline::after {
  content: '';
  position: absolute;
  width: 4px;
  background-color: rgba(0,0,0,0.03);
  top: 0;
  bottom: 0;
  left: 50%;
  margin-left: -2px;
}

.ui-timeline-item {
  padding: 1rem 3rem;
  position: relative;
  width: 50%;
}

.ui-timeline-item::after {
  content: '';
  position: absolute;
  width: 18px;
  height: 18px;
  right: -9px;
  background-color: #ffffff;
  border: 4px solid var(--coral);
  top: 2rem;
  border-radius: 50%;
  z-index: 5;
  transition: all var(--transition-fast);
}

.ui-timeline-item.left { left: 0; text-align: right; }
.ui-timeline-item.right { left: 50%; text-align: left; }
.ui-timeline-item.right::after { left: -9px; }

.ui-timeline-item.left .timeline-card-content::before {
  content: " ";
  position: absolute;
  top: 1.75rem;
  right: -10px;
  border: 10px solid transparent;
  border-left-color: var(--bg-card);
  filter: drop-shadow(1px 0px 0px rgba(0,0,0,0.01));
}

.ui-timeline-item.right .timeline-card-content::before {
  content: " ";
  position: absolute;
  top: 1.75rem;
  left: -10px;
  border: 10px solid transparent;
  border-right-color: var(--bg-card);
  filter: drop-shadow(-1px 0px 0px rgba(0,0,0,0.01));
}

.timeline-card-content {
  background-color: var(--bg-card);
  border: 1px solid rgba(0, 0, 0, 0.02);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  padding: 1.5rem;
  position: relative;
  transition: all var(--transition-normal);
  cursor: pointer;
  text-align: left;
}

.timeline-card-content:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
  border-color: rgba(0,0,0,0.05);
}

.ui-timeline-item:hover::after {
  transform: scale(1.3);
  background-color: #ffffff;
  border-color: var(--coral-dark);
}

.timeline-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}

.timeline-card-title {
  font-family: var(--font-global);
  font-size: 1.05rem;
  font-weight: 700;
  color: #1e272e;
  margin: 0;
}

.timeline-chevron {
  width: 1.15rem;
  height: 1.15rem;
  color: var(--text-light);
  transition: transform var(--transition-fast);
}

.timeline-card-body {
  max-height: 0;
  overflow: hidden;
  transition: max-height var(--transition-normal) ease-out, padding var(--transition-normal) ease-out;
  padding: 0;
}

.timeline-card-body.open {
  max-height: 1200px;
  padding-top: 1.25rem;
  margin-top: 1rem;
  border-top: 1px solid rgba(0,0,0,0.03);
}

.timeline-detail-group {
  margin-bottom: 1rem;
}

.timeline-detail-group:last-child {
  margin-bottom: 0;
}

.timeline-detail-label {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-light);
  letter-spacing: 0.8px;
  margin-bottom: 0.25rem;
}

.timeline-detail-value {
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.5;
}

.timeline-section-divider {
  width: 100%;
  display: flex;
  justify-content: center;
  margin: 3rem 0;
  position: relative;
  z-index: 10;
}

.timeline-section-title-box {
  background-color: #ffffff;
  color: #1e272e;
  font-family: var(--font-global);
  font-weight: 700;
  font-size: 1.1rem;
  padding: 0.75rem 2rem;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  border: 1px solid rgba(0, 0, 0, 0.04);
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

/* --- view: ecosistema de sistemas --- */
.system-card {
  background: var(--bg-card);
  border: 1px solid rgba(0, 0, 0, 0.03);
  border-radius: var(--radius-md);
  padding: 1.75rem;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-sm);
  transition: transform var(--transition-normal), box-shadow var(--transition-normal);
}

.system-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
}

.system-card-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.system-icon-wrapper {
  width: 44px;
  height: 44px;
  border-radius: 0.85rem;
  background-color: #f1f5f9;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  flex-shrink: 0;
}

.system-card-title {
  font-family: var(--font-global);
  font-weight: 700;
  font-size: 1.2rem;
  color: #1e272e;
  margin: 0;
}

.system-description {
  font-size: 0.85rem;
  color: var(--text-muted);
  flex-grow: 1;
  margin-bottom: 1.5rem;
  line-height: 1.55;
}

.system-accordion {
  border: 1px solid rgba(0, 0, 0, 0.03);
  border-radius: 0.85rem;
  overflow: hidden;
}

.system-accordion-header {
  background-color: var(--bg-main);
  padding: 0.6rem 1rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  user-select: none;
  transition: background var(--transition-fast);
}

.system-accordion-header:hover {
  background-color: rgba(0,0,0,0.01);
}

.system-accordion-title {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-light);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.system-accordion-content {
  max-height: 0;
  overflow: hidden;
  transition: max-height var(--transition-normal) ease-out, padding var(--transition-normal) ease-out;
  padding: 0 1rem;
  background-color: #ffffff;
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.5;
}

.system-accordion-content.open {
  max-height: 250px;
  padding: 0.85rem 1rem;
  border-top: 1px solid rgba(0, 0, 0, 0.03);
}

/* --- view: planeación en el territorio --- */
.territorio-flex-container {
  display: flex;
  gap: 2rem;
  flex-wrap: wrap;
}

.territorio-grid-layout {
  display: grid;
  grid-template-columns: 1fr 1.5fr;
  gap: 1.75rem;
  margin-top: 1.5rem;
  align-items: stretch;
}

@media (max-width: 1024px) {
  .territorio-grid-layout {
    grid-template-columns: 1fr;
  }
}

.territorio-map-column,
.territorio-data-column {
  width: 100%;
}

.colombia-map-wrapper {
  position: relative;
  background-color: #ffffff;
  border-radius: var(--radius-md);
  padding: 0.5rem;
}

.colombia-svg-detailed {
  width: 100%;
  height: auto;
  fill: #e8eef1;
  stroke: #ffffff;
  stroke-width: 1.25;
  transition: all var(--transition-normal);
}

.colombia-svg-detailed path {
  cursor: pointer;
  transition: fill var(--transition-fast), stroke-width var(--transition-fast), filter var(--transition-fast);
}

.colombia-svg-detailed path:hover {
  fill: #97b9c7;
  stroke-width: 2;
  filter: drop-shadow(0px 4px 12px rgba(76, 121, 140, 0.25));
}

.colombia-svg-detailed path.selected {
  fill: var(--color-primary);
  stroke: #ffffff;
  stroke-width: 2;
  filter: drop-shadow(0px 4px 15px rgba(76, 121, 140, 0.4));
}

/* Panel de Datos / Pestañas */
.panel-tab {
  border-bottom: 2px solid transparent !important;
}

.panel-tab:hover {
  color: var(--blue-dark) !important;
  background-color: rgba(0,0,0,0.02) !important;
}

.panel-tab.active {
  color: var(--blue-dark) !important;
  border-bottom: 2px solid var(--blue-dark) !important;
  background-color: #ffffff !important;
}

/* Contenido de Pestañas */
.tab-content {
  display: none;
  flex-grow: 1;
}

.tab-content.active {
  display: flex !important;
}

/* Chat del Asistente */
.chat-container {
  width: 100%;
  height: 100%;
}

.chat-messages::-webkit-scrollbar {
  width: 6px;
}

.chat-messages::-webkit-scrollbar-track {
  background: transparent;
}

.chat-messages::-webkit-scrollbar-thumb {
  background-color: rgba(0,0,0,0.08);
  border-radius: 9999px;
}

.chat-message {
  padding: 0.75rem 1rem;
  border-radius: var(--radius-md);
  max-width: 85%;
  font-size: 0.85rem;
  line-height: 1.5;
  box-shadow: var(--shadow-sm);
  animation: messageAppear var(--transition-fast) ease-out;
}

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

.chat-message.bot {
  background-color: #ffffff;
  color: var(--text-main);
  align-self: flex-start;
  border-radius: var(--radius-md) var(--radius-md) var(--radius-md) 0;
  border: 1px solid rgba(0,0,0,0.03);
}

.chat-message.user {
  background-color: rgba(76, 121, 140, 0.12);
  color: #1e3a47;
  border: 1px solid rgba(76, 121, 140, 0.22);
  align-self: flex-end;
  border-radius: var(--radius-md) var(--radius-md) 0 var(--radius-md);
  font-weight: 600;
}

/* Toolbar de exportación en mensajes del Bot */
.message-export-toolbar {
  margin-top: 0.85rem;
  padding-top: 0.65rem;
  border-top: 1px solid rgba(0, 0, 0, 0.06);
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.45rem;
  font-size: 0.72rem;
}

.message-export-toolbar .export-label {
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--text-muted);
  margin-right: 0.25rem;
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.btn-export-action {
  background-color: #f1f5f9;
  color: #334155;
  border: 1px solid #cbd5e1;
  border-radius: 5px;
  padding: 0.25rem 0.6rem;
  font-size: 0.72rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  transition: all 0.15s ease-in-out;
  text-decoration: none;
}

.btn-export-action:hover {
  background-color: #e2e8f0;
  color: #0f172a;
  border-color: #94a3b8;
  transform: translateY(-1px);
}

.btn-export-action.btn-export-docx {
  background-color: rgba(37, 99, 235, 0.08);
  color: #1d4ed8;
  border-color: rgba(37, 99, 235, 0.25);
}
.btn-export-action.btn-export-docx:hover {
  background-color: rgba(37, 99, 235, 0.16);
  border-color: #2563eb;
}

.btn-export-action.btn-export-pdf {
  background-color: rgba(220, 38, 38, 0.08);
  color: #b91c1c;
  border-color: rgba(220, 38, 38, 0.25);
}
.btn-export-action.btn-export-pdf:hover {
  background-color: rgba(220, 38, 38, 0.16);
  border-color: #dc2626;
}

.btn-export-action.btn-export-html {
  background-color: rgba(16, 185, 129, 0.08);
  color: #047857;
  border-color: rgba(16, 185, 129, 0.25);
}
.btn-export-action.btn-export-html:hover {
  background-color: rgba(16, 185, 129, 0.16);
  border-color: #059669;
}

/* Dashboard Scroll Container */
.dashboard-scroll-container::-webkit-scrollbar {
  width: 6px;
}

.dashboard-scroll-container::-webkit-scrollbar-track {
  background: transparent;
}

.dashboard-scroll-container::-webkit-scrollbar-thumb {
  background-color: rgba(0,0,0,0.08);
  border-radius: 9999px;
}

/* Widget Cards */
.widget-card {
  transition: transform var(--transition-normal), box-shadow var(--transition-normal);
}

.widget-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

/* Ejes Estratégicos list */
.ejes-list-container {
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
  overflow-y: auto;
  min-height: 0;
}

.eje-badge-item {
  padding: 10px 14px;
  background-color: #f8fafc;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
  border-left: 4px solid var(--color-primary);
  font-size: 12px;
  line-height: 1.55;
  color: #334155;
  transition: all 0.15s ease;
}

.eje-badge-item:hover {
  background-color: #f1f5f9;
  border-color: #cbd5e1;
}

.eje-badge-item span {
  display: block;
}

/* Tablas */
.table-premium th {
  font-weight: 700;
  border-bottom: 2px solid rgba(0,0,0,0.04);
}

.table-premium td {
  padding: 0.75rem 0.5rem;
  border-bottom: 1px solid rgba(0,0,0,0.02);
  color: var(--text-main);
}

.table-premium tr:hover td {
  background-color: rgba(0,0,0,0.01);
}

/* Gráficas SVG */
.chart-bar-rect {
  transition: fill var(--transition-fast), width 0.5s ease-out;
}
.chart-bar-rect:hover {
  fill: var(--blue-dark);
}

/* --- view: transparencia y monitoreo --- */
.monitor-card-intro {
  background: linear-gradient(135deg, rgba(250, 177, 160, 0.05) 0%, rgba(225, 245, 254, 0.1) 100%);
  border: 1px solid rgba(0, 0, 0, 0.03);
  border-radius: var(--radius-lg);
  padding: 2.25rem;
  margin-bottom: 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 2rem;
  flex-wrap: wrap;
}

.monitor-intro-text {
  flex: 2;
  min-width: 300px;
}

.monitor-intro-action {
  flex: 1;
  min-width: 200px;
  display: flex;
  justify-content: center;
}

.btn-large-piip {
  background-color: #1e272e;
  color: #ffffff;
  font-family: var(--font-global);
  font-weight: 700;
  font-size: 0.95rem;
  padding: 0.85rem 1.75rem;
  border-radius: 1.15rem;
  border: none;
  cursor: pointer;
  box-shadow: 0 4px 15px rgba(0,0,0,0.06);
  transition: all var(--transition-fast);
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.btn-large-piip:hover {
  background-color: var(--text-muted);
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(0,0,0,0.1);
}

/* ==========================================================================
   MINIJUEGO: SIMULADOR DE FORMULACIÓN BPIN/MGA (PASTEL HARMONY)
   ========================================================================== */

.sim-container {
  background: #ffffff;
  border: 1px solid rgba(0, 0, 0, 0.03);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-sm);
  max-width: 820px;
  margin: 0 auto;
  overflow: hidden;
}

.sim-header {
  background-color: #ffffff;
  border-bottom: 1px solid rgba(0, 0, 0, 0.04);
  color: #1e272e;
  padding: 1.5rem 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.sim-title {
  color: #1e272e;
  font-size: 1.25rem;
  font-weight: 700;
  margin: 0;
}

.sim-progress-bar-container {
  width: 150px;
  height: 6px;
  background-color: rgba(0, 0, 0, 0.05);
  border-radius: 999px;
  overflow: hidden;
}

.sim-progress-bar-fill {
  height: 100%;
  background-color: var(--coral);
  width: 25%;
  transition: width var(--transition-normal);
}

.sim-viewport {
  padding: 2.5rem;
}

.sim-step {
  display: none;
  animation: simStepFade 0.35s ease-out forwards;
}

.sim-step.active {
  display: block;
}

@keyframes simStepFade {
  from { opacity: 0; transform: scale(0.99); }
  to { opacity: 1; transform: scale(1); }
}

.sim-step-indicator {
  font-family: var(--font-global);
  font-weight: 700;
  font-size: 0.72rem;
  text-transform: uppercase;
  color: var(--text-light);
  letter-spacing: 1px;
  margin-bottom: 0.5rem;
}

.sim-step-title {
  font-size: 1.5rem;
  font-weight: 800;
  color: #1e272e;
  margin-bottom: 0.75rem;
}

.sim-step-desc {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-bottom: 2rem;
}

.sim-form-group {
  margin-bottom: 1.75rem;
}

.sim-label {
  display: block;
  font-weight: 600;
  font-size: 0.85rem;
  color: #1e272e;
  margin-bottom: 0.6rem;
}

.sim-select, .sim-input {
  width: 100%;
  padding: 0.75rem 1.15rem;
  border-radius: 0.95rem;
  border: 1px solid rgba(0, 0, 0, 0.05);
  font-family: var(--font-global);
  font-size: 0.9rem;
  background-color: #ffffff;
  color: var(--text-main);
  transition: all var(--transition-fast);
}

.sim-select:focus, .sim-input:focus {
  outline: none;
  border-color: var(--coral);
  box-shadow: 0 0 0 3px rgba(250, 177, 160, 0.15);
}

/* Tarjetas de opciones simulador (Redondeado pastel) */
.sim-options-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.25rem;
  margin-bottom: 2rem;
}

.sim-option-card {
  background-color: #ffffff;
  border: 1.5px solid rgba(0, 0, 0, 0.03);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  cursor: pointer;
  transition: all var(--transition-fast);
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.sim-option-card:hover {
  border-color: rgba(0, 0, 0, 0.08);
  background-color: var(--bg-main);
}

.sim-option-card.selected {
  border-color: var(--coral);
  background-color: rgba(250, 177, 160, 0.03);
  box-shadow: var(--shadow-sm);
}

.sim-option-card-title {
  font-family: var(--font-global);
  font-weight: 700;
  font-size: 0.95rem;
  color: #1e272e;
  margin: 0;
}

.sim-option-card-desc {
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.45;
}

/* Checkboxes (Pastel rounded list) */
.sim-check-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-bottom: 2rem;
}

.sim-check-item {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  background-color: var(--bg-main);
  border: 1px solid rgba(0, 0, 0, 0.02);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.sim-check-item:hover {
  background-color: rgba(0,0,0,0.02);
}

.sim-checkbox {
  width: 20px;
  height: 20px;
  accent-color: var(--coral-dark);
  margin-top: 0.15rem;
  flex-shrink: 0;
  cursor: pointer;
}

.sim-check-label-body {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.sim-check-title {
  font-weight: 700;
  font-size: 0.95rem;
  color: #1e272e;
}

.sim-check-desc {
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.4;
}

/* Caja de Resultados del Simulador */
.sim-result-box {
  background-color: rgba(27, 94, 32, 0.02);
  border: 2px dashed rgba(27, 94, 32, 0.2);
  border-radius: var(--radius-lg);
  padding: 2.5rem;
  text-align: center;
  margin-bottom: 2rem;
}

.sim-bpin-display {
  display: inline-block;
  font-family: var(--font-global);
  font-weight: 800;
  font-size: 2.2rem;
  color: var(--mint-dark);
  background-color: var(--mint);
  padding: 0.5rem 1.75rem;
  border-radius: 1.15rem;
  letter-spacing: 0.5px;
  margin: 1.25rem 0;
  border: 1px solid rgba(27, 94, 32, 0.1);
}

.sim-actions {
  display: flex;
  justify-content: flex-end;
  gap: 1rem;
  border-top: 1px solid rgba(0, 0, 0, 0.04);
  padding: 1.5rem 2.5rem;
  background-color: var(--bg-main);
}

.btn-sim-secondary {
  background-color: #ffffff;
  color: var(--text-muted);
  border: 1px solid rgba(0, 0, 0, 0.04);
  font-family: var(--font-global);
  font-weight: 600;
  font-size: 0.85rem;
  padding: 0.6rem 1.35rem;
  border-radius: 0.95rem;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.btn-sim-secondary:hover {
  background-color: var(--bg-main);
  color: #1e272e;
}

.btn-sim-primary {
  background-color: #1e272e;
  color: #ffffff;
  border: none;
  font-family: var(--font-global);
  font-weight: 700;
  font-size: 0.85rem;
  padding: 0.6rem 1.6rem;
  border-radius: 0.95rem;
  cursor: pointer;
  box-shadow: 0 4px 15px rgba(0,0,0,0.06);
  transition: all var(--transition-fast);
}

.btn-sim-primary:hover {
  background-color: var(--text-muted);
  transform: translateY(-1px);
}

.btn-sim-primary:disabled {
  background-color: #e2e8f0;
  color: #a1a1a1;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

/* --- Pestaña Ficha Técnica --- */
.ficha-scroll-container {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.ficha-general-item {
  background-color: rgba(29, 78, 216, 0.02);
  border: 1px solid rgba(29, 78, 216, 0.05);
  border-radius: var(--radius-sm);
  padding: 0.75rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.ficha-general-label {
  font-weight: 800;
  color: #4b5563;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.025em;
}

.ficha-general-value {
  color: #1f2937;
  font-size: 0.85rem;
  line-height: 1.4;
}

.ficha-question-card {
  background-color: #ffffff;
  border-left: 3px solid var(--blue-main);
  border-top: 1px solid rgba(0, 0, 0, 0.03);
  border-right: 1px solid rgba(0, 0, 0, 0.03);
  border-bottom: 1px solid rgba(0, 0, 0, 0.03);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  padding: 0.85rem 1.15rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.01);
  transition: transform var(--transition-fast);
}

.ficha-question-card:hover {
  transform: translateX(2px);
}

.ficha-question-title {
  font-weight: 800;
  color: #374151;
  font-size: 0.8rem;
}

.ficha-question-answer {
  color: #4b5563;
  font-size: 0.85rem;
  line-height: 1.5;
}

/* --- Iframe de KPIs Integrado (DNP-PIIP) --- */
.iframe-premium-wrapper {
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-md);
  background-color: #ffffff;
  height: 680px;
  width: 100%;
  margin-top: 1rem;
  transition: box-shadow var(--transition-normal);
}

.iframe-premium-wrapper:hover {
  box-shadow: var(--shadow-lg);
}

.iframe-premium-wrapper iframe {
  width: 100%;
  height: 100%;
  border: none;
}

/* ==========================================================================
   RESPONSIVIDAD Y AJUSTES MÓVILES
   ========================================================================== */

@media screen and (max-width: 1024px) {
  .ui-timeline::after {
    left: 30px;
  }
  
  .ui-timeline-item {
    width: 100%;
    padding-left: 4.5rem;
    padding-right: 1.5rem;
    text-align: left !important;
  }
  
  .ui-timeline-item.left {
    left: 0;
  }
  
  .ui-timeline-item::after {
    left: 20px !important;
    right: auto !important;
  }
  
  .ui-timeline-item.left .timeline-card-content::before,
  .ui-timeline-item.right .timeline-card-content::before {
    left: -10px !important;
    right: auto !important;
    border-width: 10px 10px 10px 0;
    border-color: transparent var(--bg-card) transparent transparent;
    filter: drop-shadow(-1px 0px 0px rgba(0,0,0,0.01));
  }
  
  .territorio-flex-container {
    flex-direction: column;
  }
  
  .territorio-map-container {
    min-height: 380px;
  }
}

@media screen and (max-width: 768px) {
  .sidebar {
    transform: translateX(-100%);
  }
  
  .sidebar.mobile-open {
    transform: translateX(0);
  }
  
  .main-wrapper {
    margin-left: 0;
    width: 100%;
  }
  
  .app-topbar {
    padding: 1rem 1.5rem;
  }
  
  .menu-toggle {
    display: block;
  }
  
  .topbar-subtitle {
    display: none;
  }
  
  .content-viewport {
    padding: 1.5rem;
  }
  
  .welcome-hero {
    padding: 3rem 1.75rem;
  }
  
  .welcome-hero h1 {
    font-size: 2.1rem;
  }
  
  .sim-viewport {
    padding: 1.5rem;
  }
  
  .sim-actions {
    padding: 1rem 1.5rem;
  }
}

/* ==========================================================================
   AJUSTES FULLSCREEN (100vh SIN SCROLL EXTERNO)
   ========================================================================== */
html, body {
  height: 100vh !important;
  max-height: 100vh !important;
  overflow: hidden !important;
  margin: 0;
  padding: 0;
}

.app-container, .main-wrapper {
  height: 100vh !important;
  max-height: 100vh !important;
  overflow: hidden !important;
}

.content-viewport {
  height: 100% !important;
  max-height: 100% !important;
  overflow: hidden !important;
  padding: 1rem 2rem !important; /* Ligeramente más compacto */
  display: flex !important;
  flex-direction: column !important;
}

.spa-view.active {
  display: flex !important;
  flex-direction: column !important;
  flex-grow: 1;
  height: 100%;
  overflow: hidden;
}

.territorio-grid-layout {
  flex-grow: 1;
  min-height: 0; /* Crucial para que grid respete el alto del contenedor */
  height: 100%;
  overflow: hidden;
}

.territorio-map-column, .territorio-data-column {
  height: 100%;
  overflow: hidden;
}

/* Permitir que la tarjeta premium se ajuste al alto disponible */
.territorio-map-column .card-premium, 
.territorio-data-column .card-premium {
  height: 100% !important;
  min-height: 0 !important;
  display: flex !important;
  flex-direction: column !important;
}

.colombia-map-wrapper {
  flex-grow: 1;
  min-height: 0 !important; /* Eliminar el min-height fijo de 400px del HTML */
  display: flex;
  align-items: center;
  justify-content: center;
}

.colombia-svg-detailed {
  max-height: 100% !important; /* Que no pase de su contenedor */
}

/* ==========================================================================
   CABECERA ESTÁNDAR PARA LABORATORIOS DATAUM (HEADER UNIVERSAL DE MÓDULOS)
   ========================================================================== */
.lab-header-banner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding: 0.55rem 1.15rem;
  min-height: 42px;
  max-height: 42px;
  border: none;
  border-bottom: 1px solid var(--border-color);
  border-radius: 0 !important;
  background: linear-gradient(135deg, #ffffff 0%, #fafbfc 65%, rgba(76, 121, 140, 0.05) 100%);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
  margin: 0 !important;
  position: relative;
  z-index: 10;
  flex-shrink: 0;
}

.lab-header-left {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex: 1;
}

.lab-header-icon-box {
  width: 30px;
  height: 30px;
  border-radius: 6px;
  background: rgba(76, 121, 140, 0.1);
  border: 1px solid rgba(76, 121, 140, 0.22);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: var(--color-primary);
  font-size: 0.9rem;
}

.lab-header-content {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.lab-header-title {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 800;
  color: #1e293b;
  letter-spacing: -0.01em;
}

.lab-header-divider {
  width: 1px;
  height: 14px;
  background-color: var(--border-color);
  display: inline-block;
}

.lab-header-kicker {
  font-size: 0.65rem;
  font-weight: 700;
  color: var(--color-primary);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
}

.lab-header-status {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
}

.lab-status-badge {
  background: #e3f2fd;
  color: #0d47a1;
  border: 1px solid #bbdefb;
  padding: 0.2rem 0.65rem;
  border-radius: 12px;
  font-size: 0.68rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  letter-spacing: 0.02em;
}

.pulse-indicator {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.25);
  display: inline-block;
  animation: pulseGreen 2s infinite ease-in-out;
}

@keyframes pulseGreen {
  0%, 100% {
    box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.25);
  }
  50% {
    box-shadow: 0 0 0 4px rgba(16, 185, 129, 0.08);
  }
}

/* ==========================================================================
   LAYOUT GEOLAB: PÁNELES CUADRICULADOS Y SIN ESPACIOS DE SEPARACIÓN
   ========================================================================== */
#main-layout-container {
  display: flex;
  flex: 1;
  overflow: hidden;
  width: 100%;
  height: calc(100vh - 42px);
  margin: 0;
  padding: 0;
  background-color: #ffffff;
}

/* FRAME IZQUIERDO (ALCANCE, FILTROS Y MAPA) */
#sidebar {
  width: 440px;
  min-width: 440px;
  max-width: 440px;
  background-color: #ffffff;
  border-right: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  z-index: 5;
  height: 100%;
  overflow: hidden;
}

#sidebar-content {
  flex: 1;
  overflow-y: auto;
  padding: 12px 14px;
}

.section-title {
  font-size: 12px;
  font-weight: 800;
  color: var(--color-primary);
  margin: 0 0 10px 0;
  padding-bottom: 5px;
  border-bottom: 2px solid var(--border-color);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.accordion-item {
  margin-bottom: 8px;
  border: 1px solid var(--border-color);
  border-radius: 4px;
  overflow: hidden;
  background: #ffffff;
}

.accordion-item summary {
  font-weight: 700;
  padding: 8px 12px;
  background-color: #f8f9fa;
  cursor: pointer;
  font-size: 11.5px;
  color: var(--color-primary);
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: background-color 0.2s ease;
  user-select: none;
}

.accordion-item summary::-webkit-details-marker {
  display: none;
}

.accordion-item summary:hover {
  background-color: #e9ecef;
}

.accordion-item summary::after {
  content: '▼';
  font-size: 9px;
  color: #6D6E71;
  transition: transform 0.2s ease;
}

.accordion-item[open] > summary {
  background-color: #edf2f5;
  border-bottom: 1px solid var(--border-color);
}

.accordion-item[open] > summary::after {
  transform: rotate(180deg);
}

.accordion-content {
  padding: 10px 12px;
  background-color: #ffffff;
}

#sidebar-footer {
  padding: 9px 14px;
  background-color: var(--bg-main);
  border-top: 1px solid var(--border-color);
  font-size: 10.5px;
  color: var(--text-muted);
  text-align: center;
  font-weight: 600;
}

/* MAPA DE COLOMBIA EN SIDEBAR IZQUIERDO */
#sidebar-map-section {
  margin-top: 8px;
  border: 1px solid var(--border-color);
  border-radius: 4px;
  overflow: hidden;
  background: #ffffff;
  display: flex;
  flex-direction: column;
}

.colombia-map-wrapper {
  width: 100%;
  height: 380px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  padding: 8px;
  background: #ffffff;
}

.colombia-svg-detailed {
  height: 100% !important;
  max-height: 100% !important;
  width: 100% !important;
  max-width: 100% !important;
  fill: #d5e0e8;
  stroke: #ffffff;
  stroke-width: 1.25;
  filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.06));
}

.colombia-svg-detailed path {
  fill: #d5e0e8;
  stroke: #ffffff;
  stroke-width: 1.25;
  cursor: pointer;
  transition: fill 0.15s ease, stroke-width 0.15s ease, filter 0.15s ease;
}

.colombia-svg-detailed path:hover {
  fill: #97b9c7;
  stroke-width: 2;
  filter: drop-shadow(0px 2px 8px rgba(76, 121, 140, 0.3));
}

.colombia-svg-detailed path.selected {
  fill: var(--color-primary) !important;
  stroke: #ffffff !important;
  stroke-width: 2 !important;
  filter: drop-shadow(0px 3px 10px rgba(76, 121, 140, 0.45));
}

#map-footer-hint {
  font-size: 10.5px;
  color: #64748b;
  text-align: center;
  padding: 6px 10px;
  background: #f8f9fa;
  border-top: 1px solid var(--border-color);
  width: 100%;
}

/* FRAME DERECHO (DASHBOARD ANALÍTICO: TABLERO / FICHA / ASISTENTE) */
#right-sidebar {
  flex: 1;
  width: auto;
  min-width: 0;
  max-width: none;
  background-color: #ffffff;
  display: flex;
  flex-direction: column;
  z-index: 5;
  height: 100%;
  overflow: hidden;
}

.stats-card {
  background: #f8f9fa;
  border: 1px solid var(--border-color);
  border-radius: 4px;
  padding: 10px 12px;
}

.stats-title {
  font-size: 12px;
  font-weight: 800;
  color: var(--color-primary);
  margin-top: 0;
  margin-bottom: 8px;
}

.panel-tabs {
  display: flex;
  border-bottom: 1px solid var(--border-color);
  background: #f8f9fa;
  margin: 0;
}

.panel-tab {
  flex: 1;
  padding: 7px 10px;
  border: none;
  background: transparent;
  font-size: 11px;
  font-weight: 700;
  color: #64748b;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  transition: all 0.2s ease;
}

.panel-tab:hover {
  background: #eef2f5;
  color: var(--color-primary);
}

.panel-tab.active {
  color: var(--color-primary) !important;
  border-bottom: 2px solid var(--color-primary) !important;
  font-weight: 800 !important;
  background: #ffffff !important;
}

.tab-content {
  display: none;
  flex-direction: column;
  flex: 1;
  overflow: hidden;
}

.tab-content.active {
  display: flex !important;
}

/* Selector de alcance estilo botones contiguos */
.scope-selector {
  display: flex;
  gap: 3px;
  background: #f1f5f9;
  padding: 3px;
  border-radius: 4px;
  border: 1px solid var(--border-color);
}

.scope-btn {
  flex: 1;
  border: none;
  background: transparent;
  padding: 5px 4px;
  font-size: 11px;
  font-weight: 700;
  border-radius: 3px;
  cursor: pointer;
  color: #64748b;
  transition: all 0.2s ease;
}

.scope-btn.active {
  background: #ffffff !important;
  color: var(--color-primary) !important;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

/* CHAT DENTRO DEL PANEL DERECHO */
.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: #fafbfc;
}

.chat-input-bar {
  padding: 8px 10px;
  border-top: 1px solid var(--border-color);
  background: #ffffff;
  display: flex;
  gap: 6px;
}

.chat-input-bar input {
  flex-grow: 1;
  font-size: 11.5px;
  padding: 6px 10px;
  border: 1px solid var(--border-color);
  border-radius: 4px;
}

.chat-input-bar button {
  padding: 6px 12px;
  border-radius: 4px;
  font-size: 11.5px;
  background: var(--color-primary);
  color: #ffffff;
  border: none;
  cursor: pointer;
}

@media (max-width: 1024px) {
  #main-layout-container {
    flex-direction: column;
    height: auto;
    overflow-y: auto;
  }
  #sidebar, #right-sidebar {
    width: 100%;
    min-width: 100%;
    max-width: 100%;
    height: auto;
  }
  #map-container {
    min-height: 400px;
  }
}

/* Estilos de la Vista Consolidada Global */
#global-report-view {
  background-color: #f8fafc;
}

.global-table-row {
  transition: background-color 0.15s ease;
}

.global-table-row:hover {
  background-color: #f1f5f9 !important;
}

#global-table-search-input:focus {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 2px rgba(76, 121, 140, 0.2);
}

