/* ==========================================================================
   LIQUIDACION A PROVEEDOR
   Estilos de las tres pantallas del modulo. Todas las clases llevan prefijo
   propio para no tocar otras pantallas (este archivo se carga en todas):
     pp-   / .tabla-pago-proveedor / .tabla-gastos   -> PAGO A PROVEEDOR
     lqp-                                            -> LIQUIDACIONES (historial)
     lq-  / mp- / #modalPagoLiquidacion              -> panel y modal REGISTRAR PAGO
   ========================================================================== */


/* ==========================================================================
   1. PAGO A PROVEEDOR (reporte-pagoproveedor.php)
   ========================================================================== */
/* ---- Tarjetas de resumen ---- */
.pp-cards {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 10px 0 14px 0;
}

.pp-card {
  flex: 1 1 150px;
  background: #fff;
  border: 1px solid #dde3f0;
  border-radius: 6px;
  padding: 8px 12px;
}

.pp-card-lbl {
  display: block;
  font-size: 10.5px;
  font-weight: bold;
  color: #7a869a;
  letter-spacing: 0.6px;
}

.pp-card-val {
  display: block;
  font-size: 22px;
  font-weight: bold;
  color: #1a202c;
  line-height: 1.2;
}

/* La tarjeta del pago es la que el usuario busca primero. */
.pp-card-fuerte {
  background: #F2FAF1;
}

.pp-card-fuerte .pp-card-val {
  color: #347F2F;
}

/* ---- Detalle ---- */
.pp-tabla-wrap {
  /* Alta segun la pantalla (antes 340px fijos: se veia "chata"). */
  max-height: calc(100vh - 220px);
  overflow: auto;
  border: 1px solid #ddd;
  border-radius: 4px;
}

/* En INTERNO la tabla llega a 21 columnas, asi que se compacta en vez de
   dejarla crecer a lo ancho (mismo criterio que DETALLE GENERAL). */
.tabla-pago-proveedor {
  margin: 0;
  font-size: 12.5px;
}

.tabla-pago-proveedor thead th {
  text-align: center;
  vertical-align: middle !important;
  white-space: nowrap;
  font-size: 11px;
  letter-spacing: 0.2px;
  border: none;
  padding: 7px 8px !important;
}

/* Cabecera de grupo (JABA / CANASTILLA / AZUL / PAGO) */
.tabla-pago-proveedor thead th.dg-grupo,
.tabla-pago-proveedor thead th.dg-fijo {
  background: #1f2937;           /* mismo fondo que la tabla de Acopio */
  color: #fff;
  font-weight: 600;
  letter-spacing: .4px;
  border-bottom: 1px solid #e5e7eb;
}

/* Las dos filas de cabecera quedan fijas al hacer scroll vertical. */
.tabla-pago-proveedor thead th {
  position: sticky;
  z-index: 2;
}

.tabla-pago-proveedor thead tr:first-child th { top: 0; height: 32px; }
.tabla-pago-proveedor thead tr:nth-child(2) th { top: 32px; }

/* Los th de la segunda fila no llevan clase de grupo: gris claro, como
   la segunda fila de Acopio. */
.tabla-pago-proveedor thead tr:nth-child(2) th {
  background: #f3f4f6;
  color: #374151;
  font-weight: 600;
  border-bottom: 1px solid #e5e7eb;
}

/* Linea divisoria entre bloques, para saltar de grupo en grupo sin leer
   cada encabezado. */
.tabla-pago-proveedor th.dg-sep,
.tabla-pago-proveedor td.dg-sep {
  border-left: 1px solid #d5d9e2 !important;
}

.tabla-pago-proveedor tbody td {
  padding: 8px 8px !important;
  white-space: nowrap;
  vertical-align: middle;
  border-color: #f0f1f4 !important;
}

/* Filas alternadas y hover, como Acopio. */
.tabla-pago-proveedor tbody tr:nth-child(even) > td { background: #fafbfc; }
.tabla-pago-proveedor tbody tr:hover > td { background: #f2f5ff; }

/* Los ceros van como guion tenue: en un EXTERNO todo el bloque CANASTILLA
   iria en cero y llenarlo de "0.000" solo agrega ruido. */
.tabla-pago-proveedor td .dg-cero {
  color: #c2c2c2;
}

.tabla-pago-proveedor .pp-fila-total > td {
  font-weight: 700;
  color: #1f2937;
  background: #eef2ff !important;
  border-top: 2px solid #143DD4 !important;
}

/* ---- Gastos ---- */
.pp-gastos-caja {
  margin-top: 18px;
  border: 1px solid #dde3f0;
  border-radius: 6px;
  overflow: hidden;
}

.pp-gastos-cab {
  background: #eef1f6;
  color: #1f2937;
  padding: 7px 12px;
  font-size: 12px;
  font-weight: bold;
  letter-spacing: 0.5px;
}

.tabla-gastos {
  margin: 0;
  font-size: 12.5px;
  width: 100%;
}

.tabla-gastos thead th {
  background: #f3f5fa;
  color: #4a5568;
  font-size: 10.5px;
  letter-spacing: 0.3px;
  padding: 5px 8px;
  border-bottom: 1px solid #dde3f0;
}

.tabla-gastos td {
  padding: 4px 8px;
  border-bottom: 1px solid #eef0f5;
  vertical-align: middle;
}

.tabla-gastos input {
  width: 100%;
  border: 1px solid #cdd5e5;
  border-radius: 3px;
  padding: 3px 6px;
  font-size: 12.5px;
}

.tabla-gastos input:focus {
  border-color: #143DD4;
  outline: none;
}

/* Cantidad que viene del reporte: se muestra pero no se teclea. */
.tabla-gastos input[readonly] {
  background: #f7f8fa;
  color: #7a869a;
  cursor: not-allowed;
}

.pp-col-num  { width: 110px; }
.pp-col-sub  { width: 120px; text-align: right; font-weight: bold; }
.pp-col-quit { width: 40px;  text-align: center; }

.pp-gasto-fijo .pp-col-quit { color: #cbd2e0; }

/* ---- Pie ---- */
.pp-resumen-final {
  margin-top: 14px;
  margin-bottom: 20px;
  border: 1px solid #c7d2fe;
  border-radius: 6px;
  overflow: hidden;
}

.pp-linea {
  display: flex;
  justify-content: space-between;
  padding: 7px 14px;
  font-size: 14px;
  border-bottom: 1px solid #eef0f5;
}

.pp-linea-lbl { color: #4a5568; }
.pp-linea-val { font-weight: bold; }

.pp-linea-resta .pp-linea-val { color: #C0392B; }

.pp-linea-neto {
  background: #eef2ff;
  color: #1e3a8a;
  font-size: 19px;
  font-weight: bold;
  border-bottom: none;
  padding: 11px 14px;
}

.pp-linea-neto .pp-linea-lbl { color: #1e3a8a; }

/* Aviso de periodo ya liquidado */
.lq-alerta-solape {
  text-align: left;
  font-size: 13px;
}

.lq-alerta-solape table {
  width: 100%;
  margin-top: 8px;
  font-size: 12px;
}

.lq-alerta-solape th {
  background: #f3f5fa;
  padding: 4px 6px;
  text-align: left;
}

.lq-alerta-solape td {
  padding: 4px 6px;
  border-bottom: 1px solid #eef0f5;
}

@media (max-width: 767px) {
  .pp-card-val { font-size: 18px; }
  .pp-linea-neto { font-size: 16px; }
}


/* ==========================================================================
   2. LIQUIDACIONES - historial (reporte-liquidaciones.php)
   ========================================================================== */
/* Mismo lenguaje que COMPRA A PROVEEDOR: azul para acciones, gris para
   todo lo demas y color solo donde el numero significa algo. */
.lqp {
  --lq-azul:  #143DD4;
  --lq-tinta: #1f2937;
  --lq-gris:  #6b7280;
  --lq-linea: #e5e7eb;
  --lq-fondo: #f6f7fa;
  color: var(--lq-tinta);
}

.lqp-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  flex-wrap: wrap;
  gap: 12px;
  padding: 4px 2px 14px 2px;
  border-bottom: 1px solid var(--lq-linea);
  margin-bottom: 14px;
}

.lqp-top h2 { margin: 0; font-size: 22px; font-weight: 700; color: var(--lq-tinta); }
.lqp-top p  { margin: 2px 0 0 0; font-size: 12.5px; color: var(--lq-gris); }

.lqp-top .btn { height: 36px; line-height: 36px; padding: 0 16px; font-weight: 600; border-radius: 4px; }

.lqp-btn-nueva { background: var(--lq-azul); border-color: var(--lq-azul); color: #fff; }
.lqp-btn-nueva:hover, .lqp-btn-nueva:focus { background: #0f2a9e; color: #fff; }

/* Filtros */
.lqp-filtros {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 10px;
  background: var(--lq-fondo);
  border: 1px solid var(--lq-linea);
  border-radius: 6px;
  padding: 10px 12px;
  margin-bottom: 14px;
}

.lqp-f { display: flex; flex-direction: column; }
.lqp-f-prod  { flex: 1 1 260px; max-width: 360px; }
.lqp-f-est   { flex: 0 1 160px; }
.lqp-f-fecha { flex: 0 1 140px; }

.lqp-f label { font-size: 11px; font-weight: 600; color: var(--lq-gris); margin-bottom: 3px; }

.lqp .lqp-f .form-control {
  height: 34px !important;
  border: 1px solid #d1d5db !important;
  border-radius: 4px !important;
  box-shadow: none !important;
  font-weight: 600;
}

.lqp .lqp-f .form-control:focus { border-color: var(--lq-azul) !important; }

.lqp-botones { display: flex; gap: 6px; }
.lqp-botones .btn { height: 34px; border-radius: 4px; font-weight: 600; }

.lqp-btn-buscar { background: var(--lq-tinta); color: #fff; border: none; padding: 0 16px; }
.lqp-btn-buscar:hover, .lqp-btn-buscar:focus { background: #000; color: #fff; }

.lqp-btn-quitar { background: #fff; color: var(--lq-gris); border: 1px solid #d1d5db; }

/* Resumen */
.lqp-kpis {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 14px;
}

.lqp-kpi {
  background: #fff;
  border: 1px solid var(--lq-linea);
  border-radius: 8px;
  padding: 12px 16px;
}

.lqp-kpi span {
  display: block;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .5px;
  color: var(--lq-gris);
}

.lqp-kpi b {
  display: block;
  margin-top: 2px;
  font-size: 24px;
  font-weight: 700;
  color: var(--lq-tinta);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.lqp-kpi b small { font-size: 13px; font-weight: 600; color: var(--lq-gris); margin-right: 3px; }
.lqp-kpi em { display: block; font-style: normal; font-size: 12px; color: var(--lq-gris); }

.lqp-kpi.saldo { background: #fff8ec; border-color: #f5d9a8; }
.lqp-kpi.saldo b { color: #b45309; }

/* Tabla */
.lqp-tabla-wrap {
  max-height: 460px;
  overflow: auto;
  border: 1px solid var(--lq-linea);
  border-radius: 6px;
}

.lqp-tabla {
  width: 100%;
  margin: 0;
  font-size: 13.5px;
  font-variant-numeric: tabular-nums;
}

.lqp-tabla thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #f3f4f6;
  border-bottom: 1px solid var(--lq-linea);
  padding: 8px 10px;
  font-size: 10.5px;
  font-weight: 600;
  color: #4b5563;
  text-transform: uppercase;
  line-height: 1.25;
  white-space: nowrap;
  text-align: left;
}

.lqp-tabla thead th.n { text-align: right; }

.lqp-tabla td {
  padding: 9px 10px;
  border-top: 1px solid #f0f1f4;
  vertical-align: middle;
  white-space: nowrap;
  color: #374151;
}

.lqp-tabla tbody tr:hover td { background: #f8f9fc; }
.lqp-tabla tr.anulada td { color: #9ca3af; }

.lqp-tabla .n { text-align: right; }
.lqp-tabla .num  { font-weight: 700; color: var(--lq-tinta); }
.lqp-tabla .lqp-prod { font-weight: 600; color: var(--lq-tinta); }
.lqp-tabla .neto { font-weight: 700; color: var(--lq-tinta); }
.lqp-tabla .saldo-pend { font-weight: 700; color: #b45309; }
.lqp-tabla .saldo-ok   { font-weight: 700; color: #15803d; }
.lqp-tabla .menos      { color: #6b7280; }
.lqp-tabla tr.anulada .num,
.lqp-tabla tr.anulada .prod,
.lqp-tabla tr.anulada .neto { color: #9ca3af; }

.lqp-tabla tfoot td {
  position: sticky;
  bottom: 0;
  background: #fff;
  border-top: 2px solid var(--lq-tinta);
  font-weight: 700;
  color: var(--lq-tinta);
  font-size: 14px;
}

.lqp-btn-ver {
  border: 1px solid #d1d5db;
  background: #fff;
  color: #374151;
  border-radius: 4px;
  padding: 3px 10px;
  font-size: 12px;
  font-weight: 600;
}

.lqp-btn-ver:hover { border-color: var(--lq-azul); color: var(--lq-azul); }

/* Fila abierta en el panel */
.lqp-tabla tr.abierta td { background: #eef2ff !important; }

.pp-aviso {
  background: var(--lq-fondo);
  border: 1px dashed #d1d5db;
  color: #4b5563;
  font-size: 13px;
  padding: 18px 16px;
  border-radius: 6px;
  margin: 6px 0;
  text-align: center;
}

@media (max-width: 991px) {
  .lqp-kpis { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 767px) {
  .lqp-f-prod { max-width: none; flex-basis: 100%; }
  .lqp-f-est, .lqp-f-fecha { flex: 1 1 45%; }
  .lqp-botones { width: 100%; }
  .lqp-botones .btn { flex: 1; }
}


/* ==========================================================================
   3. PANEL DE LA LIQUIDACION y MODAL REGISTRAR PAGO (liquidacion-pago.php)
      Los usan las dos pantallas anteriores.
   ========================================================================== */
/* ================= PANEL DE LA LIQUIDACION ================= */
.lq-panel {
  margin: 18px 0 22px 0;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  background: #fff;
  overflow: hidden;
}

#ppContenidoPanel { padding: 18px 20px 6px 20px; }

.lq-cab {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 14px;
}

.lq-cab-num { font-size: 18px; font-weight: 700; color: #1f2937; }
.lq-cab-sub { font-size: 12.5px; color: #6b7280; margin-top: 3px; }

.lq-cab-saldo { text-align: right; }

.lq-cab-saldo span {
  display: block;
  font-size: 11px;
  font-weight: 600;
  color: #6b7280;
}

.lq-cab-saldo b {
  display: block;
  font-size: 26px;
  font-weight: 700;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}

.lq-cab-saldo b.pend { color: #b45309; }
.lq-cab-saldo b.ok   { color: #15803d; }

/* Estado: texto con un punto de color, sin etiqueta pesada */
.lq-estado {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-left: 8px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .4px;
  vertical-align: 3px;
}

.lq-estado:before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: currentColor;
}

.lq-est-pend { color: #b45309; }
.lq-est-parc { color: #1d4ed8; }
.lq-est-pag  { color: #15803d; }
.lq-est-anu  { color: #9ca3af; }

.lq-cifras {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border: 1px solid #e5e7eb;
  border-radius: 6px;
}

.lq-cifras > div { padding: 9px 14px; border-left: 1px solid #e5e7eb; }
.lq-cifras > div:first-child { border-left: none; }

.lq-cifras span { display: block; font-size: 11px; font-weight: 600; color: #6b7280; }

.lq-cifras b {
  display: block;
  font-size: 18px;
  font-weight: 700;
  color: #1f2937;
  font-variant-numeric: tabular-nums;
}

.lq-cifras b.ok { color: #15803d; }

.lq-avance { display: flex; align-items: center; gap: 10px; margin: 10px 0 18px 0; }
.lq-barra { flex: 1; height: 6px; border-radius: 3px; background: #e5e7eb; overflow: hidden; }
.lq-barra div { height: 100%; background: #15803d; }
.lq-avance span { font-size: 12px; color: #6b7280; white-space: nowrap; }

.lq-sec-tit {
  margin: 4px 0 8px 0;
  font-size: 11.5px;
  font-weight: 700;
  color: #4b5563;
  text-transform: uppercase;
  letter-spacing: .4px;
}

.lq-tabla {
  width: 100%;
  margin-bottom: 16px;
  font-size: 13px;
  font-variant-numeric: tabular-nums;
  border: 1px solid #e5e7eb;
}

.lq-tabla thead th {
  background: #f3f4f6;
  padding: 7px 10px;
  font-size: 11px;
  font-weight: 600;
  color: #4b5563;
  text-transform: uppercase;
  border-bottom: 1px solid #e5e7eb;
  white-space: nowrap;
}

.lq-tabla td { padding: 8px 10px; border-top: 1px solid #f0f1f4; vertical-align: middle; color: #374151; }

.lq-tabla .n { text-align: right; }
.lq-tabla .lq-obs { max-width: 260px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lq-tabla .lq-gris { color: #9ca3af; }
.lq-tabla .lq-vacio { text-align: center; color: #9ca3af; padding: 16px; }

.lq-tabla .lq-total td { border-top: 2px solid #1f2937; font-weight: 700; color: #1f2937; }

.lq-acc { text-align: right; white-space: nowrap; }

.lq-acc .btn {
  border: 1px solid #d1d5db;
  background: #fff;
  color: #4b5563;
  border-radius: 3px;
  padding: 2px 7px;
  margin-left: 3px;
}

.lq-acc .btnImprimirReciboLiq:hover { border-color: #143DD4; color: #143DD4; }
.lq-acc .btnEliminarPagoLiq:hover   { border-color: #b91c1c; color: #b91c1c; }

.lq-acciones {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  padding: 12px 20px;
  background: #f9fafb;
  border-top: 1px solid #e5e7eb;
}

.lq-acciones .btn { height: 34px; padding: 0 14px; font-weight: 600; border-radius: 4px; }

/* ================= MODAL REGISTRAR PAGO =================
   Dos columnas: el formulario a la izquierda y, a la derecha, el resumen
   del pago (como un comprobante) con el boton de confirmar al pie. */
#modalPagoLiquidacion .modal-dialog { width: 780px; max-width: calc(100% - 20px); }

#modalPagoLiquidacion .modal-content {
  border: none;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 20px 50px -12px rgba(15, 23, 42, .35);
}

#modalPagoLiquidacion .modal-body { padding: 0; }

.mp-wrap { display: flex; min-height: 420px; }

/* ---- Formulario ---- */
.mp-form { flex: 1 1 auto; min-width: 0; padding: 22px 26px 18px 26px; }

.mp-form-cab {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.mp-form-cab h4 { margin: 0; font-size: 19px; font-weight: 700; color: #111827; }

.mp-cerrar {
  border: none;
  background: none;
  font-size: 22px;
  line-height: 1;
  color: #9ca3af;
  cursor: pointer;
  padding: 0 2px;
}

.mp-cerrar:hover { color: #111827; }

.mp-f { margin-bottom: 18px; }

.mp-lbl {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 6px;
}

.mp-lbl label, .mp-f > label {
  display: block;
  margin: 0 0 6px 0;
  font-size: 12px;
  font-weight: 600;
  color: #374151;
}

.mp-lbl label { margin: 0; }

.mp-todo {
  border: none;
  background: none;
  padding: 0;
  font-size: 12px;
  font-weight: 600;
  color: #143DD4;
  cursor: pointer;
}

.mp-todo:hover { text-decoration: underline; }

/* Monto: grande, sin caja pesada, linea inferior */
.mp-monto {
  display: flex;
  align-items: baseline;
  gap: 8px;
  border-bottom: 2px solid #e5e7eb;
  padding-bottom: 4px;
  transition: border-color .15s ease;
}

.mp-monto:focus-within { border-color: #143DD4; }
.mp-monto.error { border-color: #dc2626; }

.mp-monto span { font-size: 20px; font-weight: 600; color: #9ca3af; }

#modalPagoLiquidacion .mp-monto input {
  flex: 1;
  min-width: 0;
  border: none;
  outline: none;
  background: transparent;
  padding: 0;
  height: 46px;
  font-size: 34px;
  font-weight: 700;
  color: #111827;
  font-variant-numeric: tabular-nums;
}

.mp-monto.error input { color: #b91c1c !important; }

/* Formas de pago: los botones de RECIBOS (btn-pago, img-boton) */
.mp-formas { display: flex; flex-wrap: wrap; gap: 8px; }

.mp-formas .btn-pago {
  margin: 0;
  width: 74px;
  height: 52px;
  background: #fff;
  border: 2px solid #e5e7eb !important;
  border-radius: 8px !important;
  transition: border-color .12s ease, box-shadow .12s ease;
}

.mp-formas .btn-pago:hover { transform: none; border-color: #cbd5e1 !important; }
.mp-formas .btn-pago.activa { border-color: #143DD4 !important; box-shadow: 0 0 0 3px rgba(20, 61, 212, .15); }
.mp-formas .texto-boton { font-size: 11px; color: #374151; }

.mp-fila { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }

#modalPagoLiquidacion .mp-f .form-control {
  height: 40px !important;
  border: 1px solid #d1d5db !important;
  border-radius: 6px !important;
  box-shadow: none !important;
  font-weight: 600;
  color: #111827;
}

#modalPagoLiquidacion .mp-f .form-control:focus {
  border-color: #143DD4 !important;
  box-shadow: 0 0 0 3px rgba(20, 61, 212, .12) !important;
}

/* ---- Resumen ---- */
.mp-res {
  flex: 0 0 290px;
  display: flex;
  flex-direction: column;
  background: #f8fafc;
  border-left: 1px solid #e5e7eb;
  padding: 22px 22px 18px 22px;
}

.mp-res-tit {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .8px;
  text-transform: uppercase;
  color: #6b7280;
  margin-bottom: 14px;
}

.mp-res-prov { font-size: 16px; font-weight: 700; color: #111827; line-height: 1.25; }

.mp-res-det { margin-top: 4px; font-size: 12.5px; color: #6b7280; line-height: 1.5; }

.mp-res-cuenta { margin-top: 22px; border-top: 1px solid #e5e7eb; padding-top: 12px; }

.mp-res-linea {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 5px 0;
  font-size: 13px;
  color: #4b5563;
  font-variant-numeric: tabular-nums;
}

.mp-res-linea b { font-weight: 600; color: #111827; }
.mp-res-linea.pago b { color: #143DD4; }

.mp-res-final {
  margin-top: 8px;
  padding-top: 10px;
  border-top: 1px dashed #cbd5e1;
}

.mp-res-final span { font-weight: 700; color: #111827; }
.mp-res-final b { font-size: 20px; font-weight: 700; color: #b45309; }
.mp-res-final.cero b { color: #15803d; }
.mp-res-final.error b { color: #b91c1c; }

.mp-res-pie { margin-top: auto; padding-top: 20px; }

.mp-btn-guardar {
  display: block;
  width: 100%;
  height: 44px;
  border: none;
  border-radius: 6px;
  background: #143DD4;
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  transition: background .15s ease;
}

.mp-btn-guardar:hover { background: #0f2a9e; color: #fff; }
.mp-btn-guardar:disabled { background: #93a3e8; }

.mp-btn-cancelar {
  display: block;
  width: 100%;
  margin-top: 8px;
  border: none;
  background: none;
  font-size: 13px;
  font-weight: 600;
  color: #6b7280;
  padding: 6px 0;
}

.mp-btn-cancelar:hover { color: #111827; }

@media (max-width: 767px) {
  .lq-cab-saldo { text-align: left; }
  .lq-cifras { grid-template-columns: 1fr 1fr; }
  .lq-cifras > div:nth-child(3) { border-left: none; }
  .lq-cifras > div:nth-child(n+3) { border-top: 1px solid #e5e7eb; }
  .mp-wrap { flex-direction: column; min-height: 0; }
  .mp-res { flex: 1 1 auto; border-left: none; border-top: 1px solid #e5e7eb; }
  .mp-fila { grid-template-columns: 1fr; gap: 0; }
  .mp-form { padding: 18px 18px 6px 18px; }
}

/* ===================== SALDO A FAVOR DEL PROVEEDOR =====================
   Recuadro del panel de la liquidacion (liquidacion.ajax.php, ajaxPanelPagos):
   lo que el proveedor tiene a favor y el boton para aplicarlo como pago. */
.lq-saldo-favor {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin: 10px 0 4px;
  padding: 10px 14px;
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  border-radius: 8px;
}
.lq-saldo-favor .lq-sf-txt { display: flex; align-items: center; gap: 10px; }
.lq-saldo-favor .lq-sf-txt i { font-size: 20px; color: #15803d; }
.lq-saldo-favor .lq-sf-txt span { display: block; font-size: 11.5px; color: #166534; font-weight: 600; }
.lq-saldo-favor .lq-sf-txt b { font-size: 18px; color: #15803d; }
.lq-saldo-favor .lq-sf-btn {
  background: #15803d;
  border-color: #15803d;
  color: #fff;
  font-weight: 700;
  border-radius: 4px;
}
.lq-saldo-favor .lq-sf-btn:hover { background: #116a32; color: #fff; }
.lq-saldo-favor .lq-sf-nota { font-size: 12px; color: #166534; }


/* Formas de pago del mismo tamaño que el INGRESO del POS (.ip-fp): sin
   esto, al agregar MULTI PAGO las imagenes se estiraban. */
.mp-formas { gap: 6px; }
.mp-formas .btn-pago {
  width: auto; min-width: 70px; height: 46px; padding: 4px 8px;
  border-radius: 6px !important; overflow: hidden;
  display: flex; align-items: center; justify-content: center;
}
.mp-formas .btn-pago img, .mp-formas .btn-pago .img-boton {
  width: auto !important; height: auto !important; max-height: 34px; max-width: 70px; object-fit: contain;
}
.mp-formas .btn-pago .texto-boton { font-size: 11px; font-weight: 700; color: #374151; }
.mp-multi-fila .mp-multi-fp img, .mp-multi-fila .mp-multi-fp .img-boton {
  width: auto !important; height: auto !important; max-height: 26px; max-width: 70px; object-fit: contain;
}

/* MULTIPAGO en REGISTRAR PAGO (liquidacion-pago.php) */
.mp-formas .mp-fp-multi { background: #F0FDF4; }
.mp-formas .mp-fp-multi .texto-boton { color: #15803d; font-weight: 700; line-height: 1.1; }
.mp-multi-on .mp-formas .mp-fp-multi { border-color: #143DD4 !important; box-shadow: 0 0 0 3px rgba(20, 61, 212, .15); }
.mp-multi-on .mp-formas .mp-fp { opacity: .45; }
.mp-multi-on .mp-formas .mp-fp.activa { border-color: #e5e7eb !important; box-shadow: none; }
.mp-multi { display: none; margin-top: 8px; border: 1px solid #e5e7eb; border-radius: 6px; padding: 8px 10px 6px; background: #FAFAFB; }
.mp-multi-on .mp-multi { display: block; }
.mp-multi-fila { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.mp-multi-fila .mp-multi-fp { width: 78px; flex: none; font-size: 11.5px; font-weight: 700; color: #374151; }
.mp-multi-fila .mp-multi-fp img { max-height: 26px; max-width: 70px; }
.mp-multi-fila .form-control { height: 32px; }
.mp-multi-fila .mp-multi-monto { width: 110px; flex: none; text-align: right; font-weight: 700; color: #15803d; }
.mp-multi-fila .mp-multi-nro { flex: 1; min-width: 0; font-size: 12px; }
.mp-multi-resumen { font-size: 12px; text-align: right; color: #6b7280; padding-top: 2px; }
.mp-multi-resumen b.falta { color: #b91c1c; }
.mp-multi-resumen b.ok { color: #15803d; }


/* PAGO A PROVEEDOR: estado de cada venta (pendiente / liquidada) */
.pp-est { display: inline-block; padding: 2px 7px; border-radius: 10px; font-size: 10.5px; font-weight: 700; white-space: nowrap; }
.pp-est-pend { background: #FEF3C7; color: #92400E; }
.pp-est-pag  { background: #DCFCE7; color: #166534; }
.pp-est-debe { background: #FEE2E2; color: #991B1B; }
.tabla-pago-proveedor tr.pp-fila-liq td { color: #9ca3af; }
.tabla-pago-proveedor tr.pp-fila-liq td .pp-est { opacity: 1; }

.pp-card.pp-card-liq { background: #F0FDF4; border-color: #BBF7D0; }
.pp-card.pp-card-liq .pp-card-lbl, .pp-card.pp-card-liq .pp-card-val { color: #166534; }
.tabla-pago-proveedor tr.pp-total-pend td:last-child { color: #347F2F; }
.tabla-pago-proveedor tr.pp-total-liq td { color: #6b7280; }


/* Boton EXCEL (mismo verde que Acopio) */
.pp-btn-excel, .lqp-btn-excel { background: #217346; border: none; color: #fff; font-weight: 600; }
.pp-btn-excel:hover, .pp-btn-excel:focus, .lqp-btn-excel:hover, .lqp-btn-excel:focus { background: #1D6F42; color: #fff; }
.lqp-btn-excel { padding: 0 14px; }


/* LIQUIDACIONES: lupa y su detalle */
.lqp-lupa { border: 0; background: transparent; color: #143DD4; padding: 0 0 0 4px; font-size: 11px; cursor: pointer; opacity: .65; }
.lqp-lupa:hover { opacity: 1; }
.lqp-tabla tr.anulada .lqp-lupa { color: #9ca3af; }
.lqd-popup .swal2-title { font-size: 20px; }
.lqd-sub { font-size: 12.5px; color: #6b7280; margin-bottom: 10px; }
.lqd-tabla { width: 100%; font-size: 12.5px; text-align: left; border-collapse: collapse; }
.lqd-tabla th { background: #f3f4f6; color: #4b5563; font-size: 10.5px; text-transform: uppercase; padding: 6px 8px; }
.lqd-tabla td { padding: 6px 8px; border-top: 1px solid #f0f1f4; }
.lqd-tabla .n { text-align: right; white-space: nowrap; }
.lqd-tabla .b { font-weight: 700; }
.lqd-lupa-pesos { border: 0; background: transparent; color: #143DD4; padding: 0 2px; margin-left: 4px; font-size: 11px; cursor: pointer; }
.lqd-lupa-pesos:hover { color: #0f2fa3; }
.lqd-pm-fondo { position: fixed; inset: 0; z-index: 100100; background: rgba(17, 24, 39, .35); display: flex; align-items: center; justify-content: center; padding: 16px; }
.lqd-pm { background: #fff; border-radius: 10px; box-shadow: 0 12px 32px rgba(0, 0, 0, .25); width: 100%; max-width: 420px; max-height: 85vh; overflow: auto; padding: 14px 16px 16px; }
.lqd-pm-cab { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 10px; }
.lqd-pm-cab b { display: block; font-size: 16px; color: #111827; }
.lqd-pm-cab span { font-size: 12px; color: #6b7280; }
.lqd-pm-cerrar { border: 0; background: transparent; font-size: 22px; line-height: 1; color: #6b7280; cursor: pointer; padding: 0 4px; }
.lqd-pm-cerrar:hover { color: #111827; }
.lqd-pm .lqd-tabla tfoot td { border-top: 1px solid #e5e7eb; }
.lqd-pm .lqd-tabla tfoot tr:first-child td { border-top: 2px solid #1f2937; }
.lqd-pm .lqd-tabla tfoot tr.lqd-pm-sec td { font-weight: 400; color: #6b7280; }
.lqd-tabla tfoot td { font-weight: 700; border-top: 2px solid #1f2937; }
.lqd-cards { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; margin-bottom: 12px; }
.lqd-cards div { background: #f8fafc; border: 1px solid #e5e7eb; border-radius: 6px; padding: 8px; text-align: center; }
.lqd-cards span { display: block; font-size: 10.5px; color: #6b7280; text-transform: uppercase; }
.lqd-cards b { font-size: 18px; color: #1f2937; }
@media (max-width: 600px) { .lqd-cards { grid-template-columns: repeat(2, 1fr); } }

.swal2-popup.lqd-popup { width: 860px !important; max-width: 95vw !important; }
.lqd-popup .swal2-html-container { overflow-x: auto; }


/* PAGO A PROVEEDOR: encabezado y filtros como Liquidaciones */
.lqp-btn-ver-hist { background: #fff; border: 1px solid #d1d5db; color: #374151; }
.lqp-btn-ver-hist:hover, .lqp-btn-ver-hist:focus { border-color: #143DD4; color: #143DD4; background: #fff; }
.lqp .lqp-filtros .lqp-f-prod { max-width: 420px; }

/* Guardar liquidacion: tarjeta con observacion y boton con el neto */
.pp-guardar {
  display: flex; flex-wrap: wrap; align-items: flex-end; gap: 16px;
  margin-top: 16px; padding: 14px 16px;
  background: #f8fafc; border: 1px solid #e5e7eb; border-radius: 8px;
}
.pp-guardar-obs { flex: 1 1 320px; }
.pp-guardar-obs label { display: block; font-size: 11.5px; font-weight: 700; color: #4b5563; margin-bottom: 4px; text-transform: uppercase; }
.pp-guardar-obs label small { font-weight: 400; text-transform: none; color: #9ca3af; }
.pp-guardar-obs .form-control { height: 40px !important; border: 1px solid #d1d5db !important; border-radius: 6px !important; box-shadow: none !important; }
.pp-guardar-accion { flex: 0 1 auto; display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
.pp-guardar-info { font-size: 12.5px; color: #6b7280; }
.pp-guardar-info b { color: #1f2937; }

.pp-btn-guardar {
  display: inline-flex; align-items: center; gap: 10px;
  height: 48px; padding: 0 20px; border: none; border-radius: 8px;
  background: #15803d; color: #fff; font-size: 15px; font-weight: 700;
  box-shadow: 0 6px 14px -6px rgba(21, 128, 61, .55);
  transition: background .15s ease, transform .1s ease;
}
.pp-btn-guardar:hover { background: #116a32; }
.pp-btn-guardar:active { transform: translateY(1px); }
.pp-btn-guardar .fas { font-size: 18px; }
.pp-btn-guardar .pp-btn-monto { background: rgba(255,255,255,.18); padding: 4px 10px; border-radius: 6px; font-variant-numeric: tabular-nums; }
.pp-btn-guardar.pp-neto-neg { background: #b91c1c; box-shadow: none; }
.pp-btn-guardar:disabled, .pp-btn-guardar.guardando { opacity: .65; cursor: wait; }

@media (max-width: 767px) {
  .pp-guardar-accion { align-items: stretch; width: 100%; }
  .pp-btn-guardar { justify-content: center; }
}

#contenedorDetalleGeneral.dg-ocultar-canast .dg-bloque-canast,
#contenedorDetalleGeneral.dg-ocultar-azul .dg-bloque-azul {
  display: none;
}

#contenedorDetalleGeneral a.dg-ver-pesadas { color: #143DD4; text-decoration: none; border-bottom: 1px dashed #143DD4; cursor: pointer; }
#contenedorDetalleGeneral a.dg-ver-pesadas:hover { border-bottom-style: solid; }

.ps-sub { display: block; margin-top: 3px; font-size: 12.5px; color: #4b5563; }
.ps-cuerpo { max-height: 52vh; overflow: auto; padding-bottom: 4px; }
.ps-grupo { padding: 16px 20px 10px 20px; }
.ps-grupo + .ps-grupo { border-top: 1px solid #eef0f4; }
.ps-grupo-tit { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; margin-bottom: 10px; }
.ps-grupo-tit b { display: block; font-size: 14px; font-weight: 700; color: #1f2937; }
.ps-grupo-tit span { display: block; font-size: 12px; color: #6b7280; margin-top: 1px; }
.ps-grupo-tit strong { font-size: 18px; font-weight: 700; color: #1e3a8a; white-space: nowrap; font-variant-numeric: tabular-nums; }
.ps-grupo-tit strong small { font-size: 12px; font-weight: 600; color: #6b7280; }
.ps-cuadro { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px; }
.ps-pesada { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border: 1px solid #e5e7eb; border-radius: 8px; background: #fafbfc; }
.ps-num { flex: 0 0 26px; height: 26px; line-height: 26px; border-radius: 50%; background: #e8edfb; color: #143DD4; font-size: 12px; font-weight: 700; text-align: center; }
.ps-peso { font-size: 12px; font-weight: 600; color: #6b7280; line-height: 1.2; }
.ps-peso b { font-size: 16px; font-weight: 700; color: #1f2937; font-variant-numeric: tabular-nums; }
.ps-peso small { display: block; font-size: 11px; font-weight: 400; color: #9ca3af; margin-top: 2px; }
.ps-difiere { margin-top: 8px; color: #b45309; font-size: 12px; }

@media (max-width: 600px) {
  .ps-grupo { padding: 12px 14px 8px 14px; }
  .ps-cuadro { grid-template-columns: repeat(2, 1fr); }
  .ps-grupo-tit strong { font-size: 16px; }
  .ps-resumen { flex-wrap: wrap; }
  .ps-resumen > div { flex: 1 1 50%; box-sizing: border-box; border-bottom: 1px solid #eef0f4; }
  .ps-resumen > div:nth-child(2n) { border-right: 0; }
  .ps-resumen > div:nth-child(n+3) { border-bottom: 0; }
}

/* ==========================================================================
   DETALLE GENERAL (reporte-detallegeneral.php)
   ========================================================================== */
/* Tabla densa: 23 columnas no entran comodas con el tamano por defecto,
   asi que se compacta tipografia y padding en vez de dejar que la tabla
   crezca a lo ancho. */
.tabla-detalle-general {
  font-size: 11.5px;
}

.tabla-detalle-general thead th {
  white-space: nowrap;
  text-align: center;
  vertical-align: middle !important;
  padding: 4px 6px !important;
  font-size: 10.5px;
  letter-spacing: 0.2px;
}

/* Cabecera de grupo (JABA / CANASTILLA / AZUL / VENTA / COSTO) */
.tabla-detalle-general thead th.dg-grupo {
  background: #143DD4;
  color: #fff;
  font-weight: 700;
  border-bottom: 2px solid #0f2a9e;
}

.tabla-detalle-general thead th.dg-fijo {
  background: #1a202c;
  color: #fff;
}

/* Linea divisoria entre bloques, para que la vista salte de grupo en
   grupo sin tener que leer cada encabezado. */
.tabla-detalle-general th.dg-sep,
.tabla-detalle-general td.dg-sep {
  border-left: 2px solid #b8c2d9 !important;
}

.tabla-detalle-general tbody td {
  padding: 3px 6px !important;
  white-space: nowrap;
}

/* Los ceros se ven como guion tenue: en una venta EXTERNO todo el bloque
   CANASTILLA va en cero y llenarlo de "0.000" solo agrega ruido. */
.tabla-detalle-general td .dg-cero {
  color: #c2c2c2;
}

.dg-lqp { margin-bottom: 4px; }
.dg-filtros .lqp-f-cli  { flex: 1 1 200px; max-width: 260px; }
.dg-filtros .lqp-f-prod { flex: 1 1 200px; max-width: 260px; }
.dg-filtros .lqp-f-prov { flex: 1 1 220px; max-width: 300px; }
.dg-filtros .lqp-f-est  { flex: 0 1 150px; }
.dg-filtros .lqp-f-filas { flex: 0 1 80px; }
.dg-botones { margin-left: auto; }
.dg-bloques { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin: 0 0 12px; font-size: 12px; }
.dg-bloques-tit { font-size: 11px; font-weight: 600; color: var(--lq-gris); margin-right: 4px; }
.dg-chip { display: inline-flex; align-items: center; gap: 6px; margin: 0; padding: 4px 10px; border: 1px solid #d1d5db; border-radius: 999px; background: #fff; font-weight: 600; cursor: pointer; }
.dg-chip input { margin: 0; }
.dg-chip:has(input:checked) { border-color: var(--lq-azul); color: var(--lq-azul); }
@media (max-width: 768px) {
  .dg-filtros .lqp-f-cli, .dg-filtros .lqp-f-prod, .dg-filtros .lqp-f-prov { max-width: none; flex-basis: 100%; }
  .dg-botones { margin-left: 0; width: 100%; }
}
