/* ============================================================
 * Calidad del Agua — Micrositio de Transparencia Proactiva
 * Sistema de diseño institucional: azul agua + claridad.
 * ============================================================ */

:root {
  --primary: #173669;
  --primary-dark: #0F2549;
  --secondary: #4EA5D9;
  --accent: #77C8F2;
  --background: #F5F9FD;
  --surface: #FFFFFF;
  --text: #182A4A;
  --muted: #63758A;
  --success: #249B68;
  --success-bg: #E4F4EC;
  --warning: #B87A1F;
  --warning-bg: #FCF1DE;
  --danger: #D95555;
  --danger-bg: #FBEAEA;
  --border: #DDE8F3;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 2px 12px rgba(23, 54, 105, 0.07);
  --shadow-hover: 0 8px 28px rgba(23, 54, 105, 0.12);
  --font: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
}

* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: 84px;
}

body {
  margin: 0;
  font-family: var(--font);
  font-size: 1.0625rem;
  line-height: 1.6;
  color: var(--text);
  background: var(--background);
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 { line-height: 1.2; color: var(--primary); margin: 0 0 0.5em; }
h1 { font-size: clamp(2.1rem, 5vw, 3.4rem); font-weight: 800; letter-spacing: -0.02em; }
h2 { font-size: clamp(1.5rem, 3vw, 2.1rem); font-weight: 700; letter-spacing: -0.01em; }
h3 { font-size: 1.15rem; font-weight: 600; }

a { color: var(--secondary); text-decoration: none; }
a:hover { text-decoration: underline; }

button { font-family: inherit; cursor: pointer; }

:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
  border-radius: 4px;
}

.container { max-width: 1180px; margin: 0 auto; padding: 0 24px; }
.container.narrow { max-width: 780px; }
.container.centro { text-align: center; }

.sr-only {
  position: absolute; width: 1px; height: 1px;
  clip: rect(0 0 0 0); clip-path: inset(50%);
  overflow: hidden; white-space: nowrap;
}

.skip-link {
  position: absolute; left: 16px; top: -60px; z-index: 200;
  background: var(--primary); color: #fff;
  padding: 10px 18px; border-radius: 8px;
  transition: top 0.2s;
}
.skip-link:focus { top: 12px; text-decoration: none; }

.app-error {
  background: var(--danger-bg); color: var(--danger);
  padding: 14px 20px; text-align: center; font-weight: 600;
}

/* ============ Animación de aparición ============ */
.reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.6s ease, transform 0.6s ease;
  transition-delay: var(--delay, 0ms);
}
.reveal.revealed { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
  .onda, .gota { animation: none !important; }
  html { scroll-behavior: auto; }
}

/* ============ Header ============ */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}
.header-inner {
  display: flex; align-items: center; justify-content: space-between;
  min-height: 68px; gap: 16px;
}
.brand {
  display: flex; align-items: center;
  flex-shrink: 0;
}
.brand:hover { text-decoration: none; }
.brand-logo {
  height: 42px;
  width: auto;
  flex-shrink: 0;
  object-fit: contain;
}

.menu {
  display: flex; gap: 4px; list-style: none; margin: 0; padding: 0;
}
.menu a {
  display: block; padding: 8px 14px; border-radius: 999px;
  color: var(--text); font-weight: 500; font-size: 0.95rem;
  transition: background 0.2s, color 0.2s;
}
.menu a:hover { background: var(--background); color: var(--primary); text-decoration: none; }

.header-logo-right {
  height: 42px;
  width: auto;
  object-fit: contain;
  flex-shrink: 0;
}

.nav-toggle {
  display: none; flex-direction: column; gap: 5px;
  background: none; border: 0; padding: 10px;
}
.nav-toggle span {
  width: 22px; height: 2px; background: var(--primary); border-radius: 2px;
}

/* ============ Botones ============ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 13px 26px; border-radius: 999px; border: 2px solid transparent;
  font-weight: 600; font-size: 1rem; line-height: 1;
  transition: transform 0.15s, box-shadow 0.2s, background 0.2s;
}
.btn:hover { transform: translateY(-1px); text-decoration: none; }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); box-shadow: var(--shadow-hover); }
.btn-ghost { background: rgba(255,255,255,0.14); color: #fff; border-color: rgba(255,255,255,0.55); }
.btn-ghost:hover { background: rgba(255,255,255,0.26); }
.btn-outline { background: var(--surface); color: var(--primary); border-color: var(--border); }
.btn-outline:hover { border-color: var(--secondary); color: var(--secondary); }
.btn-danger { background: var(--surface); color: var(--danger); border-color: var(--danger); }
.btn-danger:hover { background: var(--danger-bg); }
.btn-sm { padding: 9px 18px; font-size: 0.9rem; }

/* ============ Hero ============ */
.hero {
  position: relative; overflow: hidden;
  background: linear-gradient(160deg, var(--primary-dark) 0%, var(--primary) 45%, #2D6FA8 100%);
  color: #fff;
  padding: clamp(80px, 12vw, 140px) 0 clamp(90px, 12vw, 150px);
}
/* Foto del acueducto de Querétaro, difuminada bajo un velo institucional */
.hero::before {
  content: '';
  position: absolute; inset: -14px; /* margen para ocultar el borde del blur */
  background: url('../assets/hero-acueducto.jpg') center 38% / cover no-repeat;
  filter: blur(7px) saturate(1.08);
  z-index: 0;
}
/* Velo azul: garantiza legibilidad y mantiene la identidad institucional */
.hero::after {
  content: '';
  position: absolute; inset: 0; z-index: 0;
  background: linear-gradient(155deg,
    rgba(15, 37, 73, 0.88) 0%,
    rgba(23, 54, 105, 0.80) 42%,
    rgba(45, 111, 168, 0.72) 100%);
}
.hero-inner { position: relative; z-index: 2; max-width: 760px; }
.hero-kicker {
  text-transform: uppercase; letter-spacing: 0.14em;
  font-size: 0.8rem; font-weight: 600; color: var(--accent);
}
.hero h1 { color: #fff; margin-bottom: 0.35em; }
.hero-sub { font-size: 1.2rem; color: rgba(255,255,255,0.88); max-width: 620px; }
.hero-sub a {
  color: #fff;
  text-decoration: underline;
  text-decoration-color: rgba(255, 255, 255, 0.55);
}
.hero-sub a:hover {
  color: var(--accent);
}
.hero-fecha { font-size: 0.92rem; color: var(--accent); font-weight: 500; }
.hero-ctas { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 28px; }

/* Ondas y gotas animadas */
.hero-ondas { position: absolute; inset: 0; z-index: 1; }
@media (prefers-reduced-motion: reduce) {
  .hero::before { filter: blur(5px) saturate(1.05); }
}
.onda {
  position: absolute; border-radius: 50%;
  border: 1.5px solid rgba(119, 200, 242, 0.35);
  animation: onda 7s ease-out infinite;
}
.onda-1 { width: 340px; height: 340px; right: -60px; top: 12%; }
.onda-2 { width: 340px; height: 340px; right: -60px; top: 12%; animation-delay: 2.3s; }
.onda-3 { width: 340px; height: 340px; right: -60px; top: 12%; animation-delay: 4.6s; }
@keyframes onda {
  0% { transform: scale(0.35); opacity: 0; }
  25% { opacity: 0.8; }
  100% { transform: scale(1.9); opacity: 0; }
}
.gota {
  position: absolute; width: 10px; height: 10px; border-radius: 50% 50% 50% 0;
  transform: rotate(-45deg);
  background: rgba(119, 200, 242, 0.5);
  animation: gota 6s ease-in-out infinite;
}
.gota-1 { left: 58%; top: 26%; animation-delay: 0s; }
.gota-2 { left: 74%; top: 58%; animation-delay: 2s; }
.gota-3 { left: 88%; top: 30%; animation-delay: 4s; }
@keyframes gota {
  0%, 100% { transform: rotate(-45deg) translateY(0); opacity: 0.5; }
  50% { transform: rotate(-45deg) translateY(-26px); opacity: 0.95; }
}

/* ============ Secciones ============ */
.seccion { padding: clamp(56px, 8vw, 96px) 0; }
.seccion-tinta { background: var(--surface); }
.seccion-intro { color: var(--muted); max-width: 720px; font-size: 1.1rem; margin-bottom: 36px; }
.lead { font-size: 1.18rem; color: var(--text); }
.anchor { scroll-margin-top: 84px; }
.subtitulo-seccion { margin-top: 56px; font-size: 1.4rem; }
[data-collapsible] {
  transition: padding 0.2s ease;
}
[data-collapsible].is-collapsed {
  padding: clamp(26px, 4vw, 38px) 0;
}

.section-collapse {
  display: grid;
  gap: 0;
}

.section-collapse-heading {
  margin: 0;
}

.section-collapse-toggle {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 18px 22px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--primary);
  box-shadow: var(--shadow);
  text-align: left;
  font-size: 1rem;
  font-weight: 700;
}

.section-collapse-toggle:hover {
  border-color: var(--secondary);
  box-shadow: var(--shadow-hover);
}

.section-collapse-title {
  font-size: clamp(1.05rem, 2vw, 1.35rem);
  line-height: 1.25;
}

.section-collapse-icon {
  flex: 0 0 auto;
  width: 18px;
  height: 18px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(45deg);
  transition: transform 0.2s ease;
  margin-right: 6px;
}

.section-collapse-toggle[aria-expanded="true"] .section-collapse-icon {
  transform: rotate(225deg);
  margin-top: 8px;
}

.section-collapse-content {
  padding-top: 22px;
}

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

.glosario-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px 20px;
  box-shadow: var(--shadow);
}

.glosario-card h3 {
  margin-bottom: 10px;
}

.glosario-card p {
  margin: 0;
  color: var(--muted);
}

.section-collapse-content[hidden] {
  display: none !important;
}

.pocas .section-collapse-toggle {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.22);
  color: #fff;
}

.pocas .section-collapse-toggle:hover {
  background: rgba(255, 255, 255, 0.14);
  border-color: rgba(255, 255, 255, 0.38);
}

.mensaje-transparencia { background: linear-gradient(180deg, var(--background), #EAF3FB); }

/* ============ Infografías embebidas ============ */
.infografia-head,
.infografia-inline {
  margin-bottom: 28px;
}

.proceso-infografia,
.lectura-grid,
.lectura-explain {
  margin-top: 18px;
}

.video-panel {
  padding: 18px;
  border: 1px solid var(--border);
  border-radius: calc(var(--radius) + 6px);
  background: linear-gradient(180deg, #F7FDFF, #EFF8FD);
  box-shadow: var(--shadow);
}

.video-player {
  display: block;
  width: 100%;
  border-radius: calc(var(--radius) + 2px);
  background: #041A33;
}

.lectura-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
}

.lectura-card,
.lectura-example,
.lectura-lmp,
.proceso-step,
.proceso-side-card {
  background: #fff;
  border: 1px solid #C8E5F5;
  box-shadow: 0 10px 24px rgba(16, 70, 112, 0.05);
}

.lectura-card {
  border-radius: 22px;
  padding: 20px;
}

.lectura-icon {
  display: grid;
  place-items: center;
  width: 54px;
  height: 54px;
  margin-bottom: 12px;
  border-radius: 16px;
  background: #EAF8FF;
  font-size: 1.6rem;
}

.lectura-card h4,
.lectura-example h4,
.lectura-lmp h4,
.proceso-step-copy h4,
.proceso-side-card h4 {
  margin: 0 0 6px;
  color: #0B2858;
}

.lectura-card p,
.lectura-example p,
.lectura-lmp p,
.proceso-step-copy p,
.proceso-side-note,
.proceso-side-lmp p {
  margin: 0;
  color: #617990;
  line-height: 1.45;
}

.lectura-explain {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 18px;
}

.lectura-example,
.lectura-lmp {
  border-radius: 24px;
  padding: 22px;
}

.lectura-example-top {
  display: flex;
  gap: 14px;
  align-items: flex-start;
}

.lectura-param-icon {
  display: grid;
  place-items: center;
  width: 64px;
  height: 64px;
  flex: 0 0 64px;
  border: 1px solid #C9E9F8;
  border-radius: 20px;
  background: #EAF8FF;
  font-size: 1.9rem;
}

.lectura-badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-top: 8px;
  padding: 6px 10px;
  border-radius: 999px;
  background: #EAF8F3;
  color: #1F8A6B;
  font-size: 0.82rem;
  font-weight: 900;
}

.lectura-example-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-top: 16px;
}

.lectura-mini {
  padding: 12px;
  text-align: center;
  border: 1px solid #DBEEF7;
  border-radius: 16px;
  background: #F9FDFF;
}

.lectura-mini b {
  display: block;
  color: #0B2858;
  font-size: 1rem;
}

.lectura-mini span {
  font-size: 0.76rem;
  color: #66809A;
  font-weight: 800;
}

.lectura-interpret {
  margin-top: 16px !important;
  padding: 14px 16px;
  border-left: 4px solid #4AAFE0;
  border-radius: 16px;
  background: #F1F9FF;
  color: #355D85 !important;
  font-weight: 700;
}

.lectura-lmp {
  position: relative;
  overflow: hidden;
  background: linear-gradient(180deg, #113B72, #0C2E60);
  color: #fff;
}

.lectura-lmp::after {
  content: "LMP";
  position: absolute;
  right: -12px;
  bottom: -24px;
  font-size: 6rem;
  font-weight: 900;
  color: rgba(255,255,255,0.06);
}

.lectura-lmp h4,
.lectura-lmp p {
  position: relative;
  color: #fff;
}

.lectura-lmp-badge {
  display: grid;
  place-items: center;
  width: 76px;
  height: 76px;
  margin-bottom: 16px;
  border: 3px solid #8ED5F2;
  border-radius: 50%;
  background: #EAF8FF;
  color: #102F67;
  font-size: 1.25rem;
  font-weight: 900;
}

.lectura-lmp-note {
  margin-top: 16px !important;
  padding-top: 14px;
  border-top: 1px solid rgba(255,255,255,0.2);
  color: #D9EBF8 !important;
  font-size: 0.9rem;
}

.proceso-infografia {
  padding: 2px 0 0;
}

.proceso-info-grid {
  display: grid;
  grid-template-columns: 1.45fr 0.75fr;
  gap: 24px;
}

.proceso-flow {
  position: relative;
}

.proceso-flow::before {
  content: "";
  position: absolute;
  left: 61px;
  top: 60px;
  bottom: 60px;
  width: 3px;
  background: #6FC4EA;
}

.proceso-step {
  position: relative;
  display: grid;
  grid-template-columns: 110px 60px 1fr;
  gap: 14px;
  align-items: center;
  margin-bottom: 16px;
  padding: 14px;
  border-radius: 22px;
}

.proceso-step:not(:last-child)::after {
  content: "↓";
  position: absolute;
  left: 49px;
  bottom: -31px;
  color: #1974BD;
  font-size: 2rem;
  font-weight: 900;
}

.proceso-step-icon {
  display: grid;
  place-items: center;
  width: 94px;
  height: 94px;
  border: 3px solid #4099D2;
  border-radius: 50%;
  background: #EAF8FF;
  font-size: 2.7rem;
  z-index: 2;
}

.proceso-step-num {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: linear-gradient(#1F7ACA, #0C5196);
  color: #fff;
  font-size: 1.45rem;
  font-weight: 900;
}

.proceso-step-copy p {
  font-weight: 650;
}

.proceso-side {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.proceso-side-card {
  border-radius: 22px;
  padding: 22px;
}

.proceso-side-row {
  display: grid;
  grid-template-columns: 62px 1fr;
  gap: 12px;
  align-items: center;
  padding: 13px 0;
  border-bottom: 1px solid #D7ECF8;
}

.proceso-side-row:last-of-type {
  border-bottom: 0;
}

.proceso-side-icon {
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  border: 2px solid #3B91CD;
  border-radius: 50%;
  background: #EEF9FF;
  font-size: 1.7rem;
}

.proceso-side-note {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 3px solid #4DB9E8;
  font-weight: 600;
}

.proceso-side-lmp {
  display: flex;
  gap: 12px;
  align-items: center;
}

.proceso-lmp-badge {
  display: grid;
  place-items: center;
  width: 64px;
  height: 64px;
  flex: 0 0 64px;
  border: 2px solid #3B91CD;
  border-radius: 50%;
  background: #EEF9FF;
  color: #10346A;
  font-weight: 900;
}

.proceso-banner {
  margin-top: 24px;
  padding: 20px 24px;
  border: 2px solid #2C82C2;
  border-radius: 22px;
  background: #fff;
  color: #10346A;
  font-size: 1.05rem;
  font-weight: 850;
  line-height: 1.45;
}

/* ============ Tarjetas educativas ============ */
.cards-3 {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px;
}
.cards-4 {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px;
}
.edu-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 30px 26px;
  box-shadow: var(--shadow);
  transition: transform 0.25s, box-shadow 0.25s;
}
.edu-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-hover); }
.edu-icon { font-size: 2rem; display: block; margin-bottom: 14px; }
.edu-ejemplos { color: var(--secondary); font-weight: 600; font-size: 0.92rem; }
.edu-card p:last-child { color: var(--muted); margin-bottom: 0; }

/* ============ Proceso 4 pasos ============ */
.proceso-4 {
  display: grid; grid-template-columns: 1fr auto 1fr auto 1fr auto 1fr;
  gap: 14px; align-items: stretch; margin-top: 20px;
}
.proceso-paso {
  background: var(--background); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 24px 20px; text-align: center;
}
.proceso-num {
  display: inline-flex; align-items: center; justify-content: center;
  width: 40px; height: 40px; border-radius: 50%;
  background: var(--primary); color: #fff; font-weight: 700;
  margin-bottom: 12px;
}
.proceso-paso p { color: var(--muted); font-size: 0.95rem; margin: 0; }
.proceso-flecha { align-self: center; color: var(--accent); font-size: 1.4rem; font-weight: 700; }
.proceso-ruta {
  margin-top: 28px; text-align: center; color: var(--muted);
  font-weight: 600; letter-spacing: 0.04em; font-size: 0.9rem;
}

/* ============ Indicadores generales ============ */
.grid-indicadores {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 18px;
}
.ind-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 26px 24px;
  box-shadow: var(--shadow); text-align: center;
}
.ind-card-wide {
  grid-column: span 2;
}
.ind-icon { display: inline-block; width: 44px; height: 44px; color: var(--secondary); margin-bottom: 10px; }
.ind-icon svg { width: 100%; height: 100%; }
.ind-valor { font-size: 2rem; font-weight: 800; color: var(--primary); margin: 0 0 2px; }
.ind-texto { font-size: 1.3rem; }
.ind-detalle { margin: 0; color: var(--secondary); font-weight: 600; font-size: 0.9rem; }
.ind-etiqueta { font-size: 0.92rem; color: var(--muted); font-weight: 500; margin: 6px 0 0; }

/* ============ En pocas palabras ============ */
.pocas {
  background: linear-gradient(140deg, var(--primary) 0%, #2D6FA8 100%);
  color: #fff; text-align: center;
}
.pocas h2 { color: #fff; }
.pocas-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px;
  max-width: 860px; margin: 36px auto 0;
}
.pocas-card {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: var(--radius); padding: 30px 20px;
}
.pocas-num { font-size: clamp(2.4rem, 5vw, 3.4rem); font-weight: 800; margin: 0; color: #fff; }
.pocas-label { margin: 6px 0 0; color: rgba(255,255,255,0.85); }
.pocas-nota { margin-top: 26px; color: rgba(255,255,255,0.75); font-size: 0.95rem; }

/* ============ Resultados ============ */
.periodo-bar {
  display: flex; flex-wrap: wrap; align-items: center; gap: 18px;
  background: var(--background); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 18px 22px; margin-bottom: 26px;
  position: relative;
  z-index: 220;
  isolation: isolate;
}
.periodo-selector {
  border: 0; margin: 0; padding: 0;
  display: flex; align-items: center; gap: 10px;
}
.periodo-selector legend {
  font-weight: 600; font-size: 0.85rem; color: var(--muted);
  float: left; margin-right: 12px; padding-top: 10px;
}
select, input[type="search"] {
  font-family: inherit; font-size: 1rem; color: var(--text);
  background: var(--surface); border: 1.5px solid var(--border);
  border-radius: var(--radius-sm); padding: 10px 14px;
}
select:focus, input[type="search"]:focus { border-color: var(--secondary); outline: none; }
.res-actualizacion { margin: 0; font-size: 0.92rem; color: var(--muted); font-weight: 500; }

.mapa-card {
  margin-bottom: 26px;
  padding: 24px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  position: relative;
  z-index: 1;
}

.mapa-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
}

.mapa-head h3 {
  margin: 0 0 6px;
}

.mapa-intro,
.mapa-nota {
  margin: 0;
  color: var(--muted);
}

.mapa-filtros {
  min-width: 260px;
}

.mapa-filtros select {
  width: 100%;
}

.mapa-lienzo {
  height: 460px;
  border: 1px solid var(--border);
  border-radius: calc(var(--radius) - 2px);
  overflow: hidden;
  background: #EAF3FB;
  position: relative;
  z-index: 1;
}

.mapa-lienzo .leaflet-popup-content {
  margin: 14px 16px;
}

.mapa-popup h4 {
  margin: 0 0 8px;
  color: var(--primary-dark);
}

.mapa-popup p {
  margin: 0 0 6px;
  color: var(--muted);
  font-size: 0.92rem;
}

.mapa-popup p:last-child {
  margin-bottom: 0;
}

.mapa-leyenda {
  display: flex;
  flex-wrap: wrap;
  gap: 14px 18px;
  margin-top: 14px;
  font-size: 0.9rem;
  color: var(--muted);
}

.mapa-leyenda span {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.mapa-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  display: inline-block;
}

.mapa-dot-ok { background: #1F8A6B; }
.mapa-dot-warn { background: #D97917; }
.mapa-dot-neutral { background: #6F8397; }

.marker-municipio {
  display: block;
  position: relative;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 3px solid #fff;
  box-shadow: 0 4px 12px rgba(15, 37, 73, 0.24);
  box-sizing: border-box;
}

.marker-municipio.ok { background: #1F8A6B; }
.marker-municipio.warn { background: #D97917; }
.marker-municipio.neutral { background: #6F8397; }

.marker-municipio::after {
  content: "";
  position: absolute;
  inset: 5px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.34);
}

.mapa-marker-icon {
  background: transparent;
  border: 0;
}

.dl-wrap { position: relative; margin-left: auto; z-index: 240; }
.dl-menu {
  position: absolute; right: 0; top: calc(100% + 8px); z-index: 260;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-sm); box-shadow: var(--shadow-hover);
  min-width: 220px; padding: 8px;
}
.dl-menu button {
  display: block; width: 100%; text-align: left;
  background: none; border: 0; padding: 10px 14px;
  border-radius: 8px; font-size: 0.95rem; color: var(--text);
}
.dl-menu button:hover { background: var(--background); }
.dl-grupo {
  margin: 8px 12px 2px; font-size: 0.75rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted);
}

.estado-vacio {
  text-align: center; padding: 70px 20px;
  background: var(--background); border: 1.5px dashed var(--border);
  border-radius: var(--radius);
}
.vacio-icono { font-size: 2.4rem; }
.estado-vacio p { color: var(--muted); }

/* Resumen del periodo */
.resumen-wrap {
  display: grid; grid-template-columns: 1.2fr 1fr; gap: 30px;
  background: var(--background); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 34px;
  box-shadow: var(--shadow); margin-bottom: 22px;
}
.resumen-kicker {
  text-transform: uppercase; letter-spacing: 0.1em; font-size: 0.78rem;
  font-weight: 700; color: var(--secondary); margin: 0 0 6px;
}
.resumen-num { font-size: clamp(2.8rem, 6vw, 4rem); font-weight: 800; color: var(--primary); margin: 0; line-height: 1; }
.resumen-label { color: var(--muted); margin: 4px 0 18px; }
.resumen-estado-texto { color: var(--muted); font-size: 0.95rem; }
.resumen-detalle { display: flex; gap: 28px; margin: 18px 0 0; }
.resumen-detalle div { display: flex; flex-direction: column; }
.resumen-detalle dt { font-size: 0.82rem; color: var(--muted); order: 2; }
.resumen-detalle dd { margin: 0; font-size: 1.5rem; font-weight: 700; color: var(--primary); }
.resumen-chart { max-width: 300px; margin: 0 auto; width: 100%; }
.donut-leyenda {
  display: flex; flex-direction: column; gap: 4px;
  font-size: 0.9rem; color: var(--muted); margin: 14px 0 0;
}
.dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 8px; }
.dot-ok { background: var(--success); }
.dot-warn { background: var(--warning); }

.estado-pill {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 8px 16px; border-radius: 999px;
  font-weight: 600; font-size: 0.95rem; margin: 0;
}
.estado-ok { background: var(--success-bg); color: var(--success); }
.estado-warn { background: var(--warning-bg); color: var(--warning); }
.estado-neutral { background: rgba(99, 117, 138, 0.12); color: var(--muted); }
.estado-icono {
  display: inline-flex; align-items: center; justify-content: center;
  width: 20px; height: 20px; border-radius: 50%;
  background: currentColor; color: #fff; font-size: 0.75rem; font-weight: 800;
}
.estado-pill .estado-icono { background: var(--success); }
.estado-warn .estado-icono { background: var(--warning); }
.estado-neutral .estado-icono { background: var(--muted); }

/* Comparación temporal */
.comparacion-card {
  background: var(--background); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 24px 28px; margin-bottom: 26px;
}
.comparacion-card h3 { margin-bottom: 14px; }
.comp-grid { display: flex; gap: 40px; }
.comp-periodo { margin: 0; font-size: 0.85rem; color: var(--muted); }
.comp-valor { margin: 0; font-size: 1.9rem; font-weight: 800; color: var(--primary); }
.comp-prev { color: var(--muted); }
.comp-diff { margin: 12px 0 0; font-weight: 600; }
.comp-ok { color: var(--success); }
.comp-warn { color: var(--warning); }
.comp-neutral { color: var(--muted); }

/* Buscador y filtros */
.buscador-bar {
  display: flex; flex-wrap: wrap; gap: 16px; align-items: center;
  margin: 20px 0 26px;
}
.buscador {
  display: flex; align-items: center; gap: 10px;
  background: var(--surface); border: 1.5px solid var(--border);
  border-radius: 999px; padding: 4px 18px; flex: 1; min-width: 260px;
}
.buscador input { border: 0; flex: 1; padding: 10px 0; background: transparent; }
.buscador input:focus { outline: none; }
.buscador:focus-within { border-color: var(--secondary); box-shadow: 0 0 0 3px rgba(78,165,217,0.18); }
.filtros { display: flex; gap: 8px; flex-wrap: wrap; }
.filtro-chip {
  border: 1.5px solid var(--border); background: var(--surface);
  border-radius: 999px; padding: 8px 18px; font-size: 0.9rem; font-weight: 600;
  color: var(--muted); transition: all 0.2s;
}
.filtro-chip:hover { border-color: var(--secondary); color: var(--secondary); }
.filtro-chip.activo { background: var(--primary); border-color: var(--primary); color: #fff; }
.param-sin-resultados { color: var(--muted); font-style: italic; }

/* Tarjetas de parámetros */
.param-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 20px;
}
.param-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 24px;
  box-shadow: var(--shadow);
  display: flex; flex-direction: column; gap: 14px;
  transition: transform 0.25s, box-shadow 0.25s;
}
.param-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-hover); }
.param-cat { font-size: 0.82rem; font-weight: 600; color: var(--secondary); }
.param-head h3 { margin: 4px 0 0; font-size: 1.12rem; }
.param-stats { display: flex; justify-content: space-between; gap: 10px; }
.param-num { font-size: 1.45rem; font-weight: 800; color: var(--primary); margin: 0; }
.num-warn { color: var(--warning); }
.param-sub { font-size: 0.78rem; color: var(--muted); margin: 2px 0 0; }
.param-barra {
  height: 10px; background: #E8F0F8; border-radius: 999px; overflow: hidden;
}
.param-barra-fill {
  height: 100%; border-radius: 999px;
  transition: width 0.9s cubic-bezier(0.22, 1, 0.36, 1);
}
.fill-ok { background: linear-gradient(90deg, var(--success), #3CBE8A); }
.fill-warn { background: linear-gradient(90deg, var(--warning), #F0B45C); }
.fill-neutral { background: linear-gradient(90deg, var(--muted), #90A0B2); }
.param-pct { margin: 0; font-size: 0.92rem; color: var(--muted); }
.param-pct strong { color: var(--primary); font-size: 1.05rem; }
.param-detalle-btn { margin-top: auto; align-self: flex-start; }

/* Tabla */
.tabla-detalle { margin-top: 30px; }
.tabla-detalle summary, .historial-detalle summary {
  cursor: pointer; font-weight: 600; color: var(--primary);
  padding: 14px 18px; background: var(--background);
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  list-style: none;
}
.tabla-detalle summary::before, .historial-detalle summary::before {
  content: '▸ '; color: var(--secondary);
}
.tabla-detalle[open] summary, .historial-detalle[open] summary {
  border-radius: var(--radius-sm) var(--radius-sm) 0 0;
}
.tabla-detalle summary::marker, .historial-detalle summary::marker { display: none; }
.tabla-scroll { overflow-x: auto; border: 1px solid var(--border); border-top: 0; border-radius: 0 0 var(--radius-sm) var(--radius-sm); }
.tabla { width: 100%; border-collapse: collapse; background: var(--surface); font-size: 0.95rem; }
.tabla th {
  text-align: left; padding: 14px 18px; background: var(--background);
  color: var(--primary); font-weight: 700; border-bottom: 2px solid var(--border);
}
.tabla td { padding: 13px 18px; border-bottom: 1px solid var(--border); }
.tabla tr:last-child td { border-bottom: 0; }
.tabla tr:hover td { background: #F2F8FD; }
.tabla-compacta th, .tabla-compacta td { padding: 9px 12px; font-size: 0.88rem; }

/* ============ Explorador ============ */
.explora-tabs { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 26px; }
.explora-tab {
  border: 1.5px solid var(--border); background: var(--surface);
  border-radius: var(--radius); padding: 16px 26px;
  font-size: 1.05rem; font-weight: 600; color: var(--text);
  transition: all 0.2s; flex: 1; min-width: 180px;
}
.explora-tab:hover { border-color: var(--secondary); }
.explora-tab.activo {
  background: var(--primary); border-color: var(--primary); color: #fff;
  box-shadow: var(--shadow-hover);
}
.explora-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 16px;
}
.explora-card {
  text-align: left; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 20px 22px;
  display: flex; flex-direction: column; gap: 4px;
  transition: transform 0.2s, box-shadow 0.2s;
}
.explora-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-hover); }
.explora-nombre { font-weight: 600; color: var(--text); }
.explora-pct { font-size: 1.7rem; font-weight: 800; color: var(--primary); }
.explora-sub { font-size: 0.85rem; color: var(--muted); }
.explora-vacio { color: var(--muted); }

/* ============ LMP + Metodología ============ */
.lmp-card {
  display: flex; align-items: center; justify-content: space-between; gap: 26px;
  background: linear-gradient(120deg, #EAF3FB, #F5F9FD);
  border: 1px solid var(--border); border-radius: var(--radius);
  padding: 32px 36px; margin-bottom: 56px; flex-wrap: wrap;
}
.lmp-card h2 { margin-bottom: 8px; }
.lmp-card p { margin: 0; max-width: 640px; color: var(--text); }

.proceso-linea {
  list-style: none; margin: 0; padding: 0;
  display: grid; grid-template-columns: repeat(6, 1fr); gap: 14px;
  counter-reset: paso;
}
.proceso-linea li {
  position: relative; background: var(--background);
  border: 1px solid var(--border); border-radius: var(--radius);
  padding: 22px 16px; text-align: center;
}
.pl-num {
  display: inline-flex; align-items: center; justify-content: center;
  width: 36px; height: 36px; border-radius: 50%;
  background: var(--secondary); color: #fff; font-weight: 700; margin-bottom: 10px;
}
.proceso-linea h3 { font-size: 0.98rem; }
.proceso-linea p { font-size: 0.85rem; color: var(--muted); margin: 0; }
.proceso-nota { margin-top: 24px; color: var(--muted); text-align: center; }

/* ============ Transparencia ============ */
.transparencia-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px;
}
.trans-item {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 20px 22px;
}
.trans-label {
  font-size: 0.78rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.08em; color: var(--muted); margin: 0 0 6px;
}
.trans-valor { margin: 0; font-weight: 600; color: var(--primary); }
.trans-counter-value {
  font-size: clamp(1.7rem, 3vw, 2.2rem);
  font-weight: 800;
  line-height: 1.1;
}
.trans-counter-note {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 0.92rem;
}
.trans-acciones { grid-row: span 2; }
.trans-btns { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.trans-link { font-weight: 600; font-size: 0.95rem; }
.historial-detalle { margin-top: 22px; }
.historial-lista {
  list-style: none; margin: 0; padding: 12px 18px;
  border: 1px solid var(--border); border-top: 0;
  border-radius: 0 0 var(--radius-sm) var(--radius-sm); background: var(--surface);
}
.historial-lista li {
  display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  padding: 10px 0; border-bottom: 1px solid var(--border);
}
.historial-lista li:last-child { border-bottom: 0; }
.hist-periodo { font-weight: 600; }
.hist-fecha { color: var(--muted); font-size: 0.92rem; }

/* ============ Datos abiertos ============ */
.datos-abiertos {
  background: linear-gradient(140deg, var(--primary-dark), var(--primary));
  color: #fff;
}
.datos-abiertos h2 { color: #fff; }
.datos-abiertos .lead { color: rgba(255,255,255,0.85); }
.datos-abiertos .hero-ctas { justify-content: center; }
.datos-abiertos .btn-outline { background: transparent; color: #fff; border-color: rgba(255,255,255,0.55); }
.datos-abiertos .btn-outline:hover { background: rgba(255,255,255,0.14); color: #fff; }
.datos-abiertos .btn-primary { background: var(--secondary); }
.datos-abiertos .btn-primary:hover { background: var(--accent); color: var(--primary-dark); }

/* ============ Footer ============ */
.site-footer {
  background: var(--primary-dark); color: rgba(255,255,255,0.8);
  padding: 56px 0 30px; font-size: 0.95rem;
}
.footer-grid {
  display: grid; grid-template-columns: 1.1fr 1fr 1fr 1fr auto; gap: 30px;
  padding-bottom: 34px; border-bottom: 1px solid rgba(255,255,255,0.14);
}
.footer-logo-ut {
  display: block;
  max-width: 85px;
  width: 100%;
  height: auto;
  object-fit: contain;
  margin-bottom: 10px;
}
.footer-area {
  margin: 0 0 4px;
  font-size: 0.82rem;
  font-weight: 700;
  color: #fff;
}
.footer-logo-side {
  display: flex;
  justify-content: flex-end;
  align-items: center;
}
.footer-logo-link {
  display: inline-flex;
  align-items: center;
}
.footer-logo-link:hover {
  text-decoration: none;
}
.footer-logo-infoqro {
  display: block;
  max-width: 220px;
  width: 100%;
  height: auto;
  object-fit: contain;
}
.footer-org { margin: 0; font-size: 0.88rem; }
.site-footer h3 { color: #fff; font-size: 0.95rem; margin-bottom: 12px; }
.site-footer ul { list-style: none; margin: 0; padding: 0; }
.site-footer li { margin-bottom: 8px; }
.site-footer a { color: rgba(255,255,255,0.8); }
.site-footer a:hover { color: var(--accent); }
.footer-base { padding-top: 24px; }
.footer-base p { margin: 0 0 6px; font-size: 0.85rem; }
.admin-link {
  display: inline-block; margin-top: 10px; font-size: 0.85rem;
  color: rgba(255,255,255,0.55) !important;
}

/* ============ Modal ============ */
.modal {
  position: fixed; inset: 0; z-index: 300;
  background: rgba(15, 37, 73, 0.55);
  backdrop-filter: blur(4px);
  display: flex; align-items: flex-start; justify-content: center;
  padding: 5vh 20px; overflow-y: auto;
}
.modal[hidden] { display: none; }
.modal-panel {
  background: var(--surface); border-radius: var(--radius);
  max-width: 720px; width: 100%; padding: 34px;
  box-shadow: 0 24px 70px rgba(15, 37, 73, 0.35);
  animation: modalIn 0.25s ease;
}
@keyframes modalIn {
  from { transform: translateY(24px); opacity: 0; }
  to { transform: none; opacity: 1; }
}
.modal-head {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 16px;
  margin-bottom: 8px;
}
.modal-head h2 { margin: 0; }
.modal-cerrar {
  background: var(--background); border: 1px solid var(--border);
  width: 38px; height: 38px; border-radius: 50%; font-size: 1rem;
  color: var(--muted); flex-shrink: 0;
}
.modal-cerrar:hover { color: var(--danger); border-color: var(--danger); }
.modal-seccion { margin-bottom: 22px; }
.modal-seccion h3 { font-size: 1rem; color: var(--secondary); margin-bottom: 6px; }
.modal-seccion p { margin: 0; color: var(--text); }
.modal-nota {
  background: #EAF3FB; border-radius: var(--radius-sm);
  padding: 16px 20px;
}
.modal-tecnico { font-size: 0.9rem; color: var(--muted); margin-top: 8px !important; }
.modal-resultado {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px;
  margin: 0 0 14px;
}
.modal-resultado div {
  background: var(--background); border-radius: var(--radius-sm);
  padding: 12px 14px; text-align: center;
}
.modal-resultado dt { font-size: 0.75rem; color: var(--muted); }
.modal-resultado dd { margin: 2px 0 0; font-size: 1.25rem; font-weight: 800; color: var(--primary); }
.hist-controles {
  display: flex; flex-wrap: wrap; gap: 12px; align-items: center; margin-bottom: 14px;
}
.hist-range { display: flex; gap: 6px; }
.hist-range-btn {
  border: 1.5px solid var(--border); background: var(--surface);
  border-radius: 999px; padding: 7px 16px; font-size: 0.85rem; font-weight: 600;
  color: var(--muted);
}
.hist-range-btn.activo { background: var(--primary); border-color: var(--primary); color: #fff; }
.hist-chart-wrap { height: 280px; position: relative; }

/* ============ Admin ============ */
.admin-wrap { padding: 40px 24px 80px; max-width: 900px; }
.admin-aviso {
  background: var(--warning-bg); color: var(--warning);
  border: 1px solid #F0D9B0; border-radius: var(--radius-sm);
  padding: 12px 18px; font-weight: 600; font-size: 0.95rem;
}
.admin-head {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 16px; flex-wrap: wrap; margin: 26px 0;
}
.admin-head h1 { margin-bottom: 2px; }
.admin-sub { color: var(--muted); margin: 0; }
.admin-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 30px; margin-bottom: 26px;
  box-shadow: var(--shadow);
}
.admin-periodo { font-size: 1.6rem; font-weight: 800; color: var(--primary); margin: 0 0 18px; }
.admin-hint { color: var(--muted); font-size: 0.95rem; }
.admin-hint code {
  background: var(--background); padding: 2px 7px; border-radius: 6px; font-size: 0.85em;
}
.admin-historial { list-style: none; margin: 0 0 20px; padding: 0; }
.admin-hist-row {
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
  padding: 12px 4px; border-bottom: 1px solid var(--border);
}
.admin-hist-row:last-child { border-bottom: 0; }
.demo-tag { font-style: normal; font-size: 0.75rem; color: var(--warning); font-weight: 600; }
.admin-hist-vacia { color: var(--muted); }

.drop-zone {
  border: 2px dashed var(--accent); border-radius: var(--radius);
  background: #F2F9FE; text-align: center; padding: 46px 20px;
  margin: 18px 0; transition: all 0.2s;
}
.drop-zone.drag-over {
  border-color: var(--secondary); background: #E3F2FC;
  transform: scale(1.01);
}
.drop-icono { font-size: 2.4rem; }
.drop-zone p { margin: 6px 0; font-weight: 600; color: var(--primary); }
.drop-o { color: var(--muted) !important; font-weight: 400 !important; }
.drop-formatos { font-size: 0.85rem; color: var(--muted) !important; font-weight: 400 !important; }

.import-loading { color: var(--secondary); font-weight: 600; }
.import-ok { color: var(--success); font-weight: 600; }
.import-error {
  background: var(--danger-bg); border: 1px solid #F0C4C4;
  border-radius: var(--radius-sm); padding: 16px 20px; color: var(--danger);
}
.import-error ul { margin: 8px 0 0; padding-left: 20px; font-weight: 400; }
.import-warning {
  background: var(--warning-bg); border: 1px solid #F0D9B0;
  border-radius: var(--radius-sm); padding: 16px 20px; color: var(--warning);
}
.import-warning ul { margin: 8px 0 0; padding-left: 20px; font-weight: 400; }

.import-preview h3 { margin-top: 22px; }
.preview-grid {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin: 0 0 18px;
}
.preview-grid div {
  background: var(--background); border-radius: var(--radius-sm);
  padding: 14px 16px; text-align: center;
}
.preview-grid dt { font-size: 0.78rem; color: var(--muted); }
.preview-grid dd { margin: 4px 0 0; font-size: 1.3rem; font-weight: 800; color: var(--primary); }
.preview-acciones { display: flex; gap: 12px; justify-content: flex-end; margin-top: 18px; }

/* ============ Responsive ============ */
@media (max-width: 1020px) {
  .proceso-4 { grid-template-columns: 1fr 1fr; }
  .proceso-flecha { display: none; }
  .proceso-linea { grid-template-columns: repeat(3, 1fr); }
  .cards-3, .cards-4 { grid-template-columns: 1fr 1fr; }
  .glosario-grid { grid-template-columns: 1fr 1fr; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .lectura-grid { grid-template-columns: 1fr 1fr; }
  .lectura-explain,
  .proceso-info-grid { grid-template-columns: 1fr; }
  .proceso-side { display: grid; grid-template-columns: 1fr 1fr; }
}

@media (max-width: 760px) {
  body { font-size: 1rem; }

  .nav-toggle { display: flex; }
  .header-logo-right { display: none; }
  .site-header nav {
    position: absolute; top: 100%; left: 0; right: 0;
    background: var(--surface); border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow-hover);
  }
  .menu {
    display: none; flex-direction: column; padding: 12px 20px 18px; gap: 2px;
  }
  .menu.abierto { display: flex; }
  .menu a { padding: 12px 14px; border-radius: var(--radius-sm); }

  .cards-3, .cards-4, .pocas-grid, .proceso-4,
  .glosario-grid { grid-template-columns: 1fr; }
  .lectura-grid,
  .lectura-example-grid,
  .proceso-side { grid-template-columns: 1fr; }
  .mapa-head {
    flex-direction: column;
    align-items: stretch;
  }
  .mapa-filtros {
    min-width: 0;
  }
  .mapa-lienzo {
    height: 380px;
  }
  .video-panel { padding: 12px; }
  .proceso-flow::before { left: 28px; }
  .proceso-step {
    grid-template-columns: 52px 1fr;
    padding: 14px 14px 14px 10px;
  }
  .proceso-step-icon {
    width: 48px;
    height: 48px;
    font-size: 1.4rem;
  }
  .proceso-step-num {
    position: absolute;
    left: 47px;
    top: 12px;
    width: 32px;
    height: 32px;
    border: 3px solid #fff;
    font-size: 0.9rem;
  }
  .proceso-step-copy {
    grid-column: 2;
  }
  .proceso-step-copy h4 {
    padding-left: 28px;
    font-size: 1.05rem;
  }
  .proceso-step-copy p {
    font-size: 0.92rem;
  }
  .proceso-step:not(:last-child)::after { left: 20px; }
  .proceso-side-lmp { align-items: flex-start; }
  .proceso-linea { grid-template-columns: 1fr 1fr; }
  .resumen-wrap { grid-template-columns: 1fr; padding: 26px 20px; }
  .periodo-selector legend { float: none; display: block; margin: 0 0 8px; padding: 0; }
  .periodo-selector { flex-direction: column; align-items: flex-start; }
  .periodo-bar { flex-direction: column; align-items: stretch; }
  .dl-wrap { margin-left: 0; }
  .dl-menu { left: 0; right: auto; }
  .modal-resultado, .preview-grid { grid-template-columns: 1fr 1fr; }
  .modal-panel { padding: 24px 20px; }
  .footer-grid { grid-template-columns: 1fr; }
  .footer-logo-side { justify-content: flex-start; }
  .comp-grid { gap: 24px; }
  .ind-card-wide { grid-column: span 1; }

  /* Las tablas se transforman en tarjetas */
  .tabla thead { display: none; }
  .tabla, .tabla tbody, .tabla tr, .tabla td { display: block; width: 100%; }
  .tabla tr { border-bottom: 2px solid var(--border); padding: 8px 0; }
  .tabla td { border: 0; padding: 6px 18px; }
  .tabla td::before {
    content: attr(data-th);
    display: block; font-size: 0.75rem; font-weight: 700;
    text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted);
  }
}

@media (max-width: 480px) {
  .lectura-example-grid,
  .proceso-side { grid-template-columns: 1fr; }
  .lectura-explain { gap: 14px; }
  .proceso-side-lmp {
    flex-direction: column;
    align-items: flex-start;
  }
}
