* { box-sizing: border-box; }
body {
    font-family: -apple-system, Segoe UI, Roboto, Arial, sans-serif;
    margin: 0;
    background: #f4f5f7;
    color: #1f2937;
}
header.site-header {
    background: #1e3a5f;
    color: white;
    padding: 0 1rem;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
}
header.site-header .brand {
    font-weight: bold;
    font-size: 1.1rem;
    padding: 0.9rem 1rem 0.9rem 0;
}
header.site-header nav {
    display: flex;
    flex-wrap: wrap;
}
header.site-header nav a {
    color: #d7e3f0;
    text-decoration: none;
    padding: 0.9rem 0.75rem;
    font-size: 0.92rem;
}
header.site-header nav a:hover, header.site-header nav a.active {
    background: #15293f;
    color: white;
}
header.site-header .brand { color: white; text-decoration: none; display: flex; align-items: center; gap: 1rem; padding: 0.7rem 1rem 0.7rem 0; font-size: 1.8rem; }
/* Le logo est noir : il lui faut un fond clair pour rester lisible sur le bleu. */
header.site-header .logo { height: 88px; width: 88px; background: white; border-radius: 8px; padding: 3px; }
/* Les onglets passent sur leur propre ligne, sous le logo et le nom du club. */
header.site-header nav { flex-basis: 100%; align-items: center; border-top: 1px solid #2c4a70; }
header.site-header { position: relative; }
header.site-header .deconnexion {
    position: absolute; top: 0.9rem; right: 1rem; display: flex; align-items: center; gap: 0.6rem;
    font-size: 0.9rem;
}
header.site-header .deconnexion button {
    background: none; border: 1px solid #d7e3f0; color: #d7e3f0; border-radius: 4px;
    padding: 0.3rem 0.6rem; cursor: pointer; font-size: 0.85rem;
}
.menu-bouton { display: none; }
.ligne-lien { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; margin-bottom: 0.5rem; }
.ligne-lien select { padding: 0.45rem; border: 1px solid #cbd5e1; border-radius: 4px; font-size: 0.95rem; max-width: 100%; }
.bloc-famille { background: #eef4fb; border: 1px solid #b7c9df; border-radius: 6px; padding: 0.8rem 1rem; margin-bottom: 1rem; line-height: 2; }
.total-famille { font-size: 1.15rem; margin: 1rem 0; }
.montant-ligne { width: 6rem; padding: 0.35rem; border: 1px solid #cbd5e1; border-radius: 4px; }
main {
    max-width: 1100px;
    margin: 1.5rem auto;
    padding: 0 1rem;
}
.messages { list-style: none; padding: 0; margin: 0 0 1rem 0; }
.messages li {
    padding: 0.6rem 1rem;
    border-radius: 4px;
    margin-bottom: 0.4rem;
}
.messages li.success { background: #dcfce7; color: #166534; }
.messages li.error { background: #fee2e2; color: #991b1b; }
.messages li.info, .messages li.warning { background: #fef9c3; color: #854d0e; }
table { border-collapse: collapse; width: 100%; background: white; }
table th, table td { padding: 0.5rem 0.7rem; border-bottom: 1px solid #e5e7eb; text-align: left; font-size: 0.92rem; }
table th { background: #eef1f5; }
table tr:hover { background: #f8fafc; }
.barre-actions { margin: 1rem 0; display: flex; gap: 0.5rem; flex-wrap: wrap; align-items: center; }
.btn {
    display: inline-block;
    padding: 0.45rem 0.9rem;
    border-radius: 4px;
    border: 1px solid #1e3a5f;
    background: #1e3a5f;
    color: white;
    text-decoration: none;
    font-size: 0.9rem;
    cursor: pointer;
}
.btn:hover { background: #15293f; }
.btn.secondaire { background: white; color: #1e3a5f; }
.btn.danger { background: white; color: #b91c1c; border-color: #b91c1c; }
form.inline { display: inline; }
.fiche-form p { margin: 0.6rem 0; }
.fiche-form label { display: block; font-weight: 600; margin-bottom: 0.2rem; font-size: 0.88rem; }
.fiche-form input, .fiche-form select, .fiche-form textarea {
    width: 100%; max-width: 420px; padding: 0.4rem; border: 1px solid #cbd5e1; border-radius: 4px;
}
.errorlist { color: #b91c1c; list-style: none; padding: 0; margin: 0.2rem 0; font-size: 0.85rem; }
.reste-du { background: white; padding: 0.8rem 1rem; border-radius: 6px; border: 1px solid #e5e7eb; max-width: 420px; }
.badge-sommeil { color: #9ca3af; font-style: italic; }

.fiche-panneau { background: white; border: 1px solid #e5e7eb; border-radius: 6px; padding: 1.2rem; margin-top: 0.5rem; }
.tabs-nav { display: flex; flex-wrap: wrap; border-bottom: 2px solid #e5e7eb; margin-bottom: 1.2rem; }
.tabs-nav button {
    padding: 0.55rem 1.1rem; border: none; background: none; cursor: pointer;
    font-size: 0.92rem; color: #475569; border-bottom: 3px solid transparent; margin-bottom: -2px;
}
.tabs-nav button.active { color: #1e3a5f; border-bottom-color: #1e3a5f; font-weight: 600; }
.tabs-nav button:hover:not(.active) { color: #1e3a5f; }
.tab-panel { display: none; }
.tab-panel.active { display: block; }
.tab-vide { color: #6b7280; font-style: italic; padding: 1rem 0; }

.sous-menu-donnees { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-bottom: 1.2rem; }
.sous-menu-donnees button {
    padding: 0.55rem 1.1rem; border: none; border-radius: 6px 6px 0 0;
    background: #d7e3f0; color: #1e3a5f; font-size: 0.9rem; cursor: pointer;
}
.sous-menu-donnees button:hover { background: #b7c9df; }
.sous-menu-donnees button.active { background: #1e3a5f; color: white; font-weight: 600; }

.fiche-colonnes { display: flex; gap: 2rem; flex-wrap: wrap; align-items: flex-start; }
.fiche-identite { flex: 1; min-width: 280px; }

/* --- Club : fiche, statuts, ceintures */
.fiche-resume { color: #475569; margin-top: -0.4rem; display: flex; flex-wrap: wrap; gap: 0.3rem; align-items: center; }
.fiche-form input[type="checkbox"] { width: auto; }
.fiche-form small { color: #6b7280; display: block; }
.table-defile { overflow-x: auto; }
.statut { display: inline-block; padding: 0.1rem 0.5rem; border-radius: 999px; font-size: 0.82rem; background: #e5e7eb; }
.statut-paye { background: #dcfce7; color: #166534; }
.statut-du, .statut-partiel { background: #fef9c3; color: #854d0e; }
.statut-retard { background: #fee2e2; color: #991b1b; }
.ceinture { display: inline-flex; align-items: center; gap: 0.4rem; white-space: nowrap; }
.ceinture-barre { display: inline-block; width: 28px; height: 10px; border-radius: 3px; border: 1px solid #9ca3af; }

/* --- Présences (pensé pour le téléphone) */
.cartes-cours { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 0.8rem; }
.carte-cours {
    display: flex; flex-direction: column; gap: 0.25rem; padding: 1rem 1.1rem; border-radius: 8px;
    background: #1e3a5f; color: white; text-decoration: none; font-size: 1.05rem;
}
.carte-cours.secondaire { background: white; color: #1e3a5f; border: 1px solid #cbd5e1; }
.carte-cours .compteur { font-size: 0.85rem; opacity: 0.85; }
.jour-choix input[type="date"] { padding: 0.4rem; border: 1px solid #cbd5e1; border-radius: 4px; font-size: 1rem; }
.liste-appel { list-style: none; padding: 0; margin: 0 0 5rem; display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 0.5rem; }
.liste-appel label {
    display: flex; align-items: center; justify-content: space-between; gap: 0.5rem;
    min-height: 3.2rem; padding: 0.6rem 1rem; background: white; border: 2px solid #cbd5e1;
    border-radius: 8px; cursor: pointer; font-size: 1.05rem; user-select: none; position: relative;
}
.liste-appel input { position: absolute; opacity: 0; pointer-events: none; }
.liste-appel .coche { width: 1.8rem; height: 1.8rem; border-radius: 50%; border: 2px solid #cbd5e1; color: transparent; display: grid; place-items: center; font-weight: bold; }
.liste-appel input:checked + .nom { font-weight: 600; }
.liste-appel input:checked ~ .coche { background: #16a34a; border-color: #16a34a; color: white; }
.liste-appel label:has(input:checked) { border-color: #16a34a; background: #f0fdf4; }
.liste-appel input:focus-visible ~ .coche { outline: 3px solid #1e3a5f; outline-offset: 2px; }
.barre-enregistrer {
    position: fixed; left: 0; right: 0; bottom: 0; background: white; border-top: 1px solid #e5e7eb;
    padding: 0.7rem 1rem; display: flex; justify-content: space-between; align-items: center; gap: 1rem;
    box-shadow: 0 -2px 8px rgba(0,0,0,0.06);
}
.barre-enregistrer .btn { font-size: 1.05rem; padding: 0.65rem 1.4rem; }
#compteur { font-weight: 600; }

@media (max-width: 760px) {
    header.site-header { padding: 0 0.8rem; justify-content: space-between; }
    header.site-header .brand { font-size: 1.25rem; gap: 0.7rem; padding: 0.5rem 0.5rem 0.5rem 0; }
    header.site-header .logo { height: 64px; width: 64px; }
    .menu-bouton {
        display: block; background: none; border: 1px solid #d7e3f0; color: white;
        border-radius: 4px; padding: 0.4rem 0.8rem; font-size: 0.95rem; cursor: pointer;
    }
    header.site-header nav { display: none; flex-basis: 100%; flex-direction: column; align-items: stretch; padding-bottom: 0.6rem; }
    header.site-header nav.ouvert { display: flex; }
    header.site-header nav a { padding: 0.7rem 0.4rem; border-top: 1px solid #2c4a70; }
    header.site-header .deconnexion { position: static; padding: 0.7rem 0.4rem; border-top: 1px solid #2c4a70; }
    main { margin: 1rem auto; }
    h1 { font-size: 1.4rem; }
}
