/* Utiliec Anticipos · base compartida con Utiliec Conciliar
   Base común de la familia Utiliec (gris oficina, papel blanco)
   con color propio: frambuesa. Tipografías alojadas en el sitio (licencia OFL, ver fonts/). */
@font-face { font-family: "IBM Plex Sans"; src: url("fonts/ibm-plex-sans-latin-400-normal.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "IBM Plex Sans"; src: url("fonts/ibm-plex-sans-latin-500-normal.woff2") format("woff2"); font-weight: 500; font-style: normal; font-display: swap; }
@font-face { font-family: "IBM Plex Sans"; src: url("fonts/ibm-plex-sans-latin-600-normal.woff2") format("woff2"); font-weight: 600; font-style: normal; font-display: swap; }
@font-face { font-family: "IBM Plex Sans"; src: url("fonts/ibm-plex-sans-latin-700-normal.woff2") format("woff2"); font-weight: 700; font-style: normal; font-display: swap; }
@font-face { font-family: "IBM Plex Mono"; src: url("fonts/ibm-plex-mono-latin-400-normal.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "IBM Plex Mono"; src: url("fonts/ibm-plex-mono-latin-600-normal.woff2") format("woff2"); font-weight: 600; font-style: normal; font-display: swap; }

:root {
  --office: #eef1f4;
  --paper: #ffffff;
  --ink: #1d2125;
  --muted: #5b626c;
  --rule: #d6dbe2;
  --rule-soft: #e7eaee;
  --brand: #0b6a88;        /* azul petróleo de marca */
  --brand-ink: #ffffff;
  --brand-soft: #e3f1f6;
  --pos: #1b6b3a;
  --neg: #b3261e;
  --ok-soft: #e6f4ea;
  --warn: #8a5a00;
  --warn-soft: #fdf3d8;
  --bad: #b3261e;
  --bad-soft: #fbe9e7;
  --sans: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
}
@media (prefers-color-scheme: dark) {
  :root { --office: #14171b; --paper: #1d2126; --ink: #e8eaed; --muted: #a3aab4; --rule: #343b45; --rule-soft: #2a3038;
    --brand: #7fd0ea; --brand-ink: #03222c; --brand-soft: #12303a; --pos: #7fd39b; --neg: #ff9b92; --ok-soft: #17301f; --warn: #f1c96b; --warn-soft: #33290f; --bad: #ff9b92; --bad-soft: #3a1a17; }
}

*, *::before, *::after { box-sizing: border-box; margin: 0; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body { font-family: var(--sans); font-size: 17px; line-height: 1.55; color: var(--ink); background: var(--office); -webkit-font-smoothing: antialiased; overflow-x: clip; }
img, svg { display: block; max-width: 100%; }
button { font: inherit; color: inherit; cursor: pointer; border: 0; background: none; }
a { color: inherit; }
p { text-wrap: pretty; }
h1, h2, h3 { text-wrap: balance; line-height: 1.15; }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; border-radius: 4px; }
.skip-link { position: fixed; top: -100px; left: 1rem; padding: .6rem 1rem; background: var(--paper); z-index: 99; border-radius: 6px; font-weight: 700; }
.skip-link:focus-visible { top: 1rem; }
.wrap { width: min(1180px, 100% - 32px); margin-inline: auto; }
.mono { font-family: var(--mono); }

/* ---------- Cabecera ---------- */
.top { background: var(--paper); border-bottom: 1px solid var(--rule); }
.bar { display: flex; align-items: center; justify-content: space-between; gap: 10px 20px; padding: 12px 0; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 1.15rem; text-decoration: none; }
.top nav { display: flex; gap: 2px; flex-wrap: wrap; }
.top nav a { padding: 6px 12px; font-size: .95rem; color: var(--muted); text-decoration: none; border-bottom: 2px solid transparent; }
.top nav a:hover { color: var(--ink); }
.top nav a[aria-current="page"] { color: var(--ink); font-weight: 600; border-bottom-color: var(--brand); }
@media (max-width: 640px) { .top nav { width: 100%; overflow-x: auto; flex-wrap: nowrap; scrollbar-width: none; margin: 0 -6px; } .top nav a { white-space: nowrap; } }

.hero { padding: 26px 0 16px; }
.hero h1 { font-size: clamp(1.6rem, 3vw + .7rem, 2.4rem); font-weight: 700; letter-spacing: -.015em; max-width: 26ch; }
.sub { color: var(--muted); margin-top: 8px; max-width: 66ch; }

/* ---------- Botones ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 10px 16px; min-height: 44px; border-radius: 6px; font-weight: 600; font-size: .95rem; border: 1px solid var(--rule); background: var(--paper); text-decoration: none; white-space: nowrap; cursor: pointer; }
.btn:hover { border-color: var(--ink); }
.btn.primary { background: var(--brand); color: var(--brand-ink); border-color: var(--brand); }
.btn.primary:hover { filter: brightness(1.12); }
.btn.small { min-height: 36px; padding: 6px 12px; font-size: .88rem; }
.btn[disabled] { opacity: .55; cursor: progress; }

/* ---------- Herramienta ---------- */
.tool { background: var(--paper); border: 1px solid var(--rule); border-radius: 10px; }
.drop { position: relative; display: grid; justify-items: center; text-align: center; gap: 10px; padding: 34px 20px 28px; }
.drop::before { content: ""; position: absolute; inset: 10px; border: 1.5px dashed var(--rule); border-radius: 8px; pointer-events: none; transition: border-color .15s, background-color .15s; }
.drop.over::before { border-color: var(--brand); background: color-mix(in srgb, var(--brand) 6%, transparent); }
.drop-ico { color: var(--brand); }
.drop-t { font-size: 1.2rem; font-weight: 600; }
.drop-s { color: var(--muted); font-size: .93rem; max-width: 52ch; }
.drop-actions { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-top: 4px; position: relative; }
.drop input[type=file] { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.carga-error { position: relative; max-width: 60ch; padding: 8px 12px; border-radius: 6px; background: var(--bad-soft); color: var(--bad); font-size: .92rem; }
.trabajando { padding: 40px 20px; text-align: center; color: var(--muted); }

.res-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 16px; padding: 14px 16px; border-bottom: 1px solid var(--rule); }
.res-sum { font-weight: 600; overflow-wrap: anywhere; }
.res-sum small { display: block; font-weight: 400; color: var(--muted); font-size: .88rem; }
.res-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.problemas { margin: 14px 16px 0; padding: 10px 14px; border-radius: 6px; background: color-mix(in srgb, var(--brand) 8%, var(--paper)); font-size: .9rem; }
.problemas.con-error { background: var(--bad-soft); }
.problemas summary { cursor: pointer; font-weight: 600; }
.problemas.con-error summary { color: var(--bad); }
.problemas ul { margin: 8px 0 2px; padding-left: 18px; max-height: 260px; overflow-y: auto; }
.problemas li { margin-bottom: 4px; }
.problemas li.err strong { color: var(--bad); }

.cifras { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; padding: 16px; }
.cifra { border: 1px solid var(--rule); border-radius: 8px; padding: 12px 14px; display: grid; gap: 2px; }
.c-l { font-size: .88rem; color: var(--muted); }
.c-v { font-family: var(--mono); font-size: 1.5rem; font-weight: 600; font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.c-n { font-size: .8rem; color: var(--muted); }

.vistas { display: flex; gap: 2px; padding: 0 16px; border-bottom: 1px solid var(--rule); overflow-x: auto; scrollbar-width: none; }
.vistas button { padding: 10px 14px; font-size: .95rem; color: var(--muted); border-bottom: 2px solid transparent; white-space: nowrap; }
.vistas button[aria-selected="true"] { color: var(--ink); font-weight: 600; border-bottom-color: var(--brand); }
.panel { padding: 16px; display: grid; gap: 14px; min-width: 0; }
.ayuda { font-size: .88rem; color: var(--muted); }
.sel-prod { display: grid; gap: 4px; max-width: 520px; }
.sel-prod span { font-weight: 600; font-size: .92rem; }
.sel-prod select { min-height: 44px; padding: 8px 10px; border: 1px solid var(--rule); border-radius: 6px; background: var(--paper); color: var(--ink); font: inherit; font-size: .95rem; }

/* Tablas */
.tbl { overflow-x: auto; background: var(--paper); border: 1px solid var(--rule); border-radius: 6px; }
.tbl table { border-collapse: collapse; width: 100%; font-size: .88rem; }
.tbl th, .tbl td { padding: 7px 10px; border-bottom: 1px solid var(--rule); text-align: left; vertical-align: top; }
.tbl tbody tr:last-child td { border-bottom: 0; }
.tbl th { background: var(--brand-soft); color: color-mix(in srgb, var(--brand) 72%, var(--ink)); font-weight: 700; text-align: center; white-space: nowrap; border-bottom: 2px solid var(--brand); }
.tbl td.n { text-align: right; white-space: nowrap; font-family: var(--mono); font-size: .84rem; font-variant-numeric: tabular-nums; }
.tbl td.nw { white-space: nowrap; }
.tbl td.fuerte { font-weight: 600; }
.tbl tfoot td { font-weight: 700; border-top: 2px solid var(--ink); background: color-mix(in srgb, var(--brand) 6%, var(--paper)); }
.tbl small { display: block; font-size: .78rem; }
.alerta { color: var(--bad); }
.fila-prod { cursor: pointer; }
.fila-prod:hover td, .fila-prod:focus td { background: var(--brand-soft); }
.fila-prod:focus { outline: none; }
.fila-prod:focus-visible td:first-child { box-shadow: inset 3px 0 0 var(--brand); }

/* Opciones de cálculo */
.opciones { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 18px; padding: 14px 16px; border-bottom: 1px solid var(--rule); }
.opciones .lbl { font-weight: 600; font-size: .95rem; }
.seg { display: inline-flex; border: 1px solid var(--rule); border-radius: 6px; overflow: hidden; }
.seg label { cursor: pointer; }
.seg label + label { border-left: 1px solid var(--rule); }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg span { display: block; padding: 8px 14px; font-size: .93rem; color: var(--muted); }
.seg input:checked + span { background: var(--ink); color: var(--paper); font-weight: 600; }
.seg input:focus-visible + span { outline: 2px solid var(--brand); outline-offset: -3px; }
.chk { display: flex; align-items: center; gap: 8px; font-size: .92rem; cursor: pointer; }
.chk input { width: 18px; height: 18px; accent-color: var(--brand); }


/* ---------- Los dos lados: libro y banco ---------- */
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.lados { display: grid; grid-template-columns: 1fr 1fr; position: relative; }
.lados::after { content: ""; position: absolute; top: 18px; bottom: 18px; left: 50%; border-left: 2px solid var(--brand); opacity: .55; }
.lados:has(details.revisar[open]) { grid-template-columns: 1fr; }
.lados:has(details.revisar[open])::after { display: none; }
.lados:has(details.revisar[open]) .lado + .lado { border-top: 1px solid var(--rule); }
.lado { padding: 16px; min-width: 0; display: grid; gap: 10px; align-content: start; }
.lado-h { display: grid; grid-template-columns: auto 1fr; gap: 2px 10px; align-items: center; border-bottom: 2px solid var(--brand); padding-bottom: 10px; }
.lado-h .paso { grid-row: span 2; width: 34px; height: 34px; border-radius: 50%; background: var(--brand); color: var(--brand-ink); display: grid; place-items: center; font-weight: 700; font-family: var(--mono); }
.lado-h h2 { font-size: 1.15rem; }
.lado-h p { font-size: .88rem; color: var(--muted); }
.lado .drop { padding: 22px 14px 18px; gap: 6px; }
.lado .drop::before { inset: 0; }
.lado.con-archivos .drop { padding: 10px; grid-template-columns: 1fr; }
.lado.con-archivos .drop .drop-t, .lado.con-archivos .drop .drop-s, .lado.con-archivos .drop .drop-ico { display: none; }
.lado.con-archivos .drop::before { border: 0; }
.lado.con-archivos .drop .btn.primary { background: var(--paper); color: var(--ink); border-color: var(--rule); font-weight: 500; }
.lado.cargando { opacity: .6; pointer-events: none; }
.lado.cargando .lado-h h2::after { content: " · leyendo…"; font-weight: 400; color: var(--muted); font-size: .9rem; }
.drop-t { font-size: 1.05rem; }
.archivos { display: grid; gap: 10px; min-width: 0; }
.arch { border: 1px solid var(--rule); border-radius: 8px; padding: 12px; display: grid; gap: 8px; min-width: 0; }
.arch.mal { border-color: var(--bad); }
.arch-h { display: flex; justify-content: space-between; gap: 10px; align-items: baseline; }
.arch-h strong { overflow-wrap: anywhere; }
.quitar, .enlace { color: var(--muted); font-size: .85rem; text-decoration: underline; text-underline-offset: 3px; padding: 4px 2px; min-height: 32px; }
.quitar:hover, .enlace:hover { color: var(--ink); }
.arch-sum { font-size: .92rem; color: var(--muted); }
.arch-cifras { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px 10px; }
.arch-cifras dt { font-size: .76rem; color: var(--muted); }
.arch-cifras dd { font-family: var(--mono); font-size: .9rem; font-weight: 600; font-variant-numeric: tabular-nums; }
.sello { font-size: .88rem; padding: 7px 10px; border-radius: 6px; display: flex; gap: 8px; align-items: baseline; }
.sello span { font-weight: 700; }
.sello.bien { background: var(--ok-soft); color: var(--pos); }
.sello.ojo { background: var(--warn-soft); color: var(--warn); }
.sello.neutro { background: var(--office); color: var(--muted); }
.arch-avisos { list-style: none; padding: 0; display: grid; gap: 4px; font-size: .86rem; }
.arch-avisos li { padding-left: 12px; border-left: 3px solid var(--rule); }
.arch-avisos li.aviso { border-color: var(--warn); }
.arch-avisos li.error { border-color: var(--bad); color: var(--bad); }
.revisar { border-top: 1px solid var(--rule-soft); padding-top: 8px; min-width: 0; }
.revisar summary { cursor: pointer; font-weight: 600; font-size: .92rem; color: var(--brand); }
.revisar[open] summary { margin-bottom: 10px; }
.ajustes { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: end; margin-bottom: 8px; }
.ajustes label:not(.chk) { display: grid; gap: 2px; font-size: .8rem; color: var(--muted); min-width: 0; }
.ajustes select, .prev select, .opciones select { font: inherit; font-size: .86rem; min-height: 36px; padding: 4px 8px; border: 1px solid var(--rule); border-radius: 6px; background: var(--paper); color: var(--ink); max-width: 100%; }
.ajustes select { max-width: 260px; }
.prev { max-height: 420px; overflow: auto; margin: 8px 0; }
.prev table { font-size: .8rem; }
.prev th { position: sticky; top: 0; z-index: 1; vertical-align: bottom; padding: 6px; text-align: left; }
.prev th select { display: block; width: 100%; min-width: 120px; font-size: .78rem; min-height: 32px; margin-bottom: 4px; }
.prev th select.con { border-color: var(--brand); font-weight: 600; }
.prev th span { display: block; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 180px; }
.prev td { white-space: nowrap; max-width: 220px; overflow: hidden; text-overflow: ellipsis; }
.prev td.apag { color: var(--muted); }
.prev td.nf, .prev th.nf { color: var(--muted); font-family: var(--mono); font-size: .74rem; text-align: right; }
.prev td.leido { font-size: .78rem; font-weight: 600; border-left: 2px solid var(--brand); color: var(--muted); position: sticky; right: 0; background: var(--paper); }
.prev th.leido { right: 0; z-index: 2; border-left: 2px solid var(--brand); }
.prev td.leido.pos, .pos { color: var(--pos); }
.prev td.leido.neg, .neg { color: var(--neg); }
.prev tr.falla td { background: var(--warn-soft); }
.omitidas { font-size: .84rem; background: var(--warn-soft); border-radius: 6px; padding: 8px 12px; }
.omitidas ul { padding-left: 18px; margin-top: 4px; }
.nota-solape { font-size: .86rem; color: var(--warn); }
.pie-carga { display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: center; padding: 12px 16px; border-top: 1px solid var(--rule); }
.pie-carga .falta { color: var(--muted); font-size: .92rem; }
.opciones { border-top: 1px solid var(--rule); border-bottom: 0; }
.opciones label.sel { display: flex; align-items: center; gap: 8px; font-size: .92rem; }

/* ---------- Resultado ---------- */
.res { border-top: 2px solid var(--brand); }
.veredicto { margin: 14px 16px 0; padding: 12px 14px; border-radius: 8px; font-size: .95rem; }
.veredicto.bien { background: var(--ok-soft); color: var(--pos); }
.veredicto.mal { background: var(--bad-soft); color: var(--bad); }
.veredicto.neutro { background: var(--office); color: var(--ink); }
.cuadro { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; padding: 14px 16px 4px; }
.cuadro-col { border: 1px solid var(--rule); border-radius: 8px; overflow: hidden; }
.cuadro table { border-collapse: collapse; width: 100%; font-size: .92rem; }
.cuadro th { background: var(--brand-soft); color: color-mix(in srgb, var(--brand) 72%, var(--ink)); text-align: left; padding: 8px 12px; border-bottom: 2px solid var(--brand); }
.cuadro td { padding: 8px 12px; border-bottom: 1px solid var(--rule-soft); }
.cuadro td small { color: var(--muted); font-size: .78rem; margin-left: 4px; white-space: nowrap; }
.cuadro td.n { text-align: right; font-family: var(--mono); font-variant-numeric: tabular-nums; white-space: nowrap; }
.cuadro tr.tot td { font-weight: 700; border-top: 2px solid var(--ink); border-bottom: 0; background: color-mix(in srgb, var(--brand) 6%, var(--paper)); }
.saldo-in { font: inherit; font-family: var(--mono); text-align: right; width: 150px; max-width: 100%; min-height: 36px; padding: 4px 8px; border: 1px solid var(--rule); border-radius: 6px; background: var(--paper); color: var(--ink); }
.saldo-in:placeholder-shown { border-color: var(--brand); }
.titulo-campo { display: grid; gap: 4px; padding: 10px 16px 0; font-size: .85rem; color: var(--muted); max-width: 560px; }
.titulo-campo input { font: inherit; min-height: 40px; padding: 6px 10px; border: 1px solid var(--rule); border-radius: 6px; background: var(--paper); color: var(--ink); }
.vistas { margin-top: 14px; }
.vistas button b { font-family: var(--mono); font-weight: 600; font-size: .78rem; background: var(--office); border-radius: 10px; padding: 1px 7px; margin-left: 4px; }
.te { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.te-col { min-width: 0; display: grid; gap: 6px; align-content: start; }
.te-col h3 { font-size: 1rem; border-bottom: 2px solid var(--brand); padding-bottom: 6px; }
table.pend td.ck, table.pend th.ck { width: 34px; text-align: center; padding-right: 0; }
table.pend input[type=checkbox] { width: 18px; height: 18px; accent-color: var(--brand); }
table.pend tr.sel td { background: var(--brand-soft); }
.tbl td.vacio { text-align: center; color: var(--muted); padding: 18px; }
.te .tbl { max-height: 560px; overflow: auto; }
.te .tbl th { position: sticky; top: 0; }
.pend-barra { display: flex; gap: 10px; }
.buscar input { font: inherit; font-size: .92rem; min-height: 40px; width: min(380px, 100%); padding: 6px 12px; border: 1px solid var(--rule); border-radius: 6px; background: var(--paper); color: var(--ink); }
.buscar { flex: 1; }
.manual { position: sticky; bottom: 8px; background: var(--paper); border: 1px solid var(--rule); border-radius: 8px; padding: 10px 14px; display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: center; justify-content: space-between; font-size: .92rem; z-index: 3; }
.manual.activo { border-color: var(--brand); box-shadow: 0 4px 18px rgba(31,35,40,.16); }
.manual-b { display: flex; gap: 8px; }
table.conc { min-width: 860px; }
table.conc td div + div { margin-top: 3px; padding-top: 3px; border-top: 1px dashed var(--rule-soft); }
.chip { display: inline-block; font-size: .76rem; font-weight: 600; padding: 2px 8px; border-radius: 10px; background: var(--office); white-space: nowrap; }
.chip.c-grupo, .chip.c-cercana { background: var(--warn-soft); color: var(--warn); }
.chip.c-manual { background: var(--brand-soft); color: var(--brand); }
.panel h3 { font-size: 1.02rem; }
.mono { font-size: .84em; }
@media (max-width: 860px) {
  .lados, .cuadro, .te { grid-template-columns: 1fr; }
  .lados::after { display: none; }
  .lado + .lado { border-top: 1px solid var(--rule); }
  .arch-cifras { grid-template-columns: repeat(2, 1fr); }
}

.badge { display: flex; gap: 8px; align-items: flex-start; margin-top: 16px; font-size: .92rem; }
.badge svg { flex: none; margin-top: 4px; color: var(--brand); }
.limits { margin-top: 6px; font-size: .88rem; color: var(--muted); max-width: 88ch; }

.ad-slot { min-height: 90px; margin: 30px 0; border: 1px dashed var(--rule); border-radius: 6px; display: grid; place-items: center; color: var(--muted); font-size: .8rem; }

/* ---------- Contenido ---------- */
.prose { padding: 8px 0; width: min(70ch, 100% - 32px); margin-inline: auto; }
.prose h2 { font-size: 1.45rem; margin: 30px 0 10px; }
.prose h3 { font-size: 1.1rem; margin: 20px 0 6px; }
.prose p, .prose li { margin-bottom: 10px; }
.prose ol, .prose ul { padding-left: 22px; margin-bottom: 12px; }
.prose a { color: var(--brand); text-underline-offset: 3px; }
.prose .tbl { margin: 12px 0 18px; }
.prose .tbl table { font-size: .9rem; }
.prose .tbl.ancha table { min-width: 620px; }
.faq details { border-bottom: 1px solid var(--rule); padding: 13px 0; }
.faq summary { cursor: pointer; font-weight: 600; }
.faq details p { margin-top: 8px; color: var(--muted); }
.legal { padding: 32px 0; }
.legal h1 { font-size: 2rem; margin-bottom: 16px; }
.descargas { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0 16px; }

.more-sec { width: min(70ch, 100% - 32px); margin: 10px auto 40px; }
.more-h { font-size: 1.3rem; margin: 26px 0 8px; }
.more { list-style: none; padding: 0; border-top: 1px solid var(--rule); }
.more li { border-bottom: 1px solid var(--rule); }
.more a { display: grid; gap: 2px; padding: 12px 0; text-decoration: none; }
.more a strong { color: var(--brand); font-weight: 600; }
.more a:hover strong { text-decoration: underline; text-underline-offset: 3px; }
.more a span { color: var(--muted); font-size: .92rem; }

.foot { border-top: 1px solid var(--rule); background: var(--paper); padding: 26px 0 96px; color: var(--muted); font-size: .92rem; }
.foot .wrap { display: grid; gap: 10px; }
.foot-contact { color: var(--ink); font-weight: 600; }
.foot-links { display: flex; flex-wrap: wrap; gap: 6px 20px; list-style: none; padding: 0; }
.foot a { text-underline-offset: 3px; }

.toast { position: fixed; left: 50%; bottom: 84px; transform: translate(-50%, 20px); background: var(--ink); color: var(--paper); padding: 10px 18px; border-radius: 6px; font-size: .92rem; opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; z-index: 90; max-width: calc(100% - 32px); }
.toast.on { opacity: 1; transform: translate(-50%, 0); }

.cookie-bar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 80; background: var(--paper); border-top: 1px solid var(--rule); box-shadow: 0 -4px 24px rgba(31, 35, 40, .14); }
.cookie-bar-inner { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; padding: 14px 0; }
.cookie-bar p { flex: 1 1 320px; font-size: .9rem; color: var(--muted); }
.cookie-bar a { color: var(--ink); }
.cookie-actions { display: flex; gap: 8px; flex: none; }
@media (max-width: 560px) { .cookie-bar-inner { flex-direction: column; align-items: stretch; } .cookie-bar p { flex: 0 1 auto; } .cookie-actions { justify-content: flex-end; } }

@media (max-width: 640px) {
  .hero { padding-top: 18px; }
  .drop { padding: 26px 14px 22px; }
  .res-actions { width: 100%; }
  .res-actions .btn { flex: 1 1 auto; }
  .panel { padding: 12px; }
  .cifras { padding: 12px; }
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } * { transition: none !important; } }
@media print {
  .top, .hero, .badge, .limits, .ad-slot, .prose, .more-sec, .foot, .toast, .skip-link, .cookie-bar, .res-actions, .opciones, .vistas, .lados, .pie-carga, .manual, .pend-barra, .ayuda { display: none !important; }
  body { background: #fff; color: #000; }
  .tool { border: 0; }
  .panel[hidden] { display: none !important; }
}

/* =====================================================================
   Segunda versión visual: plana, sin recuadros de color.
   El estado se dice con un punto de color y texto, no con cajas teñidas.
   ===================================================================== */
:root { --office: #f4f5f7; --ink: #16181d; --muted: #626a76; --rule: #dfe3e8; --rule-soft: #eceff2; --pos: #14804a; --neg: #c0362c; --warn: #9a6200; --sombra: 0 1px 2px rgba(22,24,29,.04), 0 12px 32px -12px rgba(22,24,29,.12); }
@media (prefers-color-scheme: dark) { :root { --office: #111317; --paper: #191c21; --ink: #eceef1; --muted: #a0a8b3; --rule: #2c323b; --rule-soft: #242930; --sombra: none; --warn: #f1c96b; --pos: #6fd297; --neg: #ff9488; } }
body { font-size: 16.5px; }
.top { border-bottom: 0; background: transparent; }
.bar { padding: 16px 0 6px; }
.hero { padding: 30px 0 22px; }
.hero h1 { font-size: clamp(1.9rem, 3.6vw + .8rem, 3.1rem); font-weight: 600; letter-spacing: -.028em; line-height: 1.04; max-width: 20ch; }
.sub { font-size: 1.06rem; max-width: 58ch; margin-top: 14px; }
.btn { border-radius: 10px; font-weight: 500; transition: border-color .15s, background-color .15s, transform .08s; }
.btn:active { transform: translateY(1px); }
.btn.primary { font-weight: 600; }

.tool { border: 0; border-radius: 18px; box-shadow: var(--sombra); overflow: clip; }
@media (prefers-color-scheme: dark) { .tool { border: 1px solid var(--rule); } }

/* La T: una barra arriba, un eje al centro */
.lados { border-top: 4px solid var(--brand); }
.lados::after { top: 0; bottom: 0; border-left: 1px solid var(--rule); opacity: 1; }
.lado { padding: 22px 24px 20px; gap: 14px; }
.lado-h { display: block; border: 0; padding: 0; }
.lado-h h2 { font-size: 1.35rem; font-weight: 600; letter-spacing: -.015em; }
.lado-h p { font-size: .92rem; margin-top: 2px; }
.lado .drop { padding: 30px 16px 26px; border-radius: 12px; background: var(--office); }
.lado .drop::before { border: 1.5px dashed color-mix(in srgb, var(--muted) 45%, transparent); border-radius: 12px; }
.lado .drop.over { background: color-mix(in srgb, var(--brand) 7%, var(--paper)); }
.drop-ico { color: var(--muted); }
.lado.con-archivos .drop { background: none; padding: 0; justify-items: start; }
.lado.con-archivos .drop .drop-actions { margin: 0; }
.lado.con-archivos .drop .btn.primary { min-height: 36px; padding: 6px 12px; font-size: .88rem; }
.lado.con-archivos .drop .btn.primary::before { content: "+"; font-weight: 600; }
.lado.con-archivos { grid-template-rows: auto auto auto; }
.lado.con-archivos .archivos { order: -1; }
.lado.con-archivos .lado-h { order: -2; }
.carga-error { background: none; padding: 0 0 0 12px; border-left: 3px solid var(--bad); border-radius: 0; }

.arch { border: 0; border-radius: 0; padding: 14px 0 12px; border-top: 1px solid var(--rule); gap: 10px; }
.arch.mal { border-color: var(--rule); }
.arch-h strong { font-weight: 600; font-size: 1rem; }
.arch-sum { font-size: .9rem; margin-top: -6px; }
.arch-cifras { gap: 4px 16px; padding: 2px 0; }
.arch-cifras dt { font-size: .78rem; }
.arch-cifras dd { font-family: var(--sans); font-size: 1.02rem; font-weight: 600; letter-spacing: -.01em; }
.sello { background: none !important; padding: 0; border-radius: 0; font-size: .9rem; color: var(--ink) !important; align-items: flex-start; gap: 9px; }
.sello i { flex: none; width: 9px; height: 9px; border-radius: 50%; margin-top: .48em; background: var(--muted); }
.sello.bien i { background: var(--pos); box-shadow: 0 0 0 4px color-mix(in srgb, var(--pos) 16%, transparent); }
.sello.ojo i { background: var(--warn); box-shadow: 0 0 0 4px color-mix(in srgb, var(--warn) 18%, transparent); }
.sello.neutro { color: var(--muted) !important; }
.arch-avisos { gap: 6px; }
.arch-avisos li { border-left-width: 2px; color: var(--muted); }
.arch-avisos li.error { color: var(--ink); }
.revisar { border-top: 0; padding-top: 0; }
.revisar summary { color: var(--ink); font-weight: 500; text-decoration: underline; text-decoration-color: var(--brand); text-decoration-thickness: 2px; text-underline-offset: 4px; list-style: none; display: inline-block; }
.revisar summary::-webkit-details-marker { display: none; }
.ajustes select, .prev select, .opciones select, .saldo-in, .buscar input, .titulo-campo input { border-radius: 8px; }
.omitidas { background: none; border-radius: 0; padding: 0 0 0 12px; border-left: 2px solid var(--warn); }
.nota-solape { color: var(--ink); padding-left: 12px; border-left: 2px solid var(--warn); }
.prev tr.falla td { background: none; box-shadow: inset 0 -2px 0 var(--warn); }

.pie-carga { border-top: 0; padding: 0 24px 18px; }
.opciones { padding: 14px 24px; background: var(--office); border-top: 0; gap: 10px 24px; font-size: .92rem; }
.opciones .lbl { font-weight: 500; }

/* Resultado */
.res { border-top: 0; }
.res-head { padding: 26px 24px 0; border-bottom: 0; align-items: flex-start; }
.res-sum { font-size: 1.3rem; font-weight: 600; letter-spacing: -.015em; line-height: 1.25; max-width: 34ch; }
.res-sum small { font-size: .92rem; margin-top: 6px; letter-spacing: 0; }

/* El balance: dos saldos frente a frente y el signo en el eje */
.cuadro { grid-template-columns: 1fr auto 1fr; gap: 0; padding: 26px 24px 6px; align-items: start; }
.bal-lado { min-width: 0; }
.bal-lado:last-child { text-align: right; }
.bal-t { font-size: .92rem; color: var(--muted); }
.bal-v { font-size: clamp(1.9rem, 2.6vw + 1rem, 2.9rem); font-weight: 600; letter-spacing: -.03em; line-height: 1.1; font-variant-numeric: tabular-nums; margin: 2px 0 14px; }
.bal-d { display: grid; gap: 0; border-top: 1px solid var(--ink); text-align: left; }
.bal-l { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--rule); font-size: .93rem; min-height: 46px; }
.bal-l dt b { display: inline-block; width: 1.1em; font-weight: 600; color: var(--muted); }
.bal-l dt small { color: var(--muted); font-size: .78rem; border: 1px solid var(--rule); border-radius: 20px; padding: 0 7px; margin-left: 4px; }
.bal-l dd { font-variant-numeric: tabular-nums; font-weight: 500; white-space: nowrap; }
.bal-eje { align-self: stretch; display: grid; justify-items: center; align-content: start; padding: 20px 26px 0; position: relative; }
.bal-eje::before { content: ""; position: absolute; top: 0; bottom: 0; left: 50%; border-left: 1px solid var(--rule); }
.bal-eje span { position: relative; width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center; font-size: 1.5rem; font-weight: 600; background: var(--paper); border: 2px solid var(--muted); color: var(--muted); line-height: 1; }
.bal-eje[data-estado="ok"] span { border-color: var(--pos); color: var(--pos); }
.bal-eje[data-estado="mal"] span { border-color: var(--neg); color: var(--neg); }
.saldo-in { font-family: var(--sans); font-weight: 500; width: 140px; min-height: 34px; background: var(--office); border-color: transparent; }
.saldo-in:hover, .saldo-in:focus { border-color: var(--rule); background: var(--paper); }
.saldo-in:placeholder-shown { border-color: var(--brand); background: var(--paper); }
.veredicto { margin: 14px 24px 0; padding: 0; border-radius: 0; background: none !important; color: var(--ink) !important; font-size: .98rem; max-width: 76ch; }
.veredicto strong { font-weight: 600; }
.veredicto.bien strong { color: var(--pos); }
.veredicto.mal strong { color: var(--neg); }
.titulo-campo { padding: 18px 24px 0; }
.titulo-campo input { background: var(--office); border-color: transparent; }
.titulo-campo input:focus { background: var(--paper); border-color: var(--rule); }

/* Pestañas como control segmentado */
.vistas { margin: 26px 24px 0; padding: 4px; gap: 2px; border: 0; background: var(--office); border-radius: 12px; display: inline-flex; max-width: calc(100% - 48px); }
.vistas button { border: 0; border-radius: 9px; padding: 8px 14px; font-size: .93rem; }
.vistas button[aria-selected="true"] { background: var(--paper); box-shadow: 0 1px 2px rgba(22,24,29,.12); font-weight: 600; }
.vistas button b { background: none; padding: 0; color: var(--muted); font-family: var(--sans); font-size: .85rem; font-weight: 500; }
.panel { padding: 18px 24px 26px; gap: 16px; }
.te { gap: 28px; }
.te-col h3 { border: 0; padding: 0; font-size: 1.08rem; font-weight: 600; }
.te-col .ayuda { margin-top: -4px; }

/* Tablas más ligeras */
.tool .tbl { border: 0; border-radius: 0; }
.tool .tbl th { background: var(--paper); color: var(--muted); font-weight: 500; font-size: .8rem; text-align: left; border-bottom: 1px solid var(--ink); padding: 8px 10px; }
.tool .tbl td { border-bottom-color: var(--rule-soft); padding: 9px 10px; }
.tool .tbl th:last-child, .tool .tbl td.n { text-align: right; }
.tool .tbl td.n { font-family: var(--sans); font-size: .9rem; font-weight: 500; }
.tool .tbl tfoot td { background: none; border-top: 1px solid var(--ink); font-weight: 600; }
.tool .prev { border: 1px solid var(--rule); border-radius: 10px; }
.tool .prev th { text-align: left; border-bottom-color: var(--rule); background: var(--office); }
.prev td.leido, .prev th.leido { border-left: 1px solid var(--rule); }
.prev td.nf, .prev th.nf, .mono { font-family: var(--sans); }
.mono { color: var(--muted); font-size: .9em; }
table.pend tr.sel td { background: color-mix(in srgb, var(--brand) 7%, var(--paper)); }
table.conc th:nth-child(3), table.conc th:nth-child(5) { text-align: right; }
table.conc th:last-child { text-align: left; }
.chip { background: none !important; padding: 0; border-radius: 0; font-weight: 500; font-size: .86rem; color: var(--ink) !important; display: inline-flex; align-items: center; gap: 7px; }
.chip::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--pos); }
.chip.c-grupo::before, .chip.c-cercana::before { background: var(--warn); }
.chip.c-manual::before { background: var(--brand); }
.manual { border-radius: 12px; border-color: var(--rule); background: var(--office); }
.manual.activo { background: var(--paper); border-color: var(--ink); box-shadow: var(--sombra); }
.buscar input { background: var(--office); border-color: transparent; }
.buscar input:focus { background: var(--paper); border-color: var(--rule); }
.badge { margin-top: 20px; color: var(--muted); }
.badge svg { color: var(--muted); }
.ad-slot { border-style: solid; border-color: var(--rule-soft); border-radius: 12px; }

/* Contenido: tablas con el color de la web, sin caja pesada */
.prose h2 { font-size: 1.55rem; font-weight: 600; letter-spacing: -.02em; margin-top: 40px; }
.prose .tbl { border-radius: 10px; }
.faq summary { font-weight: 500; }
.foot { background: transparent; }

@media (max-width: 860px) {
  .lado { padding: 18px 16px; }
  .pie-carga, .opciones, .res-head, .panel, .titulo-campo { padding-left: 16px; padding-right: 16px; }
  .cuadro { grid-template-columns: 1fr; padding: 22px 16px 4px; gap: 6px; }
  .bal-lado:last-child { text-align: left; }
  .bal-eje { padding: 6px 0; justify-items: start; }
  .bal-eje::before { display: none; }
  .bal-eje span { width: 38px; height: 38px; font-size: 1.25rem; }
  .veredicto { margin-left: 16px; margin-right: 16px; }
  .vistas { margin-left: 16px; margin-right: 16px; max-width: calc(100% - 32px); }
  .te { gap: 22px; }
}
.pie-carga { padding-top: 6px; padding-bottom: 22px; }
.manual:not(.activo) { background: none; border: 0; padding: 0; position: static; }

.skip-link { top: 0; transform: translateY(-300%); }
.skip-link:focus-visible { top: 1rem; transform: none; }

/* ---------- Propio de Anticipos ---------- */
.tipo { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; padding: 18px 24px 4px; }
.tipo-t { font-weight: 500; font-size: .95rem; }
.seg { display: inline-flex; background: var(--office); border-radius: 12px; padding: 4px; gap: 2px; }
.seg label { position: relative; cursor: pointer; }
.seg input { position: absolute; opacity: 0; inset: 0; }
.seg span { display: block; padding: 8px 16px; border-radius: 9px; font-size: .93rem; color: var(--muted); }
.seg input:checked + span { background: var(--paper); color: var(--ink); font-weight: 600; box-shadow: 0 1px 2px rgba(22,24,29,.12); }
.seg input:focus-visible + span { outline: 2px solid var(--brand); outline-offset: 2px; }
.lados { border-top: 0; margin-top: 10px; }
.tool { border-top: 4px solid var(--brand); }
.opciones input[type=date] { font: inherit; font-size: .9rem; min-height: 36px; padding: 4px 8px; border: 1px solid var(--rule); border-radius: 8px; background: var(--paper); color: var(--ink); }
.bal-eje[data-estado="falta"] span { border-color: var(--brand); color: var(--brand); }
.barra-res { display: flex; flex-wrap: wrap; gap: 12px 16px; align-items: center; justify-content: space-between; margin: 26px 24px 0; }
.barra-res .vistas { margin: 0; max-width: 100%; }
.barra-res .buscar { flex: 1 1 240px; max-width: 380px; }
.barra-res .buscar input { width: 100%; }
table.grande { min-width: 720px; }
.tool .tbl td.fuerte { font-weight: 600; }
.tool .tbl td.cero { color: var(--muted); font-weight: 400; }
.enlace.izq { text-align: left; color: var(--ink); font-size: .95rem; min-height: 0; padding: 0; text-decoration-color: var(--brand); text-decoration-thickness: 1.5px; }
small.etapa, small.de { display: block; color: var(--muted); font-size: .78rem; margin-top: 2px; }
small.de { display: inline; white-space: nowrap; }
.chip.c-parcial::before, .chip.c-saldo::before { background: var(--warn); }
.chip.c-aceptada::before { background: var(--brand); }
p.vacio { color: var(--muted); padding: 18px 0; }
.veredicto[hidden] { display: none; }
@media (max-width: 860px) { .tipo { padding: 16px 16px 2px; } .barra-res { margin-left: 16px; margin-right: 16px; } }
table.conc th:nth-child(3) { text-align: left; }
table.conc th:nth-child(5) { text-align: right; }
table.grande th:not(:first-child) { text-align: right; }
table.grande.partidas th:nth-child(2), table.grande.partidas th:nth-child(3) { text-align: left; }
