/* ============================================================
   Dark Mode — Admin Panel
   Activado con [data-theme="dark"] en <html>
   ============================================================ */

[data-theme="dark"] {
    /* ── Bootstrap core tokens ── */
    --bs-body-bg:               #0f1117;
    --bs-body-color:            #a8b3c3;   /* claro pero no blanco */
    --bs-emphasis-color:        #cdd5df;
    --bs-secondary-color:       #7b8799;
    --bs-secondary-bg:          #1e2530;
    --bs-tertiary-bg:           #161b27;
    --bs-tertiary-color:        #5a6475;
    --bs-border-color:          #2a3347;
    --bs-border-color-translucent: rgba(255,255,255,.08);
    --bs-heading-color:         #cdd5df;   /* claro pero no blanco */
    --bs-link-color:            #34d399;
    --bs-link-hover-color:      #6ee7b7;
    --bs-code-color:            #f472b6;

    /* ── Cards ── */
    --bs-card-bg:               #1a2235;
    --bs-card-border-color:     #2a3347;
    --bs-card-cap-bg:           #161d30;
    --bs-card-color:            #a8b3c3;

    /* ── Tables ── */
    --bs-table-bg:              transparent;
    --bs-table-color:           #a8b3c3;
    --bs-table-border-color:    #2a3347;
    --bs-table-striped-bg:      rgba(255,255,255,.04);
    --bs-table-hover-bg:        rgba(37,171,124,.10);
    --bs-table-active-bg:       rgba(37,171,124,.15);

    /* ── Forms ── */
    --bs-form-control-bg:       #141c2e;
    --bs-form-control-border-color: #2a3347;
    --bs-input-bg:              #141c2e;
    --bs-input-border-color:    #2a3347;
    --bs-input-color:           #a8b3c3;
    --bs-input-placeholder-color: #5a6475;
    --bs-input-focus-border-color: #25ab7c;
    --bs-input-disabled-bg:     #161b27;

    /* ── Dropdowns ── */
    --bs-dropdown-bg:           #1a2235;
    --bs-dropdown-border-color: #2a3347;
    --bs-dropdown-link-color:   #a8b3c3;
    --bs-dropdown-link-hover-color: #cdd5df;
    --bs-dropdown-link-hover-bg: rgba(37,171,124,.12);
    --bs-dropdown-link-active-bg: #25ab7c;
    --bs-dropdown-link-active-color: #fff;
    --bs-dropdown-header-color: #9ca3af;
    --bs-dropdown-divider-bg:   #2d3748;

    /* ── Modals ── */
    --bs-modal-bg:              #1a2235;
    --bs-modal-border-color:    #2a3347;
    --bs-modal-header-border-color: #2a3347;
    --bs-modal-footer-border-color: #2a3347;
    --bs-modal-color:           #a8b3c3;
    --bs-modal-backdrop-bg:     #000;
    --bs-modal-backdrop-opacity: 0.7;

    /* ── Navs & Tabs ── */
    --bs-nav-tabs-border-color: #2d3748;
    --bs-nav-tabs-link-active-bg: #1e2530;
    --bs-nav-tabs-link-active-border-color: #2d3748 #2d3748 #1e2530;
    --bs-nav-tabs-link-active-color: #f9fafb;
    --bs-nav-link-color:        #9ca3af;
    --bs-nav-link-hover-color:  #25ab7c;
    --bs-nav-pills-link-active-bg: #25ab7c;

    /* ── List groups ── */
    --bs-list-group-bg:         #1e2530;
    --bs-list-group-border-color: #2d3748;
    --bs-list-group-color:      #d1d5db;
    --bs-list-group-action-color: #d1d5db;
    --bs-list-group-action-hover-bg: rgba(255,255,255,.05);
    --bs-list-group-active-bg:  #25ab7c;
    --bs-list-group-active-border-color: #25ab7c;

    /* ── Badges ── */
    --bs-badge-color:           #fff;

    /* ── Breadcrumb ── */
    --bs-breadcrumb-divider-color: #6b7280;
    --bs-breadcrumb-item-active-color: #9ca3af;

    /* ── Pagination ── */
    --bs-pagination-bg:         #1e2530;
    --bs-pagination-border-color: #2d3748;
    --bs-pagination-color:      #9ca3af;
    --bs-pagination-hover-bg:   #2d3748;
    --bs-pagination-hover-border-color: #374151;
    --bs-pagination-hover-color: #f9fafb;
    --bs-pagination-active-bg:  #25ab7c;
    --bs-pagination-active-border-color: #25ab7c;
    --bs-pagination-active-color: #fff;
    --bs-pagination-disabled-bg: #161b27;
    --bs-pagination-disabled-color: #4b5563;

    /* ── Alerts ── */
    --bs-alert-bg:              transparent;
    --bs-alert-border-color:    transparent;
    --bs-alert-color:           #d1d5db;

    /* ── Tooltips / Popovers ── */
    --bs-tooltip-bg:            #374151;
    --bs-tooltip-color:         #f9fafb;
    --bs-popover-bg:            #1e2530;
    --bs-popover-border-color:  #2d3748;
    --bs-popover-header-bg:     #161b27;
    --bs-popover-header-color:  #f9fafb;
    --bs-popover-body-color:    #d1d5db;

    /* ── Progress ── */
    --bs-progress-bg:           #2d3748;

    /* ── Spinners ── */
    --bs-spinner-border-width:  0.2em;

    /* ── Custom app tokens ── */
    --sg-body-bg-color:             #0f1117;
    --sg-table-header-bg-color:     #1a2032;
    --sg-table-border-color:        #2d3748;
    --sg-secondary:                 #9ca3af;
    --sg-light:                     #1e2530;
}

/* ── Body & root ── */
[data-theme="dark"] body {
    background-color: #0f1117;
    color: #a8b3c3;
}

/* ── Navbar (bg-white hardcoded) ── */
[data-theme="dark"] .navbar {
    background-color: #161b27 !important;
    border-bottom: 1px solid #2d3748;
    color: #d1d5db;
}
[data-theme="dark"] .navbar a,
[data-theme="dark"] .navbar .user-name,
[data-theme="dark"] .navbar .sidebar-toggler path {
    color: #a8b3c3 !important;
    stroke: #7b8799 !important;
}

/* ── Sidebar ── */
[data-theme="dark"] .header-position {
    border-inline-end-color: #1e2a3d;
}

/* ── Main content wrapper ── */
[data-theme="dark"] .main-content-wrapper {
    background-color: #0f1117;
}
[data-theme="dark"] .main-wrapper {
    background-color: #0f1117;
}

/* ── Cards ── */
[data-theme="dark"] .card {
    background-color: #1a2235 !important;
    border-color: #2a3347;
    color: #a8b3c3;
}
[data-theme="dark"] .card-header {
    background-color: #161d30;
    border-bottom-color: #2a3347;
    color: #cdd5df;
}
[data-theme="dark"] .card-footer {
    background-color: #161d30;
    border-top-color: #2a3347;
}
[data-theme="dark"] .card-title {
    color: #cdd5df;
}
[data-theme="dark"] .card-body {
    background-color: #1a2235;
}

/* ── Tables ── */
[data-theme="dark"] .table {
    color: #a8b3c3;
    border-color: #2a3347;
}
[data-theme="dark"] .table > :not(caption) > * > * {
    background-color: transparent;
    border-bottom-color: #2a3347;
    color: #a8b3c3;
}
[data-theme="dark"] .table thead th,
[data-theme="dark"] .table th {
    background-color: #161d30 !important;
    color: #7b8799;
    border-color: #2a3347;
}
[data-theme="dark"] .table-bordered > :not(caption) > * {
    border-color: #2a3347;
}
[data-theme="dark"] .table-striped > tbody > tr:nth-of-type(odd) > * {
    background-color: rgba(255,255,255,.03);
}
[data-theme="dark"] .table-hover > tbody > tr:hover > * {
    background-color: rgba(37,171,124,.08);
}
[data-theme="dark"] .dataTables_wrapper .dataTables_length,
[data-theme="dark"] .dataTables_wrapper .dataTables_filter,
[data-theme="dark"] .dataTables_wrapper .dataTables_info,
[data-theme="dark"] .dataTables_wrapper .dataTables_paginate {
    color: #9ca3af;
}
[data-theme="dark"] .dataTables_wrapper .dataTables_filter input,
[data-theme="dark"] .dataTables_wrapper .dataTables_length select {
    background-color: #1e2530;
    border-color: #374151;
    color: #d1d5db;
}
[data-theme="dark"] .dataTables_wrapper .dataTables_paginate .paginate_button {
    color: #9ca3af !important;
}
[data-theme="dark"] .dataTables_wrapper .dataTables_paginate .paginate_button.current,
[data-theme="dark"] .dataTables_wrapper .dataTables_paginate .paginate_button:hover {
    background: #25ab7c !important;
    border-color: #25ab7c !important;
    color: #fff !important;
}

/* ── Forms ── */
[data-theme="dark"] .form-control,
[data-theme="dark"] .form-select,
[data-theme="dark"] input[type="text"],
[data-theme="dark"] input[type="email"],
[data-theme="dark"] input[type="password"],
[data-theme="dark"] input[type="number"],
[data-theme="dark"] input[type="search"],
[data-theme="dark"] input[type="url"],
[data-theme="dark"] input[type="tel"],
[data-theme="dark"] textarea,
[data-theme="dark"] select {
    background-color: #141c2e;
    border-color: #2a3347;
    color: #a8b3c3;
}
[data-theme="dark"] .form-control:focus,
[data-theme="dark"] .form-select:focus {
    background-color: #141c2e;
    border-color: #25ab7c;
    color: #cdd5df;
    box-shadow: 0 0 0 .2rem rgba(37,171,124,.2);
}
[data-theme="dark"] .form-control::placeholder { color: #5a6475; }
[data-theme="dark"] .form-control:disabled,
[data-theme="dark"] .form-control[readonly] {
    background-color: #0f1420;
    color: #5a6475;
}
[data-theme="dark"] .input-group-text {
    background-color: #161d30;
    border-color: #2a3347;
    color: #7b8799;
}
[data-theme="dark"] .form-label,
[data-theme="dark"] label {
    color: #a8b3c3;
}
[data-theme="dark"] .form-text { color: #7b8799; }

/* ── Select2 ── */
[data-theme="dark"] .select2-container--default .select2-selection--single,
[data-theme="dark"] .select2-container--default .select2-selection--multiple {
    background-color: #141c2e;
    border-color: #2a3347;
    color: #a8b3c3;
}
[data-theme="dark"] .select2-container--default .select2-selection--single .select2-selection__rendered {
    color: #a8b3c3;
}
[data-theme="dark"] .select2-dropdown {
    background-color: #1a2235;
    border-color: #2a3347;
}
[data-theme="dark"] .select2-container--default .select2-results__option {
    color: #a8b3c3;
}
[data-theme="dark"] .select2-container--default .select2-results__option--highlighted[aria-selected] {
    background-color: #25ab7c;
    color: #fff;
}
[data-theme="dark"] .select2-container--default .select2-search--dropdown .select2-search__field {
    background-color: #0f1420;
    border-color: #2a3347;
    color: #a8b3c3;
}

/* ── Dropdowns ── */
[data-theme="dark"] .dropdown-menu {
    background-color: #1a2235;
    border-color: #2a3347;
    box-shadow: 0 8px 32px rgba(0,0,0,.5);
}
[data-theme="dark"] .dropdown-item {
    color: #a8b3c3;
}
[data-theme="dark"] .dropdown-item:hover,
[data-theme="dark"] .dropdown-item:focus {
    background-color: rgba(37,171,124,.12);
    color: #cdd5df;
}
[data-theme="dark"] .dropdown-item.active,
[data-theme="dark"] .dropdown-item:active {
    background-color: #25ab7c;
    color: #fff;
}
[data-theme="dark"] .dropdown-divider { border-color: #2a3347; }
[data-theme="dark"] .dropdown-header { color: #7b8799; }

/* ── Modals ── */
[data-theme="dark"] .modal-content {
    background-color: #1a2235;
    border-color: #2a3347;
    color: #a8b3c3;
}
[data-theme="dark"] .modal-header {
    border-bottom-color: #2a3347;
}
[data-theme="dark"] .modal-footer {
    border-top-color: #2a3347;
}
[data-theme="dark"] .modal-title { color: #cdd5df; }
[data-theme="dark"] .btn-close {
    filter: invert(1) grayscale(100%) brightness(200%);
}

/* ── Badges ── */
[data-theme="dark"] .badge.bg-light {
    background-color: #374151 !important;
    color: #d1d5db !important;
}
[data-theme="dark"] .badge.bg-white {
    background-color: #1e2530 !important;
    color: #d1d5db !important;
}

/* ── Alerts ── */
[data-theme="dark"] .alert-light {
    background-color: #1e2530;
    border-color: #374151;
    color: #d1d5db;
}
[data-theme="dark"] .alert-secondary {
    background-color: rgba(100,116,139,.2);
    border-color: #374151;
}

/* ── Tabs ── */
[data-theme="dark"] .nav-tabs {
    border-bottom-color: #2d3748;
}
[data-theme="dark"] .nav-tabs .nav-link {
    color: #9ca3af;
}
[data-theme="dark"] .nav-tabs .nav-link:hover {
    border-color: #2d3748;
    color: #d1d5db;
}
[data-theme="dark"] .nav-tabs .nav-link.active {
    background-color: #1e2530;
    border-color: #2d3748 #2d3748 #1e2530;
    color: #f9fafb;
}
[data-theme="dark"] .nav-pills .nav-link { color: #9ca3af; }
[data-theme="dark"] .nav-pills .nav-link.active {
    background-color: #25ab7c;
    color: #fff;
}

/* ── List groups ── */
[data-theme="dark"] .list-group-item {
    background-color: #1a2235;
    border-color: #2a3347;
    color: #a8b3c3;
}
[data-theme="dark"] .list-group-item:hover { background-color: #161d30; }
[data-theme="dark"] .list-group-item.active {
    background-color: #25ab7c;
    border-color: #25ab7c;
    color: #fff;
}

/* ── Pagination ── */
[data-theme="dark"] .page-link {
    background-color: #1e2530;
    border-color: #2d3748;
    color: #9ca3af;
}
[data-theme="dark"] .page-link:hover {
    background-color: #2d3748;
    color: #f9fafb;
}
[data-theme="dark"] .page-item.active .page-link {
    background-color: #25ab7c;
    border-color: #25ab7c;
    color: #fff;
}
[data-theme="dark"] .page-item.disabled .page-link {
    background-color: #161b27;
    color: #4b5563;
}

/* ── Breadcrumb ── */
[data-theme="dark"] .breadcrumb { background-color: transparent; }
[data-theme="dark"] .breadcrumb-item a { color: #25ab7c; }
[data-theme="dark"] .breadcrumb-item.active { color: #9ca3af; }
[data-theme="dark"] .breadcrumb-item + .breadcrumb-item::before { color: #6b7280; }

/* ── Bg-light / border utilities ── */
[data-theme="dark"] .bg-light   { background-color: #161d30 !important; }
[data-theme="dark"] .border     { border-color: #2a3347 !important; }

/* ── Utility / misc ── */
[data-theme="dark"] hr { border-color: #2d3748; opacity: 1; }
[data-theme="dark"] .shadow,
[data-theme="dark"] .shadow-sm,
[data-theme="dark"] .shadow-lg {
    box-shadow: 0 2px 16px rgba(0,0,0,.5) !important;
}

/* ── Summernote editor ── */
[data-theme="dark"] .note-editor.note-frame {
    border-color: #374151;
}
[data-theme="dark"] .note-editor .note-toolbar {
    background-color: #1a2032;
    border-bottom-color: #2d3748;
}
[data-theme="dark"] .note-editor .note-editable {
    background-color: #1e2530;
    color: #d1d5db;
}
[data-theme="dark"] .note-editor .note-statusbar {
    background-color: #1a2032;
    border-top-color: #2d3748;
}

/* ── Nestable / sortable ── */
[data-theme="dark"] .dd-handle {
    background-color: #1e2530;
    border-color: #2d3748;
    color: #d1d5db;
}
[data-theme="dark"] .dd-handle:hover { background-color: #1a2032; }

/* ── Headings & text — tonos suaves, no blanco puro ── */
[data-theme="dark"] h1,[data-theme="dark"] h2,[data-theme="dark"] h3,
[data-theme="dark"] h4,[data-theme="dark"] h5,[data-theme="dark"] h6 {
    color: #cdd5df;
}
[data-theme="dark"] p { color: #a8b3c3; }
[data-theme="dark"] .text-muted  { color: #7b8799 !important; }
[data-theme="dark"] .text-dark   { color: #cdd5df !important; }
[data-theme="dark"] .text-black  { color: #cdd5df !important; }

/* ── Contenedores con bg-white hardcodeado ── */
[data-theme="dark"] .bg-white,
[data-theme="dark"] .statistics-card.bg-white,
[data-theme="dark"] .bg-body-tertiary {
    background-color: #1a2235 !important;
    color: #a8b3c3;
}

/* ── Bordes de contenedores custom — redious-border usa color hardcodeado ── */
[data-theme="dark"] .redious-border {
    border-color: #2a3347 !important;
}

/* ── Sub-tarjetas de métricas con inline styles (dashboard_multi) ──
   Usamos !important para vencer inline style="background:..." ── */

/* Verde — "Hoy" / "Matrículas de hoy" */
[data-theme="dark"] [style*="background:#f0fdf4"],
[data-theme="dark"] [style*="background: #f0fdf4"] {
    background: rgba(21,128,61,.18) !important;
    border-color: rgba(21,128,61,.35) !important;
}
/* Azul — "Esta semana" / "Matrículas de ciclos" */
[data-theme="dark"] [style*="background:#eff6ff"],
[data-theme="dark"] [style*="background: #eff6ff"] {
    background: rgba(37,99,235,.18) !important;
    border-color: rgba(37,99,235,.35) !important;
}
/* Morado — "Este mes" / "Nuevos estudiantes" */
[data-theme="dark"] [style*="background:#fdf4ff"],
[data-theme="dark"] [style*="background: #fdf4ff"] {
    background: rgba(124,58,237,.18) !important;
    border-color: rgba(124,58,237,.35) !important;
}
/* Amarillo — "Ingresos de hoy" */
[data-theme="dark"] [style*="background:#fefce8"],
[data-theme="dark"] [style*="background: #fefce8"] {
    background: rgba(217,119,6,.18) !important;
    border-color: rgba(217,119,6,.35) !important;
}
/* Teal — "Cobrado en ciclos" */
[data-theme="dark"] [style*="background:#f0fdfa"],
[data-theme="dark"] [style*="background: #f0fdfa"] {
    background: rgba(13,148,136,.18) !important;
    border-color: rgba(13,148,136,.35) !important;
}
/* Naranja — "Por vencer / vencidos" */
[data-theme="dark"] [style*="background:#fff7ed"],
[data-theme="dark"] [style*="background: #fff7ed"] {
    background: rgba(234,88,12,.18) !important;
    border-color: rgba(234,88,12,.35) !important;
}

/* ── Statistics cards ── */
[data-theme="dark"] .statistics-card {
    background-color: #1a2235 !important;
    border-color: #2a3347 !important;
}
[data-theme="dark"] .statistics-info h6,
[data-theme="dark"] .statistics-info h4 {
    color: #cdd5df;
}
[data-theme="dark"] .statistics-footer h6 { color: #7b8799; }

/* ── Section top y títulos de sección ── */
[data-theme="dark"] .section-top h4,
[data-theme="dark"] .section-title { color: #cdd5df; }

/* ── Analytics cards ── */
[data-theme="dark"] .analytics { background-color: #1a2235; }
[data-theme="dark"] .analytics .analytics-content p { color: #a8b3c3; }
[data-theme="dark"] .analytics .analytics-content h4 { color: #cdd5df; }

/* ── Notification popup border interno ── */
[data-theme="dark"] .notification .popup-card li:not(:last-child) {
    border-bottom-color: #2a3347;
}

/* ── Button defaults del admin ── */
[data-theme="dark"] .button-default {
    background-color: #1e2a3d;
    border-color: #2a3347;
    color: #a8b3c3;
}
[data-theme="dark"] .button-default:hover {
    background-color: rgba(37,171,124,.15);
    border-color: #25ab7c;
    color: #34d399;
}

/* ── Dashboard summary / sales-price ── */
[data-theme="dark"] .sales-price { color: #34d399; }

/* ── Container-fluid / secciones generales ── */
[data-theme="dark"] .oftions,
[data-theme="dark"] .main-content-wrapper > * {
    color: #a8b3c3;
}

/* ══════════════════════════════════════════════════════════════
   FINANZAS — /admin/finance, /admin/finance/receivables, /overdue
   Las clases fi-* están definidas en <style> inline de cada blade,
   por eso necesitan sus propias reglas aquí con !important donde
   compiten con inline styles o especificidad de hoja interna.
   ══════════════════════════════════════════════════════════════ */

/* ── Variable base que usan todos los finance blades ── */
[data-theme="dark"] { --fi-border: #2a3347; }

/* ── KPI cards ── */
[data-theme="dark"] .fi-kpi {
    background: #1a2235 !important;
    border-color: #2a3347 !important;
    box-shadow: 0 4px 12px rgba(0,0,0,.3) !important;
}
[data-theme="dark"] .fi-kpi:hover {
    box-shadow: 0 12px 24px -8px rgba(0,0,0,.5) !important;
}
/* Colores de texto KPI — convertir de dark-on-white a light-on-dark */
[data-theme="dark"] .fi-kpi-blue   { color: #93c5fd !important; }
[data-theme="dark"] .fi-kpi-green  { color: #6ee7b7 !important; }
[data-theme="dark"] .fi-kpi-red    { color: #fca5a5 !important; }
[data-theme="dark"] .fi-kpi-amber  { color: #fcd34d !important; }
[data-theme="dark"] .fi-kpi-purple { color: #c4b5fd !important; }

/* ── KPI pills ── */
[data-theme="dark"] .fi-kpi-pill              { background: rgba(255,255,255,.07) !important; border-color: rgba(255,255,255,.1) !important; }
[data-theme="dark"] .fi-kpi-pill-blue         { color: #93c5fd !important; background: rgba(37,99,235,.2) !important; }
[data-theme="dark"] .fi-kpi-pill-green        { color: #6ee7b7 !important; background: rgba(5,150,105,.2) !important; }
[data-theme="dark"] .fi-kpi-pill-red          { color: #fca5a5 !important; background: rgba(220,38,38,.2) !important; }
[data-theme="dark"] .fi-kpi-pill-amber        { color: #fcd34d !important; background: rgba(217,119,6,.2) !important; }
[data-theme="dark"] .fi-kpi-pill-purple       { color: #c4b5fd !important; background: rgba(124,58,237,.2) !important; }

/* ── Ciclo progress cards ── */
[data-theme="dark"] .fi-ciclo-card {
    background: #1a2235 !important;
    border-color: #2a3347 !important;
    box-shadow: 0 4px 12px rgba(0,0,0,.3) !important;
}
[data-theme="dark"] .fi-ciclo-title { color: #cdd5df !important; }
[data-theme="dark"] .fi-ciclo-tag {
    background: #253047 !important;
    color: #7b8799 !important;
}
[data-theme="dark"] .fi-ciclo-tag.has-morosos {
    background: rgba(185,28,28,.25) !important;
    color: #fca5a5 !important;
}
[data-theme="dark"] .fi-prog-bg { background: #1e2a3d !important; }
[data-theme="dark"] .fi-prog-label { color: #7b8799 !important; }
[data-theme="dark"] .fi-prog-meta { color: #5a6475 !important; }
[data-theme="dark"] .fi-section-title { color: #7b8799 !important; }

/* ── Banner alerta morosos ── */
[data-theme="dark"] .fi-alert {
    background: rgba(127,29,29,.25) !important;
    border-color: rgba(239,68,68,.3) !important;
}
[data-theme="dark"] .fi-alert .fi-alert-text { color: #fca5a5 !important; }

/* ── Botones fi-* ── */
[data-theme="dark"] .btn-fi {
    background: #1a2235 !important;
    border-color: #2a3347 !important;
    color: #a8b3c3 !important;
}
[data-theme="dark"] .btn-fi:hover {
    background: #253047 !important;
    border-color: #374759 !important;
    color: #cdd5df !important;
}
[data-theme="dark"] .btn-fi-outline {
    background: #1a2235 !important;
    border-color: #2a3347 !important;
    color: #a8b3c3 !important;
}
[data-theme="dark"] .btn-fi-outline:hover {
    background: #253047 !important;
    color: #cdd5df !important;
}
[data-theme="dark"] .btn-outline-secondary {
    background: #1a2235 !important;
    border-color: #2a3347 !important;
    color: #a8b3c3 !important;
}
[data-theme="dark"] .btn-outline-secondary:hover {
    background: #253047 !important;
    color: #cdd5df !important;
}

/* ── Panel de filtros ── */
[data-theme="dark"] .fi-filters {
    background: #1a2235 !important;
    border-color: #2a3347 !important;
}

/* ── DataTables — fondo del contenedor cuando las columnas no llenan el ancho ── */
[data-theme="dark"] .dataTables_wrapper,
[data-theme="dark"] .dataTables_scroll,
[data-theme="dark"] .dataTables_scrollBody,
[data-theme="dark"] .dataTables_scrollHead,
[data-theme="dark"] .dataTables_scrollFoot,
[data-theme="dark"] .dataTables_wrapper .dataTables_scroll div.dataTables_scrollBody {
    background: #1a2235 !important;
}
[data-theme="dark"] table.dataTable {
    background: #1a2235 !important;
}
[data-theme="dark"] .yajra-dataTable,
[data-theme="dark"] .default-list-table {
    background: #1a2235 !important;
}

/* ── DataTables Responsive — control cells & child rows ── */
[data-theme="dark"] table.dataTable tbody td.dtr-control,
[data-theme="dark"] table.dataTable tbody td.child,
[data-theme="dark"] table.dataTable tbody tr.child td,
[data-theme="dark"] table.dataTable tbody tr.child {
    background: #1a2235 !important;
    border-color: #2a3347 !important;
}
[data-theme="dark"] table.dataTable td.dtr-control::before {
    background-color: #25ab7c !important;
    box-shadow: 0 0 0 2px #1a2235 !important;
}

/* ── Tabla DataTable del finance ── */
[data-theme="dark"] table.dataTable tbody tr {
    background: #1a2235 !important;
    color: #a8b3c3;
}
[data-theme="dark"] table.dataTable tbody tr:hover {
    background: #1e2a3d !important;
    transform: translateX(4px);
}
[data-theme="dark"] table.dataTable thead th {
    background: #161d30 !important;
    color: #7b8799 !important;
    border-bottom-color: #2a3347 !important;
}

/* ── Badges de estado ── */
[data-theme="dark"] .status-paid     { background: rgba(22,101,52,.3)  !important; color: #6ee7b7 !important; }
[data-theme="dark"] .status-partial  { background: rgba(146,64,14,.3)  !important; color: #fcd34d !important; }
[data-theme="dark"] .status-overdue  { background: rgba(153,27,27,.3)  !important; color: #fca5a5 !important; }
[data-theme="dark"] .status-pending  { background: rgba(55,65,81,.4)   !important; color: #9ca3af !important; }
[data-theme="dark"] .status-cancelled{ background: rgba(75,85,99,.3)   !important; color: #6b7280 !important; }

/* ── Estadísticas de ganancias (fi-earn-stat) ── */
[data-theme="dark"] .fi-earn-stat .fi-es-label { color: #7b8799 !important; }
[data-theme="dark"] .fi-earn-stat .fi-es-value { color: #cdd5df !important; }

/* ── Tabla corporativa fi-table (overdue / receivables) ── */
[data-theme="dark"] .fi-table thead th {
    background: #161d30 !important;
    color: #7b8799 !important;
    border-bottom-color: #2a3347 !important;
}
[data-theme="dark"] .fi-table tbody td {
    color: #a8b3c3 !important;
    border-bottom-color: #1e2a3d !important;
}
[data-theme="dark"] .fi-table tbody tr:hover {
    background: #1e2a3d !important;
}

/* ── Celda de usuario ── */
[data-theme="dark"] .fi-user-avatar {
    background: linear-gradient(135deg, #1e2a4a, #253060) !important;
    color: #93c5fd !important;
}
[data-theme="dark"] .fi-user-name { color: #cdd5df !important; }
[data-theme="dark"] .fi-user-sub  { color: #7b8799 !important; }

/* ── Fecha y badge de meses ── */
[data-theme="dark"] .fi-date { color: #a8b3c3 !important; }
[data-theme="dark"] .fi-mbadge {
    background: rgba(185,28,28,.25) !important;
    color: #fca5a5 !important;
}

/* ── Monto deuda ── */
[data-theme="dark"] .fi-amount     { color: #fca5a5 !important; }
[data-theme="dark"] .fi-amount-sub { color: #5a6475 !important; }

/* ── Badges de riesgo ── */
[data-theme="dark"] .fi-risk-low  { background: rgba(4,120,87,.2)  !important; color: #6ee7b7 !important; }
[data-theme="dark"] .fi-risk-low  i { color: #34d399 !important; }
[data-theme="dark"] .fi-risk-mid  { background: rgba(180,83,9,.2)  !important; color: #fcd34d !important; }
[data-theme="dark"] .fi-risk-mid  i { color: #fbbf24 !important; }
[data-theme="dark"] .fi-risk-high { background: rgba(185,28,28,.2) !important; color: #fca5a5 !important; }
[data-theme="dark"] .fi-risk-high i { color: #f87171 !important; }

/* ── Botones de acción de fila ── */
[data-theme="dark"] .fi-act {
    background: #1a2235 !important;
    border-color: #2a3347 !important;
    color: #a8b3c3 !important;
}
[data-theme="dark"] .fi-act-view:hover {
    background: #253047 !important;
    border-color: #374759 !important;
    color: #cdd5df !important;
}
[data-theme="dark"] .fi-act-remind {
    background: rgba(180,83,9,.18) !important;
    color: #fcd34d !important;
    border-color: rgba(251,191,36,.3) !important;
}
[data-theme="dark"] .fi-act-remind:hover {
    background: rgba(180,83,9,.3) !important;
}
[data-theme="dark"] .fi-act-pay {
    background: rgba(4,120,87,.18) !important;
    color: #6ee7b7 !important;
    border-color: rgba(52,211,153,.3) !important;
}
[data-theme="dark"] .fi-act-pay:hover {
    background: rgba(4,120,87,.3) !important;
}

/* ── Estado vacío ── */
[data-theme="dark"] .fi-empty {
    background: linear-gradient(135deg, #1a2235, #161d30) !important;
}
[data-theme="dark"] .fi-empty p { color: #7b8799 !important; }

/* ── Paginación fi-pagination ── */
[data-theme="dark"] .fi-pagination .page-link {
    background: #1a2235 !important;
    border-color: #2a3347 !important;
    color: #a8b3c3 !important;
}
[data-theme="dark"] .fi-pagination .page-link:hover {
    background: #253047 !important;
    border-color: #374759 !important;
    color: #cdd5df !important;
}
[data-theme="dark"] .fi-pagination .page-item.disabled .page-link {
    background: #141c2e !important;
    color: #3d4a5c !important;
}

/* ── Label de filtros ── */
[data-theme="dark"] .filter-label { color: #7b8799 !important; }

/* ── Dot de ciclo en tabla ── */
[data-theme="dark"] .fi-cycle-dot {
    background: #1e2a4a !important;
    color: #93c5fd !important;
}

/* ══════════════════════════════════════════════════════════════
   CYCLE PAYMENTS — /admin/cycle_payments
   ══════════════════════════════════════════════════════════════ */

/* ── KPI cards (pastel → semi-transparent tint) ── */
[data-theme="dark"] .kpi-card {
    box-shadow: 0 6px 20px rgba(0,0,0,.35) !important;
}
[data-theme="dark"] .kpi-blue   { background: rgba(37,99,235,.18) !important;  color: #93c5fd !important; }
[data-theme="dark"] .kpi-green  { background: rgba(22,101,52,.18) !important;  color: #6ee7b7 !important; }
[data-theme="dark"] .kpi-amber  { background: rgba(180,83,9,.18)  !important;  color: #fcd34d !important; }
[data-theme="dark"] .kpi-red    { background: rgba(153,27,27,.2)  !important;  color: #fca5a5 !important; }
[data-theme="dark"] .kpi-purple { background: rgba(91,33,182,.2)  !important;  color: #c4b5fd !important; }
[data-theme="dark"] .kpi-teal   { background: rgba(15,118,110,.2) !important;  color: #5eead4 !important; }
[data-theme="dark"] .kpi-card .kpi-sub { color: inherit !important; opacity: .65; }

/* ── Proximity strip (Vencimientos próximos) ── */
[data-theme="dark"] .prox-card {
    background: #1a2235 !important;
    border-color: #2a3347 !important;
}
[data-theme="dark"] .prox-hoy  { border-color: rgba(252,165,165,.35) !important; }
[data-theme="dark"] .prox-hoy.active-prox  { border-color: #ef4444 !important; }
[data-theme="dark"] .prox-7    { border-color: rgba(252,211,77,.35)  !important; }
[data-theme="dark"] .prox-7.active-prox    { border-color: #f59e0b !important; }
[data-theme="dark"] .prox-15   { border-color: rgba(110,231,183,.35) !important; }
[data-theme="dark"] .prox-15.active-prox   { border-color: #10b981 !important; }
[data-theme="dark"] .prox-30   { border-color: rgba(147,197,253,.35) !important; }
[data-theme="dark"] .prox-30.active-prox   { border-color: #3b82f6 !important; }
[data-theme="dark"] .prox-info .prox-title { color: #7b8799 !important; }
[data-theme="dark"] .prox-info .prox-monto { color: #5a6475 !important; }

/* ── Alert vencen hoy ── */
[data-theme="dark"] .alert-vencen-hoy {
    background: rgba(127,29,29,.2) !important;
    border-color: rgba(252,165,165,.35) !important;
}
[data-theme="dark"] .alert-vencen-hoy .av-icon-wrap {
    background: rgba(220,38,38,.2) !important;
}
[data-theme="dark"] .alert-vencen-hoy .av-text { color: #fca5a5 !important; }
[data-theme="dark"] .alert-vencen-hoy .av-btn   { color: #f87171 !important; }

/* ── Panel de filtros (cycle_payments) ── */
[data-theme="dark"] .filters-panel {
    background: #1a2235 !important;
    border-color: #2a3347 !important;
}
[data-theme="dark"] .filters-panel .form-select,
[data-theme="dark"] .filters-panel .form-control {
    background: #161d30 !important;
    border-color: #2a3347 !important;
    color: #a8b3c3 !important;
}
[data-theme="dark"] .enrollment-pills {
    border-top-color: #2a3347 !important;
}
[data-theme="dark"] .pill-status {
    background: #1e2a3d !important;
    color: #7b8799 !important;
    border-color: #2a3347 !important;
}
[data-theme="dark"] .pill-status:hover { background: #253047 !important; color: #a8b3c3 !important; }
[data-theme="dark"] .pill-status.pill-active-all    { background: rgba(37,99,235,.2)  !important; color: #93c5fd !important; border-color: rgba(147,197,253,.4) !important; }
[data-theme="dark"] .pill-status.pill-active-green  { background: rgba(22,101,52,.2)  !important; color: #6ee7b7 !important; border-color: rgba(110,231,183,.4) !important; }
[data-theme="dark"] .pill-status.pill-active-amber  { background: rgba(180,83,9,.2)   !important; color: #fcd34d !important; border-color: rgba(252,211,77,.4)  !important; }
[data-theme="dark"] .pill-status.pill-active-red    { background: rgba(153,27,27,.2)  !important; color: #fca5a5 !important; border-color: rgba(252,165,165,.4) !important; }
[data-theme="dark"] .pill-status.pill-active-gray   { background: #253047              !important; color: #a8b3c3 !important; border-color: #374759              !important; }
[data-theme="dark"] .pill-status.pill-active-purple { background: rgba(91,33,182,.2)  !important; color: #c4b5fd !important; border-color: rgba(196,181,253,.4) !important; }

/* ── Botones de filtros ── */
[data-theme="dark"] .btn-limpiar {
    background: #1e2a3d !important;
    border-color: #2a3347 !important;
    color: #7b8799 !important;
}
[data-theme="dark"] .btn-limpiar:hover { background: #253047 !important; color: #a8b3c3 !important; }

/* ── Botón recordatorio masivo ── */
[data-theme="dark"] .btn-reminder {
    background: rgba(180,83,9,.2) !important;
    color: #fcd34d !important;
    border-color: rgba(252,211,77,.35) !important;
}
[data-theme="dark"] .btn-reminder:hover:not(:disabled) {
    background: rgba(180,83,9,.32) !important;
    border-color: rgba(252,211,77,.55) !important;
}

/* ── Bulk actions bar ── */
[data-theme="dark"] #bulkActionsBar {
    background: rgba(37,99,235,.15) !important;
    border-color: rgba(147,197,253,.3) !important;
    color: #93c5fd !important;
}
[data-theme="dark"] #bulkActionsBar .bulk-sep { background: rgba(147,197,253,.25) !important; }

/* ── Table container card ── */
[data-theme="dark"] .table-container-card {
    background: #1a2235 !important;
    border-color: #2a3347 !important;
}

/* ── Tabla custom (table-custom) ── */
[data-theme="dark"] .table-custom thead th {
    background: #161d30 !important;
    border-bottom-color: #2a3347 !important;
    color: #7b8799 !important;
}
[data-theme="dark"] .table-custom tbody td {
    border-bottom-color: #1e2a3d !important;
    color: #a8b3c3 !important;
}
[data-theme="dark"] .table-custom tbody tr:hover { background: #1e2a3d !important; }
[data-theme="dark"] .table-soft-warning > td { background-color: rgba(180,83,9,.12) !important; }

/* ── Badges custom ── */
[data-theme="dark"] .badge-success { background: rgba(22,101,52,.3)  !important; color: #6ee7b7 !important; }
[data-theme="dark"] .badge-warning { background: rgba(146,64,14,.3)  !important; color: #fcd34d !important; }
[data-theme="dark"] .badge-danger  { background: rgba(153,27,27,.3)  !important; color: #fca5a5 !important; }
[data-theme="dark"] .badge-info    { background: rgba(12,84,96,.3)   !important; color: #67e8f9 !important; }

/* ── Modal recordatorio ── */
[data-theme="dark"] .modal-header {
    background: rgba(146,64,14,.2) !important;
    border-bottom-color: rgba(251,191,36,.25) !important;
}
[data-theme="dark"] .modal-header .modal-title { color: #fcd34d !important; }
[data-theme="dark"] #reminderPreview {
    background: #161d30 !important;
    border-color: #2a3347 !important;
    color: #a8b3c3 !important;
}

/* ── Section labels ── */
[data-theme="dark"] .section-label-text { color: #5a6475 !important; }

/* ══════════════════════════════════════════════════════════════
   DETAIL ROW — _row_details.blade.php
   Todo el contenido usa inline styles, así que se usan selectores
   de atributo dentro del wrapper .subscription-details-wrapper
   ══════════════════════════════════════════════════════════════ */

/* ── Fila y celda contenedora del detalle expandido ── */
[data-theme="dark"] tr.detail-row,
[data-theme="dark"] tr.detail-row > td {
    background: #0f1117 !important;
    border-color: #2a3347 !important;
}

/* ── Wrapper principal ── */
[data-theme="dark"] .subscription-details-wrapper {
    background: #1a2235 !important;
    border-color: #2a3347 !important;
}

/* ── Fondos blancos y gris claro dentro del wrapper ── */
[data-theme="dark"] .subscription-details-wrapper [style*="background: #ffffff"],
[data-theme="dark"] .subscription-details-wrapper [style*="background:#ffffff"],
[data-theme="dark"] .subscription-details-wrapper [style*="background: white"] {
    background: #1a2235 !important;
}
[data-theme="dark"] .subscription-details-wrapper [style*="background: #f8fafc"],
[data-theme="dark"] .subscription-details-wrapper [style*="background:#f8fafc"] {
    background: #161d30 !important;
}
[data-theme="dark"] .subscription-details-wrapper [style*="background: linear-gradient(135deg, #f8fafc"] {
    background: linear-gradient(135deg, #161d30 0%, #1a2235 100%) !important;
}

/* ── Bordes claros dentro del wrapper ── */
[data-theme="dark"] .subscription-details-wrapper [style*="border-bottom: 1px solid #eef2f6"],
[data-theme="dark"] .subscription-details-wrapper [style*="border-bottom:1px solid #eef2f6"],
[data-theme="dark"] .subscription-details-wrapper [style*="border-bottom: 1px solid #f1f5f9"],
[data-theme="dark"] .subscription-details-wrapper [style*="border-bottom:1px solid #f1f5f9"] {
    border-bottom-color: #2a3347 !important;
}
[data-theme="dark"] .subscription-details-wrapper [style*="border: 1px solid #e2e8f0"],
[data-theme="dark"] .subscription-details-wrapper [style*="border:1px solid #e2e8f0"],
[data-theme="dark"] .subscription-details-wrapper [style*="border: 1px solid #eef2f6"],
[data-theme="dark"] .subscription-details-wrapper [style*="border-top:2px solid #e2e8f0"],
[data-theme="dark"] .subscription-details-wrapper [style*="border-top: 2px solid #e2e8f0"] {
    border-color: #2a3347 !important;
}

/* ── Textos oscuros → aclarar en dark mode ── */
[data-theme="dark"] .subscription-details-wrapper [style*="color: #0f172a"],
[data-theme="dark"] .subscription-details-wrapper [style*="color:#0f172a"],
[data-theme="dark"] .subscription-details-wrapper [style*="color: #1e3a8a"],
[data-theme="dark"] .subscription-details-wrapper [style*="color:#1e3a8a"] {
    color: #cdd5df !important;
}
[data-theme="dark"] .subscription-details-wrapper [style*="color: #64748b"],
[data-theme="dark"] .subscription-details-wrapper [style*="color:#64748b"],
[data-theme="dark"] .subscription-details-wrapper [style*="color: #475569"],
[data-theme="dark"] .subscription-details-wrapper [style*="color:#475569"],
[data-theme="dark"] .subscription-details-wrapper [style*="color: #94a3b8"],
[data-theme="dark"] .subscription-details-wrapper [style*="color:#94a3b8"] {
    color: #7b8799 !important;
}

/* ── Texto general strong/small dentro del wrapper ── */
[data-theme="dark"] .subscription-details-wrapper strong { color: #cdd5df; }
[data-theme="dark"] .subscription-details-wrapper small  { color: #7b8799; }

/* ── Nav tabs del detail row ── */
[data-theme="dark"] .subscription-details-wrapper .nav-tabs {
    border-bottom-color: #2a3347 !important;
}
[data-theme="dark"] .subscription-details-wrapper .nav-tabs .nav-link {
    color: #7b8799 !important;
}
[data-theme="dark"] .subscription-details-wrapper .nav-tabs .nav-link.active {
    background: #253047 !important;
    color: #cdd5df !important;
}
[data-theme="dark"] .subscription-details-wrapper .nav-tabs .nav-link:hover:not(.active) {
    background: #1e2a3d !important;
    color: #a8b3c3 !important;
}

/* ── Tabla cuotas inline ── */
[data-theme="dark"] .subscription-details-wrapper table thead tr,
[data-theme="dark"] .subscription-details-wrapper [style*="background:#f8fafc"] thead tr {
    background: #161d30 !important;
}
[data-theme="dark"] .subscription-details-wrapper table tbody tr {
    border-top-color: #1e2a3d !important;
}
[data-theme="dark"] .subscription-details-wrapper table tfoot tr {
    background: #161d30 !important;
    border-top-color: #2a3347 !important;
}

/* ── Barra de progreso track ── */
[data-theme="dark"] .subscription-details-wrapper [style*="background:#e2e8f0"],
[data-theme="dark"] .subscription-details-wrapper [style*="background: #e2e8f0"] {
    background: #2a3347 !important;
}

/* ── Botones de acción del tab "Acciones" ── */
[data-theme="dark"] .subscription-details-wrapper .btn[style*="background: #fef9e3"],
[data-theme="dark"] .subscription-details-wrapper .btn[style*="background:#fef9e3"] {
    background: rgba(180,83,9,.18) !important; color: #fcd34d !important; border-color: rgba(252,211,77,.3) !important;
}
[data-theme="dark"] .subscription-details-wrapper .btn[style*="background: #e6f7e6"],
[data-theme="dark"] .subscription-details-wrapper .btn[style*="background:#e6f7e6"] {
    background: rgba(22,101,52,.2) !important; color: #6ee7b7 !important; border-color: rgba(110,231,183,.3) !important;
}
[data-theme="dark"] .subscription-details-wrapper .btn[style*="background: #eef2ff"],
[data-theme="dark"] .subscription-details-wrapper .btn[style*="background:#eef2ff"] {
    background: rgba(37,99,235,.18) !important; color: #93c5fd !important; border-color: rgba(147,197,253,.3) !important;
}
[data-theme="dark"] .subscription-details-wrapper .btn[style*="background: #fffbeb"],
[data-theme="dark"] .subscription-details-wrapper .btn[style*="background:#fffbeb"] {
    background: rgba(180,83,9,.18) !important; color: #fcd34d !important; border-color: rgba(252,211,77,.3) !important;
}
[data-theme="dark"] .subscription-details-wrapper .btn[style*="background: #fef2f2"],
[data-theme="dark"] .subscription-details-wrapper .btn[style*="background:#fef2f2"] {
    background: rgba(153,27,27,.2) !important; color: #fca5a5 !important; border-color: rgba(252,165,165,.3) !important;
}
[data-theme="dark"] .subscription-details-wrapper .btn[style*="background: #f1f5f9"],
[data-theme="dark"] .subscription-details-wrapper .btn[style*="background:#f1f5f9"] {
    background: #1e2a3d !important; color: #a8b3c3 !important; border-color: #2a3347 !important;
}

/* ── Botón "Pagar" cuota individual ── */
[data-theme="dark"] .subscription-details-wrapper button[style*="background:#f8fafc"] {
    background: #1e2a3d !important; color: #93c5fd !important; border-color: rgba(147,197,253,.3) !important;
}

/* ── Resumen de pago (detailsSummary) ── */
[data-theme="dark"] [id^="detailsSummary_"] {
    background: #161d30 !important;
    border-color: #2a3347 !important;
}

/* ── Beca activa badge en renovar ── */
[data-theme="dark"] .subscription-details-wrapper [style*="background: #e6f7e6"] {
    background: rgba(22,101,52,.2) !important;
    border-left-color: #22c55e !important;
}

/* ── Form selects/inputs dentro del wrapper ── */
[data-theme="dark"] .subscription-details-wrapper .form-select,
[data-theme="dark"] .subscription-details-wrapper .form-control {
    background: #161d30 !important;
    border-color: #2a3347 !important;
    color: #a8b3c3 !important;
}

/* ══════════════════════════════════════════════════════════════
   ATTENDANCE — /admin/groups/{id}/attendance
   ══════════════════════════════════════════════════════════════ */

/* ── Stat chips ── */
[data-theme="dark"] .ga-chip {
    background: #1a2235 !important;
    border-color: #2a3347 !important;
}
[data-theme="dark"] .ga-chip-num   { color: #cdd5df !important; }
[data-theme="dark"] .ga-chip-label { color: #7b8799 !important; }
[data-theme="dark"] .ga-chip.total    .ga-chip-icon { background: rgba(25,136,99,.2)  !important; color: #34d399 !important; }
[data-theme="dark"] .ga-chip.presente .ga-chip-icon { background: rgba(5,150,105,.2)  !important; color: #6ee7b7 !important; }
[data-theme="dark"] .ga-chip.tardanza .ga-chip-icon { background: rgba(180,83,9,.2)   !important; color: #fcd34d !important; }
[data-theme="dark"] .ga-chip.ausente  .ga-chip-icon { background: rgba(220,38,38,.2)  !important; color: #fca5a5 !important; }

/* ── Badge puntualidad ── */
[data-theme="dark"] .ga-badge.on  { background: rgba(14,116,144,.2) !important; color: #67e8f9 !important; }
[data-theme="dark"] .ga-badge.off { background: #1e2a3d              !important; color: #7b8799  !important; }

/* ── Quick action buttons ── */
[data-theme="dark"] .ga-quick-btn {
    background: #1a2235 !important;
    border-color: #2a3347 !important;
    color: #a8b3c3 !important;
}
[data-theme="dark"] .ga-quick-btn:hover { background: #253047 !important; border-color: #374759 !important; }
[data-theme="dark"] .ga-quick-btn.primary {
    background: rgba(4,120,87,.18) !important;
    border-color: rgba(52,211,153,.3) !important;
    color: #6ee7b7 !important;
}
[data-theme="dark"] .ga-quick-btn.primary:hover { background: rgba(4,120,87,.28) !important; }

/* ── Student cards ── */
[data-theme="dark"] .ga-card {
    background: #1a2235 !important;
    border-color: #2a3347 !important;
}
[data-theme="dark"] .ga-card:hover { border-color: #374759 !important; }
[data-theme="dark"] .ga-name { color: #cdd5df !important; }
[data-theme="dark"] .ga-doc  { color: #7b8799  !important; }

/* ── Segmented control ── */
[data-theme="dark"] .ga-segment {
    background: #161d30 !important;
}
[data-theme="dark"] .ga-seg-btn { color: #7b8799 !important; }
[data-theme="dark"] .ga-seg-btn:hover { color: #a8b3c3 !important; }

/* ── Empty state & skeleton ── */
[data-theme="dark"] .ga-empty {
    background: #1a2235 !important;
    border-color: #2a3347 !important;
    color: #7b8799 !important;
}
[data-theme="dark"] .ga-empty i { color: #374759 !important; }
[data-theme="dark"] .ga-skel-card {
    background: #1a2235 !important;
    border-color: #2a3347 !important;
}
[data-theme="dark"] .ga-skel-circle,
[data-theme="dark"] .ga-skel-line { background: #253047 !important; }

/* ══════════════════════════════════════════════════════════════
   WHATSAPP — /admin/whatsapp
   Las variables --gray-* y --kpi-* están en el <style> del blade
   y no se pueden sobreescribir vía :root, así que van por clase.
   ══════════════════════════════════════════════════════════════ */

/* ── Page header ── */
[data-theme="dark"] .wa-header-title { color: #cdd5df !important; }
[data-theme="dark"] .wa-header-sub   { color: #7b8799 !important; }

/* ── Connection pill ── */
[data-theme="dark"] .wa-conn-pill.connected     { background: rgba(22,101,52,.2)   !important; color: #6ee7b7 !important; border-color: rgba(110,231,183,.3) !important; }
[data-theme="dark"] .wa-conn-pill.disconnected,
[data-theme="dark"] .wa-conn-pill.not_created   { background: #1e2a3d               !important; color: #7b8799 !important; border-color: #2a3347              !important; }
[data-theme="dark"] .wa-conn-pill.qr_ready,
[data-theme="dark"] .wa-conn-pill.connecting,
[data-theme="dark"] .wa-conn-pill.reconnecting  { background: rgba(180,83,9,.2)    !important; color: #fcd34d !important; border-color: rgba(252,211,77,.35)  !important; }
[data-theme="dark"] .wa-conn-pill.error         { background: rgba(153,27,27,.2)   !important; color: #fca5a5 !important; border-color: rgba(252,165,165,.3)  !important; }

/* ── Tabs ── */
[data-theme="dark"] .wa-tabs { border-bottom-color: #2a3347 !important; }
[data-theme="dark"] .wa-tab-btn { color: #7b8799 !important; }
[data-theme="dark"] .wa-tab-btn:hover { color: #34d399 !important; background: rgba(37,171,124,.08) !important; }
[data-theme="dark"] .wa-tab-btn.active { color: #34d399 !important; }

/* ── Generic cards ── */
[data-theme="dark"] .wa-card { background: #1a2235 !important; border-color: #2a3347 !important; }
[data-theme="dark"] .wa-card-header { background: #161d30 !important; border-bottom-color: #2a3347 !important; }
[data-theme="dark"] .wa-card-title { color: #a8b3c3 !important; }

/* ── Alert banners ── */
[data-theme="dark"] .wa-alert-success { background: rgba(22,101,52,.2)   !important; color: #6ee7b7 !important; border-color: rgba(110,231,183,.3) !important; }
[data-theme="dark"] .wa-alert-warning { background: rgba(180,83,9,.2)    !important; color: #fcd34d !important; border-color: rgba(252,211,77,.3)  !important; }
[data-theme="dark"] .wa-alert-danger  { background: rgba(153,27,27,.2)   !important; color: #fca5a5 !important; border-color: rgba(252,165,165,.3) !important; }
[data-theme="dark"] .wa-alert-info    { background: rgba(37,99,235,.18)  !important; color: #93c5fd !important; border-color: rgba(147,197,253,.3) !important; }

/* ── Tables ── */
[data-theme="dark"] .wa-table thead th { background: #161d30 !important; border-bottom-color: #2a3347 !important; color: #7b8799 !important; }
[data-theme="dark"] .wa-table tbody td { border-bottom-color: #1e2a3d !important; color: #a8b3c3 !important; }
[data-theme="dark"] .wa-table tbody tr:hover td { background: #1e2a3d !important; }

/* ── Activity feed ── */
[data-theme="dark"] .activity-item { border-bottom-color: #2a3347 !important; }
[data-theme="dark"] .activity-name { color: #cdd5df !important; }
[data-theme="dark"] .activity-msg  { color: #7b8799 !important; }
[data-theme="dark"] .activity-time { color: #4b5563 !important; }

/* ── Queue mini stat ── */
[data-theme="dark"] .queue-mini { border-color: #2a3347 !important; }
[data-theme="dark"] .queue-mini-item { border-right-color: #2a3347 !important; }
[data-theme="dark"] .queue-mini-item .q-val   { color: #cdd5df !important; }
[data-theme="dark"] .queue-mini-item .q-label { color: #7b8799 !important; }

/* ── Progress bar ── */
[data-theme="dark"] .wa-progress { background: #253047 !important; }

/* ── Donut ── */
[data-theme="dark"] .wa-donut-center { color: #cdd5df !important; }
[data-theme="dark"] .wa-donut-center span { color: #7b8799 !important; }
[data-theme="dark"] .donut-legend-item { color: #a8b3c3 !important; }

/* ── Automation rows ── */
[data-theme="dark"] .auto-row  { border-bottom-color: #2a3347 !important; }
[data-theme="dark"] .auto-name { color: #cdd5df !important; }
[data-theme="dark"] .auto-desc { color: #7b8799 !important; }
[data-theme="dark"] .wa-toggle { background: #374151 !important; }
[data-theme="dark"] .wa-toggle.on { background: var(--wa-green) !important; }

/* ── Badges wa-* ── */
[data-theme="dark"] .badge-wa-connected    { background: rgba(22,101,52,.2)   !important; color: #6ee7b7 !important; }
[data-theme="dark"] .badge-wa-disconnected { background: #1e2a3d               !important; color: #7b8799 !important; }
[data-theme="dark"] .badge-wa-pending      { background: rgba(180,83,9,.2)    !important; color: #fcd34d !important; }
[data-theme="dark"] .badge-wa-sent        { background: rgba(37,99,235,.2)    !important; color: #93c5fd !important; }
[data-theme="dark"] .badge-wa-delivered   { background: rgba(15,118,110,.2)   !important; color: #5eead4 !important; }
[data-theme="dark"] .badge-wa-read        { background: rgba(22,101,52,.2)    !important; color: #6ee7b7 !important; }
[data-theme="dark"] .badge-wa-error       { background: rgba(153,27,27,.2)    !important; color: #fca5a5 !important; }
[data-theme="dark"] .badge-wa-running     { background: rgba(22,101,52,.2)    !important; color: #6ee7b7 !important; }
[data-theme="dark"] .badge-wa-scheduled   { background: rgba(91,33,182,.2)    !important; color: #c4b5fd !important; }
[data-theme="dark"] .badge-wa-paused      { background: rgba(180,83,9,.2)     !important; color: #fcd34d !important; }

/* ── Logs ── */
[data-theme="dark"] .log-entry { border-bottom-color: #2a3347 !important; }
[data-theme="dark"] .log-time  { color: #7b8799 !important; }
[data-theme="dark"] .log-msg   { color: #a8b3c3 !important; }
[data-theme="dark"] .log-event { color: #34d399 !important; }
[data-theme="dark"] .log-level.debug { color: #4b5563 !important; }

/* ── Dark mode toggle button ── */
.dark-mode-toggle {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    transition: background .2s;
    color: #7e7f92;
    font-size: 20px;
    text-decoration: none;
}
.dark-mode-toggle:hover {
    background: rgba(37,171,124,.12);
    color: #25ab7c;
}
[data-theme="dark"] .dark-mode-toggle {
    color: #fbbf24;
}
[data-theme="dark"] .dark-mode-toggle:hover {
    background: rgba(251,191,36,.12);
    color: #fcd34d;
}

/* ══════════════════════════════════════════════════════════════
   LISTADOS (default-list-table) — filas, celdas de usuario,
   switch de estado y acciones. Aplica a /admin/students y demás
   listados que comparten estos componentes.
   ══════════════════════════════════════════════════════════════ */
[data-theme="dark"] .default-list-table .table { background: #1a2235; }
[data-theme="dark"] .default-list-table .table tbody tr:nth-of-type(odd)  { background: rgba(255,255,255,.03); }
[data-theme="dark"] .default-list-table .table tbody tr:nth-of-type(even) { background: transparent; }
[data-theme="dark"] .default-list-table .table tbody tr:hover { background: rgba(37,171,124,.08); }
[data-theme="dark"] .default-list-table .table th,
[data-theme="dark"] .default-list-table .table thead tr th { color: #7b8799; }

[data-theme="dark"] .user-info-panel .user-info h4,
[data-theme="dark"] .user-info-panel .user-info .h4 { color: #cdd5df; }
[data-theme="dark"] .user-info-panel .user-info span { color: #7b8799; }

[data-theme="dark"] .setting-check label { background: #2a3347; }
[data-theme="dark"] .setting-check input:checked ~ label { background: var(--sg-primary); }

[data-theme="dark"] .action-card ul li a,
[data-theme="dark"] .action-card .dropdown-toggle { color: #7b8799; }
[data-theme="dark"] .action-card ul li a:hover { color: #f87171; }
[data-theme="dark"] .action-card .dropdown-toggle:hover { color: #fff; }
[data-theme="dark"] .action-card .dropdown-menu {
    background-color: #1a2235;
    box-shadow: 0 8px 32px rgba(0,0,0,.5);
}
[data-theme="dark"] .action-card ul li a.dropdown-item,
[data-theme="dark"] .action-card ul li a.dropdown-item:hover { color: #a8b3c3; }
[data-theme="dark"] .action-card li:hover .dropdown-item {
    color: #cdd5df;
    background-color: rgba(37,171,124,.12) !important;
}

[data-theme="dark"] .form-check-input:not(:checked) {
    background-color: #141c2e;
    border-color: #3a465c;
}

/* Select2 — opción ya seleccionada dentro del desplegable */
[data-theme="dark"] .select2-container--default .select2-results__option[aria-selected="true"]:not(.select2-results__option--highlighted),
[data-theme="dark"] .select2-container--default .select2-results__option--selected:not(.select2-results__option--highlighted) {
    background-color: #253047;
    color: #cdd5df;
}

/* ── Panel de filtros: Select2, etiquetas y botón limpiar ── */
[data-theme="dark"] .filters-panel { box-shadow: none !important; }
[data-theme="dark"] .filters-panel .filter-label { color: #7b8799 !important; }
[data-theme="dark"] .filters-panel .form-select:focus,
[data-theme="dark"] .filters-panel .form-control:focus {
    border-color: #25ab7c !important;
    box-shadow: 0 0 0 3px rgba(37,171,124,.18) !important;
}
[data-theme="dark"] .filters-panel .select2-container .select2-selection--single {
    background: #161d30 !important;
    border-color: #2a3347 !important;
}
[data-theme="dark"] .filters-panel .select2-container .select2-selection--single .select2-selection__rendered {
    color: #a8b3c3 !important;
}
[data-theme="dark"] .filters-panel .select2-container--open .select2-selection--single,
[data-theme="dark"] .filters-panel .select2-container--focus .select2-selection--single {
    border-color: #25ab7c !important;
}
[data-theme="dark"] .filters-panel .select2-selection__arrow b {
    border-top-color: #7b8799 !important;
    border-bottom-color: #7b8799 !important;
}
[data-theme="dark"] .filters-panel .sf-clear {
    background: #1e2a3d !important;
    border-color: #2a3347 !important;
    color: #7b8799 !important;
}
[data-theme="dark"] .filters-panel .sf-clear:hover { background: #253047 !important; color: #a8b3c3 !important; }

/* ── /admin/students: carnets y barra de selección ── */
[data-theme="dark"] .bulk-card-trigger {
    background: rgba(99,102,241,.16) !important;
    border-color: rgba(165,180,252,.3) !important;
    color: #a5b4fc !important;
}
[data-theme="dark"] .bulk-card-trigger:hover {
    background: #4f46e5 !important;
    border-color: #4f46e5 !important;
    color: #fff !important;
}
[data-theme="dark"] .bulk-selection-bar {
    background: rgba(99,102,241,.14) !important;
    border-color: rgba(165,180,252,.3) !important;
    color: #c7d2fe !important;
}
[data-theme="dark"] .bsb-link { color: #a5b4fc !important; }
[data-theme="dark"] .student-card-btn {
    background: rgba(99,102,241,.16) !important;
    color: #a5b4fc !important;
}
[data-theme="dark"] .student-card-btn:hover {
    background: #4f46e5 !important;
    color: #fff !important;
}
