:root {
  --tinta: #22201c; --fondo: #f4f5f8; --papel: #ffffff; --linea: #e2e5ea; --linea-fuerte: #cfd4dc; --azul: #1f3a5f; --azul-claro: #eef3fa; --oro: #b89a5a;
  --ok: #2e7d32; --mal: #b3261e; --aviso: #8a5a00; --gris: #6b665d;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Liberation Sans", sans-serif;
  --radio: 10px; --sombra: 0 1px 2px rgba(20, 30, 50, .06), 0 4px 14px rgba(20, 30, 50, .06);
}
* { box-sizing: border-box; }
body { margin: 0; font: 15px/1.5 var(--sans); color: var(--tinta); background: var(--fondo); }
a { color: var(--azul); }
code, pre { font: 12.5px/1.4 ui-monospace, Consolas, monospace; }
code.hash { word-break: break-all; }
/* Iconos: sprite SVG incrustado una vez en el layout (trazo fino, currentColor, sin dependencias). */
.sprite { display: none; }
.ico { width: 1.15em; height: 1.15em; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; vertical-align: -.22em; margin-right: .45em; flex: none; }
.cabecera { position: sticky; top: 0; z-index: 50; display: flex; align-items: stretch; gap: 1.5rem; padding: 0 1.5rem; background: var(--azul); color: #fff; border-bottom: 3px solid var(--oro); box-shadow: 0 2px 10px rgba(0, 0, 0, .18); }
/* Instalación de ensayo: franja a rayas, imposible de confundir con la definitiva. */
.franja-ensayo { padding: .45rem 1.5rem; background: repeating-linear-gradient(-45deg, #ffe08a 0 14px, #ffd35c 14px 28px); color: #3d2a00; font-size: .9rem; text-align: center; border-bottom: 2px solid #b8860b; }
/* Sombra solo al hacer scroll donde el navegador admite animaciones guiadas por scroll; el resto ve una sombra sutil fija. */
@supports (animation-timeline: scroll()) {
  .cabecera { box-shadow: none; animation: cabecera-sombra linear both; animation-timeline: scroll(); animation-range: 0 60px; }
  @keyframes cabecera-sombra { to { box-shadow: 0 2px 12px rgba(0, 0, 0, .28); } }
}
.cabecera a { color: #fff; text-decoration: none; }
.marca { display: flex; flex-direction: column; justify-content: center; padding: .55rem 0; line-height: 1.25; margin-right: .5rem; }
.marca-titulo { font-weight: 700; font-size: 1.2rem; letter-spacing: .01em; }
.marca .sub { opacity: .8; font-size: .82rem; }
.menu { display: flex; align-items: stretch; flex-wrap: wrap; font-size: .92rem; }
.menu > a, .menu summary { display: flex; align-items: center; padding: 0 1rem; min-height: 3.6rem; border-bottom: 3px solid transparent; margin-bottom: -3px; color: #fff; white-space: nowrap; }
.menu > a:hover, .menu summary:hover { background: rgba(255, 255, 255, .09); }
.menu > a.actual { background: rgba(255, 255, 255, .16); border-bottom-color: #fff; font-weight: 600; }
.desplegable { position: relative; }
.desplegable summary { list-style: none; cursor: pointer; user-select: none; }
.desplegable summary::-webkit-details-marker { display: none; }
.desplegable summary .flecha { margin: 0 0 0 .3em; width: .9em; height: .9em; transition: transform .15s; }
.desplegable[open] summary, .desplegable.actual summary { background: rgba(255, 255, 255, .16); }
.desplegable.actual summary { border-bottom-color: #fff; font-weight: 600; }
.desplegable-menu a.actual { background: var(--azul-claro); color: var(--azul); font-weight: 600; }
.desplegable[open] summary .flecha { transform: rotate(180deg); }
.desplegable-menu { position: absolute; top: calc(100% + 3px); left: 0; min-width: 17rem; background: var(--papel); color: var(--tinta); border: 1px solid var(--linea); border-radius: var(--radio); box-shadow: var(--sombra); padding: .4rem; z-index: 60; }
.desplegable-menu a { display: flex; align-items: center; color: var(--tinta); padding: .5rem .7rem; border-radius: 6px; font-size: .92rem; white-space: nowrap; }
.desplegable-menu a:hover { background: var(--azul-claro); color: var(--azul); }
.desplegable-menu a small { color: var(--gris); font-size: .78rem; margin-left: .5rem; }
.sesion { display: flex; align-items: center; gap: .7rem; margin-left: auto; font-size: .9rem; white-space: nowrap; }
.quien { display: inline-flex; align-items: center; background: rgba(255, 255, 255, .14); border: 1px solid rgba(255, 255, 255, .25); border-radius: 999px; padding: .28rem .85rem .28rem .7rem; }
.quien .rol { margin-left: .45rem; font-size: .72rem; text-transform: uppercase; letter-spacing: .05em; opacity: .8; }
form.inline { display: inline; }
button.enlace { display: inline-flex; align-items: center; background: none; border: 1px solid transparent; border-radius: 6px; color: #fff; cursor: pointer; font: inherit; padding: .3rem .6rem; }
button.enlace:hover { background: rgba(255, 255, 255, .12); }
button.enlace.demo-reiniciar { color: #ffd166; border-color: rgba(255, 209, 102, .5); }
button.enlace.demo-reiniciar:hover { background: rgba(255, 209, 102, .15); }
@media (max-width: 900px) { .cabecera { flex-wrap: wrap; padding-bottom: .4rem; } .sesion { margin-left: 0; } .menu > a, .menu summary { min-height: 2.6rem; padding: 0 .7rem; } }
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-top: 3px solid var(--azul); border-radius: var(--radio); box-shadow: var(--sombra); padding: 1.1rem 1.5rem 1.3rem; 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); }
/* Cabecera de tarjeta (tablón): título con icono, ayuda contextual a la derecha, separador sutil. */
.tarjeta-cabecera { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .5rem 1rem; padding-bottom: .7rem; margin: 0 0 .9rem; border-bottom: 1px solid var(--linea); }
.tarjeta-cabecera h1 { margin: 0; display: flex; align-items: center; font-size: 1.25rem; }
.tarjeta-cabecera h1 .ico { color: var(--azul); width: 1.3em; height: 1.3em; margin-right: .55em; }
.tarjeta-cabecera h1 small { margin-left: .5rem; font-weight: normal; font-size: .85rem; }
.tarjeta-cabecera .ayuda-enlace { float: none; margin: 0; display: flex; flex-wrap: wrap; gap: .4rem; }
.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: .42rem .6rem; text-align: left; vertical-align: top; }
th { font-family: var(--sans); font-size: .74rem; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; color: var(--gris); background: #f7f8fa; border-bottom: 1px solid var(--linea-fuerte); }
tbody tr:hover td { background: #fafbfd; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
tfoot td { font-weight: 600; border-top: 2px solid var(--linea-fuerte); border-bottom: 0; background: var(--azul-claro); }
.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 var(--sans); 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-pendiente { background: #fff4d6; color: var(--aviso); } .etiqueta-adjudicada { background: #d9f5e4; } .etiqueta-descartada { background: #e6e2d9; color: var(--gris); }
.etiqueta-TRASPASO, .etiqueta-READJUDICACION, .etiqueta-AJUSTE_ENTRADA { background: #d9f5e4; }
tr.inversion td, tbody tr.inversion:hover td { background: #fff4d6; }
.marca-inversion { display: inline-block; font: bold .72rem/1.6 var(--sans); color: #fff; background: var(--aviso); padding: 0 .4rem; border-radius: 3px; }
.inversion-enlace { color: var(--aviso); font-weight: bold; }
.grupo { font: .75rem var(--sans); color: var(--gris); border: 1px dashed var(--linea); padding: 0 .3rem; }
.aviso { padding: .7rem 1rem; border-radius: 8px; margin-bottom: 1rem; 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: 6px; 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: var(--sans); 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: var(--sans); 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: .8rem var(--sans); margin: 0 0 .3rem .8rem; }
/* Píldoras de ayuda contextual con el mismo icono de interrogación del menú (máscara CSS en currentColor). */
.ayuda-enlace a, a.ayuda-enlace { display: inline-flex; align-items: center; gap: .35em; padding: .22rem .7rem .22rem .55rem; border: 1px solid var(--linea-fuerte); border-radius: 999px; background: var(--papel); color: var(--azul); text-decoration: none; white-space: nowrap; }
.ayuda-enlace a:hover, a.ayuda-enlace:hover { background: var(--azul-claro); border-color: var(--azul); }
.ayuda-enlace a::before, a.ayuda-enlace::before { content: ""; width: 1em; height: 1em; flex: none; background: currentColor; -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='10'/%3E%3Cpath d='M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3'/%3E%3Cline x1='12' y1='17' x2='12.01' y2='17'/%3E%3C/svg%3E") center / contain no-repeat; mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='10'/%3E%3Cpath d='M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3'/%3E%3Cline x1='12' y1='17' x2='12.01' y2='17'/%3E%3C/svg%3E") center / contain no-repeat; }
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: 6px; 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); }
/* Instalador web (Turno\Instalacion\InstaladorWeb). */
.instalacion { max-width: 760px; margin: 2rem auto; }
.instalador fieldset { border: 1px solid var(--linea); border-radius: 8px; padding: .8rem 1rem 1rem; margin: 0 0 1.2rem; }
.instalador legend { font-weight: 700; color: var(--azul); padding: 0 .4rem; }
.instalador label { display: block; margin: .6rem 0; }
.instalador input[type=text], .instalador input[type=email], .instalador input[type=password], .instalador textarea { display: block; width: 100%; box-sizing: border-box; margin-top: .25rem; font: inherit; padding: .3rem .4rem; border: 1px solid var(--linea); border-radius: 3px; }
.instalador label small { display: block; color: var(--gris); font-size: .82rem; margin-top: .2rem; }
.instalador label.casilla { display: flex; gap: .5rem; align-items: flex-start; }
.instalador .aviso label.casilla { margin-top: .7rem; font-weight: 600; }
.bloque-acta { background: var(--fondo); border: 1px solid var(--linea); border-radius: 8px; padding: .8rem 1rem; white-space: pre-wrap; font-size: .85rem; }
/* Filas que abren su ficha al pinchar (app.js). */
tr.fila-enlace { cursor: pointer; }
tr.fila-enlace:hover td, tr.fila-enlace:focus-visible td { background: var(--azul-claro); }
tr.fila-enlace:focus-visible { outline: 2px solid var(--azul); outline-offset: -2px; }
