/* ============================================================
   ui.css — la couche visuelle du panneau d'administration
   ============================================================
   Chargée APRÈS app.css, qu'elle ne remplace pas : app.css garde la
   structure (grilles, lignes, champs, feuilles), ce fichier porte le
   MATÉRIAU. Retirer la ligne <link> dans layout.ejs rend le dashboard
   lisible, simplement sans verre.

   ── Pourquoi une réécriture et pas une couche de plus ────────────
   Le fichier précédent empilait trois réglages successifs du verre
   (« VERRE », puis « VERRE — PLUS FRANC » qui écrasait le premier),
   trois définitions du fond et deux de l'encre. Le résultat ne
   ressemblait à aucune des trois intentions :

     • un grain à 42 % d'opacité en `overlay` — Fluent en met 2 %. Il
       salissait chaque carte en gris, d'où l'effet « plastique sale » ;
     • un reflet blanc en `soft-light` qui, en sombre, voilait tout
       d'une brume grise ;
     • un fond ANIMÉ sous vingt surfaces floutées : chaque image, le
       navigateur recalculait tous les flous. Sur un portable, c'est le
       ventilateur ;
     • et surtout un substrat presque uni (#F2F2F7, halos à 10-40 %
       dilués par un second flou) : un backdrop-filter au-dessus d'un
       aplat ne produit RIEN. On voyait des cartes grises, pas du verre.

   ── Ce que disent les références, et ce qui en est tiré ──────────
   (Apple HIG « Materials » et Liquid Glass, Microsoft Fluent
   « Acrylic », Nielsen Norman Group, Josh W. Comeau « Next-level
   frosted glass », Axess Lab sur l'accessibilité du verre.)

   1. Le verre n'existe que par ce qu'il y a derrière. Le fond est un
      dégradé maillé franc, fixe, aux couleurs de la marque. Immobile :
      un fond qui bouge sous du flou coûte à chaque image.
   2. Peu de niveaux, bien distincts : le fond, les panneaux, le chrome
      (la barre de navigation), et ce qui flotte (menus, feuilles,
      notifications). Plus on monte, plus c'est flou et opaque.
   3. Le verre va sur les contenants, jamais sur les lignes, et jamais
      verre dans verre : un backdrop-filter imbriqué ne voit que son
      parent, pas la page. Les contenants imbriqués deviennent des
      creux légers, sans flou.
   4. C'est l'ARÊTE qui fait le verre : un liseré dégradé, clair là où
      la lumière arrive (en haut à gauche), qui s'éteint en bas. Un
      contour gris uniforme fait un rectangle pâle.
   5. Le grain est à peine perceptible (4-6 %) : il donne le dépoli
      sans se voir comme une texture.
   6. L'encre est mesurée, pas choisie à l'œil : 4,5:1 minimum pour le
      texte secondaire, calculé au pire endroit (sur le halo le plus
      saturé). La translucidité se paie en encre, pas en lisibilité.
   7. Accessibilité : `prefers-reduced-transparency` et
      `prefers-contrast: more` rendent des surfaces OPAQUES ; sans
      backdrop-filter, idem. Le verre est un bonus, jamais une
      condition de lecture.
   8. La barre du haut floute ce qui est SOUS elle et un peu au-delà
      (Comeau) : le flou déborde vers le bas puis est découpé. Au
      passage, la barre cesse d'être une « racine de fond » — ses menus
      déroulants peuvent enfin flouter la page, au lieu de rien.
   ============================================================ */


/* ═══════════════════════════════════════════════════════════
   1. JETONS
   ═══════════════════════════════════════════════════════════ */

:root {
    /* ─── Marque ──────────────────────────────────────────────
       Calculée, pas choisie — et au PIRE endroit : sur le verre le
       plus transparent, posé au cœur du halo violet (du violet sur du
       violet). #4A3DC4 y fait 5,04:1 (7,62 sur blanc) ; en sombre,
       #ACA0FC fait 5,28:1. Les tons précédents (#5145CD, #9B8AFB)
       passaient sur fond uni mais tombaient à 4,51 et 3,93 sur le
       halo. Sur le violet clair du mode sombre, un texte BLANC
       tomberait sous 3:1 — d'où un jeton pour l'encre des boutons. */
    --marque:        #4A3DC4;
    --marque-doux:   color-mix(in srgb, #4A3DC4 12%, transparent);
    --marque-texte:  #FFFFFF;
    --accent:        var(--marque);

    /* ─── Palette catégorielle ─────────────────────────────────
       Ordre FIXE, validée (guide de dataviz) dans les deux modes. Ne
       pas permuter : une part garde sa couleur quand le filtre change
       leur nombre. */
    --c1: #007AFF;  --c2: #34C759;  --c3: #AF52DE;
    --c4: #FF9500;  --c5: #30B0C7;  --c6: #FF3B30;

    /* ─── Encre ───────────────────────────────────────────────
       Pire cas calculé (verre le plus transparent, cœur du halo) :
         texte principal     11,8:1
         texte secondaire     5,3:1 clair · 5,8:1 sombre
         texte tertiaire      4,0:1 clair · 4,7:1 sombre — réservé
                              aux indications, jamais à l'essentiel. */
    --label:     #15152B;
    --label-2:   rgba(28, 28, 56, .72);
    --label-3:   rgba(28, 28, 56, .62);
    --separator: rgba(40, 40, 90, .12);

    /* ─── Le fond (substrat) ─────────────────────────────────── */
    --fond:      #ECEEF8;
    /* Le violet-rose-bleu est LA signature des interfaces générées. La
       marque garde un seul halo ; les autres sont un froid (ciel) et un
       chaud (abricot), qui donnent au verre des couleurs à réfracter
       sans refaire l'affiche de toutes les startups de 2021. */
    --halo-1:    rgba(124, 108, 246, .42);   /* marque            */
    --halo-2:    rgba(56, 189, 248, .40);    /* ciel              */
    --halo-3:    rgba(251, 146, 60, .30);    /* abricot           */
    --halo-4:    rgba(45, 212, 191, .24);    /* eau               */

    /* ─── Le verre ───────────────────────────────────────────── */
    --verre-haut:     rgba(255, 255, 255, .68);  /* haut du panneau   */
    --verre-bas:      rgba(255, 255, 255, .44);  /* bas du panneau    */
    --verre-chrome:   rgba(255, 255, 255, .60);  /* barre du haut     */
    --verre-flottant: rgba(250, 250, 255, .84);  /* menus, feuilles   */
    --verre-creux:    rgba(255, 255, 255, .45);  /* contenant imbriqué */
    --arete-haut:     rgba(255, 255, 255, .98);
    --arete-bas:      rgba(255, 255, 255, .30);
    --contour:        rgba(40, 40, 110, .07);    /* détache du fond clair */
    --reflet:         inset 0 1px 0 rgba(255, 255, 255, .9);
    --ombre:          0 1px 2px rgba(30, 30, 80, .05), 0 14px 36px -14px rgba(60, 50, 150, .22);
    --ombre-haute:    0 2px 6px rgba(30, 30, 80, .06), 0 28px 70px -20px rgba(50, 40, 140, .35);
    --trait:          rgba(40, 40, 90, .08);     /* séparateurs internes */
    --survol:         rgba(81, 69, 205, .06);
    --creux:          rgba(40, 40, 110, .05);    /* champs, pistes */
    --flou:           20px;
    --flou-chrome:    24px;
    --flou-flottant:  32px;
    --grain: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)' opacity='.045'/%3E%3C/svg%3E");

    /* La couleur à laquelle ressemble une carte une fois rendue : sert
       aux filets de 2 px entre les parts de l'anneau. */
    --surface-carte: #F4F3FC;

    /* app.css lit encore ces jetons : on les aligne sur le verre. */
    --bg:        var(--fond);
    --surface:   #FFFFFF;
    --surface-2: #FFFFFF;
    --surface-3: var(--creux);
    --material:  var(--verre-chrome);
    --material-2: var(--verre-flottant);
    --shadow-1:  var(--ombre);
    --shadow-2:  var(--ombre-haute);
    --shadow-3:  var(--ombre-haute);

    --r-sm: 8px;  --r-md: 11px;  --r-lg: 16px;  --r-xl: 22px;
    --nav-h: 58px;
    --largeur: 1280px;
    /* Sortie douce, SANS dépassement : le rebond (1,56) est l'un des
       tics des interfaces générées — rien ici ne doit « rebondir ». */
    --spring: cubic-bezier(.22, 1, .36, 1);
    --font-titre: "Segoe UI Variable Display", "SF Pro Display", "Segoe UI Semibold",
                  Inter, system-ui, -apple-system, sans-serif;
}

/* Le mode sombre est CHOISI, pas déduit : mêmes intentions, valeurs
   refaites pour un fond presque noir. Déclaré deux fois — suivre le
   système, ou le choix explicite — parce que le sélecteur manuel doit
   gagner dans les deux sens. */
@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
        --marque: #ACA0FC;
        --marque-doux: color-mix(in srgb, #ACA0FC 16%, transparent);
        --marque-texte: #1A1633;
        --c1: #0A84FF;  --c2: #22A343;  --c3: #A44BD8;
        --c4: #C67600;  --c5: #009DB8;  --c6: #FF453A;

        --label:     #F3F3FA;
        --label-2:   rgba(232, 232, 248, .74);
        --label-3:   rgba(232, 232, 248, .60);
        --separator: rgba(255, 255, 255, .10);

        --fond:   #07070F;
        --halo-1: rgba(109, 91, 248, .36);
        --halo-2: rgba(34, 211, 238, .22);
        --halo-3: rgba(234, 120, 50, .20);
        --halo-4: rgba(20, 184, 166, .20);

        --verre-haut:     rgba(255, 255, 255, .085);
        --verre-bas:      rgba(255, 255, 255, .035);
        --verre-chrome:   rgba(18, 18, 30, .55);
        --verre-flottant: rgba(24, 24, 38, .86);
        --verre-creux:    rgba(255, 255, 255, .035);
        --arete-haut:     rgba(255, 255, 255, .22);
        --arete-bas:      rgba(255, 255, 255, .04);
        --contour:        rgba(0, 0, 0, .30);
        --reflet:         inset 0 1px 0 rgba(255, 255, 255, .07);
        --ombre:          0 1px 2px rgba(0, 0, 0, .25), 0 16px 40px -16px rgba(0, 0, 0, .65);
        --ombre-haute:    0 2px 8px rgba(0, 0, 0, .35), 0 30px 80px -20px rgba(0, 0, 0, .8);
        --trait:          rgba(255, 255, 255, .07);
        --survol:         rgba(255, 255, 255, .05);
        --creux:          rgba(255, 255, 255, .06);
        --grain: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)' opacity='.06'/%3E%3C/svg%3E");
        --surface-carte: #17162A;
        --surface:   #16162A;
        --surface-2: #1E1E34;
    }
}
:root[data-theme="dark"] {
    --marque: #ACA0FC;
    --marque-doux: color-mix(in srgb, #ACA0FC 16%, transparent);
    --marque-texte: #1A1633;
    --c1: #0A84FF;  --c2: #22A343;  --c3: #A44BD8;
    --c4: #C67600;  --c5: #009DB8;  --c6: #FF453A;

    --label:     #F3F3FA;
    --label-2:   rgba(232, 232, 248, .74);
    --label-3:   rgba(232, 232, 248, .60);
    --separator: rgba(255, 255, 255, .10);

    --fond:   #07070F;
    --halo-1: rgba(109, 91, 248, .36);
    --halo-2: rgba(34, 211, 238, .22);
    --halo-3: rgba(234, 120, 50, .20);
    --halo-4: rgba(20, 184, 166, .20);

    --verre-haut:     rgba(255, 255, 255, .085);
    --verre-bas:      rgba(255, 255, 255, .035);
    --verre-chrome:   rgba(18, 18, 30, .55);
    --verre-flottant: rgba(24, 24, 38, .86);
    --verre-creux:    rgba(255, 255, 255, .035);
    --arete-haut:     rgba(255, 255, 255, .22);
    --arete-bas:      rgba(255, 255, 255, .04);
    --contour:        rgba(0, 0, 0, .30);
    --reflet:         inset 0 1px 0 rgba(255, 255, 255, .07);
    --ombre:          0 1px 2px rgba(0, 0, 0, .25), 0 16px 40px -16px rgba(0, 0, 0, .65);
    --ombre-haute:    0 2px 8px rgba(0, 0, 0, .35), 0 30px 80px -20px rgba(0, 0, 0, .8);
    --trait:          rgba(255, 255, 255, .07);
    --survol:         rgba(255, 255, 255, .05);
    --creux:          rgba(255, 255, 255, .06);
    --grain: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)' opacity='.06'/%3E%3C/svg%3E");
    --surface-carte: #17162A;
    --surface:   #16162A;
    --surface-2: #1E1E34;
}

/* L'accent suit la section : Paiements en vert, Flotte en violet,
   Journal en gris. Posé une fois sur <body>, il teinte le halo du haut
   de page et le filet du titre — on sait où l'on est sans lire. */
body[data-accent="green"]  { --accent: var(--green); }
body[data-accent="purple"] { --accent: var(--purple); }
body[data-accent="teal"]   { --accent: var(--teal); }
body[data-accent="indigo"] { --accent: var(--indigo); }
body[data-accent="orange"] { --accent: var(--orange); }
body[data-accent="blue"]   { --accent: var(--marque); }
body[data-accent="gray"]   { --accent: var(--label-3); }


/* ═══════════════════════════════════════════════════════════
   2. LE FOND
   ═══════════════════════════════════════════════════════════
   Un dégradé maillé : quatre halos francs sur une base teintée, plus
   l'accent de la section en haut. FIXE — `background-attachment` n'est
   pas fiable partout, d'où le calque en position fixed. Aucune
   animation : c'est ce qui coûtait le plus. */

html { background: var(--fond); }
body { background: transparent; color: var(--label); }

body::before {
    content: '';
    position: fixed;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    background:
        radial-gradient(60vmax 50vmax at 0% 0%,     var(--halo-1), transparent 62%),
        radial-gradient(50vmax 45vmax at 100% 10%,  var(--halo-2), transparent 60%),
        radial-gradient(55vmax 50vmax at 85% 100%,  var(--halo-3), transparent 62%),
        radial-gradient(50vmax 40vmax at 10% 95%,   var(--halo-4), transparent 60%),
        radial-gradient(40vmax 22vmax at 50% -6%,   color-mix(in srgb, var(--accent) 28%, transparent), transparent 70%),
        var(--fond);
}

/* Le grain du fond : il se voit dans les interstices et donne de la
   matière au dégradé, qui sans lui « bande » en marches visibles sur
   les écrans 8 bits. */
body::after {
    content: '';
    position: fixed;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    background-image: var(--grain);
    opacity: .8;
}


/* ═══════════════════════════════════════════════════════════
   3. LE VERRE
   ═══════════════════════════════════════════════════════════
   Une seule recette, appliquée par liste de sélecteurs. La répéter
   surface par surface garantirait qu'elles divergent. */

.card, .list, .stat, .hero, .table-wrap {
    position: relative;
    background-color: transparent;
    background-image:
        linear-gradient(180deg, var(--verre-haut), var(--verre-bas)),
        var(--grain);
    -webkit-backdrop-filter: blur(var(--flou)) saturate(170%);
    backdrop-filter: blur(var(--flou)) saturate(170%);
    border: 0;
    box-shadow: var(--reflet), 0 0 0 1px var(--contour), var(--ombre);
}

/* L'arête : un liseré dégradé, lumineux en haut à gauche, éteint en
   bas à droite. Dessiné par un calque masqué — un `border` ne sait pas
   porter un dégradé sur un fond translucide sans le teinter. */
.card::after, .list::after, .stat::after, .hero::after, .table-wrap::after,
.nav-menu::after, .cmdk-boite::after, .sheet-panel::after, .pop::after, .toast::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    padding: 1px;
    background: linear-gradient(155deg, var(--arete-haut), var(--arete-bas) 38%,
                                var(--arete-bas) 70%, color-mix(in srgb, var(--arete-haut) 45%, transparent));
    -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
    -webkit-mask-composite: xor;
    mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0);
    pointer-events: none;
}

.card, .list, .stat, .table-wrap { border-radius: var(--r-lg); }
.hero { border-radius: var(--r-xl); }

/* Jamais verre dans verre : un contenant posé DANS un panneau devient
   un creux léger, sans flou. Un backdrop-filter imbriqué ne verrait
   que son parent — et doublerait l'arête. */
.card .card, .card .list, .card .stat, .card .table-wrap,
.list .list, .list .card, .hero .card, .sheet-panel .card, .sheet-panel .list,
.pop .list, .pop .card {
    background-image: none;
    background-color: var(--verre-creux);
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
    box-shadow: inset 0 0 0 1px var(--trait);
}
.card .card::after, .card .list::after, .card .stat::after, .card .table-wrap::after,
.list .list::after, .list .card::after, .hero .card::after,
.sheet-panel .card::after, .sheet-panel .list::after, .pop .list::after, .pop .card::after { content: none; }

/* L'état vide n'est pas une surface : c'est un contenu. Il était lui
   aussi en verre, donc doublé à l'intérieur de sa propre carte. */
.empty { background: none; box-shadow: none; border: 0; }

/* Le survol soulève le verre : c'est la lumière qui bouge, pas la
   teinte. Uniquement sur ce qui est cliquable. */
a.card, a.stat {
    transition: transform .22s var(--spring), box-shadow .22s var(--ease);
}
a.card:hover, a.stat:hover {
    transform: translateY(-2px);
    text-decoration: none;
    box-shadow: var(--reflet), 0 0 0 1px var(--contour), var(--ombre-haute);
}
a.card:active, a.stat:active { transform: translateY(0) scale(.99); }


/* ═══════════════════════════════════════════════════════════
   4. MISE EN PAGE
   ═══════════════════════════════════════════════════════════ */

.shell, .shell:has(.topnav) { display: block; min-height: 100vh; }
.main { display: block; }

/* Le contenu est CENTRÉ. Il était calé à gauche avec une largeur
   maximale : sur un écran de 1440 px, un quart de l'écran restait vide
   à droite, et la page avait l'air cassée. */
.content {
    width: 100%;
    max-width: var(--largeur);
    margin: 0 auto;
    padding: 6px 32px 88px;
}

/* ─── La barre de navigation : du chrome, qui flotte ─────────── */
.topnav {
    position: sticky;
    top: 12px;
    z-index: 60;
    display: flex;
    align-items: center;
    gap: 6px;
    width: min(var(--largeur), calc(100% - 32px));
    height: var(--nav-h);
    margin: 12px auto 0;
    padding: 0 10px 0 14px;
    border: 0;
    border-radius: 18px;
    background: none;
    box-shadow: var(--reflet), 0 0 0 1px var(--contour), var(--ombre);
    isolation: isolate;
}

/* Le flou vit sur un calque, pas sur la barre. Deux raisons :
   • il descend deux fois plus bas que la barre, puis il est découpé à
     sa forme : ce qui ARRIVE sous elle est déjà flouté (Comeau) ;
   • la barre n'est plus une « racine de fond » : ses menus et le
     panneau des notifications peuvent flouter la page. Avec le flou
     sur la barre elle-même, ils ne voyaient qu'elle — c'est pour ça
     qu'ils devaient être presque opaques. */
.topnav::before {
    content: '';
    position: absolute;
    inset: 0 0 -100% 0;
    z-index: -1;
    border-radius: inherit;
    background:
        linear-gradient(180deg, var(--verre-chrome), var(--verre-chrome)) top / 100% 50% no-repeat,
        var(--grain) top / 160px 160px;
    -webkit-backdrop-filter: blur(var(--flou-chrome)) saturate(180%);
    backdrop-filter: blur(var(--flou-chrome)) saturate(180%);
    -webkit-clip-path: inset(0 0 50% 0 round 18px);
    clip-path: inset(0 0 50% 0 round 18px);
    pointer-events: none;
}
.topnav::after {
    content: '';
    position: absolute;
    inset: 0;
    z-index: -1;
    border-radius: inherit;
    padding: 1px;
    background: linear-gradient(170deg, var(--arete-haut), var(--arete-bas) 60%);
    -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
    -webkit-mask-composite: xor;
    mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0);
    pointer-events: none;
}

.topnav .brand {
    display: flex;
    align-items: center;
    gap: 9px;
    margin: 0 8px 0 0;
    padding: 0;
    color: var(--label);
    text-decoration: none;
}
.brand-name {
    font-family: var(--font-titre);
    font-size: 15px;
    font-weight: 650;
    letter-spacing: -.02em;
}

/* Le logogramme : trois barres montantes — une flotte, une
   progression. Une lettre dans un carré, c'est le marqueur de tous
   les gabarits. */
.brand-mark {
    width: 32px;
    height: 32px;
    border-radius: 10px;
    background: var(--marque);
    display: grid;
    place-items: center;
    color: var(--marque-texte);
    font-size: 0;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .25);
}
.brand-mark::before {
    content: '';
    width: 16px;
    height: 16px;
    background: currentColor;
    -webkit-mask: var(--sigle) center/contain no-repeat;
    mask: var(--sigle) center/contain no-repeat;
}
:root {
    --sigle: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M3 19.5h3.2a1 1 0 0 0 1-1V13a1 1 0 0 0-1-1H3a1 1 0 0 0-1 1v5.5a1 1 0 0 0 1 1Z'/%3E%3Cpath d='M10.4 19.5h3.2a1 1 0 0 0 1-1V8.5a1 1 0 0 0-1-1h-3.2a1 1 0 0 0-1 1v10a1 1 0 0 0 1 1Z'/%3E%3Cpath d='M17.8 19.5H21a1 1 0 0 0 1-1v-14a1 1 0 0 0-1-1h-3.2a1 1 0 0 0-1 1v14a1 1 0 0 0 1 1Z'/%3E%3C/svg%3E");
}

.nav-groupes { display: flex; align-items: center; gap: 2px; flex: 1; min-width: 0; }
.nav-g { position: relative; }

.nav-g > button, .nav-g > a {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 36px;
    padding: 0 12px;
    border: 0;
    border-radius: var(--r-md);
    background: transparent;
    color: var(--label-2);
    font: inherit;
    font-size: 14px;
    font-weight: 550;
    cursor: pointer;
    white-space: nowrap;
    text-decoration: none;
    transition: background .18s var(--ease), color .18s var(--ease);
}
.nav-g > button:hover, .nav-g > a:hover { background: var(--survol); color: var(--label); text-decoration: none; }
.nav-g.actif > button, .nav-g.actif > a {
    background: var(--marque-doux);
    color: var(--marque);
    font-weight: 650;
}
.nav-g > button .icon { opacity: .55; transition: transform .2s var(--ease); }
.nav-g:hover > button .icon, .nav-g:focus-within > button .icon { transform: rotate(90deg); }

/* ─── Les pages d'une section (navigation locale) ─────────────
   En pastilles, pas soulignées : les onglets soulignés (.onglets) sont
   les FILTRES d'une page (Paiements : en attente, confirmés…). Deux
   rangées du même dessin l'une sous l'autre se liraient comme une seule. */
.sous-nav {
    display: flex; align-items: center; gap: 4px;
    min-width: 0; overflow-x: auto; scrollbar-width: none;
    margin: -4px 0;
    padding: 4px 0;
}
.sous-nav::-webkit-scrollbar { display: none; }
.sous-nav a {
    display: inline-flex; align-items: center; gap: 7px; flex: none;
    height: 32px; padding: 0 12px 0 10px; border-radius: 999px;
    color: var(--label-2); font-size: 13.5px; font-weight: 550; white-space: nowrap;
    text-decoration: none;
    transition: background .15s var(--ease), color .15s var(--ease);
}
.sous-nav a .icon { opacity: .7; }
.sous-nav a:hover { background: var(--survol); color: var(--label); text-decoration: none; }
.sous-nav a.actif {
    background: var(--surface);
    color: var(--label); font-weight: 650;
    box-shadow: 0 0 0 1px var(--trait), 0 1px 2px rgba(0, 0, 0, .06);
}
.sous-nav a.actif .icon { opacity: 1; color: var(--marque); }
.sous-nav .nav-badge { margin-left: 1px; }

/* ─── Barre du bas (téléphone) ─────────────────────────────── */
.tabbar { display: none; }

/* ─── Pastilles ───────────────────────────────────────────────
   Elles s'affichaient VIDES : `display: grid` (app.css) l'emportait
   sur l'attribut `hidden`, d'où les ronds rouges muets à côté
   d'« Aujourd'hui » et de « Système ». */
.nav-badge[hidden], .notif-compte[hidden] { display: none !important; }
.nav-badge {
    min-width: 19px;
    height: 19px;
    padding: 0 6px;
    border-radius: 10px;
    background: linear-gradient(180deg, #FF5A4F, #E5362B);
    color: #fff;
    font-size: 11.5px;
    font-weight: 700;
    line-height: 19px;
    text-align: center;
    box-shadow: 0 2px 6px rgba(229, 54, 43, .35);
    font-variant-numeric: tabular-nums;
}
.nav-g .nav-badge { position: static; margin-left: 2px; }

/* ─── Menus déroulants : ce qui flotte ─────────────────────── */
.nav-menu {
    position: absolute;
    top: calc(100% + 10px);
    left: 0;
    min-width: 240px;
    padding: 6px;
    border: 0;
    border-radius: var(--r-lg);
    opacity: 0;
    transform: translateY(-6px) scale(.97);
    transform-origin: top left;
    pointer-events: none;
    transition: opacity .16s var(--ease), transform .2s var(--spring);
}
/* Un pont invisible : sans lui, le menu se referme pendant que la
   souris traverse les 10 px entre le bouton et le menu. */
.nav-menu::before {
    content: '';
    position: absolute;
    inset: -12px 0 auto;
    height: 12px;
}
.nav-g:hover .nav-menu,
.nav-g:focus-within .nav-menu {
    opacity: 1;
    transform: none;
    pointer-events: auto;
}
.nav-menu a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 9px;
    border-radius: var(--r-sm);
    color: var(--label);
    text-decoration: none;
    font-size: 14px;
    transition: background .14s var(--ease);
}
.nav-menu a:hover { background: var(--survol); text-decoration: none; }
.nav-menu a.active { background: var(--marque-doux); color: var(--marque); font-weight: 600; }
.nav-menu .nav-icon, .cmdk-item .nav-icon {
    width: 28px;
    height: 28px;
    flex: 0 0 28px;
    border-radius: 8px;
    display: grid;
    place-items: center;
    /* Teintée, pas pleine : le carré plein aux couleurs vives, glyphe
       blanc, est le motif « icône dans un carré » de tous les gabarits. */
    color: var(--ico, var(--marque));
    background: color-mix(in srgb, var(--ico, var(--marque)) 14%, transparent);
}
.nav-icon.blue   { --ico: var(--marque); }
.nav-icon.green  { --ico: #30B356; }
.nav-icon.indigo { --ico: #5E5CE6; }
.nav-icon.orange { --ico: #F28C00; }
.nav-icon.purple { --ico: #A04FD6; }
.nav-icon.teal   { --ico: #2A9FB8; }
.nav-icon.gray   { --ico: #7C7C92; }
.nav-icon.red    { --ico: #E5362B; }

/* ─── À droite de la barre ─────────────────────────────────── */
.nav-droite { display: flex; align-items: center; gap: 6px; margin-left: auto; }

.nav-k {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    height: 36px;
    padding: 0 8px 0 11px;
    border: 0;
    border-radius: var(--r-md);
    background: var(--creux);
    box-shadow: inset 0 0 0 1px var(--trait);
    color: var(--label-2);
    font: inherit;
    font-size: 13px;
    cursor: pointer;
    transition: box-shadow .18s var(--ease), color .18s var(--ease);
}
.nav-k:hover { color: var(--label); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--marque) 45%, transparent); }
.nav-k span { min-width: 88px; text-align: left; }
kbd, .nav-k kbd {
    padding: 1px 6px;
    border-radius: 6px;
    background: var(--verre-haut);
    box-shadow: inset 0 0 0 1px var(--trait), 0 1px 0 var(--trait);
    font: inherit;
    font-size: 11px;
    font-weight: 600;
    color: var(--label-2);
}

/* Les boutons-icônes de la barre (cloche, réglages). Cible de 36 px. */
.nav-ico {
    position: relative;
    display: inline-grid;
    place-items: center;
    width: 36px;
    height: 36px;
    border: 0;
    border-radius: var(--r-md);
    background: transparent;
    color: var(--label-2);
    cursor: pointer;
    transition: background .16s var(--ease), color .16s var(--ease);
}
.nav-ico:hover, .nav-ico[aria-expanded="true"] { background: var(--survol); color: var(--label); }

/* Les actions longues qui tournent (lib/taches.js) : un rond qui tourne
   à côté de la cloche. L'en-tête est plein (navigation, recherche) et sa
   largeur est bornée : ce qui tourne (« Synchroniser tous les bots · 3 sur
   12 ») se lit au survol, et les lecteurs d'écran le lisent ; le début et
   la fin arrivent en toast. */
.taches-pastille {
    display: inline-grid; place-items: center; flex: none;
    width: 32px; height: 32px; border-radius: 999px;
    background: var(--marque-doux); cursor: default;
}
.taches-pastille[hidden] { display: none; }
.taches-texte {
    position: absolute; width: 1px; height: 1px; overflow: hidden;
    clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap;
}
.taches-rond {
    width: 14px; height: 14px; border-radius: 50%;
    border: 2px solid var(--marque); border-right-color: transparent;
    animation: sq-tourne .8s linear infinite;
}
@media (prefers-reduced-motion: reduce) { .taches-rond { animation: sq-pouls 1.6s ease-in-out infinite; } }
.nav-ico[aria-expanded="true"] { color: var(--marque); }

.notif-compte {
    position: absolute;
    top: 3px;
    right: 2px;
    min-width: 17px;
    height: 17px;
    padding: 0 4px;
    border-radius: 9px;
    background: linear-gradient(180deg, #FF5A4F, #E5362B);
    color: #fff;
    font-size: 10.5px;
    font-weight: 700;
    line-height: 17px;
    text-align: center;
    font-variant-numeric: tabular-nums;
    box-shadow: 0 0 0 2px var(--surface-carte);
}
/* La cloche tinte une fois quand quelque chose arrive. Une fois : un
   mouvement qui se répète devient un bruit qu'on apprend à ignorer. */
.nav-ico.tinte .icon { animation: tinte .9s var(--ease); transform-origin: 50% 4px; }
@keyframes tinte {
    15% { transform: rotate(14deg); } 30% { transform: rotate(-12deg); }
    45% { transform: rotate(8deg); }  60% { transform: rotate(-5deg); }
    75% { transform: rotate(2deg); }
}

/* L'état du bot : une pastille, le détail au survol. Le libellé
   complet prenait la place de deux entrées de menu. */
.bot-state {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    height: 30px;
    margin: 0 0 0 2px;
    padding: 0 11px 0 10px;
    border-radius: 15px;
    background: color-mix(in srgb, var(--green) 13%, transparent);
    box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--green) 22%, transparent);
    color: color-mix(in srgb, var(--green) 75%, var(--label));
    font-size: 12.5px;
    font-weight: 600;
    white-space: nowrap;
}
.bot-state.off {
    background: color-mix(in srgb, var(--red) 13%, transparent);
    box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--red) 25%, transparent);
    color: color-mix(in srgb, var(--red) 80%, var(--label));
}
.bot-state .caption { color: inherit; font-size: inherit; font-weight: inherit; }

/* ─── Fil d'Ariane ─────────────────────────────────────────────
   Il n'est plus une seconde barre collante : c'était un deuxième
   panneau de verre empilé sous le premier, qui mangeait 50 px. Il est
   posé dans la page, au-dessus du titre. */
.topbar, .topbar.material {
    position: static;
    display: flex;
    align-items: center;
    gap: 14px;
    width: 100%;
    max-width: var(--largeur);
    margin: 0 auto;
    padding: 20px 32px 0;
    background: none;
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
    border: 0;
    box-shadow: none;
}
.topbar[hidden] { display: none; }
.topbar[hidden] + .content { padding-top: 22px; }
.topbar-title { opacity: 1 !important; font-size: 13px; font-weight: 500; }
.topbar-actions { margin-left: auto; display: flex; gap: 8px; align-items: center; }

.fil { display: flex; align-items: center; gap: 4px; min-width: 0; font-size: 13px; }
.fil a, .fil span { white-space: nowrap; }
.fil a { color: var(--label-2) !important; text-decoration: none; transition: color .15s var(--ease); }
.fil a:hover { color: var(--label) !important; }
.fil .sep { color: var(--label-3); display: inline-flex; }
.fil .ici { color: var(--label); font-weight: 600; overflow: hidden; text-overflow: ellipsis; }

/* ─── En-tête de page ───────────────────────────────────────── */
.page-header { position: relative; margin: 10px 0 6px; padding-left: 0; }
.page-header::before { content: none; }
.title-lg {
    font-family: var(--font-titre);
    font-size: 32px;
    font-weight: 700;
    letter-spacing: -.028em;
    line-height: 1.12;
}
.page-header .title-lg::after {
    /* Le filet d'accent passe SOUS le titre : il change à chaque
       section, l'œil l'enregistre sans le lire. */
    content: '';
    display: block;
    width: 34px;
    height: 3px;
    margin-top: 9px;
    border-radius: 3px;
    background: linear-gradient(90deg, var(--accent), color-mix(in srgb, var(--accent) 20%, transparent));
}
.page-sub { margin: 8px 0 0; }

.section-title {
    /* Casse normale : les petites capitales espacées sur chaque titre
       de section sont un gabarit, pas une hiérarchie. La hiérarchie
       vient de la taille et de la graisse. */
    display: flex;
    align-items: baseline;
    gap: 8px;
    margin: 32px 0 11px;
    padding-inline: 2px;
    font-size: 15.5px;
    font-weight: 650;
    letter-spacing: -.01em;
    text-transform: none;
    color: var(--label);
}
.section-title .compte, .section-title small {
    font-size: 13px;
    font-weight: 500;
    color: var(--label-3);
    letter-spacing: 0;
}
.section-title .a-droite { margin-left: auto; font-size: 13px; font-weight: 500; }

.title-lg, .hero-chiffre, .empty-title, .sheet-title, .stat-value, .dn-c-val {
    font-family: var(--font-titre);
    font-feature-settings: "ss01", "cv01";
}


/* ═══════════════════════════════════════════════════════════
   5. COMPOSANTS
   ═══════════════════════════════════════════════════════════ */

/* Les liens prennent la marque. Une seule règle, de spécificité
   minimale : l'ancienne empilait huit `:not()` — spécificité (0,8,1) —
   et repeignait en violet tout ce qui était un lien, y compris la
   marque de la barre, « Système » et les entrées des menus. */
a { color: var(--marque); }
:focus-visible { outline: 2px solid var(--marque); outline-offset: 2px; }
::selection { background: color-mix(in srgb, var(--marque) 28%, transparent); }

/* ─── Cartes et grilles ────────────────────────────────────── */
.card { padding: 18px 20px; }
.card + .card { margin-top: 14px; }
.grid { gap: 14px; }
/* Dans une grille, l'écart vient de `gap` : la marge ci-dessus décalait
   toutes les cartes d'une rangée sauf la première. */
.grid > .card + .card { margin-top: 0; }

/* ─── Listes groupées ───────────────────────────────────────── */
.list { padding: 5px; overflow: visible; }
.list .row { border-radius: var(--r-md); background-color: transparent; }
.list .row:hover { text-decoration: none; }

/* Le titre et le sous-titre d'une ligne sont des <span> : sans
   `display: block`, ils se suivaient sur la même ligne, et
   « 3 paiements en attente À confirmer ou refuser » se lisait comme
   une seule phrase. */
.row-title, .row-sub { display: block; }
.row-title { font-size: 15px; font-weight: 550; letter-spacing: -.005em; }
.row-sub { font-size: 13px; color: var(--label-2); margin-top: 1px; }
.row-value { color: var(--label-2); font-variant-numeric: tabular-nums; }
.row-chevron { color: var(--label-3); }

/* Séparateurs : un trait discret ENTRE deux lignes. L'ancien reposait
   sur `::before`, que le liseré de statut réutilisait : les deux se
   battaient, et le liseré atterrissait à 16 ou 54 px du bord, collé au
   texte, sur toutes les lignes sauf la première. */
.row::before, .row + .row::before, .row.has-icon + .row.has-icon::before { content: none; }
.list .row + .row, .list .row + form > .row, .list form + .row,
.list .row + .notif, .list .notif + .row {
    box-shadow: 0 -1px 0 var(--trait);
}
.list .row:hover, .list .row:hover + .row { box-shadow: none; }

/* Le liseré de statut : il porte l'état d'un paiement ou d'un client,
   on le voit avant de lire. Une barre droite de 3 px, en retrait du
   haut et du bas — dessinée en image de fond, elle ne dispute ni le
   séparateur (ombre) ni le survol (couleur de fond). */
.row:has(> .badge-green),  .row:has(> * > .badge-green)  { --liseré: var(--green); }
.row:has(> .badge-red),    .row:has(> * > .badge-red)    { --liseré: var(--red); }
.row:has(> .badge-orange), .row:has(> * > .badge-orange) { --liseré: var(--orange); }
.row:has(> .badge-yellow), .row:has(> * > .badge-yellow) { --liseré: var(--yellow); }
.list .row {
    background-image: linear-gradient(var(--liseré, transparent), var(--liseré, transparent));
    background-repeat: no-repeat;
    background-position: 0 50%;
    background-size: 3px calc(100% - 22px);
}
a.row:hover, button.row:hover, .list a.row:hover { background-color: var(--survol); }

/* Les pastilles d'icône des lignes : TEINTÉES, glyphe coloré sur fond
   pâle. Le carré plein en dégradé, glyphe blanc, était le motif « icône
   dans un carré arrondi » qu'on retrouve sur tous les gabarits. */
.row-icon {
    width: 30px;
    height: 30px;
    flex: 0 0 30px;
    border-radius: 9px;
    color: var(--ico, var(--marque));
    background: color-mix(in srgb, var(--ico, var(--marque)) 13%, transparent);
    box-shadow: none;
}
.row-icon.blue   { --ico: var(--marque); }
.row-icon.green  { --ico: var(--green); }
.row-icon.red    { --ico: var(--red); }
.row-icon.orange { --ico: var(--orange); }
.row-icon.purple { --ico: var(--purple); }
.row-icon.teal   { --ico: var(--teal); }
.row-icon.indigo { --ico: var(--indigo); }
.row-icon.gray   { --ico: var(--label-2); }
.row-icon.blue, .row-icon.green, .row-icon.red, .row-icon.orange,
.row-icon.purple, .row-icon.teal, .row-icon.indigo, .row-icon.gray {
    background: color-mix(in srgb, var(--ico) 13%, transparent);
}

/* ─── Tuiles d'indicateur ─────────────────────────────────── */
.stat { padding: 16px 18px 18px; overflow: hidden; }
.stat-label { font-size: 13px; font-weight: 550; color: var(--label-2); }
.stat-value {
    margin-top: 4px;
    font-size: 30px;
    font-weight: 700;
    letter-spacing: -.03em;
    line-height: 1.08;
    font-variant-numeric: tabular-nums;
}
.stat-meta { font-size: 12px; color: var(--label-2); margin-top: 3px; }
.stat.accent-blue .stat-value { color: var(--marque); }

.stat-spark {
    position: absolute;
    right: 0; bottom: 0; left: 38%;
    height: 38px;
    pointer-events: none;
    opacity: .6;
    transition: opacity .22s var(--ease);
}
a.stat:hover .stat-spark { opacity: .95; }
.stat-spark .spark { width: 100%; height: 100%; display: block; }
.spark-trait { stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.spark-aire  { fill: currentColor; opacity: .16; }
.spark-fin   { fill: currentColor; }
.stat-spark.green  { color: var(--green); }
.stat-spark.blue   { color: var(--marque); }
.stat-spark.orange { color: var(--orange); }
.stat-spark.purple { color: var(--purple); }
.stat-label, .stat-value, .stat-meta { position: relative; z-index: 1; }

/* ─── Boutons ──────────────────────────────────────────────── */
.btn {
    min-height: 36px;
    padding: 8px 15px;
    border-radius: var(--r-md);
    font-size: 14px;
    font-weight: 600;
    background: var(--verre-haut);
    color: var(--label);
    box-shadow: inset 0 0 0 1px var(--trait), inset 0 1px 0 rgba(255, 255, 255, .25), 0 1px 2px rgba(0, 0, 0, .05);
    transition: transform .12s var(--ease), filter .15s var(--ease), box-shadow .18s var(--ease), background .18s var(--ease);
}
.btn:hover { filter: none; background: color-mix(in srgb, var(--verre-haut) 70%, var(--marque-doux)); text-decoration: none; }
.btn-sm { min-height: 30px; padding: 5px 12px; font-size: 13px; }

.btn-primary, .btn-success, .btn-danger, .btn-warning {
    color: #fff;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .18), 0 1px 2px rgba(0, 0, 0, .12);
}
/* Des aplats. Le dégradé sur chaque bouton plein est un réflexe de
   gabarit ; la hiérarchie vient de la couleur et du poids, pas d'un
   brillant. */
.btn-primary { background: var(--marque); color: var(--marque-texte); }
.btn-success { background: #23A04A; }
.btn-warning { background: #E08600; }
.btn-danger {
    /* La hachure reste : c'est la marque des gestes qu'on ne défait pas,
       visible du coin de l'œil là où une couleur seule se confond. */
    background:
        repeating-linear-gradient(-45deg, transparent 0 6px, rgba(255, 255, 255, .1) 6px 12px),
        #D93A2F;
}
.btn-primary:hover { background: color-mix(in srgb, var(--marque) 88%, #000); }
.btn-success:hover { background: #1E8E41; }
.btn-warning:hover { background: #C97800; }
.btn-danger:hover  { background: #C2322A; }
.btn-plain { background: none; box-shadow: none; color: var(--marque); }
.btn-plain:hover { background: var(--marque-doux); }

/* ─── Contrôle segmenté ────────────────────────────────────── */
.segmented {
    background: var(--creux);
    box-shadow: inset 0 0 0 1px var(--trait);
    border-radius: 12px;
    padding: 3px;
    gap: 2px;
}
.segmented a, .segmented button {
    padding: 6px 13px;
    border-radius: 9px;
    color: var(--label-2);
    font-weight: 550;
}
.segmented a:hover, .segmented button:hover { color: var(--label); }
.segmented .active, .segmented [aria-pressed="true"] {
    background: var(--verre-haut);
    color: var(--label);
    font-weight: 650;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .5), 0 0 0 1px var(--trait), 0 2px 8px -2px rgba(20, 20, 60, .18);
}

/* ─── Champs ───────────────────────────────────────────────── */
.input, .select, .textarea {
    border: 0;
    border-radius: var(--r-md);
    background: var(--creux);
    box-shadow: inset 0 0 0 1px var(--trait), inset 0 1px 2px rgba(0, 0, 0, .04);
    color: var(--label);
    transition: box-shadow .16s var(--ease), background .16s var(--ease);
}
.input:focus, .select:focus, .textarea:focus {
    background: var(--verre-haut);
    box-shadow: inset 0 0 0 1px var(--marque), 0 0 0 4px var(--marque-doux);
}
.select option { background: var(--surface); color: var(--label); }
.search {
    background: var(--creux);
    box-shadow: inset 0 0 0 1px var(--trait);
    border-radius: var(--r-md);
}
.search:focus-within { box-shadow: inset 0 0 0 1px var(--marque), 0 0 0 4px var(--marque-doux); }

/* ─── Pastilles de statut ──────────────────────────────────── */
.badge {
    padding: 3px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 650;
    background: var(--creux);
    color: var(--label-2);
    box-shadow: inset 0 0 0 1px var(--trait);
    text-decoration: none !important;
}
.badge-green  { background: color-mix(in srgb, var(--green) 15%, transparent);  color: color-mix(in srgb, var(--green) 70%, var(--label));  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--green) 25%, transparent); }
.badge-red    { background: color-mix(in srgb, var(--red) 14%, transparent);    color: color-mix(in srgb, var(--red) 78%, var(--label));    box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--red) 25%, transparent); }
.badge-orange { background: color-mix(in srgb, var(--orange) 16%, transparent); color: color-mix(in srgb, var(--orange) 70%, var(--label)); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--orange) 26%, transparent); }
.badge-yellow { background: color-mix(in srgb, var(--yellow) 22%, transparent); color: color-mix(in srgb, #A07C00 80%, var(--label));      box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--yellow) 35%, transparent); }
.badge-blue   { background: var(--marque-doux); color: var(--marque); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--marque) 22%, transparent); }
.badge-purple { background: color-mix(in srgb, var(--purple) 15%, transparent); color: color-mix(in srgb, var(--purple) 75%, var(--label)); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--purple) 25%, transparent); }
.badge-teal   { background: color-mix(in srgb, var(--teal) 15%, transparent);   color: color-mix(in srgb, var(--teal) 70%, var(--label));   box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--teal) 25%, transparent); }
:root[data-theme="dark"] .badge-yellow { color: var(--yellow); }
@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) .badge-yellow { color: var(--yellow); }
}

/* ─── Tableaux ─────────────────────────────────────────────── */
.table-wrap { overflow-x: auto; }
table.tbl th { color: var(--label-2); border-bottom: 1px solid var(--trait); }
table.tbl td { border-bottom: 1px solid var(--trait); }
table.tbl tbody tr:hover { background: var(--survol); }

/* ─── Console : jamais en verre ───────────────────────────────
   Des logs se lisent sur un fond sombre, plein et constant. Le verre
   y ferait passer les couleurs du fond entre deux lignes d'erreur. */
.console {
    background: #0B0B12;
    color: #E6E6F0;
    border: 0;
    border-radius: var(--r-md);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .06), inset 0 2px 10px rgba(0, 0, 0, .4);
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
}

/* ─── Feuilles (dialog) : ce qui flotte au-dessus de tout ──── */
dialog.sheet::backdrop {
    background: rgba(10, 10, 25, .38);
    -webkit-backdrop-filter: blur(6px) saturate(120%);
    backdrop-filter: blur(6px) saturate(120%);
}
.sheet-panel, .cmdk-boite, .nav-menu, .pop, .toast {
    position: relative;
    background-color: var(--verre-flottant);
    background-image: var(--grain);
    -webkit-backdrop-filter: blur(var(--flou-flottant)) saturate(190%);
    backdrop-filter: blur(var(--flou-flottant)) saturate(190%);
    border: 0;
    box-shadow: var(--reflet), 0 0 0 1px var(--contour), var(--ombre-haute);
}
.nav-menu { position: absolute; }
.sheet-panel { border-radius: var(--r-xl); padding: 12px 24px 26px; }
.sheet-title { font-size: 20px; letter-spacing: -.02em; }
.sheet-grabber { background: var(--label-3); opacity: .6; }

/* ─── Toasts ───────────────────────────────────────────────── */
.toasts { top: 84px; }
.toast { border-radius: 16px; padding: 11px 16px 11px 12px; font-size: 14px; }
.toast-icon { width: 22px; height: 22px; flex: 0 0 22px; font-weight: 700; }
.toast-success .toast-icon { background: #23A04A; }
.toast-error .toast-icon   { background: #D93A2F; }
.toast-info .toast-icon    { background: var(--marque); color: var(--marque-texte); }
.toast a { font-weight: 600; margin-left: 4px; }

/* ─── État vide ────────────────────────────────────────────── */
.empty-icon {
    display: inline-grid;
    place-items: center;
    padding: 14px;
    margin-bottom: 14px;
    border-radius: 18px;
    color: var(--accent);
    opacity: 1;
    background: color-mix(in srgb, var(--accent) 12%, transparent);
    box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 20%, transparent);
}
.empty-action { margin-top: 15px; }

/* ─── Pastille d'état (point) ──────────────────────────────── */
.dot.on { background: var(--green); }

/* ─── Interrupteur ─────────────────────────────────────────── */
.switch-track { background: color-mix(in srgb, var(--label) 16%, transparent); }
.switch input:checked + .switch-track { background: linear-gradient(180deg, #3CC467, #28A64F); }


/* ═══════════════════════════════════════════════════════════
   6. BANDEAU D'ACCUEIL
   ═══════════════════════════════════════════════════════════
   Le chiffre qu'on vient chercher, et la courbe qui lui donne son
   sens. Le panneau le plus en vue : il porte un halo de marque à
   l'intérieur, comme une lumière derrière la vitre. */

.hero {
    display: flex;
    align-items: flex-end;
    gap: 22px;
    margin: 14px 0 22px;
    padding: 24px 26px 20px;
    overflow: hidden;
    border-top: 0;
    background-image:
        radial-gradient(120% 140% at 0% 0%, color-mix(in srgb, var(--marque) 16%, transparent), transparent 55%),
        linear-gradient(180deg, var(--verre-haut), var(--verre-bas)),
        var(--grain);
}
.hero-txt { flex: 1; min-width: 0; }
.hero-salut { margin: 0; font-size: 14px; color: var(--label-2); }
.hero-chiffre {
    margin: 4px 0 0;
    font-size: clamp(40px, 6.5vw, 60px);
    font-weight: 750;
    letter-spacing: -.04em;
    line-height: 1;
    font-variant-numeric: tabular-nums;
    color: var(--label);
}
.hero-euro { font-size: .5em; font-weight: 650; margin-left: 4px; color: var(--label-2); }
.hero-sous { margin: 10px 0 0; font-size: 14px; color: var(--label-2); }
.hero-delta { font-weight: 650; }
.hero-delta.up   { color: color-mix(in srgb, var(--green) 80%, var(--label)); }
.hero-delta.down { color: color-mix(in srgb, var(--orange) 85%, var(--label)); }
.hero-courbe { flex: none; width: min(360px, 42%); opacity: .95; pointer-events: none; }
.hero-courbe .chart { height: 100px; }
.hero .chart-line { stroke: var(--marque); stroke-width: 2.2; }
.hero .chart-dot { fill: var(--marque); }
.hero .chart-fill-top { stop-color: var(--marque); stop-opacity: .28; }
.hero .chart-fill-bottom { stop-color: var(--marque); }

/* Les chiffres clés sous le bandeau : revenu récurrent, prévision. */
.kpis { display: flex; flex-wrap: wrap; gap: 8px 22px; margin-top: 14px; }
.kpi { display: flex; flex-direction: column; min-width: 0; color: inherit !important; text-decoration: none !important; padding: 6px 12px; margin: -6px -12px; border-radius: var(--r-md); transition: background .16s var(--ease); }
.kpi:hover { background: var(--survol); }
.kpis { gap: 8px 26px; padding-top: 14px; border-top: 1px solid var(--trait); }
.kpi-v { font-family: var(--font-titre); font-size: 18px; font-weight: 700; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.kpi-l { font-size: 12px; color: var(--label-2); }

@media (max-width: 720px) {
    .hero { flex-direction: column; align-items: stretch; gap: 10px; }
    .hero-courbe { width: 100%; }
}


/* ═══════════════════════════════════════════════════════════
   7. GRAPHIQUES
   ═══════════════════════════════════════════════════════════
   Série unique : une seule teinte, la marque. La palette
   catégorielle (--c1…--c6) ne sert qu'à l'anneau, où chaque couleur
   désigne une identité. */

.chart-line       { stroke: var(--marque); }
.chart-dot        { fill: var(--marque); }
.chart-fill-top   { stop-color: var(--marque); }
.chart-fill-bottom { stop-color: var(--marque); }
.chart-bar        { fill: var(--marque); }
.chart-bar:hover  { fill: color-mix(in srgb, var(--marque) 80%, var(--label)); }
.chart-axis       { fill: var(--label-2); }

.chart-lien { cursor: pointer; }
.chart-lien .chart-bar { transition: filter .16s var(--ease), transform .16s var(--spring); transform-box: fill-box; transform-origin: bottom; }
.chart-lien:hover .chart-bar { filter: brightness(1.15); transform: scaleY(1.04); }
.chart-lien:hover .chart-axis { fill: var(--label); font-weight: 600; }
.chart-lien:focus-visible { outline: 2px solid var(--marque); outline-offset: 2px; border-radius: 4px; }

/* ─── L'anneau de répartition ─────────────────────────────── */
.dn { display: flex; align-items: center; gap: 24px; flex-wrap: wrap; }
.dn-scene { position: relative; flex: none; }
.dn-svg { display: block; width: 250px; max-width: 100%; height: auto; overflow: visible; }
/* La paroi : la tranche de l'objet, pas une perspective — les angles
   restent justes. Adoucie : à 55 % de luminosité elle faisait un
   socle noir sous l'anneau, surtout en sombre. */
.dn-paroi { filter: brightness(.68) saturate(1.05); opacity: .85; transition: transform .3s var(--spring); }
.dn-face {
    stroke: var(--surface-carte);
    stroke-width: 2;
    stroke-linejoin: round;
    transform-box: fill-box;
    transform-origin: center;
    transition: transform .3s var(--spring), opacity .2s var(--ease);
    cursor: pointer;
}
@keyframes dn-entree { from { opacity: 0; transform: scale(.82); } }
.dn .vise.dn-face  { transform: translate(calc(var(--dx) * 7px), calc(var(--dy) * 7px)); }
.dn .vise.dn-paroi { transform: translate(calc(var(--dx) * 7px), calc(var(--dy) * 7px)); }
.dn .estompe { opacity: .3; }
.dn-pct {
    fill: #fff;
    font-size: 12.5px;
    font-weight: 700;
    pointer-events: none;
    paint-order: stroke;
    stroke: rgba(0, 0, 0, .28);
    stroke-width: 2.5px;
}
.dn-centre {
    position: absolute;
    left: 0; right: 0;
    top: calc(50% - 7px);
    transform: translateY(-50%);
    text-align: center;
    pointer-events: none;
}
.dn-c-val { font-size: 26px; font-weight: 700; letter-spacing: -.02em; font-variant-numeric: tabular-nums; color: var(--label); }
.dn-c-lab { margin-top: 1px; font-size: 12px; color: var(--label-2); }
.dn-legende { display: flex; flex-direction: column; gap: 2px; flex: 1; min-width: 190px; }
.dn-leg {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 6px 8px;
    border: 0;
    border-radius: var(--r-sm);
    background: none;
    color: var(--label);
    font: inherit;
    font-size: 13px;
    text-align: left;
    cursor: pointer;
    transition: background .14s var(--ease), opacity .2s var(--ease);
}
.dn-leg:hover { background: var(--survol); }
.dn-pastille { width: 10px; height: 10px; border-radius: 3px; flex: none; }
.dn-leg-nom { flex: 1; min-width: 0; color: var(--label-2); }
.dn-leg-val { font-weight: 650; font-variant-numeric: tabular-nums; }
.dn-avant { opacity: .3; stroke: var(--surface-carte); stroke-width: 1.5; transition: opacity .25s var(--ease); }
.dn .vise.dn-avant { opacity: .75; }
.dn .estompe.dn-avant { opacity: .1; }
.dn-note { margin: 8px 0 0; padding-left: 8px; font-size: 12px; color: var(--label-2); line-height: 1.4; }

.ring-track { stroke: var(--creux); }
.ring-value { stroke: var(--marque); }


/* ═══════════════════════════════════════════════════════════
   8. PALAIS DE COMMANDES
   ═══════════════════════════════════════════════════════════ */

.cmdk {
    position: fixed;
    inset: 0;
    z-index: 200;
    display: none;
    padding-top: 12vh;
    background: rgba(10, 10, 25, .32);
    -webkit-backdrop-filter: blur(5px);
    backdrop-filter: blur(5px);
}
.cmdk.ouvert { display: block; animation: cmdk-fond .18s var(--ease); }
@keyframes cmdk-fond { from { opacity: 0; } }
.cmdk-boite {
    width: min(640px, calc(100vw - 32px));
    margin: 0 auto;
    border-radius: var(--r-xl);
    overflow: hidden;
    animation: cmdk-entree .28s var(--spring);
}
@keyframes cmdk-entree { from { opacity: 0; transform: translateY(-14px) scale(.96); } }
.cmdk-champ { display: flex; align-items: center; gap: 10px; padding: 16px 18px; border-bottom: 1px solid var(--trait); color: var(--label-2); }
.cmdk-champ input { flex: 1; border: 0; background: none; color: var(--label); font: inherit; font-size: 17px; outline: none; }
.cmdk-champ input::placeholder { color: var(--label-3); }
.cmdk-liste { max-height: min(56vh, 460px); overflow-y: auto; padding: 6px; }
.cmdk-titre { padding: 10px 10px 4px; font-size: 11.5px; font-weight: 650; letter-spacing: .05em; text-transform: uppercase; color: var(--label-3); }
.cmdk-item {
    display: flex;
    align-items: center;
    gap: 11px;
    width: 100%;
    padding: 8px 10px;
    border: 0;
    border-radius: var(--r-md);
    background: none;
    color: var(--label);
    font: inherit;
    font-size: 14px;
    text-align: left;
    text-decoration: none;
    cursor: pointer;
}
.cmdk-item:hover { text-decoration: none; }
.cmdk-item[aria-selected="true"] { background: var(--marque); color: var(--marque-texte); }
.cmdk-item[aria-selected="true"] .cmdk-grp { color: inherit; opacity: .8; }
.cmdk-nom { flex: 1; min-width: 0; }
.cmdk-grp { font-size: 12px; color: var(--label-2); }
.cmdk-vide { padding: 26px 16px; text-align: center; color: var(--label-2); font-size: 14px; }
.cmdk-pied { display: flex; flex-wrap: wrap; gap: 14px; padding: 10px 16px; border-top: 1px solid var(--trait); font-size: 12px; color: var(--label-2); }


/* ═══════════════════════════════════════════════════════════
   9. POP-OVERS : NOTIFICATIONS ET PRÉFÉRENCES
   ═══════════════════════════════════════════════════════════ */

.pop-hote { position: relative; }
.pop {
    position: absolute;
    top: calc(100% + 12px);
    right: -6px;
    z-index: 80;
    width: 380px;
    max-width: calc(100vw - 24px);
    border-radius: var(--r-lg);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-6px) scale(.98);
    transform-origin: top right;
    transition: opacity .16s var(--ease), transform .22s var(--spring), visibility 0s linear .22s;
}
.pop.ouvert {
    opacity: 1;
    visibility: visible;
    transform: none;
    transition: opacity .16s var(--ease), transform .22s var(--spring), visibility 0s;
}
.pop-tete { display: flex; align-items: center; gap: 8px; padding: 14px 14px 10px 16px; }
.pop-tete strong { font-size: 15px; letter-spacing: -.01em; }
.pop-pied { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-top: 1px solid var(--trait); font-size: 13px; }

/* ─── Préférences ──────────────────────────────────────────── */
.prefs { width: 300px; padding: 6px 0 8px; }
.pref { display: flex; flex-direction: column; gap: 7px; padding: 9px 16px; }
.pref + .pref { border-top: 1px solid var(--trait); }
.pref-l { font-size: 12px; font-weight: 650; letter-spacing: .04em; text-transform: uppercase; color: var(--label-2); }
.pref .segmented { display: flex; }
.pref .segmented button { flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: 6px; }
.pref-ligne { display: flex; align-items: center; gap: 10px; font-size: 14px; }
.pref-ligne > span { flex: 1; }
.pref-aide { font-size: 12px; color: var(--label-2); }

/* ─── Le centre de notifications ───────────────────────────── */
.notif-panel { width: 420px; }
.notif-filtres { display: flex; align-items: center; gap: 8px; margin: 0 12px 6px; }
.notif-filtres .segmented { display: flex; flex: 1; min-width: 0; }
.notif-filtres .segmented button { flex: 1; }
/* L'ordre d'affichage (cloche et page) : un menu natif, à la hauteur
   du contrôle segmenté voisin. */
.select.notif-ordre {
    width: auto;
    height: 36px;
    padding: 0 30px 0 11px;
    border-radius: 12px;
    font-size: 13px;
    font-weight: 550;
    color: var(--label);
    cursor: pointer;
    -webkit-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 256 256'%3E%3Cpath fill='%237C7C92' d='M213.66,101.66l-80,80a8,8,0,0,1-11.32,0l-80-80A8,8,0,0,1,53.66,90.34L128,164.69l74.34-74.35a8,8,0,0,1,11.32,11.32Z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    background-size: 12px;
}
.notif-ordre-form { display: flex; align-items: center; gap: 8px; margin: 0; }
.notif-ordre-l { display: inline-flex; align-items: center; gap: 5px; font-size: 13px; font-weight: 550; color: var(--label-2); }
/* « en cours » : hors de l'ordre par défaut, ce qui dure encore est
   mêlé au reste. */
.notif-tag {
    display: inline-block;
    margin-left: 2px;
    padding: 1px 7px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 650;
    line-height: 1.5;
    vertical-align: 1px;
    color: var(--marque);
    background: var(--marque-doux);
}
.notif-liste { max-height: min(62vh, 520px); overflow-y: auto; padding: 4px 6px 8px; overscroll-behavior: contain; }
.notif-groupe {
    padding: 10px 10px 4px;
    font-size: 11.5px;
    font-weight: 650;
    letter-spacing: .05em;
    text-transform: uppercase;
    color: var(--label-3);
}
.notif {
    position: relative;
    display: flex;
    align-items: flex-start;
    gap: 11px;
    padding: 9px 10px;
    border-radius: var(--r-md);
    color: var(--label) !important;
    text-decoration: none !important;
    transition: background .14s var(--ease);
}
.notif:hover { background: var(--survol); }
.notif-ico {
    width: 30px;
    height: 30px;
    flex: 0 0 30px;
    border-radius: 9px;
    display: grid;
    place-items: center;
    color: #fff;
    background: linear-gradient(145deg, var(--ico, var(--marque)), color-mix(in srgb, var(--ico, var(--marque)) 72%, #000));
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .3);
}
.niv-rouge  { --ico: #E5362B; }
.niv-orange { --ico: #F28C00; }
.niv-bleu   { --ico: var(--marque); }
.niv-vert   { --ico: #30B356; }
.niv-violet { --ico: #A04FD6; }
.niv-gris   { --ico: #7C7C92; }
.notif-corps { flex: 1; min-width: 0; }
.notif-titre { display: block; font-size: 14px; font-weight: 550; line-height: 1.3; }
.notif-sous { display: block; margin-top: 2px; font-size: 12.5px; color: var(--label-2); line-height: 1.35; overflow: hidden; text-overflow: ellipsis; }
.notif-quand { flex: none; margin-top: 1px; font-size: 11.5px; color: var(--label-2); white-space: nowrap; font-variant-numeric: tabular-nums; }
/* Non lue : le titre s'épaissit et un point de marque apparaît. Une
   notification lue reste, mais recule. */
.notif.non-lue .notif-titre { font-weight: 700; }
.notif.non-lue::after {
    content: '';
    position: absolute;
    top: 50%;
    right: 8px;
    width: 8px;
    height: 8px;
    margin-top: -4px;
    border-radius: 50%;
    background: var(--marque);
    box-shadow: 0 0 0 3px var(--marque-doux);
}
.notif.non-lue { padding-right: 26px; }
.notif.lue .notif-ico { filter: saturate(.55); opacity: .75; }
.notif.lue .notif-titre { color: var(--label-2); }
.notif-vide { padding: 34px 20px 38px; text-align: center; color: var(--label-2); font-size: 14px; }
.notif-vide .icon { display: block; margin: 0 auto 10px; color: var(--green); }

/* La page /notifications reprend les mêmes lignes, dans une liste. */
.list .notif { border-radius: var(--r-md); }
.list .notif + .notif { box-shadow: 0 -1px 0 var(--trait); }


/* ═══════════════════════════════════════════════════════════
   10. MOUVEMENT, CHARGEMENT, DENSITÉ
   ═══════════════════════════════════════════════════════════ */

/* Plus d'apparition en cascade de chaque bloc : le fondu-montée sur
   tout ce qui entre à l'écran est un tic, et sur un outil qu'on ouvre
   trente fois par jour il ne fait que retarder la lecture. La
   transition de page (plus bas) suffit à lier deux écrans. */
@keyframes monte { from { opacity: 0; transform: translateY(9px); } }

/* Le filet de progression : il atteste qu'une demande est partie. */
#filet {
    position: fixed;
    top: 0; left: 0;
    z-index: 300;
    height: 2px;
    width: 0;
    background: var(--marque);
    box-shadow: 0 0 10px color-mix(in srgb, var(--marque) 60%, transparent);
    opacity: 0;
    transition: width .25s var(--ease), opacity .25s var(--ease);
    pointer-events: none;
}
#filet.court { width: 82%; opacity: 1; }
#filet.fini  { width: 100%; opacity: 0; transition: width .12s linear, opacity .35s .12s var(--ease); }

/* ─── Squelettes : ce qu'on voit pendant qu'une page arrive ──
   Posés par public/squelettes.js, sur le dashboard ET sur le portail
   (qui charge cette feuille). Ce que dit la recherche (NN/g « Skeleton
   Screens 101 », spin-delay, A. Roselli « More Accessible Skeletons »),
   et ce qu'on en fait :
   • rien avant 150 ms (une réponse rapide ne doit rien faire
     clignoter) ; une fois montré, il reste au moins ~0,3 s ;
   • la FORME de la page qui arrive, pas un cadre vide ;
   • une vague lente de gauche à droite : perçue plus courte qu'une
     pulsation, cycle d'environ 2 s ;
   • UNE vague pour toute la page, pas une par bloc : chaque bloc
     montre sa tranche d'un même reflet large comme l'écran (--sq-x,
     posé par le script) et la vague descend avec la hauteur (--sq-y) ;
   • aria-busy sur la zone, blocs aria-hidden, « Chargement… » pour les
     lecteurs d'écran ; mouvement réduit : une pulsation, sans
     déplacement. */
:root {
    --sq-fond:   rgba(40, 40, 110, .075);
    --sq-reflet: rgba(255, 255, 255, .78);
    --sq-cycle:  2.1s;
}
@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) { --sq-fond: rgba(255, 255, 255, .07); --sq-reflet: rgba(255, 255, 255, .12); }
}
:root[data-theme="dark"] { --sq-fond: rgba(255, 255, 255, .07); --sq-reflet: rgba(255, 255, 255, .12); }

.sq {
    position: relative;
    display: block;
    flex: none;
    max-width: 100%;
    height: 12px;
    border-radius: 7px;
    background: var(--sq-fond);
    overflow: hidden;
    isolation: isolate;          /* Safari : le reflet reste dans les coins arrondis */
}
.sq::after {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    left: calc(var(--sq-x, 0px) * -1);
    width: 100vw;
    background: linear-gradient(100deg, transparent 30%, var(--sq-reflet) 50%, transparent 70%);
    transform: translateX(-100%);
    animation: sq-vague var(--sq-cycle) cubic-bezier(.45, 0, .3, 1) infinite;
    /* La phase (négative) sert quand le squelette est reposé : la
       vague reprend où elle en était au lieu de repartir. */
    animation-delay: calc(var(--sq-y, 0) * .45ms + var(--sq-phase, 0ms));
}
@keyframes sq-vague {
    0%        { transform: translateX(-70%); }
    72%, 100% { transform: translateX(70%); }
}
.sq-rond    { border-radius: 50%; }
.sq-pilule  { border-radius: 999px; }
.sq-carre   { border-radius: 9px; }
.sq-bouton  { border-radius: var(--r-md); }
.sq-titre   { border-radius: 9px; }
.sq-ligne   { display: flex; align-items: center; gap: 12px; min-width: 0; }
.sq-pile    { display: flex; flex-direction: column; gap: 9px; min-width: 0; flex: 1; }
.sq-pile.sq-centre { align-items: center; }   /* les étapes de « Mes demandes » */
.sq-fin     { margin-left: auto; }
.sq-ligne > .sq-fin, .sq-pile > .sq-fin { flex: none; }
.sq-anneau  {
    width: 120px; height: 120px; border-radius: 50%;
    -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 13px), #000 calc(100% - 12px));
    mask: radial-gradient(farthest-side, transparent calc(100% - 13px), #000 calc(100% - 12px));
}

/* La page en attente : le squelette prend la place du contenu. */
.content.sq-actif > :not(.sq-page):not(.sq-garde) { display: none !important; }
.sq-page { animation: sq-entre .24s var(--ease) both; pointer-events: none; }
.sq-page.sq-deja { animation: none; }
.sq-page .sq-lent { pointer-events: auto; }
@keyframes sq-entre { from { opacity: 0; } }

.sq-entete { display: flex; align-items: flex-end; gap: 16px; margin: 10px 0 22px; }
.sq-entete > .sq-pile { gap: 21px; }
.sq-onglets { display: flex; gap: 28px; padding: 2px 12px 14px; margin: -4px 0 18px; border-bottom: 1px solid var(--trait); }
.sq-page .section-title { margin: 30px 0 13px; }
.sq-page .row { min-height: 58px; gap: 14px; }
.sq-grille > .card + .card, .sq-grille > .sq-pile > .card:first-child { margin-top: 0; }
.sq-boutons { flex-wrap: wrap; }
.sq-bloc { width: 100%; height: 50px; border-radius: var(--r-lg); margin: 0 0 16px; }
.sq-grille { display: grid; gap: 14px; }
.sq-g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.sq-g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.sq-g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.sq-stat { display: flex; flex-direction: column; gap: 11px; padding: 17px 18px 18px; }
.sq-bande { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); margin: 0 0 18px; border-block: 1px solid var(--trait); }
.sq-bande > div { display: flex; flex-direction: column; gap: 12px; padding: 20px 18px 22px 2px; }
.sq-bande > div + div { padding-left: 18px; border-left: 1px solid var(--trait); }
.sq-graphe { display: flex; align-items: flex-end; gap: 1.6%; height: 210px; padding-top: 12px; border-bottom: 1px solid var(--trait); }
.sq-graphe > .sq { flex: 1; width: auto; border-radius: 5px 5px 2px 2px; }
.sq-kanban { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; align-items: start; }
.sq-kanban > .list { padding: 12px 10px 10px; display: flex; flex-direction: column; gap: 10px; }
.sq-kcarte { display: flex; flex-direction: column; gap: 10px; padding: 14px 12px; border-radius: var(--r-md); background: var(--verre-creux); box-shadow: inset 0 0 0 1px var(--trait); }
.sq-bulle { display: flex; gap: 10px; align-items: flex-start; margin: 0 0 16px; }
.sq-bulle.droite { flex-direction: row-reverse; }
.sq-bulle > .sq-pile { max-width: 62%; flex: none; }
.sq-bulle.droite > .sq-pile { align-items: flex-end; }
.sq-barre { display: flex; align-items: center; gap: 10px; min-height: 34px; overflow: hidden; }
.sq-onglets, .sq-pastilles, .sq-entete { overflow: hidden; }
.topbar.sq-actif > :not(.sq-barre) { display: none !important; }
.sq-pastilles { display: flex; gap: 10px; margin: 0 0 18px; }
.sq-colonnes { display: grid; grid-template-columns: 190px minmax(0, 1fr); gap: 26px; align-items: start; }
.sq-lent {
    display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
    margin: 0 0 18px; padding: 12px 16px;
    border-radius: var(--r-lg);
    background: var(--creux);
    box-shadow: inset 0 0 0 1px var(--trait);
    font-size: 14px; color: var(--label-2);
}
.sq-lent > span { flex: 1; min-width: 200px; }
@media (max-width: 860px) {
    .sq-g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .sq-g3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .sq-bande { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .sq-bande > div:nth-child(3) { padding-left: 2px; border-left: 0; border-top: 1px solid var(--trait); }
    .sq-bande > div:nth-child(4) { border-top: 1px solid var(--trait); }
    .sq-kanban { grid-template-columns: minmax(0, 1fr); }
    .sq-kanban > :nth-child(n+2) { display: none; }
    .sq-colonnes { grid-template-columns: minmax(0, 1fr); }
    .sq-colonnes > :first-child { display: none; }
    .sq-large { display: none; }
}
@media (max-width: 560px) {
    .sq-g2, .sq-g3 { grid-template-columns: minmax(0, 1fr); }
    .sq-entete > .sq-fin, .sq-anneau, .sq-onglets > :nth-child(n+4) { display: none; }
    .sq-graphe > :nth-child(odd) { display: none; }
}

/* Une zone qui se recharge (un fragment, pas la page) : son contenu
   s'estompe et le même reflet la traverse. */
.sq-zone { position: relative; }
.sq-zone > * { opacity: .45; transition: opacity .2s var(--ease); }
.sq-zone::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    pointer-events: none;
    background: linear-gradient(100deg, transparent 30%, var(--sq-reflet) 50%, transparent 70%) no-repeat;
    background-size: 60% 100%;
    animation: sq-balaye 1.8s ease-in-out infinite;
}
@keyframes sq-balaye { from { background-position: -150% 0; } to { background-position: 250% 0; } }

/* L'accusé immédiat (squelettes.js) : le bouton s'enfonce dès le clic et
   ne se reclique pas ; le rond qui tourne ne vient qu'après 150 ms. */
.btn.sq-appui {
    cursor: progress; pointer-events: none;
    transform: translateY(1px) scale(.985); filter: brightness(.96) saturate(.92);
    transition: transform .06s ease-out, filter .06s ease-out;
}
@media (prefers-reduced-motion: reduce) { .btn.sq-appui { transform: none; } }

/* Un bouton dont l'action est partie : il tourne, il ne se reclique pas. */
.btn.sq-attente { cursor: progress; pointer-events: none; opacity: .82; }
.btn.sq-attente > .icon { display: none; }
.btn.sq-attente::before {
    content: '';
    flex: none;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    border: 2px solid currentColor;
    border-right-color: transparent;
    animation: sq-tourne .7s linear infinite;
}
@keyframes sq-tourne { to { transform: rotate(360deg); } }

/* La densité, posée sur <html> avant le premier rendu. */
:root[data-densite="compact"] .row { padding: 6px 12px; min-height: 0; }
:root[data-densite="compact"] .row-sub { font-size: 12px; }
:root[data-densite="compact"] .card { padding: 12px 14px; }
:root[data-densite="compact"] .section-title { margin: 16px 0 6px; }
:root[data-densite="compact"] .stat { padding: 12px 14px; }
:root[data-densite="compact"] .stat-value { font-size: 25px; }
:root[data-densite="compact"] .grid { gap: 9px; }
:root[data-densite="compact"] .hero { padding: 16px 18px 14px; margin-bottom: 14px; }
:root[data-densite="compact"] .hero-courbe { display: none; }

/* Transitions de page, là où le navigateur sait les faire. */
@view-transition { navigation: auto; }
@media (prefers-reduced-motion: no-preference) {
    ::view-transition-old(root) { animation: vt-sort .16s var(--ease) both; }
    ::view-transition-new(root) { animation: vt-entre .22s var(--ease) both; }
}
@keyframes vt-sort  { to   { opacity: 0; transform: translateY(-4px); } }
@keyframes vt-entre { from { opacity: 0; transform: translateY(6px); } }
@keyframes sq-pouls { 50% { opacity: .5; } }

@media (prefers-reduced-motion: reduce) {
    .content > *, .grid > *, .dn-faces .dn-face, .cmdk-boite, .cmdk.ouvert, .empty,
    #filet, .sq-page, .nav-ico.tinte .icon { animation: none !important; }
    /* Les squelettes : une pulsation douce, sans déplacement. */
    .sq::after, .sq-zone::after { content: none; }
    .sq { animation: sq-pouls 2.4s ease-in-out infinite; }
    .btn.sq-attente::before { animation-duration: 1.6s; }
    .dn-face, .dn-paroi, .card, .stat, .pop, .nav-menu { transition: none !important; }
    a.card:hover, a.stat:hover { transform: none; }
    ::view-transition-old(root), ::view-transition-new(root) { animation: none !important; }
}


/* ═══════════════════════════════════════════════════════════
   11. QUAND LE VERRE NE CONVIENT PAS
   ═══════════════════════════════════════════════════════════
   Le verre est un bonus. Trois cas le retirent, et rendent des
   surfaces opaques, bien contrastées. */

/* a) Le système demande moins de transparence (macOS, iOS, Windows). */
@media (prefers-reduced-transparency: reduce) {
    body::before { background: var(--fond); }
    body::after { display: none; }
    .card, .list, .stat, .hero, .table-wrap, .topnav::before,
    .sheet-panel, .cmdk-boite, .nav-menu, .pop, .toast {
        background: var(--surface) !important;
        -webkit-backdrop-filter: none !important;
        backdrop-filter: none !important;
    }
    .topnav::before { clip-path: inset(0 round 18px); inset: 0; }
}

/* b) Le système demande plus de contraste. */
@media (prefers-contrast: more) {
    :root { --trait: rgba(0, 0, 0, .3); --label-2: rgba(20, 20, 40, .9); }
    .card, .list, .stat, .hero, .table-wrap, .sheet-panel, .cmdk-boite, .nav-menu, .pop, .toast {
        background: var(--surface) !important;
        box-shadow: 0 0 0 1px var(--label-2) !important;
    }
}

/* c) Le navigateur ne sait pas flouter : un fond translucide SANS
      flou laisserait passer le dégradé en clair sous le texte. */
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
    body::before { background: var(--fond); }
    .card, .list, .stat, .hero, .table-wrap, .topnav::before,
    .sheet-panel, .cmdk-boite, .nav-menu, .pop, .toast {
        background: var(--surface) !important;
    }
}


/* ═══════════════════════════════════════════════════════════
   12. ÉCRANS ÉTROITS
   ═══════════════════════════════════════════════════════════ */

@media (max-width: 1100px) {
    .nav-k span, .nav-k kbd { display: none; }
    .nav-k { padding: 0 10px; }
    .bot-state .caption { display: none; }
    .bot-state { padding: 0 10px; }
}
@media (max-width: 900px) {
    .topnav .brand-name { display: none; }
    .nav-g > button, .nav-g > a { padding: 0 9px; }
}
/* Sous 760 px, quatre groupes et quatre outils ne tiennent plus sur une
   ligne : ils se chevauchaient. Les sections passent alors par la
   recherche, qui liste toutes les pages dès qu'elle s'ouvre — un menu,
   en somme, qui sait aussi trouver un client. */
@media (max-width: 760px) {
    .topnav { gap: 4px; padding: 0 8px 0 10px; }
    .nav-groupes { display: none; }
    .nav-droite { margin-left: auto; }

    /* Les cinq sections passent en bas, au pouce — comme le portail
       client. Les onglets de section restent en haut, et défilent. */
    .main { padding-bottom: 96px; }
    .tabbar {
        position: fixed; left: 10px; right: 10px; bottom: calc(10px + env(safe-area-inset-bottom)); z-index: 70;
        display: grid; grid-template-columns: repeat(5, 1fr); height: 62px; padding: 0 4px;
        max-width: 560px; margin: 0 auto;
        border-radius: 20px; isolation: isolate;
        box-shadow: var(--reflet, none), 0 0 0 1px var(--contour, var(--trait)), var(--ombre-haute, 0 10px 30px rgba(0,0,0,.18));
    }
    .tabbar::before {
        content: ''; position: absolute; inset: 0; z-index: -1; border-radius: inherit;
        background: var(--verre-flottant, var(--carte));
        -webkit-backdrop-filter: blur(var(--flou-flottant, 24px)) saturate(180%);
        backdrop-filter: blur(var(--flou-flottant, 24px)) saturate(180%);
    }
    .tabbar a {
        position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
        font-size: 10.5px; font-weight: 600; color: var(--label-2); text-decoration: none;
    }
    .tabbar a.actif { color: var(--marque); }
    .tabbar .nav-badge { position: absolute; top: 6px; left: calc(50% + 6px); min-width: 17px; height: 17px; line-height: 17px; font-size: 10.5px; padding: 0 5px; }
}
@media (max-width: 860px) {
    .content { padding-inline: 18px; }
    .topbar, .topbar.material { padding-inline: 18px; }
    .dn { justify-content: center; }
    .pop { position: fixed; top: 80px; right: 12px; left: 12px; width: auto; }
}
@media (max-width: 680px) {
    .content { padding-inline: 14px; }
    .title-lg { font-size: 27px; }
    .notif-panel { width: auto; }
}


/* ═══════════════════════════════════════════════════════════
   13. PAGES DE DONNÉES — en-tête, onglets, tableaux, statuts
   ═══════════════════════════════════════════════════════════
   Le modèle est celui des outils qu'on ouvre toute la journée
   (Stripe, Linear) plutôt que celui des gabarits : des lignes denses
   posées dans un panneau, des chiffres alignés à droite en chasse
   fixe, un statut dit par un point et un mot — le moins d'encre
   possible pour la plus grande quantité d'information. */

.entete { display: flex; align-items: flex-end; gap: 16px 20px; flex-wrap: wrap; }
.entete-texte { flex: 1; min-width: 240px; }
.entete-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.entete-actions .search { min-width: 290px; height: 36px; padding: 0 11px; }
.search > .icon { color: var(--label-3); flex: none; }
.lien-discret { margin-left: 6px; font-size: 13px; }

/* ─── Onglets à compteurs ──────────────────────────────────────
   Ils répondent avant qu'on clique : combien, et pour ce qui attend,
   combien d'argent. Soulignés plutôt que segmentés : un filtre
   principal de page, pas un réglage. */
.onglets {
    display: flex;
    gap: 2px;
    margin: 22px 0 4px;
    border-bottom: 1px solid var(--trait);
    overflow-x: auto;
    scrollbar-width: none;
}
.onglets a {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 9px 12px 12px;
    border-radius: 9px 9px 0 0;
    color: var(--label-2) !important;
    font-size: 14px;
    font-weight: 550;
    white-space: nowrap;
    text-decoration: none !important;
    transition: color .15s var(--ease), background .15s var(--ease);
}
.onglets a:hover { color: var(--label) !important; background: var(--survol); }
.onglets a.actif { color: var(--label) !important; font-weight: 650; }
.onglets a.actif::after {
    content: '';
    position: absolute;
    left: 10px; right: 10px; bottom: -1px;
    height: 2px;
    border-radius: 2px;
    background: var(--marque);
}
.onglet-n {
    min-width: 20px;
    height: 19px;
    padding: 0 6px;
    border-radius: 10px;
    background: var(--creux);
    color: var(--label-2);
    font-size: 11.5px;
    font-weight: 650;
    line-height: 19px;
    text-align: center;
    font-variant-numeric: tabular-nums;
}
.onglets a.actif .onglet-n { background: var(--marque-doux); color: var(--marque); }
.onglet-somme { font-size: 12.5px; font-weight: 500; color: var(--label-3); font-variant-numeric: tabular-nums; }

/* ─── Statut : un point et un mot ─────────────────────────────
   Une pastille colorée pleine par ligne transforme une liste en
   guirlande. Le point porte la couleur, le mot reste à l'encre. */
.statut {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    font-weight: 550;
    color: var(--label);
    white-space: nowrap;
}
.statut::before {
    content: '';
    width: 8px;
    height: 8px;
    flex: none;
    border-radius: 50%;
    background: var(--st, var(--label-3));
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--st, var(--label-3)) 20%, transparent);
}
.statut.s-pending, .statut.s-awaiting_payment, .statut.s-stopping { --st: var(--orange); }
.statut.s-confirmed, .statut.s-online, .statut.s-completed, .statut.s-active { --st: var(--green); }
.statut.s-refused, .statut.s-errored, .statut.s-banned { --st: var(--red); }
.statut.s-refunded, .statut.s-stopped, .statut.s-cancelled, .statut.s-closed_unfinished, .statut.s-expired { --st: var(--label-3); }
.statut.s-opened, .statut.s-in_progress, .statut.s-launching { --st: var(--marque); }

/* ─── Le tableau-relevé ────────────────────────────────────── */
.table-wrap { padding: 0; }
table.registre { width: 100%; border-collapse: separate; border-spacing: 0; }
table.registre th {
    padding: 13px 16px 10px;
    border-bottom: 1px solid var(--trait);
    color: var(--label-2);
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0;
    text-transform: none;
    text-align: left;
    white-space: nowrap;
}
table.registre td {
    padding: 12px 16px;
    border-bottom: 1px solid var(--trait);
    font-size: 14px;
    vertical-align: middle;
}
table.registre .num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
table.registre .muted { color: var(--label-2); }
table.registre td.montant { font-weight: 650; letter-spacing: -.01em; }
table.registre tr.s-refused td.montant a,
table.registre tr.s-refunded td.montant a { color: var(--label-3) !important; text-decoration: line-through !important; }
table.registre th.chev, table.registre td.chev { width: 34px; padding-left: 0; color: var(--label-3); }

/* L'en-tête de groupe (un mois) : il sépare sans ajouter de cadre. */
table.registre tr.tbl-groupe th, table.registre tr.tbl-groupe td {
    padding: 16px 16px 7px;
    border-bottom: 1px solid var(--trait);
    background: none;
    color: var(--label);
    font-size: 13px;
    font-weight: 650;
}
table.registre tr.tbl-groupe td { color: var(--label-2); font-weight: 500; font-size: 12.5px; }
table.registre tbody tr.tbl-groupe:hover { background: none; }

/* Toute la ligne est cliquable, sans JavaScript : le lien de la
   première cellule s'étend sur la ligne entière. Les autres liens de
   la ligne passent au-dessus. */
table.registre tr.tbl-lien { position: relative; }
.lien-ligne { color: inherit !important; text-decoration: none !important; }
.lien-ligne::after { content: ''; position: absolute; inset: 0; }
.au-dessus { position: relative; z-index: 1; }
table.registre tbody tr.tbl-lien:hover { background: var(--survol); }
table.registre tbody:last-child tr:last-child td { border-bottom: 0; }

/* ─── « À décider » : ce qui attend un geste ──────────────── */
.decisions { padding: 5px; }
.decision {
    display: flex;
    align-items: center;
    gap: 18px;
    padding: 13px 14px;
    border-radius: var(--r-md);
}
.decision + .decision { box-shadow: 0 -1px 0 var(--trait); }
.decision-montant {
    flex: none;
    min-width: 108px;
    color: var(--label) !important;
    font-family: var(--font-titre);
    font-size: 21px;
    font-weight: 700;
    letter-spacing: -.025em;
    text-decoration: none !important;
}
.decision-corps { flex: 1; min-width: 0; }
.decision-titre { font-size: 14.5px; font-weight: 600; }
.decision-titre a { color: var(--label) !important; }
.decision-faits {
    display: flex;
    flex-wrap: wrap;
    gap: 3px 14px;
    margin-top: 4px;
    color: var(--label-2);
    font-size: 12.5px;
}
.decision-faits > span { display: inline-flex; align-items: center; gap: 5px; }
.fait-alerte { color: color-mix(in srgb, var(--orange) 78%, var(--label)); font-weight: 600; }
.decision-actions { display: flex; flex: none; gap: 8px; }
/* Une décision qui traîne se voit de loin : le liseré orange. */
.decision.vieille {
    background-image: linear-gradient(var(--orange), var(--orange));
    background-repeat: no-repeat;
    background-position: 0 50%;
    background-size: 3px calc(100% - 24px);
}

@media (max-width: 760px) {
    .entete-actions, .entete-actions .search { width: 100%; min-width: 0; }
    .decision { flex-wrap: wrap; gap: 8px 14px; }
    .decision-actions { width: 100%; }
    .decision-actions > * { flex: 1; }
    .decision-actions .btn { width: 100%; }
}

/* ─── Fiche à deux colonnes ────────────────────────────────────
   Ce qu'on fait à gauche (décision, parcours), ce qu'on consulte à
   droite (les faits). Une seule colonne sous 980 px. */
.deux-col { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(280px, 1fr); gap: 0 22px; align-items: start; }
.col-cote { position: sticky; top: 88px; }
@media (max-width: 980px) {
    .deux-col { grid-template-columns: 1fr; }
    .col-cote { position: static; }
}

/* ─── Listes clé → valeur ──────────────────────────────────────
   Dans une fiche, on lit la VALEUR ; la clé n'est qu'une étiquette.
   L'emphase était inversée : libellés en gras, valeurs en gris. */
.kv .row { min-height: 42px; padding-block: 9px; }
.kv .row-title { font-weight: 450; color: var(--label-2); font-size: 14px; }
.kv .row-value { color: var(--label); font-weight: 560; font-size: 14px; }

/* La frise prend les couleurs du système, pas le bleu d'iOS. */
.tl-dot.blue   { background: var(--marque); border-color: var(--marque); }
.tl-dot.green  { background: var(--green);  border-color: var(--green); }
.tl-dot.orange { background: var(--orange); border-color: var(--orange); }
.tl-dot.red    { background: var(--red);    border-color: var(--red); }
.tl-dot { box-shadow: 0 0 0 4px var(--surface-carte); }
.timeline::before { background: var(--trait); }
.tl-item + .tl-item { border-top-color: var(--trait); }

/* ═══════════════════════════════════════════════════════════
   14. AVIS
   ═══════════════════════════════════════════════════════════ */

/* Les étoiles : dessinées, dorées pour les pleines, à l'encre
   tertiaire pour les vides. Le doré est la convention que tout le
   monde lit sans légende. */
.etoiles { display: inline-flex; gap: 1px; line-height: 0; flex: none; }
.etoiles .icon { display: block; }
.e-on  { color: #F2A11B; }
.e-off { color: color-mix(in srgb, var(--label) 16%, transparent); }

/* ─── La synthèse ─────────────────────────────────────────── */
.avis-synthese {
    display: grid;
    grid-template-columns: minmax(170px, .8fr) minmax(240px, 1.3fr) minmax(220px, 1fr);
    gap: 18px 34px;
    align-items: center;
    margin-top: 18px;
    padding: 22px 26px;
}
.as-note { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; }
.as-chiffre {
    font-family: var(--font-titre);
    font-size: 56px;
    font-weight: 700;
    letter-spacing: -.045em;
    line-height: .95;
}
.as-sous { font-size: 13px; color: var(--label-2); }
.as-sous strong { color: var(--label); }

.as-distrib { display: flex; flex-direction: column; gap: 3px; }
.as-barre {
    display: grid;
    grid-template-columns: 34px 1fr 30px;
    align-items: center;
    gap: 10px;
    padding: 4px 8px;
    margin: 0 -8px;
    border-radius: 8px;
    color: var(--label) !important;
    text-decoration: none !important;
    transition: background .14s var(--ease);
}
.as-barre:hover { background: var(--survol); }
.as-barre.actif { background: var(--marque-doux); }
.as-barre.vide { opacity: .55; }
.as-niveau { display: inline-flex; align-items: center; gap: 3px; font-size: 13px; font-weight: 600; }
.as-niveau .icon { color: #F2A11B; }
.as-piste { height: 8px; border-radius: 4px; background: var(--creux); overflow: hidden; }
.as-plein { display: block; height: 100%; border-radius: 4px; background: #F2A11B; min-width: 0; }
/* Les basses notes en couleur d'alerte : ce sont elles qu'on cherche. */
.as-plein.n2 { background: color-mix(in srgb, var(--red) 70%, #F2A11B); }
.as-plein.n1 { background: var(--red); }
.as-n { font-size: 13px; color: var(--label-2); text-align: right; }

.as-faits { display: flex; flex-direction: column; gap: 2px; }
.as-fait {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    padding: 6px 0;
    color: var(--label) !important;
    text-decoration: none !important;
}
.as-fait + .as-fait { border-top: 1px solid var(--trait); }
.as-fait-l { font-size: 13px; color: var(--label-2); }
.as-fait-v { font-size: 15px; font-weight: 650; }
.as-fait-v small { font-size: 12px; font-weight: 500; color: var(--label-2); }
.as-fait-v.alerte { color: color-mix(in srgb, var(--orange) 80%, var(--label)); }
.as-delta { margin-left: 6px; font-size: 12px; font-weight: 650; }
.as-delta.up   { color: color-mix(in srgb, var(--green) 80%, var(--label)); }
.as-delta.down { color: color-mix(in srgb, var(--red) 80%, var(--label)); }

/* Six mois en six barres : la moyenne mensuelle, sans axe ni légende
   — la hauteur suffit, le détail est au survol. */
.as-mois { display: flex; align-items: flex-end; gap: 8px; height: 58px; margin-top: 10px; padding-top: 6px; border-top: 1px solid var(--trait); }
.as-m { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 4px; height: 100%; }
.as-m-barre { width: 100%; max-width: 22px; min-height: 2px; border-radius: 3px 3px 1px 1px; background: color-mix(in srgb, var(--marque) 55%, transparent); }
.as-m-l { font-size: 10.5px; color: var(--label-3); text-transform: capitalize; }

.onglets-droite { margin-left: auto; display: flex; align-items: center; padding-bottom: 6px; }
.onglets-droite .segmented a { padding: 4px 11px; font-size: 12.5px; }

/* ─── Les avis ─────────────────────────────────────────────── */
/* Une grille qui se lit ligne par ligne, pas des colonnes CSS : en
   colonnes, les avis se lisaient de haut en bas puis dans la colonne
   d'à côté, et « les plus récents d'abord » ne voulait plus rien dire. */
.avis-grille { display: grid; grid-template-columns: repeat(auto-fill, minmax(380px, 1fr)); gap: 14px; align-items: start; margin-top: 16px; }
.avis-grille .card.avis { margin: 0; }
@media (max-width: 480px) { .avis-grille { grid-template-columns: 1fr; } }
.avis { padding: 16px 18px 12px; }
.avis-tete { display: flex; align-items: center; gap: 10px; }
.avatar {
    width: 34px;
    height: 34px;
    flex: none;
    border-radius: 50%;
    display: grid;
    place-items: center;
    object-fit: cover;
    color: #fff;
    background: var(--t, var(--label-3));
    font-size: 14px;
    font-weight: 650;
}
.avis-qui { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.25; }
.avis-qui a { color: var(--label) !important; font-weight: 600; font-size: 14px; }
.avis-qui time { font-size: 12px; color: var(--label-2); }
.avis-texte {
    margin: 12px 0 12px;
    font-size: 15px;
    line-height: 1.55;
    color: var(--label);
    text-wrap: pretty;
}
.avis-texte.vide { color: var(--label-3); font-size: 13.5px; font-style: italic; }
.avis-pied {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px 12px;
    padding-top: 10px;
    border-top: 1px solid var(--trait);
    font-size: 12.5px;
}
.avis-source { color: var(--label-2); }
.avis-alerte { color: color-mix(in srgb, var(--orange) 80%, var(--label)); font-weight: 600; }
.avis-pied a { font-weight: 550; }
.avis-pied a.discret { color: var(--label-2) !important; font-weight: 500; }
/* La réponse publique, sous l'avis ; le formulaire se déplie. */
.avis-reponse {
    margin: 0 0 12px;
    padding: 9px 12px 10px;
    border-radius: 10px;
    background: var(--creux);
    box-shadow: inset 3px 0 0 color-mix(in srgb, var(--marque) 60%, transparent);
}
.avis-reponse-qui { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 600; color: var(--label-2); }
.avis-reponse p { margin: 4px 0 0; font-size: 14px; line-height: 1.5; white-space: pre-wrap; text-wrap: pretty; }
.avis-repondre { margin-top: 8px; font-size: 12.5px; }
.avis-repondre summary { cursor: pointer; color: var(--label-2); font-weight: 500; list-style: none; width: fit-content; }
.avis-repondre summary::-webkit-details-marker { display: none; }
.avis-repondre summary:hover { color: var(--label); }
.avis-repondre[open] summary { margin-bottom: 8px; color: var(--label); }
.as-fait { flex-wrap: wrap; }
.as-fait-s { flex-basis: 100%; margin-top: -3px; font-size: 11.5px; color: var(--label-3); }

/* Un avis à une ou deux étoiles porte un filet rouge en tête : on le
   repère en survolant la grille, sans lire les étoiles une à une. */
.avis.mauvais { box-shadow: var(--reflet), 0 0 0 1px var(--contour), inset 0 3px 0 color-mix(in srgb, var(--red) 70%, transparent), var(--ombre); }

@media (max-width: 900px) {
    .avis-synthese { grid-template-columns: 1fr 1fr; }
    .as-faits { grid-column: 1 / -1; }
}
@media (max-width: 600px) {
    .avis-synthese { grid-template-columns: 1fr; padding: 18px; }
    .onglets-droite { display: none; }
}


/* ═══════════════════════════════════════════════════════════
   15. COMMANDES — chiffres, pipeline, bandeaux
   ═══════════════════════════════════════════════════════════ */

/* Une rangée de chiffres posée sur la page, sans tuiles : quatre
   nombres n'ont pas besoin de quatre cadres. */
.chiffres {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0;
    margin: 20px 0 18px;
    border-top: 1px solid var(--trait);
    border-bottom: 1px solid var(--trait);
}
.chiffre { display: flex; flex-direction: column; gap: 3px; padding: 14px 18px 14px 2px; }
.chiffre + .chiffre { padding-left: 18px; border-left: 1px solid var(--trait); }
.chiffre-v { font-family: var(--font-titre); font-size: 22px; font-weight: 700; letter-spacing: -.025em; }
.chiffre-l { font-size: 12.5px; color: var(--label-2); line-height: 1.35; }

/* ─── Le pipeline ──────────────────────────────────────────── */
.pipeline {
    display: grid;
    grid-template-columns: repeat(4, minmax(220px, 1fr));
    gap: 12px;
    align-items: start;
    overflow-x: auto;
    padding-bottom: 4px;
}
.colonne {
    border-radius: var(--r-lg);
    background: var(--verre-creux);
    box-shadow: inset 0 0 0 1px var(--trait);
    padding: 10px;
    min-height: 140px;
}
.colonne-tete { display: flex; align-items: center; gap: 8px; padding: 2px 4px 10px; }
.colonne-tete .statut { font-size: 13.5px; font-weight: 650; }
.colonne-n {
    min-width: 20px; height: 19px; padding: 0 6px; border-radius: 10px;
    background: var(--creux); color: var(--label-2);
    font-size: 11.5px; font-weight: 650; line-height: 19px; text-align: center;
}
.colonne-somme { margin-left: auto; font-size: 12.5px; color: var(--label-2); font-weight: 550; }
.colonne-corps { display: flex; flex-direction: column; gap: 8px; }
.colonne-vide { margin: 6px 4px 8px; font-size: 13px; color: var(--label-3); }
.c-completed .carte-cmd { opacity: .82; }

/* La carte : une vraie surface de verre, posée dans la colonne. */
.carte-cmd {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 11px 12px 10px;
    border-radius: 12px;
    background-image: linear-gradient(180deg, var(--verre-haut), var(--verre-bas));
    box-shadow: var(--reflet), 0 0 0 1px var(--contour), 0 1px 2px rgba(0, 0, 0, .05), 0 6px 16px -10px rgba(0, 0, 0, .25);
    color: var(--label) !important;
    text-decoration: none !important;
    transition: transform .16s var(--ease), box-shadow .16s var(--ease);
}
.carte-cmd:hover { transform: translateY(-1px); box-shadow: var(--reflet), 0 0 0 1px color-mix(in srgb, var(--marque) 35%, transparent), 0 10px 22px -12px rgba(0, 0, 0, .35); }
.carte-cmd.urgente { box-shadow: var(--reflet), 0 0 0 1px color-mix(in srgb, var(--red) 45%, transparent), 0 6px 16px -10px rgba(0, 0, 0, .25); }
.cc-titre { display: flex; align-items: center; gap: 7px; font-size: 14px; font-weight: 620; line-height: 1.3; }
.cc-sous { font-size: 12.5px; color: var(--label-2); line-height: 1.35; }
.cc-pied { display: flex; align-items: center; gap: 8px; font-size: 12.5px; }
.cc-qui { display: inline-flex; align-items: center; gap: 4px; color: var(--label-2); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cc-prix { margin-left: auto; font-weight: 650; }
.cc-budget { margin-left: auto; color: var(--label-3); }
.cc-age { display: inline-flex; align-items: center; gap: 4px; font-size: 11.5px; color: var(--label-3); }
.cc-age.alerte { color: color-mix(in srgb, var(--red) 80%, var(--label)); font-weight: 600; }

/* ─── Bandeaux d'avertissement ─────────────────────────────── */
.bandeau {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin: 16px 0 0;
    padding: 11px 14px;
    border-radius: var(--r-md);
    font-size: 13.5px;
    line-height: 1.45;
    background: color-mix(in srgb, var(--ton, var(--orange)) 10%, transparent);
    box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--ton, var(--orange)) 25%, transparent);
}
.bandeau > .icon { margin-top: 2px; color: var(--ton, var(--orange)); }
.bandeau-rouge { --ton: var(--red); }

.cellule-sous { margin-top: 2px; color: var(--label-2); }
table.registre .is-unread { font-weight: 700; }

@media (max-width: 900px) {
    .chiffres { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .chiffre:nth-child(3) { padding-left: 2px; border-left: 0; }
    .chiffre:nth-child(n+3) { border-top: 1px solid var(--trait); }
}

.unread-dot { background: var(--marque); box-shadow: 0 0 0 3px var(--marque-doux); }

/* ═══════════════════════════════════════════════════════════
   16. SYSTÈME — jauges et process
   ═══════════════════════════════════════════════════════════ */

.jauge { display: block; height: 6px; border-radius: 3px; background: var(--creux); overflow: hidden; margin: 5px 0 2px; }
.jauge > span { display: block; height: 100%; border-radius: 3px; background: var(--marque); }
.jauge.j-vert > span   { background: var(--green); }
.jauge.j-orange > span { background: var(--orange); }
.jauge.j-rouge > span  { background: var(--red); }
.jauge.fine { height: 4px; width: 90px; margin: 0; }
.jauge.fine > span { background: color-mix(in srgb, var(--marque) 70%, transparent); }
.chiffre-v small { font-size: 15px; font-weight: 600; }

.proc-titre { font-weight: 620; }
.proc-titre a { color: var(--label) !important; }
.proc-sous { margin-top: 2px; font-size: 12px; color: var(--label-2); }
.proc-mem { display: flex; align-items: center; gap: 10px; }
.proc-mem > .tabular { min-width: 58px; }
table.process td { padding-block: 10px; }
table.registre tfoot td { padding: 10px 16px; border-top: 1px solid var(--trait); border-bottom: 0; font-size: 13px; font-weight: 600; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ═══════════════════════════════════════════════════════════
   17. AUTOMATISMES
   Une tuile par automatisme. Son état tient en un seul sélecteur à
   trois positions (coupé, à blanc, réel), toujours au même endroit,
   et se lit aussi à la couleur de la pastille de l'icône :
     réel     vert plein
     à blanc  ambre, à moitié plein : il annonce sans agir
     coupé    gris, la tuile pâlit sans disparaître
   Les trois compteurs du haut portent les mêmes couleurs : légende.
   ═══════════════════════════════════════════════════════════ */

.auto-intro { margin: 4px 0 6px; max-width: 72ch; font-size: 14px; line-height: 1.55; color: var(--label-2); }   /* aussi sur /erreurs */
.auto-tuile, .auto-etat { --m: var(--green); }
.m-blanc { --m: var(--orange); }
.m-coupe { --m: var(--label-3); }
.m-fixe  { --m: var(--green); }

.auto-etats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin: 14px 0 6px; }
.auto-etat { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-radius: var(--r-lg); background: var(--creux); box-shadow: inset 0 0 0 1px var(--trait); }
.auto-etat strong { font-size: 26px; font-weight: 650; letter-spacing: -.02em; font-variant-numeric: tabular-nums; line-height: 1; }
.auto-etat > span:last-child { display: flex; flex-direction: column; font-size: 14px; font-weight: 600; line-height: 1.25; }
.auto-etat small { font-size: 12.5px; font-weight: 450; color: var(--label-2); }
.auto-pastille { flex: none; width: 12px; height: 12px; border-radius: 50%; background: var(--m); }
/* Plein = agit ; à moitié = annonce sans agir ; vide = ne fait rien. */
.m-blanc .auto-pastille { background: linear-gradient(90deg, var(--m) 50%, transparent 50%); box-shadow: inset 0 0 0 2px var(--m); }
.m-coupe .auto-pastille { background: transparent; box-shadow: inset 0 0 0 2px var(--m); }

.auto-grille { display: grid; grid-template-columns: repeat(auto-fill, minmax(420px, 1fr)); gap: 14px; }
.auto-grille > .card { margin: 0; }
.auto-tuile { display: flex; flex-direction: column; padding: 16px 18px 12px; scroll-margin-top: 90px; }
.auto-tuile:target { box-shadow: var(--reflet), 0 0 0 2px var(--marque), var(--ombre); }
.auto-tete { display: flex; align-items: flex-start; gap: 12px; }
.auto-icone { position: relative; flex: none; display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; color: var(--label); background: var(--creux); box-shadow: inset 0 0 0 1px var(--trait); }
.auto-icone::after { content: ""; position: absolute; right: -3px; bottom: -3px; width: 11px; height: 11px; border-radius: 50%; background: var(--m); box-shadow: 0 0 0 2px var(--surface); }
.m-blanc .auto-icone::after { background: linear-gradient(90deg, var(--m) 50%, var(--surface) 50%); box-shadow: 0 0 0 2px var(--surface), inset 0 0 0 2px var(--m); }
.m-coupe .auto-icone::after { background: var(--surface); box-shadow: 0 0 0 2px var(--surface), inset 0 0 0 2px var(--m); }
.auto-nom { min-width: 0; }
.auto-nom h3 { margin: 0; font-size: 15px; font-weight: 640; letter-spacing: -.006em; line-height: 1.3; }
.auto-quand { display: block; margin-top: 2px; font-size: 12.5px; color: var(--label-2); line-height: 1.4; }
.auto-fait { flex: 1; margin: 10px 0 0; font-size: 13.5px; line-height: 1.5; color: var(--label); }
.m-coupe .auto-fait, .m-coupe .auto-nom h3 { color: var(--label-2); }
.m-coupe .auto-icone { color: var(--label-3); }

.auto-commande { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; margin-top: 14px; }
.auto-choix { display: inline-flex; padding: 3px; gap: 2px; border-radius: 10px; background: var(--creux); box-shadow: inset 0 0 0 1px var(--trait); }
.auto-choix button { display: inline-flex; align-items: center; gap: 6px; padding: 5px 12px; border: 0; border-radius: 8px; background: none; color: var(--label-2); font: inherit; font-size: 13px; font-weight: 550; cursor: pointer; }
.auto-choix button:hover { color: var(--label); }
.auto-choix button:focus-visible { outline: 2px solid var(--marque); outline-offset: 1px; }
.auto-choix button[aria-pressed="true"] { color: var(--label); background: var(--surface); box-shadow: 0 1px 2px rgba(0, 0, 0, .08), 0 0 0 1px var(--trait); cursor: default; }
.auto-choix .c-reel[aria-pressed="true"]  { color: color-mix(in srgb, var(--green) 80%, var(--label)); box-shadow: 0 1px 2px rgba(0, 0, 0, .08), inset 0 0 0 1.5px color-mix(in srgb, var(--green) 55%, transparent); }
.auto-choix .c-blanc[aria-pressed="true"] { color: color-mix(in srgb, var(--orange) 85%, var(--label)); box-shadow: 0 1px 2px rgba(0, 0, 0, .08), inset 0 0 0 1.5px color-mix(in srgb, var(--orange) 60%, transparent); }
.auto-reste { font-size: 11.5px; font-weight: 600; padding: 1px 6px; border-radius: 999px; background: color-mix(in srgb, var(--orange) 14%, transparent); font-variant-numeric: tabular-nums; }
.auto-fixe { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 550; color: color-mix(in srgb, var(--green) 80%, var(--label)); }
.auto-fixe .auto-pastille { width: 9px; height: 9px; }
.auto-lancer .btn { display: inline-flex; align-items: center; gap: 6px; }

.auto-pied { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 14px; margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--trait); font-size: 12.5px; color: var(--label-2); font-variant-numeric: tabular-nums; }
.auto-semaine { color: var(--marque); white-space: nowrap; }
.auto-erreur { display: inline-flex; align-items: center; gap: 5px; color: var(--red); }
.auto-sauvegardes { margin-top: 8px; font-size: 12.5px; color: var(--label-2); }

.auto-filtre select {
    font: inherit; font-size: 13.5px; padding: 6px 30px 6px 12px; border-radius: var(--r-md);
    color: var(--label); background-color: var(--creux); border: 1px solid var(--trait);
}

/* Le fil : heure | point | ce qui s'est passé | quel automatisme. */
.auto-fil { padding: 6px 0; }
.fil-ligne {
    --pt: var(--marque);
    display: grid; grid-template-columns: 92px 10px minmax(0, 1fr) auto; align-items: baseline; gap: 12px;
    padding: 8px 18px; font-size: 14px;
}
.fil-ligne + .fil-ligne { box-shadow: 0 -1px 0 var(--trait); }
.fil-ligne time { font-size: 12.5px; color: var(--label-2); font-variant-numeric: tabular-nums; }
.fil-point { width: 7px; height: 7px; border-radius: 50%; background: var(--pt); transform: translateY(-1px); }
.fil-ligne.niv-orange { --pt: var(--orange); }
.fil-ligne.niv-red { --pt: var(--red); }
.fil-texte a { color: var(--label); }
.fil-texte a:hover { color: var(--marque); }
.fil-blanc {
    display: inline-block; margin-right: 7px; padding: 1px 7px; border-radius: 5px;
    font-size: 11.5px; font-weight: 600; color: var(--orange);
    background: color-mix(in srgb, var(--orange) 12%, transparent);
}
.fil-source { font-size: 12px; color: var(--label-3); white-space: nowrap; }

@media (max-width: 760px) {
    .auto-grille { grid-template-columns: minmax(0, 1fr); }
    .auto-etats { gap: 8px; }
    .auto-etat { flex-direction: column; align-items: flex-start; gap: 6px; padding: 12px; }
    .auto-etat small { display: none; }
    .fil-ligne { grid-template-columns: 70px 10px minmax(0, 1fr); }
    .fil-source { display: none; }
}

/* Paiements : « J'ai payé » — le client a fait sa part, à nous de vérifier. */
.fait-declare { color: var(--green); font-weight: 600; }

/* ═══════════════════════════════════════════════════════════
   18. TRANSCRIPTIONS
   Une conversation relue, pas un export : les messages d'une même
   personne se regroupent, les jours se séparent, l'équipe se
   distingue du client par une étiquette — jamais par une bulle
   colorée qui ferait « messagerie ». Lisible longtemps, à froid.
   ═══════════════════════════════════════════════════════════ */

.tr-type {
    display: inline-block; padding: 1px 8px; border-radius: 6px;
    font-size: 12.5px; font-weight: 600;
    color: var(--ton, var(--label-2));
    background: color-mix(in srgb, var(--ton, var(--label-2)) 12%, transparent);
}
.tr-type.t-help    { --ton: var(--teal); }
.tr-type.t-order   { --ton: var(--indigo); }
.tr-type.t-account { --ton: var(--orange); }

.tr-grille { margin-top: 14px; }
.tr-fil { padding: 6px 0 4px; }

.tr-jour { position: relative; display: flex; justify-content: center; margin: 14px 0 6px; }
.tr-jour::before { content: ''; position: absolute; left: 20px; right: 20px; top: 50%; height: 1px; background: var(--trait); }
.tr-jour span {
    position: relative; padding: 2px 12px; border-radius: 999px;
    font-size: 12px; font-weight: 600; color: var(--label-2); text-transform: none;
    background: var(--verre-flottant); box-shadow: inset 0 0 0 1px var(--trait);
}

.tr-groupe { display: flex; gap: 12px; padding: 8px 20px 6px; }
.tr-groupe:hover { background: var(--survol); }
.tr-avatar { width: 36px; height: 36px; flex: none; border-radius: 50%; object-fit: cover; margin-top: 2px; }
.tr-avatar.petit { width: 30px; height: 30px; font-size: 12.5px; margin: 0; }
.tr-corps { flex: 1; min-width: 0; }
.tr-tete { display: flex; align-items: baseline; gap: 8px; margin-bottom: 2px; }
.tr-nom { font-size: 14.5px; font-weight: 650; }
.tr-role {
    font-size: 11px; font-weight: 650; padding: 0 6px; border-radius: 5px; line-height: 17px;
    color: var(--label-2); background: var(--creux);
}
.r-equipe .tr-nom { color: var(--marque); }
.r-equipe .tr-role { color: var(--marque); background: var(--marque-doux); }
.r-bot .tr-nom { color: var(--label-2); }
.tr-tete time { font-size: 12px; color: var(--label-3); font-variant-numeric: tabular-nums; }

.tr-msg { position: relative; padding: 1px 0; }
.tr-heure {
    position: absolute; left: -48px; top: 3px; width: 40px; text-align: right;
    font-size: 11px; color: var(--label-3); font-variant-numeric: tabular-nums; opacity: 0;
}
.tr-msg:hover .tr-heure { opacity: 1; }
.tr-texte { font-size: 14.5px; line-height: 1.5; overflow-wrap: anywhere; }
.tr-texte strong { font-weight: 650; }
.tr-texte .md-pre--multiline, .tr-texte .md-pre.md-pre--multiline {
    display: block; white-space: pre-wrap; font-family: var(--mono); font-size: 12.5px;
    background: var(--creux); border-radius: 8px; padding: 9px 11px; margin: 6px 0;
}
.tr-texte .md-pre--inline { font-family: var(--mono); font-size: .89em; background: var(--creux); border-radius: 5px; padding: 1px 5px; }
.tr-texte .md-quote { display: flex; }
.tr-texte .md-emoji { width: 1.25em; height: 1.25em; vertical-align: -.25em; }
.tr-texte .md-spoiler-text { background: var(--creux); border-radius: 4px; padding: 0 3px; }

/* L'encart : la barre de couleur de Discord, en retrait, sur un creux. */
.tr-encart {
    position: relative; max-width: 520px; margin: 6px 0 4px; padding: 10px 14px 10px 16px;
    border-radius: 10px; background: var(--creux); overflow: hidden;
}
.tr-encart::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--pill); }
.tr-encart-auteur { font-size: 12.5px; font-weight: 600; color: var(--label-2); margin-bottom: 3px; }
.tr-encart-titre { font-size: 14.5px; font-weight: 650; margin-bottom: 3px; }
.tr-encart-texte { font-size: 13.5px; line-height: 1.5; color: var(--label); }
.tr-champs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px 14px; margin-top: 8px; }
.tr-champ { grid-column: 1 / -1; min-width: 0; }
.tr-champ.inline { grid-column: auto; }
.tr-champ-nom { font-size: 12.5px; font-weight: 650; margin-bottom: 1px; }
.tr-champ-val { font-size: 13px; line-height: 1.45; color: var(--label-2); overflow-wrap: anywhere; }
.tr-encart-pied { margin-top: 8px; font-size: 11.5px; color: var(--label-3); }

.tr-pjs { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0 2px; }
.tr-pj {
    display: inline-flex; align-items: center; gap: 7px; max-width: 320px;
    padding: 6px 10px; border-radius: 8px; font-size: 13px;
    color: var(--label); background: var(--creux); box-shadow: inset 0 0 0 1px var(--trait);
}
.tr-pj:hover { text-decoration: none; box-shadow: inset 0 0 0 1px var(--marque); }
.tr-pj .icon { color: var(--marque); flex: none; }
.tr-pj-nom { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tr-pj-taille { color: var(--label-3); font-size: 12px; flex: none; }

.tr-fin {
    display: flex; align-items: center; justify-content: center; gap: 7px;
    margin: 12px 20px 8px; padding-top: 12px; border-top: 1px solid var(--trait);
    font-size: 12.5px; color: var(--label-2);
}
.tr-fin .icon { color: var(--green); }

.tr-raison { padding: 14px 16px; margin-bottom: 14px; }
.tr-raison-titre { font-size: 12.5px; font-weight: 650; color: var(--label-2); margin-bottom: 4px; }
.tr-raison p { margin: 0; font-size: 14px; line-height: 1.5; }
.tr-participants .row { gap: 10px; }

/* La liste */
.tr-filtres { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin: 16px 0 6px; }
.tr-recherche {
    flex: 1 1 240px; max-width: 360px; font: inherit; font-size: 14px;
    padding: 7px 12px; border-radius: var(--r-md); color: var(--label);
    background: var(--creux); border: 1px solid var(--trait);
}
.tr-ligne .row-title { display: flex; align-items: baseline; gap: 8px; }
.tr-ligne .tr-type { font-size: 11.5px; }

@media (max-width: 760px) {
    .tr-groupe { padding-inline: 14px; }
    .tr-heure { display: none; }
    .tr-champs { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* ═══════════════════════════════════════════════════════════
   19. RÉPONSES TOUTES FAITES
   ═══════════════════════════════════════════════════════════ */

.rep-hote { display: inline-block; }
.rep-pop { width: 400px; top: auto; bottom: calc(100% + 10px); transform-origin: bottom right; padding: 0; }
.rep-tete { display: flex; align-items: center; gap: 10px; padding: 10px 10px 8px 12px; border-bottom: 1px solid var(--trait); }
.rep-filtre {
    flex: 1; font: inherit; font-size: 13.5px; padding: 6px 10px; border-radius: 8px;
    color: var(--label); background: var(--creux); border: 1px solid var(--trait);
}
.rep-gerer { font-size: 12.5px; color: var(--marque); }
.rep-liste { max-height: 320px; overflow-y: auto; padding: 5px; }
.rep-item {
    display: block; width: 100%; text-align: left; padding: 8px 10px; border: 0; border-radius: 8px;
    background: none; color: var(--label); font: inherit; cursor: pointer;
}
.rep-item:hover, .rep-item:focus-visible { background: var(--survol); outline: none; }
.rep-titre { display: block; font-size: 13.5px; font-weight: 620; }
.rep-apercu { display: block; margin-top: 2px; font-size: 12.5px; color: var(--label-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rep-vide { margin: 10px; font-size: 13px; color: var(--label-2); }

.rep-cartes { display: grid; gap: 12px; }
.rep-carte { padding: 14px 18px; scroll-margin-top: 90px; }
.rep-carte:target, .rep-carte.en-edition { box-shadow: var(--ombre), 0 0 0 2px var(--marque-doux); }
.rep-carte-tete { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin-bottom: 8px; }
.rep-carte-titre { margin: 0; font-size: 15.5px; font-weight: 650; letter-spacing: -.006em; }
.rep-ou { display: inline-flex; gap: 5px; }
.rep-ou .tr-type { font-size: 11.5px; }
.rep-carte-texte { font-size: 14px; line-height: 1.5; color: var(--label); }
.rep-carte-pied { margin-top: 10px; font-size: 12.5px; color: var(--label-3); }
.rep-case { display: inline-flex; align-items: center; gap: 6px; margin-right: 16px; font-size: 14px; }
.rep-aide { padding: 14px 16px; }
.rep-aide-titre { margin: 0 0 6px; font-size: 14.5px; font-weight: 650; }

@media (max-width: 760px) {
    .rep-pop { width: calc(100vw - 32px); right: -60px; }
}
.rep-pop.rep-bas { top: calc(100% + 8px); bottom: auto; transform-origin: top right; }
/* Dans une feuille, la liste tient dans la hauteur visible. */
.rep-pop.rep-bas .rep-liste { max-height: 170px; }

/* ═══════════════════════════════════════════════════════════
   20. FICHE CLIENT 360° — chiffres, risque, frise, rappels
   ═══════════════════════════════════════════════════════════ */

.c360 { margin-top: 16px; }
.c360 .chiffre-l a { color: var(--marque); }

.risque {
    --ton: var(--orange);
    margin-top: 12px; padding: 12px 16px; border-radius: var(--r-lg);
    background: color-mix(in srgb, var(--ton) 9%, transparent);
    box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--ton) 22%, transparent);
}
.risque.r-eleve { --ton: var(--red); }
.risque-tete { display: flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 600; }
.risque-faits { margin: 6px 0 0; padding-left: 20px; font-size: 14px; line-height: 1.6; }

.c360-grille { margin-top: 4px; }
.frise-mois { margin: 14px 0 6px 4px; font-size: 12.5px; font-weight: 650; color: var(--label-2); }
.frise { padding: 4px; }
.frise-ligne {
    --t: var(--label-2);
    display: flex; align-items: center; gap: 12px; padding: 9px 12px; border-radius: var(--r-md);
    color: var(--label);
}
a.frise-ligne:hover { background: var(--survol); text-decoration: none; }
.frise-ligne + .frise-ligne { box-shadow: 0 -1px 0 var(--trait); }
.frise-ligne.t-green  { --t: var(--green); }
.frise-ligne.t-red    { --t: var(--red); }
.frise-ligne.t-orange { --t: var(--orange); }
.frise-ligne.t-blue   { --t: var(--marque); }
.frise-ligne.t-indigo { --t: var(--indigo); }
.frise-ligne.t-teal   { --t: var(--teal); }
.frise-ico {
    width: 28px; height: 28px; flex: none; display: grid; place-items: center; border-radius: 8px;
    color: var(--t); background: color-mix(in srgb, var(--t) 12%, transparent);
}
.frise-corps { flex: 1; min-width: 0; }
.frise-titre { display: block; font-size: 14px; font-weight: 560; }
.frise-sous { display: block; margin-top: 1px; font-size: 12.5px; color: var(--label-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.frise-quand { font-size: 12.5px; color: var(--label-3); font-variant-numeric: tabular-nums; white-space: nowrap; }

.rappels { padding: 12px 14px; }
.rappel { display: flex; align-items: flex-start; gap: 10px; padding: 8px 0; }
.rappel + .rappel, .rappel + .rappel-form { border-top: 1px solid var(--trait); }
.rappel-form { padding-top: 10px; }
.rappel-corps { flex: 1; min-width: 0; }
.rappel-texte { font-size: 14px; }
.rappel-quand { font-size: 12.5px; color: var(--label-2); margin-top: 1px; }
.rappel.du .rappel-quand { color: var(--orange); font-weight: 600; }
.rappel-quand-select { flex: 1; padding-block: 6px; }

/* ═══════════════════════════════════════════════════════════
   21. ERREURS DES BOTS
   ═══════════════════════════════════════════════════════════ */

.err-bloc { margin-top: 14px; padding: 0; scroll-margin-top: 90px; }
.err-bloc:target { box-shadow: var(--ombre), 0 0 0 2px var(--marque-doux); }
.err-tete { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 12px; padding: 14px 18px; border-bottom: 1px solid var(--trait); }
.err-titre { display: flex; align-items: baseline; gap: 10px; font-size: 15.5px; font-weight: 650; }
.err-titre a { color: var(--label); }
.err-titre .statut { font-size: 12.5px; font-weight: 550; }
.err-meta { font-size: 12.5px; color: var(--label-2); }
.err-liste { padding: 4px 0; }
.err-ligne { display: flex; align-items: flex-start; gap: 12px; padding: 9px 18px; }
.err-ligne + .err-ligne { box-shadow: 0 -1px 0 var(--trait); }
.err-n {
    flex: none; min-width: 38px; text-align: center; padding: 1px 6px; border-radius: 6px;
    font-size: 12.5px; font-weight: 700; color: var(--red); background: color-mix(in srgb, var(--red) 11%, transparent);
}
.err-corps { flex: 1; min-width: 0; }
.err-msg { display: block; font-family: var(--mono); font-size: 12.5px; line-height: 1.5; white-space: pre-wrap; overflow-wrap: anywhere; color: var(--label); }
.err-pile { margin-top: 4px; }
.err-pile summary { cursor: pointer; font-size: 12px; color: var(--label-2); }
.err-pile pre { margin: 6px 0 0; padding: 8px 10px; border-radius: 8px; background: var(--creux); font-family: var(--mono); font-size: 11.5px; line-height: 1.5; white-space: pre-wrap; overflow-wrap: anywhere; color: var(--label-2); }
.err-quand { flex: none; font-size: 12px; color: var(--label-3); white-space: nowrap; }
.err-rien { margin: 0; padding: 12px 18px; font-size: 13.5px; color: var(--label-2); }

/* ─── Drapeaux (lib/drapeaux.js) ──────────────────────────────
   Dessinés en SVG : Windows n'affiche aucun emoji-drapeau (« GB »,
   « FR » à la place). Un filet sombre très léger détache le blanc du
   drapeau français sur une surface claire. */
.drapeau { display: inline-flex; flex: none; vertical-align: -2px; border-radius: 3px; overflow: hidden;
    box-shadow: 0 0 0 1px rgba(0, 0, 0, .12); }
.drapeau svg { display: block; width: 100%; height: 100%; }
.drapeau-sm { width: 16px; height: 11px; border-radius: 2px; }
.drapeau-md { width: 20px; height: 14px; }
.drapeau-lg { width: 24px; height: 16px; border-radius: 4px; }


/* ─── Fiche d'un bot : la barre d'actions et son menu « Plus » ── */
.fiche-tete { position: relative; z-index: 6; }   /* son menu passe au-dessus des cartes suivantes */
.fiche-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--trait); }
.fiche-actions form { display: contents; }
.fiche-actions .btn { display: inline-flex; align-items: center; gap: 6px; }
.fiche-plus { margin-left: auto; }
/* Posé DANS une carte en verre : son flou ne verrait que la carte (un
   backdrop-filter imbriqué ne floute pas la page) → surface opaque. */
.pop.menu-actions { width: 272px; padding: 6px; top: calc(100% + 8px); right: 0; background-color: var(--surface); -webkit-backdrop-filter: none; backdrop-filter: none; }
.menu-groupe { display: flex; flex-direction: column; padding: 4px 0; }
.menu-groupe + .menu-groupe { border-top: 1px solid var(--trait); margin-top: 2px; padding-top: 6px; }
.menu-groupe form { display: contents; }
.menu-titre { font-size: 12px; font-weight: 650; color: var(--label-2); padding: 4px 10px 4px; }
.menu-item { display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px 10px; border: 0; border-radius: 8px; background: none; color: var(--label); font: inherit; font-size: 14px; text-align: left; cursor: pointer; }
.menu-item svg { color: var(--label-2); flex: none; }
.menu-item:hover, .menu-item:focus-visible { background: var(--survol); outline: none; }
.menu-danger .menu-item, .menu-danger .menu-item svg { color: var(--red); }
.menu-danger .menu-item:hover, .menu-danger .menu-item:focus-visible { background: color-mix(in srgb, var(--red) 10%, transparent); }
@media (max-width: 860px) {
    .pop.menu-actions { position: absolute; top: calc(100% + 8px); left: auto; right: 0; width: 272px; }
}

/* ─── Fil d'un ticket : ajouts communs au vivant et à l'archive ── */
.md-emoji { width: 1.3em; height: 1.3em; vertical-align: -.28em; object-fit: contain; }
.md-sub { display: block; font-size: .86em; color: var(--label-3); }
.tr-modifie { font-size: 11.5px; color: var(--label-3); }
.tr-encart.avec-vignette { padding-right: 92px; min-height: 84px; }
.tr-encart-vignette { position: absolute; top: 12px; right: 12px; width: 68px; height: 68px; border-radius: 8px; object-fit: cover; }
.tr-encart-image { display: block; max-width: 100%; max-height: 300px; margin-top: 10px; border-radius: 8px; }
.tr-encart .md-h1, .tr-encart .md-h2, .tr-encart .md-h3 { margin-top: 2px; }
/* La carte de statut : épinglée et rééditée, elle dit l'état ACTUEL. */
.tr-epingle { display: inline-flex; align-items: center; gap: 5px; margin: 4px 0 2px; font-size: 11.5px; font-weight: 600; color: var(--marque); }
.tr-statut .tr-encart { box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--marque) 30%, transparent); }
/* Les boutons sous un message, comme le client les voyait (inertes ici). */
.tr-boutons { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0 2px; max-width: 540px; }
.tr-bouton {
    display: inline-flex; align-items: center; gap: 6px; min-height: 30px; padding: 4px 12px;
    border-radius: 7px; font-size: 13px; font-weight: 600; line-height: 1.2; cursor: default;
    color: #fff; background: #5865F2;
}
.tr-bouton.s-secondary, .tr-bouton.s-menu { color: var(--label); background: var(--creux); box-shadow: inset 0 0 0 1px var(--trait); }
.tr-bouton.s-success { background: #248046; }
.tr-bouton.s-danger { background: #DA373C; }
.tr-bouton.s-link { color: var(--label); background: var(--creux); box-shadow: inset 0 0 0 1px var(--trait); cursor: pointer; }
.tr-bouton.s-link:hover { text-decoration: none; box-shadow: inset 0 0 0 1px var(--marque); }
.tr-bouton.eteint { opacity: .5; }
.tr-bouton .md-emoji { width: 16px; height: 16px; vertical-align: 0; }

/* Le fil vivant dans la fiche d'une commande ou d'un ticket : bord à bord
   dans sa carte, défilant, collé au dernier message (app.js). */
.chat.fil-vivant { display: block; gap: 0; max-height: 640px; margin: -10px -20px 0; padding: 0 0 8px; }
.fil-plus { margin: 10px 20px 0; font-size: 12px; color: var(--label-3); text-align: center; }
/* La réponse, sous le fil, séparée comme la zone de saisie de Discord. */
.fil-compose { margin: 0 -20px; padding: 14px 20px 0; border-top: 1px solid var(--trait); }
.fil-compose-pied { margin-top: 8px; flex-wrap: wrap; row-gap: 8px; }
:root[data-densite="compact"] .chat.fil-vivant { margin: -6px -14px 0; }
:root[data-densite="compact"] .fil-compose { margin: 0 -14px; padding: 12px 14px 0; }
@media (max-width: 680px) {
    .fil-compose-pied .footnote { flex-basis: 100%; }
    .tr-groupe { padding: 8px 12px 6px; }
    .tr-champs { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* ═══ Essais (routes/essais.routes.js) ═══════════════════════ */
.badge-neutre { background: var(--creux, color-mix(in srgb, var(--label) 7%, transparent)); color: var(--label-2); box-shadow: inset 0 0 0 1px var(--trait); }
.essais-tete-actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.essais-tete-actions .segmented button { font: inherit; }
.essais-alerte { display: flex; gap: 12px; align-items: flex-start; margin-top: 14px; box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--orange) 30%, transparent), var(--ombre); }
.essais-alerte > .icon { color: var(--orange); margin-top: 2px; flex: none; }
.essais-alerte strong { display: block; }
.essais-alerte p { margin: 3px 0 0; color: var(--label-2); font-size: 13.5px; }

.essai-carte + .essai-carte { margin-top: 10px; }
.essai-carte.en-cours { box-shadow: inset 3px 0 0 var(--blue), var(--ombre); }
.essai-carte.attente { box-shadow: inset 3px 0 0 var(--indigo), var(--ombre); }
.essai-tete { display: flex; gap: 12px; align-items: center; }
.essai-qui { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.35; }
.essai-qui a { color: var(--label) !important; font-weight: 650; font-size: 14.5px; }
.essai-qui span { font-size: 13px; color: var(--label-2); }
.essai-badges { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; flex: none; }
.essai-fin { flex: none; text-align: right; display: flex; flex-direction: column; line-height: 1.3; }
.essai-fin strong { font-size: 15px; }
.essai-fin span { font-size: 12.5px; color: var(--label-2); }
.essai-rep { display: grid; gap: 6px; margin: 12px 0 0; padding: 10px 12px; border-radius: var(--r-md, 10px); background: var(--creux, color-mix(in srgb, var(--label) 5%, transparent)); }
.essai-rep > div { display: grid; grid-template-columns: 110px 1fr; gap: 10px; font-size: 13.5px; }
.essai-rep dt { color: var(--label-2); }
.essai-rep dd { margin: 0; overflow-wrap: anywhere; }
.essai-meta { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 10px; }
.essai-meta .badge .icon { vertical-align: -2px; }
.essai-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-top: 12px; }
.essai-bot .essai-actions { margin-top: 0; flex: none; }
.essai-actions form { margin: 0; }
.essai-refus { position: relative; }
.essai-refus > summary { list-style: none; cursor: pointer; }
.essai-refus > summary::-webkit-details-marker { display: none; }
.essai-refus[open] > summary { display: none; }
.essai-refus form { display: flex; gap: 8px; flex-wrap: wrap; }
.essai-refus .input { min-width: 260px; flex: 1; }
.essai-ajout { margin-top: 12px; }
.essai-ajout > summary { cursor: pointer; font-weight: 650; display: flex; align-items: center; gap: 8px; }
.essai-etapes { margin: 12px 0 0; padding-left: 20px; display: grid; gap: 6px; font-size: 13.5px; line-height: 1.5; color: var(--label-2); }
.essai-etapes b { color: var(--label); }
.essai-ajout-form { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.essai-ajout-form .input { flex: 1; min-width: 240px; }
.essai-regles ul { margin: 0; padding-left: 18px; display: grid; gap: 6px; font-size: 13.5px; line-height: 1.5; color: var(--label-2); }
.essai-regles strong { color: var(--label); }
@media (max-width: 620px) {
    .essai-tete { flex-wrap: wrap; }
    .essai-tete .essai-badges, .essai-tete .essai-fin { width: 100%; justify-content: flex-start; text-align: left; padding-left: 46px; }
    .essai-rep > div { grid-template-columns: 1fr; gap: 2px; }
    .essai-refus .input { min-width: 0; }
    /* Historique et bots : le texte d'abord, les étiquettes et boutons dessous. */
    .list .row.has-icon:has(.essai-badges), .essai-bot { flex-wrap: wrap; }
    .list .row.has-icon:has(.essai-badges) .row-body, .essai-bot .row-body { flex: 1 1 calc(100% - 60px); min-width: 0; }
    .list .row.has-icon > .essai-badges, .essai-bot > .essai-actions { width: 100%; justify-content: flex-start; padding-left: 46px; }
    .essais-tete-actions { width: 100%; }
    .essais-tete-actions .segmented { flex: 1; }
}
.essai-confiance { margin-top: 10px; display: flex; gap: 10px; align-items: flex-start; flex-wrap: wrap; }
.essai-confiance ul { margin: 0; padding-left: 16px; font-size: 13px; line-height: 1.5; color: var(--label-2); flex: 1 1 260px; }
.essai-confiance.c-douteuse ul { color: color-mix(in srgb, var(--red) 75%, var(--label)); }
.essai-retour .row-sub strong { color: var(--label); font-weight: 600; }

/* ─── Changer d'offre (fiche client › sheet-offre) ─────────────── */
.offre-effets { margin: 0 0 16px; }
.offre-effets ul { list-style: none; margin: 0; padding: 12px 14px; border-radius: var(--r-md); background: var(--creux); box-shadow: inset 0 0 0 1px var(--trait); display: flex; flex-direction: column; gap: 7px; }
.offre-effets li { display: flex; align-items: flex-start; gap: 8px; font-size: 13.5px; line-height: 1.4; }
.offre-effets li .icon { flex: none; margin-top: 3px; }
.offre-effets li.plus .icon { color: var(--green); }
.offre-effets li.moins .icon { color: var(--orange); }
.offre-effets li.note { color: var(--label-2); font-size: 12.5px; padding-top: 4px; border-top: 1px solid var(--trait); }
.offre-alerte { display: flex; gap: 9px; align-items: flex-start; margin: 0 0 16px; padding: 10px 12px; border-radius: var(--r-md); font-size: 13.5px; background: color-mix(in srgb, var(--orange) 12%, transparent); color: var(--label); }
.offre-alerte .icon { color: var(--orange); flex: none; margin-top: 2px; }
.offre-alerte a { color: inherit; font-weight: 600; text-decoration: underline; }

/* Des choix en cartes (radio ou case) : toute la carte se clique. */
.choix-liste { display: flex; flex-direction: column; gap: 8px; margin: 0 0 16px; }
.choix { display: flex; gap: 11px; align-items: flex-start; padding: 11px 13px; border-radius: var(--r-md); cursor: pointer; background: var(--creux); box-shadow: inset 0 0 0 1px var(--trait); transition: box-shadow .15s var(--ease), background .15s var(--ease); }
.choix:hover { background: var(--survol, var(--creux)); }
.choix input { margin: 3px 0 0; flex: none; accent-color: var(--marque); width: 16px; height: 16px; }
.choix span { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.choix strong { font-size: 14px; font-weight: 600; }
.choix small { font-size: 12.5px; color: var(--label-2); line-height: 1.35; }
.choix:has(input:checked) { box-shadow: inset 0 0 0 1.5px var(--marque); background: var(--marque-doux, var(--creux)); }
.choix-case { margin: 0 0 4px; }
.choix-off { cursor: default; opacity: .6; }
.choix-off a { color: inherit; text-decoration: underline; }
.choix input:focus-visible { outline: 2px solid var(--marque); outline-offset: 2px; }
/* Facturer : la facture part de toute façon, la case « prévenir » ne sert à rien. */
form:has(input[name="mode"][value="facturer"]:checked) [data-offre-prevenir] { display: none; }


/* ═══════════════════════════════════════════════════════════
   L'OUVERTURE (dashboard et portail)
   ═══════════════════════════════════════════════════════════
   Au premier chargement d'un onglet (views/_ouverture-tete.ejs pose
   html.ouverture), 3 s, passée par un clic ou une touche :
     0,15 s  la perle apparaît, une onde part d'elle
     0,55 s  la petite couche pousse de ses pieds, puis la grande
     1,35 s  le nom apparaît sous le logo
     1,55 s  une lumière court le long des deux couches, le logo s'éclaire
     2,45 s  tout se referme sur la perle, la page apparaît autour
   En clair, les teintes sont foncées pour tenir sur le fond pâle (et la
   quatrième tire sur le bleu : lagon puis or y donnait de l'olive). */
:root {
    --ouv-1: #D97A92; --ouv-2: #7C6AE6; --ouv-3: #2FA394; --ouv-4: #6C8BE8;
    --ouv-mot: #1B1934;
    --ouv-lumiere: rgba(255, 255, 255, .95);
    --ouv-lueur: rgba(74, 61, 196, .40);
    --ouv-halo: rgba(124, 108, 246, .18);
}
@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
        --ouv-1: #F2C4CF; --ouv-2: #C9BCF5; --ouv-3: #A3DDD5; --ouv-4: #EFDDAA;
        --ouv-mot: #EEEAF3;
        --ouv-lueur: rgba(201, 188, 245, .65);
        --ouv-halo: rgba(124, 108, 246, .22);
    }
}
:root[data-theme="dark"] {
    --ouv-1: #F2C4CF; --ouv-2: #C9BCF5; --ouv-3: #A3DDD5; --ouv-4: #EFDDAA;
    --ouv-mot: #EEEAF3;
    --ouv-lueur: rgba(201, 188, 245, .65);
    --ouv-halo: rgba(124, 108, 246, .22);
}

.ouverture-nacre { display: none; }
html.ouverture .ouverture-nacre {
    display: grid; place-items: center;
    position: fixed; inset: 0; z-index: 1000;
    background: var(--fond);
    animation: ouv-fermer .6s cubic-bezier(.65, 0, .35, 1) 2.45s both;
}
.ouverture-nacre::before {
    content: ''; position: absolute; inset: 0; pointer-events: none;
    background: radial-gradient(circle at 50% 48%, var(--ouv-halo), transparent 58%);
    animation: ouv-apparait .7s ease-out both;
}
.ouv-groupe { position: relative; display: flex; flex-direction: column; align-items: center; gap: 22px; }
.ouv-logo {
    width: 150px; height: 150px; overflow: visible;
    transform-origin: 50% 74%;
    animation: ouv-lueur 1.1s ease-out 1.55s both, ouv-logo .6s cubic-bezier(.65, 0, .35, 1) 2.45s both;
}
.ouv-onde {
    fill: none; stroke: var(--ouv-2); stroke-width: 1.2; vector-effect: non-scaling-stroke;
    transform-origin: 50px 74px;
    animation: ouv-onde 1.3s cubic-bezier(.2, .7, .3, 1) .35s both;
}
.ouv-c {
    fill: none; stroke: url(#ouv-nacre); stroke-width: 8; stroke-linecap: round;
    stroke-dasharray: 1 1; stroke-dashoffset: 1;
    animation: ouv-trace .85s cubic-bezier(.45, 0, .2, 1) .55s both;
}
.ouv-c2 { animation-duration: .95s; animation-delay: .85s; }
.ouv-l {
    fill: none; stroke: var(--ouv-lumiere); stroke-width: 3.2; stroke-linecap: round;
    stroke-dasharray: .08 1.2; stroke-dashoffset: .08;
    animation: ouv-court .7s cubic-bezier(.45, 0, .55, 1) 1.55s both;
}
.ouv-l2 { animation-delay: 1.75s; animation-duration: .75s; }
.ouv-perle { transform-origin: 50px 74px; animation: ouv-perle .7s cubic-bezier(.34, 1.56, .64, 1) .15s both; }
.ouv-mot {
    width: 178px; height: 36px; fill: var(--ouv-mot);
    animation: ouv-mot .9s cubic-bezier(.2, .8, .2, 1) 1.35s both;
}

@keyframes ouv-apparait { from { opacity: 0; } to { opacity: 1; } }
@keyframes ouv-onde {
    0%   { transform: scale(1); opacity: 0; }
    12%  { opacity: .7; }
    100% { transform: scale(7); opacity: 0; }
}
@keyframes ouv-trace {
    0%   { stroke-dashoffset: 1; opacity: 0; }
    8%   { opacity: 1; }
    100% { stroke-dashoffset: 0; opacity: 1; }
}
@keyframes ouv-court {
    0%   { stroke-dashoffset: .08; opacity: 0; }
    15%  { opacity: 1; }
    85%  { opacity: 1; }
    100% { stroke-dashoffset: -1; opacity: 0; }
}
@keyframes ouv-perle {
    0%   { transform: scale(0); opacity: 0; }
    35%  { opacity: 1; }
    100% { transform: scale(1); opacity: 1; }
}
@keyframes ouv-lueur {
    0%   { filter: drop-shadow(0 0 0 transparent); }
    45%  { filter: drop-shadow(0 0 18px var(--ouv-lueur)); }
    100% { filter: drop-shadow(0 0 8px var(--ouv-lueur)); }
}
@keyframes ouv-mot {
    from { opacity: 0; transform: translateY(12px) scale(.96); }
    to   { opacity: 1; transform: none; }
}
@keyframes ouv-logo { to { transform: scale(1.08); } }
/* Tout se referme sur la perle : logo de 150 px + 22 + nom de 36, centrés ;
   la perle est à 74 % du logo, soit 7 px sous le centre de l'écran.
   85 % : juste de quoi couvrir les coins, le cercle se voit tout de suite. */
@keyframes ouv-fermer {
    from { clip-path: circle(85% at 50% calc(50% + 7px)); }
    to   { clip-path: circle(0 at 50% calc(50% + 7px)); }
}
