/* ============================================
   CEMGI — Tema Oscuro v2.0
   Activado por body.theme-dark

   Capas:
   1. Variables globales (propaga a todo lo que use var())
   2. Override sidebar-white-theme.css (mismo selector + body.theme-dark)
   3. Servicios-premium.css hardcoded overrides
   4. Login pages
   ============================================ */

html.theme-dark { color-scheme: dark; }

/* ═══════════════════════════════════════════
   1. VARIABLES — global.css + servicios-premium.css + sidebar_servicios
   ═══════════════════════════════════════════ */
body.theme-dark {
    /* global.css */
    --bg: #0f1219 !important;
    --bg-card: #1a1f2e !important;
    --bg-hover: #252b3d !important;
    --bg-deep: #0f1219 !important;
    --text: #e2e8f0 !important;
    --text-main: #e2e8f0 !important;
    --text-dim: #94a3b8 !important;
    --text-light: #94a3b8 !important;
    --border: #2d3548 !important;
    --shadow: rgba(0,0,0,.4) !important;
    --glass-bg: rgba(255,255,255,.03) !important;
    --glass-border: rgba(255,255,255,.06) !important;

    /* servicios-premium.css */
    --bg-main: #0f1219 !important;
    --bg-warm: #141824 !important;
    --brand-light: rgba(147,186,31,.08) !important;
    --brand-pale: rgba(147,186,31,.04) !important;
    --brand-glow: rgba(147,186,31,.12) !important;
    --border-color: #2d3548 !important;
    --border-2: #3d4f66 !important;
    --tx-1: #e2e8f0 !important;
    --tx-2: #94a3b8 !important;
    --tx-3: #64748b !important;
    --text-primary: #e2e8f0 !important;
    --text-secondary: #94a3b8 !important;
    --text-muted: #64748b !important;
    --sh-xs:  0 1px 2px rgba(0,0,0,.2) !important;
    --sh-sm:  0 1px 3px rgba(0,0,0,.25), 0 1px 2px rgba(0,0,0,.15) !important;
    --sh:     0 4px 6px -1px rgba(0,0,0,.25), 0 2px 4px -1px rgba(0,0,0,.15) !important;
    --sh-md:  0 10px 15px -3px rgba(0,0,0,.3), 0 4px 6px -2px rgba(0,0,0,.2) !important;
    --sh-lg:  0 20px 25px -5px rgba(0,0,0,.35), 0 10px 10px -5px rgba(0,0,0,.2) !important;
    --sh-xl:  0 25px 50px -12px rgba(0,0,0,.5) !important;
    --shadow-sm: 0 1px 3px rgba(0,0,0,.25) !important;
    --shadow-md: 0 10px 15px -3px rgba(0,0,0,.3) !important;
    --shadow-lg: 0 20px 25px -5px rgba(0,0,0,.35) !important;

    /* sidebar_servicios.php inline vars */
    --sb-beige: #0f1219 !important;
    --sb-card: #1a1f2e !important;
    --sb-fg: #e2e8f0 !important;
    --sb-muted: #94a3b8 !important;
    --sb-hover: rgba(255,255,255,.06) !important;
    --sb-brd: #2d3548 !important;
    --sb-shadow: 0 1px 0 rgba(0,0,0,.2), 0 12px 36px -18px rgba(0,0,0,.5) !important;

    background: #0f1219 !important;
    color: #e2e8f0 !important;
}

/* ═══════════════════════════════════════════
   2. OVERRIDE sidebar-white-theme.css
   Cada selector = body.theme-dark + original
   ═══════════════════════════════════════════ */

body.theme-dark {
    background: #0f1219 !important;
    color: #e2e8f0 !important;
}

body.theme-dark .main-content {
    background: transparent !important;
}

body.theme-dark .header {
    background: #1a1f2e !important;
    color: #e2e8f0 !important;
    border-bottom: 1px solid #2d3548 !important;
}

body.theme-dark .menu-toggle,
body.theme-dark .sidebar-toggle,
body.theme-dark .header .user-name,
body.theme-dark .header .user-role,
body.theme-dark .sidebar .user-area,
body.theme-dark .page-title h1,
body.theme-dark .page-title p,
body.theme-dark .stat-content h3,
body.theme-dark .stat-content p,
body.theme-dark .section-header h2,
body.theme-dark .backup-filename,
body.theme-dark .backup-details,
body.theme-dark .empty-state,
body.theme-dark .modal-title,
body.theme-dark .modal-message,
body.theme-dark .loading-text,
body.theme-dark .loading-subtext {
    color: #e2e8f0 !important;
}

body.theme-dark .sidebar {
    background: #141824 !important;
    color: #e2e8f0 !important;
    border-right: 1px solid #2d3548 !important;
}

body.theme-dark .sidebar .sidebar-header,
body.theme-dark .sidebar .sidebar-search,
body.theme-dark .sidebar .sidebar-search input,
body.theme-dark .sidebar .nav-item,
body.theme-dark .sidebar .nav-section-header {
    background: transparent !important;
    color: #e2e8f0 !important;
}

body.theme-dark .sidebar .nav-item {
    border-color: transparent !important;
}

body.theme-dark .sidebar .nav-item.active,
body.theme-dark .sidebar .nav-item:hover {
    background: #252b3d !important;
    color: #e2e8f0 !important;
}

body.theme-dark .sidebar .sidebar-search input {
    background: #1e2433 !important;
    border: 1px solid #2d3548 !important;
    color: #e2e8f0 !important;
}

body.theme-dark .sidebar .sidebar-search input::placeholder {
    color: #64748b !important;
}

body.theme-dark .header-right .user-info {
    background: #252b3d !important;
    border-color: #2d3548 !important;
}

body.theme-dark .user-avatar {
    background: linear-gradient(135deg, #93BA1F 0%, #7A9619 100%) !important;
    color: #fff !important;
}

body.theme-dark .dashboard-container,
body.theme-dark .page-header,
body.theme-dark .stat-card,
body.theme-dark .section-card,
body.theme-dark .section-header,
body.theme-dark .backup-item,
body.theme-dark .modal-card,
body.theme-dark .card,
body.theme-dark .chart-card,
body.theme-dark .table-container,
body.theme-dark .filters-bar,
body.theme-dark .area-card,
body.theme-dark .form-card,
body.theme-dark .config-section,
body.theme-dark .backup-section,
body.theme-dark .user-card,
body.theme-dark .module-card,
body.theme-dark .formulario-card,
body.theme-dark .doc-card,
body.theme-dark .actions-bar,
body.theme-dark .detalle-header,
body.theme-dark .info-card,
body.theme-dark .campos-dinamicos {
    background: #1a1f2e !important;
    border-color: #2d3548 !important;
    color: #e2e8f0 !important;
    box-shadow: 0 4px 20px rgba(0,0,0,.25) !important;
}

body.theme-dark .page-header {
    background: linear-gradient(135deg, #93ba1f 0%, #2e4a0c 100%) !important;
}

body.theme-dark .page-header h1,
body.theme-dark .page-header p {
    color: #fff !important;
}

body.theme-dark .section-header {
    background: #1e2433 !important;
}

body.theme-dark .stat-card {
    background: #1a1f2e !important;
}

body.theme-dark .btn-create {
    background: #93BA1F !important;
    color: #0f1219 !important;
}

body.theme-dark .btn-icon.btn-download {
    background: #252b3d !important;
    color: #e2e8f0 !important;
}

body.theme-dark .btn-icon.btn-delete {
    background: #dc2626 !important;
}

body.theme-dark .btn-modal-cancel {
    background: #252b3d !important;
    color: #e2e8f0 !important;
}

body.theme-dark .btn-modal-confirm {
    background: #93BA1F !important;
    color: #0f1219 !important;
}

body.theme-dark .loading-overlay {
    background: rgba(15,18,25,.92) !important;
}

body.theme-dark .modal-overlay {
    background: rgba(0,0,0,.6) !important;
}

body.theme-dark .spinner {
    border-top: 4px solid #93BA1F !important;
}

body.theme-dark .sidebar .sidebar-header h2 {
    background: none !important;
    -webkit-text-fill-color: #e2e8f0 !important;
    color: #e2e8f0 !important;
}

body.theme-dark .sidebar .sidebar-header i {
    background: none !important;
    -webkit-text-fill-color: #93BA1F !important;
    color: #93BA1F !important;
}

body.theme-dark .sidebar .nav-item span,
body.theme-dark .sidebar .nav-section-header span {
    color: #e2e8f0 !important;
}

body.theme-dark .sidebar .nav-item i {
    color: #94a3b8 !important;
}

body.theme-dark .sidebar .nav-item:hover i {
    color: #93BA1F !important;
}

body.theme-dark .sidebar .nav-item.active i {
    color: #93BA1F !important;
}

body.theme-dark .sidebar .sidebar-user-info {
    background: #1e2433 !important;
    border-color: #2d3548 !important;
    box-shadow: 0 10px 40px -10px rgba(0,0,0,.3) !important;
}

body.theme-dark .sidebar .sidebar-user-info:hover {
    border-color: rgba(147,186,31,.4) !important;
}

body.theme-dark .sidebar .user-name {
    color: #e2e8f0 !important;
}

body.theme-dark .sidebar .area-badge {
    background: rgba(147,186,31,.12) !important;
    color: #93BA1F !important;
    border: 1px solid rgba(147,186,31,.2) !important;
}

body.theme-dark .sidebar .role-badge {
    background: #252b3d !important;
    color: #94a3b8 !important;
    border: 1px solid #2d3548 !important;
}

body.theme-dark .sidebar .sidebar-footer {
    border-top: 1px solid #2d3548 !important;
    background: linear-gradient(180deg, transparent 0%, rgba(0,0,0,.15) 100%) !important;
}

body.theme-dark .sidebar .sidebar-footer > div:first-child {
    background: rgba(255,255,255,.03) !important;
    border-color: #2d3548 !important;
    color: #64748b !important;
}

body.theme-dark .sidebar .sidebar-footer > div:first-child i {
    color: #93BA1F !important;
}

body.theme-dark .sidebar .nav-item[href*="logout"],
body.theme-dark .sidebar .sidebar-footer a[href*="logout"] {
    color: #f87171 !important;
    background: rgba(239,68,68,.1) !important;
    border-color: rgba(239,68,68,.2) !important;
}

body.theme-dark .sidebar .nav-item[href*="logout"] i,
body.theme-dark .sidebar .sidebar-footer a[href*="logout"] i {
    color: #f87171 !important;
}

body.theme-dark .sidebar .nav-section-header {
    color: #64748b !important;
}

body.theme-dark .sidebar .nav-section-header:hover {
    background: rgba(255,255,255,.04) !important;
    color: #e2e8f0 !important;
}

body.theme-dark .sidebar .nav-section-content {
    border-left-color: #2d3548 !important;
}

body.theme-dark .sidebar .badge {
    background: rgba(239,68,68,.15) !important;
    color: #f87171 !important;
    border-color: rgba(239,68,68,.25) !important;
}

body.theme-dark .sidebar .badge-success {
    background: rgba(147,186,31,.15) !important;
    color: #93BA1F !important;
    border-color: rgba(147,186,31,.25) !important;
}

body.theme-dark .sidebar .badge-warning {
    background: rgba(251,191,36,.12) !important;
    color: #fbbf24 !important;
    border-color: rgba(251,191,36,.25) !important;
}

body.theme-dark .sidebar::-webkit-scrollbar-thumb,
body.theme-dark .sidebar .sidebar-nav::-webkit-scrollbar-thumb {
    background: #2d3548 !important;
}

body.theme-dark .sidebar .sidebar-toggle {
    background: linear-gradient(135deg, #93BA1F 0%, #7A9619 100%) !important;
    border-color: #1a1f2e !important;
}

body.theme-dark .sidebar::before {
    background: radial-gradient(circle at 20% 20%, rgba(147,186,31,.04) 0%, transparent 40%),
                radial-gradient(circle at 80% 80%, rgba(99,102,241,.03) 0%, transparent 40%) !important;
}

body.theme-dark .sidebar .nav-section-header.nav-section-header--cemgi-ti {
    background: linear-gradient(135deg, rgba(147,186,31,.12), rgba(147,186,31,.04)) !important;
    border-color: rgba(147,186,31,.2) !important;
}

body.theme-dark .sidebar .nav-cemgi-ti-title {
    color: #e2e8f0 !important;
}

body.theme-dark .sidebar .nav-cemgi-ti-kicker {
    color: #93BA1F !important;
}

/* ═══════════════════════════════════════════
   3. SERVICIOS — Hardcoded overrides
   ═══════════════════════════════════════════ */

body.theme-dark .sidebar-wrapper {
    background: #0f1219 !important;
}

body.theme-dark .sidebar-card {
    background: #141824 !important;
    border-color: #2d3548 !important;
    box-shadow: 0 4px 20px rgba(0,0,0,.4) !important;
    color: #e2e8f0 !important;
}

body.theme-dark .sb-brand-text .title { color: #e2e8f0 !important; }
body.theme-dark .sb-brand-text .sub { color: #94a3b8 !important; }

body.theme-dark .sb-search input {
    background: #1e2433 !important;
    border-color: #2d3548 !important;
    color: #e2e8f0 !important;
}
body.theme-dark .sb-search input::placeholder { color: #64748b !important; }

/* Botón de búsqueda del sidebar servicios */
body.theme-dark .sb-search-btn {
    background: #1e2433 !important;
    border-color: #2d3548 !important;
    color: #94a3b8 !important;
}
body.theme-dark .sb-search-btn:hover,
body.theme-dark .sb-search-btn:focus-within {
    background: #252b3d !important;
    border-color: #3d4560 !important;
}
body.theme-dark .sb-search-btn i { color: #64748b !important; }
body.theme-dark .sb-search-btn span { color: #94a3b8 !important; }
body.theme-dark .sb-search-btn kbd {
    background: #252b3d !important;
    border-color: #2d3548 !important;
    color: #64748b !important;
}

/* Logo del sidebar servicios */
body.theme-dark .sb-logo {
    background: transparent !important;
    border-color: #2d3548 !important;
}

/* Toggle colapsado del sidebar */
body.theme-dark .sidebar-wrapper.collapsed .sb-toggle {
    background: #1e2433 !important;
    color: #93ba1f !important;
}

body.theme-dark .sb-nav-item { color: #94a3b8 !important; }
body.theme-dark .sb-nav-item:hover { background: rgba(255,255,255,.06) !important; color: #e2e8f0 !important; }
body.theme-dark .sb-nav-item.active { background: rgba(147,186,31,.12) !important; color: #e2e8f0 !important; }
body.theme-dark .sb-nav-item.active i { color: #93ba1f !important; }
body.theme-dark .sb-nav-item.sb-top { color: #94a3b8 !important; }
body.theme-dark .sb-nav-item.sb-top:hover { color: #e2e8f0 !important; }
body.theme-dark .sb-nav-item.logout { color: #f87171 !important; }
body.theme-dark .sb-nav-item.logout:hover { background: rgba(239,68,68,.1) !important; }

body.theme-dark .sb-group-label { color: #64748b !important; }

body.theme-dark .sb-user {
    background: #1e2433 !important;
    border-color: #2d3548 !important;
}
body.theme-dark .sb-user-name { color: #e2e8f0 !important; }
body.theme-dark .sb-user-role { color: #94a3b8 !important; }

body.theme-dark .sb-version .pill {
    background: #1e2433 !important;
    color: #93ba1f !important;
    border-color: #2d3548 !important;
}

body.theme-dark .sb-badge { opacity: .9 !important; }
body.theme-dark .sb-nav::-webkit-scrollbar-thumb { background: #2d3548 !important; }

/* Editorial header */
body.theme-dark .editorial-header {
    background: #1a1f2e !important;
    border-color: #2d3548 !important;
}

/* Stat card icon backgrounds */
body.theme-dark .stat-card .stat-icon { opacity: .85 !important; }
body.theme-dark .stat-card.total .stat-icon       { background: rgba(59,130,246,.15) !important; }
body.theme-dark .stat-card.por-asignar .stat-icon  { background: rgba(245,158,11,.15) !important; }
body.theme-dark .stat-card.asignado .stat-icon     { background: rgba(59,130,246,.15) !important; }
body.theme-dark .stat-card.proceso .stat-icon      { background: rgba(139,92,246,.15) !important; }
body.theme-dark .stat-card.finalizado .stat-icon   { background: rgba(147,186,31,.15) !important; }

/* Filter row */
body.theme-dark .filters-row {
    background: #1a1f2e !important;
    border-color: #2d3548 !important;
}
body.theme-dark .filter-group label { color: #94a3b8 !important; }
body.theme-dark .btn-buscar { background: #93ba1f !important; color: #0f1219 !important; }

/* Badges */
body.theme-dark .badge-success    { background: rgba(147,186,31,.15) !important; color: #93ba1f !important; }
body.theme-dark .badge-warning    { background: rgba(245,158,11,.15) !important; color: #fbbf24 !important; }
body.theme-dark .badge-info       { background: rgba(59,130,246,.15) !important; color: #60a5fa !important; }
body.theme-dark .badge-danger     { background: rgba(239,68,68,.15) !important; color: #f87171 !important; }
body.theme-dark .badge-sv-success { background: rgba(147,186,31,.15) !important; color: #93ba1f !important; }
body.theme-dark .badge-sv-warning { background: rgba(245,158,11,.15) !important; color: #fbbf24 !important; }
body.theme-dark .badge-sv-info    { background: rgba(59,130,246,.15) !important; color: #60a5fa !important; }
body.theme-dark .badge-sv-danger  { background: rgba(239,68,68,.15) !important; color: #f87171 !important; }

/* Order cards */
body.theme-dark .orden-card,
body.theme-dark .orden-row,
body.theme-dark .order-card {
    background: #1a1f2e !important;
    border-color: #2d3548 !important;
    color: #e2e8f0 !important;
}
body.theme-dark .orden-card:hover,
body.theme-dark .order-card:hover { background: #252b3d !important; }

/* ═══════════════════════════════════════════
   4. UNIVERSAL — Forms, tables, modals, etc.
   ═══════════════════════════════════════════ */

body.theme-dark h1,
body.theme-dark h2,
body.theme-dark h3,
body.theme-dark h4,
body.theme-dark h5,
body.theme-dark h6 { color: #e2e8f0 !important; }

body.theme-dark p { color: #94a3b8 !important; }

body.theme-dark a:not(.nav-item):not(.sb-nav-item):not([class*="btn"]):not(.nav-link) {
    color: #93BA1F !important;
}

/* Tables */
body.theme-dark table { color: #e2e8f0 !important; }
body.theme-dark table thead,
body.theme-dark table th {
    background: #1e2433 !important;
    color: #94a3b8 !important;
    border-bottom-color: #2d3548 !important;
}
body.theme-dark table td {
    color: #e2e8f0 !important;
    border-bottom-color: #2d3548 !important;
}
body.theme-dark table tr:hover { background: #252b3d !important; }
body.theme-dark table tbody tr:hover td { background: #252b3d !important; }
body.theme-dark table tbody tr:nth-child(even) { background: rgba(255,255,255,.02) !important; }

/* Forms */
body.theme-dark input:not([type="checkbox"]):not([type="radio"]):not([type="submit"]):not([type="button"]):not([type="range"]),
body.theme-dark select,
body.theme-dark textarea,
body.theme-dark .form-control {
    background: #1e2433 !important;
    color: #e2e8f0 !important;
    border-color: #2d3548 !important;
}

body.theme-dark input:focus,
body.theme-dark select:focus,
body.theme-dark textarea:focus,
body.theme-dark .form-control:focus {
    background: #252b3d !important;
    border-color: #93BA1F !important;
    box-shadow: 0 0 0 3px rgba(147,186,31,.15) !important;
}

body.theme-dark input::placeholder,
body.theme-dark textarea::placeholder { color: #64748b !important; }

body.theme-dark .form-group label { color: #e2e8f0 !important; }
body.theme-dark select option { background: #1e2433 !important; color: #e2e8f0 !important; }

/* Modals */
body.theme-dark .modal-content,
body.theme-dark .modal-card,
body.theme-dark [id*="modal"] > div:not(.modal-overlay) {
    background: #1a1f2e !important;
    color: #e2e8f0 !important;
    border-color: #2d3548 !important;
}

/* Tooltips & dropdowns */
body.theme-dark .dropdown-menu,
body.theme-dark .tooltip-inner {
    background: #252b3d !important;
    border-color: #2d3548 !important;
    color: #e2e8f0 !important;
}
body.theme-dark .dropdown-item:hover { background: #2d3548 !important; }

/* Alerts */
body.theme-dark .alert { border-color: #2d3548 !important; }
body.theme-dark .alert-info    { background: rgba(52,152,219,.12) !important; color: #60a5fa !important; }
body.theme-dark .alert-success { background: rgba(147,186,31,.12) !important; color: #93BA1F !important; }
body.theme-dark .alert-warning { background: rgba(251,191,36,.12) !important; color: #fbbf24 !important; }
body.theme-dark .alert-danger  { background: rgba(239,68,68,.12) !important; color: #f87171 !important; }

/* Pagination */
body.theme-dark .pagination .page-link {
    background: #1a1f2e !important;
    color: #e2e8f0 !important;
    border-color: #2d3548 !important;
}
body.theme-dark .pagination .page-item.active .page-link {
    background: #93BA1F !important;
    color: #0f1219 !important;
    border-color: #93BA1F !important;
}

/* Tabs */
body.theme-dark .nav-tabs { border-bottom-color: #2d3548 !important; }
body.theme-dark .nav-tabs .nav-link { color: #94a3b8 !important; }
body.theme-dark .nav-tabs .nav-link.active {
    background: #1a1f2e !important;
    color: #e2e8f0 !important;
    border-color: #2d3548 #2d3548 #1a1f2e !important;
}

/* Breadcrumbs */
body.theme-dark .breadcrumb { background: #1e2433 !important; }
body.theme-dark .breadcrumb-item,
body.theme-dark .breadcrumb-item a { color: #94a3b8 !important; }

/* Inline white backgrounds */
body.theme-dark [style*="background:#fff"],
body.theme-dark [style*="background: #fff"],
body.theme-dark [style*="background:#ffffff"],
body.theme-dark [style*="background: #ffffff"],
body.theme-dark [style*="background: white"],
body.theme-dark [style*="background:white"] {
    background: #1a1f2e !important;
}

/* Tickets */
body.theme-dark .ticket-card,
body.theme-dark .ticket-row {
    background: #1a1f2e !important;
    border-color: #2d3548 !important;
}
body.theme-dark .ticket-card:hover,
body.theme-dark .ticket-row:hover { background: #252b3d !important; }

body.theme-dark .star-rating .star { color: #475569 !important; }
body.theme-dark .star-rating .star.active,
body.theme-dark .star-rating .star.filled { color: #fbbf24 !important; }

/* Select2 */
body.theme-dark .select2-container--default .select2-selection--single {
    background: #1e2433 !important; border-color: #2d3548 !important; color: #e2e8f0 !important;
}
body.theme-dark .select2-dropdown { background: #1e2433 !important; border-color: #2d3548 !important; }
body.theme-dark .select2-results__option--highlighted { background: #252b3d !important; }

/* SweetAlert2 */
body.theme-dark .swal2-popup {
    background: #1a1f2e !important;
    color: #e2e8f0 !important;
}
body.theme-dark .swal2-title { color: #e2e8f0 !important; }
body.theme-dark .swal2-html-container { color: #94a3b8 !important; }

/* Scrollbar global */
body.theme-dark ::-webkit-scrollbar { width: 8px; height: 8px; }
body.theme-dark ::-webkit-scrollbar-track { background: #0f1219 !important; }
body.theme-dark ::-webkit-scrollbar-thumb { background: #2d3548 !important; border-radius: 4px; }
body.theme-dark ::-webkit-scrollbar-thumb:hover { background: #3d4f66 !important; }

/* ═══════════════════════════════════════════
   5. LOGIN PAGES
   ═══════════════════════════════════════════ */

body.theme-dark .layout { background: #0f1219 !important; }

body.theme-dark .hero-section {
    background-color: #0f1219 !important;
    background-image: radial-gradient(rgba(147,186,31,.25) 1.5px, transparent 1.5px) !important;
    background-size: 40px 40px !important;
    border-right-color: #2d3548 !important;
}

body.theme-dark .hero-vignette {
    background: radial-gradient(circle at center, transparent 20%, rgba(15,18,25,.92) 100%) !important;
}

body.theme-dark .hero-content h1 {
    background: linear-gradient(90deg, #e2e8f0 0%, #93BA1F 25%, #e2e8f0 50%, #93BA1F 75%, #e2e8f0 100%) !important;
    background-size: 200% auto !important;
    -webkit-background-clip: text !important;
    background-clip: text !important;
}

body.theme-dark .hero-content p {
    color: #94a3b8 !important;
    -webkit-text-fill-color: #94a3b8 !important;
}

body.theme-dark .brand-badge {
    background: linear-gradient(135deg, #1e2433, #252b3d) !important;
    box-shadow: 15px 15px 40px rgba(0,0,0,.4), -15px -15px 40px rgba(45,53,72,.3), inset 0 0 0 1px rgba(255,255,255,.06) !important;
}

body.theme-dark .nav-link {
    background: #1e2433 !important;
    border-color: #2d3548 !important;
    color: #e2e8f0 !important;
    -webkit-text-fill-color: #e2e8f0 !important;
}
body.theme-dark .nav-link:hover {
    border-color: #93BA1F !important;
    color: #93BA1F !important;
    -webkit-text-fill-color: #93BA1F !important;
}

body.theme-dark .login-sidebar {
    background: #141824 !important;
    color: #e2e8f0 !important;
    -webkit-text-fill-color: #e2e8f0 !important;
    box-shadow: -20px 0 80px rgba(0,0,0,.3) !important;
}
body.theme-dark .login-sidebar * { -webkit-text-fill-color: inherit !important; }

body.theme-dark .header-text h2 { color: #e2e8f0 !important; -webkit-text-fill-color: #e2e8f0 !important; }
body.theme-dark .header-text p  { color: #94a3b8 !important; -webkit-text-fill-color: #94a3b8 !important; }

body.theme-dark .input-float input {
    background: #1a1f2e !important;
    border: 2px solid #2d3548 !important;
    color: #e2e8f0 !important;
    -webkit-text-fill-color: #e2e8f0 !important;
    caret-color: #e2e8f0 !important;
}
body.theme-dark .input-float input:focus {
    background: #1e2433 !important;
    border-color: #93BA1F !important;
    box-shadow: 0 10px 20px rgba(147,186,31,.1) !important;
}
body.theme-dark .input-float label { color: #64748b !important; -webkit-text-fill-color: #64748b !important; }
body.theme-dark .input-float input:focus + label,
body.theme-dark .input-float input:not(:placeholder-shown) + label {
    color: #93BA1F !important; -webkit-text-fill-color: #93BA1F !important;
}

body.theme-dark .toggle-password { color: #64748b !important; }
body.theme-dark .cursor-light { background: radial-gradient(circle, rgba(147,186,31,.04) 0%, transparent 70%) !important; }

body.theme-dark .login-footer,
body.theme-dark .footer-login { color: #64748b !important; -webkit-text-fill-color: #64748b !important; }

body.theme-dark .version-badge { color: #64748b !important; -webkit-text-fill-color: #64748b !important; }
body.theme-dark .version-pill {
    background: #1e2433 !important;
    color: #93BA1F !important;
    -webkit-text-fill-color: #93BA1F !important;
}

/* ═══════════════════════════════════════════
   6. TOGGLE BUTTON (login + sidebar)
   ═══════════════════════════════════════════ */

.login-theme-toggle {
    position: absolute;
    top: 20px; right: 20px;
    width: 40px; height: 40px;
    border: 2px solid #e2e8f0;
    border-radius: 50%;
    background: rgba(255,255,255,.8);
    backdrop-filter: blur(8px);
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    font-size: 16px; color: #475569;
    transition: all .3s ease;
    z-index: 100;
    padding: 0;
}
.login-theme-toggle:hover { border-color: #93BA1F; color: #93BA1F; transform: scale(1.1); }
body.theme-dark .login-theme-toggle {
    background: rgba(30,36,51,.9) !important;
    border-color: #2d3548 !important;
    color: #e2e8f0 !important;
}
body.theme-dark .login-theme-toggle:hover { border-color: #93BA1F !important; color: #93BA1F !important; }

.sidebar-theme-toggle { color: #64748b !important; transition: color .2s !important; }
.sidebar-theme-toggle:hover { color: #93BA1F !important; }
body.theme-dark .sidebar-theme-toggle { color: #fbbf24 !important; }

/* ═══════════════════════════════════════════
   7. SERVICIOS-PREMIUM — remaining hardcoded overrides
   ═══════════════════════════════════════════ */

/* Editorial header text */
body.theme-dark .editorial-header h1 { color: #e2e8f0 !important; }
body.theme-dark .editorial-header p { color: #94a3b8 !important; }
body.theme-dark .editorial-header .eh-label { color: #64748b !important; }
body.theme-dark .eh-btn-primary { background: #e2e8f0 !important; color: #0f1219 !important; }
body.theme-dark .eh-btn-outline {
    background: #1e2433 !important;
    border-color: #2d3548 !important;
    color: #e2e8f0 !important;
}
body.theme-dark .eh-btn-outline:hover { background: #252b3d !important; border-color: #3d4f66 !important; }

/* Chips */
body.theme-dark .chip {
    background: #1e2433 !important;
    border-color: #2d3548 !important;
    color: #e2e8f0 !important;
}
body.theme-dark .chip:hover { border-color: #3d4f66 !important; }
body.theme-dark .chip.active { background: #e2e8f0 !important; color: #0f1219 !important; }
body.theme-dark .chip .count { background: #252b3d !important; color: #94a3b8 !important; }
body.theme-dark .chip.active .count { background: rgba(0,0,0,.15) !important; color: #0f1219 !important; }

/* Buttons in page-header */
body.theme-dark .btn-nueva-orden,
body.theme-dark .btn-nuevo {
    background: rgba(255,255,255,.15) !important;
    color: #fff !important;
}
body.theme-dark .btn-nueva-orden:hover,
body.theme-dark .btn-nuevo:hover {
    background: rgba(255,255,255,.25) !important;
    color: #fff !important;
}

/* Results container */
body.theme-dark .results-container { background: #1a1f2e !important; border-color: #2d3548 !important; }
body.theme-dark .results-header { background: #1e2433 !important; border-bottom-color: #2d3548 !important; }
body.theme-dark .results-header h3 { color: #e2e8f0 !important; }
body.theme-dark .loading-state { color: #64748b !important; }
body.theme-dark .loading-state p { color: #94a3b8 !important; }

/* Filter/search cards */
body.theme-dark .srv-filter-card,
body.theme-dark .search-card {
    background: #1a1f2e !important;
    border-color: #2d3548 !important;
}
body.theme-dark .srv-filter-card h3,
body.theme-dark .search-card h3 { color: #e2e8f0 !important; }
body.theme-dark .srv-filter-item label,
body.theme-dark .filter-group label { color: #94a3b8 !important; }

/* Modal footer */
body.theme-dark .modal-footer { background: #1e2433 !important; border-top-color: #2d3548 !important; }
body.theme-dark .modal-footer .btn-danger {
    background: rgba(239,68,68,.12) !important;
    color: #f87171 !important;
    border-color: rgba(239,68,68,.25) !important;
}
body.theme-dark .modal-footer .btn-danger:hover { background: rgba(239,68,68,.2) !important; }
body.theme-dark .modal-body { color: #e2e8f0 !important; }
body.theme-dark .modal-body .help-sv { color: #64748b !important; }

/* Pagination disabled */
body.theme-dark ul.pagination > li.disabled > span > a {
    background: #1e2433 !important;
    color: #475569 !important;
    border-color: #2d3548 !important;
}

/* Tarjetas KPI aceptadas/rechazadas (cotizaciones.php) */
body.theme-dark .cot-kpi-card { background: #1a1f2e !important; border-color: #2d3548 !important; }
body.theme-dark .cot-kpi-num { color: #e2e8f0 !important; }
body.theme-dark .cot-kpi-label { color: #94a3b8 !important; }

/* Glass panel */
body.theme-dark .glass-panel {
    background: #1a1f2e !important;
    border-color: #2d3548 !important;
    color: #e2e8f0 !important;
}

/* Outer divs (legacy tables) */
body.theme-dark .outer_div .srv-table-wrap,
body.theme-dark .outer_div3 .srv-table-wrap {
    border-color: #2d3548 !important;
}

/* ═══════════════════════════════════════════
   8. PIPELINE — pipeline-cotizacion-factura.css
   ═══════════════════════════════════════════ */

body.theme-dark {
    --pipe-card: #1a1f2e !important;
    --pipe-ink: #e2e8f0 !important;
    --pipe-muted: #94a3b8 !important;
    --pipe-shadow: 0 8px 28px -18px rgba(0,0,0,.4) !important;
}

body.theme-dark .pipe-kpi {
    background: #1a1f2e !important;
    border-color: #2d3548 !important;
}
body.theme-dark .pipe-kpi__lab { color: #94a3b8 !important; }
body.theme-dark .pipe-kpi__val { color: #e2e8f0 !important; }
body.theme-dark .pipe-kpi--amz .pipe-kpi__val { color: #fbbf24 !important; }

body.theme-dark .pipe-shell {
    background: #1a1f2e !important;
    border-color: #2d3548 !important;
}

body.theme-dark .pipe-search {
    background: #1e2433 !important;
    border-color: #2d3548 !important;
}
body.theme-dark .pipe-search input { color: #e2e8f0 !important; }
body.theme-dark .pipe-viewing { color: #94a3b8 !important; }
body.theme-dark .pipe-viewing strong { color: #93ba1f !important; }

body.theme-dark .pipe-step {
    background: linear-gradient(180deg, #1e2433, #1a1f2e) !important;
    border-color: #2d3548 !important;
    color: #94a3b8 !important;
}
body.theme-dark .pipe-step:hover {
    background: #252b3d !important;
    border-color: #93BA1F !important;
    color: #e2e8f0 !important;
}
body.theme-dark .pipe-step.is-active {
    background: rgba(245,158,11,.12) !important;
    border-color: #f59e0b !important;
    color: #fbbf24 !important;
}
body.theme-dark .pipe-step__count {
    background: rgba(148,163,184,.12) !important;
    color: #94a3b8 !important;
}
body.theme-dark .pipe-step.is-active .pipe-step__count {
    background: rgba(245,158,11,.2) !important;
    color: #fbbf24 !important;
}
body.theme-dark .pipe-step__num {
    background: rgba(148,163,184,.15) !important;
    color: #94a3b8 !important;
}
body.theme-dark .pipe-step.is-active .pipe-step__num {
    background: #f59e0b !important;
    color: #fff !important;
}
body.theme-dark .pipe-step.has-items .pipe-step__count {
    background: rgba(147,186,31,.15) !important;
    color: #93ba1f !important;
}

body.theme-dark .pipe-portal-head { color: #64748b !important; }

body.theme-dark .pipe-card {
    background: #1a1f2e !important;
    border-color: #2d3548 !important;
}
body.theme-dark .pipe-card:hover {
    border-color: rgba(147,186,31,.4) !important;
}
body.theme-dark .pipe-card.is-amazon {
    background: linear-gradient(90deg, rgba(245,158,11,.08) 0%, #1a1f2e 42%) !important;
}
body.theme-dark .pipe-card__folio { color: #e2e8f0 !important; }
body.theme-dark .pipe-card__cli { color: #e2e8f0 !important; }
body.theme-dark .pipe-card__meta { color: #94a3b8 !important; }
body.theme-dark .pipe-card__money { color: #e2e8f0 !important; }
body.theme-dark .pipe-badge-amz {
    background: rgba(245,158,11,.15) !important;
    border-color: rgba(245,158,11,.3) !important;
    color: #fbbf24 !important;
}
body.theme-dark .pipe-card__hint {
    background: rgba(147,186,31,.1) !important;
    border-color: rgba(147,186,31,.2) !important;
    color: #93ba1f !important;
}

body.theme-dark .pipe-mini__seg { background: #2d3548 !important; }
body.theme-dark .pipe-mini__seg.is-done { background: #93ba1f !important; }
body.theme-dark .pipe-mini__seg.is-current { background: #f59e0b !important; }
body.theme-dark .pipe-mini__seg.is-blocked { background: #ef4444 !important; }
body.theme-dark .pipe-mini__lab { color: #e2e8f0 !important; }
body.theme-dark .pipe-mini__sub { color: #94a3b8 !important; }

body.theme-dark .pipe-next {
    background: #1e2433 !important;
    border-color: #2d3548 !important;
    color: #94a3b8 !important;
}

body.theme-dark .pipe-clear button {
    background: #1e2433 !important;
    border-color: #2d3548 !important;
    color: #94a3b8 !important;
}
body.theme-dark .pipe-clear button:hover { background: #93BA1F !important; color: #0f1219 !important; }

body.theme-dark .pipe-legend { color: #64748b !important; }
body.theme-dark .pipe-dot.pending { background: #2d3548 !important; border-color: #475569 !important; }

body.theme-dark .pipe-empty,
body.theme-dark .pipe-loading { color: #64748b !important; }

body.theme-dark .pipe-intro { color: #94a3b8 !important; }
body.theme-dark .pipe-intro code { background: rgba(255,255,255,.08) !important; color: #e2e8f0 !important; }

body.theme-dark .pipe-ring__bg { stroke: #2d3548 !important; }
body.theme-dark .pipe-ring span { color: #e2e8f0 !important; }

/* Pipeline header select */
body.theme-dark .main-content > .page-header select {
    background: #1e2433 !important;
    color: #e2e8f0 !important;
    border-color: #2d3548 !important;
}

/* ═══════════════════════════════════════════
   9. DASHBOARD EJECUTIVO — inline <style> overrides
   ═══════════════════════════════════════════ */

body.theme-dark .metric-card {
    background: #1a1f2e !important;
    box-shadow: 0 1px 3px rgba(0,0,0,.25) !important;
}
body.theme-dark .metric-label { color: #94a3b8 !important; }
body.theme-dark .metric-value { color: #e2e8f0 !important; }

body.theme-dark .alert-box {
    background: #1a1f2e !important;
    border-color: #2d3548 !important;
    box-shadow: 0 1px 3px rgba(0,0,0,.2) !important;
}
body.theme-dark .alert-icon { background: #e2e8f0 !important; color: #0f1219 !important; }
body.theme-dark .alert-title { color: #e2e8f0 !important; }
body.theme-dark .alert-subtitle { color: #94a3b8 !important; }
body.theme-dark .alert-btn { background: #e2e8f0 !important; color: #0f1219 !important; }
body.theme-dark .alert-btn:hover { background: #cbd5e1 !important; }

body.theme-dark .header-meta { color: #64748b !important; }
body.theme-dark .header-greeting { color: #e2e8f0 !important; }
body.theme-dark .header-subtitle { color: #94a3b8 !important; }

body.theme-dark .card-title { color: #e2e8f0 !important; }
body.theme-dark .card-link { color: #94a3b8 !important; }
body.theme-dark .card-link:hover { color: #e2e8f0 !important; }

/* Calendar */
body.theme-dark .calendar-day:hover { background: #252b3d !important; }
body.theme-dark .calendar-day.today { background: #e2e8f0 !important; color: #0f1219 !important; }
body.theme-dark .calendar-day.today .calendar-day-label { color: #475569 !important; }
body.theme-dark .calendar-day-label { color: #64748b !important; }
body.theme-dark .calendar-day-num { color: #e2e8f0 !important; }
body.theme-dark .calendar-legend { color: #64748b !important; }

/* Pipeline chart in dashboard */
body.theme-dark .pipeline-center-num { color: #e2e8f0 !important; }
body.theme-dark .pipeline-center-label { color: #94a3b8 !important; }
body.theme-dark .pipeline-item { border-bottom-color: #2d3548 !important; }
body.theme-dark .pipeline-item-label { color: #e2e8f0 !important; }
body.theme-dark .pipeline-item-value { color: #e2e8f0 !important; }

/* Entregas */
body.theme-dark .entrega-item { background: #1e2433 !important; }
body.theme-dark .entrega-item:hover { background: #252b3d !important; }
body.theme-dark .entrega-date-day { color: #e2e8f0 !important; }
body.theme-dark .entrega-date-month { color: #94a3b8 !important; }
body.theme-dark .entrega-title { color: #e2e8f0 !important; }
body.theme-dark .entrega-meta { color: #94a3b8 !important; }

/* Equipo */
body.theme-dark .equipo-name { color: #e2e8f0 !important; }
body.theme-dark .equipo-bar { background: #252b3d !important; }
body.theme-dark .equipo-percent { color: #e2e8f0 !important; }

/* Cartera clientes */
body.theme-dark .cartera-title { color: #e2e8f0 !important; }
body.theme-dark .cartera-subtitle { color: #94a3b8 !important; }
body.theme-dark .cliente-card {
    background: #1a1f2e !important;
    border-color: #2d3548 !important;
    box-shadow: 0 1px 3px rgba(0,0,0,.25) !important;
}
body.theme-dark .cliente-card:hover { box-shadow: 0 8px 20px rgba(0,0,0,.4) !important; }
body.theme-dark .cliente-name { color: #e2e8f0 !important; }
body.theme-dark .cliente-type { color: #94a3b8 !important; }
body.theme-dark .cliente-amount { color: #e2e8f0 !important; }
body.theme-dark .cliente-stats { color: #94a3b8 !important; }
body.theme-dark .cliente-stat strong { color: #e2e8f0 !important; }

/* ═══════════════════════════════════════════
   10. COTIZACIÓN PIPELINE MODAL (swal2)
   ═══════════════════════════════════════════ */

body.theme-dark .swal2-cot-pipe.swal2-popup { background: #1a1f2e !important; }
body.theme-dark .swal2-cot-pipe .swal2-actions {
    background: #1e2433 !important;
    border-top-color: #2d3548 !important;
}
body.theme-dark .swal2-cot-pipe .swal2-styled.swal2-cancel {
    background: rgba(147,186,31,.12) !important;
    border-color: rgba(147,186,31,.25) !important;
    color: #93ba1f !important;
}
body.theme-dark .swal2-cot-pipe .swal2-styled.swal2-confirm {
    background: #252b3d !important;
    color: #94a3b8 !important;
}
body.theme-dark .cpip { color: #e2e8f0 !important; }

/* ═══════════════════════════════════════════
   11. CATCH-ALL — inline white backgrounds + text
   ═══════════════════════════════════════════ */

/* Expanded attribute selectors for inline background:white in all forms */
body.theme-dark [style*="background:#FFF"],
body.theme-dark [style*="background: #FFF"],
body.theme-dark [style*="background:#FFFFFF"],
body.theme-dark [style*="background: #FFFFFF"],
body.theme-dark [style*="background-color:#fff"],
body.theme-dark [style*="background-color: #fff"],
body.theme-dark [style*="background-color:#FFF"],
body.theme-dark [style*="background-color: #FFF"],
body.theme-dark [style*="background-color:white"],
body.theme-dark [style*="background-color: white"] {
    background: #1a1f2e !important;
    background-color: #1a1f2e !important;
}

/* Inline color overrides for common dark text on dark background */
body.theme-dark [style*="color:#1c1917"],
body.theme-dark [style*="color: #1c1917"],
body.theme-dark [style*="color:#1e293b"],
body.theme-dark [style*="color: #1e293b"],
body.theme-dark [style*="color:#0f172a"],
body.theme-dark [style*="color: #0f172a"] {
    color: #e2e8f0 !important;
}

/* Light borders → dark */
body.theme-dark [style*="border:1px solid #e2e8f0"],
body.theme-dark [style*="border: 1px solid #e2e8f0"],
body.theme-dark [style*="border:1px solid #e7e5e4"],
body.theme-dark [style*="border: 1px solid #e7e5e4"],
body.theme-dark [style*="border:1px solid #e5e7eb"],
body.theme-dark [style*="border: 1px solid #e5e7eb"],
body.theme-dark [style*="border:1px solid #f5f5f4"],
body.theme-dark [style*="border: 1px solid #f5f5f4"] {
    border-color: #2d3548 !important;
}

/* Dropdowns/autocomplete popovers with inline white */
body.theme-dark [id*="-drop"][style*="background:#fff"],
body.theme-dark [id*="-drop"][style*="background: #fff"] {
    background: #1e2433 !important;
    border-color: #2d3548 !important;
}

/* Dashboard-specific: grid cards at any nesting */
body.theme-dark .dashboard-grid .card { background: #1a1f2e !important; box-shadow: 0 1px 3px rgba(0,0,0,.25) !important; }
body.theme-dark .dashboard-container { color: #e2e8f0 !important; }

/* Clientes page buttons with inline white bg */
body.theme-dark .btn-nuevo[style*="background:white"],
body.theme-dark .btn-nuevo[style*="background: white"],
body.theme-dark .btn-nueva-orden[style*="background:white"],
body.theme-dark .btn-nueva-orden[style*="background: white"] {
    background: #1e2433 !important;
    color: #e2e8f0 !important;
    border-color: #2d3548 !important;
}

/* CxC alert banner */
body.theme-dark .cxc-alert { background: rgba(245,158,11,.1) !important; border-color: rgba(245,158,11,.25) !important; color: #fbbf24 !important; }

/* Dashboard cotizaciones table wrapper */
body.theme-dark [style*="border-radius:18px"][style*="background:#fff"] {
    background: #1a1f2e !important;
    border-color: #2d3548 !important;
}

/* Facturas modals with inline white bg */
body.theme-dark [style*="border-radius:14px"][style*="background:#fff"] {
    background: #1a1f2e !important;
}

/* ═══════════════════════════════════════════
   12. NUCLEAR — wildcard class-name patterns
   Cubre 42+ archivos PHP con estilos inline
   ═══════════════════════════════════════════ */

/*
 * ANY element whose class contains "-card" and is inside main-content.
 * Catches: oc-card, edit-card, stat-card, orden-card, order-card,
 * cliente-card, metric-card, info-card, doc-card, form-card, etc.
 * Excluded: page-header children (green gradient), stat-icon (semantic bg).
 */
body.theme-dark .main-content [class*="-card"]:not(.stat-icon):not(.page-header):not([class*="badge"]) {
    background: #1a1f2e !important;
    border-color: #2d3548 !important;
    color: #e2e8f0 !important;
}

/* Card sub-elements: heads, bodies, foots with light gradients/bgs */
body.theme-dark .main-content [class*="-card-head"],
body.theme-dark .main-content [class*="-card-body"],
body.theme-dark .main-content [class*="-card-foot"] {
    background: #1a1f2e !important;
    border-color: #2d3548 !important;
    color: #e2e8f0 !important;
}

/* Items inside containers (servicio-item, pipeline-item, entrega-item, etc.) */
body.theme-dark .main-content [class*="-item"]:not([class*="badge"]):not([class*="nav-"]):not(.sb-nav-item) {
    border-color: #2d3548 !important;
}

/* Dialogs / panels */
body.theme-dark .main-content [class*="-dialog"],
body.theme-dark .main-content [class*="-panel"],
body.theme-dark .main-content [class*="-wrap"]:not(.sidebar-wrapper) {
    background: #1a1f2e !important;
    border-color: #2d3548 !important;
    color: #e2e8f0 !important;
}

/* Common table patterns: any element with "-table" in class */
body.theme-dark .main-content [class*="-table"] thead th,
body.theme-dark .main-content [class*="-table"] tbody td {
    background: #1a1f2e !important;
    color: #e2e8f0 !important;
    border-color: #2d3548 !important;
}
body.theme-dark .main-content [class*="-table"] thead th {
    background: #1e2433 !important;
    color: #94a3b8 !important;
}
body.theme-dark .main-content [class*="-table"] tbody tr:hover td {
    background: #252b3d !important;
}
body.theme-dark .main-content [class*="-table-wrap"],
body.theme-dark .main-content [class*="table-wrap"] {
    background: #141824 !important;
    border-color: #2d3548 !important;
}

/* Table rows with white bg */
body.theme-dark .main-content [class*="-row"] td {
    background: #1a1f2e !important;
    border-color: #2d3548 !important;
    color: #e2e8f0 !important;
}
body.theme-dark .main-content [class*="-row"]:hover td {
    background: #252b3d !important;
}

/* ═══════════════════════════════════════════
   13. ORDENES DE COMPRA — .oc-* family
   ═══════════════════════════════════════════ */

body.theme-dark .oc-card { background: #1a1f2e !important; border-color: #2d3548 !important; }
body.theme-dark .oc-card:hover { border-color: rgba(147,186,31,.4) !important; }
body.theme-dark .oc-card-head { background: linear-gradient(180deg, #1e2433 0%, #1a1f2e 100%) !important; }
body.theme-dark .oc-card-kicker { color: #93ba1f !important; }
body.theme-dark .oc-card-num { color: #93ba1f !important; }
body.theme-dark .oc-card-submeta { color: #94a3b8 !important; }
body.theme-dark .oc-card-status { background: rgba(147,186,31,.15) !important; color: #93ba1f !important; }
body.theme-dark .oc-card-amount { color: #e2e8f0 !important; }
body.theme-dark .oc-card-body { background: transparent !important; }
body.theme-dark .oc-card-label { color: #64748b !important; }
body.theme-dark .oc-card-company { color: #e2e8f0 !important; }
body.theme-dark .oc-card-value { color: #94a3b8 !important; }
body.theme-dark .oc-card-lines { background: rgba(147,186,31,.08) !important; border-color: rgba(147,186,31,.2) !important; }
body.theme-dark .oc-card-lines:hover { background: rgba(147,186,31,.15) !important; }
body.theme-dark .oc-card-lines strong { background: rgba(147,186,31,.15) !important; color: #93ba1f !important; }
body.theme-dark .oc-card-lines small { color: #93ba1f !important; }
body.theme-dark .oc-card-lines-preview { color: #94a3b8 !important; }
body.theme-dark .oc-card-rail { background: transparent !important; }
body.theme-dark .oc-card-foot { background: #141824 !important; border-top-color: #2d3548 !important; }

/* OC buttons */
body.theme-dark .oc-btn { transition: all .15s; }
body.theme-dark .oc-btn-pdf { background: rgba(239,68,68,.15) !important; color: #f87171 !important; }
body.theme-dark .oc-btn-print { background: #252b3d !important; color: #94a3b8 !important; }
body.theme-dark .oc-btn-dl { background: rgba(59,130,246,.15) !important; color: #60a5fa !important; }
body.theme-dark .oc-btn-view { background: #252b3d !important; color: #94a3b8 !important; }

/* OC table (fallback view) */
body.theme-dark .ord-table-wrap { background: #141824 !important; border-color: #2d3548 !important; }
body.theme-dark .ord-table thead th { background: #1e2433 !important; color: #94a3b8 !important; border-bottom-color: #2d3548 !important; }
body.theme-dark .ord-table tbody td { color: #e2e8f0 !important; }
body.theme-dark .ord-table tbody tr.ord-row td { background: #1a1f2e !important; border-color: #2d3548 !important; }
body.theme-dark .ord-table tbody tr.cot-row-pipe > td { background: #1a1f2e !important; border-color: #2d3548 !important; }
body.theme-dark .ord-table tbody tr:hover td { background: #252b3d !important; }
body.theme-dark .ord-num { color: #93ba1f !important; }
body.theme-dark .ord-badge { background: rgba(147,186,31,.15) !important; color: #93ba1f !important; }
body.theme-dark .ord-empresa { color: #e2e8f0 !important; }
body.theme-dark .ord-razon { background: #252b3d !important; color: #94a3b8 !important; }
body.theme-dark .ord-cotiz { background: #252b3d !important; color: #94a3b8 !important; }
body.theme-dark .ord-importe { color: #e2e8f0 !important; }
body.theme-dark .ord-term { color: #94a3b8 !important; }
body.theme-dark .ord-btn { background: #252b3d !important; color: #94a3b8 !important; }
body.theme-dark .ord-btn:hover { background: #2d3548 !important; color: #e2e8f0 !important; }
body.theme-dark .ord-btn-dl { background: rgba(59,130,246,.15) !important; color: #60a5fa !important; }
body.theme-dark .ord-btn-pdf { background: rgba(239,68,68,.15) !important; color: #f87171 !important; }
body.theme-dark .ord-count-bar span { color: #94a3b8 !important; }

/* OC servicios modal */
body.theme-dark .oc-servicios-dialog { background: #1a1f2e !important; }
body.theme-dark .oc-servicios-list li { color: #e2e8f0 !important; border-bottom-color: #2d3548 !important; }
body.theme-dark .badge-serv { background: rgba(147,186,31,.15) !important; color: #93ba1f !important; }

/* ═══════════════════════════════════════════
   14. EDITAR ORDEN — .edit-* family
   ═══════════════════════════════════════════ */

body.theme-dark .edit-card { background: #1a1f2e !important; border-color: #2d3548 !important; }
body.theme-dark .edit-card-head { background: #1e2433 !important; border-color: #2d3548 !important; }
body.theme-dark .edit-card-body { background: #1a1f2e !important; }
body.theme-dark .edit-card--readonly .edit-card-body { background: linear-gradient(180deg, #1e2433 0%, #1a1f2e 40%) !important; }
body.theme-dark .servicio-item { background: #1a1f2e !important; border-color: #2d3548 !important; }
body.theme-dark .servicio-item:hover { background: #252b3d !important; }

/* ═══════════════════════════════════════════
   15. CLIENTES — .cl-*, .fq-*, etc.
   ═══════════════════════════════════════════ */

body.theme-dark .fq-btn { background: #1e2433 !important; border-color: #2d3548 !important; color: #94a3b8 !important; }
body.theme-dark .fq-btn:hover { border-color: #93ba1f !important; color: #93ba1f !important; }
body.theme-dark .cl-btn-edit { background: rgba(147,186,31,.12) !important; color: #93ba1f !important; }
body.theme-dark .cl-btn-del { background: rgba(239,68,68,.12) !important; color: #f87171 !important; }
body.theme-dark .cl-bulk-bar { background: rgba(245,158,11,.12) !important; border-color: rgba(245,158,11,.25) !important; color: #fbbf24 !important; }
body.theme-dark .badge-act { background: rgba(22,163,106,.12) !important; color: #4ade80 !important; border-color: rgba(22,163,106,.25) !important; }
body.theme-dark .badge-pro { background: rgba(234,88,12,.12) !important; color: #fb923c !important; border-color: rgba(234,88,12,.25) !important; }

/* ═══════════════════════════════════════════
   16. NUCLEAR TEXT — ALL text light in dark mode
   ═══════════════════════════════════════════ */

/* Force ALL text elements inside main-content to light colors.
   Exclude only elements that carry semantic color (badges, buttons, alerts). */
body.theme-dark .main-content,
body.theme-dark .main-content h1,
body.theme-dark .main-content h2,
body.theme-dark .main-content h3,
body.theme-dark .main-content h4,
body.theme-dark .main-content h5,
body.theme-dark .main-content h6,
body.theme-dark .main-content p,
body.theme-dark .main-content li,
body.theme-dark .main-content td,
body.theme-dark .main-content th,
body.theme-dark .main-content dt,
body.theme-dark .main-content dd,
body.theme-dark .main-content label,
body.theme-dark .main-content legend,
body.theme-dark .main-content figcaption,
body.theme-dark .main-content blockquote,
body.theme-dark .main-content caption {
    color: #e2e8f0 !important;
}

/* Spans, strongs, smalls, ems — the most common text wrappers
   that carry hardcoded dark colors in page <style> blocks */
body.theme-dark .main-content span:not([class*="badge"]):not([class*="btn"]):not([class*="chip"]):not([class*="pill"]):not([class*="tag"]),
body.theme-dark .main-content strong,
body.theme-dark .main-content b,
body.theme-dark .main-content small:not([class*="badge"]),
body.theme-dark .main-content em,
body.theme-dark .main-content i:not([class*="fa-"]):not([class*="fas"]):not([class*="far"]):not([class*="fab"]),
body.theme-dark .main-content time,
body.theme-dark .main-content abbr {
    color: inherit !important;
}

/* Secondary text (descriptions, captions, muteds) — slightly dimmer */
body.theme-dark .main-content .text-muted,
body.theme-dark .main-content [class*="-muted"],
body.theme-dark .main-content [class*="-submeta"],
body.theme-dark .main-content [class*="-label"]:not([class*="btn"]),
body.theme-dark .main-content [class*="-hint"],
body.theme-dark .main-content [class*="-desc"],
body.theme-dark .main-content [class*="-subtitle"],
body.theme-dark .main-content [class*="-secondary"],
body.theme-dark .main-content [class*="-caption"],
body.theme-dark .main-content [class*="-meta"] {
    color: #94a3b8 !important;
}

/* Divs inside cards/panels — catch intermediate wrappers with dark text */
body.theme-dark .main-content [class*="-card"] div,
body.theme-dark .main-content [class*="-panel"] div,
body.theme-dark .main-content [class*="-box"]:not([class*="checkbox"]) div,
body.theme-dark .main-content [class*="-dialog"] div,
body.theme-dark .main-content [class*="-section"] div,
body.theme-dark .main-content [class*="-modal"] div {
    color: #e2e8f0 !important;
}

/* Links inside main-content (not buttons/badges) */
body.theme-dark .main-content a:not([class*="btn"]):not([class*="badge"]):not([class*="nav-"]):not(.page-header a) {
    color: #93ba1f !important;
}

/* Inline style dark text colors — attribute selectors */
body.theme-dark .main-content [style*="color:#0f172a"],
body.theme-dark .main-content [style*="color: #0f172a"],
body.theme-dark .main-content [style*="color:#1e293b"],
body.theme-dark .main-content [style*="color: #1e293b"],
body.theme-dark .main-content [style*="color:#334155"],
body.theme-dark .main-content [style*="color: #334155"],
body.theme-dark .main-content [style*="color:#475569"],
body.theme-dark .main-content [style*="color: #475569"],
body.theme-dark .main-content [style*="color:#1c1917"],
body.theme-dark .main-content [style*="color: #1c1917"],
body.theme-dark .main-content [style*="color:#44403c"],
body.theme-dark .main-content [style*="color: #44403c"],
body.theme-dark .main-content [style*="color:#57534e"],
body.theme-dark .main-content [style*="color: #57534e"],
body.theme-dark .main-content [style*="color:#78716c"],
body.theme-dark .main-content [style*="color: #78716c"],
body.theme-dark .main-content [style*="color:#000"],
body.theme-dark .main-content [style*="color: #000"],
body.theme-dark .main-content [style*="color:#111"],
body.theme-dark .main-content [style*="color:#222"],
body.theme-dark .main-content [style*="color:#333"],
body.theme-dark .main-content [style*="color:black"],
body.theme-dark .main-content [style*="color: black"] {
    color: #e2e8f0 !important;
}

/* Inline muted text colors → map to dark-mode muted */
body.theme-dark .main-content [style*="color:#64748b"],
body.theme-dark .main-content [style*="color: #64748b"],
body.theme-dark .main-content [style*="color:#94a3b8"],
body.theme-dark .main-content [style*="color: #94a3b8"],
body.theme-dark .main-content [style*="color:#9ca3af"],
body.theme-dark .main-content [style*="color: #9ca3af"],
body.theme-dark .main-content [style*="color:#6b7280"],
body.theme-dark .main-content [style*="color: #6b7280"],
body.theme-dark .main-content [style*="color:#a1a1aa"],
body.theme-dark .main-content [style*="color: #a1a1aa"],
body.theme-dark .main-content [style*="color:gray"],
body.theme-dark .main-content [style*="color: gray"],
body.theme-dark .main-content [style*="color:grey"],
body.theme-dark .main-content [style*="color: grey"] {
    color: #94a3b8 !important;
}

/* Also cover sidebar text if it goes dark */
body.theme-dark .sidebar-wrapper,
body.theme-dark .sidebar-wrapper span,
body.theme-dark .sidebar-wrapper a,
body.theme-dark .sidebar-wrapper li {
    color: #e2e8f0 !important;
}

/* Servicios sidebar text */
body.theme-dark .sb-sidebar,
body.theme-dark .sb-sidebar span,
body.theme-dark .sb-sidebar a,
body.theme-dark .sb-sidebar li {
    color: #e2e8f0 !important;
}

/* .alert-soft variants */
body.theme-dark .alert-soft.ok { background: rgba(147,186,31,.1) !important; color: #93ba1f !important; border-color: rgba(147,186,31,.25) !important; }
body.theme-dark .alert-soft.warn { background: rgba(245,158,11,.1) !important; color: #fbbf24 !important; border-color: rgba(245,158,11,.25) !important; }

/* Cotización pipeline (cpip) flow rail */
body.theme-dark .cpip-line { background: #1e2433 !important; border-color: #2d3548 !important; }

/* General buttons with light bg */
body.theme-dark .main-content button[style*="background:#f1f5f9"],
body.theme-dark .main-content a[style*="background:#f1f5f9"],
body.theme-dark .main-content [style*="background: #f1f5f9"] {
    background: #252b3d !important;
}

/* Modal containers with inline white */
body.theme-dark [style*="background: white"][style*="border-radius"] {
    background: #1a1f2e !important;
    border-color: #2d3548 !important;
    color: #e2e8f0 !important;
}

/* Inline border-bottom and border-top light colors */
body.theme-dark .main-content [style*="border-bottom: 1px solid #f"],
body.theme-dark .main-content [style*="border-top: 1px solid #e"],
body.theme-dark .main-content [style*="border:1px solid #f"],
body.theme-dark .main-content [style*="border: 1px solid #f"] {
    border-color: #2d3548 !important;
}

/* Ensure form fields inside any card/dialog use dark bg */
body.theme-dark .main-content [class*="-card"] input,
body.theme-dark .main-content [class*="-card"] select,
body.theme-dark .main-content [class*="-card"] textarea,
body.theme-dark .main-content [class*="-dialog"] input,
body.theme-dark .main-content [class*="-dialog"] select {
    background: #1e2433 !important;
    border-color: #2d3548 !important;
    color: #e2e8f0 !important;
}

/* Ensure links inside dark cards are visible */
body.theme-dark .main-content [class*="-card"] a:not([class*="btn"]):not([class*="badge"]) {
    color: #93ba1f !important;
}

/* ═══════════════════════════════════════════
   17. NUCLEAR BROAD — more wildcard class patterns
   ═══════════════════════════════════════════ */

/* .card (sin prefijo de guión — errores_reportados, etc.) */
body.theme-dark .main-content > .card,
body.theme-dark .main-content .card:not(.page-header *):not([class*="stat-icon"]) {
    background: #1a1f2e !important;
    border-color: #2d3548 !important;
    color: #e2e8f0 !important;
}

/* -box pattern: modal-box, rep-box, box, confirm-box, etc. */
body.theme-dark .main-content [class*="-box"]:not([class*="checkbox"]):not([class*="flexbox"]),
body.theme-dark .main-content > .box {
    background: #1a1f2e !important;
    border-color: #2d3548 !important;
    color: #e2e8f0 !important;
}

/* -modal pattern: cred-modal, etc. */
body.theme-dark .main-content [class*="-modal"]:not([class*="-modal-"]) {
    background: #1a1f2e !important;
    border-color: #2d3548 !important;
    color: #e2e8f0 !important;
}

/* -section pattern: mir-section, etc. */
body.theme-dark .main-content [class*="-section"]:not(.hero-section) {
    background: #1a1f2e !important;
    border-color: #2d3548 !important;
}

/* -body pattern inside main-content: int-body, card-body, etc. */
body.theme-dark .main-content [class*="-body"]:not(body) {
    background: #1a1f2e !important;
}

/* Generic light bg buttons: -btn, btn-add-item, btn-cfdi-cancel */
body.theme-dark .main-content .btn-add-item { background: #1e2433 !important; border-color: #2d3548 !important; color: #94a3b8 !important; }
body.theme-dark .main-content .btn-cfdi-cancel { background: #1e2433 !important; border-color: #2d3548 !important; color: #94a3b8 !important; }

/* -container pattern: results-container */
body.theme-dark .main-content [class*="-container"]:not(.swal2-container) {
    background: #1a1f2e !important;
}

/* ═══════════════════════════════════════════
   18. CUENTAS POR COBRAR — .cxc-* family
   ═══════════════════════════════════════════ */

body.theme-dark .cxc-schedule { background: #1a1f2e !important; border-color: #2d3548 !important; }
body.theme-dark .cxc-month { background: #1a1f2e !important; border-color: #2d3548 !important; color: #e2e8f0 !important; }
body.theme-dark .cxc-modal-box { background: #1a1f2e !important; color: #e2e8f0 !important; }
body.theme-dark .cxc-btn-cancel { background: #252b3d !important; border-color: #2d3548 !important; color: #94a3b8 !important; }
body.theme-dark .cxc-confirm-box { background: #1a1f2e !important; color: #e2e8f0 !important; }
body.theme-dark .cxc-confirm-cancel { background: #252b3d !important; border-color: #2d3548 !important; color: #94a3b8 !important; }
body.theme-dark .cxc-sel-bar { background: #141824 !important; border-top-color: #93ba1f !important; color: #e2e8f0 !important; }
body.theme-dark .cxc-sel-clear { background: #252b3d !important; border-color: #2d3548 !important; color: #94a3b8 !important; }

/* ═══════════════════════════════════════════
   19. CRÉDITO CLIENTES — .cred-*
   ═══════════════════════════════════════════ */

body.theme-dark .cred-btn { background: #1e2433 !important; border-color: #2d3548 !important; color: #94a3b8 !important; }
body.theme-dark .cred-modal { background: #1a1f2e !important; color: #e2e8f0 !important; }

/* ═══════════════════════════════════════════
   20. FACTURAS — .fx-* family
   ═══════════════════════════════════════════ */

body.theme-dark .fx-btn-icon { background: #252b3d !important; border-color: #2d3548 !important; color: #94a3b8 !important; }
body.theme-dark .fx-chip { background: #252b3d !important; border-color: #2d3548 !important; color: #94a3b8 !important; }
body.theme-dark .fx-chip:hover,
body.theme-dark .fx-chip.active { background: rgba(147,186,31,.15) !important; border-color: #93ba1f !important; color: #93ba1f !important; }

/* ═══════════════════════════════════════════
   21. MÓDULO CUENTA — .mcu-* family
   ═══════════════════════════════════════════ */

body.theme-dark .mcu-panel-head { background: #1e2433 !important; border-color: #2d3548 !important; color: #94a3b8 !important; }
body.theme-dark .mcu-actions { background: #1e2433 !important; border-color: #2d3548 !important; }
body.theme-dark .mcu-btn-ghost { background: #252b3d !important; border-color: #2d3548 !important; color: #94a3b8 !important; }
body.theme-dark .mcu-cp-detail { background: #1e2433 !important; border-color: #2d3548 !important; color: #e2e8f0 !important; }
body.theme-dark .mcu-client-suggestions { background: #1a1f2e !important; border-color: #2d3548 !important; }
body.theme-dark .mcu-client-suggestions-head { background: #1e2433 !important; border-color: #2d3548 !important; color: #64748b !important; }
body.theme-dark .mcu-client-option:hover { background: #252b3d !important; }
body.theme-dark .mcu-client-option.is-debt { background: rgba(245,158,11,.08) !important; }
body.theme-dark .mcu-filterbar { background: #1a1f2e !important; border-color: #2d3548 !important; color: #e2e8f0 !important; }
body.theme-dark .mcu-advance-apply { background: #1e2433 !important; border-color: #2d3548 !important; }

/* ═══════════════════════════════════════════
   22. CARTAS DE PORTE — .ctp-*
   ═══════════════════════════════════════════ */

body.theme-dark .ctp-btn-mini { background: #252b3d !important; border-color: #2d3548 !important; color: #94a3b8 !important; }

/* ═══════════════════════════════════════════
   23. VALIDACIÓN ACUSES — .va-*
   ═══════════════════════════════════════════ */

body.theme-dark .va-card { background: #1a1f2e !important; border-color: #2d3548 !important; color: #e2e8f0 !important; }
body.theme-dark .va-panel { background: #1a1f2e !important; color: #e2e8f0 !important; }
body.theme-dark .va-btn.no { background: rgba(185,28,28,.12) !important; color: #f87171 !important; border-color: rgba(185,28,28,.3) !important; }
body.theme-dark .va-train__step.is-ok .va-train__ico { background: rgba(147,186,31,.15) !important; color: #93ba1f !important; }
body.theme-dark .va-train__step.is-miss .va-train__ico { background: rgba(234,88,12,.12) !important; color: #fb923c !important; }

/* ═══════════════════════════════════════════
   24. VIÁTICOS FÓRMULA — .vf-*
   ═══════════════════════════════════════════ */

body.theme-dark .vf-card { background: #1a1f2e !important; border-color: #2d3548 !important; }
body.theme-dark .vf-formula { background: #1e2433 !important; border-color: #2d3548 !important; color: #94a3b8 !important; }
body.theme-dark .vf-pill-pd { background: rgba(234,88,12,.12) !important; border-color: rgba(234,88,12,.3) !important; color: #fb923c !important; }
body.theme-dark .vf-table tr.pd-row-dirty { background: rgba(245,158,11,.08) !important; }
body.theme-dark .pd-counter { background: rgba(234,88,12,.12) !important; border-color: rgba(234,88,12,.3) !important; color: #fb923c !important; }

/* ═══════════════════════════════════════════
   25. ÁREAS CATÁLOGO — .ac-*
   ═══════════════════════════════════════════ */

body.theme-dark .ac-card { background: #1a1f2e !important; border-color: #2d3548 !important; }

/* ═══════════════════════════════════════════
   26. INTERESADOS — .int-*
   ═══════════════════════════════════════════ */

body.theme-dark .int-body { background: #1a1f2e !important; }

/* ═══════════════════════════════════════════
   27. MIR (Nueva Cotización) — .mir-*
   ═══════════════════════════════════════════ */

body.theme-dark .mir-hero {
    background: linear-gradient(180deg,#0f1a0a,#121a0e) !important;
    border-color: #2d5a1a !important;
}
body.theme-dark .mir-section {
    background: #1a1f2e !important;
    border-color: #2d3548 !important;
    color: #e2e8f0 !important;
    box-shadow: 0 20px 40px -30px rgba(0,0,0,.4) !important;
}
body.theme-dark .mir-section h2,
body.theme-dark .mir-section h3 { color: #e2e8f0 !important; }
body.theme-dark .mir-section p { color: #94a3b8 !important; }
body.theme-dark .mir-section label { color: #94a3b8 !important; }
body.theme-dark .mir-field input,
body.theme-dark .mir-field select {
    background: #252b3d !important;
    color: #e2e8f0 !important;
    border-color: #2d3548 !important;
}
body.theme-dark .mir-field input:focus,
body.theme-dark .mir-field select:focus {
    border-color: #93BA1F !important;
    box-shadow: 0 0 0 3px rgba(147,186,31,.15) !important;
}
body.theme-dark .mir-price {
    background: #1e2a0a !important;
    border-color: #2d5a1a !important;
    color: #e2e8f0 !important;
}
body.theme-dark .mir-catalogo-nuevo {
    background: #1e2536 !important;
    border-color: #2d3548 !important;
}
body.theme-dark .mir-warn {
    background: rgba(245,158,11,.1) !important;
    border-color: rgba(245,158,11,.25) !important;
    color: #fbbf24 !important;
}

/* Override inline green backgrounds (#f0fdf4, #dcfce7, #bbf7d0, #86efac) */
body.theme-dark [style*="f0fdf4"],
body.theme-dark [style*="dcfce7"] {
    background: #1e2a0a !important;
    border-color: #2d5a1a !important;
}
body.theme-dark [style*="bbf7d0"] { border-color: #2d5a1a !important; }
body.theme-dark [style*="86efac"] { border-color: #2d5a1a !important; }
body.theme-dark [style*="f8fafc"] {
    background: #1e2536 !important;
    border-color: #2d3548 !important;
}
body.theme-dark [style*="fffbeb"],
body.theme-dark [style*="fef3c7"],
body.theme-dark [style*="fde68a"] {
    background: #2a2510 !important;
    border-color: #554a1a !important;
}

/* Autocomplete dropdown */
body.theme-dark [id="empresa-ac"],
body.theme-dark .autocomplete-dropdown {
    background: #1e2536 !important;
    border-color: #2d3548 !important;
    color: #e2e8f0 !important;
}
body.theme-dark [id="empresa-ac"] > div:hover {
    background: #252b3d !important;
}

/* ═══════════════════════════════════════════
   28. ASIGNAR SERVICIO — filter-card, results-container
   ═══════════════════════════════════════════ */

body.theme-dark .filter-card { background: #1a1f2e !important; border-color: #2d3548 !important; }
body.theme-dark .results-container { background: #1a1f2e !important; border-color: #2d3548 !important; }

/* ═══════════════════════════════════════════
   29. EDITAR COTIZACIÓN — .cpip--page
   ═══════════════════════════════════════════ */

body.theme-dark .cpip--page { background: #1a1f2e !important; border-color: #2d3548 !important; }

/* ═══════════════════════════════════════════
   30. SIDEBAR REPORTAR — .rep-box
   ═══════════════════════════════════════════ */

body.theme-dark .rep-box { background: #1a1f2e !important; color: #e2e8f0 !important; }
body.theme-dark .rep-box .rep-cancel { background: #252b3d !important; color: #94a3b8 !important; border-color: #2d3548 !important; }
body.theme-dark .rep-box .rep-cancel:hover { background: #2d3548 !important; color: #e2e8f0 !important; }
body.theme-dark .rep-box textarea { background: #1e2433 !important; border-color: #2d3548 !important; color: #e2e8f0 !important; }
body.theme-dark .rep-box textarea::placeholder { color: #64748b !important; }
body.theme-dark .rep-box p { color: #94a3b8 !important; }
body.theme-dark .rep-box h3,
body.theme-dark .rep-box strong { color: #e2e8f0 !important; }

/* Modal de reportar error del sidebar interno (inline styles) */
body.theme-dark [style*="background:#fff"][style*="border-radius:14px"][style*="max-width:440px"] {
    background: #1a1f2e !important;
    color: #e2e8f0 !important;
}
body.theme-dark [style*="background:#f5f4ee"] {
    background: #252b3d !important;
    color: #94a3b8 !important;
}
body.theme-dark #re-int-cancel {
    background: #252b3d !important;
    color: #94a3b8 !important;
}

/* Botón hamburguesa mobile (sidebar interno) */
body.theme-dark .global-mobile-toggle {
    background: #1e2433 !important;
    border-color: #2d3548 !important;
    color: #e2e8f0 !important;
}
body.theme-dark .global-mobile-toggle:hover {
    background: #252b3d !important;
}

/* ═══════════════════════════════════════════
   31. CATCH-ALL FINAL: inline style backgrounds
   Covers remaining inline style="background:#fff" etc.
   ═══════════════════════════════════════════ */

body.theme-dark .main-content [style*="background:#fff"],
body.theme-dark .main-content [style*="background: #fff"],
body.theme-dark .main-content [style*="background:white"],
body.theme-dark .main-content [style*="background: white"],
body.theme-dark .main-content [style*="background:#fcfdf"],
body.theme-dark .main-content [style*="background:#fafaf"],
body.theme-dark .main-content [style*="background:#f8f"],
body.theme-dark .main-content [style*="background: #f8f"],
body.theme-dark .main-content [style*="background:#f1f5f9"],
body.theme-dark .main-content [style*="background: #f1f5f9"],
body.theme-dark .main-content [style*="background:#fafafa"],
body.theme-dark .main-content [style*="background: #fafafa"],
body.theme-dark .main-content [style*="background:#f8fafc"],
body.theme-dark .main-content [style*="background: #f8fafc"] {
    background: #1a1f2e !important;
    border-color: #2d3548 !important;
    color: #e2e8f0 !important;
}

/* Inline light gray borders */
body.theme-dark .main-content [style*="border:1px solid #e"],
body.theme-dark .main-content [style*="border: 1px solid #e"],
body.theme-dark .main-content [style*="border:1px solid #d"],
body.theme-dark .main-content [style*="border: 1px solid #d"],
body.theme-dark .main-content [style*="border:1px solid #c"],
body.theme-dark .main-content [style*="border: 1px solid #c"],
body.theme-dark .main-content [style*="border:1.5px solid #e"],
body.theme-dark .main-content [style*="border:1.5px solid #d"],
body.theme-dark .main-content [style*="border:1.5px solid #c"] {
    border-color: #2d3548 !important;
}

/* Inline forms with white bg */
body.theme-dark .main-content form[style*="background:#fff"],
body.theme-dark .main-content form[style*="background: #fff"],
body.theme-dark .main-content form[style*="background:white"],
body.theme-dark .main-content form[style*="background: white"] {
    background: #1a1f2e !important;
    border-color: #2d3548 !important;
}

/* SweetAlert2 overrides for page-specific modals */
body.theme-dark .swal2-popup { background: #1a1f2e !important; color: #e2e8f0 !important; }
body.theme-dark .swal2-actions { background: transparent !important; }
body.theme-dark .swal2-title { color: #e2e8f0 !important; }
body.theme-dark .swal2-html-container { color: #94a3b8 !important; }
body.theme-dark .swal2-input { background: #1e2433 !important; border-color: #2d3548 !important; color: #e2e8f0 !important; }
body.theme-dark .swal2-close { color: #64748b !important; }
body.theme-dark .swal2-close:hover { color: #e2e8f0 !important; }

/* Stat-icon backgrounds on ordenes.php (amber/green/blue semantic) — keep colored */
body.theme-dark .stat-card .stat-icon { opacity: .85; }

/* Ensure page-header stays green gradient */
body.theme-dark .page-header { background: linear-gradient(135deg, #93BA1F 0%, #7A9619 100%) !important; }

/* Tables without class prefix (generic <table> inside main-content) */
body.theme-dark .main-content table:not([class]) thead th,
body.theme-dark .main-content table:not([class]) th {
    background: #1e2433 !important;
    color: #94a3b8 !important;
    border-color: #2d3548 !important;
}
body.theme-dark .main-content table:not([class]) tbody td,
body.theme-dark .main-content table:not([class]) td {
    background: #1a1f2e !important;
    color: #e2e8f0 !important;
    border-color: #2d3548 !important;
}
body.theme-dark .main-content table:not([class]) tbody tr:hover td {
    background: #252b3d !important;
}

/* Scrollbar styling for dark mode */
body.theme-dark ::-webkit-scrollbar { width: 8px; height: 8px; }
body.theme-dark ::-webkit-scrollbar-track { background: #0f1219; }
body.theme-dark ::-webkit-scrollbar-thumb { background: #2d3548; border-radius: 4px; }
body.theme-dark ::-webkit-scrollbar-thumb:hover { background: #3d4560; }

/* ═══════════════════════════════════════════
   32. DASHBOARD FLUJO SERVICIOS — .flujo-*
   ═══════════════════════════════════════════ */

body.theme-dark .flujo-hero { background: #1a1f2e !important; border-color: #2d3548 !important; border-left-color: #93ba1f !important; }
body.theme-dark .flujo-kpi__item { background: #1a1f2e !important; border-color: #2d3548 !important; }
body.theme-dark .flujo-stat-card { background: #1a1f2e !important; border-color: #2d3548 !important; }
body.theme-dark .flujo-panel { background: #1a1f2e !important; border-color: #2d3548 !important; }
body.theme-dark .flujo-tabs__link:hover { background: #252b3d !important; }
body.theme-dark .flujo-tabs__link.active { background: #1a1f2e !important; color: #93ba1f !important; }
body.theme-dark .btn-assign { background: #252b3d !important; border-color: #2d3548 !important; color: #94a3b8 !important; }
body.theme-dark .flujo-link { color: #93ba1f !important; }
body.theme-dark .flujo-link:hover { color: #a6d024 !important; }
body.theme-dark .flujo-link-box { background: #1e2433 !important; }
body.theme-dark .flujo-hero h1 { color: #e2e8f0 !important; }
body.theme-dark .flujo-hero__lead { color: #94a3b8 !important; }
body.theme-dark .flujo-kpi__label { color: #94a3b8 !important; }
body.theme-dark .flujo-kpi__value { color: #e2e8f0 !important; }
body.theme-dark {
    --flujo-brand-pale: #1e2536;
    --flujo-brand-glow: rgba(147,186,31,.1);
    --premium-green-light: #1e2536;
}
body.theme-dark .flujo-table thead th { background: #252b3d !important; color: #94a3b8 !important; }
body.theme-dark .flujo-table tbody td { color: #e2e8f0 !important; }
body.theme-dark .flujo-table tbody tr:hover td { background: #252b3d !important; }

/* ═══════════════════════════════════════════
   33. CEMGI-MODERN.CSS overrides
   (sidebar-logo, cards from sistema interno)
   ═══════════════════════════════════════════ */

body.theme-dark .sidebar-logo { background: transparent !important; }

/* ═══════════════════════════════════════════
   34. SISTEMA INTERNO — páginas raíz
   (almacen_*, base_conocimiento, licencias,
    clasificacion, crm, dashboard_superadmin, etc.)
   ═══════════════════════════════════════════ */

/* Almacén */
body.theme-dark .reg-topbar { background: #1a1f2e !important; border-color: #2d3548 !important; }
body.theme-dark .scan-card { background: #1a1f2e !important; border-color: #2d3548 !important; }
body.theme-dark .slot { background: #1a1f2e !important; border-color: #2d3548 !important; color: #e2e8f0 !important; }
body.theme-dark .panel-cart { background: #1a1f2e !important; border-color: #2d3548 !important; }
body.theme-dark .barcode-card { background: #1a1f2e !important; }
body.theme-dark .btn-back { background: #252b3d !important; border-color: #2d3548 !important; color: #94a3b8 !important; }
body.theme-dark .btn-outline { background: #252b3d !important; border-color: #2d3548 !important; color: #94a3b8 !important; }
body.theme-dark .qty-unit-select { background: #1e2433 !important; border-color: #2d3548 !important; color: #e2e8f0 !important; }

/* Plantilla / Builder */
body.theme-dark .palette { background: #1a1f2e !important; border-color: #2d3548 !important; }
body.theme-dark .page-canvas { background: #1e2433 !important; border-color: #2d3548 !important; }
body.theme-dark .props-panel { background: #1a1f2e !important; border-color: #2d3548 !important; }
body.theme-dark .ct-secondary { background: #252b3d !important; border-color: #2d3548 !important; color: #94a3b8 !important; }
body.theme-dark .ct-danger { background: rgba(220,38,38,.12) !important; border-color: rgba(220,38,38,.3) !important; color: #f87171 !important; }
body.theme-dark .bc-btn { background: #252b3d !important; border-color: #2d3548 !important; color: #94a3b8 !important; }

/* Base de conocimiento / Licencias */
body.theme-dark .btn-o { background: #252b3d !important; border-color: rgba(147,186,31,.3) !important; color: #93ba1f !important; }
body.theme-dark .cat-sidebar { background: #1a1f2e !important; border-color: #2d3548 !important; }
body.theme-dark .art-card { background: #1a1f2e !important; border-color: #2d3548 !important; }
body.theme-dark .m-dlg { background: #1a1f2e !important; color: #e2e8f0 !important; }
body.theme-dark .read-dlg { background: #1a1f2e !important; color: #e2e8f0 !important; }
body.theme-dark .sc { background: #1a1f2e !important; border-color: #2d3548 !important; }
body.theme-dark .lic-card { background: #1a1f2e !important; border-color: #2d3548 !important; }

/* Clasificación */
body.theme-dark .mc { background: #1a1f2e !important; border-color: #2d3548 !important; }
body.theme-dark .btn-mir.secondary { background: #252b3d !important; border-color: #2d3548 !important; color: #94a3b8 !important; }
body.theme-dark .info-card { background: #1a1f2e !important; border-color: #2d3548 !important; }
body.theme-dark .class-card { background: #1a1f2e !important; border-color: #2d3548 !important; }

/* CRM */
body.theme-dark .module-header { background: #1a1f2e !important; color: #e2e8f0 !important; }
body.theme-dark .tab.active { background: #1a1f2e !important; color: #93ba1f !important; }

/* Dashboard superadmin */
body.theme-dark .metric-card { background: #1a1f2e !important; border-color: #2d3548 !important; }

/* Facturas timbradas */
body.theme-dark .ft-table-card { background: #1a1f2e !important; border-color: #2d3548 !important; }
body.theme-dark .ft-btn-pdf { background: rgba(225,29,72,.12) !important; color: #f87171 !important; }

/* Eco tickets mobile */
body.theme-dark .badge-alta { background: rgba(234,88,12,.12) !important; color: #fb923c !important; }

/* CRM clientes */
body.theme-dark .page { background: #1a1f2e !important; border-color: #2d3548 !important; color: #e2e8f0 !important; }

/* Clientes servicios — sede-chip */
body.theme-dark .sede-chip { background: #252b3d !important; border-color: #2d3548 !important; color: #60a5fa !important; }

/* Containers / importar */
body.theme-dark .container:not(.swal2-container) { background: #1a1f2e !important; }

/* Loading card */
body.theme-dark .loading-card { background: #1a1f2e !important; color: #e2e8f0 !important; }

/* Analytics Nexus */
body.theme-dark .nx-app-header { background: #141824 !important; }

/* ═══════════════════════════════════════════
   35. CEMGI-BUILDER.CSS overrides
   ═══════════════════════════════════════════ */

body.theme-dark .builder-main,
body.theme-dark .builder-sidebar,
body.theme-dark .builder-panel,
body.theme-dark .builder-toolbar {
    background: #1a1f2e !important;
    border-color: #2d3548 !important;
    color: #e2e8f0 !important;
}

/* ═══════════════════════════════════════════
   36. GLOBAL BACKGROUND — body + html
   ═══════════════════════════════════════════ */

body.theme-dark {
    background: #0f1219 !important;
    color: #e2e8f0 !important;
}
body.theme-dark .main-content {
    background: #0f1219 !important;
}

/* Ensure sidebar stays dark regardless */
body.theme-dark .sidebar-wrapper {
    background: #0f1219 !important;
}

/* Footer */
body.theme-dark footer,
body.theme-dark .footer {
    background: #0f1219 !important;
    border-color: #2d3548 !important;
    color: #64748b !important;
}

/* Generic selects, inputs and textareas outside cards */
body.theme-dark .main-content select,
body.theme-dark .main-content input:not([type="checkbox"]):not([type="radio"]):not([type="submit"]):not([type="button"]):not([type="hidden"]):not(.js-theme-toggle *),
body.theme-dark .main-content textarea {
    background: #1e2433 !important;
    border-color: #2d3548 !important;
    color: #e2e8f0 !important;
}
body.theme-dark .main-content input::placeholder,
body.theme-dark .main-content textarea::placeholder {
    color: #64748b !important;
}

/* Generic tables with .table (Bootstrap) */
body.theme-dark .main-content .table > thead > tr > th,
body.theme-dark .main-content .table > thead th {
    background: #1e2433 !important;
    color: #94a3b8 !important;
    border-color: #2d3548 !important;
}
body.theme-dark .main-content .table > tbody > tr > td,
body.theme-dark .main-content .table td {
    background: #1a1f2e !important;
    color: #e2e8f0 !important;
    border-color: #2d3548 !important;
}
body.theme-dark .main-content .table > tbody > tr:hover > td {
    background: #252b3d !important;
}
body.theme-dark .main-content .table-striped > tbody > tr:nth-of-type(odd) > td {
    background: #161b28 !important;
}

/* Pagination */
body.theme-dark .pagination > li > a,
body.theme-dark .pagination > li > span {
    background: #1a1f2e !important;
    border-color: #2d3548 !important;
    color: #94a3b8 !important;
}
body.theme-dark .pagination > .active > a,
body.theme-dark .pagination > .active > span {
    background: #93ba1f !important;
    border-color: #93ba1f !important;
    color: #fff !important;
}

/* Dropdowns */
body.theme-dark .dropdown-menu {
    background: #1a1f2e !important;
    border-color: #2d3548 !important;
}
body.theme-dark .dropdown-menu > li > a {
    color: #e2e8f0 !important;
}
body.theme-dark .dropdown-menu > li > a:hover {
    background: #252b3d !important;
}

/* Tooltips */
body.theme-dark .tooltip-inner {
    background: #252b3d !important;
    color: #e2e8f0 !important;
}

/* Breadcrumb */
body.theme-dark .breadcrumb {
    background: transparent !important;
}

/* Alerts */
body.theme-dark .alert-info { background: rgba(59,130,246,.12) !important; border-color: rgba(59,130,246,.25) !important; color: #60a5fa !important; }
body.theme-dark .alert-success { background: rgba(147,186,31,.12) !important; border-color: rgba(147,186,31,.25) !important; color: #93ba1f !important; }
body.theme-dark .alert-warning { background: rgba(245,158,11,.12) !important; border-color: rgba(245,158,11,.25) !important; color: #fbbf24 !important; }
body.theme-dark .alert-danger { background: rgba(220,38,38,.12) !important; border-color: rgba(220,38,38,.25) !important; color: #f87171 !important; }

/* Well / panel (Bootstrap 3) */
body.theme-dark .well { background: #1a1f2e !important; border-color: #2d3548 !important; color: #e2e8f0 !important; }
body.theme-dark .panel { background: #1a1f2e !important; border-color: #2d3548 !important; }
body.theme-dark .panel-heading { background: #1e2433 !important; border-color: #2d3548 !important; color: #e2e8f0 !important; }
body.theme-dark .panel-body { background: #1a1f2e !important; color: #e2e8f0 !important; }
body.theme-dark .panel-footer { background: #141824 !important; border-color: #2d3548 !important; }

/* List groups */
body.theme-dark .list-group-item { background: #1a1f2e !important; border-color: #2d3548 !important; color: #e2e8f0 !important; }
body.theme-dark .list-group-item:hover { background: #252b3d !important; }

/* Nav tabs (Bootstrap) */
body.theme-dark .nav-tabs { border-color: #2d3548 !important; }
body.theme-dark .nav-tabs > li > a { color: #94a3b8 !important; }
body.theme-dark .nav-tabs > li > a:hover { background: #252b3d !important; border-color: #2d3548 !important; }
body.theme-dark .nav-tabs > li.active > a { background: #1a1f2e !important; border-color: #2d3548 !important; border-bottom-color: #1a1f2e !important; color: #e2e8f0 !important; }

/* Tab content */
body.theme-dark .tab-content { background: #1a1f2e !important; }

/* Hr */
body.theme-dark hr { border-color: #2d3548 !important; }

/* Pre/code */
body.theme-dark pre { background: #141824 !important; border-color: #2d3548 !important; color: #e2e8f0 !important; }
body.theme-dark code { background: #1e2433 !important; color: #93ba1f !important; }

/* ═══════════════════════════════════════════
   37. ULTIMA LÍNEA DE DEFENSA — fuerza texto claro
   en TODO el body, excepto elementos con color semántico.
   Este bloque va al final para máxima prioridad.
   ═══════════════════════════════════════════ */

/* Nuclear wildcard: todo elemento hereda color claro
   EXCEPTO los que tienen color semántico propio (badges, alerts, btns con color,
   page-header, elementos con color inline verde/rojo/amarillo/blanco). */
body.theme-dark *:not(.page-header):not(.page-header *):not([class*="badge-"]):not([class*="alert-"]):not([style*="color:#93BA1F"]):not([style*="color:#7A9619"]):not([style*="color:#dc2626"]):not([style*="color:#e11d48"]):not([style*="color:#f59e0b"]):not([style*="color:#d97706"]):not([style*="color:white"]):not([style*="color:#fff"]):not([style*="color:#15803d"]):not([style*="color:#4ade80"]):not([style*="color:#ef4444"]):not([style*="color:#f87171"]):not([style*="color:#60a5fa"]):not([style*="color:#fbbf24"]):not([style*="color:#fb923c"]):not([class*="text-success"]):not([class*="text-danger"]):not([class*="text-warning"]):not([class*="text-info"]):not([class*="text-primary"]):not([class*="fa-"]):not([class*="fas "]):not([class*="far "]):not([class*="fab "]) {
    color: #e2e8f0;
}

/* Re-state muted elements to be slightly dimmer */
body.theme-dark .text-muted,
body.theme-dark [class*="-muted"],
body.theme-dark [class*="-submeta"],
body.theme-dark [class*="-hint"],
body.theme-dark [class*="-desc"],
body.theme-dark [class*="-meta"]:not([class*="meta-"]) {
    color: #94a3b8 !important;
}

/* Re-state semantic colors so the wildcard doesn't wash them out */
body.theme-dark .badge-act { color: #4ade80 !important; }
body.theme-dark .badge-pro { color: #fb923c !important; }
body.theme-dark .badge-alta { color: #fb923c !important; }
body.theme-dark .badge-canceled { color: #f87171 !important; }
body.theme-dark .badge-pending { color: #fbbf24 !important; }
body.theme-dark .text-success { color: #4ade80 !important; }
body.theme-dark .text-danger { color: #f87171 !important; }
body.theme-dark .text-warning { color: #fbbf24 !important; }
body.theme-dark .text-info { color: #60a5fa !important; }
body.theme-dark .text-primary { color: #93ba1f !important; }

/* Ensure page-header text stays white */
body.theme-dark .page-header,
body.theme-dark .page-header * { color: #fff !important; }

/* ═══════════════════════════════════════════
   SISTEMA INTERNO — Dark overrides
   sidebar-v3, header-modern, páginas internas
   ═══════════════════════════════════════════ */

/* ── 37. SIDEBAR v3 ── */
body.theme-dark {
    --sv3-bg:          #1a1f2e;
    --sv3-border:      #2d3548;
    --sv3-hover-bg:    #252b3d;
    --sv3-active-bg:   #252b3d;
    --sv3-text:        #e2e8f0;
    --sv3-muted:       #94a3b8;
    --sv3-light:       #64748b;
}
body.theme-dark .sidebar {
    background: #1a1f2e !important;
    border-right-color: #2d3548 !important;
    box-shadow: 2px 0 12px rgba(0,0,0,.25) !important;
}
body.theme-dark .sidebar::before { background: none !important; }
body.theme-dark .sidebar .sidebar-header {
    background: #1a1f2e !important;
    border-bottom-color: #2d3548 !important;
}
body.theme-dark .sidebar .sidebar-title {
    color: #e2e8f0 !important;
    -webkit-text-fill-color: #e2e8f0 !important;
}
body.theme-dark .sidebar-brand-avatar { background: #93BA1F !important; }
body.theme-dark .sidebar .sidebar-toggle {
    border-color: #2d3548 !important;
    color: #94a3b8 !important;
}
body.theme-dark .sidebar .sidebar-toggle:hover {
    background: #252b3d !important;
    color: #e2e8f0 !important;
}
body.theme-dark .sidebar.collapsed .sidebar-toggle {
    background: #1a1f2e !important;
    border-color: #2d3548 !important;
    box-shadow: 0 2px 8px rgba(0,0,0,.3) !important;
}
body.theme-dark .sidebar .sidebar-search input {
    background: #252b3d !important;
    color: #e2e8f0 !important;
    border-color: transparent !important;
}
body.theme-dark .sidebar .sidebar-search input:focus {
    background: #1e2536 !important;
    border-color: #3d4f66 !important;
}
body.theme-dark .sidebar .sidebar-search input::placeholder { color: #64748b !important; }
body.theme-dark .search-shortcut {
    background: #252b3d !important;
    border-color: #2d3548 !important;
    color: #64748b !important;
}
body.theme-dark .sidebar .nav-item { color: #e2e8f0 !important; }
body.theme-dark .sidebar .nav-item:hover { background: #252b3d !important; }
body.theme-dark .sidebar .nav-item.active {
    background: #252b3d !important;
    color: #e2e8f0 !important;
}
body.theme-dark .sidebar .nav-item i { color: #94a3b8 !important; }
body.theme-dark .sidebar .nav-item:hover i,
body.theme-dark .sidebar .nav-item.active i { color: #93BA1F !important; }
body.theme-dark .sidebar .nav-section-header > div { color: #94a3b8 !important; }
body.theme-dark .sidebar .nav-section-header:hover { background: #252b3d !important; }
body.theme-dark .sidebar .sidebar-user-info {
    background: #252b3d !important;
    border-color: #2d3548 !important;
}
body.theme-dark .sidebar .user-name { color: #e2e8f0 !important; }
body.theme-dark .user-email { color: #94a3b8 !important; }
body.theme-dark .sidebar .sidebar-footer { border-top-color: #2d3548 !important; }
body.theme-dark .sidebar-status-bar { border-top-color: #2d3548 !important; }
body.theme-dark .sidebar-uptime { color: #94a3b8 !important; }
body.theme-dark .version-badge {
    background: #252b3d !important;
    color: #94a3b8 !important;
}
body.theme-dark .dot-sep { color: #3d4f66 !important; }
body.theme-dark .novedades-link { color: #64748b !important; }
body.theme-dark .sidebar .sidebar-logout-btn {
    color: #f87171 !important;
    background: rgba(239,68,68,.1) !important;
}
body.theme-dark .sidebar .sidebar-logout-btn:hover {
    background: rgba(239,68,68,.18) !important;
}

/* ── 38. SIDEBAR ULTRA MODERN overrides ── */
body.theme-dark {
    --sidebar-bg-start: rgba(26,31,46,.98);
    --sidebar-bg-end: rgba(15,18,25,.95);
    --glass-bg: rgba(255,255,255,.03);
    --glass-border: rgba(255,255,255,.06);
    --glass-border-hover: rgba(255,255,255,.12);
    --text-primary: #e2e8f0;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    --shadow-soft: 0 8px 32px rgba(0,0,0,.3);
}

/* ── 39. HEADER MODERN ── */
body.theme-dark .header {
    background: #1a1f2e !important;
    box-shadow: 0 2px 8px rgba(0,0,0,.25) !important;
}
body.theme-dark .header-left h1 { color: #e2e8f0 !important; }
body.theme-dark .menu-toggle {
    background: #1a1f2e !important;
    color: #e2e8f0 !important;
    box-shadow: 0 4px 15px rgba(0,0,0,.3) !important;
}
body.theme-dark .notification-icon {
    background: #252b3d !important;
    color: #94a3b8 !important;
}
body.theme-dark .notification-icon:hover {
    background: #93BA1F !important;
    color: #fff !important;
}
body.theme-dark .user-info:hover { background: #252b3d !important; }
body.theme-dark .user-name { color: #e2e8f0 !important; }
body.theme-dark .user-role { color: #94a3b8 !important; }
body.theme-dark .user-dropdown {
    background: #1e2536 !important;
    box-shadow: 0 8px 32px rgba(0,0,0,.35) !important;
}
body.theme-dark .user-dropdown a { color: #e2e8f0 !important; }
body.theme-dark .user-dropdown a:hover {
    background: #252b3d !important;
    color: #93BA1F !important;
}
body.theme-dark .user-dropdown .dropdown-divider { background: #2d3548 !important; }
body.theme-dark .breadcrumbs { color: #94a3b8 !important; }
body.theme-dark .breadcrumbs a { color: #94a3b8 !important; }
body.theme-dark .breadcrumbs .current { color: #e2e8f0 !important; }

/* ── 40. TICKETS (tickets.css) ── */
body.theme-dark .tickets-hero { background: rgba(15,23,42,0.75) !important; border-color: rgba(255,255,255,0.08) !important; }
body.theme-dark .stats-grid-tk { background: transparent !important; }
body.theme-dark .stat-tk {
    background: #1a1f2e !important;
    border-color: #2d3548 !important;
    box-shadow: 0 4px 16px rgba(0,0,0,.25) !important;
}
body.theme-dark .stat-tk::before { opacity: .7; }
body.theme-dark .stat-tk:hover { box-shadow: 0 8px 24px rgba(0,0,0,.35) !important; }
body.theme-dark .stat-tk .label { color: #94a3b8 !important; }
body.theme-dark .stat-tk .value { color: #e2e8f0 !important; }
body.theme-dark .tk-toolbar {
    background: #1a1f2e !important;
    border-color: #2d3548 !important;
    box-shadow: 0 4px 16px rgba(0,0,0,.2) !important;
}
body.theme-dark .tk-toolbar-top strong { color: #e2e8f0 !important; }
body.theme-dark .tk-toolbar-hint { color: #64748b !important; }
body.theme-dark .filters-tk { background: transparent !important; }
body.theme-dark .filter-tk label { color: #94a3b8 !important; }
body.theme-dark .filter-tk select,
body.theme-dark .filter-tk input {
    background: #252b3d !important;
    color: #e2e8f0 !important;
    border-color: #2d3548 !important;
}
body.theme-dark .filter-tk input::placeholder { color: #64748b !important; }
body.theme-dark .filter-tk input:focus,
body.theme-dark .filter-tk select:focus {
    border-color: #93BA1F !important;
    box-shadow: 0 0 0 3px rgba(147,186,31,.15) !important;
}
body.theme-dark .btn-tk-secondary {
    background: #252b3d !important;
    color: #e2e8f0 !important;
    border-color: #2d3548 !important;
}
body.theme-dark .btn-tk-secondary:hover { background: #2d3548 !important; }
body.theme-dark .btn-tickets-primary {
    box-shadow: 0 4px 12px rgba(147,186,31,.25) !important;
}
body.theme-dark .table-card-tk {
    background: #1a1f2e !important;
    border-color: #2d3548 !important;
    box-shadow: 0 4px 16px rgba(0,0,0,.25) !important;
}
body.theme-dark .tk-card-head {
    background: linear-gradient(180deg,#1e293b,#1a1f2e) !important;
    border-bottom-color: #2d3548 !important;
}
body.theme-dark .tk-card-head strong { color: #f1f5f9 !important; }
body.theme-dark .tk-card-head-meta { color: #64748b !important; }
body.theme-dark .tk-live-pill { background: rgba(147,186,31,.15) !important; color: #93BA1F !important; }
body.theme-dark .tickets-table-inner { background: #1a1f2e !important; }
body.theme-dark .tickets-table-inner thead th {
    background: #252b3d !important;
    color: #94a3b8 !important;
    border-bottom-color: #2d3548 !important;
}
body.theme-dark .tickets-table-inner tbody td {
    color: #e2e8f0 !important;
    border-bottom-color: #1e2536 !important;
}
body.theme-dark .tickets-table-inner tbody tr:hover td { background: #252b3d !important; }
body.theme-dark .tickets-table-inner tbody tr:nth-child(even) { background: rgba(30,41,59,.35) !important; }
body.theme-dark .tk-loading { color: #94a3b8 !important; }
body.theme-dark .tk-loading-text { color: #64748b !important; }
body.theme-dark .modal-tk-overlay { background: rgba(0,0,0,.6) !important; }
body.theme-dark .modal-tk-box {
    background: #1a1f2e !important;
    border-color: #2d3548 !important;
}
body.theme-dark .modal-tk-head { border-bottom-color: #2d3548 !important; background: #1a1f2e !important; }
body.theme-dark .modal-tk-head h2 { color: #e2e8f0 !important; }
body.theme-dark .modal-tk-close { color: #94a3b8 !important; }
body.theme-dark .modal-tk-close:hover { background: #252b3d !important; color: #e2e8f0 !important; }
body.theme-dark .modal-tk-actions { border-top-color: #2d3548 !important; }
body.theme-dark .modal-tk-actions .btn-tk-soft {
    background: #252b3d !important;
    color: #94a3b8 !important;
}
body.theme-dark .form-tk label { color: #94a3b8 !important; }
body.theme-dark .form-tk input,
body.theme-dark .form-tk select,
body.theme-dark .form-tk textarea {
    background: #252b3d !important;
    color: #e2e8f0 !important;
    border-color: #2d3548 !important;
}
body.theme-dark #tk-captura-completa {
    background: #1e2536 !important;
    border-color: #2d3548 !important;
}

/* ── 41. GESTIÓN DE SISTEMA (gestion-sistema.css) ── */
body.theme-dark .sg-page { background: #0f1219 !important; }
body.theme-dark .sg-header { color: #e2e8f0 !important; }
body.theme-dark .sg-tabs { border-bottom-color: #2d3548 !important; }
body.theme-dark .sg-tab {
    color: #94a3b8 !important;
    background: transparent !important;
}
body.theme-dark .sg-tab.active {
    color: #93BA1F !important;
    border-bottom-color: #93BA1F !important;
}
body.theme-dark .sg-area-card,
body.theme-dark .sg-folder-card,
body.theme-dark .sg-doc-card,
body.theme-dark .sg-upload-modal,
body.theme-dark .sg-confirm-modal,
body.theme-dark .sg-move-modal,
body.theme-dark .sg-edit-modal,
body.theme-dark .sg-viewer-sidebar,
body.theme-dark .sg-create-area-modal {
    background: #1a1f2e !important;
    border-color: #2d3548 !important;
    color: #e2e8f0 !important;
}
body.theme-dark .sg-doc-card.is-obsoleto {
    background: #1e2210 !important;
    border-left-color: #fbbf24 !important;
}
body.theme-dark .sg-area-card:hover,
body.theme-dark .sg-folder-card:hover,
body.theme-dark .sg-doc-card:hover { background: #252b3d !important; }
body.theme-dark .sg-doc-meta,
body.theme-dark .sg-folder-meta { color: #94a3b8 !important; }
body.theme-dark .sg-search-input,
body.theme-dark .sg-upload-modal input,
body.theme-dark .sg-upload-modal select,
body.theme-dark .sg-upload-modal textarea,
body.theme-dark .sg-edit-modal input,
body.theme-dark .sg-edit-modal select,
body.theme-dark .sg-edit-modal textarea,
body.theme-dark .sg-move-modal select,
body.theme-dark .sg-create-area-modal input {
    background: #252b3d !important;
    color: #e2e8f0 !important;
    border-color: #2d3548 !important;
}
body.theme-dark .sg-upload-drop {
    background: #1e2536 !important;
    border-color: #3d4f66 !important;
}
body.theme-dark .sg-viewer-overlay { background: rgba(0,0,0,.7) !important; }
body.theme-dark .sg-viewer-bar {
    background: #1a1f2e !important;
    border-bottom-color: #2d3548 !important;
}
body.theme-dark .sg-viewer-title { color: #e2e8f0 !important; }

/* ── 42. USUARIOS (usuarios.css) ── */
body.theme-dark {
    --usuarios-surface: #1a1f2e;
    --usuarios-surface-alt: #252b3d;
}
body.theme-dark .usr-page,
body.theme-dark .users-page { background: #0f1219 !important; }
body.theme-dark .usr-header h1,
body.theme-dark .users-title { color: #e2e8f0 !important; }
body.theme-dark .usr-card,
body.theme-dark .usr-modal,
body.theme-dark .usr-detail-card,
body.theme-dark .user-card,
body.theme-dark .user-modal,
body.theme-dark .user-detail-modal {
    background: #1a1f2e !important;
    border-color: #2d3548 !important;
    color: #e2e8f0 !important;
}
body.theme-dark .usr-card:hover,
body.theme-dark .user-card:hover { background: #252b3d !important; }
body.theme-dark .usr-search,
body.theme-dark .users-search,
body.theme-dark .usr-modal input,
body.theme-dark .usr-modal select,
body.theme-dark .usr-modal textarea,
body.theme-dark .user-modal input,
body.theme-dark .user-modal select,
body.theme-dark .user-modal textarea {
    background: #252b3d !important;
    color: #e2e8f0 !important;
    border-color: #2d3548 !important;
}
body.theme-dark .usr-stat,
body.theme-dark .users-stat {
    background: #1a1f2e !important;
    border-color: #2d3548 !important;
}
body.theme-dark .usr-stat h3,
body.theme-dark .users-stat h3 { color: #94a3b8 !important; }
body.theme-dark .usr-stat .value,
body.theme-dark .users-stat .value { color: #e2e8f0 !important; }
body.theme-dark .usr-table th {
    background: #252b3d !important;
    color: #94a3b8 !important;
}
body.theme-dark .usr-table td {
    color: #e2e8f0 !important;
    border-bottom-color: #1e2536 !important;
}
body.theme-dark .usr-table tr:hover td { background: #252b3d !important; }
body.theme-dark .usr-filters,
body.theme-dark .users-filters {
    background: #1a1f2e !important;
    border-color: #2d3548 !important;
}
body.theme-dark .usr-filters select,
body.theme-dark .users-filters select {
    background: #252b3d !important;
    color: #e2e8f0 !important;
    border-color: #2d3548 !important;
}

/* ── 43. OBJETIVOS (objetivos.css) ── */
body.theme-dark .obj-page { background: #0f1219 !important; }
body.theme-dark .obj-header { color: #e2e8f0 !important; }
body.theme-dark .obj-stats { background: #1a1f2e !important; border-color: #2d3548 !important; }
body.theme-dark .obj-stat { color: #e2e8f0 !important; }
body.theme-dark .obj-stat-lbl { color: #94a3b8 !important; }
body.theme-dark .obj-card,
body.theme-dark .obj-form,
body.theme-dark .obj-detail,
body.theme-dark .obj-det-content,
body.theme-dark .obj-act-card,
body.theme-dark .obj-modal,
body.theme-dark .obj-kr-card,
body.theme-dark .obj-kr-form,
body.theme-dark .obj-filter-panel,
body.theme-dark .obj-act-form,
body.theme-dark .obj-timeline-card,
body.theme-dark .obj-comment-card,
body.theme-dark .obj-hist-card {
    background: #1a1f2e !important;
    border-color: #2d3548 !important;
    color: #e2e8f0 !important;
}
body.theme-dark .obj-card:hover { background: #252b3d !important; }
body.theme-dark .obj-form input,
body.theme-dark .obj-form select,
body.theme-dark .obj-form textarea,
body.theme-dark .obj-kr-form input,
body.theme-dark .obj-kr-form select,
body.theme-dark .obj-kr-form textarea,
body.theme-dark .obj-act-form input,
body.theme-dark .obj-act-form select,
body.theme-dark .obj-act-form textarea,
body.theme-dark .obj-modal input,
body.theme-dark .obj-modal select,
body.theme-dark .obj-modal textarea,
body.theme-dark .obj-filter-panel select {
    background: #252b3d !important;
    color: #e2e8f0 !important;
    border-color: #2d3548 !important;
}
body.theme-dark .obj-empty { color: #64748b !important; }
body.theme-dark .obj-area-tag {
    background: #252b3d !important;
    color: #94a3b8 !important;
}
body.theme-dark .obj-progress-bg { background: #252b3d !important; }
body.theme-dark .obj-det-close:hover { background: #252b3d !important; color: #e2e8f0 !important; }
body.theme-dark .obj-det-overlay { background: rgba(0,0,0,.6) !important; }

/* ── 44. APROBACIONES (inline styles) ── */
body.theme-dark .aprobaciones-container { background: #0f1219 !important; }
body.theme-dark .aprobaciones-container .page-header {
    background: linear-gradient(135deg,#1a2e0a,#0f1a05) !important;
}
body.theme-dark .aprobaciones-container .stat-card {
    background: #1a1f2e !important;
    border-color: #2d3548 !important;
}
body.theme-dark .aprobaciones-container .stat-card h3,
body.theme-dark .aprobaciones-container .stat-card .label { color: #94a3b8 !important; }
body.theme-dark .aprobaciones-container .stat-card .value { color: #e2e8f0 !important; }
body.theme-dark .aprobaciones-container .filtros {
    background: #1a1f2e !important;
    border-color: #2d3548 !important;
}
body.theme-dark .aprobaciones-container .filtros h3 { color: #e2e8f0 !important; }
body.theme-dark .aprobaciones-container .user-info-card {
    background: #1e2536 !important;
    border-color: #2d3548 !important;
}
body.theme-dark .aprobaciones-container .user-info-item { color: #e2e8f0 !important; }
body.theme-dark .aprobaciones-container .user-info-item strong { color: #94a3b8 !important; }
body.theme-dark .aprobaciones-container .formulario-card {
    background: #1a1f2e !important;
    border-color: #2d3548 !important;
}
body.theme-dark .aprobaciones-container .formulario-card:hover { background: #252b3d !important; }
body.theme-dark .aprobaciones-container .formulario-titulo { color: #e2e8f0 !important; }
body.theme-dark .aprobaciones-container .formulario-info {
    background: #1e2536 !important;
    border-color: #2d3548 !important;
}
body.theme-dark .aprobaciones-container .info-label { color: #64748b !important; }
body.theme-dark .aprobaciones-container .info-value { color: #e2e8f0 !important; }
body.theme-dark .aprobaciones-container .form-group select,
body.theme-dark .aprobaciones-container .form-group input,
body.theme-dark .aprobaciones-container .form-group textarea {
    background: #252b3d !important;
    color: #e2e8f0 !important;
    border-color: #2d3548 !important;
}
body.theme-dark .aprobaciones-container .modal-content {
    background: #1a1f2e !important;
    color: #e2e8f0 !important;
}
body.theme-dark .aprobaciones-container .modal-header { border-bottom-color: #2d3548 !important; }
body.theme-dark .aprobaciones-container .modal-header h3 { color: #e2e8f0 !important; }
body.theme-dark .aprobaciones-container .btn-ver {
    background: #252b3d !important;
    color: #e2e8f0 !important;
    border-color: #2d3548 !important;
}
body.theme-dark .aprobaciones-container .btn-cancelar { color: #94a3b8 !important; }
body.theme-dark .aprobaciones-container .acciones { border-top-color: #2d3548 !important; }

/* ── 45. MONITOREO (inline styles) ── */
body.theme-dark .mon-card {
    background: #1a1f2e !important;
    border-color: #2d3548 !important;
}
body.theme-dark .mon-card h2 { color: #e2e8f0 !important; }
body.theme-dark .mon-card p.hint { color: #64748b !important; }
body.theme-dark .mon-field label { color: #94a3b8 !important; }
body.theme-dark .mon-field input,
body.theme-dark .mon-field select {
    background: #252b3d !important;
    color: #e2e8f0 !important;
    border-color: #2d3548 !important;
}
body.theme-dark .mon-check {
    background: #1e2536 !important;
    border-color: #2d3548 !important;
}
body.theme-dark .mon-check label { color: #e2e8f0 !important; }
body.theme-dark .mon-check:hover { background: #252b3d !important; }
body.theme-dark .mon-table-wrap { border-color: #2d3548 !important; }
body.theme-dark .mon-table th {
    background: #252b3d !important;
    color: #94a3b8 !important;
    border-bottom-color: #2d3548 !important;
}
body.theme-dark .mon-table td {
    color: #e2e8f0 !important;
    border-bottom-color: #1e2536 !important;
}
body.theme-dark .mon-table tr:hover td { background: #252b3d !important; }
body.theme-dark .btn-editar-tramo {
    background: #252b3d !important;
    color: #e2e8f0 !important;
    border-color: #2d3548 !important;
}
body.theme-dark .samsara-tramo { background: #1e2536 !important; border-color: #2d3548 !important; }
body.theme-dark .samsara-alerta { background: #2a1f0e !important; color: #fbbf24 !important; }
body.theme-dark .tm-block { background: #2a2510 !important; border-color: #554a1a !important; }
body.theme-dark .badge-samsara { background: #1e2a0a !important; color: #93BA1F !important; }
body.theme-dark .badge-pendiente { background: #2a2510 !important; color: #fbbf24 !important; }

/* ── 46. REPORTES (inline styles) ── */
body.theme-dark .rep-wrap { background: #0f1219 !important; }
body.theme-dark .rep-stat {
    background: #1a1f2e !important;
    border-color: #2d3548 !important;
}
body.theme-dark .rep-filters a {
    background: #252b3d !important;
    color: #94a3b8 !important;
}
body.theme-dark .rep-filters a.active {
    background: #93BA1F !important;
    color: #fff !important;
}
body.theme-dark .rep-card {
    background: #1a1f2e !important;
    border-color: #2d3548 !important;
}
body.theme-dark .rep-card:hover { background: #252b3d !important; }
body.theme-dark .rep-card-head .page {
    background: #252b3d !important;
    color: #94a3b8 !important;
}
body.theme-dark .rep-card-head .date { color: #64748b !important; }
body.theme-dark .rep-card-body { color: #e2e8f0 !important; }
body.theme-dark .rep-card-resp {
    background: #1e2a0a !important;
    color: #93BA1F !important;
}
body.theme-dark .rep-evidence {
    background: #1e2a0a !important;
    color: #93BA1F !important;
}
body.theme-dark .rep-empty { color: #64748b !important; }
body.theme-dark .rep-modal {
    background: #1a1f2e !important;
    color: #e2e8f0 !important;
}
body.theme-dark .rep-modal textarea {
    background: #252b3d !important;
    color: #e2e8f0 !important;
    border-color: #2d3548 !important;
}
body.theme-dark .rep-modal .b-cancel { color: #94a3b8 !important; }
body.theme-dark .rep-sec-tab {
    background: #252b3d !important;
    color: #94a3b8 !important;
}
body.theme-dark .rep-sec-tab.active {
    background: #93BA1F !important;
    color: #fff !important;
}
body.theme-dark .rep-pill.pendiente { background: #3a1515 !important; color: #f87171 !important; }
body.theme-dark .rep-pill.visto { background: #2a2510 !important; color: #fbbf24 !important; }
body.theme-dark .rep-pill.resuelto { background: #1e2a0a !important; color: #4ade80 !important; }
body.theme-dark .btn-s.vis { background: #2a2510 !important; color: #fbbf24 !important; border-color: #554a1a !important; }
body.theme-dark .btn-s.res { background: #1e2a0a !important; color: #4ade80 !important; border-color: #2d5a1a !important; }
body.theme-dark .sug-card {
    background: #1a1f2e !important;
    border-color: #2d3548 !important;
    color: #e2e8f0 !important;
}
body.theme-dark .sug-card:hover { background: #252b3d !important; }
body.theme-dark .sug-folio {
    background: #252b3d !important;
    color: #94a3b8 !important;
}
body.theme-dark .sug-card-head .sug-date { color: #64748b !important; }
body.theme-dark .sug-leida-badge { background: #1e2a0a !important; color: #4ade80 !important; }
body.theme-dark .sug-nueva-badge { background: #0a2a1e !important; color: #34d399 !important; }

/* ── 47. MAIN CONTENT background ── */
body.theme-dark .main-content { background: #0f1219 !important; }
body.theme-dark .content-area { background: #0f1219 !important; }

/* ── 48. TICKET DETALLE — inline overrides ── */
body.theme-dark .td-estado-hint {
    background: rgba(37,99,235,.15) !important;
    color: #60a5fa !important;
}
body.theme-dark .td-plantilla-opt {
    background: #1a1f2e !important;
    border-color: #2d3548 !important;
}
body.theme-dark .td-plantilla-opt:hover {
    border-color: #2563eb !important;
    background: #252b3d !important;
}
body.theme-dark .td-plantilla-icon {
    background: rgba(37,99,235,.15) !important;
}
body.theme-dark .td-plantilla-name { color: #e2e8f0 !important; }
body.theme-dark .td-plantilla-desc { color: #94a3b8 !important; }
body.theme-dark .td-plantilla-uses { color: #64748b !important; }

/* ── 49. SIDEBAR — forced-white overrides (nav-section-header i) ── */
body.theme-dark .sidebar .nav-section-header i {
    color: #94a3b8 !important;
}

/* ── 50. APROBACIONES — estado badges ── */
body.theme-dark .estado-borrador {
    background: rgba(148,163,184,.15) !important;
    color: #94a3b8 !important;
}
body.theme-dark .estado-pendiente_coordinador {
    background: rgba(59,130,246,.15) !important;
    color: #60a5fa !important;
}
body.theme-dark .estado-pendiente_subdireccion {
    background: rgba(139,92,246,.15) !important;
    color: #a78bfa !important;
}
body.theme-dark .estado-pendiente_direccion_area {
    background: rgba(245,158,11,.15) !important;
    color: #fbbf24 !important;
}
body.theme-dark .estado-pendiente_direccion_general {
    background: rgba(239,68,68,.15) !important;
    color: #f87171 !important;
}
body.theme-dark .estado-aprobado {
    background: rgba(34,197,94,.15) !important;
    color: #4ade80 !important;
}
body.theme-dark .estado-en_crm {
    background: rgba(20,184,166,.15) !important;
    color: #2dd4bf !important;
}
body.theme-dark .estado-activo {
    background: rgba(20,184,166,.15) !important;
    color: #2dd4bf !important;
}
body.theme-dark .estado-rechazado {
    background: rgba(239,68,68,.15) !important;
    color: #f87171 !important;
}
body.theme-dark .estado-requiere_cambios {
    background: rgba(245,158,11,.15) !important;
    color: #fbbf24 !important;
}
body.theme-dark .estado-en_revision {
    background: rgba(6,182,212,.15) !important;
    color: #22d3ee !important;
}

/* ── 51. MONITOREO — mensajes ok/err ── */
body.theme-dark .msg.ok  { color: #4ade80 !important; }
body.theme-dark .msg.err { color: #f87171 !important; }

/* ── 52. INLINE DARK COLORS — catch-all for #92400e, #b45309 ── */
body.theme-dark .main-content [style*="color:#92400e"],
body.theme-dark .main-content [style*="color: #92400e"] {
    color: #fbbf24 !important;
}
body.theme-dark .main-content [style*="color:#b45309"],
body.theme-dark .main-content [style*="color: #b45309"] {
    color: #f59e0b !important;
}

/* ── 53. SIDEBAR — --glass-border-hover variable ── */
body.theme-dark {
    --glass-border-hover: rgba(255,255,255,.12) !important;
}

/* ── 54. DASHBOARD SUPERADMIN (dashboard_superadmin.php) ── */
body.theme-dark .header-greeting { color: #e2e8f0 !important; }
body.theme-dark .header-subtitle { color: #94a3b8 !important; }
body.theme-dark .header-subtitle strong { color: #e2e8f0 !important; }
body.theme-dark .header-meta { color: #64748b !important; }

body.theme-dark .metric-card {
    background: #1a1f2e !important;
    box-shadow: 0 1px 3px rgba(0,0,0,.25) !important;
}
body.theme-dark .metric-label { color: #64748b !important; }
body.theme-dark .metric-value { color: #e2e8f0 !important; }

body.theme-dark .card-title { color: #e2e8f0 !important; }
body.theme-dark .pipeline-item { border-bottom-color: #2d3548 !important; }
body.theme-dark .pipeline-item-label { color: #94a3b8 !important; }
body.theme-dark .pipeline-item-value { color: #e2e8f0 !important; }

body.theme-dark .ds-struct-row {
    background: #1e2433 !important;
}
body.theme-dark .ds-struct-icon {
    background: rgba(255,255,255,.08) !important;
}
body.theme-dark .ds-struct-name { color: #e2e8f0 !important; }
body.theme-dark .ds-struct-sub  { color: #64748b !important; }
body.theme-dark .ds-struct-val  { color: #e2e8f0 !important; }

body.theme-dark .dashboard-container [style*="color:#1c1917"] { color: #e2e8f0 !important; }
body.theme-dark .dashboard-container [style*="color: #1c1917"] { color: #e2e8f0 !important; }
body.theme-dark .dashboard-container [style*="color:#78716c"] { color: #64748b !important; }
body.theme-dark .dashboard-container [style*="color: #78716c"] { color: #64748b !important; }

/* ── 55. BADGE genérico (sin modificador) ── */
body.theme-dark .main-content .badge:not([class*="badge-"]) {
    background: rgba(148,163,184,.15) !important;
    color: #94a3b8 !important;
    border-color: rgba(148,163,184,.25) !important;
}

/* ── 56. LOGIN (login_cemgi.php) ── */
body.theme-dark {
    background: #0f1219 !important;
    color: #e2e8f0 !important;
}
body.theme-dark .hero-section {
    background-color: #0f1219 !important;
    background-image: radial-gradient(#2d3548 1.5px, transparent 1.5px) !important;
    border-right-color: #2d3548 !important;
}
body.theme-dark .hero-vignette {
    background: radial-gradient(circle at center, transparent 20%, rgba(15,18,25,0.9) 100%) !important;
}
body.theme-dark .brand-badge {
    background: linear-gradient(135deg, #1a1f2e 0%, #252b3d 100%) !important;
    box-shadow: 15px 15px 40px rgba(0,0,0,.4), -15px -15px 40px rgba(30,36,51,.5), inset 0 0 0 1px rgba(255,255,255,.06) !important;
}
body.theme-dark .brand-badge:hover {
    box-shadow: 25px 25px 60px rgba(0,0,0,.5), -25px -25px 60px rgba(30,36,51,.6), inset 0 0 0 1px rgba(255,255,255,.1) !important;
}
body.theme-dark .hero-content h1 {
    background: linear-gradient(90deg, #e2e8f0 0%, #93BA1F 25%, #e2e8f0 50%, #93BA1F 75%, #e2e8f0 100%) !important;
    -webkit-background-clip: text !important;
    background-clip: text !important;
    -webkit-text-fill-color: transparent !important;
}
body.theme-dark .hero-content p {
    color: #94a3b8 !important;
}
body.theme-dark .nav-link {
    background: #1a1f2e !important;
    border-color: #2d3548 !important;
    color: #e2e8f0 !important;
    box-shadow: 0 10px 30px -10px rgba(0,0,0,.3) !important;
}
body.theme-dark .nav-link:hover {
    border-color: #93BA1F !important;
    color: #93BA1F !important;
}
body.theme-dark .login-sidebar {
    background: #1a1f2e !important;
    color: #e2e8f0 !important;
    -webkit-text-fill-color: #e2e8f0 !important;
    box-shadow: -20px 0 80px rgba(0,0,0,.3) !important;
}
body.theme-dark .login-sidebar * {
    -webkit-text-fill-color: inherit !important;
}
body.theme-dark .header-text h2 {
    color: #e2e8f0 !important;
}
body.theme-dark .header-text p {
    color: #94a3b8 !important;
}
body.theme-dark .input-float input {
    background: #252b3d !important;
    border-color: #2d3548 !important;
    color: #e2e8f0 !important;
    caret-color: #e2e8f0 !important;
}
body.theme-dark .input-float input:focus {
    background: #1e2433 !important;
    border-color: #93BA1F !important;
    box-shadow: 0 10px 20px rgba(147,186,31,.12) !important;
}
body.theme-dark .input-float label {
    color: #64748b !important;
}
body.theme-dark .input-float input:focus + label,
body.theme-dark .input-float input:not(:placeholder-shown) + label {
    color: #93BA1F !important;
}
body.theme-dark .toggle-password {
    color: #64748b !important;
}
body.theme-dark .toggle-password:hover {
    color: #93BA1F !important;
    background: rgba(147,186,31,.15) !important;
}
body.theme-dark .alert {
    background: rgba(239,68,68,.1) !important;
    border-left-color: #ef4444 !important;
    color: #f87171 !important;
    -webkit-text-fill-color: #f87171 !important;
}
body.theme-dark .version-pill {
    background: #252b3d !important;
    color: #64748b !important;
}
body.theme-dark .copyright {
    color: #64748b !important;
}
body.theme-dark .copyright strong {
    color: #94a3b8 !important;
}
body.theme-dark .copyright small {
    color: #64748b !important;
}

/* ── 57. DASHBOARD SERVICIOS TI (reportes_sistemas.php) — KPIs globales ──
   Las 4 tarjetas traen fondo pastel inline; solo Mes y Año caían en reglas
   genéricas, Hoy (#eff6ff) y Semana (#f5f3ff) quedaban blancas. */
body.theme-dark .ds-kpi {
    background: #1a1f2e !important;
    border-color: #2d3548 !important;
    box-shadow: 0 4px 16px rgba(0,0,0,.25) !important;
}
body.theme-dark .ds-kpi[style*="eff6ff"] { background: #15213a !important; border-color: #1e3a6b !important; }
body.theme-dark .ds-kpi[style*="f5f3ff"] { background: #1f1a36 !important; border-color: #3b2a6b !important; }
body.theme-dark .ds-kpi[style*="f0fdf4"] { background: #1e2a0a !important; border-color: #2d5a1a !important; }
body.theme-dark .ds-kpi[style*="fff7ed"] { background: #2a1c10 !important; border-color: #5a3314 !important; }
body.theme-dark .ds-kpi-info h3 { color: #f1f5f9 !important; }
body.theme-dark .ds-kpi-info p { color: #cbd5e1 !important; }
body.theme-dark .ds-kpi-info small { color: #94a3b8 !important; }

/* ═══════════════════════════════════════════
   Clientes (/servicios/clientes.php) — modales Nuevo / Editar cliente
   El marcado y clientes-servicios.js ponen colores claros inline;
   se sobrescriben aquí con !important.
   ═══════════════════════════════════════════ */
body.theme-dark .modal-sv .modal-content-sv,
body.theme-dark .modal-sv .modal-body-sv { background: #1a1f2e !important; color: #e2e8f0 !important; }
body.theme-dark .modal-sv .modal-footer-sv { background: #1e2433 !important; border-top-color: #2d3548 !important; }
body.theme-dark .modal-sv .btn-sv-cancel:not([style*="background"]) { background: #252b3d !important; border-color: #2d3548 !important; color: #cbd5e1 !important; }
body.theme-dark .modal-sv .btn-sv-cancel:not([style*="background"]):hover { background: #2d3548 !important; color: #f1f5f9 !important; }

/* Secciones */
body.theme-dark .modal-sv .msv-section { background: #1a1f2e !important; border-color: #2d3548 !important; }
body.theme-dark .modal-sv .msv-section-header { background: #1e2433 !important; color: #94a3b8 !important; border-bottom-color: #2d3548 !important; }
body.theme-dark .modal-sv .msv-section-header span[style*="color"] { color: #93c5fd !important; }
body.theme-dark .modal-sv .msv-section-body { background: transparent !important; }
body.theme-dark .modal-sv .msv-label { color: #cbd5e1 !important; }
body.theme-dark .modal-sv .msv-input[readonly] { background: #252b3d !important; color: #94a3b8 !important; }
body.theme-dark .modal-sv p[style*="color"] { color: #94a3b8 !important; }

/* Selector Cliente/Sede y Activo/Prospecto (JS pone fondo #fff al activo) */
body.theme-dark .modal-sv .sw-mode-selector { background: #0f1219 !important; border-color: #2d3548 !important; }
body.theme-dark .modal-sv .sw-mode-btn { background: transparent !important; color: #94a3b8 !important; box-shadow: none !important; }
body.theme-dark .modal-sv .sw-mode-btn:hover { color: #e2e8f0 !important; }
body.theme-dark .modal-sv .sw-mode-btn.active { background: #252b3d !important; color: #93BA1F !important; box-shadow: 0 1px 4px rgba(0,0,0,.35) !important; }
body.theme-dark .modal-sv #btn-tipo-prospecto.active,
body.theme-dark .modal-sv #ec-btn-tipo-prospecto.active { color: #fb923c !important; }

/* Cajas informativas con fondo claro inline */
body.theme-dark #wrap-buscador-padre { background: rgba(147,186,31,.08) !important; }
body.theme-dark #parent_search { background: #1e2433 !important; }
body.theme-dark #parent_info { background: #1e2433 !important; border-color: #2d5a1a !important; }
body.theme-dark #sede_section_info { background: #1e2433 !important; border-color: #2d3548 !important; }
body.theme-dark #sede_section_info > div { color: #e2e8f0 !important; }
body.theme-dark #wrap-nombre-sede { background: rgba(14,165,233,.08) !important; border-color: #0c4a6e !important; }
body.theme-dark #wrap-nombre-sede .msv-label,
body.theme-dark #wrap-nombre-sede p { color: #7dd3fc !important; }
body.theme-dark #ec-banner-es-hijo > div { background: rgba(147,186,31,.08) !important; border-color: #4d6b12 !important; }
body.theme-dark #ec-section-hijos .msv-section-header { background: rgba(37,99,235,.12) !important; }
body.theme-dark #ec-section-hijos p { border-bottom-color: #2d3548 !important; }
body.theme-dark #ec-sedes-form { background: #1e2433 !important; border-color: #2d3548 !important; }
body.theme-dark #ec-btn-regresar-lista,
body.theme-dark #ec-btn-nueva-sede { background: #252b3d !important; border-color: #3d4f66 !important; color: #cbd5e1 !important; }

/* Mensajes (p. ej. «Se recuperó el borrador anterior») */
body.theme-dark .modal-sv .sv-feedback[style*="eff6ff"] { background: rgba(37,99,235,.12) !important; border-color: #1e3a8a !important; color: #93c5fd !important; }

/* Contactos dinámicos (clientes-servicios.css) */
body.theme-dark .nc-bloque { background: #1e2433 !important; border-color: #2d3548 !important; }
body.theme-dark .nc-num { color: #93c5fd !important; }
body.theme-dark .nc-del { border-color: #7f1d1d !important; color: #f87171 !important; }
body.theme-dark .nc-del:hover { background: rgba(239,68,68,.12) !important; }
