/**
 * SFXC global theme sync — works with Settings → Dark Mode toggle.
 * Requires html[data-theme="dark"] set by app.js + head-css early init.
 */

html[data-theme="dark"] {
    color-scheme: dark;
}

/* Common utility overrides that fight bootstrap-dark */
html[data-theme="dark"] .bg-white {
    background-color: #2b2e3b !important;
}

html[data-theme="dark"] .bg-light {
    background-color: #343747 !important;
}

html[data-theme="dark"] .text-dark {
    color: #eff2f7 !important;
}

html[data-theme="dark"] .text-muted {
    color: #9295a4 !important;
}

html[data-theme="dark"] .border,
html[data-theme="dark"] .border-bottom,
html[data-theme="dark"] .border-top {
    border-color: #343747 !important;
}

/* Drawers / offcanvas used on list pages */
html[data-theme="dark"] .offcanvas,
html[data-theme="dark"] .offcanvas-header,
html[data-theme="dark"] .offcanvas-body {
    background-color: #2b2e3b;
    color: #c3cbe4;
}

html[data-theme="dark"] .modal-content {
    background-color: #2b2e3b;
    color: #c3cbe4;
    border-color: #343747;
}

html[data-theme="dark"] .modal-header,
html[data-theme="dark"] .modal-footer {
    border-color: #343747;
}

/* DataTables */
html[data-theme="dark"] table.dataTable,
html[data-theme="dark"] .dataTables_wrapper {
    color: #c3cbe4;
}

html[data-theme="dark"] table.dataTable thead th,
html[data-theme="dark"] .table-light thead th,
html[data-theme="dark"] thead.table-light th {
    background-color: #343747 !important;
    color: #c3cbe4 !important;
    border-color: #3d4152 !important;
}

html[data-theme="dark"] table.dataTable tbody tr {
    background-color: #2b2e3b;
}

html[data-theme="dark"] table.dataTable tbody tr:nth-child(even) {
    background-color: #272935;
}

html[data-theme="dark"] table.dataTable tbody td {
    border-color: #343747;
}

html[data-theme="dark"] .dataTables_filter input,
html[data-theme="dark"] .dataTables_length select {
    background-color: #343747;
    border-color: #3d4152;
    color: #c3cbe4;
}

/* Collapsed sidebar flyout — head-css.php light gradient override */
html[data-theme="dark"] body.vertical-collpsed .vertical-menu #sidebar-menu > ul > li:hover > ul {
    background: linear-gradient(135deg, #2b2e3b 0%, #343747 100%) !important;
    box-shadow: 4px 8px 20px rgba(0, 0, 0, 0.35) !important;
    border-color: #343747 !important;
}

html[data-theme="dark"] body.vertical-collpsed .vertical-menu #sidebar-menu > ul > li:hover > ul > li > a:hover {
    background-color: rgba(91, 115, 232, 0.12) !important;
    color: #a6b0cf !important;
    border-left-color: #5b73e8 !important;
}
