/* =========================================================================
   BIOPOINT - SYSTEME DE DESIGN (biopoint.css)
   =========================================================================
   Feuille de style AUTONOME. L'application ne depend d'aucun CDN.

   POURQUOI PAS BOOTSTRAP
   ----------------------
   Les reseaux d'entreprise du commerce et de la grande distribution filtrent
   frequemment les CDN publics. Une interface qui s'effondre parce que
   cdn.jsdelivr.net est injoignable est inexploitable sur site. Par ailleurs un
   CDN voit passer l'adresse IP de chaque salarie qui ouvre son planning : c'est
   une donnee personnelle transmise a un tiers sans necessite.

   Cette feuille couvre exactement ce dont l'application se sert, en 1/8 du poids
   de Bootstrap, et garantit un rendu identique partout, y compris hors ligne.

   ORGANISATION
   ------------
     1. Jetons de conception       5. Composants
     2. Reinitialisation           6. Mise en page applicative
     3. Typographie                7. Accessibilite et preferences
     4. Grille et utilitaires

   MOBILE D'ABORD : les regles de base visent le telephone ; les points de rupture
   n'ajoutent que ce qu'un ecran plus large permet. Un salarie consulte son
   planning sur son telephone, jamais sur un poste fixe.

   LE SOCLE EN UNE PAGE
   --------------------
   Toute valeur vient d'un jeton de la section 1 : couleur, taille de texte,
   espacement, rayon, ombre, duree. Aucune valeur en dur dans un gabarit.
     Couleur     Le site est neutre. L'ACCENT (--bp-primary, --bp-primary-soft) ne
                 sert qu'a l'action principale, aux liens, au focus et a la ligne
                 ouverte du menu. Les couleurs de sens disent un etat, avec une
                 icone ou un mot ; le texte, lui, reste neutre.
     Texte       --bp-fs-h1, -h2, -h3, -body, -ui, -small, -micro, -chiffre ;
                 graisses 400, 500, 600, 700. Chiffres tabulaires : .bp-chiffres.
     Espacement  --bp-1 (4) -2 (8) -2h (12) -3 (16) -4 (24) -4h (32) -5 (48) -6 (64).
     Mouvement   --bp-duree-1/2/3 et --bp-courbe ; transform et opacity seulement ;
                 rien ne boucle, sauf un indicateur tant qu'il charge.
     Toucher     44 px au moins (--bp-tap) ; un element de 36 px etend sa zone.

   LES COMPOSANTS, et leurs etats (repos, survol, focus, appui, desactive...)
     Bouton      .btn + .btn-primary | .btn-outline-secondary | .btn-link |
                 .btn-danger, .btn-outline-danger ; .btn-sm, .btn-lg ; .is-loading
     Champ       .form-label, .form-control, .form-select, .form-text ;
                 .is-invalid ou aria-invalid + .invalid-feedback ; .form-check ;
                 .form-switch ; resume d'erreurs en tete de formulaire : .bp-erreurs
     Carte       .glass-panel ; chiffre cle : .kpi-title + .kpi-value
     Tableau     .table dans .table-wrap ; .table-cartes (fiches au telephone) ;
                 .table-hover ; .nombre ; .table-collante ; tr.total
     Pastille    .badge + .bg-dark | .bg-success | .bg-warning | .bg-danger |
                 .bg-info | .bg-primary ; statut d'une ligne : .esp-statut
     Bandeau     .alert + .alert-info | -success | -warning | -danger ; .btn-close
     Fenetre     .modal > .modal-dialog > .modal-content (feuille du bas au telephone)
     Onglets     .bp-onglets > .bp-onglet ; filtre segmente : .bp-segments > .bp-segment
     Liste       .bp-liste > .bp-liste-ligne ; ligne depliable : .esp-lignes
     Vide        .bp-vide (une icone, un constat, une phrase, une action au plus)
     Attente     .bp-squelette (blocs a la taille du contenu) ; .spinner-border
     Message     .bp-toasts > .bp-toast (ephemere ; biopoint.js : BioPoint.annoncer)
     Navigation  .sidebar, .nav-link-custom, .esp-rub, .esp-page, .esp-plus,
                 .bp-topbar, .bp-tabbar ; lien d'evitement : .bp-evitement ;
                 la marque en tete du menu : .esp-tete (_marque_espace.html)
   ========================================================================= */

/* =========================================================================
   1. JETONS DE CONCEPTION
   ========================================================================= */
:root {
    /* --- Fonds, du plus profond au plus clair. Des neutres a peine teintes du
           bleu-violet du sigle. --bp-bg est aussi la couleur de theme declaree par
           les gabarits (meta theme-color) : les deux valeurs restent egales, sinon
           un lisere apparait sous la barre d'etat de l'iPhone. --- */
    --bp-bg:            #09090b;
    --bp-surface:       #111115;                  /* cartes, barre laterale, modales */
    --bp-surface-2:     #18181d;                  /* survol de ligne, zone secondaire */
    --bp-surface-3:     #1f1f25;                  /* element actif, menus, messages ephemeres */
    --bp-glass:         rgba(17, 17, 21, 0.86);   /* barre du haut et barre du bas seulement */
    --bp-overlay:       rgba(5, 5, 8, 0.72);      /* voile sous une modale ou le tiroir */

    /* --- Bordures. Les deux premieres sont decoratives ; la troisieme entoure ce
           qui se saisit ou se coche : 3:1 au moins sur chaque fond (WCAG 1.4.11),
           3,87 sur --bp-surface, 4,09 sur --bp-bg. --- */
    --bp-border:         #26262e;
    --bp-border-strong:  #383843;
    --bp-border-control: #707080;

    /* --- Texte. Contraste calcule sur --bp-surface (AA a partir de 4,5:1) :
           principal 17,0:1, secondaire 10,8:1, discret 6,6:1. Le quatrieme (3,75:1)
           ne porte jamais une information : texte desactive, chevrons. --- */
    --bp-text:          #f3f3f6;
    --bp-text-2:        #c3c3cd;
    --bp-text-3:        #9898a6;
    --bp-text-4:        #6e6e7c;

    /* --- L'accent : UN seul, pris au milieu du sigle. Il ne sert qu'a l'action
           principale, aux liens, au focus et a l'element actif de la navigation.
           Blanc sur --bp-primary : 5,29:1 ; sur --bp-primary-hover : 6,34:1 ;
           --bp-primary-soft sur --bp-surface : 8,5:1. --- */
    --bp-primary:       #1257d6;
    --bp-primary-hover: #0f49b5;
    --bp-primary-soft:  #8fb5ff;
    --bp-primary-glow:  rgba(18, 87, 214, 0.16);  /* fond de l'element selectionne */
    --bp-focus:         var(--bp-primary-soft);

    /* --- La finition des espaces. Le titre de page, le fond du menu, sa ligne
           ouverte, le bouton secondaire et l'ombre de la barre du telephone ont
           leur jeton. Ici, chacun reprend un jeton du site ; la tenue claire les
           habille en bleu et blanc (en bas de la feuille), sans toucher aux
           composants. --- */
    --bp-titre:         var(--bp-text);           /* titre de page */
    --bp-menu-fond:     var(--bp-surface);        /* barre laterale */
    --bp-actif-texte:   var(--bp-text);           /* ligne ouverte du menu : son texte, */
    --bp-actif-fond:    var(--bp-surface-3);      /* son fond */
    --bp-actif-trait:   var(--bp-primary-soft);   /* et son repere de 2 px */
    --bp-second-fond:   var(--bp-surface-2);      /* bouton secondaire : son fond, */
    --bp-second-survol: var(--bp-surface-3);      /* puis, au survol, son fond, */
    --bp-second-encre:  var(--bp-text);           /* son texte */
    --bp-second-filet:  var(--bp-border-strong);  /* et son filet */
    --bp-flottant-fond: var(--bp-surface-3);      /* menu deroulant (« Plus ▾ ») */
    --bp-ombre-barre:   0 -8px 28px rgba(0, 0, 0, 0.28), 0 -1px 0 rgba(255, 255, 255, 0.04);  /* barre du telephone */

    /* --- Couleurs de sens : elles disent un etat, jamais une decoration, et
           toujours avec une icone ou un mot. L'aplat porte du texte (blanc sur
           --bp-danger : 4,56:1 ; #06140d sur --bp-success : 5,48:1 ; #241703 sur
           --bp-warning : 9,57:1) ; la variante douce est le texte et l'icone. --- */
    --bp-info:          #7cb7ff;
    --bp-success:       #1f9d6c;
    --bp-success-soft:  #3ccf91;
    --bp-warning:       #f2b544;
    --bp-danger:        #d93a35;
    --bp-danger-hover:  #c83531;                  /* blanc dessus : 5,24:1 */
    --bp-danger-soft:   #f2706b;
    /* Fonds des bandeaux et des pastilles : la couleur douce a 12 % sur la surface. */
    --bp-success-fond:  #162824;
    --bp-warning-fond:  #2c251b;
    --bp-danger-fond:   #2c1c1f;
    --bp-info-fond:     #1e2531;
    /* Les memes couleurs en composantes, pour les utilitaires a opacite reglable. */
    --bp-surface-rgb:      17, 17, 21;
    --bp-neutre-rgb:       152, 152, 166;
    --bp-primary-rgb:      18, 87, 214;
    --bp-primary-soft-rgb: 143, 181, 255;
    --bp-info-rgb:         124, 183, 255;
    --bp-success-soft-rgb: 60, 207, 145;
    --bp-warning-rgb:      242, 181, 68;
    --bp-danger-soft-rgb:  242, 112, 107;

    /* --- Rayons : boutons et champs, cartes, modales, pilules. Le rayon d'un
           element pose dans une carte vaut celui de la carte moins l'espacement. --- */
    --bp-r-sm:   8px;
    --bp-r:      12px;
    --bp-r-lg:   16px;
    --bp-r-xl:   16px;
    --bp-r-pill: 999px;

    /* --- Elevations. Sur fond sombre, la profondeur vient de la surface : une
           carte n'a pas d'ombre ; un menu en a une legere ; une modale, une franche. --- */
    --bp-shadow-sm: none;
    --bp-shadow:    0 8px 24px rgba(0, 0, 0, 0.40);
    --bp-shadow-lg: 0 24px 64px rgba(0, 0, 0, 0.55);

    /* --- Typographie. Pile systeme : aucun appel reseau, rendu natif sur
           chaque plateforme, et pas de saut de mise en page au chargement. --- */
    --bp-font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
               "Helvetica Neue", "Noto Sans", Arial, sans-serif;
    --bp-font-mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas,
                    "DejaVu Sans Mono", monospace;

    /* --- Echelle typographique : neuf tailles, quatre graisses (400, 500, 600, 700). --- */
    --bp-fs-display: clamp(2.25rem, 1.6rem + 2.6vw, 3.5rem);   /* accueil public */
    --bp-fs-h1:      1.25rem;      /* titre de page ; 1.5rem des 768 px */
    --bp-fs-h2:      1.125rem;     /* titre de carte ou de section */
    --bp-fs-h3:      1rem;         /* sous-section, titre de ligne */
    --bp-fs-body:    1rem;         /* texte courant ; 0.9375rem des 768 px */
    --bp-fs-ui:      0.875rem;     /* boutons, onglets, cellules, menu */
    --bp-fs-small:   0.8125rem;    /* aides, metadonnees */
    --bp-fs-micro:   0.75rem;      /* pastilles, en-tetes de colonne */
    --bp-fs-chiffre: 1.75rem;      /* chiffre cle ; 2rem des 992 px */

    /* --- Rythme, base 4 px : 4, 8, 12, 16, 24, 32, 48, 64. --- */
    --bp-1: 0.25rem;  --bp-2: 0.5rem;   --bp-2h: 0.75rem;  --bp-3: 1rem;
    --bp-4: 1.5rem;   --bp-4h: 2rem;    --bp-5: 3rem;      --bp-6: 4rem;

    /* --- Mouvement : trois durees, deux courbes, transform et opacity seulement
           (les couleurs se fondent en 120 ms). Une sortie dure les trois quarts
           d'une entree. --- */
    --bp-duree-1: 120ms;           /* survol, appui */
    --bp-duree-2: 180ms;           /* menu, infobulle, message ephemere */
    --bp-duree-3: 240ms;           /* modale, tiroir, feuille du bas, page */
    --bp-courbe:        cubic-bezier(.2, 0, 0, 1);
    --bp-courbe-sortie: cubic-bezier(.4, 0, 1, 1);

    /* --- Squelette applicatif --- */
    --bp-sidebar-w: 280px;
    --bp-topbar-h:  64px;
    --bp-tabbar-h:  58px;

    /* --- Cible tactile minimale (recommandation WCAG 2.5.5) --- */
    --bp-tap: 44px;

    color-scheme: dark;
}
@media (min-width: 768px) { :root { --bp-fs-h1: 1.5rem; --bp-fs-body: 0.9375rem; } }
@media (min-width: 992px) { :root { --bp-fs-chiffre: 2rem; } }

/* =========================================================================
   2. REINITIALISATION
   ========================================================================= */
*, *::before, *::after { box-sizing: border-box; }

html {
    -webkit-text-size-adjust: 100%;   /* pas de zoom auto du texte en paysage iOS */
    -moz-text-size-adjust: 100%;
    text-size-adjust: 100%;
    scroll-behavior: smooth;
    /* LE FOND VA JUSQU'AU BORD. html porte la couleur de la page, comme body : le
       rebond elastique d'iOS, le bas d'une page courte et tout decalage du doigt
       montrent le meme noir, jamais du blanc. Les cinq espaces connectes, la console
       et les pages qui chargent cette feuille. */
    background-color: var(--bp-bg);
    color-scheme: dark;
    /* LE FILET (voir aussi body). Les causes de debordement sont corrigees a leur
       source ; il empeche seulement qu'un oubli futur fasse glisser la page de cote
       au doigt. `clip`, et non `hidden` : la barre du haut reste collante. Le
       defilement se bloque sur html (biopoint.js, tiroir et modales). */
    overflow-x: clip;
}

body {
    margin: 0;
    min-height: 100vh;
    font-family: var(--bp-font);
    font-size: var(--bp-fs-body);
    line-height: 1.5;
    color: var(--bp-text);
    /* Un fond uni : la profondeur vient des surfaces, pas d'un decor. */
    background-color: var(--bp-bg);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    /* Le filet : `hidden` pour les navigateurs qui ignorent `clip`, puis `clip` ;
       body ne devient jamais un conteneur de defilement. */
    overflow-x: hidden;
    overflow-x: clip;
    overflow-y: visible;
    /* Un mot trop long pour sa ligne (reference, adresse, empreinte) passe a la ligne
       au lieu d'elargir la page. */
    overflow-wrap: break-word;
}

h1, h2, h3, h4, h5, h6 { margin: 0 0 var(--bp-2); font-weight: 600; line-height: 1.3; text-wrap: balance; }
/* L'ECHELLE DES TITRES. Sans elle, le navigateur donne 10 px a un <h6> et 23 px a
   un <h2> : un titre de carte plus petit que son texte. Trois tailles, et les
   classes .h1 a .h6 pour donner a un titre la taille d'un autre rang. */
h1, .h1 { font-size: var(--bp-fs-h1); font-weight: 700; line-height: 1.2; letter-spacing: -0.015em; }
h2, .h2, h5, .h5 { font-size: var(--bp-fs-h2); letter-spacing: -0.01em; }
h3, .h3, h4, .h4, h6, .h6 { font-size: var(--bp-fs-h3); line-height: 1.35; letter-spacing: 0; }
p  { margin: 0 0 var(--bp-3); }
ul, ol { margin: 0 0 var(--bp-3); padding-left: 1.35rem; }
hr { border: 0; border-top: 1px solid var(--bp-border); margin: var(--bp-4) 0; }

a { color: var(--bp-primary-soft); text-decoration: none; }
a:hover { color: var(--bp-text); }
/* Un lien dans une phrase se reconnait sans la couleur : il est souligne. */
p a:not([class]), .bp-lien {
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 3px;
}
a:not([class]):focus-visible, .bp-lien:focus-visible { border-radius: 4px; }

img, svg, video { max-width: 100%; height: auto; vertical-align: middle; }

button { font: inherit; color: inherit; }

table { border-collapse: collapse; width: 100%; }

/* Barres de defilement discretes, sans masquer l'affordance. */
::-webkit-scrollbar { width: 9px; height: 9px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
    background: var(--bp-border-strong);
    border-radius: var(--bp-r-pill);
}
::-webkit-scrollbar-thumb:hover { background: var(--bp-text-4); }
* { scrollbar-width: thin; scrollbar-color: var(--bp-border-strong) transparent; }

/* Anneau de focus visible partout : la navigation au clavier ne doit jamais
   se perdre. `:focus-visible` evite de l'afficher au clic a la souris. */
:focus-visible {
    outline: 2px solid var(--bp-focus);
    outline-offset: 2px;
}

/* =========================================================================
   3. TYPOGRAPHIE ET COULEURS DE TEXTE
   ========================================================================= */
.small          { font-size: var(--bp-fs-small); }
.fs-1 { font-size: 2.25rem; } .fs-2 { font-size: 1.75rem; }
.fs-3 { font-size: 1.5rem; }  .fs-4 { font-size: 1.25rem; }
.fs-5 { font-size: var(--bp-fs-h2); }  .fs-6 { font-size: var(--bp-fs-body); }

.fw-normal    { font-weight: 400; }
.fw-medium    { font-weight: 500; }
.fw-semibold  { font-weight: 600; }
.fw-bold      { font-weight: 700; }
.fw-extrabold { font-weight: 700; }

/* LES CHIFFRES S'ALIGNENT. Heures, montants, dates et compteurs gardent la meme
   largeur d'un chiffre a l'autre : une colonne se lit de haut en bas, un compteur
   ne tremble pas quand il change. La police a chasse fixe est reservee aux codes
   (SIRET, identifiants, empreintes). */
.bp-chiffres, .font-monospace, .table, time, .kpi-value, .badge,
input[type="number"], input[type="date"], input[type="time"] {
    font-variant-numeric: tabular-nums;
    font-feature-settings: "tnum";
}
.font-monospace { font-family: var(--bp-font-mono); }
.text-uppercase { text-transform: uppercase; letter-spacing: 0.04em; }
.text-lowercase { text-transform: lowercase; }
.text-center { text-align: center; }
.text-start  { text-align: left; }
.text-end    { text-align: right; }
.text-truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.text-nowrap   { white-space: nowrap; }
.tracking-tight { letter-spacing: -0.015em; }
.lh-1 { line-height: 1.1; }

.text-white     { color: var(--bp-text) !important; }
.text-body      { color: var(--bp-text); }
.text-secondary { color: var(--bp-text-2) !important; }
.text-muted     { color: var(--bp-text-3) !important; }
.text-primary   { color: var(--bp-primary-soft) !important; }
.text-info      { color: var(--bp-info) !important; }
.text-success   { color: var(--bp-success-soft) !important; }
.text-warning   { color: var(--bp-warning) !important; }
.text-danger    { color: var(--bp-danger-soft) !important; }
.text-dark      { color: var(--bp-bg) !important; }
.text-decoration-none { text-decoration: none !important; }

/* =========================================================================
   4. GRILLE ET UTILITAIRES
   ========================================================================= */

/* --- Conteneurs --- */
.container, .container-fluid {
    width: 100%;
    margin-inline: auto;
    padding-inline: var(--bp-3);
}
@media (min-width: 1400px) { .container { max-width: 1360px; } }

/* --- Grille 12 colonnes.
       `flex-wrap` plutot que CSS Grid : le comportement de repli des colonnes
       Bootstrap (une colonne sans largeur occupe l'espace restant) se reproduit
       exactement, et les gabarits existants n'ont pas a etre reecrits. --- */
.row {
    display: flex;
    flex-wrap: wrap;
    margin-inline: calc(var(--bp-gx, 0.75rem) * -1);
}
.row > * {
    width: 100%;
    max-width: 100%;
    padding-inline: var(--bp-gx, 0.75rem);
    margin-top: var(--bp-gy, 0);
}
.g-0  { --bp-gx: 0;      --bp-gy: 0; }
.g-1  { --bp-gx: 0.25rem; --bp-gy: 0.5rem; }
.g-2  { --bp-gx: 0.5rem;  --bp-gy: 1rem; }
.g-3  { --bp-gx: 0.75rem; --bp-gy: 1.5rem; }
.g-4  { --bp-gx: 1rem;    --bp-gy: 2rem; }
.g-1, .g-2, .g-3, .g-4 { margin-top: calc(var(--bp-gy) * -1); }

.col { flex: 1 0 0%; }
.col-auto { flex: 0 0 auto; width: auto; }
.col-1  { flex: 0 0 auto; width: 8.3333%; }
.col-2  { flex: 0 0 auto; width: 16.6667%; }
.col-3  { flex: 0 0 auto; width: 25%; }
.col-4  { flex: 0 0 auto; width: 33.3333%; }
.col-5  { flex: 0 0 auto; width: 41.6667%; }
.col-6  { flex: 0 0 auto; width: 50%; }
.col-7  { flex: 0 0 auto; width: 58.3333%; }
.col-8  { flex: 0 0 auto; width: 66.6667%; }
.col-9  { flex: 0 0 auto; width: 75%; }
.col-10 { flex: 0 0 auto; width: 83.3333%; }
.col-11 { flex: 0 0 auto; width: 91.6667%; }
.col-12 { flex: 0 0 auto; width: 100%; }

@media (min-width: 576px) {
    .col-sm-2  { flex: 0 0 auto; width: 16.6667%; }
    .col-sm-3  { flex: 0 0 auto; width: 25%; }
    .col-sm-4  { flex: 0 0 auto; width: 33.3333%; }
    .col-sm-5  { flex: 0 0 auto; width: 41.6667%; }
    .col-sm-6  { flex: 0 0 auto; width: 50%; }
    .col-sm-12 { flex: 0 0 auto; width: 100%; }
}
@media (min-width: 768px) {
    .col-md-1  { flex: 0 0 auto; width: 8.3333%; }
    .col-md-2  { flex: 0 0 auto; width: 16.6667%; }
    .col-md-3  { flex: 0 0 auto; width: 25%; }
    .col-md-4  { flex: 0 0 auto; width: 33.3333%; }
    .col-md-5  { flex: 0 0 auto; width: 41.6667%; }
    .col-md-6  { flex: 0 0 auto; width: 50%; }
    .col-md-7  { flex: 0 0 auto; width: 58.3333%; }
    .col-md-8  { flex: 0 0 auto; width: 66.6667%; }
    .col-md-9  { flex: 0 0 auto; width: 75%; }
    .col-md-12 { flex: 0 0 auto; width: 100%; }
}
@media (min-width: 992px) {
    .col-lg-1  { flex: 0 0 auto; width: 8.3333%; }
    .col-lg-2  { flex: 0 0 auto; width: 16.6667%; }
    .col-lg-3  { flex: 0 0 auto; width: 25%; }
    .col-lg-4  { flex: 0 0 auto; width: 33.3333%; }
    .col-lg-5  { flex: 0 0 auto; width: 41.6667%; }
    .col-lg-6  { flex: 0 0 auto; width: 50%; }
    .col-lg-7  { flex: 0 0 auto; width: 58.3333%; }
    .col-lg-8  { flex: 0 0 auto; width: 66.6667%; }
    .col-lg-9  { flex: 0 0 auto; width: 75%; }
    .col-lg-12 { flex: 0 0 auto; width: 100%; }
}
@media (min-width: 1200px) {
    .col-xl-2  { flex: 0 0 auto; width: 16.6667%; }
    .col-xl-3  { flex: 0 0 auto; width: 25%; }
    .col-xl-4  { flex: 0 0 auto; width: 33.3333%; }
    .col-xl-5  { flex: 0 0 auto; width: 41.6667%; }
    .col-xl-6  { flex: 0 0 auto; width: 50%; }
    .col-xl-7  { flex: 0 0 auto; width: 58.3333%; }
    .col-xl-8  { flex: 0 0 auto; width: 66.6667%; }
}
/* Tres grand ecran : deux colonnes seulement la ou un tableau large (le parc
   des bornes, neuf colonnes) tiendrait sinon a l'etroit a cote d'un formulaire. */
@media (min-width: 1400px) {
    .col-xxl-4 { flex: 0 0 auto; width: 33.3333%; }
    .col-xxl-8 { flex: 0 0 auto; width: 66.6667%; }
}

/* --- Affichage (l'ordre de Bootstrap, et il compte) ---
   Toutes ces regles sont `!important` : a egalite, la DERNIERE declaree gagne.
   D'ou deux regles d'ordre :
   - `.d-none` vient APRES les autres valeurs sans largeur : « d-flex d-none »
     cache ;
   - les variantes par largeur (`.d-md-block`...) viennent APRES toutes les
     valeurs sans largeur, chaque palier apres le precedent : « d-none
     d-lg-block » cache au telephone et montre sur ordinateur.
   Declarees dans les blocs de la grille, AVANT `.d-none`, la paire
   « d-none d-lg-block » ne s'afficherait jamais, et « d-block d-xl-none »
   ne se cacherait jamais. */
.d-inline       { display: inline !important; }
.d-inline-block { display: inline-block !important; }
.d-block        { display: block !important; }
.d-grid         { display: grid !important; }
.d-flex         { display: flex !important; }
.d-inline-flex  { display: inline-flex !important; }
.d-none         { display: none !important; }
@media (min-width: 576px) {
    .d-sm-inline       { display: inline !important; }
    .d-sm-inline-block { display: inline-block !important; }
    .d-sm-block        { display: block !important; }
    .d-sm-grid         { display: grid !important; }
    .d-sm-flex         { display: flex !important; }
    .d-sm-inline-flex  { display: inline-flex !important; }
    .d-sm-table-cell   { display: table-cell !important; }
    .d-sm-none         { display: none !important; }
}
@media (min-width: 768px) {
    .d-md-inline       { display: inline !important; }
    .d-md-inline-block { display: inline-block !important; }
    .d-md-block        { display: block !important; }
    .d-md-grid         { display: grid !important; }
    .d-md-flex         { display: flex !important; }
    .d-md-inline-flex  { display: inline-flex !important; }
    .d-md-none         { display: none !important; }
}
@media (min-width: 992px) {
    .d-lg-inline       { display: inline !important; }
    .d-lg-inline-block { display: inline-block !important; }
    .d-lg-block        { display: block !important; }
    .d-lg-grid         { display: grid !important; }
    .d-lg-flex         { display: flex !important; }
    .d-lg-inline-flex  { display: inline-flex !important; }
    .d-lg-none         { display: none !important; }
}
@media (min-width: 1200px) {
    .d-xl-inline       { display: inline !important; }
    .d-xl-inline-block { display: inline-block !important; }
    .d-xl-block        { display: block !important; }
    .d-xl-grid         { display: grid !important; }
    .d-xl-flex         { display: flex !important; }
    .d-xl-inline-flex  { display: inline-flex !important; }
    .d-xl-none         { display: none !important; }
}

.flex-row      { flex-direction: row !important; }
.flex-column   { flex-direction: column !important; }
.flex-wrap     { flex-wrap: wrap !important; }
.flex-nowrap   { flex-wrap: nowrap !important; }
.flex-grow-1   { flex-grow: 1 !important; }
.flex-shrink-0 { flex-shrink: 0 !important; }
/* Un enfant de rangee flexible qui peut retrecir sous la largeur de son texte. */
.min-w-0       { min-width: 0 !important; }

.justify-content-start   { justify-content: flex-start !important; }
.justify-content-center  { justify-content: center !important; }
.justify-content-end     { justify-content: flex-end !important; }
.justify-content-between { justify-content: space-between !important; }
.justify-content-around  { justify-content: space-around !important; }

.align-items-start    { align-items: flex-start !important; }
.align-items-center   { align-items: center !important; }
.align-items-end      { align-items: flex-end !important; }
.align-items-baseline { align-items: baseline !important; }
.align-items-stretch  { align-items: stretch !important; }
.align-self-center    { align-self: center !important; }

.gap-1 { gap: 0.25rem !important; } .gap-2 { gap: 0.5rem !important; }
.gap-3 { gap: 1rem !important; }    .gap-4 { gap: 1.5rem !important; }

/* --- Espacements --- */
.m-0 { margin: 0 !important; }        .m-auto { margin: auto !important; }
.mt-0 { margin-top: 0 !important; }   .mb-0 { margin-bottom: 0 !important; }
.mt-1 { margin-top: .25rem !important; }  .mb-1 { margin-bottom: .25rem !important; }
.mt-2 { margin-top: .5rem !important; }   .mb-2 { margin-bottom: .5rem !important; }
.mt-3 { margin-top: 1rem !important; }    .mb-3 { margin-bottom: 1rem !important; }
.mt-4 { margin-top: 1.5rem !important; }  .mb-4 { margin-bottom: 1.5rem !important; }
.mt-5 { margin-top: 3rem !important; }    .mb-5 { margin-bottom: 3rem !important; }
.ms-1 { margin-left: .25rem !important; } .me-1 { margin-right: .25rem !important; }
.ms-2 { margin-left: .5rem !important; }  .me-2 { margin-right: .5rem !important; }
.ms-3 { margin-left: 1rem !important; }   .me-3 { margin-right: 1rem !important; }
.ms-auto { margin-left: auto !important; } .me-auto { margin-right: auto !important; }
.mx-auto { margin-inline: auto !important; }
.mx-1 { margin-inline: .25rem !important; }
.mx-2 { margin-inline: .5rem !important; }
.mx-3 { margin-inline: 1rem !important; }
.my-1 { margin-block: .25rem !important; }
.py-1 { padding-block: .25rem !important; }
.px-1 { padding-inline: .25rem !important; }
.pt-1 { padding-top: .25rem !important; }
.pb-1 { padding-bottom: .25rem !important; }
.ms-4 { margin-left: 1.5rem !important; }
.me-4 { margin-right: 1.5rem !important; }
.mt-auto { margin-top: auto !important; }
.gap-0 { gap: 0 !important; }
.flex-fill { flex: 1 1 auto !important; }
.align-middle { vertical-align: middle !important; }
.user-select-none { user-select: none !important; }
.my-2 { margin-block: .5rem !important; }  .my-3 { margin-block: 1rem !important; }
.my-4 { margin-block: 1.5rem !important; }
.mt-auto { margin-top: auto !important; }

.p-0 { padding: 0 !important; }
.p-1 { padding: .25rem !important; }  .p-2 { padding: .5rem !important; }
.p-3 { padding: 1rem !important; }    .p-4 { padding: 1.5rem !important; }
.p-5 { padding: 2.5rem !important; }
.pt-2 { padding-top: .5rem !important; }  .pb-2 { padding-bottom: .5rem !important; }
.pt-3 { padding-top: 1rem !important; }   .pb-3 { padding-bottom: 1rem !important; }
.pt-4 { padding-top: 1.5rem !important; } .pb-4 { padding-bottom: 1.5rem !important; }
.px-2 { padding-inline: .5rem !important; }  .py-2 { padding-block: .5rem !important; }
.px-3 { padding-inline: 1rem !important; }   .py-3 { padding-block: 1rem !important; }
.px-4 { padding-inline: 1.5rem !important; } .py-4 { padding-block: 1.5rem !important; }

/* --- Dimensions --- */
.w-100 { width: 100% !important; }   .w-auto { width: auto !important; }
.h-100 { height: 100% !important; }
.mw-100 { max-width: 100% !important; }
.overflow-auto   { overflow: auto !important; }
.overflow-hidden { overflow: hidden !important; }
.overflow-x-auto { overflow-x: auto !important; }

/* --- Fonds. `--bp-o` porte l'opacite, ce qui reproduit `bg-opacity-*`. --- */
.bg-dark    { background-color: rgba(var(--bp-surface-rgb), var(--bp-o, 1)) !important; }
.bg-black   { background-color: rgba(0, 0, 0, var(--bp-o, 1)) !important; }
.bg-body    { background-color: var(--bp-surface) !important; }
.bg-primary { background-color: rgba(var(--bp-primary-rgb), var(--bp-o, 1)) !important; }
.bg-info    { background-color: rgba(var(--bp-info-rgb), var(--bp-o, 1)) !important; }
.bg-success { background-color: rgba(var(--bp-success-soft-rgb), var(--bp-o, 1)) !important; }
.bg-warning { background-color: rgba(var(--bp-warning-rgb), var(--bp-o, 1)) !important; }
.bg-danger  { background-color: rgba(var(--bp-danger-soft-rgb), var(--bp-o, 1)) !important; }
.bg-secondary { background-color: rgba(var(--bp-neutre-rgb), var(--bp-o, 1)) !important; }
.bg-transparent { background-color: transparent !important; }
.bg-opacity-10 { --bp-o: 0.10; } .bg-opacity-25 { --bp-o: 0.25; }
.bg-opacity-50 { --bp-o: 0.50; } .bg-opacity-75 { --bp-o: 0.75; }

/* --- Bordures --- */
.border         { border: 1px solid var(--bp-border) !important; }
.border-0       { border: 0 !important; }
.border-top     { border-top: 1px solid var(--bp-border) !important; }
.border-bottom  { border-bottom: 1px solid var(--bp-border) !important; }
.border-start   { border-left: 1px solid var(--bp-border) !important; }
.border-secondary { border-color: var(--bp-border-strong) !important; }
.border-primary { border-color: rgba(var(--bp-primary-soft-rgb), var(--bp-bo, 1)) !important; }
.border-success { border-color: rgba(var(--bp-success-soft-rgb), var(--bp-bo, 1)) !important; }
.border-warning { border-color: rgba(var(--bp-warning-rgb), var(--bp-bo, 1)) !important; }
.border-danger  { border-color: rgba(var(--bp-danger-soft-rgb), var(--bp-bo, 1)) !important; }
.border-info    { border-color: rgba(var(--bp-info-rgb), var(--bp-bo, 1)) !important; }
.border-opacity-25 { --bp-bo: 0.25; } .border-opacity-50 { --bp-bo: 0.5; }

.rounded        { border-radius: var(--bp-r) !important; }
.rounded-0      { border-radius: 0 !important; }
.rounded-sm     { border-radius: var(--bp-r-sm) !important; }
.rounded-lg     { border-radius: var(--bp-r-lg) !important; }
.rounded-xl     { border-radius: var(--bp-r-xl) !important; }
.rounded-pill   { border-radius: var(--bp-r-pill) !important; }
.rounded-circle { border-radius: 50% !important; }

.shadow-sm { box-shadow: var(--bp-shadow-sm) !important; }
.shadow    { box-shadow: var(--bp-shadow) !important; }
.shadow-lg { box-shadow: var(--bp-shadow-lg) !important; }
.shadow-none { box-shadow: none !important; }

.position-relative { position: relative !important; }
.position-absolute { position: absolute !important; }
.position-fixed    { position: fixed !important; }
.position-sticky   { position: sticky !important; }
.top-0 { top: 0 !important; } .end-0 { right: 0 !important; }
.start-0 { left: 0 !important; } .bottom-0 { bottom: 0 !important; }
/* La pastille d'un compteur posee sur le coin d'un bouton (la cloche) : sans ces
   deux utilitaires, elle tomberait sur l'icone et la cacherait. */
.start-100 { left: 100% !important; }
.translate-middle { transform: translate(-50%, -50%) !important; }

.opacity-50 { opacity: 0.5 !important; } .opacity-75 { opacity: 0.75 !important; }
.visually-hidden {
    position: absolute !important; width: 1px; height: 1px;
    padding: 0; margin: -1px; overflow: hidden;
    clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

/* =========================================================================
   5. COMPOSANTS
   ========================================================================= */

/* --- La carte : la surface de base de toute l'interface. Opaque, un filet,
       aucune ombre ni flou : une carte par sujet, jamais une carte dans une carte
       (a l'interieur, on separe par des filets). --- */
.glass-panel {
    background: var(--bp-surface);
    border: 1px solid var(--bp-border);
    border-radius: var(--bp-r);
}
/* Une carte qui est un lien : toute la surface repond. */
a.glass-panel { transition: background-color var(--bp-duree-1) var(--bp-courbe); }
a.glass-panel:hover { background: var(--bp-surface-2); }

/* --- Boutons. Quatre roles, et pas un de plus :
       PRINCIPAL   .btn-primary (et les pleins .btn-success, .btn-info, .btn-warning) :
                   l'aplat d'accent, UN seul par ecran ;
       SECONDAIRE  .btn-outline-secondary, .btn-outline-light, .btn-secondary, .btn-dark
                   (et les contours .btn-outline-primary, -success, -info, -warning) ;
       DISCRET     .btn-link, .btn-ghost : sans fond, pour l'action de moindre poids ;
       DESTRUCTIF  .btn-danger (plein, dans une confirmation) et .btn-outline-danger.
       Etats : survol, focus (anneau global), appui, desactive, chargement (.is-loading). --- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--bp-2);
    min-height: var(--bp-tap);
    padding: 0.5rem 1rem;
    font-size: var(--bp-fs-ui);
    font-weight: 600;
    line-height: 1.25;
    text-align: center;
    text-decoration: none;
    /* Un libelle qui doit passer a la ligne (telephone) le fait en deux lignes egales.
       AVANT `white-space` : `text-wrap` est un raccourci qui remettrait le retour a la
       ligne ; `white-space: nowrap`, pose apres, le retire et garde l'equilibrage. */
    text-wrap: balance;
    white-space: nowrap;
    background: var(--bp-btn-fond, transparent);
    border: 1px solid transparent;
    border-radius: var(--bp-r-sm);
    cursor: pointer;
    transition: background-color var(--bp-duree-1) var(--bp-courbe),
                border-color var(--bp-duree-1) var(--bp-courbe),
                color var(--bp-duree-1) var(--bp-courbe),
                transform var(--bp-duree-1) var(--bp-courbe);
    -webkit-tap-highlight-color: transparent;
}
.btn:hover { background: var(--bp-btn-survol, var(--bp-btn-fond, transparent)); }
.btn:active { transform: scale(.98); }
/* L'icone d'un bouton : 16 px, a 8 px du libelle. Ces 8 px sont l'ecart du bouton :
   la marge qu'un gabarit pose en plus sur l'icone (.me-1, .me-2...) s'y ajouterait
   et donnerait 12 ou 16 px selon la page. */
:where(.btn) > i { font-size: 1rem; }
.btn:not(.d-block, .d-inline-block, .d-inline) > i:is(.me-1, .me-2, .me-3) { margin-right: 0 !important; }
.btn:not(.d-block, .d-inline-block, .d-inline) > i:is(.ms-1, .ms-2, .ms-3) { margin-left: 0 !important; }
/* Un bouton a long libelle passe a la ligne, en lignes egales, quand sa colonne est
   etroite (une carte de tablette, un tiers d'ecran) : sur une ligne, son texte
   debordait du bouton et chevauchait le paragraphe voisin. */
.btn.btn-long { white-space: normal; }
/* Desactive : ni survol, ni appui ; le curseur le dit aussi. */
.btn:disabled, .btn.disabled, .btn[aria-disabled="true"] {
    --bp-btn-survol: var(--bp-btn-fond);
    --bp-btn-encre-survol: var(--bp-text); --bp-btn-filet-survol: var(--bp-border-strong);
    opacity: 0.45;
    cursor: not-allowed;
    transform: none;
}
/* 36 px a l'ecran sur ordinateur, 44 px sous le doigt ou le pointeur. */
.btn-sm { position: relative; padding: 0.25rem 0.75rem; font-size: var(--bp-fs-small); min-height: 36px; }
.btn-sm::after { content: ""; position: absolute; inset: -4px 0; }
.btn-lg { padding: 0.75rem 1.5rem; font-size: var(--bp-fs-h3); min-height: 52px; }
/* EN COURS : le libelle garde sa place (la largeur ne bouge pas), un indicateur le
   remplace, et un second appui ne part pas. Poser aussi aria-busy="true". */
.btn.is-loading { position: relative; color: transparent !important; pointer-events: none; }
.btn.is-loading > * { visibility: hidden; }
.btn.is-loading::before {
    content: "";
    position: absolute;
    inset: 0;
    width: 16px; height: 16px;
    margin: auto;
    border: 2px solid var(--bp-btn-texte, var(--bp-text));
    border-right-color: transparent;
    border-radius: 50%;
    animation: bp-tourne .75s linear infinite;
}
@keyframes bp-tourne { to { transform: rotate(360deg); } }

/* Sur les petits ecrans, les boutons compacts reprennent une hauteur tactile.
   Le critere est la LARGEUR, pas `pointer: coarse` : un portable a ecran tactile
   se declare `fine`, certains navigateurs Android se trompent, et le resultat
   serait un bouton de 36 px qu'on rate une fois sur trois au doigt. La largeur,
   elle, ne ment pas. */
@media (max-width: 991.98px) {
    .btn-sm, .form-control-sm, .form-select-sm {
        min-height: var(--bp-tap);
        padding-block: 0.5rem;
    }
    /* Un bouton a libelle tres court (« PDF », une icone seule) garde 44 px de large. */
    .btn { min-width: var(--bp-tap); }
    /* Les liens d'un tableau ou d'une liste gagnent la meme zone de contact. */
    .table td a:not(.btn), .bp-lien-tactile {
        display: inline-flex;
        align-items: center;
        min-height: var(--bp-tap);
    }
    /* Une case et son libelle : toute la ligne se touche. */
    .form-check { min-height: var(--bp-tap); margin-bottom: 0; }
}

/* PRINCIPAL. Le blanc sur --bp-primary : 5,29:1 ; au survol : 6,34:1 (WCAG 1.4.3). */
.btn-primary, .btn-success, .btn-info, .btn-warning {
    --bp-btn-fond: var(--bp-primary); --bp-btn-survol: var(--bp-primary-hover); --bp-btn-texte: #fff;
    color: #fff;
}
.btn-primary:hover, .btn-success:hover, .btn-info:hover, .btn-warning:hover { color: #fff; }
/* SECONDAIRE. Son fond, et au survol son fond, son texte et son filet, viennent des
   jetons --bp-second-* : en tenue claire, blanc a filet fin, puis bleu au survol. */
.btn-secondary, .btn-dark, .btn-light, .btn-outline-secondary, .btn-outline-light,
.btn-outline-primary, .btn-outline-success, .btn-outline-info, .btn-outline-warning {
    --bp-btn-fond: var(--bp-second-fond); --bp-btn-survol: var(--bp-second-survol); --bp-btn-texte: var(--bp-text);
    --bp-btn-encre-survol: var(--bp-second-encre); --bp-btn-filet-survol: var(--bp-second-filet);
    color: var(--bp-text);
    border-color: var(--bp-border-strong);
}
.btn-secondary:hover, .btn-dark:hover, .btn-light:hover, .btn-outline-secondary:hover,
.btn-outline-light:hover, .btn-outline-primary:hover, .btn-outline-success:hover,
.btn-outline-info:hover, .btn-outline-warning:hover { color: var(--bp-btn-encre-survol); }
/* Le filet au survol, sans poids : une regle qui donne son filet a un bouton le garde. */
:where(.btn-secondary, .btn-dark, .btn-light, .btn-outline-secondary, .btn-outline-light,
       .btn-outline-primary, .btn-outline-success, .btn-outline-info, .btn-outline-warning):hover {
    border-color: var(--bp-btn-filet-survol);
}
/* DISCRET. */
.btn-link, .btn-ghost {
    --bp-btn-fond: transparent; --bp-btn-survol: var(--bp-surface-2); --bp-btn-texte: var(--bp-primary-soft);
    color: var(--bp-primary-soft);
}
.btn-link:hover, .btn-ghost:hover { color: var(--bp-primary-soft); }
/* DESTRUCTIF. Le blanc sur --bp-danger : 4,56:1. Jamais au rang de l'action principale. */
.btn-danger {
    --bp-btn-fond: var(--bp-danger); --bp-btn-survol: var(--bp-danger-hover); --bp-btn-texte: #fff;
    color: #fff;
}
.btn-danger:hover { color: #fff; }
.btn-outline-danger {
    --bp-btn-fond: var(--bp-second-fond); --bp-btn-survol: var(--bp-danger-fond); --bp-btn-texte: var(--bp-danger-soft);
    color: var(--bp-danger-soft);
    border-color: var(--bp-border-strong);
}
.btn-outline-danger:hover { color: var(--bp-danger-soft); }

/* --- Pastilles. Un mot d'etat sur un fond teinte : jamais la couleur seule.
       Les variantes viennent des classes de fond : .bg-dark et .bg-secondary
       (neutre), .bg-success, .bg-warning, .bg-danger, .bg-info, .bg-primary
       (selection). Un compteur pose sur un coin (.position-absolute) ou une
       echeance depassee du menu (.esp-pastille.bg-danger) reste un aplat rouge. --- */
.badge {
    display: inline-flex;
    align-items: center;
    gap: var(--bp-1);
    min-height: 22px;
    padding: 0.125rem var(--bp-2);
    font-size: var(--bp-fs-micro);
    font-weight: 600;
    line-height: 1.35;
    letter-spacing: 0.02em;
    color: var(--bp-badge-texte, var(--bp-text-2));
    border-radius: var(--bp-r-pill);
    vertical-align: middle;
    /* `white-space: nowrap` sur une etiquette longue (« Discipline a surveiller »)
       pousserait la ligne hors de l'ecran sur telephone. Le repli est autorise, et
       la largeur bornee a celle du conteneur. */
    max-width: 100%;
    text-align: center;
}
@media (min-width: 576px) { .badge { white-space: nowrap; } }
.badge.bg-dark, .badge.bg-secondary, .badge.bg-light { --bp-badge-texte: var(--bp-text-2); }
.badge.bg-success { --bp-badge-texte: var(--bp-success-soft); }
.badge.bg-warning { --bp-badge-texte: var(--bp-warning); }
.badge.bg-danger  { --bp-badge-texte: var(--bp-danger-soft); }
.badge.bg-info    { --bp-badge-texte: var(--bp-info); }
.badge.bg-primary { --bp-badge-texte: var(--bp-primary-soft); }
.badge:is(.bg-dark, .bg-secondary, .bg-light):not([class*="bg-opacity"]) { background-color: var(--bp-surface-3) !important; }
.badge.bg-success:not([class*="bg-opacity"]) { background-color: var(--bp-success-fond) !important; }
.badge.bg-warning:not([class*="bg-opacity"]) { background-color: var(--bp-warning-fond) !important; }
.badge.bg-danger:not([class*="bg-opacity"])  { background-color: var(--bp-danger-fond) !important; }
.badge.bg-info:not([class*="bg-opacity"])    { background-color: var(--bp-info-fond) !important; }
.badge.bg-primary:not([class*="bg-opacity"]) { background-color: var(--bp-primary-glow) !important; }
/* Sur un fond teinte, le texte est celui de la variante, quelle que soit la classe
   de texte que le gabarit porte encore (.text-dark y serait illisible). */
.badge[class*="bg-"]:not([class*="bg-opacity"], .esp-pastille):is(.text-dark, .text-white, .text-black, .text-light) {
    color: var(--bp-badge-texte, var(--bp-text-2)) !important;
}
/* LE COMPTEUR : ce qui attend, en chiffres blancs sur l'aplat rouge (4,56:1). */
.badge.bg-danger.position-absolute, .badge.bg-danger.esp-pastille {
    min-width: 18px;
    min-height: 18px;
    padding: 0 5px;
    justify-content: center;
    font-weight: 700;
    letter-spacing: 0;
    color: #fff !important;
    background-color: var(--bp-danger) !important;
}
/* Dans le menu, une pastille compte ce qui est a traiter : elle est neutre. */
.badge.esp-pastille:not(.bg-danger) {
    min-width: 22px;
    justify-content: center;
    color: var(--bp-text-2) !important;
    background-color: var(--bp-surface-3) !important;
    box-shadow: inset 0 0 0 1px var(--bp-border-strong);
}

/* --- Formulaires. Le libelle au-dessus du champ, l'aide (.form-text) entre les
       deux ou dessous, l'erreur sous le champ (.invalid-feedback) : elle dit quoi
       faire. Etats du champ : survol, focus, desactive, lecture seule, en erreur
       (.is-invalid ou aria-invalid="true"), verifie (.is-valid). --- */
.form-label {
    display: block;
    margin-bottom: var(--bp-2);
    font-size: var(--bp-fs-small);
    font-weight: 600;
    color: var(--bp-text-2);
}
.form-control, .form-select, input[type="text"], input[type="password"],
input[type="email"], input[type="number"], input[type="date"], input[type="time"],
input[type="search"], input[type="tel"], select, textarea {
    display: block;
    width: 100%;
    /* 16px minimum : en dessous, iOS zoome automatiquement a la prise de focus
       et l'utilisateur se retrouve avec une page decalee a recadrer a la main. */
    font-size: 16px;
    font-family: inherit;
    line-height: 1.4;
    min-height: var(--bp-tap);
    padding: 0.5rem 0.75rem;
    color: var(--bp-text);
    background-color: var(--bp-bg);
    /* Le contour d'un champ se voit : 3:1 au moins sur chaque fond (WCAG 1.4.11). */
    border: 1px solid var(--bp-border-control);
    border-radius: var(--bp-r-sm);
    transition: border-color var(--bp-duree-1) var(--bp-courbe);
    appearance: none;
    -webkit-appearance: none;
}
/* Sur ordinateur (grand ecran, pointeur precis), le texte d'un champ prend la taille
   de l'interface - la meme pour un champ de saisie, une liste et une zone de texte.
   Ailleurs il garde 16 px : un iPhone tenu en paysage (jusqu'a 956 px de large) ou
   un iPad zoomeraient a la prise de focus. */
@media (min-width: 992px) and (pointer: fine) {
    .form-control, .form-select, input[type="text"], input[type="password"],
    input[type="email"], input[type="number"], input[type="date"], input[type="time"],
    input[type="search"], input[type="tel"], input, select, textarea { font-size: var(--bp-fs-ui); }
}
.form-control:hover, .form-select:hover, select:hover, textarea:hover,
input:not([type="submit"], [type="button"], [type="reset"], [type="image"], [type="range"], [type="file"], [type="color"]):hover { border-color: var(--bp-text-3); }
/* Le focus d'un champ : le contour passe a l'accent, double d'un anneau. */
.form-control:focus, .form-select:focus, input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--bp-focus);
    box-shadow: 0 0 0 3px var(--bp-primary-glow);
}
/* L'indication de champ vide est du texte : 4,5:1 au moins. */
::placeholder, .form-control::placeholder, textarea::placeholder { color: var(--bp-text-3); opacity: 1; }
.form-control:disabled, .form-select:disabled, input:disabled, select:disabled, textarea:disabled {
    color: var(--bp-text-3);
    background-color: var(--bp-surface-2);
    border-color: var(--bp-border-strong);
    cursor: not-allowed;
    opacity: 1;
}
.form-control[readonly], input[readonly], textarea[readonly] {
    background-color: var(--bp-surface-2);
    border-color: transparent;
}
.form-control.is-invalid, .form-select.is-invalid, [aria-invalid="true"] { border-color: var(--bp-danger-soft); }
.form-control.is-invalid:focus, .form-select.is-invalid:focus, [aria-invalid="true"]:focus {
    border-color: var(--bp-danger-soft);
    box-shadow: 0 0 0 3px rgba(var(--bp-danger-soft-rgb), 0.2);
}
.form-control.is-valid, .form-select.is-valid { border-color: var(--bp-success-soft); }
.invalid-feedback, .valid-feedback {
    display: flex;
    align-items: baseline;
    gap: var(--bp-1);
    margin-top: var(--bp-1);
    font-size: var(--bp-fs-small);
}
.invalid-feedback { color: var(--bp-danger-soft); }
.valid-feedback   { color: var(--bp-success-soft); }
/* Compact : 36 px sur ordinateur, a la hauteur d'un bouton compact - une liste comme
   un champ de saisie (le second selecteur passe devant input[type="..."], sans quoi
   un champ compact resterait a 44 px a cote d'une liste a 36) ; en dessous de 992 px,
   le champ garde les 44 px de tout ce qui se touche. */
.form-control-sm, .form-select-sm,
:is(input, select):is(.form-control-sm, .form-select-sm) { padding-block: 0.25rem; }
@media (min-width: 992px) {
    .form-control-sm, .form-select-sm,
    :is(input, select):is(.form-control-sm, .form-select-sm) { min-height: 36px; }
}
@media (min-width: 992px) and (pointer: fine) {
    .form-control-sm, .form-select-sm,
    :is(.form-control-sm, .form-select-sm):is(input, select, textarea) { font-size: var(--bp-fs-small); }
}
.form-control-lg { min-height: 52px; padding: 0.75rem 1rem; }
/* Le champ de fichier : son bouton prend le dessin du bouton secondaire, pas le gris
   clair que le navigateur lui donne. Son rayon est celui du champ moins l'espacement. */
input[type="file"]::file-selector-button {
    margin: 0 var(--bp-2h) 0 0;
    padding: var(--bp-1) var(--bp-2h);
    color: var(--bp-text);
    background: var(--bp-surface-2);
    border: 1px solid var(--bp-border-strong);
    border-radius: 4px;
    font: inherit;
    font-size: var(--bp-fs-small);
    font-weight: 600;
    cursor: pointer;
}
input[type="file"]::file-selector-button:hover { background: var(--bp-surface-3); }
input[type="file"]:disabled::file-selector-button { cursor: not-allowed; }
/* Le bouton occupe deja 28 px : l'espacement du champ se resserre pour que le champ
   de fichier garde la hauteur de ses voisins (44 px ; 36 px en compact, sur ordinateur). */
input[type="file"]:is(.form-control, .form-control-sm) { padding-block: 0.375rem; }
@media (min-width: 992px) { input[type="file"].form-control-sm { padding-block: 0.125rem; } }
textarea, textarea.form-control { min-height: 88px; resize: vertical; }

/* L'attribut hidden doit gagner sur TOUTE regle de display, y compris celle
   qui met `.form-control` en `display: block`. Sans cette ligne, un champ de
   formulaire marque `hidden` reste visible : le masquage par attribut ne
   fonctionnerait nulle part dans l'application. */
[hidden]        { display: none !important; }

/* Chevron dessine en CSS : pas d'image de fond a telecharger. */
.form-select, select {
    background-image:
        linear-gradient(45deg, transparent 50%, var(--bp-text-2) 50%),
        linear-gradient(135deg, var(--bp-text-2) 50%, transparent 50%);
    background-position: calc(100% - 18px) 50%, calc(100% - 13px) 50%;
    background-size: 5px 5px, 5px 5px;
    background-repeat: no-repeat;
    padding-right: 2.2rem;
}
option { background-color: var(--bp-surface); color: var(--bp-text); }

.form-check { display: flex; align-items: center; gap: var(--bp-2); margin-bottom: var(--bp-2); }
/* La case et le bouton radio : 20 px, dessines ici (meme rendu partout). Cochee :
   l'aplat d'accent et une coche blanche. */
.form-check-input {
    appearance: none;
    -webkit-appearance: none;
    display: inline-grid;
    place-content: center;
    width: 20px; height: 20px; min-height: 0;
    margin: 0; padding: 0; flex-shrink: 0;
    background: var(--bp-bg);
    border: 1px solid var(--bp-border-control);
    border-radius: 4px;
    cursor: pointer;
    transition: background-color var(--bp-duree-1) var(--bp-courbe),
                border-color var(--bp-duree-1) var(--bp-courbe);
}
.form-check-input[type="radio"] { border-radius: 50%; }
.form-check-input:hover { border-color: var(--bp-text-3); }
.form-check-input::before {
    content: "";
    width: 10px; height: 6px;
    border: solid #fff;
    border-width: 0 0 2px 2px;
    transform: translateY(-1px) rotate(-45deg) scale(0);
    transition: transform var(--bp-duree-1) var(--bp-courbe);
}
.form-check-input[type="radio"]::before {
    width: 8px; height: 8px;
    border: 0;
    border-radius: 50%;
    background: #fff;
    transform: scale(0);
}
.form-check-input:checked, .form-check-input:indeterminate { background: var(--bp-primary); border-color: var(--bp-primary); }
.form-check-input:checked::before { transform: translateY(-1px) rotate(-45deg) scale(1); }
.form-check-input[type="radio"]:checked::before { transform: scale(1); }
.form-check-input:indeterminate::before { width: 10px; height: 0; border-width: 0 0 2px; transform: none; }
.form-check-input:disabled { opacity: 0.45; cursor: not-allowed; }
.form-check-input:disabled ~ .form-check-label { color: var(--bp-text-3); cursor: not-allowed; }
/* Une case sans classe garde le dessin du navigateur, a la couleur du site. */
input[type="checkbox"], input[type="radio"] { accent-color: var(--bp-primary); }
/* AU CLAVIER, une case, un bouton radio ou un interrupteur porte l'anneau de tout
   le site : le contour d'un champ ne se verrait pas sur 20 px, encore moins sur
   une case cochee. A la souris, rien ne reste allume apres le clic. */
.form-check-input:focus { box-shadow: none; }
.form-check-input:not(:checked, :indeterminate):focus { border-color: var(--bp-border-control); }
.form-check-input:focus-visible,
input:is([type="checkbox"], [type="radio"], [type="range"], [type="file"]):focus-visible {
    outline: 2px solid var(--bp-focus);
    outline-offset: 2px;
    box-shadow: none;
}

/* --- Interrupteur. Les gabarits utilisent `form-switch` : sans ce style,
       l'utilisateur verrait une case a cocher la ou on lui annonce un interrupteur.
       La difference n'est pas decorative - un interrupteur dit « ceci change un
       etat maintenant », une case dit « ceci sera pris en compte a la validation ».
       Piste de 44 x 24 px ; eteint : contour net sur le fond de la page ; allume :
       l'aplat d'accent. L'etat s'ecrit aussi en mots a cote (« Activée »). --- */
.form-switch { display: flex; align-items: center; gap: var(--bp-2h); }
.form-switch .form-check-input {
    display: block;
    position: relative;
    width: 44px;
    height: 24px;
    border-radius: var(--bp-r-pill);
    background: var(--bp-bg);
    border: 1px solid var(--bp-border-control);
}
.form-switch .form-check-input::before {
    position: absolute;
    top: 2px;
    left: 2px;
    width: 18px;
    height: 18px;
    border: 0;
    border-radius: 50%;
    background: var(--bp-text-2);
    transform: none;
}
.form-switch .form-check-input:checked {
    background: var(--bp-primary);
    border-color: var(--bp-primary);
}
.form-switch .form-check-input:checked::before { background: #fff; transform: translateX(20px); }
[dir="rtl"] .form-switch .form-check-input:checked::before { transform: translateX(-20px); }
[dir="rtl"] .form-switch .form-check-input::before { left: auto; right: 2px; }
.input-group { display: flex; align-items: stretch; gap: 0; }
.input-group > .form-control { border-radius: var(--bp-r-sm) 0 0 var(--bp-r-sm); }
.input-group > .btn { border-radius: 0 var(--bp-r-sm) var(--bp-r-sm) 0; }

/* --- Tableaux. Toujours dans `.table-wrap` : sur telephone, un tableau large
       doit defiler dans son cadre, jamais faire deborder la page entiere. --- */
.table-wrap {
    width: 100%;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    -webkit-overflow-scrolling: touch;
    border-radius: var(--bp-r);
    /* LE CADRE CONTIENT AUSSI CE QUI EST POSITIONNE. Sans cela, un texte
       pour lecteur d'ecran (.visually-hidden, en position absolue) dans un
       en-tete de colonne echapperait au defilement du cadre : place a 1 200 px,
       il elargirait la page, et le telephone la reduirait de moitie. */
    position: relative;
}
/* LE CADRE QUI DEFILE SE VOIT (biopoint.js, section 6) : le bord ou du contenu est
   cache s'efface en degrade - la colonne coupee ne passe plus pour la fin du tableau. */
.defile-droite {
    -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 44px), transparent);
    mask-image: linear-gradient(to right, #000 calc(100% - 44px), transparent);
}
.defile-gauche {
    -webkit-mask-image: linear-gradient(to left, #000 calc(100% - 44px), transparent);
    mask-image: linear-gradient(to left, #000 calc(100% - 44px), transparent);
}
.defile-gauche.defile-droite {
    -webkit-mask-image: linear-gradient(to right, transparent, #000 44px, #000 calc(100% - 44px), transparent);
    mask-image: linear-gradient(to right, transparent, #000 44px, #000 calc(100% - 44px), transparent);
}
.table { width: 100%; font-size: var(--bp-fs-ui); }
/* Montants, heures et compteurs : alignes a droite, chiffre sous chiffre. */
.table .nombre, .table .bp-chiffres { text-align: right; white-space: nowrap; }
/* L'EN-TETE QUI RESTE (.table-collante sur le cadre) : pour un long tableau, sur
   ordinateur ; le cadre borne sa hauteur et l'en-tete colle a son bord. */
@media (min-width: 1200px) {
    .table-collante { max-height: calc(100dvh - var(--bp-topbar-h) - 6rem); overflow-y: auto; }
    .table-collante thead th { position: sticky; top: 0; z-index: 1; background: var(--bp-surface); }
}
/* LE TABLEAU QUI DEVIENT UNE PILE DE CARTES SOUS 1200 PX (.table-cartes, comme
   .es-table du salarie) : chaque ligne une carte, chaque cellule « en-tete : valeur »
   (data-label), le nom sur toute la largeur, les actions en bas. Aucune colonne
   coupee au bord, aucun defilement lateral, au telephone comme a la tablette (une
   tablette en paysage garde la barre laterale : il reste 700 px au tableau). */
@media (max-width: 1199.98px) {
    .table-cartes thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; }
    .table-cartes, .table-cartes tbody, .table-cartes tr, .table-cartes td { display: block; width: 100%; }
    .table-cartes tbody tr {
        display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .15rem .75rem;
        padding: .7rem 0; border-bottom: 1px solid var(--bp-border);
    }
    .table-cartes tbody tr:last-child { border-bottom: 0; }
    .table-cartes td { display: flex; flex-direction: column; align-items: flex-start; gap: .1rem; min-width: 0;
        padding: .2rem 0 !important; border: 0 !important; text-align: start !important; white-space: normal !important;
        overflow-wrap: anywhere; }
    .table-cartes td[data-label]::before {
        content: attr(data-label); color: var(--bp-text-3); font-size: var(--bp-fs-small); font-weight: 500;
    }
    .table-cartes td.carte-titre, .table-cartes td.carte-large, .table-cartes td.carte-action,
    .table-cartes td[colspan] { grid-column: 1 / -1; }
    .table-cartes td.carte-action { align-items: stretch; padding-top: .4rem !important; }
    .table-cartes td.carte-action > .btn:only-child { width: 100%; min-height: 44px; display: inline-flex; align-items: center; justify-content: center; }
    .table-cartes td.carte-action > .d-flex { justify-content: flex-start !important; }
    .table-cartes tbody tr:hover { background: transparent; }
    /* La fiche choisie garde un retrait entre sa barre et son texte. */
    .table-cartes tbody tr:is(.is-selected, [aria-selected="true"]) { padding-inline: var(--bp-2h); }
}
/* L'en-tete de colonne : le seul endroit, avec les groupes du menu, ou le texte
   passe en capitales. */
.table th {
    padding: 0.625rem 0.5rem;
    text-align: left;
    font-size: var(--bp-fs-micro);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--bp-text-3);
    border-bottom: 1px solid var(--bp-border-strong);
    /* Un en-tete de plusieurs mots (« Établissement : manquants ») passe sur deux
       lignes egales quand la place manque, plutot que de pousser la derniere colonne
       hors de la carte. */
    white-space: normal;
    text-wrap: balance;
}
/* Une rangee de boutons dans une cellule (« Fiche », « Rupture conv. »...) passe a la
   ligne plutot que de pousser la colonne Actions hors de la carte ; chaque bouton
   garde son libelle sur une ligne. Rien ne change tant que le tableau a la place. */
.bp-page td > .d-flex { flex-wrap: wrap; }
/* Une ligne : 44 px au moins (par l'espacement, jamais par une hauteur : une
   cellule qu'un gabarit change en bloc doit pouvoir grandir), un filet franc dessous. */
.table td {
    padding: 0.75rem 0.5rem;
    border-bottom: 1px solid var(--bp-border);
    vertical-align: middle;
}
.table tbody tr:last-child td { border-bottom: 0; }
/* Le survol est neutre ; la ligne choisie porte l'accent (fond et barre de 2 px). */
.table-hover tbody tr:hover { background: var(--bp-surface-2); }
.table tbody tr.is-selected, .table tbody tr[aria-selected="true"] {
    background: var(--bp-primary-glow);
    box-shadow: inset 2px 0 0 var(--bp-primary-soft);
}
/* La ligne de total. */
.table tfoot td, .table tfoot th, .table tr.total > * {
    font-weight: 600;
    color: var(--bp-text);
    border-top: 1px solid var(--bp-border-strong);
}
.table-clickable tbody tr { cursor: pointer; }

/* --- Bandeaux. Un fond teinte et un filet de la couleur de sens ; le TEXTE reste
       neutre, seule l'icone porte la couleur. role="alert" pour une erreur apres
       une action, role="status" pour une information. --- */
.alert {
    --bp-alerte: var(--bp-text-3);
    position: relative;
    display: flex;
    align-items: flex-start;
    gap: var(--bp-2h);
    padding: var(--bp-2h) var(--bp-3);
    margin-bottom: var(--bp-3);
    color: var(--bp-text-2);
    background: var(--bp-surface-2);
    border: 1px solid var(--bp-border-strong);
    border-radius: var(--bp-r);
    font-size: var(--bp-fs-ui);
    line-height: 1.45;
}
.alert-success { --bp-alerte: var(--bp-success-soft); background: var(--bp-success-fond); border-color: rgba(var(--bp-success-soft-rgb), 0.35); }
.alert-danger  { --bp-alerte: var(--bp-danger-soft);  background: var(--bp-danger-fond);  border-color: rgba(var(--bp-danger-soft-rgb), 0.35); }
.alert-warning { --bp-alerte: var(--bp-warning);      background: var(--bp-warning-fond); border-color: rgba(var(--bp-warning-rgb), 0.35); }
.alert-info    { --bp-alerte: var(--bp-info);         background: var(--bp-info-fond);    border-color: rgba(var(--bp-info-rgb), 0.35); }
.alert strong, .alert b, .alert :is(h1, h2, h3, h4, h5, h6) { color: var(--bp-text); }
.alert > i, .alert > strong:first-child > i:first-child { flex-shrink: 0; color: var(--bp-alerte); }
.alert > i { font-size: 1.125rem; line-height: 1.25rem; }
.alert a:not(.btn) { color: var(--bp-text); font-weight: 600; text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }
.alert a:not(.btn):hover { color: var(--bp-primary-soft); }
/* La croix occupe 44 px sans epaissir le bandeau. */
.alert .btn-close { margin-block: calc(var(--bp-2h) * -1); margin-inline: auto calc(var(--bp-2h) * -1); color: var(--bp-text-2); }
/* UNE ALERTE SE LIT COMME UN TEXTE. En prose (icone, gras, phrase, lien, sans bloc),
   elle s'ecrit comme un paragraphe : en rangee flexible, chaque morceau devenait une
   colonne et le lien sortait de l'ecran (« Les déclarer », 320 px). Faite de plusieurs
   blocs (titre, liste, paragraphes), un bloc par ligne : cote a cote, ils poussaient
   la page a 340 px. Et rien n'y empeche un enfant de retrecir. */
.alert:not(:has(> div, > p, > ul, > ol, > form, > button, > section, > details, > table, > a.btn)) { display: block; }
.alert:has(> :is(p, ul, ol) ~ :is(p, ul, ol)) { flex-wrap: wrap; }
.alert:has(> :is(p, ul, ol) ~ :is(p, ul, ol)) > :is(p, ul, ol) { flex: 1 1 100%; }
.alert > * { min-width: 0; }

/* La croix de fermeture : une cible de 44 px, un trace de 16 px. */
.btn-close {
    position: relative;
    flex-shrink: 0;
    width: var(--bp-tap); height: var(--bp-tap);
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: 0;
    border-radius: var(--bp-r-sm);
    color: var(--bp-text-2);
    cursor: pointer;
    transition: background-color var(--bp-duree-1) var(--bp-courbe), color var(--bp-duree-1) var(--bp-courbe);
}
.btn-close::before, .btn-close::after {
    content: "";
    position: absolute;
    width: 16px; height: 2px;
    border-radius: 1px;
    background: currentColor;
    transform: rotate(45deg);
}
.btn-close::after { transform: rotate(-45deg); }
.btn-close:hover { color: var(--bp-text); background: var(--bp-surface-3); }
.btn-close:active { transform: scale(.96); }

/* --- Modales --- */
.modal {
    position: fixed;
    inset: 0;
    z-index: 1080;
    display: none;
    overflow-y: auto;
    overscroll-behavior: contain;
    /* Un voile uni, sans flou : la page s'efface, la fenetre seule se lit. */
    background: var(--bp-overlay);
    padding: var(--bp-3);
}
.modal.show { display: block; }
.modal-dialog {
    position: relative;
    width: 100%;
    max-width: 560px;
    margin-inline: auto;
    margin-block: max(var(--bp-3), 4vh);
    animation: bp-modal-in var(--bp-duree-3) var(--bp-courbe);
}
.modal-lg  { max-width: 820px; }
.modal-xl  { max-width: 1100px; }
.modal-sm  { max-width: 420px; }
@keyframes bp-modal-in {
    from { opacity: 0; transform: translateY(12px) scale(.98); }
    to   { opacity: 1; transform: none; }
}
.modal-content {
    display: flex;
    flex-direction: column;
    /* Toute la largeur de la fenetre, meme centree (.modal-dialog-centered est une
       rangee flexible) : sans elle, un contenu court - le squelette d'attente - se
       resserre contre le bord gauche. */
    width: 100%;
    background: var(--bp-surface);
    border: 1px solid var(--bp-border-strong);
    border-radius: var(--bp-r-lg);
    box-shadow: var(--bp-shadow-lg);
    overflow: hidden;
}
/* L'en-tete : 56 px, le titre a gauche, la croix de 44 px a droite. */
.modal-header {
    display: flex;
    align-items: center;
    gap: var(--bp-2);
    min-height: 56px;
    padding: var(--bp-1) var(--bp-4);
    border-bottom: 1px solid var(--bp-border);
}
.modal-header .btn-close { margin-left: auto; margin-right: calc(var(--bp-2h) * -1); }
.modal-title { margin: 0; font-size: var(--bp-fs-h2); font-weight: 600; letter-spacing: -0.01em; }
/* `min-height: 0` : dans la feuille du telephone (hauteur bornee), le corps se
   resserre et defile ; sans lui, un long contenu poussait les boutons du pied hors
   de la feuille, coupes. */
.modal-body   { padding: var(--bp-4); overflow-y: auto; min-height: 0; }
.modal-footer {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: var(--bp-2);
    padding: var(--bp-3) var(--bp-4);
    border-top: 1px solid var(--bp-border);
}
/* Sur telephone la modale se comporte comme une feuille : elle monte du bas,
   occupe la largeur et laisse le pouce atteindre les actions. */
@media (max-width: 575.98px) {
    .modal { padding: 0; }
    .modal-dialog {
        margin: 0;
        min-height: 100%;
        display: flex;
        align-items: flex-end;
        max-width: none;
    }
    .modal-content {
        width: 100%;
        border-bottom: 0;
        border-radius: var(--bp-r-lg) var(--bp-r-lg) 0 0;
        max-height: 90vh;
        max-height: 90dvh;
    }
    /* La poignee de la feuille. */
    .modal-content::before {
        content: "";
        flex: none;
        align-self: center;
        width: 36px; height: 4px;
        margin-top: var(--bp-2);
        border-radius: var(--bp-r-pill);
        background: var(--bp-border-strong);
    }
    .modal-header, .modal-body, .modal-footer { padding-inline: var(--bp-3); }
    /* Le pied de la feuille degage la barre de geste de l'iPhone. */
    .modal-footer { padding-bottom: calc(var(--bp-3) + env(safe-area-inset-bottom, 0px)); }
    .modal-footer > .btn { flex: 1 1 auto; }
    @keyframes bp-modal-in {
        from { opacity: 0; transform: translateY(100%); }
        to   { opacity: 1; transform: none; }
    }
}

/* --- Repli : sans JavaScript, une modale ciblee par l'ancre s'ouvre quand meme. --- */
.modal:target { display: block; }

/* --- Sections repliables --- */
.collapse { display: none; }
.collapse.show { display: block; }

/* --- Accordeon --- */
.accordion-item { margin-bottom: 0.5rem; }
.accordion-header { margin: 0; }
.accordion-button {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
    width: 100%;
    /* Hauteur tactile garantie : ces en-tetes sont le seul moyen d'ouvrir le
       detail d'une journee, les rater au doigt rend la page inutilisable. */
    min-height: var(--bp-tap);
    padding: var(--bp-2h) var(--bp-3);
    font-size: var(--bp-fs-ui);
    font-weight: 600;
    text-align: left;
    color: var(--bp-text);
    background: var(--bp-surface);
    border: 1px solid var(--bp-border);
    border-radius: var(--bp-r);
    cursor: pointer;
    transition: background-color var(--bp-duree-1) var(--bp-courbe);
}
.accordion-button:hover { background: var(--bp-surface-2); }
.accordion-button::after {
    content: "";
    width: 0.62em; height: 0.62em;
    margin-left: auto;
    flex-shrink: 0;
    border-right: 2px solid var(--bp-text-3);
    border-bottom: 2px solid var(--bp-text-3);
    transform: rotate(45deg) translate(-2px, -2px);
    transition: transform var(--bp-duree-2) var(--bp-courbe);
}
.accordion-button[aria-expanded="true"]::after {
    transform: rotate(-135deg) translate(-2px, -2px);
}
.accordion-body {
    padding: 1rem;
    border: 1px solid var(--bp-border);
    border-top: 0;
    border-radius: 0 0 var(--bp-r) var(--bp-r);
}
.table-responsive { width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; position: relative; }
.table-sm td, .table-sm th { padding: 0.5rem; }
.table-dark { color: var(--bp-text); }

/* --- Infobulles --- */
.bp-tooltip {
    position: fixed;
    z-index: 1090;
    max-width: 260px;
    padding: var(--bp-2) var(--bp-2h);
    font-size: var(--bp-fs-small);
    line-height: 1.45;
    color: var(--bp-text);
    background: var(--bp-surface-3);
    border: 1px solid var(--bp-border-strong);
    border-radius: var(--bp-r-sm);
    box-shadow: var(--bp-shadow);
    pointer-events: none;
    opacity: 0;
    transition: opacity var(--bp-duree-2) var(--bp-courbe);
}
.bp-tooltip.show { opacity: 1; }

/* --- Point d'etat : fixe. Rien ne clignote ; l'etat s'ecrit a cote. --- */
.pulse-live {
    display: inline-block;
    width: 8px; height: 8px;
    border-radius: 50%;
    background-color: var(--bp-success-soft);
}

/* Le titre d'un groupe : en casse normale, discret. En capitales seulement dans
   la barre laterale, ou il separe les familles du menu. */
.section-title {
    font-size: var(--bp-fs-small);
    font-weight: 500;
    color: var(--bp-text-3);
}
.sidebar .section-title {
    font-size: var(--bp-fs-micro);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

/* --- Barres de progression --- */
.progress {
    height: 8px;
    overflow: hidden;
    background: var(--bp-surface-3);
    border-radius: var(--bp-r-pill);
}
.progress-bar {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    font-size: var(--bp-fs-micro);
    color: #fff;
    background: var(--bp-primary);
    border-radius: var(--bp-r-pill);
}
.progress-bar-striped {
    background-image: linear-gradient(45deg,
        rgba(255,255,255,.15) 25%, transparent 25%, transparent 50%,
        rgba(255,255,255,.15) 50%, rgba(255,255,255,.15) 75%,
        transparent 75%, transparent);
    background-size: 1rem 1rem;
}
.progress-bar-animated { animation: bp-stripes 1s linear infinite; }
@keyframes bp-stripes { from { background-position: 1rem 0; } to { background-position: 0 0; } }
@media (prefers-reduced-motion: reduce) { .progress-bar-animated { animation: none; } }

/* --- Indicateurs de chargement --- */
.spinner-border, .spinner-grow {
    display: inline-block;
    width: 1.5rem; height: 1.5rem;
    vertical-align: -0.125em;
}
.spinner-border {
    border: 2px solid currentColor;
    border-right-color: transparent;
    border-radius: 50%;
    animation: bp-tourne .75s linear infinite;
}
.spinner-grow {
    background-color: currentColor;
    border-radius: 50%;
    opacity: 0;
    animation: bp-grow .9s ease-in-out infinite;
}
@keyframes bp-grow {
    0%   { transform: scale(0); opacity: 0; }
    50%  { transform: none;     opacity: 1; }
    100% { transform: scale(0); opacity: 0; }
}
.spinner-border-sm, .spinner-grow-sm { width: 1rem; height: 1rem; border-width: 2px; }

/* --- Listes --- */
.list-group { display: flex; flex-direction: column; border-radius: var(--bp-r); }
.list-group-item {
    padding: var(--bp-2h) var(--bp-3);
    color: var(--bp-text);
    background: var(--bp-surface);
    border: 1px solid var(--bp-border);
    border-bottom-width: 0;
}
.list-group-item:first-child { border-radius: var(--bp-r) var(--bp-r) 0 0; }
.list-group-item:last-child  { border-radius: 0 0 var(--bp-r) var(--bp-r); border-bottom-width: 1px; }
.list-group-flush .list-group-item {
    border-inline: 0;
    border-radius: 0;
    background: transparent;
}

/* --- Complements de formulaire --- */
.input-group-text {
    display: flex;
    align-items: center;
    padding: 0.5rem 0.75rem;
    color: var(--bp-text-2);
    background: var(--bp-surface-2);
    border: 1px solid var(--bp-border-control);
    border-right: 0;
    border-radius: var(--bp-r-sm) 0 0 var(--bp-r-sm);
}
.input-group > .input-group-text + .form-control { border-radius: 0 var(--bp-r-sm) var(--bp-r-sm) 0; }
.form-text { display: block; margin-top: var(--bp-1); font-size: var(--bp-fs-small); color: var(--bp-text-3); }
.form-check-label { cursor: pointer; font-size: var(--bp-fs-ui); }

/* --- Divers --- */
.display-3 { font-size: 2.6rem; font-weight: 700; line-height: 1.1; letter-spacing: -0.025em; }
.display-4 { font-size: 2.1rem; font-weight: 700; line-height: 1.15; letter-spacing: -0.02em; }
@media (min-width: 768px) {
    .display-3 { font-size: 3.4rem; }
    .display-4 { font-size: 2.8rem; }
}
.fs-7 { font-size: var(--bp-fs-small); }
.img-fluid { max-width: 100%; height: auto; }
.table-borderless td, .table-borderless th { border: 0; }
.rounded-3 { border-radius: var(--bp-r) !important; }
.border-3 { border-width: 3px !important; }
.border-dark { border-color: var(--bp-border) !important; }
.border-end { border-right: 1px solid var(--bp-border) !important; }
.border-start-0 { border-left: 0 !important; }
.opacity-25 { opacity: 0.25 !important; }
.px-0 { padding-inline: 0 !important; }
.py-1 { padding-block: .25rem !important; }
.py-5 { padding-block: 3rem !important; }
.pe-5 { padding-right: 3rem !important; }
.g-5 { --bp-gx: 1.25rem; --bp-gy: 2.5rem; margin-top: calc(var(--bp-gy) * -1); }
.fade { transition: opacity var(--bp-duree-2) var(--bp-courbe); }
.transition {
    transition: background-color var(--bp-duree-1) var(--bp-courbe), border-color var(--bp-duree-1) var(--bp-courbe),
                color var(--bp-duree-1) var(--bp-courbe), opacity var(--bp-duree-1) var(--bp-courbe),
                transform var(--bp-duree-1) var(--bp-courbe);
}

/* Centrage vertical d'une modale : sur telephone la feuille reste ancree en bas,
   ou le pouce l'atteint. */
.modal-dialog-centered { display: flex; align-items: center; min-height: calc(100% - 8vh); }
@media (max-width: 575.98px) { .modal-dialog-centered { align-items: flex-end; min-height: 100%; } }

@media (min-width: 768px) {
    .p-md-5 { padding: 2.5rem !important; }
    .px-md-5 { padding-inline: 2.5rem !important; }
    .flex-md-row { flex-direction: row !important; }
    .align-items-md-center { align-items: center !important; }
    .fs-md-4 { font-size: 1.25rem !important; }
}
@media (min-width: 992px) { .p-lg-4 { padding: 1.5rem !important; } }

/* --- Lien d'evitement : le premier element de la page. Invisible, il apparait
       au clavier et mene droit au contenu (id="contenu"). --- */
.bp-evitement {
    position: fixed;
    top: calc(var(--bp-2) + env(safe-area-inset-top, 0px));
    left: calc(var(--bp-2) + env(safe-area-inset-left, 0px));
    z-index: 2100;
    padding: var(--bp-2h) var(--bp-3);
    color: var(--bp-text);
    background: var(--bp-surface-3);
    border: 1px solid var(--bp-border-strong);
    border-radius: var(--bp-r-sm);
    box-shadow: var(--bp-shadow);
    font-size: var(--bp-fs-ui);
    font-weight: 600;
    transform: translateY(-200%);
}
.bp-evitement:focus { color: var(--bp-text); transform: none; }
/* Le contenu recoit le focus du lien d'evitement sans s'entourer d'un anneau. */
#contenu:focus { outline: none; }

/* --- Avatar et sigle. Des initiales neutres : seule une photo apporte de la couleur. --- */
.bp-avatar {
    display: flex; align-items: center; justify-content: center;
    width: 32px; height: 32px; flex-shrink: 0;
    color: var(--bp-text);
    background: var(--bp-surface-3);
    border: 1px solid var(--bp-border-strong);
    border-radius: 50%;
    font-size: var(--bp-fs-small);
    font-weight: 600;
}
/* Le sigle officiel de Ryado (static/sigle.svg), en tete de barre : 48 px, son
   arrondi est dans le dessin. */
.bp-logo { display: block; width: 48px; height: 48px; flex-shrink: 0; }

/* --- Le pied de la barre laterale : un filet le separe du menu. L'encart d'etat
       (« Suivi des lois ») y est une simple ligne, sans carte. --- */
.sidebar > .mt-auto { padding-top: var(--bp-3); border-top: 1px solid var(--bp-border); }
.esp-encart {
    display: flex;
    align-items: flex-start;
    gap: var(--bp-2h);
    padding: var(--bp-2) var(--bp-2h);
    margin-bottom: var(--bp-2);
    color: var(--bp-text-2);
    border-radius: var(--bp-r-sm);
    text-decoration: none;
}
/* Seul l'encart qui est un lien repond au survol. */
a.esp-encart { transition: background-color var(--bp-duree-1) var(--bp-courbe); }
a.esp-encart:hover { color: var(--bp-text); background: var(--bp-surface-2); }
.esp-encart > i { font-size: 1.125rem; line-height: 1.25rem; color: var(--bp-text-3); }
.esp-encart-titre { display: block; font-size: var(--bp-fs-small); font-weight: 600; color: var(--bp-text); }
.esp-encart-detail { display: block; font-size: var(--bp-fs-micro); line-height: 1.35; color: var(--bp-text-3); }

/* --- Bandeau de consultation de support : sur chaque page tant qu'elle dure,
       et volontairement visible. --- */
.bp-bandeau-support {
    position: sticky;
    top: 0;
    z-index: 2000;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--bp-2) var(--bp-3);
    padding: var(--bp-2) var(--bp-3);
    color: var(--bp-text-2);
    background: var(--bp-warning-fond);
    border-bottom: 1px solid rgba(var(--bp-warning-rgb), 0.35);
    font-size: var(--bp-fs-ui);
}
.bp-bandeau-support > i { color: var(--bp-warning); }
.bp-bandeau-support strong { color: var(--bp-text); }
.bp-bandeau-support-fin { display: flex; flex-wrap: wrap; align-items: center; gap: var(--bp-2h); margin-left: auto; }

/* --- Etat vide. Un constat, la raison ou la suite, UNE action si l'on peut agir.
       Ce qui est rassurant le dit en mots (« Tout est à jour »), sans couleur. --- */
.bp-vide {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--bp-2);
    padding: var(--bp-5) var(--bp-3);
    color: var(--bp-text-2);
    font-size: var(--bp-fs-ui);
    text-align: center;
}
.bp-vide > i { margin-bottom: var(--bp-1); font-size: 1.5rem; color: var(--bp-text-3); }
.bp-vide-titre, .bp-vide > :is(h2, h3, h4) { margin: 0; font-size: var(--bp-fs-h3); font-weight: 600; color: var(--bp-text); }
.bp-vide p { max-width: 40ch; margin: 0; text-wrap: pretty; }
.bp-vide .btn { margin-top: var(--bp-2h); }

/* --- Squelette de chargement. Des blocs a la taille exacte de ce qui arrive :
       rien ne saute a l'arrivee. Il n'apparait qu'apres 300 ms d'attente, et bat
       doucement tant que la page charge. Poser aria-busy="true" sur le conteneur. --- */
.bp-squelette {
    display: block;
    min-height: 12px;
    color: transparent !important;
    /* Deux crans au-dessus de la carte : un cran ne s'en detache pas. */
    background: var(--bp-surface-3);
    border-radius: var(--bp-r-sm);
    opacity: 0;
    pointer-events: none;
    user-select: none;
    animation: bp-squelette 1.2s ease-in-out 300ms infinite alternate;
}
.bp-squelette > * { visibility: hidden; }
.bp-squelette-titre { width: 40%; height: 24px; margin-bottom: var(--bp-4); }
.bp-squelette-ligne { height: 12px; margin-block: var(--bp-2h); }
.bp-squelette-ligne:nth-child(3n + 2) { width: 80%; }
.bp-squelette-ligne:nth-child(3n) { width: 60%; }
@keyframes bp-squelette { from { opacity: 1; } to { opacity: 0.6; } }
@keyframes bp-squelette-fixe { to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) {
    .bp-squelette { animation: bp-squelette-fixe 1ms linear 300ms forwards !important; }
}

/* --- Message ephemere. Il confirme ce qui vient d'etre fait et dit la suite ;
       cinq secondes, puis il s'efface (une erreur reste jusqu'a sa fermeture).
       En bas a droite sur ordinateur ; au telephone, en bas, au-dessus de la barre. --- */
.bp-toasts {
    position: fixed;
    right: var(--bp-4);
    bottom: calc(var(--bp-4) + env(safe-area-inset-bottom, 0px));
    z-index: 1100;
    display: flex;
    flex-direction: column;
    gap: var(--bp-2);
    width: min(360px, calc(100vw - 2 * var(--bp-3)));
    pointer-events: none;
}
@media (max-width: 991.98px) {
    .bp-toasts {
        right: auto;
        left: 50%;
        bottom: calc(var(--bp-3) + env(safe-area-inset-bottom, 0px));
        transform: translateX(-50%);
    }
    body.has-tabbar .bp-toasts { bottom: calc(var(--bp-tabbar-h) + var(--bp-3) + env(safe-area-inset-bottom, 0px)); }
    body.ba-appli .bp-toasts {
        bottom: calc(var(--ba-h, 0px) + var(--ba-ecart, 0px) + var(--bp-4) + env(safe-area-inset-bottom, 0px));
    }
}
.bp-toast {
    display: flex;
    align-items: flex-start;
    gap: var(--bp-2h);
    padding: var(--bp-2h) var(--bp-3);
    color: var(--bp-text);
    background: var(--bp-surface-3);
    border: 1px solid var(--bp-border-strong);
    border-radius: var(--bp-r);
    box-shadow: var(--bp-shadow);
    font-size: var(--bp-fs-ui);
    line-height: 1.45;
    pointer-events: auto;
    animation: bp-entree var(--bp-duree-2) var(--bp-courbe);
}
.bp-toast > i { flex: none; font-size: 1.125rem; line-height: 1.25rem; color: var(--bp-text-3); }
.bp-toast--succes > i { color: var(--bp-success-soft); }
.bp-toast--erreur > i { color: var(--bp-danger-soft); }
.bp-toast-texte { flex: 1 1 auto; min-width: 0; }
.bp-toast-action {
    flex: none;
    padding: 0;
    color: var(--bp-primary-soft);
    background: none;
    border: 0;
    font: inherit;
    font-weight: 600;
    text-decoration: underline;
    text-underline-offset: 3px;
    cursor: pointer;
}
.bp-toast .btn-close { margin: calc(var(--bp-2h) * -1) calc(var(--bp-2h) * -1) calc(var(--bp-2h) * -1) 0; }
.bp-toast.bp-sort {
    opacity: 0;
    transform: translateY(8px);
    transition: opacity 135ms var(--bp-courbe-sortie), transform 135ms var(--bp-courbe-sortie);
}

/* --- Resume d'erreurs, en tete d'un formulaire : « 3 champs à corriger », puis un
       lien vers chaque champ. Il recoit le focus a l'envoi (tabindex="-1", role="alert"). --- */
.bp-erreurs {
    padding: var(--bp-3);
    margin-bottom: var(--bp-4);
    color: var(--bp-text-2);
    background: var(--bp-danger-fond);
    border: 1px solid rgba(var(--bp-danger-soft-rgb), 0.35);
    border-radius: var(--bp-r);
    font-size: var(--bp-fs-ui);
}
.bp-erreurs:focus-visible { outline-color: var(--bp-danger-soft); }
.bp-erreurs-titre {
    display: flex; align-items: center; gap: var(--bp-2);
    margin: 0 0 var(--bp-2);
    font-size: var(--bp-fs-h3); font-weight: 600; color: var(--bp-text);
}
.bp-erreurs-titre > i { color: var(--bp-danger-soft); }
.bp-erreurs ul { margin: 0; padding-left: 1.25rem; }
.bp-erreurs li + li { margin-top: var(--bp-1); }
.bp-erreurs a { color: var(--bp-text); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }

/* --- Onglets de page : le texte, et un trait de 2 px sous l'onglet ouvert. Au
       telephone la rangee defile de cote, sans retour a la ligne. --- */
.bp-onglets {
    display: flex;
    gap: var(--bp-4);
    margin: 0 0 var(--bp-4);
    padding: 0;
    list-style: none;
    border-bottom: 1px solid var(--bp-border);
    overflow-x: auto;
    white-space: nowrap;
    scrollbar-width: none;
}
.bp-onglets::-webkit-scrollbar { display: none; }
.bp-onglet {
    display: inline-flex; align-items: center; gap: var(--bp-2);
    min-height: var(--bp-tap);
    margin-bottom: -1px;
    padding: 0;
    color: var(--bp-text-3);
    background: none;
    border: 0;
    border-bottom: 2px solid transparent;
    font: inherit; font-size: var(--bp-fs-ui); font-weight: 500;
    text-decoration: none;
    cursor: pointer;
    transition: color var(--bp-duree-1) var(--bp-courbe);
}
.bp-onglet:hover { color: var(--bp-text); }
.bp-onglet:focus-visible { outline-offset: -2px; }
.bp-onglet:is(.active, [aria-current], [aria-selected="true"]) { color: var(--bp-text); border-bottom-color: var(--bp-primary-soft); }

/* --- Filtre segmente (« Aujourd'hui / 7 jours / 30 jours ») : le segment choisi
       est un cran plus clair - jamais un aplat d'accent. --- */
.bp-segments {
    display: inline-flex;
    gap: 2px;
    max-width: 100%;
    padding: var(--bp-1);
    background: var(--bp-surface-2);
    border-radius: var(--bp-r-pill);
    overflow-x: auto;
    scrollbar-width: none;
}
.bp-segments::-webkit-scrollbar { display: none; }
.bp-segment {
    position: relative;
    display: inline-flex; align-items: center; justify-content: center;
    min-height: 36px;
    padding: 0 var(--bp-3);
    color: var(--bp-text-3);
    background: transparent;
    border: 0;
    border-radius: var(--bp-r-pill);
    font: inherit; font-size: var(--bp-fs-ui); font-weight: 500;
    text-decoration: none;
    white-space: nowrap;
    cursor: pointer;
    transition: background-color var(--bp-duree-1) var(--bp-courbe), color var(--bp-duree-1) var(--bp-courbe);
}
.bp-segment::after { content: ""; position: absolute; inset: -4px 0; }
.bp-segment:hover { color: var(--bp-text); }
.bp-segment:is(.active, [aria-current], [aria-pressed="true"], [aria-selected="true"]) {
    color: var(--bp-text);
    background: var(--bp-surface-3);
    font-weight: 600;
}

/* --- Liste. Une ligne de 56 px : une icone ou un avatar, un titre, un sous-titre,
       a droite une date ou un montant, et un chevron si la ligne ouvre une page. --- */
.bp-liste { margin: 0; padding: 0; list-style: none; }
.bp-liste > * + * { border-top: 1px solid var(--bp-border); }
.bp-liste-ligne {
    display: flex; align-items: center; gap: var(--bp-2h);
    min-height: 56px;
    padding: var(--bp-2) var(--bp-3);
    color: var(--bp-text);
    text-decoration: none;
}
a.bp-liste-ligne { transition: background-color var(--bp-duree-1) var(--bp-courbe); }
a.bp-liste-ligne:hover { color: var(--bp-text); background: var(--bp-surface-2); }
a.bp-liste-ligne:focus-visible { outline-offset: -2px; }
.bp-liste-corps { flex: 1 1 auto; min-width: 0; }
.bp-liste-titre { display: block; font-size: var(--bp-fs-ui); font-weight: 600; }
.bp-liste-sous  { display: block; font-size: var(--bp-fs-small); color: var(--bp-text-3); }
.bp-liste-meta  { flex: none; font-size: var(--bp-fs-small); color: var(--bp-text-3);
    font-variant-numeric: tabular-nums; white-space: nowrap; }
.bp-liste-chevron { flex: none; font-size: 1rem; color: var(--bp-text-4); }

/* --- Les motifs communs aux pages des espaces (elus, direction d'enseigne,
       console, equipes internes, gerant). --- */
/* « En savoir plus » : le detail juridique replie, une ligne d'aide au plus en tete de page. */
.esp-savoir-plus { margin: 0 0 var(--bp-3); }
.esp-savoir-plus > summary { cursor: pointer; color: var(--bp-text-3); font-size: var(--bp-fs-small); font-weight: 600;
    list-style: none; display: inline-flex; align-items: center; gap: var(--bp-1); }
.esp-savoir-plus > summary::-webkit-details-marker { display: none; }
.esp-savoir-plus > summary::before { content: "\25B8"; font-size: var(--bp-fs-micro); }
.esp-savoir-plus[open] > summary::before { content: "\25BE"; }
.esp-savoir-plus > summary:hover { color: var(--bp-text); }
.esp-savoir-plus > div { margin-top: var(--bp-2); color: var(--bp-text-3); font-size: var(--bp-fs-small); line-height: 1.6; }
.esp-savoir-plus > div p { margin: 0 0 var(--bp-2); }
/* Le statut d'une ligne : un point, une couleur ET un mot. */
.esp-statut { display: inline-flex; align-items: center; gap: var(--bp-1); min-height: 22px; padding: 0.125rem var(--bp-2);
    border-radius: var(--bp-r-pill); font-size: var(--bp-fs-micro); font-weight: 600; letter-spacing: 0.02em; white-space: nowrap; }
.esp-statut::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.esp-statut.ok { color: var(--bp-success-soft); background: var(--bp-success-fond); }
.esp-statut.attente { color: var(--bp-warning); background: var(--bp-warning-fond); }
.esp-statut.alerte { color: var(--bp-danger-soft); background: var(--bp-danger-fond); }
.esp-statut.neutre { color: var(--bp-text-2); background: var(--bp-surface-3); }
/* LE MOTIF « TABLEAU + DETAIL » : une ligne par element, sa colonne Statut,
   et le bouton « Détail » qui deplie la cause et l'action sans quitter la
   page. Des <details> : aucun script, aucune CSP a negocier. Les colonnes
   se reglent par `--esp-colonnes` sur le conteneur. */
.esp-lignes { border: 1px solid var(--bp-border); border-radius: var(--bp-r); overflow: hidden;
    background: var(--bp-surface); margin-bottom: var(--bp-3); }
.esp-lignes-entete, .esp-ligne > summary, .esp-ligne-lien { display: grid; gap: var(--bp-2h); align-items: center;
    grid-template-columns: var(--esp-colonnes, minmax(0,1fr) auto auto); min-height: var(--bp-tap); padding: var(--bp-2) var(--bp-3); }
.esp-lignes-entete { font-size: var(--bp-fs-micro); text-transform: uppercase; letter-spacing: 0.04em; color: var(--bp-text-3);
    font-weight: 600; border-bottom: 1px solid var(--bp-border-strong); }
.esp-ligne { border-bottom: 1px solid var(--bp-border); }
.esp-ligne:last-child { border-bottom: none; }
.esp-ligne > summary { cursor: pointer; list-style: none; color: var(--bp-text); font-size: var(--bp-fs-ui); }
/* Une ligne dont le detail est une page a part (le fil d'une reclamation). */
.esp-ligne-lien { color: var(--bp-text); font-size: var(--bp-fs-ui); text-decoration: none; }
.esp-ligne-lien:hover { background: var(--bp-surface-2); color: var(--bp-text); }
.esp-ligne > summary::-webkit-details-marker { display: none; }
.esp-ligne > summary:hover, .esp-ligne[open] > summary { background: var(--bp-surface-2); }
.esp-ligne > summary:focus-visible, .esp-ligne-lien:focus-visible { outline-offset: -2px; }
.esp-ligne > summary > *, .esp-ligne-lien > * { min-width: 0; }
.esp-detail-bouton { justify-self: end; font-size: var(--bp-fs-small); font-weight: 600; padding: var(--bp-1) var(--bp-2h);
    border-radius: var(--bp-r-sm); border: 1px solid var(--bp-border-strong); color: var(--bp-text); background: var(--bp-surface-2);
    white-space: nowrap; }
.esp-ligne[open] .esp-detail-bouton { background: var(--bp-surface-3); }
.esp-ligne-detail { padding: var(--bp-2h) var(--bp-3) var(--bp-3); border-top: 1px solid var(--bp-border); }
.esp-sous { display: block; color: var(--bp-text-3); font-size: var(--bp-fs-small); }
.esp-vide { padding: var(--bp-3); margin: 0; color: var(--bp-text-3); font-size: var(--bp-fs-ui); }
@media (max-width: 720px) {
    .esp-lignes-entete { display: none; }
    /* Au telephone : l'element, son statut, le bouton. L'element garde toujours
       sa place (10 rem au moins) : quand la ligne est trop etroite, le statut et
       « Détail » passent dessous - le statut a gauche, « Détail » a droite - au
       lieu d'ecraser le nom sur trois lignes ou de le recouvrir. */
    .esp-ligne > summary, .esp-ligne-lien { display: flex; flex-wrap: wrap; align-items: center; gap: var(--bp-2) var(--bp-2h); }
    .esp-ligne > summary > *, .esp-ligne-lien > * { flex: 0 1 auto; }
    .esp-ligne > summary > :first-child, .esp-ligne-lien > :first-child { flex: 1 1 10rem; }
    .esp-ligne > summary > .esp-detail-bouton, .esp-ligne-lien > .esp-detail-bouton { margin-left: auto; }
    .esp-ligne > summary > .esp-cache-mobile, .esp-ligne-lien > .esp-cache-mobile { display: none; }
}

/* --- L'ETAT D'UN RESULTAT, VERT OU ROUGE (_etat_resultat.html, etat_resultat.py). Un seul
       etat, grand ; rouge : les erreurs bloquantes, une ligne chacune, avec « Corriger ».
       La couleur n'est jamais seule : un pictogramme et un mot l'accompagnent. --- */
.etat-resultat { border: 1px solid var(--bp-border); border-left-width: 6px; border-radius: var(--bp-r);
    background: var(--bp-surface); padding: var(--bp-3); margin: 0 0 var(--bp-3); }
.etat-resultat.etat-ok { border-color: rgba(var(--bp-success-soft-rgb), 0.45); border-left-color: var(--bp-success-soft);
    background: var(--bp-success-fond); }
.etat-resultat.etat-bloquant { border-color: rgba(var(--bp-danger-soft-rgb), 0.45); border-left-color: var(--bp-danger-soft);
    background: var(--bp-danger-fond); }
.etat-titre { display: flex; align-items: center; gap: var(--bp-2h); margin: 0; font-size: 1.375rem; font-weight: 700;
    line-height: 1.25; letter-spacing: -0.01em; }
.etat-ok .etat-titre { color: var(--bp-success-soft); }
.etat-bloquant .etat-titre { color: var(--bp-danger-soft); }
.etat-picto { display: inline-grid; place-items: center; flex: none; width: 2rem; height: 2rem; border-radius: 50%;
    font-size: 1.05rem; font-weight: 700; color: var(--bp-bg); }
.etat-ok .etat-picto { background: var(--bp-success-soft); }
.etat-bloquant .etat-picto { background: var(--bp-danger-soft); }
.etat-sous { margin: var(--bp-2) 0 0; color: var(--bp-text-2); font-size: var(--bp-fs-ui); }
.etat-erreurs { list-style: none; margin: var(--bp-3) 0 0; padding: 0; display: flex; flex-direction: column; gap: var(--bp-2); }
.etat-erreur { display: flex; align-items: center; gap: var(--bp-2) var(--bp-3); flex-wrap: wrap;
    padding: var(--bp-2) var(--bp-2h); border-radius: var(--bp-r-sm); background: var(--bp-surface);
    border: 1px solid rgba(var(--bp-danger-soft-rgb), 0.30); }
.etat-erreur-texte { flex: 1 1 16rem; min-width: 0; color: var(--bp-text); font-size: var(--bp-fs-ui); overflow-wrap: anywhere; }
.etat-corriger { flex: none; margin-left: auto; display: inline-flex; align-items: center; min-height: 36px;
    padding: var(--bp-1) var(--bp-3); border-radius: var(--bp-r-sm); font-size: var(--bp-fs-ui); font-weight: 600;
    color: #fff; background: var(--bp-danger); text-decoration: none; white-space: nowrap; }
.etat-corriger:hover, .etat-corriger:focus-visible { color: #fff; background: var(--bp-danger-hover); }
.etat-suite { display: flex; flex-wrap: wrap; align-items: center; gap: var(--bp-2); margin-top: var(--bp-3); }
.etat-suite > form { margin: 0; }
@media (min-width: 768px) { .etat-titre { font-size: 1.625rem; } .etat-picto { width: 2.25rem; height: 2.25rem; } }

/* =========================================================================
   6. MISE EN PAGE APPLICATIVE
   ========================================================================= */

/* --- Barre laterale. Tiroir sur telephone, colonne fixe sur grand ecran. --- */
.sidebar {
    position: fixed;
    inset-block: 0;
    left: 0;
    z-index: 1060;
    display: flex;
    flex-direction: column;
    /* 78vw et non 86 : il faut laisser une bande touchable a droite du tiroir.
       A 86vw il ne resterait que 55 px sur un ecran de 390 px, trop etroit pour
       refermer d'un appui - le geste attendu par tout utilisateur de telephone. */
    width: min(78vw, var(--bp-sidebar-w));
    height: 100vh;
    padding: var(--bp-4) var(--bp-3);
    background: var(--bp-menu-fond);
    border-right: 1px solid var(--bp-border);
    /* Indispensable : sans defilement interne, les dernieres entrees de menu et
       le bouton de deconnexion deviennent inatteignables sur un ecran court. */
    overflow-y: auto;
    overflow-x: hidden;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    transform: translateX(-100%);
    /* `visibility` suit le glissement : visible des l'ouverture, cachee a la fin de
       la fermeture (une valeur discrete reste visible pendant la transition). */
    transition: transform var(--bp-duree-3) var(--bp-courbe), visibility var(--bp-duree-3);
}
/* Les zones sures de l'iPhone, sans toucher aux marges que les gabarits posent
   sur la barre : deux cales, en tete et en pied. */
.sidebar::before, .sidebar::after { content: ""; flex: none; }
.sidebar::before { height: env(safe-area-inset-top, 0px); }
.sidebar::after  { height: env(safe-area-inset-bottom, 0px); }
/* 100dvh suit la hauteur reelle sur mobile, ou la barre d'adresse se retracte. */
@supports (height: 100dvh) { .sidebar { height: 100dvh; } }

.sidebar.mobile-open { transform: translateX(0); box-shadow: var(--bp-shadow-lg); }
/* LE TIROIR FERME EST HORS D'ATTEINTE. Pousse hors de l'ecran, il restait dans
   l'ordre du clavier et lu par VoiceOver et TalkBack : la touche Tab disparaissait
   dans un menu invisible. `visibility: hidden` le retire des deux, sans script ;
   chaque coquille (admin_layout.html compris, dont la transition `all` couvre
   aussi `visibility`) en herite. Au-dela de 992 px, la barre est une colonne fixe. */
@media (max-width: 991.98px) {
    .sidebar:not(.mobile-open) { visibility: hidden; }
}

.sidebar-backdrop {
    position: fixed;
    inset: 0;
    z-index: 1055;
    background: var(--bp-overlay);
    /* Safari sur iPhone n'envoie pas de « click » a un simple bloc touche : sans
       curseur de lien, toucher a cote du tiroir ne le refermerait pas. */
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    opacity: 0;
    visibility: hidden;
    transition: opacity var(--bp-duree-3) var(--bp-courbe), visibility var(--bp-duree-3);
}
.sidebar-backdrop.show { opacity: 1; visibility: visible; }

.main-content {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    min-width: 0;              /* autorise les enfants a retrecir au lieu de deborder */
    padding-inline: var(--bp-3);
    padding-bottom: var(--bp-5);
}

@media (min-width: 992px) {
    .sidebar { transform: none; }
    .sidebar-backdrop { display: none; }
    .main-content { margin-left: var(--bp-sidebar-w); padding-inline: var(--bp-4); }
}

/* --- Ecriture de droite a gauche ---------------------------------------------
   L'espace salarie s'affiche dans la langue choisie par le salarie, arabe compris.
   Trois proprietes seulement sont physiquement orientees dans cette feuille : le
   bord lateral du tiroir, sa position, et la marge du contenu. Le reste utilise
   deja des proprietes logiques et suit l'attribut `dir` sans rien faire. */
[dir="rtl"] .sidebar {
    left: auto;
    right: 0;
    border-right: 0;
    border-left: 1px solid var(--bp-border);
    transform: translateX(100%);
}
[dir="rtl"] .sidebar.mobile-open { transform: translateX(0); }
@media (min-width: 992px) {
    /* Sans cette remise a zero, la regle de droite a gauche - plus specifique que
       celle du grand ecran - laisserait le menu hors cadre en permanence : le
       salarie arabophone perdrait toute la barre laterale sur ordinateur. */
    [dir="rtl"] .sidebar { transform: none; }
    [dir="rtl"] .main-content { margin-left: 0; margin-right: var(--bp-sidebar-w); }
}
/* Les nombres, les heures et les montants restent lus de gauche a droite : une
   heure inversee serait une information fausse, pas une preference d'affichage. */
[dir="rtl"] .font-monospace,
[dir="rtl"] time { direction: ltr; unicode-bidi: embed; }

/* --- Navigation. Une rubrique : 44 px au doigt, 40 px sur ordinateur ; l'icone
       est neutre (la couleur que le menu lui donne ne dit aucun etat). La ligne
       ouverte : fond d'un cran plus clair, texte franc, icone et barre de 2 px a
       l'accent - une seule ligne vive dans tout le menu. --- */
.nav-link-custom {
    display: flex;
    align-items: center;
    gap: var(--bp-2h);
    min-height: var(--bp-tap);
    padding: var(--bp-2) var(--bp-2h);
    margin-bottom: var(--bp-1);
    font-size: var(--bp-fs-ui);
    font-weight: 500;
    color: var(--bp-text-2);
    border-radius: var(--bp-r-sm);
    text-decoration: none;
    transition: background-color var(--bp-duree-1) var(--bp-courbe), color var(--bp-duree-1) var(--bp-courbe);
    -webkit-tap-highlight-color: transparent;
}
/* Dans un groupe qui pose deja son ecart, la ligne n'ajoute pas le sien. */
.gap-1 > .nav-link-custom, .nav-link-custom:last-child { margin-bottom: 0; }
/* 40 px sur ordinateur, pastille de 28 px comprise : avec 8 px de marge interieure, la
   ligne en faisait 44, sa fleche (40 px) tombait deux pixels trop haut, et le menu du
   gerant ne tenait plus dans un ecran de 1080 px une fois la marque posee en tete. */
@media (min-width: 992px) { .nav-link-custom { min-height: 40px; padding-block: 6px; } }
.nav-link-custom > i { font-size: 1.125rem; color: var(--bp-text-3) !important; }
.nav-link-custom:hover > i { color: var(--bp-text-2) !important; }
.nav-link-custom.active > i { color: var(--bp-primary-soft) !important; }

/* --- Couleur des rubriques (decision du proprietaire, 11/11/2026 : « de belles
       couleurs simples, bien etudiees, pas gris »). Chaque rubrique a SA teinte,
       toujours la meme d'un espace a l'autre : on retrouve « Paie » au vert,
       « Planning » au violet, sans lire. Neuf teintes de meme clarte (environ
       72 % de luminance percue), saturees juste assez pour se distinguer sur le
       fond presque noir, toutes au-dessus de 7:1 sur --bp-surface. L'icone pose
       sur une pastille de 28 px teintee a 15 % ; la ligne ouverte prend un voile
       de sa couleur et son trait de 2 px. Le texte reste blanc casse : la
       couleur designe, elle ne remplace pas le libelle. --- */
:is(.esp-rub, .es-rubrique, .al-famille) { --rub: #8fb5ff; --esp-accent: var(--rub); }
:is(.esp-rub, .es-rubrique, .al-famille)[data-rub="accueil"]                                 { --rub: #8fb5ff; } /* indigo, l'accent du site */
:is(.esp-rub, .es-rubrique, .al-famille):is([data-rub="planning"], [data-rub="echanges"], [data-rub="assistant"])       { --rub: #c39bff; } /* violet */
:is(.esp-rub, .es-rubrique, .al-famille):is([data-rub="heures"], [data-rub="chiffres"], [data-rub="a_faire"])         { --rub: #f5bd5b; } /* ambre */
:is(.esp-rub, .es-rubrique, .al-famille):is([data-rub="equipe"], [data-rub="salaries"], [data-rub="employeur"], [data-rub="collectif"], [data-rub="signalements"]) { --rub: #6cc3f5; } /* ciel */
:is(.esp-rub, .es-rubrique, .al-famille):is([data-rub="paie"], [data-rub="argent"], [data-rub="mandat"], [data-rub="demandes"])        { --rub: #4fd6a2; } /* emeraude */
:is(.esp-rub, .es-rubrique, .al-famille)[data-rub="documents"]                               { --rub: #f7a07e; } /* corail */
:is(.esp-rub, .es-rubrique, .al-famille):is([data-rub="conformite"], [data-rub="securite"], [data-rub="systeme"], [data-rub="cles_api"], [data-rub="formation"]) { --rub: #4fd1cf; } /* turquoise */
:is(.esp-rub, .es-rubrique, .al-famille):is([data-rub="entreprise"], [data-rub="magasins"], [data-rub="clients"], [data-rub="messagerie"], [data-rub="messages"]) { --rub: #f48fb8; } /* rose */
:is(.esp-rub, .es-rubrique, .al-famille):is([data-rub="aide"], [data-rub="compte"], [data-rub="autres"]) { --rub: #9fc5ff; } /* bleu clair */
.esp-ico {
    flex: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: var(--bp-r-sm);
    background: rgba(157, 158, 255, .15);
    background: color-mix(in srgb, var(--rub) 16%, transparent);
    transition: background-color var(--bp-duree-1) var(--bp-courbe);
}
.esp-ico > i { font-size: .9375rem; color: var(--rub) !important; }
.nav-link-custom:hover > .esp-ico { background: color-mix(in srgb, var(--rub) 24%, transparent); }
/* Hors de la tenue claire, la ligne ouverte prend le voile et le trait de sa
   rubrique. En tenue claire, elle est au bleu de la marque quelle que soit la
   rubrique (les jetons --bp-actif-*, plus bas) ; l'icone garde sa couleur. */
html:not([data-tenue="clair"]) :is(.esp-rub, .es-rubrique:not(.es-a-pages)) > .nav-link-custom.active:not(.esp-a-pages) {
    background: linear-gradient(var(--rub), var(--rub)) left center / 2px calc(100% - 1rem) no-repeat,
                color-mix(in srgb, var(--rub) 10%, var(--bp-surface-2));
}
:is(.esp-rub, .es-rubrique) > .nav-link-custom.active > .esp-ico { background: color-mix(in srgb, var(--rub) 28%, transparent); }
[dir="rtl"] :is(.esp-rub, .es-rubrique:not(.es-a-pages)) > .nav-link-custom.active:not(.esp-a-pages) { background-position: right center, 0 0; }
.nav-link-custom:hover { color: var(--bp-text); background: var(--bp-surface-2); }
.nav-link-custom.active {
    color: var(--bp-actif-texte);
    /* La barre : un trait droit de 2 px, a 8 px des coins. Une ombre interieure
       suivrait l'arrondi de la ligne et dessinerait une parenthese. */
    background: linear-gradient(var(--bp-actif-trait), var(--bp-actif-trait)) left center / 2px calc(100% - 1rem) no-repeat,
                var(--bp-actif-fond);
    font-weight: 600;
}
/* Le pied du menu (« Supprimer mon compte », « Quitter ») : discret. Quitter
   n'est pas une destruction : pas de rouge. */
.sidebar .nav-link-custom:is(.text-danger, .text-secondary) { color: var(--bp-text-3) !important; }
.sidebar .nav-link-custom:is(.text-danger, .text-secondary):hover { color: var(--bp-text) !important; }

/* --- UN SEUL MENU : l'accordeon des rubriques -------------------------------
   _espace_barre.html. Le nom d'une rubrique est un lien vers sa premiere page ;
   la fleche a sa droite est le <summary> d'un <details> qui deplie ses pages
   sans quitter la page. Aucun script. La rubrique ouverte ne s'allume pas en
   bloc : c'est sa page courante qui s'allume, une seule ligne vive. */
.esp-menu { display: flex; flex-direction: column; gap: var(--bp-1); }
.esp-rub { position: relative; }
.esp-menu .nav-link-custom { margin-bottom: 0; }
.esp-rub > .esp-rub-lien { min-height: var(--bp-tap); }
@media (min-width: 992px) { .esp-rub > .esp-rub-lien { min-height: 40px; } }
.esp-rub > .esp-rub-lien.esp-a-pages { padding-right: calc(var(--bp-tap) + 2px); }
.esp-libelle { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.esp-pastille { flex: none; margin-left: auto; }
.esp-rub.active > .esp-rub-lien.esp-a-pages.active {
    color: var(--bp-text);
    background: transparent;
    box-shadow: none;
    font-weight: 600;
}
.esp-rub.active > .esp-rub-lien.esp-a-pages.active:hover { background: var(--bp-surface-2); }
.esp-rub-pages > summary.esp-rub-fleche {
    position: absolute;
    top: 0;
    right: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: var(--bp-tap);
    height: var(--bp-tap);
    list-style: none;
    cursor: pointer;
    color: var(--bp-text-3);
    border-radius: var(--bp-r-sm);
    -webkit-tap-highlight-color: transparent;
}
@media (min-width: 992px) { .esp-rub-pages > summary.esp-rub-fleche { height: 40px; } }
.esp-rub-fleche::-webkit-details-marker { display: none; }
.esp-rub-fleche::marker { content: ""; }
.esp-rub-fleche::before {
    content: "";
    width: 7px;
    height: 7px;
    border-right: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
    transform: rotate(-45deg);
    transition: transform var(--bp-duree-2) var(--bp-courbe);
}
.esp-rub-pages[open] > .esp-rub-fleche::before { transform: rotate(45deg); }
.esp-rub-fleche:hover { color: var(--bp-text); background: var(--bp-surface-2); }
.esp-rub-fleche:focus-visible { outline: 2px solid var(--bp-focus); outline-offset: -2px; }
/* Les pages d'une rubrique : un filet les relie a l'icone de leur rubrique, leur
   texte s'aligne sur le sien, et la page ouverte pose sa barre SUR le filet. */
.esp-pages {
    list-style: none;
    margin: 2px 0 var(--bp-2) 1.4375rem;
    padding: 0;
    border-left: 1px solid var(--bp-border);
}
.esp-page {
    display: flex;
    align-items: center;
    gap: var(--bp-2);
    min-height: 40px;
    margin-left: -1px;
    padding: var(--bp-1) var(--bp-2h) var(--bp-1) var(--bp-4);
    border-radius: 0 var(--bp-r-sm) var(--bp-r-sm) 0;
    color: var(--bp-text-2);
    font-size: var(--bp-fs-small);
    font-weight: 500;
    text-decoration: none;
    transition: background-color var(--bp-duree-1) var(--bp-courbe), color var(--bp-duree-1) var(--bp-courbe);
    -webkit-tap-highlight-color: transparent;
}
.esp-page:hover { color: var(--bp-text); background: var(--bp-surface-2); }
.esp-page.active {
    color: var(--bp-actif-texte);
    background: var(--bp-actif-fond);
    box-shadow: inset 2px 0 0 var(--esp-accent, var(--bp-actif-trait));
    font-weight: 600;
}
[dir="rtl"] .esp-pages { margin: 2px 1.4375rem var(--bp-2) 0; border-left: 0; border-right: 1px solid var(--bp-border); }
[dir="rtl"] .esp-page { margin-left: 0; margin-right: -1px; padding: var(--bp-1) var(--bp-4) var(--bp-1) var(--bp-2h);
    border-radius: var(--bp-r-sm) 0 0 var(--bp-r-sm); }
[dir="rtl"] .esp-page.active { box-shadow: inset -2px 0 0 var(--esp-accent, var(--bp-actif-trait)); }
[dir="rtl"] .nav-link-custom.active { background-position: right center, 0 0; }
/* Au doigt, chaque ligne garde la cible tactile minimale. */
@media (max-width: 991.98px) { .esp-page { min-height: var(--bp-tap); } }

/* --- LE BOUTON « PLUS ▾ » de la barre de titre (_espace_plus.html) -------------
   Les pages secondaires de la page courante, dans un menu deroulant a droite
   du titre. Un <details> : il s'ouvre sans script (biopoint.js le referme
   seulement au clic ailleurs). Au telephone, le menu prend la largeur de la
   barre de titre : il ne deborde jamais de l'ecran. */
.esp-titre { display: flex; align-items: center; gap: var(--bp-2); min-width: 0; }
.esp-titre > h1 { min-width: 0; }
/* LA LIGNE D'AIDE sous le titre, a partir de 768 px : une classe a elle, que
   chaque gabarit d'espace partage. */
.esp-aide { display: none; }
@media (min-width: 768px) { .esp-aide { display: block; } }
.esp-entete { position: relative; }
.esp-plus { position: relative; flex: none; }
.esp-plus > summary.esp-plus-bouton {
    display: inline-flex;
    align-items: center;
    position: relative;
    gap: var(--bp-1);
    min-height: 36px;
    padding: 0 var(--bp-2h);
    background: var(--bp-second-fond);
    border: 1px solid var(--bp-border-strong);
    border-radius: var(--bp-r-pill);
    color: var(--bp-text);
    font-size: var(--bp-fs-small);
    font-weight: 600;
    line-height: 1.2;
    transition: background-color var(--bp-duree-1) var(--bp-courbe), border-color var(--bp-duree-1) var(--bp-courbe),
                color var(--bp-duree-1) var(--bp-courbe);
    white-space: nowrap;
    list-style: none;
    cursor: pointer;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}
.esp-plus-bouton::-webkit-details-marker { display: none; }
.esp-plus-bouton::marker { content: ""; }
/* 36 px a l'ecran, 44 px sous le doigt. */
.esp-plus > summary.esp-plus-bouton::after { content: ""; position: absolute; inset: -4px 0; }
.esp-plus > summary.esp-plus-bouton:hover,
.esp-plus[open] > summary.esp-plus-bouton {
    color: var(--bp-second-encre); background: var(--bp-second-survol); border-color: var(--bp-second-filet);
}
.esp-plus-bouton:focus-visible { outline: 2px solid var(--bp-focus); outline-offset: 2px; }
.esp-plus-fleche { font-size: 0.75rem; color: var(--bp-text-3); transition: transform var(--bp-duree-2) var(--bp-courbe); }
.esp-plus[open] .esp-plus-fleche { transform: rotate(180deg); }
.esp-plus-menu {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    z-index: 1070;
    display: flex;
    flex-direction: column;
    gap: 2px;
    width: max-content;
    min-width: 220px;
    max-width: min(360px, calc(100vw - 2rem));
    padding: var(--bp-1);
    background: var(--bp-flottant-fond);
    border: 1px solid var(--bp-border-strong);
    border-radius: var(--bp-r);
    box-shadow: var(--bp-shadow);
}
.esp-plus[open] > .esp-plus-menu { animation: bp-entree var(--bp-duree-2) var(--bp-courbe); }
/* L'entree standard de ce qui apparait : un fondu, huit pixels de course. */
@keyframes bp-entree { from { opacity: 0; transform: translateY(8px); } }
.esp-plus-entree {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 2px;
    min-height: var(--bp-tap);
    padding: var(--bp-2) var(--bp-2h);
    border-radius: var(--bp-r-sm);
    color: var(--bp-text);
    font-size: var(--bp-fs-ui);
    font-weight: 500;
    text-decoration: none;
    white-space: normal;
}
.esp-plus-entree:hover { color: var(--bp-text); background: var(--bp-border); }
.esp-plus-entree.active {
    color: var(--bp-text);
    /* Le meme trait droit que la ligne ouverte du menu. */
    background: linear-gradient(var(--esp-accent, var(--bp-primary-soft)), var(--esp-accent, var(--bp-primary-soft))) left center / 2px calc(100% - 1rem) no-repeat,
                var(--bp-primary-glow);
    font-weight: 600;
}
[dir="rtl"] .esp-plus-entree.active { background-position: right center, 0 0; }
.esp-plus-libelle { display: flex; align-items: center; gap: var(--bp-2); }
.esp-plus-aide { color: var(--bp-text-3); font-size: var(--bp-fs-small); font-weight: 400; line-height: 1.35; }
@media (max-width: 767.98px) {
    .esp-plus { position: static; }
    .esp-plus-menu {
        left: var(--bp-3);
        right: var(--bp-3);
        top: calc(100% - 2px);
        width: auto;
        min-width: 0;
        max-width: none;
        max-height: 70vh;
        overflow-y: auto;
    }
}

/* --- Barre superieure --- */
.bp-topbar {
    position: sticky;
    top: 0;
    z-index: 1040;
    display: flex;
    align-items: center;
    gap: var(--bp-2);
    min-height: var(--bp-topbar-h);
    margin-inline: calc(var(--bp-3) * -1);
    padding: var(--bp-2) var(--bp-3);
    /* L'un des deux seuls flous du site (avec la barre du bas) : le contenu
       defile dessous, le titre reste lisible. */
    background: var(--bp-glass);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--bp-border);
}
/* L'en-tete de la console et des equipes internes : la hauteur de la barre des
   autres espaces. Il defile avec la page. */
.bp-entete-console { min-height: var(--bp-topbar-h); }
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
    .bp-topbar, .bp-tabbar { background: var(--bp-surface); }
}
/* Les gestes de la barre (la cloche) : des icones de 44 px, sans cadre. */
.bp-topbar > .btn {
    --bp-btn-fond: transparent; --bp-btn-survol: var(--bp-surface-3);
    flex: none;
    min-width: var(--bp-tap);
    min-height: var(--bp-tap);
    padding-inline: var(--bp-2);
    border-color: transparent;
    color: var(--bp-text-2);
}
.bp-topbar > .btn > i { font-size: 1.125rem; }
/* Le compteur de la cloche se pose sur son epaule, pas hors du bouton. */
.bp-topbar > .btn > .badge.position-absolute { top: 9px !important; left: calc(100% - 6px) !important; }
@media (min-width: 992px) {
    .bp-topbar { margin-inline: calc(var(--bp-4) * -1); padding-inline: var(--bp-4); }
}
/* LE TITRE EN ENTIER. Entre le bouton du menu, « Plus ▾ » et la cloche, il ne reste
   au titre qu'une centaine de pixels au telephone : « Déposer un document » ou le nom
   d'un magasin passent sur deux lignes equilibrees, jamais coupes par des points de
   suspension. La ligne d'aide aussi. */
.bp-topbar-title { min-width: 0; }
.bp-topbar-title h1 {
    margin: 0;
    font-size: var(--bp-fs-h1);
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: -0.015em;
    color: var(--bp-titre);
    overflow-wrap: anywhere;
    -webkit-hyphens: auto;
    hyphens: auto;
    text-wrap: balance;
}
/* UN MOT COURT NE SE COUPE PAS. La cesure sert au mot qui ne tient pas dans sa ligne
   (« Établissement » a cote de « Plus ▾ ») ; sans limite, l'equilibrage des lignes
   s'en servait aussi pour couper « Rap-port effectifs » ou « Maté-riel confié ». A
   partir de 360 px, seuls les mots de dix lettres et plus se coupent, avec quatre
   lettres au moins de chaque cote ; en deca, la place manque trop pour s'en priver. */
@media (min-width: 360px) {
    .bp-topbar-title h1 { -webkit-hyphenate-limit-before: 4; -webkit-hyphenate-limit-after: 4; hyphenate-limit-chars: 10 4 4; }
}
/* Au telephone (moins de 576 px), le titre passe avant le decor : l'initiale de
   l'etablissement s'efface, la cloche ne garde pas de marge et « Plus ▾ » se
   resserre - « Planning » tient sur une ligne a 390 px, au lieu de « Plan-ning »
   sur deux. */
@media (max-width: 575.98px) {
    .bp-topbar .bp-avatar { display: none; }
    .bp-topbar > .btn.me-2 { margin-right: 0 !important; }
    .esp-plus > summary.esp-plus-bouton { padding-inline: .6rem; }
}
/* Sous 375 px, il lui faut plus de place encore : « Plus ▾ » se reduit a sa fleche
   (le mot reste lu par VoiceOver et TalkBack) - « Avis par créneau » tient sur deux
   lignes, sans mot coupe en deux. */
@media (max-width: 374.98px) {
    .esp-plus-mot { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden;
        clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; }
}
.bp-topbar-title p {
    margin: 0;
    font-size: var(--bp-fs-small);
    color: var(--bp-text-3);
    line-height: 1.35;
    overflow-wrap: anywhere;
    text-wrap: pretty;
}

/* LA MARQUE EN TETE DE LA BARRE LATERALE (_marque_espace.html) : le sigle, le mot
   « Ryado » dessous, puis, plus discrets, le nom et le role ; le tout centre. Le mot
   est un trace : il prend la couleur du texte, noir sur un fond clair, blanc sur un
   fond sombre. */
.esp-tete {
    display: flex; flex-direction: column; align-items: center;
    margin-bottom: var(--bp-3); padding: 0 var(--bp-2);
    text-align: center;
}
.esp-mot { display: block; width: auto; height: 24px; margin-top: var(--bp-2h); color: var(--bp-text); fill: currentColor; }
/* LE LOGO DU MAGASIN (logo_etablissement.py), sous le mot « Ryado » de l'espace du gerant
   et de celui des salaries : sur un fond blanc, celui du papier sur lequel l'image a ete
   redessinee (sa transparence y est posee), lisible sur la tenue claire comme sur la
   sombre. Proportions gardees, jamais plus haut que le sigle. Le meme fond porte
   l'apercu de la page « Mon établissement ». */
.esp-logo-magasin, .logo-apercu img {
    display: block; width: auto; height: auto; object-fit: contain;
    padding: var(--bp-1); border-radius: var(--bp-r-sm);
    background: #ffffff; box-shadow: 0 0 0 1px var(--bp-border);
}
.esp-logo-magasin { max-width: 152px; max-height: 56px; margin-top: var(--bp-2); }
.logo-reglage { display: flex; flex-wrap: wrap; align-items: center; gap: var(--bp-3); }
.logo-apercu { flex: 0 0 auto; }
.logo-apercu img { max-width: 240px; max-height: 96px; }
.logo-apercu-vide {
    display: flex; align-items: center; justify-content: center;
    width: 160px; height: 72px; border: 1px dashed var(--bp-border-strong);
    border-radius: var(--bp-r-sm); color: var(--bp-text-3); font-size: var(--bp-fs-small);
}
.logo-gestes { flex: 1 1 280px; min-width: 0; }
/* LE NOM EN TETE DE LA BARRE LATERALE (le salarie, l'etablissement, l'enseigne, le
   comite, le cabinet) : en entier, sur deux lignes s'il le faut - « CSE de la
   Boulangerie Morvan — Graslin » n'est plus coupe a 150 px. */
.esp-marque { min-width: 0; max-width: 100%; margin: var(--bp-2) 0 0; font-size: var(--bp-fs-small); font-weight: 600;
    line-height: 1.3; letter-spacing: 0; color: var(--bp-text-2); overflow-wrap: anywhere; text-wrap: balance; }
.esp-role { margin-top: 2px; font-size: var(--bp-fs-micro); line-height: 1.35; color: var(--bp-text-3); }
/* EN HAUT DU TIROIR, au telephone : le choix de la tenue d'un cote, la croix qui
   referme de l'autre. Sur un grand ecran, ni l'un ni l'autre : la rangee s'efface. */
.esp-outils { display: none; }
@media (max-width: 991.98px) {
    .esp-outils { display: flex; align-items: center; justify-content: space-between; gap: var(--bp-2); margin-bottom: var(--bp-3); }
    .esp-outils > .btn { margin-inline-start: auto; }
}

.mobile-toggle-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: var(--bp-tap);
    height: var(--bp-tap);
    flex-shrink: 0;
    background: transparent;
    border: 0;
    border-radius: var(--bp-r-sm);
    color: var(--bp-text);
    font-size: 1.125rem;
    cursor: pointer;
    transition: background-color var(--bp-duree-1) var(--bp-courbe);
}
.mobile-toggle-btn:hover { background: var(--bp-surface-3); }
.mobile-toggle-btn:active { transform: scale(.96); }
@media (min-width: 992px) { .mobile-toggle-btn { display: none; } }

/* --- Zone de contenu --- */
.bp-page { padding-top: var(--bp-4); }

/* Tableau de bord : tuiles d'indicateurs */
.kpi-title {
    font-size: var(--bp-fs-small);
    font-weight: 500;
    line-height: 1.45;
    letter-spacing: 0;
    color: var(--bp-text-3);
}
/* Le chiffre cle : grand, tabulaire, a la couleur du texte. Son etat, s'il en a
   un, se dit par une pastille a cote - pas par la couleur du chiffre. */
.kpi-value { font-weight: 600; line-height: 1.1; letter-spacing: -0.02em; color: var(--bp-text); }
/* Sa taille, sauf si le gabarit en choisit une (.fs-4...). */
.kpi-value:not([class*="fs-"]) { font-size: var(--bp-fs-chiffre); }

/* --- Barre d'onglets de l'espace salarie ---------------------------------
   Un salarie ouvre son planning au telephone, souvent debout, d'une main. Une
   barre d'onglets en bas place les quatre destinations sous le pouce ; un tiroir
   imposerait deux gestes (ouvrir, viser) pour chaque changement d'ecran.
   Au-dela de 992px elle disparait au profit de la barre laterale. */
.bp-tabbar {
    position: fixed;
    inset-inline: 0;
    bottom: 0;
    z-index: 1045;
    display: flex;
    /* Plus dense que la barre du haut : de petits libelles se lisent dessus pendant
       que la page defile dessous. */
    background: rgba(var(--bp-surface-rgb), 0.94);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-top: 1px solid var(--bp-border);
    /* Laisse passer la barre de geste de l'iPhone, sinon le dernier onglet est
       a moitie recouvert et devient difficile a atteindre. */
    padding-bottom: env(safe-area-inset-bottom, 0);
}
.bp-tabbar a {
    flex: 1 1 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: var(--bp-1);
    min-height: var(--bp-tabbar-h);
    padding: var(--bp-1) 2px;
    font-size: var(--bp-fs-micro);
    font-weight: 600;
    line-height: 1.15;
    text-align: center;
    color: var(--bp-text-3);
    text-decoration: none;
    -webkit-tap-highlight-color: transparent;
    transition: color var(--bp-duree-1) var(--bp-courbe);
}
.bp-tabbar a i { font-size: 1.375rem; transition: transform var(--bp-duree-1) var(--bp-courbe); }
.bp-tabbar a.active { color: var(--bp-primary-soft); }
/* Les onglets du bas reprennent la couleur de leur rubrique (meme teinte que dans
   le menu) ; le libelle de l'onglet ouvert s'eclaire. */
.bp-tabbar a { --rub: #8fb5ff; }
.bp-tabbar a[data-rub="planning"] { --rub: #c39bff; }
.bp-tabbar a:is([data-rub="heures"], [data-rub="a_faire"]) { --rub: #f5bd5b; }
.bp-tabbar a:is([data-rub="paie"], [data-rub="demandes"]) { --rub: #4fd6a2; }
.bp-tabbar a[data-rub="documents"] { --rub: #f7a07e; }
.bp-tabbar a[data-rub="messages"] { --rub: #f48fb8; }
.bp-tabbar a[data-rub="collectif"] { --rub: #6cc3f5; }
.bp-tabbar a:is([data-rub="compte"]) { --rub: #9fc5ff; }
.bp-tabbar a[data-rub] > i { color: var(--rub); }
.bp-tabbar a[data-rub].active { color: var(--bp-text); }
.bp-tabbar a:active i { transform: scale(.94); }
.bp-tabbar a:focus-visible { outline-offset: -2px; }

/* Cinq onglets sur un ecran de 360 px laissent 72 px chacun : le libelle doit
   tenir sur UNE ligne, sinon la barre grandit et masque le contenu qu'on vient
   justement de degager. */
.bp-tabbar a span {
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
@media (max-width: 380px) {
    .bp-tabbar a { font-size: 0.6875rem; padding-inline: 1px; }
    .bp-tabbar a i { font-size: 1.25rem; }
}

/* Le contenu doit pouvoir defiler entierement au-dessus de la barre, faute de
   quoi le dernier bouton d'une page reste inaccessible. */
body.has-tabbar .main-content {
    /* Hauteur de la barre, plus une respiration : sans cette marge le dernier
       bouton d'une page se retrouve sous les onglets, donc inaccessible. */
    padding-bottom: calc(var(--bp-tabbar-h) + 1.5rem + env(safe-area-inset-bottom, 0px));
}
@media (min-width: 992px) {
    .bp-tabbar { display: none; }
    body.has-tabbar .main-content { padding-bottom: var(--bp-5); }
}

/* =========================================================================
   7. ACCESSIBILITE ET PREFERENCES
   ========================================================================= */

/* Respecte le reglage systeme « reduire les animations » : pour une personne
   sujette au mal des transports, une transition de tiroir peut provoquer un
   malaise reel. */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* Mode contraste eleve : bordures franches, plus de transparence. */
@media (prefers-contrast: more) {
    :root {
        --bp-border: #707080; --bp-border-strong: #9898a6; --bp-border-control: #c3c3cd;
        --bp-text-2: #e4e4ea; --bp-text-3: #c3c3cd; --bp-text-4: #9898a6;
        --bp-glass: var(--bp-surface);
    }
}

/* Impression : l'inspection du travail et les representants du personnel
   demandent des documents papier. La barre laterale et les actions n'ont aucun
   sens imprimees ; le fond sombre viderait une cartouche pour rien. */
@media print {
    body { background: #fff !important; color: #000 !important; }
    .sidebar, .sidebar-backdrop, .bp-topbar, .mobile-toggle-btn, .esp-plus,
    .btn, .modal, form[method="post"] { display: none !important; }
    .main-content { margin-left: 0 !important; padding: 0 !important; }
    .glass-panel {
        background: #fff !important;
        border: 1px solid #999 !important;
        box-shadow: none !important;
        break-inside: avoid;
    }
    .text-white, .text-secondary, .text-muted,
    h1, h2, h3, h4, h5, h6, td, th { color: #000 !important; }
    .table-wrap { overflow: visible !important; max-height: none !important; }
    thead { display: table-header-group; }
    .bp-evitement, .bp-toasts { display: none !important; }
    .defile-gauche, .defile-droite { -webkit-mask-image: none !important; mask-image: none !important; }
    a[href]::after { content: ""; }
}

/* AU TELEPHONE, RIEN NE SORT DE L'ECRAN. Le corps coupe le debordement
   horizontal : un bouton ou un chiffre trop large y deviendrait invisible.
   Les rangees de boutons passent a la ligne, les longs chiffres et les
   codes se coupent, et les grands chiffres des cartes se font plus petits. */
@media (max-width: 575.98px) {
    .bp-page .d-flex.gap-1, .bp-page .d-flex.gap-2, .bp-page .d-flex.gap-3 { flex-wrap: wrap; }
    .bp-page .btn { white-space: normal; max-width: 100%; }
    /* Dans un tableau, le bouton garde son libelle sur une ligne (« 6 mois »,
       « Valider le paiement du salaire ») : c'est le tableau qui defile dans son
       cadre, le bord en degrade le montre (section 6 de biopoint.js). */
    .bp-page td .btn, .bp-page th .btn { white-space: nowrap; max-width: none; }
    /* Un bouton a long libelle hors d'une .bp-page (sessions et
       second facteur) passe aussi a la ligne : 391 px ne tiennent pas sur 375. */
    .btn.btn-long { white-space: normal; max-width: 100%; }
    /* Il prend toute la largeur : son libelle y tient le plus souvent sur une ligne. */
    .btn.btn-long { width: 100%; margin-inline-end: 0 !important; }
    .bp-page .fs-3, .bp-page .fs-4, .bp-page .font-monospace,
    .bp-page code, .bp-page .dsn-code { overflow-wrap: anywhere; }
    .bp-page .fs-4.font-monospace, .bp-page .fs-3.font-monospace { font-size: 1.1rem !important; }
}

/* --- LA PAGE ALERTES (_alertes.html), la meme dans toutes les interfaces : les
       familles en tuiles, puis les alertes d'une famille. La tuile prend la couleur
       de sa rubrique (`data-rub`, ci-dessus) ; l'etat est toujours ecrit en toutes
       lettres a cote de la couleur. --- */
.al-grille { display: grid; grid-template-columns: 1fr; gap: var(--bp-3); margin: 0; padding: 0; list-style: none; }
@media (min-width: 576px) { .al-grille { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 992px) { .al-grille { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.al-grille > li { min-width: 0; }
.al-tuile { min-width: 0; display: flex; gap: var(--bp-3); align-items: flex-start; min-height: 72px; padding: var(--bp-3);
            border: 1px solid var(--bp-border); border-left: 2px solid var(--rub); border-radius: var(--bp-r-sm);
            background: var(--bp-surface); color: var(--bp-text); text-decoration: none; }
.al-tuile:hover, .al-tuile:focus-visible { background: color-mix(in srgb, var(--rub) 8%, var(--bp-surface)); color: var(--bp-text); }
.al-tuile .esp-ico { margin-top: 2px; }
.al-tuile-corps { flex: 1 1 auto; min-width: 0; }
.al-tuile-titre { display: flex; align-items: center; gap: var(--bp-2); font-weight: 600; }
.al-apercu { display: block; margin-top: 2px; color: var(--bp-text-2); font-size: .875rem;
             overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.al-compte { margin-left: auto; min-width: 24px; padding: 0 8px; border-radius: 999px; font-size: var(--bp-fs-micro);
             line-height: 22px; text-align: center; background: var(--bp-surface-2); color: var(--bp-text); border: 1px solid var(--bp-border); }
.al-compte.al-danger { background: var(--bp-danger); border-color: var(--bp-danger); color: #fff; }
.al-entete { display: flex; flex-wrap: wrap; align-items: center; gap: var(--bp-2) var(--bp-3); margin-bottom: var(--bp-3); }
.al-entete h2 { display: flex; align-items: center; gap: var(--bp-2); margin: 0; font-size: 1.125rem; }
.al-entete form { margin: 0 0 0 auto; }
.al-retour { display: inline-flex; align-items: center; gap: 6px; min-height: var(--bp-tap); color: var(--bp-text-2); text-decoration: none; }
.al-liste { margin: 0; padding: 0; list-style: none; }
.al-alerte { display: flex; flex-wrap: wrap; gap: var(--bp-2) var(--bp-3); align-items: flex-start; padding: var(--bp-3);
             margin-bottom: var(--bp-2); border: 1px solid var(--bp-border); border-radius: var(--bp-r-sm); background: transparent; }
.al-alerte.al-non-lue { border-left: 2px solid var(--rub); background: color-mix(in srgb, var(--rub) 6%, transparent); }
.al-alerte.al-non-lue .al-titre { font-weight: 600; }
.al-alerte-corps { flex: 1 1 260px; min-width: 0; }
.al-titre { display: block; color: var(--bp-text); }
.al-message { display: block; color: var(--bp-text-2); font-size: .875rem; white-space: pre-line; overflow-wrap: anywhere; }
.al-meta { display: flex; flex-wrap: wrap; gap: 6px var(--bp-2); margin-top: 4px; color: var(--bp-text-2); font-size: var(--bp-fs-micro); }
.al-etat { font-weight: 600; color: var(--bp-text); }
.al-voir { flex: none; align-self: center; min-height: var(--bp-tap); min-width: var(--bp-tap); display: inline-flex; align-items: center; gap: 6px; }
.al-vide { color: var(--bp-text-2); margin: 0; }

/* UNE OFFRE BLOQUEE DEPUIS LA CONSOLE (inscriptions_offres.py) : partout ou elle se
   presente, sa carte est grisee, sans lien, sous le badge « Bientot disponible ». */
.offre-bloquee { opacity: .55; filter: grayscale(1); }
.offre-bloquee a, .offre-bloquee button, .offre-bloquee input { pointer-events: none; }
.offre-bientot { display: inline-block; align-self: flex-start; padding: 2px 8px; border-radius: var(--bp-r-pill); border: 1px solid rgba(var(--bp-warning-rgb), 0.35); background: var(--bp-warning-fond); color: var(--bp-warning); font-size: .75rem; font-weight: 600; white-space: nowrap; filter: none; }
/* La mention sous les prix Ryado (templates/_mention_prix_ht.html, decision du 14/11/2026). */
.mention-prix-ht { margin: .75rem 0 0; font-size: .78rem; line-height: 1.45; opacity: .85; overflow-wrap: anywhere; }

/* =========================================================================
   LA TENUE DE L'ESPACE : SOMBRE, CLAIR OU MOITIÉ (html[data-tenue])
   Clair est la tenue par défaut : elle redonne aux jetons leur valeur
   claire ; « moitié » fait de même, puis rend leur valeur sombre aux menus
   (la barre latérale et la barre du bas). Le choix se fait en haut de
   l'espace (_choix_tenue.html) et se garde sur l'appareil (tenue.js) ; le
   serveur pose l'attribut à chaque page (app.py, injecter_la_tenue).
   ========================================================================= */
html[data-tenue="clair"], html[data-tenue="moitie"] {
    color-scheme: light;
    --bp-bg: #ffffff; --bp-surface: #f6f6f9; --bp-surface-2: #eeeef3; --bp-surface-3: #e4e4eb;
    --bp-glass: rgba(255, 255, 255, 0.88); --bp-overlay: rgba(16, 16, 40, 0.45);
    --bp-border: #e3e3ea; --bp-border-strong: #cfcfd9; --bp-border-control: #85859a;
    --bp-text: #0b0b10; --bp-text-2: #3b3b48; --bp-text-3: #5a5a69; --bp-text-4: #6f6f7d;
    --bp-primary: #1257d6; --bp-primary-hover: #0f4bbd; --bp-primary-soft: #0f4bbd; --bp-primary-glow: #e6eefc;
    --bp-info: #1d5fbf; --bp-success: #0b7a53; --bp-success-soft: #0b7a53; --bp-warning: #94640a;
    --bp-danger: #c62f2a; --bp-danger-hover: #b02925; --bp-danger-soft: #b3261e;
    --bp-success-fond: #e4f6ee; --bp-warning-fond: #fbf1dc; --bp-danger-fond: #fdeceb; --bp-info-fond: #e8f1fd;
    --bp-surface-rgb: 246, 246, 249; --bp-neutre-rgb: 90, 90, 105; --bp-primary-rgb: 18, 87, 214;
    --bp-primary-soft-rgb: 15, 75, 189; --bp-info-rgb: 29, 95, 191; --bp-success-soft-rgb: 11, 122, 83;
    --bp-warning-rgb: 148, 100, 10; --bp-danger-soft-rgb: 179, 38, 30;
    --bp-shadow: 0 8px 24px rgba(16, 16, 40, 0.08); --bp-shadow-lg: 0 24px 64px rgba(16, 16, 40, 0.14);
    /* Bleu et blanc, comme le site public : le titre de page en marine, le menu sur fond
       blanc, sa ligne ouverte au bleu du sigle sur un bleu très clair, le bouton
       secondaire blanc à filet fin, bleu au survol, et aucune ombre sur la barre du
       téléphone. */
    --bp-titre: #0b1f4b; --bp-menu-fond: #ffffff;
    --bp-actif-texte: #1257d6; --bp-actif-fond: #e6eefc; --bp-actif-trait: #1257d6;
    --bp-second-fond: #ffffff; --bp-second-survol: #e6eefc; --bp-second-encre: #1257d6; --bp-second-filet: #1257d6;
    --bp-flottant-fond: #ffffff; --bp-ombre-barre: none;
}
/* Moitié : les menus gardent la tenue sombre. */
html[data-tenue="moitie"] .sidebar, html[data-tenue="moitie"] .bp-tabbar {
    color-scheme: dark; color: var(--bp-text);
    --bp-bg: #09090b; --bp-surface: #111115; --bp-surface-2: #18181d; --bp-surface-3: #1f1f25;
    --bp-glass: rgba(17, 17, 21, 0.86); --bp-overlay: rgba(5, 5, 8, 0.72);
    --bp-border: #26262e; --bp-border-strong: #383843; --bp-border-control: #707080;
    --bp-text: #f3f3f6; --bp-text-2: #c3c3cd; --bp-text-3: #9898a6; --bp-text-4: #6e6e7c;
    --bp-primary: #1257d6; --bp-primary-hover: #0f49b5; --bp-primary-soft: #8fb5ff; --bp-primary-glow: rgba(18, 87, 214, 0.16);
    --bp-focus: #8fb5ff;
    --bp-info: #7cb7ff; --bp-success: #1f9d6c; --bp-success-soft: #3ccf91; --bp-warning: #f2b544;
    --bp-danger: #d93a35; --bp-danger-hover: #c83531; --bp-danger-soft: #f2706b;
    --bp-success-fond: #162824; --bp-warning-fond: #2c251b; --bp-danger-fond: #2c1c1f; --bp-info-fond: #1e2531;
    --bp-surface-rgb: 17, 17, 21; --bp-neutre-rgb: 152, 152, 166; --bp-primary-rgb: 18, 87, 214;
    --bp-primary-soft-rgb: 143, 181, 255; --bp-info-rgb: 124, 183, 255; --bp-success-soft-rgb: 60, 207, 145;
    --bp-warning-rgb: 242, 181, 68; --bp-danger-soft-rgb: 242, 112, 107;
    --bp-shadow: 0 8px 24px rgba(0, 0, 0, 0.40); --bp-shadow-lg: 0 24px 64px rgba(0, 0, 0, 0.55);
    --bp-titre: var(--bp-text); --bp-menu-fond: var(--bp-surface);
    --bp-actif-texte: var(--bp-text); --bp-actif-fond: var(--bp-surface-3); --bp-actif-trait: var(--bp-primary-soft);
    --bp-second-fond: var(--bp-surface-2); --bp-second-survol: var(--bp-surface-3); --bp-second-encre: var(--bp-text);
    --bp-second-filet: var(--bp-border-strong); --bp-flottant-fond: var(--bp-surface-3);
    --bp-ombre-barre: 0 -8px 28px rgba(0, 0, 0, 0.28), 0 -1px 0 rgba(255, 255, 255, 0.04);
}
/* Au doigt, rien ne se survole : un bouton touché garderait le bleu du survol jusqu'au
   toucher suivant. Là où l'on ne survole pas, le bouton secondaire garde ses gris. */
@media (hover: none) {
    html[data-tenue="clair"], html[data-tenue="moitie"] {
        --bp-second-survol: var(--bp-surface-2); --bp-second-encre: var(--bp-text); --bp-second-filet: var(--bp-border-strong);
    }
}
/* Dans les applications, une page claire garde une bande sombre de la hauteur de la barre
   d'état du téléphone : l'heure et la batterie, que l'application écrit en clair, restent
   lisibles. */
html[data-appli]:is([data-tenue="clair"], [data-tenue="moitie"]) > body::after {
    content: ""; position: fixed; inset: 0 0 auto 0; z-index: 3000; height: env(safe-area-inset-top, 0px);
    background: #09090b; pointer-events: none;
}
/* Les couleurs des rubriques : plus soutenues sur un fond clair, pour rester lisibles. */
html:is([data-tenue="clair"], [data-tenue="moitie"]) :is(.esp-rub, .es-rubrique, .al-famille) { --rub: #0f4bbd; }
html[data-tenue="moitie"] .sidebar :is(.esp-rub, .es-rubrique, .al-famille) { --rub: #8fb5ff; }
html:is([data-tenue="clair"], [data-tenue="moitie"]) :is(.esp-rub, .es-rubrique, .al-famille)[data-rub="accueil"] { --rub: #0f4bbd; }
html[data-tenue="moitie"] .sidebar :is(.esp-rub, .es-rubrique, .al-famille)[data-rub="accueil"] { --rub: #8fb5ff; }
html:is([data-tenue="clair"], [data-tenue="moitie"]) :is(.esp-rub, .es-rubrique, .al-famille):is([data-rub="planning"], [data-rub="echanges"], [data-rub="assistant"]) { --rub: #7a3fd6; }
html[data-tenue="moitie"] .sidebar :is(.esp-rub, .es-rubrique, .al-famille):is([data-rub="planning"], [data-rub="echanges"], [data-rub="assistant"]) { --rub: #c39bff; }
html:is([data-tenue="clair"], [data-tenue="moitie"]) :is(.esp-rub, .es-rubrique, .al-famille):is([data-rub="heures"], [data-rub="chiffres"], [data-rub="a_faire"]) { --rub: #94640a; }
html[data-tenue="moitie"] .sidebar :is(.esp-rub, .es-rubrique, .al-famille):is([data-rub="heures"], [data-rub="chiffres"], [data-rub="a_faire"]) { --rub: #f5bd5b; }
html:is([data-tenue="clair"], [data-tenue="moitie"]) :is(.esp-rub, .es-rubrique, .al-famille):is([data-rub="equipe"], [data-rub="salaries"], [data-rub="employeur"], [data-rub="collectif"], [data-rub="signalements"]) { --rub: #0b6aa8; }
html[data-tenue="moitie"] .sidebar :is(.esp-rub, .es-rubrique, .al-famille):is([data-rub="equipe"], [data-rub="salaries"], [data-rub="employeur"], [data-rub="collectif"], [data-rub="signalements"]) { --rub: #6cc3f5; }
html:is([data-tenue="clair"], [data-tenue="moitie"]) :is(.esp-rub, .es-rubrique, .al-famille):is([data-rub="paie"], [data-rub="argent"], [data-rub="mandat"], [data-rub="demandes"]) { --rub: #0b7a53; }
html[data-tenue="moitie"] .sidebar :is(.esp-rub, .es-rubrique, .al-famille):is([data-rub="paie"], [data-rub="argent"], [data-rub="mandat"], [data-rub="demandes"]) { --rub: #4fd6a2; }
html:is([data-tenue="clair"], [data-tenue="moitie"]) :is(.esp-rub, .es-rubrique, .al-famille)[data-rub="documents"] { --rub: #b34a1a; }
html[data-tenue="moitie"] .sidebar :is(.esp-rub, .es-rubrique, .al-famille)[data-rub="documents"] { --rub: #f7a07e; }
html:is([data-tenue="clair"], [data-tenue="moitie"]) :is(.esp-rub, .es-rubrique, .al-famille):is([data-rub="conformite"], [data-rub="securite"], [data-rub="systeme"], [data-rub="cles_api"], [data-rub="formation"]) { --rub: #0a7a78; }
html[data-tenue="moitie"] .sidebar :is(.esp-rub, .es-rubrique, .al-famille):is([data-rub="conformite"], [data-rub="securite"], [data-rub="systeme"], [data-rub="cles_api"], [data-rub="formation"]) { --rub: #4fd1cf; }
html:is([data-tenue="clair"], [data-tenue="moitie"]) :is(.esp-rub, .es-rubrique, .al-famille):is([data-rub="entreprise"], [data-rub="magasins"], [data-rub="clients"], [data-rub="messagerie"], [data-rub="messages"]) { --rub: #b82c6e; }
html[data-tenue="moitie"] .sidebar :is(.esp-rub, .es-rubrique, .al-famille):is([data-rub="entreprise"], [data-rub="magasins"], [data-rub="clients"], [data-rub="messagerie"], [data-rub="messages"]) { --rub: #f48fb8; }
html:is([data-tenue="clair"], [data-tenue="moitie"]) :is(.esp-rub, .es-rubrique, .al-famille):is([data-rub="aide"], [data-rub="compte"], [data-rub="autres"]) { --rub: #1d5fbf; }
html[data-tenue="moitie"] .sidebar :is(.esp-rub, .es-rubrique, .al-famille):is([data-rub="aide"], [data-rub="compte"], [data-rub="autres"]) { --rub: #9fc5ff; }
/* En tenue claire, le repère de la page ouverte est celui de la ligne ouverte : le bleu de
   la marque, quelle que soit la rubrique. */
html[data-tenue="clair"] .esp-rub { --esp-accent: var(--bp-actif-trait); }
html[data-tenue="clair"] .bp-tabbar a { --rub: #0f4bbd; }
html[data-tenue="clair"] .bp-tabbar a[data-rub="planning"] { --rub: #7a3fd6; }
html[data-tenue="clair"] .bp-tabbar a:is([data-rub="heures"], [data-rub="a_faire"]) { --rub: #94640a; }
html[data-tenue="clair"] .bp-tabbar a:is([data-rub="paie"], [data-rub="demandes"]) { --rub: #0b7a53; }
html[data-tenue="clair"] .bp-tabbar a[data-rub="documents"] { --rub: #b34a1a; }
html[data-tenue="clair"] .bp-tabbar a[data-rub="messages"] { --rub: #b82c6e; }
html[data-tenue="clair"] .bp-tabbar a[data-rub="collectif"] { --rub: #0b6aa8; }
html[data-tenue="clair"] .bp-tabbar a:is([data-rub="compte"]) { --rub: #1d5fbf; }

/* Les trois boutons du haut de l'espace. */
.bp-tenue {
    display: inline-flex; align-items: center; gap: 2px; flex: 0 0 auto; margin-inline-start: var(--bp-2); padding: 2px;
    border: 1px solid var(--bp-border); border-radius: var(--bp-r-pill); background: var(--bp-surface);
}
.bp-tenue-bouton {
    display: inline-grid; place-items: center; width: 30px; height: 30px; padding: 0; border: 0;
    border-radius: var(--bp-r-pill); color: var(--bp-text-3); background: transparent; cursor: pointer;
    transition: background-color var(--bp-duree-1) ease, color var(--bp-duree-1) ease;
}
.bp-tenue-bouton:hover { color: var(--bp-text); }
.bp-tenue-bouton[aria-pressed="true"] { color: var(--bp-actif-texte); background: var(--bp-actif-fond); }
.bp-tenue-bouton svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.bp-tenue-bouton .bp-tenue-plein { fill: currentColor; stroke: none; }
/* Sur un grand écran, les boutons sont dans la barre du haut ; sur un petit, où cette
   barre n'a plus de place, ils sont en haut du menu. */
.sidebar .bp-tenue { display: none; margin: 0; }
@media (max-width: 991.98px) {
    .bp-topbar > .bp-tenue { display: none; }
    .sidebar .bp-tenue { display: inline-flex; }
    .sidebar .bp-tenue .bp-tenue-bouton { width: var(--bp-tap); height: var(--bp-tap); }
}
