/* Unifile — layout viewport + tema oscuro Recibos / Facturas */

select, input[type="date"], input[type="datetime-local"] {
  color-scheme: dark !important;
  accent-color: #1E3A8A !important;
  background-color: #0B0F19 !important;
  color: #FFFFFF !important;
  border: 1px solid #334155 !important;
}

select.cat-input,
select {
    appearance: none !important;
    -webkit-appearance: none !important;
    -moz-appearance: none !important;
    color-scheme: dark !important;
    accent-color: #1E3A8A !important;
    background-color: #0B0F19 !important;
    color: #FFFFFF !important;
    border: 1px solid #334155 !important;
    padding: 8px 30px 8px 12px !important;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23FFFFFF' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e") !important;
    background-repeat: no-repeat !important;
    background-position: right 10px center !important;
    background-size: 14px !important;
}

select.cat-input,
.cat-input select {
  color: #FFFFFF !important;
  background-color: #0B0F19 !important;
}

select option,
select.cat-input option,
option {
    color-scheme: dark !important;
    background-color: #131C2E !important;
    color: #FFFFFF !important;
    padding: 8px !important;
    font-size: 14px !important;
}

select option:hover,
select option:focus,
select option:active,
select option:checked,
select.cat-input option:hover,
select.cat-input option:focus,
select.cat-input option:active,
select.cat-input option:checked {
    background-color: #1E3A8A !important;
    color: #FFFFFF !important;
}

select.cat-input:focus {
    border-color: #2563eb !important;
}

/* Contenedor del Custom Dropdown */
.custom-select-wrapper {
  position: relative;
  user-select: none;
  width: 100%;
}

.custom-select-wrapper > select {
  display: none !important;
}

.custom-select-trigger {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 9px 14px;
  font-size: 14px;
  font-weight: 500;
  color: #ffffff;
  background-color: #0f192e;
  border: 1px solid #1e293b;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.custom-select-trigger:hover,
.custom-select-wrapper.open .custom-select-trigger {
  border-color: #2563eb;
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.2);
}

.custom-select-trigger::after {
  content: "▾";
  font-size: 12px;
  color: #94a3b8;
  margin-left: 10px;
}

.custom-select-value {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
  min-width: 0;
}

/* Lista de opciones desplegable dentro del DOM */
.custom-options {
  position: absolute;
  display: block;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  border: 1px solid #334155;
  border-radius: 6px;
  background-color: #131C2E;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.5);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  z-index: 999;
  max-height: 220px;
  overflow-y: auto;
  transition: all 0.15s ease-in-out;
}

.custom-select-wrapper.open {
  z-index: 1000;
}

.custom-select-wrapper.open .custom-options {
  opacity: 1;
  visibility: visible;
  pointer-events: all;
}

/* Opción individual */
.custom-option {
  position: relative;
  display: block;
  padding: 10px 14px;
  font-size: 14px;
  color: #e2e8f0;
  cursor: pointer;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.custom-option.disabled {
  opacity: 0.45;
  pointer-events: none;
  cursor: default;
}

.custom-option:hover {
  background-color: #2563EB !important;
  color: #FFFFFF !important;
}
.custom-option.selected {
  background-color: #1E3A8A !important;
  color: #FFFFFF !important;
  box-shadow: inset 0 0 0 1px #3B82F6;
  font-weight: 700 !important;
}

.uf-select-panel {
  position: fixed;
  z-index: 2147483000;
  background: #131C2E;
  color: #FFFFFF;
  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: #FFFFFF;
  cursor: pointer;
  white-space: nowrap;
  font-weight: 500;
}
.uf-select-item:hover,
.uf-select-item.is-active,
.uf-select-item.is-selected {
  background-color: #1E3A8A !important;
  color: #FFFFFF !important;
  font-weight: 700 !important;
  box-shadow: inset 0 0 0 1px #3B82F6;
}

/* ── Recibos de Clientes: viewport ───────────────────────────────────────── */
html.rc-page,
html.rc-page body {
  height: 100vh;
  height: 100dvh;
  margin: 0;
  overflow: hidden;
  background: #0f172a;
  color: #f8fafc;
  color-scheme: dark;
}

html.rc-page body {
  display: flex;
  flex-direction: column;
  background: #0f172a !important;
}

html.rc-page #egBody {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: #121e2d;
}

html.rc-page .eg-table-wrapper {
  flex: 1 1 auto;
  min-height: 0;
  overflow-x: auto;
  overflow-y: auto;
  background: #1e293b !important;
}

html.rc-page .rc-footer {
  flex-shrink: 0;
  position: sticky;
  bottom: 0;
  z-index: 10;
  background: #1e293b;
  box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.35);
}

html.rc-page .eg-bottom-panel,
html.rc-page .eg-action-bar {
  flex-shrink: 0;
}

/* ── Recibos: tema oscuro ERP ────────────────────────────────────────────── */
html.rc-page .rc-header {
  display: grid;
  grid-template-columns: minmax(240px, 280px) minmax(0, 1fr) auto;
  align-items: start;
}

html.rc-page .rc-header,
html.rc-page .rc-header-left,
html.rc-page .rc-header-center,
html.rc-page .rc-header-right {
  background: #1e293b !important;
  border-color: #334155 !important;
  color: #f8fafc !important;
}

html.rc-page .rc-header-center {
  padding: 8px 12px;
  min-width: 0;
  border-right: 1px solid #334155;
}

html.rc-page .rc-info-cards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  min-width: 0;
}

html.rc-page .rc-card {
  background: #1e293b;
  border: 1px solid #334155;
  border-radius: 6px;
  padding: 8px 10px;
  min-width: 0;
}

html.rc-page .rc-card-title {
  margin: 0 0 6px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #7dd3fc;
}

html.rc-page .rc-card-grid {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  column-gap: 10px;
  row-gap: 3px;
  margin: 0;
}

html.rc-page .rc-card-grid dt {
  font-size: 11px;
  font-weight: 600;
  color: #94a3b8;
  white-space: nowrap;
}

html.rc-page .rc-card-grid dd {
  margin: 0;
  min-width: 0;
  font-size: 12px;
  font-weight: 700;
  color: #f8fafc;
  text-align: right;
  overflow: hidden;
  text-overflow: clip;
  white-space: nowrap;
}

html.rc-page .rc-card-grid dd span {
  font-variant-numeric: tabular-nums;
}

html.rc-page .badge-estado {
  display: inline-block;
  padding: 0 7px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  background: #334155;
  color: #cbd5e1;
}

html.rc-page .badge-estado.corriente {
  background: rgba(34, 197, 94, 0.18);
  color: #22c55e;
}

html.rc-page .badge-estado.vencido {
  background: rgba(239, 68, 68, 0.18);
  color: #ef4444;
}

html.rc-page #lbl-dias-venc.vencido,
html.rc-page #lbl-disponible.vencido {
  color: #ef4444;
}

html.rc-page #lbl-saldo-lps {
  color: #fbbf24;
}

html.rc-page #lbl-disponible {
  color: #22c55e;
}

html.rc-page .rc-company {
  color: #7dd3fc;
  border-bottom-color: #334155;
}

html.rc-page .eg-lbl,
html.rc-page .eg-lbl-block,
html.rc-page .rc-help,
html.rc-page .rc-help span,
html.rc-page .eg-total-lbl {
  color: #94a3b8;
}

html.rc-page .eg-input,
html.rc-page .eg-select,
html.rc-page .eg-input-mono,
html.rc-page .eg-input-num,
html.rc-page .eg-input-code,
html.rc-page .eg-input-date,
html.rc-page .eg-doc-num,
html.rc-page .rc-concepto,
html.rc-page .eg-input-hi {
  background: #0f172a !important;
  border-color: #475569 !important;
  color: #f8fafc !important;
}

html.rc-page .eg-input:focus,
html.rc-page .eg-select:focus,
html.rc-page .eg-doc-num:focus,
html.rc-page .rc-concepto:focus,
html.rc-page .eg-input-hi:focus {
  border-color: #38bdf8;
  box-shadow: 0 0 0 2px rgba(56, 189, 248, 0.2);
}

html.rc-page .eg-select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%2394a3b8' stroke-width='2'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='M19 9l-7 7-7-7'/%3E%3C/svg%3E");
}

html.rc-page .eg-search-btn,
html.rc-page .rc-cal-btn {
  background: #334155 !important;
  border-color: #475569 !important;
  color: #e2e8f0 !important;
}

html.rc-page .eg-search-btn:hover,
html.rc-page .rc-cal-btn:hover {
  background: #475569 !important;
}

html.rc-page .rc-fecha-block {
  background: #0f172a !important;
  border-color: #334155 !important;
}

html.rc-page .eg-table {
  background: #1e293b;
  color: #e2e8f0;
}

html.rc-page .eg-th {
  background: #1e3a8a !important;
  color: #dbeafe !important;
  border-right-color: #1d4ed8 !important;
}

html.rc-page .eg-td {
  color: #e2e8f0 !important;
  border-bottom-color: #334155 !important;
  border-right-color: #334155 !important;
  background: #1e293b !important;
}

html.rc-page .eg-row,
html.rc-page .eg-row:nth-child(even) {
  background: #1e293b;
}

html.rc-page .eg-row:hover {
  background: #243447 !important;
}

html.rc-page .eg-row-active,
html.rc-page .eg-row-active:hover {
  background: #1e3a5c !important;
}

html.rc-page .eg-row-active .eg-td {
  color: #f8fafc !important;
  background: transparent !important;
}

html.rc-page .eg-row-empty:hover {
  background: transparent !important;
}

html.rc-page .eg-row-empty .eg-td {
  color: transparent !important;
  border-bottom-color: #1e293b !important;
  background: #1e293b !important;
}

html.rc-page .eg-cell-input {
  color: #f8fafc;
}

html.rc-page .eg-cell-input:focus {
  background: #0f172a !important;
  border-color: #38bdf8 !important;
  color: #f8fafc !important;
}

html.rc-page .eg-table thead th {
  z-index: 4;
}

html.rc-page .eg-table tfoot td {
  position: sticky;
  bottom: 0;
  z-index: 3;
  background: #1e3a8a;
  color: #f8fafc;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  border-top: 2px solid #1d4ed8;
  border-right: 1px solid #1e40af;
  padding: 5px 5px;
  white-space: nowrap;
}

html.rc-page .eg-table tfoot td:last-child {
  border-right: none;
}

html.rc-page .eg-tfoot-lbl {
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-size: 10px;
  color: #93c5fd;
}

html.rc-page .eg-bottom-panel,
html.rc-page .eg-totals-col,
html.rc-page .eg-action-bar {
  background: #1e293b !important;
  border-color: #334155 !important;
  color: #e2e8f0 !important;
}

html.rc-page .eg-total-val {
  color: #f8fafc;
}

html.rc-page .eg-total-row-grand {
  background: #0f172a;
}

html.rc-page .eg-total-row-grand .eg-total-lbl {
  color: #86efac;
}

html.rc-page .eg-total-row-grand .eg-total-val,
html.rc-page #valGranTotalLps {
  color: #22c55e !important;
  font-weight: 800;
}

html.rc-page #valTotalLps {
  color: #38bdf8 !important;
}

html.rc-page .eg-total-row-usd .eg-total-lbl,
html.rc-page #valGranTotalUSD {
  color: #86efac !important;
}

html.rc-page .eg-btn-dark {
  background: #334155 !important;
  border-color: #64748b !important;
  color: #e2e8f0 !important;
}

html.rc-page .eg-btn-dark:hover {
  background: #475569 !important;
}

html.rc-page .eg-total-row-usd .eg-total-val {
  color: #4ade80;
}

/* ── Catálogo de Cuentas: Unifile 2027 Dark ERP ──────────────────────────── */
html.cat-page,
html.cat-page body {
  height: 100vh;
  height: 100dvh;
  margin: 0;
  overflow: hidden;
  background: #0f172a;
  color: #f8fafc;
  color-scheme: dark;
}

html.cat-page body {
  display: flex;
  flex-direction: column;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

html.cat-page .hidden {
  display: none !important;
}

html.cat-page .cat-titlebar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
  padding: 6px 12px;
  background: linear-gradient(90deg, #0f172a 0%, #1e293b 100%);
  border-bottom: 1px solid #334155;
  gap: 12px;
}

html.cat-page .cat-back-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border: 1px solid #334155;
  border-radius: 4px;
  background: #1e293b;
  color: #7dd3fc;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  text-decoration: none;
}

html.cat-page .cat-back-btn:hover {
  border-color: #38bdf8;
  color: #f8fafc;
}

html.cat-page .cat-title-module {
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #38bdf8;
}

html.cat-page .cat-title-operator {
  flex: 1;
  text-align: center;
  font-size: 11px;
  font-weight: 600;
  color: #f8fafc;
}

html.cat-page .cat-win-controls {
  display: flex;
  gap: 6px;
}

html.cat-page .cat-win-btn {
  width: 18px;
  height: 18px;
  border: 0;
  border-radius: 2px;
  font-size: 9px;
  font-weight: 900;
  cursor: pointer;
}

html.cat-page .cat-win-min { background: #fbbf24; color: #78350f; }
html.cat-page .cat-win-max { background: #22c55e; color: #14532d; }
html.cat-page .cat-win-close { background: #ef4444; color: #fff; }

html.cat-page .cat-main {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  gap: 12px;
  padding: 12px;
}

html.cat-page .cat-card {
  background: #1e293b;
  border: 1px solid #334155;
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
}

html.cat-page .cat-col-izq {
  width: 35%;
  min-width: 250px;
  max-width: 320px;
  overflow-x: auto !important;
  overflow-y: auto !important;
}

html.cat-page .cat-col-der {
  flex: 1 1 auto;
  min-width: 0;
}

html.cat-page .cat-search-bar {
  display: flex;
  gap: 8px;
  padding: 10px 12px;
  border-bottom: 1px solid #334155;
  background: #1e293b;
  flex-shrink: 0;
  align-items: center;
}

html.cat-page .cat-search-wrap {
  position: relative;
  flex: 1;
}

html.cat-page .cat-search-wrap svg {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  width: 18px;
  height: 18px;
  min-width: 18px;
  color: #64748b;
  pointer-events: none;
}

html.cat-page .cat-input,
html.cat-page .cat-select,
html.cat-page .cat-textarea,
html.cat-page select.custom-select,
html.cat-page select.form-control-dark,
html.cat-page .custom-select,
html.cat-page .form-control-dark {
  width: 100%;
  background: #0f192e;
  border: 1px solid #1e293b;
  border-radius: 6px;
  color: #ffffff;
  padding: 8px 12px;
  font-size: 13px;
  outline: none;
  color-scheme: dark !important;
}

html.cat-page .cat-input,
html.cat-page .cat-textarea {
  cursor: text;
}

html.cat-page .cat-select,
html.cat-page select.custom-select,
html.cat-page select.form-control-dark {
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%2394a3b8' stroke-width='2'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='M19 9l-7 7-7-7'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  background-size: 16px 16px;
  padding-right: 34px;
}

html.cat-page .cat-search-wrap .cat-input {
  padding-left: 34px;
}

html.cat-page .cat-input:focus,
html.cat-page .cat-select:focus,
html.cat-page .cat-textarea:focus,
html.cat-page select.custom-select:focus,
html.cat-page select.form-control-dark:focus,
html.cat-page .custom-select:focus,
html.cat-page .form-control-dark:focus {
  border-color: #2563eb;
  box-shadow: 0 0 0 1px #2563eb;
  outline: 1px solid #2563eb;
}

/* Clave de seguridad: type=text + máscara CSS (evita "Guardar contraseña" de Chrome) */
#input-clave-seguridad {
  -webkit-text-security: disc !important;
  -moz-text-security: disc !important;
  text-security: disc !important;
}

/* Desplegable nativo: color-scheme dark (Chrome/Windows ignora :hover/:checked en <option>) */
html.cat-page select.cat-select,
html.cat-page select.custom-select,
html.cat-page select.form-control-dark,
html.cat-page select.cat-select option,
html.cat-page select.custom-select option,
html.cat-page select.form-control-dark option,
html.cat-page .cat-select option,
html.cat-page .custom-select option,
html.cat-page .form-control-dark option {
  color-scheme: dark !important;
  background-color: #131C2E !important;
  color: #FFFFFF !important;
}

html.cat-page select option:hover,
html.cat-page select option:focus,
html.cat-page select option:active,
html.cat-page select option:checked {
  background-color: #1E3A8A !important;
  color: #FFFFFF !important;
}

html.cat-page #field-codigo,
html.cat-page #field-nombre,
html.cat-page #field-nombre-corto,
html.cat-page #field-codigo-barra,
html.cat-page #txt-buscar-etiqueta,
html.cat-page #input-etiquetas-busqueda,
html.cat-page .input-codigo-ref-sup {
  text-transform: uppercase;
}

html.cat-page #field-concepto {
  text-transform: none;
}

html.cat-page .cat-label {
  display: block;
  margin-bottom: 4px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #38bdf8;
}

html.cat-page .cat-icon-btn {
  width: 36px;
  height: 36px;
  border: 1px solid #334155;
  border-radius: 6px;
  background: #0f172a;
  color: #94a3b8;
  cursor: pointer;
  flex-shrink: 0;
}

html.cat-page .cat-icon-btn:hover {
  color: #38bdf8;
  border-color: #38bdf8;
}

html.cat-page #tree-container,
html.cat-page .tree-container {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  padding: 8px 10px;
  width: max-content !important;
  min-width: 100%;
  overflow-x: auto !important;
}

html.cat-page .cat-tree-node,
html.cat-page .tree-node {
  margin-bottom: 1px;
  white-space: nowrap !important;
  text-overflow: clip !important;
  overflow: visible !important;
}

html.cat-page .cat-tree-item {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 3px 6px;
  border-radius: 4px;
  font-size: 13px;
  color: #f8fafc;
  cursor: pointer;
  user-select: none;
}

html.cat-page .cat-tree-item:hover {
  background: #334155;
}

html.cat-page .cat-tree-item.selected {
  background: rgba(56, 189, 248, 0.16);
  border: 1px solid #38bdf8;
}

html.cat-page .cat-tree-toggle {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  color: #94a3b8;
}

html.cat-page .cat-tree-toggle.has-kids {
  color: #38bdf8;
  cursor: pointer;
}

html.cat-page .cat-tree-code {
  color: #38bdf8;
  font-variant-numeric: tabular-nums;
  font-size: 12px;
  flex-shrink: 0;
}

html.cat-page .cat-tree-name {
  min-width: 0;
  overflow: visible !important;
  text-overflow: clip !important;
  white-space: nowrap !important;
}

html.cat-page .cat-tree-name.mayor {
  font-weight: 700;
}

html.cat-page .cat-tree-branch {
  margin-left: 12px;
  border-left: 1px solid #334155;
  padding-left: 4px;
}

html.cat-page .cat-tree-branch.collapsed {
  display: none;
}

html.cat-page .cat-tree-empty,
html.cat-page .cat-tree-loading {
  padding: 16px 8px;
  text-align: center;
  color: #94a3b8;
  font-size: 12px;
}

html.cat-page .cat-col-izq-foot,
html.cat-page .cat-col-der-foot {
  display: flex;
  gap: 8px;
  padding: 10px 12px;
  border-top: 1px solid #334155;
  background: #1e293b;
  flex-shrink: 0;
}

html.cat-page .cat-breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
  padding: 8px 16px;
  border-bottom: 1px solid #334155;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #94a3b8;
}

html.cat-page .cat-breadcrumb .current {
  color: #38bdf8;
}

html.cat-page #panel-derecho-wrapper {
  overflow: hidden;
  width: 100%;
  position: relative;
  flex: 1 1 auto;
  min-height: 0;
}

html.cat-page #panel-derecho-slider {
  display: flex;
  width: 200%;
  height: 100%;
  transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  transform: translateX(0%);
}

html.cat-page #vista-registro-basico,
html.cat-page #vista-parametros-avanzados {
  width: 50%;
  flex-shrink: 0;
  height: 100%;
  overflow-y: auto;
  padding: 16px 20px;
  box-sizing: border-box;
}

html.cat-page .cat-vista-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

html.cat-page .cat-vista-head h2 {
  margin: 0;
  font-size: 16px;
  font-weight: 800;
  color: #f8fafc;
}

html.cat-page .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border-radius: 6px;
  border: 1px solid transparent;
  padding: 8px 14px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  cursor: pointer;
}

html.cat-page .btn-primary {
  background: #0284c7;
  border-color: #0369a1;
  color: #f8fafc;
}

html.cat-page .btn-primary:hover {
  background: #0384d4;
}

html.cat-page .btn-outline-secondary {
  background: transparent;
  border-color: #475569;
  color: #cbd5e1;
}

html.cat-page .btn-outline-secondary:hover {
  border-color: #38bdf8;
  color: #38bdf8;
}

html.cat-page .btn-success {
  background: #2b8a3e;
  border-color: #2b8a3e;
  color: #fff;
  font-weight: bold;
}

html.cat-page #btn-mas-info,
html.cat-page #btn-regresar-basico,
html.cat-page #btn-toggle-avanzado,
html.cat-page #btn-toggle-basico,
html.cat-page .cat-btn-nav-verde {
  background: #2b8a3e !important;
  color: #ffffff !important;
  font-weight: bold;
  border: none !important;
  border-radius: 4px;
}

html.cat-page #btn-mas-info:hover,
html.cat-page #btn-regresar-basico:hover,
html.cat-page .cat-btn-nav-verde:hover {
  background: #237a35 !important;
  color: #ffffff !important;
}

html.cat-page .cat-foto-frame {
  cursor: pointer;
}

html.cat-page .cat-foto-frame:hover {
  border-color: #2b8a3e;
}

html.cat-page .btn-ghost {
  background: #334155;
  border-color: #475569;
  color: #e2e8f0;
}

html.cat-page .btn-danger-outline {
  background: #0f172a;
  border-color: #334155;
  color: #f8fafc;
}

html.cat-page .btn-danger-outline:hover {
  border-color: #ef4444;
  color: #fecaca;
}

/* Selector refs trabajador: display + [X] + botón azul flecha (mismo renglón WinDEV) */
html.cat-page .cat-trab-ref-row {
  display: flex;
  flex-wrap: nowrap;
  gap: 6px;
  align-items: center;
  width: 100%;
  box-sizing: border-box;
}

html.cat-page .cat-trab-ref-row .cat-input {
  flex: 1 1 auto;
  min-width: 0;
  width: auto; /* anula .cat-input { width:100% } que empuja botones abajo */
  max-width: none;
  background: #0B0F19;
}

html.cat-page .cat-trab-btn-select {
  flex: 0 0 40px;
  width: 40px;
  height: 40px;
  min-width: 40px;
  padding: 0;
  margin: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #1E3A8A;
  border: 1px solid #93C5FD;
  border-radius: 6px;
  color: #FFFFFF;
  cursor: pointer;
  box-sizing: border-box;
  order: 3;
}

html.cat-page .cat-trab-btn-select:hover {
  background: #2563EB;
  border-color: #BFDBFE;
}

html.cat-page .cat-trab-btn-select:focus {
  outline: none;
  border-color: #22D3EE;
  box-shadow: 0 0 0 2px rgba(34, 211, 238, 0.55);
}

html.cat-page .cat-trab-btn-select:focus-visible {
  outline: 2px solid #22D3EE;
  outline-offset: 2px;
}

html.cat-page .cat-trab-btn-select svg {
  width: 18px;
  height: 18px;
  display: block;
  pointer-events: none;
  stroke: #FFFFFF;
  fill: none;
}

html.cat-page .cat-trab-btn-clear {
  flex: 0 0 28px;
  width: 28px;
  height: 28px;
  min-width: 28px;
  padding: 0;
  margin: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: 1px solid #7f1d1d;
  border-radius: 4px;
  color: #991B1B;
  font-size: 14px;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  box-sizing: border-box;
  order: 2;
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
}

html.cat-page .cat-trab-btn-clear.is-visible {
  visibility: visible;
  opacity: 1;
  pointer-events: auto;
}

html.cat-page .cat-trab-btn-clear:hover,
html.cat-page .cat-trab-btn-clear:focus {
  background: rgba(127, 29, 29, 0.35);
  border-color: #C80722;
  color: #fecaca;
  outline: none;
}

html.cat-page .cat-basico-topbar {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 14px;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.15);
}

html.cat-page .cat-basico-niveles {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

html.cat-page .cat-nivel-field {
  min-width: 180px;
  flex: 0 1 220px;
  overflow: visible;
}

html.cat-page .cat-basico-etiquetas {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 6px;
  position: relative;
}

html.cat-page .cat-etiquetas-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  width: 100%;
  min-height: 28px;
}

html.cat-page .badge-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(56, 189, 248, 0.15);
  border: 1px solid rgba(56, 189, 248, 0.35);
  color: #e2e8f0;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

html.cat-page .btn-remove-tag {
  cursor: pointer;
  font-style: normal;
  opacity: 0.75;
  line-height: 1;
}

html.cat-page .btn-remove-tag:hover {
  opacity: 1;
  color: #fca5a5;
}

html.cat-page .cat-etiqueta-search-wrap {
  position: relative;
  width: 100%;
}

html.cat-page .cat-etiquetas-ac {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  z-index: 30;
  max-height: 220px;
  overflow-y: auto;
  background: #1e293b;
  border: 1px solid rgba(148, 163, 184, 0.25);
  border-radius: 8px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
}

html.cat-page .cat-etiquetas-ac.hidden {
  display: none;
}

html.cat-page .cat-etiquetas-ac-item {
  padding: 8px 12px;
  cursor: pointer;
  font-size: 13px;
  color: #e2e8f0;
  border-bottom: 1px solid rgba(148, 163, 184, 0.08);
}

html.cat-page .cat-etiquetas-ac-item:last-child {
  border-bottom: none;
}

html.cat-page .cat-etiquetas-ac-item:hover,
html.cat-page .cat-etiquetas-ac-item.active {
  background: rgba(56, 189, 248, 0.12);
}

html.cat-page .cat-etiquetas-ac-empty {
  padding: 10px 12px;
  color: #94a3b8;
  font-size: 12px;
}

html.cat-page .cat-basico-grid {
  display: flex;
  gap: 20px;
}

html.cat-page .cat-basico-form {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

html.cat-page .cat-foto-box {
  width: 220px;
  flex-shrink: 0;
}

html.cat-page .cat-foto-frame {
  position: relative;
  width: 100%;
  aspect-ratio: 3 / 4;
  border: 2px dashed #334155;
  border-radius: 16px;
  background: #0f172a;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #64748b;
}

html.cat-page .cat-foto-frame img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

html.cat-page .cat-foto-frame img.is-empty {
  display: none;
}

html.cat-page .cat-estado {
  display: flex;
  gap: 16px;
  align-items: center;
  color: #f8fafc;
  font-size: 13px;
}

html.cat-page .cat-estado input {
  accent-color: #38bdf8;
}

html.cat-page .cat-tabs {
  display: flex;
  gap: 16px;
  border-bottom: 1px solid #334155;
  margin: 0 0 16px;
  flex-wrap: wrap;
}

html.cat-page .cat-tab {
  background: none;
  border: 0;
  border-bottom: 2px solid transparent;
  padding: 8px 2px 10px;
  color: #94a3b8;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  cursor: pointer;
}

html.cat-page .cat-tab.active {
  color: #38bdf8;
  border-bottom-color: #38bdf8;
}

html.cat-page .cat-tab.hidden {
  display: none;
}

html.cat-page .cat-tab-panel.hidden {
  display: none;
}

html.cat-page .cat-subtabs {
  display: flex;
  gap: 12px;
  border-bottom: 1px solid #334155;
  margin: 0 0 16px;
  flex-wrap: wrap;
}

html.cat-page .cat-subtab {
  background: none;
  border: 0;
  border-bottom: 2px solid transparent;
  padding: 6px 2px 8px;
  color: #94a3b8;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

html.cat-page .cat-subtab.active {
  color: #38bdf8;
  border-bottom-color: #38bdf8;
}

html.cat-page .cat-subtab-panel.hidden {
  display: none;
}

html.cat-page #tbody-horario-trabajo input,
html.cat-page #tbody-dias-feriados input {
  width: 100%;
  min-width: 86px;
  text-align: center;
}

html.cat-page #tbody-dias-feriados tr.row-selected,
html.cat-page #tbody-dias-feriados tr.row-selected > td {
  background: #1e3a5f;
}

html.cat-page .cat-muted {
  color: #94a3b8;
  font-size: 13px;
}

html.cat-page .cat-count {
  margin-left: auto;
  font-size: 10px;
  font-weight: 700;
  color: #38bdf8;
}

html.cat-page .cat-col-der-foot {
  justify-content: flex-end;
}

html.cat-page .cat-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
}

html.cat-page .cat-modal.hidden {
  display: none;
}

html.cat-page .cat-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(2, 6, 23, 0.72);
}

html.cat-page .cat-modal-dialog {
  position: relative;
  width: min(460px, calc(100vw - 32px));
  background: #0f172a;
  border: 1px solid rgba(148, 163, 184, 0.25);
  border-radius: 12px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.45);
}

html.cat-page .cat-modal-header {
  padding: 14px 16px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.15);
}

html.cat-page .cat-modal-header h3 {
  margin: 0;
  font-size: 16px;
  color: #f8fafc;
}

html.cat-page .cat-modal-body {
  padding: 16px;
  display: grid;
  gap: 14px;
}

html.cat-page .cat-tipo-grupo {
  border: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px 12px;
}

html.cat-page .cat-tipo-grupo legend {
  grid-column: 1 / -1;
  margin-bottom: 4px;
}

html.cat-page .cat-tipo-grupo label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: #cbd5e1;
}

html.cat-page .cat-modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 12px 16px 16px;
}

html.cat-page ::-webkit-scrollbar { width: 8px; height: 8px; }
html.cat-page ::-webkit-scrollbar-track { background: #0f172a; }
html.cat-page ::-webkit-scrollbar-thumb { background: #475569; border-radius: 4px; }

/* Opciones del selector dinámico de bodegas */
.custom-select-option:hover,
.custom-select-option.selected,
.custom-select-option.active {
    background-color: #2563eb !important;
    color: #ffffff !important;
    font-weight: 700 !important;
}

.custom-select-panel {
    background-color: #121e2d !important; /* Fondo azul noche oscuro */
    border: 1px solid #2a3b50 !important;
}

/* Mantenimiento de Grupos */
#tabla-mantenimiento-grupos thead th {
    background: #121e2d;
    position: sticky;
    top: 0;
    z-index: 2;
}

#tbody-mantenimiento-grupos tr:hover {
    background: #1d6bf322 !important;
}

#tbody-mantenimiento-grupos tr.selected {
    background: #1d6bf344 !important;
}

/* Opciones Especiales bloqueadas */
#tab-opciones-especiales input:disabled + span,
#tab-opciones-especiales label:has(input:disabled) {
  opacity: 0.72;
  cursor: not-allowed;
}

#btn-candado-opc-especiales {
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
}

#btn-candado-opc-especiales:hover {
  border-color: #3b82f6 !important;
  background: #1e3a5f !important;
}

/* Ficha Banco — detalle (ctrl_ult_nd2) */
html.cat-page .cat-banco-tarjetas-wrap {
  border: 1px solid #334155;
  border-radius: 6px;
  max-height: 220px;
  overflow: auto;
  background: #0f172a;
}

html.cat-page .cat-banco-tarjetas-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
  color: #e2e8f0;
}

html.cat-page .cat-banco-tarjetas-table th {
  text-align: left;
  padding: 8px 10px;
  background: #1e293b;
  color: #94a3b8;
  font-size: 10px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  position: sticky;
  top: 0;
}

html.cat-page .cat-banco-tarjetas-table td {
  padding: 8px 10px;
  border-top: 1px solid #1e293b;
}

html.cat-page .cat-banco-tarjeta-row {
  cursor: pointer;
}

html.cat-page .cat-banco-tarjeta-row:hover,
html.cat-page .cat-banco-tarjeta-row.is-selected {
  background: #1e3a5f;
}

html.cat-page .cat-banco-tarjeta-del {
  padding: 2px 8px !important;
  font-size: 11px !important;
  min-width: auto;
}

/* Modal accesos por cargo — navegación teclado */
#tbody-modal-accesos tr.modal-row-acceso {
  cursor: pointer;
  user-select: none;
}

#tbody-modal-accesos tr.modal-row-acceso:hover {
  background-color: #1e293b;
}

#tbody-modal-accesos tr.row-selected,
#tbody-modal-accesos tr.row-selected > td {
  background-color: #2563eb !important;
  color: #ffffff !important;
}

#tabla-modal-accesos-wrap:focus {
  border-color: #3b82f6 !important;
  box-shadow: 0 0 0 1px #3b82f6;
}

#input-buscar-modal-accesos {
  font-size: 16px !important;
  font-weight: 600 !important;
  padding: 10px 14px !important;
  color: #ffffff !important;
  background-color: #0f172a !important;
  border: 1px solid #3b82f6 !important;
}

#input-buscar-modal-accesos::placeholder {
  color: #94a3b8 !important;
  font-weight: 400 !important;
}

/* Serie: Tipo de Entrada solo lectura, sin oscurecer radios ni etiquetas */
html.cat-page .cat-serie-tipo-entrada-ro {
  pointer-events: none;
  user-select: none;
  -webkit-user-select: none;
  opacity: 1;
}
html.cat-page .cat-serie-tipo-entrada-ro .cat-radio-wrap,
html.cat-page .cat-serie-tipo-entrada-ro input[type="radio"],
html.cat-page .cat-serie-tipo-entrada-ro span {
  opacity: 1 !important;
  filter: none !important;
  color: inherit;
}

html.cat-page .btn-var-asunto,
html.cat-page .btn-var-cuerpo {
  background: #1e293b;
  border: 1px solid #3b82f6;
  color: #8bbefa;
  border-radius: 4px;
  padding: 4px 8px;
  font-size: 11px;
  line-height: 1.3;
  cursor: pointer;
  white-space: nowrap;
}
html.cat-page .btn-var-asunto:hover,
html.cat-page .btn-var-cuerpo:hover {
  background: #243447;
  color: #dbeafe;
}

html.cat-page.cat-ficha-embed .cat-col-izq {
  display: none !important;
}
html.cat-page.cat-ficha-embed .cat-back-btn {
  display: none !important;
}
html.cat-page.cat-ficha-embed .cat-main {
  padding: 8px;
}
html.cat-page.cat-ficha-embed .cat-col-der {
  width: 100%;
}

/* Contraste nativo de <select>/<option>: Dark Fintech (sin azul celeste #8bbafe) */
select, input[type="date"], input[type="datetime-local"] {
  color-scheme: dark !important;
  accent-color: #1E3A8A !important;
  background-color: #0B0F19 !important;
  color: #FFFFFF !important;
}

/* Ficha Activos Fijos / Depreciación (Parámetros avanzados) */
html.cat-page .cat-act-fijo-ficha {
  background: #162330;
  border: 1px solid #2a3b50;
  border-radius: 8px;
  padding: 18px 20px 22px;
}

html.cat-page .cat-act-fijo-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px 24px;
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid #2a3b50;
}

html.cat-page .cat-act-fijo-radios {
  display: flex;
  flex-wrap: wrap;
  gap: 14px 20px;
}

html.cat-page .cat-act-fijo-estado {
  display: flex;
  align-items: flex-end;
  gap: 10px;
}

html.cat-page .cat-act-fijo-imp {
  width: 90px;
}

html.cat-page .cat-act-fijo-imp .cat-input {
  text-align: right;
}

html.cat-page .cat-act-estado-btn {
  min-width: 88px;
  padding: 8px 14px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  border: 1px solid #334155;
  background: #0f172a;
  color: #94a3b8;
}

html.cat-page .cat-act-estado-btn.is-alta.is-active {
  background: #166534;
  border-color: #22c55e;
  color: #ffffff;
}

html.cat-page .cat-act-estado-btn.is-baja.is-active {
  background: #991b1b;
  border-color: #ef4444;
  color: #ffffff;
}

html.cat-page .cat-act-fijo-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px 20px;
}

html.cat-page .cat-act-fijo-grid .cat-input {
  text-align: right;
}

html.cat-page .cat-act-fecha-field {
  min-width: 140px;
}

html.cat-page .cat-act-fijo-grid #fecha_adquisicion {
  min-width: 140px;
  width: 100%;
  text-align: left;
  color-scheme: dark;
}

html.cat-page .cat-act-fijo-grid #field-act-codigo-gasto {
  text-align: left;
}

html.cat-page .cat-act-fijo-grid .cat-input.is-readonly,
html.cat-page .cat-input.is-readonly {
  background: #0b1220;
  color: #cbd5e1;
  cursor: default;
  opacity: 0.85;
}

@media (max-width: 900px) {
  html.cat-page .cat-act-fijo-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 640px) {
  html.cat-page .cat-act-fijo-grid {
    grid-template-columns: 1fr;
  }
}

/* Dark Executive — Reporte de Ventas */
body.rv-dark {
  background: #0B0F19 !important;
  color: #e2e8f0 !important;
}
body.rv-dark .rv-tbl-wrap,
body.rv-dark .rv-table-section,
body.rv-dark .rv-workarea {
  background: #0f172a !important;
}
body.rv-dark .rv-tbl-hdr,
body.rv-dark .rv-tbl-hdr-title {
  background: #1e293b !important;
  color: #f8fafc !important;
  border-color: #334155 !important;
}
body.rv-dark .rv-table td,
body.rv-dark .rv-td {
  color: #e2e8f0 !important;
  border-color: #334155 !important;
}
body.rv-dark .rv-table tbody tr:hover td,
body.rv-dark .rv-row:hover {
  background: #334155 !important;
}
body.rv-dark .rv-th {
  background: #1E293B !important;
  color: #F8FAFC !important;
}

body.rv-dark .rv-table td.rv-td-sticky-0,
body.rv-dark .rv-table td.rv-td-sticky-1,
body.rv-dark .rv-table tbody .rv-row:nth-child(odd) td.rv-td-sticky-0,
body.rv-dark .rv-table tbody .rv-row:nth-child(odd) td.rv-td-sticky-1 {
  background-color: #0f172a !important;
  color: #f8fafc !important;
}

body.rv-dark .rv-table tbody .rv-row:nth-child(even) td.rv-td-sticky-0,
body.rv-dark .rv-table tbody .rv-row:nth-child(even) td.rv-td-sticky-1 {
  background-color: #1e293b !important;
  color: #f8fafc !important;
}

body.rv-dark .rv-table tbody .rv-row:hover td.rv-td-sticky-0,
body.rv-dark .rv-table tbody .rv-row:hover td.rv-td-sticky-1 {
  background-color: #334155 !important;
  color: #f8fafc !important;
}

body.rv-dark .rv-table tbody .rv-row.active td.rv-td-sticky-0,
body.rv-dark .rv-table tbody .rv-row.active td.rv-td-sticky-1 {
  background-color: #1E3A8A !important;
  color: #FFFFFF !important;
}

body.rv-dark .rv-table tbody tr.rv-row.active,
body.rv-dark .rv-table tbody tr.rv-row.active td,
body.rv-dark .rv-table tbody tr.rv-row.active td.rv-td-sticky-0,
body.rv-dark .rv-table tbody tr.rv-row.active td.rv-td-sticky-1 {
  background-color: #1E3A8A !important;
  color: #FFFFFF !important;
  outline: none !important;
  border-top: 1px solid #3B82F6 !important;
  border-bottom: 1px solid #3B82F6 !important;
}

body.rv-dark .rv-dim-btn,
body.rv-dark .rv-extra-btn,
body.rv-dark .rv-nav-btn {
  background: #1E293B !important;
  border: 1px solid #334155 !important;
  color: #FFFFFF !important;
}
body.rv-dark .rv-dim-btn:hover,
body.rv-dark .rv-extra-btn:hover,
body.rv-dark .rv-nav-btn:hover {
  background: #2563EB !important;
  border-color: #3B82F6 !important;
  color: #FFFFFF !important;
}
body.rv-dark .rv-dim-btn.active,
body.rv-dark .rv-extra-btn.active,
body.rv-dark .rv-nav-btn.active {
  background: #2563EB !important;
  border-color: #3B82F6 !important;
  color: #FFFFFF !important;
  font-weight: 700;
}
body.rv-dark .rv-nav-lbl,
body.rv-dark .rv-dim-lbl,
body.rv-dark .rv-nav-btn .rv-nav-icon,
body.rv-dark .rv-dim-btn .rv-dim-icon,
body.rv-dark .rv-extra-btn .rv-extra-icon {
  color: #FFFFFF !important;
}

body.rv-dark .rv-table tfoot .rv-tfoot-row td,
body.rv-dark .rv-table tfoot .rv-tfoot-row td.rv-tfoot-label,
body.rv-dark .rv-table tfoot .rv-tfoot-row td.rv-tfoot-und,
body.rv-dark .rv-table tfoot .rv-tfoot-row td.rv-tfoot-amt {
  background-color: #1e293b !important;
  color: #fbbf24 !important;
  border-color: #334155 !important;
}

body.rv-dark .rv-table tfoot td.rv-tfoot-desc,
body.rv-dark .rv-table tfoot .rv-tfoot-row td.rv-tfoot-desc { color: #f87171 !important; }
body.rv-dark .rv-table tfoot td.rv-tfoot-util,
body.rv-dark .rv-table tfoot .rv-tfoot-row td.rv-tfoot-util { color: #4ade80 !important; }

.rv-td.rv-td-mc,
body.rv-dark .rv-table td.rv-td-mc,
body.rv-dark .rv-td.rv-td-mc {
  color: #fbbf24 !important;
}

/* ════════════════════════════════════════════════════════════════
   Dark Fintech Slate — reportes (Ventas, CxC, CxP, Inventarios, Bancos)
   ════════════════════════════════════════════════════════════════ */
body.rv-dark,
body.report-dark {
  --cxc-chrome: #131C2E;
  --cxc-chrome-bd: #1E293B;
  --cxc-panel: #131C2E;
  --cxc-navy: #1E293B;
  --cxc-navy-hover: #2563EB;
  --cxc-navy-border: #334155;
  --cxc-row-alt: #131C2E;
  --cxc-select: #1E3A8A;
  --cxc-lime: #2563EB;
  --cxc-lime-active-text: #FFFFFF;
  --cxc-lime-dark: #FFFFFF;
  --cxc-btn-inactive-fg: #FFFFFF;
  background: #0B0F19 !important;
  color: #E2E8F0 !important;
}

body.rv-dark .cxc-filterbar,
body.report-dark .cxc-filterbar,
body.rv-dark .cxc-topbar,
body.report-dark .cxc-topbar,
body.rv-dark .cxc-leftnav,
body.report-dark .cxc-leftnav,
body.rv-dark .rv-filterbar,
body.rv-dark .rv-topbar,
body.rv-dark .rv-leftnav {
  background: #131C2E !important;
  border-color: #1E293B !important;
  color: #E2E8F0 !important;
}

body.rv-dark .cxc-workarea,
body.report-dark .cxc-workarea,
body.rv-dark .cxc-main,
body.report-dark .cxc-main,
body.rv-dark .cxc-tbl-wrap,
body.report-dark .cxc-tbl-wrap,
body.rv-dark .cxc-table-section,
body.report-dark .cxc-table-section,
body.rv-dark .cxc-kpi-panel,
body.report-dark .cxc-kpi-panel,
body.rv-dark .cxc-banner,
body.report-dark .cxc-banner {
  background: #131C2E !important;
  color: #E2E8F0 !important;
  border-color: #1E293B !important;
}

body.rv-dark .cxc-flbl,
body.report-dark .cxc-flbl,
body.rv-dark .cxc-tbl-hdr,
body.report-dark .cxc-tbl-hdr,
body.rv-dark .cxc-tbl-hdr-title,
body.report-dark .cxc-tbl-hdr-title {
  color: #F8FAFC !important;
  background: #131C2E !important;
  border-color: #1E293B !important;
}

body.rv-dark .cxc-fsel,
body.report-dark .cxc-fsel,
body.rv-dark .cxc-back-btn,
body.report-dark .cxc-back-btn,
body.rv-dark .cxc-periodo-sel,
body.report-dark .cxc-periodo-sel {
  background: #0B0F19 !important;
  color: #F8FAFC !important;
  border-color: #334155 !important;
}

body.rv-dark .cxc-dim-btn,
body.report-dark .cxc-dim-btn,
body.rv-dark .cxc-extra-btn,
body.report-dark .cxc-extra-btn,
body.rv-dark .cxc-nav-btn,
body.report-dark .cxc-nav-btn,
body.rv-dark .rv-dim-btn,
body.rv-dark .rv-extra-btn,
body.rv-dark .rv-nav-btn {
  background: #1E293B !important;
  border: 1px solid #334155 !important;
  color: #FFFFFF !important;
}

body.rv-dark .cxc-dim-btn:hover,
body.report-dark .cxc-dim-btn:hover,
body.rv-dark .cxc-extra-btn:hover,
body.report-dark .cxc-extra-btn:hover,
body.rv-dark .cxc-nav-btn:hover,
body.report-dark .cxc-nav-btn:hover {
  background: #2563EB !important;
  border-color: #3B82F6 !important;
  color: #FFFFFF !important;
}

body.rv-dark .cxc-dim-btn.active,
body.report-dark .cxc-dim-btn.active,
body.rv-dark .cxc-extra-btn.active,
body.report-dark .cxc-extra-btn.active,
body.rv-dark .rv-dim-btn.active,
body.rv-dark .rv-extra-btn.active {
  background: #2563EB !important;
  border-color: #3B82F6 !important;
  color: #FFFFFF !important;
  font-weight: 700;
}

body.rv-dark .cxc-nav-btn.active,
body.report-dark .cxc-nav-btn.active,
body.rv-dark .rv-nav-btn.active {
  background: #10B981 !important;
  border-color: #34D399 !important;
  color: #FFFFFF !important;
  font-weight: 700;
}

body.rv-dark .cxc-nav-lbl,
body.report-dark .cxc-nav-lbl,
body.rv-dark .cxc-dim-lbl,
body.report-dark .cxc-dim-lbl,
body.rv-dark .cxc-nav-icon,
body.report-dark .cxc-nav-icon,
body.rv-dark .cxc-dim-icon,
body.report-dark .cxc-dim-icon {
  color: #FFFFFF !important;
}

body.rv-dark .cxc-th,
body.report-dark .cxc-th,
body.rv-dark .cxc-table thead th,
body.report-dark .cxc-table thead th,
body.rv-dark .eg-table thead th,
body.report-dark .eg-table thead th,
body.rv-dark table thead th,
body.report-dark table thead th {
  background: #1E293B !important;
  color: #F8FAFC !important;
  border-color: #334155 !important;
}

body.rv-dark .cxc-td,
body.report-dark .cxc-td,
body.rv-dark .celda-erp,
body.report-dark .celda-erp,
body.rv-dark .cxc-table td,
body.report-dark .cxc-table td {
  color: #E2E8F0 !important;
  border-color: #1E293B !important;
  background-color: transparent !important;
}

body.rv-dark .cxc-row,
body.report-dark .cxc-row,
body.rv-dark .cxc-table tbody tr,
body.report-dark .cxc-table tbody tr {
  background: #0B0F19 !important;
}
body.rv-dark .cxc-row:nth-child(even),
body.report-dark .cxc-row:nth-child(even),
body.rv-dark .cxc-table tbody tr:nth-child(even),
body.report-dark .cxc-table tbody tr:nth-child(even) {
  background: #131C2E !important;
}
body.rv-dark .cxc-row:hover,
body.report-dark .cxc-row:hover,
body.rv-dark .cxc-table tbody tr:hover,
body.report-dark .cxc-table tbody tr:hover {
  background: #334155 !important;
}

body.rv-dark .cxc-row.active,
body.report-dark .cxc-row.active,
body.rv-dark .cxc-row.selected-row,
body.report-dark .cxc-row.selected-row,
body.rv-dark .cxc-row.table-active,
body.report-dark .cxc-row.table-active,
body.rv-dark tr.active,
body.report-dark tr.active,
body.rv-dark tr.is-selected,
body.report-dark tr.is-selected {
  background: transparent !important;
  box-shadow: none !important;
  outline: none !important;
}

body.rv-dark tr.active td,
body.report-dark tr.active td,
body.rv-dark tr.is-selected td,
body.report-dark tr.is-selected td,
body.rv-dark .cxc-row.active td,
body.report-dark .cxc-row.active td,
body.rv-dark .cxc-row.selected-row td,
body.report-dark .cxc-row.selected-row td,
body.rv-dark .cxc-row.table-active td,
body.report-dark .cxc-row.table-active td,
body.rv-dark .cxc-row.active .cxc-td,
body.report-dark .cxc-row.active .cxc-td,
body.rv-dark .cxc-row.active .celda-erp,
body.report-dark .cxc-row.active .celda-erp {
  background-color: #1E3A8A !important;
  color: #FFFFFF !important;
  outline: none !important;
  border-top: 1px solid #3B82F6 !important;
  border-bottom: 1px solid #3B82F6 !important;
}

body.rv-dark .cxc-tfoot-row td,
body.report-dark .cxc-tfoot-row td,
body.rv-dark .cxc-table tfoot td,
body.report-dark .cxc-table tfoot td {
  background: #131C2E !important;
  color: #FBBF24 !important;
  border-color: #334155 !important;
}

body.rv-dark .cxc-td.green,
body.report-dark .cxc-td.green,
body.rv-dark .celda-erp.green,
body.report-dark .celda-erp.green,
body.rv-dark .pos,
body.report-dark .pos {
  color: #34D399 !important;
}
body.rv-dark .cxc-td.red,
body.report-dark .cxc-td.red,
body.rv-dark .celda-erp.red,
body.report-dark .celda-erp.red,
body.rv-dark .neg,
body.report-dark .neg {
  color: #F87171 !important;
}

body.rv-dark .cxc-splitter,
body.report-dark .cxc-splitter {
  background: #1E293B !important;
  border-color: #334155 !important;
}

body.rv-dark .cxc-table-footer,
body.report-dark .cxc-table-footer {
  background: #131C2E !important;
  color: #94A3B8 !important;
  border-color: #1E293B !important;
}

::-webkit-scrollbar-track {
  background: #0B0F19;
}
body.rv-dark ::-webkit-scrollbar-thumb,
body.report-dark ::-webkit-scrollbar-thumb {
  background: #334155;
}

/* Modelos wizard — selector cuentas/insumos (Dark Fintech Slate) */
.mw-sel-cat.active,
.mw-sel-mark.active,
.mw-sel-grid tbody tr.active {
  background: #1E3A8A !important;
  border-color: #3B82F6;
  color: #FFFFFF !important;
}
.mw-sel-cat:hover,
.mw-sel-mark:hover,
.mw-sel-grid tbody tr:hover {
  background: #2563EB !important;
  color: #FFFFFF !important;
}
.mw-sel-q,
.mw-sel-filters .mw-input,
.mw-sel-filters .mw-select {
  background: #0B0F19 !important;
  color: #FFFFFF !important;
  border-color: #334155 !important;
}
.mw-sel-ficha,
.mw-sel-left,
.mw-sel-right {
  background: #0B0F19;
}
.mw-sel-ficha-grid {
  background: #131C2E;
}

/* Parámetros de línea del selector: fila compacta Und / Costo (mat) */
.mw-extra-grid.mw-extra-mat,
.mw-extra-grid.mw-extra-compact {
  display: grid !important;
  grid-template-columns: repeat(2, minmax(110px, 200px)) !important;
  justify-content: start;
  gap: 8px 12px;
  margin-top: 4px;
  margin-bottom: 0;
  max-width: 440px;
  flex: 0 0 auto !important;
  min-height: 0 !important;
}
.mw-extra-grid [data-ex] {
  min-width: 0;
}
.mw-extra-grid.mw-extra-mat > [data-ex]:not([data-ex="und"]):not([data-ex="costo"]),
.mw-extra-grid .is-hidden,
.mw-extra-grid [data-ex][hidden] {
  display: none !important;
  height: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
  overflow: hidden !important;
  border: 0 !important;
}
#mwModalKardex {
  display: none !important;
}

/* Selector ligero WinDEV (Código + Nombre) */
.mw-sel-modal.mw-sel-lite {
  width: min(640px, 96vw) !important;
  height: min(560px, 90vh) !important;
}
.mw-sel-body.mw-sel-lite .mw-sel-split {
  grid-template-columns: 1fr !important;
}
.mw-sel-body.mw-sel-lite .mw-sel-right,
.mw-sel-modal.mw-sel-lite .mw-sel-right {
  display: none !important;
}
.mw-sel-modal.mw-sel-lite #mwModalNuevo,
.mw-sel-modal.mw-sel-lite #mwModalEditar,
.mw-sel-modal.mw-sel-lite #mwModalEliminar {
  display: none !important;
}

/* Etapas fullscreen */
.mw-overlay.etapas {
  padding: 0 !important;
  margin: 0 !important;
  align-items: stretch !important;
  justify-content: stretch !important;
}
.mw-modal.etapas {
  width: 100vw !important;
  height: 100vh !important;
  max-width: 100vw !important;
  max-height: 100vh !important;
  border-radius: 0 !important;
  padding: 0 !important;
  margin: 0 !important;
  resize: both !important;
  overflow: auto !important;
  min-width: 720px !important;
  min-height: 480px !important;
}

/* Modales redimensionables */
.mw-modal {
  resize: both;
  overflow: auto;
  min-width: 420px;
  min-height: 280px;
}
.mw-modal.entrada-tarea,
.mw-modal.entrada-accion {
  min-width: 780px;
  min-height: 520px;
}

/* Modal gestiones */
#modalGestiones.open { display: flex !important; }
.mw-gest-edit.readonly .mw-input,
.mw-gest-edit.readonly .mw-textarea {
  background: #131C2E !important;
  color: #CBD5E1 !important;
}
.mw-gest-tipos input[type="radio"] {
  accent-color: #2563EB !important;
}

/* Entrada de Tarea — dropdowns visibles */
#modalEntradaTarea .mw-et-tarea-left {
  overflow: visible;
}
#modalEntradaTarea .custom-select-wrapper {
  width: 100%;
  min-height: 38px;
}
#modalEntradaTarea .custom-select-trigger {
  display: flex !important;
  visibility: visible !important;
  opacity: 1 !important;
  min-height: 38px;
  background: #0B0F19 !important;
  color: #FFFFFF !important;
  border: 1px solid #334155 !important;
}
#modalEntradaTarea .custom-select-wrapper.open {
  z-index: 50;
}
#modalEntradaTarea .custom-options {
  z-index: 60;
  max-height: 240px;
}

/* Modales arrastrables */
.mw-modal-h {
  cursor: grab;
  user-select: none;
}
.mw-modal-h:active {
  cursor: grabbing;
}

/* Toggle switches Entrada de Acción */
#modalEntradaAccion .mw-switch {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 12px;
  font-weight: 700;
  color: #E2E8F0;
  cursor: pointer;
  user-select: none;
}
#modalEntradaAccion .mw-switch input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
  pointer-events: none;
}
#modalEntradaAccion .mw-switch-track {
  position: relative;
  width: 42px;
  height: 22px;
  flex: 0 0 auto;
  background: #334155;
  border: 1px solid #475569;
  border-radius: 999px;
  transition: background .18s ease, border-color .18s ease;
}
#modalEntradaAccion .mw-switch-track::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #FFFFFF;
  box-shadow: 0 1px 2px rgba(0,0,0,.35);
  transition: transform .18s ease;
}
#modalEntradaAccion .mw-switch input:checked + .mw-switch-track {
  background: #2563EB;
  border-color: #3B82F6;
}
#modalEntradaAccion .mw-switch input:checked + .mw-switch-track::after {
  transform: translateX(20px);
}
#modalEntradaAccion .mw-et-grid-side {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  align-items: stretch;
}
#modalEntradaAccion .mw-et-side-btns {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
#modalEntradaAccion .mw-et-foot-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  padding: 8px 10px 4px;
  border-top: 1px solid #334155;
}
#modalEntradaAccion .mw-et-mat-tiempo {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 8px 0 2px;
  border-top: 1px dashed #334155;
}
#modalEntradaAccion .mw-et-mat-tiempo[hidden] {
  display: none !important;
}
#modalEntradaAccion #etAccMatBodWrap.is-disabled {
  opacity: 0.45;
  pointer-events: none;
}
#modalEntradaAccion #etAccMatBodWrap[hidden] {
  display: none !important;
}
#modalEntradaAccion .mw-modal-h {
  position: relative;
  padding-right: 48px;
}
#modalEntradaAccion .mw-modal-close,
#modalEntradaAccion #etAccX {
  position: absolute;
  top: 10px;
  right: 14px;
  z-index: 10;
  margin: 0;
}
.mw-gest-tipos label.active {
  color: #FFFFFF !important;
  background: #1E3A8A !important;
  border: 1px solid #3B82F6 !important;
  border-radius: 8px;
  padding: 4px 8px;
}

/* Modelos — embed ficha oficial de catálogo */
#modalCatalogoEmbed.open {
  display: flex !important;
}
#modalCatalogoEmbed .mw-catalogo-embed {
  background: #0B0F19;
  border: 1px solid #334155;
  border-radius: 12px;
  overflow: hidden;
}
#modalCatalogoEmbed .mw-catalogo-embed-h {
  background: #1E293B;
  color: #FFFFFF;
}
#iframeCatalogoEmbed {
  background: #0B0F19;
}

/* ── Producción Fase 2 — scroll horizontal aislado por tarjeta ── */
#vista-fase2,
.prod-grid-container {
  max-width: 100% !important;
  overflow-x: hidden !important;
}

.prod-card,
.mw-card,
.prod-panel {
  min-width: 0 !important;
  width: 100%;
}

.mw-table-wrap,
.prod-table-wrap {
  width: 100% !important;
  max-width: 100% !important;
  overflow-x: auto !important;
  overflow-y: auto !important;
  display: block !important;
  min-width: 0;
}

.mw-table-wrap table,
.prod-table-wrap table {
  width: 100%;
  min-width: 850px;
  border-collapse: collapse;
}

.mw-table-wrap th,
.mw-table-wrap td,
.prod-table-wrap th,
.prod-table-wrap td {
  white-space: nowrap !important;
}

/* Modal buscador — columna derecha producto/inventario */
.modal-buscador-container.modal-producto-filtros .modal-buscador-body {
  grid-template-columns: minmax(0, 1fr) minmax(0, 320px);
}

.modal-right-column,
.modal-buscador-container.modal-producto-filtros .modal-info-panel,
.modal-info-panel.info-panel,
.info-panel {
  /* Scroll solo en #modalRightColumn — no en paneles anidados */
  overflow: visible;
  height: auto;
  max-height: none;
}

.modal-right-column {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 0;
  border-left: 1px solid #475569;
  background: #0f172a;
}

.modal-buscador-container.modal-producto-filtros .modal-info-panel {
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex: 1;
  min-height: 0;
  padding: 16px;
}

/* ═══ Blindaje antiflortante universal — columna derecha del buscador (todas las entradas) ═══ */
#modalRightColumn,
#modalRightColumn *,
.modal-right-col,
.modal-right-col * {
  position: relative !important;
  top: auto !important;
  left: auto !important;
  right: auto !important;
  bottom: auto !important;
  float: none !important;
  transform: none !important;
  box-sizing: border-box !important;
}

#modalRightColumn {
  display: flex !important;
  flex-direction: column !important;
  width: 100% !important;
  max-width: 100% !important;
  min-width: 0 !important;
  height: 100% !important;
  max-height: 100% !important;
  overflow-y: auto !important;
  overflow-x: hidden !important;
  contain: layout style;
  padding-right: 4px !important;
}

.modal-right-col {
  display: flex !important;
  flex-direction: column !important;
  width: 100% !important;
  max-width: 100% !important;
  min-width: 0 !important;
  height: 100% !important;
  max-height: 100% !important;
  overflow-y: auto !important;
  overflow-x: hidden !important;
}

#infoPanelInventario,
#mbAccordionContainer,
.mb-accordion-item,
.mb-acc-content {
  width: 100% !important;
  max-width: 100% !important;
  flex-shrink: 0 !important;
}

/* Acordeones encajonados con scroll interno */
.mb-acc-content,
.mb-acc-scroll {
  max-height: 180px !important;
  overflow-y: auto !important;
  overflow-x: hidden !important;
}

/* bpPanel exterior: sin scroll propio si envuelve la columna */
#bpPanel.modal-right-col:has(#modalRightColumn) {
  overflow: hidden !important;
}

.modal-right-column,
.modal-buscador-container .info-panel {
  display: flex !important;
  flex-direction: column !important;
  flex-wrap: nowrap !important;
  width: 100% !important;
  max-width: 100% !important;
  min-width: 0 !important;
  height: 100% !important;
  max-height: 100% !important;
  overflow-y: auto !important;
  overflow-x: hidden !important;
  box-sizing: border-box !important;
  background: #0f172a;
  border-left: 1px solid #334155;
}

/* Bloques principales: flujo normal, 100% ancho, sin aplastarse */
#infoPanelInventario,
#mbAccordionContainer,
.mb-acc-item,
.mb-accordion-item,
#modalRightColumn > #infoPanelInventario,
#modalRightColumn > #mbAccordionContainer {
  position: relative !important;
  width: 100% !important;
  max-width: 100% !important;
  flex-shrink: 0 !important;
  float: none !important;
  box-sizing: border-box !important;
}

/* Hueco físico único para existencias — SIEMPRE hijo de #infoPanelInventario (arriba de acordeones) */
#infoPanelInventario > #mbHuecoExistencias,
#mbHuecoExistencias {
  width: 100% !important;
  max-width: 100% !important;
  position: relative !important;
  float: none !important;
  flex-shrink: 0 !important;
  margin-top: 8px !important;
  box-sizing: border-box !important;
  display: block !important;
  height: auto !important;
  max-height: none !important;
  clear: both !important;
}

#infoPanelInventario > #mbInfoProducto,
#infoPanelInventario > #mbPreciosProducto,
#mbInfoProducto,
#mbPreciosProducto {
  width: 100% !important;
  max-width: 100% !important;
  position: relative !important;
  float: none !important;
  flex-shrink: 0 !important;
  box-sizing: border-box !important;
  display: block !important;
  height: auto !important;
  max-height: none !important;
  overflow: visible !important;
  clear: both !important;
}

/* Prohibido que existencias floten fuera de la ficha (fallback al fondo de la columna) */
#mbAccordionContainer #mbHuecoExistencias,
#modalRightColumn > #mbHuecoExistencias,
#modalRightColumn > .stock-table-wrapper,
#modalRightColumn > #stockTable,
#modalRightColumn > .stock-table-wd {
  display: none !important;
}

/* Hueco permanente: siempre hijo de #infoPanelInventario */
#infoPanelInventario > #mbHuecoExistencias {
  display: block !important;
}

/* Ficha: Info + Precios sin scroll interno; existencias tiene scroll-x propio */
#infoPanelInventario {
  overflow: visible !important;
  max-height: none !important;
  max-width: 100% !important;
  box-sizing: border-box !important;
}

#infoPanelInventario > #mbInfoProducto,
#infoPanelInventario > #mbPreciosProducto,
#infoPanelInventario > #mbInfoProducto *,
#infoPanelInventario > #mbPreciosProducto * {
  overflow: visible !important;
  max-height: none !important;
  max-width: 100% !important;
  box-sizing: border-box !important;
}

#infoPanelInventario {
  display: block !important;
  height: auto !important;
  flex: none !important;
  min-height: 220px !important;
  clear: both !important;
}

#infoPanelInventario .mb-ficha-producto-root,
#infoPanelInventario .mb-ficha-producto-root * {
  max-width: 100% !important;
  overflow-wrap: anywhere !important;
  word-break: break-word !important;
}

#infoPanelInventario .mb-ficha-producto-root table,
#infoPanelInventario #mbInfoProducto table,
#infoPanelInventario #mbPreciosProducto table {
  width: 100% !important;
  max-width: 100% !important;
  table-layout: fixed !important;
  position: static !important;
  float: none !important;
}

/* Blindaje acordeones — Genéricos / Imagen encajonados en columna derecha */
#mbAccordionContainer,
#mbAcordeonGenericos,
#mbAcordeonImagen,
.mb-acc-item {
  position: relative !important;
  top: auto !important;
  left: 0 !important;
  float: none !important;
  width: 100% !important;
  box-sizing: border-box !important;
}

.mb-acc-content {
  position: relative !important;
  top: auto !important;
  left: 0 !important;
  right: auto !important;
  bottom: auto !important;
  float: none !important;
  transform: none !important;
  width: 100% !important;
  max-width: 100% !important;
  box-sizing: border-box !important;
}

/* Acordeones Niveles/Grupos visibles en modo producto */
.modal-buscador-container.modal-producto-filtros #mbAcordeonNiveles.mb-acc-open > .mb-accordion-panel,
.modal-buscador-container.modal-producto-filtros #mbAcordeonGrupos.mb-acc-open > .mb-accordion-panel {
  display: block !important;
}

/* Acordeones: scroll interno limitado; nunca salen hacia la grilla izquierda */
#mbAccordionContainer,
#mbAccordionContainer * {
  max-width: 100% !important;
  float: none !important;
}

.mb-acc-content,
.mb-acc-scroll {
  max-height: 180px !important;
  overflow-y: auto !important;
  overflow-x: hidden !important;
  padding: 4px 2px;
  box-sizing: border-box !important;
}

#modalRightColumn #mbAccordionStack,
#modalRightColumn #bpPanelStack,
#modalRightColumn .mb-producto-right-stack {
  overflow: visible !important;
  max-height: none !important;
  height: auto !important;
  width: 100% !important;
  max-width: 100% !important;
  float: none !important;
}

#mbAcordeonNiveles,
#mbAcordeonGrupos,
#mbAcordeonGenericos,
#mbAcordeonImagen {
  flex-shrink: 0 !important;
  width: 100% !important;
  max-width: 100% !important;
  float: none !important;
  box-sizing: border-box !important;
}

#modalRightColumn > div {
  width: 100% !important;
  max-width: 100% !important;
  float: none !important;
  box-sizing: border-box !important;
  flex-shrink: 0 !important;
  margin-bottom: 8px !important;
}

.modal-buscador-container.modal-producto-filtros .modal-buscador-body {
  grid-template-columns: minmax(0, 1fr) minmax(0, 320px) !important;
}

/* Facturación (bp-mode): no alterar el flujo vertical de la columna derecha */
.bp-mode-inventario #infoPanelInventario,
.bp-mode-producto #infoPanelInventario,
.bp-mode-inventario #mbAccordionContainer,
.bp-mode-producto #mbAccordionContainer,
#bpPanel #infoPanelInventario,
#bpPanel #mbAccordionContainer {
  float: none !important;
  clear: both !important;
  position: relative !important;
  width: 100% !important;
  max-width: 100% !important;
  flex-shrink: 0 !important;
  flex: none !important;
  height: auto !important;
  max-height: none !important;
  overflow: visible !important;
  display: block;
}

.bp-mode-inventario #modalRightColumn,
.bp-mode-producto #modalRightColumn,
#bpPanel #modalRightColumn {
  display: flex !important;
  flex-direction: column !important;
  overflow-x: hidden !important;
  float: none !important;
}
/* Modal buscador — redimensionable y arrastrable */
.modal-buscador-content,
#modalBuscadorContainer,
.modal-buscador-container {
  resize: both !important;
  overflow: hidden !important;
  min-width: 750px;
  min-height: 480px;
  max-width: 98vw;
  max-height: 98vh;
  position: absolute;
}

#modalBuscadorHeader.modal-header,
.modal-buscador-header.modal-header {
  cursor: move;
  user-select: none;
}

.modal-buscador-overlay.modal-busqueda {
  align-items: flex-start;
  justify-content: flex-start;
}

.modal-buscador-container .modal-buscador-body {
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

/* Columna derecha producto — orden 100% físico en el HTML (sin flex order) */
#modalRightColumn > *,
#modalRightColumn > #infoPanelInventario,
#modalRightColumn > #mbAccordionContainer,
#bpPanel #modalRightColumn > *,
.modal-right-col > #infoPanelInventario,
.modal-right-col > #mbAccordionContainer {
  order: unset !important;
}

.mb-producto-right-stack {
  display: flex !important;
  flex-direction: column !important;
  gap: 0;
  width: 100% !important;
  min-height: unset;
  height: auto !important;
  max-height: none !important;
  overflow: visible !important;
  flex-shrink: 0 !important;
  position: relative !important;
}

#mbAccordionContainer {
  display: flex !important;
  flex-direction: column !important;
  gap: 0;
  width: 100% !important;
  min-height: unset;
  height: auto !important;
  max-height: none !important;
  overflow: visible !important;
  flex-shrink: 0 !important;
  position: relative !important;
  margin-top: 12px !important;
  clear: both !important;
}

#infoPanelInventario.mb-panel-precios {
  flex-shrink: 0;
  flex: none !important;
  padding: 8px 10px;
  border-bottom: 1px solid #334155;
  height: auto !important;
  max-height: none !important;
  overflow: visible !important;
}

#infoPanelInventario,
#mbAccordionContainer {
  width: 100% !important;
  flex-shrink: 0 !important;
  box-sizing: border-box !important;
}

#modalRightColumn #infoPanelInventario,
.info-panel #infoPanelInventario,
#modalRightColumn > #infoPanelInventario,
.modal-right-column > #infoPanelInventario,
.modal-buscador-container .info-panel > #infoPanelInventario {
  flex-shrink: 0 !important;
  width: 100% !important;
}

.modal-buscador-container.modal-producto-filtros #infoPanelInventario,
.modal-buscador-container.modal-producto-wide #infoPanelInventario,
.bp-mode-inventario #infoPanelInventario,
.bp-mode-producto #infoPanelInventario,
#modalRightColumn #infoPanelInventario.mb-panel-precios {
  display: block !important;
  visibility: visible !important;
  width: 100% !important;
  flex-shrink: 0 !important;
  max-height: none !important;
  overflow: visible !important;
}

#mbAcordeonNiveles,
#mbAcordeonGrupos,
#mbAcordeonGenericos,
#mbAcordeonImagen {
  flex-shrink: 0 !important;
  width: 100% !important;
}
.mb-ficha-nota-textarea {
  display: block;
  width: 100%;
  min-height: 72px;
  max-height: 120px;
  margin-top: 6px;
  padding: 8px;
  border-radius: 6px;
  border: 1px solid #334155;
  background: #1e293b;
  color: #cbd5e1;
  font-size: 11px;
  line-height: 1.45;
  resize: vertical;
  font-family: inherit;
}

.mb-ficha-nota-textarea:read-only {
  cursor: default;
}

.mb-ficha-nota-textarea::placeholder {
  color: #64748b;
  font-style: italic;
}

#mbAcordeonNiveles .btn-clear-filter[data-action="limpiar-nivel"],
#mbAcordeonGrupos .btn-clear-filter[data-action="limpiar-grupo"] {
  flex-shrink: 0;
}

#mbPanelFiltros,
#mbAccordionStack {
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  width: 100%;
}

.modal-buscador-container:not(.modal-producto-filtros) #mbAccordionStack {
  display: none !important;
  visibility: hidden !important;
}

.modal-buscador-container.modal-producto-filtros #mbAccordionStack,
.modal-buscador-container.modal-producto-filtros #mbAccordionContainer,
.modal-buscador-container.modal-producto-filtros #mbProductoColumn,
.bp-mode-inventario #bpPanelStack,
.bp-mode-producto #bpPanelStack {
  display: flex !important;
  flex-direction: column !important;
  visibility: visible !important;
}

/* Precios siempre visibles y al tope en modo producto */
.modal-buscador-container.modal-producto-filtros #infoPanelInventario,
.modal-buscador-container.modal-producto-wide #infoPanelInventario,
#modalBuscadorOverlay #infoPanelInventario.mb-panel-precios {
  display: block !important;
  visibility: visible !important;
  flex-shrink: 0 !important;
  max-height: none !important;
  overflow: visible !important;
  width: 100% !important;
}

.modal-buscador-container.modal-producto-filtros #infoPanelInventario.hidden,
.modal-buscador-container.modal-producto-wide #infoPanelInventario.hidden {
  display: block !important;
}

.modal-buscador-container.modal-producto-filtros #mbAccordionStack,
.modal-buscador-container.modal-producto-filtros #mbAccordionContainer,
.modal-buscador-container.modal-producto-filtros #mbProductoColumn,
.bp-mode-inventario #bpPanelStack,
.bp-mode-producto #bpPanelStack,
#bpPanel #bpPanelStack {
  display: flex !important;
  flex-direction: column;
  visibility: visible !important;
  opacity: 1 !important;
}

#mbPanelFiltros.block.w-full {
  display: block;
  width: 100%;
}

#mbPanelFiltros .bg-slate-800 {
  background: #1e293b;
}

#mbPanelFiltros .bg-slate-700 {
  background: #334155;
}

#mbPanelFiltros .text-slate-100 {
  color: #f1f5f9;
}

#mbPanelFiltros .text-slate-300,
#mbListaNiveles.text-slate-300,
#mbListaGrupos.text-slate-300 {
  color: #cbd5e1;
}

/* El panel superior debe crecer libremente segun su contenido (sin flex:1 / min-height:0) */
#infoPanelInventario {
  display: block !important;
  height: auto !important;
  max-height: none !important;
  overflow: visible !important;
  position: relative !important;
  width: 100% !important;
  clear: both !important;
  flex: none !important;
  min-height: 220px !important;
  flex-shrink: 0 !important;
}

#mbInfoProducto,
#mbPreciosProducto {
  display: block !important;
  height: auto !important;
  max-height: none !important;
  overflow: visible !important;
  position: relative !important;
  width: 100% !important;
  clear: both !important;
  flex: none !important;
  flex-shrink: 0 !important;
}

#mbHuecoExistencias {
  display: block !important;
  height: auto !important;
  max-height: none !important;
  position: relative !important;
  width: 100% !important;
  clear: both !important;
  flex: none !important;
  min-height: 80px !important;
  flex-shrink: 0 !important;
}

/* Contenedor de Existencias con Scroll Horizontal Nativo */
#mbHuecoExistencias,
.mb-existencias-container {
  width: 100% !important;
  max-width: 100% !important;
  overflow-x: auto !important;
  overflow-y: hidden !important;
  position: relative !important;
  box-sizing: border-box !important;
}

/* Prevenir colapso de columnas y forzar scroll cuando las columnas excedan el ancho */
#mbHuecoExistencias table,
#mbHuecoExistencias .stock-table,
.mb-existencias-container table {
  min-width: 480px !important; /* Ancho minimo: Suc, Bod, Exist, Sucursal, Bodega, Ubicación */
  width: max-content !important;
  max-width: none !important;
  table-layout: auto !important;
}

#mbHuecoExistencias th,
#mbHuecoExistencias td,
.mb-existencias-container th,
.mb-existencias-container td {
  white-space: nowrap !important; /* Evitar que Bodega/Ubicacion se rompa en multiples lineas */
  padding: 4px 8px !important;
}

/* Estilo visual limpio para el scrollbar horizontal */
#mbHuecoExistencias::-webkit-scrollbar,
.mb-existencias-container::-webkit-scrollbar {
  height: 6px !important;
}
#mbHuecoExistencias::-webkit-scrollbar-thumb,
.mb-existencias-container::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.2) !important;
  border-radius: 3px !important;
}

/* La tabla de precios no debe cortar filas */
#mbPreciosProducto table {
  display: table !important;
  height: auto !important;
  width: 100% !important;
  margin-bottom: 8px !important;
}

/* Los acordeones deben empezar ESTRICTAMENTE abajo del panel de inventario */
#mbAccordionContainer {
  display: flex !important;
  flex-direction: column !important;
  position: relative !important;
  width: 100% !important;
  margin-top: 12px !important;
  clear: both !important;
  height: auto !important;
  max-height: none !important;
  overflow: visible !important;
  flex: none !important;
  flex-shrink: 0 !important;
}

#mbPanelFiltros.mb-filters-sidebar {
  max-height: 220px;
  overflow-y: auto;
  border: 1px solid #334155;
  background: #1e293b;
  padding: 6px;
  border-radius: 6px;
}

#mbPanelFiltros.mb-filters-sidebar.mb-3 {
  margin-bottom: 12px;
}

#mbPanelFiltros .mb-accordion-header.flex {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

#mbPanelFiltros .mb-accordion-header.bg-slate-800 {
  background: #1e293b;
}

#mbPanelFiltros .mb-accordion-header.p-2 {
  padding: 8px;
}

#mbPanelFiltros .mb-accordion-header.rounded {
  border-radius: 6px;
}

#mbPanelFiltros .mb-accordion-header.text-xs {
  font-size: 11px;
}

#mbPanelFiltros .mb-accordion-header.font-bold {
  font-weight: 700;
}

#mbPanelFiltros .mb-accordion-header.text-slate-200,
#mbPanelFiltros .mb-accordion-header.text-slate-200 span {
  color: #e2e8f0;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

#mbPanelFiltros .btn-clear-filter.text-blue-400,
#mbPanelFiltros .btn-clear-filter[data-action="limpiar-nivel"] {
  color: #60a5fa;
  border-color: transparent;
  background: transparent;
  padding: 0 4px;
}

#mbPanelFiltros .btn-clear-filter.text-yellow-400,
#mbPanelFiltros .btn-clear-filter[data-action="limpiar-grupo"] {
  color: #facc15;
  border-color: transparent;
  background: transparent;
  padding: 0 4px;
}

#mbPanelFiltros .btn-clear-filter.hover\:underline:hover,
#mbPanelFiltros .btn-clear-filter:hover {
  text-decoration: underline;
  background: transparent;
}

#mbPanelFiltros .mb-filter-list.max-h-28 {
  max-height: 7rem;
}

#mbPanelFiltros .mb-filter-list.max-h-32 {
  max-height: 8rem;
}

#mbPanelFiltros.mb-filters-sidebar.w-full {
  width: 100%;
}

#mbPanelFiltros.mb-filters-sidebar.block {
  display: block;
}

#mbPanelFiltros .mb-accordion-item.border {
  border: 1px solid #334155;
}

#mbPanelFiltros .mb-accordion-item.bg-slate-900 {
  background: #0f172a;
}

#mbPanelFiltros .mb-accordion-item.rounded {
  border-radius: 6px;
}

#mbPanelFiltros .mb-accordion-header.px-2 {
  padding-left: 8px;
  padding-right: 8px;
}

#mbPanelFiltros .mb-accordion-header.py-1 {
  padding-top: 4px;
  padding-bottom: 4px;
}

#mbPanelFiltros .mb-filter-list.bg-slate-900 {
  background: #0f172a;
}

#mbPanelFiltros .mb-filter-list.p-1 {
  padding: 4px;
}

#mbPanelFiltros .mb-filter-list.border {
  border: 1px solid #334155;
}

#mbPanelFiltros .mb-filter-list.border-slate-700 {
  border-color: #334155;
}

#mbPanelFiltros .mb-filter-list.text-xs {
  font-size: 11px;
}

.mb-accordion-item.mt-2 {
  margin-top: 8px;
}

.mb-accordion-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 6px 8px;
  background: #334155;
  border-radius: 4px;
  margin-bottom: 4px;
}

.mb-accordion-header span {
  font-size: 11px;
  font-weight: 700;
  color: #e2e8f0;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

#mbPanelFiltros .btn-clear-filter.active {
  text-decoration: underline;
  font-weight: 800;
  opacity: 1;
}

.btn-clear-filter {
  flex-shrink: 0;
  cursor: pointer;
  transition: all 0.15s;
  font-size: 10px;
  font-weight: 700;
  border: none;
  background: transparent;
}

.mb-filter-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
  max-height: 7rem;
  overflow-y: auto;
  padding-right: 2px;
}

.mb-filter-item {
  display: block;
  width: 100%;
  text-align: left;
  padding: 6px 8px;
  border: 1px solid transparent;
  border-radius: 4px;
  background: #0f172a;
  color: #cbd5e1;
  font-size: 11px;
  line-height: 1.35;
  cursor: pointer;
  transition: all 0.12s;
}

.mb-filter-item:hover {
  background: rgba(148, 163, 184, 0.12);
  color: #f1f5f9;
}

.mb-filter-item.active-nivel {
  background: #2563eb !important;
  color: #ffffff !important;
  border-color: #3b82f6 !important;
  font-weight: 700;
}

.mb-filter-item.active-niv3 {
  background: #16a34a !important;
  color: #ffffff !important;
  border-color: #22c55e !important;
  font-weight: 700;
}

.mb-filter-item.active-grupo {
  background: #eab308 !important;
  color: #1e293b !important;
  border-color: #ca8a04 !important;
  font-weight: 700;
}

.mb-nivel-group {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.mb-nivel-n2 {
  display: flex;
  align-items: center;
  gap: 6px;
  font-weight: 600;
}

.mb-nivel-toggle {
  flex: 0 0 auto;
  width: 12px;
  font-size: 9px;
  color: #94a3b8;
  line-height: 1;
}

.mb-nivel-label {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mb-nivel-subs {
  list-style: none;
  margin: 0;
  padding-left: 12px;
  width: 100%;
  box-sizing: border-box;
}

.mb-nivel-subs > li {
  margin: 0;
  padding: 0;
  list-style: none;
}

.mb-nivel-subs > li > button {
  width: 100%;
}

.mb-nivel-subs[id^="subniveles_"] {
  position: relative !important;
  width: 100% !important;
  max-width: 100% !important;
  box-sizing: border-box !important;
}

.mb-nivel-n2 { font-weight: 600; }
.mb-nivel-n3 { font-size: 10px; }

.mb-filter-loading,
.mb-filter-empty {
  font-size: 11px;
  color: #64748b;
  padding: 8px;
  text-align: center;
}

/* Barra superior — filtro por grupos + chips verdes (modal buscador standalone) */
.bp-grupos-bar,
.mb-contenedor-filtro-grupos {
  display: flex;
  align-items: stretch;
  gap: 10px;
  padding: 8px 14px;
  background: linear-gradient(90deg, #14532d 0%, #166534 55%, #15803d 100%);
  border-bottom: 1px solid rgba(34, 197, 94, 0.35);
}
.bp-grupos-bar-label {
  flex: 0 0 auto;
  align-self: center;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #bbf7d0;
  white-space: nowrap;
}
.bp-grupos-bar-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  padding: 6px 8px;
  border-radius: 8px;
  background: rgba(15, 23, 42, 0.28);
  border: 1px solid rgba(134, 239, 172, 0.25);
}
.bp-grupos-chips { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.bp-grupo-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 8px 4px 10px;
  border-radius: 999px;
  background: rgba(22, 163, 74, 0.95);
  border: 1px solid rgba(187, 247, 208, 0.45);
  color: #ecfdf5;
  font-size: 11px;
  font-weight: 700;
  max-width: 220px;
}
.bp-grupo-chip-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bp-grupo-chip-remove {
  border: none;
  background: rgba(15, 23, 42, 0.25);
  color: #ecfdf5;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 11px;
  padding: 0;
  flex-shrink: 0;
}
.bp-grupo-chip-remove:hover { background: rgba(239, 68, 68, 0.75); }
.bp-grupos-input-wrap { position: relative; flex: 1 1 180px; min-width: 140px; }
.bp-grupos-input {
  width: 100%;
  padding: 7px 10px;
  border-radius: 6px;
  border: 1px solid rgba(134, 239, 172, 0.35);
  background: rgba(15, 23, 42, 0.45);
  color: #f0fdf4;
  font-size: 12px;
  outline: none;
}
.bp-grupos-input::placeholder { color: rgba(187, 247, 208, 0.65); }
.bp-grupos-input:focus {
  border-color: #86efac;
  box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.18);
}
/* Autocomplete grupos: flujo normal dentro de la columna (sin absolute/z-index) */
.bp-grupos-ac,
#modalRightColumn .bp-grupos-ac,
#mbAccordionContainer .bp-grupos-ac {
  position: static !important;
  z-index: auto !important;
  margin-top: 4px;
  max-height: 160px;
  overflow-y: auto;
  background: #131c2e;
  border: 1px solid #334155;
  border-radius: 6px;
  box-shadow: none;
}
.bp-grupos-ac-item {
  padding: 8px 10px;
  font-size: 12px;
  color: #e2e8f0;
  cursor: pointer;
}
.bp-grupos-ac-item:hover,
.bp-grupos-ac-item.active { background: #2563eb; color: #fff; }
.bp-grupos-ac-empty { padding: 8px 10px; font-size: 11px; color: #64748b; }

/* ── Acordeones columna derecha modal buscar producto (paridad WinDEV) ── */
.mb-accordions-stack {
  display: flex;
  flex-direction: column;
  gap: 0;
  width: 100%;
  min-height: 0;
}

#modalRightColumn.mb-accordions-stack,
#bpPanel #modalRightColumn {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
}

.mb-accordion-item {
  border: 1px solid #334155;
  border-radius: 0;
  background: #0f172a;
  flex-shrink: 0;
}

.mb-accordion-item + .mb-accordion-item {
  border-top: none;
}

.mb-accordion-header.mb-acc-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 6px 12px;
  background: #1e293b;
  color: #e2e8f0;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  border-bottom: 1px solid #334155;
  cursor: pointer;
  user-select: none;
  transition: background 0.12s;
}

/* Utilidades Tailwind emuladas en cabeceras acordeón */
.mb-accordion-header.bg-slate-800 { background: #1e293b; }
.mb-accordion-header.text-slate-200 { color: #e2e8f0; }
.mb-accordion-header.cursor-pointer { cursor: pointer; }
.mb-accordion-header.font-bold { font-weight: 700; }
.mb-accordion-header.px-3 { padding-left: 12px; padding-right: 12px; }
.mb-accordion-header.py-1\.5 { padding-top: 6px; padding-bottom: 6px; }
.mb-accordion-header.border-b { border-bottom-width: 1px; border-bottom-style: solid; }
.mb-accordion-header.border-slate-700 { border-bottom-color: #334155; }
.mb-accordion-header.flex { display: flex; }
.mb-accordion-header.justify-between { justify-content: space-between; }
.mb-accordion-header.items-center { align-items: center; }

.mb-accordion-header.mb-acc-static {
  cursor: default;
}

.mb-general-top {
  flex-shrink: 0;
  border: 1px solid #334155;
  border-radius: 0;
  background: #0f172a;
}

.mb-general-body.mb-acc-panel-open {
  padding: 8px 10px;
  background: #0f172a;
  max-height: 280px;
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-gutter: stable;
}

.mb-accordion-header.mb-acc-header:hover {
  background: #334155;
}

.mb-accordion-item.mb-acc-open > .mb-accordion-header.mb-acc-header {
  background: #334155;
  color: #f1f5f9;
}

.mb-acc-chevron {
  font-size: 9px;
  color: #94a3b8;
  transition: transform 0.15s;
  flex-shrink: 0;
}

.mb-accordion-item.mb-acc-open > .mb-accordion-header .mb-acc-chevron {
  transform: rotate(180deg);
}

.mb-accordion-panel {
  display: none;
  padding: 8px 10px;
  background: #0f172a;
}

.mb-accordion-panel.mb-acc-expanded {
  display: block;
  max-height: none;
  overflow: visible;
}

.mb-acc-content,
.mb-acc-scroll {
  max-height: 180px !important;
  overflow-y: auto !important;
  overflow-x: hidden !important;
  padding: 4px 2px;
  box-sizing: border-box !important;
}

#infoPanelInventario.info-panel-inventario {
  max-height: none !important;
  overflow: visible !important;
}

.mb-genericos-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 10px;
}

.mb-genericos-table th {
  position: static;
  background: #334155;
  color: #cbd5e1;
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  padding: 6px 5px;
  text-align: left;
  border-bottom: 1px solid #475569;
}

.mb-genericos-table th.text-right,
.mb-genericos-table td.text-right {
  text-align: right;
}

.mb-genericos-table td {
  padding: 5px;
  border-bottom: 1px solid #334155;
  color: #e2e8f0;
  vertical-align: middle;
}

.mb-gen-codigo {
  font-family: monospace;
  font-weight: 700;
  color: #38bdf8;
  white-space: nowrap;
}

.mb-gen-nombre {
  max-width: 140px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mb-gen-exist {
  font-variant-numeric: tabular-nums;
  color: #22c55e;
  font-weight: 600;
}

#mbListaImagen .mb-ficha-img-wrap,
#mbListaImagen .bp-ficha-img-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 80px;
  max-height: 120px;
  margin-bottom: 8px;
  border: 1px dashed #475569;
  border-radius: 6px;
  background: #1e293b;
  overflow: hidden;
}

#mbListaImagen .mb-ficha-img,
#mbListaImagen .bp-ficha-img {
  max-width: 100%;
  max-height: 116px;
  object-fit: contain;
}

#mbListaImagen .mb-ficha-img-empty,
#mbListaImagen .bp-ficha-img-empty {
  font-size: 11px;
  color: #64748b;
}

#mbListaImagen .mb-ficha-nota,
#mbListaImagen .bp-ficha-nota {
  font-size: 11px;
  color: #cbd5e1;
  line-height: 1.45;
  white-space: pre-wrap;
  max-height: 72px;
  overflow-y: auto;
  padding: 8px;
  border-radius: 6px;
  background: #1e293b;
  border: 1px solid #334155;
}

#mbListaImagen .mb-ficha-nota-empty,
#mbListaImagen .bp-ficha-nota-empty {
  color: #64748b;
  font-style: italic;
}

.modal-buscador-container.modal-producto-filtros #mbAccordionStack,
.bp-mode-inventario #bpPanelStack,
.bp-mode-producto #bpPanelStack {
  display: flex;
  flex-direction: column;
}

.modal-buscador-container:not(.modal-producto-filtros) #mbAccordionStack {
  display: none !important;
}

.mb-nivel2-item {
  width: 100%;
}

.mb-nivel-n2.active-nivel {
  background: #2563eb !important;
  color: #ffffff !important;
  border-radius: 4px;
  font-weight: 700;
}

.mb-nivel-n3.active-niv3 {
  background: #16a34a !important;
  color: #ffffff !important;
  border-radius: 4px;
  font-weight: 700;
}

#mbListaNiveles .w-full { width: 100%; }
#mbListaNiveles .flex { display: flex; }
#mbListaNiveles .flex-col { flex-direction: column; }
#mbListaNiveles .gap-1 { gap: 4px; }
#mbListaNiveles .my-1 { margin-top: 4px; margin-bottom: 4px; }
#mbListaNiveles .pl-4 { padding-left: 16px; }
#mbListaNiveles .py-1 { padding-top: 4px; padding-bottom: 4px; }
#mbListaNiveles .px-2 { padding-left: 8px; padding-right: 8px; }
#mbListaNiveles .py-1\.5 { padding-top: 6px; padding-bottom: 6px; }
#mbListaNiveles .items-center { align-items: center; }
#mbListaNiveles .gap-1 { gap: 4px; }
#mbListaNiveles .text-xs { font-size: 11px; }
#mbListaNiveles .text-slate-200 { color: #e2e8f0; }
#mbListaNiveles .text-slate-300 { color: #cbd5e1; }
#mbListaNiveles .cursor-pointer { cursor: pointer; }
#mbListaNiveles .hover\:bg-slate-700:hover { background: #334155; }

.mb-nivel-subs {
  list-style: none;
  margin: 0;
  padding: 0;
  width: 100%;
  box-sizing: border-box;
}

/* Contención fisica estricta para la columna derecha en todos los modulos */
#modalRightColumn {
  position: relative !important;
  display: flex !important;
  flex-direction: column !important;
  width: 100% !important;
  max-width: 100% !important;
  overflow-x: hidden !important;
  overflow-y: auto !important;
  box-sizing: border-box !important;
}

/* Forzar que todos los acordeones vivan dentro del ancho de la columna derecha */
#modalRightColumn #mbAccordionContainer,
#modalRightColumn #mbAcordeonNiveles,
#modalRightColumn #mbAcordeonGrupos,
#modalRightColumn #mbAcordeonGenericos,
#modalRightColumn #mbAcordeonImagen,
#modalRightColumn .mb-acc-item,
#modalRightColumn .mb-acc-content,
#modalRightColumn #mbListaGenericos {
  position: relative !important;
  top: auto !important;
  left: 0 !important;
  right: auto !important;
  bottom: auto !important;
  float: none !important;
  transform: none !important;
  width: 100% !important;
  max-width: 100% !important;
  margin: 0 !important;
  box-sizing: border-box !important;
}

/* ── Sidebars: contraste blanco brillante ── */
.sidebar-left a, .sidebar-left span,
.sidebar-right a, .sidebar-right span,
.sidebar-left .sidebar-item,
.sidebar-right .sidebar-item,
.sidebar-left p,
.sidebar-right p {
  color: #f8fafc !important; /* Blanco brillante */
  font-weight: 500;
}

.sidebar-left a:hover, .sidebar-right a:hover,
.sidebar-left .sidebar-item:hover,
.sidebar-right .sidebar-item:hover {
  color: #ffffff !important;
  text-shadow: 0 0 5px rgba(255, 255, 255, 0.4);
}

.sidebar-left .text-\[10px\],
.sidebar-right .text-\[10px\],
.sidebar-left p.text-\[10px\],
.sidebar-right p.text-\[10px\] {
  color: #cbd5e1 !important;
  font-weight: 700;
}

/* ── Dashboard ejecutivo (index) ── */
.uf-dashboard {
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-height: 100%;
}

.uf-dash-kpi-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 10px;
}

.uf-dash-kpi {
  background: linear-gradient(180deg, #131C2E 0%, #0B0F19 100%);
  border: 1px solid #1e293b;
  border-radius: 10px;
  padding: 12px 14px;
  min-height: 96px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.uf-dash-kpi-total {
  border-color: #2563eb;
  box-shadow: inset 0 0 0 1px rgba(37, 99, 235, 0.25);
}

.uf-dash-kpi-label,
.kpi-card .kpi-title,
.kpi-label {
  margin: 0;
  font-size: 0.95rem !important; /* ~20% más grande */
  line-height: 1.25;
  color: #e2e8f0 !important;
  font-weight: 600;
  letter-spacing: 0.01em;
}

.uf-dash-kpi-qty,
.kpi-card .kpi-count,
.kpi-number {
  margin: 8px 0 2px;
  font-size: 1.35rem !important; /* ~30% más pequeño */
  line-height: 1.2;
  font-weight: 700;
  color: #f8fafc;
  letter-spacing: -0.02em;
}

.uf-dash-kpi-amt,
.kpi-card .kpi-amount,
.kpi-value {
  margin: 0;
  font-size: 1.05rem !important; /* ~20% más grande */
  font-weight: 600;
  color: #38bdf8 !important;
}

.uf-dash-charts {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  flex: 1;
  min-height: 0;
}

.uf-dash-chart-panel {
  background: linear-gradient(180deg, #131C2E 0%, #0B0F19 100%);
  border: 1px solid #1e293b;
  border-radius: 10px;
  padding: 14px 16px 12px;
  display: flex;
  flex-direction: column;
  min-height: 320px;
}

.uf-dash-chart-head h2 {
  margin: 0;
  font-size: 15px;
  font-weight: 700;
  color: #f8fafc;
}

.uf-dash-chart-head p {
  margin: 4px 0 0;
  font-size: 11px;
  color: #94a3b8;
  font-style: italic;
}

.uf-dash-chart-body {
  flex: 1;
  min-height: 220px;
  position: relative;
  margin-top: 10px;
}

.uf-dash-chart-body canvas {
  width: 100% !important;
  height: 100% !important;
}

.uf-dash-chart-foot {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid #1e293b;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.uf-dash-chart-foot span {
  font-size: 12px;
  color: #94a3b8;
  font-weight: 600;
}

.uf-dash-chart-foot strong {
  font-size: 13px;
  color: #38bdf8;
  font-weight: 700;
}

@media (max-width: 1280px) {
  .uf-dash-kpi-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 900px) {
  .uf-dash-kpi-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .uf-dash-charts {
    grid-template-columns: 1fr;
  }
}

/* ── 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-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; }

/* ----------------------------------------------------------------
   Reporte Administrativo — barra lateral WinDEV (Admon / Cubo / …)
   ---------------------------------------------------------------- */
.ra-leftnav {
  width: 56px;
  flex-shrink: 0;
  background: #0c1929;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 4px 0 8px;
  gap: 4px;
  border-right: 1px solid #1e3a5f;
}
.ra-nav-btn {
  width: 50px;
  min-height: 52px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  padding: 6px 3px;
  border-radius: 5px;
  cursor: pointer;
  border: 1px solid transparent;
  background: transparent;
  color: #94a3b8;
  transition: background .12s, color .12s, border-color .12s;
}
.ra-nav-btn:hover {
  background: rgba(255, 255, 255, .08);
  color: #e2e8f0;
  border-color: rgba(125, 211, 252, .25);
}
.ra-nav-btn.active {
  background: #7aad00;
  color: #fff;
  border-color: #9acc1a;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .25);
}
.ra-nav-icon {
  width: 22px;
  height: 22px;
  flex-shrink: 0;
}
.ra-nav-lbl {
  font-size: 8.5px;
  font-weight: 700;
  text-align: center;
  line-height: 1.15;
  letter-spacing: .02em;
}
