:root {
  --tinta: #22201c; --fondo: #f5f2ec; --papel: #ffffff; --linea: #d8d2c6; --azul: #1f3a5f; --oro: #b89a5a;
  --ok: #2e7d32; --mal: #b3261e; --aviso: #8a5a00; --gris: #6b665d;
}
* { box-sizing: border-box; }
body { margin: 0; font: 15px/1.5 Georgia, "Liberation Serif", serif; color: var(--tinta); background: var(--fondo); }
a { color: var(--azul); }
code, pre { font: 12.5px/1.4 ui-monospace, Consolas, monospace; }
.cabecera { display: flex; flex-wrap: wrap; gap: 1rem; align-items: baseline; justify-content: space-between; padding: .8rem 1.5rem; background: var(--azul); color: #fff; border-bottom: 4px solid var(--oro); }
.cabecera a { color: #fff; text-decoration: none; }
.marca a { font-weight: bold; font-size: 1.15rem; }
.marca .sub { opacity: .8; font-size: .9rem; margin-left: .5rem; }
.cabecera nav { display: flex; gap: 1.2rem; align-items: baseline; font-family: Arial, "Liberation Sans", sans-serif; font-size: .9rem; }
.cabecera nav a:hover { text-decoration: underline; }
.quien { opacity: .85; margin-right: .6rem; }
form.inline { display: inline; }
button.enlace { background: none; border: 0; color: #fff; cursor: pointer; text-decoration: underline; font: inherit; padding: 0; }
button.enlace.demo-reiniciar { color: #ffd166; margin-right: .8rem; }
main { max-width: 1400px; margin: 1.5rem auto; padding: 0 1.5rem; }
footer { text-align: center; color: var(--gris); font-size: .8rem; padding: 2rem 0; }
.tarjeta { background: var(--papel); border: 1px solid var(--linea); border-radius: 4px; padding: 1.2rem 1.5rem; margin-bottom: 1.5rem; overflow-x: auto; }
.tarjeta.estrecha { max-width: 420px; margin: 3rem auto; }
h1 { font-size: 1.3rem; margin: 0 0 .8rem; color: var(--azul); }
.meta { color: var(--gris); font-size: .9rem; }
table { border-collapse: collapse; width: 100%; font-size: .9rem; }
th, td { border-bottom: 1px solid var(--linea); padding: .35rem .5rem; text-align: left; vertical-align: top; }
th { font-family: Arial, "Liberation Sans", sans-serif; font-size: .78rem; text-transform: uppercase; letter-spacing: .04em; color: var(--gris); }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
tfoot td { font-weight: bold; border-top: 2px solid var(--linea); }
.saldos .orden { color: var(--gris); font-size: .8rem; }
.estado-vacante td, .estado-amortizada td { color: var(--gris); font-style: italic; }
.deficit { color: var(--ok); } .superavit { color: var(--mal); }
.etiqueta { display: inline-block; font: bold .7rem/1.6 Arial, sans-serif; letter-spacing: .04em; padding: 0 .45rem; border-radius: 3px; background: #e6e2d9; color: var(--tinta); }
.etiqueta-PREFERENCIA { background: #f3e3b8; } .etiqueta-TURNO { background: #d9e6f5; }
.etiqueta-ANULACION, .etiqueta-EXCLUSION { background: #f5d9d6; } .etiqueta-RECTIFICACION { background: #e2d9f5; }
.etiqueta-TRASPASO, .etiqueta-READJUDICACION, .etiqueta-AJUSTE_ENTRADA { background: #d9f5e4; }
tr.inversion td { background: #fff4d6; }
.marca-inversion { display: inline-block; font: bold .72rem/1.6 Arial, sans-serif; color: #fff; background: var(--aviso); padding: 0 .4rem; border-radius: 3px; }
.inversion-enlace { color: var(--aviso); font-weight: bold; }
.grupo { font: .75rem Arial, sans-serif; color: var(--gris); border: 1px dashed var(--linea); padding: 0 .3rem; }
.aviso { padding: .6rem .9rem; border-radius: 4px; margin-bottom: .8rem; border: 1px solid; }
.aviso ul { margin: 0; padding-left: 1.2rem; }
.aviso-ok { background: #e7f4e8; border-color: var(--ok); }
.aviso-error { background: #fbe9e7; border-color: var(--mal); }
.aviso-aviso { background: #fff4d6; border-color: var(--aviso); }
.ok { color: var(--ok); font-weight: bold; } .mal { color: var(--mal); font-weight: bold; }
label { display: block; margin: .5rem 0; }
label.check { display: inline-block; }
input[type=text], input[type=password], input[type=date], select { font: inherit; padding: .3rem .4rem; border: 1px solid var(--linea); border-radius: 3px; width: 100%; max-width: 100%; }
.tarjeta.estrecha input { width: 100%; }
button { font: inherit; padding: .45rem 1rem; border-radius: 3px; border: 1px solid var(--azul); background: #fff; color: var(--azul); cursor: pointer; }
button.primario { background: var(--azul); color: #fff; }
button.secundario, a.secundario { font-size: .9rem; margin-left: .6rem; }
.dos-columnas { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; }
@media (max-width: 800px) { .dos-columnas { grid-template-columns: 1fr; } }
.filtros { display: flex; flex-wrap: wrap; gap: .4rem 1rem; align-items: end; margin-bottom: .8rem; font-size: .9rem; }
.filtros label { margin: 0; }
.filtros input, .filtros select { width: auto; }
table.alta input, table.alta select { width: 100%; min-width: 5rem; }
fieldset.unidad { border: 1px solid var(--linea); margin: 1rem 0; padding: .5rem 1rem; }
dl.campos { display: grid; grid-template-columns: max-content 1fr; gap: .3rem 1.2rem; margin: 0; }
dl.campos dt { color: var(--gris); font-family: Arial, sans-serif; font-size: .8rem; text-transform: uppercase; padding-top: .15rem; }
dl.campos dd { margin: 0; overflow-wrap: anywhere; }
pre.json { white-space: pre-wrap; background: #f7f5f0; border: 1px solid var(--linea); padding: .6rem; margin: 0; }
ul.correctivos { padding-left: 1.2rem; }
@media (max-width: 800px) { .serie th:nth-child(5), .serie td:nth-child(5), .serie th:nth-child(7), .serie td:nth-child(7) { display: none; } }
.subnav { display: flex; gap: 1rem; margin-bottom: 1rem; font-family: Arial, sans-serif; font-size: .9rem; }
.subnav a { padding: .3rem .7rem; border: 1px solid var(--linea); border-radius: 3px; background: #fff; text-decoration: none; }
.subnav a.actual { background: var(--azul); color: #fff; border-color: var(--azul); }
details { margin: .3rem 0; } summary { cursor: pointer; color: var(--azul); }
textarea { font: 12.5px/1.4 ui-monospace, Consolas, monospace; width: 100%; border: 1px solid var(--linea); border-radius: 3px; padding: .4rem; }
h2 { font-size: 1.05rem; color: var(--azul); margin: 1rem 0 .5rem; }
form.correccion { border: 1px solid var(--linea); padding: .6rem 1rem; margin: .5rem 0; border-radius: 3px; }
.ayuda { display: grid; grid-template-columns: 240px 1fr; gap: 1.5rem; align-items: start; }
.ayuda-indice { position: sticky; top: 1rem; }
.ayuda-indice ol { padding-left: 1.2rem; margin: 0; font-size: .9rem; }
.ayuda-indice li { margin: .3rem 0; }
.ayuda-indice h2 { font-size: .8rem; text-transform: uppercase; letter-spacing: .04em; opacity: .7; margin: .9rem 0 .3rem; }
.ayuda-indice .meta { font-size: .8rem; opacity: .7; margin-top: 1rem; }
.ayuda-texto h2 { font-size: 1.2rem; color: var(--azul); margin: 1.6rem 0 .6rem; padding-top: .4rem; border-top: 1px solid var(--linea); }
.ayuda-texto h2:first-child { border-top: 0; margin-top: 0; }
.ayuda-texto ol, .ayuda-texto ul { padding-left: 1.4rem; }
.ayuda-texto li { margin: .25rem 0; }
.ayuda-texto p { max-width: 75ch; }
.ayuda-enlace { float: right; font: .85rem Arial, "Liberation Sans", sans-serif; margin: 0 0 .3rem .8rem; }
nav.subnav .ayuda-enlace { float: none; margin-left: auto; border: 0; background: none; }
@media (max-width: 800px) { .ayuda { grid-template-columns: 1fr; } .ayuda-indice { position: static; } }
a.boton { display: inline-block; padding: .45rem 1rem; border-radius: 3px; border: 1px solid var(--azul); text-decoration: none; }
a.boton.primario { background: var(--azul); color: #fff; }
.carta-texto { max-height: 70vh; overflow: auto; font-size: 12px; }
.carta-pdf { width: 100%; height: 70vh; border: 1px solid var(--linea); }
