/* NEPXUS — personalización de apariencia (opciones del panel Configuraciones > Personalizar apariencia).
   Lo maneja assets/js/nx-theme.js, que escribe en <html>:
     data-bs-theme="dark"            modo oscuro (claro = valor de origen)
     data-nx-sbm="dark|light|color|gradient"  menú lateral (el color/tono lo dan --nx-p / --nx-sb de nx-theme.css)
     data-nx-topbar="light|dark|colored"      barra superior (reglas en custom.css)
     html.nx-floating                navegación flotante (reglas en custom.css)
     data-nx-cw="boxed"              contenido centrado
     data-nx-dn="compact"            densidad compacta
     data-nx-rd="square"             esquinas rectas
     data-nx-fs="sm|lg"              tamaño de texto (reglas en custom.css)
   Se carga DESPUÉS de custom.css (partials/head-css.php). Sin ninguna preferencia guardada no aplica ninguna regla de
   este archivo salvo el estilo del propio panel: el aspecto original queda intacto. */

/* ════════════════ PANEL DE APARIENCIA ════════════════ */
.right-bar { width: 320px; right: -330px; }
.right-bar .rightbar-title h5 { font-size: 1rem; }
#nx-theme-panel .nx-th-sub { font-size: .74rem; color: #74788d; margin-bottom: 6px; }
#nx-theme-panel .nx-th-hint { font-size: .72rem; color: #8a90a6; line-height: 1.35; margin-top: 6px; }
#nx-theme-panel .nx-opt-grid { display: grid; gap: 8px; }
#nx-theme-panel .nx-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
#nx-theme-panel .nx-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
#nx-theme-panel .nx-cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
#nx-theme-panel .nx-opt { display: flex; flex-direction: column; align-items: stretch; gap: 6px; padding: 6px 6px 7px; border: 1px solid var(--bs-border-color, #e3e6ee);
    border-radius: 10px; background: var(--bs-body-bg, #fff); color: var(--bs-body-color, #495057); cursor: pointer; font-size: .76rem; line-height: 1.2; text-align: center;
    transition: border-color .15s, background-color .15s, box-shadow .15s, color .15s; }
#nx-theme-panel .nx-opt-pv { display: block; border-radius: 6px; overflow: hidden; line-height: 0; }
#nx-theme-panel .nx-opt-pv svg { display: block; height: auto; }
#nx-theme-panel .nx-opt:hover { border-color: var(--nx-p, #556ee6); }
#nx-theme-panel .nx-opt:focus-visible, #nx-theme-panel .nx-th-sw button:focus-visible, #nx-theme-panel .nx-th-seg button:focus-visible { outline: 2px solid var(--nx-p, #556ee6); outline-offset: 2px; }
#nx-theme-panel .nx-opt.active { border-color: var(--nx-p, #556ee6); background: rgba(var(--nx-p-rgb, 85,110,230), .1); color: var(--nx-p, #556ee6); font-weight: 600;
    box-shadow: 0 0 0 1px var(--nx-p, #556ee6); }
#nx-theme-panel .nx-cols-4 .nx-opt { font-size: .7rem; padding: 5px 4px 6px; }
/* Color principal: marca de selección y selector libre (arcoíris) */
#nx-theme-panel .nx-th-sw { align-items: center; }
#nx-theme-panel .nx-th-sw button { position: relative; }
#nx-theme-panel .nx-th-sw button[data-nx-k="p"].active::after, #nx-theme-panel .nx-th-sw button[data-nx-k="sb"].active::after {
    content: "\2713"; position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; color: #fff; font-size: 14px; font-weight: 700; line-height: 1; }
#nx-theme-panel .nx-th-rainbow { position: relative; display: block; width: 30px; height: 30px; margin: 0; border-radius: 50%; overflow: hidden; cursor: pointer;
    background: conic-gradient(#ef4444, #f59e0b, #eab308, #22c55e, #06b6d4, #3b82f6, #a855f7, #ec4899, #ef4444);
    box-shadow: inset 0 0 0 2px #fff, 0 0 0 1px rgba(0,0,0,.12); transition: transform .15s; }
#nx-theme-panel .nx-th-rainbow:hover { transform: scale(1.1); }
#nx-theme-panel .nx-th-rainbow.active { box-shadow: inset 0 0 0 2px #fff, 0 0 0 2px var(--nx-p, #556ee6); transform: scale(1.1); }
#nx-theme-panel .nx-th-rainbow input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; padding: 0; border: 0; }
#nx-theme-panel .nx-th-hex { margin-top: 10px; }
#nx-theme-panel .nx-th-seg button { color: var(--bs-body-color, inherit); }
#nx-theme-panel #nx-sb-tones[hidden] { display: none; }

/* ════════════════ MENÚ LATERAL: claro / color / degradado ════════════════
   custom.css pinta el menú con variables --nx-sm-* (por defecto = menú oscuro de origen); aquí solo se redefinen. */
html[data-nx-sbm="light"] {
    --nx-sm-bg: #fff; --nx-sm-brand: transparent; --nx-sm-title: #98a2b3; --nx-sm-text: #545a6d; --nx-sm-icon: #7f8497; --nx-sm-hi: var(--nx-p, #556ee6);
    --nx-sm-hibg: rgba(var(--nx-p-rgb, 85,110,230), .10); --nx-sm-hibg2: rgba(var(--nx-p-rgb, 85,110,230), .12); --nx-fly-bg: #fff;
}
html[data-nx-sbm="color"], html[data-nx-sbm="gradient"] {
    --nx-sm-bg: var(--nx-p, #556ee6); --nx-sm-brand: var(--nx-p, #556ee6); --nx-sm-title: rgba(255,255,255,.58); --nx-sm-text: rgba(255,255,255,.88); --nx-sm-icon: rgba(255,255,255,.78); --nx-sm-hi: #fff;
    --nx-sm-hibg: rgba(255,255,255,.14); --nx-sm-hibg2: rgba(255,255,255,.18); --nx-fly-bg: color-mix(in srgb, var(--nx-p, #556ee6) 86%, #000);
}
/* Degradado: del color principal a una versión más profunda (el bloque del logo toma el color de arriba, sin corte) */
html[data-nx-sbm="gradient"] { --nx-sm-bg: linear-gradient(180deg, var(--nx-p, #556ee6) 0%, color-mix(in srgb, var(--nx-p, #556ee6) 52%, #1e1b4b) 100%); }
/* Iconos activos/hover en color o degradado: blancos (no el color principal, que se confundiría con el fondo) */
html[data-nx-sbm="color"] .vertical-menu, html[data-nx-sbm="gradient"] .vertical-menu { --nx-p2: #fff; }
html[data-bs-theme="dark"][data-nx-sbm="light"] {
    --nx-sm-bg: var(--bs-tertiary-bg, #32394e); --nx-sm-title: #8f98b3; --nx-sm-text: #c3cbe4; --nx-sm-icon: #98a2c3; --nx-sm-hi: #fff;
    --nx-sm-hibg: rgba(255,255,255,.08); --nx-sm-hibg2: rgba(255,255,255,.1); --nx-fly-bg: var(--bs-tertiary-bg, #32394e);
}
html[data-nx-sbm="light"] .vertical-menu { box-shadow: 0 .75rem 1.5rem rgba(18,38,63,.06), 1px 0 0 var(--bs-border-color, #e9ecef); }
html[data-nx-sbm="light"] #sidebar-menu .nx-lk-basic { background: #eef1fd; color: #4a63d9; border-color: #cfd8fb; }
html[data-nx-sbm="light"] #sidebar-menu .nx-lk-mid, html[data-nx-sbm="light"] #sidebar-menu .nx-lk-vip { background: linear-gradient(145deg, #fff6dd, #ffe7a3); color: #a35f00; border-color: #f3cd72; }

/* ════════════════ ANCHO DEL CONTENIDO: centrado ════════════════ */
html[data-nx-cw="boxed"] .page-content > .container-fluid,
html[data-nx-cw="boxed"] .footer > .container-fluid { max-width: 1200px; margin-left: auto; margin-right: auto; }

/* ════════════════ DENSIDAD: compacta ════════════════ */
html[data-nx-dn="compact"] .page-content { padding-top: calc(70px + 14px); }
html[data-nx-dn="compact"] .page-title-box { padding-bottom: 12px; }
html[data-nx-dn="compact"] .page-title-box h4, html[data-nx-dn="compact"] .page-title-box .h4 { font-size: 15px; }
html[data-nx-dn="compact"] .card { margin-bottom: 14px; }
html[data-nx-dn="compact"] .card-body { padding: .85rem; }
html[data-nx-dn="compact"] .card-header, html[data-nx-dn="compact"] .card-footer { padding: .55rem .85rem; }
html[data-nx-dn="compact"] .modal-header, html[data-nx-dn="compact"] .modal-footer { padding-top: .6rem; padding-bottom: .6rem; }
html[data-nx-dn="compact"] .modal-body { padding: .9rem 1rem; }
html[data-nx-dn="compact"] .table > :not(caption) > * > * { padding-top: .32rem; padding-bottom: .32rem; }
html[data-nx-dn="compact"] .btn:not(.btn-sm):not(.btn-lg):not(.header-item):not(.btn-close) { padding-top: .28rem; padding-bottom: .28rem; font-size: .82rem; }
html[data-nx-dn="compact"] .form-control:not(.form-control-sm):not(.form-control-lg):not(textarea),
html[data-nx-dn="compact"] .form-select:not(.form-select-sm):not(.form-select-lg) { padding-top: .28rem; padding-bottom: .28rem; font-size: .84rem; }
html[data-nx-dn="compact"] .form-label { margin-bottom: .25rem; }
html[data-nx-dn="compact"] .mb-3 { margin-bottom: .7rem !important; }
html[data-nx-dn="compact"] .mb-4 { margin-bottom: 1rem !important; }
html[data-nx-dn="compact"] .dropdown-item { padding-top: .3rem; padding-bottom: .3rem; }
html[data-nx-dn="compact"] .nav-tabs .nav-link, html[data-nx-dn="compact"] .nav-pills .nav-link { padding-top: .45rem; padding-bottom: .45rem; }
html[data-nx-dn="compact"] .list-group-item { padding-top: .45rem; padding-bottom: .45rem; }
html[data-nx-dn="compact"] #sidebar-menu ul li a { padding-top: .42rem; padding-bottom: .42rem; }
html[data-nx-dn="compact"] #sidebar-menu ul li ul.sub-menu li a { padding-top: .3rem; padding-bottom: .3rem; }
/* select2 (los combos tienen altura fija en ui-widgets.php) */
html[data-nx-dn="compact"] .select2-container .select2-selection--single { height: 32px !important; min-height: 32px !important; }
html[data-nx-dn="compact"] .select2-container--default .select2-selection--single .select2-selection__rendered { line-height: 30px !important; font-size: .84rem !important; }
html[data-nx-dn="compact"] .select2-container--default .select2-selection--single .select2-selection__arrow { height: 30px !important; }
html[data-nx-dn="compact"] .form-select-sm + .select2-container .select2-selection--single,
html[data-nx-dn="compact"] .nx-s2-compact .select2-selection--single { height: 28px !important; min-height: 28px !important; }
html[data-nx-dn="compact"] .form-select-sm + .select2-container .select2-selection__rendered,
html[data-nx-dn="compact"] .nx-s2-compact .select2-selection__rendered { line-height: 26px !important; }
html[data-nx-dn="compact"] .form-select-sm + .select2-container .select2-selection__arrow,
html[data-nx-dn="compact"] .nx-s2-compact .select2-selection__arrow { height: 26px !important; }
html[data-nx-dn="compact"] .select2-results__option { padding-top: .32rem !important; padding-bottom: .32rem !important; }
html[data-nx-dn="compact"] .nx-dt-wrap .nx-dt-ico { padding-top: .25rem; padding-bottom: .25rem; }

/* ════════════════ ESQUINAS: rectas ════════════════ */
html[data-nx-rd="square"] {
    --bs-border-radius: 0; --bs-border-radius-sm: 0; --bs-border-radius-lg: 0; --bs-border-radius-xl: 0; --bs-border-radius-xxl: 0;
    --nx-fm-radius: 0px;
}
html[data-nx-rd="square"] :is(.card, .card-header, .card-footer, .btn, .form-control, .form-select, .input-group-text, .badge, .alert, .modal-content, .dropdown-menu, .dropdown-item,
    .nav-pills .nav-link, .nav-tabs .nav-link, .page-link, .list-group, .list-group-item, .progress, .progress-bar, .img-thumbnail, .toast, .popover, .accordion-item, .accordion-button,
    .select2-selection, .select2-dropdown, .select2-search__field, .select2-results__option, .select2-selection__choice, .swal2-popup, .swal2-styled, .swal2-input, .swal2-select, .swal2-textarea,
    .datepicker, .datepicker table tr td, .datepicker table tr th, .nx-tp, .nx-tp-val, .nx-tp-mer, .nx-tp-chips button, .nx-qa-item, .topbar-status-pill, .tb-chip, .nx-lk-badge,
    .dataTables_wrapper .dataTables_filter input, .dataTables_wrapper .dataTables_length select, .soft-panel, .view-box, .view-note, .kpi-card, .filter-card, .summary-card):not(.rounded-circle):not(.rounded-pill):not(.avatar-title) { border-radius: 0 !important; }
html[data-nx-rd="square"] .vertical-menu, html[data-nx-rd="square"] #page-topbar, html[data-nx-rd="square"] .navbar-brand-box { border-radius: 0 !important; }
html[data-nx-rd="square"] [style*="border-radius"]:not([style*="50%"]):not(.rounded-circle):not(.rounded-pill):not(.avatar-title):not(.nx-opt):not(.nx-opt-pv) { border-radius: 0 !important; }

/* ════════════════ MODO OSCURO: ajustes sobre el tema oscuro de base ════════════════ */
html[data-bs-theme="dark"] body { background-color: var(--bs-body-bg); color: var(--bs-body-color); }
html[data-bs-theme="dark"] .bg-white, html[data-bs-theme="dark"] .bg-light, html[data-bs-theme="dark"] .table-light,
html[data-bs-theme="dark"] .card.bg-white, html[data-bs-theme="dark"] .text-bg-light { background-color: var(--bs-secondary-bg) !important; color: var(--bs-body-color); }
html[data-bs-theme="dark"] .text-dark, html[data-bs-theme="dark"] .text-black { color: var(--bs-body-color) !important; }
html[data-bs-theme="dark"] .text-muted { color: #8f98b3 !important; }
html[data-bs-theme="dark"] .border, html[data-bs-theme="dark"] .border-bottom, html[data-bs-theme="dark"] .border-top { border-color: var(--bs-border-color) !important; }
html[data-bs-theme="dark"] hr { border-color: var(--bs-border-color); opacity: 1; }
html[data-bs-theme="dark"] .btn-light { --bs-btn-bg: #32394e; --bs-btn-border-color: #32394e; --bs-btn-color: #e3e7f5; --bs-btn-hover-bg: #3b4360; --bs-btn-hover-border-color: #3b4360; --bs-btn-hover-color: #fff;
    --bs-btn-active-bg: #3b4360; --bs-btn-active-border-color: #3b4360; --bs-btn-active-color: #fff; }
html[data-bs-theme="dark"] .btn-outline-secondary, html[data-bs-theme="dark"] .btn-outline-dark { --bs-btn-color: #b5bdd6; --bs-btn-border-color: #4a5370; --bs-btn-hover-bg: #3b4360; --bs-btn-hover-color: #fff; --bs-btn-hover-border-color: #4a5370; }
html[data-bs-theme="dark"] .form-control, html[data-bs-theme="dark"] .form-select, html[data-bs-theme="dark"] .input-group-text {
    background-color: #2a3042; border-color: #3a4260; color: #d6dcf0; }
html[data-bs-theme="dark"] .form-control::placeholder { color: #7f88a6; }
html[data-bs-theme="dark"] .form-control:disabled, html[data-bs-theme="dark"] .form-control[readonly], html[data-bs-theme="dark"] .form-select:disabled { background-color: #232838; color: #8f98b3; }
html[data-bs-theme="dark"] .form-control:focus, html[data-bs-theme="dark"] .form-select:focus { background-color: #2a3042; color: #fff; border-color: var(--nx-p, #556ee6); }
html[data-bs-theme="dark"] .table { --bs-table-color: var(--bs-body-color); --bs-table-border-color: var(--bs-border-color); }
html[data-bs-theme="dark"] .table > thead > tr > th, html[data-bs-theme="dark"] .table thead th { background-color: #2a3042; color: #e3e7f5; border-color: var(--bs-border-color); }
html[data-bs-theme="dark"] .table-striped > tbody > tr:nth-of-type(odd) > * { --bs-table-bg-type: rgba(255,255,255,.03); }
html[data-bs-theme="dark"] .table-hover > tbody > tr:hover > * { --bs-table-bg-state: rgba(255,255,255,.05); color: #fff; }
html[data-bs-theme="dark"] .modal-content { background-color: #262b3c; color: var(--bs-body-color); border-color: #353d55; }
html[data-bs-theme="dark"] .modal-header, html[data-bs-theme="dark"] .modal-footer { border-color: #353d55; }
html[data-bs-theme="dark"] .btn-close { filter: invert(1) grayscale(100%) brightness(200%); }
html[data-bs-theme="dark"] .dropdown-menu { background-color: #2a3042; border-color: #353d55; color: var(--bs-body-color); }
html[data-bs-theme="dark"] .dropdown-item { color: #c3cbe4; }
html[data-bs-theme="dark"] .dropdown-item:hover, html[data-bs-theme="dark"] .dropdown-item:focus { background-color: #343b52; color: #fff; }
html[data-bs-theme="dark"] .dropdown-divider { border-color: #353d55; }
html[data-bs-theme="dark"] .card { background-color: #262b3c; border-color: #2f3650; }
html[data-bs-theme="dark"] .card-header, html[data-bs-theme="dark"] .card-footer { background-color: transparent; border-color: #2f3650; }
html[data-bs-theme="dark"] .nav-tabs { border-color: #353d55; }
html[data-bs-theme="dark"] .nav-tabs .nav-link.active { background-color: #262b3c; border-color: #353d55 #353d55 #262b3c; color: #fff; }
html[data-bs-theme="dark"] .nav-tabs .nav-link:hover { border-color: #353d55 #353d55 transparent; }
html[data-bs-theme="dark"] .list-group-item { background-color: #262b3c; border-color: #353d55; color: var(--bs-body-color); }
html[data-bs-theme="dark"] .page-link { background-color: #262b3c; border-color: #353d55; color: #c3cbe4; }
html[data-bs-theme="dark"] .page-item.disabled .page-link { background-color: #232838; color: #6b7390; }
html[data-bs-theme="dark"] .alert { border-color: #353d55; }
html[data-bs-theme="dark"] .popover, html[data-bs-theme="dark"] .toast { background-color: #2a3042; color: var(--bs-body-color); border-color: #353d55; }
html[data-bs-theme="dark"] code { background: rgba(255,255,255,.06); }
/* Barra superior y chips de estado */
html[data-bs-theme="dark"] .topbar-status-pill { background: rgba(255,255,255,.06) !important; border-color: rgba(255,255,255,.12) !important; color: #d6dcf0; }
html[data-bs-theme="dark"] .topbar-status-pill strong { color: #fff; }
html[data-bs-theme="dark"] .topbar-company-name, html[data-bs-theme="dark"] .tb-chip-sep { color: #8f98b3; }
html[data-bs-theme="dark"] .tb-chip-divider { background: rgba(255,255,255,.15); }
html[data-bs-theme="dark"] .tb-chip-ok { color: #4ade80; } html[data-bs-theme="dark"] .tb-chip-warn { color: #fbbf24; } html[data-bs-theme="dark"] .tb-chip-danger { color: #f87171; }
html[data-bs-theme="dark"] .nx-qa-item { color: var(--bs-body-color); }
html[data-bs-theme="dark"] .nx-qa-item:hover { background: #343b52; }
/* select2 */
html[data-bs-theme="dark"] .select2-container--default .select2-selection--single,
html[data-bs-theme="dark"] .select2-container--default .select2-selection--multiple { background-color: #2a3042 !important; border-color: #3a4260 !important; }
html[data-bs-theme="dark"] .select2-container--default .select2-selection--single .select2-selection__rendered { color: #d6dcf0 !important; }
html[data-bs-theme="dark"] .select2-container--default .select2-selection--single .select2-selection__placeholder { color: #7f88a6 !important; }
html[data-bs-theme="dark"] .select2-container--default .select2-selection--single .select2-selection__arrow b { border-top-color: #98a2c3; }
html[data-bs-theme="dark"] .select2-container--default .select2-selection--multiple .select2-selection__choice { background-color: #3b4360; border-color: #4a5370; color: #e3e7f5; }
html[data-bs-theme="dark"] .select2-dropdown { background-color: #2a3042; border-color: #3a4260 !important; color: #d6dcf0; }
html[data-bs-theme="dark"] .select2-container--default .select2-results__option { color: #d6dcf0; }
html[data-bs-theme="dark"] .select2-container--default .select2-results__option[aria-selected=true], html[data-bs-theme="dark"] .select2-container--default .select2-results__option--selected { background-color: #343b52; color: #fff; }
html[data-bs-theme="dark"] .select2-container--default .select2-results__option--highlighted[aria-selected],
html[data-bs-theme="dark"] .select2-container--default .select2-results__option--highlighted.select2-results__option--selectable { color: #fff !important; }
html[data-bs-theme="dark"] .select2-search--dropdown .select2-search__field { background-color: #232838; border-color: #3a4260; color: #d6dcf0; }
html[data-bs-theme="dark"] .select2-container--disabled .select2-selection--single { background-color: #232838 !important; }
html[data-bs-theme="dark"] .select2-dropdown .select2-results__group { color: #8f98b3; }
/* Fechas y horas */
html[data-bs-theme="dark"] .datepicker.dropdown-menu { background-color: #2a3042; border-color: #3a4260; color: #d6dcf0; }
html[data-bs-theme="dark"] .datepicker table tr td, html[data-bs-theme="dark"] .datepicker table tr th { color: #d6dcf0; }
html[data-bs-theme="dark"] .datepicker table tr td.day:hover, html[data-bs-theme="dark"] .datepicker table tr td span:hover,
html[data-bs-theme="dark"] .datepicker .datepicker-switch:hover, html[data-bs-theme="dark"] .datepicker .prev:hover, html[data-bs-theme="dark"] .datepicker .next:hover,
html[data-bs-theme="dark"] .datepicker tfoot tr th.today:hover, html[data-bs-theme="dark"] .datepicker tfoot tr th.clear:hover { background: #3b4360 !important; }
html[data-bs-theme="dark"] .datepicker table tr td.old, html[data-bs-theme="dark"] .datepicker table tr td.new { color: #6b7390; }
html[data-bs-theme="dark"] .datepicker table tr td.today { background-color: rgba(var(--nx-p-rgb, 85,110,230), .25) !important; color: #fff; }
html[data-bs-theme="dark"] .datepicker table tr td.disabled, html[data-bs-theme="dark"] .datepicker table tr td.disabled:hover { color: #565e7a !important; }
html[data-bs-theme="dark"] .datepicker .dow { color: #8f98b3; }
html[data-bs-theme="dark"] .nx-tp { background: #2a3042; border-color: #3a4260; color: #d6dcf0; }
html[data-bs-theme="dark"] .nx-tp .nx-tp-val, html[data-bs-theme="dark"] .nx-tp .nx-tp-mer { background: #232838; border-color: #3a4260; color: #e3e7f5; }
html[data-bs-theme="dark"] .nx-tp .nx-tp-sep { color: #c3cbe4; }
html[data-bs-theme="dark"] .nx-tp .nx-tp-chips button { background: #343b52; border-color: #3a4260; color: #c3cbe4; }
html[data-bs-theme="dark"] .nx-tp .nx-tp-foot { border-color: #3a4260; }
html[data-bs-theme="dark"] .nx-tp .nx-tp-btn:hover, html[data-bs-theme="dark"] .nx-tp .nx-tp-link:hover, html[data-bs-theme="dark"] .nx-tp .nx-tp-chips button:hover { background: #3b4360; }
html[data-bs-theme="dark"] .nx-dt-wrap .nx-dt-ico { color: #98a2c3; }
html[data-bs-theme="dark"] .nx-dt-wrap.nx-dt-disabled .nx-dt-ico, html[data-bs-theme="dark"] .nx-dt-wrap .nx-dt-disp[readonly] + .nx-dt-ico { background-color: #232838; }
/* SweetAlert2 */
html[data-bs-theme="dark"] .swal2-popup { background: #262b3c; color: #d6dcf0; }
html[data-bs-theme="dark"] .swal2-title, html[data-bs-theme="dark"] .swal2-html-container, html[data-bs-theme="dark"] .swal2-content { color: #e3e7f5; }
html[data-bs-theme="dark"] .swal2-input, html[data-bs-theme="dark"] .swal2-textarea, html[data-bs-theme="dark"] .swal2-select { background: #2a3042; border-color: #3a4260; color: #e3e7f5; }
html[data-bs-theme="dark"] .swal2-footer { border-color: #353d55; color: #98a2c3; }
html[data-bs-theme="dark"] .swal2-validation-message { background: #2a3042; color: #f8a6a6; }
html[data-bs-theme="dark"] div:where(.swal2-container) div:where(.swal2-popup) { background: #262b3c; color: #d6dcf0; }
/* DataTables y utilidades de tablas */
html[data-bs-theme="dark"] .dataTables_wrapper .dataTables_info, html[data-bs-theme="dark"] .dataTables_wrapper .dataTables_length,
html[data-bs-theme="dark"] .dataTables_wrapper .dataTables_filter { color: #98a2c3; }
html[data-bs-theme="dark"] table.dataTable tbody tr { background-color: transparent; }
html[data-bs-theme="dark"] table.dataTable.stripe > tbody > tr.odd > *, html[data-bs-theme="dark"] table.dataTable.display > tbody > tr.odd > * { box-shadow: inset 0 0 0 9999px rgba(255,255,255,.03); }
/* Paneles con fondo claro fijo en pantallas concretas (clases repetidas en el ERP) */
html[data-bs-theme="dark"] :is(.soft-panel, .view-box, .view-note, .kpi-card, .bi-kpi, .bi-filter, .rec-summary-card, .filter-panel, .filter-card, .summary-card, .panel, .module-card, .info-box, .report-card, .sheet, .payment-row, .readonly-field, .box) {
    background-color: #262b3c !important; border-color: #353d55 !important; color: var(--bs-body-color); }
html[data-bs-theme="dark"] .form-bloqueado :is(input, select, button, textarea) { background-color: #232838 !important; color: #8f98b3 !important; }
/* Estilos en línea con fondo blanco / gris muy claro */
html[data-bs-theme="dark"] [style*="background:#fff"], html[data-bs-theme="dark"] [style*="background: #fff"], html[data-bs-theme="dark"] [style*="background-color:#fff"],
html[data-bs-theme="dark"] [style*="background-color: #fff"], html[data-bs-theme="dark"] [style*="background:white"], html[data-bs-theme="dark"] [style*="background: white"],
html[data-bs-theme="dark"] [style*="background:#f8f9fa"], html[data-bs-theme="dark"] [style*="background: #f8f9fa"], html[data-bs-theme="dark"] [style*="background:#f8f9fc"],
html[data-bs-theme="dark"] [style*="background: #f8f9fc"], html[data-bs-theme="dark"] [style*="background:#f5f6fa"], html[data-bs-theme="dark"] [style*="background:#f1f3f9"] {
    background-color: #262b3c !important; color: var(--bs-body-color); }
/* Panel de apariencia en oscuro */
html[data-bs-theme="dark"] #nx-theme-panel .nx-th-title, html[data-bs-theme="dark"] #nx-theme-panel .nx-th-sub { color: #98a2c3; }
html[data-bs-theme="dark"] #nx-theme-panel .nx-th-hint { color: #7f88a6; }
html[data-bs-theme="dark"] #nx-theme-panel .nx-opt { background: #2a3042; border-color: #3a4260; color: #c3cbe4; }
html[data-bs-theme="dark"] #nx-theme-panel .nx-opt.active { background: rgba(var(--nx-p-rgb, 85,110,230), .22); color: #fff; }
html[data-bs-theme="dark"] #nx-theme-panel .nx-th-seg button { border-color: #3a4260; }
html[data-bs-theme="dark"] #nx-theme-panel .nx-th-sw button, html[data-bs-theme="dark"] #nx-theme-panel .nx-th-rainbow { box-shadow: inset 0 0 0 2px #262b3c, 0 0 0 1px rgba(255,255,255,.18); }
html[data-bs-theme="dark"] #nx-theme-panel .nx-th-hex input[type=text] { background: #2a3042; color: #d6dcf0; border-color: #3a4260; }
html[data-bs-theme="dark"] .right-bar { background-color: #262b3c; color: var(--bs-body-color); }
html[data-bs-theme="dark"] .right-bar .btn-light { color: #e3e7f5; }
