@media screen {
    :where(.ukb-payments-scope) .accessible-dialog-overlay { position: fixed; inset: 0; z-index: 22000; padding: 16px; display: flex; align-items: center; justify-content: center; background: rgba(5,12,25,.8); }
    :where(.ukb-payments-scope) .staff-dialog { box-sizing: border-box; max-height: calc(100dvh - 32px); overflow-y: auto; background: #fff !important; color: #172033 !important; }
    :where(.ukb-payments-scope) .staff-dialog--notice { width: 100%; max-width: 440px; border-radius: 12px; padding: 24px; margin: 0 !important; font: 15px/1.5 system-ui,sans-serif; }
    :where(.ukb-payments-scope) .staff-dialog :is(h2,h3,h4,label,.popup-message,.date-preview,.duration-info) { color: #172033 !important; background: transparent !important; }
    :where(.ukb-payments-scope) .staff-dialog :is(input,select,textarea) { box-sizing: border-box; max-width: 100%; color: #172033 !important; background: #fff !important; border: 1px solid #64748b !important; min-height: 36px; }
    :where(.ukb-payments-scope) .staff-dialog button { min-width: 36px; min-height: 36px; color: #fff !important; background: #075985 !important; border: 1px solid #075985; }
    :where(.ukb-payments-scope) .staff-dialog :is(.cancel,.btn-secondary,.modal-close,.close-btn),:where(.ukb-payments-scope) .staff-dialog--notice button[data-modal-cancel] { background: #991b1b !important; border-color: #991b1b; color: #fff !important; }
    :where(.ukb-payments-scope) .staff-dialog.mention-popup button, :where(.ukb-payments-scope) .staff-dialog.mention-popup button * { color: #fff !important; }
    :where(.ukb-payments-scope) .staff-dialog button:disabled { opacity: 1; color: #475569 !important; background: #e2e8f0 !important; border-color: #94a3b8; cursor: not-allowed; }
    :where(.ukb-payments-scope) .staff-dialog :is(button,input,select,textarea,a,[tabindex]):focus-visible { outline: 3px solid #2563eb !important; outline-offset: 3px; }
    :where(.ukb-payments-scope) .staff-dialog .modal-header { background: #f1f5f9 !important; color: #172033 !important; }
    :where(.ukb-payments-scope) .staff-dialog .modal-header > svg { color: #172033 !important; }
    :where(.ukb-payments-scope) .staff-dialog .modal-history-header { background: #f1f5f9 !important; color: #172033 !important; }
    :where(.ukb-payments-scope) .staff-dialog .popup-actions { display: flex; flex-wrap: wrap; gap: 10px; }
    :where(.ukb-payments-scope) .staff-dialog--notice :is(.success-icon,.error-icon,.info-icon) { font-size: 32px; margin: 0 auto 12px; color: #075985; }
    :where(.ukb-payments-scope) .staff-dialog--advance > div { background: #f1f5f9 !important; }
    :where(.ukb-payments-scope) .staff-dialog--advance :is(div,p,span,strong,small) { color: #172033 !important; }
    :where(.ukb-payments-scope) .staff-dialog [role="alert"] { color: #991b1b !important; background: #fff1f2 !important; padding: 12px; }
    :where(.ukb-payments-scope) .staff-dialog :is(th) { color: #fff !important; background: #172033 !important; }
    :where(.ukb-payments-scope) .staff-dialog :is(td) { color: #172033 !important; background: #fff !important; }
    @media (max-width: 600px) {
        :where(.ukb-payments-scope) .staff-dialog { width: calc(100vw - 32px) !important; max-width: calc(100vw - 32px) !important; padding: 16px !important; margin: 0 !important; }
        :where(.ukb-payments-scope) .staff-dialog :is(.modal-actions,.date-input-group) { flex-wrap: wrap; }
    }
}

/* Base Styles */
:where(.ukb-payments-scope) * {
  padding: 0;
  margin: 0;
  box-sizing: border-box;
  transition: all 0.3s ease;
}
:where(.ukb-payments-scope) body.sidebar-open {
  overflow: hidden;
}
:where(.ukb-payments-scope) .payment-dashboard {
  font-family: Arial, sans-serif;
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
  overflow-x: hidden;
  max-width: 100vw;
  box-sizing: border-box;

}

:where(.ukb-payments-scope) .payment-section {
  width: 100%;
  overflow-x: auto;
  margin: 20px 0;
}

/* Styles pour les popups */
:where(.ukb-payments-scope) .popup-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0, 0, 0, 0.5);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000;
  overflow-y: auto; /* Permet le scroll */
  padding: 20px; /* Ajoute de l'espace autour */
}

:where(.ukb-payments-scope) .user-profile {
  display: flex;
  align-items: center;
  gap: 20px;
}

:where(.ukb-payments-scope) .notification-icons {
  display: flex;
  gap: 15px;
}

:where(.ukb-payments-scope) .confirmation-popup {
  background: white;
  padding: 25px;
  border-radius: 10px;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
  max-width: 400px;
  width: 100%;
  text-align: center;
  animation: ukb-payments-fadeIn 0.3s;
  margin: auto; /* Centre le popup */
}

@keyframes ukb-payments-fadeIn {
  from { opacity: 0; transform: translateY(-20px); }
  to { opacity: 1; transform: translateY(0); }
}

:where(.ukb-payments-scope) .popup-title {
  font-size: 1.5rem;
  margin-bottom: 15px;
  color: #333;
}

:where(.ukb-payments-scope) .popup-message {
  margin-bottom: 20px;
  color: #555;
}

:where(.ukb-payments-scope) .popup-actions {
  display: flex;
  justify-content: center;
  gap: 15px;
}

:where(.ukb-payments-scope) .popup-btn {
  padding: 8px 20px;
  border: none;
  border-radius: 5px;
  cursor: pointer;
  font-weight: 500;
  transition: all 0.2s;
}

:where(.ukb-payments-scope) .popup-btn.confirm {
  background-color: #4CAF50;
  color: white;
}

:where(.ukb-payments-scope) .popup-btn.confirm:hover {
  background-color: #45a049;
}

:where(.ukb-payments-scope) .popup-btn.cancel {
  background-color: #f44336;
  color: white;
}

:where(.ukb-payments-scope) .popup-btn.cancel:hover {
  background-color: #d32f2f;
}

:where(.ukb-payments-scope) .popup-btn.neutral {
  background-color: #2196F3;
  color: white;
}
:where(.ukb-payments-scope) .popup-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0, 0, 0, 0.5);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000;
  overflow-y: auto; /* Permet le scroll */
  padding: 20px;
}

:where(.ukb-payments-scope) .confirmation-popup {
  background: white;
  padding: 25px;
  border-radius: 10px;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
  max-width: 400px;
  width: 100%;
  text-align: center;
  animation: ukb-payments-fadeIn 0.3s;
  margin: auto;
}

@keyframes ukb-payments-fadeIn {
  from { opacity: 0; transform: translateY(-20px); }
  to { opacity: 1; transform: translateY(0); }
}

:where(.ukb-payments-scope) .popup-title {
  font-size: 1.5rem;
  margin-bottom: 15px;
  color: #333;
}

:where(.ukb-payments-scope) .popup-message {
  margin-bottom: 20px;
  color: #555;
}

:where(.ukb-payments-scope) .popup-actions {
  display: flex;
  justify-content: center;
  gap: 15px;
}

:where(.ukb-payments-scope) .popup-btn {
  padding: 8px 20px;
  border: none;
  border-radius: 5px;
  cursor: pointer;
  font-weight: 500;
  transition: all 0.2s;
}

:where(.ukb-payments-scope) .popup-btn.confirm {
  background-color: #4CAF50;
  color: white;
}

:where(.ukb-payments-scope) .popup-btn.confirm:hover {
  background-color: #45a049;
}

:where(.ukb-payments-scope) .popup-btn.cancel {
  background-color: #f44336;
  color: white;
}

:where(.ukb-payments-scope) .popup-btn.cancel:hover {
  background-color: #d32f2f;
}

:where(.ukb-payments-scope) .popup-btn.neutral {
  background-color: #2196F3;
  color: white;
}

:where(.ukb-payments-scope) .popup-btn.neutral:hover {
  background-color: #0b7dda;
}

:where(.ukb-payments-scope) .success-icon {
  color: #4CAF50;
  font-size: 3rem;
  margin-bottom: 15px;
}

:where(.ukb-payments-scope) .error-icon {
  color: #f44336;
  font-size: 3rem;
  margin-bottom: 15px;
}
:where(.ukb-payments-scope) .popup-btn.neutral:hover {
  background-color: #0b7dda;
}

:where(.ukb-payments-scope) .success-icon {
  color: #4CAF50;
  font-size: 3rem;
  margin-bottom: 15px;
}

:where(.ukb-payments-scope) .error-icon {
  color: #f44336;
  font-size: 3rem;
  margin-bottom: 15px;
}

:where(.ukb-payments-scope) .table-header {
  display: flex;
  justify-content: space-between;
  margin-bottom: 20px;
  font-family: Monaco;
  font-size: 25px;
}

:where(.ukb-payments-scope) .icon-btn1, :where(.ukb-payments-scope) .icon-btn2, :where(.ukb-payments-scope) .icon-btn3, :where(.ukb-payments-scope) .icon-btn4, :where(.ukb-payments-scope) .icon-btn5, :where(.ukb-payments-scope) .icon-btn6, :where(.ukb-payments-scope) .icon-btn7, :where(.ukb-payments-scope) .icon-btn-edit, :where(.ukb-payments-scope) .icon-btn-advance {
  background-color: #010101;
  color: white;
  border: none;
  padding: 8px 12px;
  cursor: pointer;
  border-radius: 4px;
  width: 2px;
  min-width: 50px;
  font-size: 12 px;
}

:where(.ukb-payments-scope) .icon-btn2 {
  background-color: #58a64f;
}

:where(.ukb-payments-scope) .icon-btn3 {
  background-color: #1f1f1f;
}

:where(.ukb-payments-scope) .icon-btn4 {
  background-color: #0880ff;
}

:where(.ukb-payments-scope) .icon-btn5 {
  background-color: #f8152b;
}

:where(.ukb-payments-scope) .icon-btn6 {
  background-color: #1f1f1f;
}

:where(.ukb-payments-scope) .icon-btn7 {
  background-color: #000a56;
}

:where(.ukb-payments-scope) thead {
  background: #ffffff;
  color: #ffffff;
}

:where(.ukb-payments-scope) .payment-table {
  width: 100%;
  min-width: 1200px; /* Largeur minimale pour garder la lisibilité */
  border-collapse: collapse;
  font-size: 14px;
  background: #1a252f;
  color: #ffffff;
}

:where(.ukb-payments-scope) .payment-table th,
:where(.ukb-payments-scope) .payment-table td {
  border: 1px solid #34495e;
  padding: 10px 8px;
  text-align: center;
  white-space: none;
  overflow: hidden;
  text-overflow: ellipsis;
}
:where(.ukb-payments-scope) .payment-table th {
  background: #2c3e50;
  color: #ecf0f1;
  font-weight: bold;
  position: sticky;
  top: 0;
  z-index: 10;
}

:where(.ukb-payments-scope) .popup-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%; /* Corrigé de 50% à 100% */
  height: 100%; /* Corrigé de 80% à 100% */
  background-color: rgba(0, 0, 0, 0.5);
  display: flex;
  justify-content: center;
  align-items: flex-start; /* Changé de center à flex-start pour permettre le scroll */
  z-index: 1000;
  overflow-y: auto;
  padding: 20px;
}
:where(.ukb-payments-scope) .payment-table th:nth-child(15),
:where(.ukb-payments-scope) .payment-table td:nth-child(15) {
  text-align: center;
  min-width: 180px; /* Largeur minimale pour les icônes */
  white-space: nowrap;
}
:where(.ukb-payments-scope) .payment-table td:last-child {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 5px;
  flex-wrap: nowrap;
}

:where(.ukb-payments-scope) .popup {
  background: white;
  padding: 20px;
  border-radius: 8px;
  width: 90%; /* Modifié de 30% à 90% pour mobile */
  max-width: 500px; /* Augmenté la max-width */
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  margin: 20px auto; /* Centrage avec marge */
}

:where(.ukb-payments-scope) .form-group {
  margin-bottom: 15px;
}

:where(.ukb-payments-scope) .form-group label {
  display: block;
  margin-bottom: 5px;
}

:where(.ukb-payments-scope) .form-group input {
  width: 100%;
  padding: 8px;
  box-sizing: border-box;
}

:where(.ukb-payments-scope) .popup-buttons {
  display: flex;
  justify-content: flex-end;
}

:where(.ukb-payments-scope) .cancel-btn, :where(.ukb-payments-scope) .submit-btn {
  background: #f44336;
  color: white;
  border: none;
  padding: 8px 12px;
  margin-right: 10px;
  cursor: pointer;
}

:where(.ukb-payments-scope) .submit-btn {
  background: #4caf50;
}

:where(.ukb-payments-scope) .sidebar ul {
  list-style-type: none;
  padding: 0;
  margin: 0;
}

:where(.ukb-payments-scope) .sidebar ul li {
  padding: 15px 20px;
  cursor: pointer;
  transition: background-color 0.3s;
}

:where(.ukb-payments-scope) .sidebar ul li:hover {
  background-color: #34495e;
}

:where(.ukb-payments-scope) .sidebar ul li a {
  color: white;
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 10px;
}

/* Main Container */
:where(.ukb-payments-scope) .main-content {
  margin-left: 200px;
  padding: 20px;
  transition: margin-left 0.3s;
  width: calc(100% - 200px);
  max-width: 100%;
  overflow-x: hidden;
}
/* Dashboard Counters */


/* Status Styles */
:where(.ukb-payments-scope) .status-paid {
  background-color: #27ae60;
  color: white;
  font-weight: bold;
  padding: 4px 8px;
  border-radius: 12px;
  font-size: 11px;
}

:where(.ukb-payments-scope) .status-unpaid {
  background-color: #e74c3c;
  color: white;
  font-weight: bold;
  padding: 4px 8px;
  border-radius: 12px;
  font-size: 11px;
}

/* Button Styles */
:where(.ukb-payments-scope) .icon-btn4, :where(.ukb-payments-scope) .icon-btn-edit, :where(.ukb-payments-scope) .icon-btn-advance, :where(.ukb-payments-scope) .icon-btn5, :where(.ukb-payments-scope) .icon-btn6, :where(.ukb-payments-scope) .icon-btn7 {
  display: inline-flex;
  background: none;
  border: none;
  padding: 6px;
  margin: 2px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 12px;
  transition: all 0.3s ease;
  min-width: 30px;
  height: 30px;

}



:where(.ukb-payments-scope) .icon-btn4 {
  background-color: #3498db;
  color: white;
}

:where(.ukb-payments-scope) .icon-btn4:hover {
  background-color: #2980b9;
}

:where(.ukb-payments-scope) .icon-btn-edit {
  background-color: #f39c12;
  color: white;
}

:where(.ukb-payments-scope) .icon-btn-edit:hover {
  background-color: #e67e22;
}

:where(.ukb-payments-scope) .icon-btn5 {
  background-color: #e74c3c;
  color: white;
}

:where(.ukb-payments-scope) .icon-btn5:hover {
  background-color: #c0392b;
}



:where(.ukb-payments-scope) .icon-btn6 {
  background-color: #2ecc71;
  color: white;
  font-size: 12px;
  padding: 6px 10px;
}

:where(.ukb-payments-scope) .icon-btn6:hover {
  background-color: #27ae60;
}


:where(.ukb-payments-scope) .icon-btn7 {
  background-color: #9b59b6;
  color: white;
}

:where(.ukb-payments-scope) .icon-btn7:hover {
  background-color: #8e44ad;
}

/* Mobile Table Styles */
:where(.ukb-payments-scope) .mobile-table {
  display: none;
  flex-direction: column;
  gap: 15px;
  margin: 20px 0;
}

:where(.ukb-payments-scope) .mobile-row {
  background: #2c3e50;
  border-radius: 8px;
  padding: 15px;
  color: white;
  box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

:where(.ukb-payments-scope) .mobile-row-item {
  display: flex;
  justify-content: space-between;
  margin-bottom: 8px;
  padding: 5px 0;
  border-bottom: 1px solid #34495e;
}

:where(.ukb-payments-scope) .mobile-row-item:last-child {
  border-bottom: none;
  margin-bottom: 0;
}

:where(.ukb-payments-scope) .mobile-row-item span:first-child {
  font-weight: bold;
  color: #bdc3c7;
  min-width: 120px;
}

:where(.ukb-payments-scope) .mobile-row-item strong {
  color: #ecf0f1;
  text-align: right;
  flex: 1;
}

:where(.ukb-payments-scope) .mobile-actions {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 15px;
  padding-top: 15px;
  border-top: 1px solid #34495e;
  flex-wrap: wrap;
}

:where(.ukb-payments-scope) .mobile-actions button {
  flex: 1;
  min-width: 40px;
  max-width: 60px;
  padding: 8px;
  font-size: 14px;
}

/* Responsive Design */
@media (max-width: 1400px) {
  :where(.ukb-payments-scope) .payment-table {
    font-size: 11px;
  }

  :where(.ukb-payments-scope) .payment-table th,
  :where(.ukb-payments-scope) .payment-table td {
    padding: 6px 4px;
  }

  :where(.ukb-payments-scope) .icon-btn4, :where(.ukb-payments-scope) .icon-btn-edit, :where(.ukb-payments-scope) .icon-btn-advance, :where(.ukb-payments-scope) .icon-btn5, :where(.ukb-payments-scope) .icon-btn6, :where(.ukb-payments-scope) .icon-btn7 {
    padding: 4px 6px;
    font-size: 12px;
    min-width: 25px;
  }
}

@media (max-width: 1200px) {
  :where(.ukb-payments-scope) .payment-table {
    min-width: 1000px;
  }

  :where(.ukb-payments-scope) .payment-table th:nth-child(1),
  :where(.ukb-payments-scope) .payment-table td:nth-child(1) {
    width: 40px;
    min-width: 40px;
  }
}

/* CORRECTION SPÉCIFIQUE POUR LES ÉCRANS 775px - 992px */
@media (min-width: 776px) and (max-width: 992px) {
  /* Ajustement du contenu principal pour compenser le sidebar */
  :where(.ukb-payments-scope) .main-content {
    margin-left: 280px;
    width: calc(100% - 280px);
    padding: 15px;
    overflow-x: auto;
  }

  /* Assurer que le tableau reste visible et scrollable */
  :where(.ukb-payments-scope) .payment-table {
    display: table !important;
    min-width: 100%;
    font-size: 11px;
  }

  :where(.ukb-payments-scope) .mobile-table {
    display: none !important;
  }

  /* Réduction des paddings pour gagner de l'espace */
  :where(.ukb-payments-scope) .payment-table th,
  :where(.ukb-payments-scope) .payment-table td {
    padding: 5px 3px;
    font-size: 10px;
  }

  /* Ajustement des boutons d'action */
  :where(.ukb-payments-scope) .icon-btn4, :where(.ukb-payments-scope) .icon-btn-edit, :where(.ukb-payments-scope) .icon-btn-advance, :where(.ukb-payments-scope) .icon-btn5, :where(.ukb-payments-scope) .icon-btn6, :where(.ukb-payments-scope) .icon-btn7 {
    padding: 3px 5px;
    font-size: 9px;
    min-width: 22px;
    margin: 1px;
  }

  /* Colonne actions plus compacte */
  :where(.ukb-payments-scope) .payment-table th:nth-child(15),
  :where(.ukb-payments-scope) .payment-table td:nth-child(15) {
    min-width: 120px;
  }

  /* Ajustement des filtres et autres éléments */
  :where(.ukb-payments-scope) .filters-container {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    padding: 10px;
  }

  :where(.ukb-payments-scope) .dashboard-counters {
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
  }
}

/* ALTERNATIVE : CACHER LE SIDEBAR SUR CES ÉCRANS */
/* Si vous préférez masquer le sidebar pour avoir plus d'espace */
@media (min-width: 776px) and (max-width: 992px) {
  :where(.ukb-payments-scope) .sidebar {
    transform: translateX(-100%);
  }

  :where(.ukb-payments-scope) .main-content {
    margin-left: 0;
    width: 100%;
  }

  :where(.ukb-payments-scope) .sidebar.active {
    transform: translateX(0);
  }
}

/* VERSION MOBILE - en dessous de 775px */
@media (max-width: 775px) {
  :where(.ukb-payments-scope) .payment-table {
    display: none;
  }

  :where(.ukb-payments-scope) .mobile-table {
    display: flex;
  }

  :where(.ukb-payments-scope) .sidebar {
    transform: translateX(-100%);
  }

  :where(.ukb-payments-scope) .main-content {
    margin-left: 0;
    width: 100%;
  }
}

/* GARANTIR QUE LE TABLEAU EST SCROLLABLE */
:where(.ukb-payments-scope) .payment-section {
  overflow-x: auto;
  margin: 15px 0;
}

/* OPTIMISATION DU TABLEAU POUR LES ÉCRANS MOYENS */
@media (min-width: 776px) and (max-width: 992px) {
  :where(.ukb-payments-scope) .payment-table {
    min-width: 900px; /* Largeur minimale réduite */
  }

  /* Masquer certaines colonnes moins importantes si nécessaire */
  :where(.ukb-payments-scope) .payment-table th:nth-child(4),
  :where(.ukb-payments-scope) .payment-table td:nth-child(4),
  :where(.ukb-payments-scope) .payment-table th:nth-child(6),
  :where(.ukb-payments-scope) .payment-table td:nth-child(6) {
    display: none;
  }
}

/* SOLUTION AVEC SIDEBAR COMPACT */
@media (min-width: 776px) and (max-width: 992px) {
  :where(.ukb-payments-scope) .sidebar {
    width: 200px; /* Sidebar plus étroit */
  }

  :where(.ukb-payments-scope) .main-content {
    margin-left: 200px;
    width: calc(100% - 200px);
  }

  :where(.ukb-payments-scope) .sidebar-menu a {
    padding: 10px 12px;
    font-size: 13px;
  }

  :where(.ukb-payments-scope) .sidebar-header h2 {
    font-size: 1rem;
  }
}

/* Version mobile uniquement en dessous de 775px */
@media (max-width: 775px) {
  :where(.ukb-payments-scope) .payment-table {
    display: none;
  }

  :where(.ukb-payments-scope) .mobile-table {
    display: flex;
  }
}

@media (max-width: 768px) {
  :where(.ukb-payments-scope) .mobile-row {
    padding: 12px;
  }

  :where(.ukb-payments-scope) .mobile-row-item {
    flex-direction: column;
    gap: 4px;
  }

  :where(.ukb-payments-scope) .mobile-row-item span:first-child {
    min-width: auto;
  }

  :where(.ukb-payments-scope) .mobile-row-item strong {
    text-align: left;
  }

  :where(.ukb-payments-scope) .mobile-actions {
    gap: 5px;
  }

  :where(.ukb-payments-scope) .mobile-actions button {
    min-width: 35px;
    max-width: 45px;
    padding: 6px;
    font-size: 12px;
  }

  :where(.ukb-payments-scope) .icon-btn6 {
    font-size: 10px;
    padding: 4px 6px;
  }
}

@media (max-width: 576px) {
  :where(.ukb-payments-scope) .mobile-row {
    padding: 10px;
  }

  :where(.ukb-payments-scope) .mobile-actions {
    flex-direction: column;
    gap: 8px;
  }

  :where(.ukb-payments-scope) .mobile-actions button {
    max-width: none;
    min-width: auto;
  }

  :where(.ukb-payments-scope) .dashboard-counters {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  :where(.ukb-payments-scope) .counter {
    padding: 15px;
  }

  :where(.ukb-payments-scope) .counter h3 {
    font-size: 14px;
  }

  :where(.ukb-payments-scope) .counter p {
    font-size: 20px;
  }
}

/* Scrollbar Styling */
:where(.ukb-payments-scope) .payment-section::-webkit-scrollbar {
  height: 8px;
}

:where(.ukb-payments-scope) .payment-section::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 4px;
}

:where(.ukb-payments-scope) .payment-section::-webkit-scrollbar-thumb {
  background: #888;
  border-radius: 4px;
}

:where(.ukb-payments-scope) .payment-section::-webkit-scrollbar-thumb:hover {
  background: #555;
}

/* Animation for smooth transitions */
:where(.ukb-payments-scope) .payment-table tr {
  transition: background-color 0.2s ease;
}
:where(.ukb-payments-scope) .payment-table tr:hover {
  background-color: #000000;
  transition: background-color 0.2s ease;
}

:where(.ukb-payments-scope) .mobile-row {
  transition: transform 0.2s ease;
}

:where(.ukb-payments-scope) .mobile-row:hover {
  transform: translateY(-2px);
}

/* Print Styles */
@media print {
  :where(.ukb-payments-scope) .payment-table {
    background: white !important;
    color: black !important;
  }

  :where(.ukb-payments-scope) .payment-table th {
    background: #f8f9fa !important;
    color: black !important;
    border-color: #dee2e6 !important;
  }

  :where(.ukb-payments-scope) .payment-table td {
    border-color: #dee2e6 !important;
    color: black !important;
  }

  :where(.ukb-payments-scope) .status-paid, :where(.ukb-payments-scope) .status-unpaid {
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }
}

/* Loading State */
:where(.ukb-payments-scope) .payment-table.loading {
  opacity: 0.6;
  pointer-events: none;
}

/* Empty State */
:where(.ukb-payments-scope) .payment-table:has(tbody tr:only-child td[colspan]) {
  background: #f8f9fa;
}

:where(.ukb-payments-scope) .payment-table:has(tbody tr:only-child td[colspan]) td {
  text-align: center;
  padding: 40px;
  color: #6c757d;
  font-style: italic;
}


:where(.ukb-payments-scope) .total-row {
  font-weight: bold;
  background-color: #e7f3e8;
}

:where(.ukb-payments-scope) .filter_st {
  min-width: 100px;
}

:where(.ukb-payments-scope) .level-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 10px;
  width: 100%;
}

:where(.ukb-payments-scope) .level-filter-label {
  display: flex;
  align-items: center;
  gap: 5px;
  background-color: #f0f0f0;
  padding: 5px 10px;
  border-radius: 4px;
  cursor: pointer;
  transition: background-color 0.2s;
  font-size: 14px;
}

:where(.ukb-payments-scope) .level-filter-label:hover {
  background-color: #e0e0e0;
}

:where(.ukb-payments-scope) .level-filter-label input[type="checkbox"] {
  margin: 0;
  cursor: pointer;
}

@media (max-width: 768px) {
  :where(.ukb-payments-scope) .student-selection {
    flex-direction: column;
    align-items: stretch;
  }

  :where(.ukb-payments-scope) .level-filters {
    flex-direction: column;
    color: #000000;
  }

  :where(.ukb-payments-scope) .level-filter-label {
    justify-content: space-between;
  }
}
:where(.ukb-payments-scope) .student-selection .filter_st{
  margin: 0;
  min-width: 200px;
  padding: 0;
  text-align: center;
  font-size: 18px;
}

:where(.ukb-payments-scope) .selected-students {
  margin-bottom: 20px;
}

:where(.ukb-payments-scope) .selected-students ul {
  list-style-type: none;
  padding: 0;
}

:where(.ukb-payments-scope) .selected-students li {
  background-color: #f9f9f9;
  padding: 10px;
  border-radius: 8px;
  margin-bottom: 5px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}


:where(.ukb-payments-scope) .payment-popup {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: flex-start; /* Changé de center à flex-start */
  justify-content: center;
  z-index: 1000;
  overflow-y: auto; /* Permet le scroll */
  padding: 20px;
  box-sizing: border-box;
}

:where(.ukb-payments-scope) .popup-content {
  background: white;
  padding: 20px;
  border-radius: 8px;
  width: 90%;
  max-width: 400px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  margin: 20px auto; /* Centrage avec marge */
}

:where(.ukb-payments-scope) .popup-actions {
  display: flex;
  justify-content: space-between;
  margin-top: 15px;
}

:where(.ukb-payments-scope) .popup-actions button {
  padding: 8px 16px;
  border: none;
  border-radius: 5px;
  cursor: pointer;
}

:where(.ukb-payments-scope) .popup-actions button:hover {
  background-color: #007bff;
  color: white;
}

:where(.ukb-payments-scope) .money-icon, :where(.ukb-payments-scope) .money-icon1 {
  font-size: 100px;
  color: #007bff;
}

:where(.ukb-payments-scope) .money-icon1 {
  color: #f8152b;
}

:where(.ukb-payments-scope) .status-paid {
  background-color: #d4edda;
  color: #155724;
  font-weight: bold;
  text-align: center;
  border-radius: 4px;
  padding: 5px;
}

:where(.ukb-payments-scope) .status-unpaid {
  background-color: #f8d7da;
  color: #721c24;
  font-weight: bold;
  text-align: center;
  border-radius: 4px;
  padding: 5px;
}

:where(.ukb-payments-scope) .logo {
  height: 60px;
  width: auto;
}

:where(.ukb-payments-scope) .delete-popup {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background-color: white;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  padding: 20px;
  z-index: 1000;
  width: 90%;
  max-width: 400px;
}

:where(.ukb-payments-scope) .delete-close-btn {
  position: absolute;
  top: 10px;
  right: 10px;
  background: red;
  color: white;
  border: none;
  font-size: 18px;
  width: 20px;
  height: 30px;
  border-radius: 50%;
  cursor: pointer;
}


:where(.ukb-payments-scope) .delete-message {
  font-size: 18px;
  color: #333;
  margin: 20px 0;
}

:where(.ukb-payments-scope) .delete-actions {
  display: flex;
  justify-content: space-around;
}

:where(.ukb-payments-scope) .delete-confirm-btn, :where(.ukb-payments-scope) .delete-cancel-btn {
  padding: 10px 20px;
  font-size: 16px;
  cursor: pointer;
  border: none;
  border-radius: 5px;
  transition: background-color 0.3s;
}

:where(.ukb-payments-scope) .delete-confirm-btn {
  background-color: red;
  color: white;
}

:where(.ukb-payments-scope) .delete-confirm-btn:hover {
  background-color: darkred;
}

:where(.ukb-payments-scope) .delete-cancel-btn {
  background-color: #ccc;
  color: black;
}

:where(.ukb-payments-scope) .delete-cancel-btn:hover {
  background-color: #aaa;
}

:where(.ukb-payments-scope) .receive-payment {
  width: 100%;
  height: 50px;
  font-size: 18px;
  border-radius: 25px;
  border-color: #007bff;
  padding: 0 15px;
}

:where(.ukb-payments-scope) .pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  margin-top: 20px;
  gap: 15px;
}

:where(.ukb-payments-scope) .pagination-btn {
  background: #007bff;
  color: white;
  border: none;
  padding: 8px 12px;
  border-radius: 4px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

:where(.ukb-payments-scope) .pagination-btn:disabled {
  background: #cccccc;
  cursor: not-allowed;
}

:where(.ukb-payments-scope) .pagination-info {
  font-size: 16px;
  color: #ffffff;
}

:where(.ukb-payments-scope) .studentNameId {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

/* Mobile Layout */
:where(.ukb-payments-scope) .mobile-table {
  display: none;
}

/* Responsive Styles */
@media (max-width: 1200px) {
  :where(.ukb-payments-scope) .payment-table th, :where(.ukb-payments-scope) .payment-table td {
    padding: 8px 5px;
    font-size: 8px;
  }
}

@media (max-width: 992px) {
  :where(.ukb-payments-scope) .sidebar {
    left: -100px;
  }

  :where(.ukb-payments-scope) .sidebar.active {
    left: 0;
  }

  :where(.ukb-payments-scope) .main-content {
    margin-left: 0;
    padding: 20px 0;
  }


  :where(.ukb-payments-scope) .dashboard-counters {
    flex-direction: column;
    gap: 15px;
    padding: 0 0;
  }

  :where(.ukb-payments-scope) .counter {
    min-width: 100%;
    padding: 20px 0;
  }
}

@media (max-width: 768px) {
  /* Modified Sidebar for Mobile */

  :where(.ukb-payments-scope) .sidebar {
    width: 100%;
    left: -300px;
    transform: translateX(0);
    display: block;
  }
  :where(.ukb-payments-scope) .icon-btn1, :where(.ukb-payments-scope) .icon-btn2, :where(.ukb-payments-scope) .icon-btn3, :where(.ukb-payments-scope) .icon-btn4, :where(.ukb-payments-scope) .icon-btn5, :where(.ukb-payments-scope) .icon-btn6, :where(.ukb-payments-scope) .icon-btn7, :where(.ukb-payments-scope) .icon-btn-edit {
    background: none;

  }
  :where(.ukb-payments-scope) .icon-btn1, :where(.ukb-payments-scope) .icon-btn2, :where(.ukb-payments-scope) .icon-btn3, :where(.ukb-payments-scope) .icon-btn4, :where(.ukb-payments-scope) .icon-btn5, :where(.ukb-payments-scope) .icon-btn6, :where(.ukb-payments-scope) .icon-btn7, :where(.ukb-payments-scope) .icon-btn-edit:hover{
    background: none;

  }
  :where(.ukb-payments-scope) .popup-content {
    position: relative; /* Changé de absolute à relative */
    left: auto; /* Supprimé le positionnement fixe */
    top: auto;
    width: 90%; /* Largeur adaptative */
    max-width: 350px;
    height: auto; /* Hauteur automatique */
    margin: 20px auto; /* Centrage */
  }
  :where(.ukb-payments-scope) .main-content {
    position: relative;
    left: 0;
    right: 0;
    margin-left: 0;
  }

  :where(.ukb-payments-scope) .sidebar.active {
    left: 0;
    transform: translateX(0);
  }



  :where(.ukb-payments-scope) .mobile-table {
    display: flex;
    flex-direction: column;
    gap: 15px;
  }

  :where(.ukb-payments-scope) .mobile-row {
    background: #1f1f1f;
    border-radius: 8px;
    padding: 15px 0;
    color: white;
  }

  :where(.ukb-payments-scope) .mobile-row-item {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
    padding: 0 10px;
  }

  :where(.ukb-payments-scope) .mobile-row-item strong {
    color: #4CAF50;
  }

  :where(.ukb-payments-scope) .mobile-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 15px;
    padding: 0 10px;
  }

  :where(.ukb-payments-scope) .icon-btn1, :where(.ukb-payments-scope) .icon-btn2, :where(.ukb-payments-scope) .icon-btn3, :where(.ukb-payments-scope) .icon-btn4, :where(.ukb-payments-scope) .icon-btn5, :where(.ukb-payments-scope) .icon-btn6, :where(.ukb-payments-scope) .icon-btn7 {
    min-width: auto;
    padding: 8px;
    margin: 0;
  }

  :where(.ukb-payments-scope) .student-selection {
    flex-direction: column;
    padding: 0 0;
  }

  :where(.ukb-payments-scope) .selected_st, :where(.ukb-payments-scope) .filter_st {
    width: 100%;
    padding: 0 10px;
  }

}

@media (max-width: 576px) {
  :where(.ukb-payments-scope) .main-content {
    position: absolute;
    padding: 0;
    margin: 0;
    left: 0;
  }

  :where(.ukb-payments-scope) .counter h3 {
    font-size: 1rem;
  }

  :where(.ukb-payments-scope) .counter p {
    font-size: 1.2rem;
  }

  :where(.ukb-payments-scope) .money-icon, :where(.ukb-payments-scope) .money-icon1 {
    font-size: 60px;
  }

  :where(.ukb-payments-scope) .popup-content {
    padding: 15px;
    width: 95%; /* Plus large sur très petits écrans */
    max-width: 320px;
  }

  :where(.ukb-payments-scope) .mobile-actions {
    flex-wrap: wrap;
    justify-content: center;
    padding: 0 5px;
  }


  :where(.ukb-payments-scope) .icon-btn1, :where(.ukb-payments-scope) .icon-btn2, :where(.ukb-payments-scope) .icon-btn3, :where(.ukb-payments-scope) .icon-btn4, :where(.ukb-payments-scope) .icon-btn5, :where(.ukb-payments-scope) .icon-btn6, :where(.ukb-payments-scope) .icon-btn7, :where(.ukb-payments-scope) .icon-btn-edit {
    background: none;

  }
  :where(.ukb-payments-scope) .icon-btn1, :where(.ukb-payments-scope) .icon-btn2, :where(.ukb-payments-scope) .icon-btn3, :where(.ukb-payments-scope) .icon-btn4, :where(.ukb-payments-scope) .icon-btn5, :where(.ukb-payments-scope) .icon-btn6, :where(.ukb-payments-scope) .icon-btn7, :where(.ukb-payments-scope) .icon-btn-edit:hover{
    background: none;
    margin: 5px;
  }

}

@media (max-width: 400px) {
  :where(.ukb-payments-scope) .sidebar {
    display: block;
    width: 100%;
    left: 0%;
  }
  :where(.ukb-payments-scope) .main-content{
    position: absolute;
    left: 0;
    right: 0;
  }

  :where(.ukb-payments-scope) .sidebar.active {
    left: 0;
    transform: translateX(0);
  }

  :where(.ukb-payments-scope) .popup-content {
    width: 95%;
    max-width: 300px; /* Réduit encore sur très petits écrans */
  }

  :where(.ukb-payments-scope) .mobile-row {
    padding: 10px 0;
  }

  :where(.ukb-payments-scope) .mobile-actions {
    gap: 5px;
    padding: 0 5px;
  }

  :where(.ukb-payments-scope) .icon-btn4, :where(.ukb-payments-scope) .icon-btn5, :where(.ukb-payments-scope) .icon-btn6, :where(.ukb-payments-scope) .icon-btn7 {
    padding: 6px;
    font-size: 14px;
  }

  :where(.ukb-payments-scope) .dashboard-counters {
    padding: 0 0;
  }

  :where(.ukb-payments-scope) .student-selection {
    padding: 0 0;
  }

  :where(.ukb-payments-scope) .mobile-row-item {
    padding: 0 5px;
  }
  :where(.ukb-payments-scope) .icon-btn1, :where(.ukb-payments-scope) .icon-btn2, :where(.ukb-payments-scope) .icon-btn3, :where(.ukb-payments-scope) .icon-btn4, :where(.ukb-payments-scope) .icon-btn5, :where(.ukb-payments-scope) .icon-btn6, :where(.ukb-payments-scope) .icon-btn7, :where(.ukb-payments-scope) .icon-btn-edit {
    background: none;

  }
  :where(.ukb-payments-scope) .icon-btn1, :where(.ukb-payments-scope) .icon-btn2, :where(.ukb-payments-scope) .icon-btn3, :where(.ukb-payments-scope) .icon-btn4, :where(.ukb-payments-scope) .icon-btn5, :where(.ukb-payments-scope) .icon-btn6, :where(.ukb-payments-scope) .icon-btn7, :where(.ukb-payments-scope) .icon-btn-edit:hover{
    background: none;
    margin: 5px;
  }
}

/* Print Styles */
@media print {

  :where(.ukb-payments-scope) .popup-content, :where(.ukb-payments-scope) .popup-content * {
    visibility: visible;
  }
  :where(.ukb-payments-scope) .popup-content {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
  }
}
:where(.ukb-payments-scope) .payment-type-selector {
  margin-bottom: 15px;
}

:where(.ukb-payments-scope) .payment-type-selector select {
  padding: 8px;
  border: 1px solid #ddd;
  border-radius: 4px;
  width: 100%;
}

:where(.ukb-payments-scope) .dashboard-counters {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 20px;
  margin-bottom: 30px;
}

:where(.ukb-payments-scope) .counter {
  background: white;
  padding: 20px;
  border-radius: 10px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.1);
  text-align: center;
}

:where(.ukb-payments-scope) .counter h3 {
  margin: 10px 0;
  color: #333;
  font-size: 14px;
}

:where(.ukb-payments-scope) .counter p {
  font-size: 24px;
  font-weight: bold;
  color: #4CAF50;
}

:where(.ukb-payments-scope) .money-icon, :where(.ukb-payments-scope) .money-icon1 {
  font-size: 30px;
  color: #4CAF50;
}

:where(.ukb-payments-scope) .status-paid {
  color: green;
  font-weight: bold;
}

:where(.ukb-payments-scope) .status-unpaid {
  color: red;
  font-weight: bold;
}

:where(.ukb-payments-scope) .section-title {
  background-color: #e8f5e8;
  padding: 8px;
  margin: 10px 0;
  border-radius: 4px;
  font-weight: bold;
}
:where(.ukb-payments-scope) .icon-btn6 {
  background: #4CAF50;
  color: white;
  border: none;
  padding: 8px 12px;
  margin: 2px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 12px;
  transition: background 0.3s;
}

:where(.ukb-payments-scope) .icon-btn6:hover {
  background: #45a049;
}

/* Pour la version mobile */
:where(.ukb-payments-scope) .mobile-actions .icon-btn6 {
  padding: 6px 10px;
  font-size: 11px;
  margin: 3px;
}
/* Styles pour les filtres */

:where(.ukb-payments-scope) .filter-group label {
  font-weight: bold;
  font-size: 14px;
  color: #1a242d;
}

:where(.ukb-payments-scope) .filter-group select,
:where(.ukb-payments-scope) .filter-group input {
  padding: 10px 12px;
  border: 1px solid #ddd;
  border-radius: 6px;
  font-size: 14px;
  background: #1e2a35;
  transition: border-color 0.3s;
  width: 100%;
}

:where(.ukb-payments-scope) .filter-group select:focus,
:where(.ukb-payments-scope) .filter-group input:focus {
  outline: none;
  border-color: #007bff;
  box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.25);
}
:where(.ukb-payments-scope) .reset-filters-btn {
  padding: 8px 12px;
  border: none;
  border-radius: 4px;
  background: #6c757d;
  color: white;
  cursor: pointer;
  font-size: 12px;
  font-weight: 500;
  height: 32px;
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 4px;
  transition: all 0.2s ease;
  margin-left: 10px;
}

:where(.ukb-payments-scope) .reset-filters-btn:hover {
  background: #5a6268;
  transform: translateY(-1px);
}

/* Responsive pour petits écrans */
@media (max-width: 768px) {
  :where(.ukb-payments-scope) .reset-filters-btn {
    padding: 6px 10px;
    font-size: 11px;
    margin-left: 0;
    margin-top: 8px;
  }
}
:where(.ukb-payments-scope) .filter-statistics-2{
  display: flex;
  gap: 19px;
  align-items: center;
  padding: 10px;
  /* background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
   border-radius: 8px;
   border: 1px solid #dee2e6; */
}

/* Boutons d'impression très compacts */
:where(.ukb-payments-scope) .icon-btn6, :where(.ukb-payments-scope) .icon-btn7 {
  padding: 4px 6px;
  margin: 1px;
  font-size: 11px;
  border: 1px solid #ccc;
  border-radius: 2px;
  background: #f8f9fa;
  cursor: pointer;
  min-width: 35px;
}

:where(.ukb-payments-scope) .icon-btn6:hover, :where(.ukb-payments-scope) .icon-btn7:hover {
  background: #e9ecef;
}

:where(.ukb-payments-scope) .icon-btn7 {
  background: #fff3cd;
}

:where(.ukb-payments-scope) .icon-btn7:hover {
  background: #ffeaa7;
}

/* Version mobile ultra compacte */
@media (max-width: 768px) {
  :where(.ukb-payments-scope) .mobile-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 3px;
    justify-content: center;
    padding: 5px;
  }

  :where(.ukb-payments-scope) .mobile-actions button {
    padding: 3px 5px;
    font-size: 10px;
    min-width: 30px;
  }
}
/* Popup Historique */
:where(.ukb-payments-scope) .history-popup {
  background: #1a242d;
  padding: 25px;
  border-radius: 10px;
  width: 90%;
  max-width: 800px;
  max-height: 80vh;
  overflow-y: auto;
}

:where(.ukb-payments-scope) .filter-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 15px;
  margin: 20px 0;
}

:where(.ukb-payments-scope) .filter-group {
  display: flex;
  flex-direction: column;
  background: #1a252f;
}

:where(.ukb-payments-scope) .filter-group label {
  font-weight: bold;
  margin-bottom: 5px;
  color: #000000;
}

:where(.ukb-payments-scope) .filter-group select,
:where(.ukb-payments-scope) .filter-group input {
  padding: 8px;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 14px;
}

:where(.ukb-payments-scope) .history-results {
  margin-top: 20px;
  padding: 15px;
  background: #ffffff;
  border-radius: 5px;
}

:where(.ukb-payments-scope) .print-all-btn {
  background: #28a745;
  color: white;
  padding: 10px 15px;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  margin-top: 10px;
}

:where(.ukb-payments-scope) .print-all-btn:hover {
  background: #218838;
}

:where(.ukb-payments-scope) .history-btn {
  background: #6c757d;
  color: white;
  padding: 10px 15px;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  margin-left: 15px;
}

:where(.ukb-payments-scope) .history-btn:hover {
  background: #5a6268;
}

:where(.ukb-payments-scope) .admin-controls {
  margin: 15px 0;
  padding: 12px;
  background: #f8f9fa;
  border-radius: 6px;
  border: 1px solid #e9ecef;
}

:where(.ukb-payments-scope) .admin-controls h3 {
  margin-bottom: 12px;
  color: #495057;
  font-size: 14px;
  font-weight: 600;
}

:where(.ukb-payments-scope) .admin-buttons {
  display: flex;
  gap: 8px;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: flex-start;
}

:where(.ukb-payments-scope) .admin-btn {
  padding: 8px 12px;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-weight: 500;
  font-size: 12px;
  transition: all 0.2s ease;
  min-width: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
}
:where(.ukb-payments-scope) .admin-btn.refresh {
  background: #17a2b8;
  color: white;
  width: 250px;
}:where(.ukb-payments-scope) .admin-btn.statistics {
  background: #17a2b8;
  color: white;
  width: 250px;
}

:where(.ukb-payments-scope) .admin-btn.reini {
  background: #013054;
  color: white;
}


:where(.ukb-payments-scope) .admin-btn.cleanup {
  background: #ffc107;
  color: #212529;
}

:where(.ukb-payments-scope) .admin-btn.cache {
  background: #dc3545;
  color: white;
}

:where(.ukb-payments-scope) .admin-btn:hover {
  opacity: 0.85;
  transform: translateY(-1px);
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

:where(.ukb-payments-scope) .admin-btn:active {
  transform: translateY(0);
}

/* Version responsive pour petits écrans */
@media (max-width: 768px) {
  :where(.ukb-payments-scope) .admin-controls {
    padding: 10px;
    margin-top: 10px;
  }

  :where(.ukb-payments-scope) .admin-buttons {
    gap: 6px;
    flex-wrap: wrap;
    justify-content: center;
    margin-left: 20px;
  }

  :where(.ukb-payments-scope) .admin-btn {
    padding: 6px 10px;
    font-size: 11px;
    min-width: 55px;
  }

  :where(.ukb-payments-scope) .admin-controls h3 {
    font-size: 13px;
    text-align: center;
    margin-bottom: 10px;
  }
}

/* Ajoutez ces styles à votre fichier CSS existant */
:where(.ukb-payments-scope) .dropdown-filter {
  position: relative;
  display: inline-block;
  width: 100%;
}

:where(.ukb-payments-scope) .dropdown-toggle {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid #ddd;
  border-radius: 4px;
  background: white;
  text-align: left;
  cursor: pointer;
}

:where(.ukb-payments-scope) .dropdown-menu {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: white;
  border: 1px solid #000000;
  border-radius: 4px;
  max-height: 200px;
  overflow-y: auto;
  z-index: 1000;
  box-shadow: 0 4px 8px rgba(0,0,0,0.1);
  color: #ffffff;
}

:where(.ukb-payments-scope) .dropdown-item {
  padding: 8px 12px;
  cursor: pointer;
  border-bottom: 1px solid #000000;
  color: #000000;
}

:where(.ukb-payments-scope) .dropdown-item:hover {
  background: #f8f9fa;
}

:where(.ukb-payments-scope) .dropdown-item:last-child {
  border-bottom: none;
}

:where(.ukb-payments-scope) .theme-selector-container {
  position: absolute;
  top: 20px;
  right: 20px;
  z-index: 1000;
}
:where(.ukb-payments-scope) .payment-table {
  width: 100%;
  border-collapse: collapse;
}

:where(.ukb-payments-scope) .payment-table th {
  background: #2c3e50;
  color: white;
  padding: 12px;
  text-align: left;
}

:where(.ukb-payments-scope) .payment-table td {
  padding: 10px;
  border-bottom: 1px solid #ddd;
}

:where(.ukb-payments-scope) .payment-table tr:hover {
  background-color: #374d62;
}

@media (max-width: 768px) {
  :where(.ukb-payments-scope) .payment-table {
    display: none;
  }

  :where(.ukb-payments-scope) .mobile-table {
    display: flex;
    width: 100%;
    margin: 0;
    padding: 0 5px;
  }
}

:where(.ukb-payments-scope) .status-paid {
  color: #28a745;
  font-weight: bold;
}

:where(.ukb-payments-scope) .status-unpaid {
  color: #dc3545;
  font-weight: bold;
}

:where(.ukb-payments-scope) .icon-btn-edit, :where(.ukb-payments-scope) .icon-btn5, :where(.ukb-payments-scope) .icon-btn6, :where(.ukb-payments-scope) .icon-btn7 {
  padding: 5px 10px;
  margin: 0 2px;
  border: none;
  border-radius: 4px;
  cursor: pointer;
}

:where(.ukb-payments-scope) .icon-btn-edit { background: #ffc107; color: white; }
:where(.ukb-payments-scope) .icon-btn5 { background: #dc3545; color: white; }
:where(.ukb-payments-scope) .icon-btn6 { background: #17a2b8; color: white; }
:where(.ukb-payments-scope) .icon-btn7 { background: #6f42c1; color: white; }
/* Correction des marges excessives sur mobile */
@media (max-width: 992px) {
  :where(.ukb-payments-scope) .payment-dashboard {
    margin: 0;
    padding: 0;
    overflow-x: hidden;
  }

  :where(.ukb-payments-scope) .main-content {
    margin-left: 0;
    padding: 10px;
    width: 100%;
  }

  :where(.ukb-payments-scope) .sidebar-open {
    margin-left: 0;
  }

  :where(.ukb-payments-scope) .dashboard-counters {
    grid-template-columns: 1fr;
    gap: 15px;
    margin: 10px 0;
    padding: 0 10px;
  }

  :where(.ukb-payments-scope) .counter {
    margin: 0;
    padding: 15px;
  }

  :where(.ukb-payments-scope) .student-selection {
    padding: 0 10px;
    margin: 15px 0;
  }

  :where(.ukb-payments-scope) .filters-container {
    grid-template-columns: 1fr;
    gap: 10px;
    margin: 15px 0;
    padding: 0 10px;
    font-size: 9px;
  }

  :where(.ukb-payments-scope) .filter-group {
    width: 100%;
  }

  :where(.ukb-payments-scope) .payment-section {
    margin: 10px 0;
    padding: 0 5px;
  }
}

/* Ajustements pour très petits écrans */
@media (max-width: 480px) {
  :where(.ukb-payments-scope) .main-content {
    padding: 5px;
  }

  :where(.ukb-payments-scope) .dashboard-title h1 {
    font-size: 1.3rem;
    padding: 10px;
  }

  :where(.ukb-payments-scope) .selected_st, :where(.ukb-payments-scope) .filter_st {
    min-width: 100%;
    margin: 5px 0;
  }

  :where(.ukb-payments-scope) .mobile-row {
    margin: 5px 0;
    padding: 10px;
  }

  :where(.ukb-payments-scope) .mobile-actions {
    justify-content: center;
    gap: 5px;
  }

  :where(.ukb-payments-scope) .mobile-actions button {
    min-width: 40px;
    padding: 6px;
    font-size: 12px;
  }

  :where(.ukb-payments-scope) .pagination {
    margin: 15px 0;
    padding: 0 10px;
  }
}

/* Correction spécifique pour la sidebar */
@media (max-width: 992px) {
  :where(.ukb-payments-scope) .sidebar {
    width: 480px;
    left: -280px;
  }

  :where(.ukb-payments-scope) .sidebar.active {
    left: 0;
  }

}

/* Ajustement du conteneur principal quand la sidebar est ouverte */
@media (max-width: 992px) {
  :where(.ukb-payments-scope) .main-content.sidebar-open {
    transform: translateX(280px);
    width: calc(100% - 280px);
  }
}

/* Styles pour les actions mobiles - disposition horizontale */
:where(.ukb-payments-scope) .mobile-actions {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 15px;
  padding-top: 15px;
  border-top: 1px solid #34495e;
  flex-wrap: wrap;
  flex-direction: row; /* Assure l'alignement horizontal */
}

/* Styles des boutons d'action */
:where(.ukb-payments-scope) .mobile-actions button {
  flex: 0 0 auto; /* Empêche l'étirement */
  min-width: 40px;
  max-width: 60px;
  padding: 8px;
  font-size: 14px;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
}

/* Styles spécifiques pour chaque type de bouton */
:where(.ukb-payments-scope) .mobile-actions .icon-btn4 {
  background-color: #3498db;
  color: white;
}

:where(.ukb-payments-scope) .mobile-actions .icon-btn-edit {
  background-color: #f39c12;
  color: white;
}

:where(.ukb-payments-scope) .mobile-actions .icon-btn5 {
  background-color: #e74c3c;
  color: white;
}

:where(.ukb-payments-scope) .mobile-actions .icon-btn6 {
  background-color: #2ecc71;
  color: white;
  font-size: 12px;
}

:where(.ukb-payments-scope) .mobile-actions .history-btn {
  background-color: #9b59b6;
  color: white;
  font-size: 12px;
}

/* Effets au survol */
:where(.ukb-payments-scope) .mobile-actions button:hover {
  transform: translateY(-2px);
  box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

/* Ajustements pour très petits écrans */
@media (max-width: 480px) {
  :where(.ukb-payments-scope) .mobile-actions {
    gap: 5px;
    padding: 10px 0;
  }

  :where(.ukb-payments-scope) .mobile-actions button {
    min-width: 35px;
    max-width: 45px;
    padding: 6px;
    font-size: 12px;
    height: 35px;
  }

  :where(.ukb-payments-scope) .mobile-actions .icon-btn6 {
    font-size: 10px;
    padding: 4px 6px;
  }
}

/* Pour les écrans moyens */
@media (max-width: 768px) {
  :where(.ukb-payments-scope) .mobile-actions {
    justify-content: space-around;
    gap: 6px;
  }

  :where(.ukb-payments-scope) .mobile-actions button {
    flex: 1;
    max-width: 55px;
    margin: 2px;
  }
}

/* Organisation spécifique des icônes */
:where(.ukb-payments-scope) .mobile-actions {
  /* Premier groupe : actions principales */
  :where(.ukb-payments-scope) .icon-btn4, :where(.ukb-payments-scope) .icon-btn-edit, :where(.ukb-payments-scope) .icon-btn5 {
    order: 1;
  }

  /* Deuxième groupe : impressions */
  :where(.ukb-payments-scope) .icon-btn6 {
    order: 2;
  }

  /* Troisième groupe : historique */
  :where(.ukb-payments-scope) .history-btn {
    order: 3;
  }
}

/* Ajustement pour éviter le débordement */
@media (max-width: 380px) {
  :where(.ukb-payments-scope) .mobile-actions {
    gap: 3px;
  }

  :where(.ukb-payments-scope) .mobile-actions button {
    min-width: 32px;
    max-width: 40px;
    padding: 4px;
    font-size: 11px;
  }

  /* Réduire la taille des icônes */
  :where(.ukb-payments-scope) .mobile-actions button::before {
    transform: scale(0.9);
  }
}

/* Amélioration de la visibilité */
:where(.ukb-payments-scope) .mobile-actions button {
  font-weight: bold;
  text-shadow: 0 1px 1px rgba(0,0,0,0.3);
}

/* Style cohérent pour tous les boutons d'action */
:where(.ukb-payments-scope) .icon-btn4, :where(.ukb-payments-scope) .icon-btn-edit, :where(.ukb-payments-scope) .icon-btn5, :where(.ukb-payments-scope) .icon-btn6, :where(.ukb-payments-scope) .history-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin: 2px;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.2s ease;
}

/* Version desktop (si nécessaire) */
@media (min-width: 769px) {
  :where(.ukb-payments-scope) .mobile-actions {
    display: none; /* Cacher sur desktop */
  }
}

/* Conteneur principal des filtres */
:where(.ukb-payments-scope) .filters-container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 15px;
  margin: 20px 0;
  padding: 0 10px;
  width: 100%;
  box-sizing: border-box;
  background: #1a242d;
  font-size: 9px;
}

/* Groupe de filtre */
:where(.ukb-payments-scope) .filter-group {
  display: flex;
  flex-direction: column;
  gap: 5px;
  min-width: 0; /* Empêche le débordement */
  background: #1a242d;
}

:where(.ukb-payments-scope) .filter-group label {
  font-weight: bold;
  font-size: 14px;
  color: #ffffff;
  margin-bottom: 4px;
}

/* Inputs et selects */
:where(.ukb-payments-scope) .filter-group select,
:where(.ukb-payments-scope) .filter-group input,
:where(.ukb-payments-scope) .dropdown-toggle {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #ddd;
  border-radius: 6px;
  font-size: 14px;
  background: #1a242d;
  transition: border-color 0.3s;
  box-sizing: border-box; /* Inclut padding et border dans la largeur */
  max-width: 100%;
}
:where(.ukb-payments-scope) .filters-container .filter-group label{
  color: #ffffff;
}

:where(.ukb-payments-scope) .filter-group select:focus,
:where(.ukb-payments-scope) .filter-group input:focus,
:where(.ukb-payments-scope) .dropdown-toggle:focus {
  outline: none;
  border-color: #007bff;
  box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.25);
}

/* Dropdown personnalisé */
:where(.ukb-payments-scope) .dropdown-filter {
  position: relative;
  width: 100%;
}

:where(.ukb-payments-scope) .dropdown-menu {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: #1e2a35;
  border: 1px solid #ddd;
  border-radius: 4px;
  max-height: 200px;
  overflow-y: auto;
  z-index: 1000;
  box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

:where(.ukb-payments-scope) .dropdown-item {
  padding: 8px 12px;
  cursor: pointer;
  border-bottom: 1px solid #eee;
  color: #333;
}

:where(.ukb-payments-scope) .dropdown-item:hover {
  background: #f8f9fa;
}

:where(.ukb-payments-scope) .dropdown-item:last-child {
  border-bottom: none;
}

/* Statistiques de filtre */
:where(.ukb-payments-scope) .filter-statistics-2 {
  display: flex;
  gap: 15px;
  align-items: center;
  padding: 10px;
  flex-wrap: wrap;
  justify-content: center;
}

:where(.ukb-payments-scope) .stat-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  background: #1a242d;
  padding: 8px 12px;
  border-radius: 6px;
  min-width: 80px;
}

:where(.ukb-payments-scope) .stat-label {
  font-size: 12px;
  color: #000000;
  font-weight: bold;
}

:where(.ukb-payments-scope) .stat-value {
  font-size: 16px;
  font-weight: bold;
  color: #007bff;
}

/* Contrôles admin */
:where(.ukb-payments-scope) .admin-controls {
  margin: 15px 0;
  padding: 12px;
  background: #f8f9fa;
  border-radius: 6px;
  border: 1px solid #e9ecef;
  width: 100%;
  box-sizing: border-box;
}

:where(.ukb-payments-scope) .admin-controls h3 {
  margin-bottom: 12px;
  color: #495057;
  font-size: 14px;
  font-weight: 600;
  text-align: center;
}

:where(.ukb-payments-scope) .admin-buttons {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: center;
}

/* Responsive Design */
@media (max-width: 1200px) {
  :where(.ukb-payments-scope) .filters-container {
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 12px;
  }
}

@media (max-width: 992px) {
  :where(.ukb-payments-scope) .filters-container {
    grid-template-columns: repeat(2, 1fr);
    padding: 0 5px;
  }

  :where(.ukb-payments-scope) .filter-group {
    min-width: 150px;
  }
}

@media (max-width: 768px) {
  :where(.ukb-payments-scope) .filters-container {
    grid-template-columns: 1fr;
    gap: 10px;
    margin: 15px 0;
  }

  :where(.ukb-payments-scope) .filter-group {
    min-width: 100%;
  }

  :where(.ukb-payments-scope) .filter-group select,
  :where(.ukb-payments-scope) .filter-group input,
  :where(.ukb-payments-scope) .dropdown-toggle {
    padding: 8px 10px;
    font-size: 13px;
  }

  :where(.ukb-payments-scope) .filter-statistics-2 {
    gap: 10px;
    justify-content: space-around;
  }

  :where(.ukb-payments-scope) .stat-item {
    min-width: 70px;
    padding: 6px 10px;
  }

  :where(.ukb-payments-scope) .stat-label {
    font-size: 11px;
  }

  :where(.ukb-payments-scope) .stat-value {
    font-size: 14px;
  }

  :where(.ukb-payments-scope) .admin-buttons {
    gap: 6px;
  }

  :where(.ukb-payments-scope) .admin-btn {
    padding: 6px 10px;
    font-size: 11px;
  }
}

@media (max-width: 576px) {
  :where(.ukb-payments-scope) .filters-container {
    padding: 0;
  }

  :where(.ukb-payments-scope) .filter-group label {
    font-size: 13px;
  }

  :where(.ukb-payments-scope) .filter-group select,
  :where(.ukb-payments-scope) .filter-group input,
  :where(.ukb-payments-scope) .dropdown-toggle {
    padding: 7px 9px;
    font-size: 12px;
  }

  :where(.ukb-payments-scope) .filter-statistics-2 {
    gap: 8px;
  }

  :where(.ukb-payments-scope) .stat-item {
    min-width: 60px;
    padding: 5px 8px;
  }

  :where(.ukb-payments-scope) .stat-label {
    font-size: 10px;
  }

  :where(.ukb-payments-scope) .stat-value {
    font-size: 13px;
  }

  :where(.ukb-payments-scope) .admin-controls {
    padding: 10px;
  }

  :where(.ukb-payments-scope) .admin-controls h3 {
    font-size: 13px;
  }
}

/* Correction spécifique pour les très petits écrans */
@media (max-width: 400px) {
  :where(.ukb-payments-scope) .filters-container {
    gap: 8px;
  }

  :where(.ukb-payments-scope) .filter-group {
    gap: 3px;
  }

  :where(.ukb-payments-scope) .filter-group label {
    font-size: 12px;
  }

  :where(.ukb-payments-scope) .filter-group select,
  :where(.ukb-payments-scope) .filter-group input,
  :where(.ukb-payments-scope) .dropdown-toggle {
    padding: 6px 8px;
    font-size: 11px;
  }

  :where(.ukb-payments-scope) .filter-statistics-2 {
    gap: 5px;
  }

  :where(.ukb-payments-scope) .stat-item {
    min-width: 55px;
    padding: 4px 6px;
  }
}

/* Pour éviter tout débordement */
:where(.ukb-payments-scope) .student-selection {
  width: 100%;
  box-sizing: border-box;
  padding: 0 10px;
}

/* Assurer que tout reste dans les conteneurs */
:where(.ukb-payments-scope) .student-selection > * {
  max-width: 100%;
}

/* Correction pour les dropdowns */
:where(.ukb-payments-scope) .dropdown-filter {
  max-width: 100%;
}

:where(.ukb-payments-scope) .dropdown-toggle {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-align: left;
}

/* Style pour le bouton de réinitialisation */
:where(.ukb-payments-scope) .reset-filters-btn {
  padding: 8px 12px;
  border: none;
  border-radius: 4px;
  background: #6c757d;
  color: white;
  cursor: pointer;
  font-size: 12px;
  font-weight: 500;
  height: auto;
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 4px;
  transition: all 0.2s ease;
  margin-top: 10px;
  width: 100%;
  justify-content: center;
}

:where(.ukb-payments-scope) .reset-filters-btn:hover {
  background: #5a6268;
  transform: translateY(-1px);
}

@media (max-width: 768px) {
  :where(.ukb-payments-scope) .reset-filters-btn {
    margin-top: 8px;
    padding: 6px 10px;
    font-size: 11px;
  }
}

/* POPUP MOBILE - CORRECTION DU CENTRAGE ET SCROLL */
:where(.ukb-payments-scope) .payment-popup {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.8);
  display: flex;
  align-items: flex-start; /* Changé de center à flex-start */
  justify-content: center;
  z-index: 10000;
  padding: 20px;
  box-sizing: border-box;
  overflow-y: auto; /* Permet le scroll */
}

:where(.ukb-payments-scope) .popup-content {
  background: white;
  border-radius: 12px;
  width: 90%;
  max-width: 400px;
  max-height: 90vh; /* Limite la hauteur maximale */
  overflow-y: auto; /* Permet le scroll interne si nécessaire */
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
  margin: 20px auto; /* Marge pour le scroll */
}

:where(.ukb-payments-scope) .popup-content h3 {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  padding: 20px;
  margin: 0;
  font-size: 18px;
  text-align: center;
  border-radius: 12px 12px 0 0;
  position: sticky;
  top: 0;
  z-index: 10;
}

:where(.ukb-payments-scope) .input-section {
  padding: 15px 20px;
  border-bottom: 1px solid #f0f0f0;
}

:where(.ukb-payments-scope) .input-section:last-of-type {
  border-bottom: none;
}

:where(.ukb-payments-scope) .input-section label {
  display: block;
  margin-bottom: 8px;
  font-weight: 600;
  color: #333;
  font-size: 14px;
}

:where(.ukb-payments-scope) .input-section input,
:where(.ukb-payments-scope) .input-section select {
  width: 100%;
  padding: 12px 15px;
  border: 1px solid #ddd;
  border-radius: 6px;
  font-size: 16px;
  background: #fafafa;
  box-sizing: border-box;
}

:where(.ukb-payments-scope) .popup-actions {
  display: flex;
  gap: 15px;
  padding: 20px;
  background: #f8f9fa;
  border-radius: 0 0 12px 12px;
  position: sticky;
  bottom: 0;
  z-index: 10;
}

:where(.ukb-payments-scope) .popup-actions button {
  flex: 1;
  padding: 12px 20px;
  border: none;
  border-radius: 6px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
}

:where(.ukb-payments-scope) .popup-actions button:first-child {
  background: #6c757d;
  color: white;
}

:where(.ukb-payments-scope) .popup-actions button:last-child {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
}

/* VERSION MOBILE - SCROLL CORRIGÉ */
@media screen and (max-width: 768px) {
  :where(.ukb-payments-scope) .payment-popup {
    padding: 15px;
    align-items: flex-start; /* Toujours flex-start */
    justify-content: center;
    overflow-y: auto; /* Scroll activé */
  }

  :where(.ukb-payments-scope) .popup-content {
    width: 85%;
    max-width: 350px;
    max-height: 85vh;
    margin: 20px auto; /* Marge pour le scroll */
  }

  :where(.ukb-payments-scope) .popup-content h3 {
    padding: 15px;
    font-size: 16px;
  }

  :where(.ukb-payments-scope) .input-section {
    padding: 12px 15px;
  }

  :where(.ukb-payments-scope) .input-section input,
  :where(.ukb-payments-scope) .input-section select {
    padding: 10px 12px;
    font-size: 15px;
  }

  :where(.ukb-payments-scope) .popup-actions {
    flex-direction: column;
    gap: 10px;
    padding: 15px;
  }

  :where(.ukb-payments-scope) .popup-actions button {
    width: 100%;
    padding: 12px;
  }
}

/* PETITS ÉCRANS MOBILE */
@media screen and (max-width: 480px) {
  :where(.ukb-payments-scope) .payment-popup {
    padding: 10px;
    align-items: flex-start;
    justify-content: center;
    overflow-y: auto;
  }

  :where(.ukb-payments-scope) .popup-content {
    width: 90%;
    max-width: 320px;
    max-height: 90vh;
    margin: 10px auto;
  }

  :where(.ukb-payments-scope) .popup-content h3 {
    padding: 12px;
    font-size: 15px;
  }

  :where(.ukb-payments-scope) .input-section {
    padding: 10px 12px;
  }

  :where(.ukb-payments-scope) .input-section input,
  :where(.ukb-payments-scope) .input-section select {
    padding: 8px 10px;
    font-size: 14px;
  }

  :where(.ukb-payments-scope) .popup-actions {
    padding: 12px;
    gap: 8px;
  }

  :where(.ukb-payments-scope) .popup-actions button {
    padding: 10px;
    font-size: 14px;
  }
}

/* GARANTIR QUE LE SCROLL FONCTIONNE */
:where(.ukb-payments-scope) .payment-popup {
  display: flex !important;
  align-items: flex-start !important; /* Important pour le scroll */
  justify-content: center !important;
  overflow-y: auto !important;
}

:where(.ukb-payments-scope) .popup-content {
  margin-left: auto !important;
  margin-right: auto !important;
  position: relative;
  left: 0;
  right: 0;
}

/* CORRECTION SPÉCIFIQUE POUR LE SCROLL SUR MOBILE */
@media screen and (max-width: 768px) {
  :where(.ukb-payments-scope) .payment-popup {
    left: 0 !important;
    right: 0 !important;
    margin: 0 !important;
    -webkit-overflow-scrolling: touch; /* Scroll fluide sur iOS */
  }

  :where(.ukb-payments-scope) .popup-content {
    left: 0 !important;
    right: 0 !important;
    margin-left: auto !important;
    margin-right: auto !important;
  }

  /* Empêcher le body de scroller quand le popup est ouvert */
  :where(.ukb-payments-scope) body.popup-open {
    overflow: hidden;
  }
}

/* SIDEBAR BASE STYLES */
:where(.ukb-payments-scope) .sidebar {
  position: fixed;
  top: 0;
  left: 0;
  width: 280px;
  height: 100vh;
  background: #2c3e50; /* par ex. */
  background: #2c3e50; /* par ex. */
  color: white;
  z-index: 1010;
  overflow-y: auto;
  transition: transform 0.3s ease-in-out;
}

:where(.ukb-payments-scope) .sidebar-header {
  padding: 20px;
  text-align: center;
  border-bottom: 1px solid #34495e;
  background: #1a252f;
}

:where(.ukb-payments-scope) .sidebar-header h2 {
  margin: 0;
  font-size: 1.2rem;
  font-weight: bold;
  color: white;
}

:where(.ukb-payments-scope) .sidebar-menu {
  list-style-type: none;
  padding: 0;
  margin: 0;
}

:where(.ukb-payments-scope) .sidebar-menu li {
  border-bottom: 1px solid #34495e;
}

:where(.ukb-payments-scope) .sidebar-menu li:last-child {
  border-bottom: none;
}

:where(.ukb-payments-scope) .sidebar-menu a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 15px 20px;
  color: white;
  text-decoration: none;
  transition: background-color 0.3s ease;
}

:where(.ukb-payments-scope) .sidebar-menu a:hover {
  background-color: #34495e;
}

/* OVERLAY */
:where(.ukb-payments-scope) .sidebar-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.6);
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease-in-out;
}

/* VERSION MOBILE UNIQUEMENT */

/* RESPONSIVE POUR DIFFÉRENTES TAILLES MOBILE */
@media screen and (max-width: 786px) {
  :where(.ukb-payments-scope) .sidebar {
    width: 260px;
  }

}

@media screen and (max-width: 426px) {
  :where(.ukb-payments-scope) .sidebar {
    display: block;
    width: 240px;
  }

  :where(.ukb-payments-scope) .sidebar-header {
    padding: 15px;
  }

  :where(.ukb-payments-scope) .sidebar-header h2 {
    font-size: 1.1rem;
  }

  :where(.ukb-payments-scope) .sidebar-menu a {
    padding: 12px 15px;
    font-size: 14px;
  }

  :where(.ukb-payments-scope) .sidebar-toggle-btn {
    top: 15px;
    left: -15px;
    padding: 8px 10px;
    font-size: 16px;
    background: none;
  }
}

@media screen and (max-width: 375px) {
  :where(.ukb-payments-scope) .sidebar {
    display: block;
    width: 220px;
  }

  :where(.ukb-payments-scope) .sidebar-toggle-btn {
    top: 15px;
    left: 5px;
    padding: 8px 10px;
    font-size: 16px;
    background: none;
  }
  :where(.ukb-payments-scope) .sidebar-toggle-btn:hover{
    background: none;
  }

  :where(.ukb-payments-scope) .sidebar-header {
    padding: 12px;
  }

  :where(.ukb-payments-scope) .sidebar-menu a {
    padding: 10px 12px;
    font-size: 13px;
    gap: 8px;
  }
}

@media screen and (max-width: 320px) {
  :where(.ukb-payments-scope) .sidebar {
    width: 200px;
    display: block;
  }
  :where(.ukb-payments-scope) .sidebar-toggle-btn {
    top: 15px;
    left: 35px;
    padding: 8px 10px;
    font-size: 16px;
    background: none;
  }

  :where(.ukb-payments-scope) .sidebar-toggle-btn :hover {
    background: none;
  }
  :where(.ukb-payments-scope) .sidebar-header h2 {
    font-size: 1rem;
  }

  :where(.ukb-payments-scope) .sidebar-menu a {
    padding: 8px 10px;
    font-size: 12px;
  }

}

/* MAIN CONTENT ADJUSTMENT */
:where(.ukb-payments-scope) .main-content {
  margin-left: 280px;
  width: calc(100% - 280px);
  padding: 20px;
  box-sizing: border-box;
  transition: margin-left 0.3s ease;
}

@media screen and (max-width: 992px) {
  :where(.ukb-payments-scope) .main-content {
    margin-left: 0;
    width: 100%;
  }
}
:where(.ukb-payments-scope) .status-paid {
  color: #28a745;
  font-weight: bold;
  background-color: #f0fff4;
  padding: 2px 6px;
  border-radius: 3px;
}

:where(.ukb-payments-scope) .status-partial {
  color: #ffc107;
  font-weight: bold;
  background-color: #fffbf0;
  padding: 2px 6px;
  border-radius: 3px;
}

:where(.ukb-payments-scope) .status-unpaid {
  color: #dc3545;
  font-weight: bold;
  background-color: #fff5f5;
  padding: 2px 6px;
  border-radius: 3px;
}

/* Style pour l'icône d'alerte */
:where(.ukb-payments-scope) [title="Incohérence de calcul"] {
  font-size: 12px;
  cursor: help;
}
/* Styles pour les statuts dans les reçus */
:where(.ukb-payments-scope) .status-paid {
  color: #28a745;
  font-weight: bold;
}

:where(.ukb-payments-scope) .status-partial {
  color: #ffc107;
  font-weight: bold;
}

:where(.ukb-payments-scope) .status-unpaid {
  color: #dc3545;
  font-weight: bold;
}
/* ===== VARIABLES ===== */
.ukb-payments-scope {
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --primary-light: #3b82f6;
  --secondary: #64748b;
  --accent: #06b6d4;
  --success: #10b981;
  --warning: #f59e0b;
  --error: #ef4444;
  --background: #0f172a;
  --surface: #1e293b;
  --surface-light: #1a242d;
  --text-primary: #ffffff;
  --text-secondary: #ffffff;
  --text-muted: #064572;
  --border: #475569;
  --shadow: rgba(0, 0, 0, 0.3);

  --font-size-sm: 0.875rem;
  --font-size-base: 1rem;
  --font-size-lg: 1.125rem;
  --font-size-xl: 1.25rem;

  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.25rem;
  --space-6: 1.5rem;
  --space-8: 2rem;

  --radius: 0.5rem;
  --radius-lg: 0.75rem;
  --radius-xl: 1rem;

  --transition: 0.3s ease;
}

/* ===== COMPTEURS ===== */
:where(.ukb-payments-scope) .dashboard-counters {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: var(--space-6);
  margin-bottom: var(--space-8);
  width: 100%;
}

:where(.ukb-payments-scope) .counter {
  background: linear-gradient(135deg, var(--surface), var(--surface-light));
  padding: var(--space-8);
  border-radius: var(--radius-xl);
  text-align: center;
  position: relative;
  overflow: hidden;
  transition: all var(--transition);
  border: 1px solid var(--border);
  box-shadow: 0 4px 20px var(--shadow);
}

:where(.ukb-payments-scope) .counter::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--primary), var(--accent));
}

:where(.ukb-payments-scope) .counter:hover {
  transform: translateY(-8px);
  box-shadow: 0 8px 32px var(--shadow);
}

:where(.ukb-payments-scope) .counter-icon {
  font-size: 3rem;
  margin-bottom: var(--space-4);
  opacity: 0.9;
}

:where(.ukb-payments-scope) .counter.mensuel .counter-icon { color: var(--primary); }
:where(.ukb-payments-scope) .counter.reste .counter-icon { color: var(--warning); }
:where(.ukb-payments-scope) .counter.inscription .counter-icon { color: var(--success); }
:where(.ukb-payments-scope) .counter.reste-inscription .counter-icon { color: var(--error); }

:where(.ukb-payments-scope) .counter h3 {
  font-size: var(--font-size-sm);
  color: var(--text-secondary);
  margin-bottom: var(--space-3);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

:where(.ukb-payments-scope) .counter p {
  font-size: 2rem;
  font-weight: 700;
  color: var(--text-primary);
  font-feature-settings: "tnum";
  font-variant-numeric: tabular-nums;
}

/* ===== SELECTION ÉTUDIANT ===== */
:where(.ukb-payments-scope) .student-selection {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-6);
  margin-bottom: var(--space-8);
  align-items: end;
  background: var(--surface);
  padding: var(--space-6);
  border-radius: var(--radius-xl);
  box-shadow: 0 4px 20px var(--shadow);
}

:where(.ukb-payments-scope) .selected_st, :where(.ukb-payments-scope) .filter_st {
  padding: var(--space-4) var(--space-5);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: var(--font-size-base);
  background: var(--surface-light);
  color: var(--text-primary);
  transition: all var(--transition);
  flex: 1;
  min-width: 250px;

}

/* ===== FILTRES UNIFORMISÉS ===== */
:where(.ukb-payments-scope) .filters-container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 15px;
  margin: 20px 0;
  padding: 0 10px;
  width: 100%;
  box-sizing: border-box;
}

:where(.ukb-payments-scope) .filter-group {
  display: flex;
  flex-direction: column;
  gap: 5px;
  min-width: 0;
}

:where(.ukb-payments-scope) .filter-group label {
  font-weight: bold;
  font-size: 12px;
  color: #ecf0f1;
  margin-bottom: 4px;
}

/* DROPDOWNS UNIFORMES */
:where(.ukb-payments-scope) .dropdown-filter {
  position: relative;
  width: 100%;
}

:where(.ukb-payments-scope) .dropdown-toggle {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #34495e;
  border-radius: 6px;
  background: #2c3e50;
  color: #ecf0f1;
  text-align: left;
  cursor: pointer;
  font-size: 12px;
  transition: all 0.3s ease;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

:where(.ukb-payments-scope) .dropdown-toggle:hover {
  border-color: #667eea;
  background: #34495e;
}

:where(.ukb-payments-scope) .dropdown-menu {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: #2c3e50;
  border: 1px solid #34495e;
  border-radius: 6px;
  max-height: 200px;
  overflow-y: auto;
  z-index: 1000;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  margin-top: 2px;
}

:where(.ukb-payments-scope) .dropdown-item {
  padding: 10px 12px;
  cursor: pointer;
  color: #ecf0f1;
  transition: all 0.15s ease;
  border-bottom: 1px solid #34495e;
  font-size: 12px;
}

:where(.ukb-payments-scope) .dropdown-item:hover {
  background: #34495e;
}

:where(.ukb-payments-scope) .dropdown-item:last-child {
  border-bottom: none;
}

/* INPUT DATE UNIFORMISÉ */
:where(.ukb-payments-scope) .date-input {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #34495e;
  border-radius: 6px;
  font-size: 12px;
  background: #2c3e50;
  color: #ecf0f1;
  transition: all 0.3s ease;
}

:where(.ukb-payments-scope) .date-input:focus {
  outline: none;
  border-color: #667eea;
  box-shadow: 0 0 0 2px rgba(102, 126, 234, 0.2);
}

/* STATISTIQUES */
:where(.ukb-payments-scope) .filter-statistics {
  display: flex;
  gap: 15px;
  align-items: center;
  padding: 15px;
  background: #013054;
  border-radius: 8px;
  border: 1px solid #000000;
  grid-column: 1 / -1;
  justify-content: center;
  flex-wrap: wrap;
}

:where(.ukb-payments-scope) .stat-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  background: #1a252f;
  padding: 10px 15px;
  border-radius: 6px;
  min-width: 80px;
  border: 1px solid #34495e;
}

:where(.ukb-payments-scope) .stat-label {
  font-size: 11px;
  color: #000000;
  font-weight: 600;
  margin-bottom: 4px;
}

:where(.ukb-payments-scope) .stat-value {
  font-size: 16px;
  font-weight: 700;
  color: #ecf0f1;
}

/* ACTIONS DES FILTRES */
:where(.ukb-payments-scope) .filter-actions {
  display: flex;
  justify-content: center;
  margin-top: 15px;
}

:where(.ukb-payments-scope) .reset-filters-btn {
  padding: 10px 20px;
  border: none;
  border-radius: 6px;
  background: #6c757d;
  color: white;
  cursor: pointer;
  font-size: 12px;
  font-weight: 500;
  transition: all 0.3s ease;
}

:where(.ukb-payments-scope) .reset-filters-btn:hover {
  background: #5a6268;
  transform: translateY(-1px);
}

/* HEADER DE SÉLECTION */
:where(.ukb-payments-scope) .selection-header {
  display: flex;
  gap: 15px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

:where(.ukb-payments-scope) .selected_st, :where(.ukb-payments-scope) .filter_st {
  padding: 10px 12px;
  border: 1px solid #34495e;
  border-radius: 6px;
  font-size: 12px;
  background: #1a242d;
  color: #ffffff;
  transition: all 0.3s ease;
  flex: 1;
  min-width: 200px;
}

:where(.ukb-payments-scope) .selected_st:focus,
:where(.ukb-payments-scope) .filter_st:focus {
  outline: none;
  border-color: #667eea;
  box-shadow: 0 0 0 2px rgba(102, 126, 234, 0.2);
}

/* RESPONSIVE */
@media (max-width: 768px) {
  :where(.ukb-payments-scope) .filters-container {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  :where(.ukb-payments-scope) .selection-header {
    flex-direction: column;
  }

  :where(.ukb-payments-scope) .selected_st, :where(.ukb-payments-scope) .filter_st {
    min-width: auto;
    width: 100%;
  }

  :where(.ukb-payments-scope) .filter-statistics {
    gap: 10px;
  }

  :where(.ukb-payments-scope) .stat-item {
    min-width: 70px;
    padding: 8px 12px;
  }
}

:where(.ukb-payments-scope) .selected_st:focus,
:where(.ukb-payments-scope) .filter_st:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

/* ===== CONTAINER FILTRES ===== */
:where(.ukb-payments-scope) .filters-container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: var(--space-6);
  margin: var(--space-8) 0;
  width: 100%;
  padding: var(--space-6);
  background: var(--surface);
  border-radius: var(--radius-xl);
  box-shadow: 0 4px 20px var(--shadow);
}

/* ===== GROUPES DE FILTRES ===== */
:where(.ukb-payments-scope) .filter-group {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  min-width: 0;
}

:where(.ukb-payments-scope) .filter-group label {
  font-weight: 600;
  font-size: var(--font-size-sm);
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: var(--space-2);
}

:where(.ukb-payments-scope) .filter-group select,
:where(.ukb-payments-scope) .filter-group input {
  padding: var(--space-4) var(--space-5);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: var(--font-size-base);
  background: var(--surface-light);
  color: var(--text-primary);
  transition: all var(--transition);
  width: 100%;
}

:where(.ukb-payments-scope) .filter-group select:focus,
:where(.ukb-payments-scope) .filter-group input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

/* ===== DROPDOWN FILTRES ===== */
:where(.ukb-payments-scope) .dropdown-filter {
  position: relative;
  width: 100%;
}

:where(.ukb-payments-scope) .dropdown-toggle {
  width: 100%;
  padding: var(--space-4) var(--space-5);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface-light);
  color: var(--text-primary);
  text-align: left;
  cursor: pointer;
  font-size: var(--font-size-base);
  transition: all var(--transition);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

:where(.ukb-payments-scope) .dropdown-toggle::after {
  content: '▼';
  font-size: var(--font-size-sm);
  transition: transform var(--transition);
}

:where(.ukb-payments-scope) .dropdown-toggle.active::after {
  transform: rotate(180deg);
}

:where(.ukb-payments-scope) .dropdown-menu {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  max-height: 200px;
  overflow-y: auto;
  z-index: 1000;
  box-shadow: 0 8px 32px var(--shadow);
  margin-top: var(--space-2);
}

:where(.ukb-payments-scope) .dropdown-item {
  padding: var(--space-3) var(--space-5);
  cursor: pointer;
  color: var(--text-primary);
  transition: all 0.15s ease;
  border-bottom: 1px solid var(--border);
}

:where(.ukb-payments-scope) .dropdown-item:hover {
  background: var(--surface-light);
}

:where(.ukb-payments-scope) .dropdown-item:last-child {
  border-bottom: none;
}

/* ===== STATISTIQUES FILTRES ===== */
:where(.ukb-payments-scope) .filter-statistics-2 {
  display: flex;
  gap: var(--space-6);
  align-items: center;
  padding: var(--space-5);
  background: var(--surface-light);
  border-radius: var(--radius);
  flex-wrap: wrap;
  justify-content: center;
  grid-column: 1 / -1;
  margin-top: var(--space-4);
}
:where(.ukb-payments-scope) .filter-statistics-2 .stat-item{
  background: #1a252f;
}
:where(.ukb-payments-scope) .stat-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  background: var(--surface);
  padding: var(--space-4) var(--space-5);
  border-radius: var(--radius);
  min-width: 100px;
  border: 1px solid var(--border);
  transition: all var(--transition);
}

:where(.ukb-payments-scope) .stat-item:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px var(--shadow);
}

:where(.ukb-payments-scope) .stat-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: var(--space-2);
}

:where(.ukb-payments-scope) .stat-value {
  font-size: var(--font-size-lg);
  font-weight: 700;
  color: var(--text-primary);
}

/* ===== CONTROLES ADMIN ===== */
:where(.ukb-payments-scope) .admin-controls {
  margin: var(--space-6) 0;
  padding: var(--space-6);
  background: var(--surface);
  border-radius: var(--radius-xl);
  border: 1px solid var(--border);
  box-shadow: 0 4px 20px var(--shadow);
  width: 100%;
}

:where(.ukb-payments-scope) .admin-controls h3 {
  margin-bottom: var(--space-5);
  color: var(--text-secondary);
  font-size: var(--font-size-lg);
  font-weight: 600;
  text-align: center;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

:where(.ukb-payments-scope) .admin-buttons {
  display: flex;
  gap: var(--space-4);
  flex-wrap: wrap;
  justify-content: center;
}

:where(.ukb-payments-scope) .admin-btn, :where(.ukb-payments-scope) .reset-filters-btn {
  padding: var(--space-3) var(--space-5);
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  font-weight: 600;
  font-size: var(--font-size-sm);
  transition: all var(--transition);
  display: flex;
  align-items: center;
  gap: var(--space-2);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

:where(.ukb-payments-scope) .admin-btn.refresh {
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  color: white;
}

:where(.ukb-payments-scope) .admin-btn.reini {
  background: linear-gradient(135deg, var(--secondary), #475569);
  color: white;
}

:where(.ukb-payments-scope) .reset-filters-btn {
  background: linear-gradient(135deg, var(--warning), #d97706);
  color: white;
  width: 100%;
  justify-content: center;
  margin-top: var(--space-4);
}

:where(.ukb-payments-scope) .admin-btn:hover,
:where(.ukb-payments-scope) .reset-filters-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px var(--shadow);
}

/* ===== RESPONSIVE ===== */

/* Desktop */
@media (max-width: 1200px) {
  :where(.ukb-payments-scope) .filters-container {
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: var(--space-4);
  }

  :where(.ukb-payments-scope) .dashboard-counters {
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  }
}

/* Tablet */
@media (max-width: 992px) {
  :where(.ukb-payments-scope) .filters-container {
    grid-template-columns: repeat(2, 1fr);
    padding: 0 var(--space-3);
  }

  :where(.ukb-payments-scope) .student-selection {
    flex-direction: column;
    align-items: stretch;
  }

  :where(.ukb-payments-scope) .selected_st, :where(.ukb-payments-scope) .filter_st {
    width: 100%;
    min-width: auto;
  }

  :where(.ukb-payments-scope) .dashboard-counters {
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: var(--space-4);
  }
}

/* Mobile */
@media (max-width: 768px) {
  :where(.ukb-payments-scope) .filters-container {
    grid-template-columns: 1fr;
    gap: var(--space-4);
    margin: var(--space-6) 0;
  }

  :where(.ukb-payments-scope) .filter-group {
    min-width: 100%;
  }

  :where(.ukb-payments-scope) .filter-statistics-2 {
    gap: var(--space-4);
    justify-content: space-around;
  }

  :where(.ukb-payments-scope) .stat-item {
    min-width: 70px;
    padding: var(--space-3) var(--space-4);
  }

  :where(.ukb-payments-scope) .dashboard-counters {
    grid-template-columns: 1fr;
    gap: var(--space-4);
  }

  :where(.ukb-payments-scope) .counter {
    padding: var(--space-6);
  }
}

/* Small Mobile */
@media (max-width: 576px) {
  :where(.ukb-payments-scope) .filter-statistics-2 {
    gap: var(--space-3);
  }

  :where(.ukb-payments-scope) .stat-item {
    min-width: 60px;
    padding: var(--space-3);
  }

  :where(.ukb-payments-scope) .stat-label {
    font-size: 0.65rem;
  }

  :where(.ukb-payments-scope) .stat-value {
    font-size: var(--font-size-base);
  }

  :where(.ukb-payments-scope) .counter h3 {
    font-size: 0.875rem;
  }

  :where(.ukb-payments-scope) .counter p {
    font-size: 1.5rem;
  }
}

/* ===== SCROLLBAR FILTRES ===== */
:where(.ukb-payments-scope) .dropdown-menu::-webkit-scrollbar {
  width: 6px;
}

:where(.ukb-payments-scope) .dropdown-menu::-webkit-scrollbar-track {
  background: var(--surface-light);
}

:where(.ukb-payments-scope) .dropdown-menu::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: var(--radius);
}

:where(.ukb-payments-scope) .dropdown-menu::-webkit-scrollbar-thumb:hover {
  background: var(--border-light);
}
/* Styles pour le dropdown avec recherche */
:where(.ukb-payments-scope) .searchable-dropdown-container {
  position: relative;
  min-width: 300px;
  max-width: 400px;
}

:where(.ukb-payments-scope) .dropdown-trigger {
  position: relative;
  display: flex;
  align-items: center;
}

:where(.ukb-payments-scope) .searchable-input {
  width: 100%;
  padding: 10px 35px 10px 15px;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 14px;
  background-color: white;
  cursor: pointer;
}

:where(.ukb-payments-scope) .searchable-input:focus {
  outline: none;
  border-color: #3498db;
  box-shadow: 0 0 0 2px rgba(52, 152, 219, 0.2);
}

:where(.ukb-payments-scope) .dropdown-arrow {
  position: absolute;
  right: 10px;
  pointer-events: none;
  color: #7f8c8d;
}

:where(.ukb-payments-scope) .dropdown-menu {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: #191616;
  border: 1px solid #ddd;
  border-radius: 4px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.15);
  z-index: 1000;
  margin-top: 5px;
  max-height: 400px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

:where(.ukb-payments-scope) .dropdown-search-header {
  display: flex;
  padding: 10px;
  background: #f8f9fa;
  border-bottom: 1px solid #eee;
}

:where(.ukb-payments-scope) .dropdown-search-input {
  flex: 1;
  padding: 8px 12px;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 14px;
}

:where(.ukb-payments-scope) .dropdown-search-input:focus {
  outline: none;
  border-color: #3498db;
}

:where(.ukb-payments-scope) .close-dropdown {
  background: none;
  border: none;
  font-size: 20px;
  cursor: pointer;
  color: #95a5a6;
  margin-left: 10px;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
}

:where(.ukb-payments-scope) .close-dropdown:hover {
  background: #e9ecef;
  color: #e74c3c;
}

:where(.ukb-payments-scope) .dropdown-list {
  flex: 1;
  overflow-y: auto;
  max-height: 300px;
}

:where(.ukb-payments-scope) .dropdown-item {
  padding: 12px 15px;
  border-bottom: 1px solid #f0f0f0;
  cursor: pointer;
  transition: background-color 0.2s;
}

:where(.ukb-payments-scope) .dropdown-item:hover {
  background-color: #f8f9fa;
}

:where(.ukb-payments-scope) .dropdown-item:last-child {
  border-bottom: none;
}

:where(.ukb-payments-scope) .student-info-row {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

:where(.ukb-payments-scope) .student-name {
  font-weight: 600;
  color: #2c3e50;
}

:where(.ukb-payments-scope) .student-details {
  font-size: 12px;
  color: #7f8c8d;
  display: flex;
  gap: 10px;
}

:where(.ukb-payments-scope) .no-results {
  padding: 20px;
  text-align: center;
  color: #95a5a6;
  font-style: italic;
}

:where(.ukb-payments-scope) .dropdown-footer {
  padding: 10px 15px;
  background: #191616;
  border-top: 1px solid #eee;
  font-size: 12px;
  color: #7f8c8d;
  text-align: center;
}

/* Pour mobile */
@media (max-width: 768px) {
  :where(.ukb-payments-scope) .searchable-dropdown-container {
    min-width: 100%;
    max-width: 100%;
  }

  :where(.ukb-payments-scope) .dropdown-menu {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 90%;
    max-height: 80vh;
    z-index: 2000;
  }
}

/* ==========================================================================
   MODE EMBARQUÉ DANS L'ESPACE COMPTABLE (AccountantDashboard)
   ========================================================================== */
:where(.ukb-payments-scope) .payment-dashboard.embedded {
  width: 100% !important;
  max-width: 100% !important;
  min-height: auto !important;
  background: transparent !important;
  box-shadow: none !important;
  padding: 0 !important;
  margin: 0 !important;
}

:where(.ukb-payments-scope) .payment-dashboard.embedded .main-content.embedded {
  margin-left: 0 !important;
  width: 100% !important;
  max-width: 100% !important;
  padding: 0 !important;
  min-height: auto !important;
  box-shadow: none !important;
}

/* Le formulaire de paiement garde un contraste lisible dans tous les thèmes. */
:where(.ukb-payments-scope) .payment-popup .popup-content .input-section input,
:where(.ukb-payments-scope) .payment-popup .popup-content .input-section select,
:where(.ukb-payments-scope) .payment-popup .popup-content .input-section textarea {
  color: #1f2937 !important;
  -webkit-text-fill-color: #1f2937 !important;
  background-color: #fafafa !important;
  caret-color: #1f2937;
  color-scheme: light;
  opacity: 1;
}

:where(.ukb-payments-scope) .payment-popup .popup-content .input-section select option {
  color: #1f2937 !important;
  -webkit-text-fill-color: #1f2937 !important;
  background-color: #fff !important;
}

:where(.ukb-payments-scope) .payment-popup .popup-content .input-section input::placeholder,
:where(.ukb-payments-scope) .payment-popup .popup-content .input-section textarea::placeholder {
  color: #64748b !important;
  -webkit-text-fill-color: #64748b !important;
  opacity: 1;
}




/* Audit accessibility, 9 November 2026 */
:where(.ukb-payments-scope) .stat-item .stat-label {color: #e2e8f0;background: #0a0f1c;}
:where(.ukb-payments-scope) .dropdown-arrow:focus-visible {outline: 3px solid #2563eb;outline-offset: 3px;}

:where(.ukb-payments-scope) .modal-history-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

:where(.ukb-payments-scope) .payment-section .section-content .payment-row span{
    color: #0a0f1c;
}

:where(.ukb-payments-scope) .modal-history-content {
    background: white;
    border-radius: 10px;
    width: 90%;
    max-width: 1200px;
    max-height: 80vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    color: #1a252f; /* Couleur de texte principale */
}

:where(.ukb-payments-scope) .modal-history-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    background: #2c3e50;
    color: white;
}

:where(.ukb-payments-scope) .close-btn {
    background: none;
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
}

:where(.ukb-payments-scope) .student-info {
    padding: 15px 20px;
    background: #f8f9fa;
    border-bottom: 1px solid #ddd;
    color: #1a252f; /* Texte visible */
}

:where(.ukb-payments-scope) .payments-table-container {
    flex: 1;
    overflow-y: auto;
    padding: 0 20px;
}

:where(.ukb-payments-scope) .payments-history-table {
    width: 100%;
    border-collapse: collapse;
    margin: 10px 0;
    color: #1a252f; /* Texte visible */
}

:where(.ukb-payments-scope) .payments-history-table th,
:where(.ukb-payments-scope) .payments-history-table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #ddd;
    color: #1a252f; /* Texte visible */
}

:where(.ukb-payments-scope) .payments-history-table th {
    background: #34495e;
    color: white;
    position: sticky;
    top: 0;
}

:where(.ukb-payments-scope) .status-paid {
    color: #27ae60;
    font-weight: bold;
}

:where(.ukb-payments-scope) .status-pending {
    color: #e74c3c;
    font-weight: bold;
}

:where(.ukb-payments-scope) .receipt-btn {
    background: #3498db;
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 4px;
    cursor: pointer;
}

:where(.ukb-payments-scope) .receipt-btn:hover {
    background: #2980b9;
}

:where(.ukb-payments-scope) .modal-history-footer {
    padding: 15px 20px;
    background: #f8f9fa;
    text-align: right;
    color: #1a252f; /* Texte visible */
}

:where(.ukb-payments-scope) .close-button {
    background: #95a5a6;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 5px;
    cursor: pointer;
}

:where(.ukb-payments-scope) .close-button:hover {
    background: #7f8c8d;
}

:where(.ukb-payments-scope) .theme-selector-container {
    position: absolute;
    top: 20px;
    right: 20px;
    z-index: 1000;
}

/* Ajoutez aussi ces styles à ModalHistory.css */
:where(.ukb-payments-scope) .no-data-message {
    text-align: center;
    padding: 40px;
    color: #666;
    font-style: italic;
}

:where(.ukb-payments-scope) .summary-section {
    margin-bottom: 20px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
    color: #1a252f; /* Texte visible */
}

:where(.ukb-payments-scope) .summary-cards {
    display: flex;
    gap: 15px;
    margin-top: 10px;
}

:where(.ukb-payments-scope) .summary-card {
    flex: 1;
    padding: 15px;
    background: white;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    text-align: center;
    color: #1a252f; /* Texte visible */
}

:where(.ukb-payments-scope) .summary-label {
    display: block;
    font-size: 12px;
    color: #495057; /* Couleur corrigée - pas blanc */
    margin-bottom: 5px;
}

:where(.ukb-payments-scope) .summary-value {
    display: block;
    font-size: 16px;
    font-weight: bold;
    color: #1a252f; /* Couleur corrigée - pas blanc */
}

:where(.ukb-payments-scope) .modal-actions {
    margin-top: 20px;
    text-align: center;
}

:where(.ukb-payments-scope) .close-modal-btn {
    padding: 10px 20px;
    background: #6c757d;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

:where(.ukb-payments-scope) .close-modal-btn:hover {
    background: #5a6268;
}

/* Styles pour le debug */
:where(.ukb-payments-scope) .debug-info {
    margin-top: 15px;
    padding: 10px;
    background: #fff3cd;
    border: 1px solid #ffeaa7;
    border-radius: 4px;
    font-size: 12px;
    color: #856404; /* Texte visible */
}

:where(.ukb-payments-scope) .student-info.warning {
    background: #fff3cd;
    border: 1px solid #ffeaa7;
    border-radius: 6px;
    padding: 15px;
    margin-bottom: 20px;
    color: #856404; /* Texte visible */
}

:where(.ukb-payments-scope) .student-info.warning h3 {
    color: #856404;
    margin: 0 0 10px 0;
}

:where(.ukb-payments-scope) .student-info.warning p {
    color: #856404;
    margin: 0;
}

:where(.ukb-payments-scope) .compact-row {
    font-style: italic;
    background: #f9f9f9;
    border-top: 1px solid #ddd;
    color: #1a252f; /* Texte visible */
}

:where(.ukb-payments-scope) .modal-history-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.7);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

:where(.ukb-payments-scope) .modal-history-content {
    background: white;
    border-radius: 12px;
    padding: 25px;
    max-width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    width: 1000px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    color: #1a252f; /* Texte visible */
}

:where(.ukb-payments-scope) .modal-history-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    border-bottom: 2px solid #4CAF50;
    padding-bottom: 15px;
}

:where(.ukb-payments-scope) .modal-history-header h2 {
    color: #ffffff;
    margin: 0;
    font-size: 24px;
}

:where(.ukb-payments-scope) .close-btn {
    background: none;
    border: none;
    font-size: 28px;
    cursor: pointer;
    color: #999;
    padding: 5px;
    width: 50px;
}

:where(.ukb-payments-scope) .close-btn:hover {
    color: #ff4757;
}

:where(.ukb-payments-scope) .student-info {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
    border-left: 4px solid #013054;
    color: #1a252f; /* Texte visible */
}

:where(.ukb-payments-scope) .student-info h3 {
    margin: 0 0 8px 0;
    color: #2c3e50;
    font-size: 18px;
}

:where(.ukb-payments-scope) .student-info p {
    margin: 0;
    color: #666;
    font-size: 14px;
}

:where(.ukb-payments-scope) .summary-section {
    margin-bottom: 25px;
    color: #1a252f; /* Texte visible */
}

:where(.ukb-payments-scope) .summary-section h4 {
    color: #2c3e50;
    margin-bottom: 15px;
    font-size: 18px;
}

:where(.ukb-payments-scope) .summary-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-bottom: 20px;
}

:where(.ukb-payments-scope) .summary-card {
    background: linear-gradient(135deg, #1a242d 0%, #013054 100%);
    color: #ffffff; /* Texte blanc uniquement pour ces cartes spécifiques */
    padding: 20px;
    border-radius: 12px;
    text-align: center;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

:where(.ukb-payments-scope) .summary-label {
    display: block;
    font-size: 14px;
    margin-bottom: 8px;
    opacity: 0.9;
    color: #ffffff; /* Texte blanc pour les labels dans les cartes sombres */
}

:where(.ukb-payments-scope) .summary-value {
    display: block;
    font-size: 24px;
    font-weight: bold;
    color: #ffffff; /* Texte blanc pour les valeurs dans les cartes sombres */
}

:where(.ukb-payments-scope) .transactions-table-container {
    overflow-x: auto;
    margin-top: 20px;
}

:where(.ukb-payments-scope) .transactions-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    color: #1a252f; /* Texte visible */
}

:where(.ukb-payments-scope) .transactions-table th {
    background: linear-gradient(135deg, #000000 0%, #1a242d 100%);
    color: white;
    padding: 15px;
    text-align: left;
    font-weight: 600;
    font-size: 14px;
}

:where(.ukb-payments-scope) .transactions-table td {
    padding: 12px 15px;
    border-bottom: 1px solid #e0e0e0;
    font-size: 14px;
    color: #1a252f; /* Texte visible */
    background: white; /* Fond blanc pour les cellules */
}

:where(.ukb-payments-scope) .transactions-table tr:hover {
    background-color: #f8f9fa; /* Couleur de survol plus claire */
    color: #1a252f; /* Texte visible au survol */
}

:where(.ukb-payments-scope) .transaction-type {
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
}

:where(.ukb-payments-scope) .transaction-type.mensuel {
    background: #e3f2fd;
    color: #1976d2;
}

:where(.ukb-payments-scope) .transaction-type.inscription {
    background: #e8f5e8;
    color: #2e7d32;
}

:where(.ukb-payments-scope) .status-paid {
    color: #28a745;
    font-weight: 600;
}

:where(.ukb-payments-scope) .btnhistory{
    display: flex;
}

:where(.ukb-payments-scope) .receipt-btn {
    background: #4CAF50;
    color: white;
    border: none;
    padding: 8px 15px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 8px;
    transition: background 0.3s;
}

:where(.ukb-payments-scope) .receipt-btn:hover {
    background: #45a049;
    transform: translateY(-1px);
}

:where(.ukb-payments-scope) .loading, :where(.ukb-payments-scope) .error-message, :where(.ukb-payments-scope) .no-data-message {
    text-align: center;
    padding: 40px;
    font-size: 18px;
    color: #666;
}

:where(.ukb-payments-scope) .error-message {
    color: #ff4757;
}

/* Responsive */
@media (max-width: 768px) {
    :where(.ukb-payments-scope) .modal-history-content {
        margin: 20px;
        padding: 15px;
        max-width: 95%;
    }

    :where(.ukb-payments-scope) .summary-cards {
        grid-template-columns: 1fr;
    }

    :where(.ukb-payments-scope) .transactions-table {
        font-size: 12px;
    }

    :where(.ukb-payments-scope) .transactions-table th,
    :where(.ukb-payments-scope) .transactions-table td {
        padding: 8px;
    }
}

:where(.ukb-payments-scope) .delete-btn {
    background: #e74c3c;
    color: white;
    border: none;
    border-radius: 4px;
    padding: 6px 10px;
    margin-left: 8px;
    cursor: pointer;
    font-size: 8px;
    transition: background 0.3s;
}

:where(.ukb-payments-scope) .delete-btn:hover {
    background: #c0392b;
}

:where(.ukb-payments-scope) .receipt-btn {
    background: #3498db;
    color: white;
    border: none;
    border-radius: 4px;
    padding: 6px 10px;
    cursor: pointer;
    font-size: 14px;
    transition: background 0.3s;
}

:where(.ukb-payments-scope) .receipt-btn:hover {
    background: #2980b9;
}

:where(.ukb-payments-scope) .loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

:where(.ukb-payments-scope) .loading-spinner {
    background: white;
    padding: 20px;
    border-radius: 8px;
    font-weight: bold;
    color: #1a252f; /* Texte visible */
}

/* Styles pour les calculs dynamiques */
:where(.ukb-payments-scope) .calculs-dynamiques {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin: 20px 0;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #e9ecef;
    color: #1a252f; /* Texte visible */
}

:where(.ukb-payments-scope) .calculs-section h4 {
    margin: 0 0 10px 0;
    color: #2c3e50;
    font-size: 16px;
}

:where(.ukb-payments-scope) .calculs-grid {
    display: grid;
    gap: 8px;
}

:where(.ukb-payments-scope) .calcul-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 5px 0;
    border-bottom: 1px solid #e9ecef;
    color: #1a252f; /* Texte visible */
}

:where(.ukb-payments-scope) .calcul-item:last-child {
    border-bottom: none;
}

:where(.ukb-payments-scope) .calcul-label {
    font-weight: 600;
    color: #495057;
}

:where(.ukb-payments-scope) .calcul-value {
    font-weight: 700;
    color: #2c3e50;
}

:where(.ukb-payments-scope) .calcul-statut {
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
}

:where(.ukb-payments-scope) .statut-paye {
    background-color: #d4edda;
    color: #155724;
}

:where(.ukb-payments-scope) .statut-partiel {
    background-color: #fff3cd;
    color: #856404;
}

:where(.ukb-payments-scope) .statut-impaye {
    background-color: #f8d7da;
    color: #721c24;
}

/* Responsive */
@media (max-width: 768px) {
    :where(.ukb-payments-scope) .calculs-dynamiques {
        grid-template-columns: 1fr;
        gap: 15px;
    }
}

/* Styles existants améliorés */
:where(.ukb-payments-scope) .summary-cards {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
    margin-bottom: 20px;
}

:where(.ukb-payments-scope) .summary-card {
    background: white;
    padding: 15px;
    border-radius: 8px;
    border: 1px solid #e9ecef;
    text-align: center;
    color: #1a252f; /* Texte visible */
}

:where(.ukb-payments-scope) .summary-label {
    display: block;
    font-size: 12px;
    color: #6c757d; /* Gris visible */
    margin-bottom: 5px;
}

:where(.ukb-payments-scope) .summary-value {
    display: block;
    font-size: 18px;
    font-weight: 700;
    color: #2c3e50; /* Texte foncé visible */
}

/* Dans ModalHistory.css */
:where(.ukb-payments-scope) .header-actions {
    display: flex;
    gap: 10px;
    align-items: center;
}

:where(.ukb-payments-scope) .reload-btn {
    background: #28a745;
    color: white;
    border: none;
    border-radius: 4px;
    padding: 5px 10px;
    cursor: pointer;
    font-size: 14px;
}

:where(.ukb-payments-scope) .reload-btn:disabled {
    background: #6c757d;
    cursor: not-allowed;
}

:where(.ukb-payments-scope) .reload-btn:hover:not(:disabled) {
    background: #218838;
}

:where(.ukb-payments-scope) .retry-btn {
    background: #007bff;
    color: white;
    border: none;
    border-radius: 4px;
    padding: 8px 15px;
    cursor: pointer;
    margin-top: 10px;
}

:where(.ukb-payments-scope) .retry-btn:hover {
    background: #0056b3;
}

:where(.ukb-payments-scope) .edit-btn {
    background: #ffc107;
    color: #212529;
    border: none;
    border-radius: 4px;
    padding: 5px 10px;
    cursor: pointer;
    margin-right: 5px;
}

:where(.ukb-payments-scope) .edit-btn:hover {
    background: #e0a800;
}

/* CORRECTIONS SPÉCIFIQUES POUR LES ÉLÉMENTS BLANCS */
:where(.ukb-payments-scope) .summary-card:not([class*="background"]) {
    background: white !important;
    color: #1a252f !important;
}

:where(.ukb-payments-scope) .summary-card .summary-label,
:where(.ukb-payments-scope) .summary-card .summary-value {
    color: #1a252f !important;
}

/* Assurer que tous les textes sont visibles */
:where(.ukb-payments-scope) * {
    color: inherit;
}

/* Surcharger les couleurs de texte problématiques */
:where(.ukb-payments-scope) [style*="color: white"],
:where(.ukb-payments-scope) [style*="color: #fff"],
:where(.ukb-payments-scope) [style*="color: #ffffff"] {
    color: #1a252f !important;
}

/* Correction spécifique pour les lignes du tableau */
:where(.ukb-payments-scope) .transactions-table tr {
    background: white;
    color: #1a252f;
}

:where(.ukb-payments-scope) .transactions-table tr td {
    background: white;
    color: #1a252f;
}
/* CORRECTIONS SPÉCIFIQUES POUR LES SECTIONS FRAIS MENSUELS ET INSCRIPTION */
:where(.ukb-payments-scope) .calculs-dynamiques .calculs-section {
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 15px;
}

:where(.ukb-payments-scope) .calculs-dynamiques .calculs-section h4 {
    color: #2c3e50 !important;
    font-size: 16px;
    margin-bottom: 15px;
    border-bottom: 2px solid #3498db;
    padding-bottom: 8px;
}

:where(.ukb-payments-scope) .calculs-grid {
    display: grid;
    gap: 10px;
}

:where(.ukb-payments-scope) .calcul-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid #f0f0f0;
    color: #2c3e50 !important;
}

:where(.ukb-payments-scope) .calcul-item:last-child {
    border-bottom: none;
}

:where(.ukb-payments-scope) .calcul-label {
    font-weight: 600;
    color: #495057 !important;
    font-size: 14px;
}

:where(.ukb-payments-scope) .calcul-value {
    font-weight: 700;
    color: #2c3e50 !important;
    font-size: 14px;
}

/* Styles pour les statuts */
:where(.ukb-payments-scope) .calcul-statut {
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
}

:where(.ukb-payments-scope) .statut-paye {
    background-color: #d4edda !important;
    color: #155724 !important;
    border: 1px solid #c3e6cb;
}

:where(.ukb-payments-scope) .statut-partiel {
    background-color: #fff3cd !important;
    color: #856404 !important;
    border: 1px solid #ffeaa7;
}

:where(.ukb-payments-scope) .statut-impaye {
    background-color: #f8d7da !important;
    color: #721c24 !important;
    border: 1px solid #f5c6cb;
}

/* Correction spécifique pour les titres des sections */
:where(.ukb-payments-scope) .student-info h3 {
    color: #2c3e50 !important;
    margin-bottom: 10px;
}

:where(.ukb-payments-scope) .student-info p {
    color: #666 !important;
    margin-bottom: 15px;
}

/* Assurer que tous les textes dans les sections d'info sont visibles */
:where(.ukb-payments-scope) .student-info * {
    color: #2c3e50 !important;
}

/* Correction pour les cartes de résumé qui pourraient avoir du texte blanc */
:where(.ukb-payments-scope) .summary-card {
    background: linear-gradient(135deg, #1a242d 0%, #013054 100%);
}

:where(.ukb-payments-scope) .summary-card .summary-label,
:where(.ukb-payments-scope) .summary-card .summary-value {
    color: #ffffff !important; /* Garder le texte blanc uniquement pour ces cartes spécifiques */
}

/* Pour les autres cartes qui ne devraient pas avoir de fond sombre */
:where(.ukb-payments-scope) .summary-card:not([class*="background"]) {
    background: white !important;
}

:where(.ukb-payments-scope) .summary-card:not([class*="background"]) .summary-label {
    color: #6c757d !important;
}

:where(.ukb-payments-scope) .summary-card:not([class*="background"]) .summary-value {
    color: #2c3e50 !important;
}

/* Correction pour le tableau des transactions */
:where(.ukb-payments-scope) .transactions-table {
    background: white;
}

:where(.ukb-payments-scope) .transactions-table th {
    background: linear-gradient(135deg, #000000 0%, #1a242d 100%);
    color: white !important; /* Garder le texte blanc pour les en-têtes */
}

:where(.ukb-payments-scope) .transactions-table td {
    background: white;
    color: #2c3e50 !important;
    border-bottom: 1px solid #e9ecef;
}

/* Styles pour les types de transaction */
:where(.ukb-payments-scope) .transaction-type.mensuel {
    background: #e3f2fd !important;
    color: #1976d2 !important;
    border: 1px solid #bbdefb;
}

:where(.ukb-payments-scope) .transaction-type.inscription {
    background: #e8f5e8 !important;
    color: #2e7d32 !important;
    border: 1px solid #c8e6c9;
}

/* FORCER la visibilité de tous les textes dans la modal */
:where(.ukb-payments-scope) .modal-history-content,
:where(.ukb-payments-scope) .modal-history-content * {
    color: #2c3e50 !important;
}

/* Exceptions pour les éléments qui doivent rester blancs */
:where(.ukb-payments-scope) .modal-history-header,
:where(.ukb-payments-scope) .modal-history-header *,
:where(.ukb-payments-scope) .transactions-table th,
:where(.ukb-payments-scope) .transactions-table th *,
:where(.ukb-payments-scope) .summary-card,
:where(.ukb-payments-scope) .summary-card * {
    color: white !important;
}

/* Correction spécifique pour les boutons */
:where(.ukb-payments-scope) .receipt-btn,
:where(.ukb-payments-scope) .edit-btn,
:where(.ukb-payments-scope) .delete-btn,
:where(.ukb-payments-scope) .reload-btn,
:where(.ukb-payments-scope) .retry-btn {
    color: white !important;
}

:where(.ukb-payments-scope) .receipt-btn:hover,
:where(.ukb-payments-scope) .edit-btn:hover,
:where(.ukb-payments-scope) .delete-btn:hover,
:where(.ukb-payments-scope) .reload-btn:hover,
:where(.ukb-payments-scope) .retry-btn:hover {
    color: white !important;
}

/* Styles pour les messages */
:where(.ukb-payments-scope) .loading,
:where(.ukb-payments-scope) .error-message,
:where(.ukb-payments-scope) .no-data-message {
    color: #666 !important;
}

:where(.ukb-payments-scope) .error-message {
    color: #ff4757 !important;
}

/* Responsive */
@media (max-width: 768px) {
    :where(.ukb-payments-scope) .calculs-dynamiques {
        grid-template-columns: 1fr;
    }

    :where(.ukb-payments-scope) .calcul-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
    }

    :where(.ukb-payments-scope) .calcul-value {
        align-self: flex-end;
    }
}
:where(.ukb-payments-scope) .modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
  }
  
  :where(.ukb-payments-scope) .modal-content {
    background: white;
    padding: 20px;
    border-radius: 10px;
    width: 80%;
    max-width: 600px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
  }
  
  :where(.ukb-payments-scope) .close-btn {
    background: red;
    color: white;
    border: none;
    padding: 10px;
    cursor: pointer;
    margin-top: 10px;
  }
  
  :where(.ukb-payments-scope) table {
    width: 100%;
    border-collapse: collapse;
  }
  
  :where(.ukb-payments-scope) th, :where(.ukb-payments-scope) td {
    padding: 10px;
    border-bottom: 1px solid #ddd;
    text-align: left;
  }
  
:where(.ukb-payments-scope) .theme-selector {
    position: relative;
    display: inline-block;
}

:where(.ukb-payments-scope) .theme-toggle-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 10px 15px;
    border-radius: 25px;
    cursor: pointer;
    font-weight: 500;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
}

:where(.ukb-payments-scope) .theme-toggle-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}

:where(.ukb-payments-scope) .theme-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    background: white;
    border-radius: 8px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    padding: 10px;
    z-index: 1000;
    min-width: 120px;
}

:where(.ukb-payments-scope) .theme-option {
    display: block;
    width: 100%;
    padding: 8px 12px;
    border: none;
    background: none;
    text-align: left;
    cursor: pointer;
    border-radius: 4px;
    margin: 2px 0;
    transition: all 0.2s ease;
}

:where(.ukb-payments-scope) .theme-option:hover {
    background: #f8f9fa;
}

:where(.ukb-payments-scope) .theme-option.active {
    background: #007bff;
    color: white;
}

/* Thèmes globaux */
.ukb-payments-scope {
    --primary-color: #007bff;
    --secondary-color: #6c757d;
    --success-color: #28a745;
    --danger-color: #dc3545;
    --warning-color: #ffc107;
    --info-color: #17a2b8;
    --light-color: #f8f9fa;
    --dark-color: #343a40;
    --background-color: #ffffff;
    --text-color: #212529;
    --border-color: #dee2e6;
}

:where(.ukb-payments-scope) .theme-dark {
    --primary-color: #0d6efd;
    --background-color: #1a1a1a;
    --text-color: #ffffff;
    --border-color: #495057;
}

:where(.ukb-payments-scope) .theme-blue {
    --primary-color: #1e88e5;
    --background-color: #e3f2fd;
    --text-color: #1565c0;
    --border-color: #90caf9;
}

:where(.ukb-payments-scope) .theme-green {
    --primary-color: #43a047;
    --background-color: #e8f5e8;
    --text-color: #2e7d32;
    --border-color: #a5d6a7;
}

:where(.ukb-payments-scope) .theme-purple {
    --primary-color: #8e24aa;
    --background-color: #f3e5f5;
    --text-color: #7b1fa2;
    --border-color: #ce93d8;
}

/* Application des variables CSS */
:where(.ukb-payments-scope) body {
    background-color: var(--background-color);
    color: var(--text-color);
}
:where(.ukb-payments-scope) .academic-year-summary-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 16px;
    margin: 0 0 20px;
    padding: 18px 22px;
    border: 1px solid #475569;
    border-radius: 14px;
    background: #111c2e;
    color: #f8fafc;
}
:where(.ukb-payments-scope) .academic-year-summary-toolbar h2 { margin: 0 0 6px; color: #f8fafc; font-size: 1.15rem; }
:where(.ukb-payments-scope) .academic-year-summary-toolbar p { margin: 0; color: #cbd5e1; font-size: .9rem; }
:where(.ukb-payments-scope) .academic-year-summary-choice { display: flex; flex-direction: column; gap: 7px; color: #f8fafc; font-weight: 600; font-size: .9rem; }
:where(.ukb-payments-scope) .academic-year-payment-summary .academic-year-summary-choice select {
    min-width: 220px;
    padding: 10px 14px;
    border: 1px solid #64748b;
    border-radius: 8px;
    background: #0f172a !important;
    color: #f8fafc !important;
    -webkit-text-fill-color: #f8fafc !important;
    color-scheme: dark;
    font: inherit;
    cursor: pointer;
}
:where(.ukb-payments-scope) .academic-year-summary-choice select:focus-visible { outline: 2px solid #60a5fa; outline-offset: 2px; }
:where(.ukb-payments-scope) .academic-year-summary-empty { color: #cbd5e1; padding: 12px 18px; border: 1px solid #475569; border-radius: 8px; background: #111c2e; }
@media (max-width: 600px) {
    :where(.ukb-payments-scope) .academic-year-summary-choice { width: 100%; }
    :where(.ukb-payments-scope) .academic-year-summary-choice select { width: 100%; min-width: 0; }
}

