/* =============================================================================
   PRIISM — Dark Mode Global Overrides
   Cohérent avec les variables Velzon : [data-layout-mode="dark"]
   body-bg:#1a1d21 | card-bg:#212529 | secondary:#2a2f34
   text:#ced4da | border:#32383e | input:#262a2f
   ============================================================================= */

/* ---------------------------------------------------------------------------
   TRANSITIONS GLOBALES (mode light <-> dark)
   --------------------------------------------------------------------------- */
[data-layout-mode="dark"] *,
[data-layout-mode="light"] * {
    transition: background-color 0.2s ease, color 0.18s ease,
                border-color 0.18s ease, box-shadow 0.18s ease !important;
}

/* ---------------------------------------------------------------------------
   SYNCHRONISATION VARIABLES BOOTSTRAP 5
   tabulator_bootstrap5.min.css et d'autres libs CDN utilisent --bs-* variables.
   Velzon utilise data-layout-mode (pas data-bs-theme), donc on bridge manuellement.
   --------------------------------------------------------------------------- */
html[data-layout-mode="dark"] {
    --bs-body-bg: #1a1d21;
    --bs-body-color: #ced4da;
    --bs-body-color-rgb: 206, 212, 218;
    --bs-secondary-bg: #2a2f34;
    --bs-tertiary-bg: #212529;
    --bs-border-color: #32383e;
    --bs-border-color-translucent: rgba(255,255,255,0.1);
    --bs-emphasis-color: #fff;
    --bs-emphasis-color-rgb: 255,255,255;
    --bs-secondary-color: rgba(206,212,218,.75);
    --bs-tertiary-color: rgba(206,212,218,.5);
    /* Table Bootstrap 5 */
    --bs-table-bg: #212529;
    --bs-table-color: #ced4da;
    --bs-table-border-color: #32383e;
    --bs-table-striped-bg: #1e2228;
    --bs-table-striped-color: #ced4da;
    --bs-table-active-bg: #1f3552;
    --bs-table-active-color: #ced4da;
    --bs-table-hover-bg: #2a2f34;
    --bs-table-hover-color: #fff;
    /* Card */
    --bs-card-bg: #212529;
    --bs-card-border-color: #32383e;
    --bs-card-cap-bg: #1e2228;
    /* Forms */
    --bs-form-control-bg: #262a2f;
    --bs-form-control-border-color: #32383e;
    /* Dropdown */
    --bs-dropdown-bg: #212529;
    --bs-dropdown-border-color: #32383e;
    --bs-dropdown-color: #ced4da;
    --bs-dropdown-link-color: #ced4da;
    --bs-dropdown-link-hover-bg: #2a2f34;
    --bs-dropdown-link-active-bg: #405189;
    /* Modal */
    --bs-modal-bg: #212529;
    --bs-modal-border-color: #32383e;
    --bs-modal-header-border-color: #32383e;
    --bs-modal-footer-border-color: #32383e;
    --bs-modal-color: #ced4da;
    /* Input group */
    --bs-input-group-addon-bg: #2a2f34;
    --bs-input-group-addon-border-color: #32383e;
    --bs-input-group-addon-color: #ced4da;
    /* Pagination */
    --bs-pagination-bg: #212529;
    --bs-pagination-border-color: #32383e;
    --bs-pagination-color: #8a9099;
    --bs-pagination-hover-bg: #2a2f34;
    --bs-pagination-hover-color: #ced4da;
    --bs-pagination-active-bg: #405189;
    --bs-pagination-active-border-color: #405189;
    --bs-pagination-disabled-bg: #212529;
    --bs-pagination-disabled-color: #555c64;
    --bs-pagination-disabled-border-color: #32383e;
    /* List group */
    --bs-list-group-bg: #212529;
    --bs-list-group-border-color: #32383e;
    --bs-list-group-color: #ced4da;
    --bs-list-group-action-hover-bg: #2a2f34;
    --bs-list-group-hover-bg: #2a2f34;
    --bs-list-group-active-bg: #405189;
    --bs-list-group-active-border-color: #405189;
    /* Tooltips */
    --bs-tooltip-bg: #2a2f34;
    --bs-tooltip-color: #ced4da;
    /* Offcanvas */
    --bs-offcanvas-bg: #212529;
    --bs-offcanvas-color: #ced4da;
    --bs-offcanvas-border-color: #32383e;
    /* Accordion */
    --bs-accordion-bg: #212529;
    --bs-accordion-border-color: #32383e;
    --bs-accordion-btn-bg: #1e2228;
    --bs-accordion-btn-color: #ced4da;
    --bs-accordion-active-bg: #2a2f34;
    --bs-accordion-active-color: #ced4da;
    --bs-accordion-body-bg: #212529;
    /* Nav */
    --bs-nav-tabs-border-color: #32383e;
    --bs-nav-tabs-link-active-bg: #212529;
    --bs-nav-tabs-link-active-border-color: #32383e #32383e #212529;
    --bs-nav-tabs-link-hover-border-color: transparent transparent #32383e;
    --bs-nav-pills-link-active-bg: #405189;
}

/* ---------------------------------------------------------------------------
   BOOTSTRAP — UTILITY CLASSES
   --------------------------------------------------------------------------- */
[data-layout-mode="dark"] .bg-white       { background-color: #212529 !important; }
[data-layout-mode="dark"] .bg-light       { background-color: #2a2f34 !important; color: #ced4da !important; }
[data-layout-mode="dark"] .bg-body        { background-color: #1a1d21 !important; }
[data-layout-mode="dark"] .bg-secondary   { background-color: #2a2f34 !important; }

[data-layout-mode="dark"] .text-dark      { color: #ced4da !important; }
[data-layout-mode="dark"] .text-black     { color: #ced4da !important; }
[data-layout-mode="dark"] .text-body      { color: #ced4da !important; }
[data-layout-mode="dark"] .text-secondary { color: #8a9099 !important; }
[data-layout-mode="dark"] .text-muted     { color: #8a9099 !important; }

[data-layout-mode="dark"] .border         { border-color: #32383e !important; }
[data-layout-mode="dark"] .border-top     { border-top-color: #32383e !important; }
[data-layout-mode="dark"] .border-bottom  { border-bottom-color: #32383e !important; }
[data-layout-mode="dark"] .border-start   { border-left-color: #32383e !important; }
[data-layout-mode="dark"] .border-end     { border-right-color: #32383e !important; }
[data-layout-mode="dark"] .border-light   { border-color: #32383e !important; }
[data-layout-mode="dark"] .border-secondary { border-color: #32383e !important; }

/* ---------------------------------------------------------------------------
   BOOTSTRAP — BADGES "subtle"
   --------------------------------------------------------------------------- */
[data-layout-mode="dark"] .bg-success-subtle  { background-color: rgba(10,179,156,0.18) !important; color: #0ab39c !important; }
[data-layout-mode="dark"] .bg-danger-subtle   { background-color: rgba(240,101,72,0.18) !important;  color: #f06548 !important; }
[data-layout-mode="dark"] .bg-warning-subtle  { background-color: rgba(247,184,75,0.18) !important;  color: #f7b84b !important; }
[data-layout-mode="dark"] .bg-info-subtle     { background-color: rgba(41,156,219,0.18) !important;  color: #299cdb !important; }
[data-layout-mode="dark"] .bg-primary-subtle  { background-color: rgba(64,81,137,0.25) !important;   color: #8aa3e0 !important; }
[data-layout-mode="dark"] .bg-secondary-subtle{ background-color: rgba(135,138,153,0.2) !important;  color: #adb5bd !important; }
[data-layout-mode="dark"] .bg-dark-subtle     { background-color: rgba(42,47,52,0.6) !important;     color: #ced4da !important; }

[data-layout-mode="dark"] .badge.bg-light     { background-color: #2a2f34 !important; color: #ced4da !important; }
[data-layout-mode="dark"] .badge.text-dark    { color: #ced4da !important; }
[data-layout-mode="dark"] .badge.bg-secondary { background-color: #2a2f34 !important; color: #ced4da !important; }

/* ---------------------------------------------------------------------------
   BOOTSTRAP — ALERTS
   --------------------------------------------------------------------------- */
[data-layout-mode="dark"] .alert-primary   { background-color: rgba(64,81,137,0.25) !important; border-color: rgba(64,81,137,0.4) !important; color: #8aa3e0 !important; }
[data-layout-mode="dark"] .alert-success   { background-color: rgba(10,179,156,0.18) !important; border-color: rgba(10,179,156,0.3) !important; color: #0ab39c !important; }
[data-layout-mode="dark"] .alert-danger    { background-color: rgba(240,101,72,0.18) !important;  border-color: rgba(240,101,72,0.3) !important;  color: #f06548 !important; }
[data-layout-mode="dark"] .alert-warning   { background-color: rgba(247,184,75,0.18) !important;  border-color: rgba(247,184,75,0.3) !important;  color: #f7b84b !important; }
[data-layout-mode="dark"] .alert-info      { background-color: rgba(41,156,219,0.18) !important;  border-color: rgba(41,156,219,0.3) !important;  color: #299cdb !important; }
[data-layout-mode="dark"] .alert-light     { background-color: #2a2f34 !important; border-color: #32383e !important; color: #ced4da !important; }
[data-layout-mode="dark"] .alert-secondary { background-color: #2a2f34 !important; border-color: #32383e !important; color: #ced4da !important; }

/* ---------------------------------------------------------------------------
   BOOTSTRAP — CARDS
   --------------------------------------------------------------------------- */
[data-layout-mode="dark"] .card {
    background-color: #212529 !important;
    border-color: #32383e !important;
}
[data-layout-mode="dark"] .card-header {
    background-color: #1e2228 !important;
    border-bottom-color: #32383e !important;
    color: #ced4da !important;
}
[data-layout-mode="dark"] .card-footer {
    background-color: #1e2228 !important;
    border-top-color: #32383e !important;
}
[data-layout-mode="dark"] .card-title,
[data-layout-mode="dark"] .card-subtitle { color: #ced4da !important; }

/* ---------------------------------------------------------------------------
   BOOTSTRAP — TABLES (HTML standard)
   Utilise html[...] pour battre les règles Bootstrap/Velzon
   --------------------------------------------------------------------------- */
html[data-layout-mode="dark"] .table {
    --bs-table-bg: #212529;
    --bs-table-color: #ced4da;
    --bs-table-border-color: #32383e;
    --bs-table-striped-bg: #1e2228;
    --bs-table-striped-color: #ced4da;
    --bs-table-hover-bg: #2a2f34;
    --bs-table-hover-color: #fff;
    color: #ced4da !important;
    border-color: #32383e !important;
}
html[data-layout-mode="dark"] .table > :not(caption) > * > * {
    background-color: #212529 !important;
    color: #ced4da !important;
    border-color: #32383e !important;
}
html[data-layout-mode="dark"] .table > thead > tr > th,
html[data-layout-mode="dark"] .table > thead > tr > td {
    background-color: #1e2228 !important;
    color: #a8b1c5 !important;
    border-color: #32383e !important;
}
html[data-layout-mode="dark"] .table > tbody > tr > td,
html[data-layout-mode="dark"] .table > tbody > tr > th {
    background-color: #212529 !important;
    color: #ced4da !important;
    border-color: #32383e !important;
}
html[data-layout-mode="dark"] .table-striped > tbody > tr:nth-of-type(odd) > * {
    background-color: #1e2228 !important;
    color: #ced4da !important;
}
html[data-layout-mode="dark"] .table-striped > tbody > tr:nth-of-type(even) > * {
    background-color: #212529 !important;
}
html[data-layout-mode="dark"] .table-hover > tbody > tr:hover > * {
    background-color: #2a2f34 !important;
    color: #fff !important;
}
html[data-layout-mode="dark"] .table-bordered > :not(caption) > * {
    border-color: #32383e !important;
}
html[data-layout-mode="dark"] .table-light > * {
    background-color: #2a2f34 !important;
    color: #ced4da !important;
}
/* Lignes sélectionnées / actives dans les tables HTML */
html[data-layout-mode="dark"] .table > tbody > tr.table-active > * {
    background-color: #1f3552 !important;
    color: #ced4da !important;
}
html[data-layout-mode="dark"] tr, html[data-layout-mode="dark"] td, html[data-layout-mode="dark"] th {
    border-color: #32383e !important;
}

/* ---------------------------------------------------------------------------
   BOOTSTRAP — FORMS
   --------------------------------------------------------------------------- */
[data-layout-mode="dark"] .form-control,
[data-layout-mode="dark"] .form-select,
[data-layout-mode="dark"] textarea.form-control {
    background-color: #262a2f !important;
    color: #ced4da !important;
    border-color: #2a2f34 !important;
}
[data-layout-mode="dark"] .form-control:focus,
[data-layout-mode="dark"] .form-select:focus {
    background-color: #2a2f34 !important;
    color: #ced4da !important;
    border-color: #33393f !important;
    box-shadow: 0 0 0 0.15rem rgba(64,81,137,0.25) !important;
}
[data-layout-mode="dark"] .form-control::placeholder { color: #555c64 !important; }
[data-layout-mode="dark"] .form-control:disabled,
[data-layout-mode="dark"] .form-control[readonly] {
    background-color: #1e2228 !important;
    color: #6c757d !important;
}
[data-layout-mode="dark"] .input-group-text {
    background-color: #2a2f34 !important;
    color: #ced4da !important;
    border-color: #2a2f34 !important;
}
[data-layout-mode="dark"] .form-label { color: #ced4da !important; }
[data-layout-mode="dark"] .form-text  { color: #8a9099 !important; }
[data-layout-mode="dark"] .form-check-label { color: #ced4da !important; }
[data-layout-mode="dark"] .form-floating > label { color: #8a9099 !important; }

/* ---------------------------------------------------------------------------
   BOOTSTRAP — MODALES
   --------------------------------------------------------------------------- */
[data-layout-mode="dark"] .modal-content {
    background-color: #212529 !important;
    color: #ced4da !important;
    border-color: #32383e !important;
}
[data-layout-mode="dark"] .modal-header {
    background-color: #1e2228 !important;
    border-bottom-color: #32383e !important;
    color: #ced4da !important;
}
[data-layout-mode="dark"] .modal-footer {
    background-color: #1e2228 !important;
    border-top-color: #32383e !important;
}
[data-layout-mode="dark"] .modal-body      { background-color: #212529 !important; }
[data-layout-mode="dark"] .modal-title     { color: #ced4da !important; }
[data-layout-mode="dark"] .btn-close       { filter: invert(1) grayscale(1) brightness(1.5); }

/* ---------------------------------------------------------------------------
   BOOTSTRAP — DROPDOWNS
   --------------------------------------------------------------------------- */
[data-layout-mode="dark"] .dropdown-menu {
    background-color: #292e33 !important;
    border-color: #32383e !important;
    box-shadow: 0 4px 24px rgba(0,0,0,0.4) !important;
}
[data-layout-mode="dark"] .dropdown-item {
    color: #adb5bd !important;
}
[data-layout-mode="dark"] .dropdown-item:hover,
[data-layout-mode="dark"] .dropdown-item:focus {
    background-color: #2f343a !important;
    color: #ced4da !important;
}
[data-layout-mode="dark"] .dropdown-item.active,
[data-layout-mode="dark"] .dropdown-item:active {
    background-color: #405189 !important;
    color: #fff !important;
}
[data-layout-mode="dark"] .dropdown-divider { border-color: #32383e !important; }
[data-layout-mode="dark"] .dropdown-header  { color: #8a9099 !important; }

/* ---------------------------------------------------------------------------
   BOOTSTRAP — LIST GROUPS
   --------------------------------------------------------------------------- */
[data-layout-mode="dark"] .list-group-item {
    background-color: #212529 !important;
    border-color: #32383e !important;
    color: #ced4da !important;
}
[data-layout-mode="dark"] .list-group-item:hover,
[data-layout-mode="dark"] .list-group-item-action:hover {
    background-color: #2a2f34 !important;
    color: #ced4da !important;
}
[data-layout-mode="dark"] .list-group-item.active {
    background-color: #405189 !important;
    border-color: #405189 !important;
    color: #fff !important;
}
[data-layout-mode="dark"] .list-group-item-light {
    background-color: #2a2f34 !important;
    color: #ced4da !important;
}

/* ---------------------------------------------------------------------------
   BOOTSTRAP — NAV / TABS / PILLS
   --------------------------------------------------------------------------- */
[data-layout-mode="dark"] .nav-tabs {
    border-bottom-color: #32383e !important;
}
[data-layout-mode="dark"] .nav-tabs .nav-link {
    color: #8a9099 !important;
}
[data-layout-mode="dark"] .nav-tabs .nav-link:hover {
    color: #ced4da !important;
    border-color: transparent transparent #32383e !important;
}
[data-layout-mode="dark"] .nav-tabs .nav-item.show .nav-link,
[data-layout-mode="dark"] .nav-tabs .nav-link.active {
    background-color: #212529 !important;
    border-color: #32383e #32383e #212529 !important;
    color: #ced4da !important;
}
[data-layout-mode="dark"] .nav-pills .nav-link        { color: #8a9099 !important; }
[data-layout-mode="dark"] .nav-pills .nav-link.active { background-color: #405189 !important; color: #fff !important; }
[data-layout-mode="dark"] .tab-content                { color: #ced4da !important; }

/* ---------------------------------------------------------------------------
   BOOTSTRAP — ACCORDION
   --------------------------------------------------------------------------- */
[data-layout-mode="dark"] .accordion-item {
    background-color: #212529 !important;
    border-color: #32383e !important;
}
[data-layout-mode="dark"] .accordion-button {
    background-color: #1e2228 !important;
    color: #ced4da !important;
}
[data-layout-mode="dark"] .accordion-button:not(.collapsed) {
    background-color: #2a2f34 !important;
    color: #ced4da !important;
    box-shadow: inset 0 -1px 0 #32383e !important;
}
[data-layout-mode="dark"] .accordion-button::after { filter: invert(1); }
[data-layout-mode="dark"] .accordion-body { background-color: #212529 !important; color: #ced4da !important; }

/* ---------------------------------------------------------------------------
   BOOTSTRAP — PAGINATION / BREADCRUMB
   --------------------------------------------------------------------------- */
[data-layout-mode="dark"] .page-item .page-link {
    background-color: #212529 !important;
    border-color: #32383e !important;
    color: #8a9099 !important;
}
[data-layout-mode="dark"] .page-item.active .page-link {
    background-color: #405189 !important;
    border-color: #405189 !important;
    color: #fff !important;
}
[data-layout-mode="dark"] .breadcrumb-item { color: #8a9099 !important; }
[data-layout-mode="dark"] .breadcrumb-item a { color: #8a9099 !important; }
[data-layout-mode="dark"] .breadcrumb-item.active { color: #ced4da !important; }
[data-layout-mode="dark"] .breadcrumb-item + .breadcrumb-item::before { color: #555c64 !important; }

/* ---------------------------------------------------------------------------
   BOOTSTRAP — PROGRESS / SPINNER / HR
   --------------------------------------------------------------------------- */
[data-layout-mode="dark"] .progress { background-color: #2a2f34 !important; }
[data-layout-mode="dark"] hr { border-color: #32383e !important; opacity: 0.6 !important; }
[data-layout-mode="dark"] code { background-color: #2a2f34 !important; color: #f06548 !important; }
[data-layout-mode="dark"] pre  { background-color: #1e2228 !important; color: #ced4da !important; border-color: #32383e !important; }

/* ---------------------------------------------------------------------------
   COMPOSANT — TABULATOR (tabulator_bootstrap5.min.css via CDN)
   Utilise html[...] + sélecteurs très spécifiques pour battre Bootstrap5 theme
   --------------------------------------------------------------------------- */
html[data-layout-mode="dark"] .tabulator {
    background-color: #212529 !important;
    color: #ced4da !important;
    border-color: #32383e !important;
    border-radius: 8px;
}
/* Header */
html[data-layout-mode="dark"] .tabulator .tabulator-header {
    background-color: #1e2228 !important;
    border-bottom: 2px solid #32383e !important;
}
html[data-layout-mode="dark"] .tabulator .tabulator-header .tabulator-col {
    background-color: #1e2228 !important;
    border-right-color: #32383e !important;
    color: #a8b1c5 !important;
}
html[data-layout-mode="dark"] .tabulator .tabulator-header .tabulator-col:hover {
    background-color: #262b31 !important;
}
html[data-layout-mode="dark"] .tabulator .tabulator-header .tabulator-col .tabulator-col-content,
html[data-layout-mode="dark"] .tabulator .tabulator-header .tabulator-col .tabulator-col-title {
    color: #a8b1c5 !important;
}
html[data-layout-mode="dark"] .tabulator .tabulator-header .tabulator-col.tabulator-sortable .tabulator-col-title {
    color: #a8b1c5 !important;
}
/* Holder (zone scrollable) */
html[data-layout-mode="dark"] .tabulator .tabulator-tableholder {
    background-color: #212529 !important;
}
html[data-layout-mode="dark"] .tabulator .tabulator-tableholder .tabulator-table {
    background-color: #212529 !important;
    color: #ced4da !important;
}
/* Lignes */
html[data-layout-mode="dark"] .tabulator .tabulator-row {
    background-color: #212529 !important;
    border-bottom: 1px solid #2a2f34 !important;
    color: #ced4da !important;
}
html[data-layout-mode="dark"] .tabulator .tabulator-row.tabulator-row-even {
    background-color: #212529 !important;
}
html[data-layout-mode="dark"] .tabulator .tabulator-row.tabulator-row-odd {
    background-color: #1e2228 !important;
}
html[data-layout-mode="dark"] .tabulator .tabulator-row:hover,
html[data-layout-mode="dark"] .tabulator .tabulator-row.tabulator-selectable:hover {
    background-color: #2a2f34 !important;
    cursor: pointer;
}
html[data-layout-mode="dark"] .tabulator .tabulator-row.tabulator-selected,
html[data-layout-mode="dark"] .tabulator .tabulator-row.tabulator-selected:hover {
    background-color: #1f3552 !important;
}
/* Cellules */
html[data-layout-mode="dark"] .tabulator .tabulator-row .tabulator-cell {
    border-right: 1px solid #2a2f34 !important;
    color: #ced4da !important;
}
html[data-layout-mode="dark"] .tabulator .tabulator-row .tabulator-cell.tabulator-editing {
    background-color: #262a2f !important;
    border-color: #405189 !important;
}
/* Footer / pagination */
html[data-layout-mode="dark"] .tabulator .tabulator-footer {
    background-color: #1e2228 !important;
    border-top: 1px solid #32383e !important;
    color: #8a9099 !important;
}
html[data-layout-mode="dark"] .tabulator .tabulator-footer .tabulator-page {
    background-color: #212529 !important;
    border-color: #32383e !important;
    color: #8a9099 !important;
}
html[data-layout-mode="dark"] .tabulator .tabulator-footer .tabulator-page:hover {
    background-color: #2a2f34 !important;
    color: #ced4da !important;
}
html[data-layout-mode="dark"] .tabulator .tabulator-footer .tabulator-page.active {
    background-color: #405189 !important;
    color: #fff !important;
}
html[data-layout-mode="dark"] .tabulator .tabulator-footer .tabulator-page-size {
    background-color: #212529 !important;
    color: #ced4da !important;
    border-color: #32383e !important;
}
html[data-layout-mode="dark"] .tabulator-page-counter { color: #8a9099 !important; }
/* Inputs dans Tabulator (filtres, édition) */
html[data-layout-mode="dark"] .tabulator .tabulator-header-filter input,
html[data-layout-mode="dark"] .tabulator input[type="text"],
html[data-layout-mode="dark"] .tabulator input[type="search"],
html[data-layout-mode="dark"] .tabulator input[type="number"],
html[data-layout-mode="dark"] .tabulator select {
    background-color: #1e2228 !important;
    color: #ced4da !important;
    border-color: #32383e !important;
}
html[data-layout-mode="dark"] .tabulator .tabulator-header-filter input::placeholder {
    color: #555c64 !important;
}
/* Resize handle */
html[data-layout-mode="dark"] .tabulator .tabulator-col-resize-handle {
    background-color: #32383e !important;
}
/* Loader Tabulator */
html[data-layout-mode="dark"] .tabulator .tabulator-loader .tabulator-loader-msg {
    background-color: #212529 !important;
    color: #ced4da !important;
    border-color: #32383e !important;
}
/* Checkbox column */
html[data-layout-mode="dark"] .tabulator input[type="checkbox"] {
    accent-color: #405189;
}
/* Flèches de tri */
html[data-layout-mode="dark"] .tabulator .tabulator-header .tabulator-col .tabulator-arrow {
    border-bottom-color: #a8b1c5 !important;
    border-top-color: #a8b1c5 !important;
}
html[data-layout-mode="dark"] .tabulator .tabulator-header .tabulator-col.tabulator-sortable .tabulator-arrow {
    border-bottom-color: #a8b1c5 !important;
}
/* Cellule en cours d'édition inline */
html[data-layout-mode="dark"] .tabulator .tabulator-cell.tabulator-editing {
    background-color: #1f2d42 !important;
    border: 2px solid #405189 !important;
}
html[data-layout-mode="dark"] .tabulator .tabulator-cell.tabulator-editing input,
html[data-layout-mode="dark"] .tabulator .tabulator-cell.tabulator-editing textarea,
html[data-layout-mode="dark"] .tabulator .tabulator-cell.tabulator-editing select {
    background-color: #1f2d42 !important;
    color: #ced4da !important;
    border: none !important;
}
/* Menu contextuel Tabulator */
html[data-layout-mode="dark"] .tabulator-menu {
    background-color: #212529 !important;
    border-color: #32383e !important;
    box-shadow: 0 4px 16px rgba(0,0,0,0.5) !important;
}
html[data-layout-mode="dark"] .tabulator-menu .tabulator-menu-item {
    color: #ced4da !important;
}
html[data-layout-mode="dark"] .tabulator-menu .tabulator-menu-item:hover {
    background-color: #2a2f34 !important;
}
html[data-layout-mode="dark"] .tabulator-menu .tabulator-menu-separator {
    border-color: #32383e !important;
}
/* Ligne sélectionnée via checkbox */
html[data-layout-mode="dark"] .tabulator .tabulator-row.tabulator-selected .tabulator-cell {
    color: #ced4da !important;
}

/* ---------------------------------------------------------------------------
   COMPOSANT — RECHERCHE GLOBALE (header search dropdown)
   --------------------------------------------------------------------------- */
[data-layout-mode="dark"] #search-dropdown {
    background: #292e33 !important;
    border-color: #32383e !important;
    box-shadow: 0 4px 24px rgba(0,0,0,0.4) !important;
}
[data-layout-mode="dark"] #search-dropdown .dropdown-header {
    color: #8a9099 !important;
    border-bottom-color: #32383e !important;
}
[data-layout-mode="dark"] #search-dropdown .dropdown-item {
    color: #adb5bd !important;
}
[data-layout-mode="dark"] #search-dropdown .dropdown-item:hover {
    background-color: #2f343a !important;
    color: #ced4da !important;
}

/* ---------------------------------------------------------------------------
   COMPOSANT — PAGE DE PROFIL (display_profile.html)
   --------------------------------------------------------------------------- */
[data-layout-mode="dark"] .profile-card-glass {
    background: rgba(33,37,41,0.92) !important;
    border-color: rgba(255,255,255,0.07) !important;
}
[data-layout-mode="dark"] .profile-foreground,
[data-layout-mode="dark"] .profile-header-bg { filter: brightness(0.5) saturate(0.7); }

/* ---------------------------------------------------------------------------
   COMPOSANT — KM (knowledge management)
   --------------------------------------------------------------------------- */
[data-layout-mode="dark"] .km-card,
[data-layout-mode="dark"] [class*="km-"] { background-color: #212529 !important; color: #ced4da !important; }

/* ---------------------------------------------------------------------------
   COMPOSANT — SCROLLBAR (messages, chat)
   --------------------------------------------------------------------------- */
[data-layout-mode="dark"] ::-webkit-scrollbar-track { background: #1e2228; }
[data-layout-mode="dark"] ::-webkit-scrollbar-thumb { background: #2a2f34; border-radius: 4px; }
[data-layout-mode="dark"] ::-webkit-scrollbar-thumb:hover { background: #404040; }

/* ---------------------------------------------------------------------------
   COMPOSANT — STAT CARDS / KPI (dashboard, vsa_sync)
   --------------------------------------------------------------------------- */
[data-layout-mode="dark"] .stat-card,
[data-layout-mode="dark"] .kpi-card,
[data-layout-mode="dark"] .kpi-mini {
    background-color: #212529 !important;
    border-color: #32383e !important;
    color: #ced4da !important;
}

/* ---------------------------------------------------------------------------
   COMPOSANT — TOASTS (custom photo upload, etc.)
   --------------------------------------------------------------------------- */
[data-layout-mode="dark"] .toast {
    background-color: #212529 !important;
    color: #ced4da !important;
    border-color: #32383e !important;
}
[data-layout-mode="dark"] .toast .btn-close { filter: invert(1) grayscale(1); }

/* ---------------------------------------------------------------------------
   COMPOSANT — OFFCANVAS
   --------------------------------------------------------------------------- */
[data-layout-mode="dark"] .offcanvas {
    background-color: #212529 !important;
    color: #ced4da !important;
}
[data-layout-mode="dark"] .offcanvas-header {
    border-bottom-color: #32383e !important;
}

/* ---------------------------------------------------------------------------
   COMPOSANT — POPOVER / TOOLTIP
   --------------------------------------------------------------------------- */
[data-layout-mode="dark"] .popover {
    background-color: #292e33 !important;
    border-color: #32383e !important;
}
[data-layout-mode="dark"] .popover-header {
    background-color: #1e2228 !important;
    border-bottom-color: #32383e !important;
    color: #ced4da !important;
}
[data-layout-mode="dark"] .popover-body { color: #adb5bd !important; }
[data-layout-mode="dark"] .tooltip-inner { background-color: #292e33 !important; color: #ced4da !important; }

/* ---------------------------------------------------------------------------
   COMPOSANT — HUB FORMATION (hero gradient avec texte forcé blanc)
   --------------------------------------------------------------------------- */
[data-layout-mode="dark"] .hub-formation-hero *,
[data-layout-mode="dark"] .hub-formation-hero h1 { color: #ffffff !important; }

/* ---------------------------------------------------------------------------
   COMPOSANT — CHOICES.JS / SELECT2
   --------------------------------------------------------------------------- */
[data-layout-mode="dark"] .choices__inner {
    background-color: #262a2f !important;
    border-color: #2a2f34 !important;
    color: #ced4da !important;
}
[data-layout-mode="dark"] .choices__list--dropdown,
[data-layout-mode="dark"] .choices__list[aria-expanded] {
    background-color: #292e33 !important;
    border-color: #32383e !important;
}
[data-layout-mode="dark"] .choices__item { color: #ced4da !important; }
[data-layout-mode="dark"] .choices__item--selectable.is-highlighted {
    background-color: #2f343a !important;
}
[data-layout-mode="dark"] .choices__input {
    background-color: #262a2f !important;
    color: #ced4da !important;
}

/* ---------------------------------------------------------------------------
   COMPOSANT — FLATPICKR
   --------------------------------------------------------------------------- */
[data-layout-mode="dark"] .flatpickr-calendar {
    background-color: #212529 !important;
    border-color: #32383e !important;
    box-shadow: 0 4px 24px rgba(0,0,0,0.4) !important;
}
[data-layout-mode="dark"] .flatpickr-month,
[data-layout-mode="dark"] .flatpickr-weekdays { background-color: #1e2228 !important; }
[data-layout-mode="dark"] .flatpickr-day      { color: #ced4da !important; }
[data-layout-mode="dark"] .flatpickr-day:hover{ background-color: #2a2f34 !important; }
[data-layout-mode="dark"] .flatpickr-day.selected { background-color: #405189 !important; border-color: #405189 !important; color: #fff !important; }
[data-layout-mode="dark"] .flatpickr-current-month { color: #ced4da !important; }
[data-layout-mode="dark"] span.flatpickr-weekday { color: #8a9099 !important; }

/* ---------------------------------------------------------------------------
   CORRECTION — Éléments HTML de base non couverts par Velzon
   --------------------------------------------------------------------------- */
[data-layout-mode="dark"] h1, [data-layout-mode="dark"] h2,
[data-layout-mode="dark"] h3, [data-layout-mode="dark"] h4,
[data-layout-mode="dark"] h5, [data-layout-mode="dark"] h6 { color: #ced4da; }

[data-layout-mode="dark"] p,
[data-layout-mode="dark"] span:not([class]),
[data-layout-mode="dark"] li { color: #ced4da; }

[data-layout-mode="dark"] a:not(.btn):not(.nav-link):not(.dropdown-item) { color: #7a9fd4; }
[data-layout-mode="dark"] a:not(.btn):not(.nav-link):not(.dropdown-item):hover { color: #a0bfe8; }

[data-layout-mode="dark"] blockquote {
    background-color: #1e2228 !important;
    border-left-color: #405189 !important;
    color: #ced4da !important;
}

/* ---------------------------------------------------------------------------
   CORRECTION — Classes specifiques inline repérées dans les templates HIGH
   Ces selectors ciblent les patterns les plus courants en inline style
   --------------------------------------------------------------------------- */

/* Sections à fond gris clair (#f5f5f5, #f8f9fa, etc.) */
[data-layout-mode="dark"] .section-bg,
[data-layout-mode="dark"] .bg-gray,
[data-layout-mode="dark"] .bg-f5 { background-color: #1e2228 !important; }

/* Éléments ayant du texte blanc sur fond coloré — conserver tel quel */
[data-layout-mode="dark"] .btn-primary,
[data-layout-mode="dark"] .btn-success,
[data-layout-mode="dark"] .btn-danger,
[data-layout-mode="dark"] .btn-warning,
[data-layout-mode="dark"] .btn-info { color: #fff !important; }

/* ---------------------------------------------------------------------------
   Filtre Semestre (Tous / S1 / S2) — boutons outline non actifs lisibles
   Le thème peut appliquer une couleur de texte identique au fond (ex. blanc).
   --------------------------------------------------------------------------- */
.s1s2-filter-group .btn.btn-outline-primary:not(.active) {
    color: var(--vz-primary, #405189) !important;
    background-color: var(--vz-white, #fff) !important;
    border-color: var(--vz-primary, #405189) !important;
}
[data-layout-mode="dark"] .s1s2-filter-group .btn.btn-outline-primary:not(.active) {
    color: #a8b8e8 !important;
    background-color: transparent !important;
    border-color: #5a6ca8 !important;
}

/*# sourceMappingURL=custom.min.css.map */
