/***************************************************
 Tables dans les CPTs et dans /mon-compte
 ***************************************************/
.cmef-table {
  border-top: none !important;
  border-collapse: collapse !important;
}

.cmef-table thead tr {
  background-color: #f2f2f2 !important;
}

.cmef-table thead th {
  border-radius: 3px !important;
}

.cmef-table tbody tr {
  border-bottom: 1px solid #ddd !important;
  background-color: transparent !important;
}

.cmef-table th, .cmef-table td {
  padding: 8px !important;
  border: none !important;
}

/* Règle générale pour tous les tableaux SAUF agence */
.cmef-table:not(.cmef-agency-table) td:nth-child(2n) {
  text-align: right !important;
}

.cmef-add {
  color: gray;
  text-decoration: none;
}

/***************************************************
 Icône de connexion/déconnexion
 ***************************************************/
#cmef-login {
  position: relative;

  &:hover, &:focus-within {
    .icon-salient-m-user {
      color: #3ae5ff !important;
    }
  }
}

#cmef-login > button {
  border: none;
  background: transparent;
  font-size: 18px;
  cursor: pointer;
  
  & .icon-salient-m-user {
    background: none !important;
    transition: color .3s ease;
  }
}

body:not(.mobile) #cmef-dropdown {
  display: none;

  left: 50%;
  top: 100%;
  position: absolute;
  transform: translateX(-50%);

  padding: 0.25rem;
  min-width: 190px;

  background: #fff;
  border-radius: 10px;
  border: 1px solid rgba(0,0,0,.08);
  box-shadow: 0 8px 24px rgba(0,0,0,.12);
  
  & a {
    color: black !important;
  }
  
  & a:hover {
    background: #f6f6f7;
  }
}

body.mobile #cmef-dropdown,
#cmef-login:hover #cmef-dropdown,
#cmef-login:focus-within #cmef-dropdown {
  display: flex;
  flex-direction: column;
}

#cmef-dropdown a {
  width: 100%;
  padding: 0.6rem 0.5rem;
  border-radius: 6px;

  &:after {
    display: none !important;
  }
}

/***************************************************
 Enlever l'underline de "Blog" pour les CPTs
 ***************************************************/
body[class*='single-cmef']
.current_page_parent .menu-title-text:not(:hover)::after {
  transform: scaleX(0) !important;
}

/***************************************************
 Style des liens pour revenir en arrière
 ***************************************************/
.cmef-return {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
  color: #333;
  font-size: 16px;
  margin-bottom: 20px;
  transition: transform 0.3s ease;
  
  &:hover {
    transform: translateX(-5px);
    
      .icon::before {
        transform: translateY(-50%) scale(1.2);
      }
  }
}

.cmef-return .icon {
  width: 20px;
  height: 20px;
  position: relative;
  
  &::before {
    content: "<-";
    line-height: 1;
    position: absolute;
    left: 0;
    top: 49%;
    transform: translateY(-49%);
    transition: transform 0.3s ease;
  }
}

/***************************************************
 🆕 TABLEAU ENFANTS - STYLES SPÉCIFIQUES
 ***************************************************/
.cmef-children-table .cmef-child-card {
    padding: 16px !important;
    background: #f8f9fa;
    border-radius: 8px;
    margin-bottom: 8px;
}

.cmef-child-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
}

.cmef-child-info {
    flex: 1;
}

.cmef-child-name {
    margin: 0 0 12px 0;
    font-size: 18px;
    font-weight: 600;
    color: #333;
}

.cmef-child-details {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.cmef-detail-item {
    font-size: 14px;
    line-height: 1.4;
}

.cmef-detail-label {
    font-weight: 600;
    color: #555;
}

.cmef-detail-value {
    color: #333;
}

.cmef-child-actions {
    flex-shrink: 0;
}

/***************************************************
 🆕 TABLEAU AGENCE - STYLES SPÉCIFIQUES
 ***************************************************/

/* Titre séparé du tableau */
.cmef-agency-title {
    margin: 20px 0 15px 0;
    font-size: 20px;
    font-weight: 600;
    color: #333;
}

/* Alignement à gauche pour TOUTES les colonnes du tableau agence */
.cmef-agency-table td {
    text-align: left !important;
}

/* Centrage SEULEMENT pour colonnes spécifiques */
.cmef-agency-table .cmef-center,
.cmef-agency-table .cmef-center * {
    text-align: center !important;
}

/* Couleurs pour les montants */
.amount-due {
    color: #dc3545 !important;
    font-weight: 600;
}

.amount-paid {
    color: #28a745 !important;
    font-weight: 600;
}

/* Statuts fiche santé */
.status-missing {
    font-size: 16px;
    color: #dc3545;
    font-weight: 500;
}

.status-completed {
    font-size: 16px;
    color: #28a745;
    font-weight: 500;
}

/* Ligne de résumé */
.cmef-summary-row {
    background-color: #f8f9fa !important;
    border-top: 2px solid #dee2e6 !important;
}

.cmef-summary-row td {
    padding: 12px 8px !important;
    font-weight: 600;
}

/* Bouton d'édition */
.cmef-edit-btn {
    background: linear-gradient(135deg, #6c757d 0%, #5a6268 100%) !important;
    color: #fff !important;
    padding: 8px 16px;
    border-radius: 4px;
    text-decoration: none !important;
    font-size: 13px;
    font-weight: 500;
    display: inline-block;
    transition: all 0.2s ease;
    border: none;
    box-shadow: 0 1px 2px rgba(0,0,0,0.1);
    white-space: nowrap;
}

.cmef-edit-btn:hover {
    background: linear-gradient(135deg, #5a6268 0%, #495057 100%) !important;
    color: #fff !important;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0,0,0,0.15);
}

/***************************************************
 🆕 RESPONSIVE
 ***************************************************/
@media (max-width: 768px) {
    .cmef-agency-table {
        font-size: 12px;
    }
    
    .cmef-edit-btn {
        padding: 6px 12px;
        font-size: 11px;
    }
    
    .cmef-child-header {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
    }
    
    .cmef-child-actions {
        align-self: flex-start;
    }
    
    .cmef-child-name {
        font-size: 16px;
    }
}

/***************************************************
 MESSAGE DE BIENVENUE
 ***************************************************/
.cmef-welcome-message {
    background: #00b5d0;
    border-bottom: 2px solid #007c8a;
    padding: 20px;
    margin-bottom: 40px;
    border-radius: 10px;
}

.cmef-welcome-message h2 {
    margin: 0 0 10px 0;
    color: #fff;
    font-size: 24px;
    font-weight: 600;
}

.cmef-welcome-message p {
    margin: 0;
    color: #fff;
    font-size: 16px;
    line-height: 1.5;
	padding-bottom: 0;
}

@media (max-width: 768px) {
    .cmef-welcome-message h2 {
        font-size: 20px;
    }
    
    .cmef-welcome-message p {
        font-size: 14px;
    }
}

/* Styles pour la page agence */
.cmef-add-child-section {
    margin-bottom: 30px;
    text-align: center;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 10px;
    border: 2px dashed #007cba;
}

.cmef-add-btn-primary {
    display: inline-block;
    padding: 15px 30px;
    background: #007cba;
    color: white;
    text-decoration: none;
    border-radius: 6px;
    font-weight: 600;
    font-size: 16px;
    transition: all 0.3s ease;
}

.cmef-add-btn-primary:hover {
    background: #005a87;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 124, 186, 0.3);
}

.cmef-enrollments-section {
    margin-bottom: 40px;
}

.cmef-section-title {
    border-bottom: 2px solid #007cba;
    padding-bottom: 10px;
    margin-bottom: 20px;
}

.cmef-no-enrollments {
    text-align: center;
    padding: 40px;
    background: #f8f9fa;
    border-radius: 8px;
    color: #6c757d;
    font-style: italic;
}

.cmef-agency-table {
    margin-top: 0;
}

.cmef-summary-row {
    background: #e9ecef;
    font-weight: bold;
}

.amount-due {
    color: #dc3545;
    font-weight: bold;
}

.amount-paid {
    color: #28a745;
    font-weight: bold;
}

.status-completed {
    color: #28a745;
}

.status-missing {
    color: #dc3545;
}

/***************************************************
 🔥 CONDITIONS D'INSCRIPTION - STYLE SOBRE
 ***************************************************/

/* Alignement à gauche pour le tableau des conditions spécifiquement */
.cmef-conditions-table td {
    text-align: left !important;
}

/* Ligne spéciale pour l'accordéon dans le tableau */
.cmef-conditions-accordion-row {
    padding: 0 !important;
    background: transparent !important;
}

/* Container de l'accordéon */
.cmef-conditions-accordion {
    border: 1px solid #ddd;
    border-radius: 4px;
    margin: 8px 0;
    background: #fff;
}

/* En-tête de l'accordéon */
.cmef-accordion-header {
    padding: 12px 16px;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #f8f9fa;
    border-bottom: 1px solid transparent;
    transition: all 0.2s ease;
}

.cmef-accordion-header:hover {
    background: #e9ecef;
}

.cmef-accordion-header.active {
    background: #e9ecef;
    border-bottom-color: #ddd;
}

.cmef-accordion-title {
    font-weight: 500;
    color: #495057;
    font-size: 14px;
}

.cmef-accordion-icon {
    color: #6c757d;
    font-size: 12px;
    transition: transform 0.2s ease;
    font-weight: bold;
}

.cmef-accordion-header.active .cmef-accordion-icon {
    transform: rotate(180deg);
}

/* Corps de l'accordéon */
.cmef-accordion-body {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
    background: #fff;
}

.cmef-accordion-body.active {
    max-height: none;
}

.cmef-accordion-content {
    padding: 16px;
    border-top: 1px solid #ddd;
}

/* Contenu des conditions */
.cmef-condition-text {
    color: #495057;
    line-height: 1.5;
    font-size: 13px;
}

.cmef-condition-text p {
    margin: 0 0 10px 0;
}

.cmef-condition-text p:last-child {
    margin-bottom: 0;
}

.cmef-condition-text ul,
.cmef-condition-text ol {
    margin: 10px 0;
    padding-left: 18px;
}

.cmef-condition-text li {
    margin-bottom: 4px;
}

.cmef-condition-text strong {
    color: #343a40;
    font-weight: 600;
}

.cmef-condition-text h3,
.cmef-condition-text h4 {
    margin: 16px 0 8px 0;
    color: #343a40;
    font-size: 14px;
}

/* Séparateurs */
.cmef-condition-separator {
    margin: 20px 0 !important;
    border: none !important;
    border-top: 1px solid #ddd !important;
    opacity: 0.6;
}

/* Responsive */
@media (max-width: 768px) {
    .cmef-accordion-header {
        padding: 10px 12px;
    }
    
    .cmef-accordion-content {
        padding: 12px;
    }
    
    .cmef-accordion-title {
        font-size: 13px;
    }

    .cmef-condition-text {
        font-size: 12px;
    }
}

/***************************************************
 🔥 STYLES POUR LES FORMULAIRES ENFANTS (base_child.php)
 ***************************************************/

/* 🎯 SECTIONS PRINCIPALES */
.cmef-form-section {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 20px;
    margin: 20px 0 60px 0;
}

.cmef-form-header {
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid #dee2e6;
}

.cmef-form-header h4 {
    margin: 0 0 8px 0;
    color: #495057;
    font-size: 1.1em;
}

.cmef-form-header p {
    margin: 0;
    color: #6c757d;
    font-size: 0.9em;
}

/* 🔥 MONTANT EN GRAS SEULEMENT */
.cmef-form-header p strong {
    font-weight: 700;
    color: #495057; /* Même couleur que le texte normal */
}

.cmef-form-content {
    margin-top: 15px;
}

/* 🎯 MESSAGES DE STATUT */
.cmef-status-success {
    color: #28a745;
    font-weight: 600;
    padding: 4px 8px;
    background: #d4edda;
    border-radius: 4px;
    border: 1px solid #c3e6cb;
}

.cmef-status-pending {
    color: #856404;
    font-weight: 600;
    padding: 4px 8px;
    background: #fff3cd;
    border-radius: 4px;
    border: 1px solid #ffeaa7;
}

/* 🎯 FORMULAIRE D'ACOMPTE - STYLE SOBRE */
.cmef-deposit-form {
    background: #f8f9fa; /* Même fond que les autres sections */
    border: 1px solid #dee2e6; /* Bordure discrète */
}

.cmef-deposit-form .cmef-form-header {
    border-bottom: 1px solid #dee2e6; /* Bordure normale */
}

.cmef-deposit-form .cmef-form-header h4 {
    color: #495057; /* Couleur normale, pas de vert */
}

/* 🎯 LIENS */
.cmef-health-link {
    color: #007cba;
    text-decoration: none;
    font-weight: 500;
}

.cmef-health-link:hover {
    color: #005a87;
    text-decoration: underline;
}

/* 🎯 MESSAGES D'ERREUR */
.cmef-error-message {
    background: #f8d7da;
    color: #721c24;
    padding: 10px;
    border-radius: 4px;
    border: 1px solid #f5c6cb;
}

/* 🎯 ESPACEMENT ENTRE SECTIONS */
.cmef-table + .cmef-form-section {
    margin-top: 25px;
}

.cmef-form-section + .cmef-table {
    margin-top: 25px;
}

/* 🎯 RESPONSIVE */
@media (max-width: 768px) {
    .cmef-form-section {
        padding: 15px;
        margin: 15px 0;
    }
    
    .cmef-form-header h4 {
        font-size: 1em;
    }
}

/***************************************************
 🔥 STYLES SPÉCIFIQUES POUR LES MOTS DE PASSE
 ***************************************************/

/* Affichage des mots de passe avec possibilité de copie */
.cmef-password-display {
    background: #f8f9fa;
    padding: 4px 8px;
    border-radius: 4px;
    border: 1px solid #dee2e6;
    font-family: 'Courier New', monospace;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.cmef-password-display:hover {
    background: #e9ecef;
    border-color: #adb5bd;
}

.cmef-no-password {
    color: #6c757d;
    font-style: italic;
}

/***************************************************
 🔥 HISTORIQUE DES PAIEMENTS - STYLES MINIMAUX
 ***************************************************/

/* Section principale */
.payment-history-section {
  background: #f8f9fa;
  border-radius: 8px;
  padding: 20px;
  margin: 20px 0;
  border: 1px solid #e9ecef;
}

.payment-history-title {
  margin: 0 0 15px 0;
  color: #495057;
  font-size: 1.1em;
  font-weight: 600;
}

/* Entrées de paiement */
.payment-entry {
  background: white;
  border-radius: 6px;
  padding: 12px 15px;
  margin-bottom: 10px;
  border-left: 4px solid #6c757d;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.payment-entry-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

.payment-type {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  min-width: 120px;
}

.payment-details {
  display: flex;
  align-items: center;
  gap: 15px;
  flex: 1;
  justify-content: center;
}

.payment-date {
  color: #6c757d;
  font-size: 0.9em;
}

.payment-amount {
  font-weight: 600;
  color: #28a745;
  font-size: 1.1em;
}

.payment-method {
  color: #6c757d;
  font-size: 0.85em;
  font-style: italic;
}

/* Couleurs par type */
.payment-down { border-left-color: #ffc107; }
.payment-balance { border-left-color: #28a745; }
.payment-refund { border-left-color: #dc3545; }
.payment-refund .payment-amount { color: #dc3545; }
.payment-adjustment { border-left-color: #17a2b8; }
.payment-adjustment .payment-amount { color: #17a2b8; }

/* Résumé */
.payment-summary {
  margin-top: 15px;
  padding: 15px;
  border-radius: 6px;
  border: 2px solid #e9ecef;
  background: white;
}

.payment-summary.fully-paid {
  background: #d4edda;
  border-color: #28a745;
  color: #155724;
}

.payment-summary.partial-paid {
  background: #fff3cd;
  border-color: #ffc107;
  color: #856404;
}

.summary-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

/* Responsive */
@media (max-width: 768px) {
  .payment-entry-content {
      flex-direction: column;
      align-items: flex-start;
  }
  
  .payment-details {
      justify-content: flex-start;
      width: 100%;
  }
  
  .summary-content {
      flex-direction: column;
      align-items: flex-start;
  }
}

/***************************************************
 🔥 BOUTON "CONTINUER L'INSCRIPTION" - STYLE CMEF
 ***************************************************/

.cmef-continue-registration-section {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 40px;
    margin: 20px 0;
    text-align: center;
}

.cmef-continue-registration-section p {
    margin: 15px 0 0 0;
    color: #6c757d;
    font-size: 14px;
    line-height: 1.5;
	padding-bottom: 0;
}

/* 🎯 BOUTON ROUGE CMEF */
.cmef-continue-btn {
    display: inline-block;
    padding: 15px 30px;
    background: #C84032;
    color: white !important;
    text-decoration: none !important;
    border-radius: 6px;
    font-weight: 600;
    font-size: 16px;
    transition: all 0.3s ease;
    border: none;
    box-shadow: 0 4px 12px rgba(200, 64, 50, 0.3);
}

.cmef-continue-btn:hover {
    background: #a73429;
    color: white !important;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(200, 64, 50, 0.4);
}

/* 🎯 RESPONSIVE */
@media (max-width: 768px) {
    .cmef-continue-registration-section {
        padding: 15px;
        margin: 15px 0;
    }
    
    .cmef-continue-btn {
        padding: 12px 25px;
        font-size: 14px;
        width: 100%;
        max-width: 280px;
    }
    
    .cmef-continue-registration-section p {
        font-size: 13px;
    }
}

/***************************************************
 🆕 BOUTON ARGENT DE POCHE - VERSION COMPACTE
 ***************************************************/

/* Bouton texte compact "Ajouter" */
.cmef-add-pocket-money {
    display: inline-block;
    padding: 4px 10px;
    background: #e8f5e9; /* Fond vert très léger */
    color: #2e7d32 !important; /* Texte vert foncé */
    text-decoration: none !important;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
    transition: all 0.2s ease;
    border: 1px solid #c8e6c9; /* Bordure vert clair */
    white-space: nowrap; /* Empêche le texte de se couper */
    line-height: 1.2;
}

.cmef-add-pocket-money:hover {
    background: #c8e6c9; /* Fond vert plus prononcé au survol */
    color: #1b5e20 !important; /* Texte vert encore plus foncé */
    border-color: #a5d6a7;
    transform: translateY(-1px);
    box-shadow: 0 2px 6px rgba(46, 125, 50, 0.15);
}

/* Container du formulaire argent de poche */
.cmef-pocket-money-form {
    margin-top: 20px;
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Style du formulaire (hérite des styles existants) */
.cmef-pocket-money-form .cmef-form-section {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
}

.cmef-pocket-money-form .cmef-form-header h4 {
    color: #495057;
}

/* Responsive */
@media (max-width: 768px) {
    .cmef-pocket-money-container {
        flex-wrap: wrap;
        gap: 6px;
    }
    
    .cmef-add-pocket-money {
        font-size: 11px;
        padding: 4px 8px;
    }
}