:root {
  --azul: #1f4e79;
  --azul-osc: #163a5a;
  --azul-claro: #e8f0f8;
  --texto: #1d2733;
  --suave: #5d6b7a;
  --borde: #d6dee8;
  --fondo: #f3f6fa;
  --blanco: #fff;
  --verde: #1e7d4f;
  --verde-f: #e3f4ea;
  --amarillo: #8a5a00;
  --amarillo-f: #fff3d6;
  --rojo: #b42318;
  --rojo-f: #fde8e6;
  --gris-f: #eef1f5;
  --radio: 8px;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; }
body {
  font-family: "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif;
  font-size: 14.5px; color: var(--texto); background: var(--fondo);
  display: flex; min-height: 100vh;
}
a { color: var(--azul); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 22px; margin: 0 0 4px; }
h2 { font-size: 17px; margin: 0 0 12px; }
h3 { font-size: 15px; margin: 0 0 8px; }
.sub { color: var(--suave); margin: 0 0 18px; }

/* ---------- menú lateral */
nav.lateral {
  width: 220px; flex-shrink: 0; background: var(--azul-osc); color: #cfdbe8;
  padding: 18px 0; position: sticky; top: 0; height: 100vh; overflow-y: auto;
}
nav.lateral .marca { color: #fff; font-weight: 700; font-size: 17px; padding: 0 20px 16px; }
nav.lateral a.marca:hover { background: none; text-decoration: none; }
nav.lateral .grupo { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: #8fa6bf; padding: 14px 20px 4px; }
nav.lateral a { display: block; color: #dce6f1; padding: 7px 20px; border-left: 3px solid transparent; }
nav.lateral a:hover { background: rgba(255,255,255,.07); text-decoration: none; }
nav.lateral a.activo { background: rgba(255,255,255,.12); border-left-color: #7fb2e5; color: #fff; font-weight: 600; }
nav.lateral form { padding: 14px 20px 0; }
nav.lateral form button { width: 100%; }

main { flex: 1; min-width: 0; padding: 24px 28px 60px; }
.banner-ejemplo { background: #6b3fa0; color: #fff; padding: 8px 14px; border-radius: var(--radio); margin-bottom: 16px; font-weight: 600; }

/* ---------- tarjetas */
.tarjeta { background: var(--blanco); border: 1px solid var(--borde); border-radius: var(--radio); padding: 18px 20px; margin-bottom: 18px; }
.encabezado { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 14px; }
.acciones { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

/* ---------- formularios */
label { display: block; font-weight: 600; font-size: 13px; margin-bottom: 4px; color: #334255; }
input[type=text], input[type=date], input[type=number], input[type=email], input[type=search],
input[type=password], select, textarea {
  width: 100%; padding: 8px 10px; border: 1px solid var(--borde); border-radius: 6px;
  font: inherit; background: #fff; color: var(--texto);
}
input:focus, select:focus, textarea:focus { outline: 2px solid #9cc3ea; border-color: #6d9fd0; }
input[readonly] { background: var(--gris-f); }
textarea { min-height: 70px; resize: vertical; }
.fila { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); margin-bottom: 14px; }
.fila.dos { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.campo { min-width: 0; }
.ayuda { color: var(--suave); font-size: 12.5px; margin-top: 3px; }
.check { display: flex; align-items: center; gap: 8px; font-weight: 500; }
.check input { width: auto; }

button, .boton {
  display: inline-flex; align-items: center; gap: 6px; padding: 8px 14px; border-radius: 6px;
  border: 1px solid var(--azul); background: var(--azul); color: #fff; font: inherit; font-weight: 600;
  cursor: pointer; text-decoration: none; white-space: nowrap;
}
button:hover, .boton:hover { background: var(--azul-osc); text-decoration: none; }
.boton.sec, button.sec { background: #fff; color: var(--azul); }
.boton.sec:hover, button.sec:hover { background: var(--azul-claro); }
.boton.peligro, button.peligro { background: #fff; color: var(--rojo); border-color: #e5a29b; }
.boton.peligro:hover, button.peligro:hover { background: var(--rojo-f); }
.boton.chico, button.chico { padding: 4px 9px; font-size: 13px; }
button.enlace { background: none; border: none; color: var(--azul); padding: 0; font-weight: 500; }
button.enlace:hover { text-decoration: underline; background: none; }
button.enlace.rojo { color: var(--rojo); }

/* ---------- filtros */
.filtros-principales { display: grid; gap: 14px; grid-template-columns: minmax(200px, 1fr) minmax(300px, 1.4fr) minmax(220px, 1.2fr); }
.filtros-principales .titulo-filtro { font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--azul); font-weight: 700; margin-bottom: 6px; }
.rango { display: flex; gap: 6px; align-items: center; }
.rapidos { display: flex; gap: 5px; flex-wrap: wrap; margin-top: 6px; }
.rapidos button { padding: 3px 8px; font-size: 12.5px; font-weight: 500; background: var(--azul-claro); color: var(--azul); border-color: #c4d7ea; }
.rapidos button:hover { background: #d4e4f4; }
.filtros-sec { display: grid; gap: 12px; grid-template-columns: repeat(4, minmax(0, 1fr)); margin-top: 14px; padding-top: 14px; border-top: 1px dashed var(--borde); }
.barra-filtros { display: flex; justify-content: space-between; align-items: center; margin-top: 14px; gap: 10px; flex-wrap: wrap; }
.descripcion-filtros { color: var(--suave); font-size: 13px; }

/* ---------- tablas */
.tabla-cont { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; background: #fff; }
th, td { padding: 8px 10px; text-align: left; border-bottom: 1px solid #e6ebf1; vertical-align: top; }
th { background: #f6f8fb; font-size: 12.5px; text-transform: uppercase; letter-spacing: .03em; color: #4a5a6c; position: sticky; top: 0; }
tbody tr:hover { background: #f7fafd; }
td.num, th.num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
td.nowrap { white-space: nowrap; }
tr.vinculada td { color: #7d8896; background: #fafbfc; }
tr.total td { font-weight: 700; background: #f6f8fb; }
.vacio { text-align: center; color: var(--suave); padding: 30px; }

.totales { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-top: 14px; }
.totales div { background: var(--azul-claro); border-radius: var(--radio); padding: 12px 14px; }
.totales span { display: block; font-size: 12px; color: var(--suave); text-transform: uppercase; letter-spacing: .04em; }
.totales strong { font-size: 20px; font-variant-numeric: tabular-nums; }
.totales .saldo { background: var(--amarillo-f); }

.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; margin-bottom: 18px; }
.kpis div { background: #fff; border: 1px solid var(--borde); border-radius: var(--radio); padding: 12px 14px; }
.kpis span { display: block; font-size: 12px; color: var(--suave); text-transform: uppercase; }
.kpis strong { font-size: 19px; }

/* ---------- etiquetas de estado */
.etq { display: inline-block; padding: 2px 8px; border-radius: 20px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.etq.pagada, .etq.facturada { background: var(--verde-f); color: var(--verde); }
.etq.parcial { background: var(--amarillo-f); color: var(--amarillo); }
.etq.pendiente { background: var(--rojo-f); color: var(--rojo); }
.etq.vinculada, .etq.no_aplica { background: var(--gris-f); color: #56657a; }
.etq.anulada { background: var(--gris-f); color: #56657a; box-shadow: inset 0 0 0 1px #9aa6b5; }
.etq.f-pendiente { background: #f1e8fb; color: #6b3fa0; }
.etq.tipo { background: var(--azul-claro); color: var(--azul); }
.etq.haulmer { background: #e6f2ff; color: #0b5cad; }
.candado { color: var(--suave); font-size: 12.5px; }

/* ---------- mensajes */
.mensajes { margin-bottom: 16px; display: grid; gap: 8px; }
.msg { padding: 10px 14px; border-radius: var(--radio); border: 1px solid; }
.msg.ok { background: var(--verde-f); color: #135c39; border-color: #a9dcbf; }
.msg.error { background: var(--rojo-f); color: #8c1b12; border-color: #f2b3ac; }
.msg.aviso { background: var(--amarillo-f); color: #6d4700; border-color: #f0d28c; }

/* ---------- combo con búsqueda */
.combo { position: relative; }
.combo .lista {
  position: absolute; z-index: 50; left: 0; right: 0; top: calc(100% + 2px); max-height: 300px; overflow-y: auto;
  background: #fff; border: 1px solid var(--borde); border-radius: 6px; box-shadow: 0 8px 24px rgba(20,40,70,.15); display: none;
}
.combo.abierto .lista { display: block; }
.combo .op { padding: 7px 10px; cursor: pointer; }
.combo .op small { color: var(--suave); margin-left: 6px; }
.combo .op.activa, .combo .op:hover { background: var(--azul-claro); }
.combo .grupo { padding: 6px 10px 3px; font-size: 11px; font-weight: 700; text-transform: uppercase; color: var(--azul); background: #f6f8fb; position: sticky; top: 0; }
.combo .nada { padding: 10px; color: var(--suave); }
.combo .limpiar { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); border: none; background: none; color: #8a97a6; font-size: 17px; padding: 0 4px; cursor: pointer; }
.combo .limpiar:hover { color: var(--rojo); background: none; }
.combo input { padding-right: 26px; }

/* ---------- líneas de venta */
table.lineas td { padding: 5px 6px; vertical-align: middle; }
table.lineas input, table.lineas select { padding: 6px 8px; }
table.lineas .c-prod { width: 30%; }
table.lineas .c-cant { width: 10%; }
table.lineas .c-uni { width: 10%; }
table.lineas .c-prec { width: 15%; }
.precio-fecha { font-size: 11.5px; color: var(--suave); }
.precio-fecha.viejo { color: var(--amarillo); font-weight: 600; }

.paginas { display: flex; gap: 6px; justify-content: center; margin-top: 12px; }
.detalle-grid { display: grid; grid-template-columns: 160px 1fr; gap: 6px 14px; }
.detalle-grid dt { color: var(--suave); }
.detalle-grid dd { margin: 0; }
.dos-col { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: 18px; align-items: start; }
.progreso { padding: 14px; border-radius: var(--radio); background: var(--azul-claro); }
.spinner { display: inline-block; width: 14px; height: 14px; border: 2px solid #9cc3ea; border-top-color: var(--azul); border-radius: 50%; animation: gira .8s linear infinite; vertical-align: -2px; margin-right: 6px; }
@keyframes gira { to { transform: rotate(360deg); } }

/* ---------- rutas */
.contador { display: inline-block; min-width: 20px; padding: 1px 6px; border-radius: 10px; background: #e5484d;
  color: #fff; font-size: 11.5px; font-weight: 700; text-align: center; margin-left: 4px; }
.tarjetas-rutas { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); }
.tarjeta-ruta { background: #fff; border: 1px solid var(--borde); border-radius: var(--radio); padding: 14px 16px;
  display: flex; flex-direction: column; gap: 6px; color: inherit; border-top: 4px solid var(--azul); }
a.tarjeta-ruta:hover { text-decoration: none; box-shadow: 0 6px 18px rgba(20,40,70,.12); }
.tarjeta-ruta.cerrada { border-top-color: var(--verde); }
.tarjeta-ruta.vacia { border-top-color: #c7d0db; color: var(--suave); }
.tarjeta-ruta.alerta { border-top-color: #e5484d; background: #fff7f7; }
.tarjeta-ruta h3 { margin: 0; font-size: 17px; display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.tarjeta-ruta .dato { display: flex; justify-content: space-between; font-size: 13.5px; }
.tarjeta-ruta .grande { font-size: 20px; font-weight: 700; }
.etq.abierta { background: var(--azul-claro); color: var(--azul); }
.etq.cerrada { background: var(--verde-f); color: var(--verde); }
.navfecha { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.navfecha input { width: auto; }
.docs { font-size: 13px; color: var(--suave); }
.docs a { white-space: nowrap; }
table.planilla td { vertical-align: middle; padding: 6px; }
table.planilla td:first-child { min-width: 190px; }
table.planilla input[type=text], table.planilla select { padding: 6px 8px; }
table.planilla .c-monto { width: 130px; }
table.planilla .c-medio { width: 130px; }
table.planilla tr.no-entregado td { background: #fff4f4; }
table.planilla tr.pagado td:first-child { box-shadow: inset 3px 0 0 var(--verde); }
.cheque { display: flex; gap: 4px; margin-top: 4px; }
.cheque[hidden] { display: none; }
.cheque input { font-size: 12.5px; }
.resumen-vivo { position: sticky; bottom: 0; background: #fff; border: 1px solid var(--borde); border-radius: var(--radio);
  padding: 12px 16px; box-shadow: 0 -6px 18px rgba(20,40,70,.08); display: grid; gap: 10px;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); align-items: end; margin-top: 12px; }
.resumen-vivo span { display: block; font-size: 11.5px; color: var(--suave); text-transform: uppercase; }
.resumen-vivo strong { font-size: 17px; font-variant-numeric: tabular-nums; }
.cuadre-ok { color: var(--verde); } .cuadre-mal { color: var(--rojo); }
.tarjeta-ruta.con-enlace { position: relative; }
.tarjeta-ruta.con-enlace:hover { box-shadow: 0 6px 18px rgba(20,40,70,.12); }
.tarjeta-ruta .cubre { color: inherit; }
.tarjeta-ruta .cubre::after { content: ""; position: absolute; inset: 0; }
.tarjeta-ruta .cubre:hover { text-decoration: none; }
.tarjeta-ruta .pie { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-size: 13px;
  margin-top: 2px; padding-top: 6px; border-top: 1px dashed var(--borde); position: relative; z-index: 1; }
.tarjeta-ruta .pie form { margin: 0; }
.pestanas { display: flex; gap: 4px; border-bottom: 2px solid var(--borde); margin-bottom: 16px; flex-wrap: wrap; }
.pestanas a { padding: 8px 14px; border: 1px solid transparent; border-bottom: none; border-radius: var(--radio) var(--radio) 0 0;
  margin-bottom: -2px; color: var(--suave); font-weight: 600; }
.pestanas a:hover { text-decoration: none; color: var(--azul); background: var(--azul-claro); }
.pestanas a.activa { background: #fff; color: var(--azul); border-color: var(--borde); border-bottom: 2px solid #fff; }
/* Barra con pestañas de clientes: las fijas a la izquierda, las de clientes se desplazan hacia el lado. */
.barra-pestanas { position: relative; margin-bottom: 16px; }
.barra-pestanas .pestanas { flex-wrap: wrap; row-gap: 4px; align-items: flex-end; margin-bottom: 0; }
.barra-pestanas .pestanas a.fija { white-space: nowrap; flex: 0 0 auto; }
/* En pantallas angostas la franja de clientes pasa a su propia línea y se desplaza hacia el lado. */
.pestanas-clientes { display: flex; gap: 4px; flex: 1 1 240px; min-width: 0; overflow-x: auto; scrollbar-width: thin; }
.pestana-cliente { display: flex; align-items: center; flex: 0 0 auto; border: 1px solid #d5e1ee; border-bottom: none;
  border-radius: var(--radio) var(--radio) 0 0; background: #f4f7fb; margin-bottom: -2px; }
.pestana-cliente a { padding: 7px 4px 7px 12px; border: none; margin: 0; white-space: nowrap; color: #334255; font-weight: 600; }
.pestana-cliente a:hover { background: none; }
.pestana-cliente.activa { background: #fff; border-color: var(--borde); border-bottom: 2px solid #fff; }
.pestana-cliente.activa a { color: var(--azul); background: none; border: none; }
.pestana-cliente small { font-weight: 600; font-size: 11.5px; margin-left: 4px; }
.pestana-cliente small.debe, .pestanas-mas small.debe { color: var(--rojo); }
.pestana-cliente small.al-dia, .pestanas-mas small.al-dia { color: var(--suave); }
.pestana-cliente form { margin: 0; }
.pestana-x { background: none; border: none; color: #8a97a6; padding: 2px 8px 2px 2px; font-size: 13px; cursor: pointer; }
.pestana-x:hover { color: var(--rojo); background: none; }
.pestana-cliente.arrastrando { opacity: .4; }
.pestana-cliente[draggable] { cursor: grab; }
.pestanas-mas { position: relative; flex: 0 0 auto; align-self: center; }
.pestanas-mas summary { cursor: pointer; padding: 6px 10px; color: var(--azul); font-weight: 600; list-style: none; white-space: nowrap; }
.pestanas-mas summary::-webkit-details-marker { display: none; }
.pestanas-mas .menu { position: absolute; right: 0; top: 100%; z-index: 60; background: #fff; border: 1px solid var(--borde);
  border-radius: var(--radio); box-shadow: 0 8px 24px rgba(20,40,70,.15); min-width: 240px; max-height: 360px; overflow-y: auto; }
.pestanas-mas .menu a { display: flex; justify-content: space-between; gap: 10px; padding: 8px 12px; border: none; margin: 0;
  border-radius: 0; color: #334255; font-weight: 500; }
.pestanas-mas .menu a.activa { background: var(--azul-claro); color: var(--azul); border: none; }
.pestana-nueva { flex: 0 0 auto; align-self: center; margin-left: 4px; padding: 3px 12px; font-size: 18px; line-height: 1.2; }
.pestana-buscador { position: absolute; z-index: 55; left: 0; right: 0; top: calc(100% + 6px); box-shadow: 0 10px 30px rgba(20,40,70,.18); }
.cliente-cab .cliente-saldos { display: flex; gap: 18px; }
.cliente-cab .cliente-saldos span { display: block; font-size: 12px; color: var(--suave); text-transform: uppercase; }
.cliente-cab .cliente-saldos strong { font-size: 24px; }
.ya-abono { color: var(--verde); }
button:disabled, button:disabled:hover { opacity: .45; cursor: not-allowed; }
.combo .op.crear { color: var(--azul); font-weight: 600; border-top: 1px solid var(--borde); }
.aviso-campo { color: var(--amarillo); font-weight: 600; }
.mover summary { cursor: pointer; color: var(--azul); font-size: 12.5px; }
.mover form { display: flex; gap: 4px; flex-wrap: wrap; margin-top: 4px; }
.mover form > * { width: auto; font-size: 12.5px; padding: 4px 6px; }

/* ---------- botones grandes */
button.grande, .boton.grande { padding: 11px 20px; font-size: 15.5px; }

/* ---------- líneas de pago (varios medios en un mismo pago) */
.lineas-pago { display: grid; gap: 6px; }
.linea-pago { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.linea-pago .lp-medio { width: auto; min-width: 150px; flex: 0 1 190px; }
.linea-pago .lp-monto { width: 130px; text-align: right; flex: 0 0 130px; }
.linea-pago .lp-quitar { font-size: 15px; padding: 0 4px; }
.linea-pago .lp-datos { display: flex; flex-wrap: wrap; gap: 6px; flex-basis: 100%; }
.linea-pago .lp-datos[hidden], .linea-pago [hidden] { display: none; }
.linea-pago .lp-datos input { width: auto; flex: 1 1 150px; font-size: 13px; padding: 6px 8px; }
.linea-pago .lp-fecha { display: flex; align-items: center; gap: 4px; font-size: 12.5px; font-weight: 500; margin: 0; }
.linea-pago .lp-fecha input { flex: 0 0 auto; }
table.planilla .c-cobro { min-width: 320px; }
table.planilla .linea-pago .lp-medio { min-width: 120px; flex-basis: 150px; }
.f-pie { display: flex; gap: 10px; align-items: center; margin-top: 3px; font-size: 12.5px; }

/* ---------- ventana «Registrar pago o abono» */
dialog.ventana { width: min(880px, 96vw); max-height: 92vh; overflow: auto; border: none; border-radius: 12px;
  padding: 20px 24px; box-shadow: 0 20px 60px rgba(10,30,60,.35); }
dialog.ventana::backdrop { background: rgba(15,30,50,.45); }
.ventana-cab { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.ventana-cab h2 { margin: 0; font-size: 20px; }
.ventana-cab .enlace { font-size: 20px; color: var(--suave); }
.vp-docs { max-height: 230px; overflow-y: auto; margin-top: 6px; border: 1px solid var(--borde); border-radius: var(--radio); }
.vp-docs.apagada { opacity: .6; }
.vp-resumen { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 12px; }
.vp-resumen div { background: var(--azul-claro); border-radius: var(--radio); padding: 10px 14px; }
.vp-resumen span { display: block; font-size: 12px; color: var(--suave); text-transform: uppercase; }
.vp-resumen strong { font-size: 20px; }
#vp-aviso, #vp-error, #vp-confirmar { margin-top: 10px; }

/* ---------- antigüedad de la deuda */
.etq.edad-verde { background: var(--verde-f); color: var(--verde); }
.etq.edad-amarilla { background: var(--amarillo-f); color: var(--amarillo); }
.etq.edad-roja { background: var(--rojo-f); color: var(--rojo); }
tr.edad-verde > td:first-child { box-shadow: inset 4px 0 0 #3bb273; }
tr.edad-amarilla > td:first-child { box-shadow: inset 4px 0 0 #e0a325; }
tr.edad-roja > td:first-child { box-shadow: inset 4px 0 0 #e5484d; }

/* ---------- panel de Cobranza */
.cb-accesos { display: grid; grid-template-columns: auto 1fr; gap: 14px; margin-bottom: 14px; align-items: stretch; }
.cb-acceso { font-size: 17px; padding: 14px 24px; }
.cb-buscador { display: flex; align-items: center; gap: 8px; margin: 0; background: #fff; border: 2px solid #9cc3ea;
  border-radius: var(--radio); padding: 0 14px; font-size: 18px; }
.cb-buscador input { border: none; font-size: 17px; padding: 12px 4px; outline: none; }
.cb-buscador:focus-within { border-color: var(--azul); }
.cb-filtros { display: flex; flex-wrap: wrap; gap: 14px; align-items: end; padding: 12px 18px; }
.cb-filtros label, .cb-vista label { display: flex; flex-direction: column; gap: 4px; margin: 0; }
.cb-filtros select, .cb-vista select { width: auto; min-width: 170px; }
.cb-totales small { display: block; margin-top: 2px; }
.cb-totales .enlace { font-size: 12.5px; margin-top: 4px; }
.cb-tarjeta-roja strong { color: var(--rojo); }
.cb-desglose-lista { margin-top: 6px; font-size: 13px; }
.cb-desglose-lista div { display: flex; justify-content: space-between; gap: 8px; border-top: 1px dashed var(--borde); padding: 2px 0; }
.cb-desglose-lista span { text-transform: none; font-size: 13px; display: inline; }
.cb-vista { display: flex; flex-wrap: wrap; gap: 16px; align-items: end; margin-bottom: 12px; }
.interruptor { display: inline-flex; border: 1px solid var(--azul); border-radius: var(--radio); overflow: hidden; }
.interruptor button { border: none; border-radius: 0; background: #fff; color: var(--azul); padding: 9px 16px; font-size: 14.5px; }
.interruptor button.activo { background: var(--azul); color: #fff; }
.cb-lista { padding: 0; }
.cb-tabla th { top: 0; }
.cb-grupo-cab td { background: #eef3f9; cursor: pointer; font-size: 14.5px; border-top: 2px solid #d5e1ee; }
.cb-grupo-cab:hover td { background: #e3ecf6; }
.cb-subtotal { float: right; font-weight: 700; font-size: 15px; }
.cb-flecha { display: inline-block; width: 14px; color: var(--azul); }
.cb-fila { cursor: pointer; }
.cb-monto { font-size: 15px; }
.cb-sub > td { background: #fafbfc; padding: 6px 14px 12px 34px; }
.cb-sub table th { position: static; }

/* ---------- Inicio */
.inicio-acciones { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 18px; }
.inicio-acciones form { margin: 0; }
.cal-cab { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.cal-filtro { display: flex; align-items: center; gap: 6px; margin: 0; }
.cal-filtro select { width: auto; }
.cal-nav { display: flex; align-items: center; gap: 8px; }
.cal-nav strong { min-width: 140px; text-align: center; font-size: 17px; }
.cal-cuerpo { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); gap: 18px; align-items: start; }
.cal-grilla { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
.cal-dsem { text-align: center; font-size: 12px; font-weight: 700; color: var(--suave); text-transform: uppercase; padding: 2px 0; }
.cal-dia { min-height: 66px; border: 1px solid var(--borde); border-radius: 6px; background: #fff; color: inherit; padding: 4px 6px;
  display: flex; flex-direction: column; align-items: flex-start; justify-content: flex-start; gap: 1px; font-weight: 400;
  white-space: normal; text-align: left; overflow: hidden; }
.cal-dia:hover { background: #f4f8fd; border-color: var(--azul); }
.cal-dia .num { font-weight: 700; font-size: 14px; }
.cal-dia .cal-monto { font-size: 12px; font-weight: 700; color: #8c1b12; line-height: 1.2; }
.cal-dia .cal-n { font-size: 11px; color: var(--suave); line-height: 1.2; }
.cal-dia.pendiente { background: #fde2df; border-color: #f0a39b; }
.cal-dia.pendiente:hover { background: #fbd2cd; }
.cal-dia.hoy { box-shadow: inset 0 0 0 3px var(--azul); }
.cal-dia.elegido { border: 2px solid #e0a325; }
.cal-dia.vacio { visibility: hidden; }
.cal-pie { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 10px; margin-top: 10px; }
.cal-leyenda { font-size: 12.5px; color: var(--suave); display: flex; align-items: center; gap: 4px 12px; flex-wrap: wrap; }
.cal-leyenda > span { display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; }
.ley { display: inline-block; width: 14px; height: 14px; border-radius: 3px; border: 1px solid var(--borde); }
.ley-rojo { background: #fde2df; border-color: #f0a39b; }
.ley-blanco { background: #fff; }
.ley-hoy { box-shadow: inset 0 0 0 3px var(--azul); }
.cal-panel { border-left: 1px solid var(--borde); padding-left: 16px; max-height: 640px; overflow-y: auto; }
.cal-grupo { margin-bottom: 14px; }
.cal-grupo-cab { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 6px 8px; background: #eef3f9;
  border-radius: var(--radio); margin-bottom: 6px; font-size: 14px; }
.cal-grupo-cab a { margin-left: auto; font-size: 13px; }
.cal-cliente { padding: 4px 0 8px 8px; border-bottom: 1px dashed var(--borde); margin-bottom: 6px; }
.cal-cliente-cab { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 4px; }
table.cal-docs th, table.cal-docs td { padding: 4px 6px; font-size: 13px; }
table.cal-docs th { position: static; }
.inicio-secciones h2 { margin-top: 6px; }
.secciones-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px; }
.seccion { display: flex; flex-direction: column; gap: 4px; background: #fff; border: 1px solid var(--borde); border-radius: var(--radio);
  padding: 16px 18px; color: inherit; }
.seccion:hover { text-decoration: none; border-color: var(--azul); box-shadow: 0 6px 18px rgba(20,40,70,.12); }
.seccion .icono { font-size: 30px; line-height: 1; }
.seccion strong { font-size: 17px; color: var(--azul); }
.seccion small { color: var(--suave); }
@media (max-width: 900px) {
  .cal-cuerpo { grid-template-columns: 1fr; }
  .cal-panel { border-left: none; padding-left: 0; border-top: 1px solid var(--borde); padding-top: 12px; max-height: none; }
  .cal-dia { min-height: 54px; padding: 3px 4px; }
  .cal-dia .cal-n { display: none; }
}
@media (max-width: 480px) {
  .cal-dia .cal-monto { font-size: 10px; }
  .cal-dia .num { font-size: 12.5px; }
  .cal-nav strong { min-width: 110px; font-size: 15px; }
}

@media (max-width: 1100px) {
  .filtros-principales { grid-template-columns: 1fr; }
  .filtros-sec { grid-template-columns: repeat(2, 1fr); }
  .dos-col { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  body { flex-direction: column; }
  nav.lateral { width: 100%; height: auto; position: static; }
  main { padding: 16px; }
  .totales { grid-template-columns: repeat(2, 1fr); }
  .fila.dos { grid-template-columns: 1fr; }
}
/* ---------- informe de deudas pendientes (vista previa en pantalla con forma de hoja) */
.inf-opciones { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 18px; margin-bottom: 12px; }
.inf-rutas { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 2px 12px; margin-top: 4px; }
.informe { background: #fff; border: 1px solid var(--borde); box-shadow: 0 2px 10px rgba(20,40,70,.08);
  margin: 0 auto 24px; padding: 14mm 12mm; max-width: 216mm; color: #111; font-size: 12.5px; }
.inf-cab { border-bottom: 2px solid var(--azul); padding-bottom: 6px; margin-bottom: 12px; }
.inf-cab h1 { font-size: 19px; margin: 0; color: var(--azul); }
.inf-cab p { margin: 2px 0 0; color: #333; }
.inf-empresa { font-size: 12px; color: #444; }
.inf-filtros { font-size: 11.5px; color: #555 !important; }
.inf-grupo { margin-bottom: 14px; }
table.inf-tabla { width: 100%; border-collapse: collapse; font-size: 11.5px; }
.inf-tabla th, .inf-tabla td { padding: 3px 5px; border-bottom: 1px solid #dde3ea; text-align: left; vertical-align: top; }
.inf-tabla th { position: static; text-transform: none; letter-spacing: 0; }  /* (los th de la app son «pegajosos»: al imprimir se superponen) */
.inf-tabla th.num, .inf-tabla td.num { text-align: right; white-space: nowrap; }
.inf-tabla thead th { background: #eef3f8; font-size: 11px; color: #263646; }
.inf-tabla thead tr.inf-ruta-tit th { background: var(--azul); color: #fff; font-size: 13px; padding: 5px 6px; }
.inf-ruta-tit span { font-weight: 400; font-size: 11.5px; opacity: .9; }
.inf-cliente td { font-weight: 700; background: #f7f9fb; padding-top: 5px; }
.inf-subcliente td { font-style: italic; border-bottom: 1px solid #b8c4d1; }
.inf-subtotal td { font-weight: 700; background: #e8eef5; border-top: 1.5px solid #8ea2b8; }
.inf-general td { font-size: 13px; background: #dbe6f2; }
.inf-favor-tit td { color: var(--verde); font-weight: 600; padding-top: 6px; }
.inf-favor-fila td, .inf-favor { color: var(--verde); }
.inf-nc { color: #666; font-size: 10.5px; }
.inf-viejo { color: var(--rojo); font-weight: 600; }
.inf-total { margin-top: 10px; }
@media (max-width: 900px) {
  .inf-opciones { grid-template-columns: 1fr; }
  .informe { padding: 12px; }
}

@media print {
  nav.lateral, .no-imprimir, .banner-ejemplo, .mensajes { display: none !important; }
  body { display: block; background: #fff; }
  main { padding: 0; }
  .tarjeta { border: none; }
  .informe { border: none; box-shadow: none; padding: 0; margin: 0; max-width: none; font-size: 10.5px; }
  table.inf-tabla { font-size: 9.5pt; }
  .inf-tabla thead { display: table-header-group; }  /* encabezados repetidos en cada página */
  .inf-tabla tr { break-inside: avoid; page-break-inside: avoid; }  /* sin cortar filas */
  .inf-grupo.salto { break-before: page; page-break-before: always; }
  .inf-total { break-inside: avoid; }
  .inf-tabla thead th, .inf-subtotal td, .inf-cliente td { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}
