/* GestLoc — pont de compatibilité Bootstrap / Select2 / DataTables / SweetAlert2 / Fancybox / Chart.js (G63 V0).
   RÈGLE : aucune règle ici ne s'applique hors `.gl-ds` (contenu migré) ou hors `body.gl-ds-bridge` (classe d'opt-in explicite, jamais posée par défaut). Les gabarits PDF et les courriels ne chargent jamais ce fichier. */

/* 1. Variables Bootstrap 5.3 : les composants Bootstrap placés dans `.gl-ds` adoptent les jetons GestLoc */
.gl-ds {
  --bs-primary: #1A3B5D; --bs-primary-rgb: 26, 59, 93; --bs-link-color: #1A3B5D; --bs-link-hover-color: #0F2239;
  --bs-body-font-family: var(--gl-font); --bs-body-color: #334155; --bs-border-color: #8492A6; --bs-border-radius: 8px; --bs-border-radius-lg: 12px; --bs-focus-ring-color: rgba(26, 59, 93, .25);
  --bs-success: #166534; --bs-danger: #991B1B; --bs-warning: #92400E; --bs-info: #1E40AF;
}
.gl-ds .btn-primary { --bs-btn-bg: #1A3B5D; --bs-btn-border-color: #1A3B5D; --bs-btn-hover-bg: #0F2239; --bs-btn-hover-border-color: #0F2239; --bs-btn-active-bg: #0F2239; --bs-btn-disabled-bg: #8492A6; --bs-btn-disabled-border-color: #8492A6; }
.gl-ds .form-control, .gl-ds .form-select { border-color: #8492A6; min-height: 40px; border-radius: 8px; } .gl-ds .form-control:disabled, .gl-ds .form-control[readonly], .gl-ds .form-select:disabled { background: #F1F5F9; border-color: #E2E8F0; color: #475569; }
.gl-ds .form-control:focus, .gl-ds .form-select:focus { border-color: #1A3B5D; box-shadow: 0 0 0 3px rgba(26, 59, 93, .18); }
.gl-ds .form-control.is-invalid, .gl-ds .form-select.is-invalid { border-color: #991B1B; } .gl-ds .invalid-feedback { color: #991B1B; font-weight: 600; font-size: 12px; }

/* 2. Select2 4.1 (+ thème bootstrap-5) */
.gl-ds .select2-container--bootstrap-5 .select2-selection { min-height: 40px; border-color: #8492A6; border-radius: 8px; }
.gl-ds .select2-container--bootstrap-5.select2-container--focus .select2-selection, .gl-ds .select2-container--bootstrap-5.select2-container--open .select2-selection { border-color: #1A3B5D; box-shadow: 0 0 0 3px rgba(26, 59, 93, .18); }
.gl-ds .select2-container--bootstrap-5 .select2-selection--single .select2-selection__rendered { color: #0F172A; }
body.gl-ds-bridge .select2-container--bootstrap-5 .select2-dropdown { border-color: #8492A6; border-radius: 8px; box-shadow: 0 10px 28px rgba(15, 23, 42, .12); z-index: 2000; }
body.gl-ds-bridge .select2-container--bootstrap-5 .select2-results__option--highlighted { background: #E6EDF5; color: #1A3B5D; }

/* 3. DataTables 1.13 */
.gl-ds .dataTables_wrapper .dataTables_filter input, .gl-ds .dataTables_wrapper .dataTables_length select { border: 1px solid #8492A6; border-radius: 8px; min-height: 36px; padding: 4px 10px; }
.gl-ds table.dataTable thead th { background: #F1F5F9; color: #0F172A; font-size: 12px; border-bottom: 1px solid #E2E8F0; }
.gl-ds .dataTables_wrapper .page-item.active .page-link { background: #1A3B5D; border-color: #1A3B5D; } .gl-ds .dataTables_wrapper .page-link { color: #1A3B5D; border-color: #8492A6; }

/* 4. SweetAlert2 11 : la fenêtre est ajoutée au <body> → opt-in explicite par classe du corps */
body.gl-ds-bridge .swal2-popup { border-radius: 14px; border: 1px solid #94A3B8; box-shadow: 0 28px 72px rgba(8, 17, 32, .45); font-family: 'Inter', system-ui, sans-serif; }
body.gl-ds-bridge .swal2-styled.swal2-confirm { background: #1A3B5D !important; border-radius: 8px; } body.gl-ds-bridge .swal2-styled.swal2-cancel { background: #fff !important; color: #334155 !important; border: 1px solid #8492A6 !important; border-radius: 8px; } body.gl-ds-bridge .swal2-styled.swal2-deny { background: #991B1B !important; border-radius: 8px; }
body.gl-ds-bridge .swal2-styled:focus-visible { outline: 2px solid #1A3B5D; outline-offset: 2px; box-shadow: 0 0 0 4px #fff; }

/* 5. Fancybox 5 et Chart.js : aucun style imposé ; la palette de graphiques est fournie par le JS de la page (jetons --gl-nuit, --gl-vert) */
.gl-ds .fancybox__container { --fancybox-accent-color: #1A3B5D; }
.gl-ds canvas { max-width: 100%; }

/* 6. Fenêtres Bootstrap : empilement garanti sous la coque (menu 1030, dropdown 1040, modale 1055, Select2 2000, SweetAlert 1060) */
.gl-ds .modal-dialog { margin-inline: auto; }

/* G63 : Fancybox ouvert depuis une fenêtre Bootstrap (z-index d'origine 1050 < 1055) — passe au-dessus de la fenêtre, sous SweetAlert2 (1060). */
body.gl-ds-bridge .fancybox__container { z-index: 1058; }
