/**
 * Unifile — estilos globales de aplicación.
 * Barras de desplazamiento 12–14px en tablas, paneles y contenedores.
 */

html,
body,
* {
  scrollbar-width: auto;
  scrollbar-color: #64748b #e2e8f0;
}

*::-webkit-scrollbar {
  width: 13px;
  height: 13px;
}

*::-webkit-scrollbar-track {
  background: #e2e8f0;
  border-radius: 4px;
}

*::-webkit-scrollbar-thumb {
  background: #94a3b8;
  border-radius: 6px;
  border: 2px solid #e2e8f0;
  min-height: 32px;
}

*::-webkit-scrollbar-thumb:hover {
  background: #64748b;
}

*::-webkit-scrollbar-corner {
  background: #e2e8f0;
}

/* Nav lateral contable: estado activo (lime) */
.cxc-nav-btn.active {
  background: #a3e635 !important;
  color: #000 !important;
  font-weight: 700;
}

/* ESTILOS GLOBALES UNIFILE: Selects y Fechas Nativas */
select, input[type="date"], input[type="datetime-local"] {
  color-scheme: dark !important;
  background-color: #0f172a !important;
  color: #f8fafc !important;
  border: 1px solid #334155;
}
input[type="date"], input[type="datetime-local"] {
  min-width: 145px;
}
select:focus, input[type="date"]:focus, input[type="datetime-local"]:focus {
  border-color: #38bdf8 !important;
  outline: none;
}

/* Encabezados: sin resize nativo del browser (usar .col-resizer) */
.cxc-th,
thead th.cxc-th {
  resize: none !important;
}

/* Series / grid-windev: handle de ancho + drop de reorden */
.trx-cols-interactive thead th.resizable,
.grid-windev.uf-table-core thead th.resizable {
  position: relative;
  cursor: grab;
}
.trx-cols-interactive thead th.trx-col-dragging,
.grid-windev.uf-table-core thead th.trx-col-dragging {
  opacity: 0.55;
  cursor: grabbing;
}
.trx-cols-interactive thead th.trx-col-drop,
.grid-windev.uf-table-core thead th.trx-col-drop {
  box-shadow: inset 3px 0 0 #bef264;
}
.trx-cols-interactive thead th .col-resizer,
.grid-windev.uf-table-core thead th .col-resizer {
  position: absolute;
  top: 0;
  right: -2px;
  width: 7px;
  height: 100%;
  cursor: col-resize;
  z-index: 30;
}
.trx-cols-interactive thead th .col-resizer:hover,
.grid-windev.uf-table-core thead th .col-resizer:hover,
.trx-cols-interactive thead th .col-resizer.resizing,
.grid-windev.uf-table-core thead th .col-resizer.resizing,
body.uf-col-resizing .trx-cols-interactive thead th .col-resizer,
body.uf-col-resizing .grid-windev.uf-table-core thead th .col-resizer {
  background: rgba(190, 242, 100, 0.45);
}
body.uf-col-resizing {
  cursor: col-resize !important;
  user-select: none !important;
}

/* Series y Fechas: columna Suc angosta (45–50px) */
#tbl-trx-sf th:nth-child(1),
#tbl-trx-sf td:nth-child(1),
#tbl-trx-sf .trx-col-suc {
  width: 48px !important;
  min-width: 45px !important;
  max-width: 50px !important;
  text-align: center !important;
  padding-left: 2px !important;
  padding-right: 2px !important;
  box-sizing: border-box;
  overflow: hidden;
}

/* Footer de tablas estilo Reporte Administrativo — sticky bottom */
.ra-table-footer {
  position: sticky;
  bottom: 0;
  z-index: 10;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 6px 10px;
  background: #e2e6ea;
  border-top: 1px solid #cbd5e1;
  font-size: 11px;
  font-weight: 700;
  color: #0f172a;
}

.ra-footer-totals {
  display: flex;
  align-items: baseline;
  gap: 10px;
  flex-wrap: wrap;
  margin-right: auto;
  font-weight: 700;
  color: #0f172a;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.ra-ft-lbl {
  color: #64748b;
  font-weight: 700;
}

.ra-footer-val {
  color: #0f172a;
  font-variant-numeric: tabular-nums;
  font-family: ui-monospace, 'Cascadia Code', monospace;
}

.ra-registros {
  color: #334155;
  margin-left: auto;
  white-space: nowrap;
}

/* Detalle de Transacciones — panel inferior flexible (ESF / ER / Balanzas) */
.cont-lower.detalle-transacciones-container,
.detalle-transacciones-container {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 300px;
  min-width: 0;
  overflow: hidden;
}

.cont-tab-panel.detalle-transacciones-container,
#panel-detalle-trx,
#bal-panel-detalle-trx {
  flex: 1;
  min-height: 0;
  display: none;
  flex-direction: column;
  overflow: hidden;
}

.cont-tab-panel.detalle-transacciones-container.visible,
#panel-detalle-trx.visible,
#bal-panel-detalle-trx.visible {
  display: flex;
}

#contenedor-cont-detalle-trx,
#contenedor-bal-detalle-trx,
.detalle-transacciones-container .table-wrapper {
  flex: 1 1 0;
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 250px;
  max-height: calc(100vh - 450px);
  min-width: 0;
  overflow-x: auto;
  overflow-y: auto !important;
  -webkit-overflow-scrolling: touch;
  width: 100%;
  background: #fff;
}

#contenedor-cont-detalle-trx .cxc-table,
#contenedor-bal-detalle-trx .cxc-table {
  flex: 0 0 auto;
  width: 100%;
}

#contenedor-cont-detalle-trx thead th.cxc-th,
#contenedor-bal-detalle-trx thead th.cxc-th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: var(--cxc-navy, #1e3a5f) !important;
}

#panel-detalle-trx .ra-table-footer,
#bal-panel-detalle-trx .ra-table-footer {
  flex-shrink: 0;
  position: sticky;
  bottom: 0;
  z-index: 3;
}

.tabla-detalles-container tfoot, 
.tabla-detalles-footer,
.cxc-table tfoot,
.cxc-table tfoot tr {
    position: sticky;
    bottom: 0;
    background-color: #f1f5f9 !important;
    font-weight: bold;
    z-index: 20;
    border-top: 2px solid #cbd5e1;
}

.cxc-table tfoot td {
    background-color: #f1f5f9 !important;
    color: #1e293b;
    padding: 8px 4px;
}

/* ─── Caja/Bancos: anchos % para que MONTO sea visible sin scroll ─── */
#tbl-otros-ingresos,
#tbl-otros-egresos {
  width: 100% !important;
  min-width: 0 !important;
  table-layout: fixed;
}
#tbl-otros-ingresos col.ot-f-nom,
#tbl-otros-egresos col.ot-f-nom { width: 32%; }
#tbl-otros-ingresos col.ot-f-suc,
#tbl-otros-egresos col.ot-f-suc { width: 6%; }
#tbl-otros-ingresos col.ot-f-fecha,
#tbl-otros-egresos col.ot-f-fecha { width: 14%; }
#tbl-otros-ingresos col.ot-f-serie,
#tbl-otros-egresos col.ot-f-serie { width: 12%; }
#tbl-otros-ingresos col.ot-f-docu,
#tbl-otros-egresos col.ot-f-docu { width: 10%; }
#tbl-otros-ingresos col.ot-f-monto,
#tbl-otros-egresos col.ot-f-monto { width: 16%; }
#tbl-otros-ingresos col.ot-f-com,
#tbl-otros-egresos col.ot-f-com { width: 10%; }

#tbl-otros-caja,
#tbl-otros-ingresos,
#tbl-otros-egresos {
  table-layout: fixed;
}
#tbl-otros-caja.trx-cols-interactive thead th.resizable,
#tbl-otros-ingresos.trx-cols-interactive thead th.resizable,
#tbl-otros-egresos.trx-cols-interactive thead th.resizable {
  position: relative;
}
#tbl-otros-caja.trx-cols-interactive thead th .col-resizer,
#tbl-otros-ingresos.trx-cols-interactive thead th .col-resizer,
#tbl-otros-egresos.trx-cols-interactive thead th .col-resizer {
  position: absolute;
  top: 0;
  right: -2px;
  width: 7px;
  height: 100%;
  cursor: col-resize;
  z-index: 30;
}

/* Caja/Bancos: sangría jerárquica 3 → 5 → 7 dígitos */
#tbl-otros-caja .cxc-td.ot-indent-1 { padding-left: 22px !important; }
#tbl-otros-caja .cxc-td.ot-indent-1.center { padding-left: 18px !important; }
#tbl-otros-caja .cxc-td.ot-indent-2 { padding-left: 40px !important; }
#tbl-otros-caja .cxc-td.ot-indent-2.center { padding-left: 34px !important; }
#tbl-otros-caja .ot-row-root .cxc-td { font-weight: 800; }
#tbl-otros-caja .ot-row-mid .cxc-td { font-weight: 700; }
#tbl-otros-caja .ot-row-leaf .cxc-td.ot-indent-2.left::before {
  content: '· ';
  color: #94a3b8;
  font-weight: 700;
}

/* Flujo de Caja: 60% tabla / 40% gráfico */
.otros-flujo-matriz {
  flex: 1 1 60% !important;
  width: 60% !important;
  min-width: 0;
}
.otros-flujo-chart {
  flex: 1 1 40% !important;
  width: 40% !important;
  min-width: 180px;
}
#tbl-otros-flujo .cxc-row.ot-row-saldo {
  background: #dcfce7 !important;
}
#tbl-otros-flujo .cxc-row.ot-row-saldo .cxc-td {
  color: #166534 !important;
  font-weight: 800;
}
#tbl-otros-flujo .cxc-row.ot-row-subtotal .cxc-td {
  color: #1d4ed8 !important;
  font-weight: 800;
}
#tbl-otros-flujo .cxc-row.ot-row-seccion {
  background: #e2e8f0 !important;
}
#tbl-otros-flujo .cxc-row.ot-row-detalle,
#tbl-otros-flujo .cxc-row.ot-row-total {
  background: #f1f5f9 !important;
}
#tbl-otros-flujo.trx-cols-interactive thead th .col-resizer,
#tbl-otros-flujo-hist.trx-cols-interactive thead th .col-resizer {
  position: absolute;
  top: 0;
  right: -2px;
  width: 7px;
  height: 100%;
  cursor: col-resize;
  z-index: 30;
}
#tbl-otros-flujo.trx-cols-interactive thead th.resizable,
#tbl-otros-flujo-hist.trx-cols-interactive thead th.resizable {
  position: relative;
}

/* ── Flujo de Recursos: tarjetas, anchos fluidos, resize/sort ── */
.otros-rec-view {
  background: #e8ecf1 !important;
  gap: 0;
  padding: 10px 12px 8px;
  box-sizing: border-box;
}
.otros-rec-piso {
  background: transparent !important;
}
.otros-rec-origenes {
  display: flex !important;
  flex-direction: row !important;
  gap: 16px !important;
  padding: 0;
  box-sizing: border-box;
}
.otros-rec-half,
.otros-rec-piso-2,
.otros-rec-piso-3 {
  border: 1px solid #d0d7e2;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  background: #fff !important;
  overflow: hidden;
  box-sizing: border-box;
}
.otros-rec-half + .otros-rec-half {
  border-left: 1px solid #d0d7e2 !important;
}
.otros-rec-half .cxc-tbl-hdr,
.otros-rec-piso-2 > .cxc-tbl-hdr,
.otros-rec-piso-3 > .cxc-tbl-hdr {
  padding: 8px 12px 6px;
  flex-shrink: 0;
}
#contenedor-otros-rec-efe,
#contenedor-otros-rec-pas {
  padding: 0 8px 8px;
  box-sizing: border-box;
  overflow-x: hidden;
  overflow-y: auto;
}
#contenedor-otros-rec-apl {
  padding: 0 8px 8px;
  box-sizing: border-box;
  overflow-x: auto;
  overflow-y: auto;
}
/* Detalle: sin padding inferior — Totales pegan con barra Registros */
#contenedor-otros-rec-det {
  padding: 0 8px 0;
  box-sizing: border-box;
  overflow-x: auto;
  overflow-y: auto;
}
.otros-rec-piso-3 > .otros-footer-bar {
  margin: 0;
  padding: 3px 10px;
  border-top: 1px solid #c5ced9;
  border-radius: 0;
  flex-shrink: 0;
}
#tbl-otros-rec-det tfoot {
  position: sticky;
  bottom: 0;
  z-index: 6;
}
#tbl-otros-rec-det tfoot td {
  background: #e8edf3 !important;
  border-top: 1px solid #c5ced9;
  padding-top: 4px !important;
  padding-bottom: 4px !important;
}
#tbl-otros-rec-efe,
#tbl-otros-rec-pas {
  width: 100% !important;
  min-width: 0 !important;
  max-width: 100%;
  table-layout: fixed;
  box-sizing: border-box;
}
#contenedor-otros-rec-efe,
#contenedor-otros-rec-pas {
  overflow-x: hidden !important;
}
#tbl-otros-rec-apl,
#tbl-otros-rec-det {
  width: 100% !important;
  min-width: 100%;
  max-width: none;
  table-layout: fixed;
}

/* Origen Efe/Pas — 100%: Desc 22 | Ant 18 | % 9 | Mes 18 | % 9 | Final 16 | % 8 */
#tbl-otros-rec-efe colgroup col:nth-child(1),
#tbl-otros-rec-pas colgroup col:nth-child(1) { width: 22%; }
#tbl-otros-rec-efe colgroup col:nth-child(2),
#tbl-otros-rec-pas colgroup col:nth-child(2) { width: 18%; }
#tbl-otros-rec-efe colgroup col:nth-child(3),
#tbl-otros-rec-pas colgroup col:nth-child(3) { width: 9%; }
#tbl-otros-rec-efe colgroup col:nth-child(4),
#tbl-otros-rec-pas colgroup col:nth-child(4) { width: 18%; }
#tbl-otros-rec-efe colgroup col:nth-child(5),
#tbl-otros-rec-pas colgroup col:nth-child(5) { width: 9%; }
#tbl-otros-rec-efe colgroup col:nth-child(6),
#tbl-otros-rec-pas colgroup col:nth-child(6) { width: 16%; }
#tbl-otros-rec-efe colgroup col:nth-child(7),
#tbl-otros-rec-pas colgroup col:nth-child(7) { width: 8%; }

#tbl-otros-rec-efe col.ot-r-desc,
#tbl-otros-rec-pas col.ot-r-desc,
#tbl-otros-rec-efe col.ot-r-num,
#tbl-otros-rec-pas col.ot-r-num,
#tbl-otros-rec-efe col.ot-r-pct,
#tbl-otros-rec-pas col.ot-r-pct {
  min-width: 0 !important;
  max-width: none !important;
}
#tbl-otros-rec-efe thead th,
#tbl-otros-rec-pas thead th,
#tbl-otros-rec-efe td,
#tbl-otros-rec-pas td {
  min-width: 0 !important;
  max-width: none;
  box-sizing: border-box;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
/* Montos y %: derecha, sin ellipsis (ej. 706,835,850.25) */
#tbl-otros-rec-efe td:nth-child(2),
#tbl-otros-rec-efe td:nth-child(3),
#tbl-otros-rec-efe td:nth-child(4),
#tbl-otros-rec-efe td:nth-child(5),
#tbl-otros-rec-efe td:nth-child(6),
#tbl-otros-rec-efe td:nth-child(7),
#tbl-otros-rec-pas td:nth-child(2),
#tbl-otros-rec-pas td:nth-child(3),
#tbl-otros-rec-pas td:nth-child(4),
#tbl-otros-rec-pas td:nth-child(5),
#tbl-otros-rec-pas td:nth-child(6),
#tbl-otros-rec-pas td:nth-child(7),
#tbl-otros-rec-efe tfoot td.right,
#tbl-otros-rec-pas tfoot td.right,
#tbl-otros-rec-efe thead th[data-sort-key="ant"],
#tbl-otros-rec-efe thead th[data-sort-key="mes"],
#tbl-otros-rec-efe thead th[data-sort-key="final"],
#tbl-otros-rec-efe thead th[data-sort-key^="pct_"],
#tbl-otros-rec-pas thead th[data-sort-key="ant"],
#tbl-otros-rec-pas thead th[data-sort-key="mes"],
#tbl-otros-rec-pas thead th[data-sort-key="final"],
#tbl-otros-rec-pas thead th[data-sort-key^="pct_"] {
  text-align: right;
  text-overflow: clip !important;
  overflow: hidden !important;
  font-variant-numeric: tabular-nums;
  font-family: ui-monospace, 'Cascadia Code', 'Consolas', monospace;
  padding-left: 4px;
  padding-right: 6px;
}

#tbl-otros-rec-apl col.ot-a-desc { width: 18%; min-width: 180px; }
#tbl-otros-rec-apl col.ot-a-num { width: 9%; min-width: 110px; }
#tbl-otros-rec-apl col.ot-a-pct {
  width: 65px;
  min-width: 55px;
  max-width: 65px;
}
#tbl-otros-rec-apl thead th[data-sort-key="desc"],
#tbl-otros-rec-apl td:nth-child(1) {
  min-width: 180px;
  overflow: visible;
  text-overflow: clip;
}
#tbl-otros-rec-apl thead th[data-sort-key="ant"],
#tbl-otros-rec-apl thead th[data-sort-key="efectivo"],
#tbl-otros-rec-apl thead th[data-sort-key="otros"],
#tbl-otros-rec-apl thead th[data-sort-key="final"],
#tbl-otros-rec-apl td:nth-child(2),
#tbl-otros-rec-apl td:nth-child(5),
#tbl-otros-rec-apl td:nth-child(8),
#tbl-otros-rec-apl td:nth-child(11) {
  min-width: 110px;
  white-space: nowrap !important;
  overflow: visible !important;
  text-overflow: clip !important;
}
#tbl-otros-rec-apl thead th[data-sort-key^="parc_"],
#tbl-otros-rec-apl thead th[data-sort-key^="tot_"],
#tbl-otros-rec-apl td:nth-child(3),
#tbl-otros-rec-apl td:nth-child(4),
#tbl-otros-rec-apl td:nth-child(6),
#tbl-otros-rec-apl td:nth-child(7),
#tbl-otros-rec-apl td:nth-child(9),
#tbl-otros-rec-apl td:nth-child(10),
#tbl-otros-rec-apl td:nth-child(12),
#tbl-otros-rec-apl td:nth-child(13) {
  width: 65px !important;
  max-width: 65px !important;
  min-width: 55px;
  box-sizing: border-box;
}

/* Detalle: SUC 50px fijo; sobrante a NOMBRE y COMENTARIO */
#tbl-otros-rec-det col.ot-h-suc {
  width: 50px;
  min-width: 50px;
  max-width: 50px;
}
#tbl-otros-rec-det col.ot-h-fecha { width: 7%; }
#tbl-otros-rec-det col.ot-h-serie { width: 7%; }
#tbl-otros-rec-det col.ot-h-doc { width: 7%; }
#tbl-otros-rec-det col.ot-h-nom { width: 26%; }
#tbl-otros-rec-det col.ot-h-und { width: 6%; }
#tbl-otros-rec-det col.ot-h-num { width: 9%; }
#tbl-otros-rec-det col.ot-h-est { width: 6%; }
#tbl-otros-rec-det col.ot-h-com { width: 18%; }
#tbl-otros-rec-det thead th[data-sort-key="suc"],
#tbl-otros-rec-det td:nth-child(1),
#tbl-otros-rec-det col.ot-h-suc {
  width: 50px !important;
  min-width: 50px !important;
  max-width: 50px !important;
  text-align: center;
  padding-left: 2px;
  padding-right: 2px;
  box-sizing: border-box;
}
#tbl-otros-rec-det thead th[data-sort-key="nombre"],
#tbl-otros-rec-det td:nth-child(5) { width: 26%; }
#tbl-otros-rec-det thead th[data-sort-key="comentario"],
#tbl-otros-rec-det td:nth-child(11) { width: 18%; }
#tbl-otros-rec-det thead th[data-sort-key="entrada"],
#tbl-otros-rec-det thead th[data-sort-key="salida"],
#tbl-otros-rec-det thead th[data-sort-key="balance"],
#tbl-otros-rec-det td:nth-child(7),
#tbl-otros-rec-det td:nth-child(8),
#tbl-otros-rec-det td:nth-child(9) {
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: clip !important;
}

#tbl-otros-rec-efe.trx-cols-interactive thead th.resizable,
#tbl-otros-rec-pas.trx-cols-interactive thead th.resizable,
#tbl-otros-rec-apl.trx-cols-interactive thead th.resizable,
#tbl-otros-rec-det.trx-cols-interactive thead th.resizable {
  position: relative;
  cursor: pointer;
  user-select: none;
}
#tbl-otros-rec-efe.trx-cols-interactive thead th .col-resizer,
#tbl-otros-rec-pas.trx-cols-interactive thead th .col-resizer,
#tbl-otros-rec-apl.trx-cols-interactive thead th .col-resizer,
#tbl-otros-rec-det.trx-cols-interactive thead th .col-resizer {
  position: absolute;
  top: 0;
  right: -2px;
  width: 7px;
  height: 100%;
  cursor: col-resize;
  z-index: 30;
  background: transparent;
}
#tbl-otros-rec-efe.trx-cols-interactive thead th .col-resizer:hover,
#tbl-otros-rec-pas.trx-cols-interactive thead th .col-resizer:hover,
#tbl-otros-rec-apl.trx-cols-interactive thead th .col-resizer:hover,
#tbl-otros-rec-det.trx-cols-interactive thead th .col-resizer:hover,
body.uf-col-resizing #tbl-otros-rec-efe thead th .col-resizer,
body.uf-col-resizing #tbl-otros-rec-pas thead th .col-resizer,
body.uf-col-resizing #tbl-otros-rec-apl thead th .col-resizer,
body.uf-col-resizing #tbl-otros-rec-det thead th .col-resizer {
  background-color: rgba(163, 230, 53, 0.45);
}
#tbl-otros-rec-efe thead th .fr-sort-ind,
#tbl-otros-rec-pas thead th .fr-sort-ind,
#tbl-otros-rec-apl thead th .fr-sort-ind,
#tbl-otros-rec-det thead th .fr-sort-ind {
  display: inline-block;
  margin-left: 4px;
  font-size: 9px;
  color: #93c5fd;
  vertical-align: middle;
  opacity: 0.55;
}
#tbl-otros-rec-efe thead th.uf-sort-active .fr-sort-ind,
#tbl-otros-rec-pas thead th.uf-sort-active .fr-sort-ind,
#tbl-otros-rec-apl thead th.uf-sort-active .fr-sort-ind,
#tbl-otros-rec-det thead th.uf-sort-active .fr-sort-ind {
  color: #a3e635;
  opacity: 1;
  font-weight: 700;
}

/* ── Sidebar colapsable (reportes — global, todos los módulos) ── */
.cxc-leftnav,
.rv-leftnav,
.ra-leftnav {
  position: relative;
  transition: width 0.18s ease, min-width 0.18s ease, padding 0.18s ease, opacity 0.15s ease;
}
.cxc-leftnav {
  flex: 0 0 62px;
}
.cxc-nav-toggle {
  width: 52px;
  height: 28px;
  min-width: 28px;
  margin: 2px 0 6px;
  padding: 0;
  border: 1px solid #94a3b8;
  border-radius: 4px;
  background: #334155;
  color: #f8fafc;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: -0.5px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  line-height: 1;
  z-index: 40;
}
.cxc-nav-toggle:hover {
  background: #1e293b;
  color: #a3e635;
}
.cxc-nav-toggle-icon {
  pointer-events: none;
  user-select: none;
}

/* Contenedores de trabajo */
.cxc-workarea,
.rv-workarea,
.ra-app {
  position: relative;
}

/* Colapsado: oculta el menú y deja solo el botón >> flotante */
.cxc-workarea.sidebar-collapsed .cxc-leftnav,
.rv-workarea.sidebar-collapsed .rv-leftnav,
.ra-app.sidebar-collapsed .ra-leftnav {
  width: 0 !important;
  min-width: 0 !important;
  max-width: 0 !important;
  flex: 0 0 0 !important;
  padding: 0 !important;
  border-right-width: 0 !important;
  overflow: visible !important;
  opacity: 1;
}
.cxc-workarea.sidebar-collapsed .cxc-leftnav > *:not(.cxc-nav-toggle),
.rv-workarea.sidebar-collapsed .rv-leftnav > *:not(.cxc-nav-toggle),
.ra-app.sidebar-collapsed .ra-leftnav > *:not(.cxc-nav-toggle),
.cxc-workarea.sidebar-collapsed .cxc-nav-group {
  display: none !important;
}
.cxc-workarea.sidebar-collapsed .cxc-nav-toggle,
.rv-workarea.sidebar-collapsed .cxc-nav-toggle,
.ra-app.sidebar-collapsed .cxc-nav-toggle {
  position: absolute;
  left: 4px;
  top: 6px;
  width: 28px;
  height: 28px;
  margin: 0;
  z-index: 60;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.25);
}

/* Panel principal a ancho completo */
.cxc-workarea.sidebar-collapsed .cxc-main,
.rv-workarea.sidebar-collapsed .rv-main,
.ra-app.sidebar-collapsed .ra-main {
  width: 100% !important;
  max-width: 100% !important;
  flex: 1 1 100% !important;
  min-width: 0;
}

/* Tablas estándar ocupan el ancho liberado al colapsar el menú */
.cxc-workarea.sidebar-collapsed .cxc-main .cxc-table:not(.cxc-table-wide),
.rv-workarea.sidebar-collapsed .rv-main table {
  width: 100% !important;
  min-width: 100% !important;
}

/* Depreciación: resize handles + sort indicators */
#tbl-otros-dep-cats.trx-cols-interactive thead th.resizable,
#tbl-otros-dep-act.trx-cols-interactive thead th.resizable,
#tbl-otros-dep-con.trx-cols-interactive thead th.resizable {
  position: relative;
  cursor: pointer;
  user-select: none;
}
#tbl-otros-dep-cats.trx-cols-interactive thead th .col-resizer,
#tbl-otros-dep-act.trx-cols-interactive thead th .col-resizer,
#tbl-otros-dep-con.trx-cols-interactive thead th .col-resizer {
  position: absolute;
  top: 0;
  right: -2px;
  width: 7px;
  height: 100%;
  cursor: col-resize;
  z-index: 30;
}
#tbl-otros-dep-cats thead th .fr-sort-ind,
#tbl-otros-dep-act thead th .fr-sort-ind,
#tbl-otros-dep-con thead th .fr-sort-ind {
  display: inline-block;
  margin-left: 4px;
  font-size: 9px;
  color: #93c5fd;
  opacity: 0.55;
}
#tbl-otros-dep-cats thead th.uf-sort-active .fr-sort-ind,
#tbl-otros-dep-act thead th.uf-sort-active .fr-sort-ind,
#tbl-otros-dep-con thead th.uf-sort-active .fr-sort-ind {
  color: #a3e635;
  opacity: 1;
  font-weight: 700;
}

/* ── Inventario · Detalles de Productos (panel superior) ───────── */
#invDetallesPanel.inv-detalles-active #invMidSection .cxc-tbl-hdr {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
#invDetallesPanel.inv-detalles-active #invMidSection .cxc-tbl-hdr-title {
  min-width: 0;
  flex: 1 1 auto;
}
#invDetallesPanel.inv-detalles-active #invMidSection .cxc-tbl-hdr-meta {
  flex: 0 0 auto;
  white-space: nowrap;
  margin-left: auto;
}

#tbl-productos col.inv-pr-cod,
#tbl-productos th.inv-det-codigo,
#tbl-productos td.inv-det-codigo {
  min-width: 80px;
  width: 80px;
  text-align: center;
}

#tbl-productos td.inv-det-nombre,
#tbl-productos th.inv-det-nombre {
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  white-space: nowrap !important;
  max-width: 0; /* fuerza ellipsis con table-layout: fixed */
}

#invDetallesPanel.inv-detalles-active #tbl-productos td.inv-det-nombre {
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  white-space: nowrap !important;
}

/*
 * Panel 1 · Totales fijos al pie.
 * Sticky en tfoot (bloque completo). Las filas internas NO son sticky
 * para evitar que Totales/Registros se intercalen sobre el tbody al scroll.
 */
#invDetallesPanel.inv-detalles-active #invMidSection .inv-detalles-scroll,
#invDetallesPanel.inv-detalles-active #invLowerSection .inv-detalles-scroll {
  overflow-x: auto !important;
  overflow-y: auto !important;
  margin-bottom: 0 !important;
}
#invDetallesPanel.inv-detalles-active .unifile-grid {
  border-collapse: separate;
  border-spacing: 0;
}
#invDetallesPanel.inv-detalles-active .unifile-grid thead th {
  position: sticky;
  top: 0;
  z-index: 11;
}

/* Totales siempre en <tfoot>, fijos al pie del scroll (Panel 1 y 2) */
.unifile-grid tfoot {
  position: sticky;
  bottom: 0;
  background-color: #e9ecef;
  font-weight: bold;
  z-index: 5;
  border-top: 2px solid #a0a0a0;
}
.unifile-grid tfoot tr {
  position: static; /* anula sticky global por-fila */
}
.unifile-grid tfoot td {
  background-color: #e9ecef !important;
  font-weight: bold;
}

/* ── Inventario · Sugeridos por Ventas (toolbar en 2 bloques) ─── */
#invSugeridosView .inv-sug-toolbar {
  display: flex;
  align-items: stretch;
  justify-content: flex-start;
  flex-wrap: wrap;
  gap: 8px 12px;
}
#invSugeridosView .inv-sug-block {
  display: flex;
  flex-direction: column;
  gap: 4px;
  background: #f8fafc;
  border: 1px solid #c5ced9;
  border-radius: 6px;
  padding: 6px 12px 8px;
  width: fit-content;
  max-width: 100%;
}
#invSugeridosView .inv-sug-block-title {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #1e3a8a;
}
#invSugeridosView .inv-sug-block-body {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px 10px;
}
#invSugeridosView .inv-sug-block .cxc-flbl,
#invSugeridosView .inv-sug-check {
  font-size: 13px;
  font-weight: 600;
  color: #374151;
}
#invSugeridosView .inv-sug-block .cxc-fsel,
#invSugeridosView .inv-sug-num-input {
  font-size: 14px;
  font-weight: 600;
  min-height: 30px;
  padding: 3px 8px;
}
#invSugeridosView .inv-sug-num-input {
  width: 52px;
  text-align: center;
}
#invSugeridosView .inv-sug-stat-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: #e3f2fd;
  color: #0d47a1;
  font-size: 14px;
  font-weight: bold;
  padding: 4px 10px;
  border-radius: 6px;
  border: none;
  white-space: nowrap;
}
#invSugeridosView .inv-sug-stat-badge strong {
  font-size: 14px;
  font-weight: 800;
  color: #0d47a1;
}
#invSugeridosView .inv-sug-aplicar {
  margin-left: 8px;
  align-self: center;
  flex-shrink: 0;
}
#invSugeridosView .inv-sug-block-params .inv-sug-block-body {
  flex-wrap: nowrap;
  align-items: center;
}
#invSugeridosView #tbl-sugeridos .inv-sug-col-n2 {
  max-width: 170px;
  width: 170px;
  white-space: nowrap;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
}
#invSugeridosView #tbl-sugeridos .inv-sug-col-n3 {
  max-width: 150px;
  width: 150px;
  white-space: nowrap;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
}
#invSugeridosView #tbl-sugeridos .inv-sug-col-nom {
  max-width: 240px;
  width: 240px;
  white-space: nowrap;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
}
#invSugeridosView #tbl-sugeridos .inv-sug-col-cod {
  min-width: 70px;
  width: 70px;
  text-align: center;
}
#invSugeridosView #tbl-sugeridos tfoot {
  position: sticky;
  bottom: 0;
  z-index: 5;
  background-color: #e9ecef;
  font-weight: bold;
  border-top: 2px solid #a0a0a0;
}

/* ── Inventario · Totales por Fecha (x_nodos_inv_fd) ─────────── */
#invFechaView .inv-fecha-toolbar {
  display: flex;
  align-items: stretch;
  justify-content: flex-start;
  flex-wrap: wrap;
  gap: 8px 12px;
  background: #e2e6ec;
  border-bottom: 2px solid #cbd5e1;
  padding: 6px 10px;
}
#invFechaView .inv-fecha-block {
  display: flex;
  flex-direction: column;
  gap: 4px;
  background: #f8fafc;
  border: 1px solid #c5ced9;
  border-radius: 6px;
  padding: 6px 12px 8px;
  width: fit-content;
  max-width: 100%;
}
#invFechaView .inv-fecha-block-title {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #1e3a8a;
}
#invFechaView .inv-fecha-block-body {
  display: flex;
  align-items: center;
  flex-wrap: nowrap;
  gap: 6px 10px;
}
#invFechaView .inv-fecha-block .cxc-flbl {
  font-size: 13px;
  font-weight: 600;
  color: #374151;
}
#invFechaView .inv-fecha-date {
  font-size: 14px;
  font-weight: 600;
  min-width: 145px;
  width: 145px;
  min-height: 30px;
  padding: 3px 8px;
  border: 1px solid #8a9ab4;
  border-radius: 3px;
  background: #fff;
}
#invFechaView .inv-fecha-block .cxc-fsel {
  font-size: 14px;
  font-weight: 600;
  min-height: 30px;
  padding: 3px 8px;
  border: 1px solid #8a9ab4;
  border-radius: 3px;
  background: #fff;
}
#invFechaView .inv-fecha-aplicar {
  margin-left: 8px;
  align-self: center;
  flex-shrink: 0;
}
#invFechaView #tablaTotalesFecha.inv-fecha-grid td.cxc-td,
#invFechaView #tablaTotalesFecha.inv-fecha-grid th.cxc-th,
#invFechaView #tbl-fecha.inv-fecha-grid td.cxc-td,
#invFechaView #tbl-fecha.inv-fecha-grid th.cxc-th {
  user-select: text;
  -webkit-user-select: text;
}
#invFechaView #tablaTotalesFecha.inv-fecha-grid tbody tr.cxc-row,
#invFechaView #tbl-fecha.inv-fecha-grid tbody tr.cxc-row {
  cursor: pointer;
}
#invFechaView #tablaTotalesFecha.inv-fecha-grid tbody tr.cxc-row.selected-row,
#invFechaView #tablaTotalesFecha.inv-fecha-grid tbody tr.cxc-row.selected-row td,
#invFechaView #tbl-fecha.inv-fecha-grid tbody tr.cxc-row.selected-row,
#invFechaView #tbl-fecha.inv-fecha-grid tbody tr.cxc-row.selected-row td {
  background: #dbeafe !important;
  outline: none;
}
#invFechaView #tablaTotalesFecha.trx-cols-interactive thead th.resizable,
#invFechaView #tbl-fecha.trx-cols-interactive thead th.resizable {
  position: relative;
  cursor: pointer;
  user-select: none;
}
#invFechaView #tablaTotalesFecha.trx-cols-interactive thead th .col-resizer,
#invFechaView #tbl-fecha.trx-cols-interactive thead th .col-resizer {
  position: absolute;
  top: 0;
  right: -2px;
  width: 7px;
  height: 100%;
  cursor: col-resize;
  z-index: 30;
}
#invFechaView #tablaTotalesFecha thead th .fr-sort-ind,
#invFechaView #tbl-fecha thead th .fr-sort-ind {
  display: inline-block;
  margin-left: 4px;
  font-size: 9px;
  color: #93c5fd;
  opacity: 0.55;
}
#invFechaView #tablaTotalesFecha thead th.uf-sort-active .fr-sort-ind,
#invFechaView #tbl-fecha thead th.uf-sort-active .fr-sort-ind {
  color: #a3e635;
  opacity: 1;
  font-weight: 700;
}
#invFechaView #tablaTotalesFecha .inv-fecha-col-n2,
#invFechaView #tbl-fecha .inv-fecha-col-n2 {
  max-width: 170px;
  width: 170px;
  white-space: nowrap;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
}
#invFechaView #tablaTotalesFecha .inv-fecha-col-n3,
#invFechaView #tbl-fecha .inv-fecha-col-n3 {
  max-width: 150px;
  width: 150px;
  white-space: nowrap;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
}
#invFechaView #tablaTotalesFecha .inv-fecha-col-nom,
#invFechaView #tbl-fecha .inv-fecha-col-nom {
  max-width: 240px;
  width: 240px;
  white-space: nowrap;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
}
#invFechaView #tablaTotalesFecha .inv-fecha-col-cod,
#invFechaView #tablaTotalesFecha .inv-fecha-col-fec,
#invFechaView #tbl-fecha .inv-fecha-col-cod,
#invFechaView #tbl-fecha .inv-fecha-col-fec {
  text-align: center;
  min-width: 70px;
}
#invFechaView #tablaTotalesFecha .inv-fecha-col-num,
#invFechaView #tbl-fecha .inv-fecha-col-num {
  text-align: right;
}

/* ── Módulo vista + wrapper scroll (sticky header/footer) ── */
.modulo-vista {
  display: flex;
  flex-direction: column;
  height: calc(100vh - 120px); /* Altura disponible bajo el menú principal */
  overflow: hidden; /* Evita el scroll en toda la página */
}

.tabla-wrapper {
  flex: 1;
  min-height: 0; /* CRUCIAL: Permite que el flex-child respete el overflow */
  overflow: auto; /* AQUÍ se genera la barra de scroll */
  position: relative;
  border-bottom: 1px solid #ccc;
}

.tabla-wrapper table {
  border-collapse: separate;
  border-spacing: 0;
  width: 100%;
}

.tabla-wrapper table thead th {
  position: sticky;
  top: 0;
  z-index: 20;
  background-color: #1a365d !important;
  color: white;
  box-shadow: 0 2px 2px -1px rgba(0, 0, 0, 0.4);
}

/* ── table-container-scroll: sticky header (Físico + Totales Fecha) ── */
.table-container-scroll {
  max-height: calc(100vh - 250px) !important;
  overflow-y: auto !important;
  overflow-x: auto !important;
  position: relative !important;
  border-bottom: 1px solid #ccc;
}

.table-container-scroll table {
  border-collapse: separate !important;
  border-spacing: 0 !important;
  width: 100%;
}

.table-container-scroll table thead th,
.table-container-scroll thead th {
  position: sticky !important;
  top: 0 !important;
  z-index: 100 !important;
  background-color: #1a365d !important;
  color: #ffffff !important;
  box-shadow: 0 2px 2px -1px rgba(0, 0, 0, 0.4);
}

.table-container-scroll thead th:hover {
  background-color: #1a365d !important;
  color: #ffffff !important;
}

.table-container-scroll table tfoot td,
.table-container-scroll tfoot td {
  position: sticky !important;
  bottom: 0 !important;
  z-index: 90 !important;
  background-color: #ebedf0 !important;
  font-weight: bold;
  box-shadow: 0 -2px 2px -1px rgba(0, 0, 0, 0.2);
}

.table-container-scroll .unifile-grid tfoot {
  position: static;
  background: transparent;
  border-top: none;
}

/* Dos filas de pie Totales Fecha: Registros al borde, Totales encima */
.table-container-scroll tfoot tr.inv-fecha-tfoot-registros td {
  bottom: 0 !important;
}
.table-container-scroll tfoot tr.inv-fecha-tfoot-totales td {
  bottom: 22px !important;
}

/* Anchos y corte limpio para columnas de niveles (tabla-estandar) */
.tabla-estandar th:nth-child(1),
.tabla-estandar td:nth-child(1) { /* NIVEL 2 */
  max-width: 180px;
  min-width: 150px;
  width: 180px;
  white-space: nowrap;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
}

.tabla-estandar th:nth-child(2),
.tabla-estandar td:nth-child(2) { /* NIVEL 3 */
  max-width: 160px;
  min-width: 130px;
  width: 160px;
  white-space: nowrap;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
}

.tabla-wrapper table thead th:hover {
  background-color: #1a365d !important;
  color: white;
}

.tabla-wrapper table tfoot td {
  position: sticky;
  bottom: 0;
  z-index: 10;
  background-color: #ebedf0 !important;
  font-weight: bold;
  box-shadow: 0 -2px 2px -1px rgba(0, 0, 0, 0.2);
  user-select: text;
}

/* Anula sticky global de .unifile-grid tfoot dentro del wrapper */
.tabla-wrapper .unifile-grid tfoot {
  position: static;
  background: transparent;
  border-top: none;
  z-index: auto;
}
.tabla-wrapper .unifile-grid tfoot tr {
  position: static;
}

/* Dos filas de pie: Registros al borde, Totales encima (compat tabla-wrapper) */
.tabla-wrapper tfoot tr.inv-fecha-tfoot-registros td,
.table-container-scroll tfoot tr.inv-fecha-tfoot-registros td {
  bottom: 0;
}
.tabla-wrapper tfoot tr.inv-fecha-tfoot-totales td,
.table-container-scroll tfoot tr.inv-fecha-tfoot-totales td {
  bottom: 22px;
}

/* Desktop grid: selección de texto en celdas */
.desktop-grid.desktop-grid-selectable td,
.desktop-grid.desktop-grid-selectable th {
  user-select: text;
  -webkit-user-select: text;
}
.desktop-grid.desktop-grid-selectable thead th {
  user-select: none;
  -webkit-user-select: none;
}

/* ── Levantamiento Físico: diff + ocultar Exist. (sin tocar scroll) ── */
#invFisicoView .inv-fisico-dif-neg {
  color: #b91c1c !important;
  background: #fef2f2 !important;
  font-weight: 700;
}
#invFisicoView .inv-fisico-dif-pos {
  color: #0369a1 !important;
  background: #f0fdf4 !important;
  font-weight: 700;
}
#invFisicoView .inv-fisico-dif-zero {
  color: #475569 !important;
  font-weight: 600;
}
#invFisicoView.hide-existencias .inv-fisico-col-exist,
#invFisicoView #tbl-fisico.hide-existencias .inv-fisico-col-exist {
  display: none !important;
}
@media print {
  #invFisicoView.hide-existencias .inv-fisico-col-exist {
    display: none !important;
  }
}

/* ═══════════════════════════════════════════════════════════════════════════
   GRID WINDEV — Anti-Tailwind (!important) · inventarios / Sub Nivel / etc.
   ═══════════════════════════════════════════════════════════════════════════ */
table.grid-windev,
.grid-windev {
  width: 100% !important;
  border-collapse: collapse !important;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif !important;
  font-size: 11px !important;
  background-color: #ffffff !important;
  color: #0f172a !important;
}

/* Headers azules */
table.grid-windev thead th,
table.grid-windev thead th.cxc-th,
.grid-windev thead th,
.grid-windev thead th.cxc-th {
  background-color: #1a365d !important; /* Azul Unifile Oficial */
  color: #ffffff !important;
  font-weight: 600 !important;
  padding: 6px 8px !important;
  text-align: left !important;
  border-right: 1px solid #2d4a77 !important;
  border-bottom: 1px solid #0f172a !important;
  font-size: 11px !important;
  text-transform: uppercase !important;
  position: sticky !important;
  top: 0 !important;
  z-index: 100 !important;
}

/* Indicadores de sort global (unifile-table-core) */
.grid-windev thead th .uf-sort-ind,
table.grid-windev thead th .uf-sort-ind {
  margin-left: 4px;
  font-size: 10px;
  opacity: 0.75;
  font-weight: 700;
}
.grid-windev thead th.uf-sort-active .uf-sort-ind,
table.grid-windev thead th.uf-sort-active .uf-sort-ind {
  opacity: 1;
  color: #bef264 !important;
}

/* Encabezados de reportes: siempre a la izquierda (datos numéricos siguen en td.right) */
table.grid-windev thead th.text-right,
table.grid-windev thead th.right,
table.grid-windev thead th.cxc-th.right,
table.grid-windev thead th.center,
table.grid-windev thead th.cxc-th.center,
.grid-windev thead th.text-right,
.grid-windev thead th.right,
.grid-windev thead th.center {
  text-align: left !important;
}

/* Celdas y bordes */
table.grid-windev tbody td,
table.grid-windev tbody td.cxc-td,
.grid-windev tbody td,
.grid-windev tbody td.cxc-td {
  padding: 4px 8px !important;
  border-bottom: 1px solid #e2e8f0 !important;
  border-right: 1px solid #cbd5e1 !important;
  color: #0f172a !important;
  background-color: transparent !important;
}

/* Alternancia zebra */
table.grid-windev tbody tr:nth-child(even),
table.grid-windev tbody tr.cxc-row:nth-child(even),
.grid-windev tbody tr:nth-child(even),
.grid-windev tbody tr.cxc-row:nth-child(even) {
  background-color: #f8fafc !important;
}

table.grid-windev tbody tr:hover,
table.grid-windev tbody tr.cxc-row:hover,
.grid-windev tbody tr:hover {
  background-color: #f1f5f9 !important;
  cursor: pointer !important;
}

/* Fila seleccionada — Verde Lima Oficial Unifile */
table.grid-windev tbody tr.selected,
table.grid-windev tbody tr.selected td,
table.grid-windev tbody tr.active-row,
table.grid-windev tbody tr.active-row td,
table.grid-windev tbody tr.row-selected,
table.grid-windev tbody tr.row-selected td,
table.grid-windev tbody tr.selected-row,
table.grid-windev tbody tr.selected-row td,
table.grid-windev tbody tr.active,
table.grid-windev tbody tr.active td,
table.grid-windev tbody tr.cxc-row.active,
table.grid-windev tbody tr.cxc-row.active td,
.grid-windev tbody tr.selected,
.grid-windev tbody tr.selected td,
.grid-windev tbody tr.row-selected,
.grid-windev tbody tr.row-selected td,
.grid-windev tbody tr.active,
.grid-windev tbody tr.active td {
  background-color: #bef264 !important; /* Verde Lima Oficial Unifile */
  color: #0f172a !important;
  font-weight: 700 !important;
}

table.grid-windev tbody tr.cxc-row.active:hover,
table.grid-windev tbody tr.row-selected:hover,
table.grid-windev tbody tr.selected-row:hover,
table.grid-windev tbody tr.active:hover,
table.grid-windev tbody tr.selected:hover,
table.grid-windev tbody tr.active-row:hover {
  background-color: #bef264 !important;
}

/* Totales footer */
table.grid-windev tfoot td,
table.grid-windev tfoot tr.cxc-tfoot-row td,
table.grid-windev tfoot tr.row-totales td,
.grid-windev tfoot td {
  background-color: #cbd5e1 !important;
  color: #0f172a !important;
  font-weight: bold !important;
  border-top: 2px solid #1a365d !important;
  padding: 5px 8px !important;
}

table.grid-windev tfoot tr.row-registros td,
table.grid-windev tfoot tr.cxc-tfoot-row:last-child td,
.grid-windev tfoot tr.row-registros td {
  background-color: #e2e8f0 !important;
  color: #334155 !important;
  font-size: 11px !important;
  font-weight: bold !important;
  border-top: 1px solid #94a3b8 !important;
  padding: 4px 8px !important;
}

table.grid-windev .text-right,
table.grid-windev td.right,
table.grid-windev td.text-right,
.grid-windev .text-right,
.grid-windev td.right,
.grid-windev td.text-right {
  text-align: right !important;
}
table.grid-windev thead th.right,
table.grid-windev thead th.text-right,
.grid-windev thead th.right,
.grid-windev thead th.text-right {
  text-align: left !important;
}

/* Resumen General Valorado — layout Flexbox + sticky opaco + selección */
#invMovView .panel-grid-box {
  display: flex;
  flex-direction: column;
  border: 1px solid #94a3b8;
  background-color: #ffffff;
}
#invMovView .table-scroll-area {
  overflow-y: auto;
  overflow-x: auto;
  max-height: 280px;
  position: relative;
  min-height: 0;
  background: #fff;
}
#invMovView .master-scroll {
  max-height: 280px !important;
}
#invMovView .detail-scroll {
  max-height: 280px !important;
}
#invMovView .grid-windev thead th {
  position: sticky !important;
  top: 0 !important;
  z-index: 100 !important;
  background-color: #1a365d !important;
  color: #ffffff !important;
  cursor: pointer;
}
#invMovView .grid-windev thead th .col-resizer {
  position: absolute;
  right: 0;
  top: 0;
  width: 5px;
  height: 100%;
  cursor: col-resize;
  z-index: 101;
}
#invMovView .grid-windev thead th .col-resizer:hover,
body.uf-col-resizing #invMovView .grid-windev thead th .col-resizer {
  background-color: #38bdf8;
}
#invMovView .grid-windev tfoot,
#invMovView .grid-windev tfoot.sticky-footer {
  position: sticky !important;
  bottom: 0 !important;
  z-index: 90 !important;
}
#invMovView .grid-windev tfoot tr.row-totales td {
  background-color: #cbd5e1 !important;
  background-clip: padding-box !important;
  opacity: 1 !important;
}
#invMovView .grid-windev tfoot tr.row-registros td {
  background-color: #e2e8f0 !important;
  background-clip: padding-box !important;
  opacity: 1 !important;
}
#invMovView .grid-windev tbody tr.row-selected,
#invMovView .grid-windev tbody tr.row-selected td,
#invMovView .grid-windev tbody tr.selected-row,
#invMovView .grid-windev tbody tr.selected-row td,
#invMovView .grid-windev tbody tr.active,
#invMovView .grid-windev tbody tr.active td {
  background-color: #bef264 !important;
  color: #0f172a !important;
  font-weight: 700 !important;
}

/* ── Facturación: letrero de estado + tiempos (WinDEV) ── */
.fc-status-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 6px;
  align-self: flex-start;
  background: #ecfdf5;
  border: 1px solid #6ee7b7;
  border-radius: 20px;
  padding: 4px 12px;
  font-size: 11px;
  font-weight: 700;
  color: #065f46;
  letter-spacing: 0.02em;
}

.fc-status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.25);
  flex-shrink: 0;
}

.fc-status-label {
  color: #065f46;
  font-weight: 700;
  white-space: nowrap;
}

.fc-status-time {
  background: #d1e7dd;
  color: #0f5132;
  font-weight: 700;
  font-size: 11px;
  padding: 2px 10px;
  border-radius: 4px;
  border: 1px solid #a3cfbb;
  white-space: nowrap;
}

/* Modal «Mensaje del sistema» — impresión post-grabado (paridad WinDEV) */
.fc-wd-msg-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.72);
  backdrop-filter: blur(2px);
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 1000000;
}

.fc-wd-msg-overlay.active {
  display: flex;
}

.fc-wd-msg-dialog {
  background: #f8fafc;
  border: 2px solid #64748b;
  border-radius: 6px;
  width: min(480px, calc(100vw - 32px));
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.45);
  overflow: hidden;
}

.fc-wd-msg-header {
  background: linear-gradient(180deg, #1e3a5f 0%, #0f2744 100%);
  color: #fff;
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.fc-wd-msg-body {
  padding: 28px 24px 20px;
  text-align: center;
  background: #fff;
}

.fc-wd-msg-question {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
  color: #1e293b;
}

.fc-wd-msg-actions {
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
  padding: 0 16px 20px;
  background: #fff;
}

.fc-wd-msg-btn {
  min-width: 120px;
  padding: 8px 14px;
  font-size: 11px;
  font-weight: 700;
  border-radius: 4px;
  border: 1px solid #94a3b8;
  cursor: pointer;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.fc-wd-msg-btn-no {
  background: #e2e8f0;
  color: #334155;
}

.fc-wd-msg-btn-preview {
  background: #fef3c7;
  color: #92400e;
  border-color: #fcd34d;
}

.fc-wd-msg-btn-print {
  background: linear-gradient(180deg, #2563eb 0%, #1d4ed8 100%);
  color: #fff;
  border-color: #1d4ed8;
}

/* ═══════════════════════════════════════════════════════════════
   Entrada Facturas / Cotizaciones — tema oscuro ejecutivo (.fc-ui-dark)
   Misma paleta navy en FC y CT (coherencia visual).
═══════════════════════════════════════════════════════════════ */
body.fc-ui-dark {
  background: #0f172a !important;
  color: #e2e8f0 !important;
}
body.fc-ui-dark #facturasScreen {
  background: #0f172a !important;
}
body.fc-ui-dark .fc-header-block {
  background: #1e293b !important;
  border-color: #334155 !important;
  color: #e2e8f0 !important;
}
body.fc-ui-dark .fc-col-left,
body.fc-ui-dark .fc-col-right {
  border-color: #334155 !important;
}
/* Cotizaciones / Órdenes de Ventas dedicadas: nunca mostrar opciones del comprobante */
body.fc-modo-ct #opciones-comprobante,
body.fc-modo-ct #fcOpcionesComprobante,
body.fc-modo-ov #opciones-comprobante,
body.fc-modo-ov #fcOpcionesComprobante {
  display: none !important;
}
body.fc-ui-dark .fc-lbl,
body.fc-ui-dark .fc-toggles-title,
body.fc-ui-dark .fc-toggle-lbl {
  color: #94a3b8 !important;
}
body.fc-ui-dark .fc-input,
body.fc-ui-dark .fc-select,
body.fc-ui-dark .fc-textarea,
body.fc-ui-dark .fc-num,
body.fc-ui-dark .fc-date,
body.fc-ui-dark .fc-input-code,
body.fc-ui-dark .fc-input-name,
body.fc-ui-dark .fc-mono {
  background: #0f172a !important;
  border-color: #475569 !important;
  color: #f1f5f9 !important;
}
body.fc-ui-dark .fc-table-wrapper {
  background: #1e293b !important;
  border-color: #334155 !important;
}
body.fc-ui-dark .fc-table {
  background: #1e293b !important;
  color: #e2e8f0 !important;
}
body.fc-ui-dark .fc-row,
body.fc-ui-dark .fc-row:nth-child(even) {
  background: #1e293b !important;
}
body.fc-ui-dark .fc-row:hover {
  background: #243447 !important;
}
body.fc-ui-dark .fc-bottom,
body.fc-ui-dark .fc-footer-block,
body.fc-ui-dark .fc-actions,
body.fc-ui-dark [class*="fc-bottom"] {
  background: #1e293b !important;
  border-color: #334155 !important;
  color: #e2e8f0 !important;
}
body.fc-ui-dark .fc-toggles-section {
  background: #0f172a !important;
  border-color: #475569 !important;
}
body.fc-ui-dark .fc-table thead th,
body.fc-ui-dark .fc-th {
  background: #1a3a5c !important;
  color: #e2e8f0 !important;
  border-color: #2d5a8a !important;
}
body.fc-ui-dark .fc-table tbody td,
body.fc-ui-dark .fc-td {
  border-color: #334155 !important;
  color: #e2e8f0 !important;
  background: #1e293b;
}
/* Fila activa FC/CT (modo oscuro): ver bloque global table-facturacion al final de app.css */
body.fc-ui-dark .fc-row-active .fc-td-right,
body.fc-ui-dark .fc-row-editing .fc-td-right {
  font-weight: 700;
  color: #f8fafc !important;
}
body.fc-ui-dark .fc-cell-input,
body.fc-ui-dark .fc-cod-input {
  background: #0f172a !important;
  color: #f1f5f9 !important;
  border-color: #475569 !important;
}
body.fc-ui-dark .fc-bottom-panel,
body.fc-ui-dark .fc-totals-panel,
body.fc-ui-dark .fc-levels-panel,
body.fc-ui-dark .fc-actions-bar {
  background: #1e293b;
  border-color: #334155;
  color: #e2e8f0;
}
body.fc-ui-dark .fc-total-lbl {
  color: #94a3b8 !important;
}
body.fc-ui-dark .fc-total-val {
  color: #f1f5f9 !important;
}
body.fc-ui-dark .fc-total-grand {
  background: #0f172a !important;
  border-color: #334155 !important;
}
body.fc-ui-dark .fc-status-badge {
  background: #334155;
  color: #cbd5e1;
  border-color: #475569;
}
body.fc-ui-dark .fc-currency-badge {
  background: #334155;
  border-color: #475569;
  color: #e2e8f0;
}
body.fc-ui-dark .fc-search-btn {
  background: #334155;
  border-color: #475569;
  color: #e2e8f0;
}
body.fc-ui-dark .fc-ac-list {
  background: #1e293b;
  border-color: #475569;
  color: #e2e8f0;
}
body.fc-ui-dark .fc-level-row {
  color: #cbd5e1;
}
body.fc-ui-dark .fc-level-active {
  background: #334155 !important;
}
body.fc-ui-dark .fc-btn-dark,
body.fc-ui-dark .fc-action-grid #fcBtnAnular {
  background: #9f1239 !important;
  border-color: rgba(255, 255, 255, 0.2);
  color: #ffffff !important;
}
body.fc-ui-dark .fc-td-muted {
  color: #94a3b8 !important;
}

/* Cotizaciones vendedor: columnas compactas (menos scroll horizontal) */
#panel-cotizaciones.rv-cotizaciones-compact .rv-table {
  min-width: 1280px !important;
  width: max-content;
  table-layout: fixed;
}
#panel-cotizaciones.rv-cotizaciones-compact .rv-table th[data-sort-key="vendedor"],
#panel-cotizaciones.rv-cotizaciones-compact .rv-table td[data-key="vendedor"] {
  min-width: 110px !important;
  max-width: 130px;
  width: 120px;
}
#panel-cotizaciones.rv-cotizaciones-compact .rv-table th[data-sort-key="cliente"],
#panel-cotizaciones.rv-cotizaciones-compact .rv-table td[data-key="cliente"] {
  min-width: 110px !important;
  max-width: 140px;
  width: 120px;
}
#panel-cotizaciones.rv-cotizaciones-compact .rv-table th[data-sort-key="producto"],
#panel-cotizaciones.rv-cotizaciones-compact .rv-table td[data-key="producto"] {
  min-width: 140px !important;
  max-width: 180px;
  width: 160px;
}
#panel-cotizaciones.rv-cotizaciones-compact .rv-table th[data-sort-key="und"],
#panel-cotizaciones.rv-cotizaciones-compact .rv-table th[data-sort-key="precio"],
#panel-cotizaciones.rv-cotizaciones-compact .rv-table th[data-sort-key="venta"],
#panel-cotizaciones.rv-cotizaciones-compact .rv-table th[data-sort-key="costoVenta"],
#panel-cotizaciones.rv-cotizaciones-compact .rv-table th[data-sort-key="util"],
#panel-cotizaciones.rv-cotizaciones-compact .rv-table th[data-sort-key="impuesto"],
#panel-cotizaciones.rv-cotizaciones-compact .rv-table td[data-key="und"],
#panel-cotizaciones.rv-cotizaciones-compact .rv-table td[data-key="precio"],
#panel-cotizaciones.rv-cotizaciones-compact .rv-table td[data-key="venta"],
#panel-cotizaciones.rv-cotizaciones-compact .rv-table td[data-key="costoVenta"],
#panel-cotizaciones.rv-cotizaciones-compact .rv-table td[data-key="util"],
#panel-cotizaciones.rv-cotizaciones-compact .rv-table td[data-key="impuesto"] {
  min-width: 72px !important;
  width: 84px;
}
#panel-cotizaciones .rv-table td.rv-td.right {
  text-align: right !important;
}
#panel-cotizaciones .rv-table th[data-sort-key="cod"] {
  text-align: left !important;
}

/* ═══════════════════════════════════════════════════════════════
   Encabezados de tablas de reportes — texto e icono ⇅ a la IZQUIERDA
   (no afecta sort ni .col-resizer; celdas .right siguen a la derecha)
═══════════════════════════════════════════════════════════════ */
.rv-table thead th,
.rv-table thead th.rv-th,
.rv-table thead th.rv-th.right,
.rv-table thead th.rv-th.center,
.rv-table thead th.right,
.rv-table thead th.center,
.rv-table thead th.text-right,
table.tabla-sortable thead th,
table.tabla-sortable thead th.right,
table.tabla-sortable thead th.center,
.ra-dtable thead th,
.ra-dtable thead th.right,
.ra-dtable thead th.cxc-th.right,
th.sortable,
th.sortable-header,
th.uf-sortable,
.sortable-header,
.th-content,
.desktop-grid thead th,
.desktop-grid thead th.right,
.trx-cols-interactive thead th {
  text-align: left !important;
  justify-content: flex-start !important;
}
.rv-table thead th .rv-th-sort,
.rv-table thead th .cxc-sort-ind,
.rv-table thead th .uf-sort-ind,
.rv-table thead th .fr-sort-ind,
.desktop-grid thead th .fr-sort-ind,
.desktop-grid thead th .uf-sort-ind,
th.sortable .uf-sort-ind,
th.sortable-header .uf-sort-ind {
  margin-left: 4px;
  display: inline;
}

/* Toasts centrados en pantalla (Toast + #fcToast) */
#toast-container {
  position: fixed !important;
  top: 50% !important;
  left: 50% !important;
  right: auto !important;
  bottom: auto !important;
  transform: translate(-50%, -50%) !important;
  z-index: 999999 !important;
  pointer-events: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  max-width: 420px;
  width: min(420px, calc(100vw - 32px));
}
#fcToast {
  position: fixed !important;
  top: 50% !important;
  left: 50% !important;
  transform: translate(-50%, -50%) !important;
  z-index: 999999 !important;
}

/* Confirmación de descarte (Nuevo / Esc) — overlay centrado */
#ufConfirmDescarteOverlay {
  position: fixed;
  inset: 0;
  z-index: 1000000;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(15, 23, 42, 0.72);
  backdrop-filter: blur(2px);
}
#ufConfirmDescarteOverlay.active { display: flex; }

/* Encabezados de tabla: sort/resize sin ocultar texto ni forzar centrado */
table.tabla-sortable thead th,
table.table-facturacion thead th,
table.desktop-grid thead th,
table.grid-desktop thead th,
table.fc-table thead th {
  text-align: left !important;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  position: relative;
  padding-right: 14px;
}
table.tabla-sortable thead th .uf-sort-ind,
table.tabla-sortable thead th .fr-sort-ind,
table.tabla-sortable thead th .cxc-sort-ind {
  font-size: 9px;
  opacity: 0.85;
  margin-left: 2px;
}

/* Resaltado uniforme de fila activa en Modal y Entradas */
.table-facturacion tbody tr.selected,
.table-facturacion tbody tr:focus-within,
.table-facturacion tbody tr.active,
.table-facturacion tbody tr.fc-row-active,
.table-facturacion tbody tr.fc-row-editing,
.table-orden-ventas tbody tr.selected,
.table-orden-ventas tbody tr:focus-within,
.table-orden-ventas tbody tr.active,
.table-depositos tbody tr.selected,
.table-depositos tbody tr:focus-within,
.table-depositos tbody tr.active,
.fc-table.table-facturacion tbody tr.selected,
.fc-table.table-facturacion tbody tr:focus-within,
.fc-table.table-facturacion tbody tr.fc-row-active,
.fc-table.table-facturacion tbody tr.fc-row-editing,
table.grid-entrada tbody tr.selected,
table.grid-entrada tbody tr:focus-within,
table.grid-entrada tbody tr.active,
#modal-listado-documentos table tbody tr.selected,
#modal-listado-documentos table tbody tr.active,
#modal-listado-documentos table tbody tr.ld-row-focus,
#modal-listado-documentos .ld-table tbody tr.selected,
#modal-listado-documentos .ld-table tbody tr.active,
#modal-listado-documentos .ld-table tbody tr.ld-row-focus {
  background-color: #2563eb !important; /* Azul Cobalto brillante de alto contraste */
  border-left: 4px solid #f59e0b !important; /* Indicador lateral Dorado */
  box-shadow: none !important;
  transition: background-color 0.15s ease-in-out;
  color: #ffffff !important;
}

#modal-listado-documentos table tbody tr.selected td,
#modal-listado-documentos table tbody tr.active td,
#modal-listado-documentos table tbody tr.ld-row-focus td,
#modal-listado-documentos .ld-table tbody tr.selected td,
#modal-listado-documentos .ld-table tbody tr.active td,
#modal-listado-documentos .ld-table tbody tr.ld-row-focus td,
.table-facturacion tbody tr.selected td,
.table-facturacion tbody tr.selected > td,
.table-facturacion tbody tr:focus-within > td,
.table-facturacion tbody tr.active > td,
.table-facturacion tbody tr.fc-row-active > td,
.table-facturacion tbody tr.fc-row-editing > td,
.table-orden-ventas tbody tr.selected > td,
.table-orden-ventas tbody tr:focus-within > td,
.table-orden-ventas tbody tr.active > td,
.table-depositos tbody tr.selected > td,
.table-depositos tbody tr:focus-within > td,
.table-depositos tbody tr.active > td,
.fc-table.table-facturacion tbody tr.selected > td,
.fc-table.table-facturacion tbody tr:focus-within > td,
.fc-table.table-facturacion tbody tr.fc-row-active > td,
.fc-table.table-facturacion tbody tr.fc-row-editing > td,
table.grid-entrada tbody tr.selected > td,
table.grid-entrada tbody tr:focus-within > td,
table.grid-entrada tbody tr.active > td {
  background-color: #2563eb !important;
  color: #ffffff !important;
}

/* Hover sutil (solo filas no seleccionadas) */
.table-facturacion tbody tr:hover:not(.selected):not(.active):not(.fc-row-active):not(:focus-within),
.table-orden-ventas tbody tr:hover:not(.selected):not(.active):not(:focus-within),
.table-depositos tbody tr:hover:not(.selected):not(.active):not(:focus-within),
.fc-table.table-facturacion tbody tr:hover:not(.selected):not(.fc-row-active):not(:focus-within),
table.grid-entrada tbody tr:hover:not(.selected):not(.active):not(:focus-within) {
  background-color: #1e293b !important;
}
.table-facturacion tbody tr:hover:not(.selected):not(.active):not(.fc-row-active):not(:focus-within) > td,
.table-orden-ventas tbody tr:hover:not(.selected):not(.active):not(:focus-within) > td,
.table-depositos tbody tr:hover:not(.selected):not(.active):not(:focus-within) > td,
.fc-table.table-facturacion tbody tr:hover:not(.selected):not(.fc-row-active):not(:focus-within) > td,
table.grid-entrada tbody tr:hover:not(.selected):not(.active):not(:focus-within) > td {
  background-color: #1e293b !important;
}

/* Modo oscuro FC/CT/OV: azul cobalto + dorado */
body.fc-ui-dark .fc-table tbody tr.fc-row.fc-row-active,
body.fc-ui-dark .fc-table tbody tr.fc-row.fc-row-editing,
body.fc-ui-dark .fc-table tbody tr.fc-row.selected,
body.fc-ui-dark .fc-table tbody tr.fc-row:focus-within,
body.fc-ui-dark .fc-row-active,
body.fc-ui-dark .fc-row-editing,
body.fc-ui-dark .fc-row.selected,
body.fc-ui-dark .fc-row:focus-within {
  background: #2563eb !important;
  border-left: 4px solid #f59e0b !important;
  box-shadow: none !important;
  color: #ffffff !important;
}
body.fc-ui-dark .fc-table tbody tr.fc-row.fc-row-active > td,
body.fc-ui-dark .fc-table tbody tr.fc-row.fc-row-editing > td,
body.fc-ui-dark .fc-table tbody tr.fc-row.selected > td,
body.fc-ui-dark .fc-table tbody tr.fc-row:focus-within > td,
body.fc-ui-dark .fc-row-active .fc-td,
body.fc-ui-dark .fc-row-editing .fc-td,
body.fc-ui-dark .fc-row.selected .fc-td,
body.fc-ui-dark .fc-row:focus-within .fc-td {
  background: #2563eb !important;
  color: #ffffff !important;
}
body.fc-ui-dark .fc-row-active:hover,
body.fc-ui-dark .fc-row-editing:hover,
body.fc-ui-dark .fc-row.selected:hover,
body.fc-ui-dark .fc-row-active:hover .fc-td,
body.fc-ui-dark .fc-row-editing:hover .fc-td,
body.fc-ui-dark .fc-row.selected:hover .fc-td {
  background: #1d4ed8 !important;
}

/* ── LoginModal / autorización gerencia: layout autónomo (sin Tailwind CDN) ─
   Facturas carga Tailwind; Depósitos/Cajas/otras entradas no. Sin estas reglas
   el diálogo queda en flujo de documento (abajo-izquierda) en vez de overlay. */
#unifileLoginModal,
#modal-autorizacion-gerencia,
.uf-login-modal {
  position: fixed !important;
  inset: 0 !important;
  top: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  left: 0 !important;
  z-index: 1000000 !important;
  box-sizing: border-box !important;
  margin: 0 !important;
  padding: 1rem !important;
  align-items: center !important;
  justify-content: center !important;
  background: rgba(0, 0, 0, 0.55) !important;
  -webkit-backdrop-filter: blur(2px);
  backdrop-filter: blur(2px);
}
#unifileLoginModal.hidden,
#modal-autorizacion-gerencia.hidden,
.uf-login-modal.hidden {
  display: none !important;
  pointer-events: none !important;
}
#unifileLoginModal.flex,
#modal-autorizacion-gerencia.flex,
.uf-login-modal.flex,
#unifileLoginModal:not(.hidden),
#modal-autorizacion-gerencia:not(.hidden),
.uf-login-modal:not(.hidden) {
  display: flex !important;
  pointer-events: auto !important;
}
#unifileLoginModal .uf-login-dialog,
#unifileLoginModal .modal-content,
#modal-autorizacion-gerencia .uf-login-dialog,
#modal-autorizacion-gerencia .modal-content,
.uf-login-modal .uf-login-dialog,
.uf-login-modal .modal-content {
  position: relative !important;
  width: 100% !important;
  max-width: 24rem !important;
  margin: 0 auto !important;
  border-radius: 0.5rem !important;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.55) !important;
  overflow: hidden !important;
}
#unifileLoginModal .uf-login-form,
#modal-autorizacion-gerencia .uf-login-form {
  display: block !important;
  padding: 1rem !important;
}
#unifileLoginModal .uf-login-form > div,
#modal-autorizacion-gerencia .uf-login-form > div {
  margin-bottom: 0.75rem;
}
#unifileLoginModal .uf-login-form > div:last-child,
#modal-autorizacion-gerencia .uf-login-form > div:last-child {
  margin-bottom: 0;
  display: flex !important;
  gap: 0.5rem !important;
  padding-top: 0.25rem;
}
#unifileLoginModal .uf-login-label,
#modal-autorizacion-gerencia .uf-login-label,
#unifileLoginModal label,
#modal-autorizacion-gerencia label {
  display: block !important;
  margin-bottom: 0.25rem;
  font-size: 11px;
  font-weight: 600;
}
#unifileLoginModal input[type="email"],
#unifileLoginModal input[type="text"],
#unifileLoginModal input[type="password"],
#modal-autorizacion-gerencia input[type="email"],
#modal-autorizacion-gerencia input[type="text"],
#modal-autorizacion-gerencia input[type="password"] {
  display: block !important;
  width: 100% !important;
  box-sizing: border-box !important;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  padding: 0.5rem 0.75rem;
  font-size: 0.875rem;
}
#unifileLoginModal #ufLoginCancel,
#unifileLoginModal #ufLoginSubmit,
#unifileLoginModal #btn-autorizar-gerencia,
#modal-autorizacion-gerencia #ufLoginCancel,
#modal-autorizacion-gerencia #ufLoginSubmit,
#modal-autorizacion-gerencia #btn-autorizar-gerencia {
  flex: 1 1 0 !important;
  padding: 0.5rem 0.75rem !important;
  font-size: 12px !important;
  font-weight: 700 !important;
  border-radius: 6px !important;
  cursor: pointer;
}
#unifileLoginModal #ufLoginError.hidden,
#modal-autorizacion-gerencia #ufLoginError.hidden {
  display: none !important;
}
body.uf-login-modal-open {
  overflow: hidden !important;
}

/* ── Modal autorización gerencia / login (tema oscuro, alta especificidad) ─ */
#modal-autorizacion-gerencia,
#unifileLoginModal.uf-login-auth {
  background: rgba(2, 6, 23, 0.72) !important;
}
#modal-autorizacion-gerencia .modal-content,
#modal-autorizacion-gerencia .uf-login-dialog,
#unifileLoginModal.uf-login-auth .modal-content,
#unifileLoginModal.uf-login-auth .uf-login-dialog {
  background-color: #0f172a !important;
  color: #ffffff !important;
  border: 1px solid #334155 !important;
}
#modal-autorizacion-gerencia .uf-login-form,
#unifileLoginModal.uf-login-auth .uf-login-form {
  background-color: #0f172a !important;
}
#modal-autorizacion-gerencia .uf-login-label,
#unifileLoginModal.uf-login-auth .uf-login-label,
#modal-autorizacion-gerencia label,
#unifileLoginModal.uf-login-auth label {
  color: #cbd5e1 !important;
}
#modal-autorizacion-gerencia input[type="email"],
#modal-autorizacion-gerencia input[type="text"],
#modal-autorizacion-gerencia input[type="password"],
#unifileLoginModal.uf-login-auth input[type="email"],
#unifileLoginModal.uf-login-auth input[type="text"],
#unifileLoginModal.uf-login-auth input[type="password"],
body.fc-ui-dark #modal-autorizacion-gerencia input,
body.cf-ui-dark #modal-autorizacion-gerencia input {
  background-color: #1e293b !important;
  color: #ffffff !important;
  border: 1px solid #475569 !important;
  padding: 10px !important;
  border-radius: 6px !important;
  -webkit-text-fill-color: #ffffff !important;
  caret-color: #ffffff !important;
}
#modal-autorizacion-gerencia input::placeholder,
#unifileLoginModal.uf-login-auth input::placeholder {
  color: #94a3b8 !important;
  opacity: 1 !important;
}
#modal-autorizacion-gerencia #ufLoginError,
#unifileLoginModal.uf-login-auth #ufLoginError {
  color: #fca5a5 !important;
}
#modal-autorizacion-gerencia #ufLoginCancel,
#unifileLoginModal.uf-login-auth #ufLoginCancel {
  background: #334155 !important;
  border-color: #475569 !important;
  color: #f1f5f9 !important;
}
#modal-autorizacion-gerencia #btn-autorizar-gerencia,
#modal-autorizacion-gerencia #ufLoginSubmit,
#unifileLoginModal.uf-login-auth #btn-autorizar-gerencia,
#unifileLoginModal.uf-login-auth #ufLoginSubmit {
  background: #84cc16 !important;
  color: #0f172a !important;
  border: none !important;
}

.custom-options {
  background-color: #0f172a !important;
  color: #f8fafc !important;
}
.custom-option:hover,
.custom-option.selected,
.custom-option.active {
  background-color: #2563eb !important;
  color: #ffffff !important;
  font-weight: 700 !important;
}

/* Panel propio: Windows/Chrome ignora option:hover y pinta un celeste ilegible */
.uf-select-panel {
  position: fixed;
  z-index: 2147483000;
  background: #0f172a;
  color: #f8fafc;
  border: 1px solid #334155;
  border-radius: 6px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, .55);
  max-height: 280px;
  overflow-y: auto;
  min-width: 160px;
  padding: 4px 0;
}
.uf-select-item {
  display: block;
  padding: 7px 12px;
  font-size: 12px;
  color: #e2e8f0;
  cursor: pointer;
  white-space: nowrap;
  font-weight: 500;
}
.uf-select-item:hover,
.uf-select-item.is-active,
.uf-select-item.is-selected {
  background-color: #2563eb !important;
  color: #ffffff !important;
  font-weight: 700 !important;
}

.modal-buscador-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.8);
  z-index: 9999999;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ── Facturación: Acciones alto contraste (paridad Transferencias) ── */
.fc-actions-col .fc-action-grid .fc-btn,
.fc-action-grid .fc-btn,
.acciones-grid button,
.btn-accion {
  display: flex !important;
  align-items: center !important;
  justify-content: flex-start !important;
  gap: 12px !important;
  width: 100% !important;
  min-height: 44px;
  padding: 0 12px 0 18px !important;
  box-sizing: border-box !important;
  text-align: left !important;
  color: #ffffff !important;
  font-weight: 700;
  text-transform: none !important;
  letter-spacing: .02em;
  border: 1px solid rgba(255, 255, 255, 0.2);
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.25);
  transition: filter .12s, transform .12s;
}
.fc-action-grid .fc-btn .fc-btn-ico,
.fc-action-grid .fc-btn svg,
.acciones-grid button svg,
.btn-accion svg {
  width: 22px !important;
  height: 22px !important;
  min-width: 22px !important;
  min-height: 22px !important;
  flex-shrink: 0 !important;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.fc-actions-col .fc-action-grid .fc-btn:hover:not(:disabled),
.fc-action-grid .fc-btn:hover:not(:disabled) {
  filter: brightness(1.15);
}
.fc-actions-col .fc-action-grid .fc-btn:disabled,
.fc-action-grid .fc-btn:disabled {
  opacity: .45;
  cursor: not-allowed;
  filter: none;
}
.fc-action-grid .fc-btn-green,
.fc-action-grid #fcBtnGrabar {
  background: #16a34a !important;
  color: #ffffff !important;
}
.fc-action-grid .fc-btn-blue {
  background: #2563eb !important;
  color: #ffffff !important;
}
.fc-action-grid .fc-btn-red {
  background: #dc2626 !important;
  color: #ffffff !important;
}
.fc-action-grid .fc-btn-amber,
.fc-action-grid #fcBtnReservar {
  background: #d97706 !important;
  color: #ffffff !important;
}
.fc-action-grid .fc-btn-sky {
  background: #0284c7 !important;
  color: #ffffff !important;
}
.fc-action-grid .fc-btn-indigo {
  background: #4f46e5 !important;
  color: #ffffff !important;
}
.fc-action-grid .fc-btn-teal,
.fc-action-grid #fcBtnImprimir {
  background: #0d9488 !important;
  color: #ffffff !important;
}
.fc-action-grid .fc-btn-anular,
.fc-action-grid .fc-btn-dark,
.fc-action-grid #fcBtnAnular {
  background: #9f1239 !important;
  color: #ffffff !important;
}
body.fc-ui-dark .fc-action-grid .fc-btn-dark,
body.fc-ui-dark .fc-action-grid #fcBtnAnular {
  background: #9f1239 !important;
  color: #ffffff !important;
}
