:root { --fondo: #f4f5f7; --texto: #1d2330; --acento: #1f5fbf; --borde: #d5d9e0; }
* { box-sizing: border-box; }
body { margin: 0; font: 16px/1.5 system-ui, -apple-system, "Segoe UI", sans-serif; background: var(--fondo); color: var(--texto); }
.barra { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .75rem 1.25rem; background: #fff; border-bottom: 1px solid var(--borde); }
.marca { font-weight: 600; }
.contenido { max-width: 960px; margin: 2rem auto; padding: 0 1rem; }
.tarjeta { background: #fff; border: 1px solid var(--borde); border-radius: 8px; padding: 1.5rem; max-width: 480px; }
.boton { display: inline-block; padding: .55rem 1rem; border: 0; border-radius: 6px; background: var(--acento); color: #fff; font: inherit; text-decoration: none; cursor: pointer; }
.boton.secundario { background: #fff; color: var(--acento); border: 1px solid var(--acento); }
.salir { display: flex; align-items: center; gap: .75rem; margin: 0; font-size: .9rem; }

.contenido:has(.filtros) { max-width: 1100px; }
.filtros { display: flex; flex-wrap: wrap; gap: .75rem 1rem; align-items: flex-end; background: #fff; border: 1px solid var(--borde); border-radius: 8px; padding: 1rem; margin-bottom: 1rem; }
.filtros label { display: flex; flex-direction: column; gap: .25rem; font-size: .85rem; color: #4a5365; }
.filtros input, .filtros select { font: inherit; padding: .4rem .5rem; border: 1px solid var(--borde); border-radius: 6px; background: #fff; color: var(--texto); min-width: 9rem; }
.acciones { display: flex; align-items: center; gap: .75rem; }
.htmx-indicator { opacity: 0; transition: opacity 150ms ease-in; font-size: .85rem; color: #4a5365; }
.htmx-request .htmx-indicator, .htmx-request.htmx-indicator { opacity: 1; }
.resumen, .vacio { color: #4a5365; margin: .5rem 0; }
.errores { background: #fdecec; border: 1px solid #f1b5b5; color: #7a1f1f; border-radius: 8px; padding: .5rem 1rem; margin-bottom: 1rem; }
.errores ul { margin: .25rem 0; padding-left: 1.25rem; }
.tabla-contenedor { overflow-x: auto; background: #fff; border: 1px solid var(--borde); border-radius: 8px; }
.tabla { width: 100%; border-collapse: collapse; font-size: .92rem; }
.tabla th, .tabla td { text-align: left; padding: .5rem .75rem; border-bottom: 1px solid var(--borde); white-space: nowrap; }
.tabla th { background: #f8f9fb; font-weight: 600; }
.tabla .num { text-align: right; font-variant-numeric: tabular-nums; }
.tabla tr.mas td { text-align: center; }
.etiqueta { display: inline-block; padding: .05rem .5rem; border-radius: 999px; background: #eef1f6; border: 1px solid var(--borde); font-size: .8rem; }

.enlace { color: var(--acento); text-decoration: none; }
.enlace:hover { text-decoration: underline; }
.contenido:has(.visor) { max-width: 1200px; }
.visor { display: grid; grid-template-columns: 300px 1fr; gap: 1rem; align-items: start; }
.ficha { background: #fff; border: 1px solid var(--borde); border-radius: 8px; padding: 1rem 1.25rem; }
.ficha h1 { font-size: 1.15rem; margin: 0 0 .75rem; }
.ficha dl { display: grid; grid-template-columns: auto 1fr; gap: .35rem .75rem; margin: 0; font-size: .9rem; }
.ficha dt { color: #4a5365; }
.ficha dd { margin: 0; overflow-wrap: anywhere; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .82rem; }
.vista { background: #fff; border: 1px solid var(--borde); border-radius: 8px; padding: 1rem; }
.acciones-visor { display: flex; flex-wrap: wrap; align-items: center; gap: .75rem; margin-bottom: .75rem; }
.acciones-visor .boton:disabled { opacity: .6; cursor: progress; }
#estado { font-size: .88rem; color: #4a5365; }
.pdf { width: 100%; height: 70vh; border: 1px solid var(--borde); border-radius: 6px; background: #eef1f6; }
.descargas, .nota { font-size: .88rem; color: #4a5365; margin: .6rem 0 0; }
.marco-impresion { position: fixed; right: 0; bottom: 0; width: 1px; height: 1px; border: 0; opacity: 0; pointer-events: none; }
@media (max-width: 800px) { .visor { grid-template-columns: 1fr; } }
