/* ═══════════════════════════════════════════════════════════════════════════
   DARK MODE GLOBAL — activé par body.mod-skin-dark (per-user via localStorage)
   Fichier partagé entre admin et client (chargé par base.tpl)
   ═══════════════════════════════════════════════════════════════════════════ */

:root {
    --ui-page-bg: #f5f7fb;
    --ui-panel-bg: #ffffff;
    --ui-panel-toolbar-bg: #ffffff;
    --ui-field-bg: #ffffff;
    --ui-field-bg-readonly: #f3f4f6;
    --ui-field-border: #d5d9df;
    --ui-field-border-focus: #9ba4af;
    --ui-field-text: #1f2933;
    --ui-field-muted: #6b7280;
    --ui-field-height: 35px;
    --ui-button-height: var(--ui-field-height);
    --ui-field-radius: 6px;
    --dm-neutral-bg-base: #24262c;
    --dm-neutral-bg-surface: #2b2d33;
    --dm-neutral-bg-surface-alt: #303136;
    --dm-neutral-bg-field: #1f2127;
    --dm-neutral-border: #32353d;
    --dm-neutral-border-soft: rgba(255, 255, 255, 0.08);
    --dm-neutral-accent: #aeb5bf;
    --dm-neutral-text-soft: #c7ccd4;
}

body.mod-skin-dark {
    --ui-page-bg: var(--dm-neutral-bg-base);
    --ui-panel-bg: var(--dm-neutral-bg-surface);
    --ui-panel-toolbar-bg: var(--dm-neutral-bg-surface-alt);
    --ui-field-bg: var(--dm-neutral-bg-field);
    --ui-field-bg-readonly: var(--dm-neutral-bg-field);
    --ui-field-border: var(--dm-neutral-border-soft);
    --ui-field-border-focus: rgba(255, 255, 255, 0.14);
    --ui-field-text: rgba(255, 255, 255, 0.88);
    --ui-field-muted: rgba(255, 255, 255, 0.56);
}

/* --- FORMULAIRES UNIFIÉS LIGHT/DARK --- */
body:not(.mod-skin-dark) .form-control,
body:not(.mod-skin-dark) .form-select,
body:not(.mod-skin-dark) .custom-select,
body:not(.mod-skin-dark) .custom-file-label,
body:not(.mod-skin-dark) .select2-container--default .select2-selection--single,
body:not(.mod-skin-dark) .select2-container--default .select2-selection--multiple {
    background-color: var(--ui-field-bg) !important;
    border-color: var(--ui-field-border) !important;
    color: var(--ui-field-text) !important;
}

body:not(.mod-skin-dark) .form-control:focus,
body:not(.mod-skin-dark) .form-select:focus,
body:not(.mod-skin-dark) .custom-select:focus,
body:not(.mod-skin-dark) .select2-container--default.select2-container--focus .select2-selection--single,
body:not(.mod-skin-dark) .select2-container--default.select2-container--open .select2-selection--single,
body:not(.mod-skin-dark) .select2-container--default.select2-container--focus .select2-selection--multiple,
body:not(.mod-skin-dark) .select2-container--default.select2-container--open .select2-selection--multiple {
    background-color: var(--ui-field-bg) !important;
    border-color: var(--ui-field-border-focus) !important;
    color: var(--ui-field-text) !important;
    box-shadow: none !important;
}

body:not(.mod-skin-dark) .form-control:disabled,
body:not(.mod-skin-dark) .form-control[readonly],
body:not(.mod-skin-dark) .form-select:disabled,
body:not(.mod-skin-dark) .form-select[readonly],
body:not(.mod-skin-dark) .custom-select:disabled,
body:not(.mod-skin-dark) .custom-select[readonly] {
    background-color: var(--ui-field-bg-readonly) !important;
    color: var(--ui-field-muted) !important;
}

.form-control:not(textarea),
.form-select,
.custom-select,
select.form-control,
input.form-control {
    min-height: var(--ui-field-height) !important;
    height: var(--ui-field-height) !important;
    padding: 0 12px !important;
    line-height: calc(var(--ui-field-height) - 2px) !important;
    border-radius: var(--ui-field-radius) !important;
    box-shadow: none !important;
    box-sizing: border-box !important;
}

form .btn:not(.btn-lg):not(.btn-xs):not(.btn-icon):not(.btn-circle),
.form-actions .btn:not(.btn-lg):not(.btn-xs):not(.btn-icon):not(.btn-circle),
.input-group > .btn:not(.btn-lg):not(.btn-xs):not(.btn-icon):not(.btn-circle),
.swal2-actions .swal2-styled,
.swal2-actions .swm-btn {
    min-height: var(--ui-button-height) !important;
    height: var(--ui-button-height) !important;
    padding-top: 0 !important;
    padding-bottom: 0 !important;
    border-radius: var(--ui-field-radius) !important;
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    line-height: 1.2 !important;
    box-sizing: border-box;
}

textarea.form-control {
    min-height: 120px;
    line-height: 1.45;
    border-radius: var(--ui-field-radius) !important;
    box-shadow: none !important;
}

.select2-container--default .select2-selection--single {
    min-height: var(--ui-field-height) !important;
    height: var(--ui-field-height) !important;
    border-radius: var(--ui-field-radius) !important;
    box-shadow: none !important;
    display: flex !important;
    align-items: center !important;
}

.select2-container--default .select2-selection--single .select2-selection__rendered {
    line-height: calc(var(--ui-field-height) - 2px) !important;
    padding-left: 12px !important;
    padding-right: 34px !important;
}

.select2-container--default .select2-selection--single .select2-selection__arrow {
    height: calc(var(--ui-field-height) - 2px) !important;
    right: 8px !important;
}

.select2-container--default .select2-selection--multiple {
    min-height: var(--ui-field-height) !important;
    border-radius: var(--ui-field-radius) !important;
    box-shadow: none !important;
}

.select2-dropdown {
    border-color: var(--ui-field-border) !important;
}

select option,
select optgroup {
    background-color: var(--ui-field-bg);
    color: var(--ui-field-text);
}

body.mod-skin-dark:not(.mod-skin-light) select,
body.mod-skin-dark:not(.mod-skin-light) .custom-select {
    color-scheme: dark;
}

body.mod-skin-dark:not(.mod-skin-light) select option,
body.mod-skin-dark:not(.mod-skin-light) select optgroup {
    background-color: #383b40 !important;
    color: #ffffff !important;
}

body.mod-skin-light select,
body:not(.mod-skin-dark) select,
body.mod-skin-light .custom-select,
body:not(.mod-skin-dark) .custom-select {
    color-scheme: light;
}

body.mod-skin-light select option,
body:not(.mod-skin-dark) select option,
body.mod-skin-light select optgroup,
body:not(.mod-skin-dark) select optgroup {
    background-color: #ffffff !important;
    color: #0f172a !important;
}

body.mod-skin-dark:not(.mod-skin-light) select option:checked,
body.mod-skin-dark:not(.mod-skin-light) select option[selected] {
    background: linear-gradient(#5f646d, #5f646d) !important;
    background-color: #5f646d !important;
    box-shadow: inset 0 0 0 999px #5f646d;
    color: #ffffff !important;
}

body.mod-skin-light select option:checked,
body:not(.mod-skin-dark) select option:checked,
body.mod-skin-light select option[selected],
body:not(.mod-skin-dark) select option[selected] {
    background: linear-gradient(#e2e8f0, #e2e8f0) !important;
    background-color: #e2e8f0 !important;
    box-shadow: inset 0 0 0 999px #e2e8f0;
    color: #0f172a !important;
}

body.mod-skin-dark:not(.mod-skin-light) select option:hover,
body.mod-skin-dark:not(.mod-skin-light) select option:focus {
    background: linear-gradient(#4b5058, #4b5058) !important;
    background-color: #4b5058 !important;
    box-shadow: inset 0 0 0 999px #4b5058;
    color: #ffffff !important;
}

body.mod-skin-light select option:hover,
body:not(.mod-skin-dark) select option:hover,
body.mod-skin-light select option:focus,
body:not(.mod-skin-dark) select option:focus {
    background: linear-gradient(#f1f5f9, #f1f5f9) !important;
    background-color: #f1f5f9 !important;
    box-shadow: inset 0 0 0 999px #f1f5f9;
    color: #0f172a !important;
}

/* --- FONDS DE PAGE & STRUCTURE --- */
body.mod-skin-dark {
    background-color: var(--dm-neutral-bg-base) !important;
    color: #fff;
}
body.mod-skin-dark #clx-page-content {
    background-color: var(--dm-neutral-bg-base) !important;
}
body.mod-skin-dark .page-content {
    background-color: var(--dm-neutral-bg-base);
    color: #fff;
}
body.mod-skin-dark .page-wrapper {
    background-color: var(--dm-neutral-bg-base);
}
body.mod-skin-dark .page-header {
    background-color: var(--dm-neutral-bg-field);
}
body.mod-skin-dark a {
    color: var(--dm-neutral-text-soft);
}

/* --- PANNEAUX & CARTES --- */
body.mod-skin-dark .panel,
body.mod-skin-dark .card {
    background-color: var(--ui-panel-bg);
}
body.mod-skin-dark .panel {
    border: 0;
}
body.mod-skin-dark .panel-container,
body.mod-skin-dark .panel-content,
body.mod-skin-dark .card-body {
    background-color: var(--ui-panel-bg);
}
body.mod-skin-dark .panel-hdr {
    background: var(--ui-panel-toolbar-bg);
}
body.mod-skin-dark .panel-hdr h2 {
    color: #fff;
}
body.mod-skin-dark .card-header {
    background-color: var(--dm-neutral-bg-surface-alt);
}
body.mod-skin-dark .list-group-item {
    background-color: var(--dm-neutral-bg-surface);
}
body.mod-skin-dark .dashboard-stat2 {
    background-color: var(--dm-neutral-bg-surface);
}

/* --- TABLEAUX --- */
body.mod-skin-dark .table {
    color: #fff;
}
body.mod-skin-dark .table td,
body.mod-skin-dark .table th {
    padding: .75rem;
    vertical-align: top;
    border-top: 1px solid #6d6d80;
}
body.mod-skin-dark .table-bordered td,
body.mod-skin-dark .table-bordered th {
    border: 1px solid var(--dm-neutral-border);
}
body.mod-skin-dark .table-bordered {
    border: none;
}
body.mod-skin-dark .table-striped tbody tr:nth-of-type(odd) {
    color: #6d6d80;
    background-color: var(--dm-neutral-bg-surface-alt);
}
body.mod-skin-dark .table-striped>tbody>tr:nth-of-type(odd)>* {
    color: #ffffff !important;
}
body.mod-skin-dark .table thead th {
    border-bottom: 2px solid var(--dm-neutral-border);
    background-color: var(--dm-neutral-bg-surface-alt);
}
body.mod-skin-dark .thead-light th {
    background-color: var(--dm-neutral-bg-surface-alt);
}
body.mod-skin-dark .table-hover tbody tr:hover {
    color: #fff;
    background: var(--dm-neutral-bg-surface-alt);
}
body.mod-skin-dark .table-hover > tbody > tr:hover > * {
    --bs-table-accent-bg: black;
    color: #ffffff;
}

/* --- TEXTES --- */
body.mod-skin-dark .text-dark {
    color: #fff !important;
}
body.mod-skin-dark .text-black {
    color: #fff !important;
}
body.mod-skin-dark .text-muted,
body.mod-skin-dark .text-muted-green {
    color: #dedee0 !important;
}
body.mod-skin-dark .h1, body.mod-skin-dark .h2, body.mod-skin-dark .h3,
body.mod-skin-dark .h4, body.mod-skin-dark .h5, body.mod-skin-dark .h6,
body.mod-skin-dark h1, body.mod-skin-dark h2, body.mod-skin-dark h3,
body.mod-skin-dark h4, body.mod-skin-dark h5, body.mod-skin-dark h6 {
    color: #fff;
}
body.mod-skin-dark .subheader-title {
    color: #ffffff;
    text-shadow: #000 0 1px;
}

/* --- FORMULAIRES --- */
body.mod-skin-dark .form-control,
body.mod-skin-dark:not(.mod-skin-light) .form-control,
body.mod-skin-dark .custom-file-label,
body.mod-skin-dark:not(.mod-skin-light) .custom-file-label {
    background-color: var(--ui-field-bg) !important;
    border-color: var(--ui-field-border) !important;
    color: var(--ui-field-text) !important;
}
body.mod-skin-dark .form-control:focus,
body.mod-skin-dark:not(.mod-skin-light) .form-control:focus,
body.mod-skin-dark .custom-file-label:focus,
body.mod-skin-dark:not(.mod-skin-light) .custom-file-label:focus {
    background-color: var(--ui-field-bg) !important;
    border-color: var(--ui-field-border-focus) !important;
    color: var(--ui-field-text) !important;
}
body.mod-skin-dark .form-control:disabled,
body.mod-skin-dark .form-control[readonly],
body.mod-skin-dark:not(.mod-skin-light) .form-control:disabled,
body.mod-skin-dark:not(.mod-skin-light) .form-control[readonly],
body.mod-skin-dark .custom-file-label:disabled,
body.mod-skin-dark .custom-file-label[readonly],
body.mod-skin-dark:not(.mod-skin-light) .custom-file-label:disabled,
body.mod-skin-dark:not(.mod-skin-light) .custom-file-label[readonly] {
    background-color: var(--ui-field-bg-readonly) !important;
    border-color: rgba(255, 255, 255, 0.05) !important;
    color: var(--ui-field-muted) !important;
}
body.mod-skin-dark .form-select:disabled,
body.mod-skin-dark .form-select[readonly],
body.mod-skin-dark:not(.mod-skin-light) .form-select:disabled,
body.mod-skin-dark:not(.mod-skin-light) .form-select[readonly],
body.mod-skin-dark:not(.mod-skin-light) .custom-select:disabled,
body.mod-skin-dark:not(.mod-skin-light) .custom-select[readonly] {
    background-color: var(--ui-field-bg-readonly) !important;
    border-color: rgba(255, 255, 255, 0.05) !important;
    color: var(--ui-field-muted) !important;
}
body.mod-skin-dark .form-select,
body.mod-skin-dark:not(.mod-skin-light) .form-select,
body.mod-skin-dark .custom-select,
body.mod-skin-dark:not(.mod-skin-light) .custom-select {
    color: var(--ui-field-text) !important;
    background-color: var(--ui-field-bg) !important;
    border: 1px solid var(--ui-field-border) !important;
}
body.mod-skin-dark .form-select:focus,
body.mod-skin-dark:not(.mod-skin-light) .form-select:focus,
body.mod-skin-dark .custom-select:focus,
body.mod-skin-dark:not(.mod-skin-light) .custom-select:focus {
    background-color: var(--ui-field-bg) !important;
    border-color: var(--ui-field-border-focus) !important;
    color: var(--ui-field-text) !important;
}
body.mod-skin-dark .custom-select:focus {
    background-color: var(--ui-field-bg) !important;
    border-color: var(--ui-field-border-focus) !important;
    color: var(--ui-field-text) !important;
}
body.mod-skin-dark .input-group-text,
body.mod-skin-dark:not(.mod-skin-light) .input-group:not(.has-length) .input-group-text {
    background-color: var(--dm-neutral-bg-field);
    border: 1px solid var(--dm-neutral-border-soft);
    color: rgba(255, 255, 255, 0.7);
}
body.mod-skin-dark {
    --sm-select2-dark-field-bg: var(--ui-field-bg);
    --sm-select2-dark-dropdown-bg: var(--ui-field-bg);
    --sm-select2-dark-search-bg: var(--ui-field-bg);
    --sm-select2-dark-border: var(--ui-field-border);
    --sm-select2-dark-text: var(--ui-field-text);
    --sm-select2-dark-muted: var(--ui-field-muted);
    --dm-unified-field-height: var(--ui-field-height);
    --dm-unified-field-radius: var(--ui-field-radius);
    --dm-unified-field-border: var(--ui-field-border);
    --dm-unified-field-border-focus: var(--ui-field-border-focus);
    --dm-unified-dropdown-bg: var(--ui-field-bg);
    --dm-unified-dropdown-hover: #25272d;
    --dm-unified-dropdown-selected: var(--ui-panel-toolbar-bg);
    --dm-unified-dropdown-shadow: 0 10px 24px rgba(0, 0, 0, 0.34), 0 3px 8px rgba(0, 0, 0, 0.18);
}
body.mod-skin-dark .custom-control-label::before {
    background-color: #2B2C3F;
    border: #3c3d5a solid 2px;
}

body.mod-skin-dark .dm-unified-form .form-control:not(textarea),
body.mod-skin-dark .dm-unified-form .form-select,
body.mod-skin-dark .dm-unified-form input.form-control,
body.mod-skin-dark .dm-unified-form select.form-control,
body.mod-skin-dark .dm-unified-form .custom-select {
    min-height: var(--dm-unified-field-height) !important;
    height: var(--dm-unified-field-height) !important;
    padding: 9px 12px !important;
    line-height: 1.35 !important;
}

body.mod-skin-dark .dm-unified-form textarea.form-control {
    min-height: 120px;
    line-height: 1.45;
}

body.mod-skin-dark .dm-unified-form .select2-container--default .select2-selection--single,
body.mod-skin-dark .dm-unified-form .select2-container--default .select2-selection--single.dm-unified-dark-selection {
    min-height: var(--dm-unified-field-height);
    height: var(--dm-unified-field-height);
    border-radius: var(--dm-unified-field-radius);
    border: 1px solid var(--dm-unified-field-border) !important;
    background-color: var(--dm-neutral-bg-field) !important;
    box-shadow: none !important;
    display: flex;
    align-items: center;
    transition: border-color .16s ease, border-width .16s ease, border-radius .16s ease;
}

body.mod-skin-dark .dm-unified-form .select2-container--default .select2-selection--single .select2-selection__rendered,
body.mod-skin-dark .dm-unified-form .select2-container--default .select2-selection--single.dm-unified-dark-selection .select2-selection__rendered {
    line-height: calc(var(--dm-unified-field-height) - 2px);
    padding-left: 12px;
    padding-right: 34px;
}

body.mod-skin-dark .dm-unified-form .select2-container--default .select2-selection--single .select2-selection__arrow {
    height: calc(var(--dm-unified-field-height) - 2px);
    right: 8px;
}

body.mod-skin-dark .dm-unified-form .select2-container--default.select2-container--focus .select2-selection--single,
body.mod-skin-dark .dm-unified-form .select2-container--default.select2-container--open .select2-selection--single,
body.mod-skin-dark .dm-unified-form .select2-container--default.select2-container--focus .select2-selection--multiple,
body.mod-skin-dark .dm-unified-form .select2-container--default.select2-container--open .select2-selection--multiple {
    border-color: var(--dm-unified-field-border-focus) !important;
    border-width: 2px !important;
    background-color: var(--dm-neutral-bg-field) !important;
}

body.mod-skin-dark .dm-unified-form .select2-container--default.select2-container--open.select2-container--below .select2-selection--single {
    border-bottom-color: transparent !important;
    border-bottom-left-radius: 0 !important;
    border-bottom-right-radius: 0 !important;
}

body.mod-skin-dark .dm-unified-form .select2-container--default.select2-container--open.select2-container--above .select2-selection--single {
    border-top-color: transparent !important;
    border-top-left-radius: 0 !important;
    border-top-right-radius: 0 !important;
}

body.mod-skin-dark .dm-unified-dark-dropdown.select2-dropdown,
body.mod-skin-dark .dm-unified-dark-dropdown.select2-dropdown--above,
body.mod-skin-dark .dm-unified-dark-dropdown.select2-dropdown--below {
    background: var(--dm-unified-dropdown-bg) !important;
    border-color: transparent !important;
    box-shadow: var(--dm-unified-dropdown-shadow) !important;
    backdrop-filter: blur(28px) saturate(1.12);
    -webkit-backdrop-filter: blur(28px) saturate(1.12);
    position: relative;
}

body.mod-skin-dark .dm-unified-dark-dropdown.select2-dropdown::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(255,255,255,.025) 0%, rgba(255,255,255,0) 18%, rgba(0,0,0,.035) 100%);
    pointer-events: none;
}

body.mod-skin-dark .dm-unified-dark-dropdown.select2-dropdown > * {
    position: relative;
    z-index: 1;
}

body.mod-skin-dark .dm-unified-dark-dropdown.select2-dropdown--below {
    border-left: 2px solid var(--dm-unified-field-border-focus) !important;
    border-right: 2px solid var(--dm-unified-field-border-focus) !important;
    border-bottom: 2px solid var(--dm-unified-field-border-focus) !important;
    border-top-left-radius: 0 !important;
    border-top-right-radius: 0 !important;
}

body.mod-skin-dark .dm-unified-dark-dropdown.select2-dropdown--above {
    border-left: 2px solid var(--dm-unified-field-border-focus) !important;
    border-right: 2px solid var(--dm-unified-field-border-focus) !important;
    border-top: 2px solid var(--dm-unified-field-border-focus) !important;
    border-top-left-radius: 6px !important;
    border-top-right-radius: 6px !important;
    border-bottom-left-radius: 0 !important;
    border-bottom-right-radius: 0 !important;
}

body.mod-skin-dark .dm-unified-dark-dropdown .select2-results__option {
    background: transparent;
}

body.mod-skin-dark .dm-unified-dark-dropdown .select2-search--dropdown {
    padding: 10px 12px 8px;
}

body.mod-skin-dark .dm-unified-dark-dropdown .select2-search__field {
    display: block;
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 !important;
    box-sizing: border-box !important;
    border: 1px solid rgba(255,255,255,.28) !important;
    background: rgba(255,255,255,.045) !important;
    background-color: rgba(255,255,255,.045) !important;
}

body.mod-skin-dark .dm-unified-dark-dropdown .select2-search__field:focus {
    border-color: rgba(255,255,255,.4) !important;
    background: rgba(255,255,255,.065) !important;
    background-color: rgba(255,255,255,.065) !important;
}

body.mod-skin-dark .dm-unified-dark-dropdown .select2-results__option--highlighted[aria-selected],
body.mod-skin-dark .dm-unified-dark-dropdown .select2-results__option--highlighted[aria-selected] * {
    background-color: var(--dm-unified-dropdown-hover) !important;
    color: rgba(255, 255, 255, 0.94) !important;
}

body.mod-skin-dark .dm-unified-dark-dropdown .select2-results__option[aria-selected=true],
body.mod-skin-dark .dm-unified-dark-dropdown .select2-results__option[aria-selected=true] * {
    background-color: var(--dm-unified-dropdown-selected) !important;
    color: rgba(255, 255, 255, 0.94) !important;
}

/* --- SELECT2 --- */
body.mod-skin-dark .select2-container--default .select2-selection--single,
body.mod-skin-dark:not(.mod-skin-light) .select2-container--default .select2-selection--single {
    background-color: var(--sm-select2-dark-field-bg);
    border: 1px solid var(--sm-select2-dark-border);
    border-radius: 4px;
}
body.mod-skin-dark .select2-container--default .select2-selection--single .select2-selection__rendered,
body.mod-skin-dark:not(.mod-skin-light) .select2-container--default .select2-selection--single .select2-selection__rendered {
    color: var(--sm-select2-dark-text);
}
body.mod-skin-dark .select2-container--default .select2-selection--multiple,
body.mod-skin-dark:not(.mod-skin-light) .select2-container--default .select2-selection--multiple {
    background-color: var(--sm-select2-dark-field-bg);
    border-color: var(--sm-select2-dark-border);
    color: var(--sm-select2-dark-text);
}
body.mod-skin-dark .select2-container--default.select2-container--disabled .select2-selection--single,
body.mod-skin-dark:not(.mod-skin-light) .select2-container--default.select2-container--disabled .select2-selection--single,
body.mod-skin-dark .select2-container--default.select2-container--disabled .select2-selection--multiple,
body.mod-skin-dark:not(.mod-skin-light) .select2-container--default.select2-container--disabled .select2-selection--multiple {
    background-color: #1f2127 !important;
    border-color: rgba(255, 255, 255, 0.05) !important;
    color: rgba(255, 255, 255, 0.56);
}
body.mod-skin-dark .select2-dropdown,
body.mod-skin-dark:not(.mod-skin-light) .select2-dropdown {
    background-color: var(--sm-select2-dark-dropdown-bg);
    border-color: var(--sm-select2-dark-border);
}
body.mod-skin-dark .select2-results__message {
    color: #92929f !important;
}
body.mod-skin-dark .select2-search--dropdown:before {
    color: var(--sm-select2-dark-text);
}
body.mod-skin-dark .select2-container--default .select2-search--dropdown .select2-search__field,
body.mod-skin-dark:not(.mod-skin-light) .select2-container--default .select2-search--dropdown .select2-search__field {
    background-color: var(--sm-select2-dark-search-bg);
    border-color: var(--sm-select2-dark-border);
    color: var(--sm-select2-dark-text);
}
body.mod-skin-dark .select2-container--default .select2-results__option[aria-selected=true],
body.mod-skin-dark:not(.mod-skin-light) .select2-container--default .select2-results__option[aria-selected=true] {
    background-color: #303136 !important;
    color: rgba(255, 255, 255, 0.94) !important;
}
body.mod-skin-dark .select2-container--default .select2-results__option[aria-selected=true] *,
body.mod-skin-dark:not(.mod-skin-light) .select2-container--default .select2-results__option[aria-selected=true] * {
    color: inherit !important;
}

body.mod-skin-dark .select2-container--default.select2-container--focus .select2-selection--single,
body.mod-skin-dark .select2-container--default.select2-container--open .select2-selection--single,
body.mod-skin-dark .select2-container--default.select2-container--focus .select2-selection--multiple,
body.mod-skin-dark .select2-container--default.select2-container--open .select2-selection--multiple,
body.mod-skin-dark:not(.mod-skin-light) .select2-container--default.select2-container--focus .select2-selection--single,
body.mod-skin-dark:not(.mod-skin-light) .select2-container--default.select2-container--open .select2-selection--single,
body.mod-skin-dark:not(.mod-skin-light) .select2-container--default.select2-container--focus .select2-selection--multiple,
body.mod-skin-dark:not(.mod-skin-light) .select2-container--default.select2-container--open .select2-selection--multiple {
    border-color: rgba(255, 255, 255, 0.14) !important;
    background-color: #1f2127 !important;
}

body.mod-skin-dark .select2-container--default .select2-results__option--highlighted[aria-selected],
body.mod-skin-dark .select2-container--default .select2-results__option--highlighted[aria-selected] *,
body.mod-skin-dark:not(.mod-skin-light) .select2-container--default .select2-results__option--highlighted[aria-selected],
body.mod-skin-dark:not(.mod-skin-light) .select2-container--default .select2-results__option--highlighted[aria-selected] * {
    background-color: #303136 !important;
    color: rgba(255, 255, 255, 0.94) !important;
}

/* --- BOUTONS --- */
body.mod-skin-dark .btn-default {
    background-color: #565773;
    background-image: none;
    color: #fff;
}

/* --- CALENDRIER / FULLCALENDAR --- */
body.mod-skin-dark .fc-head-container thead tr {
    background-image: none;
}
body.mod-skin-dark .fc-other-month {
    background-image: none;
    background-color: #15151F;
    background-size: 1rem 1rem;
}

/* --- PROGRESS --- */
body.mod-skin-dark .progress {
    background-color: #323347;
}

/* --- ALERTES --- */
body.mod-skin-dark .alert-info {
    color: #fff;
    background-color: #2f264f;
    border-color: transparent;
}
body.mod-skin-dark .alert-danger {
    border-color: rgba(255,168,0,.5);
    color: #fff;
    background-color: #392f28;
}
body.mod-skin-dark .alert-success {
    position: relative;
    color: #59ff95 !important;
    background-color: rgba(34, 197, 94, 0.20) !important;
    border-color: rgba(74, 222, 128, 0.52) !important;
    text-shadow: 0 0 10px rgba(74, 222, 128, 0.12);
    padding-left: 3rem;
}
body.mod-skin-dark .alert-success:before {
    content: "\f058";
    font-family: "Font Awesome 5 Pro";
    font-weight: 900;
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: #38ef7d !important;
    font-size: 1.05rem;
    line-height: 1;
    text-shadow: 0 0 12px rgba(74, 222, 128, 0.24);
    pointer-events: none;
}
body.mod-skin-dark .alert-success,
body.mod-skin-dark .alert-success span,
body.mod-skin-dark .alert-success strong,
body.mod-skin-dark .alert-success div,
body.mod-skin-dark .alert-success p {
    color: #59ff95 !important;
}

/* --- BADGES --- */
body.mod-skin-dark .badge.badge-outline-danger {
    color: #f64e60;
    background-color: #3a2434;
}
body.mod-skin-dark .badge.badge-outline-success {
    color: #ffffff;
    background-color: #047051;
}

/* --- AVATARS / SYMBOLES --- */
body.mod-skin-dark .symbol .symbol-label {
    background-color: #565772;
}
body.mod-skin-dark .clx-avatar {
    background: #372533;
    color: #E45B64;
}

/* --- SETTINGS PANEL --- */
body.mod-skin-dark .settings-panel .list:hover {
    color: #6d6d80;
    background: #323347;
}
body.mod-skin-dark .settings-panel h5 {
    color: #fff;
}

/* --- PAGINATION --- */
body.mod-skin-dark .page-link {
    color: #fff;
    background-color: var(--dm-neutral-bg-surface-alt);
    border-color: transparent;
}
body.mod-skin-dark .pagination .page-item:first-child:not(.active) .page-link,
body.mod-skin-dark .pagination .page-item:last-child:not(.active) .page-link,
body.mod-skin-dark .pagination .page-item.disabled .page-link {
    background: var(--dm-neutral-bg-surface);
}

/* --- ONGLETS / TABS --- */
body.mod-skin-dark .nav-tabs .nav-item.show .nav-link,
body.mod-skin-dark .nav-tabs .nav-link.active {
    background-color: var(--dm-neutral-bg-surface);
}
body.mod-skin-dark .nav-tabs-clean .nav-item .nav-link.active {
    border-bottom: 1px solid var(--dm-neutral-accent);
    color: var(--dm-neutral-accent);
}
body.mod-skin-dark .nav-tabs .nav-item .nav-link.active:not(:hover) {
    color: var(--dm-neutral-accent);
}

/* --- ÉDITEUR REDACTOR --- */
body.mod-skin-dark .redactor-box,
body.mod-skin-dark .redactor-editor {
    background-color: #1b1b29;
}
body.mod-skin-dark .redactor-toolbar {
    background: #323347;
}
body.mod-skin-dark .redactor-toolbar li a {
    color: #fff;
}
body.mod-skin-dark .redactor-editor {
    border: 1px solid #2b2b40;
}

/* --- CODE --- */
body.mod-skin-dark code {
    background: #1c1c29;
}

/* --- SWEET ALERT --- */
body.mod-skin-dark .swal2-popup {
    background: #000;
}
body.mod-skin-dark .swal2-title {
    color: #ffffff;
}

/* --- DIVERS --- */
body.mod-skin-dark .bg-white {
    background-color: #000000 !important;
}
body.mod-skin-dark .dropdown-item {
    color: #ffffff;
}
body.mod-skin-dark .dropdown-item:hover,
body.mod-skin-dark .dropdown-item:focus {
    color: #fff;
    background-color: #2E2E3C;
}
body.mod-skin-dark .dropdown-menu {
    background: #3d3d4c;
    border: 1px solid rgba(255, 255, 255, 0.10);
}
body.mod-skin-dark .dropdown-item.active,
body.mod-skin-dark .dropdown-item:active {
    color: var(--dm-neutral-text-soft) !important;
    background: rgba(0, 0, 0, 0.35);
}
body.mod-skin-dark .dropzone {
    background: #000000;
}
body.mod-skin-dark .datepicker-content li {
    background-color: #3d3d4c;
}
body.mod-skin-dark .datepicker-week li,
body.mod-skin-dark .datepicker-week li:hover {
    background-color: #15151f;
}
body.mod-skin-dark .daterangepicker {
    background-color: #3d3d4c;
}
body.mod-skin-dark .daterangepicker .ranges li:hover {
    background-color: #151E29;
}
body.mod-skin-dark .daterangepicker .calendar-table {
    background-color: #3d3d4c;
}
body.mod-skin-dark .daterangepicker td.off,
body.mod-skin-dark .daterangepicker td.off.in-range,
body.mod-skin-dark .daterangepicker td.off.start-date,
body.mod-skin-dark .daterangepicker td.off.end-date {
    background-color: #3d3d4c;
}

/* --- OVERRIDES THEME BLUE_EXTRA (fonds clairs imposés par le thème) --- */
body.mod-skin-dark #clx-page-content {
    background: var(--dm-neutral-bg-base) !important;
}
body.mod-skin-dark.mod-bg-1,
body.mod-skin-dark.mod-bg-2,
body.mod-skin-dark.mod-bg-3,
body.mod-skin-dark.mod-bg-4 {
    background-color: var(--dm-neutral-bg-base) !important;
}
body.mod-skin-dark .page-content-wrapper {
    background-color: var(--dm-neutral-bg-base);
}
body.mod-skin-dark .nav-menu-clean {
    background: var(--dm-neutral-bg-surface);
}
body.mod-skin-dark .nav-menu-clean li a {
    color: #c0c0c0 !important;
}
body.mod-skin-dark .nav-menu-clean li a span {
    color: #c0c0c0 !important;
}
body.mod-skin-dark .nav-menu-clean li a:hover {
    background-color: var(--dm-neutral-bg-surface-alt) !important;
}
body.mod-skin-dark .notification li.unread {
    background: var(--dm-neutral-bg-surface);
}
body.mod-skin-dark .notification.notification-layout-2 li {
    background: var(--dm-neutral-bg-surface);
}
body.mod-skin-dark .notification.notification-layout-2 li.unread {
    background: var(--dm-neutral-bg-surface-alt);
}
body.mod-skin-dark .notification .name {
    color: #e0e0e0;
}
body.mod-skin-dark .notification .msg-a,
body.mod-skin-dark .notification .msg-b {
    color: #a0a0a0;
}

/* --- MODALS --- */
body.mod-skin-dark .modal-content {
    background-color: var(--dm-neutral-bg-surface);
    border-color: var(--dm-neutral-border);
    color: #fff;
}
body.mod-skin-dark .modal-header {
    background-color: var(--dm-neutral-bg-surface-alt);
    border-bottom-color: var(--dm-neutral-border);
}
body.mod-skin-dark .modal-footer {
    background-color: var(--dm-neutral-bg-surface-alt);
    border-top-color: var(--dm-neutral-border);
}
body.mod-skin-dark .close,
body.mod-skin-dark .btn-close {
    color: #e2e8f0;
    text-shadow: none;
    opacity: 0.8;
    filter: none;
}
body.mod-skin-dark .close:hover,
body.mod-skin-dark .btn-close:hover {
    color: #fff;
    opacity: 1;
}
/* Croix alert : couleur vive assortie au type */
body.mod-skin-dark .alert-success .close,
body.mod-skin-dark .alert-success .btn-close { color: #38ef7d; }
body.mod-skin-dark .alert-success .close:hover,
body.mod-skin-dark .alert-success .btn-close:hover { color: #9dffbf; }
body.mod-skin-dark .alert-danger .close,
body.mod-skin-dark .alert-danger .btn-close { color: #f87171; }
body.mod-skin-dark .alert-danger .close:hover,
body.mod-skin-dark .alert-danger .btn-close:hover { color: #fca5a5; }
body.mod-skin-dark .alert-warning .close,
body.mod-skin-dark .alert-warning .btn-close { color: #fbbf24; }
body.mod-skin-dark .alert-warning .close:hover,
body.mod-skin-dark .alert-warning .btn-close:hover { color: #fde68a; }
body.mod-skin-dark .alert-info .close,
body.mod-skin-dark .alert-info .btn-close { color: var(--dm-neutral-text-soft); }
body.mod-skin-dark .alert-info .close:hover,
body.mod-skin-dark .alert-info .btn-close:hover { color: #ffffff; }

/* --- BREADCRUMB & SUBHEADER --- */
body.mod-skin-dark .breadcrumb {
    background-color: transparent;
}
body.mod-skin-dark .breadcrumb-item a {
    color: var(--dm-neutral-text-soft);
}
body.mod-skin-dark .breadcrumb-item.active {
    color: #9ca3af;
}
body.mod-skin-dark .subheader {
    background-color: transparent;
    border-bottom-color: var(--dm-neutral-border);
}

/* --- OFFCANVAS / SIDEBAR --- */
body.mod-skin-dark .offcanvas {
    background-color: var(--dm-neutral-bg-surface);
    color: #fff;
}

/* --- POPOVERS & TOOLTIPS --- */
body.mod-skin-dark .popover {
    background-color: var(--dm-neutral-bg-surface);
    border-color: var(--dm-neutral-border);
}
body.mod-skin-dark .popover-header {
    background-color: var(--dm-neutral-bg-surface-alt);
    border-bottom-color: var(--dm-neutral-border);
    color: #fff;
}
body.mod-skin-dark .popover-body {
    color: #c0c0c0;
}
body.mod-skin-dark .bs-popover-top > .popover-arrow::after,
body.mod-skin-dark .bs-popover-auto[data-popper-placement^="top"] > .popover-arrow::after {
    border-top-color: var(--dm-neutral-bg-surface);
}
body.mod-skin-dark .bs-popover-bottom > .popover-arrow::after,
body.mod-skin-dark .bs-popover-auto[data-popper-placement^="bottom"] > .popover-arrow::after {
    border-bottom-color: var(--dm-neutral-bg-surface);
}

/* --- ACCORDION --- */
body.mod-skin-dark .accordion-item {
    background-color: var(--dm-neutral-bg-surface);
    border-color: var(--dm-neutral-border);
}
body.mod-skin-dark .accordion-button {
    background-color: var(--dm-neutral-bg-surface);
    color: #fff;
}
body.mod-skin-dark .accordion-button:not(.collapsed) {
    background-color: var(--dm-neutral-bg-surface-alt);
    color: var(--dm-neutral-accent);
}

/* --- CLIENT-SPECIFIC --- */
body.mod-skin-dark .info-card {
    background-color: var(--dm-neutral-bg-surface);
}
