:root {
  --fondo: #f3f5f9; --panel: #fff; --texto: #18212f; --suave: #6b7686; --borde: #e3e8ef; --borde-2: #cfd7e2;
  --primario: #2457a5; --primario-2: #1b4686; --primario-bg: #eaf1fb; --lateral: #13294b;
  --ok: #157347; --ok-bg: #e3f5eb; --error: #b42318; --error-bg: #fdecea; --aviso: #8a5a00; --aviso-bg: #fff3d6;
  --sombra: 0 1px 2px rgba(16,24,40,.05), 0 1px 3px rgba(16,24,40,.06);
  --radio: 12px;
}
* { box-sizing: border-box; }
body { margin: 0; font: 15px/1.5 "Inter", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif; background: var(--fondo); color: var(--texto); -webkit-font-smoothing: antialiased; }
a { color: var(--primario); }
h1 { font-size: 24px; font-weight: 700; letter-spacing: -.01em; margin: 0 0 20px; }
h2 { font-size: 16px; font-weight: 600; margin: 0 0 14px; }

.barra { position: sticky; top: 0; z-index: 10; display: flex; align-items: center; gap: 12px; height: 56px; padding: 0 20px; background: #fff; color: var(--texto); border-bottom: 1px solid var(--borde); }
.barra a { color: var(--texto); text-decoration: none; }
.marca { font-weight: 700; display: flex; align-items: center; gap: 10px; }
.marca::before { content: "$"; display: grid; place-items: center; width: 30px; height: 30px; border-radius: 8px; background: var(--primario); color: #fff; font-weight: 700; }
.usuario { margin-left: auto; font-size: 14px; color: var(--suave); }
.usuario a { color: var(--primario); }
.menu-btn { display: none; background: none; border: 0; color: var(--texto); font-size: 22px; cursor: pointer; }

.lateral { position: fixed; top: 56px; left: 0; bottom: 0; width: 220px; background: var(--lateral); padding: 14px 10px; overflow-y: auto; }
.lateral a { display: block; padding: 9px 14px; margin-bottom: 2px; color: #c9d5e8; text-decoration: none; border-radius: 8px; font-size: 14.5px; }
.lateral a:hover { background: rgba(255,255,255,.07); color: #fff; }
.lateral a.activo { background: rgba(255,255,255,.13); color: #fff; font-weight: 600; }
.lateral a.externo { color: #8fa3c2; font-size: 14px; }
.lateral .sep { margin: 12px 14px; border-top: 1px solid rgba(255,255,255,.12); }
/* Desplegables de color: Ingresos (verde) y Carga de comprobantes (coral) */
.grupo-ing { --g: #2e9d6a; --g-claro: #dff4e9; --g-texto: #14532d; --g-activo: #b5e5cc; }
.grupo-egr { --g: #e9b824; --g-claro: #fdf3d3; --g-texto: #4a3800; --g-activo: #f7dc85; }
.lateral .grupo-egr summary { color: #2b2200; }
.lateral details.grupo { margin: 6px 0; border-radius: 10px; overflow: hidden; background: var(--g-claro); }
.lateral summary { list-style: none; display: flex; align-items: center; gap: 8px; padding: 10px 14px; background: var(--g); color: #fff; font-weight: 600; font-size: 14.5px; cursor: pointer; user-select: none; }
.lateral summary::-webkit-details-marker { display: none; }
.lateral summary::after { content: ""; margin-left: auto; width: 7px; height: 7px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(45deg); transition: transform .15s; }
.lateral details[open] > summary::after { transform: rotate(-135deg); margin-top: 4px; }
.lateral summary:hover { filter: brightness(1.08); }
.lateral details.grupo a { margin: 0; padding: 9px 14px 9px 26px; border-radius: 0; color: var(--g-texto); font-size: 14px; }
.lateral details.grupo a:hover { background: var(--g-activo); color: var(--g-texto); }
.lateral details.grupo a.activo { background: var(--g-activo); color: var(--g-texto); font-weight: 700; }
.contenido { margin-left: 220px; padding: 28px 32px; max-width: 1240px; }

.panel { background: var(--panel); border: 1px solid var(--borde); border-radius: var(--radio); padding: 20px; margin-bottom: 18px; box-shadow: var(--sombra); }
.tarjetas { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 14px; margin-bottom: 20px; }
.tarjeta { background: var(--panel); border: 1px solid var(--borde); border-radius: var(--radio); padding: 16px 18px; box-shadow: var(--sombra); }
.tarjeta .etq { font-size: 13px; color: var(--suave); }
.tarjeta .val { font-size: 22px; font-weight: 700; margin-top: 4px; font-variant-numeric: tabular-nums; letter-spacing: -.01em; }

.tabla-wrap { overflow-x: auto; }
.panel.tabla-wrap { padding: 6px 0 0; }
.panel.tabla-wrap > h2, .panel.tabla-wrap > p { padding: 0 20px; }
.panel.tabla-wrap > h2 { padding-top: 12px; }
table { width: 100%; border-collapse: collapse; background: var(--panel); }
th, td { padding: 11px 14px; border-bottom: 1px solid var(--borde); text-align: left; vertical-align: middle; }
th { font-size: 12px; font-weight: 600; color: var(--suave); background: transparent; white-space: nowrap; }
tr:last-child td { border-bottom: 0; }
tr:hover td { background: #fafbfd; }
td.n, th.n { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
tr.anulado td { color: #9aa5b1; text-decoration: line-through; }
tfoot td { font-weight: 600; background: #f8fafc; }
tr.sub td { background: #f7f9fb; font-weight: 600; }

form.grilla { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 14px 16px; align-items: end; }
label { display: block; font-size: 13px; font-weight: 500; color: #445063; }
input, select, textarea { display: block; width: 100%; margin-top: 6px; padding: 9px 12px; min-height: 40px; border: 1px solid var(--borde-2); border-radius: 8px; font: inherit; color: var(--texto); background: #fff; transition: border-color .15s, box-shadow .15s; }
textarea { min-height: 0; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--primario); box-shadow: 0 0 0 3px rgba(36,87,165,.15); }
input[type=checkbox] { display: inline; width: auto; min-height: 0; margin: 0 6px 0 0; accent-color: var(--primario); }
td input, td select { margin: 0; padding: 6px 9px; min-height: 34px; min-width: 90px; }
.col-2 { grid-column: span 2; }
.col-todo { grid-column: 1 / -1; }

.btn { display: inline-flex; align-items: center; gap: 6px; padding: 9px 16px; border-radius: 8px; border: 1px solid var(--borde-2); background: #fff; color: var(--texto); font: inherit; font-weight: 500; cursor: pointer; text-decoration: none; white-space: nowrap; transition: background .15s; }
.btn:hover { background: #f4f6f9; }
.btn.primario { background: var(--primario); border-color: var(--primario); color: #fff; }
.btn.primario:hover { background: var(--primario-2); }
.btn.peligro { color: var(--error); border-color: #f2c4bf; }
.btn.chico { padding: 5px 11px; font-size: 13px; }
.btn-tacho { display: inline-grid; place-items: center; width: 32px; height: 30px; vertical-align: middle; border: 1px solid #f2c4bf; border-radius: 8px; background: #fff; color: #c0362c; cursor: pointer; }
.btn-tacho:hover { background: #c0362c; border-color: #c0362c; color: #fff; }
.btn-tacho:disabled { color: #b8c0cc; border-color: var(--borde); background: #f6f7f9; cursor: not-allowed; }
.btn.ancho { width: 100%; justify-content: center; }
.btn.link { border: 0; background: none; padding: 4px 0; color: var(--primario); }
.btn.link:hover { text-decoration: underline; background: none; }
.acciones { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 16px; }
.acciones form { display: inline; }
.acciones form.acciones { display: flex; }
.acciones input, .acciones select { margin-top: 0; }
.nowrap { white-space: nowrap; }
.derecha { margin-left: auto; }

.alerta { padding: 12px 16px; border-radius: 10px; margin-bottom: 16px; }
.alerta.ok { background: var(--ok-bg); color: var(--ok); }
.alerta.error { background: var(--error-bg); color: var(--error); }
.alerta.aviso { background: var(--aviso-bg); color: var(--aviso); }

.chip { white-space: nowrap; display: inline-block; padding: 3px 10px; border-radius: 99px; font-size: 12px; font-weight: 600; }
.chip.ok { background: var(--ok-bg); color: var(--ok); }
.chip.error { background: var(--error-bg); color: var(--error); }
.chip.aviso { background: var(--aviso-bg); color: var(--aviso); }
.chip.gris { background: #eef1f4; color: var(--suave); }
.suave { color: var(--suave); }
.pos { color: var(--ok); } .neg { color: var(--error); }

body.login { display: grid; place-items: center; min-height: 100vh; background: linear-gradient(160deg, #13294b 0%, #2457a5 100%); }
.caja-login { width: min(380px, 92vw); background: var(--panel); border-radius: 16px; padding: 32px; display: grid; gap: 16px; box-shadow: 0 20px 50px rgba(0,0,0,.25); }
.caja-login h1 { margin: 0; } .caja-login .sub { margin: -10px 0 0; color: var(--suave); }

/* Hoja para imprimir (recibos, liquidaciones, comprobantes) */
.hoja { background: #fff; border: 1px solid var(--borde); border-radius: var(--radio); padding: 28px; max-width: 860px; box-shadow: var(--sombra); }
.hoja .cab { display: flex; justify-content: space-between; gap: 16px; border-bottom: 2px solid var(--texto); padding-bottom: 12px; margin-bottom: 16px; }
.hoja .total { font-size: 20px; font-weight: 700; text-align: right; margin-top: 14px; }
.hoja table tr:hover td { background: none; }

/* Resumen de totales del comprobante (pantalla Ver) */
.totales-comp { display: flex; flex-wrap: wrap; gap: 8px; margin: 16px 0; }
.totales-comp > div { flex: 1 1 130px; background: #f8fafc; border: 1px solid var(--borde); border-radius: 10px; padding: 10px 14px; font-variant-numeric: tabular-nums; }
.totales-comp span { display: block; font-size: 12px; color: var(--suave); }
.totales-comp .grande { background: var(--primario); border-color: var(--primario); color: #fff; font-size: 19px; font-weight: 700; }
.totales-comp .grande span { color: #d6e2f5; }

/* Formulario de comprobante */
.comp-layout { display: grid; grid-template-columns: minmax(0, 1fr) 330px; gap: 20px; align-items: start; }
.paso { background: var(--panel); border: 1px solid var(--borde); border-radius: var(--radio); padding: 20px 22px; margin-bottom: 16px; box-shadow: var(--sombra); }
.paso-tit { display: flex; align-items: center; gap: 10px; margin: 0 0 16px; font-size: 16px; font-weight: 600; }
.paso-tit .num { display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: var(--primario-bg); color: var(--primario); font-size: 13px; font-weight: 700; }
.paso-tit .der { margin-left: auto; font-weight: 400; }
.fila { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
.ayuda { font-size: 13px; color: var(--suave); margin: 8px 0 0; }
.input-grande { font-size: 16px; padding: 11px 14px; min-height: 46px; }
.prov-ficha { display: flex; align-items: center; gap: 12px; margin-top: 12px; padding: 10px 14px; background: #f8fafc; border: 1px solid var(--borde); border-radius: 10px; font-size: 14px; }
.prov-ficha .avatar { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: var(--primario-bg); color: var(--primario); font-weight: 700; flex: none; }
.prov-ficha .der { margin-left: auto; }
.prov-nuevo { margin-top: 12px; padding: 14px; border: 1px dashed var(--borde-2); border-radius: 10px; }
.prov-nuevo .etq-nuevo { display: inline-block; font-size: 12px; font-weight: 600; color: var(--primario); background: var(--primario-bg); padding: 2px 8px; border-radius: 99px; margin-bottom: 10px; }

.segmentado { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.segmentado button, .segmentado select { padding: 8px 14px; min-height: 38px; border: 1px solid var(--borde-2); border-radius: 8px; background: #fff; font: inherit; font-size: 14px; cursor: pointer; color: var(--texto); width: auto; margin: 0; }
.segmentado button:hover { background: #f4f6f9; }
.segmentado button.activo, .segmentado select.activo { background: var(--primario); border-color: var(--primario); color: #fff; font-weight: 600; }
.numero-comp { display: flex; align-items: center; gap: 6px; }
.numero-comp input { margin-top: 6px; font-variant-numeric: tabular-nums; }
.numero-comp .pv { width: 90px; flex: none; }
.numero-comp span { margin-top: 6px; color: var(--suave); }

.renglones { display: grid; gap: 10px; }
.renglon { display: grid; grid-template-columns: minmax(0, 1fr) 170px 36px; gap: 10px; align-items: center; }
.renglon.avanzado { grid-template-columns: minmax(0, 1fr) 130px 130px 130px 36px; }
.renglon input, .renglon select { margin: 0; }
.renglon .col-av { display: none; }
.renglon.avanzado .col-av { display: block; }
.renglon.avanzado .col-simple { display: none; }
.renglon-cab { font-size: 12px; font-weight: 600; color: var(--suave); }
.renglon-cab > div { padding-left: 2px; }
.input-plata { text-align: right; font-variant-numeric: tabular-nums; }
.quitar { width: 36px; height: 36px; border: 0; border-radius: 8px; background: none; color: #8a94a3; cursor: pointer; font-size: 18px; }
.quitar:hover { background: var(--error-bg); color: var(--error); }
.links-paso { display: flex; flex-wrap: wrap; gap: 4px 18px; margin-top: 12px; }
.nuevo-rubro { display: none; gap: 8px; align-items: center; margin-top: 10px; padding: 10px; background: #f8fafc; border-radius: 10px; }
.nuevo-rubro.abierto { display: flex; }
.nuevo-rubro input { margin: 0; }

.resumen { position: sticky; top: 76px; }
.resumen .paso { padding: 20px; }
.resumen-total { font-size: 30px; font-weight: 700; letter-spacing: -.02em; font-variant-numeric: tabular-nums; margin: 2px 0 14px; }
.resumen-lineas { display: grid; gap: 6px; font-size: 14px; padding: 12px 0; border-top: 1px solid var(--borde); border-bottom: 1px solid var(--borde); margin-bottom: 16px; }
.resumen-lineas div { display: flex; justify-content: space-between; font-variant-numeric: tabular-nums; }
.resumen-lineas div.cero { display: none; }
.resumen-lineas:not(:has(div:not(.cero))) { display: none; }
.resumen-lineas span { color: var(--suave); }
.toggle { display: grid; grid-template-columns: 1fr 1fr; background: #eef1f5; border-radius: 10px; padding: 4px; margin: 6px 0 14px; }
.toggle button { border: 0; background: none; padding: 8px; border-radius: 8px; font: inherit; font-size: 14px; cursor: pointer; color: var(--suave); }
.toggle button.activo { background: #fff; color: var(--texto); font-weight: 600; box-shadow: var(--sombra); }
.switch { display: flex; align-items: center; gap: 10px; font-size: 14px; color: var(--texto); cursor: pointer; margin-bottom: 12px; }
.switch input { position: absolute; opacity: 0; }
.switch .pista { width: 38px; height: 22px; border-radius: 99px; background: #cfd7e2; position: relative; transition: background .15s; flex: none; }
.switch .pista::after { content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: transform .15s; box-shadow: 0 1px 2px rgba(0,0,0,.2); }
.switch input:checked + .pista { background: var(--primario); }
.switch input:checked + .pista::after { transform: translateX(16px); }
.oculto { display: none !important; }
.resumen label { margin-bottom: 12px; }

/* Lista de comprobantes y pagos */
.tarjeta-link { text-decoration: none; color: inherit; transition: border-color .15s, box-shadow .15s; }
.tarjeta-link:hover { border-color: var(--borde-2); }
.tarjeta-link.sel { border-color: var(--primario); box-shadow: 0 0 0 3px rgba(36,87,165,.12); }
.barra-lista { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 14px; }
.buscador { flex: 1 1 260px; position: relative; }
.buscador input { margin: 0; padding-left: 36px; }
.buscador::before { content: ""; position: absolute; left: 13px; top: 50%; width: 11px; height: 11px; border: 2px solid #8a94a3; border-radius: 50%; transform: translateY(-60%); }
.buscador::after { content: ""; position: absolute; left: 24px; top: 58%; width: 6px; height: 2px; background: #8a94a3; transform: rotate(45deg); }
.filtro-activo { margin: -4px 0 12px; font-size: 14px; }
.lista-comp { display: grid; gap: 8px; }
.comp-fila { display: grid; grid-template-columns: minmax(0, 1fr) 190px 130px 90px; gap: 14px; align-items: center; background: var(--panel); border: 1px solid var(--borde); border-radius: var(--radio); padding: 14px 18px; box-shadow: var(--sombra); transition: border-color .15s; }
.comp-fila:hover { border-color: var(--borde-2); }
.comp-fila.anulada { opacity: .55; }
.comp-fila.anulada .cf-prov { text-decoration: line-through; }
.cf-main { color: inherit; text-decoration: none; min-width: 0; }
.cf-prov { font-weight: 600; font-size: 15.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cf-prov .suave { font-weight: 400; font-size: 13px; }
.cf-det { font-size: 13.5px; color: var(--suave); margin-top: 2px; }
.cf-barra { height: 5px; background: #eef1f5; border-radius: 99px; margin-top: 8px; max-width: 260px; overflow: hidden; }
.cf-barra span { display: block; height: 100%; background: var(--ok); border-radius: 99px; }
.cf-montos { text-align: right; }
.cf-saldo { font-size: 18px; font-weight: 700; font-variant-numeric: tabular-nums; }
.cf-sub { font-size: 12.5px; }
.cf-acc { text-align: right; }
.vacio { text-align: center; padding: 40px 20px; color: var(--suave); background: var(--panel); border: 1px dashed var(--borde-2); border-radius: var(--radio); }
.dialogo { border: 0; border-radius: 16px; padding: 24px; width: min(520px, 94vw); box-shadow: 0 24px 60px rgba(0,0,0,.25); }
.dialogo::backdrop { background: rgba(15,25,45,.45); }
@media (max-width: 800px) {
  .comp-fila { grid-template-columns: 1fr auto; }
  .cf-estado { order: 3; } .cf-acc { order: 4; }
}

@media (max-width: 1000px) {
  .comp-layout { grid-template-columns: 1fr; }
  .resumen { position: static; }
}
@media (max-width: 800px) {
  .menu-btn { display: block; }
  .lateral { transform: translateX(-100%); transition: transform .2s; z-index: 9; box-shadow: 2px 0 8px rgba(0,0,0,.2); }
  body.menu-abierto .lateral { transform: none; }
  .contenido { margin-left: 0; padding: 16px; }
  .usuario { display: none; }
  .col-2 { grid-column: auto; }
  .renglon, .renglon.avanzado { grid-template-columns: 1fr 1fr 36px; }
  .renglon > :first-child { grid-column: 1 / -1; }
  .renglon.avanzado > .col-av { grid-column: auto; }
  .renglon-cab { display: none !important; }
  .renglon:not(.avanzado) > .col-simple { grid-column: span 2; }
  .fila { grid-template-columns: 1fr; }
}
@media print {
  .barra, .lateral, .no-print, .alerta { display: none !important; }
  .contenido { margin: 0; padding: 0; }
  body { background: #fff; }
  .hoja { border: 0; padding: 0; box-shadow: none; }
  h1 { display: none; }
}
.pie-login { margin: 4px 0 0; text-align: center; font-size: 12px; color: var(--suave); }
.pie-login a { color: var(--suave); }


/* Buscador de rubro (lupa) y sugerencias de proveedor */
.rub-sel { display: flex; gap: 6px; align-items: center; min-width: 0; }
.rub-sel select { flex: 1; min-width: 0; margin: 0; }
.btn-lupa { flex: none; display: grid; place-items: center; width: 40px; height: 40px; border: 1px solid var(--borde-2); border-radius: 8px; background: #fff; color: var(--primario); cursor: pointer; }
.btn-lupa:hover { background: var(--primario-bg); border-color: var(--primario); }
.autocompletar { position: relative; }
.sugerencias { position: absolute; left: 0; right: 0; top: calc(100% + 4px); z-index: 20; background: #fff; border: 1px solid var(--borde-2); border-radius: 10px; box-shadow: 0 12px 30px rgba(15,25,45,.15); max-height: 330px; overflow-y: auto; padding: 4px; }
.opc { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 8px; cursor: pointer; }
.opc strong { display: block; font-weight: 600; }
.opc small { display: block; color: var(--suave); font-size: 12.5px; margin-top: 1px; }
.opc.act, .opc:hover { background: var(--primario-bg); }
.opc mark { background: #fde68a; color: inherit; border-radius: 3px; padding: 0 1px; }
.opc .ini { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: var(--primario-bg); color: var(--primario); font-weight: 700; flex: none; font-size: 13px; }
.opc.act .ini { background: #fff; }
.dlg-rub { width: min(560px, 94vw); }
.rb-lista { margin-top: 10px; max-height: min(380px, 55vh); overflow-y: auto; border: 1px solid var(--borde); border-radius: 10px; padding: 4px; }

/* ===== Cheques ===== */
.cheque { --ch1: #e8f0fb; --ch2: #d6e4f7; --ch-tinta: #1d3f73; --ch-borde: #a9c1e4;
  position: relative; max-width: 860px; border-radius: 14px; padding: 22px 26px 18px; color: var(--ch-tinta);
  border: 1px solid var(--ch-borde); box-shadow: 0 10px 30px rgba(20,40,80,.12);
  background:
    radial-gradient(circle at 85% 30%, rgba(255,255,255,.75) 0 70px, transparent 71px),
    repeating-linear-gradient(135deg, rgba(255,255,255,.35) 0 2px, transparent 2px 9px),
    repeating-linear-gradient(45deg, rgba(255,255,255,.25) 0 1px, transparent 1px 7px),
    linear-gradient(120deg, var(--ch1), var(--ch2)); overflow: hidden; }
.cheque::before { content: ""; position: absolute; inset: 8px; border: 1.5px dashed rgba(29,63,115,.18); border-radius: 10px; pointer-events: none; }
.cheque.ch-tercero { --ch1: #e6f5ee; --ch2: #cfeadb; --ch-tinta: #1d5a3f; --ch-borde: #9fd0b6; }
.cheque.ch-tercero::before { border-color: rgba(29,90,63,.2); }
.cheque small { display: block; font-size: 11px; text-transform: uppercase; letter-spacing: .06em; opacity: .75; font-weight: 600; }
.cheque input, .cheque select { background: rgba(255,255,255,.7); border-color: rgba(0,0,0,.08); color: var(--texto); margin-top: 4px; }
.cheque input:focus, .cheque select:focus { background: #fff; }
.ch-top { display: flex; justify-content: space-between; gap: 18px; align-items: flex-start; }
.ch-banco { display: flex; gap: 12px; align-items: center; flex: 1; min-width: 0; }
.ch-banco strong { font-size: 17px; display: block; }
.ch-logo { flex: none; display: grid; place-items: center; width: 46px; height: 46px; border-radius: 12px; background: var(--ch-tinta); color: #fff; font-weight: 700; font-size: 20px; }
.ch-sub { font-size: 13px; min-height: 32px; padding: 5px 10px; }
.ch-nro { text-align: right; font-family: "Courier New", monospace; font-size: 20px; font-weight: 700; letter-spacing: .08em; }
.ch-nro input { width: 170px; font-family: inherit; font-size: 18px; font-weight: 700; text-align: right; letter-spacing: .08em; }
.ch-cuerpo { display: flex; justify-content: space-between; gap: 18px; align-items: flex-end; margin-top: 18px; flex-wrap: wrap; }
.ch-fechas { display: flex; gap: 12px; flex-wrap: wrap; }
.ch-fechas label { margin: 0; }
.ch-fechas input { width: auto; }
.ch-leer .ch-fechas > div { font-weight: 600; font-size: 15px; }
.ch-pagodia small { color: #b45309; opacity: 1; }
.ch-monto { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; background: rgba(255,255,255,.85); border: 2px solid var(--ch-tinta); border-radius: 10px; padding: 8px 14px; font-size: 24px; font-weight: 700; font-variant-numeric: tabular-nums; margin: 0; }
.ch-monto small { width: 100%; }
.ch-monto input { width: 200px; border: 0; background: transparent; font-size: 24px; font-weight: 700; padding: 0; min-height: 0; margin: 0; box-shadow: none; }
.ch-linea { display: flex; align-items: baseline; gap: 12px; margin-top: 16px; border-bottom: 1.5px solid rgba(0,0,0,.18); padding-bottom: 4px; }
.ch-linea small { flex: none; }
.ch-linea input { border: 0; background: transparent; margin: 0; padding: 2px 4px; min-height: 0; font-size: 16px; font-weight: 600; }
.ch-linea span { font-size: 16px; font-weight: 600; }
.ch-letras { font-style: italic; font-family: Georgia, serif; font-weight: 400 !important; }
.ch-pie { display: flex; justify-content: space-between; align-items: flex-end; gap: 18px; margin-top: 22px; flex-wrap: wrap; }
.ch-cmc7 { font-family: "Courier New", monospace; font-size: 17px; letter-spacing: .12em; opacity: .8; }
.ch-firma { text-align: center; min-width: 230px; border-top: 1.5px solid var(--ch-tinta); padding-top: 6px; }
.ch-firma span { font-family: "Brush Script MT", "Segoe Script", cursive; font-size: 21px; display: block; }
.ch-firma input { text-align: center; }
.asiento-prev { margin-top: 18px; background: #f8fafc; border: 1px solid var(--borde); border-radius: 10px; padding: 12px 14px; }
.asiento-prev .ap-tit { font-weight: 600; font-size: 14px; margin-bottom: 6px; }
.asiento-prev th, .asiento-prev td { padding: 6px 8px; font-size: 14px; }
.ver-cheque { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 18px; align-items: start; }
dl.datos { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; margin: 0; font-size: 14px; }
dl.datos dt { color: var(--suave); } dl.datos dd { margin: 0; }
.mini-ch { display: inline-block; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; padding: 2px 7px; border-radius: 5px; vertical-align: 2px; }
.mini-ch.propio { background: #e8f0fb; color: #1d3f73; } .mini-ch.tercero { background: #e6f5ee; color: #1d5a3f; }
.btn-verde { background: #2e9d6a; border-color: #2e9d6a; color: #fff; } .btn-verde:hover { background: #26855a; }
@media (max-width: 900px) { .ver-cheque { grid-template-columns: 1fr; } }
@media (max-width: 640px) {
  .cheque { padding: 18px 16px 14px; }
  .ch-top { flex-direction: column; } .ch-nro { text-align: left; } .ch-nro input { width: 100%; text-align: left; }
  .ch-monto, .ch-monto input { width: 100%; } .ch-linea { flex-direction: column; gap: 2px; } .ch-linea input { width: 100%; }
  .ch-firma { min-width: 0; width: 100%; }
}

/* ---------- Ingresos ---------- */
.ing-fila { grid-template-columns: minmax(0, 1fr) 210px 150px 110px 112px; }
.ing-fila .cf-acc { white-space: nowrap; }
.cf-rubro { min-width: 0; font-size: 14px; line-height: 1.3; }
.cf-rubro a { color: var(--texto); text-decoration: none; display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cf-rubro a:hover { color: var(--primario); text-decoration: underline; }
.cf-rubro small { color: var(--suave); font-size: 12px; }
.ing-fila .cf-estado { text-align: center; }
.fondos { display: grid; gap: 6px; margin: 6px 0 14px; }
.resumen .fondo-opc, .fondo-opc { display: flex; align-items: center; gap: 10px; margin: 0; padding: 9px 12px; border: 1px solid var(--borde-2); border-radius: 10px; cursor: pointer; transition: border-color .15s, background .15s; }
.fondo-opc:hover { background: #f8fafc; }
.fondo-opc input { width: auto; min-height: 0; margin: 0; accent-color: var(--ok); }
.fondo-opc strong { display: block; font-weight: 600; font-size: 14px; }
.fondo-opc small { display: block; color: var(--suave); font-size: 12px; }
.fondo-opc:has(input:checked) { border-color: var(--ok); background: var(--ok-bg); box-shadow: 0 0 0 3px rgba(21,115,71,.1); }
.totales-comp .grande-ok { background: var(--ok); border-color: var(--ok); }
@media (max-width: 800px) {
  .ing-fila { grid-template-columns: 1fr auto; }
  .ing-fila .cf-rubro { order: 3; } .ing-fila .cf-estado { order: 4; text-align: left; } .ing-fila .cf-acc { order: 5; }
}
.etq-fecha { display: block; font-size: 13px; font-weight: 500; color: #445063; }
.fecha-auto { margin-top: 6px; min-height: 40px; padding: 8px 12px; border-radius: 8px; background: #f3f5f9; border: 1px dashed var(--borde-2); font-weight: 600; font-variant-numeric: tabular-nums; }
.fecha-auto small { font-weight: 400; color: var(--suave); margin-left: 6px; }

/* ---------- Botón de ayuda (globito con ?) ---------- */
.contenido { position: relative; }
.btn-ayuda-ico { position: absolute; top: 22px; right: 32px; display: grid; place-items: center; width: 44px; height: 44px; padding: 0; border: 0; border-radius: 50%; background: none; color: #111; cursor: pointer; transition: transform .15s, color .15s; }
.btn-ayuda-ico:hover { color: var(--primario); transform: scale(1.08); }
.btn-ayuda-ico[aria-expanded="true"] { color: var(--primario); }
.btn-ayuda-ico:focus-visible { outline: 3px solid rgba(36,87,165,.35); }
.panel-ayuda { border-color: #bcd0ee; background: #f5f8fd; }
.panel-ayuda ul { margin: 0; padding-left: 20px; display: grid; gap: 8px; }
.panel-ayuda .chip { vertical-align: 1px; }
@media (max-width: 800px) { .btn-ayuda-ico { top: 10px; right: 12px; } }
@media print { .btn-ayuda-ico { display: none; } }

/* Empresas: localidad nueva en el mismo lugar que el desplegable */
.loc-nueva { display: flex; gap: 6px; align-items: center; margin-top: 6px; }
.loc-nueva.oculto { display: none; }
.loc-nueva input { margin: 0; }

/* Empresas: varios teléfonos y correos con su sector */
.contactos { display: grid; gap: 8px; align-content: start; }
.contactos-tit { font-size: 13px; font-weight: 500; color: #445063; }
.contacto-fila { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr) 36px; gap: 8px; align-items: center; }
.contacto-fila input { margin: 0; }
.contactos .mas-contacto { justify-self: start; font-size: 14px; }
.contactos-ver { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-top: 6px; }
.contactos-ver span { white-space: nowrap; }
form.grilla-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); align-items: start; }
@media (max-width: 1000px) { form.grilla-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 640px) { form.grilla-4 { grid-template-columns: 1fr; } form.grilla-4 .col-2 { grid-column: auto; } }
.seccion-form { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; margin-top: 10px; padding-top: 16px; border-top: 1px solid var(--borde); }
.seccion-form h3 { margin: 0; font-size: 17px; }
.seccion-form .suave { font-size: 13px; }
.estudio-ver { margin-top: 10px; padding-top: 10px; border-top: 1px dashed var(--borde-2); }

/* ===== Egresos > Cargar pagos ===== */
.grilla-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px 16px; align-items: end; }
.grilla-3 label { margin: 0; }
.txt-error { color: var(--error); font-weight: 600; }
.lista-prov { display: grid; gap: 8px; }
.prov-opc { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border: 1px solid var(--borde); border-radius: 12px; color: inherit; text-decoration: none; background: var(--panel); transition: border-color .15s, background .15s; }
.prov-opc:hover { border-color: var(--primario); background: #f8fafc; }
.prov-opc .ini, .prov-elegido .ini { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; background: var(--primario-bg); color: var(--primario); font-weight: 700; flex: none; }
.po-det { flex: 1; min-width: 0; }
.po-det strong { display: block; font-weight: 600; }
.po-det small { color: var(--suave); font-size: 13px; }
.po-saldo { font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.po-flecha { color: var(--suave); font-size: 22px; line-height: 1; }
.prov-elegido { display: flex; align-items: center; gap: 12px; }
.chk-todos { display: inline-flex; align-items: center; gap: 6px; margin: 0; font-size: 14px; cursor: pointer; }
.chk-todos input { width: auto; min-height: 0; margin: 0; }
.lista-pagar { display: grid; gap: 8px; }
.pagar-fila { display: flex; align-items: center; gap: 12px; margin: 0; padding: 12px 14px; border: 1px solid var(--borde-2); border-radius: 12px; cursor: pointer; font-weight: 400; transition: border-color .15s, background .15s; }
.pagar-fila:hover { background: #f8fafc; }
.pagar-fila.sel { border-color: var(--primario); background: var(--primario-bg); }
.pagar-fila .chk { width: 18px; height: 18px; min-height: 0; margin: 0; flex: none; accent-color: var(--primario); }
.pf-det { flex: 1; min-width: 0; line-height: 1.5; }
.pf-det .suave { font-size: 13px; }
.pf-imp input { width: 150px; margin: 0; }
.pf-imp input:disabled { background: transparent; border-color: transparent; }
@media (max-width: 700px) { .grilla-3 { grid-template-columns: 1fr; } .pagar-fila { flex-wrap: wrap; } .pf-imp { width: 100%; } .pf-imp input { width: 100%; } }

/* ===== Proveedores: ventanita de alta / edición ===== */
.dlg-prov { width: min(780px, 96vw); padding: 0; max-height: 92vh; }
.dlg-prov form { display: flex; flex-direction: column; max-height: 92vh; }
.dlg-cab { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 20px 24px 14px; border-bottom: 1px solid var(--borde); }
.dlg-cab h2 { margin: 0; font-size: 19px; }
.dlg-cuerpo { padding: 18px 24px; overflow-y: auto; }
.dlg-pie { display: flex; justify-content: flex-end; gap: 10px; padding: 14px 24px; border-top: 1px solid var(--borde); background: #f8fafc; border-radius: 0 0 16px 16px; }
.grilla-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 16px; align-items: start; }
.grilla-2 > label, .grilla-2 > div > label { margin: 0; }
.grilla-2 .col-2 { grid-column: 1 / -1; }
.grilla-2 > div > label + .doc-par, .grilla-2 > div > label + .rub-sel { margin-top: 6px; }
.doc-par { display: grid; grid-template-columns: 96px minmax(0, 1fr); gap: 6px; }
.doc-par select, .doc-par input { margin: 0; }
.dlg-prov .seccion-form { margin-top: 18px; }
@media (max-width: 640px) { .grilla-2 { grid-template-columns: 1fr; } }
.numero-comp input.auto { background: #f1f5f9; color: var(--suave); cursor: not-allowed; }
input.solo-lectura { background: #f1f5f9; color: var(--texto); cursor: default; }
.prov-nuevo { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; background: var(--aviso-bg); border-color: #e7c56a; }

/* Orden de pago (Cargar pagos) */
.op-titulo { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; padding-bottom: 14px; border-bottom: 1px solid var(--borde); }
.op-nro { font-size: 26px; font-weight: 700; letter-spacing: .02em; font-variant-numeric: tabular-nums; }
.op-fecha { margin: 0; width: 190px; font-size: 13px; color: var(--suave); }
.op-tabla { display: grid; gap: 6px; }
.op-fila { display: grid; grid-template-columns: 22px minmax(0, 1fr) 96px 96px 130px 150px; gap: 12px; align-items: center; }
.op-fila .n { text-align: right; font-variant-numeric: tabular-nums; }
.op-encab { padding: 0 14px; font-size: 12px; font-weight: 600; color: var(--suave); }
.op-pie { padding: 10px 14px 0; border-top: 1px solid var(--borde); margin-top: 4px; font-size: 14px; }
.pagar-fila.op-fila { display: grid; }
.btn-pagar-todo { justify-content: center; background: #e9edf2; border-color: #cfd7e2; color: var(--texto); font-weight: 600; }
.btn-pagar-todo:hover { background: #dde3ea; }
.op-hoja .op-nro { font-size: 22px; }
.firmas { display: flex; justify-content: space-around; gap: 30px; margin-top: 70px; }
.firmas div { flex: 0 1 220px; border-top: 1px solid var(--texto); padding-top: 6px; text-align: center; font-size: 13px; color: var(--suave); }
@media (max-width: 800px) {
  .op-fila { grid-template-columns: 22px 1fr 1fr; }
  .op-encab { display: none; }
  .op-fila > :nth-child(3), .op-fila > :nth-child(4) { font-size: 13px; }
  .op-fila .pf-imp { grid-column: 1 / -1; }
  .op-fecha { width: 100%; }
}

/* Orden de pago v2: total arriba al lado del encabezado + botón Cerrar */
.op-der { display: flex; align-items: flex-end; gap: 10px; }
.btn-cerrar { gap: 7px; color: var(--suave); }
.btn-cerrar:hover { color: var(--error); border-color: #f2c4bf; background: #fff5f4; }
@media (max-width: 800px) { .op-der { width: 100%; } .op-der .op-fecha { flex: 1; } }
@media print { .btn-cerrar { display: none; } }

/* Orden de pago impresa: membrete con logo, título centrado */
.op-membrete { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 20px; }
.op-inst { display: flex; align-items: center; gap: 14px; font-size: 12.5px; line-height: 1.45; color: var(--suave); }
.op-inst strong { color: var(--texto); font-size: 13.5px; }
.op-logo { width: 110px; height: auto; flex: none; }
.op-titulo-doc { font-size: 28px; font-weight: 800; letter-spacing: .08em; text-align: center; white-space: nowrap; }
.op-datos-doc { text-align: right; font-size: 14px; line-height: 1.7; }
.op-pagamos { padding: 4px 0 14px; margin-bottom: 8px; border-bottom: 1px solid var(--borde); }
@media (max-width: 800px) {
  .op-membrete { grid-template-columns: 1fr; text-align: left; }
  .op-titulo-doc, .op-datos-doc { text-align: left; }
}
@media print { .op-logo { width: 100px; } .op-membrete { grid-template-columns: 1fr auto 1fr; } .op-titulo-doc { text-align: center; } .op-datos-doc { text-align: right; } }
.hoja.op-hoja { max-width: 1000px; }
.op-datos-doc { white-space: nowrap; }
.op-titulo-doc { font-size: 26px; }

/* Orden de pago: botón Descargar PDF (no sale en la impresión) */
.op-descargar { display: flex; justify-content: center; max-width: 1000px; margin-top: 16px; }
.op-descargar .btn { padding: 11px 22px; }
.op-hoja.pdf { border: 0; box-shadow: none; border-radius: 0; max-width: none; }
.op-hoja.pdf a { color: inherit; text-decoration: none; }
@media print { .op-descargar { display: none !important; } }
.op-hoja.pdf { background: #fff; padding: 4px; }
.op-hoja.pdf .op-membrete { grid-template-columns: auto 1fr auto; gap: 14px; }
.op-hoja.pdf .op-inst { font-size: 11px; gap: 10px; white-space: nowrap; }
.op-hoja.pdf .op-inst strong { font-size: 12px; }
.op-hoja.pdf .op-logo { width: 78px; }
.op-hoja.pdf .op-titulo-doc { font-size: 21px; }
.op-hoja.pdf .op-datos-doc { font-size: 12px; }
.op-hoja.pdf .op-nro { font-size: 18px; }

/* Orden de pago centrada con márgenes cómodos (pantalla, impresión y PDF) */
.hoja.op-hoja { margin-left: auto; margin-right: auto; padding: 36px 44px; }
.op-descargar { margin-left: auto; margin-right: auto; }
.op-hoja.pdf { background: #fff !important; padding: 0 !important; margin: 0 !important; }
@media print {
  @page { size: A4; margin: 18mm 16mm; }
  .hoja.op-hoja { max-width: none; margin: 0 auto; padding: 0; border: 0; box-shadow: none; }
}
@media print {
  .op-membrete { grid-template-columns: auto 1fr auto; gap: 14px; }
  .op-inst { font-size: 10.5px; gap: 10px; white-space: nowrap; }
  .op-inst strong { font-size: 11.5px; }
  .op-logo { width: 74px; }
  .op-titulo-doc { font-size: 20px; }
  .op-datos-doc { font-size: 11.5px; }
  .op-hoja .op-nro { font-size: 17px; }
}

/* Orden de pago: firmas al pie de la hoja (impresión A4 y PDF; en pantalla queda igual) */
.op-hoja.pdf { display: flex; flex-direction: column; min-height: 985px; }
.op-hoja.pdf .firmas { margin-top: auto; padding-top: 60px; }
@media print {
  .hoja.op-hoja { display: flex; flex-direction: column; min-height: 255mm; }
  .op-hoja .firmas { margin-top: auto; padding-top: 60px; break-inside: avoid; }
}

/* Cuenta corriente: buscador predictivo */
.buscar-cc { flex: 1 1 300px; }
.buscar-cc .sugerencias { max-height: 420px; }
.sug-tit { padding: 8px 10px 4px; font-size: 11.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; color: var(--suave); border-top: 1px solid var(--borde); margin-top: 4px; }
.buscar-cc .sugerencias { min-width: 480px; }
@media (max-width: 640px) { .buscar-cc .sugerencias { min-width: 0; } }

/* Cuenta corriente de un proveedor (libro mayor) y Deuda */
.cc-filtros { display: flex; align-items: flex-end; gap: 12px; flex-wrap: wrap; margin: 4px 0 16px; }
.cc-filtros label { margin: 0; width: 170px; font-size: 13px; color: var(--suave); }
.cc-filtros .segmentado .btn { padding: 9px 18px; }
.cc-hoja.op-hoja .op-pagamos { margin-bottom: 4px; }
.cc-tabla { font-size: 13.5px; font-variant-numeric: tabular-nums; }
.cc-tabla th, .cc-tabla td { padding: 8px 10px; }
.cc-tabla .cc-ant td { color: var(--suave); font-style: italic; }
.cc-tabla tr.cc-pago td { background: #f7faf8; }
.cc-tabla tfoot td { font-weight: 600; border-top: 2px solid var(--texto); border-bottom: 0; }
.cc-tabla .neg { color: var(--error); }
.cc-com { color: var(--suave); font-size: 12.5px; min-width: 200px; }
.cc-contado { font-size: 10.5px; padding: 1px 6px; vertical-align: 1px; }
.cc-totales { display: flex; justify-content: flex-end; gap: 14px; margin-top: 16px; flex-wrap: wrap; }
.cc-totales > div { display: flex; flex-direction: column; align-items: flex-end; padding: 10px 16px; border: 1px solid var(--borde); border-radius: 10px; min-width: 170px; }
.cc-totales span { font-size: 12px; color: var(--suave); }
.cc-totales strong { font-size: 17px; font-variant-numeric: tabular-nums; }
.cc-totales .grande { background: var(--primario); border-color: var(--primario); color: #fff; }
.cc-totales .grande.debe { background: #b3261e; border-color: #b3261e; }
.cc-totales .grande span, .cc-totales .grande small { color: rgba(255,255,255,.85); }
.cc-totales .grande strong { font-size: 22px; }
.cc-totales small { font-size: 12px; }
.cc-nota { font-size: 12px; margin: 12px 0 0; }
.op-hoja.pdf .cc-tabla { font-size: 11px; }
.op-hoja.pdf .cc-com { min-width: 0; }
@media print {
  .cc-tabla { font-size: 10.5px; } .cc-tabla th, .cc-tabla td { padding: 5px 6px; } .cc-com { min-width: 0; font-size: 10px; }
  .cc-hoja.op-hoja { min-height: 0; display: block; }
  .cc-totales > div { border-color: #999; } .cc-totales .grande { background: none !important; color: var(--texto); border: 2px solid var(--texto); }
  .cc-totales .grande span, .cc-totales .grande small { color: var(--suave); }
}
.chk-linea { display: inline-flex !important; align-items: center; gap: 7px; width: auto !important; font-size: 14px !important; color: var(--texto) !important; padding-bottom: 10px; cursor: pointer; }
.chk-linea input { width: auto; margin: 0; }
.op-hoja.pdf.sin-com .cc-col-com { display: none; }
@media print { .cc-hoja.sin-com .cc-col-com { display: none; } }
.cc-filtros label:not(.chk-linea) { width: 150px; }
.cc-filtros .btn { padding: 9px 14px; }
.op-hoja.pdf .cc-tabla th, .op-hoja.pdf .cc-tabla td { padding: 6px 6px; }
.op-hoja.pdf .cc-com { width: 34%; font-size: 10px; }
.op-hoja.pdf .cc-contado { font-size: 9px; }
/* Cuenta corriente: edición en la misma fila */
.btn-lapiz { display: inline-grid; place-items: center; width: 30px; height: 28px; border: 1px solid var(--borde-2); border-radius: 7px; background: #fff; color: var(--suave); cursor: pointer; }
.btn-lapiz:hover { color: var(--primario); border-color: var(--primario); }
.cc-acc { width: 40px; text-align: right; }
.cc-tabla tr.cc-edit td { background: #fffbea; border-bottom: 2px solid #e7c56a; padding: 12px; }
.cc-edit-form { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px; }
.cc-edit-form label { margin: 0; font-size: 12.5px; color: var(--suave); width: 150px; }
.cc-edit-form input { margin-top: 3px; }
.cc-edit-tit { flex-basis: 100%; font-size: 14px; }
.cc-ed-nro { width: 200px !important; }
.cc-ed-nro span { display: flex; align-items: center; gap: 4px; }
.cc-ed-nro input[name=punto_venta] { width: 64px; } .cc-ed-nro b { color: var(--suave); }
.cc-ed-com { flex: 1 1 220px; width: auto !important; }
.cc-ed-bot { display: flex; gap: 8px; }
.op-hoja.pdf .no-print { display: none !important; }
.cc-hoja.op-hoja.pdf { min-height: 0; display: block; }
/* Membrete solo al imprimir y en el PDF (en pantalla no se ve) */
.op-membrete.solo-impresion { display: none; }
.op-hoja.pdf .op-membrete.solo-impresion { display: grid; }
@media print { .op-membrete.solo-impresion { display: grid; } }
.cc-hoja .op-pagamos { padding-top: 0; }
/* Filtro Desde / hasta: juntos y del ancho justo para una fecha */
.rango-fechas { display: inline-flex; align-items: center; gap: 8px; flex-wrap: nowrap; }
.rango-fechas span { font-size: 13.5px; color: var(--suave); }
.rango-fechas input[type=date] { width: 148px; margin: 0; padding-left: 10px; padding-right: 8px; }
.acciones input[type=date] { width: 148px; }
.cc-filtros { align-items: center; }
.cc-filtros .chk-linea { padding-bottom: 0; }

/* PDF e impresión: nada se sale del ancho de la hoja (aunque la letra salga más ancha en otra PC) */
.op-hoja.pdf { width: 100%; box-sizing: border-box; }
.op-hoja.pdf .op-membrete { grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr) minmax(0, .9fr); gap: 10px; }
.op-hoja.pdf .op-inst, .op-hoja.pdf .op-datos-doc { white-space: normal; min-width: 0; }
.op-hoja.pdf .op-inst > div { min-width: 0; overflow-wrap: anywhere; }
.op-hoja.pdf .op-titulo-doc { white-space: normal; font-size: 19px; letter-spacing: .05em; line-height: 1.2; }
.op-hoja.pdf table { table-layout: fixed; width: 100%; }
.op-hoja.pdf .cc-tabla th:nth-child(1) { width: 15%; } .op-hoja.pdf .cc-tabla th:nth-child(2) { width: 15%; } .op-hoja.pdf .cc-tabla th:nth-child(3) { width: 11%; }
.op-hoja.pdf .cc-tabla .n { white-space: nowrap; }
.op-hoja.pdf .cc-totales > div { min-width: 0; }
@media print {
  .op-membrete { grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr) minmax(0, .9fr) !important; gap: 10px !important; }
  .op-inst, .op-datos-doc, .op-titulo-doc { white-space: normal !important; min-width: 0; }
  .op-titulo-doc { line-height: 1.2; }
}
.op-hoja.pdf .cc-tabla th:nth-child(1) { width: 13%; } .op-hoja.pdf .cc-tabla th:nth-child(2) { width: 15%; } .op-hoja.pdf .cc-tabla th:nth-child(3) { width: 10%; }
.op-hoja.pdf .cc-tabla th:nth-child(4), .op-hoja.pdf .cc-tabla th:nth-child(5) { width: 11%; } .op-hoja.pdf .cc-tabla th:nth-child(6) { width: 12%; }
.op-hoja.pdf .cc-tabla th.cc-col-com { width: 28%; }
.op-hoja.pdf .cc-com { overflow-wrap: anywhere; }
.op-hoja.pdf .cc-contado, .op-hoja.pdf .cc-contado { display: block; width: fit-content; margin-top: 2px; }
@media print { .cc-contado { display: block; width: fit-content; margin-top: 1px; } .cc-com { overflow-wrap: anywhere; } }

/* Ver comprobante: impresión prolija en una hoja (sin botones ni formulario de pago) */
@media print {
  @page { size: A4; margin: 16mm 14mm; }
  .hoja.ver-comp { border: 0; box-shadow: none; padding: 0; max-width: none; }
  .ver-pagos { border: 0 !important; box-shadow: none !important; padding: 0 !important; margin-top: 14px !important; break-inside: avoid; }
  .ver-pagos .tabla-wrap { overflow: visible; }
  .ver-pagos table, .hoja.ver-comp table { width: 100%; font-size: 11px; }
  .ver-pagos th, .ver-pagos td, .hoja.ver-comp th, .hoja.ver-comp td { padding: 5px 6px; }
  .hoja.ver-comp .totales-comp > div { border-color: #999; }
  .hoja.ver-comp .totales-comp .grande { background: none !important; color: var(--texto) !important; border: 2px solid var(--texto) !important; }
  .chip { border: 1px solid #999; background: none !important; }
}

/* Proveedores: botones de ícono por fila (cuenta corriente, suspender/reactivar, editar) con cartelito al pasar el mouse */
.acciones-fila { white-space: nowrap; }
.acciones-fila > * { vertical-align: middle; }
.btn-ico { display: inline-grid; place-items: center; width: 32px; height: 30px; padding: 0; vertical-align: middle; border: 1px solid var(--borde-2); border-radius: 8px; background: #fff; color: #44516a; cursor: pointer; text-decoration: none; }
.btn-ico:hover { background: var(--primario-bg); border-color: var(--primario); color: var(--primario); }
.btn-ico.cta { color: var(--primario); border-color: #bcd0ee; }
.btn-ico.cta:hover { background: var(--primario); border-color: var(--primario); color: #fff; }
.btn-ico.susp { color: #b45309; border-color: #f1d3a6; }
.btn-ico.susp:hover { background: #b45309; border-color: #b45309; color: #fff; }
.btn-ico.react { color: var(--ok); border-color: #b7e0c8; }
.btn-ico.react:hover { background: var(--ok); border-color: var(--ok); color: #fff; }
[data-tip] { position: relative; }
[data-tip]::after { content: attr(data-tip); position: absolute; bottom: calc(100% + 7px); left: 50%; transform: translate(-50%, 4px); padding: 5px 9px; border-radius: 6px; background: #18212f; color: #fff; font-size: 12px; font-weight: 500; line-height: 1.3; white-space: nowrap; pointer-events: none; opacity: 0; transition: opacity .12s, transform .12s; z-index: 30; }
[data-tip]:hover::after, [data-tip]:focus-visible::after { opacity: 1; transform: translate(-50%, 0); }
.acciones-fila .tip-envoltura[data-tip]::after { left: auto; right: 0; transform: translate(0, 4px); }
.acciones-fila .tip-envoltura[data-tip]:hover::after { transform: translate(0, 0); }
.tip-envoltura { display: inline-block; vertical-align: middle; }
/* Ayuda: íconos chiquitos iguales a los de la fila */
.ico-ayuda { display: inline-grid; place-items: center; width: 24px; height: 22px; vertical-align: -6px; border: 1px solid var(--borde-2); border-radius: 6px; background: #fff; color: #44516a; }
.ico-ayuda svg { width: 14px; height: 14px; }
.ico-ayuda.cta { color: var(--primario); } .ico-ayuda.susp { color: #b45309; } .ico-ayuda.react { color: var(--ok); }
/* Ficha de solo lectura del proveedor */
.dlg-ficha .dlg-cab h2 { display: flex; align-items: center; gap: 10px; }
.fi-dato { display: flex; flex-direction: column; gap: 2px; padding: 9px 12px; border-radius: 8px; background: #f6f8fb; min-width: 0; }
.fi-dato > span { font-size: 12px; color: var(--suave); text-transform: uppercase; letter-spacing: .03em; }
.fi-dato > strong { font-weight: 500; overflow-wrap: anywhere; }
.ver-ficha { cursor: pointer; }

/* Editar comprobante (lápiz de la cuenta corriente): mismo formulario de la carga, con lo no editable en gris */
.aviso-edicion { background: #fffbea; border: 1px solid #e7c56a; border-radius: 10px; padding: 12px 16px; margin: 0 0 16px; font-size: 14.5px; }
.modo-editar #razon, .modo-editar .numero-comp input, .modo-editar textarea[readonly],
.modo-editar.imp-bloq #trub input, .modo-editar.imp-bloq #timp input, .modo-editar.imp-bloq #iva-imp { background: #f1f3f6; color: #4b5563; cursor: not-allowed; }
.modo-editar #tipos button:disabled, .modo-editar #tipo-mas:disabled, .modo-editar #iva-alic:disabled { cursor: not-allowed; opacity: .55; }
.modo-editar #tipos button.activo:disabled { opacity: 1; }
.ed-forma { display: flex; flex-direction: column; gap: 2px; padding: 10px 0 4px; border-top: 1px solid var(--borde); margin-top: 8px; font-size: 14px; }
.ed-forma .suave { font-size: 12.5px; }
.ed-pagado { display: inline-block; margin-top: 4px; align-self: flex-start; background: #e8f6ee; color: #17703f; border-radius: 999px; padding: 2px 10px; font-size: 12.5px; font-weight: 600; }
a.btn-lapiz { text-decoration: none; }

/* Cargar pagos: varias formas de pago en una orden */
.medio-fila { border: 1px solid var(--borde-2); border-radius: 10px; padding: 10px; margin: 6px 0 8px; background: #fff; }
.medio-fila select { margin: 0 0 8px; }
.medio-linea { display: grid; grid-template-columns: 120px minmax(0, 1fr) auto; gap: 6px; align-items: center; }
.medio-linea input { margin: 0; }
.medio-linea .m-imp[readonly] { background: #f6f8fa; }
.medio-fila .m-medio { display: block; margin-top: 6px; font-size: 12px; }
.medios-falta { background: var(--error-bg, #fdecec); color: var(--error, #b42318); border-radius: 8px; padding: 7px 10px; font-size: 13.5px; font-weight: 600; margin: 4px 0 10px; }
.op-formas-tit { font-size: 15px; margin: 18px 0 6px; }
.op-formas { margin-bottom: 8px; }

/* Cuenta corriente: toda la tarjeta del comprobante es clickeable (pendiente = cargar el pago; pagado = ver) */
.comp-fila { position: relative; cursor: pointer; }
.comp-fila .cf-link { position: absolute; inset: 0; border-radius: inherit; z-index: 1; }
.comp-fila .cf-link:focus-visible { outline: 3px solid var(--primario); outline-offset: 2px; }
.comp-fila:hover { border-color: var(--primario); box-shadow: 0 0 0 3px rgba(37, 87, 167, .14), var(--sombra); }
.comp-fila .cf-ver { position: relative; z-index: 2; font-size: 13px; }
.comp-fila .cf-accion { font-size: 13px; font-weight: 600; color: var(--primario); white-space: nowrap; opacity: 0; transition: opacity .15s; }
.comp-fila:hover .cf-accion { opacity: 1; }
@media (hover: none) { .comp-fila .cf-accion { opacity: 1; } }
@media (min-width: 801px) { .lista-comp .comp-fila { grid-template-columns: minmax(0, 1fr) 190px 130px 130px; } }
/* Lo que se le debe: en pantallas medianas no se pisan Comprobante y Fecha (se oculta la fecha del comprobante, queda el vencimiento) */
@media (min-width: 801px) and (max-width: 1440px) {
  .op-fila { grid-template-columns: 22px minmax(0, 1fr) 86px 118px 120px; gap: 10px; }
  .op-fila:not(.op-pie) > :nth-child(3) { display: none; }
  .op-pie > span[style] { grid-column: 2 / 4 !important; }
  .op-fila .pf-imp input { width: 100%; }
}
.op-comentario { margin: 14px 0 0; padding: 10px 12px; border-left: 3px solid var(--borde-2); background: #f8fafc; font-size: 14px; }
@media print { .op-comentario { background: none; } }
