/* =====================================================================
   NuevoSur · Portal de Transparencia Santa Aurora 2026
   Sistema visual: bosque (confianza, territorio) + cobre (techumbres, acción)
   ===================================================================== */

:root {
  --ink: #13201b;
  --ink-2: #3a4741;
  --ink-3: #5f6b65;
  --forest: #1d4a38;
  --forest-600: #255c46;
  --forest-700: #163a2c;
  --forest-50: #e7efe9;
  --moss: #9db89a;
  --copper: #b4512a;
  --copper-600: #9a4321;
  --copper-300: #e9a27a;
  --copper-50: #f8ebe3;
  --paper: #f6f3ec;
  --paper-2: #eee9de;
  --line: #dcd5c6;
  --line-2: #e9e4d8;
  --white: #ffffff;
  --ok: #2c7a4b;
  --ok-50: #e3f1e8;
  --warn: #9a6512;
  --warn-50: #fbf0db;
  --danger: #b3261e;
  --danger-50: #fbe7e5;
  --plan: #9aa59f;

  --font: "Archivo", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --r-sm: 8px;
  --r: 14px;
  --r-lg: 22px;
  --shadow-sm: 0 1px 2px rgba(19, 32, 27, .06), 0 2px 8px rgba(19, 32, 27, .05);
  --shadow: 0 2px 4px rgba(19, 32, 27, .04), 0 18px 48px -12px rgba(19, 32, 27, .22);
  --wrap: 1240px;
  --gutter: clamp(16px, 4vw, 40px);
  --section: clamp(64px, 9vw, 128px);
  --head-h: 112px;
  --ease: cubic-bezier(.2, .7, .2, 1);
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 96px; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 1.0625rem;
  line-height: 1.6;
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img { max-width: 100%; display: block; }
a { color: var(--forest); text-underline-offset: 3px; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
h1, h2, h3, h4 { margin: 0; line-height: 1.12; letter-spacing: -.02em; font-weight: 750; }
p { margin: 0; }
ul, ol { margin: 0; padding: 0; }
code { font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; font-size: .9em; background: var(--paper-2); padding: .1em .35em; border-radius: 4px; }
[hidden] { display: none !important; }
.num, .kpi__value, .stat__value, .money__value, .table td { font-variant-numeric: tabular-nums; }
.sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.ico { width: 1.15em; height: 1.15em; flex: none; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; vertical-align: -.2em; }
:focus-visible { outline: 3px solid var(--copper); outline-offset: 2px; border-radius: 4px; }
main:focus { outline: none; }

.wrap { width: 100%; max-width: var(--wrap); margin-inline: auto; padding-inline: var(--gutter); }

.skip-link {
  position: fixed; top: 8px; left: 8px; z-index: 100;
  background: var(--ink); color: #fff; padding: 10px 16px; border-radius: var(--r-sm);
  transform: translateY(-160%); transition: transform .2s;
}
.skip-link:focus { transform: none; }

/* ---------- Tipografía ---------- */
.eyebrow {
  display: inline-flex; align-items: center; gap: 10px;
  font-size: .8125rem; font-weight: 650; letter-spacing: .12em; text-transform: uppercase;
  color: var(--copper); margin-bottom: 16px;
}
.eyebrow--light { color: var(--copper-300); }
.h2 { font-size: clamp(2rem, 3.8vw, 3.25rem); font-weight: 800; letter-spacing: -.03em; line-height: 1.04; max-width: 18ch; }
.h2--light { color: #fff; }
.lead { font-size: clamp(1.0625rem, 1.4vw, 1.25rem); color: var(--ink-2); line-height: 1.6; max-width: 56ch; margin-top: 20px; }
.muted { color: var(--ink-3); }
.stamp { display: block; font-size: .875rem; color: var(--ink-3); margin-top: 12px; }
.stamp .ico { margin-right: 4px; }
.stamp--light { color: rgba(255, 255, 255, .82); }
.note {
  position: relative; display: block; padding: 16px 0 0 28px;
  font-size: .9rem; color: var(--ink-3); margin-top: 20px; border-top: 1px solid var(--line-2);
}
.note .ico { position: absolute; left: 0; top: 19px; color: var(--forest); }

/* ---------- Botones ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 48px; padding: 12px 22px; border-radius: 999px; border: 1.5px solid transparent;
  font-weight: 650; font-size: 1rem; line-height: 1.1; text-decoration: none; white-space: nowrap;
  transition: background-color .2s var(--ease), color .2s var(--ease), border-color .2s var(--ease), transform .2s var(--ease), box-shadow .2s;
}
.btn .ico { transition: transform .25s var(--ease); }
.btn:hover .ico { transform: translateX(3px); }
.btn:active { transform: translateY(1px); }
.btn--sm { min-height: 40px; padding: 8px 16px; font-size: .9375rem; }
.btn--lg { min-height: 56px; padding: 14px 28px; font-size: 1.0625rem; }
.btn--block { width: 100%; }
.btn--accent { background: var(--copper); color: #fff; }
.btn--accent:hover { background: var(--copper-600); }
.btn--primary { background: var(--forest); color: #fff; }
.btn--primary:hover { background: var(--forest-700); }
.btn--outline { border-color: var(--ink); color: var(--ink); background: transparent; }
.btn--outline:hover { background: var(--ink); color: #fff; }
.btn--ghost { background: var(--paper-2); color: var(--ink); }
.btn--ghost:hover { background: var(--line); }
.btn--ghost-light { border-color: rgba(255, 255, 255, .7); color: #fff; background: rgba(255, 255, 255, .06); backdrop-filter: blur(6px); }
.btn--ghost-light:hover { background: #fff; color: var(--ink); }
.btn--danger { background: var(--danger-50); color: var(--danger); }
.btn--danger:hover { background: var(--danger); color: #fff; }
.btn[disabled] { opacity: .5; pointer-events: none; }

.link-arrow {
  display: inline-flex; align-items: center; gap: 8px; padding: 6px 0;
  background: none; border: 0; font-weight: 650; color: var(--forest); text-decoration: none;
  border-bottom: 1.5px solid currentColor;
}
.link-arrow:hover { color: var(--copper); }
.link-arrow:hover .ico { transform: translateX(3px); }
.link-arrow .ico { transition: transform .2s var(--ease); }

/* ---------- Encabezado ---------- */
.masthead { position: fixed; inset: 0 0 auto; z-index: 50; padding-top: env(safe-area-inset-top, 0px); color: #fff; transition: background-color .3s, box-shadow .3s, color .3s; }
.utility { font-size: .8125rem; border-bottom: 1px solid rgba(255, 255, 255, .14); max-height: 40px; overflow: hidden; transition: max-height .3s var(--ease), opacity .3s; }
.utility__inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 40px; }
.utility__msg { display: flex; align-items: center; gap: 8px; opacity: .85; }
.utility__actions { display: flex; align-items: center; gap: 20px; }
.utility__link { display: inline-flex; align-items: center; gap: 6px; color: inherit; text-decoration: none; opacity: .85; }
.utility__link:hover { opacity: 1; text-decoration: underline; }
.saver-toggle {
  display: inline-flex; align-items: center; gap: 8px; padding: 4px 4px 4px 10px; border-radius: 999px;
  background: rgba(255, 255, 255, .1); border: 1px solid rgba(255, 255, 255, .22); color: inherit; font-size: .8125rem;
}
.saver-toggle__state { padding: 1px 8px; border-radius: 999px; background: rgba(255, 255, 255, .18); font-weight: 650; }
.saver-toggle[aria-pressed="true"] .saver-toggle__state { background: var(--copper-300); color: var(--ink); }

.navbar__inner { display: flex; align-items: center; gap: 32px; min-height: 72px; }
.brand { display: inline-flex; align-items: center; gap: 12px; color: inherit; text-decoration: none; margin-right: auto; }
.brand__mark { width: 40px; height: 40px; flex: none; }
.brand__text { display: flex; flex-direction: column; line-height: 1.05; }
.brand__name { font-size: 1.375rem; font-weight: 450; letter-spacing: -.02em; }
.brand__name b { font-weight: 800; }
.brand__sub { font-size: .75rem; letter-spacing: .06em; text-transform: uppercase; opacity: .78; margin-top: 3px; }
.mainnav { display: flex; gap: 4px; }
.mainnav a {
  position: relative; padding: 10px 14px; border-radius: 999px; color: inherit; text-decoration: none;
  font-weight: 550; font-size: .975rem; transition: background-color .2s;
}
.mainnav a:hover { background: rgba(255, 255, 255, .12); }
.mainnav a[aria-current="page"]::after {
  content: ""; position: absolute; left: 14px; right: 14px; bottom: 2px; height: 2px; border-radius: 2px; background: var(--copper-300);
}
.masthead.is-solid {
  background: rgba(255, 255, 255, .94); color: var(--ink);
  box-shadow: 0 1px 0 var(--line), 0 10px 30px -18px rgba(19, 32, 27, .3);
  backdrop-filter: saturate(1.4) blur(14px);
}
.masthead.is-solid .utility { max-height: 0; opacity: 0; border-color: transparent; }
.masthead.is-solid .mainnav a:hover { background: var(--paper-2); }
.masthead.is-solid .mainnav a[aria-current="page"]::after { background: var(--copper); }

/* ---------- Hero ---------- */
.hero {
  position: relative; isolation: isolate; color: #fff; background: var(--forest-700);
  min-height: min(84vh, 780px); display: flex; align-items: flex-end; overflow: hidden;
  padding: calc(var(--head-h) + 40px) 0 clamp(140px, 13vw, 170px);
}
.hero::before {
  content: ""; position: absolute; inset: 0; z-index: -2;
  background: var(--forest-700) 50% 62% / cover no-repeat;
  animation: heroZoom 18s var(--ease) both;
}
html:not(.saver) .hero::before { background-image: url("../assets/img/hero.webp"); }
@media (max-width: 700px) {
  html:not(.saver) .hero::before { background-image: url("../assets/img/hero-sm.webp"); }
  .hero::before { background-position: 84% 50%; }
}
@keyframes heroZoom { from { transform: scale(1.08); } to { transform: scale(1); } }
.hero__shade {
  position: absolute; inset: 0; z-index: -1;
  background:
    linear-gradient(90deg, rgba(10, 20, 16, .88) 0%, rgba(10, 20, 16, .55) 45%, rgba(10, 20, 16, .1) 80%),
    linear-gradient(0deg, rgba(10, 20, 16, .6) 0%, transparent 40%);
}
.hero__inner { max-width: var(--wrap); }
.hero__title {
  font-size: clamp(2.5rem, 5.4vw, 4.75rem); font-weight: 800; line-height: .98; letter-spacing: -.04em;
  max-width: 16ch; text-wrap: balance;
}
.hero__title span { display: block; color: var(--copper-300); }
.hero__lead { font-size: clamp(1.0625rem, 1.5vw, 1.3rem); max-width: 54ch; margin-top: 24px; color: rgba(255, 255, 255, .88); }
.hero__lead strong { color: #fff; font-weight: 650; }
.hero__ctas { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 36px; }
.pulse { width: 9px; height: 9px; border-radius: 50%; background: #7fd39b; box-shadow: 0 0 0 0 rgba(127, 211, 155, .7); animation: pulse 2.2s infinite; }
@keyframes pulse { 70% { box-shadow: 0 0 0 10px rgba(127, 211, 155, 0); } 100% { box-shadow: 0 0 0 0 rgba(127, 211, 155, 0); } }

/* ---------- Respuesta directa ---------- */
.answer-wrap { position: relative; z-index: 2; margin-top: clamp(-150px, -13vw, -110px); }
.answer {
  background: var(--white); border-radius: var(--r-lg); box-shadow: var(--shadow);
  padding: clamp(24px, 3.4vw, 44px); border: 1px solid var(--line-2);
}
.answer__head { display: flex; flex-direction: column; margin-bottom: 28px; }
.answer__head .eyebrow { margin-bottom: 10px; }
.answer__head h2 { font-size: clamp(1.4rem, 2.4vw, 2rem); font-weight: 750; max-width: 32ch; text-wrap: balance; }
.answer__grid { display: grid; grid-template-columns: 1.15fr 1fr .8fr; gap: clamp(16px, 2vw, 28px); }
.kpi { display: flex; gap: 22px; align-items: center; padding: 24px; border-radius: var(--r); background: var(--forest-50); }
.kpi--money { background: var(--copper-50); }
.kpi__body { flex: 1; min-width: 0; }
.kpi__ring { width: 128px; height: 128px; flex: none; }
.kpi__label { font-size: .9375rem; font-weight: 650; color: var(--ink-2); letter-spacing: 0; }
.kpi__value { font-size: clamp(2.4rem, 4vw, 3.4rem); font-weight: 800; letter-spacing: -.04em; line-height: 1.05; margin-top: 4px; }
.kpi--money .kpi__value { color: var(--copper-600); }
.kpi .kpi__value { color: var(--forest); }
.kpi--money .kpi__value { color: var(--copper-600); }
.kpi__note { font-size: .9375rem; color: var(--ink-2); margin-top: 6px; }
.kpi__split { display: flex; justify-content: space-between; gap: 12px; font-size: .9375rem; margin-top: 10px; color: var(--ink-2); }
.kpi__split b { color: var(--ink); }
.kpi .stamp { margin-top: 10px; font-size: .8125rem; }
.delta { display: inline-block; font-size: .8125rem; font-weight: 700; padding: 2px 9px; border-radius: 999px; margin-left: 4px; background: var(--ok-50); color: var(--ok); white-space: nowrap; }
.delta.is-neg { background: var(--warn-50); color: var(--warn); }
.answer__facts { list-style: none; display: grid; gap: 0; align-content: center; }
.answer__facts li { display: flex; flex-direction: column; padding: 14px 0; border-bottom: 1px solid var(--line-2); }
.answer__facts li:last-child { border: 0; }
.answer__facts b { font-size: 1.75rem; font-weight: 800; letter-spacing: -.03em; line-height: 1.1; }
.answer__facts li > span { font-size: .9375rem; color: var(--ink-3); }
.kpi__value small { font-size: .42em; font-weight: 700; letter-spacing: -.01em; margin-left: .25em; }
.answer__actions { display: flex; flex-wrap: wrap; gap: 12px 32px; margin-top: 28px; padding-top: 24px; border-top: 1px solid var(--line-2); }

.meter, .bar { position: relative; height: 10px; border-radius: 999px; background: rgba(19, 32, 27, .1); overflow: hidden; }
.meter { margin-top: 14px; background: rgba(154, 67, 33, .14); }
.meter span, .bar span { position: absolute; inset: 0 auto 0 0; width: 0; border-radius: inherit; background: var(--forest); transition: width 1.1s var(--ease); }
.meter span, .bar--copper span { background: var(--copper); }
.bar--muted span { background: var(--plan); }
.bar--light { background: rgba(255, 255, 255, .25); }
.bar--light span { background: #fff; }
.bar--lg { height: 14px; }

/* ---------- Secciones ---------- */
.section { padding-block: var(--section); }
.section--tint { background: var(--paper-2); }
.section__head { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px 48px; flex-wrap: wrap; margin-bottom: clamp(32px, 4vw, 56px); }
.section__aside { max-width: 36ch; color: var(--ink-3); }

.split { display: grid; grid-template-columns: 1fr 1.05fr; gap: clamp(32px, 6vw, 96px); align-items: start; }
.split__figure { margin: 40px 0 0; }
.split__figure img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; border-radius: var(--r); }
.h2 { text-wrap: balance; }
.split__figure figcaption { font-size: .8125rem; color: var(--ink-3); margin-top: 10px; }
.split--docs { align-items: center; }
.split--docs .btn { margin-top: 32px; }

.facts { display: grid; grid-template-columns: 1fr 1fr; margin: 0; border-top: 2px solid var(--ink); }
.facts__item { padding: 22px 0; border-bottom: 1px solid var(--line); padding-right: 20px; }
.facts__item:nth-child(even) { padding-left: 20px; border-left: 1px solid var(--line); }
.facts__item--wide { grid-column: 1 / -1; padding-right: 0; }
.facts__item--wide + .facts__item { padding-left: 0; border-left: 0; }
.facts__item--wide + .facts__item + .facts__item { padding-left: 20px; border-left: 1px solid var(--line); }
.facts__item--wide ~ .facts__item:nth-child(odd) { padding-left: 20px; border-left: 1px solid var(--line); }
.facts__item--wide ~ .facts__item:nth-child(even) { padding-left: 0; border-left: 0; }
.facts dt { font-size: .8125rem; font-weight: 650; text-transform: uppercase; letter-spacing: .08em; color: var(--ink-3); margin-bottom: 6px; }
.facts dd { margin: 0; font-size: 1.125rem; font-weight: 600; line-height: 1.35; }
.facts__item--wide dd { font-size: 1.375rem; font-weight: 750; letter-spacing: -.01em; }
.facts dd.facts__sub { font-size: .9375rem; font-weight: 400; color: var(--ink-3); margin-top: 4px; }
.status { display: inline-flex; align-items: center; gap: 8px; padding: 4px 12px; border-radius: 999px; background: var(--ok-50); color: var(--ok); font-weight: 700; font-size: .9375rem; }
.status::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.status.is-warn { background: var(--warn-50); color: var(--warn); }
.status.is-muted { background: var(--paper-2); color: var(--ink-3); }

/* Tarjetas por tipo */
.type-cards { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(16px, 2vw, 28px); }
.type-card {
  position: relative; display: flex; align-items: flex-end; min-height: clamp(420px, 42vw, 540px);
  border-radius: var(--r-lg); overflow: hidden; color: #fff; text-decoration: none; isolation: isolate; background: var(--forest-700);
}
.type-card img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: -2; transition: transform .8s var(--ease); }
.type-card::before { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(0deg, rgba(10, 20, 16, .92) 0%, rgba(10, 20, 16, .45) 50%, rgba(10, 20, 16, .05) 100%); }
.type-card:hover img { transform: scale(1.05); }
.type-card__body { padding: clamp(24px, 3vw, 40px); width: 100%; }
.type-card__count { font-size: .9375rem; opacity: .85; }
.type-card__count b { font-weight: 800; }
.type-card h3 { font-size: clamp(1.75rem, 2.8vw, 2.5rem); font-weight: 800; letter-spacing: -.03em; margin-top: 6px; }
.type-card p:not(.type-card__count) { margin-top: 10px; color: rgba(255, 255, 255, .85); max-width: 44ch; }
.type-card__progress { display: flex; align-items: center; gap: 18px; margin-top: 24px; }
.type-card__progress .bar { flex: 1; }
.type-card__pct { font-size: 2rem; font-weight: 800; letter-spacing: -.03em; min-width: 3.4em; }

/* Ranking de sectores (inicio) */
.rank { list-style: none; display: grid; grid-template-columns: repeat(3, 1fr); gap: 0; border-top: 2px solid var(--ink); }
.rank li { padding: 24px 24px 26px 0; border-bottom: 1px solid var(--line); }
.rank li:not(:nth-child(3n + 1)) { padding-left: 24px; border-left: 1px solid var(--line); }
.rank__top { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.rank__name { font-size: 1.25rem; font-weight: 750; letter-spacing: -.01em; }
.rank__pct { font-size: 1.75rem; font-weight: 800; letter-spacing: -.03em; color: var(--forest); }
.rank__meta { font-size: .875rem; color: var(--ink-3); margin: 4px 0 14px; }

/* Banda */
.band { position: relative; isolation: isolate; color: #fff; background: var(--forest-700); padding-block: clamp(80px, 11vw, 150px); overflow: hidden; }
.band__img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: -2; }
.band__shade { position: absolute; inset: 0; z-index: -1; background: linear-gradient(180deg, rgba(16, 38, 29, .78), rgba(16, 38, 29, .92)); }
.pillars { list-style: none; display: grid; grid-template-columns: repeat(4, 1fr); gap: 0; margin-top: clamp(40px, 5vw, 72px); border-top: 1px solid rgba(255, 255, 255, .25); }
.pillars li { padding: 28px 28px 0 0; }
.pillars li + li { padding-left: 28px; border-left: 1px solid rgba(255, 255, 255, .18); }
.pillars .ico { width: 30px; height: 30px; color: var(--copper-300); stroke-width: 1.6; }
.pillars h3 { font-size: 1.25rem; font-weight: 750; margin-top: 18px; }
.pillars p { color: rgba(255, 255, 255, .8); margin-top: 8px; font-size: .975rem; }

/* Tira de evidencias */
.strip { display: grid; grid-template-columns: 2fr 1fr 1fr; grid-template-rows: auto auto; gap: 16px; }
.strip .ph { position: relative; border-radius: var(--r); overflow: hidden; background: var(--paper-2); border: 0; padding: 0; text-align: left; color: #fff; }
.strip .ph:first-child { grid-row: span 2; }
.strip .ph img { width: 100%; height: 100%; object-fit: cover; aspect-ratio: 4 / 3; transition: transform .6s var(--ease); }
.strip .ph:first-child img { aspect-ratio: auto; min-height: 100%; }
.strip .ph:hover img { transform: scale(1.04); }
.ph__cap { position: absolute; inset: auto 0 0 0; padding: 40px 16px 14px; background: linear-gradient(0deg, rgba(10, 20, 16, .85), transparent); font-size: .875rem; line-height: 1.35; }
.ph__cap b { display: block; font-size: 1rem; font-weight: 700; }


/* ---------- Encabezado de páginas internas ---------- */
.page-head { position: relative; isolation: isolate; color: #fff; background: var(--forest-700); padding: calc(var(--head-h) + 56px) 0 clamp(48px, 6vw, 80px); overflow: hidden; }
.page-head__img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: -2; }
.page-head__shade { position: absolute; inset: 0; z-index: -1; background: linear-gradient(90deg, rgba(10, 20, 16, .92), rgba(10, 20, 16, .6) 60%, rgba(10, 20, 16, .35)); }
.page-head__title { font-size: clamp(2.4rem, 5.2vw, 4.4rem); font-weight: 800; letter-spacing: -.04em; line-height: 1; margin-top: 18px; }
.page-head__lead { font-size: clamp(1.0625rem, 1.4vw, 1.2rem); color: rgba(255, 255, 255, .86); max-width: 58ch; margin-top: 16px; }
.crumbs { display: flex; gap: 8px; font-size: .875rem; color: rgba(255, 255, 255, .75); }
.crumbs a { color: #fff; }
.page-body { padding-block: clamp(32px, 4vw, 56px) var(--section); display: grid; grid-template-columns: minmax(0, 1fr); gap: clamp(20px, 2.4vw, 32px); }
.field > input, .field > select, .input-icon input { min-width: 0; }

/* Paneles */
.panel { background: var(--white); border: 1px solid var(--line-2); border-radius: var(--r-lg); padding: clamp(20px, 3vw, 40px); box-shadow: var(--shadow-sm); }
.panel__head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px 32px; margin-bottom: 24px; }
.panel__head--wrap { flex-wrap: wrap; }
.panel__title { font-size: clamp(1.375rem, 2vw, 1.75rem); font-weight: 750; letter-spacing: -.02em; }
.panel__sub { color: var(--ink-3); margin-top: 6px; font-size: .975rem; }
.result-count { font-size: .9rem; color: var(--ink-3); margin: 4px 0 16px; }

/* Indicadores */
.stats { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: clamp(12px, 1.6vw, 20px); }
.stat { background: var(--white); border: 1px solid var(--line-2); border-radius: var(--r-lg); padding: 24px; box-shadow: var(--shadow-sm); display: flex; flex-direction: column; gap: 10px; }
.stat--feature { flex-direction: row; align-items: center; gap: 20px; background: var(--forest); color: #fff; border-color: transparent; }
.stat__ring { width: 112px; height: 112px; flex: none; }
.stat__label { font-size: .9375rem; font-weight: 650; color: var(--ink-3); letter-spacing: 0; }
.stat--feature .stat__label { color: rgba(255, 255, 255, .8); }
.stat__value { font-size: clamp(2rem, 3vw, 2.75rem); font-weight: 800; letter-spacing: -.04em; line-height: 1; }
.stat__value small { font-size: .5em; font-weight: 600; color: var(--ink-3); letter-spacing: 0; }
.stat__note { font-size: .875rem; color: var(--ink-3); }
.stat--feature .stat__note { color: rgba(255, 255, 255, .85); }
.stat--feature .delta { background: rgba(255, 255, 255, .16); color: #fff; }
.stat .bar { margin-top: auto; }

/* Anillo SVG */
.ring-svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring-svg .ring-bg { stroke: rgba(19, 32, 27, .1); }
.ring-svg .ring-fg { stroke: var(--forest); transition: stroke-dashoffset 1.2s var(--ease); }
.ring-svg .ring-plan { stroke: var(--copper); }
.stat--feature .ring-svg .ring-bg { stroke: rgba(255, 255, 255, .18); }
.stat--feature .ring-svg .ring-fg { stroke: #fff; }
.stat--feature .ring-svg .ring-plan { stroke: var(--copper-300); }

/* Gráfico de curva */
.legend { list-style: none; display: flex; gap: 18px; font-size: .875rem; color: var(--ink-2); }
.legend li { display: flex; align-items: center; gap: 8px; }
.legend__sw { width: 22px; height: 3px; border-radius: 2px; }
.legend__sw--real { background: var(--forest); height: 4px; }
.legend__sw--plan { background: repeating-linear-gradient(90deg, var(--plan) 0 6px, transparent 6px 10px); }
.chart { width: 100%; position: relative; }
.chart svg { width: 100%; height: auto; display: block; overflow: visible; }
.chart .grid line { stroke: var(--line-2); }
.chart .axis text { fill: var(--ink-3); font-size: 12px; font-family: var(--font); }
.chart .s-real { fill: none; stroke: var(--forest); stroke-width: 3; stroke-linejoin: round; stroke-linecap: round; }
.chart .s-plan { fill: none; stroke: var(--plan); stroke-width: 2.2; stroke-dasharray: 6 5; }
.chart .s-area { fill: url(#gradReal); }
.chart .dot { fill: #fff; stroke: var(--forest); stroke-width: 2.5; }
.chart .dot-last { fill: var(--forest); }
.chart .lbl-last { fill: var(--forest); font-weight: 800; font-size: 14px; font-family: var(--font); }
.chart .hit { fill: transparent; cursor: crosshair; }
.chart__tip { position: absolute; pointer-events: none; background: var(--ink); color: #fff; font-size: .8125rem; padding: 8px 12px; border-radius: 8px; white-space: nowrap; transform: translate(-50%, -110%); box-shadow: var(--shadow-sm); }
.chart__summary { font-size: .9375rem; color: var(--ink-2); margin-top: 14px; }

/* Barra de herramientas / filtros */
.toolbar { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.segmented { display: inline-flex; padding: 4px; gap: 2px; background: var(--paper-2); border-radius: 999px; flex-wrap: wrap; }
.segmented button { border: 0; background: transparent; padding: 8px 14px; border-radius: 999px; font-size: .9rem; font-weight: 600; color: var(--ink-2); min-height: 36px; }
.segmented button[aria-pressed="true"] { background: var(--white); color: var(--ink); box-shadow: var(--shadow-sm); }
select, input[type="text"], input[type="search"], input[type="password"], input[type="date"], input[type="number"], input[type="file"], textarea {
  width: 100%; min-height: 44px; padding: 10px 14px; border: 1.5px solid var(--line); border-radius: var(--r-sm); background: var(--white);
  font-size: 1rem; transition: border-color .2s, box-shadow .2s;
}
select { appearance: none; padding-right: 38px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%233a4741' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; background-size: 16px; }
input:hover, select:hover, textarea:hover { border-color: #c6bdaa; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--forest); box-shadow: 0 0 0 3px rgba(29, 74, 56, .18); }
input[aria-invalid="true"] { border-color: var(--danger); box-shadow: 0 0 0 3px rgba(179, 38, 30, .12); }
.select-wrap select { width: auto; min-width: 180px; border-radius: 999px; }
.filters { display: grid; grid-template-columns: 2fr 1.2fr 1fr 1fr 1fr auto; gap: 12px; align-items: end; margin-bottom: 16px; }
.filters--docs { grid-template-columns: 2.2fr 1.2fr 1fr 1fr auto; }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field__label { font-size: .8125rem; font-weight: 650; color: var(--ink-2); }
.field__hint { font-size: .8125rem; color: var(--ink-3); }
.field__error { font-size: .8125rem; color: var(--danger); font-weight: 600; }
.input-icon { position: relative; display: block; }
.input-icon .ico { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--ink-3); }
.input-icon input { padding-left: 40px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 8px; }
.chip { border: 1.5px solid var(--line); background: var(--white); padding: 7px 14px; border-radius: 999px; font-size: .9rem; font-weight: 600; color: var(--ink-2); min-height: 38px; transition: all .15s; }
.chip:hover { border-color: var(--ink-2); }
.chip[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: #fff; }
.chip__n { display: inline-block; margin-left: 6px; font-size: .78rem; opacity: .65; }

/* Tarjetas de sector */
.sector-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.sector { border: 1px solid var(--line); border-radius: var(--r); padding: 22px; display: flex; flex-direction: column; gap: 12px; background: var(--white); transition: border-color .2s, box-shadow .2s, transform .2s; }
.sector:hover { border-color: var(--moss); box-shadow: var(--shadow-sm); transform: translateY(-2px); }
.sector__top { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.sector__name { font-size: 1.1875rem; font-weight: 750; display: flex; align-items: center; gap: 8px; }
.sector__name .ico { color: var(--copper); }
.sector__pct { font-size: 2.25rem; font-weight: 800; letter-spacing: -.04em; line-height: 1; color: var(--forest); }
.sector__etapa { font-size: .9375rem; color: var(--ink-2); min-height: 2.9em; }
.sector__meta { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 6px 12px; font-size: .8125rem; color: var(--ink-3); padding-top: 12px; border-top: 1px solid var(--line-2); }
.empty { text-align: center; padding: 40px 20px; color: var(--ink-3); border: 1.5px dashed var(--line); border-radius: var(--r); }
.empty .btn { margin-top: 14px; }

/* Línea de tiempo */
.timeline { list-style: none; display: grid; grid-template-columns: repeat(7, 1fr); gap: 0; position: relative; }
.timeline::before { content: ""; position: absolute; left: 0; right: 0; top: 11px; height: 2px; background: var(--line); }
.timeline li { position: relative; padding: 36px 14px 0 0; }
.timeline li::before { content: ""; position: absolute; top: 4px; left: 0; width: 16px; height: 16px; border-radius: 50%; background: var(--white); border: 2.5px solid var(--line); }
.timeline li.is-cumplido::before { background: var(--forest); border-color: var(--forest); }
.timeline li.is-proximo::before { background: var(--copper); border-color: var(--copper); box-shadow: 0 0 0 5px var(--copper-50); }
.timeline__date { font-size: .8125rem; font-weight: 700; color: var(--ink-3); text-transform: uppercase; letter-spacing: .05em; }
.timeline__title { font-size: 1rem; font-weight: 700; margin-top: 4px; line-height: 1.3; }
.timeline__detail { font-size: .875rem; color: var(--ink-3); margin-top: 4px; }
.timeline__badge { display: inline-block; margin-top: 8px; font-size: .75rem; font-weight: 700; padding: 2px 8px; border-radius: 999px; background: var(--paper-2); color: var(--ink-3); }
.is-cumplido .timeline__badge { background: var(--ok-50); color: var(--ok); }
.is-proximo .timeline__badge { background: var(--copper-50); color: var(--copper-600); }

/* ---------- Recursos ---------- */
.money { display: grid; grid-template-columns: repeat(3, 1fr); gap: clamp(12px, 1.6vw, 20px); }
.money__card { background: var(--white); border: 1px solid var(--line-2); border-radius: var(--r-lg); padding: 26px; box-shadow: var(--shadow-sm); border-top: 5px solid var(--ink); }
.money__card--used { border-top-color: var(--copper); }
.money__card--left { border-top-color: var(--forest); }
.money__label { font-size: .9375rem; font-weight: 650; color: var(--ink-3); letter-spacing: 0; }
.money__value { font-size: clamp(1.75rem, 2.8vw, 2.5rem); font-weight: 800; letter-spacing: -.035em; margin-top: 8px; line-height: 1.05; }
.money__note { font-size: .9375rem; color: var(--ink-2); margin-top: 8px; }
.compare { display: grid; gap: 18px; }
.compare__row { display: grid; grid-template-columns: 180px 1fr 70px; gap: 16px; align-items: center; }
.compare__label { font-size: .9375rem; font-weight: 600; color: var(--ink-2); }
.compare__val { font-size: 1.125rem; font-weight: 800; text-align: right; font-variant-numeric: tabular-nums; }
.catbars { list-style: none; display: grid; gap: 16px; }
.catbars li { display: grid; grid-template-columns: 220px 1fr 160px; gap: 16px; align-items: center; }
.catbars__name { font-weight: 650; }
.catbars__val { text-align: right; font-variant-numeric: tabular-nums; font-weight: 700; }
.catbars__val small { display: block; font-weight: 500; color: var(--ink-3); font-size: .8125rem; }

/* Tabla */
.table-wrap { overflow-x: auto; border: 1px solid var(--line-2); border-radius: var(--r); }
.table { width: 100%; border-collapse: collapse; font-size: .9375rem; }
.table th, .table td { padding: 14px 16px; text-align: left; border-bottom: 1px solid var(--line-2); vertical-align: top; }
.table thead th { font-size: .78rem; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-3); background: var(--paper); font-weight: 700; white-space: nowrap; }
.table tbody tr:hover { background: #fbfaf6; }
.table tfoot th, .table tfoot td { font-weight: 800; background: var(--paper); border-bottom: 0; }
.t-right { text-align: right !important; }
.table td.num { white-space: nowrap; font-weight: 650; }
.badge { display: inline-flex; align-items: center; gap: 6px; font-size: .8125rem; font-weight: 700; padding: 3px 10px; border-radius: 999px; white-space: nowrap; background: var(--paper-2); color: var(--ink-2); }
.badge--ok { background: var(--ok-50); color: var(--ok); }
.badge--warn { background: var(--warn-50); color: var(--warn); }
.badge--muted { background: var(--paper-2); color: var(--ink-3); }
.badge--info { background: var(--forest-50); color: var(--forest); }
.doc-ref { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; white-space: nowrap; }

/* Documentos */
.doclist { list-style: none; display: grid; gap: 10px; }
.doc { display: grid; grid-template-columns: auto 1fr auto; gap: 18px; align-items: center; padding: 18px 20px; border: 1px solid var(--line); border-radius: var(--r); background: var(--white); transition: border-color .2s, box-shadow .2s; }
.doc:hover { border-color: var(--moss); box-shadow: var(--shadow-sm); }
.doc__icon { width: 48px; height: 56px; border-radius: 8px; background: var(--copper-50); color: var(--copper-600); display: grid; place-items: center; position: relative; font-size: .6875rem; font-weight: 800; letter-spacing: .04em; }
.doc__icon .ico { width: 22px; height: 22px; margin-bottom: 10px; }
.doc__icon span { position: absolute; bottom: 7px; }
.doc__title { font-weight: 700; font-size: 1.0625rem; line-height: 1.3; }
.doc__meta { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: .875rem; color: var(--ink-3); margin-top: 6px; align-items: center; }
.doc__meta .badge { font-size: .75rem; }
.doc__actions { display: flex; gap: 8px; }
.doclist--compact .doc { padding: 14px 16px; grid-template-columns: auto 1fr auto; }
.doclist--compact .doc__icon { width: 40px; height: 46px; }
.icon-btn { display: inline-grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; border: 1.5px solid var(--line); background: var(--white); color: var(--ink); text-decoration: none; transition: all .15s; }
.icon-btn:hover { background: var(--ink); border-color: var(--ink); color: #fff; }

/* Galería */
.gallery { list-style: none; display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.gcard { display: flex; flex-direction: column; border-radius: var(--r); overflow: hidden; background: var(--white); border: 1px solid var(--line-2); height: 100%; }
.gcard__btn { display: block; position: relative; border: 0; padding: 0; background: var(--paper-2); aspect-ratio: 4 / 3; overflow: hidden; width: 100%; }
.gcard__btn img { width: 100%; height: 100%; object-fit: cover; transition: transform .6s var(--ease); }
.gcard__btn:hover img { transform: scale(1.05); }
.gcard__zoom { position: absolute; right: 12px; top: 12px; width: 38px; height: 38px; border-radius: 50%; background: rgba(255, 255, 255, .92); color: var(--ink); display: grid; place-items: center; opacity: 0; transition: opacity .2s; }
.gcard__btn:hover .gcard__zoom, .gcard__btn:focus-visible .gcard__zoom { opacity: 1; }
.gcard__body { padding: 16px 18px 18px; }
.gcard__meta { display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: .8125rem; color: var(--ink-3); }
.gcard__meta span { display: inline-flex; align-items: center; gap: 4px; }
.gcard__title { font-size: 1.0625rem; font-weight: 700; margin-top: 6px; }
.gcard__desc { font-size: .9rem; color: var(--ink-2); margin-top: 4px; }
.ph-load { display: grid; place-items: center; gap: 6px; width: 100%; height: 100%; color: var(--ink-2); font-size: .875rem; font-weight: 600; text-align: center; padding: 12px; }
.ph-load .ico { width: 28px; height: 28px; color: var(--forest); }

/* Visor */
.lightbox { position: fixed; inset: 0; z-index: 80; display: grid; place-items: center; padding: 24px; }
.lightbox__backdrop { position: absolute; inset: 0; background: rgba(8, 14, 11, .92); }
.lightbox__fig { position: relative; margin: 0; display: grid; grid-template-columns: minmax(0, 1fr) 320px; max-width: 1240px; width: 100%; max-height: calc(100vh - 48px); background: var(--ink); border-radius: var(--r-lg); overflow: hidden; }
.lightbox__media { background: #000; display: grid; place-items: center; min-height: 300px; }
.lightbox__media img { max-height: calc(100vh - 48px); width: 100%; object-fit: contain; }
.lightbox__cap { color: #fff; padding: 32px 28px; display: flex; flex-direction: column; gap: 10px; }
.lightbox__meta { font-size: .875rem; color: var(--copper-300); font-weight: 600; }
.lightbox__cap h2 { font-size: 1.5rem; font-weight: 750; }
.lightbox__cap p { color: rgba(255, 255, 255, .82); }
.lightbox__count { margin-top: auto !important; font-size: .875rem; }
.lightbox__btn { position: absolute; width: 48px; height: 48px; border-radius: 50%; border: 0; background: rgba(255, 255, 255, .14); color: #fff; display: grid; place-items: center; }
.lightbox__btn:hover { background: #fff; color: var(--ink); }
.lightbox__btn .ico { width: 22px; height: 22px; }
.lightbox__btn--close { top: 16px; right: 16px; }
.lightbox__btn--prev { left: 16px; top: 50%; transform: translateY(-50%); }
.lightbox__btn--next { right: 16px; top: 50%; transform: translateY(-50%); }

/* ---------- Administración ---------- */
.admin-head { background: var(--ink); color: #fff; padding: calc(var(--head-h) + 32px) 0 40px; }
.admin-head__inner { display: flex; justify-content: space-between; align-items: flex-end; gap: 24px; flex-wrap: wrap; }
.admin-head__title { font-size: clamp(2rem, 4vw, 3rem); font-weight: 800; letter-spacing: -.035em; }
.admin-head__lead { color: rgba(255, 255, 255, .78); margin-top: 8px; }
.admin-body { padding-block: 40px var(--section); }
.login { display: grid; place-items: center; }
.login__card { width: 100%; max-width: 440px; background: var(--white); border: 1px solid var(--line-2); border-radius: var(--r-lg); padding: clamp(24px, 4vw, 40px); box-shadow: var(--shadow); display: grid; gap: 18px; }
.login__mark { width: 48px; height: 48px; }
.login__title { font-size: 1.75rem; font-weight: 800; }
.login__sub { color: var(--ink-3); margin-top: -10px; }
.login__demo { font-size: .9rem; background: var(--paper); border-radius: var(--r-sm); padding: 12px 14px; }
.login__demo summary { font-weight: 650; cursor: pointer; }
.login__demo p { margin-top: 8px; color: var(--ink-2); }
.login__foot { display: flex; gap: 8px; align-items: center; font-size: .8125rem; color: var(--ink-3); }
.input-pass { position: relative; display: block; }
.input-pass input { padding-right: 52px; }
.input-pass__toggle { position: absolute; right: 4px; top: 50%; transform: translateY(-50%); width: 40px; height: 40px; border: 0; background: none; color: var(--ink-3); border-radius: 50%; display: grid; place-items: center; }
.input-pass__toggle:hover { background: var(--paper-2); color: var(--ink); }
.alert { padding: 12px 14px; border-radius: var(--r-sm); font-size: .9375rem; font-weight: 550; }
.alert--error { background: var(--danger-50); color: var(--danger); }
.alert--ok { background: var(--ok-50); color: var(--ok); }
.alert--info { background: var(--forest-50); color: var(--forest); }

.admin-bar { display: flex; align-items: center; gap: 16px 24px; flex-wrap: wrap; background: var(--white); border: 1px solid var(--line-2); border-radius: var(--r); padding: 14px 18px; margin-bottom: 20px; box-shadow: var(--shadow-sm); }
.admin-bar__user { display: flex; align-items: center; gap: 12px; margin-right: auto; }
.admin-bar__user div { display: flex; flex-direction: column; line-height: 1.25; }
.admin-bar__user span { font-size: .875rem; color: var(--ink-3); }
.avatar { width: 40px; height: 40px; border-radius: 50%; background: var(--forest-50); color: var(--forest); display: grid; place-items: center; }
.admin-bar__session { display: flex; align-items: center; gap: 8px; font-size: .875rem; color: var(--ink-3); }
.admin-layout { display: grid; grid-template-columns: 240px 1fr; gap: 20px; align-items: start; }
.admin-nav { display: flex; flex-direction: column; gap: 4px; position: sticky; top: 96px; }
.admin-nav button { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border: 0; border-radius: var(--r-sm); background: transparent; text-align: left; font-weight: 600; color: var(--ink-2); min-height: 46px; }
.admin-nav button:hover { background: var(--paper-2); }
.admin-nav button[aria-selected="true"] { background: var(--ink); color: #fff; }
.admin-nav button[disabled] { opacity: .45; cursor: not-allowed; }
.admin-nav button[disabled]::after { content: "Sin permiso"; margin-left: auto; font-size: .72rem; font-weight: 600; }
.apanel:focus { outline: none; }
.table td:first-child { white-space: nowrap; }
.apanel { background: var(--white); border: 1px solid var(--line-2); border-radius: var(--r-lg); padding: clamp(20px, 3vw, 36px); box-shadow: var(--shadow-sm); }
.apanel__head { display: flex; justify-content: space-between; gap: 16px; align-items: flex-start; flex-wrap: wrap; margin-bottom: 24px; padding-bottom: 20px; border-bottom: 1px solid var(--line-2); }
.apanel__title { font-size: 1.5rem; font-weight: 750; }
.apanel__sub { color: var(--ink-3); font-size: .9375rem; margin-top: 4px; }
.apanel h3 { font-size: 1.125rem; font-weight: 750; margin: 28px 0 14px; }
.form-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.form-grid--2 { grid-template-columns: repeat(2, 1fr); }
.form-grid--4 { grid-template-columns: repeat(4, 1fr); }
.form-actions { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; margin-top: 24px; padding-top: 20px; border-top: 1px solid var(--line-2); }
.calc { display: flex; flex-direction: column; justify-content: center; gap: 2px; padding: 10px 14px; min-height: 44px; border-radius: var(--r-sm); background: var(--paper); border: 1.5px dashed var(--line); }
.calc b { font-size: 1.125rem; font-variant-numeric: tabular-nums; }
.calc.is-error b { color: var(--danger); }
.edit-table input, .edit-table select { min-height: 40px; padding: 8px 10px; }
.edit-table input[type="number"] { max-width: 100px; }
.edit-table td { vertical-align: middle; }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: .9375rem; }
.check input { width: 20px; height: 20px; margin-top: 2px; accent-color: var(--forest); flex: none; }
.switch { position: relative; display: inline-flex; align-items: center; gap: 10px; font-size: .875rem; font-weight: 600; cursor: pointer; }
.switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch__track { width: 42px; height: 24px; border-radius: 999px; background: var(--line); position: relative; transition: background .2s; flex: none; }
.switch__track::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .2); transition: transform .2s var(--ease); }
.switch input:checked + .switch__track { background: var(--forest); }
.switch input:checked + .switch__track::after { transform: translateX(18px); }
.switch input:focus-visible + .switch__track { outline: 3px solid var(--copper); outline-offset: 2px; }
.mini-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.mini-stat { padding: 18px; border-radius: var(--r); background: var(--paper); }
.mini-stat span { font-size: .8125rem; color: var(--ink-3); font-weight: 600; }
.mini-stat b { display: block; font-size: 1.5rem; font-weight: 800; letter-spacing: -.03em; margin-top: 4px; }
.perm-list { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }

/* Toast */
.toast { position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%); z-index: 90; background: var(--ink); color: #fff; padding: 14px 20px; border-radius: 12px; box-shadow: var(--shadow); display: flex; align-items: center; gap: 12px; max-width: calc(100vw - 32px); font-size: .9375rem; animation: toastIn .35s var(--ease); }
.toast .ico { color: #7fd39b; }
.toast a { color: var(--copper-300); font-weight: 650; }
@keyframes toastIn { from { opacity: 0; transform: translate(-50%, 12px); } }

/* ---------- Pie ---------- */
.footer { background: var(--ink); color: rgba(255, 255, 255, .78); padding-top: clamp(56px, 7vw, 96px); font-size: .9375rem; }
.footer__grid { display: grid; grid-template-columns: 1.5fr 1fr 1fr 1.2fr; gap: 40px; padding-bottom: 48px; }
.footer__brand p { margin-top: 20px; max-width: 40ch; }
.brand--light { color: #fff; margin: 0; }
.footer__title { font-size: .8125rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: #fff; margin-bottom: 14px; }
.footer__title:not(:first-child) { margin-top: 24px; }
.footer__links { list-style: none; display: grid; gap: 10px; }
.footer a { color: rgba(255, 255, 255, .88); }
.footer a:hover { color: var(--copper-300); }
.footer__admin { display: inline-flex; align-items: center; gap: 8px; margin-top: 16px; font-weight: 650; }
.footer__bottom { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; padding-block: 24px; border-top: 1px solid rgba(255, 255, 255, .12); font-size: .8125rem; color: rgba(255, 255, 255, .6); }

/* Navegación inferior móvil */
.tabbar { display: none; }


/* ---------- Modo ahorro de datos ---------- */
.saver .saver-hide { display: none !important; }
.saver .page-head, .saver .band, .saver .type-card { background: linear-gradient(135deg, var(--forest-700), var(--forest) 70%, #2d5a47); }
.saver .hero::before { background: linear-gradient(135deg, var(--forest-700), var(--forest) 70%, #2d5a47); animation: none; }

/* ---------- Responsive ---------- */
.mainnav a { white-space: nowrap; }
@media (max-width: 1180px) {
  .mainnav a { padding: 10px 10px; font-size: .9375rem; }
  .navbar__inner { gap: 20px; }
  .brand__sub { display: none; }
  .navbar__cta span { display: none; }
  .navbar__cta { width: 44px; padding: 0; }
  .answer__grid { grid-template-columns: 1fr 1fr; }
  .answer__facts { grid-column: 1 / -1; grid-template-columns: repeat(3, 1fr); }
  .answer__facts li { border-bottom: 0; border-right: 1px solid var(--line-2); padding: 4px 16px; }
  .answer__facts li:first-child { padding-left: 0; }
  .answer__facts li:last-child { border-right: 0; }
  .stats { grid-template-columns: 1fr 1fr; }
  .timeline { grid-template-columns: 1fr; gap: 0; }
  .timeline::before { left: 7px; right: auto; top: 6px; bottom: 6px; width: 2px; height: auto; }
  .timeline li { padding: 0 0 24px 36px; }
  .timeline li::before { top: 2px; }
  .filters { grid-template-columns: 1fr 1fr 1fr; }
  .filters--docs { grid-template-columns: 1fr 1fr; }
  .field--search { grid-column: 1 / -1; }
}

@media (max-width: 960px) {
  :root { --head-h: 96px; }
  .mainnav, .navbar__cta span { display: none; }
  .navbar__cta { width: 44px; padding: 0; }
  .navbar__inner { min-height: 60px; }
  .split, .split--docs { grid-template-columns: 1fr; }
  .split__figure { display: none; }
  .type-cards { grid-template-columns: 1fr; }
  .type-card { min-height: 380px; }
  .rank { grid-template-columns: 1fr 1fr; }
  .rank li:not(:nth-child(3n + 1)) { padding-left: 0; border-left: 0; }
  .rank li:nth-child(even) { padding-left: 24px; border-left: 1px solid var(--line); }
  .pillars { grid-template-columns: 1fr 1fr; }
  .pillars li:nth-child(3) { padding-left: 0; border-left: 0; }
  .sector-grid, .gallery { grid-template-columns: 1fr 1fr; }
  .money { grid-template-columns: 1fr; }
  .catbars li { grid-template-columns: 1fr auto; }
  .catbars li .bar { grid-column: 1 / -1; grid-row: 2; }
  .admin-layout { grid-template-columns: minmax(0, 1fr); }
  .admin-nav { position: static; flex-direction: row; overflow-x: auto; padding-bottom: 4px; scrollbar-width: thin; }
  .admin-nav button { white-space: nowrap; flex: none; }
  .form-grid, .form-grid--4 { grid-template-columns: 1fr 1fr; }
  .mini-stats { grid-template-columns: 1fr 1fr; }
  .footer__grid { grid-template-columns: 1fr 1fr; }
  .lightbox__fig { grid-template-columns: 1fr; overflow-y: auto; }
  .lightbox__media img { max-height: 62vh; }
  .lightbox__cap { padding: 20px; }

  /* Barra inferior tipo app para la ciudadanía móvil (evento A) */
  body { padding-bottom: calc(68px + env(safe-area-inset-bottom)); }
  .tabbar {
    display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; inset: auto 0 0; z-index: 60;
    background: rgba(255, 255, 255, .97); backdrop-filter: blur(12px); border-top: 1px solid var(--line);
    padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
  }
  .tabbar a { display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 6px 2px; color: var(--ink-3); text-decoration: none; font-size: .72rem; font-weight: 650; border-radius: 10px; min-height: 52px; justify-content: center; }
  .tabbar a .ico { width: 23px; height: 23px; }
  .tabbar a[aria-current="page"] { color: var(--forest); background: var(--forest-50); }
  .toast { bottom: calc(84px + env(safe-area-inset-bottom)); }
}

@media (max-width: 700px) {
  body { font-size: 1rem; }
  .utility__msg { display: none; }
  .utility__inner { justify-content: flex-end; }
  .utility__actions { gap: 14px; }
  .brand__name { font-size: 1.2rem; }
  .brand__mark { width: 36px; height: 36px; }
  .hero { min-height: 0; padding-top: calc(var(--head-h) + 20px); padding-bottom: 124px; }
  .hero .eyebrow { font-size: .72rem; letter-spacing: .1em; margin-bottom: 12px; }
  .hero__title { font-size: 2.4rem; }
  .hero__lead { font-size: 1rem; margin-top: 14px; }
  .hero__ctas { margin-top: 22px; }
  .hero__ctas .btn--ghost-light { display: none; }
  .apanel:focus, .panel:focus { outline: none; }
  .hero__shade { background: linear-gradient(0deg, rgba(10, 20, 16, .94) 0%, rgba(10, 20, 16, .7) 55%, rgba(10, 20, 16, .35) 100%); }
  .hero__ctas .btn { width: 100%; }
  .answer-wrap { margin-top: -100px; }
  .answer__grid { grid-template-columns: 1fr; }
  .answer__facts { grid-template-columns: 1fr 1fr 1fr; }
  .answer__facts li { padding: 4px 10px; }
  .answer__facts b { font-size: 1.3rem; }
  .answer__facts span { font-size: .8125rem; line-height: 1.3; }
  .kpi { flex-direction: row; padding: 18px; gap: 16px; }
  .kpi__ring { width: 92px; height: 92px; }
  .answer__actions { flex-direction: column; gap: 10px; }
  .facts { grid-template-columns: 1fr; }
  .facts__item, .facts__item:nth-child(even), .facts__item--wide ~ .facts__item:nth-child(odd) { padding-left: 0 !important; border-left: 0 !important; padding-right: 0; }
  .rank { grid-template-columns: 1fr; }
  .rank li:nth-child(even) { padding-left: 0; border-left: 0; }
  .rank li { padding-right: 0; }
  .pillars { grid-template-columns: 1fr; }
  .pillars li, .pillars li + li { padding-left: 0; border-left: 0; padding-right: 0; }
  .strip { grid-template-columns: 1fr 1fr; }
  .strip .ph:first-child { grid-column: 1 / -1; grid-row: auto; }
  .strip .ph:first-child img { aspect-ratio: 4 / 3; }
  .stats { grid-template-columns: 1fr 1fr; }
  .stat--feature { grid-column: 1 / -1; }
  .stat { padding: 18px; }
  .sector-grid, .gallery { grid-template-columns: 1fr; }
  .compare__row { grid-template-columns: 1fr auto; gap: 6px 12px; }
  .compare__row .bar { grid-column: 1 / -1; grid-row: 2; }
  .filters, .filters--docs { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .admin-layout, .admin-panels { min-width: 0; }
  .filters .btn { grid-column: 1 / -1; }
  .toolbar, .segmented { width: 100%; }
  .segmented button { flex: 1; padding: 8px 8px; font-size: .8125rem; }
  .select-wrap, .select-wrap select { width: 100%; }
  .panel__head { flex-direction: column; }
  .doc { grid-template-columns: auto 1fr; gap: 14px; padding: 16px; }
  .doc__actions { grid-column: 1 / -1; }
  .doc__actions .btn { flex: 1; }
  .doclist--compact .doc__actions { grid-column: auto; }
  /* Tabla de gastos como tarjetas */
  .table-wrap { border: 0; overflow: visible; }
  .table--cards thead { display: none; }
  .table--cards, .table--cards tbody, .table--cards tr, .table--cards td, .table--cards tfoot, .table--cards th { display: block; width: 100%; }
  .table--cards tbody tr { border: 1px solid var(--line); border-radius: var(--r); padding: 6px 4px; margin-bottom: 10px; background: var(--white); }
  .table--cards td, .table--cards tbody th { border: 0; padding: 7px 14px; text-align: left !important; overflow-wrap: anywhere; white-space: normal !important; }
  .table--cards td::before { content: attr(data-label); display: block; font-size: .72rem; font-weight: 700; color: var(--ink-3); text-transform: uppercase; letter-spacing: .05em; margin-bottom: 2px; }
  .table--cards td:not([data-label])::before { content: none; }
  .table--cards td .empty { margin: 4px 0; }
  .edit-table input[type="number"] { max-width: none; }
  .table--cards tfoot tr { display: flex; justify-content: space-between; border-radius: var(--r); padding: 14px 16px; background: var(--ink); color: #fff; }
  .table--cards tfoot th, .table--cards tfoot td { background: transparent; padding: 0; width: auto; }
  .table--cards tfoot td:empty { display: none; }
  .form-grid, .form-grid--2, .form-grid--4 { grid-template-columns: 1fr; }
  .footer__grid { grid-template-columns: 1fr; gap: 28px; }
  .admin-bar__session { width: 100%; order: 3; }
  .lightbox { padding: 0; }
  .lightbox__fig { max-height: 100vh; height: 100%; border-radius: 0; }
  .lightbox__btn--prev, .lightbox__btn--next { top: 30vh; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; scroll-behavior: auto !important; }
}

/* ---------- Impresión (Ctrl+P en el navegador) ---------- */
@media print {
  .masthead, .tabbar, .toast, .lightbox, .footer, .skip-link { display: none !important; }
  body { padding: 0; background: #fff; }
}
