/* Adhésions / membres */
.member-page{max-width:980px;margin:32px auto;padding:0 18px 40px}
.member-card{background:#fff;border-radius:22px;box-shadow:0 16px 45px rgba(0,0,0,.09);padding:30px}
.member-form{display:grid;gap:20px}
.form-grid{display:grid;gap:16px}
.two-cols{grid-template-columns:repeat(2,minmax(0,1fr))}
.address-cols{grid-template-columns:150px 1fr}
.member-form label{display:grid;gap:7px;font-weight:600}
.member-form input,.member-form select,.member-form textarea{width:100%;box-sizing:border-box}
.address-block{padding:18px;background:#f7f7f7;border-radius:16px}
.address-block h3{margin:0 0 4px}
.autocomplete-wrap{position:relative}
.address-suggestions{display:none;position:absolute;z-index:100;top:calc(100% + 4px);left:0;right:0;background:#fff;border:1px solid #ddd;border-radius:12px;box-shadow:0 12px 30px rgba(0,0,0,.14);overflow:hidden;max-height:300px;overflow-y:auto}
.address-suggestion{display:block;width:100%;border:0;border-bottom:1px solid #eee;background:#fff;color:#333;text-align:left;padding:11px 13px;cursor:pointer;font:inherit}
.address-suggestion:hover{background:#fce8f0}
.consent-box{grid-template-columns:auto 1fr!important;align-items:start;gap:10px!important;font-weight:400!important}
.consent-box input{width:auto;margin-top:3px}
.member-submit{justify-self:start}
.admin-section-header{display:flex;justify-content:space-between;align-items:end;gap:18px;margin-bottom:20px}
.adhesion-list{display:grid;gap:18px}
.adhesion-admin-card{border:1px solid #e3e3e3;border-radius:16px;padding:20px;background:#fff}
.adhesion-admin-top{display:flex;justify-content:space-between;align-items:start;gap:16px;margin-bottom:18px}
.adhesion-admin-top h3{margin:0 0 7px}
.adhesion-actions{margin-top:18px;padding-top:18px;border-top:1px solid #eee}
.admin-comment{margin-top:16px;padding:12px;background:#f7f7f7;border-radius:10px}
@media(max-width:700px){
  .two-cols,.address-cols{grid-template-columns:1fr}
  .member-card{padding:20px}
  .admin-section-header{align-items:stretch;flex-direction:column}
}


.portal-suggestion {
    margin-top: 14px;
}

.portal-suggestion .btn {
    display: inline-block;
}

/* Édition des demandes d'adhésion */
.adhesion-edit-form {
    display: grid;
    gap: 16px;
}

.adhesion-edit-form label {
    display: grid;
    gap: 6px;
    font-weight: 600;
}

.adhesion-edit-form input,
.adhesion-edit-form textarea,
.adhesion-edit-form select {
    width: 100%;
    box-sizing: border-box;
}

.adhesion-edit-actions {
    margin-top: 4px;
    flex-wrap: wrap;
}

.adhesion-edit-actions .btn {
    min-width: 190px;
}

@media (max-width: 700px) {
    .adhesion-edit-actions {
        display: grid;
        grid-template-columns: 1fr;
    }

    .adhesion-edit-actions .btn {
        width: 100%;
        min-width: 0;
    }
}

/* Liste et détail membres */

.membres-filters {
    grid-template-columns: minmax(280px, 2fr) minmax(160px, 1fr) auto;
    align-items: end;
}

.membre-detail-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.5fr) minmax(320px, .8fr);
    gap: 22px;
}

.membre-edit-form {
    display: grid;
    gap: 16px;
}

.member-danger-zone {
    margin-top: 26px;
    padding-top: 20px;
    border-top: 1px solid #e7e7e7;
}

.member-danger-zone form {
    margin: 10px 0;
}

@media (max-width: 900px) {
    .membre-detail-layout {
        grid-template-columns: 1fr;
    }

    .membres-filters {
        grid-template-columns: 1fr;
    }
}

/* Cotisation visible dans la fiche membre */
.cotisation-current-card {
    position: relative;
}

.cotisation-current-status {
    margin-bottom: 16px;
}

.cotisation-status {
    display: inline-block;
    padding: 7px 12px;
    border-radius: 999px;
    font-weight: 700;
    font-size: 0.92rem;
    background: #f1f1f1;
}

.cotisation-status-payee {
    background: #e4f7e8;
    color: #237a35;
}

.cotisation-status-a_payer,
.cotisation-status-demande_envoyee,
.cotisation-status-rappel_envoye {
    background: #fff2d8;
    color: #8a5a00;
}

.cotisation-status-exoneree {
    background: #e8f1ff;
    color: #245b9e;
}

.cotisation-status-annulee {
    background: #f1f1f1;
    color: #777;
}

.cotisation-missing {
    padding: 16px;
    border-radius: 14px;
    background: #fff7e5;
    border: 1px solid #f0d79f;
}

.cotisation-missing p {
    margin-bottom: 0;
}

/* Cotisations */
.cotisation-param-form {
    display: grid;
    grid-template-columns: 160px 180px auto auto;
    gap: 14px;
    align-items: end;
}

.cotisation-current-card {
    border-left: 6px solid #e91e63;
}

.cotisation-current-header {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    align-items: start;
    margin-bottom: 18px;
}

.cotisation-current-header h2 {
    margin: 0;
}

.cotisation-current-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
}

.cotisation-current-grid > div {
    padding: 14px;
    background: #f7f7f7;
    border-radius: 12px;
}

.cotisation-current-grid span {
    display: block;
    color: #777;
    font-size: .9rem;
    margin-bottom: 4px;
}

@media (max-width: 800px) {
    .cotisation-param-form,
    .cotisation-current-grid {
        grid-template-columns: 1fr;
    }

    .cotisation-current-header {
        flex-direction: column;
    }
}

/* Paiement des cotisations */

.cotisation-edit-form {
    margin-top: 20px;
    padding-top: 18px;
    border-top: 1px solid #e7e7e7;
}

.cotisation-payment-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.mass-payment-filters {
    display: grid;
    grid-template-columns: 180px 220px auto;
    gap: 14px;
    align-items: end;
}

.bulk-payment-bar {
    display: grid;
    grid-template-columns: 190px 220px auto;
    gap: 14px;
    align-items: end;
    margin-bottom: 18px;
    padding: 16px;
    background: #f7f7f7;
    border-radius: 14px;
}

.bulk-payment-bar label {
    display: grid;
    gap: 6px;
    font-weight: 600;
}

@media (max-width: 800px) {
    .cotisation-payment-grid,
    .mass-payment-filters,
    .bulk-payment-bar {
        grid-template-columns: 1fr;
    }
}

/* Paiement des cotisations */

.cotisation-edit-form {
    margin-top: 20px;
    padding-top: 18px;
    border-top: 1px solid #e7e7e7;
}

.cotisation-payment-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.mass-payment-filters {
    display: grid;
    grid-template-columns: 180px 220px auto;
    gap: 14px;
    align-items: end;
}

.bulk-payment-bar {
    display: grid;
    grid-template-columns: 190px 220px auto;
    gap: 14px;
    align-items: end;
    margin-bottom: 18px;
    padding: 16px;
    background: #f7f7f7;
    border-radius: 14px;
}

.bulk-payment-bar label {
    display: grid;
    gap: 6px;
    font-weight: 600;
}

@media (max-width: 800px) {
    .cotisation-payment-grid,
    .mass-payment-filters,
    .bulk-payment-bar {
        grid-template-columns: 1fr;
    }
}


/* Cases à cocher plus visibles pour la saisie groupée */
#checkAll,
.payment-check {
    width: 22px;
    height: 22px;
    min-width: 22px;
    cursor: pointer;
    vertical-align: middle;
}

.admin-table th:first-child,
.admin-table td:first-child {
    text-align: center;
}


/* Rappels de cotisations */
.rappels-table .rappel-check {
    width: 22px;
    height: 22px;
    min-width: 22px;
    cursor: pointer;
    vertical-align: middle;
}

.rappels-table th:first-child,
.rappels-table td:first-child {
    text-align: center;
}

.rappel-selection-actions {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    margin: 16px 0;
}

.rappel-send-actions {
    margin-top: 18px;
}

/* Demandes de cotisations */

.demandes-table .demande-check {
    width: 22px;
    height: 22px;
    min-width: 22px;
    cursor: pointer;
    vertical-align: middle;
}

.demandes-table th:first-child,
.demandes-table td:first-child {
    text-align: center;
}

.demande-year-form {
    max-width: 260px;
}

.demande-send-actions {
    margin-top: 18px;
}

.qr-preview {
    display: flex;
    align-items: center;
    gap: 20px;
    margin: 18px 0;
    padding: 16px;
    background: #f7f7f7;
    border-radius: 14px;
}

.qr-preview img {
    width: 150px;
    height: 150px;
    object-fit: contain;
    background: #fff;
    padding: 8px;
    border-radius: 8px;
}

@media (max-width: 650px) {
    .qr-preview {
        flex-direction: column;
        align-items: flex-start;
    }
}

/* Rappels de cotisations */
.rappels-table .rappel-check {
    width: 22px;
    height: 22px;
    min-width: 22px;
    cursor: pointer;
    vertical-align: middle;
}

.rappels-table th:first-child,
.rappels-table td:first-child {
    text-align: center;
}

.rappel-selection-actions {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    margin: 16px 0;
}

.rappel-send-actions {
    margin-top: 18px;
}


/* Aperçu QR sur la page des rappels */
.qr-preview {
    display: flex;
    align-items: center;
    gap: 20px;
    margin: 18px 0;
    padding: 16px;
    background: #f7f7f7;
    border-radius: 14px;
}

.qr-preview img {
    width: 150px;
    height: 150px;
    object-fit: contain;
    background: #fff;
    padding: 8px;
    border-radius: 8px;
}

@media (max-width: 650px) {
    .qr-preview {
        flex-direction: column;
        align-items: flex-start;
    }
}

/* Première adhésion / maillot */

.adhesion-cotisation-box {
    margin: 22px 0;
    padding: 18px;
    border: 1px solid #e2e2e2;
    border-radius: 14px;
    background: #f8f8f8;
}

.adhesion-cotisation-box h3 {
    margin-top: 0;
}

.maillot-choice {
    display: grid;
    gap: 10px;
    margin: 14px 0;
}

.maillot-choice label {
    display: flex;
    align-items: flex-start;
    gap: 9px;
    cursor: pointer;
}

.maillot-choice input[type="radio"] {
    margin-top: 3px;
}

.adhesion-price {
    margin-top: 14px;
    padding: 13px 15px;
    border-radius: 10px;
    background: #fff;
    border-left: 4px solid #e91e63;
    font-size: 1.05rem;
}

.adhesion-membership-summary {
    margin: 14px 0;
    padding: 13px 15px;
    background: #f7f7f7;
    border-radius: 10px;
}

.adhesion-membership-summary p {
    margin: 5px 0;
}


.maillot-radio-line {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    gap: 10px;
    width: 100%;
}

.maillot-radio-line input[type="radio"] {
    flex: 0 0 auto;
    margin: 0;
}

.maillot-radio-line span {
    display: inline;
}

#blocOffrePremiereCotisation {
    display: grid;
    gap: 14px;
}


/* V3 - forcer réellement texte + radio sur la même ligne
   même si le CSS global met les labels en display:grid */
.maillot-choice {
    display: flex !important;
    flex-direction: column !important;
    gap: 10px !important;
}

.maillot-choice .maillot-radio-line {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    justify-content: flex-start !important;
    gap: 9px !important;
    width: auto !important;
    margin: 0 !important;
    padding: 0 !important;
    font-weight: 600;
}

.maillot-choice .maillot-radio-line input[type="radio"] {
    display: inline-block !important;
    flex: 0 0 auto !important;
    width: 16px !important;
    height: 16px !important;
    margin: 0 !important;
    padding: 0 !important;
}

.maillot-choice .maillot-radio-line span {
    display: inline !important;
    margin: 0 !important;
    padding: 0 !important;
    line-height: 1.35;
}


/* V4 - structure HTML dédiée pour radio + texte sur la même ligne */
.maillot-choice {
    display: flex !important;
    flex-direction: column !important;
    gap: 10px !important;
}

.maillot-radio-row {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    gap: 10px !important;
    width: 100%;
}

.maillot-radio-row input[type="radio"] {
    flex: 0 0 auto !important;
    width: 16px !important;
    height: 16px !important;
    margin: 0 !important;
}

.maillot-radio-row label {
    display: inline-block !important;
    margin: 0 !important;
    padding: 0 !important;
    width: auto !important;
    font-weight: 600;
    line-height: 1.35;
    cursor: pointer;
}

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

.membres-table {
    min-width: 1150px;
}

/* ============================================================
   CORRECTION LISTE DES MEMBRES
   - défilement horizontal réel
   - dernière colonne (Voir / Action) toujours visible
   ============================================================ */

.admin-table-wrap.table-responsive,
.admin-table-wrap {
    display: block;
    width: 100%;
    max-width: 100%;
    overflow-x: auto !important;
    overflow-y: visible;
    -webkit-overflow-scrolling: touch;
}

.membres-table {
    width: 100%;
    min-width: 1180px;
    border-collapse: separate;
    border-spacing: 0;
}

/* La colonne d'action reste visible à droite */
.membres-table th:last-child,
.membres-table td:last-child {
    position: sticky;
    right: 0;
    z-index: 3;
    background: #fff;
    white-space: nowrap;
    box-shadow: -8px 0 10px -10px rgba(0,0,0,.35);
}

/* Entête de la colonne Action */
.membres-table thead th:last-child {
    z-index: 4;
    background: #f4f4f4;
}

/* Un peu d'espace pour le bouton Voir */
.membres-table td:last-child,
.membres-table th:last-child {
    min-width: 80px;
    text-align: center;
}

/* Les emails ne doivent pas élargir inutilement le tableau */
.membres-table td:nth-child(4) {
    max-width: 245px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Correctif liste_membres.php */
.membres-table {
    width: 100%;
    min-width: 0 !important;
    table-layout: auto;
}

.membres-table th:last-child,
.membres-table td:last-child {
    position: static !important;
    right: auto !important;
    box-shadow: none !important;
}

.membre-row-clickable {
    cursor: pointer;
}

.membre-row-clickable:hover td {
    background: #fafafa;
}

.membre-row-clickable:focus {
    outline: 2px solid #ef3b7d;
    outline-offset: -2px;
}

.membres-table td:nth-child(4) {
    max-width: 240px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}


/* Export XLSX membres */
.membres-export-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 8px;
}

.membres-export-note {
    margin-top: 12px;
}



/* ============================================================
   Bouton retour pages publiques
   ============================================================ */

.public-return-wrap {
    width: min(980px, calc(100% - 30px));
    margin: 18px auto 0;
}

.public-return-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 9px 14px;
    border-radius: 999px;
    background: #55585d;
    color: #fff !important;
    text-decoration: none;
    font-weight: 700;
    font-size: .92rem;
    transition: opacity .15s ease, transform .15s ease;
}

.public-return-btn:hover {
    opacity: .9;
    transform: translateY(-1px);
}
