:root {
  --azul: #1f5fa8; --azul-osc: #12263f; --acento: #4fb3d9; --verde: #2e9e5b; --ambar: #e0a400; --rojo: #d64545;
  --fondo: #f3f5f8; --panel: #ffffff; --borde: #dde3ea; --texto: #1d2733; --suave: #66768a;
  --alerta: #fff4e5; --alerta-borde: #f0a020; --radio: 8px;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  color: var(--texto); background: var(--fondo);
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--fondo); font-size: 14px; }
a { color: var(--azul); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 22px; margin: 0 0 14px; }
h2 { font-size: 16px; margin: 4px 0 10px; }
h3 { font-size: 14px; margin: 14px 0 6px; }
p { margin: 6px 0; }
code { background: #eef2f6; padding: 1px 5px; border-radius: 4px; font-size: 12px; }
.muted { color: var(--suave); }
.small { font-size: 12px; }
.mono { font-family: ui-monospace, Consolas, monospace; font-size: 12px; }
.nowrap { white-space: nowrap; }
.centro { text-align: center; }
.der { text-align: right; }
.rojo-txt { color: var(--rojo); font-weight: 600; }

/* layout */
.app { display: flex; min-height: 100vh; }
.nav { width: 232px; background: var(--azul-osc); color: #fff; padding: 16px 0; flex-shrink: 0; }
.nav .marca { padding: 0 18px 14px; font-weight: 800; font-size: 18px; }
.nav .marca span { color: var(--acento); }
.nav .marca small { display: block; font-weight: 400; font-size: 11px; opacity: .7; margin-top: 2px; }
.nav .seccion { display: flex; align-items: center; gap: 8px; width: 100%; background: none; border: 0; border-radius: 0; color: #c9d6e8; cursor: pointer;
  padding: 9px 18px; font-size: 11.5px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; text-align: left; }
.nav .seccion:hover { background: rgba(255,255,255,.06); filter: none; color: #fff; }
.nav .seccion .nombre { flex: 1; }
.nav .seccion .flecha { display: inline-block; font-size: 10px; transition: transform .15s; opacity: .8; }
.nav .seccion .cuenta { font-size: 10px; font-weight: 400; background: rgba(255,255,255,.12); border-radius: 9px; padding: 1px 7px; letter-spacing: 0; }
.nav .grupo { border-top: 1px solid rgba(255,255,255,.06); }
.nav .grupo .sub { display: none; padding-bottom: 6px; }
.nav .grupo.abierto .sub { display: block; }
.nav .grupo.abierto .seccion { color: #fff; }
.nav .grupo.abierto .flecha { transform: rotate(90deg); }
.nav .grupo .sub a { padding-left: 34px; font-size: 13.5px; }
.nav a { display: block; color: #d6e2f2; padding: 7px 18px; border-left: 3px solid transparent; }
.nav a:hover { background: rgba(255,255,255,.07); text-decoration: none; }
.nav a.activo { background: rgba(255,255,255,.12); border-left-color: var(--acento); color: #fff; }
.nav .pie { padding: 14px 18px; font-size: 12px; border-top: 1px solid rgba(255,255,255,.15); margin-top: 16px; line-height: 1.6; }
.nav .pie a { display: inline; padding: 0; border: 0; }
.muted-claro { opacity: .65; }
.main { flex: 1; padding: 22px 26px; min-width: 0; }
@media (max-width: 860px) {
  .app { flex-direction: column; }
  .nav { width: 100%; padding: 8px 0; }
  .nav .marca { width: 100%; padding: 4px 14px 8px; }
  .nav .grupo .sub a { padding: 7px 14px 7px 30px; }
  .nav .pie { width: 100%; margin-top: 6px; padding: 8px; }
  .main { padding: 14px; }
}

/* componentes */
.card { background: var(--panel); border: 1px solid var(--borde); border-radius: var(--radio); padding: 16px 18px; margin-bottom: 16px; }
.card.sinpad { padding: 0; overflow: hidden; }
.card.sinpad .cab { margin: 0; padding: 12px 14px; border-bottom: 1px solid var(--borde); background: #f8fafc; }
.grid { display: grid; gap: 14px; }
.g2 { grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); }
.g4, .g5 { grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); }
.g6 { grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); }
.fila { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.fila.fin { justify-content: flex-end; }
.fila.arriba { align-items: flex-start; }
.espacio { flex: 1; }
.tarjeta { background: var(--panel); border: 1px solid var(--borde); border-left: 6px solid #5b7db1; border-radius: var(--radio); padding: 10px 14px; }
.tarjeta .cifra { font-size: 22px; font-weight: 700; margin: 2px 0; font-variant-numeric: tabular-nums; }
.veredicto { background: var(--panel); border: 1px solid var(--borde); border-left: 8px solid; border-radius: var(--radio); padding: 12px 16px; margin: 0 0 14px; }
.veredicto .titulo { font-size: 18px; font-weight: 700; margin-bottom: 4px; }

table { width: 100%; border-collapse: collapse; background: var(--panel); }
th, td { padding: 7px 9px; border-bottom: 1px solid var(--borde); text-align: left; vertical-align: top; }
th { background: #eef2f6; font-weight: 600; font-size: 12px; color: #3b4a5c; white-space: nowrap; }
td.num, th.num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
th.centro, td.centro { text-align: center; }
tr.total td { font-weight: 700; background: #f7f9fb; }
tr.grupo td { background: #f3f6fa; font-weight: 600; font-size: 12px; color: #3b4a5c; }
tr.clic { cursor: pointer; }
tr.clic:hover td { background: #f6f9fd; }
tr.inactivo td, .inactivo { opacity: .55; }
tr.resalte td { background: #eaf6ee; }
.tabla-scroll { overflow-x: auto; }
.sangria { margin-left: 17px; }

.punto { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 7px; vertical-align: middle; }
.mini { display: inline-flex; align-items: flex-end; gap: 2px; height: 26px; }
.mini i { display: block; width: 9px; border-radius: 2px; }
.barra { height: 6px; background: #e6ebf1; border-radius: 3px; overflow: hidden; margin-top: 6px; }
.barra div { height: 100%; background: var(--verde); }
.avance { margin-bottom: 10px; }

button, .btn {
  font: inherit; border: 1px solid var(--azul); background: var(--azul); color: #fff; padding: 7px 14px;
  border-radius: 6px; cursor: pointer; display: inline-block; line-height: 1.3;
}
button:hover { filter: brightness(1.08); }
button:disabled { opacity: .5; cursor: not-allowed; }
button.sec, .btn.sec { background: #fff; color: var(--azul); }
button.peligro { background: var(--rojo); border-color: var(--rojo); }
button.ok { background: var(--verde); border-color: var(--verde); }
button.mini { padding: 2px 8px; font-size: 12px; }

label { display: block; font-size: 12px; color: var(--suave); margin-bottom: 3px; }
label.check, label.radio { display: inline-flex; align-items: center; gap: 6px; color: var(--texto); font-size: 14px; margin: 4px 10px 0 0; }
label.check input, label.radio input { width: auto; }
input, select, textarea {
  font: inherit; width: 100%; padding: 7px 9px; border: 1px solid #c4ced9; border-radius: 6px; background: #fff; color: var(--texto);
}
input:disabled { background: #f1f3f6; color: #8a96a3; }
textarea { resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 2px solid #9cc3f0; border-color: var(--azul); }
.form { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px 14px; }
.form .ancho { grid-column: 1 / -1; }
input.num { text-align: right; }
input.w130 { width: 130px; }
.fila select { width: auto; }

.etq { display: inline-block; padding: 2px 8px; border-radius: 10px; font-size: 11px; font-weight: 600; background: #e8edf3; color: #3b4a5c; white-space: nowrap; }
.etq.verde { background: #dcefdc; color: #1b5e20; }
.etq.azul { background: #dce9f8; color: #0d47a1; }
.etq.ambar { background: #fff0d4; color: #8a5300; }
.etq.rojo { background: #fde0e0; color: #a01616; }
.etq.gris { background: #eceff1; color: #607080; }
.chip { display: inline-block; padding: 4px 10px; border: 1px solid var(--borde); border-radius: 14px; background: #fff; color: var(--texto); font-size: 12px; }
.chip.activo { background: var(--azul-osc); color: #fff; border-color: var(--azul-osc); }
.chip:hover { text-decoration: none; }

.alerta { background: var(--alerta); border: 1px solid var(--alerta-borde); border-radius: var(--radio); padding: 10px 14px; margin: 8px 0; }
.alerta.rojo { background: #fdecec; border-color: var(--rojo); }

.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--borde); margin-bottom: 16px; flex-wrap: wrap; align-items: flex-end; }
.tabs a { padding: 8px 14px; border: 1px solid transparent; border-bottom: 0; border-radius: 6px 6px 0 0; color: var(--suave); }
.tabs a.activo { background: var(--panel); border-color: var(--borde); color: var(--texto); margin-bottom: -1px; font-weight: 600; }

.modal-fondo { position: fixed; inset: 0; background: rgba(15, 25, 40, .45); display: flex; align-items: flex-start; justify-content: center; padding: 5vh 16px; z-index: 50; overflow-y: auto; }
.modal { background: #fff; border-radius: 10px; padding: 20px 22px; box-shadow: 0 10px 40px rgba(0,0,0,.25); }
.modal h2 { margin-top: 0; font-size: 18px; }
.toast { position: fixed; bottom: 20px; right: 20px; background: #263238; color: #fff; padding: 10px 16px; border-radius: 8px; z-index: 60; max-width: 420px; }
.toast.error { background: var(--rojo); }
.secreto { font-family: ui-monospace, Consolas, monospace; font-size: 20px; background: #f3f6f9; border: 1px dashed #9fb3c8; padding: 10px; text-align: center; border-radius: 6px; user-select: all; }
pre.ejemplo { background: #f3f6f9; padding: 10px; border-radius: 6px; font-size: 12px; }
.pegajoso { position: sticky; bottom: 0; background: var(--fondo); padding: 10px 0; }

.login { max-width: 380px; margin: 10vh auto; }
.login .marca { font-size: 26px; font-weight: 800; color: var(--azul-osc); text-align: center; margin-bottom: 4px; }
.login .marca span { color: var(--acento); }

/* matriz de riesgos */
table.calor { width: auto; background: transparent; border-collapse: separate; border-spacing: 3px; }
table.calor td { border: 0; width: 76px; height: 56px; text-align: center; vertical-align: middle; color: #fff; border-radius: 4px; padding: 2px; }
table.calor td.muted { color: var(--suave); width: auto; height: auto; }
table.calor td.sel { outline: 3px solid #1d2733; }
table.calor a { color: #fff; display: block; }
table.calor b { font-size: 18px; }
.leyenda { max-width: 360px; }

/* plan de crecimiento */
table.ansoff { width: auto; }
table.ansoff td { min-width: 170px; text-align: center; }
table.ansoff td b { display: block; font-size: 22px; }
.kanban { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 14px; }
.kanban .col { background: #e9eef4; border-radius: var(--radio); padding: 10px; }
.kanban .col h2 { font-size: 14px; }
.ficha { background: #fff; border: 1px solid var(--borde); border-radius: 6px; padding: 10px; margin-bottom: 8px; display: grid; gap: 4px; }
.ficha.clic { cursor: pointer; }
.ficha.clic:hover { border-color: var(--azul); }
table.preguntas td { vertical-align: middle; }

/* documentos */
.documento hr { border: 0; border-top: 1px solid var(--borde); margin: 14px 0; }
.texto table { margin: 6px 0 12px; }
.texto ul { margin: 4px 0 10px; padding-left: 22px; }

@media print {
  body { background: #fff; }
  .nav, .no-print, .toast, .tabs { display: none !important; }
  .main { padding: 0; }
  .card { border: 0; padding: 0; }
  @page { size: letter; margin: 14mm; }
}

/* finanzas */
input.w70 { width: 80px; }
input.w110 { width: 120px; }
input.w150 { width: 150px; }
.fila input.num { width: 90px; }
table.flujo td:first-child, table.ppto td:first-child { white-space: nowrap; }
table.ppto input.celda { width: 96px; padding: 4px 6px; }
table.lineas input, table.lineas select { padding: 5px 7px; }
.grafico { width: 100%; height: auto; display: block; }
.grafico .eje { font-size: 11px; fill: #66768a; }
.leyenda-g { display: flex; flex-wrap: wrap; gap: 14px; font-size: 12px; color: #3b4a5c; margin-top: 4px; }
.leyenda-g i { display: inline-block; width: 12px; height: 12px; border-radius: 3px; margin-right: 5px; vertical-align: -1px; }
.dupont { align-items: stretch; }
.dupont > span { font-size: 22px; color: var(--suave); align-self: center; }
.dupont > div { flex: 1; min-width: 150px; }

/* sin desborde horizontal en pantallas angostas */
.grid > * { min-width: 0; }
.g2 { grid-template-columns: repeat(auto-fit, minmax(min(340px, 100%), 1fr)); }
.g4, .g5 { grid-template-columns: repeat(auto-fit, minmax(min(190px, 100%), 1fr)); }
.g6 { grid-template-columns: repeat(auto-fit, minmax(min(170px, 100%), 1fr)); }
.card { overflow-x: auto; }
table.ansoff td { min-width: 120px; }

/* formato de analisis de precio unitario */
.apu { background: #fff; border: 1px solid var(--borde); border-radius: var(--radio); padding: 22px 26px; margin-bottom: 16px; max-width: 1100px; }
.apu-cab { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; border-bottom: 3px solid var(--azul-osc); padding-bottom: 10px; margin-bottom: 12px; flex-wrap: wrap; }
.apu-empresa { font-weight: 800; font-size: 18px; color: var(--azul-osc); }
.apu-titulo { font-size: 15px; letter-spacing: .06em; color: #3b4a5c; margin-top: 2px; }
table.apu-datos { width: auto; font-size: 12px; }
table.apu-datos td { padding: 2px 8px; border: 0; }
table.apu-info { margin-bottom: 10px; font-size: 13px; }
table.apu-info td { border: 1px solid var(--borde); padding: 5px 8px; }
table.apu-info td:nth-child(odd) { background: #f3f6fa; color: #3b4a5c; width: 16%; white-space: nowrap; }
.apu-sec { background: var(--azul-osc); color: #fff; font-weight: 700; font-size: 12px; letter-spacing: .05em; padding: 5px 10px; margin-top: 14px; border-radius: 4px 4px 0 0; }
table.apu-tabla { font-size: 12.5px; }
table.apu-tabla th { background: #e9eef4; }
table.apu-tabla td, table.apu-tabla th { padding: 5px 8px; }
table.apu-resumen tr.total td { background: #eef4fb; }
.apu-ind { margin-top: 14px; }
.apu-firmas { display: flex; justify-content: space-around; margin-top: 56px; text-align: center; font-size: 12px; font-weight: 600; }
.apu-firmas div { border-top: 1px solid #333; width: 200px; padding-top: 6px; }
table.apu-edit td { padding: 4px; }
table.apu-edit select, table.apu-edit input { font-size: 13px; }
table.apu-edit select.sel-ins { min-width: 240px; }
.solo-impresion { display: none; }
@media print {
  .apu { border: 0; padding: 0; max-width: none; }
  .apu-sec, table.apu-tabla th, table.apu-info td:nth-child(odd), table.apu-resumen tr.total td, .tarjeta { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .solo-impresion { display: block; }
  a.btn { display: none; }
}
table.apu-edit input[name=descripcion] { min-width: 220px; }
table.apu-edit select[name=seccion] { min-width: 150px; }
.apu { overflow-x: auto; }
@media (max-width: 860px) { .apu { padding: 14px; } }

/* ===== multiempresa e identidad ===== */
.nav .marca .logo-nav { display: block; max-width: 150px; max-height: 48px; margin-bottom: 8px; background: #fff; border-radius: 6px; padding: 4px; }
.nav .marca a.cambiar { display: inline; padding: 0; border: 0; font-size: 11px; font-weight: 400; color: var(--acento); }
.empresa-opcion { display: flex; justify-content: space-between; align-items: center; text-align: left; padding: 12px 14px; }
.logo-caja { width: 180px; height: 120px; border: 1px dashed #c4ced9; border-radius: 8px; display: flex; align-items: center; justify-content: center; background: #fafbfc; }
.logo-caja img { max-width: 170px; max-height: 110px; }
.card.valor ul, .m-valores ul { margin: 6px 0 0; padding-left: 18px; font-size: 13px; }
.card.valor.clic { cursor: pointer; }
.card.valor.clic:hover { border-color: var(--azul); }
.vision-banda { background: var(--azul-osc); color: #fff; padding: 12px 16px; border-radius: var(--radio); margin-bottom: 12px; }
.bsc { display: grid; gap: 10px; }
.bsc-fila { display: grid; grid-template-columns: 170px 1fr; gap: 10px; background: #e9eef4; border-radius: var(--radio); padding: 10px; }
.bsc-titulo { font-weight: 700; color: var(--azul-osc); align-self: center; }
.bsc-objs { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(220px, 100%), 1fr)); gap: 8px; }
.bsc-obj { background: #fff; border: 1px solid var(--borde); border-top: 5px solid; border-radius: 6px; padding: 8px 10px; display: grid; gap: 3px; }
.bsc-obj.clic { cursor: pointer; }
@media (max-width: 700px) { .bsc-fila { grid-template-columns: 1fr; } }
.foda { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(280px, 100%), 1fr)); gap: 10px; margin-top: 10px; }
.foda-c { border-radius: var(--radio); padding: 10px 14px; border: 1px solid var(--borde); }
.foda-c h2, .foda-c h3 { margin: 0 0 6px; }
.foda-c ul { margin: 0; padding-left: 18px; }
.foda-c li.clic { cursor: pointer; }
.foda-F { background: #e9f5ec; } .foda-O { background: #e8f1fb; } .foda-D { background: #fff5e0; } .foda-A { background: #fdecec; }
/* organigrama */
.org-scroll { overflow-x: auto; padding: 10px 0; }
ul.org, ul.org ul { list-style: none; margin: 0; padding: 0; display: flex; justify-content: center; position: relative; }
ul.org ul { padding-top: 18px; }
ul.org li { position: relative; padding: 18px 6px 0; display: flex; flex-direction: column; align-items: center; }
ul.org > li { padding-top: 0; }
ul.org li::before, ul.org li::after { content: ''; position: absolute; top: 0; right: 50%; width: 50%; height: 18px; border-top: 2px solid #b8c4d1; }
ul.org li::after { right: auto; left: 50%; border-left: 2px solid #b8c4d1; }
ul.org li:only-child::before, ul.org li:only-child::after { display: none; }
ul.org li:only-child { padding-top: 0; }
ul.org li:first-child::before, ul.org li:last-child::after { border: 0 none; }
ul.org li:last-child::before { border-right: 2px solid #b8c4d1; border-radius: 0 6px 0 0; }
ul.org li:first-child::after { border-radius: 6px 0 0 0; }
ul.org ul::before { content: ''; position: absolute; top: 0; left: 50%; height: 18px; border-left: 2px solid #b8c4d1; }
ul.org > li > ul::before { }
.nodo { background: #fff; border: 1px solid var(--borde); border-top: 5px solid; border-radius: 6px; padding: 8px 10px; min-width: 150px; max-width: 190px;
  display: grid; gap: 2px; text-align: center; font-size: 12.5px; box-shadow: 0 1px 3px rgba(0,0,0,.06); }
.nodo.clic { cursor: pointer; }
.nodo.clic:hover { border-color: var(--azul); }
/* manual de identidad */
.manual { background: #fff; border: 1px solid var(--borde); border-radius: var(--radio); padding: 28px 32px; max-width: 1000px; }
.manual header { display: flex; align-items: center; gap: 18px; border-bottom: 4px solid var(--marca); padding-bottom: 14px; margin-bottom: 16px; }
.manual header img { max-height: 70px; max-width: 200px; }
.m-nombre { font-size: 26px; font-weight: 800; color: var(--marca); }
.m-slogan { color: var(--suave); font-size: 15px; }
.m-proposito { font-size: 18px; font-style: italic; text-align: center; padding: 14px; background: #f5f7fa; border-left: 5px solid var(--marca2); margin-bottom: 16px; }
.manual section { margin-bottom: 16px; }
.manual h2 { color: var(--marca); border-bottom: 1px solid var(--borde); padding-bottom: 4px; }
.m-dos { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(300px, 100%), 1fr)); gap: 20px; }
.m-valores { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(220px, 100%), 1fr)); gap: 12px; }
.m-valores > div { border: 1px solid var(--borde); border-top: 4px solid var(--marca2); border-radius: 6px; padding: 10px; }
.manual footer { border-top: 1px solid var(--borde); padding-top: 10px; margin-top: 20px; font-size: 11.5px; color: var(--suave); text-align: center; }
@media print {
  .manual { border: 0; padding: 0; max-width: none; }
  .manual *, .foda-c, .nodo, .bsc-fila, .vision-banda { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .salto { page-break-before: always; }
}
.foda { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (max-width: 700px) { .foda { grid-template-columns: 1fr; } }

/* ===== Recursos Humanos (replica de FleetHR) ===== */
.g3 { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.kpi { font-size: 26px; font-weight: 700; }
tr.anulada td { color: #9aa5b1; text-decoration: line-through; }
.alerta.verde { background: #e9f5e9; border-color: var(--verde); }
.lineas td { padding: 4px; }
.lineas input { padding: 5px 7px; }
/* ===== Documento de liquidacion (formato heredado de FACTO) ===== */
.liq-doc { background: #fff; color: #333; border: 1px solid #ddd; padding: 22px 26px; max-width: 820px; font-size: 12.5px; }
.liq-doc .cab { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }
.liq-doc .cab img { max-height: 64px; max-width: 220px; }
.liq-doc .cab .emp { font-weight: 700; font-size: 13px; }
.liq-doc .cab h2 { margin: 0; font-size: 21px; background: #e6e6e6; padding: 10px 22px; border-radius: 30px 0 0 0; }
.liq-doc .blq { border-radius: 4px; overflow: hidden; margin-bottom: 12px; background: #fff; box-shadow: 0 0 0 1px #e3e3e3; }
.liq-doc .blq .t { background: #e6e6e6; font-weight: 700; padding: 8px 10px; display: flex; justify-content: space-between; gap: 8px; }
.liq-doc .blq .t small { font-weight: 600; font-size: 11px; }
.liq-doc .r { display: grid; grid-template-columns: 1fr auto; padding: 7px 10px; gap: 8px; }
.liq-doc .r:nth-child(odd) { background: #c8e1c4; }
.liq-doc .r b { font-weight: 700; }
.liq-doc .r4 { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; padding: 7px 10px; gap: 8px; }
.liq-doc .r4:nth-child(odd) { background: #c8e1c4; }
.liq-doc .r4 > :nth-child(n+2) { text-align: right; }
.liq-doc .gen { display: grid; grid-template-columns: 140px 1fr 120px 1fr; padding: 7px 10px; gap: 6px; }
.liq-doc .gen:nth-child(odd) { background: #c8e1c4; }
.liq-doc .gen b { font-weight: 700; }
.liq-doc .dos { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; align-items: start; }
.liq-doc .tot { background: #c8e1c4; border: 1px solid #a5c99f; border-radius: 4px; padding: 8px 10px; display: flex; justify-content: space-between; font-weight: 700; width: 50%; margin: 0 0 12px auto; }
.liq-doc .tot.final { font-size: 14px; }
.liq-doc .covid { background: #8e4fcf; color: #fff; padding: 8px 10px; border-radius: 4px; font-weight: 700; display: flex; justify-content: space-between; margin-bottom: 12px; }
.liq-doc .recibi { text-align: center; font-weight: 600; font-size: 11.5px; margin: 14px 0 54px; }
.liq-doc .firmas { display: flex; justify-content: space-around; text-align: center; font-weight: 700; font-size: 11.5px; }
.liq-doc .firmas div { border-top: 1px solid #333; width: 220px; padding-top: 6px; }
.liq-doc .sello { margin-top: 26px; font-size: 10px; color: #777; border-top: 1px dashed #ccc; padding-top: 8px; word-break: break-all; }
.liq-doc .neg { color: #333; }
@media (max-width: 640px) { .liq-doc .dos { grid-template-columns: 1fr; } .liq-doc .tot { width: 100%; } .liq-doc .gen { grid-template-columns: 1fr 1fr; } }

@media print {
  .liq-doc { border: 0; max-width: none; padding: 0; font-size: 11.5px; }
  .liq-doc .r:nth-child(odd), .liq-doc .r4:nth-child(odd), .liq-doc .gen:nth-child(odd), .liq-doc .tot, .liq-doc .covid, .liq-doc .blq .t, .liq-doc .cab h2 {
    -webkit-print-color-adjust: exact; print-color-adjust: exact;
  }
  .imprimir-solo { display: block !important; }
}

/* ---------- Calidad: mapa de procesos y plan */
.mapa-proc { display: grid; grid-template-columns: 34px 1fr 34px; gap: 10px; align-items: stretch; }
.mapa-lado { writing-mode: vertical-rl; transform: rotate(180deg); text-align: center; font-size: .78rem; color: #fff; background: var(--azul-osc); border-radius: 6px; padding: 8px 4px; }
.mapa-lado:last-child { transform: none; background: var(--verde); }
.mapa-banda { background: #fff; border: 1px solid var(--borde); border-left: 6px solid; border-radius: 8px; padding: 10px 12px; margin-bottom: 10px; }
.mapa-titulo { font-weight: 700; margin-bottom: 8px; }
.mapa-cajas { display: flex; flex-wrap: wrap; gap: 8px; }
.mapa-caja { display: flex; flex-direction: column; gap: 2px; min-width: 150px; flex: 1 1 150px; max-width: 240px; padding: 8px 10px; border: 1px solid var(--borde); border-radius: 6px; background: #f8fafc; color: inherit; text-decoration: none; }
.mapa-caja:hover { border-color: var(--azul); background: #eef4fb; }
.gantt .g-celda { padding: 0 1px; min-width: 18px; }
.gantt .g-barra { height: 12px; background: var(--acento); border-radius: 3px; }
.gantt .g-barra.lista { background: var(--verde); }
@media (max-width: 700px) { .mapa-proc { grid-template-columns: 1fr; } .mapa-lado { writing-mode: horizontal-tb; transform: none; } .mapa-caja { max-width: none; } }

/* ---------- Documentos: encabezado de control, pasos y avisos */
.encabezado-doc { width: 100%; margin: 10px 0 16px; border: 1px solid var(--borde); font-size: 12.5px; }
.encabezado-doc th { background: #f3f6f9; width: 12%; white-space: nowrap; }
.encabezado-doc td, .encabezado-doc th { padding: 5px 8px; border: 1px solid var(--borde); }
.texto ol.pasos { padding-left: 0; list-style: none; }
.texto ol.pasos li { position: relative; padding: 6px 0 6px 40px; border-bottom: 1px dashed var(--borde); }
.texto ol.pasos li::before { counter-increment: paso; content: counter(paso); position: absolute; left: 0; top: 5px; width: 26px; height: 26px; border-radius: 50%;
  background: var(--azul); color: #fff; font-weight: 700; font-size: 13px; display: flex; align-items: center; justify-content: center; }
.texto h4 { margin: 14px 0 6px; font-size: 14px; color: var(--azul-osc); }
.aviso { border-left: 4px solid; border-radius: 4px; padding: 8px 12px; margin: 8px 0; font-size: 13.5px; }
.aviso.advertencia { border-color: var(--ambar); background: #fff6e0; }
.aviso.nota { border-color: var(--acento); background: #eaf6fb; }
@media print { .encabezado-doc { font-size: 11px; } .texto ol.pasos li::before { -webkit-print-color-adjust: exact; print-color-adjust: exact; } }

/* ---------- Prebalance (8 columnas) */
.prebalance .pb-cab { display: grid; grid-template-columns: 1fr 1.4fr 1fr; gap: 12px; align-items: start; margin-bottom: 12px; font-size: 13px; }
.prebalance .pb-titulo { text-align: center; font-weight: 700; font-size: 15px; }
.prebalance .pb-titulo span { font-weight: 400; font-size: 12px; }
.tabla-pb { font-size: 12px; border-collapse: collapse; width: 100%; }
.tabla-pb th, .tabla-pb td { border: 1px solid var(--borde); padding: 3px 6px; }
.tabla-pb th { background: #f3f6f9; text-align: center; }
.tabla-pb td.num { white-space: nowrap; }
.tabla-pb tr.grupo-pb td { background: #fafbfc; font-weight: 600; font-size: 11.5px; color: var(--azul-osc); }
.tabla-pb tr.sub td, .tabla-pb tr.res td { font-weight: 600; background: #f8fafc; }
.tabla-pb tr.tot td { font-weight: 700; background: #eef3f8; border-top: 2px solid var(--azul-osc); }
.prebalance .pb-pie { margin-top: 10px; display: grid; gap: 6px; font-size: 12.5px; }
.prebalance .pb-firmas { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; margin-top: 48px; text-align: center; }
.prebalance .pb-firmas div { border-top: 1px solid #333; padding-top: 4px; font-size: 12px; }
@media print { @page { size: landscape; margin: 10mm; } .tabla-pb { font-size: 9.5px; } .prebalance .pb-firmas { margin-top: 60px; } }
@media (max-width: 700px) { .prebalance .pb-cab { grid-template-columns: 1fr; } .prebalance .pb-titulo { text-align: left; } }

/* ---------- Filtros de movimientos de caja */
.filtros-caja { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px 12px; align-items: end; padding: 12px 14px; margin-bottom: 12px; }
.filtros-caja label { display: block; font-size: 12px; color: var(--muted, #6b7785); margin-bottom: 3px; }
.filtros-caja input, .filtros-caja select { width: 100%; }
.filtros-caja .ancho2 { grid-column: span 2; }
.filtros-caja .acciones { display: flex; gap: 6px; }
@media (max-width: 600px) { .filtros-caja .ancho2 { grid-column: span 1; } }

/* Barra de datos: en todas las pantallas, de cuando son los datos que se ven
   y como traer los nuevos. */
.barra-datos { display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  margin: -6px 0 14px; padding: 7px 12px; border: 1px solid var(--borde);
  border-radius: var(--radio); background: var(--panel); font-size: 13px; }
.barra-datos.oculta { display: none; }
.barra-datos .estado { width: 9px; height: 9px; border-radius: 50%; background: #b6bec8; flex: none; }
.barra-datos .txt { color: var(--suave); min-width: 0; }
.barra-datos .espacio { flex: 1; }
.barra-datos button.chico { padding: 4px 11px; font-size: 12.5px; }
.barra-datos.ok .estado { background: #2e9e5b; }
.barra-datos.aviso { border-color: #e7c66a; background: #fffbef; }
.barra-datos.aviso .estado { background: #e0a400; }
.barra-datos.aviso .txt { color: #7a5c00; }
.barra-datos.error { border-color: #e9b4b4; background: #fdf3f3; }
.barra-datos.error .estado { background: #d64545; }
.barra-datos.error .txt { color: #8e2b2b; }
@media (max-width: 860px) { .barra-datos { margin-top: 0; } }
/* Guia de ratios: fila desplegable bajo cada ratio y leyenda */
tr.guia-ratio td { border-top: none; padding-top: 0; }
tr.guia-ratio summary { cursor: pointer; color: var(--azul); }
tr.guia-ratio details[open] { background: #f7f9fc; border-radius: 6px; padding: 4px 8px 6px; }
.leyenda-ratios summary { cursor: pointer; }
