/* ÁBACO Aporta · mismo lenguaje visual que ÁBACO Inversiones y Mi Municipio.
   Plano, sin sombras, sin recursos externos (la política de contenido los prohíbe). */

:root {
  --acento: #1F4E79;
  --acento-fuerte: #16385a;
  --acento-suave: #e8eef5;
  --acento-medio: #9db8d1;
  --foco: #2b6cb0;
  --lienzo: #eef0f4;
  --superficie: #ffffff;
  --tinta: #141a22;
  --tenue: #626874;
  --borde: #dfe3e9;
  --positivo: #1d7a4d;
  --positivo-suave: #e3f2ea;
  --negativo: #b1400f;
  --negativo-suave: #fbeae2;
  --alerta: #92400e;
  --alerta-suave: #fdf3e1;
  --error: #9b2c2c;
  --error-suave: #fbe9e9;
  --radio: 7px;
  --radio-chico: 5px;
  --control: 34px;
  --letra: "Public Sans", "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  --cifras: "IBM Plex Mono", Consolas, "SFMono-Regular", Menlo, monospace;
}

* { box-sizing: border-box; }

html { font-size: 14px; -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--lienzo);
  color: var(--tinta);
  font-family: var(--letra);
  line-height: 1.5;
}

a { color: var(--acento); text-underline-offset: 2px; }
a:hover { color: var(--acento-fuerte); }
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, summary:focus-visible {
  outline: 2px solid var(--foco);
  outline-offset: 2px;
}

h1, h2, h3, h4 { line-height: 1.25; margin: 0 0 .5rem; }
h1 { font-size: 1.6rem; font-weight: 650; }
h2 { font-size: 1.22rem; font-weight: 650; margin-top: 1.6rem; }
h3 { font-size: 1.05rem; font-weight: 650; margin-top: 1.1rem; }
p { margin: 0 0 .75rem; }
small, .tenue { color: var(--tenue); }
.tenue { font-size: .95em; }
hr { border: 0; border-top: 1px solid var(--borde); margin: 1.5rem 0; }
code, .codigo, .num, .cifra-valor, kbd { font-family: var(--cifras); }
code { font-size: .92em; background: var(--acento-suave); padding: 0 .3em; border-radius: 3px; overflow-wrap: anywhere; }

.saltar { position: absolute; left: -9999px; }
.saltar:focus { left: 1rem; top: 1rem; background: var(--superficie); padding: .5rem 1rem; z-index: 10; }

/* --- cabecera ----------------------------------------------------------- */

.cabecera {
  background: var(--acento);
  color: #fff;
}
.cabecera-interior {
  max-width: 1180px;
  margin: 0 auto;
  padding: .6rem 1rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .5rem 1.25rem;
}
.marca { color: #fff; text-decoration: none; display: flex; align-items: baseline; gap: .5rem; }
.marca:hover { color: #fff; }
.marca-nombre { font-weight: 700; font-size: 1.15rem; letter-spacing: .01em; }
.marca-lugar { font-size: .9rem; color: var(--acento-medio); }

.nav-principal { display: flex; flex-wrap: wrap; gap: .1rem .2rem; flex: 1 1 auto; }
.nav-principal a {
  color: #fff;
  text-decoration: none;
  padding: .35rem .6rem;
  border-radius: var(--radio-chico);
  font-size: .95rem;
}
.nav-principal a:hover { background: var(--acento-fuerte); }
.nav-principal a[aria-current="page"] { background: var(--acento-fuerte); box-shadow: inset 0 -2px 0 var(--acento-medio); }

.sesion { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem; margin-left: auto; }
.sesion form { margin: 0; display: flex; gap: .3rem; align-items: center; }
.sesion select { min-width: 12rem; max-width: 18rem; height: 30px; }
.sesion a, .sesion .boton-enlace { color: #fff; }
.sesion .boton-chico { background: transparent; border-color: var(--acento-medio); color: #fff; }
.sesion .boton-chico:hover { background: var(--acento-fuerte); }
.contador {
  display: inline-block; min-width: 1.4em; padding: 0 .35em; margin-left: .2em;
  border-radius: 999px; background: #fff; color: var(--acento); font-size: .8rem; text-align: center; font-weight: 700;
}

.subnav {
  background: var(--superficie);
  border-bottom: 1px solid var(--borde);
}
.subnav-interior { max-width: 1180px; margin: 0 auto; padding: .25rem 1rem; display: flex; flex-wrap: wrap; gap: .1rem .3rem; }
.subnav a { text-decoration: none; padding: .35rem .6rem; border-radius: var(--radio-chico); font-size: .95rem; color: var(--tinta); }
.subnav a:hover { background: var(--acento-suave); }
.subnav a[aria-current="page"] { background: var(--acento-suave); color: var(--acento-fuerte); font-weight: 600; }
.subnav .rotulo { color: var(--tenue); font-size: .85rem; padding: .35rem .3rem .35rem 0; }

/* --- bandas ------------------------------------------------------------- */

.banda { border-bottom: 1px solid var(--borde); font-size: .93rem; }
.banda-interior { max-width: 1180px; margin: 0 auto; padding: .45rem 1rem; }
.banda-simulacion { background: var(--alerta-suave); color: var(--alerta); }
.banda-emergencia { background: var(--negativo); color: #fff; border-bottom-color: var(--negativo); }
.banda-emergencia a { color: #fff; font-weight: 600; }

/* --- cuerpo ------------------------------------------------------------- */

main.contenedor { max-width: 1180px; margin: 0 auto; padding: 1.25rem 1rem 3rem; }
.estrecho { max-width: 720px; }
.medio { max-width: 920px; }

.cabecera-pagina { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: .5rem 1rem; margin-bottom: 1rem; }
.cabecera-pagina p { margin: 0; color: var(--tenue); }
.migas { font-size: .9rem; color: var(--tenue); margin-bottom: .4rem; }
.migas a { color: var(--tenue); }
.acciones { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }

.aviso {
  border: 1px solid var(--borde);
  border-left-width: 4px;
  border-radius: var(--radio-chico);
  padding: .6rem .85rem;
  margin: 0 0 1rem;
  background: var(--superficie);
}
.aviso-exito { border-left-color: var(--positivo); background: var(--positivo-suave); }
.aviso-error { border-left-color: var(--error); background: var(--error-suave); }
.aviso-aviso, .aviso-info { border-left-color: var(--alerta); background: var(--alerta-suave); }
.aviso-neutro { border-left-color: var(--acento); background: var(--acento-suave); }
.aviso p:last-child { margin-bottom: 0; }

.tarjeta {
  background: var(--superficie);
  border: 1px solid var(--borde);
  border-radius: var(--radio);
  padding: 1rem 1.1rem;
  margin-bottom: 1rem;
}
.tarjeta > h2:first-child, .tarjeta > h3:first-child { margin-top: 0; }
.tarjeta-titulo { display: flex; justify-content: space-between; align-items: baseline; gap: .5rem; flex-wrap: wrap; }
.tarjeta-titulo h2, .tarjeta-titulo h3 { margin: 0 0 .5rem; }

.rejilla { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fill, minmax(min(280px, 100%), 1fr)); }
.rejilla-2 { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(min(340px, 100%), 1fr)); }
.columnas { display: grid; gap: 1rem; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
@media (max-width: 860px) { .columnas { grid-template-columns: minmax(0, 1fr); } }

.cifras { display: grid; gap: .75rem; grid-template-columns: repeat(auto-fit, minmax(min(150px, 100%), 1fr)); margin-bottom: 1rem; }
.cifra { background: var(--superficie); border: 1px solid var(--borde); border-radius: var(--radio); padding: .75rem .9rem; }
.cifra-valor { display: block; font-size: 1.35rem; font-weight: 600; color: var(--acento-fuerte); overflow-wrap: anywhere; }
.cifra-rotulo { display: block; color: var(--tenue); font-size: .88rem; }

.ficha-necesidad { display: flex; flex-direction: column; gap: .35rem; }
.ficha-necesidad h3 { margin: 0; font-size: 1.02rem; }
.ficha-necesidad h3 a { text-decoration: none; color: var(--tinta); }
.ficha-necesidad h3 a:hover { color: var(--acento); text-decoration: underline; }
.ficha-pie { display: flex; justify-content: space-between; gap: .5rem; flex-wrap: wrap; font-size: .9rem; color: var(--tenue); margin-top: auto; }
.chips { display: flex; flex-wrap: wrap; gap: .3rem; }
.chip {
  display: inline-block; padding: .05rem .5rem; border-radius: 999px; font-size: .82rem;
  border: 1px solid var(--borde); background: var(--lienzo); color: var(--tinta); white-space: nowrap;
}
.chip-linea { background: var(--acento-suave); border-color: var(--acento-medio); color: var(--acento-fuerte); }
.chip-urgente { background: var(--alerta-suave); border-color: #e8c38a; color: var(--alerta); }
.chip-emergencia { background: var(--negativo-suave); border-color: #e7b39c; color: var(--negativo); font-weight: 600; }
.chip-renovable { background: var(--positivo-suave); border-color: #a9d3bb; color: var(--positivo); }

/* --- estados ------------------------------------------------------------ */

.estado { display: inline-block; padding: .05rem .5rem; border-radius: var(--radio-chico); font-size: .82rem; font-weight: 600; white-space: nowrap; }
.estado-activo { background: var(--acento-suave); color: var(--acento-fuerte); }
.estado-bien { background: var(--positivo-suave); color: var(--positivo); }
.estado-mal { background: var(--negativo-suave); color: var(--negativo); }
.estado-neutro { background: var(--lienzo); color: var(--tenue); }

.barra { display: inline-flex; align-items: center; gap: .45rem; width: 100%; max-width: 260px; }
.barra progress { flex: 1 1 auto; height: 8px; min-width: 60px; }
.barra-cifra { font-family: var(--cifras); font-size: .85rem; color: var(--tenue); min-width: 3.2em; text-align: right; }
progress { -webkit-appearance: none; appearance: none; border: 0; border-radius: 4px; background: var(--acento-suave); height: 8px; }
progress::-webkit-progress-bar { background: var(--acento-suave); border-radius: 4px; }
progress::-webkit-progress-value { background: var(--acento); border-radius: 4px; }
progress::-moz-progress-bar { background: var(--acento); border-radius: 4px; }
progress.lleno::-webkit-progress-value { background: var(--positivo); }
progress.lleno::-moz-progress-bar { background: var(--positivo); }

/* --- señales ------------------------------------------------------------ */

.senales { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: .5rem; }
.senal { border: 1px solid var(--borde); border-left-width: 4px; border-radius: var(--radio-chico); padding: .55rem .75rem; background: var(--superficie); }
.senal-alta { border-left-color: var(--negativo); }
.senal-media { border-left-color: #c9852b; }
.senal-baja { border-left-color: var(--acento-medio); }
.senal strong { display: block; }
.senal p { margin: .15rem 0 0; color: var(--tenue); font-size: .93rem; }
.senal a.senal-enlace { font-size: .9rem; }

/* --- tablas ------------------------------------------------------------- */

.tabla-envoltura { overflow-x: auto; -webkit-overflow-scrolling: touch; margin-bottom: 1rem; }
table.tabla { width: 100%; border-collapse: collapse; background: var(--superficie); font-size: .95rem; }
.tabla th, .tabla td { text-align: left; padding: .5rem .6rem; border-bottom: 1px solid var(--borde); vertical-align: top; }
.tabla th { font-weight: 600; color: var(--tenue); font-size: .85rem; background: #f7f8fa; white-space: nowrap; }
.tabla tr:last-child td { border-bottom: 0; }
.tabla td.num, .tabla th.num { text-align: right; white-space: nowrap; }
.tabla th.num { font-family: var(--letra); }
.tabla tfoot td { font-weight: 600; border-top: 2px solid var(--borde); }
.tarjeta .tabla-envoltura { margin: 0 -1.1rem; }
.tarjeta .tabla-envoltura:last-child { margin-bottom: -1rem; }
.tarjeta .tabla th:first-child, .tarjeta .tabla td:first-child { padding-left: 1.1rem; }
.tarjeta .tabla th:last-child, .tarjeta .tabla td:last-child { padding-right: 1.1rem; }

dl.datos { display: grid; grid-template-columns: max-content 1fr; gap: .3rem 1rem; margin: 0; }
dl.datos dt { color: var(--tenue); }
dl.datos dd { margin: 0; overflow-wrap: anywhere; }
@media (max-width: 560px) { dl.datos { grid-template-columns: 1fr; } dl.datos dd { margin-bottom: .4rem; } }

/* --- formularios -------------------------------------------------------- */

form { margin: 0; }
.formulario { display: flex; flex-direction: column; gap: .8rem; }
.formulario > button, .formulario > .boton { align-self: flex-start; }
.campo { display: flex; flex-direction: column; gap: .25rem; }
.campo > span:first-child, .campo label, .rotulo-campo { font-weight: 600; font-size: .93rem; }
.campo .ayuda, .ayuda { color: var(--tenue); font-size: .88rem; font-weight: 400; }
.fila-campos { display: grid; gap: .8rem; grid-template-columns: repeat(auto-fit, minmax(min(180px, 100%), 1fr)); }
fieldset { border: 1px solid var(--borde); border-radius: var(--radio); padding: .75rem 1rem 1rem; margin: 0; }
legend { font-weight: 650; padding: 0 .35rem; }

input[type="text"], input[type="email"], input[type="password"], input[type="date"], input[type="month"], input[type="number"],
input[type="search"], input[type="tel"], input[type="file"], select, textarea {
  font: inherit;
  color: var(--tinta);
  background: var(--superficie);
  border: 1px solid #c9ced7;
  border-radius: var(--radio-chico);
  min-height: var(--control);
  padding: .3rem .55rem;
  width: 100%;
  max-width: 100%;
}
input[type="file"] { padding: .25rem; }
textarea { min-height: 5.5rem; resize: vertical; }
input.cifra-campo, td input { font-family: var(--cifras); }
.casilla { display: flex; align-items: flex-start; gap: .5rem; font-weight: 400; }
.casilla input { margin-top: .25rem; width: auto; min-height: 0; }
.radios { display: flex; flex-wrap: wrap; gap: .5rem 1.2rem; }

.boton, button {
  font: inherit;
  display: inline-flex; align-items: center; justify-content: center; gap: .35rem;
  min-height: var(--control);
  padding: .3rem .95rem;
  border-radius: var(--radio-chico);
  border: 1px solid var(--acento);
  background: var(--acento);
  color: #fff;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
}
.boton:hover, button:hover { background: var(--acento-fuerte); border-color: var(--acento-fuerte); color: #fff; }
.boton-secundario { background: var(--superficie); color: var(--acento); border-color: var(--acento-medio); }
.boton-secundario:hover { background: var(--acento-suave); color: var(--acento-fuerte); border-color: var(--acento); }
.boton-peligro { background: var(--superficie); color: var(--error); border-color: #e2b1b1; }
.boton-peligro:hover { background: var(--error-suave); color: var(--error); border-color: var(--error); }
.boton-chico { min-height: 28px; padding: .1rem .6rem; font-size: .88rem; }
.boton-enlace { background: none; border: 0; color: var(--acento); padding: 0; min-height: 0; font-weight: 400; text-decoration: underline; }
.boton-enlace:hover { background: none; color: var(--acento-fuerte); }
.en-linea { display: inline-flex; flex-wrap: wrap; gap: .4rem; align-items: center; }
.en-linea input[type="text"], .en-linea select { width: auto; min-width: 0; flex: 1 1 10rem; }
.en-linea input[type="number"] { width: 6rem; flex: 0 0 6rem; }
.en-linea > label { font-size: .85rem; color: var(--tenue); margin: 0; }

details { border: 1px solid var(--borde); border-radius: var(--radio-chico); background: var(--superficie); margin: .5rem 0; }
details > summary { cursor: pointer; padding: .45rem .75rem; font-weight: 600; color: var(--acento); }
details[open] > summary { border-bottom: 1px solid var(--borde); }
details > .detalle-cuerpo { padding: .75rem; }

.filtros { display: flex; flex-wrap: wrap; gap: .6rem; align-items: flex-end; margin-bottom: 1rem; }
.filtros .campo { flex: 1 1 160px; }
.filtros .campo-ancho { flex: 2 1 240px; }

/* --- piezas propias ----------------------------------------------------- */

.vales { display: grid; gap: .6rem; grid-template-columns: repeat(auto-fill, minmax(min(210px, 100%), 1fr)); }
.vale { border: 1px dashed var(--acento-medio); border-radius: var(--radio); padding: .75rem; background: var(--superficie); text-align: center; break-inside: avoid; }
.vale .codigo { font-size: 1.35rem; font-weight: 600; letter-spacing: .08em; display: block; margin: .3rem 0; }
.secreto { font-family: var(--cifras); font-size: 1.15rem; font-weight: 600; background: var(--alerta-suave); padding: .25rem .5rem; border-radius: var(--radio-chico); overflow-wrap: anywhere; }

.texto-constancia {
  font-family: var(--cifras); font-size: .9rem; white-space: pre-wrap; overflow-wrap: anywhere;
  background: #f7f8fa; border: 1px solid var(--borde); border-radius: var(--radio-chico); padding: 1rem; margin: 0 0 1rem;
}
.huella { font-family: var(--cifras); font-size: .85rem; overflow-wrap: anywhere; color: var(--tenue); }

.grafico { width: 100%; height: auto; max-height: 260px; display: block; }
.grafico .eje { stroke: var(--borde); stroke-width: 1; }
.grafico .barra-svg { fill: var(--acento); }
.grafico .barra-svg:hover { fill: var(--acento-fuerte); }
.grafico .etiqueta-svg { fill: var(--tenue); font-size: 11px; font-family: var(--letra); }

.lista-simple { margin: 0; padding-left: 1.2rem; }
.lista-simple li { margin-bottom: .3rem; }
.lista-limpia { list-style: none; padding: 0; margin: 0; }
.lista-limpia > li { padding: .55rem 0; border-bottom: 1px solid var(--borde); }
.lista-limpia > li:last-child { border-bottom: 0; }
.vacio { color: var(--tenue); font-style: italic; }
.portada-lema { font-size: 1.1rem; color: var(--tenue); max-width: 760px; }
.pasos { counter-reset: paso; list-style: none; padding: 0; margin: 0 0 1.25rem; display: grid; gap: .75rem; grid-template-columns: repeat(auto-fit, minmax(min(210px, 100%), 1fr)); }
.pasos li { counter-increment: paso; background: var(--superficie); border: 1px solid var(--borde); border-radius: var(--radio); padding: .8rem .9rem; }
.pasos li::before { content: counter(paso); display: inline-flex; width: 1.6rem; height: 1.6rem; border-radius: 50%; align-items: center; justify-content: center; background: var(--acento); color: #fff; font-weight: 700; margin: 0 .45rem .35rem 0; }
.cuentas-demo td:first-child { font-family: var(--cifras); }

/* --- pie ---------------------------------------------------------------- */

.pie { border-top: 1px solid var(--borde); background: var(--superficie); color: var(--tenue); font-size: .9rem; }
.pie-interior { max-width: 1180px; margin: 0 auto; padding: 1rem; display: flex; flex-wrap: wrap; gap: .5rem 1.5rem; justify-content: space-between; }
.pie a { color: var(--tenue); }

/* --- móvil -------------------------------------------------------------- */

@media (max-width: 720px) {
  html { font-size: 15px; }
  :root { --control: 44px; }
  .cabecera-interior { padding: .5rem .75rem; }
  .sesion { margin-left: 0; width: 100%; }
  .sesion select { min-width: 0; flex: 1 1 auto; height: 40px; }
  main.contenedor { padding: 1rem .75rem 2.5rem; }
  h1 { font-size: 1.35rem; }
  .cifra-valor { font-size: 1.12rem; }
  .tabla th, .tabla td { padding: .45rem .5rem; }
  .boton, button { min-height: 44px; }
  .boton-chico { min-height: 36px; }
  .en-linea { width: 100%; }
  .en-linea > button { flex: 1 1 auto; }
  body { overflow-x: hidden; }
}

/* --- impresión (constancias, vales, informe) ---------------------------- */

@media print {
  body { background: #fff; }
  .cabecera, .subnav, .banda, .pie, .no-imprimir, .acciones, form { display: none !important; }
  main.contenedor { max-width: none; padding: 0; }
  .tarjeta, .cifra { border-color: #999; }
  a { color: inherit; text-decoration: none; }
  .vale { border-color: #555; }
}

/* Entrar con un clic: un botón por cuenta de la demostración (el mismo formulario de entrar). */
.un-clic { list-style: none; margin: .5rem 0 0; padding: 0; display: grid; gap: .4rem; }
.un-clic form { margin: 0; }
.un-clic button { width: 100%; display: flex; align-items: center; justify-content: space-between; gap: .6rem; min-height: 44px; padding: .4rem .65rem;
  font-weight: 400; text-align: left; color: var(--tinta); background: var(--superficie); border: 1px solid var(--borde); border-radius: var(--radio-chico); }
.un-clic button:hover { border-color: var(--acento); background: var(--acento-suave); color: var(--tinta); }
.un-clic button:focus-visible { outline: 2px solid var(--foco); outline-offset: 2px; }
.un-clic__texto { display: grid; gap: 2px; min-width: 0; }
.un-clic__que { font-weight: 600; font-size: .92rem; }
.un-clic__correo { font-family: var(--cifras); font-size: .78rem; color: var(--tenue); overflow-wrap: anywhere; }
.un-clic__ir { flex: none; font-size: .85rem; font-weight: 600; color: var(--acento); }
@media print { .un-clic { display: none; } }
