:root {
  color-scheme: light;
  font-family: system-ui, "Segoe UI", sans-serif;
  color: #192c25;
  background: #f1f3ed;
  --bosque: #173a30;
  --verde: #256451;
  --claro: #e6eee6;
  --tinta: #192c25;
  --gris: #4e635a;
  --borde: #cbd6cc;
  --papel: #fffefa;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; min-width: 280px; }
h1, h2, h3, p { margin: 0 0 .65rem; }
h1, h2 { font-family: Georgia, Cambria, serif; font-weight: 500; }
h1 { font-size: clamp(2rem, 4vw, 3.25rem); line-height: 1.06; letter-spacing: -.04em; }
h2 { font-size: 1.65rem; }
h3 { font-size: 1rem; }
a { color: var(--verde); }
p, td, dd { overflow-wrap: anywhere; }
small, .nota { color: var(--gris); }
button, input, select, textarea { font: inherit; color: inherit; min-width: 0; }
button, .boton {
  display: inline-flex; justify-content: center; align-items: center; border: 1px solid var(--borde);
  background: var(--papel); border-radius: .55rem; padding: .65rem .85rem; cursor: pointer; text-decoration: none;
}
button:hover, .boton:hover { background: var(--claro); }
button:disabled { opacity: .55; cursor: wait; }
.primario { background: var(--verde); border-color: var(--verde); color: white; }
.primario:hover { background: var(--bosque); color: white; }
:focus-visible { outline: 3px solid #946119; outline-offset: 3px; }
.salto { position: fixed; left: 1rem; top: -6rem; z-index: 10; background: white; padding: .75rem; }
.salto:focus { top: 1rem; }
.cabecera {
  display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: .75rem;
  padding: .85rem clamp(1rem, 4vw, 3.5rem); background: var(--bosque); color: #f8fff7;
}
.cabecera strong { display: block; }
.cabecera span { font-size: .85rem; color: #dce8dc; }
.cabecera button { background: transparent; color: white; border-color: #97ac9f; }
.cabecera button:hover { background: #285747; }
.usuario, .acciones { display: flex; gap: .65rem; align-items: center; flex-wrap: wrap; }
.distribucion { display: grid; grid-template-columns: minmax(12.5rem, 16rem) minmax(0, 1fr); min-height: calc(100vh - 5rem); }
nav { padding: 1.4rem .8rem; background: #e6ece3; border-right: 1px solid var(--borde); }
nav p { margin: .8rem .6rem .45rem; font-size: .75rem; font-weight: 700; text-transform: uppercase; letter-spacing: .11em; color: #435d50; }
nav button { width: 100%; justify-content: flex-start; border: 0; background: none; text-align: left; font-size: .92rem; }
nav button[aria-current="page"] { font-weight: 700; color: #173726; background: #d1e2d3; }
main { padding: clamp(1rem, 4vw, 3.4rem); width: 100%; max-width: 100rem; }
main:focus { outline: none; }
.encabezado {
  display: flex; justify-content: space-between; align-items: end; gap: 1rem; flex-wrap: wrap;
  margin-bottom: 1.25rem; border-bottom: 1px solid var(--borde); padding-bottom: 1.3rem;
}
.procedencia { text-transform: uppercase; letter-spacing: .12em; font-size: .74rem; font-weight: 720; }
.panel {
  background: var(--papel); border: 1px solid var(--borde); margin: 0 0 1rem;
  padding: clamp(.9rem, 2.5vw, 1.4rem); border-radius: .8rem;
}
.rejilla, .indicadores, dl { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 15rem), 1fr)); gap: 1rem; }
.indicador strong { font-size: 2rem; display: block; }
.indicador { border-top: 3px solid var(--verde); }
label { display: grid; gap: .35rem; font-size: .9rem; font-weight: 650; }
input, select, textarea { width: 100%; border: 1px solid #94a89b; background: white; padding: .58rem; border-radius: .4rem; }
textarea { resize: vertical; min-height: 5.5rem; }
input[type="checkbox"] { width: auto; justify-self: start; }
form > .acciones { margin-top: 1rem; }
fieldset { border: 1px solid var(--borde); border-radius: .55rem; margin: 0; min-width: 0; }
legend { font-weight: 650; }
.fila { padding: .7rem 0; border-bottom: 1px solid var(--borde); margin-bottom: .5rem; }
.fila button { margin-top: .45rem; }
dl > div:has(.tabla) { grid-column: 1 / -1; }
.ancho { grid-column: 1 / -1; }
.tabla { overflow: auto; }
table { width: 100%; border-collapse: collapse; min-width: 34rem; }
td, th { padding: .7rem .55rem; border-bottom: 1px solid #e0e5dd; text-align: left; font-size: .88rem; vertical-align: top; }
th { color: #40584a; background: #eef2ea; }
td button { min-width: 4.4rem; padding: .36rem .55rem; }
.estado { display: inline-block; background: #e5eee4; color: #1f4836; padding: .18rem .5rem; border-radius: 1rem; font-size: .8rem; }
.alerta { background: #fff1d6; color: #573506; }
dl { margin: 1rem 0 0; }
dt { color: var(--gris); font-size: .8rem; font-weight: 650; }
dd { margin: .25rem 0 0; white-space: pre-wrap; }
details { padding: .6rem 0; border-bottom: 1px solid var(--borde); }
summary { cursor: pointer; font-weight: 650; }
code { overflow-wrap: anywhere; word-break: break-word; }
#aviso { z-index: 5; position: fixed; bottom: 1rem; right: 1rem; max-width: min(28rem, calc(100% - 2rem)); padding: .8rem 1rem; background: var(--bosque); color: white; border-radius: .55rem; box-shadow: 0 .3rem 1.6rem #192c2544; }
#aviso.error { background: #852b26; }
.ingreso { display: grid; grid-template-columns: 1fr 1fr; max-width: 57rem; margin: clamp(1rem, 13vh, 8rem) auto 1rem; min-height: 25rem; border: 1px solid var(--borde); border-radius: 1rem; overflow: hidden; }
.identidad { background: var(--bosque); color: white; padding: clamp(1.4rem, 5vw, 4rem); display: flex; flex-direction: column; justify-content: center; }
.identidad .procedencia { color: #dce8dc; }
.ingreso form { display: grid; gap: 1rem; align-content: center; padding: clamp(1.3rem, 4vw, 3rem); background: var(--papel); }
@media (max-width: 760px) {
  .distribucion { grid-template-columns: minmax(0, 1fr); }
  nav { display: flex; gap: .3rem; padding: .5rem; border: none; border-bottom: 1px solid var(--borde); overflow-x: auto; }
  nav p { display: none; }
  nav button { width: auto; flex-shrink: 0; }
  .ingreso { grid-template-columns: 1fr; margin: 1rem; min-height: 0; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { scroll-behavior: auto !important; } }
