/* ==========================================================================
   GEICG - COMPOSANTS & STYLES PARTAGÉS (geicg-components.css)
   Phase 4 : Centralisation et Allègement des Assets CSS & JS
   Zéro régression visuelle, conservation stricte de toutes les classes & IDs
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. ANIMATIONS ET INTERACTIONS PREMIUM
   -------------------------------------------------------------------------- */
@keyframes kpiEntrance {
  0% {
    opacity: 0;
    transform: translateY(18px) scale(0.98);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes liveRadar {
  0% { transform: scale(0.6); opacity: 1; }
  50% { opacity: 0.6; }
  100% { transform: scale(2.2); opacity: 0; }
}

@keyframes btnPulseGlow {
  0%, 100% {
    box-shadow: 0 4px 14px rgba(22, 163, 74, 0.25);
    transform: translateY(0);
  }
  50% {
    box-shadow: 0 6px 22px rgba(22, 163, 74, 0.45);
    transform: translateY(-1.5px);
  }
}

@keyframes modalZoomIn {
  from {
    opacity: 0;
    transform: scale(0.95) translateY(-8px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

/* --------------------------------------------------------------------------
   2. CARTES KPI (DASHBOARDS & LISTES)
   -------------------------------------------------------------------------- */
.card-kpi-container {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}
@media (max-width: 1200px) {
  .card-kpi-container {
    grid-template-columns: repeat(2, 1fr);
  }
}
@media (max-width: 640px) {
  .card-kpi-container {
    grid-template-columns: 1fr;
  }
}

.kpi-card {
  position: relative;
  overflow: hidden;
  min-height: 118px !important;
  padding: 22px 22px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  box-sizing: border-box;
  background: #FFFFFF;
  border-radius: 12px;
  border: 1px solid #E2E8F0;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.02);
  transition: transform 0.28s cubic-bezier(0.16, 1, 0.3, 1), 
              box-shadow 0.28s cubic-bezier(0.16, 1, 0.3, 1), 
              border-color 0.28s cubic-bezier(0.16, 1, 0.3, 1);
  animation: kpiEntrance 0.55s cubic-bezier(0.16, 1, 0.3, 1) backwards;
  cursor: default;
}

.kpi-card-clickable {
  cursor: pointer !important;
}
.kpi-card-clickable:hover {
  transform: translateY(-4px) scale(1.01) !important;
  box-shadow: 0 12px 24px -6px rgba(0, 0, 0, 0.1), 0 4px 8px -2px rgba(0, 0, 0, 0.04) !important;
}

.kpi-card > div:first-child {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
}

.kpi-card [id^="kpi-"] {
  font-size: 20px;
  font-weight: 900;
}

/* Échelonnement de l'apparition des cartes KPI (Staggered entrance) */
.card-kpi-container:nth-of-type(1) .kpi-card:nth-child(1) { animation-delay: 0.04s; }
.card-kpi-container:nth-of-type(1) .kpi-card:nth-child(2) { animation-delay: 0.08s; }
.card-kpi-container:nth-of-type(1) .kpi-card:nth-child(3) { animation-delay: 0.12s; }
.card-kpi-container:nth-of-type(1) .kpi-card:nth-child(4) { animation-delay: 0.16s; }

.card-kpi-container:nth-of-type(2) .kpi-card:nth-child(1) { animation-delay: 0.20s; }
.card-kpi-container:nth-of-type(2) .kpi-card:nth-child(2) { animation-delay: 0.24s; }
.card-kpi-container:nth-of-type(2) .kpi-card:nth-child(3) { animation-delay: 0.28s; }
.card-kpi-container:nth-of-type(2) .kpi-card:nth-child(4) { animation-delay: 0.32s; }

.card-kpi-container:nth-of-type(3) .kpi-card:nth-child(1) { animation-delay: 0.36s; }
.card-kpi-container:nth-of-type(3) .kpi-card:nth-child(2) { animation-delay: 0.40s; }
.card-kpi-container:nth-of-type(3) .kpi-card:nth-child(3) { animation-delay: 0.44s; }
.card-kpi-container:nth-of-type(3) .kpi-card:nth-child(4) { animation-delay: 0.48s; }

.kpi-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 24px -4px rgba(15, 23, 42, 0.08), 0 6px 10px -3px rgba(15, 23, 42, 0.03) !important;
}

.kpi-icon-box {
  width: 48px !important;
  height: 48px !important;
  border-radius: 12px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  flex-shrink: 0 !important;
  transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.35s ease;
}

.kpi-icon-box svg, .kpi-icon-box i {
  width: 24px !important;
  height: 24px !important;
}

.kpi-card:hover .kpi-icon-box {
  transform: scale(1.15) rotate(4deg);
}

/* Effet reflet de lumière (Shimmer shine) */
.kpi-card::after {
  content: '';
  position: absolute;
  top: 0;
  left: -120%;
  width: 60%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.55), transparent);
  transform: skewX(-22deg);
  pointer-events: none;
}

.kpi-card:hover::after {
  left: 180%;
  transition: left 0.85s ease-in-out;
}

/* Indicateur radar vert en direct */
.live-status-pulse {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: #10B981;
  position: relative;
  margin-right: 6px;
  vertical-align: middle;
}
.live-status-pulse::after {
  content: '';
  position: absolute;
  top: -3px;
  left: -3px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background-color: rgba(16, 185, 129, 0.55);
  animation: liveRadar 2s infinite ease-out;
}

/* --------------------------------------------------------------------------
   3. FILTRES, CARTES & TABLES DATATABLES
   -------------------------------------------------------------------------- */
.card-filters {
  transition: box-shadow 0.25s ease, border-color 0.25s ease;
}
.card-filters:focus-within {
  box-shadow: 0 6px 18px rgba(30, 58, 95, 0.08) !important;
  border-color: #CBD5E1 !important;
}

/* Animations et survols de lignes DataTables */
.table-data-interactive tbody tr {
  transition: background-color 0.18s ease;
}
.table-data-interactive tbody tr:hover {
  background-color: #F8FAFC !important;
}

/* Boutons d'actions avec micro-rebond */
.table-data-interactive a.btn, 
.table-data-interactive button.btn {
  transition: transform 0.16s ease, box-shadow 0.16s ease;
}
.table-data-interactive a.btn:hover,
.table-data-interactive button.btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

/* Bouton d'annulation de versement sécurisé */
.btn-action-cancel-paiement {
  border: 1.5px solid #EF4444 !important;
  color: #DC2626 !important;
  background: #FEF2F2 !important;
  transition: all 0.2s ease-in-out;
}
.btn-action-cancel-paiement:hover {
  background: #EF4444 !important;
  color: #FFFFFF !important;
  border-color: #EF4444 !important;
  box-shadow: 0 2px 8px rgba(239, 68, 68, 0.35);
}

/* --------------------------------------------------------------------------
   4. BADGES DE STATUT UNIFIÉS
   -------------------------------------------------------------------------- */
.badge-status {
  padding: 5px 12px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  text-transform: uppercase;
}
.badge-status.badge-success, .badge-success { background: #DCFCE7; color: #15803D; border: 1px solid #86EFAC; }
.badge-status.badge-warning, .badge-warning { background: #FEF3C7; color: #B45309; border: 1px solid #FDE68A; }
.badge-status.badge-danger, .badge-danger { background: #FEE2E2; color: #B91C1C; border: 1px solid #FCA5A5; }
.badge-status.badge-info, .badge-info { background: #E0F2FE; color: #0369A1; border: 1px solid #7DD3FC; }
.badge-status.badge-secondary, .badge-secondary { background: #F1F5F9; color: #475569; border: 1px solid #CBD5E1; }

/* --------------------------------------------------------------------------
   5. AVATARS ÉTUDIANTS ET UTILISATEURS
   -------------------------------------------------------------------------- */
.student-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid #E2E8F0;
}
.student-avatar-initials {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: linear-gradient(135deg, #1E3A5F 0%, #0F172A 100%);
  color: #FFFFFF;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 13.5px;
  letter-spacing: 0.5px;
  flex-shrink: 0;
  box-shadow: 0 2px 4px rgba(15, 23, 42, 0.15);
  border: 1.5px solid #CBD5E1;
}

/* --------------------------------------------------------------------------
   6. RÈGLES D'IMPRESSION STANDARDS (MEDIA PRINT)
   -------------------------------------------------------------------------- */
#print-header-banner, .print-signatures-block {
  display: none;
}

@media print {
  @page {
    size: A4 landscape;
    margin: 8mm;
  }
  body, html, .app-layout, .main-content, .content-wrapper {
    background: #FFFFFF !important;
    color: #000000 !important;
    margin: 0 !important;
    padding: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
    box-shadow: none !important;
  }
  header, .topbar, .topbar *, .sidebar, .sidebar *, aside, nav, .main-nav, .page-header, .no-print, 
  .card-filters, .card-kpi-container, .kpi-section-title,
  .dataTables_length, .dataTables_filter, .dataTables_info, .dataTables_paginate,
  button, a.btn, input, select, textarea, .form-control, .select2, .select2-container {
    display: none !important;
  }
  .card {
    box-shadow: none !important;
    border: none !important;
    padding: 0 !important;
    margin: 0 !important;
  }
  #table-paiements,
  #table-comptabilite-etudiants,
  #table-caisse-annexe,
  #table-scolarites,
  #table-sessions-caisse,
  #table-emplois_temps,
  #table-notes,
  #table-compositions,
  .table-print-clean {
    width: 100% !important;
    border-collapse: collapse !important;
    margin-top: 10px !important;
  }
  #table-paiements th, #table-paiements td,
  #table-comptabilite-etudiants th, #table-comptabilite-etudiants td,
  #table-caisse-annexe th, #table-caisse-annexe td,
  #table-scolarites th, #table-scolarites td,
  #table-sessions-caisse th, #table-sessions-caisse td,
  #table-emplois_temps th, #table-emplois_temps td,
  #table-notes th, #table-notes td,
  #table-compositions th, #table-compositions td,
  .table-print-clean th,
  .table-print-clean td {
    border: 1px solid #334155 !important;
    padding: 6px 8px !important;
    font-size: 11px !important;
    color: #000000 !important;
  }
  #table-paiements th,
  #table-comptabilite-etudiants th,
  #table-caisse-annexe th,
  #table-scolarites th,
  #table-sessions-caisse th,
  #table-emplois_temps th,
  #table-notes th,
  #table-compositions th,
  .table-print-clean th {
    background: #F1F5F9 !important;
    font-weight: 800 !important;
    text-transform: uppercase !important;
  }
  #table-paiements tr,
  #table-comptabilite-etudiants tr,
  #table-caisse-annexe tr,
  #table-scolarites tr,
  #table-sessions-caisse tr,
  #table-emplois_temps tr,
  #table-notes tr,
  #table-compositions tr,
  .table-print-clean tr {
    page-break-inside: avoid !important;
  }
  #table-paiements th:last-child, #table-paiements td:last-child,
  #table-comptabilite-etudiants th:last-child, #table-comptabilite-etudiants td:last-child,
  #table-caisse-annexe th:last-child, #table-caisse-annexe td:last-child,
  #table-scolarites th:last-child, #table-scolarites td:last-child,
  #table-sessions-caisse th:last-child, #table-sessions-caisse td:last-child,
  #table-emplois_temps th:last-child, #table-emplois_temps td:last-child,
  #table-notes th:last-child, #table-notes td:last-child,
  #table-compositions th:last-child, #table-compositions td:last-child {
    display: none !important;
  }
  #print-header-banner, .print-signatures-block {
    display: block !important;
  }
}

/* --------------------------------------------------------------------------
   7. MODULE FINANCE & CAISSE (COMPOSANTS DÉDIÉS)
   -------------------------------------------------------------------------- */
#table-paiements tbody tr,
#table-comptabilite-etudiants tbody tr,
#table-caisse-annexe tbody tr,
#table-scolarites tbody tr,
#table-sessions-caisse tbody tr {
  transition: background-color 0.18s ease;
}
#table-paiements tbody tr:hover,
#table-comptabilite-etudiants tbody tr:hover,
#table-caisse-annexe tbody tr:hover,
#table-scolarites tbody tr:hover,
#table-sessions-caisse tbody tr:hover {
  background-color: #F8FAFC !important;
}
#table-caisse-annexe tbody tr:hover {
  background-color: #FFFBEB !important;
}

#table-paiements a.btn, #table-paiements button.btn,
#table-comptabilite-etudiants a.btn, #table-comptabilite-etudiants button.btn,
#table-caisse-annexe a.btn, #table-caisse-annexe button.btn,
#table-scolarites a.btn, #table-scolarites button.btn,
#table-sessions-caisse a.btn, #table-sessions-caisse button.btn {
  transition: transform 0.16s ease, box-shadow 0.16s ease;
}
#table-paiements a.btn:hover, #table-paiements button.btn:hover,
#table-comptabilite-etudiants a.btn:hover, #table-comptabilite-etudiants button.btn:hover,
#table-caisse-annexe a.btn:hover, #table-caisse-annexe button.btn:hover,
#table-scolarites a.btn:hover, #table-scolarites button.btn:hover,
#table-sessions-caisse a.btn:hover, #table-sessions-caisse button.btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

/* Modals animés avec ouverture fluide */
#modal-encaissement-scolarite > div,
#modal-recu-paiement-success > div,
#modal-encaissement-annexe > div,
#modal-encaisser-annexe > div,
#modal-recu-annexe-success > div {
  animation: modalZoomIn 0.32s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Boutons d'encaissement avec Pulse lumineux */
#btn-open-encaissement-modal,
#btn-open-caisse-annexe-modal,
#btn-open-encaissement-annexe-modal {
  animation: btnPulseGlow 2.8s infinite ease-in-out;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}
#btn-open-encaissement-modal:hover,
#btn-open-caisse-annexe-modal:hover,
#btn-open-encaissement-annexe-modal:hover {
  transform: translateY(-2px) scale(1.03);
}

/* Animation slideDown générique */
@keyframes slideDown {
  from { opacity: 0; transform: translateY(-12px); }
  to { opacity: 1; transform: translateY(0); }
}

/* KPI icon box et wrapper transitions */
.kpi-icon-wrapper {
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.kpi-card:hover .kpi-icon-wrapper {
  transform: scale(1.12) rotate(-4deg);
}

/* DataTables structure standard */
.dataTables_wrapper {
  width: 100% !important;
  position: relative !important;
  clear: both !important;
  box-sizing: border-box !important;
}
.dataTables_wrapper .dataTables_length {
  float: left !important;
  margin-bottom: 16px !important;
}
.dataTables_wrapper .dataTables_filter {
  float: right !important;
  margin-bottom: 16px !important;
  text-align: right !important;
}
.dataTables_wrapper::after {
  content: "" !important;
  display: block !important;
  clear: both !important;
}
.dataTables_wrapper .dataTables_scroll,
.dataTables_wrapper table.dataTable {
  clear: both !important;
  width: 100% !important;
  margin-top: 14px !important;
  border-collapse: collapse !important;
}
table.dataTable thead th {
  background-color: #F8FAFC !important;
  color: #475569 !important;
  font-size: 13px !important;
  font-weight: 700 !important;
  padding: 12px 14px !important;
  border-bottom: 2px solid #E2E8F0 !important;
  white-space: nowrap !important;
  vertical-align: middle !important;
}
table.dataTable tbody td {
  padding: 12px 14px !important;
  font-size: 13px !important;
  vertical-align: middle !important;
  white-space: nowrap !important;
  border-bottom: 1px solid #F1F5F9 !important;
}
table.dataTable .annee-badge,
table.dataTable .badge {
  position: static !important;
  top: auto !important;
  right: auto !important;
  display: inline-block !important;
}

.table-responsive {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

/* Ajustement responsive spécifique pour le tableau à 9 colonnes de Comptabilité Étudiants */
#table-comptabilite-etudiants thead th {
  padding: 10px 8px !important;
  font-size: 11px !important;
}
#table-comptabilite-etudiants tbody td {
  padding: 10px 8px !important;
  font-size: 12.5px !important;
}
#table-comptabilite-etudiants tbody td:nth-child(1),
#table-comptabilite-etudiants tbody td:nth-child(2) {
  white-space: normal !important;
}

/* Classes d'impression PV et Bons */
@media print {
  .btn-no-print { display: none !important; }
  .print-area { border: none !important; box-shadow: none !important; padding: 0 !important; width: 100% !important; }
  .card-bon { border: 1px dashed #000000 !important; box-shadow: none !important; }
  .receipt-page-container { border: 2px solid #800000 !important; padding: 12px !important; margin: 0 !important; box-shadow: none !important; width: 100% !important; box-sizing: border-box !important; }
  .institution-logo-img { max-width: 145px !important; max-height: 70px !important; display: block !important; }
}

/* --------------------------------------------------------------------------
   8. REÇUS DE PAIEMENT & BORDEREAUX OFFICIELS
   -------------------------------------------------------------------------- */
.receipt-outer-frame {
  border: 2px solid #800000;
  padding: 16px;
  background: #FFFFFF;
  font-family: Arial, Helvetica, sans-serif;
  color: #000000;
  max-width: 860px;
  margin: 0 auto;
  box-sizing: border-box;
}
.receipt-header-table {
  width: 100%;
  border-collapse: collapse;
}
.institution-logo-img {
  max-width: 145px;
  max-height: 70px;
  object-fit: contain;
  display: block;
}
.logo-eicg-box {
  background: #800000;
  color: #FFFFFF;
  padding: 10px 14px;
  border-radius: 4px;
  text-align: center;
  font-weight: 900;
  font-size: 15px;
  line-height: 1.2;
}
.institution-title {
  color: #800000;
  font-weight: bold;
  text-decoration: underline;
  font-size: 16px;
  text-align: center;
  margin: 0 0 8px 0;
}
.institution-subtitle {
  font-style: italic;
  font-weight: bold;
  font-size: 13px;
  text-align: center;
  margin: 8px 0 3px 0;
}
.institution-contacts {
  font-style: italic;
  font-size: 12px;
  text-align: center;
  margin: 0;
}
.title-gray-banner {
  background: #9E9E9E;
  color: #000000;
  font-weight: bold;
  font-size: 18px;
  text-align: center;
  padding: 6px;
  margin: 10px 0 6px 0;
  letter-spacing: 0.5px;
}
.annee-academique-title {
  text-align: center;
  font-size: 14px;
  font-weight: bold;
  margin-bottom: 12px;
}
.student-photo-box {
  border: 1px solid #000000;
  width: 100px;
  height: 115px;
  float: right;
  margin-left: 12px;
  background: #F8FAFC;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.info-grid-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  line-height: 1.5;
}
.gray-inline-badge {
  background: #D1D5DB;
  padding: 2px 8px;
  font-weight: bold;
  display: inline-block;
}
.blue-text-words {
  color: #0000FF;
  font-weight: bold;
}
.fin-breakdown-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 10px;
  margin-bottom: 12px;
  font-size: 12.5px;
  border: 1px solid #000000;
}
.fin-breakdown-table th {
  background: #D1D5DB;
  border: 1px solid #000000;
  padding: 6px 8px;
  text-align: center;
  font-weight: bold;
}
.fin-breakdown-table td {
  border: 1px solid #000000;
  padding: 6px 8px;
}
.fin-total-row {
  background: #404040;
  color: #FFFFFF;
  font-weight: bold;
}
.fin-total-row td {
  border: 1px solid #000000;
  color: #FFFFFF;
  font-weight: bold;
}
.yellow-nb-box {
  background: #FFFF00;
  border: 1px solid #000000;
  padding: 6px 10px;
  margin: 10px 0;
  font-size: 12px;
  font-weight: bold;
  font-style: italic;
  color: #000000;
  line-height: 1.4;
}
.barcode-simulated {
  font-family: 'Libre Barcode 128', 'Code 128', monospace;
  font-size: 26px;
  letter-spacing: 2px;
  text-align: right;
}

/* --------------------------------------------------------------------------
   9. MODULE SCOLARITÉ & ADMISSIONS (BOUTONS D'ACTION, WIZARD, BADGES & PRINT)
   -------------------------------------------------------------------------- */
/* Boutons d'actions rapides (tableaux étudiants & scolarité) */
.btn-action-icon {
  width: 32px;
  height: 32px;
  min-width: 32px;
  padding: 0;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  cursor: pointer;
  text-decoration: none;
  box-sizing: border-box;
}
.btn-action-icon:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}
.btn-action-icon i, .btn-action-icon svg {
  width: 15px;
  height: 15px;
  stroke: currentColor;
}
.btn-action-classe {
  background: #FFFBEB;
  border: 1px solid #FCD34D;
  color: #D97706;
}
.btn-action-classe:hover {
  background: #F59E0B;
  border-color: #F59E0B;
  color: #FFFFFF;
}
.btn-action-print {
  background: #F0FDF4;
  border: 1px solid #86EFAC;
  color: #166534;
}
.btn-action-print:hover {
  background: #16A34A;
  border-color: #16A34A;
  color: #FFFFFF;
}
.btn-action-dossier {
  background: #EFF6FF;
  border: 1px solid #BFDBFE;
  color: #1D4ED8;
}
.btn-action-dossier:hover {
  background: #1E3A5F;
  border-color: #1E3A5F;
  color: #FFFFFF;
}
.btn-action-edit {
  background: #F8FAFC;
  border: 1px solid #CBD5E1;
  color: #475569;
}
.btn-action-edit:hover {
  background: #475569;
  border-color: #475569;
  color: #FFFFFF;
}
.btn-action-cancel {
  background: #FEF2F2;
  border: 1px solid #FECACA;
  color: #DC2626;
}
.btn-action-cancel:hover {
  background: #EF4444;
  border-color: #EF4444;
  color: #FFFFFF;
}

/* Composants Assistant Inscription (Wizard Stepper) */
.wizard-stepper {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 28px;
  background: #FFFFFF;
  border-radius: 12px;
  padding: 16px 24px;
  border: 1px solid #E2E8F0;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
  overflow-x: auto;
}
.wizard-step-item {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 13px;
  color: #94A3B8;
  position: relative;
  white-space: nowrap;
  padding: 6px 12px;
  border-radius: 8px;
  transition: all 0.25s ease;
  cursor: pointer;
}
.wizard-step-item.active {
  color: #1E3A5F;
  background: #EFF6FF;
}
.wizard-step-item.completed {
  color: #15803D;
}
.wizard-step-number {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #F1F5F9;
  color: #64748B;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 800;
  transition: all 0.25s ease;
}
.wizard-step-item.active .wizard-step-number {
  background: #1E3A5F;
  color: #FFFFFF;
}
.wizard-step-item.completed .wizard-step-number {
  background: #DCFCE7;
  color: #15803D;
}
.wizard-step-divider {
  flex: 1;
  height: 2px;
  background: #E2E8F0;
  margin: 0 12px;
  min-width: 20px;
}
.wizard-card {
  background: #FFFFFF;
  border-radius: 12px;
  padding: 28px;
  border: 1px solid #E2E8F0;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}
.wizard-step-content {
  display: none;
}
.wizard-step-content.active {
  display: block;
}
.wizard-grid-3,
.wizard-grid-etape1,
.edit-grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  width: 100%;
}
@media (max-width: 991px) {
  .wizard-grid-3,
  .wizard-grid-etape1,
  .edit-grid-3 {
    grid-template-columns: repeat(2, 1fr);
  }
}
@media (max-width: 640px) {
  .wizard-grid-3,
  .wizard-grid-etape1,
  .edit-grid-3 {
    grid-template-columns: 1fr;
  }
}

/* Switch & Slider (Accessoires & options) */
.switch input:checked + .slider {
  background-color: #15803D !important;
}
.switch input:focus + .slider {
  box-shadow: 0 0 1px #15803D;
}
.switch input:checked + .slider:before {
  transform: translateX(18px);
}
.slider:before {
  position: absolute;
  content: "";
  height: 14px;
  width: 14px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: .3s;
  border-radius: 50%;
}

/* Colonnes DataTables avec retours à la ligne configurés */
table.dataTable tbody td.col-libelle,
table.dataTable td.col-libelle,
table.dataTable th.col-libelle {
  white-space: normal !important;
  word-break: normal !important;
  overflow-wrap: break-word !important;
  line-height: 1.4 !important;
  min-width: 250px !important;
  max-width: 420px !important;
}
table.dataTable tbody td.col-desc,
table.dataTable td.col-desc,
table.dataTable th.col-desc {
  white-space: normal !important;
  word-break: normal !important;
  overflow-wrap: break-word !important;
  line-height: 1.4 !important;
  min-width: 200px !important;
  max-width: 400px !important;
}
table.dataTable tbody td.col-piece,
table.dataTable td.col-piece,
table.dataTable th.col-piece {
  white-space: normal !important;
  word-break: normal !important;
  overflow-wrap: break-word !important;
  min-width: 220px !important;
  max-width: 380px !important;
}

.btn-is-loading {
  opacity: 0.7;
  pointer-events: none;
}

/* Impressions dédiées : Récépissés, Badges & Fiches Navettes */
@media print {
  body.printing-financial-statement #modal_fiche_navette {
    display: none !important;
  }
  body.printing-financial-statement #financial-statement-modal {
    display: block !important;
    position: static !important;
    background: #FFFFFF !important;
    padding: 0 !important;
    margin: 0 !important;
    width: 100% !important;
    box-shadow: none !important;
    z-index: 999999 !important;
  }
  body.printing-financial-statement #financial-statement-modal > div {
    box-shadow: none !important;
    border: none !important;
    max-width: 100% !important;
    padding: 0 !important;
    margin: 0 !important;
  }
  body.printing-financial-statement #printable-financial-zone {
    display: block !important;
    visibility: visible !important;
    padding: 20px !important;
  }
  body:not(.printing-financial-statement) #modal_fiche_navette {
    display: block !important;
    position: static !important;
    background: none !important;
    padding: 0 !important;
    width: 100% !important;
    height: auto !important;
    z-index: 1 !important;
  }
  body:not(.printing-financial-statement) #modal_fiche_navette > div {
    box-shadow: none !important;
    border: none !important;
    max-width: 100% !important;
    padding: 0 !important;
    margin: 0 !important;
  }
  body:not(.printing-financial-statement) #modal_fiche_navette .btn-close-fiche-navette,
  body:not(.printing-financial-statement) #modal_fiche_navette .modal-custom-header,
  body:not(.printing-financial-statement) #modal_fiche_navette .modal-custom-footer,
  body:not(.printing-financial-statement) #modal_fiche_navette .no-print {
    display: none !important;
  }
  body:not(.printing-financial-statement) #printable-voucher-zone {
    display: block !important;
    visibility: visible !important;
    position: static !important;
    width: 100% !important;
    margin: 0 !important;
    padding: 24px !important;
    border: 2px solid #1E3A5F !important;
    box-sizing: border-box !important;
  }
  #printable-recepisse-area, #printable-bon-remise-area {
    position: absolute !important;
    left: 0 !important;
    top: 0 !important;
    width: 100% !important;
    padding: 0 !important;
  }
  #section-carte-scolaire {
    position: absolute !important;
    left: 0 !important;
    top: 0 !important;
    width: 100% !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 30px !important;
    padding: 20px !important;
    background: #FFF !important;
  }
  .badge-card-container {
    box-shadow: none !important;
    border: 1px solid #94A3B8 !important;
    page-break-inside: avoid !important;
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }
}

/* --------------------------------------------------------------------------
   10. MODULE PÉDAGOGIE, NOTES, BULLETINS & EMPLOIS DU TEMPS
   -------------------------------------------------------------------------- */
/* Grille de saisie des notes & évaluations */
.input-readonly {
  background-color: #F8FAFC !important;
  color: #1E3A5F !important;
  font-weight: 700 !important;
  cursor: not-allowed !important;
  border-color: #CBD5E1 !important;
}
.eval-badge {
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.input-valeur-note:focus {
  border-color: #1E3A5F !important;
  box-shadow: 0 0 0 3px rgba(30, 58, 95, 0.15) !important;
  outline: none;
  background-color: #FFFFFF !important;
}
.row-absent {
  background-color: #FEF2F2 !important;
}
.row-dirty {
  background-color: #F0FDF4 !important;
}
.progress-track {
  background-color: #E2E8F0;
  border-radius: 999px;
  height: 8px;
  overflow: hidden;
  width: 100%;
}
.progress-fill {
  background: linear-gradient(90deg, #1E3A5F 0%, #16A34A 100%);
  height: 100%;
  border-radius: 999px;
  transition: width 0.3s ease;
}
.kbd-hint {
  background: #E2E8F0;
  color: #334155;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 700;
  font-family: monospace;
  border: 1px solid #CBD5E1;
}

/* Tableaux de bulletin académique */
.bulletin-table th, .bulletin-table td {
  padding: 10px 12px;
  border-bottom: 1px solid #E2E8F0;
}
.bulletin-table thead th {
  background: #F8FAFC;
  font-weight: 700;
  font-size: 12px;
  color: #475569;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Cartes matières (compositions & examens) */
.matiere-card-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  border: 1.5px solid #CBD5E1;
  border-radius: 8px;
  margin-bottom: 6px;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  background: #FFFFFF;
}
.matiere-card-item:hover {
  border-color: #0284C7;
  background: #F0F9FF;
  transform: translateX(4px);
}
.matiere-card-item.selected {
  border-color: #0284C7;
  background: #EFF6FF;
  box-shadow: 0 2px 4px rgba(2, 132, 199, 0.12);
}

@keyframes btnSpin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}
.btn-circle-loader {
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-radius: 50%;
  border-top-color: #FFFFFF;
  animation: btnSpin 0.65s linear infinite;
  vertical-align: middle;
}

/* Boutons & grille emplois du temps */
.btn-print-schedule:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 14px rgba(2,132,199,0.45) !important;
  filter: brightness(1.05);
}
.btn-action-planning:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 10px rgba(30,58,95,0.3) !important;
}
.btn-action-grille:hover {
  background: #E2E8F0 !important;
  color: #0F1F2A !important;
}
.btn-action-reset:hover {
  background: #DC2626 !important;
  color: #FFFFFF !important;
  border-color: #DC2626 !important;
  box-shadow: 0 4px 10px rgba(220,38,38,0.3) !important;
}

@media (max-width: 640px) {
  .schedule-timing-row {
    grid-template-columns: 1fr !important;
  }
}

/* Impressions dédiées : Bulletins, PVs et Emplois du temps */
@media print {
  .card-bulletin, .pv-container {
    border: none !important;
    box-shadow: none !important;
    padding: 0 !important;
  }
  .print-header {
    display: block !important;
    margin-bottom: 20px !important;
  }
  .page-break {
    page-break-after: always;
  }
  #printable-schedule-area {
    position: absolute !important;
    left: 0 !important;
    top: 0 !important;
    width: 100% !important;
    padding: 20px !important;
    background: #FFFFFF !important;
  }
  .print-only-header {
    display: block !important;
  }
}

/* --------------------------------------------------------------------------
   11. MODULE ADMINISTRATION & TABLEAU DE BORD (DASHBOARD)
   -------------------------------------------------------------------------- */
.dash-card {
  background: #FFFFFF;
  border: 1px solid #E2E8F0;
  border-radius: 14px;
  padding: 20px;
  box-shadow: 0 2px 4px rgba(15, 23, 42, 0.03);
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}
.dash-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 20px rgba(15, 23, 42, 0.08);
  border-color: #CBD5E1;
}
.dash-quick-link {
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px;
  border-radius: 12px;
  background: #FFFFFF;
  border: 1px solid #E2E8F0;
  transition: all 0.2s ease;
}
.dash-quick-link:hover {
  background: #F8FAFC;
  border-color: var(--primary-color, #1E3A5F);
  transform: translateY(-2px);
}

/* Grille & Cartes des 5 Sections Fonctionnelles Réduites & Harmonieuses */
.dash-module-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
}
@media (max-width: 1366px) {
  .dash-module-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}
@media (max-width: 768px) {
  .dash-module-grid {
    grid-template-columns: 1fr;
  }
}
.dash-module-card {
  background: #FFFFFF;
  border: 1px solid #E2E8F0;
  border-radius: 12px;
  padding: 14px 16px;
  text-decoration: none !important;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 124px;
  box-shadow: 0 2px 4px -1px rgba(15, 23, 42, 0.03), 0 1px 2px -1px rgba(15, 23, 42, 0.02);
  transition: all 0.22s cubic-bezier(0.4, 0, 0.2, 1);
}
.dash-module-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 20px -4px rgba(15, 23, 42, 0.08), 0 4px 8px -4px rgba(15, 23, 42, 0.04);
  border-color: #CBD5E1;
}
.dash-module-icon {
  width: 36px;
  height: 36px;
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.dash-module-icon svg,
.dash-module-icon i {
  width: 18px !important;
  height: 18px !important;
}
.dash-module-num {
  font-size: 20px !important;
  font-weight: 800;
  line-height: 1.1;
  margin-top: 8px !important;
  letter-spacing: -0.3px;
}
.dash-module-card span[style*="border-radius: 20px"] {
  font-size: 10.5px !important;
  padding: 2px 8px !important;
}
.dash-module-card div > div[style*="font-size: 12px"] {
  font-size: 11px !important;
  margin-top: 2px !important;
}
.dash-module-card > div:last-child {
  border-top: 1px solid #F1F5F9;
  padding-top: 8px !important;
  margin-top: 10px !important;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.dash-module-card > div:last-child strong {
  font-size: 12px !important;
}
.dash-module-card > div:last-child svg,
.dash-module-card > div:last-child i {
  width: 14px !important;
  height: 14px !important;
}

/* ==========================================================================
   MODALES : SCROLL LOCK ARRIÈRE-PLAN & CONTENU SCROLLABLE UNIVERSEL
   ========================================================================== */

/* 1. Verrouillage strict du défilement de l'arrière-plan de la page */
html.modal-open,
body.modal-open {
  overflow: hidden !important;
}

/* 2. L'overlay modal : centrage sécurisé et scroll global au besoin */
.modal-overlay,
.modal,
.modal-custom,
[id^="modal-"],
[id^="modal_"],
[id*="Modal"] {
  overflow-x: hidden !important;
  overflow-y: auto !important;
  overscroll-behavior: contain !important;
  -webkit-overflow-scrolling: touch;
  box-sizing: border-box !important;
}

/* 3. La boîte de dialogue modale (carte blanche) :
      - Elle ne dépasse JAMAIS la hauteur de l'écran (max-height: calc(100vh - 40px))
      - Elle s'organise en flex colonne (en-tête fixe en haut, contenu scrollable au milieu) */
.modal-overlay > div,
.modal > div,
.modal-custom > div,
[id^="modal-"] > div,
[id^="modal_"] > div,
[id*="Modal"] > div,
.modal-dialog {
  max-height: calc(100vh - 40px) !important;
  display: flex !important;
  flex-direction: column !important;
  overflow: hidden !important;
  margin: auto !important;
  max-width: 100%;
  overscroll-behavior: contain !important;
}

/* 4. En-tête de la modale : reste toujours visible et ancré en haut */
.modal-overlay > div > div:first-child,
.modal > div > div:first-child,
.modal-custom > div > div:first-child,
[id^="modal-"] > div > div:first-child,
[id^="modal_"] > div > div:first-child,
[id*="Modal"] > div > div:first-child,
.modal-header {
  flex-shrink: 0 !important;
}

/* 5. Corps de la modale (Formulaire ou Contenu) : DÉFILEMENT FLUIDE & SCROLLABLE */
.modal-overlay > div > form,
.modal-overlay > div > div:nth-child(2),
.modal > div > form,
.modal > div > div:nth-child(2),
.modal-custom > div > form,
.modal-custom > div > div:nth-child(2),
[id^="modal-"] > div > form,
[id^="modal-"] > div > div:nth-child(2),
[id^="modal_"] > div > form,
[id^="modal_"] > div > div:nth-child(2),
[id*="Modal"] > div > form,
[id*="Modal"] > div > div:nth-child(2),
.modal-body {
  overflow-y: auto !important;
  overflow-x: hidden !important;
  flex: 1 1 auto !important;
  min-height: 0 !important;
  overscroll-behavior: contain !important;
  -webkit-overflow-scrolling: touch;
}

/* 6. Barre de défilement élégante et discrète pour le contenu de la modale */
.modal-overlay > div > form::-webkit-scrollbar,
.modal-overlay > div > div:nth-child(2)::-webkit-scrollbar,
[id^="modal-"] > div > form::-webkit-scrollbar,
[id^="modal-"] > div > div:nth-child(2)::-webkit-scrollbar,
[id^="modal_"] > div > form::-webkit-scrollbar,
[id^="modal_"] > div > div:nth-child(2)::-webkit-scrollbar,
.modal-body::-webkit-scrollbar {
  width: 6px;
}
.modal-overlay > div > form::-webkit-scrollbar-thumb,
.modal-overlay > div > div:nth-child(2)::-webkit-scrollbar-thumb,
[id^="modal-"] > div > form::-webkit-scrollbar-thumb,
[id^="modal-"] > div > div:nth-child(2)::-webkit-scrollbar-thumb,
[id^="modal_"] > div > form::-webkit-scrollbar-thumb,
[id^="modal_"] > div > div:nth-child(2)::-webkit-scrollbar-thumb,
.modal-body::-webkit-scrollbar-thumb {
  background: #CBD5E1;
  border-radius: 4px;
}
.modal-overlay > div > form::-webkit-scrollbar-thumb:hover,
.modal-overlay > div > div:nth-child(2)::-webkit-scrollbar-thumb:hover,
[id^="modal-"] > div > form::-webkit-scrollbar-thumb:hover,
[id^="modal-"] > div > div:nth-child(2)::-webkit-scrollbar-thumb:hover,
[id^="modal_"] > div > form::-webkit-scrollbar-thumb:hover,
[id^="modal_"] > div > div:nth-child(2)::-webkit-scrollbar-thumb:hover,
.modal-body::-webkit-scrollbar-thumb:hover {
  background: #94A3B8;
}
