/* ==========================================================================
   KIT D'INTERFACE « V2 » — look application, partagé par les pages qui
   l'adoptent (www/index.php, moncompte/mes_lessons.php, …).

   Tout est préfixé .v2 / .v2-* pour ne rien emprunter (ni casser) des styles
   historiques de main.css, et surtout pour laisser le menu commun
   (include/menuv3.php) s'afficher exactement comme sur les autres pages.
   Palette sémantique : le bleu porte l'information, le vert l'objectif
   atteint, l'ambre UNIQUEMENT l'alerte réelle.

   Les particularités d'une page vivent dans SA feuille (assets/css/<page>.css).
   ========================================================================== */

.v2-body {
    --v2-surface: #ffffff;
    --v2-surface-2: #f5f7fb;
    --v2-ink: #0e1524;
    --v2-ink-2: #5a6478;
    --v2-ink-3: #8b93a7;
    --v2-line: #e6eaf2;
    --v2-blue: #2563eb;
    --v2-blue-soft: #eef3ff;
    --v2-go: #15a34a;
    --v2-go-soft: #e9f8ef;
    --v2-amber: #c2410c;
    --v2-amber-soft: #fdf0e9;
    --v2-shadow: 0 1px 2px rgba(14, 21, 36, .06), 0 8px 24px rgba(14, 21, 36, .06);
    --v2-r: 18px;

    /* Rien d'autre que le fond de page et la place laissée à la barre basse :
       la typographie du <body> reste celle de main.css, sinon le menu commun
       (include/menuv3.php) ne s'afficherait pas comme sur les autres pages.

       Le papier peint de l'app est conservé, adouci par un voile clair posé
       par-dessus : les cartes blanches restent lisibles, le motif reste
       reconnaissable. Jouer sur l'alpha du dégradé = jouer sur l'opacité. */
    background-color: var(--v2-surface-2);
    background-image:
        linear-gradient(rgba(245, 247, 251, .35), rgba(245, 247, 251, .35)),
        url(../images/logos/8c98994518b575bfd8c949e91d20548b.jpg);
    background-attachment: fixed, fixed;
    background-repeat: repeat, repeat;
    padding-bottom: calc(86px + env(safe-area-inset-bottom));
}

/* Une page sans barre de navigation (saisie de leçon, par exemple) n'a pas
   besoin de la réserve du bas : elle laisserait un vide en fin de page. */
.v2-body:not(:has(.v2-nav)) {
    padding-bottom: 1.5rem;
}

.v2,
.v2-header,
.v2-nav,
.v2-overlay {
    color: var(--v2-ink);
    font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 15px;
    line-height: 1.35;
    -webkit-font-smoothing: antialiased;
}

.v2 *,
.v2-header *,
.v2-nav *,
.v2-overlay * {
    -webkit-tap-highlight-color: transparent;
}

.v2 {
    max-width: 480px;
    margin: 0 auto;
    /* Transparent : le papier peint adouci du <body> reste visible entre les
       cartes, comme sur le reste de l'application. */
    background: transparent;
}

/* Colonnes de la vue desktop : neutres tant qu'on est en une seule colonne
   (les sections s'enchaînent comme si les conteneurs n'existaient pas). */
.v2-main,
.v2-side {
    display: contents;
}

/* ── En-tête ─────────────────────────────────────────────────────── */
.v2-header {
    background: linear-gradient(160deg, #1e3a8a 0%, #2563eb 100%);
    color: #fff;
    padding: 22px 0 24px;
    /* Bas droit : la carte de recherche vient s'y poser sans décrochement. */
    border-radius: 0;
    position: relative;
    overflow: hidden;
}

/* Le contenu de l'en-tête suit la même colonne que le reste de la page. */
.v2-header__in {
    max-width: 480px;
    margin: 0 auto;
    padding: 0 20px;
    position: relative;
    z-index: 1;
}

/* ── Variantes de couleur du bandeau ──────────────────────────────
   Reprises des variantes historiques (.dash-header-green, -red, …) pour
   que chaque page garde sa couleur d'origine : le bleu reste la valeur
   par défaut, le vert la création, l'ambre / le rouge l'exclusion. */
.v2-header--green  { background: linear-gradient(160deg, #15803d 0%, #16a34a 100%); }
.v2-header--red    { background: linear-gradient(160deg, #991b1b 0%, #dc2626 100%); }
.v2-header--amber  { background: linear-gradient(160deg, #b45309 0%, #f59e0b 100%); }
.v2-header--purple { background: linear-gradient(160deg, #5b21b6 0%, #7c3aed 100%); }
.v2-header--teal   { background: linear-gradient(160deg, #0f766e 0%, #14b8a6 100%); }

/* Même trame de petites croix que l'en-tête de la vue v1 (.dash-header). */
.v2-header::before {
    content: "";
    position: absolute;
    inset: 0;
    background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.04'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}

.v2-header::after {
    content: "";
    position: absolute;
    right: -40px;
    top: -40px;
    width: 180px;
    height: 180px;
    background: radial-gradient(circle, rgba(255, 255, 255, .14), transparent 70%);
}

.v2-header h1 {
    font-size: 26px;
    font-weight: 800;
    letter-spacing: -.4px;
    margin: 0;
    position: relative;
    z-index: 1;
}

.v2-date {
    font-size: 13px;
    opacity: .82;
    margin-top: 2px;
    position: relative;
    z-index: 1;
}

.v2-wave {
    display: inline-block;
    transform-origin: 70% 70%;
    animation: v2-wave 2.4s ease-in-out 1s infinite;
}

@keyframes v2-wave {

    0%, 60%, 100% { transform: rotate(0deg); }
    10%, 30% { transform: rotate(14deg); }
    20% { transform: rotate(-8deg); }
    40% { transform: rotate(-4deg); }
}

/* ── Recherche (déclencheur collant) ─────────────────────────────── */
.v2-search {
    position: sticky;
    top: 0;
    z-index: 20;
    padding: 12px 16px 10px;
    /* Voile translucide plutôt qu'aplat : le papier peint continue de
       transparaître pendant que le contenu défile dessous. */
    background: linear-gradient(180deg, rgba(245, 247, 251, .94) 72%, rgba(245, 247, 251, 0));
    backdrop-filter: blur(6px);
    margin-bottom: 4px;
}

/* Sur mobile / tablette le champ, collant en haut de l'écran, chevauche
   légèrement le bandeau au repos (même idée que le desktop, plus discret).
   Pas de « vitre » pleine largeur : le champ s'aligne alors sur la même
   colonne que les cartes (Prochaine séance…), et c'est lui qui porte les
   angles arrondis en remontant sur le bleu. */
@media (max-width: 991.98px) {
    .v2-search {
        margin-top: -18px;
        padding: 10px 16px 4px;
        background: none;
        backdrop-filter: none;
    }
    .v2-search-trigger {
        border-radius: var(--v2-r);
        box-shadow: var(--v2-shadow);
    }
}

.v2-search-trigger {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 11px;
    border: 1px solid transparent;
    background: #eef1f7;
    border-radius: 14px;
    padding: 14px;
    cursor: pointer;
    transition: transform .16s cubic-bezier(.32, .72, 0, 1), background .16s ease, box-shadow .16s ease, border-color .16s ease;
}

.v2-search-trigger:hover { background: #e9edf5; }
.v2-search-trigger:active { transform: scale(.99); background: #e4e9f2; }

.v2-search-trigger.is-expanding {
    background: #fff;
    border-color: var(--v2-line);
    box-shadow: var(--v2-shadow);
    transform: translateY(-2px);
}

.v2-search-trigger .ico { font-size: 15px; color: var(--v2-ink-3); }
.v2-search-trigger .ph { font-size: 15px; color: var(--v2-ink-3); font-weight: 500; }

/* ── Sections & titres ───────────────────────────────────────────── */
.v2-section { padding: 0 16px; margin-bottom: 14px; }

/* ── En-tête de carte ─────────────────────────────────────────────
   Bandeau clair en haut de chaque carte, même grammaire visuelle que le
   séparateur « Terminées (3) » des listes : le titre de la section vit
   dans la carte, plus au-dessus d'elle. */
.v2-card__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 11px 14px;
    background: #fbfcfe;
    border-bottom: 1px solid var(--v2-line);
    border-radius: var(--v2-r) var(--v2-r) 0 0;
    position: relative;
    z-index: 1;
}

.v2-card__head .t {
    display: flex;
    align-items: center;
    gap: 7px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 1.1px;
    text-transform: uppercase;
    color: var(--v2-ink-3);
}

.v2-card__head .m {
    font-size: 12px;
    font-weight: 600;
    color: var(--v2-ink-3);
    white-space: nowrap;
}

.v2-card__link { color: var(--v2-blue); text-decoration: none; font-weight: 700; }

.v2-card__body { padding: 14px; }

.v2-card {
    background: #fff;
    border-radius: var(--v2-r);
    box-shadow: var(--v2-shadow);
    border: 1px solid var(--v2-line);
}

/* ── Bandeaux d'alerte (rappel de saisie) ────────────────────────── */
.v2-flag {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 13px 14px;
    border-radius: 15px;
    text-decoration: none;
    color: inherit;
    border: 1px solid #f3d6c6;
    background: var(--v2-amber-soft);
}

.v2-flag__ico {
    width: 34px;
    height: 34px;
    border-radius: 11px;
    display: grid;
    place-items: center;
    background: #fadfd0;
    color: var(--v2-amber);
    flex-shrink: 0;
}

.v2-flag__body { flex: 1; min-width: 0; }
.v2-flag__title { display: block; font-size: 14px; font-weight: 800; color: var(--v2-amber); }
.v2-flag__sub { display: block; font-size: 12.5px; color: #8a4a2a; margin-top: 1px; }
.v2-flag__cta { font-size: 12.5px; font-weight: 800; color: var(--v2-amber); white-space: nowrap; text-decoration: none; }

/* Variante « suggestion » : informe sans alerter — un bandeau ambre pour une
   fonction à découvrir se lirait comme un problème à régler. */
.v2-flag--violet { border-color: #ddd6fe; background: #f5f3ff; }
.v2-flag--violet .v2-flag__ico { background: #ede9fe; color: #6d28d9; }
.v2-flag--violet .v2-flag__title { color: #5b21b6; }
.v2-flag--violet .v2-flag__sub { color: #6b5b8a; }
.v2-flag--violet .v2-flag__cta { color: #6d28d9; }

.v2-flag__close {
    border: 0;
    background: transparent;
    color: #a78bfa;
    font-size: 13px;
    line-height: 1;
    padding: 4px;
    cursor: pointer;
    flex-shrink: 0;
}

.v2-flag__close:hover { color: #6d28d9; }

/* ── Décompte congés ─────────────────────────────────────────────── */
.v2-conge {
    border-radius: 16px;
    padding: 14px 16px;
    color: #fff;
    background: linear-gradient(125deg, #0c4a91 0%, #0ea5e9 55%, #38bdf8 100%);
    box-shadow: 0 12px 26px -14px rgba(3, 105, 161, .6);
}

.v2-conge.is-active {
    background: linear-gradient(125deg, #047857 0%, #10b981 55%, #34d399 100%);
    box-shadow: 0 12px 26px -14px rgba(4, 120, 87, .6);
}

.v2-conge__eyebrow { font-size: 11px; font-weight: 700; letter-spacing: .8px; text-transform: uppercase; opacity: .9; }
.v2-conge__title { font-size: 17px; font-weight: 800; margin-top: 3px; display: flex; align-items: baseline; gap: 8px; }
.v2-conge__j { font-size: 22px; font-weight: 800; letter-spacing: -.5px; }
.v2-conge__sub { font-size: 12.5px; opacity: .9; margin-top: 3px; }

/* ── Héros : prochaine séance / séance en cours ──────────────────── */
.v2-next {
    position: relative;
    overflow: hidden;
}

.v2-next__body { padding: 16px; }

.v2-strip {
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 5px;
    background: var(--v2-go);
}

.v2-strip--amber { background: var(--v2-amber); }

.v2-next__top {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 10px;
    margin-bottom: 12px;
}

.v2-when { font-size: 13px; font-weight: 700; color: var(--v2-go); letter-spacing: .2px; }
.v2-when--amber { color: var(--v2-amber); }
.v2-in { font-size: 12px; color: var(--v2-ink-3); font-weight: 600; white-space: nowrap; }

.v2-who { display: flex; align-items: center; gap: 12px; }

.v2-avatar {
    width: 46px;
    height: 46px;
    border-radius: 14px;
    background: var(--v2-blue-soft);
    color: var(--v2-blue);
    display: grid;
    place-items: center;
    font-weight: 800;
    font-size: 16px;
    flex-shrink: 0;
    overflow: hidden;
}

.v2-avatar--img { object-fit: cover; }
.v2-avatar--sm { width: 40px; height: 40px; border-radius: 12px; font-size: 14px; }

.v2-name { font-size: 18px; font-weight: 800; letter-spacing: -.2px; }
.v2-meta { font-size: 13px; color: var(--v2-ink-2); margin-top: 1px; }

/* ── Chronomètre de la séance en cours ───────────────────────────────
   La barre se remplit au fil de la séance et se réchauffe : bleue au
   départ, rouge quand le temps est écoulé. La teinte de l'instant
   (--v2-timer-now) est posée seconde par seconde par index_v2.js ; sans
   JS la barre reste bleue de bout en bout. */
.v2-timer {
    --v2-timer-start: var(--v2-blue);
    --v2-timer-end: #dc2626;
    height: 7px;
    border-radius: 20px;
    background: var(--v2-surface-2);
    overflow: hidden;
    margin-top: 14px;
}

.v2-timer__fill {
    display: block;
    position: relative;
    height: 100%;
    width: 0;
    border-radius: 20px;
    overflow: hidden;
    background-image: linear-gradient(90deg,
        var(--v2-timer-start),
        var(--v2-timer-now, var(--v2-timer-start)));
    transition: width 1s linear;
}

/* Reflet qui balaie la portion remplie : la séance court. */
.v2-timer__fill::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(100deg,
        transparent 20%, rgba(255, 255, 255, .55) 50%, transparent 80%);
    animation: v2-timer-sweep 2.6s ease-in-out infinite;
}

/* Dernières minutes : la barre respire pour attirer l'œil. */
.v2-timer--ending .v2-timer__fill { animation: v2-timer-pulse 1.4s ease-in-out infinite; }

@keyframes v2-timer-sweep {

    0% { transform: translateX(-100%); }
    65%, 100% { transform: translateX(100%); }
}

@keyframes v2-timer-pulse {

    0%, 100% { opacity: 1; }
    50% { opacity: .6; }
}

.v2-foot { display: flex; gap: 8px; margin-top: 14px; }

.v2-btn {
    flex: 1;
    border: 0;
    border-radius: 12px;
    padding: 11px;
    font-size: 14px;
    font-weight: 700;
    text-align: center;
    text-decoration: none;
    cursor: pointer;
    transition: transform .1s, filter .15s;
}

.v2-btn:active { transform: scale(.96); }
.v2-btn--primary { background: var(--v2-blue); color: #fff; }
.v2-btn--primary:hover { color: #fff; filter: brightness(1.06); }
.v2-btn--ghost { background: var(--v2-surface-2); color: var(--v2-ink); }
.v2-btn--ghost:hover { color: var(--v2-ink); background: #eef1f7; }

/* ── État vide ───────────────────────────────────────────────────── */
.v2-empty { padding: 26px 20px; text-align: center; }
.v2-empty__ico { font-size: 30px; color: var(--v2-ink-3); opacity: .55; margin-bottom: 10px; }
.v2-empty__title { font-size: 16px; font-weight: 800; }
.v2-empty p { font-size: 13px; color: var(--v2-ink-2); margin: 6px 0 14px; }
.v2-empty .v2-btn { display: inline-block; flex: none; padding: 11px 18px; }

/* ── Listes (journée, dernières leçons) ──────────────────────────── */
.v2-list { overflow: hidden; }

.v2-row {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 11px 13px;
    text-decoration: none;
    color: inherit;
    border-bottom: 1px solid var(--v2-line);
}

.v2-row:last-child { border-bottom: 0; }
.v2-row:hover { color: inherit; background: #fafbfe; }
.v2-row:active { background: var(--v2-surface-2); }
.v2-row--done { opacity: .78; }

.v2-row__info { flex: 1; min-width: 0; }
.v2-row__name { font-size: 15px; font-weight: 700; letter-spacing: -.1px; }

.v2-row__sub {
    font-size: 12.5px;
    color: var(--v2-ink-2);
    margin-top: 1px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.v2-row__chev { color: var(--v2-ink-3); font-size: 12px; }

/* Dernière ligne d'une liste : lien vers l'historique complet. */
.v2-row--more {
    justify-content: center;
    gap: 8px;
    font-size: 13px;
    font-weight: 700;
    color: var(--v2-blue);
    background: #fbfcfe;
}

.v2-row--more:hover { color: var(--v2-blue); background: #f4f7fd; }
.v2-row--more .v2-row__chev { color: inherit; }

.v2-list__label {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 1.1px;
    text-transform: uppercase;
    color: var(--v2-ink-3);
    padding: 10px 14px 6px;
    background: #fbfcfe;
    border-bottom: 1px solid var(--v2-line);
}

.v2-badge {
    font-size: 11px;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 20px;
    white-space: nowrap;
}

.v2-badge--go { background: var(--v2-go-soft); color: var(--v2-go); }
.v2-badge--blue { background: var(--v2-blue-soft); color: var(--v2-blue); }
.v2-badge--amber { background: var(--v2-amber-soft); color: var(--v2-amber); }
.v2-badge--slate { background: var(--v2-surface-2); color: var(--v2-ink-2); }

/* ── KPI semaine ─────────────────────────────────────────────────── */
.v2-duo { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.v2-duo--solo { grid-template-columns: 1fr; }
.v2-duo--tight { gap: 8px; margin-top: 4px; }

.v2-kpi {
    padding: 13px 14px;
    border-radius: 14px;
    background: var(--v2-surface-2);
}

.v2-kpi__lab {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .8px;
    text-transform: uppercase;
    color: var(--v2-ink-3);
    display: flex;
    align-items: center;
    gap: 5px;
}

.v2-kpi__val { font-size: 28px; font-weight: 800; letter-spacing: -1px; margin: 6px 0 2px; }
.v2-kpi__sub { font-size: 12px; color: var(--v2-ink-2); font-weight: 600; }
.v2-blue { color: var(--v2-blue); }
.v2-go { color: var(--v2-go); }

.v2-alert {
    margin-top: 10px;
    background: var(--v2-amber-soft);
    border: 1px solid #f3d6c6;
    border-radius: 14px;
    padding: 12px 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    text-decoration: none;
}

.v2-alert .l { display: flex; align-items: center; gap: 9px; font-size: 13px; font-weight: 700; color: var(--v2-amber); }
.v2-alert .r { font-size: 13px; font-weight: 800; color: var(--v2-amber); white-space: nowrap; }

/* ── Bilan du mois ───────────────────────────────────────────────── */
.v2-mrow { margin-bottom: 16px; }
.v2-mrow:last-child { margin-bottom: 0; }

.v2-mrow__line {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 8px;
    margin-bottom: 7px;
    flex-wrap: wrap;
}

.v2-mrow__line .big { font-size: 21px; font-weight: 800; letter-spacing: -.5px; }
.v2-mrow__line .small { font-size: 13px; color: var(--v2-ink-3); font-weight: 600; }

.v2-trend {
    font-size: 11.5px;
    font-weight: 700;
    color: var(--v2-ink-2);
    background: var(--v2-surface-2);
    padding: 3px 9px;
    border-radius: 20px;
    white-space: nowrap;
}

.v2-trend--up { color: var(--v2-go); background: var(--v2-go-soft); }
.v2-trend--down { color: var(--v2-amber); background: var(--v2-amber-soft); }

.v2-bar { height: 7px; border-radius: 20px; background: var(--v2-surface-2); overflow: hidden; }
.v2-bar > i { display: block; height: 100%; border-radius: 20px; transition: width .8s cubic-bezier(.32, .72, 0, 1); }
.v2-bar > i.is-blue { background: var(--v2-blue); }
.v2-bar > i.is-go { background: var(--v2-go); }

.v2-goal {
    display: flex;
    justify-content: space-between;
    font-size: 11px;
    color: var(--v2-ink-3);
    font-weight: 600;
    margin-top: 6px;
}

.v2-ttc-toggle {
    margin-top: 8px;
    border: 1px solid var(--v2-line);
    background: var(--v2-surface-2);
    color: var(--v2-ink-2);
    font-size: 11.5px;
    font-weight: 700;
    border-radius: 20px;
    padding: 4px 11px;
    cursor: pointer;
}

.v2-tile { border-radius: 12px; padding: 11px 13px; text-decoration: none; display: block; }
.v2-tile__lab { font-size: 11px; font-weight: 700; letter-spacing: .5px; text-transform: uppercase; }
.v2-tile__val { font-size: 19px; font-weight: 800; margin-top: 2px; }
.v2-tile--go { background: var(--v2-go-soft); color: var(--v2-go); }
.v2-tile--amber { background: var(--v2-amber-soft); color: var(--v2-amber); }
.v2-tile--blue { background: var(--v2-blue-soft); color: var(--v2-blue); }

/* ── Barre de navigation basse ───────────────────────────────────── */
.v2-nav {
    /* La barre doit s'afficher telle quelle sur les pages qui n'ont pas le
       corps .v2-body (elles ne définissent donc pas les variables de couleur) :
       on les porte ici, sur la barre elle-même. */
    --v2-line: #e6eaf2;
    --v2-ink: #0e1524;
    --v2-ink-3: #8b93a7;
    --v2-blue: #2563eb;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 30;
    background: rgba(255, 255, 255, .94);
    backdrop-filter: blur(12px);
    border-top: 1px solid var(--v2-line);
    display: flex;
    justify-content: space-around;
    align-items: flex-start;
    padding: 8px 0 calc(8px + env(safe-area-inset-bottom));
    /* Barre d'un bord à l'autre de l'écran : elle appartient à la fenêtre,
       pas à la colonne de contenu (qui, elle, reste centrée). */
}

.v2-nav a {
    flex: 1;
    text-align: center;
    text-decoration: none;
    color: var(--v2-ink-3);
    font-size: 10.5px;
    font-weight: 700;
    padding: 4px 0;
}

.v2-nav a .ni { font-size: 17px; display: block; margin-bottom: 3px; }
.v2-nav a.is-active { color: var(--v2-blue); }

.v2-nav__fab .fab {
    display: inline-grid;
    place-items: center;
    width: 46px;
    height: 46px;
    border-radius: 16px;
    background: var(--v2-blue);
    color: #fff;
    font-size: 18px;
    margin-top: -20px;
    box-shadow: 0 6px 16px rgba(37, 99, 235, .4);
}

/* Pages « héritées » qui n'ont pas le corps .v2-body : la barre basse leur est
   ajoutée telle quelle, il faut laisser de la place au contenu pour qu'il ne
   soit pas masqué derrière elle. Uniquement en mobile — ≥ 992 px, la barre
   disparaît (.v2-nav { display: none }) et le menu commun prend le relais. */
@media (max-width: 991.98px) {
    body:has(.v2-nav) {
        padding-bottom: calc(86px + env(safe-area-inset-bottom));
    }
}

/* ── Recherche plein écran ───────────────────────────────────────── */
.v2-overlay {
    position: fixed;
    inset: 0;
    z-index: 1080;
    background: #fff;
    display: flex;
    flex-direction: column;
    max-width: 480px;
    margin: 0 auto;
    opacity: 0;
    transform: scale(1.04);
    transform-origin: top center;
    transition: opacity .22s ease, transform .28s cubic-bezier(.32, .72, 0, 1);
    visibility: hidden;
    pointer-events: none;
}

.v2-overlay.is-open { opacity: 1; transform: scale(1); visibility: visible; pointer-events: auto; }

.v2-ov__bar {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: calc(12px + env(safe-area-inset-top)) 16px 12px;
    border-bottom: 1px solid var(--v2-line);
    background: #fff;
}

.v2-ov__field {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 9px;
    background: var(--v2-surface-2);
    border-radius: 13px;
    padding: 11px 13px;
}

.v2-ov__field .ico { font-size: 15px; color: var(--v2-ink-3); }

.v2-ov__field input {
    flex: 1;
    min-width: 0;
    border: 0;
    background: none;
    font-size: 16px;
    color: var(--v2-ink);
    outline: none;
}

.v2-ov__field input::placeholder { color: var(--v2-ink-3); }

.v2-ov__cancel {
    border: 0;
    background: none;
    color: var(--v2-blue);
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    padding: 4px;
    white-space: nowrap;
}

.v2-ov__panel {
    display: flex;
    flex-direction: column;
    width: 100%;
    height: 100%;
    min-height: 0;
    background: #fff;
}

.v2-ov__results { flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch; padding: 6px 0 24px; }

.v2-res__head {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 1.2px;
    text-transform: uppercase;
    color: var(--v2-ink-3);
    padding: 14px 20px 8px;
}

.v2-res {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 16px;
    text-decoration: none;
    color: inherit;
    cursor: pointer;
}

.v2-res:hover { color: inherit; background: #fafbfe; }
.v2-res:active { background: var(--v2-surface-2); }
.v2-res__info { flex: 1; min-width: 0; }
.v2-res__name { font-size: 15.5px; font-weight: 700; letter-spacing: -.1px; }
.v2-res__name mark { background: #fff2b8; color: inherit; border-radius: 3px; padding: 0 1px; }

.v2-res__sub {
    font-size: 12.5px;
    color: var(--v2-ink-2);
    margin-top: 1px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.v2-ov__empty { text-align: center; color: var(--v2-ink-3); padding: 54px 30px; font-size: 14px; }
.v2-ov__empty .em { font-size: 34px; display: block; margin-bottom: 12px; opacity: .5; }
.v2-ov__empty a { color: var(--v2-blue); font-weight: 700; }
.v2-ov__hint { text-align: center; color: var(--v2-ink-3); padding: 40px 30px; font-size: 13.5px; }

/* ══ TABLETTE : même colonne unique, un peu plus large ═══════════════ */
@media (min-width: 600px) and (max-width: 991.98px) {
    .v2 { max-width: 580px; }
    .v2-header__in { max-width: 580px; }
    .v2-overlay { max-width: 580px; }
}

/* ══ DESKTOP : deux colonnes, plus de barre basse ════════════════════
   La colonne de gauche porte le travail du jour (séance en cours ou à
   venir, journée), celle de droite les actions et les chiffres. La
   navigation est alors assurée par le menu commun en haut de page. */
@media (min-width: 992px) {
    .v2-body { padding-bottom: 40px; }

    /* Largeur : celle du .container Bootstrap de la vue v1, pour que les deux
       tableaux de bord occupent exactement la même colonne à l'écran. */
    .v2 {
        max-width: 960px;
        display: grid;
        grid-template-columns: minmax(0, 1.45fr) minmax(0, 1fr);
        gap: 0 22px;
        align-items: start;
        padding: 0 12px 32px;
        background: transparent;
    }

    .v2-main,
    .v2-side {
        display: flex;
        flex-direction: column;
        min-width: 0;
    }

    .v2-main { grid-column: 1; }
    .v2-side { grid-column: 2; }

    .v2-section { padding: 0; margin-bottom: 16px; }

    /* En-tête pleine largeur ; sa réserve basse accueille la carte de
       recherche qui vient se poser dessus (même effet que la v1). */
    .v2-header { padding: 26px 0 62px; }
    .v2-header__in { max-width: 960px; padding: 0 16px; }
    .v2-header h1 { font-size: 30px; }

    .v2-search {
        grid-column: 1 / -1;
        position: relative;
        z-index: 25;
        margin-top: -42px;
        padding: 0 4px;
        background: none;
        backdrop-filter: none;
    }

    /* La carte de recherche chevauche le dégradé, comme sur la vue v1. */
    .v2-search-trigger {
        background: #fff;
        border-color: var(--v2-line);
        border-radius: var(--v2-r);
        padding: 16px 20px;
        box-shadow: 0 10px 30px rgba(14, 21, 36, .12);
    }

    .v2-search-trigger:hover { background: #fff; box-shadow: 0 12px 34px rgba(14, 21, 36, .16); }

    /* Les deux colonnes commencent à la même hauteur… */
    .v2-main > .v2-section:first-child,
    .v2-side > .v2-section:first-child { margin-top: 16px; }

    /* … sauf la carte qui doit chevaucher le bandeau. */
    .v2-main > .v2-section.v2-lift:first-child,
    .v2-side > .v2-section.v2-lift:first-child,
    .v2-lift { margin-top: -46px; }

    .v2-kpi__val { font-size: 26px; }
    .v2-row { padding: 12px 14px; }

    /* La barre basse n'a plus lieu d'être : le menu haut prend le relais. */
    .v2-nav { display: none; }

    /* Recherche : boîte de dialogue centrée plutôt que plein écran. */
    .v2-overlay {
        max-width: none;
        background: rgba(14, 21, 36, .45);
        backdrop-filter: blur(3px);
        padding: 9vh 20px 24px;
        align-items: center;
        transform: none;
    }

    .v2-overlay.is-open { transform: none; }

    .v2-ov__panel {
        width: 100%;
        max-width: 640px;
        height: auto;
        max-height: 72vh;
        border-radius: 18px;
        overflow: hidden;
        box-shadow: 0 24px 60px rgba(14, 21, 36, .3);
    }

    .v2-ov__bar { padding: 12px 14px; }
}

/* Paliers de largeur du .container Bootstrap, repris à l'identique. */
@media (min-width: 1200px) {
    .v2,
    .v2-header__in { max-width: 1140px; }
}

@media (min-width: 1400px) {
    .v2,
    .v2-header__in { max-width: 1320px; }
}

@media (prefers-reduced-motion: reduce) {
    .v2 *,
    .v2-header *,
    .v2-nav *,
    .v2-overlay * { transition: none !important; animation: none !important; }
}

/* ══ VARIANTES DE COLONNE ═══════════════════════════════════════════
   Une page qui n'a pas de colonne latérale garde la même largeur mais
   une seule colonne. */
@media (min-width: 992px) {
    .v2--solo { grid-template-columns: minmax(0, 1fr); }
    .v2--solo .v2-main { grid-column: 1 / -1; }
}

/* Bloc qui vient se poser sur le bandeau d'en-tête, comme la carte de
   recherche du tableau de bord. Le bandeau réserve la place en dessous
   grâce à .v2-header--lift. */
.v2-lift {
    position: relative;
    z-index: 25;
    margin-top: -34px;
}

.v2-lift .v2-card,
.v2-lift .form-card,
.v2-lift .card-base { box-shadow: 0 10px 30px rgba(14, 21, 36, .12); }

.v2-header--lift { padding-bottom: 54px; }

@media (min-width: 992px) {
    .v2-header--lift { padding-bottom: 76px; }
}

/* ══ FORMULAIRES ════════════════════════════════════════════════════ */
.v2-chips { display: flex; flex-wrap: wrap; gap: 7px; }

.v2-chip {
    border: 1px solid var(--v2-line);
    background: #fff;
    color: var(--v2-ink-2);
    border-radius: 20px;
    padding: 6px 13px;
    font-size: 12.5px;
    font-weight: 700;
    text-decoration: none;
    white-space: nowrap;
    cursor: pointer;
    transition: background .15s, color .15s, border-color .15s;
}

.v2-chip:hover { background: var(--v2-surface-2); color: var(--v2-ink); }

.v2-chip.is-on {
    background: var(--v2-blue);
    border-color: var(--v2-blue);
    color: #fff;
}

.v2-fields {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 10px;
    margin-top: 12px;
}

.v2-field { min-width: 0; }

.v2-field label {
    display: block;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .6px;
    text-transform: uppercase;
    color: var(--v2-ink-3);
    margin-bottom: 4px;
}

.v2-field input,
.v2-field select {
    width: 100%;
    border: 1px solid var(--v2-line);
    background: var(--v2-surface-2);
    border-radius: 12px;
    padding: 10px 12px;
    font: inherit;
    font-size: 14px;
    color: var(--v2-ink);
    outline: none;
}

.v2-field input:focus,
.v2-field select:focus {
    border-color: var(--v2-blue);
    background: #fff;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, .12);
}

.v2-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.v2-actions .v2-btn { flex: 0 0 auto; padding: 10px 18px; }

/* ══ PAGINATION ═════════════════════════════════════════════════════ */
.v2-pager {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 11px 14px;
    background: #fbfcfe;
    border-top: 1px solid var(--v2-line);
    font-size: 12.5px;
    color: var(--v2-ink-3);
    font-weight: 600;
}

.v2-pager__links { display: flex; gap: 6px; }

.v2-pager__links a,
.v2-pager__links span {
    min-width: 32px;
    text-align: center;
    padding: 5px 9px;
    border-radius: 10px;
    border: 1px solid var(--v2-line);
    background: #fff;
    color: var(--v2-ink-2);
    text-decoration: none;
    font-weight: 700;
}

.v2-pager__links a:hover { background: var(--v2-surface-2); color: var(--v2-ink); }

.v2-pager__links .is-on {
    background: var(--v2-blue);
    border-color: var(--v2-blue);
    color: #fff;
}

/* Petits boutons d'action en bout de ligne de liste. */
.v2-row__acts { display: flex; gap: 6px; flex-shrink: 0; }

.v2-row__act {
    width: 32px;
    height: 32px;
    display: grid;
    place-items: center;
    border-radius: 10px;
    border: 1px solid var(--v2-line);
    background: #fff;
    color: var(--v2-ink-2);
    font-size: 12px;
    text-decoration: none;
}

.v2-row__act:hover { background: var(--v2-blue-soft); color: var(--v2-blue); border-color: #d7e3ff; }

/* ══ LISTES : LIGNE AVEC ACTIONS ════════════════════════════════════
   Quand une ligne porte des boutons à droite, la zone cliquable est le
   bloc « élève » et non la ligne entière. */
.v2-row__main {
    flex: 1;
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 11px;
    text-decoration: none;
    color: inherit;
}

.v2-row__main:hover { color: inherit; }

/* ══ TRI DANS L'EN-TÊTE D'UNE CARTE ═════════════════════════════════ */
.v2-sort {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
}

.v2-sort__link {
    color: var(--v2-ink-2);
    text-decoration: none;
    padding: 3px 8px;
    border-radius: 20px;
    border: 1px solid transparent;
}

.v2-sort__link:hover { color: var(--v2-ink); background: var(--v2-surface-2); }

.v2-sort__link.is-on {
    color: var(--v2-blue);
    border-color: #d7e3ff;
    background: var(--v2-blue-soft);
    font-weight: 700;
}

/* Sur petit écran, le tri passe sous le titre pour ne pas serrer l'en-tête. */
@media (max-width: 575px) {
    .v2-card__head:has(.v2-sort) {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
}

/* ══ BOUTON D'ACTION DANS LE BANDEAU D'EN-TÊTE ══════════════════════ */
/* Fonctionne indifféremment sur <a> et sur <button> : les boutons doivent
   avoir exactement la même allure d'une page à l'autre. */
.v2-header__action {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    margin-top: 12px;
    padding: 8px 14px;
    border: 0;
    border-radius: 12px;
    background: rgba(255, 255, 255, .16);
    color: #fff;
    text-decoration: none;
    font-family: inherit;
    font-size: 13px;
    font-weight: 700;
    line-height: 1.35;
    cursor: pointer;
    -webkit-appearance: none;
    appearance: none;
}

.v2-header__action:hover,
.v2-header__action:focus { color: #fff; background: rgba(255, 255, 255, .26); }

/* ── Bandeau : titre à gauche, action à droite ─────────────────────
   Variante du tableau de bord : le bouton d'action vient se caler à
   l'opposé du titre. La variante -hide-mobile le masque sous 992 px
   (la barre basse v2-nav porte déjà le raccourci concerné). */
.v2-header--side .v2-header__in {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}

.v2-header--side .v2-header__title { min-width: 0; }

.v2-header--side .v2-header__action {
    margin-top: 4px;
    margin-left: auto;
    white-space: nowrap;
    flex: 0 0 auto;
}

.v2-header--side .header-actions {
    margin-top: 4px;
    margin-left: auto;
    flex: 0 0 auto;
    justify-content: flex-end;
}

.v2-header--side .header-actions .v2-header__action { margin-left: 0; }

@media (max-width: 991.98px) {
    .v2-header--side-hide-mobile .v2-header__action { display: none; }
}

/* ══ CASE À COCHER EN FORME DE PASTILLE ═════════════════════════════ */
.v2-check {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    border: 1px solid var(--v2-line);
    background: #fff;
    border-radius: 20px;
    padding: 8px 14px;
    font-size: 12.5px;
    font-weight: 700;
    color: var(--v2-ink-2);
    cursor: pointer;
}

.v2-check:has(input:checked) {
    background: var(--v2-blue-soft);
    border-color: #d7e3ff;
    color: var(--v2-blue);
}

.v2-check input { accent-color: var(--v2-blue); }

/* Trois indicateurs côte à côte. */
.v2-duo--trio { grid-template-columns: repeat(3, 1fr); }

@media (max-width: 419px) {
    .v2-duo--trio { grid-template-columns: 1fr 1fr; }
    .v2-duo--trio > :last-child { grid-column: 1 / -1; }
}

/* ══════════════════════════════════════════════════════════════════════
   CHARGE À VENIR (accueil de l'enseignant salarié)

   Une barre par jour des 7 prochains jours : ce qui est posé au planning.
   Un jour sans séance garde une barre minimale grisée — un trou doit se
   VOIR, c'est justement l'information utile.
   ══════════════════════════════════════════════════════════════════════ */

.v2-spark {
    display: flex;
    align-items: flex-end;
    gap: 6px;
    height: 74px;
    margin-top: 14px;
}

.v2-spark__d {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    min-width: 0;
}

.v2-spark__b {
    position: relative;
    width: 100%;
    flex: 1;
    border-radius: 7px 7px 0 0;
    background: var(--v2-blue-soft);
}

.v2-spark__f {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    border-radius: 7px 7px 0 0;
    background: var(--v2-blue);
}

.v2-spark__d.is-off .v2-spark__f { background: #c9d2e3; }

.v2-spark__l {
    font-size: 11px;
    line-height: 1.25;
    text-align: center;
    color: var(--v2-ink-3);
    white-space: nowrap;
}

/* ══════════════════════════════════════════════════════════════════════
   RÉPARTITION PAR AUTO-ÉCOLE (accueil de l'enseignant indépendant)

   Une ligne par donneur d'ordre : le nom, ce qu'il rapporte, et une barre
   proportionnelle au chiffre d'affaires. Les quatre couleurs ne codent
   qu'un RANG (1er, 2e, …), pas un jugement : rien ici n'est une alerte.
   ══════════════════════════════════════════════════════════════════════ */

.v2-ae {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.v2-ae__r {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 4px 10px;
    align-items: baseline;
}

.v2-ae__n {
    font-size: 14px;
    font-weight: 700;
    color: var(--v2-ink);
}

.v2-ae__v {
    font-size: 13px;
    color: var(--v2-ink-2);
    white-space: nowrap;
}

.v2-ae__v b { color: var(--v2-ink); font-weight: 700; }

.v2-ae__bar {
    grid-column: 1 / -1;
    height: 8px;
    border-radius: 99px;
    background: var(--v2-blue-soft);
    overflow: hidden;
}

.v2-ae__bar i {
    display: block;
    height: 100%;
    border-radius: 99px;
    background: var(--v2-blue);
}

.v2-ae__r.is-2 .v2-ae__bar i { background: var(--v2-go); }
.v2-ae__r.is-3 .v2-ae__bar i { background: var(--v2-amber); }
.v2-ae__r.is-4 .v2-ae__bar i { background: var(--v2-ink-3); }

/* Ligne de pied d'une carte : un constat à gauche, une action à droite. */
.v2-proj {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 12px;
    font-size: 13px;
    color: var(--v2-ink-2);
}

.v2-proj b {
    font-size: 15px;
    font-weight: 700;
    color: var(--v2-ink);
}

/* ══════════════════════════════════════════════════════════════════════
   PONT AVEC LES PAGES DE FORMULAIRE EXISTANTES

   Les pages « ajouter un élève » et « exclusions » gardent leur markup
   (Bootstrap + classes historiques .form-card / .card-base) : seul leur
   habillage est repris ici, ce qui évite de toucher à des formulaires en
   production. Tout est scopé sous .v2-body pour ne rien changer ailleurs.
   ══════════════════════════════════════════════════════════════════════ */

/* Cartes historiques → cartes v2. */
.v2-body .form-card,
.v2-body .card-base {
    background: #fff;
    border: 1px solid var(--v2-line);
    border-radius: var(--v2-r);
    box-shadow: var(--v2-shadow);
    margin-bottom: 14px;
    overflow: hidden;
}

.v2-body .form-card-header,
.v2-body .card-base-header {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 11px 14px;
    background: #fbfcfe;
    border-bottom: 1px solid var(--v2-line);
    margin: 0;
}

.v2-body .form-card-header h5,
.v2-body .card-base-header h5 {
    margin: 0;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 1.1px;
    text-transform: uppercase;
    color: var(--v2-ink-3);
    font-family: inherit;
}

/* La pastille d'icône devient une simple icône colorée, plus discrète. */
.v2-body .form-card-header .hicon,
.v2-body .card-base-header .hicon {
    width: 26px;
    height: 26px;
    border-radius: 9px;
    display: grid;
    place-items: center;
    font-size: 11px;
    background: var(--v2-blue-soft);
    color: var(--v2-blue);
    box-shadow: none;
}

.v2-body .form-card-header .hicon.green { background: var(--v2-go-soft); color: var(--v2-go); }
.v2-body .form-card-header .hicon.red,
.v2-body .card-base-header .hicon.red { background: var(--v2-amber-soft); color: var(--v2-amber); }
.v2-body .form-card-header .hicon.slate,
.v2-body .card-base-header .hicon.slate { background: var(--v2-surface-2); color: var(--v2-ink-3); }

.v2-body .form-card-body,
.v2-body .card-base-body { padding: 14px; }

.v2-body .card-base-header .count-badge {
    margin-left: auto;
    font-size: 12px;
    font-weight: 700;
    color: var(--v2-ink-3);
    background: none;
    padding: 0;
}

/* Champs de formulaire. */
.v2-body .form-label {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .6px;
    text-transform: uppercase;
    color: var(--v2-ink-3);
    margin-bottom: 4px;
}

.v2-body .form-control,
.v2-body .form-select {
    border: 1px solid var(--v2-line);
    background: var(--v2-surface-2);
    border-radius: 12px;
    padding: 10px 12px;
    font-size: 14px;
    color: var(--v2-ink);
    box-shadow: none;
}

.v2-body .form-control:focus,
.v2-body .form-select:focus {
    border-color: var(--v2-blue);
    background: #fff;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, .12);
}

.v2-body .form-control.is-invalid,
.v2-body .form-select.is-invalid {
    border-color: var(--v2-amber);
    background: var(--v2-amber-soft);
}

.v2-body .form-text { font-size: 11.5px; color: var(--v2-ink-3); }
.v2-body .required-star { color: var(--v2-amber); }
.v2-body .form-check-input:checked { background-color: var(--v2-blue); border-color: var(--v2-blue); }
.v2-body .form-check-label { font-size: 13px; color: var(--v2-ink-2); }

.v2-body textarea.form-control { min-height: 96px; }

/* Boutons : Bootstrap et boutons maison alignés sur le bouton v2.
   `:not(.btn-sm)` est essentiel — les petits boutons vivent souvent dans un
   groupe (.btn-group), où Bootstrap pilote lui-même tailles et coins ; les
   repeindre désalignait les rangées d'icônes (historique des factures). */
.v2-body .btn-primary:not(.btn-sm),
.v2-body .btn-filter,
.v2-body .btn-exclude,
.v2-body .btn-reinstate,
.v2-body .btn-submit {
    border: 0;
    border-radius: 12px;
    padding: 11px 18px;
    font-size: 14px;
    font-weight: 700;
    background: var(--v2-blue);
    color: #fff;
    box-shadow: none;
}

.v2-body .btn-primary:not(.btn-sm):hover,
.v2-body .btn-filter:hover,
.v2-body .btn-submit:hover { background: var(--v2-blue); filter: brightness(1.06); color: #fff; }

.v2-body .btn-exclude { background: var(--v2-amber); }
.v2-body .btn-exclude:hover { background: var(--v2-amber); filter: brightness(1.06); }
.v2-body .btn-reinstate { background: var(--v2-go); }
.v2-body .btn-reinstate:hover { background: var(--v2-go); filter: brightness(1.06); }

.v2-body .btn-clear {
    border: 1px solid var(--v2-line);
    border-radius: 12px;
    padding: 10px 16px;
    font-size: 14px;
    font-weight: 700;
    background: var(--v2-surface-2);
    color: var(--v2-ink);
}

/* Bandeaux d'information / erreur / succès. */
.v2-body .alert-custom {
    display: flex;
    align-items: flex-start;
    gap: 11px;
    border-radius: 15px;
    padding: 13px 14px;
    margin-bottom: 14px;
    font-size: 13.5px;
    border: 1px solid var(--v2-line);
    background: #fff;
    color: var(--v2-ink-2);
    box-shadow: var(--v2-shadow);
}

.v2-body .alert-custom h6 { font-size: 14px; font-weight: 800; margin: 0 0 4px; }
.v2-body .alert-custom ul { margin: 0; padding-left: 18px; }

.v2-body .alert-custom.info { background: var(--v2-blue-soft); border-color: #d7e3ff; color: #24406e; }
.v2-body .alert-custom.success { background: var(--v2-go-soft); border-color: #bfe9cf; color: #14663a; }
.v2-body .alert-custom.error,
.v2-body .alert-custom.warning { background: var(--v2-amber-soft); border-color: #f3d6c6; color: #8a4a2a; }
.v2-body .alert-custom.info i, .v2-body .alert-custom.info h6 { color: var(--v2-blue); }
.v2-body .alert-custom.success i, .v2-body .alert-custom.success h6 { color: var(--v2-go); }
.v2-body .alert-custom.error i, .v2-body .alert-custom.warning i,
.v2-body .alert-custom.error h6, .v2-body .alert-custom.warning h6 { color: var(--v2-amber); }

/* Fiches d'exclusion et blocs assimilés. */
.v2-body .exclusion-card {
    border: 1px solid var(--v2-line);
    border-radius: 15px;
    padding: 13px 14px;
    background: var(--v2-surface-2);
    height: 100%;
}

.v2-body .excl-name { font-size: 15px; font-weight: 700; }
.v2-body .excl-meta { font-size: 12.5px; color: var(--v2-ink-2); }

.v2-body .motif-box {
    background: #fff;
    border: 1px solid var(--v2-line);
    border-radius: 12px;
    padding: 10px 12px;
    font-size: 13px;
    color: var(--v2-ink-2);
    margin: 9px 0;
}

.v2-body .selected-student-info {
    margin-top: 8px;
    background: var(--v2-go-soft);
    color: var(--v2-go);
    border-radius: 12px;
    padding: 8px 11px;
    font-size: 12.5px;
    font-weight: 700;
}

/* États vides des pages historiques. */
.v2-body .empty-state { padding: 26px 20px; text-align: center; color: var(--v2-ink-2); }
.v2-body .empty-state i { font-size: 30px; color: var(--v2-ink-3); opacity: .55; }
.v2-body .empty-state h5 { font-size: 16px; font-weight: 800; margin: 10px 0 4px; color: var(--v2-ink); }
.v2-body .empty-state p { font-size: 13px; margin: 0; }

/* Zone de dépôt de photo. */
.v2-body #photo-drop {
    border-radius: 14px;
    background: var(--v2-surface-2);
    border: 1px dashed var(--v2-line);
}

/* ── Bandeau : plusieurs actions côte à côte ─────────────────────── */
.v2-header .header-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 12px;
}

.v2-header .header-actions .v2-header__action { margin-top: 0; }

.v2-header .header-count {
    display: inline-grid;
    place-items: center;
    min-width: 30px;
    height: 30px;
    padding: 0 8px;
    margin-left: 8px;
    border-radius: 10px;
    background: rgba(255, 255, 255, .2);
    font-size: 15px;
    font-weight: 800;
    vertical-align: middle;
}

/* ── Bandeaux d'information des pages historiques ────────────────── */
.v2-body .feedback-alert,
.v2-body .alert-nonmaj {
    display: flex;
    align-items: center;
    gap: 11px;
    border-radius: 15px;
    padding: 13px 14px;
    margin-bottom: 14px;
    font-size: 13.5px;
    border: 1px solid var(--v2-line);
    background: #fff;
    box-shadow: var(--v2-shadow);
}

.v2-body .feedback-alert { background: var(--v2-go-soft); border-color: #bfe9cf; color: #14663a; }
.v2-body .feedback-alert i { color: var(--v2-go); }

.v2-body .alert-nonmaj { background: var(--v2-amber-soft); border-color: #f3d6c6; color: #8a4a2a; justify-content: space-between; }
.v2-body .alert-nonmaj-text { flex: 1; min-width: 0; }

.v2-body .btn-warn {
    border: 0;
    border-radius: 12px;
    padding: 9px 14px;
    font-size: 13px;
    font-weight: 700;
    background: var(--v2-amber);
    color: #fff;
    white-space: nowrap;
}

.v2-body .btn-warn .warn-badge {
    background: rgba(255, 255, 255, .28);
    border-radius: 20px;
    padding: 1px 7px;
    margin-left: 6px;
    font-size: 11px;
}

/* Un bandeau collant en bas doit passer AU-DESSUS de la barre de navigation. */
@media (max-width: 991.98px) {
    .v2-body .sticky-bordereau {
        bottom: calc(64px + env(safe-area-inset-bottom));
        border-radius: 16px 16px 0 0;
    }
}

/* Bouton flottant d'une page (nouveau message…) : tant que la barre de
   navigation est affichée, il doit se poser au-dessus d'elle, pas dessous. */
@media (max-width: 991.98px) {
    .v2-body .action-button {
        bottom: calc(78px + env(safe-area-inset-bottom));
        z-index: 29;
    }
}

/* Bouton « Enregistrer » flottant de mon_profil.php (.fab-save), présent sur
   une page sans .v2-body : même levée au-dessus de la barre basse. */
@media (max-width: 991.98px) {
    body:has(.v2-nav) .fab-save {
        bottom: calc(78px + env(safe-area-inset-bottom));
    }
}

/* Tout ce qui est ancré en bas de l'écran doit se poser AU-DESSUS de la barre
   de navigation, jamais dessus : notifications éphémères (toasts Bootstrap) et
   bandeau « Note interne » de la fiche élève. */
@media (max-width: 991.98px) {
    .v2-body .toast-container.bottom-0 {
        bottom: calc(70px + env(safe-area-inset-bottom)) !important;
    }

    .v2-body .cm-toast {
        bottom: calc(62px + env(safe-area-inset-bottom));
        /* Fermé, il doit disparaître pour de bon : la translation reprend le
           décalage, sinon il se contente de redescendre sur la barre. */
        transform: translateY(calc(100% + 62px + env(safe-area-inset-bottom)));
    }

    .v2-body .cm-toast.cm-toast--on { transform: translateY(0); }
}

/* ══════════════════════════════════════════════════════════════════════
   UNIFORMISATION DES EN-TÊTES HISTORIQUES

   La plupart des pages du www ouvrent sur un `.dash-header`. Plutôt que de
   réécrire quarante en-têtes, on leur donne ici la FORME de celui du tableau
   de bord : bandeau pleine largeur à angles droits, même graisse de titre,
   même réserve pour la carte qui vient se poser dessus.

   La COULEUR n'est pas touchée : chaque page garde la sienne (variantes
   .dash-header-green / -red / -amber…), comme demandé.
   ══════════════════════════════════════════════════════════════════════ */
.v2-body .dash-header {
    border-radius: 0;
    padding: 22px 0 62px;
    margin-bottom: 0;
}

.v2-body .dash-header h1 {
    font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 26px;
    font-weight: 800;
    letter-spacing: -.4px;
}

.v2-body .dash-header .sub {
    font-size: 13px;
    opacity: .82;
    margin-top: 2px;
}

@media (min-width: 992px) {
    .v2-body .dash-header { padding: 26px 0 76px; }
    .v2-body .dash-header h1 { font-size: 30px; }
}

/* Le contenu remonte sur le bandeau, comme la carte de recherche de l'accueil. */
.v2-body .dash-content,
.v2-body .content-wrapper {
    position: relative;
    z-index: 10;
    margin-top: -46px;
}

/* Les boutons posés dans un en-tête historique suivent le même dessin que
   ceux du tableau de bord. */
.v2-body .dash-header .btn-header,
.v2-body .dash-header .btn-outline-white {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 8px 14px;
    border: 0;
    border-radius: 12px;
    background: rgba(255, 255, 255, .16);
    color: #fff;
    text-decoration: none;
    font-family: inherit;
    font-size: 13px;
    font-weight: 700;
    line-height: 1.35;
    cursor: pointer;
    -webkit-appearance: none;
    appearance: none;
}

.v2-body .dash-header .btn-header:hover,
.v2-body .dash-header .btn-outline-white:hover { background: rgba(255, 255, 255, .26); color: #fff; }

/* ══════════════════════════════════════════════════════════════════════
   NOTIFICATIONS ÉPHÉMÈRES  (.notif-wrap > .notif-item)

   Deux pages posent ce conteneur juste après le menu et y empilent leurs
   messages « Modifications sauvegardées » : moncompte/mon_profil.php et
   moncompte/ma_comptaV2.php. Il n'avait AUCUN style : le div restait dans le
   flux, à l'endroit précis que la carte de contenu vient recouvrir
   (.content-wrapper remonte de -46px avec z-index 10). Le message existait
   bien dans le DOM, mais passait sous le formulaire — invisible.

   Il est donc ancré ici en haut de la fenêtre, sous la barre de navigation
   (sticky, z-index 1030) et sous la recherche plein écran (z-index 1080).

   .notif-item porte par ailleurs, dans main.css, le dessin des lignes de la
   page notifications.php ; tout est redéfini sous .notif-wrap pour que les
   deux usages homonymes cohabitent sans se gêner.
   ══════════════════════════════════════════════════════════════════════ */
.notif-wrap {
    position: fixed;
    top: 72px;
    right: 16px;
    left: auto;
    z-index: 1040;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 8px;
    width: min(380px, calc(100vw - 32px));
    /* Vide, il ne doit intercepter aucun clic sur la page qu'il survole. */
    pointer-events: none;
}

.notif-wrap .notif-item {
    pointer-events: auto;
    width: 100%;
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 14px;
    border: 1px solid var(--v2-line, #e6eaf2);
    border-left: 4px solid var(--v2-ink-3, #8b93a7);
    border-bottom: none;
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 10px 30px rgba(14, 21, 36, .16);
    color: var(--v2-ink, #0e1524);
    font-size: 14px;
    line-height: 1.35;
    animation: notifIn .22s cubic-bezier(.22, 1, .36, 1);
}

/* Les états de main.css visent la liste de notifications, pas ces toasts. */
.notif-wrap .notif-item:hover {
    background: #fff;
}

.notif-wrap .notif-item.unread::after {
    content: none;
}

.notif-wrap .notif-item i {
    font-size: 15px;
    margin-top: 1px;
    flex: 0 0 auto;
}

.notif-wrap .notif-item.success {
    border-left-color: var(--v2-go, #15a34a);
}

.notif-wrap .notif-item.success i {
    color: var(--v2-go, #15a34a);
}

.notif-wrap .notif-item.warning {
    border-left-color: #c2410c;
}

.notif-wrap .notif-item.warning i {
    color: #c2410c;
}

.notif-wrap .notif-item.danger {
    border-left-color: #dc2626;
}

.notif-wrap .notif-item.danger i {
    color: #dc2626;
}

@keyframes notifIn {
    from {
        opacity: 0;
        transform: translateX(16px);
    }

    to {
        opacity: 1;
        transform: none;
    }
}

@media (prefers-reduced-motion: reduce) {
    .notif-wrap .notif-item {
        animation: none;
    }
}

/* Sur mobile la barre du haut est plus courte et la colonne pleine largeur :
   le message se cale d'un bord à l'autre, toujours au-dessus du contenu. */
@media (max-width: 575.98px) {
    .notif-wrap {
        top: 66px;
        right: 12px;
        left: 12px;
        width: auto;
        align-items: stretch;
    }
}
