/*
 * Feuille commune des formulaires : gabarit « saisir » du modèle unique du SGA (lot 2 du plan de conformité du 12/11/2026,
 * approuvé le 14/11/2026). Page de référence : demo_modele-sga-reference_2026-11-12.html (fenêtre à bandeau, blocs teintés,
 * champs de 46 px, pied).
 *
 * UN SEUL ENDROIT pour toutes les fiches et fenêtres de la gestion ET de la console : aucun formulaire n'est retouché un par un.
 * Posée par `App\Support\Design\FeuilleFormulairesModele` (render hook STYLES_AFTER des deux panneaux), APRÈS le thème, le cadre
 * et leurs jetons.
 *
 * RETOUR EN ARRIÈRE : retirer cette feuille (réglage IDEXA_FORMULAIRES_MODELE=false, ou la ligne des deux fournisseurs de
 * panneau) rend l'aspect d'avant, octet pour octet : rien d'autre ne dépend d'elle. La première tranche du 12/11 (bandeau,
 * croix et pied des fenêtres de la gestion) reste dans `cadre-gestion.css`.
 *
 * Règles : couleurs par jetons de l'établissement seulement (R-005 : aucun filet de couleur, fonds teintés), mobile d'abord
 * (une colonne, cibles de 44 à 46 px, champs à 16 px pour que iOS ne zoome pas), rien sous 13 px, clair et sombre par les jetons.
 *
 * Préfixe des classes maison : aucune ; on ne cible que des classes natives de Filament et les fenêtres propres aux pages.
 */

/* ---- Jetons de la feuille : tous dérivés des jetons de l'établissement, avec repli sobre ---------------------------- */
.fi-body {
    --fm-accent: var(--idexa-accent, var(--accent, #334155));
    --fm-accent-fg: var(--idexa-accent-contraste, var(--accent-fg, #ffffff));
    --fm-surface: var(--idexa-surface, var(--panel, #ffffff));
    --fm-douce: var(--idexa-surface-douce, var(--wash, #f4f6f9));
    --fm-texte: var(--idexa-texte, var(--ink, #111827));
    --fm-doux: var(--idexa-texte-doux-fort, var(--soft, #4b5563));
    --fm-trait: var(--idexa-trait, var(--line, #d9dee5));
    --fm-champ: var(--idexa-trait-champ, var(--mute, #566275));
    --fm-danger: var(--idexa-danger-texte, var(--late, #b3261e));
    --fm-bloc: color-mix(in srgb, var(--fm-accent) 5%, var(--fm-douce));
    --fm-rayon-bloc: 14px;
    --fm-rayon-champ: 10px;
    --fm-champ-h: 46px;
}

/* La console n'a pas d'établissement : son bandeau prend le rail de sa charte (jamais l'orange de sa marque, illisible en aplat). */
.fi-panel-admin {
    --fm-accent: var(--idexa-accent, var(--rail, #243049));
    --fm-accent-fg: var(--idexa-accent-contraste, #ffffff);
}

/* =================================================================================================================
   1. Les sections : des blocs teintés, sans filet ni anneau
   ================================================================================================================= */
:root:root .fi-body .fi-section {
    --tw-ring-shadow: 0 0 #0000;
    --tw-ring-color: transparent;
    border: 0;
}

/* Dans une fenêtre et dans un panneau latéral : le bloc est la section même (fond teinté, coins arrondis). */
:root:root .fi-body .fi-modal-window .fi-section:not(.fi-section-not-contained) {
    border-radius: var(--fm-rayon-bloc);
    background-color: var(--fm-bloc);
    box-shadow: none;
}

/* Sur une page (fiche longue) : la carte reste blanche et arrondie du cadre ; son contenu devient le bloc teinté. */
:root:root .fi-body .fi-main .fi-section:not(.fi-section-not-contained) > .fi-section-content-ctn {
    margin: 0 12px 12px;
    border-top: 0;
    border-radius: var(--fm-rayon-bloc);
    background-color: var(--fm-bloc);
}

/* Une fenêtre ouverte depuis une page n'est pas une carte de page : le bloc y est la section, pas son contenu. */
:root:root .fi-body .fi-modal-window .fi-section:not(.fi-section-not-contained) > .fi-section-content-ctn {
    margin: 0;
    border-radius: 0;
    background-color: transparent;
}

/* Un bloc dans un bloc (et les éléments d'un répéteur) : blanc sur le fond teinté, pour que l'emboîtement se lise. */
:root:root .fi-body .fi-section:not(.fi-section-not-contained) .fi-section:not(.fi-section-not-contained),
:root:root .fi-body .fi-modal-window .fi-section:not(.fi-section-not-contained) .fi-section:not(.fi-section-not-contained),
:root:root .fi-body .fi-fo-repeater-item {
    border-radius: var(--fm-rayon-bloc);
    background-color: var(--fm-surface);
    box-shadow: none;
}

:root:root .fi-body .fi-main .fi-section:not(.fi-section-not-contained) .fi-section:not(.fi-section-not-contained) > .fi-section-content-ctn,
:root:root .fi-body .fi-modal-window .fi-section:not(.fi-section-not-contained) .fi-section:not(.fi-section-not-contained) > .fi-section-content-ctn {
    margin: 0;
    border-radius: 0;
    background-color: transparent;
}

:root:root .fi-body .fi-section:not(.fi-section-not-contained) .fi-section-content-ctn {
    border-top: 0;
}

:root:root .fi-body .fi-section:not(.fi-section-not-contained) .fi-section-content {
    padding: 14px;
}

:root:root .fi-body .fi-section:not(.fi-section-not-contained) .fi-section-header {
    padding: 14px 14px 4px;
}

:root:root .fi-body .fi-main .fi-section:not(.fi-section-not-contained) > .fi-section-header {
    padding: 14px 14px 10px;
}

:root:root .fi-body .fi-section-header-heading {
    color: var(--fm-accent);
    font-size: 16px;
    font-weight: 700;
    overflow-wrap: anywhere;
}

:root:root .fi-body .fi-section-header-description {
    margin-top: 2px;
    color: var(--fm-doux);
    font-size: 14px;
}

/* Un bloc se replie du bout du doigt : toute la barre du titre est une cible de 44 px. */
:root:root .fi-body .fi-section-header .fi-icon-btn {
    min-width: 44px;
    min-height: 44px;
}

/* De l'air régulier entre les champs d'un bloc ou d'une fenêtre (la grille de Filament en met 24 px, trop pour un téléphone). */
:root:root .fi-body .fi-section-content .fi-grid,
:root:root .fi-body .fi-modal-content .fi-grid,
:root:root .fi-body .fi-sc-form .fi-grid {
    gap: 14px;
}

/* =================================================================================================================
   2. Les champs : 46 px de haut, coins de 10 px, contour fin et lisible
   ================================================================================================================= */
:root:root .fi-body .fi-fo-field .fi-input-wrp,
:root:root .fi-body .fi-modal-window .fi-input-wrp {
    min-height: var(--fm-champ-h);
    border-radius: var(--fm-rayon-champ);
    background-color: var(--fm-surface);
}

:root:root .fi-body .fi-fo-field .fi-input,
:root:root .fi-body .fi-fo-field .fi-select-input,
:root:root .fi-body .fi-modal-window .fi-input,
:root:root .fi-body .fi-modal-window .fi-select-input {
    min-height: calc(var(--fm-champ-h) - 2px);
    /* 16 px : en dessous, iOS zoome la page à la prise de focus d'un champ. */
    font-size: 16px;
    color: var(--fm-texte);
}

:root:root .fi-body .fi-fo-field .fi-fo-textarea textarea,
:root:root .fi-body .fi-modal-window .fi-fo-textarea textarea {
    min-height: 96px;
    font-size: 16px;
    color: var(--fm-texte);
}

/* Le champ actif : anneau fin aux couleurs de l'établissement (le champ reste blanc sur le fond teinté du bloc). */
:root:root .fi-body .fi-fo-field .fi-input-wrp:focus-within {
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--fm-accent) 30%, transparent);
}

/* Les cases et les boutons radio : le libellé entier se touche (44 px). */
:root:root .fi-body .fi-fo-checkbox-list-option-label,
:root:root .fi-body .fi-fo-radio-label,
:root:root .fi-body .fi-fo-toggle-buttons-btn-ctn {
    min-height: 44px;
    align-items: center;
}

/* =================================================================================================================
   3. Libellés, aides et erreurs
   ================================================================================================================= */
:root:root .fi-body .fi-fo-field-label-content {
    color: var(--fm-texte);
    font-size: 15px;
    font-weight: 650;
}

:root:root .fi-body .fi-fo-field-label-required-mark {
    color: var(--fm-danger);
}

:root:root .fi-body .fi-fo-field-content-ctn .fi-sc-text {
    color: var(--fm-doux);
    font-size: 14px;
}

:root:root .fi-body .fi-fo-field-wrp-error-message {
    color: var(--fm-danger);
    font-size: 14px;
    font-weight: 500;
}

/* Dans une fenêtre ou sur téléphone, le libellé est AU-DESSUS du champ, jamais à sa gauche. */
:root:root .fi-body .fi-modal-window .fi-fo-field.fi-fo-field-has-inline-label,
:root:root .fi-body .fi-modal-window .fi-fo-field-has-inline-label {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 6px;
}

/* =================================================================================================================
   4. Les fenêtres de saisie : bandeau (console), corps, pied, feuille basse sur téléphone
   ================================================================================================================= */
/* Le bandeau de la gestion est posé par `cadre-gestion.css` (12/11) ; la console le reçoit ici, avec les mêmes mesures. */
.fi-panel-admin.fi-body .fi-modal-window:not(.fi-align-center) {
    border-radius: 18px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgb(16 30 60 / 18%);
}

.fi-panel-admin.fi-body .fi-modal-window:not(.fi-align-center) > .fi-modal-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 0;
    padding: 16px 64px 16px 20px;
    background: var(--fm-accent);
    color: var(--fm-accent-fg);
}

.fi-panel-admin.fi-body .fi-modal-window:not(.fi-align-center) > .fi-modal-header .fi-modal-heading {
    margin: 0;
    font-size: 20px;
    font-weight: 700;
    color: inherit;
    overflow-wrap: anywhere;
}

.fi-panel-admin.fi-body .fi-modal-window:not(.fi-align-center) > .fi-modal-header .fi-modal-description {
    margin: 2px 0 0;
    font-size: 14px;
    color: inherit;
    opacity: 0.85;
}

.fi-panel-admin.fi-body .fi-modal-window:not(.fi-align-center) > .fi-modal-header .fi-modal-close-btn {
    top: 10px;
    right: 12px;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: rgb(255 255 255 / 16%);
    color: inherit;
}

.fi-panel-admin.fi-body .fi-modal-window:not(.fi-align-center) > .fi-modal-header .fi-modal-close-btn svg {
    color: inherit;
}

.fi-panel-admin.fi-body .fi-modal-window:not(.fi-align-center) > .fi-modal-content {
    padding: 18px 20px;
}

/* Le contenu défile, le pied (Enregistrer, Annuler) reste toujours visible. */
:root:root .fi-body .fi-modal:not(.fi-modal-slide-over) .fi-modal-window {
    display: flex;
    flex-direction: column;
    max-height: calc(100dvh - 32px);
}

:root:root .fi-body .fi-modal:not(.fi-modal-slide-over) .fi-modal-window > .fi-modal-content {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
}

:root:root .fi-body .fi-modal-window > .fi-modal-footer {
    flex: none;
    background-color: var(--fm-surface);
}

:root:root .fi-body .fi-modal-footer-actions {
    flex-wrap: wrap;
    gap: 10px;
}

:root:root .fi-body .fi-modal-footer-actions .fi-btn {
    min-height: var(--fm-champ-h);
    border-radius: var(--fm-rayon-champ);
}

/* Téléphone : la fenêtre monte du bas, pleine largeur ; les boutons du pied s'empilent, l'action principale en premier. */
@media (max-width: 639.98px) {
    :root:root .fi-body .fi-modal:not(.fi-modal-slide-over) .fi-modal-window-ctn {
        align-items: end;
        grid-template-rows: 1fr;
        padding: 0;
    }

    :root:root .fi-body .fi-modal:not(.fi-modal-slide-over) .fi-modal-window {
        width: 100%;
        max-width: none;
        max-height: 92dvh;
        margin: 0;
        border-radius: 18px 18px 0 0;
        padding-bottom: env(safe-area-inset-bottom, 0px);
    }

    :root:root .fi-body .fi-modal-footer-actions {
        flex-direction: column-reverse;
        align-items: stretch;
    }

    :root:root .fi-body .fi-modal-footer-actions .fi-btn {
        justify-content: center;
        width: 100%;
    }

    /* Une colonne partout : toute grille d'un formulaire retombe à une colonne. */
    :root:root .fi-body .fi-modal form .fi-grid,
    :root:root .fi-body .fi-sc-form .fi-grid {
        grid-template-columns: minmax(0, 1fr) !important;
    }

    :root:root .fi-body .fi-modal form .fi-grid > .fi-grid-col,
    :root:root .fi-body .fi-sc-form .fi-grid > .fi-grid-col {
        grid-column: 1 / -1 !important;
    }

    :root:root .fi-body .fi-fo-field.fi-fo-field-has-inline-label,
    :root:root .fi-body .fi-fo-field-has-inline-label {
        display: grid;
        grid-template-columns: minmax(0, 1fr);
        gap: 6px;
    }
}

/* Écran large : des blocs un peu plus aérés. */
@media (min-width: 640px) {
    :root:root .fi-body .fi-section:not(.fi-section-not-contained) .fi-section-content {
        padding: 16px;
    }

    :root:root .fi-body .fi-section:not(.fi-section-not-contained) .fi-section-header {
        padding: 16px 16px 4px;
    }

    :root:root .fi-body .fi-main .fi-section:not(.fi-section-not-contained) > .fi-section-header {
        padding: 16px 16px 12px;
    }

    :root:root .fi-body .fi-main .fi-section:not(.fi-section-not-contained) > .fi-section-content-ctn {
        margin: 0 16px 16px;
    }
}

/* =================================================================================================================
   5. Assistants (Wizard) : barre d'étapes compacte et plate, sur une ligne, sans défilement
   Un petit numéro rond et le libellé court ; l'étape active a un fond teinté et un numéro plein, les étapes faites une coche,
   les étapes à venir sont grises. Ni chevron, ni pilule, ni filet de couleur (R-005). Le texte d'aide de l'étape (formulaires
   du lot 3) se lit au-dessus des champs, pas dans l'onglet.
   ================================================================================================================= */
:root:root .fi-body .fi-sc-wizard-header {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: minmax(0, 1fr);
    gap: 4px;
    margin: 0 0 14px;
    padding: 4px;
    border: 0;
    border-radius: 12px;
    background-color: color-mix(in srgb, var(--fm-accent) 6%, var(--fm-douce));
    box-shadow: none;
    --tw-ring-shadow: 0 0 #0000;
    overflow: visible;
}

:root:root .fi-body .fi-sc-wizard-header-step {
    display: flex;
    min-width: 0;
    border-radius: 9px;
}

:root:root .fi-body .fi-sc-wizard-header-step-separator {
    display: none;
}

:root:root .fi-body .fi-sc-wizard-header-step-btn {
    width: 100%;
    min-width: 0;
    min-height: 44px;
    padding: 6px 10px;
    gap: 8px;
    border-radius: 9px;
}

:root:root .fi-body .fi-sc-wizard-header-step.fi-active {
    background-color: color-mix(in srgb, var(--fm-accent) 12%, var(--fm-surface));
}

/* Le numéro rond : 26 px. À venir : gris. Actif : plein. Fait : coche sur fond teinté. */
:root:root .fi-body .fi-sc-wizard-header-step-icon-ctn {
    width: 26px;
    height: 26px;
    flex: none;
    border: 0;
    border-radius: 50%;
    background-color: color-mix(in srgb, currentColor 10%, transparent);
}

:root:root .fi-body .fi-sc-wizard-header-step:not(.fi-completed) .fi-sc-wizard-header-step-icon-ctn {
    border-width: 0;
}

:root:root .fi-body .fi-sc-wizard-header-step-number {
    font-size: 13px;
    font-weight: 700;
    line-height: 1;
    color: var(--fm-doux);
}

:root:root .fi-body .fi-sc-wizard-header-step-icon-ctn .fi-icon {
    width: 14px;
    height: 14px;
    color: var(--fm-doux);
}

:root:root .fi-body .fi-sc-wizard-header-step.fi-active .fi-sc-wizard-header-step-icon-ctn {
    background-color: var(--fm-accent);
}

:root:root .fi-body .fi-sc-wizard-header-step.fi-active .fi-sc-wizard-header-step-number,
:root:root .fi-body .fi-sc-wizard-header-step.fi-active .fi-sc-wizard-header-step-icon-ctn .fi-icon {
    color: var(--fm-accent-fg);
}

:root:root .fi-body .fi-sc-wizard-header-step.fi-completed .fi-sc-wizard-header-step-icon-ctn {
    background-color: color-mix(in srgb, var(--fm-accent) 18%, transparent);
}

:root:root .fi-body .fi-sc-wizard-header-step.fi-completed .fi-sc-wizard-header-step-icon-ctn .fi-icon {
    color: var(--fm-accent);
}

/* Le libellé court : il passe à la ligne plutôt que de déborder. */
:root:root .fi-body .fi-sc-wizard-header-step-text {
    width: auto;
    min-width: 0;
    max-width: none;
}

:root:root .fi-body .fi-sc-wizard-header-step-label {
    font-size: 14px;
    font-weight: 500;
    line-height: 1.2;
    color: var(--fm-doux);
    overflow-wrap: anywhere;
}

:root:root .fi-body .fi-sc-wizard-header-step.fi-active .fi-sc-wizard-header-step-label {
    font-weight: 700;
    color: var(--fm-texte);
}

:root:root .fi-body .fi-sc-wizard-header-step.fi-completed .fi-sc-wizard-header-step-label {
    color: var(--fm-texte);
}

/* La description de l'étape sort de l'onglet quand le formulaire la reprend au-dessus des champs (`.sga-etapes`). */
:root:root .fi-body .sga-etapes .fi-sc-wizard-header-step-description {
    display: none;
}

:root:root .fi-body .fi-sc-wizard-header-step-description {
    font-size: 13px;
    line-height: 1.3;
}

:root:root .fi-body .sga-etape-aide {
    margin: 0;
    font-size: 14px;
    line-height: 1.4;
    color: var(--fm-doux);
}

/* Téléphone : seulement les numéros, avec le libellé de l'étape active. */
@media (max-width: 639.98px) {
    :root:root .fi-body .fi-sc-wizard-header {
        display: flex;
    }

    :root:root .fi-body .fi-sc-wizard-header-step:not(.fi-active) {
        display: flex;
        flex: 0 0 auto;
    }

    :root:root .fi-body .fi-sc-wizard-header-step.fi-active {
        flex: 1 1 auto;
    }

    :root:root .fi-body .fi-sc-wizard-header-step:not(.fi-active) .fi-sc-wizard-header-step-btn {
        padding: 6px;
    }

    :root:root .fi-body .fi-sc-wizard-header-step:not(.fi-active) .fi-sc-wizard-header-step-text {
        position: absolute;
        width: 1px;
        height: 1px;
        overflow: hidden;
        clip-path: inset(50%);
        white-space: nowrap;
    }
}

/* Le résumé « Votre saisie » des formulaires en étapes (lot 3) : une ligne « libellé : valeur » par réponse. */
:root:root .fi-body .sga-resume-etapes-lignes {
    display: grid;
    gap: 0;
}

:root:root .fi-body .sga-resume-etapes-ligne {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 8px 0;
    border-top: 1px solid color-mix(in srgb, currentColor 18%, transparent);
    font-size: 14px;
}

:root:root .fi-body .sga-resume-etapes-libelle {
    opacity: 0.7;
}

:root:root .fi-body .sga-resume-etapes-valeur {
    text-align: right;
    word-break: break-word;
}

:root:root .fi-body .sga-resume-etapes-vide {
    font-weight: 500;
    opacity: 0.55;
}

/* Le pied d'un assistant (lot 3, formulaires en étapes) : Filament remplace le pied de la fenêtre (`.fi-modal-footer`) par
   celui de l'assistant (`.fi-sc-wizard-footer`). Il reçoit donc les mêmes règles que le pied des fenêtres de saisie. */
:root:root .fi-body .fi-sc-wizard-footer {
    flex-wrap: wrap;
    gap: 10px;
}

:root:root .fi-body .fi-sc-wizard-footer .fi-btn {
    min-height: var(--fm-champ-h);
    border-radius: var(--fm-rayon-champ);
}

@media (max-width: 639.98px) {
    :root:root .fi-body .fi-sc-wizard-footer {
        flex-direction: column-reverse;
        align-items: stretch;
    }

    :root:root .fi-body .fi-sc-wizard-footer .fi-btn {
        justify-content: center;
        width: 100%;
    }
}

/* =================================================================================================================
   6. Fenêtres propres aux pages : même bandeau, mêmes coins, même pied que les fenêtres de saisie
   ================================================================================================================= */
/* « À quoi sert cette page ? » des espaces en cartes, et l'aide de page hors du gabarit liste et fiche. */
.fi-body .idc-modale:has(> .idc-modale-titre),
.fi-body .fl-modale:has(> .fl-modale-titre) {
    border-radius: 18px;
    overflow: hidden auto;
}

.fi-body .idc-modale > .idc-modale-titre,
.fi-body .fl-modale > .fl-modale-titre {
    margin: -23px -23px 16px;
    padding: 16px 64px 16px 20px;
    background: var(--fm-accent);
    color: var(--fm-accent-fg);
    font-size: 20px;
    font-weight: 700;
    overflow-wrap: anywhere;
}

.fi-body .idc-modale:has(> .idc-modale-titre) > .idc-modale-fermer,
.fi-body .fl-modale:has(> .fl-modale-titre) > .fl-modale-fermer {
    top: 8px;
    right: 10px;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: rgb(255 255 255 / 16%);
    color: var(--fm-accent-fg);
    font-size: 22px;
    line-height: 1;
}

.fi-body .idc-modale-note {
    border-radius: var(--fm-rayon-bloc);
    background-color: var(--fm-bloc);
}

/* Les guides pas à pas (fenêtres des procédures) : bandeau de l'établissement. */
.fi-body .idexa-guide__fenetre {
    overflow: hidden;
    border-radius: 18px;
}

.fi-body .idexa-guide__entete {
    background: var(--fm-accent);
    color: var(--fm-accent-fg);
}

.fi-body .idexa-guide__entete .idexa-guide__titre,
.fi-body .idexa-guide__entete .idexa-guide__objectif,
.fi-body .idexa-guide__entete .idexa-guide__fermer {
    color: inherit;
}

.fi-body .idexa-guide__entete .idexa-guide__fermer {
    min-width: 44px;
    min-height: 44px;
    border-radius: 50%;
    background: rgb(255 255 255 / 16%);
}

/* Les blocs d'information posés par les pages dans une fenêtre (dossier, aperçu de message) suivent le même fond teinté. */
.fi-body .fi-modal-window .fiche-modale-info,
.fi-body .fi-modal-window .fiche-modale-apercu {
    border-radius: var(--fm-rayon-bloc);
    background-color: var(--fm-bloc);
    box-shadow: none;
}

/* Le mouvement réduit est respecté : aucune transition propre à cette feuille. */
@media (prefers-reduced-motion: reduce) {
    :root:root .fi-body .fi-fo-field .fi-input-wrp {
        transition: none;
    }
}

/* Aperçu du PDF de l'avis de soutenance (sous « Votre saisie ») : une vignette au format lettre (8,5 x 11 po), à fond blanc. */
:root:root .fi-body .sga-apercu-avis-fond {
    background: var(--fm-surface);
    border-radius: 6px;
    overflow: hidden;
    box-shadow: 0 1px 3px color-mix(in srgb, currentColor 22%, transparent);
}

:root:root .fi-body .sga-apercu-avis-cadre {
    display: block;
    width: 100%;
    aspect-ratio: 8.5 / 11;
    border: 0;
    background: var(--fm-surface);
}

:root:root .fi-body .sga-apercu-avis-grand .sga-apercu-avis-cadre {
    aspect-ratio: auto;
    height: 72vh;
}

/* 21/11/2026 – dans la colonne de droite, le cadre de l'avis a la forme de celui du rapport de soutenance (écrans harmonisés). */
:root:root .fi-body .sga-apercu-avis-colonne .sga-apercu-avis-fond { background: var(--gray-100, #eef1f5); border-radius: 0.75rem; padding: 0.5rem; box-shadow: none; }
:root:root .fi-body .sga-apercu-avis-colonne .sga-apercu-avis-cadre { aspect-ratio: 8.5 / 11.15; height: auto; border-radius: 0.4rem; background: var(--fm-surface); }

/* Les logos partenaires : une case par logo, avec sa vignette et le nom du partenaire. */
:root:root .fi-body .sga-logo-option {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
}

:root:root .fi-body .sga-logo-vignette {
    width: 48px;
    height: 32px;
    object-fit: contain;
    background: var(--fm-surface);
    border-radius: 4px;
}

/* La bibliothèque des logos, dans « Réglages › Avis de soutenance ». */
:root:root .fi-body .sga-logos-liste {
    display: grid;
    gap: 8px;
    margin: 0;
    padding: 0;
    list-style: none;
}

:root:root .fi-body .sga-logos-ligne {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: 8px;
    background: color-mix(in srgb, currentColor 5%, transparent);
}

:root:root .fi-body .sga-logos-ligne img {
    width: 72px;
    height: 48px;
    object-fit: contain;
    background: var(--fm-surface);
    border-radius: 4px;
}

:root:root .fi-body .sga-logos-texte {
    flex: 1 1 200px;
    display: grid;
    gap: 2px;
    font-size: 14px;
    min-width: 0;
}

:root:root .fi-body .sga-logos-texte span {
    opacity: 0.7;
    word-break: break-word;
}

:root:root .fi-body .sga-logos-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

/* 20/11/2026 – avis de soutenance : le grand aperçu à droite du formulaire reste visible pendant le défilement. */
@media (min-width: 1024px) {
    :root:root .fi-body .sga-colonne-apercu { position: sticky; top: 0; align-self: start; }

}

/* 21/11/2026 – LA BANDE BLANCHE. La fenêtre (`overflow: hidden`) gardait 400 px environ de contenu caché qu'un geste du
   navigateur (ouvrir la liste « Gabarit » en bas, passer d'un champ à l'autre) faisait défiler : l'en-tête bleu partait
   en haut et une bande vide restait en bas. `clip` coupe pareil mais interdit tout défilement de la fenêtre ; seul le
   corps du formulaire défile. */
:root:root .fi-body .fi-modal-window:has(.sga-colonne-apercu) { overflow: clip; }

/* 21/11/2026 – les listes dont le détail s'édite dans une fenêtre (jury du rapport et de l'avis de soutenance) : les champs
   sont cachés, la zone de contenu de chaque ligne restait donc vide sous le nom ; le libellé était tronqué (« Directeur … »).
   Une ligne par élément, libellé complet sur plusieurs lignes au besoin. */
:root:root .fi-body .sga-liste-fenetre .fi-fo-repeater-item-content { display: none; }
:root:root .fi-body .sga-liste-fenetre .fi-fo-repeater-item-header-label { white-space: normal; overflow: visible; text-overflow: clip; }
