/* Styles propres à SD School, en complément de Bootstrap */


.menu-lateral {
    --bs-offcanvas-width: 270px;
    display: flex;
    flex-direction: column;
}

@media (min-width: 992px) {
    /* Le menu reste en place quand la page défile : hauteur de l'écran sous la barre du haut,
       et c'est la liste du menu qui défile si elle est plus longue (--hauteur-barre mesurée par layouts/app) */
    .menu-lateral {
        width: 270px;
        flex-shrink: 0;
        height: calc(100vh - var(--hauteur-barre, 56px));
        height: calc(100dvh - var(--hauteur-barre, 56px));
        position: sticky;
        top: var(--hauteur-barre, 56px);
        align-self: flex-start;
        transition: width .2s ease;
    }
    .menu-lateral .offcanvas-body {
        display: block !important; /* Bootstrap le met en flex : la liste serait écrasée au lieu de défiler */
        min-height: 0;
        overscroll-behavior: contain; /* le défilement du menu n'entraîne pas la page */
    }
    .menu-lateral.reduit {
        width: 60px;
        overflow: hidden;
    }
    .menu-lateral.reduit .offcanvas-body .nav-link span {
        display: none;
    }
    .menu-lateral.reduit .offcanvas-body .nav-link {
        text-align: center;
        padding-left: .5rem;
        padding-right: .5rem;
    }
    .menu-lateral.reduit .offcanvas-body .nav-link i {
        margin-right: 0 !important;
        font-size: 1.2rem;
    }
    .menu-lateral.reduit .pied-menu {
        display: none;
    }
    .menu-lateral.reduit .btn-reduire-menu {
        width: 100%;
    }
}

.carte-chiffre .icone {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: grid;
    place-items: center;
    font-size: 1.4rem;
}

.page-connexion {
    min-height: 100vh;
    display: grid;
    place-items: center;
    background: linear-gradient(135deg, #0d6efd 0%, #0a3d91 100%);
}

.page-connexion .card {
    width: min(420px, 92vw);
}

.avatar-eleve {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    font-weight: 600;
    font-size: 1.2rem;
}

/* Encaissement : état des mois et des échéances (vert = payé, orange = reste à payer, rouge = non payé) */
.entete-mois > td { border-bottom-width: 2px; }
.mois-paye, .entete-mois.mois-paye > td { background: #8fdc8f !important; color: #0f3d0f; }
.mois-partiel, .entete-mois.mois-partiel > td { background: #ffc069 !important; color: #4d2c00; }
.mois-impaye, .entete-mois.mois-impaye > td { background: #ff8f8f !important; color: #4a0b0b; }
.ligne-paye > td { background: #eefbee !important; }
.ligne-partiel > td { background: #fff4e3 !important; }
.ligne-impaye > td { background: #fff0f0 !important; }
.ligne-mois > .cellule-eleve { background: #fff !important; }
.pastille { display: inline-block; width: .9rem; height: .9rem; border-radius: .2rem; vertical-align: -2px; margin-right: .25rem; }
.bouton-plier {
    width: 1.35rem; height: 1.35rem; padding: 0; margin-right: .5rem;
    border: 1px solid #555; background: #fff; color: #222;
    font-weight: 700; line-height: 1; font-size: .95rem; vertical-align: 1px;
}
.bouton-plier:focus-visible { outline: 2px solid #0d6efd; outline-offset: 1px; }

/* Encaissement : enfants de la famille (photo, nom, classe) */
.carte-enfant {
    width: 8.5rem;
    padding: .5rem .25rem;
    border-radius: .5rem;
    border: 1px solid #e9ecef;
    display: flex;
    flex-direction: column;
    align-items: center;
}
.carte-enfant:hover { background: #f1f6ff; border-color: #b6d4fe; }

/* Grandes bulles des attestations (fiche employé) */
.bulle-attestation { transition: transform .1s, box-shadow .1s; }
.bulle-attestation:hover { transform: translateY(-2px); box-shadow: 0 .5rem 1rem rgba(0, 0, 0, .1); }

/* Sous-menus du menu latéral */
.sous-menu { margin-left: 1.1rem; padding-left: .4rem; border-left: 2px solid #dee2e6; }
.sous-menu .nav-link { font-size: .92rem; }
[aria-expanded="true"] > .fleche-sous-menu { transform: rotate(180deg); }
.fleche-sous-menu { transition: transform .15s; }

/* Séparateurs du menu : un trait, ou un titre de section */
.separateur-menu hr { margin: .4rem .75rem; opacity: .2; }
.separateur-menu .titre-section { padding: .6rem 1rem .15rem; font-size: .7rem; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: #6c757d; }
.sous-menu .separateur-menu .titre-section { padding-top: .35rem; }
.menu-lateral.reduit .separateur-menu .titre-section { display: none; }

/* Chargement en arrière-plan (public/js/filtres.js et navigation.js) : rien ne clignote si la réponse est rapide ;
   au-delà de 0,25 s, le contenu s'estompe légèrement et une fine barre de progression défile en haut de l'écran */
main[aria-busy="true"] { cursor: progress; }
main[aria-busy="true"] > *:not(.filtre-direct) { opacity: .6; transition: opacity .2s .25s; }
main[aria-busy="true"]::before {
    content: ""; position: fixed; top: 0; left: 0; z-index: 2000; height: 3px; width: 35%;
    background: linear-gradient(90deg, transparent, #ffc107, #fff3cd, #ffc107, transparent);
    opacity: 0; animation: sd-barre 1.1s linear .15s infinite;
}
@keyframes sd-barre { 0% { transform: translateX(-100%); opacity: 1; } 100% { transform: translateX(300%); opacity: 1; } }
@media (prefers-reduced-motion: reduce) { main[aria-busy="true"]::before { animation: none; opacity: 1; width: 100%; } }

/* Zone de dépôt de fichiers (glisser-déposer) */
.zone-depot { border: 2px dashed #9ec5fe; background: #f5f9ff; cursor: pointer; transition: background .15s, border-color .15s; }
.zone-depot:hover, .zone-depot.survol { border-color: #0d6efd; background: #e7f1ff; }
