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


/* ===== Correcciones por pantalla (revisión modo oscuro/densidad/esquinas) ===== */
/* @@FIX-A@@ */
/* Esquinas rectas: tarjetas/insignias propias de estas pantallas (radios fijos en su CSS) */
html[data-nx-rd="square"] :is(.account-card, .audit-card, .audit-kpi, .bi-hero, .bi-kpi, .bi-filter, .bi-card, .bi-criteria, .bi-badge, .bi-help, .bi-tbl-search input, .tipo-pill, .estado-pill, .bix-bucket,
    .rec-card, .glossary-item, .alert-soft, .badge-ac, .badge-status-1, .badge-status-2, .badge-status-3, .badge-status-4, .badge-status-5, .badge-cw, .cw-bay-card, .cw-bay-status,
    .cal-wrap, .cal-view-tabs, .cal-view-tab, .cal-event, .cal-mini-day, .cal-prof-item, .cal-mini-nav .btn-date-nav, .cal-toolbar .btn-nav, .cal-timepicker-panel, .ticket-timepicker-panel,
    .nx-cred-box, #cwToolbarCard, #cwBaysCard, #cwTicketsCard, #modalCrearEditar .modal-content, #modalCrearEditar .modal-tercero__header, #modalCrearEditar .text-muted.mb-2):not(.rounded-circle):not(.rounded-pill) { border-radius: 0 !important; }
html[data-nx-rd="square"] :is(.nxck-banner, .nxck-modal, .nxck-btn, .nxck-cat, .nxck-badge) { border-radius: 0; }
html[data-nx-rd="square"] :is(#modalCrearEditar, #carrModal) :is(.form-control, .form-select, .input-group-text, .btn, .select2-selection) { border-radius: 0 !important; }
/* Banner de cookies (assets/css/cookie-consent.css, colores fijos) */
html[data-bs-theme="dark"] .nxck-banner, html[data-bs-theme="dark"] .nxck-modal { background: #262b3c; color: #c3cbe4; box-shadow: 0 12px 40px rgba(0,0,0,.45), 0 0 0 1px #353d55; }
html[data-bs-theme="dark"] .nxck-banner h6, html[data-bs-theme="dark"] .nxck-modal-head h5, html[data-bs-theme="dark"] .nxck-cat-head label { color: #e8ecf8; }
html[data-bs-theme="dark"] .nxck-btn-outline { background: #2a3042; border-color: #3a4260; color: #d6dcf0; }
html[data-bs-theme="dark"] .nxck-btn-outline:hover { background: #343b52; }
html[data-bs-theme="dark"] .nxck-cat { background: #2a3042; border-color: #353d55; }
html[data-bs-theme="dark"] .nxck-cat p, html[data-bs-theme="dark"] .nxck-close { color: #98a2c3; }
/* Contabilidad (partials/accounting_helper.php) y auditoría: tarjetas y avisos con fondo fijo */
html[data-bs-theme="dark"] :is(.account-card, .audit-kpi, .audit-card, .glossary-item, .bi-kpi, .bi-filter, .bi-criteria, .rec-card, .cw-bay-card) { background: #262b3c; border-color: #353d55; box-shadow: none; color: var(--bs-body-color); }
html[data-bs-theme="dark"] :is(.account-card, .audit-kpi, .bi-kpi) strong, html[data-bs-theme="dark"] .rec-card .rec-name { color: #e8ecf8; }
html[data-bs-theme="dark"] :is(.account-card, .audit-kpi, .bi-kpi) small, html[data-bs-theme="dark"] :is(.rec-tipo, .rec-occ-label, .bi-muted, .glossary-item) { color: #98a2c3; }
html[data-bs-theme="dark"] .alert-soft { background: rgba(245,158,11,.12); border-color: rgba(245,158,11,.35); color: #fcd9a0; }
html[data-bs-theme="dark"] .badge-ac { background: #2a3042; border-color: #3a4260; color: #c3cbe4; }
html[data-bs-theme="dark"] .mini-list .row-line { border-color: #353d55; }
html[data-bs-theme="dark"] .btn-soft-dark { color: #d6dcf0; background-color: rgba(255,255,255,.08); }
html[data-bs-theme="dark"] .btn-soft-dark:hover { background-color: #3b4360; color: #fff; }
/* BI (partials/bi_report_kit.php y bi-*.php) */
html[data-bs-theme="dark"] .bi-hero { background: linear-gradient(135deg, #2a3042, #262b3c); border-color: #353d55; box-shadow: none; }
html[data-bs-theme="dark"] .bi-help { background: rgba(99,102,241,.12); border-color: rgba(129,140,248,.45); color: #c3cbe4; }
html[data-bs-theme="dark"] .bi-card { box-shadow: none; }
html[data-bs-theme="dark"] .bi-criteria summary, html[data-bs-theme="dark"] .bi-quick .btn.active { color: #a5b4fc; }
html[data-bs-theme="dark"] .bi-quick .btn { border-color: #3a4260; }
html[data-bs-theme="dark"] .bi-quick .btn.active { background: rgba(99,102,241,.22); border-color: #4f5aa8; }
html[data-bs-theme="dark"] .bi-badge, html[data-bs-theme="dark"] .tipo-pill, html[data-bs-theme="dark"] .estado-registrado { background: rgba(99,102,241,.2); color: #c7d2fe; }
html[data-bs-theme="dark"] .bi-badge.ok, html[data-bs-theme="dark"] .estado-aceptado, html[data-bs-theme="dark"] .bix-b0 { background: rgba(34,197,94,.18); color: #86efac; }
html[data-bs-theme="dark"] .bi-badge.warn, html[data-bs-theme="dark"] .bix-b1 { background: rgba(245,158,11,.2); color: #fcd34d; }
html[data-bs-theme="dark"] .bix-b2 { background: rgba(249,115,22,.2); color: #fdba74; }
html[data-bs-theme="dark"] .bi-badge.bad, html[data-bs-theme="dark"] .estado-error, html[data-bs-theme="dark"] .bix-b3, html[data-bs-theme="dark"] .bix-b4 { background: rgba(239,68,68,.2); color: #fca5a5; }
html[data-bs-theme="dark"] .bi-badge.info, html[data-bs-theme="dark"] .estado-enviado { background: rgba(59,130,246,.2); color: #93c5fd; }
html[data-bs-theme="dark"] .bix-table tfoot td { background: #2a3042; color: #e8ecf8; border-top-color: #6366f1; }
html[data-bs-theme="dark"] .bix-table td.amount, html[data-bs-theme="dark"] .amount { color: inherit; }
html[data-bs-theme="dark"] .bi-svg .axis { fill: #98a2c3; } html[data-bs-theme="dark"] .bi-svg .value { fill: #d6dcf0; }
html[data-bs-theme="dark"] .rank-name { color: #d6dcf0; } html[data-bs-theme="dark"] .rank-bar { background: #343b52; }
html[data-bs-theme="dark"] .rank-val, html[data-bs-theme="dark"] .rank-sub, html[data-bs-theme="dark"] .bi-legend span { color: #98a2c3; }
html[data-bs-theme="dark"] .bi-tbl-search i { color: #7f88a6; }
/* Calendario de citas (modules/crm/appointment-calendar.php) */
html[data-bs-theme="dark"] .cal-wrap { background: #262b3c; border-color: #353d55; box-shadow: none; }
html[data-bs-theme="dark"] .cal-sidebar { background: #2a3042; border-color: #353d55; }
html[data-bs-theme="dark"] .cal-main, html[data-bs-theme="dark"] .cal-week-header { background: #262b3c; }
html[data-bs-theme="dark"] .cal-sidebar-head, html[data-bs-theme="dark"] .cal-toolbar, html[data-bs-theme="dark"] .cal-week-header, html[data-bs-theme="dark"] .cal-month-header, html[data-bs-theme="dark"] .cal-day-summary { border-color: #353d55; }
html[data-bs-theme="dark"] :is(.cal-sidebar-head h6, .cal-day-summary h6, .cal-month-header span, .cal-cita-mini-srv) { color: #98a2c3; }
html[data-bs-theme="dark"] :is(.cal-mini-date-label, .cal-title, .cal-cita-mini-cli) { color: #e8ecf8; }
html[data-bs-theme="dark"] :is(.cal-mini-day, .cal-prof-item, .cal-week-header .wh-day, .cal-month-day-num, .cal-mini-nav .btn-date-nav, .cal-toolbar .btn-nav) { color: #c3cbe4; }
html[data-bs-theme="dark"] :is(.cal-mini-nav .btn-date-nav, .cal-toolbar .btn-nav) { background: #2a3042; border-color: #3a4260; }
html[data-bs-theme="dark"] :is(.cal-mini-nav .btn-date-nav, .cal-toolbar .btn-nav, .cal-mini-day, .cal-prof-item, .cal-hour-cell, .cal-month-day, .cal-day-col, .cal-cita-mini):hover { background: #343b52; color: #fff; }
html[data-bs-theme="dark"] .cal-mini-day.other-month, html[data-bs-theme="dark"] .cal-mini-grid .mini-day-names span, html[data-bs-theme="dark"] :is(.cal-hour-label, .cal-day-hour-label, .cal-week-header .wh-time) { color: #7f88a6; }
html[data-bs-theme="dark"] .cal-mini-day.today, html[data-bs-theme="dark"] .cal-prof-item.active, html[data-bs-theme="dark"] .cal-week-header .wh-day.today-col, html[data-bs-theme="dark"] .cal-month-day.selected-cell { background: rgba(99,102,241,.22); color: #c7d2fe; }
html[data-bs-theme="dark"] .cal-month-day.today-cell { background: rgba(99,102,241,.14); }
html[data-bs-theme="dark"] .cal-month-day.other-month { background: #232838; }
html[data-bs-theme="dark"] .cal-view-tabs { background: #2a3042; }
html[data-bs-theme="dark"] .cal-view-tab { color: #98a2c3; }
html[data-bs-theme="dark"] .cal-view-tab.active { background: #3b4360; color: #fff; box-shadow: none; }
html[data-bs-theme="dark"] .cal-week-header .wh-time, html[data-bs-theme="dark"] .cal-week-header .wh-day { border-color: #353d55; }
html[data-bs-theme="dark"] .cal-hour-row, html[data-bs-theme="dark"] .cal-hour-cell, html[data-bs-theme="dark"] .cal-month-day, html[data-bs-theme="dark"] .cal-day-col, html[data-bs-theme="dark"] .cal-cita-mini { border-color: #2f3650; }
html[data-bs-theme="dark"] .cal-prof-check { border-color: #4a5370; }
/* vistas semana/día/mes: la rejilla se pinta con estilos en línea (appointment-calendar.php) */
html[data-bs-theme="dark"] .cal-main :is([style*="#f1f5f9"], [style*="#e5e7eb"], [style*="#f8fafc"]) { border-color: #2f3650 !important; }
html[data-bs-theme="dark"] .cal-main :is([style*="background:#eef2ff"], [style*="background:#f0f4ff"]) { background: rgba(99,102,241,.22) !important; }
html[data-bs-theme="dark"] .cal-main [style*="color:#4f46e5"], html[data-bs-theme="dark"] .cal-main [style*="color: #4f46e5"] { color: #a5b4fc !important; }
html[data-bs-theme="dark"] #tblTickets_length select { background-color: #2a3042 !important; border-color: #3a4260 !important; color: #d6dcf0 !important; }
html[data-bs-theme="dark"] #tblTickets_length label { color: #98a2c3 !important; }
html[data-bs-theme="dark"] .cal-main [style*="color:#374151"], html[data-bs-theme="dark"] .cal-main [style*="color:#111827"] { color: #e3e7f5 !important; }
html[data-bs-theme="dark"] .cal-quickadd { background: rgba(99,102,241,.12); border-color: #353d55; }
html[data-bs-theme="dark"] .cal-quickadd strong, html[data-bs-theme="dark"] .cal-cita-mini-hora { color: #a5b4fc; }
html[data-bs-theme="dark"] .cal-timepicker-panel { background: #2a3042; border-color: #3a4260; }
html[data-bs-theme="dark"] .cal-timepicker-panel :is(input, button, .separator, .cal-tp-meridian) { color: #d6dcf0; }
html[data-bs-theme="dark"] .cal-timepicker-panel :is(input, .cal-tp-meridian) { background: #232838; border-color: #3a4260; }
html[data-bs-theme="dark"] #modalCalCita .select2-container .select2-selection--single { border-color: #3a4260 !important; }
html[data-bs-theme="dark"] #modalCalCita .select2-container .select2-selection--single .select2-selection__rendered { color: #d6dcf0 !important; }
/* Estados de cita / lavado (insignias con colores pastel fijos) */
html[data-bs-theme="dark"] :is(.badge-status-1, .badge-cw-1) { background: rgba(59,130,246,.2) !important; color: #93c5fd !important; border-color: rgba(59,130,246,.4) !important; }
html[data-bs-theme="dark"] :is(.badge-status-2, .badge-cw-2) { background: rgba(34,197,94,.18) !important; color: #86efac !important; border-color: rgba(34,197,94,.4) !important; }
html[data-bs-theme="dark"] :is(.badge-status-3, .badge-cw-3) { background: rgba(245,158,11,.2) !important; color: #fcd34d !important; border-color: rgba(245,158,11,.4) !important; }
html[data-bs-theme="dark"] :is(.badge-status-4, .badge-cw-4) { background: rgba(239,68,68,.2) !important; color: #fca5a5 !important; border-color: rgba(239,68,68,.4) !important; }
html[data-bs-theme="dark"] :is(.badge-status-5, .badge-cw-5) { background: rgba(148,163,184,.18) !important; color: #cbd5e1 !important; border-color: rgba(148,163,184,.35) !important; }
/* Lavadero (modules/carwash/carwash-ticket.php) */
html[data-bs-theme="dark"] :is(#cwToolbarCard, #cwBaysCard, #cwTicketsCard) { background: #262b3c !important; border-color: #353d55 !important; box-shadow: none !important; }
html[data-bs-theme="dark"] .cw-bay-card.libre { background: rgba(34,197,94,.1); border-color: rgba(34,197,94,.4); }
html[data-bs-theme="dark"] .cw-bay-card.ocupado { background: rgba(239,68,68,.1); border-color: rgba(239,68,68,.4); }
html[data-bs-theme="dark"] .cw-bay-card.selected { background: rgba(59,130,246,.14); border-color: rgba(59,130,246,.5); }
html[data-bs-theme="dark"] #cwToolbarCard .custom-select, html[data-bs-theme="dark"] #cwTicketsCard .custom-select { background-color: #2a3042; border-color: #3a4260; color: #d6dcf0; }
html[data-bs-theme="dark"] .cw-bay-name { color: #e8ecf8; }
html[data-bs-theme="dark"] .cw-bay-libre { background: rgba(34,197,94,.18); color: #86efac; border-color: rgba(34,197,94,.4); }
html[data-bs-theme="dark"] .cw-bay-ocupado { background: rgba(239,68,68,.2); color: #fca5a5; border-color: rgba(239,68,68,.4); }
html[data-bs-theme="dark"] :is(.ticket-label, .ticket-footer) { color: #98a2c3; }
html[data-bs-theme="dark"] :is(.ticket-header, .ticket-section, .ticket-total, .ticket-footer, .ticket-row) { border-color: #353d55; }
html[data-bs-theme="dark"] .ticket-nro { background: #3b4360; }
html[data-bs-theme="dark"] .custom-select { background-color: #2a3042; border-color: #3a4260; color: #d6dcf0; }
html[data-bs-theme="dark"] #modalTicket .cw-price-group .input-group-text { background: rgba(59,130,246,.18) !important; border-color: #3a4260 !important; color: #93c5fd !important; }
html[data-bs-theme="dark"] #modalTicket #tk_precio_final { color: #e8ecf8 !important; }
html[data-bs-theme="dark"] :is(.ticket-timepicker-panel, .cal-timepicker-panel) { background: #2a3042; border-color: #3a4260; }
html[data-bs-theme="dark"] .ticket-timepicker-panel :is(input, .ticket-tp-meridian) { background: #232838; border-color: #3a4260; color: #d6dcf0; }
html[data-bs-theme="dark"] .ticket-timepicker-panel :is(button, .separator) { color: #d6dcf0; }
html[data-bs-theme="dark"] .swal2-popup :is(.cw-invoice-box, .cw-swal-payment-row) { background: #2a3042; border-color: #353d55; }
html[data-bs-theme="dark"] .swal2-popup .cw-swal-payment-row .form-label { color: #c3cbe4; }
/* select2 dentro de modales con reglas #idModal de fondo blanco (el :not(#_) sube la especificidad por encima de los #id) */
html[data-bs-theme="dark"] .modal:not(#_) .select2-container--default .select2-selection--single,
html[data-bs-theme="dark"] .modal:not(#_) .select2-container--default .select2-selection--multiple { background-color: #2a3042 !important; border-color: #3a4260 !important; }
html[data-bs-theme="dark"] .modal:not(#_) .select2-container--default .select2-selection--single .select2-selection__rendered { color: #d6dcf0 !important; }
html[data-bs-theme="dark"] .modal:not(#_) .select2-container--default .select2-selection--single .select2-selection__placeholder { color: #7f88a6 !important; }
html[data-bs-theme="dark"] #carrModal #carrBtnConsultarDocumento, html[data-bs-theme="dark"] #carrModal .driver-search-btn { background: #2a3042 !important; border-color: #3a4260 !important; color: #d6dcf0 !important; }
html[data-bs-theme="dark"] #carrModal #carrBtnConsultarDocumento:hover, html[data-bs-theme="dark"] #carrModal .driver-search-btn:hover { background: #3b4360 !important; color: #fff !important; }
html[data-bs-theme="dark"] #carrModal #carrBtnConsultarDocumento:disabled, html[data-bs-theme="dark"] #carrModal .driver-search-btn:disabled { background: #232838 !important; }
html[data-bs-theme="dark"] .modal:not(#_) .modal-content { background-color: #262b3c; color: var(--bs-body-color); }
html[data-bs-theme="dark"] .modal:not(#_) :is(.modal-body, .modal-footer) { background-color: transparent; }
html[data-bs-theme="dark"] .modal:not(#_) label.form-label { color: #c3cbe4; }
html[data-bs-theme="dark"] .nx-cred-title { color: #c3cbe4; }
html[data-bs-theme="dark"] .modal:not(#_) .modal-footer { border-color: #353d55; }
html[data-bs-theme="dark"] #modalCrearEditar .text-muted.mb-2 { background: #2a3042; border-color: #353d55; }
html[data-bs-theme="dark"] .modal:not(#_) .input-group-text { background-color: #2a3042; border-color: #3a4260; color: #98a2c3; }
html[data-bs-theme="dark"] :is(#newCompaniaModal, #editCompaniaModal) .form-label { color: #c3cbe4; }
html[data-bs-theme="dark"] .nx-cred-box { background: #262b3c; border-color: #353d55; border-left-color: var(--nx-p, #556ee6); }
html[data-bs-theme="dark"] .nx-cred-box.nx-cred-cpe { border-left-color: #34c38f; }
/* Pedidos / ventas: el selector de fecha de solo lectura fijaba fondo blanco */
html[data-bs-theme="dark"] #comprobanteForm input[data-provide="datepicker"] { background-color: #232838; color: #d6dcf0; }
html[data-bs-theme="dark"] .sumatorias-table td:first-child { color: #98a2c3; }
html[data-bs-theme="dark"] .sumatorias-table td:last-child, html[data-bs-theme="dark"] .sumatorias-table strong { color: #e8ecf8; }
/* @@FIX-B@@ */
/* --- B/D: CRM, logística, compras, taller, tesorería, calendario de horarios, tablas --- */
html[data-bs-theme="dark"] label.form-label { color: #c8cfe4; }
html[data-bs-theme="dark"] .crm-kpi, html[data-bs-theme="dark"] .vs-kpi { background: #2a3042; border-color: #3a4260; box-shadow: none; }
html[data-bs-theme="dark"] .crm-kpi strong, html[data-bs-theme="dark"] .vs-kpi strong, html[data-bs-theme="dark"] .crm-cell-main { color: #e6ebf5; }
html[data-bs-theme="dark"] .crm-kpi small, html[data-bs-theme="dark"] .crm-kpi .sub, html[data-bs-theme="dark"] .vs-kpi small, html[data-bs-theme="dark"] .kb-col-head .tot { color: #9aa3bd; }
html[data-bs-theme="dark"] .crm-kpi.warn strong { color: #f5b04c; }
html[data-bs-theme="dark"] .crm-kpi.bad strong { color: #f87171; }
html[data-bs-theme="dark"] .crm-kpi.ok strong { color: #34d399; }
html[data-bs-theme="dark"] .crm-chip { background: #2a3042; border-color: #3a4260; color: #d6dcf0; }
html[data-bs-theme="dark"] .crm-chip.active { background: #323a73; border-color: #4a56a8; color: #c7d2fe; }
html[data-bs-theme="dark"] .crm-chip .n { background: #3a4260; color: #e6ebf5; }
html[data-bs-theme="dark"] .crm-chip.active .n { background: #4a56a8; }
html[data-bs-theme="dark"] .crm-tag { background: #323a52; color: #cfd6ea; }
html[data-bs-theme="dark"] .kb-col { background: #222737; }
html[data-bs-theme="dark"] .kb-col-head { background: #2a3042; color: #e6ebf5; }
html[data-bs-theme="dark"] .kb-col h6, html[data-bs-theme="dark"] .schedule-summary-card h6 { color: #f1f3fb; }
html[data-bs-theme="dark"] .badge-tp-completado { background: rgba(22,137,95,.22) !important; color: #5fd3a5 !important; border-color: rgba(22,137,95,.5) !important; }
html[data-bs-theme="dark"] .badge-vac-vencida { background: rgba(217,48,48,.22) !important; color: #ff9b9b !important; border-color: rgba(217,48,48,.5) !important; }
html[data-bs-theme="dark"] #detailPanel { background: #2a3042 !important; color: #e6ebf5; border-color: #3a4260 !important; }
html[data-bs-theme="dark"] .gc-status-1, html[data-bs-theme="dark"] .cpe-status-0, html[data-bs-theme="dark"] .gr-status-1 { background: rgba(234,88,12,.2); color: #fdba74; border-color: rgba(234,88,12,.45); }
html[data-bs-theme="dark"] .gc-status-2 { background: rgba(37,99,235,.2); color: #93c5fd; border-color: rgba(37,99,235,.45); }
html[data-bs-theme="dark"] .gc-status-3, html[data-bs-theme="dark"] .cpe-status-1, html[data-bs-theme="dark"] .gr-status-3 { background: rgba(16,185,129,.2); color: #6ee7b7; border-color: rgba(16,185,129,.45); }
html[data-bs-theme="dark"] .gr-status-2, html[data-bs-theme="dark"] .cpe-status-2 { background: rgba(220,38,38,.2); color: #fca5a5; border-color: rgba(220,38,38,.45); }
html[data-bs-theme="dark"] .gc-status-3 + *, html[data-bs-theme="dark"] td strong[style*="7c3aed"] { color: #c4b5fd !important; }
html[data-bs-theme="dark"] .schedule-summary-card, html[data-bs-theme="dark"] .calendar-help-box { background: #2a3042 !important; border-color: #3a4260 !important; color: #d6dcf0; }
html[data-bs-theme="dark"] .calendar-help-box .text-dark, html[data-bs-theme="dark"] .text-dark.fw-semibold { color: #e6ebf5 !important; }
html[data-bs-theme="dark"] .vs-alert-banner.danger { background: rgba(220,38,38,.16); border-color: rgba(220,38,38,.4); color: #fca5a5; }
html[data-bs-theme="dark"] .vs-alert-banner.warning { background: rgba(245,158,11,.16); border-color: rgba(245,158,11,.4); color: #fcd34d; }
html[data-bs-theme="dark"] .vs-kpi-icon { filter: brightness(.9) saturate(1.1); background-color: rgba(255,255,255,.08) !important; }
html[data-bs-theme="dark"] .plate-chip { background: #323a52; border-color: #3a4260; color: #e6ebf5; }
html[data-bs-theme="dark"] .mesa-chip { background: #323a52; color: #cfd6ea; }
html[data-bs-theme="dark"] .mesa-chip.is-empty { background: transparent; border-color: #3a4260; color: #8a94b0; }
html[data-bs-theme="dark"] .mesa-name.is-empty { color: #8a94b0; }
html[data-bs-theme="dark"] .mesa-card.is-frozen .mesa-name, html[data-bs-theme="dark"] .mesa-frozen .mf-total { color: #ff8a9b; }
html[data-bs-theme="dark"] .table-light th, html[data-bs-theme="dark"] .table > thead th { color: #c8cfe4; }
html[data-bs-theme="dark"] .table-warning td, html[data-bs-theme="dark"] .table-warning th { background: rgba(245,158,11,.14) !important; color: #fcd34d; }
html[data-bs-theme="dark"] .table-danger td, html[data-bs-theme="dark"] .table-danger th { background: rgba(220,38,38,.16) !important; color: #fca5a5; }
html[data-bs-theme="dark"] .table-success td, html[data-bs-theme="dark"] .table-success th { background: rgba(16,185,129,.14) !important; color: #6ee7b7; }
html[data-bs-theme="dark"] .treasury-pagecontrols button { background: #2a3042; color: #d6dcf0; border-color: #3a4260; }
html[data-bs-theme="dark"] .treasury-pagecontrols button:hover:not(:disabled) { background: #323a73; }
html[data-bs-theme="dark"] .treasury-pageinfo { color: #9aa3bd; }
html[data-bs-theme="dark"] #treasury-table tr.fw-bold, html[data-bs-theme="dark"] tr.fw-bold { background: #2a3042; }
html[data-bs-theme="dark"] td[style*="#2e7d32"], html[data-bs-theme="dark"] .text-income { color: #6ee7b7 !important; }
html[data-bs-theme="dark"] td[style*="#1565c0"] { color: #93c5fd !important; }
html[data-bs-theme="dark"] code { background: #323a52; color: #f0b9c9; }
html[data-bs-theme="dark"] small.text-muted, html[data-bs-theme="dark"] .text-muted { color: #9aa3bd !important; }
html[data-bs-theme="dark"] .table-striped > tbody > tr:nth-of-type(odd) > * { color: inherit; }
/* esquinas rectas en los componentes anteriores */
html[data-nx-rd="square"] .crm-kpi, html[data-nx-rd="square"] .crm-chip, html[data-nx-rd="square"] .crm-tag, html[data-nx-rd="square"] .kb-col, html[data-nx-rd="square"] .kb-col-head,
html[data-nx-rd="square"] .vs-kpi, html[data-nx-rd="square"] .vs-alert-banner, html[data-nx-rd="square"] .mesa-chip, html[data-nx-rd="square"] .plate-chip,
html[data-nx-rd="square"] .schedule-summary-card, html[data-nx-rd="square"] .calendar-help-box { border-radius: 0 !important; }

/* @@FIX-C@@ */
/* --- C: parking / colas / reservas / piezas / impresoras / reportes (modo oscuro) --- */
html[data-bs-theme="dark"] :is(.pk-space-card, .pk-tipo-chip, .pk-card, .pk-kpi-mini, .pke-info-card, .pke-calc-card, .pke-kpi, .pke-pay-chip, .pke-historial-card, .pke-cobro-card,
    .pkr-kpi, .pkr-card, .pkr-chip, .pkr-agr-btn, .pkr-occ-card, .kpi-card, .soft-panel, .view-box, .carrier-row, .stat-chip, .mod-btn, .queue-item, .chart-card, .filter-bar,
    .check-filter, .check-kpi, .res-list, .detail-card, .res-card, .rs-filter, .rs-card, .rs-timeline-wrap, .board-filter, .rsb-kpi, .room-card, .btn-date-nav, .pc-card, .res-timepicker-panel, .rs-timepicker-panel) {
    background: #262b3c; border-color: #353d55; color: #d6dcf0; }
html[data-bs-theme="dark"] :is(.pk-space-card.libre, .pkr-occ-card.libre) { background: linear-gradient(135deg, rgba(34,197,94,.14), #262b3c); border-color: rgba(52,211,153,.45); }
html[data-bs-theme="dark"] :is(.pk-space-card.ocupado, .pkr-occ-card.ocup) { background: linear-gradient(135deg, rgba(239,68,68,.14), #262b3c); border-color: rgba(248,113,113,.4); }
html[data-bs-theme="dark"] .pk-space-card.libre.selected, html[data-bs-theme="dark"] :is(.pk-tipo-chip, .pke-pay-chip, .pkr-chip, .pkr-agr-btn).selected,
html[data-bs-theme="dark"] :is(.pkr-chip, .pkr-agr-btn).active { background: rgba(var(--nx-p-rgb,85,110,230),.22); border-color: var(--nx-p,#556ee6); color: #fff; }
html[data-bs-theme="dark"] :is(.pk-tipo-chip:hover, .pke-pay-chip:hover, .pkr-chip:hover, .pkr-agr-btn:hover:not(.active), .btn-date-nav:hover, .mod-btn:hover, .queue-item:hover, .carrier-row:hover) { background: #343b52; border-color: var(--nx-p,#556ee6); color: #fff; }
html[data-bs-theme="dark"] :is(.pk-space-code, .pkr-kpi-val, .pkr-card-title, .pkr-occ-name, .pke-info-value, .pke-calc-value, #pke_monto_cobrar, .kpi-card strong, .part-title, .rs-card-name, .rs-date-nav .date-label,
    .rs-stat .sv, .cita-cli, .res-summary-row strong, .check-kpi .n, .rsb-kpi .n, .pc-card-title, .stat-chip .sv, .legend span) { color: #e8ecf8 !important; }
html[data-bs-theme="dark"] :is(.pk-space-placa, .pk-kpi-lbl, .pke-info-label, .pke-calc-label, .pke-total-label, .pke-kpi-lbl, .pkr-kpi-lbl, .pkr-kpi-sub, .pkr-occ-placa, .pkr-empty, .part-sub, .view-label,
    .kpi-card small, .kpi-card .kpi-lbl, .kpi-card .kpi-sub, .section-title, .rs-date-nav .date-sub, .rs-card-tipo, .rs-stat .sl, .cita-srv, .res-section-title, .res-total small, .mini-help, .pc-card-id,
    .add-label, .pc-add-card .add-label, .select2-opt-sub, .input-money .money-prefix) { color: #98a2c3 !important; }
html[data-bs-theme="dark"] :is(.pk-search-box .search-icon) { color: #98a2c3; }
html[data-bs-theme="dark"] :is(.pke-calc-row, .pkr-card-header, .rs-card-header, .res-list-head, .res-summary-row, .rs-timeline-head, .pc-card-actions) { border-color: #353d55; }
html[data-bs-theme="dark"] :is(.res-card .card-header, .detail-card .card-header) { background: transparent; border-color: #353d55; }
html[data-bs-theme="dark"] .pke-buscar-hero { background: linear-gradient(135deg, #2a3042, #262b3c); border-color: #3a4260; }
html[data-bs-theme="dark"] #pke_buscar_placa { border-color: #3a4260 !important; }
html[data-bs-theme="dark"] .pke-vehicle-panel { border-color: #353d55; }
html[data-bs-theme="dark"] .pke-total-box { background: linear-gradient(135deg, rgba(var(--nx-p-rgb,85,110,230),.18), #262b3c); }
html[data-bs-theme="dark"] .pke-total-editable { background: #232838 !important; border-color: #3a4260 !important; color: #c7d2fe !important; }
html[data-bs-theme="dark"] .pke-pay-input .input-group-text { background: #2a3042 !important; border-color: #3a4260 !important; color: #93c5fd !important; }
html[data-bs-theme="dark"] .pk-select2 .select2-container .select2-selection--single { background: #2a3042 !important; border-color: #3a4260 !important; }
html[data-bs-theme="dark"] .pk-select2 .select2-container .select2-selection--single .select2-selection__rendered { color: #d6dcf0 !important; }
/* insignias/pastillas de estado (fondo suave claro -> translucido) */
html[data-bs-theme="dark"] :is(.badge-pk-1, .pk-badge-ocupado, .pkr-badge-ocup, .status-0, .status-9, .badge-status-ocupado, .ico-ocupada, .ico-cancel, .availability-bad) { background: rgba(239,68,68,.16) !important; color: #fca5a5 !important; border-color: rgba(239,68,68,.35) !important; }
html[data-bs-theme="dark"] :is(.badge-pk-2, .pk-badge-libre, .pkr-badge-libre, .status-1, .badge-status-disponible, .ico-in, .availability-ok, .wait-ok, .sh-status-3, .qi-s3) { background: rgba(34,197,94,.16) !important; color: #86efac !important; border-color: rgba(34,197,94,.35) !important; }
html[data-bs-theme="dark"] .badge-pk-1 { background: rgba(59,130,246,.18) !important; color: #93c5fd !important; border-color: rgba(59,130,246,.4) !important; }
html[data-bs-theme="dark"] :is(.badge-pk-5, .badge-status-libre, .ico-libre, .pkr-rank-n, .room-libre .pill, .badge-cita-status-5, .status-3) { background: rgba(148,163,184,.16) !important; color: #cbd5e1 !important; border-color: rgba(148,163,184,.3) !important; }
html[data-bs-theme="dark"] :is(.badge-status-parcial, .pk-tiempo-badge, .pke-tiempo-badge, .ico-out, .ico-salida, .room-salida .pill, .availability-warn, .wait-mid, .sh-status-1, .sh-status-4, .qi-s1, .absent-badge, .badge-cita-status-3) { background: rgba(245,158,11,.16) !important; color: #fcd34d !important; border-color: rgba(245,158,11,.35) !important; }
html[data-bs-theme="dark"] :is(.ico-arr, .room-reservada .pill, .sh-status-2, .qi-s2, .badge-cita-status-1, .status-2) { background: rgba(59,130,246,.16) !important; color: #93c5fd !important; border-color: rgba(59,130,246,.35) !important; }
html[data-bs-theme="dark"] :is(.wait-bad, .badge-cita-status-4, .room-ocupada .pill, .sh-status-9, .status-4) { background: rgba(239,68,68,.16) !important; color: #fca5a5 !important; border-color: rgba(239,68,68,.35) !important; }
html[data-bs-theme="dark"] :is(.ico-limpieza, .room-limpieza .pill) { background: rgba(168,85,247,.18); color: #d8b4fe; border-color: rgba(168,85,247,.35); }
html[data-bs-theme="dark"] .room-mantenimiento .pill { background: rgba(251,146,60,.16); color: #fdba74; border-color: rgba(251,146,60,.35); }
html[data-bs-theme="dark"] .badge-cita-status-2 { background-color: rgba(34,197,94,.16) !important; color: #86efac !important; border-color: rgba(34,197,94,.35) !important; }
html[data-bs-theme="dark"] .badge-cita-status-1 { background-color: rgba(59,130,246,.16) !important; color: #93c5fd !important; border-color: rgba(59,130,246,.35) !important; }
html[data-bs-theme="dark"] .badge-cita-status-3 { background-color: rgba(245,158,11,.16) !important; color: #fcd34d !important; border-color: rgba(245,158,11,.35) !important; }
html[data-bs-theme="dark"] .badge-cita-status-4 { background-color: rgba(239,68,68,.16) !important; color: #fca5a5 !important; border-color: rgba(239,68,68,.35) !important; }
html[data-bs-theme="dark"] .badge-cita-status-5 { background-color: rgba(148,163,184,.16) !important; color: #cbd5e1 !important; border-color: rgba(148,163,184,.3) !important; }
html[data-bs-theme="dark"] :is(.model-chip, .pkr-nav-item:hover) { background: rgba(var(--nx-p-rgb,85,110,230),.2); color: #c7d2fe; }
html[data-bs-theme="dark"] .pkr-nav, html[data-bs-theme="dark"] .rs-view-tabs { background: #2a3042; border-color: #353d55; }
html[data-bs-theme="dark"] .pkr-nav-item, html[data-bs-theme="dark"] .rs-view-tabs button { color: #98a2c3; }
html[data-bs-theme="dark"] .rs-view-tabs button.active { background: #3b4360; color: #fff; }
html[data-bs-theme="dark"] .pkr-table th { background: #2a3042; color: #b5bdd6; }
html[data-bs-theme="dark"] .pkr-table tbody tr:hover { background: rgba(255,255,255,.05); }
html[data-bs-theme="dark"] :is(.pkr-search, .pkr-date-input) { background: #2a3042; border-color: #3a4260; color: #d6dcf0; }
html[data-bs-theme="dark"] :is(.pkr-bar, .type-bar-bg, .progress-bar-custom) { background: #353d55; }
html[data-bs-theme="dark"] .pkr-rank-n { color: #cbd5e1; }
/* piezas / logistica / impresoras / colas */
html[data-bs-theme="dark"] .kpi-card, html[data-bs-theme="dark"] .soft-panel { border-color: #353d55; }
html[data-bs-theme="dark"] .rpt-hero { background: linear-gradient(135deg, rgba(139,92,246,.16), #262b3c 60%, rgba(14,165,233,.1)); border-color: #353d55; }
html[data-bs-theme="dark"] :is(.empty-hint) { background: #2a3042; border-color: #3a4260; color: #98a2c3; }
html[data-bs-theme="dark"] .btn-soft-primary { background: rgba(59,130,246,.15); color: #93c5fd; border-color: rgba(59,130,246,.3); }
html[data-bs-theme="dark"] .btn-soft-success { background: rgba(34,197,94,.14); color: #86efac; border-color: rgba(34,197,94,.3); }
html[data-bs-theme="dark"] .btn-soft-warning { background: rgba(245,158,11,.14); color: #fcd34d; border-color: rgba(245,158,11,.3); }
html[data-bs-theme="dark"] .btn-soft-danger { background: rgba(239,68,68,.14); color: #fca5a5; border-color: rgba(239,68,68,.3); }
html[data-bs-theme="dark"] :is(.btn-soft-primary, .btn-soft-success, .btn-soft-warning, .btn-soft-danger):hover { filter: brightness(1.25); }
html[data-bs-theme="dark"] .parts-hero, html[data-bs-theme="dark"] [class*="hero"]:is(.part-hero, .compat-hero) { background: linear-gradient(135deg, rgba(34,197,94,.14), #262b3c 60%, #2a3042); border-color: #353d55; }
html[data-bs-theme="dark"] :is(.pc-card-color-0, .pc-card-color-1, .pc-card-color-2, .pc-card-color-3, .pc-card-color-4) { background: linear-gradient(135deg, rgba(255,255,255,.07), #262b3c 60%); border-color: #353d55; }
html[data-bs-theme="dark"] :is(.pc-card-color-0) { border-top-color: #2196F3; } html[data-bs-theme="dark"] :is(.pc-card-color-1) { border-top-color: #4CAF50; } html[data-bs-theme="dark"] :is(.pc-card-color-2) { border-top-color: #FF9800; }
html[data-bs-theme="dark"] :is(.pc-card-footer, .pc-card-actions) { background: rgba(255,255,255,.03); }
html[data-bs-theme="dark"] :is(.pc-cat-badge, #pc-count-badge) { background: #2a3042 !important; color: #b5bdd6 !important; border-color: #3a4260 !important; }
html[data-bs-theme="dark"] :is(.pc-card-icon, .pc-add-card .add-icon) { background: rgba(255,255,255,.1); }
html[data-bs-theme="dark"] .pc-add-card { background: #262b3c; border-color: #3a4260; }
html[data-bs-theme="dark"] .pc-add-card:hover { background: #2a3042; }
html[data-bs-theme="dark"] .cat-cb-item { background: #2a3042; border-color: #3a4260; color: #d6dcf0; }
html[data-bs-theme="dark"] :is(.cat-cb-item:hover, .cat-cb-item.active) { background: rgba(33,150,243,.18); border-color: #2196F3; }
html[data-bs-theme="dark"] .current-ticket-card { background: linear-gradient(135deg, rgba(var(--nx-p-rgb,85,110,230),.16), #262b3c 60%); border-color: #353d55; }
html[data-bs-theme="dark"] .mod-btn.active { background: rgba(var(--nx-p-rgb,85,110,230),.2); }
html[data-bs-theme="dark"] .ctc-actions { border-color: #353d55; }
html[data-bs-theme="dark"] .stat-chip.s-total .sv { color: #e3e7f5 !important; }
html[data-bs-theme="dark"] .queue-agent-count, html[data-bs-theme="dark"] .chart-card h6, html[data-bs-theme="dark"] .pk-card h6, html[data-bs-theme="dark"] :is(.res-list-head, .detail-card .card-header) h6 { color: #e8ecf8; }
html[data-bs-theme="dark"] :is(.pk-card, .chart-card, .pke-historial-card, .res-list, .rs-filter, .check-filter, .filter-bar) h6.mb-0 { color: #e8ecf8; }
html[data-bs-theme="dark"] .queue-agent :is(span, small) { color: inherit; }
/* reservas */
html[data-bs-theme="dark"] :is(.res-soft-box, .cita-item) { background: #2a3042; border-color: #353d55; }
html[data-bs-theme="dark"] .cita-item:hover { background: #343b52; border-color: var(--nx-p,#556ee6); }
html[data-bs-theme="dark"] .cita-hora { color: #a5b4fc; }
html[data-bs-theme="dark"] .res-total { background: rgba(var(--nx-p-rgb,85,110,230),.16); border-color: rgba(var(--nx-p-rgb,85,110,230),.4); }
html[data-bs-theme="dark"] .res-total .amount { color: #c7d2fe; }
html[data-bs-theme="dark"] .res-summary-row { border-color: #353d55; }
html[data-bs-theme="dark"] #formReserva .form-label, html[data-bs-theme="dark"] .res-card .form-label { color: #c3cbe4; }
html[data-bs-theme="dark"] #formReserva .form-select { background-color: #2a3042 !important; border-color: #3a4260 !important; color: #d6dcf0 !important; }
html[data-bs-theme="dark"] #formReserva .select2-container .select2-selection--single, html[data-bs-theme="dark"] #formReserva .select2-basic + .select2-container .select2-selection--single { background: #2a3042 !important; border-color: #3a4260 !important; }
html[data-bs-theme="dark"] #formReserva .select2-container .select2-selection__rendered, html[data-bs-theme="dark"] #formReserva .select2-basic + .select2-container .select2-selection__rendered { color: #d6dcf0 !important; }
html[data-bs-theme="dark"] :is(.res-date-wrap .form-control, .res-time-wrap .form-control, .check-date-wrap .form-control, .check-time-wrap .form-control) { background: #2a3042 !important; color: #d6dcf0; }
html[data-bs-theme="dark"] :is(.res-date-wrap, .res-time-wrap, .check-date-wrap, .check-time-wrap) .input-group-text { background: #2a3042; color: #98a2c3; border-color: #3a4260; }
html[data-bs-theme="dark"] :is(.res-timepicker-panel, .rs-timepicker-panel) { border-color: #3a4260; box-shadow: 0 .5rem 1rem rgba(0,0,0,.45); }
html[data-bs-theme="dark"] :is(.res-timepicker-panel, .rs-timepicker-panel) :is(input, select, button, .separator) { background: #2a3042; color: #d6dcf0; border-color: #3a4260; }
html[data-bs-theme="dark"] .rs-timeline-head { background: #2a3042; color: #98a2c3; }
html[data-bs-theme="dark"] .rs-timeline-row { border-color: #2f3650; }
html[data-bs-theme="dark"] .rs-timeline-row:hover { background: rgba(255,255,255,.05); }
html[data-bs-theme="dark"] .rs-slot-libre { background: #3a4260; }
html[data-bs-theme="dark"] .room-card .room-guest { background: #2a3042; border-color: #353d55; color: #d6dcf0; }
html[data-bs-theme="dark"] .room-card :is(.room-name, .room-title, .room-num, strong, b) { color: #e8ecf8; }
html[data-bs-theme="dark"] .room-card :is(.text-muted, small) { color: #98a2c3 !important; }
html[data-bs-theme="dark"] .room-card .btn-soft-success { color: #86efac; }
html[data-bs-theme="dark"] .rsb-kpi span, html[data-bs-theme="dark"] .rsb-kpi small { color: #98a2c3; }
html[data-bs-theme="dark"] #filtro_fecha_txt, html[data-bs-theme="dark"] #detalleEstado { background-color: #2a3042; color: #d6dcf0; border-color: #3a4260; }
/* parametros / mi plan / top clientes */
html[data-bs-theme="dark"] label.module-option { background: #2a3042; border-color: #3a4260; color: #d6dcf0; }
html[data-bs-theme="dark"] label.module-option strong { color: #e8ecf8; }
html[data-bs-theme="dark"] .info-panel { background: rgba(59,130,246,.14); border-color: rgba(59,130,246,.35); color: #bfdbfe; }
html[data-bs-theme="dark"] .info-panel strong { color: #fff; }
html[data-bs-theme="dark"] .params-tabs .nav-link { color: #98a2c3; }
html[data-bs-theme="dark"] .params-tabs .nav-link.active { color: #fff; }
html[data-bs-theme="dark"] .nxp-pm.is-have { background: rgba(34,197,94,.16); color: #86efac; }
html[data-bs-theme="dark"] .nxp-pm.is-new { background: rgba(var(--nx-p-rgb,85,110,230),.22); color: #c7d2fe; }
html[data-bs-theme="dark"] .nxp-plan .btn-light { background: #2a3042; color: #e3e7f5; border-color: #3a4260; }
html[data-bs-theme="dark"] .nxp-plan.is-current { background: rgba(var(--nx-p-rgb,85,110,230),.14); }
html[data-bs-theme="dark"] #tablaTopClientes thead th, html[data-bs-theme="dark"] table.dataTable thead th.sorting { background-color: #2a3042; color: #e3e7f5; border-color: #353d55; }
html[data-bs-theme="dark"] :is(.client-rank, .email, .contacto-cell) { color: #b5bdd6; }
html[data-bs-theme="dark"] #clear-filters-btn { background: #2a3042 !important; color: #d6dcf0 !important; border-color: #3a4260 !important; }
html[data-bs-theme="dark"] #clear-filters-btn:hover { background: #3b4360 !important; color: #fff !important; }
/* estados vacios del informe de logistica */
html[data-bs-theme="dark"] :is(.text-center) > :is(.text-secondary) { color: #98a2c3; }
/* Esquinas rectas: tarjetas/pastillas propias de estas pantallas */
html[data-nx-rd="square"] :is(.pk-space-card, .pk-tipo-chip, .pk-card, .pk-kpi-mini, .pk-kpi-icon, .pk-ticket-print, .pke-buscar-hero, .pke-vehicle-panel, .pke-info-card, .pke-calc-card, .pke-total-box, .pke-kpi, .pke-kpi-icon,
    .pke-pay-chip, .pke-historial-card, .pke-cobro-card, .pkr-kpi, .pkr-kpi-icon, .pkr-card, .pkr-nav, .pkr-nav-item, .pkr-chip, .pkr-agr-btn, .pkr-occ-card, .pkr-search, .pkr-date-input, .kpi-card, .soft-panel, .view-box, .empty-hint,
    .rpt-hero, .carrier-row, .stat-chip, .mod-btn, .queue-item, .chart-card, .filter-bar, .current-ticket-card, .check-filter, .check-kpi, .check-kpi .ico, .res-list, .detail-card, .res-card, .res-soft-box, .res-total, .rs-filter, .rs-card,
    .rs-card-icon, .rs-timeline-wrap, .rs-view-tabs, .rs-view-tabs button, .btn-date-nav, .cita-item, .board-filter, .rsb-kpi, .room-card, .pc-card, .pc-add-card, .cat-cb-item, .availability-ok, .availability-bad, .availability-warn,
    .nxp-hero, .nxp-plan, .nxp-bar, .params-card, .params-tabs .nav-link, .module-option, .info-panel, .model-chip, .status-pill, .pk-tiempo-badge, .pke-tiempo-badge, .absent-badge, .part-card, .res-timepicker-panel, .rs-timepicker-panel):not(.rounded-circle):not(.rounded-pill) { border-radius: 0 !important; }
html[data-bs-theme="dark"] .pkr-nav-item.active { color: #fff; }
html[data-bs-theme="dark"] .pkr-card .fw-bold, html[data-bs-theme="dark"] .pkr-table .fw-bold { color: #e8ecf8; }
html[data-bs-theme="dark"] #top-clients-table th, html[data-bs-theme="dark"] #top-clients-table thead th.sorting { background-color: #2a3042; color: #e3e7f5; border-bottom-color: #353d55; }
html[data-bs-theme="dark"] #top-clients-table .client-rank { color: #b5bdd6; }
html[data-bs-theme="dark"] #top-clients-table .contacto-cell .email { color: #b5bdd6; }
html[data-bs-theme="dark"] #top-clients-table .contacto-cell .telefono { color: #98a2c3; }
html[data-bs-theme="dark"] :is(.check-filter, .res-list, .detail-card) .form-label { color: #c3cbe4; }
html[data-bs-theme="dark"] .detail-item { background: #2a3042; border-color: #353d55; }
html[data-bs-theme="dark"] .detail-item small, html[data-bs-theme="dark"] .amount-box small, html[data-bs-theme="dark"] .empty-state { color: #98a2c3; }
html[data-bs-theme="dark"] .detail-item strong { color: #e8ecf8; }
html[data-bs-theme="dark"] .amount-box { background: rgba(var(--nx-p-rgb,85,110,230),.16); border-color: rgba(var(--nx-p-rgb,85,110,230),.4); }
html[data-bs-theme="dark"] .amount-box strong { color: #c7d2fe; }
/* --- B/D (2.ª pasada) --- */
html[data-bs-theme="dark"] label.form-label, html[data-bs-theme="dark"] .form-label { color: #c8cfe4 !important; }
html[data-bs-theme="dark"] .kb-add { color: #a5b4fc; }
html[data-bs-theme="dark"] table th, html[data-bs-theme="dark"] .table thead th { color: #c8cfe4 !important; }
html[data-bs-theme="dark"] .page-content div:not([class*="bg-"]):not([class*="btn"]):not([class*="badge"])[style*="color:#212529"] { color: #e6ebf5 !important; }
html[data-bs-theme="dark"] .table-danger td, html[data-bs-theme="dark"] .table-danger th, html[data-bs-theme="dark"] .table-danger strong { color: #fca5a5 !important; }
html[data-bs-theme="dark"] .table-warning td, html[data-bs-theme="dark"] .table-warning th, html[data-bs-theme="dark"] .table-warning strong { color: #fcd34d !important; }
html[data-bs-theme="dark"] .mesa-card.is-frozen .mesa-name, html[data-bs-theme="dark"] .nm-preview.is-frozen .mesa-name:not(.is-empty), html[data-bs-theme="dark"] .mesa-frozen span { color: #ff8a9b !important; }
html[data-bs-theme="dark"] .mesa-name.is-empty { color: #8a94b0 !important; }
html[data-bs-theme="dark"] tr.fw-bold > td, html[data-bs-theme="dark"] tr.fw-bold > th { background: #2a3042 !important; }
html[data-bs-theme="dark"] code, html[data-bs-theme="dark"] td code { background: #323a52 !important; color: #f0b9c9 !important; }
html[data-bs-theme="dark"] tr.fw-bold[style*="#e8f5e9"], html[data-bs-theme="dark"] tr.fw-bold[style*="#e8f5e9"] > td { background: rgba(16,185,129,.16) !important; }
html[data-bs-theme="dark"] tr.fw-bold[style*="#e3f2fd"], html[data-bs-theme="dark"] tr.fw-bold[style*="#e3f2fd"] > td { background: rgba(59,130,246,.16) !important; }
html[data-bs-theme="dark"] tr.table-light, html[data-bs-theme="dark"] tr.table-light > td, html[data-bs-theme="dark"] tr.table-light > th { background: #2a3042 !important; color: #e6ebf5; }
/* @@FIX-D@@ */


/* ── Registros "del sistema" (Cliente Varios, sucursal principal, series/unidades/medios de pago estándar, usuario licencia) ──
   Se detectan por data-sysdef="1" o por contener el botón .nx-lock. Fondo suave + texto legible en claro y oscuro. */
table tbody tr[data-sysdef="1"] > td,
table tbody tr:has(.nx-lock) > td { background-color: #eef1f6 !important; color: #3b4458 !important; }
table tbody tr[data-sysdef="1"] > td:first-child,
table tbody tr:has(.nx-lock) > td:first-child { box-shadow: inset 3px 0 0 #556ee6; }
tr[data-sysdef="1"] .nx-lock, tr:has(.nx-lock) .nx-lock { color: #4b5563 !important; background: #e2e6ee !important; border-color: #cfd5e1 !important; opacity: 1 !important; }
html[data-bs-theme="dark"] table tbody tr[data-sysdef="1"] > td,
html[data-bs-theme="dark"] table tbody tr:has(.nx-lock) > td { background-color: #2a3042 !important; color: #e6ebf5 !important; }
html[data-bs-theme="dark"] tr[data-sysdef="1"] .nx-lock, html[data-bs-theme="dark"] tr:has(.nx-lock) .nx-lock { color: #cbd2e4 !important; background: #3a4258 !important; border-color: #4a5470 !important; }
