/* GLMU – Administration des loges. Feuille de style unique, sans outil de compilation. */

:root {
    --primary: #1f3a6e;       /* bleu GLMU – à adapter */
    --primary-dark: #152a52;
    --text: #1f2328;
    --muted: #5b6470;
    --border: #d6dae0;
    --bg: #f4f5f7;
    --card: #ffffff;
    --success-bg: #e8f5ec;
    --success-text: #1d6b34;
    --error-bg: #fdecec;
    --error-text: #a11d1d;
    --radius: 8px;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html, body { margin: 0; }

body {
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    font-size: 16px;
    line-height: 1.5;
    color: var(--text);
    background: var(--bg);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

a { color: var(--primary); }

.container { width: 100%; max-width: 760px; margin: 0 auto; padding: 0 16px; }
.main { flex: 1; padding-top: 32px; padding-bottom: 48px; }

/* En-tête */
.site-header { background: var(--primary); color: #fff; }
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 64px; flex-wrap: wrap; }
.brand { color: #fff; text-decoration: none; display: flex; align-items: baseline; gap: 10px; }
.brand-mark { font-weight: 800; font-size: 1.35rem; letter-spacing: .06em; }
.brand-sub { opacity: .85; font-size: .95rem; }
.nav { display: flex; align-items: center; gap: 16px; }
.nav a, .nav .link-button { color: #fff; }
.nav .btn { background: #fff; color: var(--primary); }

/* Pied de page */
.site-footer { color: var(--muted); font-size: .875rem; padding: 24px 0; border-top: 1px solid var(--border); }
.site-footer a { color: var(--muted); }

/* Cartes */
.card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 28px; }
.card-narrow { max-width: 440px; margin: 0 auto; }
.card h1 { margin-top: 0; font-size: 1.6rem; }
.card h2 { font-size: 1.1rem; margin-top: 1.5em; }
.card-footer { margin-top: 24px; padding-top: 16px; border-top: 1px solid var(--border); font-size: .95rem; }
.muted { color: var(--muted); }
.hint { color: var(--muted); font-size: .85rem; margin: 4px 0 0; }

/* Formulaires */
.field { margin-bottom: 18px; border: 0; padding: 0; }
.field label, .field legend { display: block; font-weight: 600; margin-bottom: 6px; }
input[type=text], input[type=email], input[type=password], input[type=tel] {
    width: 100%;
    padding: 10px 12px;
    font: inherit;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: #fff;
}
select { width: 100%; padding: 10px 12px; font: inherit; border: 1px solid var(--border); border-radius: 6px; background: #fff; }
.input-date { max-width: 220px; }
input:focus, select:focus { outline: 2px solid var(--primary); outline-offset: 1px; border-color: var(--primary); }
.section-title { font-size: 1.05rem; color: var(--primary); border-bottom: 1px solid var(--border); padding-bottom: 6px; margin: 28px 0 16px; }
.optional { font-weight: 400; color: var(--muted); font-size: .85rem; }
.grid-cp { display: grid; grid-template-columns: 140px 1fr; gap: 0 16px; }
.radios { display: flex; gap: 24px; }
.field .radio, .field .checkbox { font-weight: 400; display: flex; gap: 8px; align-items: flex-start; }
.field-error { color: var(--error-text); font-size: .875rem; margin: 4px 0 0; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
.code-input { font-size: 1.6rem !important; letter-spacing: .5em; text-align: center; font-variant-numeric: tabular-nums; }
.actions { display: flex; gap: 16px; align-items: center; }
.inline { display: inline; margin: 0; }
.resend { margin-top: 16px; text-align: center; }

/* Piège à robots (honeypot) : hors écran */
.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }

/* Boutons */
.btn {
    display: inline-block;
    background: var(--primary);
    color: #fff;
    border: 0;
    border-radius: 6px;
    padding: 11px 20px;
    font: inherit;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
}
.btn:hover { background: var(--primary-dark); }
.btn-block { width: 100%; }
.btn-small { padding: 6px 14px; font-size: .9rem; }
.link-button { background: none; border: 0; padding: 0; font: inherit; color: var(--primary); text-decoration: underline; cursor: pointer; }

/* Alertes */
.alert { border-radius: var(--radius); padding: 12px 16px; margin-bottom: 20px; }
.alert ul { margin: 0; padding-left: 20px; }
.alert-success { background: var(--success-bg); color: var(--success-text); }
.alert-error { background: var(--error-bg); color: var(--error-text); }
.alert-warning { background: #fff6e0; color: #7a5300; }
.alert-warning a { color: inherit; font-weight: 600; }

/* Espace adhérent */
.page-title { margin: 0 0 20px; font-size: 1.6rem; }
.card + .card { margin-top: 24px; }
.card-title { margin: 0 0 8px; font-size: 1.3rem; }
.membre { border-top: 1px solid var(--border); padding-top: 16px; margin-top: 16px; }
.membre-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.membre-head h3 { margin: 0; font-size: 1.1rem; }
.membre .details { margin: 12px 0 0; }
.tag { display: inline-block; font-size: .75rem; font-weight: 500; background: var(--bg); border: 1px solid var(--border); color: var(--muted); border-radius: 999px; padding: 0 8px; margin-left: 4px; vertical-align: middle; }
.btn-outline { background: #fff; color: var(--primary); border: 1px solid var(--primary); }
.btn-outline:hover { background: var(--bg); color: var(--primary-dark); }
.actions { flex-wrap: wrap; }

.membre-foot { margin: 8px 0 0; text-align: right; font-size: .875rem; }
.link-muted { color: var(--muted); }
.membre-ancien h3 { color: var(--muted); }
details > summary { cursor: pointer; }
details > summary.card-title { margin: 0; }

.tag-warning { background: #fff6e0; border-color: #f0d9a0; color: #7a5300; }
.ligne-inactive td { color: var(--muted); text-decoration: line-through; }
.ligne-inactive td:last-child { text-decoration: none; }

/* Photos d'identification */
.avatar { display: inline-flex; align-items: center; justify-content: center; width: 45px; height: 60px; border-radius: 6px;
    object-fit: cover; vertical-align: middle; margin-right: 8px; border: 1px solid var(--border); }
.avatar-vide { background: var(--bg); color: var(--muted); font-size: .85rem; font-weight: 600; }
.photo-identite { display: flex; gap: 20px; align-items: flex-start; border: 1px solid var(--border); border-radius: 6px;
    padding: 14px; margin: 16px 0 8px; flex-wrap: wrap; }
.photo-cadre img, .photo-vide { width: 150px; height: 200px; border-radius: 6px; object-fit: cover; display: flex;
    align-items: center; justify-content: center; background: var(--bg); color: var(--muted); font-size: 2rem; font-weight: 700; }
.photo-actions { flex: 1; min-width: 220px; }
.photo-actions form { margin: 8px 0; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.photo-actions input[type=file] { font-size: .9rem; max-width: 100%; }
.photo-liens { margin: 4px 0; font-size: .9rem; }

/* Cotisations */
.recap { border: 1px solid var(--border); border-radius: 6px; padding: 12px 16px; margin: 12px 0; }
.recap-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.recap-head h3 { margin: 0; font-size: 1rem; }
.table { width: 100%; border-collapse: collapse; margin-top: 8px; font-size: .95rem; }
.table td, .table th { padding: 6px 4px; border-bottom: 1px solid var(--border); text-align: left; }
.table tfoot th { font-weight: 500; color: var(--muted); }
.table .num { text-align: right; white-space: nowrap; }
.statut { font-size: .8rem; font-weight: 600; border-radius: 999px; padding: 2px 10px; }
.statut-solde { background: var(--success-bg); color: var(--success-text); }
.statut-partiel { background: #fff6e0; color: #7a5300; }
.statut-non_paye { background: var(--error-bg); color: var(--error-text); }
.statut-trop_percu { background: #e8f0fd; color: #1d4f9a; }
.versements { margin-top: 8px; font-size: .9rem; }
.versements ul { margin: 6px 0 0; padding-left: 20px; }

/* Engagements (droit à l'image, décharge, autorisation parentale) */
.engagement { border: 1px solid var(--border); background: #fafbfc; border-radius: 6px; padding: 12px 16px; margin-bottom: 18px; font-size: .95rem; }
.engagement p { margin: 0 0 10px; }
.engagement-title { font-weight: 700; }
.engagement .checkbox { font-weight: 400; display: flex; gap: 8px; align-items: center; }
.engagement-ok { color: var(--success-text); margin: 0 0 12px; }

/* Fiche adhérent */
.details { display: grid; grid-template-columns: 180px 1fr; gap: 10px 16px; margin: 24px 0; }
.details dt { color: var(--muted); }
.details dd { margin: 0; font-weight: 500; }
.badge { display: inline-block; font-size: .75rem; background: var(--success-bg); color: var(--success-text); border-radius: 999px; padding: 1px 8px; margin-left: 6px; }

@media (max-width: 600px) {
    .grid-2, .grid-cp { grid-template-columns: 1fr; }
    .details { grid-template-columns: 1fr; gap: 2px; }
    .details dd { margin-bottom: 10px; }
    .card { padding: 20px; }
    .brand-sub { display: none; }
}

/* ---------- Espace Bureau ---------- */
.container.container-large { max-width: 1180px; }

.bureau-menu { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 24px; border-bottom: 2px solid var(--border); }
.bureau-menu a { padding: 8px 14px; text-decoration: none; color: var(--muted); border-radius: var(--radius) var(--radius) 0 0; }
.bureau-menu a:hover { color: var(--primary); background: var(--card); }
.bureau-menu a.actif { color: var(--primary); background: var(--card); font-weight: 600; box-shadow: inset 0 -3px 0 var(--primary); }

.stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 12px; margin-bottom: 20px; }
.stat { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 12px 16px; display: flex; flex-direction: column; }
.stat-valeur { font-size: 1.8rem; font-weight: 700; color: var(--primary); line-height: 1.1; }
.stat-libelle { color: var(--muted); font-size: .9rem; }

.a-traiter { list-style: none; margin: 0; padding: 0; }
.a-traiter li { padding: 8px 0; border-bottom: 1px solid var(--border); }
.a-traiter li:last-child { border-bottom: 0; }
.a-traiter li.vide, .a-traiter li.vide a { color: var(--muted); }

.filtres, .form-ligne { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: flex-end; margin-bottom: 16px; }
.filtres select, .filtres input, .form-ligne select, .form-ligne input[type="text"], .form-ligne input[type="date"],
.actions-bureau input, .actions-bureau select, .inline-form select {
    padding: 6px 8px; border: 1px solid var(--border); border-radius: 6px; font: inherit; font-size: .95rem; background: #fff;
}
.form-ligne label, .actions-bureau label { display: flex; flex-direction: column; font-size: .85rem; color: var(--muted); gap: 2px; }
.form-ligne label:has(input[type="checkbox"]) { flex-direction: row; align-items: center; gap: 6px; color: var(--text); }

.card-table { overflow-x: auto; padding: 0; }
.card.card-table .table { margin: 0; }
.card-table .table th, .card-table .table td { padding: 8px 10px; vertical-align: middle; }
.table-compacte { font-size: .9rem; }
.ligne-echue td { background: #fff7e6; }
.table .avatar { width: 30px; height: 40px; font-size: .75rem; }

.grille-bureau { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; align-items: start; }
.grille-bureau .card { margin-bottom: 0; }
.grille-bureau + .card, .grille-bureau + .card + .card { margin-top: 20px; }

.actions-bureau { display: flex; flex-direction: column; gap: 10px; margin-top: 10px; }
.actions-bureau form { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 8px; padding: 8px; background: var(--bg); border-radius: 6px; }

.inline-form { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 2px 0; }
.inline-form label { font-size: .85rem; }
.ligne-accompagnateur { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 6px 0; border-bottom: 1px solid var(--border); }

details summary { cursor: pointer; color: var(--primary); margin: 12px 0 8px; }
.details-journal span { display: block; font-size: .85rem; }

@media (max-width: 860px) {
    .grille-bureau { grid-template-columns: 1fr; }
}
.pagination { display: flex; align-items: center; justify-content: center; gap: 12px; margin-top: 16px; }

/* Certificat médical périmé (liste des pratiquants du bureau) */
.table tr.ligne-perimee td { background: #f83333; color: #fff; }
.table tr.ligne-perimee a, .table tr.ligne-perimee .muted { color: #fff; }
.table tr.ligne-perimee .tag { background: #fff; color: #f83333; }

/* Icône « imprimer la fiche » (liste des pratiquants) */
.icone { vertical-align: middle; }
.table td.imprimer { width: 1%; text-align: center; }
.table td.imprimer a { display: inline-block; padding: 2px 4px; border-radius: 4px; }
.table td.imprimer a:hover { background: var(--bg); }
.btn-inactif { opacity: .45; cursor: not-allowed; }

/* ---------- GLMU ---------- */
.fil-ariane { font-size: .9rem; color: var(--muted); margin-bottom: 12px; }
.fil-ariane a { color: var(--muted); }
.entete-page { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 16px; }
.entete-page h1 { margin: 0; }
.onglets { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 20px; border-bottom: 2px solid var(--border); }
.onglets a { padding: 8px 14px; text-decoration: none; color: var(--muted); border-radius: var(--radius) var(--radius) 0 0; }
.onglets a:hover { color: var(--primary); background: var(--card); }
.onglets a.actif { color: var(--primary); background: var(--card); font-weight: 600; box-shadow: inset 0 -3px 0 var(--primary); }
.tag-grade { background: #e7ecf6; color: var(--primary); }
.tag-honoraire { background: #f3ecdc; color: #6b5317; }
.tag-conge { background: #eceff3; color: var(--muted); }
.tag-visio { background: #e6f4f1; color: #1d5f54; }
.liste-cartes { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.liste-cartes .card { margin: 0; }
.liste-cartes .card h2 { margin-top: 0; font-size: 1.1rem; }
.alerte-regle { border-left: 4px solid #c58b00; background: #fff8e6; padding: 8px 12px; border-radius: 4px; margin: 8px 0; }
textarea { width: 100%; min-height: 80px; padding: 10px 12px; border: 1px solid var(--border); border-radius: 6px; font: inherit; }
input[type=date], input[type=number] { padding: 9px 10px; border: 1px solid var(--border); border-radius: 6px; font: inherit; }
