/**
 * Estilos específicos para impactos.html
 * Layout de mapa + texto similar al capítulo 6 de escenarios_clima.html
 */

/* ============================================================
   CAPITULO 1 - LAYOUT MAPA + TEXTO (60% - 40%)
   ============================================================ */

.impactos-chapter-mapa-texto {
  display: grid;
  grid-template-columns: 60% 40%;
  grid-template-rows: auto 1fr;
  gap: 0.5rem;
  padding: 0.5rem;
  width: 100%;
  height: calc(100vh - 65px) !important;
  min-height: calc(100vh - 65px);
  box-sizing: border-box;
}

.impactos-chapter-mapa-texto .map-title {
  grid-column: 1 / -1;
  grid-row: 1;
  font-size: 1.3rem;
  font-weight: 600;
  color: var(--color-btn-primary);
  margin: 0;
  padding: 0.8rem 1rem;
  background: var(--color-bg-white);
  border-radius: 8px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
  text-align: center;
}

.impactos-chapter-mapa-texto .chapter-map {
  grid-column: 1;
  grid-row: 2;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
  position: relative;
}

.impactos-chapter-mapa-texto .chapter-map .map-container {
  width: 100%;
  height: 100%;
}

.impactos-chapter-mapa-texto .chapter-text {
  grid-column: 2;
  grid-row: 2;
  background: var(--color-bg-white);
  border-radius: 8px;
  padding: 1rem;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
  overflow-y: auto;
}

.impactos-chapter-mapa-texto .chapter-title {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--color-btn-primary);
  margin-bottom: 0.8rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--color-btn-primary);
}

.impactos-chapter-mapa-texto .chapter-content {
  font-size: 0.95rem;
  line-height: 1.6;
  color: var(--color-gray-900);
}

.impactos-chapter-mapa-texto .chapter-content p {
  margin-bottom: 0.8rem;
}

.impactos-chapter-mapa-texto .chapter-content ul {
  list-style: none;
  padding: 0;
  margin: 0.5rem 0;
}

.impactos-chapter-mapa-texto .chapter-content li {
  padding: 0.5rem 0.6rem;
  margin-bottom: 0.4rem;
  background: rgba(162, 26, 92, 0.05);
  border-left: 3px solid var(--color-btn-primary);
  border-radius: 0 4px 4px 0;
  font-size: 0.9rem;
  line-height: 1.4;
}

/* ============================================================
   CONTROLES DE CAPAS
   ============================================================ */

.impactos-chapter-mapa-texto .map-controls {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  background: rgba(255, 255, 255, 0.95);
  border-radius: 6px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
  z-index: 100;
  min-width: 160px;
  font-size: 0.75rem;
}

.impactos-chapter-mapa-texto .map-controls-header {
  padding: 0.4rem 0.6rem;
  background: var(--color-bg-white);
  color: var(--color-gray-900);
  border-radius: 6px 6px 0 0;
  border-bottom: 1px solid var(--color-border-light);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.impactos-chapter-mapa-texto .map-controls-title {
  font-size: 0.75rem;
  font-weight: 600;
}

.impactos-chapter-mapa-texto .map-controls-toggle {
  background: transparent;
  border: none;
  color: var(--color-text-gray);
  cursor: pointer;
  font-size: 0.7rem;
  padding: 0.1rem 0.3rem;
}

.impactos-chapter-mapa-texto .map-controls-content {
  padding: 0.4rem;
}

.impactos-chapter-mapa-texto .map-controls.collapsed .map-controls-content {
  display: none;
}

.impactos-chapter-mapa-texto .layer-control {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.1rem 0;
}

.impactos-chapter-mapa-texto .layer-control input[type="checkbox"] {
  width: 14px;
  height: 14px;
  margin: 0;
}

.impactos-chapter-mapa-texto .layer-control label {
  font-size: 0.75rem;
  cursor: pointer;
  color: var(--color-gray-900);
}

/* Título de grupo de capas */
.impactos-chapter-mapa-texto .layer-group-title {
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--color-data-blue);
  margin: 0.4rem 0 0.2rem 0;
  padding-bottom: 0.15rem;
  border-bottom: 1px solid var(--color-border);
}

.impactos-chapter-mapa-texto .layer-group-title:first-child {
  margin-top: 0;
}

/* ============================================================
   PANEL DE LEYENDAS
   ============================================================ */

.impactos-chapter-mapa-texto .map-legends {
  position: absolute;
  bottom: 0.5rem;
  left: 0.5rem;
  right: auto;
  width: auto;
  max-width: 200px;
  background: rgba(255, 255, 255, 0.95);
  border-radius: 6px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
  z-index: 100;
  font-size: 0.65rem;
  box-sizing: border-box;
  padding: 0.3rem 0.5rem;
}

.impactos-chapter-mapa-texto .map-legends-header {
  padding: 0.3rem 0.5rem;
  background: var(--color-bg-gray);
  border-radius: 6px 6px 0 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.impactos-chapter-mapa-texto .map-legends-title {
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--color-gray-900);
}

.impactos-chapter-mapa-texto .map-legends-toggle {
  background: transparent;
  border: none;
  color: var(--color-text-gray);
  cursor: pointer;
  font-size: 0.7rem;
  padding: 0.1rem 0.3rem;
}

.impactos-chapter-mapa-texto .map-legends-content {
  padding: 0.25rem 0.4rem;
  width: 100%;
  box-sizing: border-box;
}

.impactos-chapter-mapa-texto .map-legends.collapsed .map-legends-content {
  display: none;
}

.impactos-chapter-mapa-texto .legend-item {
  margin: 0;
  width: 100%;
}

.impactos-chapter-mapa-texto .legend-item-title {
  font-size: 0.6rem;
  font-weight: 600;
  color: var(--color-gray-900);
  margin-bottom: 0.25rem;
}

.impactos-chapter-mapa-texto .legend-item-image {
  max-width: 100%;
  height: auto;
}

.impactos-chapter-mapa-texto .legend-categoria {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.15rem 0;
}

.impactos-chapter-mapa-texto .legend-simbolo {
  width: 14px;
  height: 14px;
  border-radius: 2px;
  flex-shrink: 0;
}

.impactos-chapter-mapa-texto .legend-label {
  font-size: 0.7rem;
  color: var(--color-gray-900);
}

.impactos-chapter-mapa-texto .map-legends-empty {
  font-size: 0.65rem;
  color: var(--color-gray-600);
  text-align: center;
  padding: 0.3rem;
}

/* Símbolos de línea para leyendas */
.legend-simbolo.legend-line {
  width: 20px;
  height: 3px;
  border-radius: 1px;
}

/* Símbolos de punto para leyendas */
.legend-simbolo.legend-point {
  width: 12px;
  height: 12px;
  border-radius: 50%;
}

/* ============================================================
   CAPITULO 3 - ESTILOS DE CONTROLES Y LEYENDAS
   ============================================================ */

.chapter-estrategias .map-controls {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  background: rgba(255, 255, 255, 0.95);
  border-radius: 6px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
  z-index: 100;
  max-width: 220px;
  font-size: 0.75rem;
}

.chapter-estrategias .map-controls-header {
  padding: 0.4rem 0.6rem;
  background: white;
  color: var(--color-gray-900);
  border-radius: 6px 6px 0 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--color-border-light);
}

.chapter-estrategias .map-controls-title {
  font-size: 0.75rem;
  font-weight: 600;
}

.chapter-estrategias .map-controls-toggle {
  background: transparent;
  border: none;
  color: var(--color-gray-900);
  cursor: pointer;
  font-size: 0.7rem;
  padding: 0.1rem 0.3rem;
}

.chapter-estrategias .map-controls-content {
  padding: 0.4rem;
  max-height: 300px;
  overflow-y: auto;
}

.chapter-estrategias .map-controls.collapsed .map-controls-content {
  display: none;
}

.chapter-estrategias .layer-control {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.25rem 0;
  font-size: 0.75rem;
}

.chapter-estrategias .layer-control input[type="checkbox"] {
  width: 14px;
  height: 14px;
  cursor: pointer;
}

.chapter-estrategias .layer-control label {
  cursor: pointer;
  color: var(--color-gray-900);
}

.chapter-estrategias .map-legends {
  position: absolute;
  bottom: 0.5rem;
  right: 0.5rem;
  background: rgba(255, 255, 255, 0.95);
  border-radius: 6px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
  z-index: 100;
  max-width: 200px;
  font-size: 0.7rem;
}

.chapter-estrategias .map-legends-header {
  padding: 0.3rem 0.5rem;
  background: white;
  color: var(--color-gray-900);
  border-radius: 6px 6px 0 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--color-border-light);
}

.chapter-estrategias .map-legends-title {
  font-size: 0.7rem;
  font-weight: 600;
}

.chapter-estrategias .map-legends-toggle {
  background: transparent;
  border: none;
  color: var(--color-gray-900);
  cursor: pointer;
  font-size: 0.65rem;
  padding: 0.1rem 0.2rem;
}

.chapter-estrategias .map-legends-content {
  padding: 0.3rem 0.4rem;
  max-height: 250px;
  overflow-y: auto;
}

.chapter-estrategias .map-legends.collapsed .map-legends-content {
  display: none;
}

.chapter-estrategias .legend-item {
  margin-bottom: 0.4rem;
}

.chapter-estrategias .legend-item-title {
  font-size: 0.65rem;
  font-weight: 600;
  color: var(--color-gray-900);
  margin-bottom: 0.2rem;
}

.chapter-estrategias .legend-simbologia {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.chapter-estrategias .legend-categoria {
  display: flex;
  align-items: center;
  gap: 0.3rem;
}

.chapter-estrategias .legend-simbolo {
  width: 14px;
  height: 14px;
  border-radius: 2px;
  flex-shrink: 0;
}

.chapter-estrategias .legend-label {
  font-size: 0.65rem;
  color: var(--color-gray-900);
}

.chapter-estrategias .map-legends-empty {
  font-size: 0.6rem;
  color: var(--color-gray-600);
  text-align: center;
  padding: 0.3rem;
}

/* ============================================================
   CAPITULO 4 - HIDROLOGÍA 2 ESTILOS
   ============================================================ */

.chapter-estrategias .hidrologia-subtitulo {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--color-btn-primary);
  margin: 0.8rem 0 0.4rem 0;
  padding-bottom: 0.2rem;
  border-bottom: 1px solid var(--color-header-bg);
}

.chapter-estrategias .chart-hidrologia-container {
  width: 100%;
  height: 180px;
  margin: 0.8rem 0;
  position: relative;
}

.chapter-estrategias .chart-hidrologia-container.chart-lineas {
  height: 200px;
  border-radius: 8px;
  padding: 0.5rem;
}

.chapter-estrategias .chart-hidrologia-container.chart-barras {
  height: 280px;
  border-radius: 8px;
  padding: 0.5rem;
  background: white;
  margin: 0.5rem 0;
}


.chapter-estrategias .acuiferos-titulo {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--color-gray-900);
  margin: 0.5rem 0 0.3rem 0;
}

.chapter-estrategias .acuiferos-container {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 0.8rem;
}

.chapter-estrategias .acuiferos-lista {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.3rem 1rem;
  flex: 1;
}

.chapter-estrategias .acuiferos-container .gotas-img {
  width: 100px;
  height: auto;
  flex-shrink: 0;
}

.chapter-estrategias .acuiferos-lista li {
  font-size: 0.8rem;
  padding: 0.2rem 0;
}

.chapter-estrategias .acuifero-nombre {
  font-weight: 500;
}

.chapter-estrategias .acuifero-nombre.alto-atoyac {
  color: #1068cb;
}

.chapter-estrategias .acuifero-nombre.soltepec {
  color: #4caf50;
}

.chapter-estrategias .acuifero-nombre.huamantla {
  color: #ff9800;
}

.chapter-estrategias .acuifero-nombre.emiliano-zapata {
  color: #e2484a;
}

.chapter-estrategias .deficit-texto {
  font-size: 0.85rem;
  background: #fff3e0;
  padding: 0.5rem 0.8rem;
  border-radius: 6px;
  border-left: 3px solid #ff9800;
  margin: 0.8rem 0;
}

/* ============================================================
   BOTON SPLIT PARA COMPARAR
   ============================================================ */

.impactos-split-btn {
  position: absolute;
  bottom: 0.5rem;
  right: 0.5rem;
  background: rgba(255, 255, 255, 0.95);
  border: 2px solid var(--color-btn-primary);
  border-radius: 6px;
  padding: 0.3rem 0.5rem;
  cursor: pointer;
  z-index: 100;
  display: flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--color-btn-primary);
  transition: all 0.2s ease;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}

.impactos-split-btn:hover {
  background: var(--color-btn-primary);
  color: var(--color-bg-white);
  transform: translateY(-1px);
  box-shadow: 0 3px 8px rgba(162, 26, 92, 0.3);
}

.impactos-split-btn.active {
  background: var(--color-btn-primary);
  color: var(--color-bg-white);
}

.impactos-split-btn .split-icon {
  font-size: 0.85rem;
}

/* Barra de Split Vertical */
.impactos-split-bar {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 4px;
  background: var(--color-bg-white);
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
  cursor: ew-resize;
  z-index: 150;
  user-select: none;
}

.impactos-split-bar::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 24px;
  height: 40px;
  background: var(--color-bg-white);
  border-radius: 20px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.impactos-split-bar::after {
  content: "⇄";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: var(--color-btn-primary);
  font-size: 1rem;
  font-weight: bold;
}

/* Etiquetas de capas en modo Split */
.impactos-split-label {
  position: absolute;
  bottom: 2.5rem;
  padding: 0.3rem 0.6rem;
  background: rgba(0, 0, 0, 0.75);
  color: var(--color-bg-white);
  font-size: 0.65rem;
  font-weight: 600;
  border-radius: 4px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
  z-index: 140;
  pointer-events: none;
  max-width: 120px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.impactos-split-label-left {
  left: 0.5rem;
}

.impactos-split-label-right {
  right: 0.5rem;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */

@media (max-width: 992px) {
  .impactos-chapter-mapa-texto {
    grid-template-columns: 1fr;
    grid-template-rows: auto auto 1fr;
  }

  .impactos-chapter-mapa-texto .chapter-map {
    grid-column: 1;
    grid-row: 2;
    min-height: 300px;
  }

  .impactos-chapter-mapa-texto .chapter-text {
    grid-column: 1;
    grid-row: 3;
    max-height: 200px;
  }
}

@media (max-width: 768px) {
  .impactos-chapter-mapa-texto .map-title {
    font-size: 1.1rem;
    padding: 0.6rem 0.8rem;
  }

  .impactos-chapter-mapa-texto .chapter-text {
    max-height: 180px;
    padding: 0.8rem;
  }

  .impactos-chapter-mapa-texto .chapter-title {
    font-size: 1rem;
  }
}

/* ============================================================
   TOOLTIP HOVER MUNICIPIOS
   ============================================================ */

.municipio-hover-tooltip {
  position: absolute;
  background: rgba(0, 0, 0, 0.8);
  color: var(--color-bg-white);
  padding: 0.4rem 0.6rem;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 500;
  pointer-events: none;
  z-index: 200;
  white-space: nowrap;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

/* ============================================================
   TABLA 86 - SUPERFICIE AGRICOLA INTERACTIVA
   ============================================================ */

.tabla-agricola-container {
  margin-top: 1rem;
  padding-top: 0.8rem;
  border-top: 1px solid var(--color-border-light);
}

.tabla-titulo {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--color-btn-primary);
  margin: 0 0 0.6rem 0;
  text-align: center;
}

.tabla-scroll {
  overflow-x: auto;
  border-radius: 6px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.tabla-agricola {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.75rem;
  min-width: 400px;
}

.tabla-agricola thead {
  background: linear-gradient(135deg, var(--color-btn-primary-hover) 0%, var(--color-btn-primary) 100%);
}

.tabla-agricola thead th {
  color: var(--color-bg-white);
  padding: 0.6rem 0.5rem;
  text-align: center;
  font-weight: 600;
  font-size: 0.7rem;
  line-height: 1.3;
  border: none;
}

.tabla-agricola thead th .th-subtitle {
  font-weight: 400;
  font-size: 0.65rem;
  opacity: 0.9;
  display: block;
}

.tabla-agricola tbody tr {
  transition: background 0.2s ease;
  cursor: pointer;
  border-bottom: 1px solid var(--color-border-light);
}

.tabla-agricola tbody tr:hover {
  background: rgba(162, 26, 92, 0.08);
}

.tabla-agricola tbody tr.active {
  background: rgba(162, 26, 92, 0.15);
}

.tabla-agricola tbody tr.active td:first-child {
  border-left: 3px solid var(--color-btn-primary);
}

.tabla-agricola tbody td {
  padding: 0.5rem 0.4rem;
  text-align: left;
  color: var(--color-gray-900);
  font-size: 0.72rem;
}

.tabla-agricola tbody td.num {
  text-align: right;
  font-family: 'Segoe UI', monospace;
  font-variant-numeric: tabular-nums;
}

.tabla-agricola tbody tr.fila-total {
  background: rgba(162, 26, 92, 0.05);
  border-top: 2px solid var(--color-btn-primary);
}

.tabla-agricola tbody tr.fila-total:hover {
  background: rgba(162, 26, 92, 0.12);
}

.tabla-agricola tbody tr.fila-total td {
  font-weight: 600;
  color: var(--color-btn-primary);
}

/* Efecto de resaltado al hacer clic */
.tabla-agricola tbody tr.highlight {
  animation: highlightRow 0.5s ease;
}

@keyframes highlightRow {
  0% {
    background: rgba(162, 26, 92, 0.3);
  }
  100% {
    background: rgba(162, 26, 92, 0.08);
  }
}

/* Tooltip en celdas */
.tabla-agricola td[data-tooltip] {
  position: relative;
}

.tabla-agricola td[data-tooltip]::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0, 0, 0, 0.85);
  color: var(--color-bg-white);
  padding: 0.3rem 0.5rem;
  border-radius: 4px;
  font-size: 0.65rem;
  white-space: nowrap;
  opacity: 0;
  visibility: hidden;
  transition: all 0.2s ease;
  z-index: 10;
}

.tabla-agricola td[data-tooltip]:hover::after {
  opacity: 1;
  visibility: visible;
  bottom: calc(100% + 5px);
}

.tabla-fuente {
  font-size: 0.7rem;
  color: var(--color-text-gray);
  margin: 0.5rem 0 0 0;
  text-align: center;
}

.tabla-fuente em {
  color: var(--color-gray-800);
}


/* Responsive */
@media (max-width: 768px) {
  .tabla-agricola {
    font-size: 0.7rem;
  }

  .tabla-agricola thead th {
    padding: 0.5rem 0.3rem;
    font-size: 0.65rem;
  }

  .tabla-agricola tbody td {
    padding: 0.4rem 0.3rem;
    font-size: 0.68rem;
  }

  .tabla-titulo {
    font-size: 0.8rem;
  }
}

/* Indicadores de ordenamiento */
.tabla-agricola thead th.sorted-asc::after {
  content: ' ▲';
  font-size: 0.6rem;
  opacity: 0.8;
}

.tabla-agricola thead th.sorted-desc::after {
  content: ' ▼';
  font-size: 0.6rem;
  opacity: 0.8;
}

.tabla-agricola thead th:not(:first-child):hover {
  background: rgba(255, 255, 255, 0.1);
}

/* ============================================================
   CAPITULO 2 - LAYOUT TEXTO (20%) + TABLA (80%)
   Similar al capítulo 1 de clima.html
   ============================================================ */

.chapter-impactos-tabla {
  display: grid;
  grid-template-columns: 1fr;
  grid-template-rows: auto 1fr;
  gap: 0.5rem;
  height: calc(100vh - 65px);
  padding: 0.5rem;
  box-sizing: border-box;
}

.chapter-impactos-tabla .map-title {
  grid-column: 1 / -1;
  grid-row: 1;
  font-size: 1.3rem;
  font-weight: 600;
  color: var(--color-btn-primary);
  margin: 0;
  padding: 0.8rem 1rem;
  background: var(--color-bg-white);
  border-radius: 8px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
  text-align: center;
}

.impactos-content {
  grid-column: 1 / -1;
  grid-row: 2;
  display: grid;
  grid-template-columns: 20% 1fr;
  gap: 0.5rem;
  height: 100%;
  min-height: 0;
  overflow: hidden;
}

/* Card de texto (izquierda) */
.impactos-text-card {
  background: var(--color-bg-white);
  border-radius: 8px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
  padding: 0.8rem;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
}

.impactos-text-card .card-title {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--color-btn-primary);
  margin-bottom: 0.5rem;
  padding-bottom: 0.3rem;
  border-bottom: 2px solid var(--color-btn-primary);
}

.impactos-text-card .card-content {
  font-size: 0.95rem;
  line-height: 1.5;
  color: var(--color-gray-900);
  flex: 1;
}

.impactos-text-card .card-content p {
  margin-bottom: 0.5rem;
}

.impactos-text-card .cultivos-lista {
  list-style: none;
  padding: 0;
  margin: 0.5rem 0;
}

.impactos-text-card .cultivos-lista li {
  padding: 0.3rem 0.5rem;
  margin-bottom: 0.3rem;
  background: rgba(162, 26, 92, 0.05);
  border-left: 3px solid var(--color-btn-primary);
  border-radius: 0 4px 4px 0;
  font-size: 0.9rem;
  line-height: 1.4;
}

/* Estadísticas destacadas */
.impactos-stats {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.8rem;
  padding-top: 0.5rem;
  border-top: 1px solid var(--color-border-light);
}

.impactos-stats .stat-item {
  flex: 1;
  text-align: center;
  padding: 0.5rem;
  background: rgba(162, 26, 92, 0.08);
  border-radius: 6px;
}

.impactos-stats .stat-value {
  display: block;
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--color-btn-primary);
}

.impactos-stats .stat-label {
  display: block;
  font-size: 0.65rem;
  color: var(--color-text-gray);
  margin-top: 0.2rem;
}

/* Card de tabla (derecha) */
.impactos-tabla-card {
  background: var(--color-bg-white);
  border-radius: 8px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  height: 100%;
  min-height: 0;
}

.impactos-tabla-card .tabla-header {
  padding: 0.6rem 1rem;
  background: linear-gradient(135deg, var(--color-btn-primary-hover) 0%, var(--color-btn-primary) 100%);
  flex-shrink: 0;
}

.impactos-tabla-card .tabla-titulo-grande {
  font-size: 1rem;
  font-weight: 600;
  color: var(--color-bg-white);
  margin: 0;
  text-align: center;
}

.tabla-scroll-grande {
  flex: 1;
  overflow: auto;
  padding: 0.5rem;
}

/* Tabla 89 - Siniestros */
.tabla-siniestros {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.tabla-siniestros thead {
  background: var(--color-bg-gray);
  position: sticky;
  top: 0;
  z-index: 10;
}

.tabla-siniestros thead th {
  padding: 0.6rem 0.5rem;
  text-align: center;
  font-weight: 600;
  font-size: 0.85rem;
  color: var(--color-gray-900);
  border-bottom: 2px solid var(--color-btn-primary);
  cursor: pointer;
}

.tabla-siniestros thead th:hover {
  background: var(--color-border-light);
}

.tabla-siniestros thead th:first-child {
  cursor: default;
}

.tabla-siniestros thead th:first-child:hover {
  background: var(--color-bg-gray);
}

.tabla-siniestros tbody tr {
  transition: background 0.2s ease;
  cursor: pointer;
  border-bottom: 1px solid var(--color-border-light);
}

.tabla-siniestros tbody tr:hover {
  background: rgba(162, 26, 92, 0.08);
}

.tabla-siniestros tbody tr.active {
  background: rgba(162, 26, 92, 0.15);
}

.tabla-siniestros tbody tr.active td:first-child {
  border-left: 3px solid var(--color-btn-primary);
}

.tabla-siniestros tbody td {
  padding: 0.5rem 0.4rem;
  text-align: center;
  color: var(--color-gray-900);
  font-size: 0.85rem;
}

.tabla-siniestros tbody td.num {
  text-align: center;
  font-family: 'Segoe UI', monospace;
  font-variant-numeric: tabular-nums;
}

.tabla-siniestros tbody td.col-total {
  font-weight: 600;
  background: rgba(162, 26, 92, 0.05);
}

/* Fila crítica (2011 - mayor siniestro) */
.tabla-siniestros tbody tr.fila-critica {
  background: rgba(220, 53, 69, 0.1);
}

.tabla-siniestros tbody tr.fila-critica:hover {
  background: rgba(220, 53, 69, 0.18);
}

.tabla-siniestros tbody tr.fila-critica td {
  color: var(--color-error-dark);
  font-weight: 500;
}

/* Fila destacada (2014 - segundo mayor) */
.tabla-siniestros tbody tr.fila-destacada {
  background: rgba(255, 152, 0, 0.1);
}

.tabla-siniestros tbody tr.fila-destacada:hover {
  background: rgba(255, 152, 0, 0.18);
}

/* Footer de la tabla */
.tabla-siniestros tfoot {
  background: rgba(162, 26, 92, 0.08);
}

.tabla-siniestros tfoot tr.fila-total td {
  padding: 0.6rem 0.4rem;
  font-weight: 600;
  color: var(--color-btn-primary);
  border-top: 2px solid var(--color-btn-primary);
  text-align: center;
  font-size: 0.85rem;
}

.tabla-fuente-grande {
  font-size: 0.7rem;
  color: var(--color-text-gray);
  margin: 0;
  padding: 0.5rem 1rem;
  background: var(--color-gray-100);
  border-top: 1px solid var(--color-border-light);
}

/* Indicadores de ordenamiento */
.tabla-siniestros thead th.sorted-asc::after {
  content: ' ▲';
  font-size: 0.6rem;
  opacity: 0.7;
}

.tabla-siniestros thead th.sorted-desc::after {
  content: ' ▼';
  font-size: 0.6rem;
  opacity: 0.7;
}

/* Efecto de resaltado */
.tabla-siniestros tbody tr.highlight {
  animation: highlightRow 0.5s ease;
}

/* Responsive capítulo 2 */
@media (max-width: 1200px) {
  .impactos-content {
    grid-template-columns: 25% 1fr;
  }
}

@media (max-width: 992px) {
  .chapter-impactos-tabla {
    grid-template-rows: auto auto 1fr;
  }

  .impactos-content {
    grid-template-columns: 1fr;
    grid-template-rows: auto 1fr;
  }

  .impactos-text-card {
    max-height: 200px;
    height: auto;
  }

  .impactos-tabla-card {
    height: auto;
    min-height: 300px;
  }
}

@media (max-width: 768px) {
  .chapter-impactos-tabla .map-title {
    font-size: 1.1rem;
    padding: 0.6rem 0.8rem;
  }

  .impactos-text-card {
    max-height: 180px;
    padding: 0.6rem;
  }

  .impactos-text-card .card-title {
    font-size: 1rem;
  }

  .tabla-siniestros {
    font-size: 0.8rem;
  }

  .tabla-siniestros thead th,
  .tabla-siniestros tbody td {
    padding: 0.4rem 0.3rem;
    font-size: 0.75rem;
  }
}

/* ============================================================
   CAPITULO 3 - ESTRATEGIAS DE ADAPTACIÓN (Layout texto + cards)
   ============================================================ */

.chapter-estrategias {
  display: grid;
  grid-template-columns: 30% 70%;
  grid-template-rows: auto 1fr;
  gap: 1rem;
  padding: 1rem;
  height: calc(100vh - 65px);
  box-sizing: border-box;
}

.chapter-estrategias .map-title {
  grid-column: 1 / -1;
  grid-row: 1;
  font-size: 1.3rem;
  font-weight: 600;
  color: var(--color-btn-primary);
  margin: 0;
  padding: 0.8rem 1rem;
  background: var(--color-bg-white);
  border-radius: 8px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
  text-align: center;
}

.chapter-estrategias .chapter-text {
  grid-column: 1;
  grid-row: 2;
  background: var(--color-bg-white);
  border-radius: 8px;
  padding: 1rem;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
  overflow-y: auto;
}

.chapter-estrategias .chapter-title {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--color-btn-primary);
  margin-bottom: 0.8rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--color-btn-primary);
}

.chapter-estrategias .chapter-content {
  font-size: 0.95rem;
  line-height: 1.6;
  color: var(--color-gray-900);
}

.chapter-estrategias .chapter-content p {
  margin-bottom: 0.8rem;
}

/* Mapa del capítulo 3 */
.chapter-estrategias .chapter-map {
  grid-column: 2;
  grid-row: 2;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
  position: relative;
}

.chapter-estrategias .chapter-map .map-container {
  width: 100%;
  height: 100%;
}

/* Títulos de estrategias dentro de la card de texto */
.chapter-estrategias .estrategia-titulo {
  font-size: 1rem;
  font-weight: 600;
  color: var(--color-btn-primary);
  margin: 1rem 0 0.5rem 0;
  padding-bottom: 0.3rem;
  border-bottom: 1px solid var(--color-header-bg);
}

/* Lista de estrategias */
.chapter-estrategias .estrategia-lista {
  list-style: none;
  padding: 0;
  margin: 0 0 0.5rem 0;
}

.chapter-estrategias .estrategia-lista li {
  padding: 0.3rem 0 0.3rem 1.5rem;
  margin-bottom: 0.2rem;
  font-size: 0.85rem;
  line-height: 1.4;
  position: relative;
}

.chapter-estrategias .estrategia-lista li::before {
  content: "✓";
  position: absolute;
  left: 0;
  color: var(--color-btn-primary);
  font-weight: bold;
  font-size: 0.9rem;
}

/* Card de estrategia individual */
.estrategia-card {
  background: var(--color-bg-white);
  border-radius: 12px;
  padding: 1rem;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
  border: 1px solid var(--color-border-light);
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  overflow: hidden;
}

.estrategia-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.12);
}

.estrategia-card-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--color-btn-primary);
}

.estrategia-icon {
  font-size: 1.8rem;
  flex-shrink: 0;
  width: 45px;
  height: 45px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
}

.estrategia-icon.agua {
  background: linear-gradient(135deg, var(--color-strategy-blue-light) 0%, var(--color-strategy-blue) 100%);
}

.estrategia-icon.sostenible {
  background: linear-gradient(135deg, var(--color-strategy-green-light) 0%, var(--color-strategy-green) 100%);
}

.estrategia-icon.tecnologia {
  background: linear-gradient(135deg, var(--color-strategy-orange-light) 0%, var(--color-strategy-orange) 100%);
}

.estrategia-icon.territorio {
  background: linear-gradient(135deg, var(--color-strategy-pink-light) 0%, var(--color-strategy-pink) 100%);
}

.estrategia-card-header h4 {
  margin: 0;
  color: var(--color-btn-primary);
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.3;
}

/* Lista de acciones dentro de cada card */
.estrategia-acciones {
  list-style: none;
  padding: 0;
  margin: 0;
  flex: 1;
  overflow-y: auto;
}

.estrategia-acciones li {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  padding: 0.4rem 0;
  font-size: 0.9rem;
  color: var(--color-gray-900);
  line-height: 1.4;
  border-bottom: 1px solid var(--color-bg-gray);
}

.estrategia-acciones li:last-child {
  border-bottom: none;
}

.estrategia-acciones li::before {
  content: "✓";
  color: var(--color-btn-primary);
  font-weight: bold;
  flex-shrink: 0;
  margin-top: 0.1rem;
}

/* Responsive capítulo 3 */
@media (max-width: 1024px) {
  .chapter-estrategias {
    grid-template-columns: 1fr;
    grid-template-rows: auto auto auto;
  }

  .chapter-estrategias .chapter-text {
    grid-column: 1;
    grid-row: 2;
    max-height: 150px;
  }

  .chapter-estrategias .estrategias-grid {
    grid-column: 1;
    grid-row: 3;
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 640px) {
  .chapter-estrategias .estrategias-grid {
    grid-template-columns: 1fr;
    grid-template-rows: auto;
  }

  .estrategia-card {
    max-height: 200px;
  }
}

/* ============================================================
   CAPITULO 4 - INCENDIOS FORESTALES (Layout texto 30% + gráfica 70%)
   Similar al capítulo 4 de amenazas.html (sequía)
   ============================================================ */

.chapter-incendios {
  display: grid;
  grid-template-columns: 30% 70%;
  grid-template-rows: auto 1fr;
  gap: 0.5rem;
  padding: 1rem;
  height: calc(100vh - 65px);
  box-sizing: border-box;
}

.chapter-incendios .map-title {
  grid-column: 1 / -1;
  grid-row: 1;
  font-size: 1.3rem;
  font-weight: 600;
  color: var(--color-btn-primary);
  margin: 0;
  padding: 0.8rem 1rem;
  background: var(--color-bg-white);
  border-radius: 8px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
  text-align: center;
}

.chapter-incendios .chapter-text {
  grid-column: 1;
  grid-row: 2;
  background: var(--color-bg-white);
  border-radius: 8px;
  padding: 1rem;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
  overflow-y: auto;
}

.chapter-incendios .chapter-title {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--color-btn-primary);
  margin-bottom: 0.8rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--color-btn-primary);
}

.chapter-incendios .chapter-content {
  font-size: 0.95rem;
  line-height: 1.6;
  color: var(--color-gray-900);
}

.chapter-incendios .chapter-content p {
  margin-bottom: 0.8rem;
}

.chapter-incendios .chapter-chart-full {
  grid-column: 2;
  grid-row: 2;
  background: var(--color-bg-white);
  border-radius: 8px;
  padding: 1rem;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.chapter-incendios .chapter-chart-full .chart-title {
  flex-shrink: 0;
  margin-bottom: 0.5rem;
  font-size: 1rem;
  font-weight: 600;
  color: var(--color-btn-primary);
  text-align: center;
}

.chapter-incendios .chapter-chart-full .chart-container {
  flex: 1;
  width: 100% !important;
  max-width: none !important;
  max-height: none !important;
  min-height: 0;
  position: relative;
}

.chapter-incendios .chapter-chart-full canvas {
  width: 100% !important;
  height: 100% !important;
}

/* Estadísticas destacadas para incendios */
.incendios-stats {
  display: flex;
  gap: 0.5rem;
  margin-top: 1rem;
  padding-top: 0.8rem;
  border-top: 1px solid var(--color-border-light);
}

.incendios-stats .stat-item {
  flex: 1;
  text-align: center;
  padding: 0.5rem;
  background: rgba(255, 152, 0, 0.1);
  border-radius: 6px;
  border-left: 3px solid var(--color-warning-orange);
}

.incendios-stats .stat-value {
  display: block;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--color-warning-orange-dark);
}

.incendios-stats .stat-label {
  display: block;
  font-size: 0.65rem;
  color: var(--color-text-gray);
  margin-top: 0.2rem;
}

/* ============================================================
   CAPITULO 6 - INCENDIOS FORESTALES CON MAPA
   Layout: texto (30%) + mapa arriba (70%) + gráfica abajo (70%)
   ============================================================ */

.chapter-incendios-mapa {
  display: grid;
  grid-template-columns: 30% 70%;
  grid-template-rows: auto 1fr 1fr;
  gap: 0.5rem;
  padding: 0.5rem;
  height: calc(100vh - 65px);
  box-sizing: border-box;
}

.chapter-incendios-mapa .map-title {
  grid-column: 1 / -1;
  grid-row: 1;
  font-size: 1.3rem;
  font-weight: 600;
  color: var(--color-btn-primary);
  margin: 0;
  padding: 0.8rem 1rem;
  background: var(--color-bg-white);
  border-radius: 8px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
  text-align: center;
}

.chapter-incendios-mapa .incendios-text {
  grid-column: 1;
  grid-row: 2 / 4;
  background: var(--color-bg-white);
  border-radius: 8px;
  padding: 1rem;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
  overflow-y: auto;
}

.chapter-incendios-mapa .chapter-title {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--color-btn-primary);
  margin-bottom: 0.8rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--color-btn-primary);
}

.chapter-incendios-mapa .chapter-content {
  font-size: 0.95rem;
  line-height: 1.6;
  color: var(--color-gray-900);
}

.chapter-incendios-mapa .chapter-content p {
  margin-bottom: 0.8rem;
}

.chapter-incendios-mapa .incendios-map {
  grid-column: 2;
  grid-row: 2;
  background: var(--color-bg-white);
  border-radius: 8px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
  overflow: hidden;
  position: relative;
}

.chapter-incendios-mapa .incendios-map .map-container {
  width: 100%;
  height: 100%;
}

.chapter-incendios-mapa .incendios-chart {
  grid-column: 2;
  grid-row: 3;
  background: var(--color-bg-white);
  border-radius: 8px;
  padding: 0.5rem;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.chapter-incendios-mapa .incendios-chart .chart-title {
  flex-shrink: 0;
  margin-bottom: 0.5rem;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--color-btn-primary);
  text-align: center;
}

.chapter-incendios-mapa .incendios-chart .chart-container {
  flex: 1;
  width: 100% !important;
  max-width: none !important;
  min-height: 0;
  position: relative;
}

.chapter-incendios-mapa .incendios-chart canvas {
  width: 100% !important;
  height: 100% !important;
  max-width: none !important;
}

/* Estadísticas de incendios */
.chapter-incendios-mapa .incendios-stats {
  display: flex;
  gap: 0.5rem;
  margin-top: 1rem;
  padding-top: 0.8rem;
  border-top: 1px solid var(--color-border-light);
}

.chapter-incendios-mapa .incendios-stats .stat-item {
  flex: 1;
  text-align: center;
  padding: 0.5rem;
  background: rgba(255, 152, 0, 0.1);
  border-radius: 6px;
  border-left: 3px solid var(--color-warning-orange);
}

.chapter-incendios-mapa .incendios-stats .stat-value {
  display: block;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--color-warning-orange-dark);
}

.chapter-incendios-mapa .incendios-stats .stat-label {
  display: block;
  font-size: 0.65rem;
  color: var(--color-text-gray);
  margin-top: 0.2rem;
}

/* Controles de capas para mapa 6 */
.chapter-incendios-mapa .map-controls {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  background: rgba(255, 255, 255, 0.95);
  border-radius: 6px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
  z-index: 100;
  max-width: 200px;
  font-size: 0.75rem;
}

.chapter-incendios-mapa .map-controls-header {
  padding: 0.4rem 0.6rem;
  background: white;
  color: var(--color-gray-900);
  border-radius: 6px 6px 0 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--color-border-light);
}

.chapter-incendios-mapa .map-controls-title {
  font-size: 0.75rem;
  font-weight: 600;
}

.chapter-incendios-mapa .map-controls-toggle {
  background: transparent;
  border: none;
  color: var(--color-gray-900);
  cursor: pointer;
  font-size: 0.7rem;
  padding: 0.1rem 0.3rem;
}

.chapter-incendios-mapa .map-controls-content {
  padding: 0.4rem;
  max-height: 200px;
  overflow-y: auto;
}

.chapter-incendios-mapa .map-controls.collapsed .map-controls-content {
  display: none;
}

.chapter-incendios-mapa .layer-control {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.25rem 0;
  font-size: 0.75rem;
}

.chapter-incendios-mapa .layer-control input[type="checkbox"] {
  width: 14px;
  height: 14px;
  cursor: pointer;
}

.chapter-incendios-mapa .layer-control label {
  cursor: pointer;
  color: var(--color-gray-900);
}

/* Panel de leyendas para mapa 6 */
.chapter-incendios-mapa .map-legends {
  position: absolute;
  bottom: 0.5rem;
  right: 0.5rem;
  background: rgba(255, 255, 255, 0.95);
  border-radius: 6px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
  z-index: 100;
  max-width: 180px;
  font-size: 0.7rem;
}

.chapter-incendios-mapa .map-legends-header {
  padding: 0.3rem 0.5rem;
  background: white;
  color: var(--color-gray-900);
  border-radius: 6px 6px 0 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--color-border-light);
}

.chapter-incendios-mapa .map-legends-title {
  font-size: 0.7rem;
  font-weight: 600;
}

.chapter-incendios-mapa .map-legends-toggle {
  background: transparent;
  border: none;
  color: var(--color-gray-900);
  cursor: pointer;
  font-size: 0.65rem;
  padding: 0.1rem 0.2rem;
}

.chapter-incendios-mapa .map-legends-content {
  padding: 0.3rem 0.4rem;
  max-height: 150px;
  overflow-y: auto;
}

.chapter-incendios-mapa .map-legends.collapsed .map-legends-content {
  display: none;
}

.chapter-incendios-mapa .map-legends-empty {
  font-size: 0.6rem;
  color: var(--color-gray-600);
  text-align: center;
  padding: 0.3rem;
}

/* Responsive capítulo 6 con mapa */
@media (max-width: 1024px) {
  .chapter-incendios-mapa {
    grid-template-columns: 1fr;
    grid-template-rows: auto auto auto auto;
  }

  .chapter-incendios-mapa .incendios-text {
    grid-column: 1;
    grid-row: 2;
    max-height: 180px;
  }

  .chapter-incendios-mapa .incendios-map {
    grid-column: 1;
    grid-row: 3;
    min-height: 250px;
  }

  .chapter-incendios-mapa .incendios-chart {
    grid-column: 1;
    grid-row: 4;
    min-height: 250px;
  }
}

/* Responsive capítulo 4 */
@media (max-width: 1024px) {
  .chapter-incendios {
    grid-template-columns: 1fr;
    grid-template-rows: auto auto 1fr;
  }

  .chapter-incendios .chapter-text {
    grid-column: 1;
    grid-row: 2;
    max-height: 180px;
  }

  .chapter-incendios .chapter-chart-full {
    grid-column: 1;
    grid-row: 3;
    min-height: 300px;
  }
}

@media (max-width: 768px) {
  .chapter-incendios .map-title {
    font-size: 1.1rem;
    padding: 0.6rem 0.8rem;
  }

  .chapter-incendios .chapter-text {
    max-height: 160px;
    padding: 0.8rem;
  }

  .chapter-incendios .chapter-title {
    font-size: 1rem;
  }

  .incendios-stats {
    flex-direction: column;
  }
}

/* ============================================================
   CAPITULO 5 - PLAGAS FORESTALES (Layout texto 20% + tabla 80%)
   Reutiliza estilos del capítulo 2
   ============================================================ */

.chapter-plagas-tabla {
  display: grid;
  grid-template-columns: 1fr;
  grid-template-rows: auto 1fr;
  gap: 0.5rem;
  height: calc(100vh - 65px);
  padding: 0.5rem;
  box-sizing: border-box;
}

.chapter-plagas-tabla .map-title {
  grid-column: 1 / -1;
  grid-row: 1;
  font-size: 1.3rem;
  font-weight: 600;
  color: var(--color-btn-primary);
  margin: 0;
  padding: 0.8rem 1rem;
  background: var(--color-bg-white);
  border-radius: 8px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
  text-align: center;
}

.plagas-content {
  grid-column: 1 / -1;
  grid-row: 2;
  display: grid;
  grid-template-columns: 22% 1fr;
  gap: 0.5rem;
  height: 100%;
  min-height: 0;
  overflow: hidden;
}

/* Card de texto para plagas */
.plagas-text-card {
  background: var(--color-bg-white);
  border-radius: 8px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
  padding: 0.8rem;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
}

.plagas-text-card .card-title {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--color-btn-primary);
  margin-bottom: 0.5rem;
  padding-bottom: 0.3rem;
  border-bottom: 2px solid var(--color-btn-primary);
}

.plagas-text-card .card-content {
  font-size: 0.95rem;
  line-height: 1.5;
  color: var(--color-gray-900);
  flex: 1;
}

.plagas-text-card .card-content p {
  margin-bottom: 0.5rem;
}

/* Lista de plagas */
.plagas-lista {
  list-style: none;
  padding: 0;
  margin: 0.5rem 0;
}

.plagas-lista li {
  padding: 0.3rem 0.5rem;
  margin-bottom: 0.3rem;
  background: rgba(76, 175, 80, 0.08);
  border-left: 3px solid var(--color-success-alt);
  border-radius: 0 4px 4px 0;
  font-size: 0.88rem;
  line-height: 1.4;
}

/* Estadísticas de plagas */
.plagas-stats {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.8rem;
  padding-top: 0.5rem;
  border-top: 1px solid var(--color-border-light);
}

.plagas-stats .stat-item {
  flex: 1;
  text-align: center;
  padding: 0.5rem;
  background: rgba(76, 175, 80, 0.1);
  border-radius: 6px;
  border-left: 3px solid var(--color-success-alt);
}

.plagas-stats .stat-value {
  display: block;
  font-size: 1rem;
  font-weight: 700;
  color: var(--color-success-dark);
}

.plagas-stats .stat-label {
  display: block;
  font-size: 0.6rem;
  color: var(--color-text-gray);
  margin-top: 0.2rem;
}

/* Card de tabla para plagas */
.plagas-tabla-card {
  background: var(--color-bg-white);
  border-radius: 8px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  height: 100%;
  min-height: 0;
}

.plagas-tabla-card .tabla-header {
  padding: 0.6rem 1rem;
  background: linear-gradient(135deg, var(--color-success-dark) 0%, var(--color-success-alt) 100%);
  flex-shrink: 0;
}

.plagas-tabla-card .tabla-titulo-grande {
  font-size: 1rem;
  font-weight: 600;
  color: var(--color-bg-white);
  margin: 0;
  text-align: center;
}

/* Tabla de plagas */
.tabla-plagas {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.tabla-plagas thead {
  background: var(--color-bg-gray);
  position: sticky;
  top: 0;
  z-index: 10;
}

.tabla-plagas thead th {
  padding: 0.6rem 0.5rem;
  text-align: center;
  font-weight: 600;
  font-size: 0.85rem;
  color: var(--color-gray-900);
  border-bottom: 2px solid var(--color-success-alt);
  cursor: pointer;
}

.tabla-plagas thead th:hover {
  background: var(--color-border-light);
}

.tabla-plagas thead th:first-child {
  cursor: default;
}

.tabla-plagas thead th:first-child:hover {
  background: var(--color-bg-gray);
}

.tabla-plagas tbody tr {
  transition: background 0.2s ease;
  cursor: pointer;
  border-bottom: 1px solid var(--color-border-light);
}

.tabla-plagas tbody tr:hover {
  background: rgba(76, 175, 80, 0.08);
}

.tabla-plagas tbody tr.active {
  background: rgba(76, 175, 80, 0.15);
}

.tabla-plagas tbody tr.active td:first-child {
  border-left: 3px solid var(--color-success-alt);
}

.tabla-plagas tbody td {
  padding: 0.5rem 0.4rem;
  text-align: center;
  color: var(--color-gray-900);
  font-size: 0.85rem;
}

.tabla-plagas tbody td.num {
  text-align: center;
  font-family: 'Segoe UI', monospace;
  font-variant-numeric: tabular-nums;
}

.tabla-plagas tbody td.col-total {
  font-weight: 600;
  background: rgba(76, 175, 80, 0.08);
}

/* Fila crítica (año con mayor afectación) */
.tabla-plagas tbody tr.fila-critica {
  background: rgba(244, 67, 54, 0.1);
}

.tabla-plagas tbody tr.fila-critica:hover {
  background: rgba(244, 67, 54, 0.18);
}

.tabla-plagas tbody tr.fila-critica td {
  color: var(--color-error-dark);
  font-weight: 500;
}

/* Footer de la tabla */
.tabla-plagas tfoot {
  background: rgba(76, 175, 80, 0.1);
}

.tabla-plagas tfoot tr.fila-total td {
  padding: 0.6rem 0.4rem;
  font-weight: 600;
  color: var(--color-success-dark);
  border-top: 2px solid var(--color-success-alt);
  text-align: center;
  font-size: 0.85rem;
}

/* Indicadores de ordenamiento para tabla plagas */
.tabla-plagas thead th.sorted-asc::after {
  content: ' ▲';
  font-size: 0.6rem;
  opacity: 0.7;
}

.tabla-plagas thead th.sorted-desc::after {
  content: ' ▼';
  font-size: 0.6rem;
  opacity: 0.7;
}

/* Efecto de resaltado */
.tabla-plagas tbody tr.highlight {
  animation: highlightRowGreen 0.5s ease;
}

@keyframes highlightRowGreen {
  0% {
    background: rgba(76, 175, 80, 0.3);
  }
  100% {
    background: rgba(76, 175, 80, 0.08);
  }
}

/* Responsive capítulo 5 */
@media (max-width: 1200px) {
  .plagas-content {
    grid-template-columns: 25% 1fr;
  }
}

@media (max-width: 992px) {
  .chapter-plagas-tabla {
    grid-template-rows: auto auto 1fr;
  }

  .plagas-content {
    grid-template-columns: 1fr;
    grid-template-rows: auto 1fr;
  }

  .plagas-text-card {
    max-height: 200px;
    height: auto;
  }

  .plagas-tabla-card {
    height: auto;
    min-height: 300px;
  }
}

@media (max-width: 768px) {
  .chapter-plagas-tabla .map-title {
    font-size: 1.1rem;
    padding: 0.6rem 0.8rem;
  }

  .plagas-text-card {
    max-height: 180px;
    padding: 0.6rem;
  }

  .plagas-text-card .card-title {
    font-size: 1rem;
  }

  .tabla-plagas {
    font-size: 0.8rem;
  }

  .tabla-plagas thead th,
  .tabla-plagas tbody td {
    padding: 0.4rem 0.3rem;
    font-size: 0.75rem;
  }

  .plagas-stats {
    flex-direction: column;
  }
}

/* ============================================================
   CAPITULO 7 - PLAGAS CON MAPA (Layout texto 30% + mapa/tabla 70%)
   Similar al capítulo 6 de incendios
   ============================================================ */

.chapter-plagas-mapa {
  display: grid;
  grid-template-columns: 30% 70%;
  grid-template-rows: auto 1fr 1fr;
  gap: 0.5rem;
  padding: 0.5rem;
  height: calc(100vh - 65px);
  box-sizing: border-box;
}

.chapter-plagas-mapa .map-title {
  grid-column: 1 / -1;
  grid-row: 1;
  font-size: 1.3rem;
  font-weight: 600;
  color: var(--color-btn-primary);
  margin: 0;
  padding: 0.8rem 1rem;
  background: var(--color-bg-white);
  border-radius: 8px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
}

.chapter-plagas-mapa .plagas-text {
  grid-column: 1;
  grid-row: 2 / 4;
  background: var(--color-bg-white);
  border-radius: 8px;
  padding: 1rem;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
  overflow-y: auto;
}

.chapter-plagas-mapa .chapter-title {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--color-btn-primary);
  margin-bottom: 0.8rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--color-btn-primary);
}

.chapter-plagas-mapa .chapter-content {
  font-size: 0.85rem;
  line-height: 1.5;
  color: var(--color-gray-900);
}

.chapter-plagas-mapa .chapter-content p {
  margin-bottom: 0.5rem;
}

.chapter-plagas-mapa .plagas-map {
  grid-column: 2;
  grid-row: 2;
  background: var(--color-bg-white);
  border-radius: 8px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
  overflow: hidden;
  position: relative;
}

.chapter-plagas-mapa .plagas-map .map-container {
  width: 100%;
  height: 100%;
}

.chapter-plagas-mapa .plagas-tabla {
  grid-column: 2;
  grid-row: 3;
  overflow: hidden;
}

.chapter-plagas-mapa .plagas-tabla .plagas-tabla-card {
  height: 100%;
  min-height: 0;
}

.chapter-plagas-mapa .plagas-tabla .tabla-scroll-grande {
  max-height: calc(100% - 4rem);
  overflow-y: auto;
}

/* Estilos de plagas reutilizados en nuevo layout */
.chapter-plagas-mapa .plagas-lista {
  list-style: none;
  padding: 0;
  margin: 0.5rem 0;
}

.chapter-plagas-mapa .plagas-lista li {
  padding: 0.3rem 0;
  padding-left: 1rem;
  border-left: 3px solid var(--color-success-alt);
  margin-bottom: 0.3rem;
  font-size: 0.8rem;
}

.chapter-plagas-mapa .plagas-stats {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.8rem;
  padding-top: 0.5rem;
  border-top: 1px solid var(--color-border-light);
}

.chapter-plagas-mapa .plagas-stats .stat-item {
  flex: 1;
  text-align: center;
  padding: 0.4rem;
  background: rgba(76, 175, 80, 0.1);
  border-radius: 6px;
  border-left: 3px solid var(--color-success-alt);
}

.chapter-plagas-mapa .plagas-stats .stat-value {
  display: block;
  font-size: 1rem;
  font-weight: 700;
  color: var(--color-success-dark);
}

.chapter-plagas-mapa .plagas-stats .stat-label {
  display: block;
  font-size: 0.65rem;
  color: var(--color-text-gray);
  margin-top: 0.2rem;
}

/* Regiones forestales */
.regiones-forestales {
  margin-top: 0.8rem;
  padding-top: 0.5rem;
  border-top: 1px solid var(--color-border-light);
}

.regiones-titulo {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--color-btn-primary);
  margin-bottom: 0.5rem;
}

.region-item {
  margin-bottom: 0.5rem;
  padding: 0.4rem 0.5rem;
  background: rgba(76, 175, 80, 0.05);
  border-radius: 4px;
  border-left: 3px solid var(--color-success-alt);
}

.region-item h5 {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--color-success-dark);
  margin: 0 0 0.2rem 0;
}

.region-item p {
  font-size: 0.8rem;
  line-height: 1.4;
  margin: 0.15rem 0;
}

/* Controles de capas para mapa 7 */
.chapter-plagas-mapa .map-controls {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  background: rgba(255, 255, 255, 0.95);
  border-radius: 6px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
  z-index: 100;
  max-width: 200px;
  font-size: 0.75rem;
}

.chapter-plagas-mapa .map-controls-header {
  padding: 0.4rem 0.6rem;
  background: white;
  color: var(--color-gray-900);
  border-radius: 6px 6px 0 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--color-border-light);
}

.chapter-plagas-mapa .map-controls-title {
  font-size: 0.75rem;
  font-weight: 600;
}

.chapter-plagas-mapa .map-controls-toggle {
  background: transparent;
  border: none;
  color: var(--color-gray-900);
  cursor: pointer;
  font-size: 0.7rem;
  padding: 0.1rem 0.3rem;
}

.chapter-plagas-mapa .map-controls-content {
  padding: 0.4rem;
  max-height: 200px;
  overflow-y: auto;
}

.chapter-plagas-mapa .map-controls.collapsed .map-controls-content {
  display: none;
}

.chapter-plagas-mapa .layer-control {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.25rem 0;
  font-size: 0.75rem;
}

.chapter-plagas-mapa .layer-control input[type="checkbox"] {
  width: 14px;
  height: 14px;
  cursor: pointer;
}

.chapter-plagas-mapa .layer-control label {
  cursor: pointer;
  color: var(--color-gray-900);
}

/* Panel de leyendas para mapa 7 */
.chapter-plagas-mapa .map-legends {
  position: absolute;
  bottom: 0.5rem;
  right: 0.5rem;
  background: rgba(255, 255, 255, 0.95);
  border-radius: 6px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
  z-index: 100;
  max-width: 180px;
  font-size: 0.7rem;
}

.chapter-plagas-mapa .map-legends-header {
  padding: 0.3rem 0.5rem;
  background: white;
  color: var(--color-gray-900);
  border-radius: 6px 6px 0 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--color-border-light);
}

.chapter-plagas-mapa .map-legends-title {
  font-size: 0.7rem;
  font-weight: 600;
}

.chapter-plagas-mapa .map-legends-toggle {
  background: transparent;
  border: none;
  color: var(--color-gray-900);
  cursor: pointer;
  font-size: 0.65rem;
  padding: 0.1rem 0.2rem;
}

.chapter-plagas-mapa .map-legends-content {
  padding: 0.3rem 0.4rem;
  max-height: 150px;
  overflow-y: auto;
}

.chapter-plagas-mapa .map-legends.collapsed .map-legends-content {
  display: none;
}

.chapter-plagas-mapa .map-legends-empty {
  font-size: 0.6rem;
  color: var(--color-gray-600);
  text-align: center;
  padding: 0.3rem;
}

/* Responsive capítulo 7 con mapa */
@media (max-width: 1024px) {
  .chapter-plagas-mapa {
    grid-template-columns: 1fr;
    grid-template-rows: auto auto auto auto;
  }

  .chapter-plagas-mapa .plagas-text {
    grid-column: 1;
    grid-row: 2;
    max-height: 180px;
  }

  .chapter-plagas-mapa .plagas-map {
    grid-column: 1;
    grid-row: 3;
    min-height: 250px;
  }

  .chapter-plagas-mapa .plagas-tabla {
    grid-column: 1;
    grid-row: 4;
    min-height: 250px;
  }
}

/* ============================================================
   CAPITULO 6 - DEGRADACIÓN DEL SUELO (Layout mapa imagen + texto)
   ============================================================ */

.chapter-degradacion {
  display: grid;
  grid-template-columns: 1fr;
  grid-template-rows: auto 1fr;
  gap: 0.5rem;
  padding: 0.5rem;
  width: 100%;
  height: calc(100vh - 65px) !important;
  min-height: calc(100vh - 65px);
  box-sizing: border-box;
}

.chapter-degradacion .map-title {
  grid-column: 1;
  grid-row: 1;
  font-size: 1.3rem;
  font-weight: 600;
  color: var(--color-btn-primary);
  margin: 0;
  padding: 0.8rem 1rem;
  background: var(--color-bg-white);
  border-radius: 8px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
  text-align: center;
}

.degradacion-content {
  display: grid;
  grid-template-columns: 65% 35%;
  gap: 0.8rem;
  height: 100%;
  min-height: 0;
}

/* Contenedor del mapa y tabla */
.degradacion-map-container {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  background: var(--color-bg-white);
  border-radius: 8px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
  padding: 0.8rem;
  overflow: hidden;
}

.mapa-erosion-wrapper {
  flex: 1;
  position: relative;
  overflow: hidden;
  min-height: 0;
  border-radius: 6px;
}

.mapa-erosion-wrapper .map-container {
  width: 100%;
  height: 100%;
}

/* Controles de capas para mapa 8 */
.mapa-erosion-wrapper .map-controls {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  background: rgba(255, 255, 255, 0.95);
  border-radius: 6px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
  z-index: 100;
  max-width: 200px;
  font-size: 0.75rem;
}

.mapa-erosion-wrapper .map-controls-header {
  padding: 0.4rem 0.6rem;
  background: white;
  color: var(--color-gray-900);
  border-radius: 6px 6px 0 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--color-border-light);
}

.mapa-erosion-wrapper .map-controls-title {
  font-size: 0.75rem;
  font-weight: 600;
}

.mapa-erosion-wrapper .map-controls-toggle {
  background: transparent;
  border: none;
  color: var(--color-gray-900);
  cursor: pointer;
  font-size: 0.7rem;
  padding: 0.1rem 0.3rem;
}

.mapa-erosion-wrapper .map-controls-content {
  padding: 0.4rem;
  max-height: 200px;
  overflow-y: auto;
}

.mapa-erosion-wrapper .map-controls.collapsed .map-controls-content {
  display: none;
}

.mapa-erosion-wrapper .layer-control {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.25rem 0;
  font-size: 0.75rem;
}

.mapa-erosion-wrapper .layer-control input[type="checkbox"] {
  width: 14px;
  height: 14px;
  cursor: pointer;
}

.mapa-erosion-wrapper .layer-control label {
  cursor: pointer;
  color: var(--color-gray-900);
}

/* Panel de leyendas para mapa 8 */
.mapa-erosion-wrapper .map-legends {
  position: absolute;
  bottom: 0.5rem;
  right: 0.5rem;
  background: rgba(255, 255, 255, 0.95);
  border-radius: 6px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
  z-index: 100;
  max-width: 180px;
  font-size: 0.7rem;
}

.mapa-erosion-wrapper .map-legends-header {
  padding: 0.3rem 0.5rem;
  background: white;
  color: var(--color-gray-900);
  border-radius: 6px 6px 0 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--color-border-light);
}

.mapa-erosion-wrapper .map-legends-title {
  font-size: 0.7rem;
  font-weight: 600;
}

.mapa-erosion-wrapper .map-legends-toggle {
  background: transparent;
  border: none;
  color: var(--color-gray-900);
  cursor: pointer;
  font-size: 0.65rem;
  padding: 0.1rem 0.2rem;
}

.mapa-erosion-wrapper .map-legends-content {
  padding: 0.3rem 0.4rem;
  max-height: 150px;
  overflow-y: auto;
}

.mapa-erosion-wrapper .map-legends.collapsed .map-legends-content {
  display: none;
}

.mapa-erosion-wrapper .map-legends-empty {
  font-size: 0.6rem;
  color: var(--color-gray-600);
  text-align: center;
  padding: 0.3rem;
}

/* Tabla de erosión */
.tabla-erosion-container {
  flex-shrink: 0;
}

.tabla-erosion-container .tabla-titulo {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--color-btn-primary);
  margin: 0 0 0.5rem 0;
  text-align: center;
}

.tabla-erosion {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8rem;
}

.tabla-erosion thead {
  background: linear-gradient(135deg, var(--color-btn-primary-hover) 0%, var(--color-btn-primary) 100%);
}

.tabla-erosion thead th {
  padding: 0.5rem 0.4rem;
  text-align: center;
  font-weight: 600;
  font-size: 0.75rem;
  color: var(--color-bg-white);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.tabla-erosion tbody td {
  padding: 0.5rem 0.4rem;
  text-align: center;
  border: 1px solid var(--color-gray-300);
  font-size: 0.8rem;
}

.tabla-erosion tbody td.num {
  font-family: 'Roboto Mono', monospace;
}

.tabla-erosion .col-extrema {
  background: rgba(139, 0, 0, 0.15);
}

.tabla-erosion .col-fuerte {
  background: rgba(205, 92, 92, 0.15);
}

.tabla-erosion .col-moderada {
  background: rgba(240, 230, 140, 0.3);
}

.tabla-erosion .col-leve {
  background: rgba(144, 238, 144, 0.2);
}

.tabla-erosion .col-estable {
  background: rgba(34, 139, 34, 0.15);
}

.tabla-erosion .col-total {
  background: rgba(162, 26, 92, 0.1);
  font-weight: 600;
}

.tabla-erosion-container .tabla-fuente {
  font-size: 0.7rem;
  color: var(--color-text-gray);
  margin: 0.4rem 0 0 0;
  text-align: right;
}

/* Card de texto explicativo */
.degradacion-text-card {
  background: var(--color-bg-white);
  border-radius: 8px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.degradacion-text-card .card-title {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--color-bg-white);
  margin: 0;
  padding: 0.7rem 1rem;
  background: linear-gradient(135deg, var(--color-btn-primary-hover) 0%, var(--color-btn-primary) 100%);
}

.degradacion-text-card .card-content {
  padding: 0.8rem;
  overflow-y: auto;
  flex: 1;
}

.degradacion-text-card p {
  font-size: 0.95rem;
  line-height: 1.5;
  color: var(--color-gray-900);
  margin: 0 0 0.6rem 0;
}

.zonas-erosion {
  margin-bottom: 0.8rem;
  padding: 0.6rem;
  background: rgba(162, 26, 92, 0.05);
  border-radius: 6px;
  border-left: 3px solid var(--color-btn-primary);
}

.zonas-erosion h4 {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--color-btn-primary);
  margin: 0 0 0.4rem 0;
}

.zonas-erosion ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.zonas-erosion li {
  padding: 0.25rem 0;
  font-size: 0.9rem;
  color: var(--color-gray-900);
  position: relative;
  padding-left: 1rem;
}

.zonas-erosion li::before {
  content: "•";
  position: absolute;
  left: 0;
  color: var(--color-btn-primary);
  font-weight: bold;
}

/* Niveles de erosión con colores */
.niveles-erosion {
  margin-top: 0.8rem;
}

.niveles-erosion h4 {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--color-btn-primary);
  margin: 0 0 0.5rem 0;
}

.nivel-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.3rem 0;
}

.nivel-color {
  width: 18px;
  height: 18px;
  border-radius: 3px;
  flex-shrink: 0;
}

.nivel-texto {
  font-size: 0.88rem;
  color: var(--color-gray-900);
}

.nivel-item.extrema .nivel-color {
  background: var(--color-scale-critical);
}

.nivel-item.fuerte .nivel-color {
  background: var(--color-scale-high);
}

.nivel-item.moderada .nivel-color {
  background: var(--color-scale-medium);
}

.nivel-item.leve .nivel-color {
  background: var(--color-scale-low);
}

.nivel-item.estable .nivel-color {
  background: var(--color-scale-minimal);
}

.nota-fuente {
  font-size: 0.85rem !important;
  color: var(--color-text-gray) !important;
  margin-top: 0.8rem !important;
  padding-top: 0.5rem;
  border-top: 1px solid var(--color-border-light);
}

/* ============================================================
   CAPITULO 6 - RESPONSIVE
   ============================================================ */

@media (max-width: 1200px) {
  .degradacion-content {
    grid-template-columns: 60% 40%;
  }
}

@media (max-width: 992px) {
  .degradacion-content {
    grid-template-columns: 1fr;
    grid-template-rows: auto auto;
  }

  .degradacion-map-container {
    max-height: 50vh;
  }

  .degradacion-text-card {
    max-height: 40vh;
  }
}

@media (max-width: 768px) {
  .chapter-degradacion {
    padding: 0.3rem;
    gap: 0.3rem;
  }

  .chapter-degradacion .map-title {
    font-size: 1.1rem;
    padding: 0.6rem;
  }

  .degradacion-content {
    gap: 0.5rem;
  }

  .degradacion-map-container {
    padding: 0.5rem;
  }

  .tabla-erosion thead th,
  .tabla-erosion tbody td {
    padding: 0.3rem 0.2rem;
    font-size: 0.65rem;
  }

  .degradacion-text-card .card-title {
    font-size: 1rem;
    padding: 0.5rem 0.8rem;
  }

  .degradacion-text-card .card-content {
    padding: 0.6rem;
  }

  .degradacion-text-card p {
    font-size: 0.8rem;
  }

  .zonas-erosion h4,
  .niveles-erosion h4 {
    font-size: 0.8rem;
  }

  .nivel-texto {
    font-size: 0.72rem;
  }
}

