/* ============ Liste des adhérents (table allégée) ============ */

/* ---- En-tête : titre + action « Inscrire un élève » ---- */
.members-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 0.5rem;
}

/* ---- Filtres ---- */
.ml-filters {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 0.6rem 1rem;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 0.85rem 1rem;
    margin: 1rem 0;
}
.ml-filter { display: flex; flex-direction: column; gap: 0.2rem; flex: 1 1 180px; min-width: 160px; }
/* La recherche occupe sa propre ligne, au-dessus des selects. */
.ml-search { flex: 1 1 100%; }
.ml-filters label { margin: 0; font-size: 0.72rem; font-weight: 600; color: var(--text-muted); }
.ml-filters .form-select,
.ml-filters .form-control { margin: 0; }

/* ---- KPIs (repères cliquables → filtre rapide) ---- */
.ml-kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0.7rem; margin: 1rem 0; }
@media (max-width: 720px) { .ml-kpis { grid-template-columns: 1fr 1fr; } }
.ml-kpi {
    display: flex; flex-direction: column; gap: 0.15rem; text-align: left;
    background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius);
    padding: 0.7rem 0.9rem; cursor: pointer; transition: border-color 0.15s ease, background 0.15s ease;
}
.ml-kpi:hover { border-color: var(--border-strong); background: var(--surface-2-hov); }
.ml-kpi .k-l { font-size: 0.74rem; color: var(--text-muted); }
.ml-kpi .k-n { font-size: 1.45rem; font-weight: 700; line-height: 1.1; color: var(--text) }
.ml-kpi.warn { border-color: rgba(224, 171, 51, 0.4); }
.ml-kpi.warn .k-n { color: var(--warning); }
.ml-kpi.due .k-n { color: var(--gold-strong); }

/* ---- Chips de filtres actifs ---- */
.ml-active-filters { display: flex; flex-wrap: wrap; align-items: center; gap: 0.4rem; margin-bottom: 0.8rem; }
.ml-af-label { font-size: 0.78rem; color: var(--text-faint); }
.ml-fchip {
    display: inline-flex; align-items: center; gap: 0.3rem;
    font-size: 0.78rem; color: var(--text); background: var(--surface-3);
    border: 1px solid var(--border-strong); border-radius: 999px; padding: 0.12rem 0.25rem 0.12rem 0.6rem;
}
.ml-fchip-x {
    border: 0; background: transparent; color: var(--text-muted); cursor: pointer;
    width: 18px; height: 18px; border-radius: 50%; line-height: 1; font-size: 0.7rem; padding: 0;
}
.ml-fchip-x:hover { background: var(--hover); color: var(--text); }
.ml-reset { border: 0; background: transparent; color: var(--gold); cursor: pointer; font-size: 0.78rem; padding: 0.1rem 0.3rem; }
.ml-reset:hover { color: var(--gold-strong); }

/* ---- Ligne compteur + export (compact) ---- */
.ml-listhead { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 0.85rem; }

.ml-count {
    display: inline-flex;
    align-items: center;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-muted);
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: 999px;
    padding: 0.2rem 0.7rem;
}

.ml-export-btn {
    display: inline-flex; align-items: center; gap: 0.4rem;
    font-size: 0.8rem; font-weight: 600; color: var(--text-muted);
    background: var(--surface-3); border: 1px solid var(--border-strong);
    border-radius: var(--radius-sm); padding: 0.35rem 0.7rem; cursor: pointer;
}
.ml-export-btn:hover { color: var(--gold-strong); background: var(--gold-soft); }
.ml-export-btn.dropdown-toggle::after { margin-left: 0.1rem; }
/* Items du menu export (inclut un <button>, non couvert par a.dropdown-item). */
.ml-export-menu .dropdown-item {
    width: 100%; text-align: left; background: transparent; border: 0; cursor: pointer;
    color: var(--text-muted); font-weight: 500; font-size: 0.85rem; border-radius: var(--radius-sm);
}
.ml-export-menu .dropdown-item:hover { color: var(--text); background: var(--hover); }

/* ---- Table ---- */
.members-table { width: 100%; border-collapse: separate; border-spacing: 0; }
.members-table thead th {
    text-align: left;
    font-size: 0.7rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    font-weight: 600;
    color: var(--text-faint);
    padding: 0 1rem 0.6rem;
    border-bottom: 1px solid var(--border);
}
.members-table thead th.right { text-align: right; }
.members-table tbody td { padding: 0.9rem 1rem; border-bottom: 1px solid var(--border); vertical-align: middle; }
.members-table tbody tr:hover td { background: var(--surface-2); }
.members-table tbody tr:hover td:first-child { border-top-left-radius: var(--radius-sm); border-bottom-left-radius: var(--radius-sm); }
.members-table tbody tr:hover td:last-child { border-top-right-radius: var(--radius-sm); border-bottom-right-radius: var(--radius-sm); }

/* ---- Cellule adhérent ---- */
.m-top { display: flex; align-items: center; flex-wrap: wrap; gap: 0.6rem; }
.m-av {
    flex: 0 0 auto; width: 38px; height: 38px; border-radius: 50%;
    display: grid; place-items: center;
    background: var(--gold-soft); color: var(--gold-strong);
    font-weight: 700; font-size: 0.8rem; border: 1px solid var(--border-strong);
}
.m-name { font-weight: 600; color: var(--text); }
.m-name a { color: var(--text); }
.m-name a:hover { color: var(--gold-strong); }
.m-badge {
    font-size: 0.68rem; font-weight: 600;
    color: var(--warning); background: rgba(224, 171, 51, 0.14);
    border: 1px solid rgba(224, 171, 51, 0.35); border-radius: 999px; padding: 0.05rem 0.5rem;
}

.m-line {
    display: flex; flex-wrap: wrap; align-items: center;
    gap: 0.35rem 0.9rem; margin-top: 0.4rem;
    padding-left: calc(38px + 0.6rem);
    font-size: 0.8rem; color: var(--text-muted);
}
.m-line.two { margin-top: 0.3rem; }
@media (max-width: 600px) { .m-line { padding-left: 0; } }

.m-belt { display: inline-flex; align-items: center; gap: 0.45rem; color: var(--text); }
.m-belt-date { color: var(--text-faint); font-size: 0.72rem; }
/* Barrette : petit « plus », discret, ce n'est pas un grade. */
.m-barrette { display: inline-block; width: 16px; height: 5px; border-radius: 2px; vertical-align: middle;
    border: 1px solid rgba(0, 0, 0, 0.25); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.12); }
.m-belt .belt { width: 74px; height: 16px; margin: 0 0 0.5rem; }

.m-stat { display: inline-flex; align-items: center; gap: 0.3rem; font-weight: 500; }
.m-stat.ok { color: var(--success); }
.m-stat.ko { color: var(--danger); }
.m-stat svg { flex: 0 0 auto; }

.m-disc {
    font-size: 0.72rem; color: var(--text-muted);
    background: var(--surface-3); border: 1px solid var(--border-strong);
    border-radius: 999px; padding: 0.05rem 0.5rem;
}

.m-balance { font-weight: 700; font-size: 0.9rem; text-align: right; white-space: nowrap; }
.m-balance.due { color: var(--gold-strong); }
.m-balance.ok { color: var(--text-faint); }

/* ---- Actions ---- */
.actions-cell { text-align: right; white-space: nowrap; }
.act-group { display: inline-flex; align-items: center; gap: 0.25rem; }
.act-btn {
    width: 32px; height: 32px; border-radius: 8px;
    border: 1px solid var(--border); background: var(--surface-3); color: var(--text-muted);
    cursor: pointer; display: inline-grid; place-items: center; text-decoration: none;
}
.act-btn:hover { color: var(--gold-strong); background: var(--gold-soft); border-color: var(--border-strong); text-decoration: none; }
/* Bouton « remettre la ceinture » : accent doré pour signaler un passage réussi à valider. */
.act-btn.act-award { color: var(--gold-strong); background: var(--gold-soft); border-color: var(--gold); }
.act-btn.act-award:hover { background: rgba(230, 201, 138, 0.22); }
.act-btn.is-loading { opacity: 0.5; pointer-events: none; }
.kebab {
    width: 32px; height: 32px; border-radius: 8px;
    border: 1px solid transparent; background: transparent; color: var(--text-muted);
    cursor: pointer; display: inline-grid; place-items: center;
}
.kebab:hover, .kebab[aria-expanded="true"] { background: var(--surface-3); color: var(--text); border-color: var(--border); }

/* Item destructif dans le menu ⋯ */
a.dropdown-item.danger { color: #f1a39e; }
a.dropdown-item.danger:hover, a.dropdown-item.danger:focus { color: #f7c4c0; background: rgba(226, 98, 91, 0.14); }

/* ---- Navigation par saison (renouvellement) ---- */
.season-hint { margin: 0 0 1rem; font-size: 0.82rem; color: var(--text-muted); }
.renew-done {
    display: inline-flex; align-items: center; gap: 0.35rem;
    font-size: 0.78rem; font-weight: 600; color: var(--success);
}
.renew-done svg { flex: 0 0 auto; }
