/* ============================================================
   Proxima design system — application stylesheet (starter kit)
   Brand accent lives in the --accent* tokens below — change them in ONE place.
   ============================================================ */

:root {
    /* Surfaces. --bg-primary n'est plus un gris : c'est la couleur PLEINE du fond de marque
       (voir le bloc « Fond » plus bas), celle qui se voit si le dégradé ne peint pas. Les
       surfaces claires, elles, n'ont pas bougé — c'est sur elles que tout le contenu s'écrit. */
    --bg-primary:    #152c78;
    --bg-secondary:  #ffffff;
    --bg-tertiary:   #f0f1f5;
    --bg-elevated:   #ffffff;
    --bg-glass:       rgba(0, 0, 0, 0.02);
    --bg-glass-hover: rgba(0, 0, 0, 0.04);
    --bg-primary-rgb: 21, 44, 120;

    /* Text */
    --text-primary:   #1a1a2e;
    --text-secondary: #6b7084;
    --text-muted:     #9ca3b4;

    /* Accent — bleu RIPPA. Deux valeurs relevées sur la marque : le bleu machine #006dbc
       (carrosserie et flèche des mini-pelles) et le marine #152c78 du logo. Le bleu machine
       porte l'accent — il se détache du texte (#1a1a2e), ce que le marine ne ferait pas —
       et le marine ancre le dégradé, comme sur la machine elle-même. */
    --accent:         #006dbc;
    --accent-soft:    rgba(0, 109, 188, 0.10);
    --accent-glow:    rgba(0, 109, 188, 0.16);
    --accent-gradient: linear-gradient(135deg, #152c78, #006dbc);

    /* ---- Fond de l'application : le bleu de marque et sa tapisserie ----
       Le fond N'EST PLUS neutre. Il porte le dégradé de marque (marine → bleu machine) et une
       tapisserie de mini-pelles — le PRODUIT de RIPPA, pas son logo : l'emblème officiel
       (cercle et triangle) répété en tuile se lirait comme un papier peint publicitaire. Le
       logo, lui, vit à UN endroit, l'entête, et dans un fichier (wwwroot/images/logo*.svg).

       Ce qui rend l'opération sûre, c'est la FEUILLE : le contenu ne s'écrit pas sur le bleu,
       il remonte sur une surface claire (.app-main). Sans elle, poser du bleu plein voudrait
       dire recolorer le texte des 35 écrans ; avec elle, pas un caractère de contenu ne touche
       le fond, et --text-primary garde exactement le contraste qu'il avait.

       La tuile fait 80 px et porte DEUX machines en quinconce, la seconde retournée : sans ce
       décalage, la répétition se lit comme une grille au lieu d'un motif. Opacité 14 %.

       Data URI plutôt qu'un fichier de wwwroot/images, pour la raison qui vaut déjà pour
       --select-chevron plus bas : une image externe ne peut pas changer de teinte d'un thème à
       l'autre. Ici le motif ne change pas — seul le dégradé s'assombrit — mais le garder en
       jeton met les deux moitiés du fond au même endroit, lisibles ensemble. */
    --fond-haut:    #152c78;
    --fond-bas:     #0a4f8f;
    --fond-degrade: linear-gradient(160deg, var(--fond-haut) 0%, var(--fond-bas) 100%);
    --fond-motif:   url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='80' height='80' viewBox='0 0 80 80'%3E%3Cg fill='none' stroke='%23ffffff' stroke-width='6' stroke-linecap='round' stroke-linejoin='round' opacity='0.14'%3E%3Cg transform='translate(4.8 8.8) scale(0.3413) translate(-17 -29)'%3E%3Crect x='20' y='72' width='44' height='12' rx='6'/%3E%3Crect x='26' y='48' width='26' height='16' rx='4'/%3E%3Cpath d='M52 56 70 32 84 48'/%3E%3Cpath d='M84 48 89 62 76 58'/%3E%3C/g%3E%3Cg transform='translate(70.4 46.4) scale(-0.3413 0.3413) translate(-17 -29)'%3E%3Crect x='20' y='72' width='44' height='12' rx='6'/%3E%3Crect x='26' y='48' width='26' height='16' rx='4'/%3E%3Cpath d='M52 56 70 32 84 48'/%3E%3Cpath d='M84 48 89 62 76 58'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");

    /* Le trait et l'encre de ce qui vit À MÊME le bleu — l'entête et le pied, rien d'autre.
       Identiques dans les deux thèmes : le fond y est sombre des deux côtés. */
    --fond-trait:   rgba(255, 255, 255, 0.16);
    --fond-encre:   #ffffff;
    --fond-encre-2: rgba(255, 255, 255, 0.74);
    --fond-encre-3: rgba(255, 255, 255, 0.56);

    /* L'encre de la FEUILLE, mise de côté. .appbar et .footer réécrivent --text-primary,
       --accent, --border… pour leur sous-arborescence : un menu qui S'OUVRE depuis l'entête
       (le sélecteur de langue) en hérite, et écrirait blanc sur sa carte claire. Il remet ces
       jetons-ci à la place — les valeurs de la feuille, que l'entête ne touche pas. */
    --feuille-texte:  #1a1a2e;
    --feuille-texte-2: #6b7084;
    --feuille-accent: #006dbc;
    --feuille-trait:  rgba(0, 0, 0, 0.08);
    --feuille-survol: rgba(0, 0, 0, 0.04);

    /* Brouillon — violet. Volontairement distinct du vert d'une approbation : un brouillon
       n'est ni validé ni transmis, la confusion visuelle serait coûteuse. (Norme reprise
       de Chronos.) */
    --draft:      #7c3aed;
    --draft-soft: rgba(124, 58, 237, 0.10);

    /* Borders */
    --border:        rgba(0, 0, 0, 0.08);
    --border-subtle: rgba(0, 0, 0, 0.04);

    /* Scrollbar */
    --scrollbar-thumb:       rgba(0, 0, 0, 0.18);
    --scrollbar-thumb-hover: rgba(0, 0, 0, 0.32);

    /* Radii */
    --radius-sm:   8px;
    --radius-md:  12px;
    --radius-lg:  16px;
    --radius-xl:  24px;
    --radius-full: 9999px;

    /* Shadows */
    --shadow-sm:   0 1px 2px  rgba(0, 0, 0, 0.05);
    --shadow-md:   0 4px 16px rgba(0, 0, 0, 0.06);
    --shadow-lg:   0 8px 32px rgba(0, 0, 0, 0.08);
    --shadow-glow: 0 0 30px var(--accent-glow);

    --transition: 200ms cubic-bezier(0.4, 0, 0.2, 1);

    /* Tokens additionnels utilisés par la zone « Rapports » — couleur de marque (voir --accent). */
    --accent-wash: radial-gradient(120% 100% at 0% 0%, rgba(0, 109, 188, 0.10) 0%, rgba(0, 109, 188, 0.00) 60%);
    --shimmer: linear-gradient(90deg, var(--bg-tertiary) 0%, var(--bg-glass-hover) 50%, var(--bg-tertiary) 100%);
    --status-success: #22c55e;
    --status-warning: #f59e0b;
    --status-danger:  #ef4444;

    /* « Machine au travail » — délibérément NEUTRE. Le vert de marque est réservé à une seule
       chose dans le pilotage Forge : signaler qu'un HUMAIN est requis. Tout ce que les agents
       font seuls se rend en gris, pour que l'œil apprenne la convention sans lire les libellés. */
    --machine:      #8b93a5;
    --machine-soft: rgba(139, 147, 165, 0.12);

    /* Chevron des <select>. En jeton parce qu'une image de fond ne peut pas hériter
       currentColor : la seule façon d'avoir la bonne couleur dans les deux thèmes est
       d'échanger l'image elle-même. */
    --select-chevron: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%236b7084' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");

    /* Séries des graphiques d'analyse (SVG maison). La première est l'accent de marque ; les
       suivantes gardent un contraste net entre elles ET sur les deux fonds — d'où deux jeux. */
    --graph-1: #006dbc;
    --graph-2: #ea580c;
    --graph-3: #059669;
    --graph-4: #7c3aed;
    --graph-5: #db2777;
    --graph-6: #0891b2;
}

[data-theme="dark"] {
    --bg-primary:    #081026;
    --bg-secondary:  #161b22;
    --bg-tertiary:   #1e242c;
    --bg-elevated:   #1a2028;
    --bg-glass:       rgba(255, 255, 255, 0.03);
    --bg-glass-hover: rgba(255, 255, 255, 0.06);
    --bg-primary-rgb: 8, 16, 38;

    /* Le fond de marque en sombre : le même dégradé, descendu d'un cran. Le motif, lui, ne
       change pas — il est blanc à 14 % dans les deux thèmes, et le bleu sous lui suffit à
       faire la différence. */
    --fond-haut: #081026;
    --fond-bas:  #0a2b4d;

    --text-primary:   #e6edf3;
    --text-secondary: #9aa4b1;
    --text-muted:     #6b7280;

    --feuille-texte:  #e6edf3;
    --feuille-texte-2: #9aa4b1;
    --feuille-accent: #4ca6e8;
    --feuille-trait:  rgba(255, 255, 255, 0.08);
    --feuille-survol: rgba(255, 255, 255, 0.06);

    /* Brighten the brand accent on dark backgrounds so text/links stay legible. Le marine du
       logo devient illisible sur fond sombre : le dégradé part donc d'un bleu machine soutenu. */
    --accent:      #4ca6e8;
    --accent-glow: rgba(0, 109, 188, 0.32);
    --accent-soft: rgba(76, 166, 232, 0.16);
    --accent-gradient: linear-gradient(135deg, #0d5fa8, #4ca6e8);

    /* Violet éclairci pour rester lisible sur fond sombre. */
    --draft:      #a78bfa;
    --draft-soft: rgba(167, 139, 250, 0.16);

    --border:        rgba(255, 255, 255, 0.08);
    --border-subtle: rgba(255, 255, 255, 0.04);

    --scrollbar-thumb:       rgba(255, 255, 255, 0.18);
    --scrollbar-thumb-hover: rgba(255, 255, 255, 0.32);

    --shadow-sm: 0 1px 2px  rgba(0, 0, 0, 0.4);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.45);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.55);

    --machine:      #79839a;
    --machine-soft: rgba(121, 131, 154, 0.16);

    --select-chevron: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%239aa4b1' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");

    /* Séries des graphiques, éclaircies pour rester lisibles sur fond sombre. */
    --graph-1: #4ca6e8;
    --graph-2: #fb923c;
    --graph-3: #34d399;
    --graph-4: #a78bfa;
    --graph-5: #f472b6;
    --graph-6: #22d3ee;

    /* color-scheme: dark fait aussi dessiner à l'OS ses widgets natifs en sombre — c'est ce qui
       empêche la liste déroulante d'un <select> de s'ouvrir en blanc sur un thème sombre. */
    color-scheme: dark;
}

/* ---- Reset ---- */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html, body {
    height: 100%;
    /* Inter ne porte aucun caractère chinois : en mandarin, le navigateur descend la liste
       jusqu'à une police CJK — celle du système (PingFang sur Mac, Microsoft YaHei sur Windows,
       Noto Sans CJK ou WenQuanYi sur Linux). Sans ces replis nommés, certains postes tombent sur
       une police de secours à empattements qui jure avec le reste de l'écran. */
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, system-ui,
                 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', 'Noto Sans CJK SC', 'WenQuanYi Zen Hei',
                 sans-serif;
    font-size: 15px;
    line-height: 1.6;
    color: var(--text-primary);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Le fond de marque, posé sur `body` SEUL et non sur `html, body` : tant que <html> n'a pas
   de fond, celui de <body> se propage au canevas et couvre donc toute la fenêtre, y compris
   sous une page plus courte que l'écran. Le poser sur les deux le peindrait deux fois.

   L'ordre des couches compte : la tapisserie est écrite en premier, donc elle est AU-DESSUS
   du dégradé. Et `fixed` l'ancre à la fenêtre — un motif qui défile avec le contenu attire
   l'œil, ce qu'une tapisserie ne doit jamais faire. */
body {
    background-color: var(--fond-haut);
    background-image: var(--fond-motif), var(--fond-degrade);
    background-attachment: fixed;
}

a { color: inherit; text-decoration: none; }

/* ---- Scrollbars ---- */
* {
    scrollbar-width: thin;
    scrollbar-color: var(--scrollbar-thumb) transparent;
}
*::-webkit-scrollbar          { width: 10px; height: 10px; }
*::-webkit-scrollbar-track    { background: transparent; }
*::-webkit-scrollbar-thumb {
    background: var(--scrollbar-thumb);
    border: 2px solid transparent;
    background-clip: padding-box;
    border-radius: 8px;
    transition: background-color 0.15s ease;
}
*::-webkit-scrollbar-thumb:hover {
    background: var(--scrollbar-thumb-hover);
    background-clip: padding-box;
}
*::-webkit-scrollbar-corner   { background: transparent; }

/* ============================================================
   App shell
   ============================================================ */
.app-shell {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.appbar {
    position: sticky;
    top: 0;
    z-index: 50;
    display: flex;
    align-items: center;
    gap: 16px;
    height: 56px;
    padding: 0 24px;
    /* L'entête vit SUR le bleu, pas sur une barre blanche. Elle n'est pas transparente pour
       autant : elle est collante (sticky) et la feuille claire défile dessous — au travers
       d'un fond vraiment transparent, on verrait passer le contenu. Un marine à 78 % plus le
       flou déjà présent donne l'effet voulu (l'entête se fond dans le fond, au repos) sans
       cette contrepartie. */
    background: color-mix(in srgb, var(--fond-haut) 78%, transparent);
    border-bottom: 1px solid var(--fond-trait);
    backdrop-filter: blur(20px);

    /* Le seul endroit, avec le pied de page, où le texte s'écrit sur le bleu. Plutôt que de
       recolorer un par un les onglets, les icônes, la pastille et le sélecteur de langue —
       dont le style vit dans trois fichiers scopés qu'on ne peut pas atteindre d'ici — on
       réécrit les JETONS pour la sous-arborescence : chaque descendant les hérite, y compris
       à travers le CSS isolé de MainLayout et de DistriLayout. */
    --text-primary:   var(--fond-encre);
    --text-secondary: var(--fond-encre-2);
    --text-muted:     var(--fond-encre-3);
    --accent:         var(--fond-encre);
    --accent-soft:    rgba(255, 255, 255, 0.18);
    --border:         rgba(255, 255, 255, 0.26);
    --bg-glass:       rgba(255, 255, 255, 0.10);
    --bg-glass-hover: rgba(255, 255, 255, 0.16);
}
.appbar-leading,
.appbar-trailing { display: flex; align-items: center; gap: 12px; }
/* Centrée sans jamais couper (voir .section-nav, MainLayout.razor.css) : `safe` colle la rangée
   à gauche plutôt que de la faire déborder des deux côtés quand elle ne tient pas. */
.appbar-center   { flex: 1; min-width: 0; display: flex; justify-content: safe center; }
/* Les actions (engrenage de configuration, thème) tiennent le coin haut-droit, que la zone
   centrale soit rendue ou non : sans ce `auto`, un entête sans onglets les collait au logo. */
.appbar-trailing { margin-left: auto; }

/* LA BARRE TIENT À 1 280 PX, MÊME POUR UN ADMINISTRATEUR (2026-11-04). Mesuré à 1 440 px : sept
   onglets et dix boutons demandaient 90 px de trop, rognés sur « Dashboard ». On regagne la
   place à droite, où elle ne coûte rien à lire : « Prêt » (qui ne dit rien qu'on ne voie déjà)
   se retire, les boutons se rapprochent, le nom du compte se raccourcit au besoin. Les onglets,
   eux, gardent leur libellé. Ajouter un onglet OU un bouton demande de refaire la mesure :
   `node tools/barre-du-haut/mesurer.js` (l'application lancée, un compte administrateur). */
@media (max-width: 1600px) {
    .appbar { gap: 12px; padding: 0 16px; }
    .appbar-trailing { gap: 4px; }
    .appbar .status-row:has(.status-dot) { display: none; }
    .appbar-trailing .status-row { max-width: 9em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: inline-block; }
}

.brand-lockup      { display: inline-flex; align-items: center; gap: 12px; }
.brand-lockup-name { font-weight: 600; font-size: 18px; font-family: inherit; letter-spacing: -0.015em; color: var(--text-primary); }
.app-icon { display: inline-block; flex-shrink: 0; }
.app-icon-md { width: 32px; height: 32px; }

/* LE LOGO de RIPPA : un fichier, deux variantes (marine sur feuille claire, blanche sur le
   bleu de marque). Hauteur fixée, largeur libre — le rapport du logo est 1261 × 324, et
   c'est lui qui décide de la largeur, pas nous. */
.brand-logo    { display: block; height: 26px; width: auto; flex-shrink: 0; }
.brand-logo-lg { height: 44px; }

@media (max-width: 560px) {
    .brand-logo { height: 22px; }
}

.appbar-badge {
    font-weight: 500; font-size: 9.5px; font-family: inherit;
    color: var(--accent);
    background: var(--accent-soft);
    padding: 2px 8px;
    border-radius: var(--radius-full);
    letter-spacing: 0.06em;
    text-transform: uppercase;
    line-height: 1.6;
}

/* La pastille d'environnement (BadgeEnvironnement.razor). La démo garde la pastille de base
   (jetons réécrits par .appbar : blanc sur blanc translucide). Le dev prend l'ambre CLAIR : sur
   le bleu de marque, l'ambre foncé du kit serait illisible — et le bleu est le même dans les
   deux thèmes, donc une seule règle. */
.appbar-badge.badge-dev {
    color: #fcd34d;
    background: rgba(245, 158, 11, 0.22);
    box-shadow: inset 0 0 0 1px rgba(252, 211, 77, 0.45);
}
@media (max-width: 560px) {
    /* Sur téléphone, la phrase entière pousserait les onglets : le titre (survol, lecteur
       d'écran) garde l'explication. */
    .appbar-badge.badge-dev, .appbar-badge.badge-demo {
        max-width: 9.5em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
    }
}

.status-row {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-weight: 500; font-size: 11px; font-family: inherit;
    letter-spacing: 0.02em;
    color: var(--text-secondary);
}
.status-dot {
    width: 7px;
    height: 7px;
    border-radius: var(--radius-full);
    background: #22c55e;
    box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.18);
}

.btn-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    background: transparent;
    border: none;
    border-radius: var(--radius-full);
    color: var(--text-secondary);
    cursor: pointer;
    transition: background-color 0.12s ease, color 0.12s ease;
}
.btn-icon:hover { background: var(--bg-glass-hover); color: var(--accent); }

/* LA CLOCHE du personnel (ClocheInterne) : un bouton d'icône comme les autres, plus une pastille
   qui compte les notifications non lues et les tâches dues. Rouge plein, chiffre blanc : elle
   doit se lire sur le bleu de l'entête comme sur la feuille claire. */
.cloche { position: relative; }
.cloche-pastille {
    position: absolute; top: 2px; right: 1px;
    min-width: 16px; height: 16px; padding: 0 4px;
    border-radius: var(--radius-full);
    background: #dc2626; color: #fff;
    font-size: 10px; font-weight: 700; line-height: 16px; text-align: center;
    font-variant-numeric: tabular-nums;
    pointer-events: none;
}

/* ---- Les écrans « Mes tâches » et « Notifications » ---- */
.taches-groupe { margin-top: 18px; }
.taches-groupe-titre { display: flex; align-items: center; gap: 8px; margin: 0 0 8px; font-size: 14px; font-weight: 600; }
.tache-ligne, .notif-ligne { align-items: flex-start; }
.tache-ligne.est-fermee .list-item-title { text-decoration: line-through; color: var(--text-muted); }
.tache-actions { display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end; }
.tache-meta { display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: 12.5px; color: var(--text-secondary); margin-top: 4px; }
.tache-retard { color: #b91c1c; font-weight: 600; }
[data-theme="dark"] .tache-retard { color: #f87171; }
.notif-ligne.est-non-lue { background: var(--accent-soft); }
.notif-ligne.est-non-lue .list-item-title::before {
    content: ""; display: inline-block; width: 8px; height: 8px; margin-right: 8px;
    border-radius: 50%; background: var(--accent); vertical-align: middle;
}
.list-item-title.multiligne { white-space: normal; }
/* Le titre et le détail d'une tâche prennent toute la rangée, quelle que soit la largeur : un
   « span 2 » dans une grille à une colonne (téléphone) en créerait une seconde, et écraserait
   la première. */
.taches-form .form-field.span-2 { grid-column: 1 / -1; }
/* Une case à cocher et son libellé, une par ligne (« Me joindre »). */
.ligne-case { display: flex; align-items: center; gap: 8px; font-size: 14px; }
@media (max-width: 640px) {
    .tache-ligne, .notif-ligne { flex-direction: column; gap: 8px; }
    .tache-actions { justify-content: flex-start; }
}

/* ---- Mobile ----
   Sur petit écran, tout débordement horizontal fait « dézoomer » le navigateur, ce qui casse
   toute la mise en page (grilles qui repassent en 2 colonnes, champs coupés). On réduit donc le
   padding de la barre du haut et du contenu pour tout faire tenir dans la largeur de l'écran. */
@media (max-width: 640px) {
    /* L'ENTÊTE PASSE SUR DEUX RANGÉES. Sur une seule, le logo, les onglets et les six boutons
       d'un administrateur demandaient ~480 px : la barre débordait de 50 à 90 px et faisait
       défiler toute la page de côté, sous un 390. En haut le logo et les actions, en dessous
       les onglets sur toute la largeur — défilables si un rôle en porte plus qu'il n'en tient. */
    .appbar {
        flex-wrap: wrap; height: auto; min-height: 56px;
        padding: 8px 14px; gap: 6px 8px;
    }
    .appbar-leading  { min-width: 0; gap: 8px; }
    .appbar-trailing { gap: 2px; }
    .appbar .btn-icon { width: 32px; height: 32px; }
    .appbar-center {
        order: 3; flex: 1 0 100%; justify-content: flex-start;
        overflow-x: auto; scrollbar-width: none; margin: 0 -4px;
    }
    .appbar-center::-webkit-scrollbar { display: none; }
    /* « Prêt » ne dit rien qu'on ne voie déjà ; le nom du compte reste, raccourci au besoin. */
    .appbar .status-row:has(.status-dot) { display: none; }
    .appbar .status-row { max-width: 7em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: inline-block; }
    .brand-lockup { gap: 8px; }
    .brand-lockup-name { font-size: 15px; white-space: nowrap; }
    /* La feuille se resserre contre les bords : sur 400 px de large, 20 px de marge de chaque
       côté, c'est 10 % de la page donnés au décor. Le bleu reste visible, en filet. */
    .app-main {
        padding: 18px 14px;
        margin: 10px auto 14px;
        border-radius: var(--radius-md);
    }
}

/* ---- Impression et contraste renforcé ----
   La tapisserie est DÉCORATIVE : elle ne porte aucune information, donc elle part la première
   dès que la page doit se lire autrement. À l'impression, la feuille redevient une page — les
   navigateurs ne sortent déjà pas les fonds par défaut, mais « imprimer les arrière-plans »
   coché ne doit pas produire une page bleue et une ombre portée. */
@media print {
    body     { background: #fff; }
    .app-main { margin: 0; background: #fff; box-shadow: none; border-radius: 0; }
}

@media (prefers-contrast: more) {
    body { background-image: none; }
}

.app-main {
    flex: 1 1 auto;
    min-height: 0;
    width: 100%;
    /* Utilise l'essentiel de la largeur de l'écran (≈ 95 % sur écran standard, plafonné sur
       très grand écran) au lieu de l'ancien 1320px qui laissait de larges marges vides. */
    max-width: min(2000px, 95vw);

    /* LA FEUILLE. Tout le contenu de l'application est posé dessus : c'est ce qui permet au
       fond d'être bleu plein sans qu'aucun écran ait à changer une couleur de texte.
       Les marges ne sont pas décoratives — sans elles la feuille touche les bords et ne
       flotte plus, elle recouvre. */
    margin: 20px auto 24px;
    padding: 28px 28px;
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.22);
}

/* L'exception : un écran qui n'a rien à porter. La connexion tient dans une carte de 420 px —
   une feuille pleine largeur autour d'elle serait un grand rectangle blanc et vide. La carte
   flotte donc directement sur le bleu, là où le fond se voit le mieux. */
.app-main-flottant {
    background: none;
    box-shadow: none;
    border-radius: 0;
    margin-top: 0;
}

/* Sans feuille, le titre et son sous-titre retombent SUR le bleu — et y restaient illisibles,
   en encre foncée. Ce sont les deux seules lignes dans ce cas : tout le reste de l'écran de
   connexion vit dans la carte. On recolore donc ces deux-là précisément, plutôt que d'inverser
   les jetons du bloc entier — ce qui aurait rendu le texte DE la carte blanc sur blanc. */
.app-main-flottant .page-title    { color: var(--fond-encre); }
.app-main-flottant .page-subtitle { color: var(--fond-encre-2); }

/* ---- Footer ---- */
/* Le pied vit sur le bleu, sous la feuille : transparent, et mêmes jetons d'encre claire que
   l'entête (voir .appbar) plutôt qu'une couleur recopiée dans chacun de ses trois éléments. */
.footer {
    background: none;
    border-top: 1px solid var(--fond-trait);
    font-size: 13px;

    --text-primary:   var(--fond-encre);
    --text-secondary: var(--fond-encre-2);
    --text-muted:     var(--fond-encre-3);
    color: var(--text-secondary);
}
.footer-minimal {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 14px 24px;
}
.footer-copy strong { color: var(--text-primary); font-weight: 600; }
.footer-meta { color: var(--text-muted); font-variant-numeric: tabular-nums; }
@media (max-width: 720px) {
    .footer-minimal { flex-direction: column; align-items: flex-start; gap: 6px; }
}

/* ============================================================
   Page
   ============================================================ */
.page { display: flex; flex-direction: column; gap: 20px; }

.page-header {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
}
.page-title    { font-weight: 600; font-size: 28px; font-family: inherit; letter-spacing: -0.02em; color: var(--text-primary); }
.page-subtitle { font-size: 13px; color: var(--text-muted); margin-top: 2px; }

/* ---- Search ---- */
.search-field { position: relative; min-width: 280px; }
.search-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    display: inline-flex;
    pointer-events: none;
}
.input.search-input { padding-left: 36px; }

.input {
    width: 100%;
    padding: 9px 12px;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    /* IMPORTANT : hériter la police du body (Inter). Le raccourci « font: … inherit » est
       invalide et était ignoré → les <input>/<select> tombaient en Arial et les <textarea>
       en monospace. On déclare donc les propriétés séparément. */
    font-family: inherit;
    font-size: 14px;
    line-height: 1.5;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-soft);
}

/* ---- <select> : le navigateur en dessine une partie, comme <input type="file"> ----

   La BOÎTE FERMÉE obéit à .input depuis toujours. Ce qui restait natif, c'est la flèche (que
   le navigateur peint lui-même) et la LISTE OUVERTE (que dessine le système d'exploitation —
   d'où le surlignage bleu de Windows au milieu d'une interface verte).

   La flèche se règle partout : appearance:none la supprime, et on remet la nôtre.
   La liste ouverte, elle, n'est stylable que depuis `appearance: base-select` (Chrome/Edge ;
   Firefox et Safari ne l'ont pas encore). D'où le @supports plus bas : amélioration
   progressive, jamais une condition de bon fonctionnement.

   ⚠️ Ne PAS remplacer <select> par un composant maison. On y perd la navigation au clavier,
   le sélecteur natif du mobile et le support des lecteurs d'écran — trois choses difficiles à
   refaire correctement, pour gagner une bordure. */
select.input {
    appearance: none;
    -webkit-appearance: none;
    padding-right: 34px;                 /* la place de notre chevron */
    background-image: var(--select-chevron);
    background-repeat: no-repeat;
    background-position: right 11px center;
    background-size: 15px 15px;
    cursor: pointer;
}
select.input:disabled {
    cursor: not-allowed;
    opacity: 0.55;
    background-image: none;              /* désactivé : rien à dérouler, pas de chevron */
}

/* Un champ DÉSACTIVÉ doit en avoir l'air. Sans cette règle, un <input disabled> gardait
   exactement l'apparence d'un champ actif : on cliquait, on tapait, et rien ne se passait —
   c'est ce qu'on voyait sur /configuration → Paramètres quand le compte n'avait pas le droit
   d'enregistrer. Même traitement que le <select> désactivé ci-dessus. */
.input:disabled {
    cursor: not-allowed;
    opacity: 0.55;
    background-color: var(--bg-glass-hover);
}

/* Chrome/Edge : la liste déroulante devient un élément de la page, donc enfin la nôtre.
   Partout ailleurs ce bloc est ignoré et la liste native — parfaitement fonctionnelle et
   accessible — reste en place. */
@supports (appearance: base-select) {
    select.input {
        appearance: base-select;
        /* On GARDE notre chevron en image de fond : le glyphe que le navigateur fournit dans
           ce mode est un triangle plein, qui jure avec le reste des icônes (traits fins). */
    }
    select.input::picker-icon { display: none; }

    select.input::picker(select) {
        appearance: base-select;
        margin-top: 4px;
        padding: 4px;
        border: 1px solid var(--border);
        border-radius: var(--radius-sm);
        background: var(--bg-elevated);
        box-shadow: var(--shadow-md);
    }
    select.input option {
        padding: 8px 10px;
        border-radius: 6px;
        font-size: 14px;
        color: var(--text-primary);
    }
    select.input option:hover { background: var(--bg-glass-hover); }
    select.input option:checked { background: var(--accent-soft); color: var(--accent); }
    /* La coche que le navigateur ajoute devant l'option choisie : superflue, on garde la
       couleur d'accent comme seule marque. */
    select.input option::checkmark { display: none; }
}

/* Les grilles resserrent le padding des champs avec le raccourci `padding:` — plus
   spécifique, il écraserait la place réservée au chevron. On la re-réserve pour les
   <select> concernés. */
.data-table td select.input,
.entry-table tbody td select.input { padding-right: 28px; }

/* ============================================================
   Buttons
   ============================================================ */
.btn-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 8px 16px;
    border: none;
    border-radius: var(--radius-sm);
    background: var(--accent-gradient);
    color: #ffffff;
    font: 500 13px/1 'Inter', system-ui, sans-serif;
    cursor: pointer;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.btn-primary:hover  { transform: translateY(-1px); box-shadow: 0 6px 14px var(--accent-glow), 0 2px 4px rgba(0, 0, 0, 0.06); }
.btn-primary:active { transform: translateY(0); }
/* Même raison que .input:disabled : un bouton désactivé qui garde son dégradé et son survol
   ressemble à un bouton en panne. */
.btn-primary:disabled,
.btn-secondary:disabled { opacity: 0.45; cursor: not-allowed; transform: none; box-shadow: none; }

.btn-secondary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    white-space: nowrap;
    padding: 8px 16px;
    background: var(--bg-elevated);
    color: var(--text-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font: 500 13px/1 'Inter', system-ui, sans-serif;
    cursor: pointer;
    transition: var(--transition);
}
.btn-secondary:hover { border-color: var(--text-secondary); color: var(--text-primary); }

/* Bouton « brouillon » — même poids visuel que btn-secondary (il ne doit pas concurrencer
   l'action principale), mais teinté violet pour rattacher l'action au brouillon plutôt
   qu'à une validation. (Norme reprise de Chronos.) */
.btn-draft {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    white-space: nowrap;
    padding: 8px 16px;
    background: var(--draft-soft);
    color: var(--draft);
    border: 1px solid var(--draft);
    border-radius: var(--radius-sm);
    font: 500 13px/1 'Inter', system-ui, sans-serif;
    cursor: pointer;
    transition: var(--transition);
}
.btn-draft:hover { background: var(--draft); color: #fff; }
.btn-draft:disabled { opacity: 0.45; cursor: default; background: var(--draft-soft); color: var(--draft); }

/* ============================================================
   List
   ============================================================ */
.list { list-style: none; padding: 0; margin: 0; }
.list-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px 18px;
    border-bottom: 1px solid var(--border-subtle);
    transition: background-color 0.12s ease;
}
.list-item:last-child { border-bottom: none; }
.list-item:hover      { background: var(--bg-glass-hover); }
.list-item-body  { flex: 1; min-width: 0; }
.list-item-title {
    font-weight: 600; font-size: 15px; font-family: inherit;
    color: var(--text-primary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.list-item-sub {
    font-size: 13px;
    color: var(--text-secondary);
    margin-top: 4px;
    line-height: 1.5;
}

.project-item-head {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 4px;
}
.project-number {
    font: 600 11px 'JetBrains Mono', 'Fira Code', monospace;
    letter-spacing: 0.04em;
    color: var(--text-muted);
}

/* ============================================================
   Table
   ============================================================ */
.table-scroll {
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    overflow: auto;              /* scrolls horizontally and vertically as needed */
    max-height: 640px;
}
.table {
    width: 100%;
    min-width: 720px;            /* keep columns readable; the wrapper scrolls when narrower */
    border-collapse: separate;
    border-spacing: 0;
    font-size: 14px;
    table-layout: fixed;
}
.table thead th {
    position: sticky;            /* header stays put while the rows scroll */
    top: 0;
    z-index: 1;
    background: var(--bg-tertiary);
    text-align: left;
    padding: 11px 14px;
    font-weight: 500;
    font-size: 11px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}
/* Clickable, sortable column headers — styled to read like the header label itself.
   Shared by the projects list (.table) and every detail table (.data-table). */
.table thead th .th-sort,
.data-table thead th .th-sort {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin: 0;
    padding: 0;
    background: none;
    border: 0;
    font: inherit;
    letter-spacing: inherit;
    text-transform: inherit;
    color: inherit;
    cursor: pointer;
    user-select: none;
    transition: color 0.15s ease;
}
.table thead th .th-sort:hover,
.data-table thead th .th-sort:hover { color: var(--text-primary); }
.table thead th .th-sort:focus-visible,
.data-table thead th .th-sort:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
    border-radius: 4px;
}
.table thead th:not([aria-sort="none"]) .th-sort,
.data-table thead th:not([aria-sort="none"]) .th-sort { color: var(--text-primary); }
.sort-arrow {
    font-size: 10px;
    line-height: 1;
    opacity: 0.4;
    transition: opacity 0.15s ease, color 0.15s ease;
}
.sort-arrow.is-active {
    opacity: 1;
    color: var(--accent);
}

/* ---- Filtre par colonne : le titre ouvre le filtre, la flèche à côté trie ----
   (DataTable avec ColumnFilters, et la section Machineries du réapprovisionnement.) */
.th-filtrable { display: inline-flex; align-items: center; gap: 4px; }
.th-entonnoir { opacity: 0.35; flex-shrink: 0; transition: opacity 0.15s ease; }
.th-filtre-bouton:hover .th-entonnoir { opacity: 0.8; }
.th-filtre-bouton.is-filtree { color: var(--accent) !important; }
.th-filtre-bouton.is-filtree .th-entonnoir { opacity: 1; }
.data-table thead th .th-filtrable .th-tri { padding: 2px; }

.col-filtres-actifs {
    display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px;
    margin: 10px 0;
}
.col-filtre-pastille {
    display: inline-flex; align-items: center;
    border: 1px solid var(--accent);
    background: var(--accent-soft);
    border-radius: 999px;
    font-size: 12px;
    overflow: hidden;
    max-width: 100%;
}
.col-filtre-pastille button {
    background: none; border: 0; font: inherit; color: var(--text-primary); cursor: pointer;
}
.col-filtre-pastille-texte {
    padding: 3px 4px 3px 10px;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 320px;
}
.col-filtre-pastille-x { padding: 3px 9px 3px 5px; font-size: 14px; line-height: 1; color: var(--text-muted) !important; }
.col-filtre-pastille-x:hover { color: var(--text-primary) !important; }

.col-filtre {
    margin: 10px 0;
    padding: 12px 14px;
    border: 1px solid var(--accent);
    border-radius: var(--radius-md);
    background: var(--bg-secondary);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
    display: flex; flex-direction: column; gap: 10px;
}
.col-filtre-tete { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 8px 16px; }
.col-filtre-titre { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.col-filtre-aide { font-size: 12px; color: var(--text-muted); }
.col-filtre-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; }
.col-filtre-actions .btn-link:disabled { opacity: 0.4; cursor: default; text-decoration: none; }
.col-filtre-plage { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px 14px; }
.col-filtre-plage .form-field { width: 140px; font-size: 12px; color: var(--text-secondary); }
.col-filtre-raccourcis { display: flex; gap: 6px; }
.col-filtre-recherche { max-width: 380px; }
.col-filtre-liste-tete { display: flex; gap: 14px; }
.col-filtre-liste {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 2px 14px;
    max-height: 240px;
    overflow: auto;
}
.col-filtre-valeur {
    display: flex; align-items: center; gap: 8px;
    padding: 3px 4px; border-radius: 4px;
    font-size: 13px; color: var(--text-primary); cursor: pointer;
}
.col-filtre-valeur:hover { background: var(--bg-glass-hover); }
.col-filtre-libelle { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.col-filtre-n { font-size: 11px; color: var(--text-muted); font-variant-numeric: tabular-nums; }
.col-filtre-note { font-size: 12px; color: var(--text-muted); margin: 0; }
.table tbody td {
    padding: 12px 14px;
    color: var(--text-primary);
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
}
.table tbody tr:last-child td { border-bottom: none; }
.table tbody tr:hover         { background: var(--bg-glass-hover); }

/* Column widths — applied to header and body so the two aligned tables match.
   Every column (including Projet, col 2) gets a width so none collapses to 0 when
   the table is narrow; table-layout:fixed then shrinks them proportionally. */
.table th:nth-child(1), .table td:nth-child(1) { width: 130px; }
.table th:nth-child(2), .table td:nth-child(2) { width: 260px; }
.table th:nth-child(3), .table td:nth-child(3) { width: 190px; }
.table th:nth-child(4), .table td:nth-child(4) { width: 160px; }
.table th:nth-child(5), .table td:nth-child(5) { width: 120px; }
.table th:nth-child(6), .table td:nth-child(6) { width: 130px; }

/* La file d'envoi de ⚙ Configuration → Messagerie : ses propres largeurs (celles du .table de
   base visent une autre grille). Le sujet prend la place qui reste ; une adresse longue se
   coupe dans sa colonne au lieu de déborder sur le sujet ; la table défile sous 1 000 px. */
.table.messagerie-file { min-width: 1000px; }
.table.messagerie-file th:nth-child(1), .table.messagerie-file td:nth-child(1) { width: 105px; white-space: nowrap; }
.table.messagerie-file th:nth-child(2), .table.messagerie-file td:nth-child(2) { width: 115px; }
.table.messagerie-file th:nth-child(3), .table.messagerie-file td:nth-child(3) { width: 200px; overflow-wrap: anywhere; }
.table.messagerie-file th:nth-child(4), .table.messagerie-file td:nth-child(4) { width: 240px; }
.table.messagerie-file th:nth-child(5), .table.messagerie-file td:nth-child(5) { width: auto; }
.table.messagerie-file th:nth-child(6), .table.messagerie-file td:nth-child(6) { width: 64px; text-align: right; }
.table.messagerie-file th:nth-child(7), .table.messagerie-file td:nth-child(7) { width: 165px; }
.messagerie-file-a { overflow-wrap: anywhere; }
.messagerie-file-actions { white-space: nowrap; text-align: right; }
.messagerie-file td.cell-num { font-variant-numeric: tabular-nums; }

.cell-number {
    font-family: 'JetBrains Mono', 'Fira Code', monospace;
    font-size: 12px;
    letter-spacing: 0.02em;
    color: var(--text-muted);
    white-space: nowrap;
}
.cell-title {
    font-weight: 600;
    color: var(--text-primary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.cell-sub {
    font-size: 12.5px;
    color: var(--text-secondary);
    margin-top: 2px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.cell-action { text-align: right; white-space: nowrap; }
.btn-row { padding: 6px 12px; }
/* Troncature « … » générique pour les colonnes texte (Contact, Emplacement) afin que
   les valeurs longues n'augmentent pas la hauteur des lignes — la valeur complète reste
   visible au survol via l'attribut title. */
.cell-ellipsis {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ============================================================
   Pagination
   ============================================================ */
.table-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
}
.table-footer-info { font-size: 13px; color: var(--text-muted); font-variant-numeric: tabular-nums; }

.pagination { display: inline-flex; align-items: center; gap: 4px; }
.pagination-btn {
    min-width: 32px;
    height: 32px;
    padding: 0 8px;
    background: transparent;
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-weight: 500;
    font-size: 13px;
    font-variant-numeric: tabular-nums;
    cursor: pointer;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.pagination-btn:hover:not(:disabled):not(.active) {
    border-color: var(--border);
    color: var(--text-primary);
    background: var(--bg-glass-hover);
}
.pagination-btn.active {
    background: var(--accent);
    border-color: var(--accent);
    color: #ffffff;
    cursor: default;
}
.pagination-btn:disabled { opacity: 0.4; cursor: not-allowed; }
.pagination-ellipsis { color: var(--text-muted); padding: 0 6px; user-select: none; }

/* ============================================================
   Tags
   ============================================================ */
.tag {
    display: inline-block;
    padding: 3px 8px;
    background: var(--accent-soft);
    color: var(--accent);
    font-weight: 600;
    font-size: 10px;
    line-height: 1;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    border-radius: var(--radius-full);
    white-space: nowrap;
}
.tag.tag-success { color: #22c55e; background: rgba(34, 197, 94, 0.14); }
.tag.tag-info    { color: #6b7084; background: var(--bg-tertiary); }
.tag.warn        { color: #b45309; background: rgba(245, 158, 11, 0.16); }
.tag.error       { color: #b91c1c; background: rgba(239, 68, 68, 0.14); }
/* Brouillon — violet : ni validé ni transmis, à ne pas confondre avec un statut approuvé (vert). */
.tag.tag-draft   { color: var(--draft); background: var(--draft-soft); }
/* Approuvée, pièce en commande de Chine — bleu : accordée, mais on attend la pièce (à côté du vert de la pièce en inventaire). */
.tag.tag-commande { color: #1d4ed8; background: rgba(37, 99, 235, 0.12); }
[data-theme="dark"] .tag.warn  { color: #fbbf24; }
[data-theme="dark"] .tag.error { color: #f87171; }
[data-theme="dark"] .tag.tag-commande { color: #93c5fd; background: rgba(59, 130, 246, 0.2); }

/* ── Nuancier de teintes distinctives (norme reprise de Chronos) ────────────
   Huit teintes à attribuer par un condensé stable de la valeur (même catégorie,
   même couleur partout et à chaque démarrage). Elles sont DISTINCTIVES, pas
   sémantiques : contrairement à vert/ambre/rouge ailleurs dans l'app, la teinte
   ne dit rien de bon ou de mauvais — elle sert uniquement à repérer une
   catégorie sans lire chaque ligne.

   ⚠ AUCUN ROUGE dans ce nuancier, et ce n'est pas un choix esthétique : dans le
   reste de l'app le rouge signale une erreur (ligne bloquante, tag `error`,
   suppression). Une catégorie teintée en rouge se lit comme un élément en
   défaut. Rose et corail sont écartés pour la même raison : de loin, ils sont
   du rouge. Toute teinte ajoutée ici doit passer le même test. */
.tag.cat-color-1 { color: #7c3aed; background: rgba(124, 58, 237, 0.14); }  /* violet */
.tag.cat-color-2 { color: #2563eb; background: rgba(37, 99, 235, 0.14); }   /* bleu */
.tag.cat-color-3 { color: #0d9488; background: rgba(13, 148, 136, 0.16); }  /* sarcelle */
.tag.cat-color-4 { color: #a16207; background: rgba(161, 98, 7, 0.16); }    /* ocre */
.tag.cat-color-5 { color: #4338ca; background: rgba(67, 56, 202, 0.14); }   /* indigo */
.tag.cat-color-6 { color: #a21caf; background: rgba(162, 28, 175, 0.13); }  /* magenta */
.tag.cat-color-7 { color: #0369a1; background: rgba(3, 105, 161, 0.14); }   /* cyan */
.tag.cat-color-8 { color: #4d7c0f; background: rgba(77, 124, 15, 0.16); }   /* olive */
/* En thème sombre, seules les teintes de TEXTE sont éclaircies : les fonds translucides
   restent lisibles tels quels sur le fond sombre. */
[data-theme="dark"] .tag.cat-color-1 { color: #c4b5fd; }
[data-theme="dark"] .tag.cat-color-2 { color: #93c5fd; }
[data-theme="dark"] .tag.cat-color-3 { color: #5eead4; }
[data-theme="dark"] .tag.cat-color-4 { color: #fcd34d; }
[data-theme="dark"] .tag.cat-color-5 { color: #a5b4fc; }
[data-theme="dark"] .tag.cat-color-6 { color: #f0abfc; }
[data-theme="dark"] .tag.cat-color-7 { color: #7dd3fc; }
[data-theme="dark"] .tag.cat-color-8 { color: #bef264; }

/* ============================================================
   Cards / details
   ============================================================ */
.card {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 18px 20px;
}
.detail-description { font-size: 15px; line-height: 1.6; color: var(--text-primary); }

.breadcrumbs {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--text-muted);
}
.breadcrumbs a { color: var(--text-secondary); transition: color 0.12s ease; }
.breadcrumbs a:hover { color: var(--accent); }
.breadcrumbs-sep { color: var(--border); }

.detail-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1px;
    background: var(--border-subtle);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    overflow: hidden;
}
.detail-field {
    background: var(--bg-secondary);
    padding: 14px 18px;
}
.detail-field dt {
    font-weight: 500; font-size: 11px; font-family: inherit;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: 4px;
}
.detail-field dd {
    font-weight: 500; font-size: 14px; font-family: inherit;
    color: var(--text-primary);
    /* Les valeurs longues sans espaces (courriel, URL, adresse) se replient dans la
       case au lieu de déborder horizontalement. */
    overflow-wrap: anywhere;
}
.detail-field dd a { color: var(--accent); text-decoration: none; }
.detail-field dd a:hover { text-decoration: underline; }

/* ============================================================
   Empty state
   ============================================================ */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 8px;
    padding: 48px 24px;
    color: var(--text-secondary);
}
.empty-state-icon {
    width: 72px;
    height: 72px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: var(--accent-soft);
    color: var(--accent);
    margin-bottom: 4px;
}
.empty-state-title { font-weight: 600; font-size: 17px; font-family: inherit; color: var(--text-primary); letter-spacing: -0.01em; }
.empty-state-body  { font-size: 13.5px; line-height: 1.55; max-width: 360px; color: var(--text-muted); margin-bottom: 8px; }

/* ---- Blazor error UI ---- */
#blazor-error-ui {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    padding: 12px 24px;
    background: #fef2f2;
    color: #b91c1c;
    border-top: 1px solid rgba(239, 68, 68, 0.3);
    font-size: 13px;
}
#blazor-error-ui .dismiss { cursor: pointer; float: right; }

@media (max-width: 600px) {
    .page-header { flex-direction: column; align-items: stretch; }
    .search-field { min-width: 0; width: 100%; }
    .list-item { flex-direction: column; align-items: stretch; }
}

/* ============================================================
   Project detail — tabs, KPIs, people, data tables
   ============================================================ */
.section-title {
    font-weight: 600; font-size: 16px; font-family: inherit;
    letter-spacing: -0.01em;
    color: var(--text-primary);
    margin: 26px 0 12px;
}

/* ---- Tabs ---- */
.tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 2px;
    border-bottom: 1px solid var(--border);
    /* Espace sous les onglets réduit (au-dessus des barres d'outils) — interface plus compacte. */
    margin: 16px 0 12px;
}
.tab {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    background: none;
    border: 0;
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
    padding: 10px 14px;
    font-weight: 500; font-size: 14px; font-family: inherit;
    color: var(--text-muted);
    cursor: pointer;
    transition: color 0.15s ease, border-color 0.15s ease;
}
.tab:hover { color: var(--text-primary); }
.tab.is-active { color: var(--accent); border-bottom-color: var(--accent); }
.tab-count {
    font-size: 11px;
    font-weight: 600;
    padding: 1px 7px;
    border-radius: var(--radius-full);
    background: var(--bg-tertiary);
    color: var(--text-muted);
}
.tab.is-active .tab-count { background: var(--accent-soft); color: var(--accent); }
/* Le compteur des NOTIFICATIONS non lues : le seul qui compte des nouvelles plutôt que des
   dossiers en cours. Il se voit sans qu'on le cherche — c'est tout son travail — et il garde
   la couleur d'accent quand son onglet est actif, comme les autres. */
.tab-count.est-alerte { background: var(--accent); color: #fff; }
.tab.is-active .tab-count.est-alerte { background: var(--accent); color: #fff; }

/* ---- KPI cards ---- */
.kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 12px;
    margin-bottom: 6px;
}
.kpi-card {
    display: flex;
    flex-direction: column;
    gap: 4px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 16px 18px;
}
.kpi-label { font-weight: 500; font-size: 11px; font-family: inherit; letter-spacing: 0.05em; text-transform: uppercase; color: var(--text-muted); }
.kpi-value { font-weight: 600; font-size: 22px; font-family: inherit; letter-spacing: -0.02em; color: var(--text-primary); font-variant-numeric: tabular-nums; }
.kpi-value.neg { color: #dc2626; }
[data-theme="dark"] .kpi-value.neg { color: #f87171; }
.kpi-sub { font-size: 12px; color: var(--text-muted); }

/* ---- Chiffres-filtres (Distribution Canada : Garantie, Réclamations) ----
   Même dessin que les tuiles KPI ci-dessus, mais ce sont des BOUTONS (ou des liens) : un
   chiffre qu'on ne peut pas ouvrir est un chiffre qu'on ne croit pas. Celui qui est posé
   comme filtre s'allume à l'accent, comme une pastille active ; .est-attention signale
   un chiffre qui demande un geste (une garantie qui expire, un dossier à compléter). */
.chiffres { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; }
.chiffre {
    display: flex; flex-direction: column; gap: 4px; align-items: flex-start; text-align: left;
    padding: 14px 16px; margin: 0;
    background: var(--bg-secondary); border: 1px solid var(--border); border-radius: var(--radius-md);
    color: var(--text-primary); font-family: inherit; text-decoration: none; cursor: pointer;
    transition: border-color var(--transition), box-shadow var(--transition), background-color var(--transition);
}
.chiffre:hover { border-color: var(--accent); box-shadow: var(--shadow-sm); }
.chiffre.is-active { border-color: var(--accent); background: var(--accent-soft); box-shadow: inset 0 0 0 1px var(--accent); }
.chiffre.est-attention:not(.is-active) { border-left: 3px solid var(--status-warning); }
.chiffre-libelle { font-weight: 500; font-size: 11px; letter-spacing: 0.05em; text-transform: uppercase; color: var(--text-muted); }
.chiffre-valeur { font-weight: 650; font-size: 26px; letter-spacing: -0.02em; line-height: 1.1; font-variant-numeric: tabular-nums; }
.chiffre-valeur.est-ok { color: #15803d; }
.chiffre-valeur.est-attention { color: #b45309; }
.chiffre-valeur.est-erreur { color: #b91c1c; }
.chiffre-valeur.est-accent { color: var(--accent); }
[data-theme="dark"] .chiffre-valeur.est-ok { color: #4ade80; }
[data-theme="dark"] .chiffre-valeur.est-attention { color: #fbbf24; }
[data-theme="dark"] .chiffre-valeur.est-erreur { color: #f87171; }
.chiffre-detail { font-size: 12px; color: var(--text-muted); line-height: 1.4; }
/* Téléphone : deux par rangée plutôt qu'une colonne de quatre cartes. */
@media (max-width: 480px) {
    .chiffres { grid-template-columns: 1fr 1fr; gap: 8px; }
    .chiffre { padding: 12px; }
    .chiffre-valeur { font-size: 22px; }
}

/* ---- People ---- */
.person-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 12px;
}
.person-card {
    display: flex;
    flex-direction: column;
    gap: 3px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 14px 16px;
}
.person-role { font-weight: 500; font-size: 11px; font-family: inherit; letter-spacing: 0.05em; text-transform: uppercase; color: var(--text-muted); }
.person-name { font-weight: 600; font-size: 15px; font-family: inherit; color: var(--text-primary); margin-bottom: 3px; }
.person-line { font-size: 13px; color: var(--text-secondary); }
a.person-line:hover { color: var(--accent); }
.person-line.muted, .muted { color: var(--text-muted); }

/* ---- Data tables (budget, transactions, orders, reports, rates) ---- */
.data-scroll {
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    overflow: auto;
}
/* Les longues tables utilisent ~toute la hauteur d'écran restante (au lieu d'un plafond fixe à 560px)
   pour voir beaucoup plus de lignes sans rogner l'en-tête de page. Plancher pour les petits écrans. */
.data-scroll.tall { max-height: calc(100vh - 240px); min-height: 360px; }
.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
    white-space: nowrap;
}
.data-table thead th {
    position: sticky;
    top: 0;
    z-index: 1;
    background: var(--bg-tertiary);
    text-align: center;
    padding: 10px 14px;
    font-weight: 600; font-size: 11px; font-family: inherit;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--text-muted);
    border-bottom: 1px solid var(--border);
}
/* Valeurs centrées dans toutes les grilles (les cellules d'action restent à droite).
   (Norme reprise de Chronos.) */
.data-table tbody td {
    padding: 9px 14px;
    color: var(--text-primary);
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
    text-align: center;
}
.data-table td.cell-action { text-align: right; }
.data-table thead th .th-sort { justify-content: center; }
.data-table tbody tr:hover { background: var(--bg-glass-hover); }
.data-table tfoot td {
    position: sticky;
    bottom: 0;
    background: var(--bg-tertiary);
    padding: 10px 14px;
    font-weight: 600;
    color: var(--text-primary);
    border-top: 1px solid var(--border);
    font-variant-numeric: tabular-nums;
    text-align: center;
}
.data-table .num { text-align: center; font-variant-numeric: tabular-nums; }
/* Police des nombres agrandie dans le corps et le pied des grilles (pas dans l'en-tête). */
.data-table td.num { font-size: 15px; font-weight: 600; }
/* Colonne Commentaire : largeur plafonnée + retour à la ligne, pour garder toute la grille
   visible sans défilement horizontal excessif. */
.data-table td.cell-comment {
    max-width: 380px;
    white-space: normal;
    overflow-wrap: anywhere;
}

/* Champs d'édition en ligne dans les grilles (édition directe cellule par cellule). */
.data-table td .input {
    padding: 5px 8px;
    font-size: 13px;
    color: var(--text-primary);
    width: 100%;
    min-width: 0;
}

/* Cellule en cours d'édition : toute la cellule s'illumine (liseré accent + fond doux) pour
   repérer d'un coup d'œil où l'on saisit — le liseré de la cellule fait office de contour. */
.data-table tbody td:has(.input):focus-within,
.entry-table tbody td:has(.input):focus-within {
    background: var(--accent-soft);
    box-shadow: inset 0 0 0 2px var(--accent);
}
/* Le contour est porté par la cellule : on neutralise l'anneau propre du champ dans la grille
   pour éviter un double anneau (le champ garde son bord accent via .input:focus).
   Repli sans :has() → le champ garde simplement son bord accent, sans surbrillance de cellule. */
.data-table td .input:focus,
.entry-table td .input:focus {
    box-shadow: none;
}
/* Commentaire éditable en ligne : zone de texte qui grandit pour montrer TOUT le texte,
   avec retours à la ligne (field-sizing pour l'auto-hauteur sur navigateurs récents). */
.data-table td.cell-comment .cell-comment-input {
    min-width: 300px;
    field-sizing: content;
    min-height: 2.4em;
    max-height: 16em;
    line-height: 1.45;
    resize: vertical;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    vertical-align: top;
}
.data-table .mono { font-family: 'JetBrains Mono', 'Fira Code', monospace; font-size: 12px; color: var(--text-secondary); }
.data-table .neg { color: #dc2626; }
[data-theme="dark"] .data-table .neg { color: #f87171; }
.data-table td.num.neg, .data-table .kpi-value.neg { color: #dc2626; }
/* économie (Écart positif : Budget ≥ Facturé) — vert */
.data-table .pos { color: #16a34a; }
[data-theme="dark"] .data-table .pos { color: #4ade80; }

/* hour chips inside the labour-report detail cell */
.chip {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    margin: 2px 4px 2px 0;
    padding: 2px 9px;
    border-radius: var(--radius-full);
    background: var(--bg-tertiary);
    font-size: 12px;
    color: var(--text-secondary);
    white-space: nowrap;
}
.chip strong { color: var(--text-primary); font-variant-numeric: tabular-nums; }

/* Document link button in transaction / order tables */
.file-link {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 10px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--bg-elevated);
    color: var(--text-secondary);
    font-weight: 500; font-size: 12px; font-family: inherit;
    white-space: nowrap;
    transition: border-color 0.12s ease, color 0.12s ease;
}
.file-link:hover { border-color: var(--accent); color: var(--accent); }
.file-link-empty { color: var(--text-muted); }

/* ---- Onglet Avenant : tableau maître-détail extensible ---- */
/* Bouton « Voir détails » / « Masquer » de chaque ligne parent. */
.btn-link {
    border: none;
    background: none;
    padding: 0;
    font-weight: 500; font-size: 12px; font-family: inherit;
    color: var(--accent);
    cursor: pointer;
    white-space: nowrap;
}
.btn-link:hover { text-decoration: underline; }
/* Ligne d'en-tête des sous-lignes (petite légende). */
.data-table tbody tr.avenant-sub-head td {
    background: var(--bg-tertiary);
    padding-left: 32px;
    font-weight: 600; font-size: 10px; font-family: inherit;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--text-muted);
}
/* Sous-lignes de documents : fond subtil + indentation à gauche pour lire comme du détail imbriqué. */
.data-table tbody tr.avenant-sub td { background: var(--bg-glass); }
.data-table tbody tr.avenant-sub td:first-child { padding-left: 32px; }
.data-table tbody tr.avenant-sub:hover { background: transparent; }

.detail-grid.compact { grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); margin-bottom: 14px; }
.detail-card + .data-scroll { margin-top: 0; }

/* ---- DataTable: filter row + empty state ---- */
.data-table-wrap { display: flex; flex-direction: column; gap: 12px; }
.table-filter { min-width: 0; width: 100%; max-width: 380px; }
.table-filter .search-input { padding-right: 70px; }
.table-filter-count {
.table-plus { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 10px 2px 2px; color: var(--text-secondary); font-size: 13px; }
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 12px;
    color: var(--text-muted);
    font-variant-numeric: tabular-nums;
    pointer-events: none;
}
.data-table .empty-row { text-align: center; color: var(--text-muted); padding: 22px; }

/* ---- View toggle (Tableau / Graphique) ---- */
.view-toggle {
    display: inline-flex;
    gap: 2px;
    padding: 2px;
    margin-bottom: 14px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
}
.view-btn {
    background: none;
    border: 0;
    padding: 6px 16px;
    font-weight: 500; font-size: 13px; font-family: inherit;
    color: var(--text-muted);
    border-radius: calc(var(--radius-md) - 3px);
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease;
}
.view-btn:hover { color: var(--text-primary); }
.view-btn.is-active { background: var(--accent); color: #fff; }

/* ---- Budget treemap ---- */
.treemap { display: flex; flex-direction: column; gap: 12px; }
.treemap-crumbs { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 13px; }
.treemap-crumb {
    background: none;
    border: 0;
    padding: 2px 4px;
    font-weight: 600; font-size: 13px; font-family: inherit;
    color: var(--text-secondary);
    cursor: pointer;
}
.treemap-crumb:hover { color: var(--accent); }
.treemap-crumb.is-active { color: var(--text-primary); cursor: default; }
.treemap-crumb-sep { color: var(--text-muted); }
.treemap-hint { margin-left: auto; color: var(--text-muted); font-size: 12px; }
.treemap-crumbs { justify-content: space-between; }
.treemap-title { font-weight: 500; font-size: 13px; font-family: inherit; color: var(--text-secondary); }
.treemap-legend { display: flex; gap: 14px; flex-wrap: wrap; }
.legend-item { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--text-muted); }
.legend-dot { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
/* #2 — indicateurs cliquables (boutons de tri) du graphique d'écart au budget. */
.legend-btn { border: 1px solid var(--border, #d7dde3); background: var(--surface, #fff); border-radius: 999px; padding: 3px 10px; cursor: pointer; line-height: 1.4; transition: background .12s, border-color .12s, color .12s; }
.legend-btn:hover { border-color: var(--accent, #0a7a45); color: var(--text-secondary); }
.legend-btn.is-active { border-color: var(--accent, #0a7a45); background: rgba(10, 122, 69, .10); color: var(--text-secondary); font-weight: 600; }

/* #6 — niveau « facture » (2e imbrication) du résumé de contrat : léger retrait + fond plus pâle. */
.suivi-sub-2 > td:first-child { padding-left: 28px; }
.suivi-sub-2 { background: rgba(125, 125, 125, .04); }

/* #4 — édition en ligne de la DP dans le suivi d'heures. */
.dp-edit { display: inline-flex; align-items: center; gap: 4px; }
.dp-input { width: 72px; padding: 2px 6px; text-align: right; }
.dp-edit-btn { margin-left: 6px; opacity: .55; }
.dp-edit-btn:hover { opacity: 1; }

/* ---- Budget bar chart (facturé vs budget, par activité) ---- */
.budget-bars { display: flex; flex-direction: column; gap: 14px; }
.bars-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.bars-title { font-weight: 500; font-size: 13px; font-family: inherit; color: var(--text-secondary); max-width: 560px; }
.bars-legend { display: flex; gap: 14px; flex-wrap: wrap; }
.bars-body { display: flex; gap: 14px; align-items: flex-start; }
.bars-list { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.bar-row {
    display: grid;
    grid-template-columns: 220px 1fr 156px;
    align-items: center;
    gap: 14px;
    padding: 5px 8px;
    border-radius: 7px;
    cursor: pointer;
    transition: background 0.12s ease;
}
.bar-row:hover { background: var(--bg-glass-hover); }
.bar-row.is-selected { background: var(--accent-soft); }
.bar-label { min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.bar-code { font-family: 'JetBrains Mono', 'Fira Code', monospace; font-size: 12px; color: var(--text-muted); }
.bar-desc { font-size: 12.5px; color: var(--text-primary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bar-track {
    position: relative;
    height: 22px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: 5px;
    overflow: hidden;
}
.bar-fill { position: absolute; left: 0; top: 0; height: 100%; border-radius: 4px 0 0 4px; transition: width 0.2s ease; }
.bar-budget-line { position: absolute; left: 50%; top: 0; bottom: 0; width: 2px; background: var(--text-secondary); opacity: 0.7; }
.bar-meta { text-align: right; display: flex; flex-direction: column; gap: 1px; }
.bar-pct { font-weight: 700; font-size: 13px; font-family: inherit; font-variant-numeric: tabular-nums; }
.bar-ecart { font-size: 11.5px; font-variant-numeric: tabular-nums; }
.bar-ecart.over { color: #dc2626; }
.bar-ecart.under { color: var(--text-muted); }
[data-theme="dark"] .bar-ecart.over { color: #f87171; }

/* Detail panel beside the bars — reuses the figures styling, stays in view while scrolling. */
.bars-detail {
    position: sticky;
    top: 12px;
    flex: 0 0 250px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 14px 16px;
}

@media (max-width: 760px) {
    .bars-body { flex-direction: column; }
    .bars-detail { position: static; flex-basis: auto; width: 100%; }
    .bar-row { grid-template-columns: 110px 1fr 120px; gap: 8px; }
}

.treemap-body { display: flex; gap: 14px; align-items: flex-start; }
.treemap-svg {
    flex: 1 1 auto;
    width: 100%;
    height: auto;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background: var(--bg-secondary);
    overflow: visible;
}
.treemap-tile { cursor: pointer; }
.treemap-tile rect { transition: opacity 0.12s ease; }
.treemap-tile:hover rect { opacity: 0.86; }
.treemap-tile rect.is-selected { stroke: var(--text-primary); stroke-width: 3; }
.treemap-label { font: 600 13px 'Inter', sans-serif; pointer-events: none; }
.treemap-amount { font: 500 12px 'Inter', sans-serif; pointer-events: none; opacity: 0.92; font-variant-numeric: tabular-nums; }
.treemap-dev { font: 700 12px 'Inter', sans-serif; pointer-events: none; }
.treemap-state { font-weight: 600; font-size: 13px; font-family: inherit; margin-bottom: 12px; }

.treemap-detail {
    flex: 0 0 250px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 14px 16px;
}
.treemap-detail-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 4px; }
.treemap-detail-close { background: none; border: 0; color: var(--text-muted); cursor: pointer; font-size: 14px; }
.treemap-detail-close:hover { color: var(--text-primary); }
.treemap-detail-title { font-weight: 600; font-size: 14px; font-family: inherit; color: var(--text-primary); margin-bottom: 12px; line-height: 1.4; }
.treemap-figures { display: flex; flex-direction: column; gap: 8px; }
.treemap-figures > div { display: flex; justify-content: space-between; gap: 12px; font-size: 13px; }
.treemap-figures dt { color: var(--text-muted); }
.treemap-figures dd { color: var(--text-primary); font-variant-numeric: tabular-nums; font-weight: 500; }
.treemap-figures dd.neg { color: #dc2626; }
[data-theme="dark"] .treemap-figures dd.neg { color: #f87171; }
.treemap-figures dd.pos { color: #16a34a; }
[data-theme="dark"] .treemap-figures dd.pos { color: #4ade80; }

@media (max-width: 720px) {
    .treemap-body { flex-direction: column; }
    .treemap-detail { flex-basis: auto; width: 100%; }
}

/* ============================================================
   Forms (new project, new rates, new report)
   ============================================================ */
.header-tools { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.header-actions { display: flex; gap: 10px; align-items: center; }

/* ---- Projects list filter bar ---- */
.filter-bar {
    display: flex;
    align-items: center;
    gap: 18px;
    flex-wrap: wrap;
    margin-bottom: 16px;
}
.filter-check { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text-secondary); cursor: pointer; user-select: none; }
.filter-check input { width: 16px; height: 16px; accent-color: var(--accent); cursor: pointer; }
.filter-years { display: inline-flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.filter-label { font-size: 13px; color: var(--text-muted); }
.chip-toggle {
    padding: 4px 12px;
    border-radius: var(--radius-full);
    border: 1px solid var(--border);
    background: var(--bg-elevated);
    color: var(--text-secondary);
    font-weight: 500; font-size: 12.5px; font-family: inherit;
    cursor: pointer;
    transition: background 0.12s ease, border-color 0.12s ease, color 0.12s ease;
}
.chip-toggle:hover { border-color: var(--accent); color: var(--text-primary); }
/* Deux noms pour le même état : « is-on » (la liste des projets, la Forge) et « is-active »
   (les barres de filtres de RIPPA Distribution Canada). La pastille active n'était PAS mise en
   évidence sous le second nom — elle se cliquait, elle filtrait, et rien ne disait laquelle
   était posée. Un filtre invisible est un filtre dont on ne sort pas. */
.chip-toggle.is-on,
.chip-toggle.is-active { background: var(--accent); border-color: var(--accent); color: #fff; }
.chip-toggle.is-on:hover,
.chip-toggle.is-active:hover { color: #fff; }
.chip-more { font-weight: 600; }
.filter-count { margin-left: auto; font-size: 13px; color: var(--text-muted); font-variant-numeric: tabular-nums; }

.tab-toolbar { display: flex; justify-content: flex-end; margin-bottom: 14px; }
.toolbar-locked { font-size: 13px; color: var(--text-muted); display: inline-flex; align-items: center; gap: 6px; }

.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 14px;
    margin-bottom: 4px;
}
.form-grid.tight { grid-template-columns: repeat(auto-fill, minmax(155px, 1fr)); gap: 10px; }
.form-field { display: flex; flex-direction: column; gap: 5px; }
.form-field.span-2 { grid-column: span 2; }
.form-field label { font-weight: 500; font-size: 12px; font-family: inherit; color: var(--text-secondary); }
.form-field .req { color: #dc2626; }
[data-theme="dark"] .form-field .req { color: #f87171; }

.form-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 18px;
}
.form-running-total { margin-right: auto; color: var(--text-secondary); font-size: 13px; }
.form-running-total strong { color: var(--text-primary); font-variant-numeric: tabular-nums; }

.form-card { margin-bottom: 18px; }
.form-card-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.form-card-head h3 { font-weight: 600; font-size: 16px; font-family: inherit; color: var(--text-primary); }
.form-card-close { background: none; border: 0; color: var(--text-muted); cursor: pointer; font-size: 15px; }
.form-card-close:hover { color: var(--text-primary); }
.form-subhead { font-weight: 600; font-size: 12px; font-family: inherit; letter-spacing: 0.04em; text-transform: uppercase; color: var(--text-muted); margin: 18px 0 10px; }

.form-banner {
    padding: 11px 14px;
    border-radius: var(--radius-sm);
    font-size: 13.5px;
    margin-bottom: 14px;
}
.form-banner.success { background: var(--accent-soft); color: var(--accent); border: 1px solid var(--accent); }
/* Bandeau lié au brouillon (ex. « élément rappelé ») — violet, surtout pas le vert de succès :
   repasser en brouillon n'est pas une validation. */
.form-banner.draft { background: var(--draft-soft); color: var(--draft); border: 1px solid var(--draft); }
.form-banner.error {
    background: rgba(239, 68, 68, 0.1);
    color: #dc2626;
    border: 1px solid rgba(239, 68, 68, 0.4);
}
[data-theme="dark"] .form-banner.error { color: #f87171; }

.form-hint { color: var(--text-muted); font-size: 13px; margin-bottom: 12px; }

/* ---- Editable budget-entry table (new project) ---- */
.entry-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.entry-table thead th {
    text-align: left;
    padding: 9px 12px;
    font-weight: 600; font-size: 11px; font-family: inherit;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--text-muted);
    background: var(--bg-tertiary);
    border-bottom: 1px solid var(--border);
}
.entry-table thead th.num { text-align: right; }
.entry-table tbody td { padding: 6px 10px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.entry-table tbody td .input { padding: 7px 9px; }
.entry-table .mono-input { font-family: 'JetBrains Mono', 'Fira Code', monospace; }
.entry-table .num-input { text-align: right; font-variant-numeric: tabular-nums; }
.entry-table .empty-row { text-align: center; color: var(--text-muted); padding: 20px; }
.entry-table tfoot td {
    padding: 10px 12px;
    font-weight: 600;
    color: var(--text-primary);
    background: var(--bg-tertiary);
    border-top: 1px solid var(--border);
    font-variant-numeric: tabular-nums;
}
.entry-table tfoot td.num { text-align: right; }
.row-remove {
    background: none;
    border: 0;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 14px;
    padding: 4px 6px;
    border-radius: var(--radius-sm);
}
.row-remove:hover { color: #dc2626; background: var(--bg-glass-hover); }

/* ── Feuille de temps : zone de dépôt + pastilles de statut ─────────────────── */
/* Zone de dépôt de fichier.

   Le <input type="file"> natif dessine SON propre bouton (« Choose File »), carré, gris, et
   dans la langue du navigateur — le navigateur ne laisse pas le styler. On ne le cache pas :
   on l'étale, TRANSPARENT, sur toute la zone. Le clic et le glisser-déposer marchent donc
   partout dans le cadre, le focus clavier reste réel, et ce qui s'affiche est notre bouton.
   Le cacher (display:none, ou 1×1 px) casserait le dépôt par glissement — précisément ce que
   la zone annonce à l'utilisateur. */
.dropzone {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 32px 24px;
    border: 2px dashed var(--border);
    border-radius: var(--radius-md);
    background: var(--bg-glass);
    color: var(--text-secondary);
    text-align: center;
    cursor: pointer;
    transition: border-color 0.18s ease, background-color 0.18s ease, color 0.18s ease;
}
.dropzone:hover { border-color: var(--text-secondary); background: var(--bg-glass-hover); }

/* focus-within et non :focus : c'est l'input invisible qui reçoit le focus clavier, jamais le
   cadre. Sans ça, tabuler jusqu'à la zone ne montrerait rigoureusement rien. */
.dropzone:focus-within {
    border-color: var(--accent);
    background: var(--accent-soft);
    color: var(--accent);
    outline: none;
}

/* Cette règle DOIT rester globale : l'input est rendu par le composant <InputFile>, donc il
   n'hérite pas de l'attribut de portée du composant parent, et un sélecteur dans un
   *.razor.css ne l'atteindrait pas sans ::deep. C'est aussi ce qui garantit que toutes les
   zones de dépôt de l'app se comportent pareil — il n'y a qu'une mécanique, écrite une fois. */
.dropzone input[type="file"] {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
}
/* Pendant l'analyse d'une capture, l'input est désactivé : le curseur doit le dire, sinon la
   zone a l'air cliquable alors qu'elle ne répond plus. */
.dropzone input[type="file"]:disabled { cursor: progress; }

/* Bouton « choisir un fichier » — le petit frère de .dropzone, là où une zone de dépôt
   pleine largeur serait trop lourde (une preuve parmi cinq, une pièce jointe de bulletin).
   Le bouton natif du navigateur (« Choisir un fichier · Aucun fichier choisi », gris, dans la
   langue du NAVIGATEUR et pas de l'écran) ne se stylise pas : on le cache sous un libellé qui
   porte l'allure de .btn-secondary, et c'est l'input invisible, étendu sur tout le libellé,
   qui reçoit le clic et le focus clavier. Global pour la même raison que .dropzone : l'input
   est rendu par <InputFile>, hors de portée du CSS isolé. */
.bouton-fichier {
    position: relative;
    align-self: flex-start;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: var(--bg-elevated);
    color: var(--text-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font: 500 13px/1 'Inter', system-ui, sans-serif;
    white-space: nowrap;
    cursor: pointer;
    transition: var(--transition);
}
.bouton-fichier::before {
    content: "";
    width: 14px;
    height: 14px;
    flex-shrink: 0;
    background: currentColor;
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4'/%3E%3Cpolyline points='17 8 12 3 7 8'/%3E%3Cline x1='12' y1='3' x2='12' y2='15'/%3E%3C/svg%3E") center / contain no-repeat;
            mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4'/%3E%3Cpolyline points='17 8 12 3 7 8'/%3E%3Cline x1='12' y1='3' x2='12' y2='15'/%3E%3C/svg%3E") center / contain no-repeat;
}
.bouton-fichier:hover { border-color: var(--text-secondary); color: var(--text-primary); }
.bouton-fichier:focus-within { border-color: var(--accent); color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.bouton-fichier input[type="file"] {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
}
.bouton-fichier.est-desactive { opacity: 0.45; cursor: not-allowed; }
.bouton-fichier input[type="file"]:disabled { cursor: not-allowed; }

/* Un bandeau d'erreur qui reçoit le focus (tabindex="-1", pour y amener l'œil après un envoi
   refusé) n'a pas à porter l'anneau du navigateur : il est déjà rouge, et il défile à l'écran. */
.form-banner[tabindex="-1"]:focus { outline: none; }

.dropzone-icon { color: var(--text-muted); margin-bottom: 6px; line-height: 0; }
.dropzone:hover .dropzone-icon,
.dropzone:focus-within .dropzone-icon { color: var(--accent); }
.dropzone-title { font-weight: 600; font-size: 14px; font-family: inherit; color: var(--text-primary); }
.dropzone:focus-within .dropzone-title { color: var(--accent); }
.dropzone-hint { font-size: 12.5px; color: var(--text-muted); }

.pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 2px 10px;
    border-radius: var(--radius-full, 999px);
    background: var(--accent-soft);
    color: var(--accent);
    font-weight: 600; font-size: 12px; font-family: inherit;
}
.pill-ok   { background: rgba(34, 197, 94, 0.14);  color: #15803d; }
.pill-warn { background: rgba(234, 179, 8, 0.16);  color: #a16207; }
.pill-err  { background: rgba(239, 68, 68, 0.14);  color: #b91c1c; }

/* ── La pastille « données de démonstration » ──────────────────────────────
   Elle GROSSIT, et ce n'est pas de la décoration. Les lignes semées du registre ne portent
   plus « (exemple) » dans leur nom (RegistreDemo) : cette pastille est donc le seul endroit
   qui dise à celui qui regarde l'écran que rien de ce qu'il lit n'est réel. Une note de bas
   de page ne ferait pas le travail — d'où la taille d'un titre secondaire, la couleur d'un
   avertissement et le point qui attire l'œil avant le texte.
   La règle de CONVENTIONS.md (« Demo material must announce itself ») est tenue ici. */
.pill-demo {
    padding: 5px 14px;
    font-size: 14px;
    background: rgba(234, 179, 8, 0.18);
    color: #854d0e;
    border: 1px solid rgba(234, 179, 8, 0.5);
}
.pill-demo::before { content: "\25CF"; font-size: 9px; line-height: 1; }
[data-theme="dark"] .pill-demo { background: rgba(234, 179, 8, 0.2); color: #fcd34d; }

.clean-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.clean-list-row { display: flex; align-items: center; gap: 10px; font-size: 13.5px; color: var(--text-secondary); }

/* ── Menu de configuration — norme Chronos ─────────────────────────────────
   Une barre latérale GROUPÉE plutôt qu'une rangée d'onglets : les intertitres
   disent à quoi sert chaque écran, et un écran de plus n'aggrave rien. */
.config-layout {
    display: grid;
    grid-template-columns: 232px minmax(0, 1fr);
    gap: 28px;
    align-items: start;
}

.config-nav {
    display: grid;
    gap: 18px;
    position: sticky;
    top: 76px;                      /* 56 px de barre d'app collante + une respiration */
}
.config-nav-group { display: grid; gap: 2px; }
.config-nav-title {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--text-muted);
    padding: 0 10px 6px;
}
/* La note qui explique un onglet en lecture seule (Usagers & accès sans « comptes.gerer »).
   Discrète : elle informe celui qui cherche, sans peser sur celui qui a le droit. */
.config-nav-note {
    font-size: 11px;
    line-height: 1.45;
    color: var(--text-muted);
    margin: 6px 0 0;
    padding: 0 10px;
}
.config-nav-note code { font-size: 10px; }
.config-nav-item {
    appearance: none;
    background: none;
    border: none;
    border-left: 2px solid transparent;
    padding: 8px 12px;
    font: inherit;
    font-weight: 600;
    font-size: 13.5px;
    color: var(--text-secondary);
    text-align: left;
    cursor: pointer;
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    transition: color 0.12s ease, background-color 0.12s ease, border-color 0.12s ease;
}
.config-nav-item:hover { color: var(--text-primary); background: var(--bg-glass-hover); }
.config-nav-item.is-active {
    color: var(--accent);
    border-left-color: var(--accent);
    background: var(--bg-glass-hover);
}

/* La variante « zone de danger » : même géométrie, couleur d'alerte. */
.config-nav-danger { color: var(--status-danger); }
.config-nav-danger:hover { color: var(--status-danger); }
.config-nav-danger.is-active { color: var(--status-danger); border-left-color: var(--status-danger); }

/* Le panneau ne doit jamais pousser la grille : les tableaux larges défilent chez eux. */
.config-panel { min-width: 0; }

/* Sous 900 px la barre repasse au-dessus du contenu, en rangée défilante — mieux
   qu'une colonne de 232 px qui mangerait la moitié d'un écran de portable. */
@media (max-width: 900px) {
    .config-layout { grid-template-columns: minmax(0, 1fr); gap: 18px; }
    .config-nav {
        position: static;
        grid-auto-flow: column;
        grid-auto-columns: max-content;
        gap: 20px;
        overflow-x: auto;
        padding-bottom: 6px;
        border-bottom: 1px solid var(--border);
    }
    .config-nav-group { grid-auto-flow: column; grid-auto-columns: max-content; gap: 4px; align-items: center; }
    .config-nav-title { padding: 0 6px 0 0; }
    /* En rangée horizontale défilante, un paragraphe deviendrait une colonne interminable :
       le panneau de refus, lui, reste là pour l'expliquer une fois l'onglet ouvert. */
    .config-nav-note { display: none; }
    .config-nav-item { border-left: none; border-bottom: 2px solid transparent; border-radius: var(--radius-sm); white-space: nowrap; }
    .config-nav-item.is-active { border-left-color: transparent; border-bottom-color: var(--accent); }
    .config-nav-danger.is-active { border-left-color: transparent; border-bottom-color: var(--status-danger); }
}

.config-check { display: flex; align-items: center; gap: 10px; padding: 6px 0; }
.config-check input[type="checkbox"] { width: 16px; height: 16px; accent-color: var(--accent); }
.config-inline { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.config-inline .input { max-width: 140px; }

/* ============================================================
   Graphiques d'analyse (SVG serveur, Components/Shared/Graphique*)
   Partagé entre les trois formes : c'est le langage visuel commun,
   les composants n'ont pas de géométrie en CSS.
   ============================================================ */
.graphique { margin: 0; }
.graphique-titre { font-size: 0.85rem; font-weight: 600; color: var(--text-primary); margin-bottom: 8px; }
.graphique-svg { width: 100%; height: auto; display: block; }
.graphique-grille { stroke: var(--border); stroke-width: 1; }
.graphique-axe { fill: var(--text-secondary); font-size: 11px; }
.graphique-barre { fill: var(--serie); }
.graphique-barre:hover { opacity: 0.85; }
.graphique-ligne { stroke: var(--serie); stroke-width: 2; fill: none; stroke-linejoin: round; stroke-linecap: round; }
.graphique-point { fill: var(--serie); }
.graphique-part { fill: var(--serie); stroke: var(--bg-secondary); stroke-width: 2; }
/* Le trou du donut reprend le fond de la carte : un « faux perçage » bien moins fragile
   qu'un vrai chemin annulaire, tant que le graphique vit dans une .card. */
.graphique-trou { fill: var(--bg-secondary); }

.serie-1 { --serie: var(--graph-1); }
.serie-2 { --serie: var(--graph-2); }
.serie-3 { --serie: var(--graph-3); }
.serie-4 { --serie: var(--graph-4); }
.serie-5 { --serie: var(--graph-5); }
.serie-6 { --serie: var(--graph-6); }

.graphique-legende { list-style: none; display: flex; flex-wrap: wrap; gap: 6px 16px; margin: 8px 0 0; padding: 0; font-size: 0.8rem; color: var(--text-secondary); }
.graphique-legende li { display: flex; align-items: center; gap: 6px; }
.graphique-legende .pastille { width: 10px; height: 10px; border-radius: 3px; background: var(--serie); flex: none; }
.graphique-legende.colonne { flex-direction: column; gap: 6px; }
.legende-etiquette { min-width: 0; }
.legende-part { color: var(--text-muted); margin-left: auto; font-variant-numeric: tabular-nums; white-space: nowrap; padding-left: 8px; }

.graphique-secteurs { display: grid; grid-template-columns: minmax(140px, 200px) 1fr; gap: 16px; align-items: center; }
.graphique-secteurs .graphique-legende { margin: 0; }
@media (max-width: 560px) {
    .graphique-secteurs { grid-template-columns: 1fr; }
}

/* ── Réapprovisionnement — proposition d'achats (/reapprovisionnement) ─────
   Reproduction du tableau Odoo id 27. Une grille dense, lue par qui décide d'acheter :
   la couleur est réservée au STATUT (§5 de la spécification : URGENT rouge, À planifier
   orange, Surstock bleu, Dormant gris, À vérifier jaune, OK vert) et à la quantité à
   commander. Le reste doit rester du chiffre, sinon plus rien ne ressort. */
.reappro-etat {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    margin: 0 0 14px;
    font-size: 13px;
    color: var(--text-secondary);
}
.reappro-hors-perimetre summary { cursor: pointer; }
.reappro-hors-perimetre ul { margin: 6px 0 0; padding-left: 18px; columns: 2 240px; }
.reappro-hors-perimetre-n { color: var(--text-secondary); font-variant-numeric: tabular-nums; }
.reappro-point {
    width: 8px; height: 8px;
    border-radius: 50%;
    background: #16a34a;
    flex: none;
}
.reappro-point.is-perdu { background: #dc2626; }
.reappro-perdu { color: #dc2626; font-weight: 600; }
[data-theme="dark"] .reappro-perdu { color: #f87171; }

.reappro-kpi { margin-bottom: 16px; }

.reappro-parametres { margin-bottom: 8px; padding: 14px 18px; }
.reappro-parametres-titre {
    display: flex;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 6px 14px;
    cursor: pointer;
    font-weight: 600;
    font-size: 14px;
    color: var(--text-primary);
}
.reappro-parametres[open] .reappro-parametres-titre { margin-bottom: 14px; }
.reappro-parametres-resume { font-weight: 400; font-size: 12.5px; color: var(--text-muted); }
/* En COLONNES de texte, pas en grille : l'arbre des catégories se lit de haut en bas, et une
   sous-catégorie reste sous son parent au lieu de partir dans la colonne voisine. */
/* Le panneau des paramètres : trois groupes en cartes, une carte par famille de catégories,
   et la lecture Odoo repliée en liste clé-valeur. */
.rp-groupes {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 14px;
}
.rp-groupe {
    background: var(--bg-elevated, var(--bg-primary));
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 14px 16px 16px;
}
.rp-groupe-titre {
    margin: 0;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
}
.rp-groupe-aide {
    margin: 3px 0 12px;
    font-size: 12px;
    color: var(--text-muted);
    line-height: 1.4;
}
.rp-champs {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 10px 12px;
}
.rp-champ label { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rp-saisie { position: relative; display: flex; align-items: center; }
.rp-saisie .input {
    width: 100%;
    padding-right: 48px;
    font-variant-numeric: tabular-nums;
    text-align: right;
}
.rp-unite {
    position: absolute;
    right: 10px;
    font-size: 12px;
    color: var(--text-muted);
    pointer-events: none;
}

.rp-pied {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 20px;
    padding-top: 14px;
    border-top: 1px solid var(--border);
}
.rp-actions { display: flex; gap: 10px; margin-left: auto; }
.rp-lecture summary {
    cursor: pointer;
    font-size: 12.5px;
    font-weight: 500;
    color: var(--text-secondary);
}
.rp-dl {
    display: grid;
    grid-template-columns: max-content 1fr;
    gap: 5px 18px;
    margin: 10px 0 0;
    font-size: 12.5px;
}
.rp-dl dt { color: var(--text-muted); }
.rp-dl dd { margin: 0; color: var(--text-primary); font-variant-numeric: tabular-nums; }
.rp-dl dd.mono { font-family: 'JetBrains Mono', 'Fira Code', monospace; font-size: 12px; }

/* Statut en pastille TEINTÉE : la couleur se lit d'un coup d'œil sans hurler — fond à 12 %,
   texte plein. Hérite la couleur du statut posée sur la cellule (.is-urgent…). */
.rp-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 2px 10px 2px 8px;
    border-radius: var(--radius-full);
    background: color-mix(in srgb, currentColor 12%, transparent);
    font-size: 12px;
    font-weight: 600;
    line-height: 1.6;
    white-space: nowrap;
}
.rp-badge::before {
    content: "";
    width: 6px; height: 6px;
    border-radius: 50%;
    background: currentColor;
}

.reappro-filtres { margin-bottom: 12px; }
.reappro-chip-n {
    margin-left: 4px;
    font-variant-numeric: tabular-nums;
    opacity: 0.75;
}

/* Le statut : couleur de texte, pas de fond — une colonne de pastilles pleines hurlerait. */
.data-table td.reappro-statut {
    font-weight: 600;
    font-size: 12.5px;
    white-space: nowrap;
}
.reappro-statut.is-urgent    { color: #dc2626; }
.reappro-statut.is-planifier { color: #c2410c; }
.reappro-statut.is-surstock  { color: #2563eb; }
.reappro-statut.is-dormant   { color: var(--text-muted); }
.reappro-statut.is-verifier  { color: #a16207; }
.reappro-statut.is-ok        { color: #15803d; }
.reappro-statut.is-aucun     { color: var(--text-muted); font-weight: 500; }
[data-theme="dark"] .reappro-statut.is-urgent    { color: #f87171; }
[data-theme="dark"] .reappro-statut.is-planifier { color: #fb923c; }
[data-theme="dark"] .reappro-statut.is-surstock  { color: #60a5fa; }
[data-theme="dark"] .reappro-statut.is-verifier  { color: #fbbf24; }
[data-theme="dark"] .reappro-statut.is-ok        { color: #4ade80; }

/* La même couleur, en liseré, sur les pastilles de filtre — tant qu'elles ne sont pas actives. */
.chip-toggle.reappro-chip:not(.is-on).is-urgent    { border-left: 3px solid #dc2626; }
.chip-toggle.reappro-chip:not(.is-on).is-planifier { border-left: 3px solid #ea580c; }
.chip-toggle.reappro-chip:not(.is-on).is-surstock  { border-left: 3px solid #2563eb; }
.chip-toggle.reappro-chip:not(.is-on).is-dormant   { border-left: 3px solid #9ca3af; }
.chip-toggle.reappro-chip:not(.is-on).is-verifier  { border-left: 3px solid #eab308; }
.chip-toggle.reappro-chip:not(.is-on).is-ok        { border-left: 3px solid #16a34a; }

/* La quantité à commander est LE chiffre de la page : il se lit en gras dès qu'il est positif. */
.data-table td.reappro-qte.is-positive { font-weight: 700; color: var(--text-primary); }
/* Rapport des pièces : une qté en BO est déjà due à un client, sans rien pour la couvrir. */
.data-table td.reappro-bo.is-positive { font-weight: 700; color: #dc2626; }
[data-theme="dark"] .data-table td.reappro-bo.is-positive { color: #f87171; }

.data-table td.mono { white-space: nowrap; }
.data-table td.reappro-produit { min-width: 240px; }
.data-table td.reappro-produit .cell-title,
.reappro-groupes .cell-title { display: block; }
.data-table td.reappro-produit .cell-sub,
.reappro-groupes .cell-sub { display: block; font-size: 11.5px; }

/* Section Machineries : la ligne étiquette porte le total, les machines se replient dessous. */
.reappro-groupes tr.reappro-groupe td { background: var(--bg-tertiary); font-weight: 600; }
.reappro-groupes tr.reappro-groupe td .cell-sub { font-weight: 400; }
.reappro-groupes tr.reappro-machine td { font-size: 12.5px; }
.reappro-groupes tr.reappro-machine td:first-child { padding-left: 34px; }
.reappro-groupes td:first-child { min-width: 240px; }
.reappro-groupes tfoot td { font-weight: 700; }
/* La grille (2026-10-30) : la ligne de total ferme chaque table, sur les lignes affichées ;
   « Tout déplier / replier » reste sous la barre d'outils, au-dessus des étiquettes. */
.reappro-depliage { display: flex; gap: 8px; margin: 0 0 10px; }
.reappro-total-n { font-weight: 400; color: var(--text-secondary); font-size: 12.5px; }
.data-table tfoot tr.reappro-pied td { font-weight: 700; }
.data-table tfoot tr.reappro-pied td.reappro-pied-titre { text-align: left; white-space: nowrap; }
.data-table tfoot td.reappro-total { white-space: nowrap; }
.reappro-groupes td.reappro-codes { font-size: 12px; white-space: normal; max-width: 340px; }
.reappro-deplier {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 0;
    border: 0;
    background: none;
    color: inherit;
    font: inherit;
    cursor: pointer;
    text-align: left;
}
.reappro-deplier:hover .cell-title { color: var(--accent); }
.reappro-fleche { width: 12px; color: var(--text-muted); }

.reappro-note {
    margin: 16px 0 0;
    font-size: 13px;
    color: var(--text-secondary);
    max-width: 90ch;
}

/* ── Approvisionnement expérimental (/reapprovisionnement/experimental) ────
   Le calendrier des PO d'un produit. Une couleur par FAMILLE de mouvement, la même dans le
   graphique, le calendrier, la grille et la légende : arrivées bleu (--graph-1), PO proposés
   hachurés à l'accent, Booking orange (--graph-2), autres commandes violet (--graph-4),
   prévision gris machine. Le rouge reste au retard et à la rupture, comme dans la proposition. */
.ax-page {
    --ax-arrivee: var(--graph-1);
    --ax-propose: var(--accent);
    --ax-booking: var(--graph-2);
    --ax-commande: var(--graph-4);
    --ax-prevision: var(--machine);
    --ax-croissance: #ca8a04;
    --ax-avec: var(--graph-3);
    --ax-sans: var(--status-danger);
    --ax-ok: #16a34a;
    --ax-attention: #ea580c;
    --ax-alerte: #dc2626;
}
[data-theme="dark"] .ax-page { --ax-ok: #4ade80; --ax-attention: #fb923c; --ax-alerte: #f87171; --ax-croissance: #facc15; }

.ax-beta, .sous-menu-marque {
    display: inline-block;
    margin-left: 8px;
    padding: 2px 8px;
    border-radius: var(--radius-full);
    background: var(--draft-soft);
    color: var(--draft);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    vertical-align: middle;
}
.sous-menu-marque { margin-left: 6px; padding: 1px 6px; font-size: 9.5px; }

/* Le produit : son identité à gauche, ses faits à droite. */
.ax-produit {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 14px 28px;
    margin-bottom: 16px;
    padding: 16px 20px;
    background: var(--accent-wash), var(--bg-secondary);
}
.ax-produit-identite { display: flex; align-items: center; gap: 18px; }
.ax-produit-identite > div { display: flex; flex-direction: column; gap: 2px; }
.ax-produit-choix { display: flex; flex-direction: column; gap: 4px; }
.ax-produit-code { font-size: 12.5px; color: var(--accent); font-weight: 600; }
.ax-produit-nom { font-size: 20px; font-weight: 700; letter-spacing: -0.02em; color: var(--text-primary); }
.ax-produit-sous { font-size: 12.5px; color: var(--text-muted); }
.ax-produit-faits { display: flex; flex-wrap: wrap; gap: 10px 28px; margin: 0; }
.ax-produit-faits dt { font-size: 11px; font-weight: 500; letter-spacing: 0.05em; text-transform: uppercase; color: var(--text-muted); }
.ax-produit-faits dd { margin: 2px 0 0; font-size: 13.5px; color: var(--text-primary); font-variant-numeric: tabular-nums; display: flex; align-items: center; gap: 6px; }

.ax-kpi { margin-bottom: 16px; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); }
.ax-kpi-alerte { border-color: color-mix(in srgb, var(--ax-alerte) 45%, transparent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--ax-alerte) 10%, transparent); }
.ax-alerte { margin-bottom: 16px; line-height: 1.5; }

.ax-carte { margin-bottom: 18px; padding: 16px 18px 12px; }
.ax-carte-entete { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 6px; }
.ax-carte-entete .section-title { margin: 0; }
.ax-carte-aide { margin: 3px 0 0; font-size: 12.5px; color: var(--text-muted); }
.ax-section { margin: 0 0 20px; }
.ax-section > .section-title { margin: 0 0 10px; }
.ax-vide { padding: 22px; }

/* ── Le graphique et le calendrier (SVG) ─────────────────────────────── */
.ax-graphique .graphique-svg, .ax-calendrier .graphique-svg { overflow: visible; }
.ax-passe { fill: var(--bg-tertiary); opacity: 0.7; }
.ax-choisi { fill: var(--accent-soft); stroke: var(--accent); stroke-width: 1; stroke-dasharray: 3 3; }
.ax-zero { stroke: var(--text-muted); stroke-width: 1.2; }
.ax-securite { stroke: var(--ax-attention); stroke-width: 1.3; stroke-dasharray: 6 4; }
.ax-securite-texte { fill: var(--ax-attention); font-size: 10.5px; font-weight: 600; }
.ax-barre { transition: opacity var(--transition); }
.ax-livre       { fill: var(--ax-prevision); opacity: 0.55; }
.ax-arrivee     { fill: var(--ax-arrivee); }
.ax-proposee    { fill: url(#ax-hachure); stroke: var(--ax-propose); stroke-width: 1.2; }
.ax-hachure-fond { fill: color-mix(in srgb, var(--ax-propose) 14%, transparent); }
.ax-hachure-trait { stroke: var(--ax-propose); stroke-width: 2.2; }
.ax-b-booking   { fill: var(--ax-booking); }
.ax-b-commande  { fill: var(--ax-commande); }
.ax-b-prevision { fill: var(--ax-prevision); }
.ax-b-croissance { fill: var(--ax-croissance); }
.ax-ligne-avec { fill: none; stroke: var(--ax-avec); stroke-width: 2.6; stroke-linejoin: round; stroke-linecap: round; }
.ax-ligne-sans { fill: none; stroke: var(--ax-sans); stroke-width: 2; stroke-dasharray: 6 5; stroke-linejoin: round; }
.ax-point-avec { fill: var(--bg-secondary); stroke: var(--ax-avec); stroke-width: 2; }
.ax-aujourdhui { stroke: var(--text-primary); stroke-width: 1.3; stroke-dasharray: 2 3; opacity: 0.7; }
.ax-aujourdhui-texte { fill: var(--text-primary); font-size: 10.5px; font-weight: 600; }
.ax-annee { font-weight: 700; fill: var(--text-primary); }
.ax-ruban { fill: var(--border); }
.ax-ruban.is-ok { fill: color-mix(in srgb, var(--ax-ok) 55%, transparent); }
.ax-ruban.is-planifier { fill: var(--ax-attention); }
.ax-ruban.is-urgent { fill: var(--ax-alerte); }
.ax-cible { fill: transparent; cursor: pointer; }
.ax-cible:hover { fill: var(--accent-soft); }

/* La légende reprend .graphique-legende ; ses pastilles prennent la couleur de leur famille. */
.ax-legende .pastille.ax-arrivee   { background: var(--ax-arrivee); }
.ax-legende .pastille.ax-proposee  { background: repeating-linear-gradient(45deg, var(--ax-propose) 0 2px, transparent 2px 5px); border: 1px solid var(--ax-propose); }
.ax-legende .pastille.ax-b-booking { background: var(--ax-booking); }
.ax-legende .pastille.ax-b-commande { background: var(--ax-commande); }
.ax-legende .pastille.ax-b-prevision { background: var(--ax-prevision); }
.ax-legende .pastille.ax-b-croissance { background: var(--ax-croissance); }
.ax-legende .pastille.ax-livre { background: color-mix(in srgb, var(--ax-prevision) 55%, transparent); }
.ax-trait { display: inline-block; width: 18px; height: 0; border-top: 2.6px solid; flex: none; }
.ax-trait-avec { border-color: var(--ax-avec); }
.ax-trait-sans { border-top-style: dashed; border-color: var(--ax-sans); border-top-width: 2px; }
.ax-trait-fab { height: 6px; border: 0; border-radius: 3px; background: color-mix(in srgb, var(--ax-arrivee) 28%, transparent); }
.ax-trait-route { height: 6px; border: 0; border-radius: 3px; background: var(--ax-arrivee); }
.ax-trait-propose { height: 6px; border: 1.5px dashed var(--ax-propose); border-radius: 3px; }
.ax-losange-legende { width: 10px; height: 10px; transform: rotate(45deg); background: var(--ax-ok); flex: none; margin: 0 2px; }
.ax-losange-legende.is-planifier { background: var(--ax-attention); }
.ax-losange-legende.is-urgent { background: var(--ax-alerte); }
.ax-losange-legende.ax-losange-limite { background: var(--bg-secondary); border: 2px solid var(--ax-propose); }

.ax-bande { fill: var(--bg-tertiary); opacity: 0.55; }
.ax-gantt-titre { fill: var(--text-primary); font-size: 12px; font-weight: 600; }
.ax-gantt-sous { fill: var(--text-muted); font-size: 10.5px; }
.ax-gantt-fab { fill: color-mix(in srgb, var(--ax-arrivee) 24%, transparent); }
.ax-gantt-fab.is-propose { fill: color-mix(in srgb, var(--ax-propose) 10%, transparent); stroke: var(--ax-propose); stroke-width: 1; stroke-dasharray: 4 3; }
.ax-gantt-route { fill: var(--ax-arrivee); }
.ax-gantt-route.ax-mer { fill: var(--graph-6); }
.ax-gantt-route.is-propose { fill: color-mix(in srgb, var(--ax-propose) 22%, transparent); stroke: var(--ax-propose); stroke-width: 1.5; stroke-dasharray: 5 3; }
.ax-gantt-date { fill: var(--text-secondary); font-size: 10.5px; font-variant-numeric: tabular-nums; }
.ax-gantt-retard { stroke: var(--ax-alerte); stroke-width: 3; stroke-linecap: round; opacity: 0.75; }
.ax-losange { fill: var(--ax-ok); stroke: var(--bg-secondary); stroke-width: 1.5; }
.ax-losange.is-planifier { fill: var(--ax-attention); }
.ax-losange.is-urgent { fill: var(--ax-alerte); }
.ax-losange.ax-losange-limite { fill: var(--bg-secondary); stroke: var(--ax-propose); stroke-width: 2.2; }

/* ── Les PO proposés : une carte par PO, son parcours en trois étapes ── */
.ax-propositions { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 12px; }
.ax-po {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 16px 18px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-left: 4px solid var(--ax-propose);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
}
.ax-po.is-bientot { border-left-color: var(--ax-attention); }
.ax-po.is-urgent { border-left-color: var(--ax-alerte); }
.ax-po .rp-badge.is-urgent { color: var(--ax-alerte); }
.ax-po .rp-badge.is-planifier { color: var(--ax-attention); }
.ax-po .rp-badge.is-ok { color: var(--ax-ok); }
.ax-po-entete { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.ax-po-numero { font-weight: 600; font-size: 13.5px; color: var(--text-primary); }
.ax-po-qte { display: flex; align-items: baseline; gap: 8px; }
.ax-po-chiffre { font-size: 30px; font-weight: 700; letter-spacing: -0.03em; color: var(--text-primary); font-variant-numeric: tabular-nums; line-height: 1; }
.ax-po-unite { font-size: 13px; color: var(--text-secondary); font-variant-numeric: tabular-nums; }
.ax-po-etapes { list-style: none; margin: 0; padding: 0 0 0 14px; border-left: 2px solid var(--border); display: flex; flex-direction: column; gap: 9px; }
.ax-po-etapes li { position: relative; display: grid; grid-template-columns: 1fr auto; gap: 0 10px; font-size: 12.5px; }
.ax-po-etapes li::before { content: ""; position: absolute; left: -20px; top: 4px; width: 8px; height: 8px; border-radius: 50%; background: var(--bg-secondary); border: 2px solid var(--ax-propose); }
.ax-po-etapes li:first-child::before { background: var(--ax-propose); }
.ax-po-etapes span { color: var(--text-muted); }
.ax-po-etapes strong { color: var(--text-primary); font-weight: 600; font-variant-numeric: tabular-nums; text-align: right; }
.ax-po-etapes em { grid-column: 1 / -1; font-style: normal; font-size: 11.5px; color: var(--text-secondary); }
.ax-po-etapes em.ax-retard, .ax-retard { color: var(--ax-alerte); font-weight: 600; }
.ax-po-sert { margin: 0; font-size: 12px; color: var(--text-secondary); line-height: 1.45; }
.ax-po > .btn-secondary { align-self: flex-start; }

/* ── Le plan mois par mois : un tableau MRP, mois en colonnes ───────── */
.data-table.ax-plan th[scope="row"] { text-align: left; white-space: nowrap; font-weight: 500; color: var(--text-secondary); position: sticky; left: 0; background: var(--bg-secondary); z-index: 1; }
.data-table.ax-plan td { white-space: nowrap; font-variant-numeric: tabular-nums; min-width: 54px; }
.data-table.ax-plan td.ax-col-passe, .data-table.ax-plan th.ax-col-passe { background: var(--bg-tertiary); color: var(--text-muted); }
.data-table.ax-plan .ax-col-choisie { background: var(--accent-soft) !important; }
.ax-plan-mois { border: 0; background: none; padding: 0; font: inherit; color: inherit; cursor: pointer; text-transform: capitalize; }
.ax-plan-mois:hover { color: var(--accent); }
.data-table.ax-plan tr.ax-plan-groupe td { background: var(--bg-tertiary); font-size: 11px; font-weight: 600; letter-spacing: 0.05em; text-transform: uppercase; color: var(--text-muted); text-align: left; }
.data-table.ax-plan tr.ax-plus td { color: var(--ax-arrivee); }
.data-table.ax-plan tr.ax-plan-propose td { color: var(--ax-propose); font-weight: 600; }
.data-table.ax-plan tr.ax-moins td { color: var(--text-secondary); }
.data-table.ax-plan tr.ax-total td, .data-table.ax-plan tr.ax-total th { font-weight: 700; color: var(--text-primary); border-top: 1px solid var(--border); }
.data-table.ax-plan tr.ax-sans td { color: var(--text-secondary); }
.ax-etat-pastille { display: inline-block; min-width: 30px; padding: 1px 8px; border-radius: var(--radius-full); font-weight: 600; font-size: 12px; background: color-mix(in srgb, currentColor 13%, transparent); }
.ax-etat-pastille.is-ok { color: var(--ax-ok); }
.ax-etat-pastille.is-planifier { color: var(--ax-attention); }
.ax-etat-pastille.is-urgent { color: var(--ax-alerte); }
td.ax-solde-neg { color: var(--ax-alerte) !important; font-weight: 700; }
td.ax-solde-bas { color: var(--ax-attention) !important; font-weight: 600; }

/* ── Les paramètres et la grille ─────────────────────────────────────── */
.ax-champ-note { display: block; margin-top: 4px; font-size: 11.5px; color: var(--text-muted); line-height: 1.4; }
.ax-case { margin-top: 10px; font-size: 13px; color: var(--text-primary); }
.ax-filtre-mois { margin: 0 0 10px; }
.ax-filtre-mois .chip-toggle, .ax-carte-entete .chip-toggle { text-transform: capitalize; }
.data-table tr.ax-ligne-propose td { background: color-mix(in srgb, var(--ax-propose) 6%, transparent); }
.data-table tr.ax-ligne-stock td { font-weight: 600; }
.data-table td.ax-cell-date .cell-title, .data-table td.ax-cell-date .cell-sub { display: block; white-space: nowrap; }
.data-table td.ax-cell-date .cell-sub { font-size: 11.5px; }
.ax-depasse { color: var(--ax-alerte) !important; }
.ax-type { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; font-size: 12.5px; font-weight: 500; }
.ax-type::before { content: ""; width: 9px; height: 9px; border-radius: 3px; background: var(--ax-prevision); flex: none; }
.ax-type.ax-stock::before { background: var(--text-primary); }
.ax-type.ax-mer::before { background: var(--graph-6); }
.ax-type.ax-po::before { background: var(--ax-arrivee); }
.ax-type.ax-propose::before { background: repeating-linear-gradient(45deg, var(--ax-propose) 0 2px, transparent 2px 4px); border: 1px solid var(--ax-propose); }
.ax-type.ax-booking::before { background: var(--ax-booking); }
.ax-type.ax-commande::before { background: var(--ax-commande); }
.ax-type.ax-croissance::before { background: var(--ax-croissance); }
.data-table td.ax-qte { font-weight: 600; }
.data-table td.ax-qte.is-plus { color: var(--ax-arrivee); }
.data-table td.ax-qte.is-moins { color: var(--text-primary); }
.ax-page .rp-badge.is-ok, .ax-brouillon .rp-badge.is-ok { color: var(--ax-ok); }
.ax-page .rp-badge.is-planifier { color: var(--ax-attention); }
.ax-page .rp-badge.is-urgent { color: var(--ax-alerte); }
.ax-page .rp-badge.is-info { color: var(--graph-4); }
.ax-note p { margin: 0 0 8px; }
.data-table td.ax-couverture { min-width: 240px; max-width: 380px; white-space: normal; }
.data-table td.ax-couverture .cell-sub { display: block; margin-top: 3px; font-size: 11.5px; line-height: 1.35; }
.ax-page .btn-imprimer { display: inline-flex; align-items: center; gap: 6px; }
.ax-page .btn-icone { width: 15px; height: 15px; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* ── Les scénarios de commande : une couleur à eux (--graph-5), partout ─ */
.ax-page { --ax-scenario: var(--graph-5); }
.ax-b-scenario { fill: var(--ax-scenario); }
.ax-legende .pastille.ax-b-scenario { background: var(--ax-scenario); }
.ax-trait-scenario { height: 6px; border: 0; border-radius: 3px; background: var(--ax-scenario); }
.ax-gantt-route.ax-scenario { fill: var(--ax-scenario); }
.ax-gantt-fab.is-scenario { fill: color-mix(in srgb, var(--ax-scenario) 22%, transparent); }
.ax-type.ax-scenario::before { background: var(--ax-scenario); }
.data-table.ax-plan tr.ax-plan-scenario td { color: var(--ax-scenario); font-weight: 600; }
.ax-scenarios { border-top: 3px solid var(--ax-scenario); }
.ax-scenarios-table td { vertical-align: middle; }
.ax-scenarios-table .input { padding: 5px 8px; font-size: 13px; }
.ax-scenarios-table .ax-sc-libelle { min-width: 190px; }
.ax-scenarios-table .ax-sc-qte { width: 80px; text-align: right; }
.ax-scenarios-table .cell-sub { display: block; margin-top: 3px; font-size: 11px; }
.ax-scenarios-table tr.ax-scenario-inactif td { opacity: 0.55; }
/* Les PO d'Odoo qu'une planification ignore (§7 bis) : la ligne cochée se lit barrée, sa case reste nette. */
.ax-po-ignores .section-title .rp-badge { margin-left: 8px; vertical-align: middle; }
.ax-po-ignores-table tr.ax-po-ignore td:not(:first-child):not(:last-child) { opacity: 0.55; text-decoration: line-through; }
.ax-po-ignores-table td:first-child input { width: 18px; height: 18px; cursor: pointer; }
.ax-po-ignores-table td:first-child input:disabled { cursor: not-allowed; }
.ax-po-ignores-table .pl-po-machine { display: inline-block; margin: 0 10px 2px 0; white-space: nowrap; }
.ax-po-ignores-table .cell-sub { display: block; }
.ax-po-ignores-table td { white-space: nowrap; }
.ax-po-ignores-table td.ax-po-fournisseur { white-space: normal; min-width: 180px; }
.ax-po-ignores-table .ax-po-doc { display: flex; align-items: center; gap: 8px; }
.ax-scenarios-table tr.ax-scenario-erreur td { color: var(--ax-alerte); font-size: 12px; font-weight: 600; opacity: 1; }
.ax-sous-titre { margin: 18px 0 2px; font-size: 14px; font-weight: 600; color: var(--text-primary); }
.data-table.ax-bilan { width: auto; min-width: min(100%, 640px); margin-top: 8px; }
.data-table.ax-bilan th[scope="row"] { text-align: left; font-weight: 500; color: var(--text-secondary); white-space: nowrap; }
.data-table.ax-bilan td { white-space: nowrap; font-variant-numeric: tabular-nums; }
.ax-ecart { font-weight: 600; color: var(--text-secondary); }
.ax-ecart.is-mieux { color: var(--ax-ok); }
.ax-ecart.is-pire { color: var(--ax-alerte); }
.ax-po-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.ax-carte-entete > .btn-primary, .ax-carte-entete > .btn-secondary { flex: none; white-space: nowrap; }
.ax-securite-effective { margin-top: 10px; font-weight: 600; color: var(--text-secondary); }

/* ── Le panneau des paramètres : les groupes de la proposition, puis les siens ── */
/* Le délai mesuré sur les PO reçus, sous le délai moyen qu'on pose. */
.ax-observe {
    margin-top: 12px;
    padding: 10px 12px;
    border-radius: var(--radius-sm);
    background: var(--accent-soft);
    font-size: 12.5px;
    color: var(--text-primary);
}
.ax-observe-titre { margin: 0 0 8px; line-height: 1.45; }
.ax-observe-titre span { display: block; color: var(--text-secondary); }
.ax-observe-actions { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 8px 12px; }
.ax-observe-actions .btn-secondary { padding: 5px 10px; font-size: 12.5px; }
.ax-observe-actions { min-width: 0; }
.ax-observe-detail { flex: 1 1 100%; min-width: 0; }
.ax-observe-defilement { max-width: 100%; overflow-x: auto; }
.ax-po-plan { color: var(--ax-attention) !important; }
.ax-observe-detail summary { cursor: pointer; padding: 5px 0; color: var(--accent); font-weight: 500; }
.data-table.ax-observe-table { margin-top: 6px; font-size: 12px; background: var(--bg-secondary); }
.data-table.ax-observe-table td, .data-table.ax-observe-table th { padding: 4px 8px; white-space: nowrap; }
/* Le délai propre à un PO proposé, sur sa carte. */
.ax-po-delai { display: grid; grid-template-columns: 1fr 110px; align-items: center; gap: 4px 10px; font-size: 12.5px; }
.ax-po-delai label { color: var(--text-muted); }
.ax-po-delai .rp-saisie .input { padding: 5px 34px 5px 8px; font-size: 13px; }
.ax-po-delai .chip-toggle, .ax-po-delai .ax-champ-note { grid-column: 1 / -1; justify-self: start; margin: 0; }
.ax-po-majoration { margin: -6px 0 0; font-size: 12px; color: var(--ax-propose); font-weight: 600; }
/* Surstock (bleu) et Dormant (gris) : les couleurs de statut de la proposition. */
.ax-page .rp-badge.is-surstock, .ax-etat-pastille.is-surstock { color: #2563eb; }
.ax-ruban.is-surstock { fill: #2563eb; }
.ax-page .rp-badge.ax-statut-dormant { color: var(--text-muted); }
[data-theme="dark"] .ax-page .rp-badge.is-surstock, [data-theme="dark"] .ax-etat-pastille.is-surstock { color: #60a5fa; }
[data-theme="dark"] .ax-ruban.is-surstock { fill: #60a5fa; }

/* ── Les paramètres du plan, en haut de la page ─────────────────────────
   Une bande toujours visible (les réglages clés en pastilles, ceux qu'on a changés en
   couleur), qui s'ouvre sur le parcours d'un PO à l'échelle et une carte par groupe, chacune
   à sa teinte (--teinte) : la même couleur pour sa bordure, son icône, ses curseurs et le
   point des réglages modifiés. */
.ax-reglages { margin-bottom: 18px; padding: 0; overflow: hidden; border-top: 3px solid var(--accent); }
.ax-reglages-entete {
    display: flex; align-items: center; gap: 14px; width: 100%;
    padding: 14px 18px 10px; border: 0; background: none; color: inherit; font: inherit;
    text-align: left; cursor: pointer;
}
.ax-reglages-icone {
    display: grid; place-items: center; flex: none; width: 38px; height: 38px;
    border-radius: 12px; background: var(--accent-gradient); color: #fff; box-shadow: var(--shadow-glow);
}
.ax-reglages-titre { display: flex; flex-direction: column; gap: 2px; flex: 1; min-width: 0; }
.ax-reglages-titre strong { font-size: 15px; font-weight: 650; color: var(--text-primary); letter-spacing: -0.01em; }
.ax-reglages-titre span { font-size: 12.5px; color: var(--text-muted); }
.ax-reglages-modifies {
    flex: none; padding: 3px 10px; border-radius: var(--radius-full);
    background: var(--accent-soft); color: var(--accent); font-size: 12px; font-weight: 600;
}
.ax-reglages-chevron {
    display: grid; place-items: center; flex: none; width: 30px; height: 30px; border-radius: 50%;
    background: var(--bg-tertiary); color: var(--text-secondary); transition: var(--transition);
}
.ax-reglages-entete:hover .ax-reglages-chevron { background: var(--accent-soft); color: var(--accent); }
.ax-reglages-puces { display: flex; flex-wrap: wrap; gap: 6px; padding: 0 18px 14px 70px; }
.ax-puce {
    display: inline-flex; align-items: baseline; gap: 6px; padding: 4px 11px;
    border: 1px solid transparent; border-radius: var(--radius-full);
    background: var(--bg-tertiary); color: var(--text-secondary); font-size: 12px;
}
.ax-puce strong { color: var(--text-primary); font-weight: 600; font-variant-numeric: tabular-nums; }
.ax-puce.est-modifie { background: var(--accent-soft); border-color: color-mix(in srgb, var(--accent) 35%, transparent); color: var(--accent); }
.ax-puce.est-modifie strong { color: var(--accent); }
.ax-reglages-corps { padding: 4px 18px 18px; border-top: 1px solid var(--border); background: var(--bg-glass); }

/* Le parcours d'un PO, à l'échelle. */
.ax-parcours {
    margin: 14px 0 6px; padding: 14px 16px 12px;
    border: 1px solid var(--border); border-radius: var(--radius-md); background: var(--bg-secondary); box-shadow: var(--shadow-sm);
}
.ax-parcours-tete { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 4px 12px; }
.ax-parcours-titre { font-size: 13.5px; font-weight: 600; color: var(--text-primary); }
.ax-parcours-total { font-size: 12.5px; color: var(--text-secondary); font-variant-numeric: tabular-nums; }
.ax-parcours-barre { position: relative; display: flex; gap: 3px; height: 34px; margin: 26px 0 10px; }
.ax-parcours-seg {
    display: grid; place-items: center; min-width: 38px; border-radius: 8px;
    color: #fff; font-size: 12px; font-weight: 650; font-variant-numeric: tabular-nums; white-space: nowrap;
}
.ax-sg-planif { background: var(--machine); }
.ax-sg-fabrication { background: var(--graph-1); }
.ax-sg-coussin { background: repeating-linear-gradient(45deg, var(--graph-2) 0 6px, color-mix(in srgb, var(--graph-2) 70%, #fff) 6px 12px); }
.ax-sg-traversee { background: var(--graph-6); }
.ax-sg-pdi { background: var(--graph-3); }
.ax-parcours-mesure { position: absolute; top: -22px; bottom: -5px; width: 0; border-left: 2px dashed var(--text-primary); }
.ax-parcours-mesure span {
    position: absolute; top: -3px; transform: translateX(-50%); padding: 0 6px; border-radius: var(--radius-full);
    background: var(--text-primary); color: var(--bg-secondary); font-size: 11px; font-weight: 600; white-space: nowrap;
}
.ax-parcours-jalons { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin: 0; padding: 0; list-style: none; }
.ax-parcours-jalons li { display: flex; flex-direction: column; gap: 1px; font-size: 11.5px; }
.ax-parcours-jalons li:nth-child(2) { text-align: center; } .ax-parcours-jalons li:nth-child(3) { text-align: center; }
.ax-parcours-jalons li:last-child { text-align: right; }
.ax-parcours-jalons span { color: var(--text-muted); }
.ax-parcours-jalons strong { color: var(--text-primary); font-size: 12.5px; font-weight: 600; font-variant-numeric: tabular-nums; }
.ax-parcours-legende { display: flex; flex-wrap: wrap; gap: 6px 16px; margin: 10px 0 0; padding: 0; list-style: none; font-size: 12px; color: var(--text-secondary); }
.ax-parcours-legende li { display: inline-flex; align-items: center; gap: 6px; }
.ax-parcours-legende i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; }

.ax-reglages-section {
    display: flex; align-items: baseline; gap: 8px; margin: 20px 0 10px;
    font-size: 11px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-muted);
}
.ax-reglages-section span { font-weight: 400; letter-spacing: 0; text-transform: none; font-size: 12px; }
.ax-reglages-grille { display: grid; grid-template-columns: repeat(auto-fit, minmax(270px, 1fr)); gap: 14px; }

/* Une carte de réglages, à sa teinte. */
.ax-rg-carte {
    --teinte: var(--accent);
    display: flex; flex-direction: column; gap: 12px; padding: 14px 16px 16px;
    border: 1px solid var(--border); border-top: 3px solid var(--teinte); border-radius: var(--radius-md);
    background: var(--bg-secondary); box-shadow: var(--shadow-sm); transition: box-shadow var(--transition);
}
.ax-rg-carte:hover { box-shadow: var(--shadow-md); }
.ax-teinte-bleu { --teinte: var(--graph-1); }
.ax-teinte-vert { --teinte: var(--graph-3); }
.ax-teinte-violet { --teinte: var(--graph-4); }
.ax-teinte-cyan { --teinte: var(--graph-6); }
.ax-teinte-orange { --teinte: var(--graph-2); }
.ax-teinte-gris { --teinte: var(--machine); }
.ax-rg-carte header { display: flex; align-items: flex-start; gap: 12px; }
.ax-rg-carte h4 { margin: 0; font-size: 13.5px; font-weight: 600; color: var(--text-primary); }
.ax-rg-carte header p { margin: 2px 0 0; font-size: 12px; line-height: 1.4; color: var(--text-muted); }
.ax-rg-icone {
    display: grid; place-items: center; flex: none; width: 32px; height: 32px; border-radius: 10px;
    background: color-mix(in srgb, var(--teinte) 13%, transparent); color: var(--teinte);
}
.ax-rg-champs { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); align-items: end; gap: 10px 12px; }
/* Dans une carte étroite, un libellé long passe à la ligne plutôt que d'être coupé. */
.ax-rg-carte .rp-champ label { white-space: normal; overflow: visible; line-height: 1.3; }
.ax-rg-resultat {
    margin: 0; padding: 8px 10px; border-radius: var(--radius-sm);
    background: color-mix(in srgb, var(--teinte) 8%, transparent); color: var(--text-secondary); font-size: 12px; line-height: 1.45;
}
/* Un intertitre dans une carte : la croissance d'abord, puis les autres demandes. */
.ax-rg-intertitre { margin: 4px 0 0; font-size: 11px; font-weight: 600; letter-spacing: 0.05em; text-transform: uppercase; color: var(--text-muted); }
.ax-rg-carte .ax-observe { margin-top: 0; background: color-mix(in srgb, var(--teinte) 8%, transparent); }
/* Un réglage qui s'écarte du défaut : un point à sa teinte, un cadre teinté. */
.ax-rg-carte .rp-champ.est-modifie label::before,
.ax-curseur.est-modifie label::before {
    content: ""; display: inline-block; width: 6px; height: 6px; margin-right: 6px; border-radius: 50%;
    background: var(--teinte); vertical-align: middle;
}
.ax-rg-carte .rp-champ.est-modifie .input { border-color: color-mix(in srgb, var(--teinte) 55%, transparent); background: color-mix(in srgb, var(--teinte) 5%, var(--bg-secondary)); }
.ax-rg-carte .rp-saisie .input:focus { border-color: var(--teinte); box-shadow: 0 0 0 3px color-mix(in srgb, var(--teinte) 18%, transparent); }

/* Le curseur d'un pourcentage. */
.ax-curseur { display: flex; flex-direction: column; gap: 8px; }
.ax-curseur-tete { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.ax-curseur-tete label { font-size: 13px; font-weight: 500; color: var(--text-secondary); }
.ax-curseur output {
    padding: 1px 9px; border-radius: var(--radius-full); background: color-mix(in srgb, var(--teinte) 12%, transparent);
    color: var(--teinte); font-size: 13px; font-weight: 650; font-variant-numeric: tabular-nums;
}
.ax-curseur input[type="range"] {
    -webkit-appearance: none; appearance: none; width: 100%; height: 6px; margin: 4px 0; border-radius: var(--radius-full);
    background: linear-gradient(to right, var(--teinte) var(--plein, 0%), var(--border) var(--plein, 0%)); cursor: pointer; outline: none;
}
.ax-curseur input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none; appearance: none; width: 18px; height: 18px; border-radius: 50%;
    background: #fff; border: 2px solid var(--teinte); box-shadow: var(--shadow-sm);
}
.ax-curseur input[type="range"]::-moz-range-thumb {
    width: 16px; height: 16px; border-radius: 50%; background: #fff; border: 2px solid var(--teinte); box-shadow: var(--shadow-sm);
}
.ax-curseur input[type="range"]:focus-visible { box-shadow: 0 0 0 3px color-mix(in srgb, var(--teinte) 25%, transparent); }

/* L'interrupteur : une case à cocher qui a l'air d'en être un. */
.ax-interrupteur { position: relative; display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--text-primary); cursor: pointer; }
.ax-interrupteur input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.ax-interrupteur-piste {
    position: relative; flex: none; width: 36px; height: 20px; border-radius: var(--radius-full);
    background: var(--border); transition: background var(--transition);
}
.ax-interrupteur-piste::after {
    content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%;
    background: #fff; box-shadow: var(--shadow-sm); transition: transform var(--transition);
}
.ax-interrupteur input:checked + .ax-interrupteur-piste { background: var(--teinte); }
.ax-interrupteur input:checked + .ax-interrupteur-piste::after { transform: translateX(16px); }
.ax-interrupteur input:focus-visible + .ax-interrupteur-piste { outline: 2px solid var(--teinte); outline-offset: 2px; }

.ax-reglages-pied {
    display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 12px;
    margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--border);
}
@media (max-width: 720px) {
    .ax-reglages-puces { padding-left: 18px; }
    .ax-parcours-jalons { grid-template-columns: repeat(2, 1fr); }
    .ax-parcours-jalons li { text-align: left !important; }
}

/* ── Le bon de commande proposé (tiroir) ─────────────────────────────── */
.ax-brouillon { display: flex; flex-direction: column; gap: 16px; }
.ax-brouillon-entete { margin: 0; }
.ax-brouillon-lignes { width: 100%; }
.ax-brouillon-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; }

@media (max-width: 720px) {
    .ax-produit-nom { font-size: 17px; }
    .ax-carte { padding: 12px; }
}

/* ── Vue conteneur (/conteneurs) ───────────────────────────────────────────
   Une carte par conteneur, dans l'ordre d'arrivée. Les machines ressortent du
   contenu : cinq mini-pelles comptent plus que trois cents blocs de plastique,
   même si les blocs sont soixante fois plus nombreux. */
.conteneur-resume {
    margin: 0 0 14px;
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
}

.conteneur-liste {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 12px;
    /* Une carte dépliée grandit seule : ses voisines gardent leur hauteur de dix articles
       au lieu de s'étirer avec elle et de montrer un grand vide. */
    align-items: start;
}

.conteneur-carte {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 16px 18px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* La date est passée : le conteneur devrait être là. Un liseré suffit — il y en a
   souvent plusieurs, et cinq cartes rouges ne disent plus rien. */
.conteneur-attendu { border-left: 3px solid var(--status-warning); }

.conteneur-entete {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    justify-content: space-between;
    gap: 6px 14px;
}

.conteneur-identite {
    display: flex;
    align-items: baseline;
    gap: 10px;
    min-width: 0;
}

.conteneur-numero {
    font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
    font-size: 16px;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: 0.02em;
}

.conteneur-ref {
    font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
    font-size: 11px;
    color: var(--text-muted);
}

.conteneur-quand {
    display: flex;
    align-items: baseline;
    gap: 8px;
    font-size: 13px;
}

.conteneur-delai { font-weight: 600; color: var(--accent); }
.conteneur-delai.is-attendu { color: #a16207; }
[data-theme="dark"] .conteneur-delai.is-attendu { color: #fbbf24; }

.conteneur-date { color: var(--text-secondary); }

.conteneur-contenu-resume {
    margin: 0;
    font-size: 14px;
    color: var(--text-secondary);
}

.conteneur-lignes {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

/* Le contenu d'une carte : la hauteur de DIX articles PLUS celle du bouton du pli, réservée
   même quand il y en a moins ou qu'il n'y a pas de bouton. Toutes les cartes repliées ont
   ainsi la même taille, d'une rangée à l'autre. Au-delà de dix, le pli (ci-dessous). */
.conteneur-contenu {
    display: flex;
    flex-direction: column;
    font-size: 13px;
    line-height: 1.5;
    min-height: calc(10 * 1.5em + 9 * 4px + 8px + 1.5em + 16px);
}

/* Replié : la dixième ligne s'estompe vers le bouton — il y a une suite. */
.conteneur-contenu.is-replie .conteneur-lignes {
    -webkit-mask-image: linear-gradient(to bottom, #000 calc(100% - 1.6em), rgba(0, 0, 0, 0.35));
            mask-image: linear-gradient(to bottom, #000 calc(100% - 1.6em), rgba(0, 0, 0, 0.35));
}

/* Les articles révélés par le dépli entrent en fondu, sans faire sauter la carte. */
.conteneur-ligne.is-sous-pli { animation: conteneur-deplie 0.22s ease-out both; }
@keyframes conteneur-deplie {
    from { opacity: 0; transform: translateY(-3px); }
    to   { opacity: 1; transform: none; }
}

/* Le bouton du pli : pleine largeur, discret, et il dit ce qu'il cache. */
.conteneur-deplier {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    margin-top: 8px;
    padding: 7px 12px;
    border: 1px dashed var(--text-muted);
    border-radius: var(--radius-sm);
    background: var(--bg-tertiary);
    color: var(--accent);
    font: inherit;
    font-size: 13px;
    line-height: 1.5;
    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease;
}
.conteneur-deplier:hover { background: var(--accent-soft); border-color: var(--accent); border-style: solid; }
.conteneur-deplier:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.conteneur-deplier-texte { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; justify-content: center; }
.conteneur-deplier-texte strong { font-weight: 600; }
.conteneur-deplier-qte { color: var(--text-secondary); font-size: 12px; font-variant-numeric: tabular-nums; }
.conteneur-deplier-chevron { flex: none; transition: transform 0.2s ease; }
.conteneur-deplier.is-deplie { background: transparent; border-style: solid; border-color: var(--border); color: var(--text-secondary); }
.conteneur-deplier.is-deplie .conteneur-deplier-chevron { transform: rotate(180deg); }

@media (prefers-reduced-motion: reduce) {
    .conteneur-ligne.is-sous-pli { animation: none; }
    .conteneur-deplier-chevron { transition: none; }
}

.conteneur-ligne {
    display: grid;
    grid-template-columns: 3.5rem minmax(0, 1fr) auto;
    align-items: baseline;
    gap: 10px;
    font-size: 13px;
    color: var(--text-secondary);
}

.conteneur-qte {
    font-variant-numeric: tabular-nums;
    font-weight: 600;
    text-align: right;
    color: var(--text-primary);
}

.conteneur-produit {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.conteneur-code {
    font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
    font-size: 11px;
    color: var(--text-muted);
}

/* Une machine ressort du lot : c'est ce qu'on vient chercher sur cet écran. */
.conteneur-ligne.is-machine {
    color: var(--text-primary);
    font-weight: 600;
}

/* Et son nom ne se coupe JAMAIS. « R15 ECO - Kubota D72… » ne dit pas quel modèle
   arrive : sur trois colonnes, une machine prend deux lignes plutôt qu'une ellipse.
   Les pièces, elles, gardent l'ellipse — leur nom exact se lit dans le code. */
.conteneur-ligne.is-machine .conteneur-produit {
    white-space: normal;
    overflow: visible;
    text-overflow: clip;
}

.conteneur-ligne.is-machine .conteneur-qte { color: var(--accent); }

.conteneur-note {
    margin: 18px 0 0;
    font-size: 13px;
    color: var(--text-secondary);
    max-width: 78ch;
}

/* La recherche de /conteneurs : un numéro, un lot, un OBL, un PO, un article, une série. */
.conteneur-recherche { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin: 0 0 16px; }
.conteneur-recherche .search-field { flex: 1 1 320px; max-width: 560px; min-width: 0; }
.conteneur-recherche-compte { font-size: 13px; color: var(--text-secondary); }

/* Le bouton d'action de /conteneurs : l'entrée de l'assistant de réception. */
.conteneur-actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }

/* Le transfert par lot d'un conteneur, sous sa carte : les deux boutons, puis le résultat. */
.conteneur-lot { display: flex; flex-direction: column; gap: 8px; border-top: 1px solid var(--border); padding-top: 12px; }
.conteneur-lot-detail { margin: 0; font-size: 13px; color: var(--text-secondary); overflow-wrap: anywhere; }

/* ── LA RÉCEPTION D'UN CONTENEUR (/conteneurs/reception) ─────────────────────
   L'assistant : nouvel import, historique, puis le dossier d'un import — la grille
   par conteneur, ses constats (rouge = bloquant, ambre = avertissement), la
   correction en ligne et le plan de ce qui serait écrit dans Odoo. Les étapes, en
   tête, vivent dans le composant EtapesReception (CSS scopé). */
.reception-nouvel { margin-bottom: 24px; }

/* La date effective (étape 3) : celle de toutes les transactions écrites dans Odoo. */
.reception-date-effective { margin: 4px 0 16px; padding: 12px 14px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--bg-secondary); }
.reception-date-effective-saisie { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.reception-date-effective-saisie .input { width: auto; min-width: 170px; }

/* La facture fournisseur (étape 5) : l'en-tête en grille, puis les lignes. */
.reception-facture-entete { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px 18px; margin: 14px 0 16px; }
.reception-facture-entete dt { font-size: 12px; color: var(--text-secondary); margin-bottom: 3px; }
.reception-facture-entete dd { margin: 0; font-weight: 600; color: var(--text-primary); overflow-wrap: anywhere; }
.reception-facture-entete dd .form-hint { display: block; font-weight: 400; }
.reception-facture-entete dd code { font-weight: 500; font-size: 12.5px; }
.reception-facture-conteneur { border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 14px 16px; margin: 14px 0; }
.reception-facture-titre { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; font-size: 16px; font-weight: 650; margin: 0 0 10px; }
.reception-facture-transport td { background: var(--bg-secondary); }
.input.reception-facture-montant { width: 130px; text-align: right; display: inline-block; }
.conteneur-reception { margin-bottom: 24px; }
.reception-depot { margin: 6px 0 14px; }
.reception-actions { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; justify-content: flex-end; }
.reception-historique { margin-top: 8px; }
.reception-entete-actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.reception-fichiers { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin: 0 0 16px; }
.reception-fichiers-titre { font-size: 12.5px; color: var(--text-secondary); }
.reception-exemples { display: inline-flex; gap: 8px; align-items: baseline; font-size: 13px; color: var(--text-secondary); }
.reception-kpi { margin-bottom: 6px; }
.reception-kpi .kpi-card.is-erreur .kpi-value { color: #dc2626; }
.reception-kpi .kpi-card.is-avert .kpi-value { color: #a16207; }
.reception-source { font-size: 12.5px; color: var(--text-secondary); margin: 0 0 14px; }

.reception-constats { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.reception-constat {
    font-size: 12.5px;
    line-height: 1.4;
    padding: 4px 10px;
    border-radius: var(--radius-sm);
    border-left: 3px solid transparent;
}
.reception-constat.is-erreur { background: rgba(239, 68, 68, 0.08); border-left-color: #dc2626; color: #991b1b; }
.reception-constat.is-avert  { background: rgba(234, 179, 8, 0.10); border-left-color: #ca8a04; color: #854d0e; }
.reception-page > .reception-constats { margin-bottom: 16px; }

.reception-plan { margin-bottom: 20px; border-color: var(--accent); }

/* Les articles inconnus d'Odoo : l'alerte en tête du dossier. Les lignes arrivées sans PO : les PO proposés. */
.reception-alerte { margin-bottom: 16px; border-color: #dc2626; border-left-width: 4px; }
.reception-alerte > p { margin: 4px 0 10px; font-size: 13.5px; }
.reception-propositions { margin-bottom: 20px; border-color: #ca8a04; border-left-width: 4px; }
.reception-proposition { margin-top: 12px; }
.reception-proposition .reception-constat { margin: 6px 0 0; }
.reception-ligne-proposition { display: flex; gap: 10px; align-items: baseline; flex-wrap: wrap; margin-top: 4px; font-size: 12.5px; }
/* Le plan d'écriture, geste par geste : un résumé en tuiles, puis chaque geste avec son
   explication et sa table de détail (emplacements, articles, numéros de série). */
.reception-plan-sommaire {
    list-style: none; margin: 10px 0 16px; padding: 0;
    display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 8px;
}
.reception-plan-sommaire li {
    display: flex; flex-direction: column; gap: 2px;
    padding: 8px 12px; border-radius: var(--radius-sm);
    background: var(--bg-tertiary); font-size: 12.5px; color: var(--text-secondary);
}
.reception-plan-sommaire strong { font-size: 20px; line-height: 1.1; color: var(--text-primary); font-variant-numeric: tabular-nums; }
.reception-plan-gestes { list-style: none; margin: 0 0 14px; padding: 0; display: flex; flex-direction: column; gap: 14px; }
.reception-geste { padding: 12px 14px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--bg-secondary); }
.reception-geste-hors { background: transparent; border-style: dashed; }
.reception-geste-titre { display: flex; align-items: center; gap: 10px; margin: 0 0 4px; font-size: 14.5px; font-weight: 600; }
.reception-geste-num {
    display: inline-flex; align-items: center; justify-content: center; flex: none;
    width: 24px; height: 24px; border-radius: 50%;
    background: var(--accent); color: #fff; font-size: 12.5px; font-weight: 700;
}
.reception-geste-explication { margin: 0 0 8px; font-size: 13px; color: var(--text-secondary); line-height: 1.45; }
.reception-geste-liste { margin: 4px 0 0; padding-left: 20px; font-size: 13px; line-height: 1.5; }
.reception-geste-liste .reception-geste-liste { margin-top: 2px; }
.reception-geste-liste .cell-sub { display: inline; margin-left: 6px; }
.reception-geste .reception-constat { margin: 8px 0 0; }
.reception-constat.is-ok { background: rgba(34, 197, 94, 0.10); border-left-color: #16a34a; color: #166534; }
[data-theme="dark"] .reception-constat.is-ok { color: #86efac; }
.reception-plan-table { table-layout: auto; margin-top: 4px; }
.reception-plan-table th, .reception-plan-table td { vertical-align: top; }
.reception-plan-table .cell-qte { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.reception-plan-article { font-weight: 600; white-space: nowrap; }
.reception-plan-table td:first-child { min-width: 260px; }
.reception-plan-table .cell-qte { width: 1%; }
.reception-plan-table .cell-sub { white-space: normal; display: block; }
.reception-plan-series { font-family: 'JetBrains Mono', 'Fira Code', monospace; font-size: 12px; }
.reception-plan-table code { font-size: 12.5px; }

.reception-grille-tete { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.reception-conteneur { margin-bottom: 18px; }
.reception-conteneur-tete { display: flex; gap: 12px; align-items: baseline; margin: 6px 0; }
/* La grille garde ses colonnes à leur largeur naturelle : un n° de série ne se coupe pas,
   la table défile plutôt (le .table de base est en disposition fixe). */
.reception-table { table-layout: auto; }
.reception-table th, .reception-table td { white-space: nowrap; vertical-align: top; }
.reception-table td.cell-ellipsis { max-width: 240px; overflow: hidden; text-overflow: ellipsis; }
.reception-table .cell-action > * + * { margin-left: 12px; }
.reception-table .reception-ligne-constats td { white-space: normal; }
.reception-table .input { min-width: 90px; padding: 4px 8px; font-size: 13px; }
.reception-table .reception-qte { min-width: 56px; width: 64px; }
.reception-ligne.is-retiree td { text-decoration: line-through; color: var(--text-muted); }
.reception-ligne.is-erreur > td:first-child { box-shadow: inset 3px 0 0 #dc2626; }
.reception-ligne.is-avert > td:first-child  { box-shadow: inset 3px 0 0 #ca8a04; }
.reception-ligne-constats td { padding-top: 0; border-top: none; }
.cellule-is-erreur { color: #b91c1c; font-weight: 650; }
.cellule-is-avert  { color: #a16207; }
.reception-annexes { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 16px; margin-top: 12px; }
.reception-fin { margin-top: 18px; }

/* Le chemin entre les étapes : retour à gauche, suite à droite, la raison d'un bouton fermé entre les deux. */
.reception-navigation { justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 16px; }
.reception-navigation .form-hint { flex: 1 1 240px; }
.reception-approbation { margin-top: 10px; font-weight: 600; color: var(--text-primary); }

/* Configuration → Écriture dans Odoo : la liste blanche, par groupe d'opérations. */
.ecriture-groupe { margin: 12px 0 0; padding: 10px 12px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--bg-secondary); }
.ecriture-groupe-tete { display: flex; gap: 12px; align-items: baseline; margin-bottom: 6px; }
.ecriture-operation { align-items: flex-start; margin-top: 6px; }
.ecriture-operation code { font-size: 12.5px; }
.ecriture-operation .tag { margin-left: 6px; }

/* Étape 4 : ce qui a été écrit dans Odoo, geste par geste. */
.reception-application { margin-bottom: 20px; border-color: var(--accent); }
.reception-geste.is-echoue { border-color: #dc2626; box-shadow: inset 3px 0 0 #dc2626; }
.reception-geste.is-saute  { border-style: dashed; opacity: 0.8; }
.reception-geste-titre .tag { margin-left: auto; }
.reception-appels { margin-top: 6px; font-size: 12.5px; }
.reception-appels > summary { cursor: pointer; color: var(--text-secondary); }
.reception-appels-liste { margin: 6px 0 0; padding-left: 20px; display: flex; flex-direction: column; gap: 4px; }
.reception-appels-liste code { font-size: 11.5px; white-space: pre-wrap; word-break: break-all; }

/* ── LES RAPPORTS ────────────────────────────────────────────────────────────
   L'index (une carte par rapport) et la barre d'outils du détail (période, vue,
   sommaire). Ces règles ont d'abord vécu dans RapportDetail.razor.css et
   Rapports.razor.css — c'est-à-dire en CSS SCOPÉ, donc invisibles hors de ces deux
   composants.

   Elles sont ici parce que le registre national a maintenant ses PROPRES rapports
   (/rippa_distri_canada/dealer/rapports), qui reprennent la même forme de résultat et
   le même rendu. Scopées, elles laissaient ces écrans-là sans aucun style : un mur de
   texte à la place des cartes, et des champs de date bruts à la place de la barre
   d'outils. Deux surfaces partagent ce langage visuel ; il appartient donc au
   fichier commun, pas à l'une des deux.
   ──────────────────────────────────────────────────────────────────────────── */

.rapport-liste {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 16px;
}

.rapport-carte {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 20px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    text-decoration: none;
    transition: var(--transition);
}

.rapport-carte:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    border-color: var(--accent);
}

/* La QUESTION passe avant le titre : c'est elle qui dit à quoi sert le rapport. */
.rapport-question {
    font-weight: 600;
    font-size: 11px;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--accent);
}

.rapport-titre {
    font-weight: 600;
    font-size: 17px;
    letter-spacing: -0.01em;
    color: var(--text-primary);
}

.rapport-detail {
    font-size: 13.5px;
    line-height: 1.55;
    color: var(--text-secondary);
}

.rapport-ouvrir {
    margin-top: 6px;
    font-size: 13px;
    font-weight: 500;
    color: var(--accent);
}

/* L'index /rapports en cartes COMPACTES : titre puis question, rien d'autre — la
   description passe au survol. Le portail (EspaceRapports) a ses panneaux par thème, .rp-*. */
.rapport-liste-compacte {
    grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
    gap: 10px;
}
.rapport-liste-compacte .rapport-carte {
    gap: 3px;
    padding: 12px 14px;
}
.rapport-liste-compacte .rapport-carte:hover { transform: translateY(-1px); }
.rapport-liste-compacte .rapport-titre { font-size: 14.5px; }
.rapport-liste-compacte .rapport-question {
    font-size: 12.5px;
    font-weight: 400;
    letter-spacing: 0;
    text-transform: none;
    color: var(--text-muted);
}

/* L'index des rapports du PORTAIL : un panneau par thème, une ligne par rapport. Chaque
   panneau porte sa teinte (--rp-teinte, un jeton existant) : le pictogramme du thème, la
   pastille de chaque ligne et le survol en dérivent, en clair comme en sombre. */
.rp-themes {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 16px;
    align-items: start;
}
.rp-theme {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}
.rp-theme-entete {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 16px;
    border-bottom: 1px solid var(--border-subtle);
    background: color-mix(in srgb, var(--rp-teinte) 7%, transparent);
}
.rp-theme-icone {
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    border-radius: var(--radius-md);
    background: var(--rp-teinte);
    color: #fff;
    flex-shrink: 0;
}
.rp-theme-icone svg { width: 19px; height: 19px; }
.rp-theme-nom {
    margin: 0;
    font-size: 15px;
    font-weight: 650;
    letter-spacing: -0.01em;
    color: var(--text-primary);
}
.rp-theme-compte {
    margin-left: auto;
    min-width: 24px;
    padding: 2px 8px;
    border-radius: var(--radius-full);
    background: color-mix(in srgb, var(--rp-teinte) 14%, transparent);
    color: var(--rp-teinte);
    font-size: 12px;
    font-weight: 600;
    text-align: center;
}
.rp-liste {
    list-style: none;
    margin: 0;
    padding: 6px;
}
.rp-ligne {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px;
    border-radius: var(--radius-md);
    text-decoration: none;
    color: inherit;
    transition: var(--transition);
}
.rp-ligne:hover,
.rp-ligne:focus-visible {
    background: color-mix(in srgb, var(--rp-teinte) 9%, transparent);
}
.rp-ligne-icone {
    display: grid;
    place-items: center;
    width: 32px;
    height: 32px;
    border-radius: var(--radius-sm);
    background: color-mix(in srgb, var(--rp-teinte) 12%, transparent);
    color: var(--rp-teinte);
    flex-shrink: 0;
}
.rp-ligne-icone svg { width: 17px; height: 17px; }
.rp-ligne-texte {
    display: flex;
    flex-direction: column;
    gap: 1px;
    min-width: 0;
    flex: 1;
}
.rp-ligne-titre {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
}
.rp-ligne-question {
    font-size: 12.5px;
    color: var(--text-muted);
}
.rp-ligne-fleche {
    width: 16px;
    height: 16px;
    color: var(--text-muted);
    flex-shrink: 0;
    transition: var(--transition);
}
.rp-ligne:hover .rp-ligne-fleche {
    color: var(--rp-teinte);
    transform: translateX(2px);
}

.rapport-outils {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 10px 16px;
    padding-bottom: 12px;
    margin-bottom: 12px;
    border-bottom: 1px solid var(--border);
}

.rapport-periode {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 10px;
    font-size: 13px;
    color: var(--text-secondary);
}

.rapport-periode-nom {
    font-weight: 600;
    color: var(--text-primary);
}

.rapport-periode label {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.rapport-periode input[type="date"] {
    padding: 5px 8px;
    background: var(--bg-elevated);
    color: var(--text-primary);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font: 500 13px/1 'Inter', system-ui, sans-serif;
    color-scheme: inherit;
}

.rapport-effacer {
    padding: 5px 10px;
    background: transparent;
    color: var(--text-secondary);
    border: 1px dashed var(--border);
    border-radius: var(--radius-sm);
    font: 500 12px/1 'Inter', system-ui, sans-serif;
    cursor: pointer;
    transition: var(--transition);
}

.rapport-effacer:hover { border-color: var(--text-secondary); color: var(--text-primary); }

/* Le sélecteur de vue : deux segments collés, l'actif porte l'accent doux — même langage
   visuel que les onglets de l'entête. */
.rapport-vues {
    display: inline-flex;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    overflow: hidden;
}

.rapport-vue {
    padding: 6px 14px;
    background: var(--bg-elevated);
    color: var(--text-secondary);
    border: none;
    font: 500 13px/1 'Inter', system-ui, sans-serif;
    cursor: pointer;
    transition: var(--transition);
}

.rapport-vue + .rapport-vue { border-left: 1px solid var(--border); }

.rapport-vue.est-active {
    background: var(--accent-soft);
    color: var(--accent);
    font-weight: 600;
}

.rapport-vue:disabled { opacity: 0.45; cursor: not-allowed; }

.rapport-sommaire {
    font-size: 13.5px;
    color: var(--text-secondary);
    margin-bottom: 14px;
}

/* Un rapport indisponible se signale sans crier : le texte porte l'information, la couleur
   ne fait que la confirmer. */
.rapport-sommaire.est-erreur {
    color: var(--status-danger);
    font-weight: 500;
}

/* ── PDI à préparer (/preparation) et la télé d'atelier (/preparation/tv) ──────
   Le rendu de la file vit dans PdiAffichage.razor.css ; ici, seulement l'enveloppe. */
.prep-actions-entete {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: flex-end;
}
/* Le sous-menu de l'onglet « Opérations » (File des PDI · Dashboard - Atelier · Logistique d'opération…) :
   des segments collés, l'actif porte l'accent doux — le même langage que le sélecteur de vue des rapports.
   Sur un téléphone, il défile de côté plutôt que d'élargir la page. */
.sous-menu {
    display: inline-flex;
    align-self: flex-start;
    width: fit-content;
    max-width: 100%;
    margin: 0 0 16px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: none;
}
.sous-menu-lien {
    flex: none;
    white-space: nowrap;
    padding: 7px 16px;
    background: var(--bg-elevated);
    color: var(--text-secondary);
    font: 500 13.5px/1 'Inter', system-ui, sans-serif;
    text-decoration: none;
    transition: var(--transition);
}
.sous-menu-lien + .sous-menu-lien { border-left: 1px solid var(--border); }
.sous-menu-lien:hover { color: var(--text-primary); }
.sous-menu-lien.est-actif { background: var(--accent-soft); color: var(--accent); font-weight: 600; }

/* Le formulaire de l'objectif hebdomadaire, au-dessus du tableau de score. */
.atelier-objectif {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 12px 20px;
    margin: 0 0 16px;
    padding: 14px 16px;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius-md, 10px);
}
.atelier-objectif-champ { display: flex; flex-direction: column; gap: 6px; font-size: 13px; font-weight: 600; color: var(--text-secondary); }
.atelier-objectif-champ .input { width: 120px; }
.atelier-objectif-note { margin: 0; font-size: 12.5px; color: var(--text-muted); flex-basis: 100%; }
.atelier-objectif-erreur { color: var(--status-danger); font-weight: 500; }
.atelier-objectif-ok { color: var(--status-success); font-weight: 600; }

/* L'apparence de la télé : treize designs en vignettes, puis la phrase de l'équipe. Chaque
   vignette est un dessin réduit du tableau (bandeau, chiffre, piste, cartes, barres) dans les
   couleurs de son design — mêmes teintes que AtelierAffichage.razor.css. */
.atelier-apparence { margin: 0 0 16px; }
.atelier-apparence .atelier-objectif { margin: 12px 0 0; }
.atelier-apparence-titre { margin: 0 0 10px; font-size: 15px; font-weight: 700; color: var(--text-primary); }
.atelier-designs { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px; }
.atelier-design {
    display: flex; flex-direction: column; gap: 6px; padding: 10px; text-align: left;
    font: inherit; color: var(--text-primary); cursor: pointer;
    background: var(--bg-elevated); border: 2px solid var(--border); border-radius: var(--radius-md, 10px);
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.atelier-design:hover { border-color: var(--accent); }
.atelier-design.est-choisi { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.atelier-design-nom { font-weight: 700; font-size: 14px; }
.atelier-design-description { font-size: 12.5px; color: var(--text-muted); line-height: 1.35; }
.atelier-phrase-champ { flex: 1 1 360px; }
.atelier-phrase-champ .input { width: 100%; }

.atelier-design-apercu {
    --ap-fond: #050b1a; --ap-carte: #0f1f45; --ap-trait: rgba(63, 169, 255, 0.3); --ap-encre: #fff;
    --ap-accent: #3fa9ff; --ap-barre: #2366d1; --ap-bandeau: transparent;
    position: relative; display: grid; grid-template-columns: 1.3fr 1fr; grid-template-rows: 14px 1fr 34px; gap: 5px;
    height: 112px; padding: 7px; border-radius: 6px; overflow: hidden; background: var(--ap-fond);
}
.atelier-design-apercu > span { border-radius: 3px; }
.ap-bandeau { grid-column: 1 / -1; background: var(--ap-bandeau); border-bottom: 2px solid var(--ap-trait); }
.ap-score, .ap-cartes > span, .ap-barres { background: var(--ap-carte); border: 1px solid var(--ap-trait); }
.ap-score { display: flex; flex-direction: column; justify-content: center; gap: 5px; padding: 4px 6px; }
.ap-chiffre { font-size: 22px; font-weight: 900; line-height: 1; color: var(--ap-encre); }
.ap-piste { height: 5px; border-radius: 3px; background: rgba(127, 147, 184, 0.3); }
.ap-piste > span { display: block; width: 62%; height: 100%; border-radius: 3px; background: var(--ap-accent); }
.ap-cartes { display: grid; gap: 5px; }
.ap-barres { grid-column: 1 / -1; display: flex; align-items: flex-end; gap: 6px; padding: 3px 8px 0; }
.ap-barres > span { flex: 1; background: var(--ap-barre); border-radius: 2px 2px 0 0; }
.ap-barres > span:last-child { background: var(--ap-accent); }

.atelier-apercu-jour {
    --ap-fond: #eef3fb; --ap-carte: #fff; --ap-trait: #d5e1f2; --ap-encre: #152c78;
    --ap-accent: #2f8cff; --ap-barre: #1f3d73; --ap-bandeau: linear-gradient(110deg, #152c78, #0a4f8f);
}
.atelier-apercu-plan {
    --ap-fond:
        linear-gradient(rgba(255,255,255,.12) 1px, transparent 1px) 0 0 / 10px 10px,
        linear-gradient(90deg, rgba(255,255,255,.12) 1px, transparent 1px) 0 0 / 10px 10px, #0a4f8f;
    --ap-carte: rgba(6, 40, 92, 0.35); --ap-trait: rgba(255, 255, 255, 0.7); --ap-encre: #fff;
    --ap-accent: #9fe1ff; --ap-barre: rgba(255, 255, 255, 0.9);
    font-family: ui-monospace, Consolas, monospace;
}
.atelier-apercu-plan .ap-score, .atelier-apercu-plan .ap-cartes > span, .atelier-apercu-plan .ap-barres { border-style: dashed; border-radius: 1px; }
.atelier-apercu-arena {
    --ap-fond: linear-gradient(90deg, transparent 0 22%, #2f7bff 22% 24%, transparent 24% 49%, #ff2e48 49% 51%, transparent 51% 76%, #2f7bff 76% 78%, transparent 78%) top / 100% 3px no-repeat, #0b1322;
    --ap-carte: #05070d; --ap-trait: #3c4d70; --ap-encre: #bfeaff; --ap-accent: #6fd3ff; --ap-barre: #2f7bff;
}
.atelier-apercu-arena .ap-chiffre { font-family: "Courier New", monospace; text-shadow: 0 0 8px rgba(111, 211, 255, 0.8); }
.atelier-apercu-arena .ap-cartes > span:first-child { box-shadow: inset 0 -3px 0 #ff2e48; }
.atelier-apercu-halloween {
    --ap-fond: radial-gradient(circle at 88% 14%, #fff6d8 0 6%, rgba(255, 236, 180, 0.3) 7%, transparent 14%), linear-gradient(180deg, #2a1048, #0b0414);
    --ap-carte: rgba(58, 22, 92, 0.85); --ap-trait: rgba(74, 168, 255, 0.45); --ap-encre: #ffb347;
    --ap-accent: #8dff5a; --ap-barre: #2f7bff;
}
.atelier-apercu-halloween .ap-chiffre { text-shadow: 0 0 8px rgba(255, 138, 31, 0.9); }
.atelier-apercu-halloween .ap-barres > span:nth-child(even):not(:last-child) { background: #ff8a1f; }
.atelier-apercu-halloween .ap-bandeau::before { content: "🎃"; font-size: 10px; line-height: 12px; }
.atelier-apercu-noel {
    --ap-fond:
        radial-gradient(circle at 20% 30%, #fff 0 1px, transparent 1.6px) 0 0 / 22px 22px,
        radial-gradient(circle at 70% 70%, rgba(255,255,255,.8) 0 1.2px, transparent 1.8px) 0 0 / 30px 30px,
        linear-gradient(180deg, #0f2560, #050f2a);
    --ap-carte: rgba(28, 62, 128, 0.85); --ap-trait: rgba(201, 220, 245, 0.45); --ap-encre: #fffaf0;
    --ap-accent: #3ddc84; --ap-barre: #2f7bff;
}
.atelier-apercu-noel .ap-chiffre { text-shadow: 0 0 8px rgba(255, 215, 106, 0.9); }
.atelier-apercu-noel .ap-piste > span { background: repeating-linear-gradient(135deg, #e3263a 0 4px, #fff 4px 8px); }
.atelier-apercu-noel .ap-barres > span:nth-child(even):not(:last-child) { background: #e3263a; }
.atelier-apercu-noel .ap-bandeau::before { content: "🎄"; font-size: 10px; line-height: 12px; }
.atelier-apercu-tempete {
    --ap-fond:
        repeating-linear-gradient(166deg, transparent 0 9px, rgba(255, 255, 255, 0.32) 9px 10px, transparent 10px 23px),
        linear-gradient(180deg, #1c2b40, #080e18);
    --ap-carte: rgba(40, 64, 96, 0.85); --ap-trait: rgba(191, 239, 255, 0.5); --ap-encre: #ffffff;
    --ap-accent: #e8fbff; --ap-barre: #2f7bff;
}
.atelier-apercu-tempete .ap-chiffre { text-shadow: 0 0 8px rgba(191, 239, 255, 0.9); }
.atelier-apercu-tempete .ap-piste > span { background: linear-gradient(90deg, #2f7bff, #7fdcff); }
.atelier-apercu-tempete .ap-barres > span:nth-child(even):not(:last-child) { background: #7fdcff; }
.atelier-apercu-tempete .ap-bandeau::before { content: "❄️"; font-size: 10px; line-height: 12px; }
.atelier-apercu-valentin {
    --ap-fond:
        radial-gradient(circle at 30% 40%, rgba(255, 77, 141, 0.55) 0 1.6px, transparent 2.2px) 0 0 / 24px 24px,
        radial-gradient(900px 300px at 100% 110%, rgba(255, 77, 141, 0.3), transparent 70%),
        linear-gradient(180deg, #1a1446, #0b0a24);
    --ap-carte: rgba(52, 38, 120, 0.85); --ap-trait: rgba(255, 122, 168, 0.45); --ap-encre: #fff5f9;
    --ap-accent: #ffc2d9; --ap-barre: #2f7bff;
}
.atelier-apercu-valentin .ap-chiffre { text-shadow: 0 0 8px rgba(255, 122, 168, 0.9); }
.atelier-apercu-valentin .ap-piste > span { background: linear-gradient(90deg, #2f5bd9, #ff4d8d); }
.atelier-apercu-valentin .ap-barres > span:nth-child(even):not(:last-child) { background: #ff4d8d; }
.atelier-apercu-valentin .ap-bandeau::before { content: "💘"; font-size: 10px; line-height: 12px; }
.atelier-apercu-printemps {
    --ap-fond:
        radial-gradient(ellipse 3px 1.8px at 30% 40%, #f9a8d4 0 60%, transparent 100%) 0 0 / 26px 26px,
        linear-gradient(180deg, transparent 86%, #5cb85c 86%),
        linear-gradient(180deg, #cfe9ff, #effaeb);
    --ap-carte: #ffffff; --ap-trait: #d4e5ee; --ap-encre: #152c78;
    --ap-accent: #f472b6; --ap-barre: #1f5fd1;
}
.atelier-apercu-printemps .ap-piste > span { background: linear-gradient(90deg, #1f5fd1, #5cc46e); }
.atelier-apercu-printemps .ap-barres > span:nth-child(even):not(:last-child) { background: #3aa655; }
.atelier-apercu-printemps .ap-bandeau::before { content: "🌷"; font-size: 10px; line-height: 12px; }
.atelier-apercu-ete {
    --ap-fond:
        radial-gradient(circle at 94% 6%, #fffbea 0 7%, rgba(255, 214, 120, 0.5) 9%, transparent 22%),
        linear-gradient(180deg, transparent 82%, #1fa6c9 82% 90%, #f2dcaa 90%),
        linear-gradient(180deg, #5fb7ec, #d7f1fb);
    --ap-carte: rgba(255, 255, 255, 0.92); --ap-trait: #cfe8f2; --ap-encre: #0b3a75;
    --ap-accent: #ff6b6b; --ap-barre: #1f5fd1;
}
.atelier-apercu-ete .ap-piste > span { background: linear-gradient(90deg, #1f5fd1, #2dd4bf); }
.atelier-apercu-ete .ap-barres > span:nth-child(even):not(:last-child) { background: #14b8b0; }
.atelier-apercu-ete .ap-bandeau::before { content: "🏖️"; font-size: 10px; line-height: 12px; }
.atelier-apercu-paques {
    --ap-fond:
        radial-gradient(ellipse 3px 4px at 30% 40%, #c4b5fd 0 70%, transparent 100%) 0 0 / 28px 28px,
        radial-gradient(ellipse 3px 4px at 70% 75%, #fbcfe8 0 70%, transparent 100%) 0 0 / 34px 34px,
        linear-gradient(180deg, transparent 86%, #86dca0 86%),
        linear-gradient(180deg, #e9e0ff, #e8f9f0);
    --ap-carte: #ffffff; --ap-trait: #e2d9f7; --ap-encre: #1e1b4b;
    --ap-accent: #ec4899; --ap-barre: #1f5fd1;
}
.atelier-apercu-paques .ap-piste > span { background: repeating-linear-gradient(135deg, #1f5fd1 0 4px, #8b5cf6 4px 8px); }
.atelier-apercu-paques .ap-barres > span:nth-child(even):not(:last-child) { background: #8b5cf6; }
.atelier-apercu-paques .ap-bandeau::before { content: "🐣"; font-size: 10px; line-height: 12px; }
.atelier-apercu-stjean {
    --ap-fond:
        radial-gradient(circle at 78% 18%, rgba(255, 255, 255, 0.9) 0 1.5px, rgba(124, 196, 255, 0.55) 2.5px, transparent 11px),
        radial-gradient(circle at 18% 64%, rgba(124, 196, 255, 0.8) 0 1.5px, rgba(255, 255, 255, 0.4) 2.5px, transparent 9px),
        linear-gradient(90deg, #1f5fd1 0 12%, #fff 12% 24%, #1f5fd1 24% 36%, #fff 36% 48%, #1f5fd1 48% 60%, #fff 60% 72%, #1f5fd1 72% 84%, #fff 84%) top / 100% 3px no-repeat,
        linear-gradient(90deg, transparent calc(50% - 6px), #fff calc(50% - 6px) calc(50% + 6px), transparent calc(50% + 6px)),
        linear-gradient(180deg, transparent calc(50% - 6px), #fff calc(50% - 6px) calc(50% + 6px), transparent calc(50% + 6px)),
        #003da5;
    --ap-carte: rgba(8, 38, 112, 0.86); --ap-trait: rgba(244, 248, 255, 0.4); --ap-encre: #ffffff;
    --ap-accent: #7cc4ff; --ap-barre: #2f7bff;
}
.atelier-apercu-stjean .ap-chiffre { text-shadow: 0 0 8px rgba(124, 196, 255, 0.9); }
.atelier-apercu-stjean .ap-piste > span { background: repeating-linear-gradient(135deg, #2f7bff 0 4px, #f4f8ff 4px 8px); }
.atelier-apercu-stjean .ap-barres > span:nth-child(even):not(:last-child) { background: #f4f8ff; }
.atelier-apercu-stjean .ap-bandeau::before { content: "⚜️"; font-size: 10px; line-height: 12px; }
.atelier-apercu-nouvelanchinois {
    --ap-fond:
        radial-gradient(ellipse 5px 4px at 15% 7px, #e02a2a 0 80%, transparent 100%),
        radial-gradient(ellipse 5px 4px at 50% 7px, #e02a2a 0 80%, transparent 100%),
        radial-gradient(ellipse 5px 4px at 85% 7px, #e02a2a 0 80%, transparent 100%),
        radial-gradient(circle at 70% 60%, rgba(245, 194, 66, 0.8) 0 1px, transparent 1.6px) 0 0 / 26px 26px,
        linear-gradient(180deg, #4a0b16, #1f0409);
    --ap-carte: rgba(120, 18, 32, 0.8); --ap-trait: rgba(245, 194, 66, 0.45); --ap-encre: #fff8ec;
    --ap-accent: #f5c242; --ap-barre: #2f7bff;
}
.atelier-apercu-nouvelanchinois .ap-chiffre { text-shadow: 0 0 8px rgba(245, 194, 66, 0.85); }
.atelier-apercu-nouvelanchinois .ap-piste > span { background: linear-gradient(90deg, #2f7bff, #e02a2a); }
.atelier-apercu-nouvelanchinois .ap-barres > span:nth-child(even):not(:last-child) { background: #e02a2a; }
.atelier-apercu-nouvelanchinois .ap-bandeau::before { content: "🏮"; font-size: 10px; line-height: 12px; }

/* La télé n'a ni entête ni feuille : la file occupe tout l'écran, sur fond blanc. */
.tele-shell {
    min-height: 100vh;
    background: #fff;
}
/* Le clip qui garde la télé éveillée (TeleLayout) : en lecture, plein écran — Chromium ne
   garde l'écran allumé que pour une vidéo visible et assez grande ; un clip de 2 px ne compte
   pas —, mais SOUS la page : le z-index négatif le peint avant le fond opaque de .tele-shell,
   qui le recouvre. Jamais sous un clic. Pas d'opacity: 0 ni de display: none, qu'un navigateur
   peut lire comme « rien ne joue ». */
.tele-eveil {
    position: fixed;
    inset: 0;
    width: 100vw;
    height: 100vh;
    object-fit: cover;
    z-index: -1;
    pointer-events: none;
}
/* L'intermède (TeleLayout) : plein écran PAR-DESSUS tout pendant ses 4 s, invisible le reste
   du temps. Le fond bleu de marque couvre le temps que la première image arrive. */
.tele-entracte {
    position: fixed;
    inset: 0;
    width: 100vw;
    height: 100vh;
    object-fit: cover;
    z-index: 2147483000;
    background: #152c78;
    visibility: hidden;
    pointer-events: none;
}
.tele-entracte.est-visible { visibility: visible; }
.tele-chargement {
    margin: 0;
    padding: 4vw;
    font-size: 2vw;
    color: #334155;
}

/* ═══════════════════════════════════════════════════════════════════════════
   Usagers & accès — les pièces communes (Configuration → Usagers, Rôles, Accès
   par rôle ; administration des concessionnaires). Le même contrat vivra dans
   Chronos, CamRack et le kit : seuls les jetons changent d'une app à l'autre.

   Ces classes vivaient dans le CSS ISOLÉ de Configuration.razor, qui n'atteint
   pas les composants enfants (GestionUtilisateurs, GestionRoles, AccesParRole) :
   leurs tableaux et leurs titres s'affichaient sans style. Globales ici.
   ═══════════════════════════════════════════════════════════════════════════ */
.section-titre {
    font-weight: 600;
    font-size: 17px;
    letter-spacing: -0.01em;
    color: var(--text-primary);
    margin-bottom: 12px;
}
.sous-titre {
    font-weight: 600;
    font-size: 14px;
    color: var(--text-primary);
    margin: 16px 0 8px;
}
.etat-texte {
    font-size: 13.5px;
    line-height: 1.6;
    color: var(--text-secondary);
}
.integration-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13.5px;
}
.integration-table th {
    text-align: left;
    font-weight: 500;
    font-size: 11px;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--text-muted);
    padding: 8px 12px;
    border-bottom: 1px solid var(--border);
}
.integration-table td {
    padding: 8px 12px;
    border-bottom: 1px solid var(--border-subtle);
    color: var(--text-secondary);
    vertical-align: top;
}
.integration-table code,
.etat-texte code {
    font-family: 'JetBrains Mono', ui-monospace, monospace;
    font-size: 12px;
    background: var(--bg-tertiary);
    border-radius: 4px;
    padding: 1px 5px;
    color: var(--text-primary);
}

/* Libellés et textes discrets — bornés aux écrans d'accès, pour ne rien changer ailleurs. */
.acces-ecran .field-label {
    display: block;
    font-size: 12px;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 6px;
}
.acces-ecran .text-muted { color: var(--text-muted); font-size: 12.5px; }
.acces-ecran .champ + .champ { margin-top: 12px; }
.acces-ecran .actions-ligne { display: flex; flex-wrap: wrap; gap: 6px; }
/* Mon équipe : les gestes d'une ligne passent à la ligne plutôt que de déborder de la carte. */
.equipe-actions { display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end; }

/* Boutons : la petite taille des lignes de tableau, et le rouge des gestes destructifs. */
.btn-sm { padding: 6px 12px; font-size: 12.5px; }
.btn-primary.btn-danger { background: var(--status-danger); }
.btn-primary.btn-danger:hover { box-shadow: 0 6px 14px rgba(239, 68, 68, 0.3), 0 2px 4px rgba(0, 0, 0, 0.06); }
.btn-secondary.btn-danger { color: var(--status-danger); }
.btn-secondary.btn-danger:hover { border-color: var(--status-danger); color: var(--status-danger); }

/* Pastilles d'état d'un compte (EtatCompte). */
.etat-compte { display: inline-flex; flex-wrap: wrap; gap: 4px; }

/* Modale de confirmation — STYLE_GUIDE §5.22. */
.modal-backdrop {
    position: fixed; inset: 0;
    background: rgba(15, 23, 42, 0.45);
    display: flex;
    align-items: center; justify-content: center;
    z-index: 1000;
    animation: modal-backdrop-in 0.18s ease-out;
}
@keyframes modal-backdrop-in { from { opacity: 0; } to { opacity: 1; } }
.modal-card {
    width: 460px;
    max-width: calc(100vw - 32px);
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 22px 24px 18px;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.22), 0 4px 12px rgba(0, 0, 0, 0.08);
    animation: modal-card-in 0.22s cubic-bezier(0.4, 0, 0.2, 1);
}
.modal-card:focus { outline: none; }
@keyframes modal-card-in {
    from { opacity: 0; transform: scale(0.96) translateY(10px); }
    to   { opacity: 1; transform: scale(1) translateY(0); }
}
.modal-title { margin: 0 0 10px; font-weight: 600; font-size: 17px; line-height: 1.3; font-family: inherit; letter-spacing: -0.01em; color: var(--text-primary); }
.modal-body  { margin: 0 0 22px; font-size: 14px; line-height: 1.55; color: var(--text-secondary); }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; }

/* Tiroir latéral — STYLE_GUIDE §5.23. Pleine largeur sur un téléphone. */
.tiroir-fond {
    position: fixed; inset: 0;
    background: rgba(20, 22, 30, 0.45);
    z-index: 900;
    animation: modal-backdrop-in 0.18s ease-out;
}
.tiroir {
    position: fixed; top: 0; right: 0; bottom: 0;
    width: min(560px, 100vw);
    display: flex; flex-direction: column;
    background: var(--bg-elevated);
    color: var(--text-primary);
    box-shadow: var(--shadow-lg), -12px 0 40px rgba(0, 0, 0, 0.12);
    z-index: 910;
    animation: tiroir-entree 0.28s cubic-bezier(0.4, 0, 0.2, 1);
}
.tiroir.tiroir-large { width: min(1180px, 100vw); }
.tiroir:focus { outline: none; }
@keyframes tiroir-entree { from { transform: translateX(100%); } to { transform: translateX(0); } }
.tiroir-tete {
    display: flex; align-items: flex-start; justify-content: space-between; gap: 12px;
    padding: 20px 24px 14px;
    border-bottom: 1px solid var(--border-subtle);
}
.tiroir-titre { margin: 0; font-weight: 600; font-size: 17px; letter-spacing: -0.01em; color: var(--text-primary); }
.tiroir-sous-titre { margin: 4px 0 0; font-size: 13px; color: var(--text-muted); }
.tiroir-fermer {
    border: 0; background: none; cursor: pointer;
    color: var(--text-muted); font-size: 16px; line-height: 1;
    padding: 6px; border-radius: var(--radius-sm);
}
.tiroir-fermer:hover { color: var(--text-primary); background: var(--bg-tertiary); }
.tiroir-corps { flex: 1; overflow-y: auto; padding: 18px 24px; }
.tiroir-pied {
    display: flex; justify-content: flex-end; gap: 8px;
    padding: 14px 24px;
    border-top: 1px solid var(--border-subtle);
}
@media (prefers-reduced-motion: reduce) {
    .tiroir, .tiroir-fond, .modal-card, .modal-backdrop { animation: none; }
}

/* Choix de rôles dans le tiroir : une case, le nom, et ce que le rôle ouvre. */
.choix-role {
    display: flex; gap: 10px; align-items: flex-start;
    padding: 10px 12px;
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    cursor: pointer;
}
.choix-role + .choix-role { margin-top: 6px; }
.choix-role:hover { border-color: var(--border); }
.choix-role input { margin-top: 3px; accent-color: var(--accent); }
.choix-role-nom { font-weight: 500; font-size: 13.5px; color: var(--text-primary); }
.choix-role-quoi {
    display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; line-clamp: 3; overflow: hidden;
    font-size: 12.5px; color: var(--text-muted);
}

/* Le mot de passe généré, montré une fois (RevelationSecret). */
.revelation-secret { display: flex; flex-direction: column; gap: 8px; align-items: flex-start; scroll-margin-top: 80px; }
.revelation-secret:focus { outline: 2px solid var(--accent); outline-offset: 2px; }
.revelation-tete { display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; }
.revelation-tete .text-muted { color: var(--text-muted); font-size: 12px; }
.revelation-valeur { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.revelation-code {
    display: inline-block;
    padding: 6px 10px;
    font-family: 'JetBrains Mono', ui-monospace, monospace;
    font-size: 15px;
    color: var(--text-primary);
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    user-select: all;
    overflow-wrap: anywhere;
}
.revelation-consigne { margin: 0; font-size: 12.5px; line-height: 1.5; color: var(--text-secondary); }

/* Les onglets de la configuration sont des LIENS (une adresse par onglet) : même allure que
   les anciens boutons. */
a.config-nav-item { display: block; text-decoration: none; }

/* DataTable : une ligne qui ouvre quelque chose (OnRowClick). */
.data-table tbody tr.ligne-cliquable { cursor: pointer; }
.data-table tbody tr.ligne-selectionnee td { background: var(--accent-soft); }

/* Usagers : l'entête de la liste (titre + « Nouvel usager »), les filtres rapides. */
.entete-liste { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.entete-liste .section-titre { margin-bottom: 0; }
.filtres-acces { display: flex; flex-wrap: wrap; gap: 6px; margin: 14px 0 12px; }
.lien-compte { font-size: 13.5px; font-weight: 600; font-family: 'JetBrains Mono', ui-monospace, monospace; }
.lien-registre { display: block; margin-top: 4px; font-size: 12px; color: var(--accent); }

/* La fiche d'un usager, dans le tiroir : quatre sections dans le même ordre partout. */
.fiche-section + .fiche-section { margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--border-subtle); }
.fiche-titre {
    margin: 0 0 10px;
    font-size: 12px; font-weight: 600; letter-spacing: 0.05em; text-transform: uppercase;
    color: var(--text-muted);
}
.fiche-dl { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; margin: 0 0 12px; font-size: 13.5px; }
.fiche-dl dt { color: var(--text-muted); }
.fiche-dl dd { margin: 0; color: var(--text-primary); overflow-wrap: anywhere; }
.fiche-dl code { font-family: 'JetBrains Mono', ui-monospace, monospace; font-size: 12.5px; }
.fiche-etat { margin-bottom: 10px; }
.fiche-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.fiche-actions a.btn-secondary { text-decoration: none; }
.champ-ligne { display: flex; gap: 8px; align-items: center; }
.champ-ligne .input { flex: 1; min-width: 0; }
.fiche-historique { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; font-size: 12.5px; color: var(--text-secondary); }
.fiche-historique li { display: flex; flex-wrap: wrap; gap: 6px; align-items: baseline; }
.fiche-historique .mono { font-family: 'JetBrains Mono', ui-monospace, monospace; font-size: 11.5px; color: var(--text-muted); }
@media (max-width: 480px) {
    .fiche-dl { grid-template-columns: 1fr; gap: 2px; }
    .fiche-dl dd { margin-bottom: 8px; }
}

/* Création : les sortes de compte en cartes cliquables. */
.choix-sorte { display: grid; gap: 8px; }
.choix-sorte-carte {
    display: flex; flex-direction: column; gap: 4px; text-align: left;
    padding: 12px 14px;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font: inherit; font-size: 13.5px; color: var(--text-primary);
    cursor: pointer;
    transition: border-color 0.12s ease, background-color 0.12s ease;
}
.choix-sorte-carte:hover, .choix-sorte-carte:focus-visible { border-color: var(--accent); background: var(--accent-soft); }
.choix-sorte-carte .text-muted { font-size: 12.5px; }

/* La liste des usagers garde le tableau de l'app (centré, sans retour à la ligne), sauf deux
   colonnes : l'identifiant, qu'on lit à gauche, et dont la description tient en deux lignes ;
   les rôles, qui passent à la ligne plutôt que de pousser l'état hors de l'écran. */
.data-table td.cellule-compte { text-align: left; white-space: normal; min-width: 180px; max-width: 320px; }
.data-table td.cellule-compte .description-compte {
    display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; overflow: hidden;
    font-size: 12.5px;
}
.data-table td.cellule-roles { white-space: normal; max-width: 240px; }
.data-table td.cellule-texte { text-align: left; white-space: normal; min-width: 280px; }

/* ── Fil de retour des sous-pages de « Mon compte » (/compte/mot-de-passe, /compte/double-authentification) ── */
.fil-retour {
    display: inline-block;
    margin-bottom: 6px;
    font-size: 0.8125rem;
    color: var(--accent);
    text-decoration: none;
}
.fil-retour:hover { text-decoration: underline; }

/* La matrice « Accès par rôle » (Configuration → Accès et /securite) : une colonne par rôle.
   Au-delà de la largeur de la feuille, elle défile DANS son cadre au lieu d'élargir la page. */
.acces-defilement { overflow-x: auto; }

/* ═══════════════════════════════════════════════════════════════════════════
   GUIDES (Distribution Canada → Documents) — les cartes de l'onglet Documents, la page d'un guide
   (/documents/guides/{clé}) et la référence du catalogue de pièces. Global plutôt qu'isolé :
   les trois écrans partagent l'en-tête, les tuiles et les badges, et les pictogrammes viennent
   d'un composant (IconeGuide) que le CSS isolé d'une page n'atteindrait pas. Préfixe gd-.
   Une seule surface en dégradé par écran : la tuile d'icône de l'en-tête (ou le bandeau final).
   ═══════════════════════════════════════════════════════════════════════════ */

.gd-surtitre {
    font-size: 11px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase;
    color: var(--accent);
}
.gd-texte { margin: 0 0 10px; line-height: 1.6; color: var(--text-secondary); }
.gd-texte:last-child { margin-bottom: 0; }

/* ── Fil d'Ariane ── */
.gd-fil { display: flex; align-items: center; gap: 8px; margin: 2px 0 14px; font-size: 13px; color: var(--text-muted); }
.gd-fil a { color: var(--accent); text-decoration: none; font-weight: 500; }
.gd-fil a:hover { text-decoration: underline; }

/* ── L'en-tête : tuile en dégradé, sur-titre, titre, résumé, méta, actions ── */
.gd-hero {
    display: flex; gap: 24px; align-items: flex-start;
    padding: 30px 32px;
    background-color: var(--bg-secondary);
    background-image: var(--accent-wash);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-sm);
    margin-bottom: 28px;
}
.gd-hero-icone {
    flex: 0 0 auto; display: grid; place-items: center;
    width: 68px; height: 68px; border-radius: 20px;
    background: var(--accent-gradient); color: #fff;
    box-shadow: var(--shadow-glow);
}
.gd-hero-icone svg { width: 36px; height: 36px; }
.gd-hero-texte { min-width: 0; display: flex; flex-direction: column; gap: 8px; }
.gd-hero-titre { margin: 0; font-size: 30px; line-height: 1.2; font-weight: 700; letter-spacing: -0.02em; color: var(--text-primary); }
.gd-hero-resume { margin: 0; max-width: 680px; font-size: 15.5px; line-height: 1.6; color: var(--text-secondary); }
.gd-meta { display: flex; flex-wrap: wrap; gap: 8px; list-style: none; margin: 6px 0 0; padding: 0; }
.gd-meta li {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 5px 12px; border-radius: var(--radius-full);
    background: var(--bg-elevated); border: 1px solid var(--border-subtle);
    font-size: 12.5px; font-weight: 500; color: var(--text-secondary);
}
.gd-meta svg { width: 15px; height: 15px; color: var(--accent); }
.gd-meta a { display: inline-flex; align-items: center; gap: 6px; color: inherit; text-decoration: none; }
.gd-meta a:hover { color: var(--accent); }
.gd-hero-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 10px; }
.gd-hero-actions .btn-primary, .gd-hero-actions .btn-secondary { display: inline-flex; align-items: center; gap: 8px; }
.gd-icone-externe { width: 14px; height: 14px; }

/* ── La vidéo, en tête du guide : le lecteur, et à côté ce qu'elle montre et ses chapitres ── */
.gd-video {
    display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 28px; align-items: start;
    padding: 20px; margin-bottom: 28px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-sm);
    scroll-margin-top: 16px;
}
.gd-video-cadre { border-radius: var(--radius-lg); overflow: hidden; background: #081026; aspect-ratio: 16 / 9; }
.gd-video-cadre video { display: block; width: 100%; height: 100%; }
.gd-video-cote { display: flex; flex-direction: column; gap: 8px; padding-top: 4px; }
.gd-video-titre { margin: 0; font-size: 20px; font-weight: 700; letter-spacing: -0.01em; color: var(--text-primary); }
.gd-video-texte { margin: 0 0 6px; font-size: 14px; line-height: 1.55; color: var(--text-secondary); }
.gd-chapitres { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.gd-chapitre {
    display: flex; align-items: baseline; gap: 10px; width: 100%;
    padding: 6px 10px; border: 0; border-radius: var(--radius-md);
    background: transparent; cursor: pointer; text-align: left;
    font: inherit; font-size: 13.5px; color: var(--text-secondary);
}
.gd-chapitre:hover, .gd-chapitre:focus-visible { background: var(--bg-elevated); color: var(--accent); }
.gd-video-autre { display: inline-flex; align-items: center; gap: 6px; margin: 0 0 8px; font-size: 13.5px; }
.gd-video-autre svg { width: 15px; height: 15px; }
.gd-chapitre-temps { flex: 0 0 38px; font-variant-numeric: tabular-nums; font-weight: 600; color: var(--accent); }
@media (max-width: 960px) {
    .gd-video { grid-template-columns: minmax(0, 1fr); gap: 18px; padding: 14px; }
}

/* ── Le corps d'un guide : sommaire collant + contenu ── */
.gd-corps { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 36px; align-items: start; }
.gd-sommaire { position: sticky; top: 16px; padding: 4px 0; }
.gd-sommaire-titre { margin: 0 0 10px; font-size: 11px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--text-muted); }
.gd-sommaire ol { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.gd-sommaire a {
    display: flex; align-items: center; gap: 10px;
    padding: 7px 10px; border-radius: var(--radius-sm);
    font-size: 13.5px; line-height: 1.35; color: var(--text-secondary); text-decoration: none;
    transition: background-color var(--transition), color var(--transition);
}
.gd-sommaire a:hover { background: var(--accent-soft); color: var(--text-primary); }
.gd-sommaire-num {
    flex: 0 0 auto; display: grid; place-items: center;
    width: 22px; height: 22px; border-radius: var(--radius-full);
    font-size: 11.5px; font-weight: 700; color: var(--text-muted);
    border: 1.5px solid var(--border);
}
.gd-sommaire-num:empty { width: 8px; height: 8px; margin: 0 7px; background: var(--border); border: 0; }
.gd-sommaire-num.est-etape { color: var(--accent); border-color: var(--accent); }
.gd-sommaire-groupe { margin: 12px 0 4px; padding: 0 10px; font-size: 11px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--text-muted); }
.gd-sommaire-maj { margin: 16px 0 0; padding: 0 10px; font-size: 12px; color: var(--text-muted); }

.gd-contenu { min-width: 0; display: flex; flex-direction: column; }
.gd-contenu > section { scroll-margin-top: 20px; }

/* ── La préparation : une liste à cocher avec sa barre de progression ── */
.gd-bloc {
    padding: 22px 24px; margin-bottom: 28px;
    background: var(--bg-elevated); border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg); box-shadow: var(--shadow-sm);
}
.gd-bloc-entete { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 8px; }
.gd-bloc-titre { margin: 0; font-size: 19px; font-weight: 650; letter-spacing: -0.01em; color: var(--text-primary); }
.gd-progression-texte { font-size: 12.5px; font-weight: 600; color: var(--accent); }
.gd-barre { height: 6px; margin: 14px 0 12px; border-radius: var(--radius-full); background: var(--bg-tertiary); overflow: hidden; }
.gd-barre span { display: block; height: 100%; border-radius: inherit; background: var(--accent-gradient); transition: width 300ms cubic-bezier(0.4, 0, 0.2, 1); }

.gd-controle { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.gd-controle-ligne {
    display: flex; align-items: center; gap: 12px;
    padding: 10px 12px; border-radius: var(--radius-md);
    border: 1px solid var(--border-subtle); background: var(--bg-secondary);
    cursor: pointer;
    transition: background-color var(--transition), border-color var(--transition);
}
.gd-controle-ligne:hover { border-color: var(--border); background: var(--bg-glass-hover); }
.gd-controle-ligne input {
    appearance: none; -webkit-appearance: none; flex: 0 0 auto; margin: 0;
    width: 20px; height: 20px; border-radius: 6px;
    border: 2px solid var(--border); background: var(--bg-elevated);
    display: grid; place-items: center; cursor: pointer;
    transition: background-color var(--transition), border-color var(--transition);
}
.gd-controle-ligne input:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.gd-controle-ligne input:checked {
    border-color: transparent; background: var(--accent-gradient);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m5 12.5 4.5 4.5L19 7.5'/%3E%3C/svg%3E"), var(--accent-gradient);
    background-size: 14px 14px, cover; background-position: center; background-repeat: no-repeat;
}
.gd-controle-texte { flex: 1; font-size: 14px; color: var(--text-primary); }
.gd-controle-ligne.est-coche { background: var(--accent-soft); border-color: transparent; }
.gd-controle-ligne.est-coche .gd-controle-texte { color: var(--text-secondary); }

.gd-pret {
    display: flex; align-items: center; gap: 10px; margin-top: 14px;
    padding: 10px 14px; border-radius: var(--radius-md);
    background: rgba(34, 197, 94, 0.10); color: #15803d; font-size: 13.5px; font-weight: 500;
}
.gd-pret svg { width: 18px; height: 18px; flex: 0 0 auto; }
[data-theme="dark"] .gd-pret { color: #4ade80; background: rgba(34, 197, 94, 0.14); }

/* ── Badges « Obligatoire » / « Facultatif » ── */
.gd-badge {
    flex: 0 0 auto; padding: 2px 8px; border-radius: var(--radius-full);
    font-size: 10.5px; font-weight: 600; letter-spacing: .05em; text-transform: uppercase; white-space: nowrap;
}
.gd-badge.est-exige { background: rgba(245, 158, 11, 0.14); color: #b45309; }
.gd-badge.est-facultatif { background: var(--bg-tertiary); color: var(--text-muted); }
[data-theme="dark"] .gd-badge.est-exige { color: #fbbf24; background: rgba(245, 158, 11, 0.18); }

/* ── Les étapes : un rail numéroté, une carte par étape ── */
.gd-etape { display: grid; grid-template-columns: 44px minmax(0, 1fr); gap: 18px; padding-bottom: 18px; }
.gd-etape-rail { position: relative; display: flex; justify-content: center; }
.gd-etape:not(.est-derniere) .gd-etape-rail::after {
    content: ""; position: absolute; top: 46px; bottom: -18px; left: 50%; width: 2px; transform: translateX(-50%);
    background: linear-gradient(var(--accent), var(--accent-soft));
    border-radius: 2px; opacity: .45;
}
.gd-etape-num {
    position: relative; z-index: 1;
    display: grid; place-items: center; width: 40px; height: 40px; border-radius: var(--radius-full);
    background: var(--bg-elevated); color: var(--accent);
    border: 2px solid var(--accent);
    font-size: 15px; font-weight: 700; font-variant-numeric: tabular-nums;
    box-shadow: 0 0 0 5px var(--bg-secondary);
}
.gd-etape-carte {
    display: flex; flex-direction: column; gap: 6px;
    padding: 18px 22px; border-radius: var(--radius-lg);
    background: var(--bg-elevated); border: 1px solid var(--border-subtle); box-shadow: var(--shadow-sm);
    transition: box-shadow var(--transition), border-color var(--transition);
}
.gd-etape-carte:hover { box-shadow: var(--shadow-md); border-color: var(--border); }
.gd-etape-titre { margin: 0 0 4px; font-size: 18px; font-weight: 650; letter-spacing: -0.01em; color: var(--text-primary); }
.gd-etape-action { align-self: flex-start; margin-top: 8px; display: inline-flex; align-items: center; gap: 6px; }

.gd-points { list-style: none; margin: 4px 0 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.gd-points li { display: flex; align-items: center; gap: 10px; font-size: 14px; color: var(--text-primary); }
.gd-puce { width: 6px; height: 6px; border-radius: var(--radius-full); background: var(--accent); flex: 0 0 auto; }

.gd-astuce {
    display: flex; gap: 10px; align-items: flex-start; margin-top: 8px;
    padding: 10px 14px; border-radius: var(--radius-md);
    background: var(--accent-soft); color: var(--text-primary);
}
.gd-astuce svg { width: 18px; height: 18px; flex: 0 0 auto; margin-top: 2px; color: var(--accent); }
.gd-astuce p { margin: 0; font-size: 13.5px; line-height: 1.55; }

/* ── Après l'envoi : une ligne du temps ── */
.gd-groupe-titre {
    display: flex; align-items: center; gap: 12px; margin: 22px 0 16px;
    font-size: 12px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--text-muted);
}
.gd-groupe-titre::after { content: ""; flex: 1; height: 1px; background: var(--border); }
.gd-suite { display: grid; grid-template-columns: 44px minmax(0, 1fr); gap: 18px; padding-bottom: 16px; }
.gd-suite-rail { position: relative; display: flex; justify-content: center; }
.gd-suite + .gd-suite .gd-suite-rail::before {
    content: ""; position: absolute; top: -16px; height: 22px; left: 50%; width: 0;
    border-left: 2px dashed var(--border); transform: translateX(-50%);
}
.gd-suite-point {
    position: relative; z-index: 1; margin-top: 6px;
    width: 14px; height: 14px; border-radius: var(--radius-full);
    background: var(--bg-secondary); border: 3px solid var(--accent);
}
.gd-suite-titre { margin: 0 0 6px; font-size: 16px; font-weight: 650; color: var(--text-primary); }
.gd-lien { display: inline-flex; gap: 6px; font-size: 13.5px; font-weight: 600; color: var(--accent); text-decoration: none; }
.gd-lien:hover { text-decoration: underline; }

/* ── Le bandeau final ── */
.gd-cta {
    display: flex; align-items: center; justify-content: space-between; gap: 20px; flex-wrap: wrap;
    margin-top: 18px; padding: 24px 28px; border-radius: var(--radius-xl);
    background: var(--accent-gradient); color: #fff; box-shadow: var(--shadow-md);
}
.gd-cta-titre { margin: 0 0 4px; font-size: 20px; font-weight: 700; letter-spacing: -0.01em; color: #fff; }
.gd-cta-texte { margin: 0; font-size: 14px; color: rgba(255, 255, 255, 0.82); }
.gd-cta-bouton {
    display: inline-flex; align-items: center; gap: 8px; padding: 10px 18px;
    border-radius: var(--radius-full); background: #fff; color: #152c78;
    font-weight: 600; font-size: 14px; text-decoration: none; box-shadow: var(--shadow-sm);
    transition: transform var(--transition), box-shadow var(--transition);
}
.gd-cta-bouton:hover { transform: translateY(-1px); box-shadow: var(--shadow-md); }
.gd-note { margin: 16px 0 0; font-size: 12.5px; color: var(--text-muted); text-align: center; }

/* ── Les cartes de l'onglet Documents ── */
.gd-section { margin-bottom: 30px; }
.gd-section-entete { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.gd-section-entete .section-title { margin: 0; }
.gd-section-intro { max-width: 760px; margin-bottom: 14px; }
.gd-compte {
    min-width: 22px; padding: 1px 8px; border-radius: var(--radius-full);
    background: var(--accent-soft); color: var(--accent);
    font-size: 11.5px; font-weight: 700; text-align: center;
}
.gd-cartes { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }
.gd-carte {
    display: flex; flex-direction: column; gap: 8px;
    padding: 20px; border-radius: var(--radius-xl);
    background: var(--bg-elevated); border: 1px solid var(--border-subtle); box-shadow: var(--shadow-sm);
    text-decoration: none; color: inherit;
    transition: box-shadow var(--transition), transform var(--transition), border-color var(--transition);
}
.gd-carte:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); border-color: var(--border); }
.gd-carte:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.gd-carte-icone {
    display: grid; place-items: center; width: 46px; height: 46px; margin-bottom: 6px;
    border-radius: 14px; background: var(--accent-soft); color: var(--accent);
    transition: background-color var(--transition), color var(--transition);
}
.gd-carte:hover .gd-carte-icone { background: var(--accent-gradient); color: #fff; }
.gd-carte-icone svg { width: 24px; height: 24px; }
.gd-carte-titre { font-size: 17px; font-weight: 650; letter-spacing: -0.01em; line-height: 1.3; color: var(--text-primary); }
.gd-carte-resume { font-size: 13.5px; line-height: 1.55; color: var(--text-secondary); }
.gd-carte-modeles { display: flex; flex-wrap: wrap; gap: 5px; }
.gd-puce-modele {
    padding: 2px 8px; border-radius: var(--radius-full);
    background: var(--bg-tertiary); color: var(--text-secondary);
    font-size: 11.5px; font-weight: 600; font-variant-numeric: tabular-nums;
}
.gd-carte-pied { display: flex; align-items: center; gap: 14px; margin-top: auto; padding-top: 10px; border-top: 1px solid var(--border-subtle); }
.gd-carte-meta { display: inline-flex; align-items: center; gap: 5px; font-size: 12.5px; color: var(--text-muted); }
.gd-carte-meta svg { width: 14px; height: 14px; }
.gd-carte-fleche { margin-left: auto; font-size: 18px; color: var(--accent); transition: transform var(--transition); }
.gd-carte:hover .gd-carte-fleche { transform: translateX(3px); }

/* ── Le catalogue de pièces ── */
.gd-facons { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px; margin-bottom: 30px; }
.gd-facon {
    display: flex; flex-direction: column; align-items: flex-start;
    padding: 18px 20px; border-radius: var(--radius-lg);
    background: var(--bg-elevated); border: 1px solid var(--border-subtle); box-shadow: var(--shadow-sm);
    text-decoration: none; color: inherit;
    transition: box-shadow var(--transition), transform var(--transition), border-color var(--transition);
}
.gd-facon:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); border-color: var(--accent); }
.gd-facon:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.gd-facon-lien { display: inline-flex; align-items: center; gap: 5px; margin-top: auto; padding-top: 10px; font-size: 13px; font-weight: 600; color: var(--accent); }
.gd-facon-icone {
    display: grid; place-items: center; width: 40px; height: 40px; margin-bottom: 10px;
    border-radius: 12px; background: var(--accent-soft); color: var(--accent);
}
.gd-facon-icone svg { width: 22px; height: 22px; }
.gd-facon-titre { display: block; margin: 0 0 6px; font-size: 15.5px; font-weight: 650; color: var(--text-primary); }
.gd-facon .gd-texte { display: block; font-size: 13.5px; }

.gd-machines { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.gd-machine {
    display: flex; flex-direction: column; align-items: flex-start; gap: 10px;
    padding: 16px; border-radius: var(--radius-lg);
    background: var(--bg-elevated); border: 1px solid var(--border-subtle); box-shadow: var(--shadow-sm);
    text-decoration: none; color: inherit;
    transition: box-shadow var(--transition), transform var(--transition), border-color var(--transition);
}
.gd-machine:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); border-color: var(--accent); }
.gd-machine:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.gd-machine-icone { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 12px; background: var(--accent-soft); color: var(--accent); }
.gd-machine-icone svg { width: 28px; height: 28px; }
.gd-machine:hover .gd-machine-icone { background: var(--accent-gradient); color: #fff; }
.gd-machine-nom { font-size: 20px; font-weight: 700; letter-spacing: -0.01em; color: var(--text-primary); font-variant-numeric: tabular-nums; }
.gd-machine-lien { display: inline-flex; align-items: center; gap: 5px; font-size: 12.5px; font-weight: 600; color: var(--accent); }
.gd-machines:has(.avec-image) { grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); }
/* L'image de design est un trait noir sur blanc : elle garde son fond blanc, même en sombre. */
.gd-machine-image {
    display: block; align-self: stretch; padding: 6px;
    border-radius: var(--radius-md); background: #fff; border: 1px solid var(--border-subtle);
}
.gd-machine-image img { display: block; width: 100%; height: auto; aspect-ratio: 1; object-fit: contain; }

/* ── Une machine du catalogue : image de design, étiquettes au bout des traits, liste ── */
.gd-vue-entete { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 14px; }
.gd-vue-entete .gd-texte { max-width: 62ch; margin: 4px 0 0; }
.gd-vue-titre { margin: 2px 0 0; font-size: 32px; font-weight: 750; letter-spacing: -0.02em; color: var(--text-primary); }
.gd-vue-modeles { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 18px; }
.gd-vue-modeles a {
    padding: 5px 12px; border-radius: 999px; font-size: 13px; font-weight: 650; text-decoration: none;
    color: var(--text-secondary); background: var(--bg-elevated); border: 1px solid var(--border-subtle);
    font-variant-numeric: tabular-nums;
}
.gd-vue-modeles a:hover { color: var(--accent); border-color: var(--accent); }
.gd-vue-modeles a.est-actif { color: #fff; background: var(--accent); border-color: var(--accent); }

.gd-vue { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(260px, 1fr); gap: 20px; align-items: start; }
.gd-vue.sans-image { grid-template-columns: minmax(0, 1fr); max-width: 640px; }
.gd-vue-image {
    position: relative; margin: 0; container-type: inline-size;
    border-radius: var(--radius-lg); background: #fff; border: 1px solid var(--border-subtle); box-shadow: var(--shadow-sm);
}
.gd-vue-image img { display: block; width: 100%; height: 100%; }
/* L'étiquette tient le bout du trait, comme au catalogue ; sa taille suit la largeur de l'image. */
.gd-etiquette {
    position: absolute; display: inline-flex; align-items: center; gap: 0.45em;
    padding: 0.28em 0.7em 0.28em 0.3em; border-radius: 999px;
    font-size: clamp(9px, 1.65cqi, 13px); font-weight: 650; line-height: 1; white-space: nowrap;
    color: #1f3d73; background: #fff; border: 1.5px solid #1f3d73; text-decoration: none;
    box-shadow: 0 1px 3px rgb(0 0 0 / 0.18);
    transition: background var(--transition), color var(--transition), transform var(--transition);
}
.gd-etiquette-code {
    display: grid; place-items: center; min-width: 1.6em; height: 1.6em; padding: 0 0.25em; border-radius: 999px;
    background: #1f3d73; color: #fff; font-family: 'JetBrains Mono', ui-monospace, monospace;
}
.gd-etiquette:hover, .gd-etiquette:focus-visible, .gd-etiquette.est-actif {
    background: #1f3d73; color: #fff; transform: scale(1.06); z-index: 2; outline: none;
}
.gd-etiquette:hover .gd-etiquette-code, .gd-etiquette:focus-visible .gd-etiquette-code, .gd-etiquette.est-actif .gd-etiquette-code { background: #fff; color: #1f3d73; }
/* Image étroite : la lettre seule, la liste dit le reste. */
@container (max-width: 520px) {
    .gd-etiquette { padding: 0.2em; font-size: 11px; }
    .gd-etiquette-nom { display: none; }
}

.gd-vue-liste { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.gd-vue-ligne {
    display: flex; align-items: center; gap: 12px; padding: 9px 12px;
    border-radius: var(--radius-md); background: var(--bg-elevated); border: 1px solid var(--border-subtle);
    text-decoration: none; color: inherit;
    transition: border-color var(--transition), background var(--transition);
}
.gd-vue-ligne:hover, .gd-vue-ligne:focus-visible, .gd-vue-ligne.est-actif { border-color: var(--accent); background: var(--accent-soft); outline: none; }
.gd-vue-ligne .gd-lettre { width: 30px; height: 30px; font-size: 13px; }
.gd-vue-ligne-texte { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.gd-vue-ligne-nom { font-size: 14px; font-weight: 650; color: var(--text-primary); }
.gd-vue-ligne-catalogue { font-size: 11.5px; color: var(--text-secondary); font-family: 'JetBrains Mono', ui-monospace, monospace; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gd-vue-ligne .gd-icone-externe { color: var(--accent); flex: 0 0 auto; }
.gd-vue-note { margin-top: 16px; font-size: 13px; color: var(--text-secondary); }

/* Les chargeuses : une vignette par sous-section, sa vue éclatée sur fond blanc (un trait noir
   reste un trait noir, même en sombre), son nom dessous. */
.gd-vignettes { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.gd-vignette {
    display: flex; flex-direction: column; height: 100%; overflow: hidden;
    border-radius: var(--radius-lg); background: var(--bg-elevated); border: 1px solid var(--border-subtle); box-shadow: var(--shadow-sm);
    text-decoration: none; color: inherit;
    transition: box-shadow var(--transition), transform var(--transition), border-color var(--transition);
}
.gd-vignette:hover, .gd-vignette:focus-visible { box-shadow: var(--shadow-md); transform: translateY(-2px); border-color: var(--accent); outline: none; }
.gd-vignette-image { position: relative; display: block; aspect-ratio: 4 / 3; background: #fff; border-bottom: 1px solid var(--border-subtle); }
/* En absolu : une grande image ne peut pas étirer sa case, toutes les vignettes gardent la même hauteur. */
.gd-vignette-image img { position: absolute; inset: 10px; width: calc(100% - 20px); height: calc(100% - 20px); object-fit: contain; }
.gd-vignette-pied { display: flex; align-items: center; gap: 10px; padding: 10px 12px; margin-top: auto; }
.gd-vignette-pied .gd-lettre { width: 30px; height: 30px; font-size: 13px; }
.gd-vignette-pied .gd-icone-externe { color: var(--accent); flex: 0 0 auto; }
@media (max-width: 480px) {
    .gd-vignettes { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
    .gd-vignette-pied { padding: 8px; gap: 8px; }
    .gd-vignette-pied .gd-lettre { display: none; }
}
@media (max-width: 900px) {
    .gd-vue { grid-template-columns: minmax(0, 1fr); }
}

.gd-lettre {
    flex: 0 0 auto; display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px;
    background: var(--accent-soft); color: var(--accent);
    font-size: 15px; font-weight: 700; font-family: 'JetBrains Mono', ui-monospace, monospace;
}

/* ── Petits écrans : le sommaire s'efface, l'en-tête se resserre ── */
@media (max-width: 960px) {
    .gd-corps { grid-template-columns: minmax(0, 1fr); }
    .gd-sommaire { display: none; }
}
@media (max-width: 640px) {
    .gd-hero { flex-direction: column; gap: 16px; padding: 22px 20px; }
    .gd-hero-titre { font-size: 24px; }
    .gd-etape, .gd-suite { grid-template-columns: 34px minmax(0, 1fr); gap: 12px; }
    .gd-etape-num { width: 32px; height: 32px; font-size: 13px; }
    .gd-etape:not(.est-derniere) .gd-etape-rail::after { top: 38px; }
    .gd-etape-carte { padding: 16px; }
    .gd-cta { padding: 20px; }
}
@media (prefers-reduced-motion: reduce) {
    .gd-carte, .gd-machine, .gd-cta-bouton, .gd-barre span, .gd-carte-fleche, .gd-etiquette, .gd-vue-ligne, .gd-vignette { transition: none; }
}

/* ═══════════════════════════════════════════════════════════════════════════
   BULLETINS (Distribution Canada → Documents, et l'éditeur de l'administration) — le bulletin mis en
   page (BulletinDocument), son corps mis en forme (BulletinCorps), et le choix de publication
   commun aux bulletins, documents et tutoriels (ChoixPublication). Global : les mêmes
   composants servent la lecture, l'aperçu en direct et la liste. Préfixes bl- et pub-.

   Le bandeau porte la couleur du GENRE — bleu RIPPA (information), ambre (service), rouge
   (rappel) — et c'est la seule surface colorée du document : le corps reste une feuille
   claire, lisible et imprimable.
   ═══════════════════════════════════════════════════════════════════════════ */

.bl-doc {
    --bl-teinte: #006dbc;
    --bl-bandeau: linear-gradient(135deg, #152c78 0%, #0a4f8f 60%, #006dbc 100%);
    --bl-doux: rgba(0, 109, 188, 0.08);
    overflow: hidden;
    background: var(--bg-secondary);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-md, 0 8px 28px rgba(0, 0, 0, 0.10));
    color: var(--text-primary);
}
.bl-doc.bl-genre-service {
    --bl-teinte: #b45309;
    --bl-bandeau: linear-gradient(135deg, #152c78 0%, #3b3f78 45%, #b45309 135%);
    --bl-doux: rgba(245, 158, 11, 0.10);
}
.bl-doc.bl-genre-rappel {
    --bl-teinte: #b91c1c;
    --bl-bandeau: linear-gradient(135deg, #3b0d12 0%, #7f1d1d 50%, #b91c1c 100%);
    --bl-doux: rgba(239, 68, 68, 0.09);
}

.bl-bandeau {
    position: relative;
    display: flex; flex-direction: column; gap: 12px;
    padding: 26px 32px 30px;
    background: var(--bl-bandeau);
    color: #fff;
}
/* La tapisserie de la marque, discrète, sous le texte du bandeau. */
.bl-bandeau::after {
    content: ""; position: absolute; inset: 0; pointer-events: none;
    background-image: var(--fond-motif); opacity: .55;
    -webkit-mask-image: linear-gradient(90deg, transparent 30%, #000 100%);
            mask-image: linear-gradient(90deg, transparent 30%, #000 100%);
}
.bl-bandeau > * { position: relative; z-index: 1; }
.bl-bandeau-haut { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.bl-logo { height: 26px; width: auto; }
.bl-type {
    padding: 4px 10px; border-radius: var(--radius-full);
    background: rgba(255, 255, 255, 0.16); border: 1px solid rgba(255, 255, 255, 0.28);
    font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
}
.bl-numero { margin-left: auto; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 13px; opacity: .85; }
.bl-priorite {
    align-self: flex-start;
    display: inline-flex; align-items: center; gap: 6px;
    padding: 5px 12px 5px 8px; border-radius: var(--radius-full);
    background: #fff; color: var(--bl-teinte);
    font-size: 12px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase;
}
.bl-prio-urgente .bl-priorite { background: #fde047; color: #7f1d1d; }
.bl-priorite svg { width: 16px; height: 16px; }
.bl-titre { margin: 0; font-size: 30px; line-height: 1.2; font-weight: 700; letter-spacing: -0.02em; color: #fff; }
.bl-chapeau { margin: 0; max-width: 1100px; font-size: 16.5px; line-height: 1.55; color: rgba(255, 255, 255, 0.88); }

.bl-couverture { margin: 0; background: var(--bg-tertiary); }
.bl-couverture img { display: block; width: 100%; max-height: 380px; object-fit: cover; }

.bl-meta {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 0;
    margin: 0; border-bottom: 1px solid var(--border-subtle);
}
.bl-meta > div { padding: 14px 32px 14px 32px; border-right: 1px solid var(--border-subtle); }
.bl-meta > div:last-child { border-right: 0; }
.bl-meta dt { font-size: 11px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--text-muted); }
.bl-meta dd { margin: 4px 0 0; font-size: 14px; font-weight: 600; color: var(--text-primary); }
.bl-meta .est-echeance dd { color: var(--bl-teinte); }

.bl-action {
    display: flex; gap: 16px; align-items: flex-start;
    margin: 24px 32px 0; padding: 18px 20px;
    background: var(--bl-doux);
    border: 1px solid color-mix(in srgb, var(--bl-teinte) 30%, transparent);
    border-left: 5px solid var(--bl-teinte);
    border-radius: var(--radius-md);
}
.bl-action-icone {
    flex: 0 0 auto; display: grid; place-items: center;
    width: 36px; height: 36px; border-radius: 50%;
    background: var(--bl-teinte); color: #fff;
}
.bl-action-icone svg { width: 20px; height: 20px; }
.bl-action-titre { margin: 0 0 4px; font-size: 13px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--bl-teinte); }
.bl-action-texte { margin: 0; font-size: 15.5px; line-height: 1.55; font-weight: 500; white-space: pre-line; }
.bl-action-echeance { margin: 8px 0 0; font-size: 13px; font-weight: 700; color: var(--bl-teinte); }

.bl-corps { padding: 22px 32px 26px; }
.bl-paragraphe { margin: 0 0 14px; font-size: 15px; line-height: 1.7; color: var(--text-primary); }
.bl-intertitre {
    margin: 22px 0 10px; padding-bottom: 6px;
    font-size: 18px; font-weight: 700; letter-spacing: -0.01em; color: var(--text-primary);
    border-bottom: 2px solid var(--bl-doux);
}
.bl-corps > :first-child { margin-top: 0; }
.bl-puces, .bl-numeros { margin: 0 0 16px; padding-left: 0; list-style: none; font-size: 15px; line-height: 1.6; }
.bl-puces li, .bl-numeros li { position: relative; padding-left: 30px; margin-bottom: 8px; }
.bl-puces li::before {
    content: ""; position: absolute; left: 9px; top: .62em;
    width: 8px; height: 8px; border-radius: 50%; background: var(--bl-teinte);
}
.bl-numeros { counter-reset: bl-etape; }
.bl-numeros li { counter-increment: bl-etape; padding-left: 38px; min-height: 26px; }
.bl-numeros li::before {
    content: counter(bl-etape); position: absolute; left: 0; top: 0;
    display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%;
    background: var(--bl-teinte); color: #fff; font-size: 13px; font-weight: 700;
}
.bl-encadre {
    display: flex; gap: 12px; align-items: flex-start;
    margin: 0 0 16px; padding: 14px 16px;
    border-radius: var(--radius-md);
    font-size: 14.5px; line-height: 1.6;
}
.bl-encadre svg { flex: 0 0 auto; width: 22px; height: 22px; margin-top: 1px; }
.bl-encadre p { margin: 0 0 6px; }
.bl-encadre p:last-child { margin-bottom: 0; }
.bl-encadre.est-note { background: var(--accent-soft); color: var(--text-primary); }
.bl-encadre.est-note svg { color: var(--accent); }
.bl-encadre.est-attention { background: rgba(239, 68, 68, 0.09); border: 1px solid rgba(239, 68, 68, 0.28); color: var(--text-primary); }
.bl-encadre.est-attention svg { color: #dc2626; }

.bl-piece {
    display: flex; align-items: center; gap: 12px;
    margin: 0 32px 24px; padding: 12px 14px;
    border: 1px dashed var(--border); border-radius: var(--radius-md);
    background: var(--bg-tertiary);
}
.bl-piece svg { flex: 0 0 auto; width: 24px; height: 24px; color: var(--bl-teinte); }
.bl-piece-nom { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; }

.bl-pied {
    display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap;
    padding: 12px 32px; border-top: 1px solid var(--border-subtle);
    background: var(--bg-tertiary); font-size: 12px; color: var(--text-muted);
}

@media (max-width: 640px) {
    .bl-bandeau { padding: 20px 18px 22px; }
    .bl-titre { font-size: 23px; }
    .bl-chapeau { font-size: 15px; }
    .bl-meta > div { padding: 12px 18px; border-right: 0; border-bottom: 1px solid var(--border-subtle); }
    .bl-action { margin: 18px 18px 0; }
    .bl-corps { padding: 18px; }
    .bl-piece { margin: 0 18px 18px; }
    .bl-pied { padding: 12px 18px; }
}

/* ── Les cartes de bulletin de l'onglet Documents : la couleur du genre en liseré, la
   couverture en vignette, le chapeau en accroche. ── */
.bl-carte-couverture { display: block; width: 100%; max-width: 560px; height: 140px; object-fit: cover; border-radius: var(--radius-md); margin-bottom: 10px; }
.bl-carte-chapeau { margin: 4px 0 8px; font-size: 14px; line-height: 1.5; color: var(--text-secondary); }
.bl-carte-priorite { font-weight: 700; }
.bl-carte-priorite.est-urgente { color: #b91c1c; }
.bl-carte-priorite.est-importante { color: #b45309; }
.bl-carte-echeance { font-size: 12.5px; font-weight: 600; color: #b45309; }

/* ── L'impression : le bulletin seul, couleurs gardées, comme un document RIPPA ── */
@media print {
    body:has(.bl-doc) .appbar,
    body:has(.bl-doc) .footer,
    body:has(.bl-doc) .bandeau-vue,
    body:has(.bl-doc) nav,
    body:has(.bl-doc) .no-print,
    body:has(.bl-doc) .form-banner { display: none !important; }
    .bl-doc { box-shadow: none; border: 0; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
    .bl-doc * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}

/* ── Le choix de publication : trois cartes (maintenant · programmer · brouillon) ── */
.pub-choix { display: flex; flex-direction: column; gap: 10px; }
.pub-modes { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.pub-mode {
    display: flex; flex-direction: column; align-items: flex-start; gap: 3px;
    padding: 10px 12px; text-align: left; cursor: pointer;
    background: var(--bg-secondary); color: var(--text-primary);
    border: 1px solid var(--border); border-radius: var(--radius-md);
    font: inherit;
}
.pub-mode:hover { border-color: var(--accent); }
.pub-mode.is-on { border-color: var(--accent); background: var(--accent-soft); box-shadow: inset 0 0 0 1px var(--accent); }
.pub-mode:disabled { opacity: .6; cursor: not-allowed; }
.pub-mode-titre { font-size: 13.5px; font-weight: 600; }
.pub-mode-texte { font-size: 12px; line-height: 1.4; color: var(--text-muted); }
.pub-date { display: flex; flex-direction: column; gap: 4px; font-size: 12px; font-weight: 500; color: var(--text-secondary); max-width: 280px; }
.pub-verrou { margin: 0; }
@media (max-width: 560px) { .pub-modes { grid-template-columns: 1fr; } }

/* ═══════════════════════════════════════════════════════════════════════════
   EXPLORATEUR 3D (Distribution Canada → Documents → Catalogue de pièces → R10) — la machine en 3D
   à gauche, le catalogue détaillé à droite (en dessous sur téléphone). Monté par
   wwwroot/js/explorateur-3d.js (et sa géométrie, modeles3d/<clé>.js) dans la page du modèle. La SCÈNE garde un fond clair dans les
   deux thèmes, légèrement assombri en sombre : une mini-pelle bleue se lit mal sur un fond noir.
   La sélection est ROUGE (--x3d-choix) : ni l'orange d'un moteur Kubota, ni le vert et jaune
   d'un concurrent.
   ═══════════════════════════════════════════════════════════════════════════ */
.x3d {
    --x3d-scene-a: #f7f9fc; --x3d-scene-b: #d9e2ee; --x3d-grille: #a9b8cc;
    --x3d-choix: #d3202b; --x3d-choix-doux: rgba(211, 32, 43, 0.13);
    display: flex; flex-direction: column; gap: 10px; margin: 8px 0 18px;
}
[data-theme="dark"] .x3d {
    --x3d-scene-a: #1b2433; --x3d-scene-b: #0b111b; --x3d-grille: #2a3a52;
    --x3d-choix: #ff5a62; --x3d-choix-doux: rgba(255, 90, 98, 0.2);
}
/* L'attribut hidden doit gagner contre les display des pièces (loupe, bulle, réglages…) : sans
   cette règle, la loupe masquée couvrirait la page et mangerait les clics. */
.x3d [hidden] { display: none !important; }
.x3d-barre { display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: center; }
.x3d-recherche { flex: 1 1 320px; display: flex; align-items: center; gap: 8px; min-width: 0; padding: 0 12px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--bg-secondary); color: var(--text-muted); }
.x3d-recherche:focus-within { border-color: var(--accent); }
.x3d-recherche input { flex: 1; min-width: 0; border: 0; background: transparent; color: var(--text-primary); font: inherit; font-size: 15px; padding: 9px 0; outline: none; }
.x3d-stats { font-size: 12px; color: var(--text-secondary); font-variant-numeric: tabular-nums; }
.x3d-source { font-size: 12px; padding: 3px 10px; border-radius: 999px; background: var(--accent-soft); color: var(--accent); }
.x3d-source.est-copie { background: rgba(217, 119, 6, 0.14); color: #b45309; font-weight: 600; }
[data-theme="dark"] .x3d-source.est-copie { color: #fbbf24; }
.x3d-corps { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr);   /* 60 % la machine, 40 % la liste et les sections */ gap: 12px; height: min(78vh, 820px); min-height: 520px; }
.x3d-scene { position: relative; min-width: 0; min-height: 0; border-radius: var(--radius-md); overflow: hidden; touch-action: none; border: 1px solid var(--border);
    background: radial-gradient(120% 95% at 45% 25%, var(--x3d-scene-a), var(--x3d-scene-b)); }
.x3d-scene canvas { display: block; width: 100%; height: 100%; }
.x3d-chargement { position: absolute; inset: 0; display: grid; place-items: center; padding: 24px; text-align: center; color: var(--text-secondary); font-weight: 600; }
.x3d-legende, .x3d-asmbar { position: absolute; top: 12px; left: 12px; right: 12px; display: flex; flex-wrap: wrap; gap: 6px; pointer-events: none; }
.x3d-legende > *, .x3d-asmbar > * { pointer-events: auto; }
.x3d-pastille { display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 10px 0 5px; border-radius: 14px; border: 1px solid var(--border); background: color-mix(in srgb, var(--bg-secondary) 86%, transparent); cursor: pointer; font: inherit; font-size: 12px; color: var(--text-primary); }
.x3d-point { width: 18px; height: 18px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; font-size: 10px; color: #fff; }
.x3d-pastille-nom { display: none; }
.x3d-pastille:hover .x3d-pastille-nom, .x3d-pastille[aria-pressed="true"] .x3d-pastille-nom { display: inline; }
.x3d-pastille[aria-pressed="true"] { border-color: var(--x3d-choix); box-shadow: 0 0 0 1px var(--x3d-choix) inset; }
.x3d-asmlabel { display: grid; gap: 1px; padding: 6px 12px; border-radius: var(--radius-sm); border: 1px solid var(--border); background: color-mix(in srgb, var(--bg-secondary) 90%, transparent); font-size: 12px; min-width: 0; }
.x3d-asmlabel b { font-weight: 600; overflow-wrap: anywhere; }
.x3d-asmlabel span { color: var(--text-secondary); }
.x3d-outils { position: absolute; left: 12px; bottom: 12px; right: 12px; display: flex; flex-wrap: wrap; gap: 8px; align-items: flex-end; pointer-events: none; }
.x3d-outil { pointer-events: auto; display: inline-flex; align-items: center; gap: 8px; height: 34px; padding: 0 12px; border-radius: var(--radius-sm); border: 1px solid var(--border); background: color-mix(in srgb, var(--bg-secondary) 92%, transparent); color: var(--text-primary); cursor: pointer; font: inherit; font-size: 13px; font-weight: 500; }
.x3d-outil[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: #fff; }
.x3d-outil input[type=range] { width: 110px; accent-color: var(--accent); }
label.x3d-outil { cursor: default; }
.x3d-pose { position: absolute; left: 12px; bottom: 56px; width: 270px; max-width: calc(100% - 24px); padding: 12px 14px; border-radius: var(--radius-md); border: 1px solid var(--border); background: var(--bg-secondary); box-shadow: var(--shadow-md); display: grid; gap: 8px; }
.x3d-pose h3 { margin: 0; font-size: 11px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--text-secondary); }
.x3d-pose label { display: grid; grid-template-columns: 100px 1fr; align-items: center; gap: 8px; font-size: 12px; color: var(--text-secondary); }
.x3d-pose input { width: 100%; accent-color: var(--accent); }
.x3d-pose-boutons { display: flex; gap: 6px; }
.x3d-pose-boutons button { flex: 1; height: 28px; border-radius: 8px; border: 1px solid var(--border); background: var(--bg-tertiary); color: var(--text-primary); cursor: pointer; font: inherit; font-size: 12px; }
.x3d-aide { position: absolute; right: 14px; bottom: 60px; font-size: 11px; color: var(--text-secondary); text-align: right; pointer-events: none; }
.x3d-bulle { position: absolute; z-index: 3; pointer-events: none; padding: 6px 9px; border-radius: 8px; background: #0d1b3d; color: #fff; font-size: 12px; white-space: nowrap; transform: translate(12px, 12px); }
.x3d-bulle span { opacity: .72; }
.x3d-panneau { min-width: 0; min-height: 0; display: flex; flex-direction: column; border: 1px solid var(--border); border-radius: var(--radius-md); background: var(--bg-secondary); overflow: hidden; }
.x3d-fil { display: flex; flex-wrap: wrap; gap: 2px; align-items: center; padding: 10px 14px; border-bottom: 1px solid var(--border); font-size: 12px; color: var(--text-secondary); }
.x3d-fil button { border: 0; background: none; padding: 2px 5px; border-radius: 6px; cursor: pointer; color: var(--accent); font: inherit; font-weight: 500; }
.x3d-fil button:hover { background: var(--accent-soft); }
.x3d-fil-sep { opacity: .5; }
.x3d-fil-ici { color: var(--text-primary); font-weight: 600; padding: 2px 5px; }
.x3d-contenu { flex: 1; min-height: 0; overflow-y: auto; padding: 16px; display: grid; align-content: start; gap: 14px; }
.x3d-contenu h2 { margin: 2px 0 0; font-size: 22px; font-weight: 700; line-height: 1.15; letter-spacing: -.02em; text-wrap: balance; }
.x3d-code { color: var(--accent); margin-right: 6px; }
.x3d-surtitre { margin: 0 0 4px; font-size: 11px; font-weight: 600; letter-spacing: .07em; text-transform: uppercase; color: var(--text-secondary); }
.x3d-lede { margin: 0; color: var(--text-secondary); }
.x3d-petit, .x3d-note-asm { margin: 0; font-size: 12px; color: var(--text-secondary); }
.x3d-liste { display: grid; gap: 2px; margin: 0; padding: 0; list-style: none; }
.x3d-item, .x3d-resultat { width: 100%; display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 10px; align-items: center; text-align: left; padding: 8px 10px; border: 0; border-radius: var(--radius-sm); background: transparent; color: var(--text-primary); cursor: pointer; font: inherit; }
.x3d-resultat { grid-template-columns: 26px minmax(0, 1fr); align-items: start; }
.x3d-item:hover, .x3d-item:focus-visible, .x3d-resultat:hover, .x3d-resultat:focus-visible { background: var(--bg-tertiary); }
.x3d-item-k, .x3d-mono { font-family: 'JetBrains Mono', ui-monospace, Menlo, Consolas, monospace; font-size: 12px; color: var(--text-secondary); }
.x3d-item-k { min-width: 38px; }
.x3d-item-t { min-width: 0; overflow-wrap: anywhere; font-weight: 500; }
.x3d-item-t small { display: block; font-size: 12px; font-weight: 400; color: var(--text-secondary); }
.x3d-item-n { font-size: 12px; color: var(--text-secondary); white-space: nowrap; font-variant-numeric: tabular-nums; }
.x3d-sysdot { width: 26px; height: 26px; border-radius: 8px; display: grid; place-items: center; color: #fff; font-weight: 700; font-size: 13px; }
.x3d-tags { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
.x3d-tag { font-size: 11px; font-weight: 500; padding: 1px 7px; border-radius: 999px; background: var(--accent-soft); color: var(--accent); }
.x3d-zones { display: flex; flex-wrap: wrap; gap: 6px; }
.x3d-zones button { border: 1px solid var(--border); background: var(--bg-tertiary); color: var(--text-primary); border-radius: 8px; padding: 5px 9px; cursor: pointer; font: inherit; font-size: 12px; }
.x3d-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.x3d-actions a, .x3d-actions button { text-decoration: none; }
/* Groupe ouvert avec sa vue éclatée : 45 % la machine, 55 % le panneau, et le dessin officiel
   prend toute la largeur du panneau (sans la marge intérieure) pour se lire sans la loupe. */
.x3d-corps.avec-dessin { grid-template-columns: minmax(0, 9fr) minmax(0, 11fr); }
.x3d-corps.avec-dessin .x3d-figure { margin: 0 -10px; }
.x3d-figure { margin: 0; border: 1px solid var(--border); border-radius: var(--radius-md); background: #fff; overflow: hidden; }
.x3d-figure img { display: block; width: 100%; height: auto; cursor: zoom-in; }
.x3d-figure figcaption { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 2px 8px; padding: 6px 10px; font-size: 11px; color: #6b7084; border-top: 1px solid #e6e8ef; background: #f7f8fb; }
.x3d-tableau { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius-md); }
.x3d-tableau table { width: 100%; border-collapse: collapse; font-size: 13px; }
.x3d-tableau th { position: sticky; top: 0; background: var(--bg-tertiary); text-align: left; font-size: 11px; font-weight: 600; letter-spacing: .05em; text-transform: uppercase; color: var(--text-secondary); padding: 8px 7px; border-bottom: 1px solid var(--border); }
.x3d-tableau td { padding: 6px 7px; border-bottom: 1px solid var(--border); vertical-align: top; }
.x3d-tableau tr:last-child td { border-bottom: 0; }
.x3d-tableau tr[data-row] { cursor: pointer; }
.x3d-tableau tr[data-row]:hover td { background: var(--bg-tertiary); }
.x3d-tableau tr.est-choisie td, .x3d-tableau tr.est-choisie:hover td { background: var(--x3d-choix-doux); }
.x3d-tableau tr.est-choisie td.x3d-nom { box-shadow: inset 3px 0 0 var(--x3d-choix); }
.x3d-ref { font-family: 'JetBrains Mono', ui-monospace, Menlo, Consolas, monospace; font-size: 12px; color: var(--text-secondary); }
.x3d-q { text-align: right; font-variant-numeric: tabular-nums; }
.x3d-nom { min-width: 120px; overflow-wrap: anywhere; }
.x3d-inv { border: 0; background: none; padding: 1px 3px; border-radius: 4px; cursor: copy; white-space: nowrap; color: var(--text-primary); font-family: 'JetBrains Mono', ui-monospace, Menlo, Consolas, monospace; font-size: 11.5px; }
.x3d-inv:hover { background: var(--accent-soft); }
.x3d-boutique { font-size: 12px; font-weight: 500; color: var(--accent); white-space: nowrap; }
.x3d mark { background: var(--x3d-choix-doux); color: inherit; border-radius: 2px; }
.x3d-note { display: grid; gap: 6px; padding-top: 12px; border-top: 1px solid var(--border); font-size: 12px; color: var(--text-secondary); }
.x3d-note p { margin: 0; }
.x3d-loupe { position: fixed; inset: 0; z-index: 2000; display: grid; grid-template-rows: auto 1fr; background: rgba(5, 12, 30, 0.86); }
.x3d-loupe header { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 16px; color: #fff; }
.x3d-loupe header span { display: flex; gap: 8px; }
.x3d-loupe header button { height: 32px; padding: 0 12px; border-radius: 8px; border: 1px solid rgba(255, 255, 255, 0.3); background: transparent; color: #fff; cursor: pointer; font: inherit; }
.x3d-loupe-defile { overflow: auto; display: grid; place-items: center; padding: 0 16px 16px; }
.x3d-loupe img { max-width: 100%; max-height: 100%; border-radius: 8px; background: #fff; }
.x3d-loupe.est-agrandie img { max-width: none; max-height: none; width: 1800px; }
.x3d-toast { position: fixed; left: 50%; bottom: 24px; z-index: 2001; transform: translateX(-50%); padding: 8px 14px; border-radius: 10px; background: #0d1b3d; color: #fff; font-size: 13px; }
@media (max-width: 980px) {
    .x3d-corps, .x3d-corps.avec-dessin { grid-template-columns: minmax(0, 1fr); grid-template-rows: 62vh auto; height: auto; }
    .x3d-contenu { overflow: visible; }
    .x3d-aide { display: none; }
    .x3d-outil { height: 32px; padding: 0 10px; font-size: 12px; }
    .x3d-outil input[type=range] { width: 76px; }
}

/* ============================================================
   SIGNALEMENTS — le bouton « Signaler » de la barre, ses deux formulaires, « Mes signalements »
   et la console. Voir docs/signalements.md. Le menu du bouton vit DANS l'entête, qui réécrit
   les jetons de texte en blanc pour sa sous-arborescence : il porte donc ses propres couleurs.
   ============================================================ */
.sg-signaler-ancre { position: relative; }
.sg-signaler { display: inline-flex; align-items: center; gap: 7px; padding: 6px 12px; border-radius: 999px;
    border: 1px solid var(--fond-trait); color: var(--fond-encre); font-size: 13px; font-weight: 600; cursor: pointer;
    background: rgba(255, 255, 255, 0.08); list-style: none; user-select: none; }
.sg-signaler::-webkit-details-marker { display: none; }
.sg-signaler:hover { background: rgba(255, 255, 255, 0.16); }
.sg-signaler:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
.sg-signaler-ancre[open] > .sg-signaler { background: #fff; color: #152c78; }
/* La barre est déjà pleine sous ~1700 px : le bouton garde sa pastille mais pas son mot, pour ne
   pas rogner les onglets. Son titre (infobulle et lecteur d'écran) dit toujours ce qu'il fait. */
@media (max-width: 1700px) {
    .sg-signaler { padding: 6px 9px; }
    .sg-signaler > span:not(.cloche-pastille) { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
}
.sg-menu { --sg-encre: #1a1a2e; --sg-encre-2: #6b7084; --sg-fond: #fff; --sg-trait: rgba(0, 0, 0, 0.08);
    position: absolute; right: 0; top: calc(100% + 10px); width: 360px; max-width: calc(100vw - 32px); z-index: 60;
    background: var(--sg-fond); color: var(--sg-encre); border-radius: 14px; box-shadow: 0 18px 50px rgba(10, 20, 60, 0.35);
    padding: 12px; display: grid; gap: 8px; text-align: left; }
[data-theme="dark"] .sg-menu { --sg-encre: #e5e7eb; --sg-encre-2: #9ca3b4; --sg-fond: #1f2335; --sg-trait: rgba(255, 255, 255, 0.10); }
.sg-choix { display: flex; gap: 12px; align-items: flex-start; padding: 12px; border: 1px solid var(--sg-trait);
    border-radius: 12px; color: var(--sg-encre); text-decoration: none; }
.sg-choix:hover, .sg-choix:focus-visible { border-color: #006dbc; background: rgba(0, 109, 188, 0.07); outline: none; }
.sg-choix > span:last-child { display: grid; gap: 2px; }
.sg-choix-ico { width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; flex: none; }
.sg-choix-ico.bug { background: rgba(239, 68, 68, 0.12); color: #b91c1c; }
.sg-choix-ico.idee { background: rgba(234, 179, 8, 0.16); color: #a16207; }
.sg-choix-t { font-weight: 650; font-size: 14px; }
.sg-choix-d { font-size: 12.5px; color: var(--sg-encre-2); line-height: 1.4; }
.sg-signaler { position: relative; }
.sg-signaler > .cloche-pastille { position: absolute; top: -5px; right: -5px; }
.sg-menu-console { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 10px;
    background: rgba(0, 109, 188, 0.07); color: #006dbc; font-size: 13px; font-weight: 600; text-decoration: none; }
.sg-menu-console:hover { background: rgba(0, 109, 188, 0.13); }
.sg-menu-console b { font-size: 12px; color: #b91c1c; }
.sg-menu-pied { display: flex; justify-content: space-between; gap: 12px; font-size: 12.5px; padding: 4px 4px 0; color: var(--sg-encre-2); }
.sg-menu-pied a { color: #006dbc; font-weight: 600; white-space: nowrap; }

/* Les formulaires : une colonne d'étapes, et ce qui l'accompagne à droite. */
.sg-deux { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 28px; align-items: start; }
@media (max-width: 980px) { .sg-deux { grid-template-columns: 1fr; } }
.sg-cote { display: grid; gap: 14px; }
.sg-carte { background: var(--bg-secondary); border: 1px solid var(--border); border-radius: 12px; padding: 16px 18px; min-width: 0; }
.sg-carte h2, .sg-carte h3 { margin: 0 0 4px; font-size: 14px; font-weight: 650; }
.sg-carte .sous { margin: 0 0 12px; font-size: 12.5px; color: var(--text-muted); line-height: 1.45; }
.sg-dl { display: grid; grid-template-columns: 96px 1fr; gap: 6px 10px; font-size: 12.5px; margin: 0; }
.sg-dl dt { color: var(--text-muted); }
.sg-dl dd { margin: 0; color: var(--text-primary); font-weight: 500; overflow-wrap: anywhere; }
.sg-mono { font-family: 'JetBrains Mono', ui-monospace, monospace; font-size: 11.5px; }

.sg-etapes { display: grid; }
.sg-etape { display: flex; gap: 20px; }
.sg-etape-rail { display: flex; flex-direction: column; align-items: center; flex: none; }
.sg-etape-num { width: 34px; height: 34px; border-radius: 50%; background: var(--accent); color: #fff; display: flex;
    align-items: center; justify-content: center; font-weight: 600; font-size: 14px; box-shadow: 0 0 0 5px var(--accent-soft); }
.sg-etape-ligne { flex: 1; width: 1px; background: var(--border); margin: 9px 0; }
.sg-etape-corps { flex: 1; min-width: 0; padding-bottom: 30px; }
.sg-etape:last-child .sg-etape-corps { padding-bottom: 0; }
.sg-etape-titre { font-size: 19px; font-weight: 600; letter-spacing: -0.015em; color: var(--text-primary); margin: 0 0 3px; }
.sg-etape-desc { font-size: 13.5px; color: var(--text-muted); margin: 0 0 16px; }
.sg-champ { display: grid; gap: 6px; margin-bottom: 14px; }
.sg-champ > label, .sg-champ > .sg-champ-libelle { font-size: 13px; font-weight: 500; color: var(--text-secondary); }
.sg-champ .req { color: #dc2626; }
.sg-grille-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.sg-grille-3 { display: grid; grid-template-columns: 1fr 1.4fr 1.4fr; gap: 14px; }
@media (max-width: 720px) { .sg-grille-2, .sg-grille-3 { grid-template-columns: 1fr; } }

/* Les choix : de vrais boutons radio, sous l'apparence des pastilles du guide. */
.sg-choix-ligne { display: flex; flex-wrap: wrap; gap: 8px; border: 0; padding: 0; margin: 0; }
.sg-pastille-choix { position: relative; border: 1px solid var(--border); background: var(--bg-secondary); color: var(--text-secondary);
    border-radius: 999px; padding: 8px 16px; font-size: 13.5px; font-weight: 500; cursor: pointer; }
.sg-pastille-choix input { position: absolute; opacity: 0; pointer-events: none; }
.sg-pastille-choix:hover { border-color: var(--text-muted); color: var(--text-primary); }
.sg-pastille-choix:has(input:checked) { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); font-weight: 600; }
.sg-pastille-choix:has(input:focus-visible) { box-shadow: 0 0 0 3px var(--accent-soft); border-color: var(--accent); }

.sg-origine { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }

.sg-badge { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.sg-badge::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.st-nouveau  { color: #006dbc; background: rgba(0, 109, 188, 0.10); }
.st-analyse  { color: #7c3aed; background: rgba(124, 58, 237, 0.10); }
.st-info     { color: #b45309; background: rgba(245, 158, 11, 0.16); }
.st-accepte  { color: #0369a1; background: rgba(3, 105, 161, 0.10); }
.st-cours    { color: #4338ca; background: rgba(67, 56, 202, 0.12); }
.st-resolu   { color: #0d9488; background: rgba(13, 148, 136, 0.13); }
.st-deploye  { color: #15803d; background: rgba(34, 197, 94, 0.14); }
.st-ferme    { color: var(--text-secondary); background: var(--bg-tertiary); }
[data-theme="dark"] .st-nouveau { color: #60a5fa; }
[data-theme="dark"] .st-analyse { color: #a78bfa; }
[data-theme="dark"] .st-info { color: #fbbf24; }
[data-theme="dark"] .st-accepte { color: #38bdf8; }
[data-theme="dark"] .st-cours { color: #818cf8; }
[data-theme="dark"] .st-resolu { color: #2dd4bf; }
[data-theme="dark"] .st-deploye { color: #4ade80; }

.sg-type { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 650; }
.sg-type.bug { color: #b91c1c; }
.sg-type.idee { color: #a16207; }
[data-theme="dark"] .sg-type.bug { color: #f87171; }
[data-theme="dark"] .sg-type.idee { color: #facc15; }
.sg-grav { font-size: 12px; font-weight: 600; color: var(--text-muted); }
.sg-grav.fort { color: #b91c1c; }
[data-theme="dark"] .sg-grav.fort { color: #f87171; }

.sg-filtres { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.sg-filtre { border: 1px solid var(--border); border-radius: 999px; padding: 6px 12px; font-size: 12.5px; font-weight: 600;
    color: var(--text-secondary); background: var(--bg-secondary); text-decoration: none; }
.sg-filtre.is-on { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }
.sg-filtre b { margin-left: 4px; color: var(--text-primary); }

.sg-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.sg-table th { text-align: left; font-size: 11px; letter-spacing: 0.05em; text-transform: uppercase; color: var(--text-muted);
    font-weight: 600; padding: 10px 12px; border-bottom: 1px solid var(--border); }
.sg-table td { padding: 11px 12px; border-bottom: 1px solid var(--border-subtle); vertical-align: middle; }
.sg-table tr.est-nouveau td:first-child { box-shadow: inset 3px 0 0 var(--accent); }
.sg-table tr.est-choisi { background: var(--accent-soft); }
.sg-table .ref { font-family: 'JetBrains Mono', ui-monospace, monospace; font-size: 12px; color: var(--text-muted); white-space: nowrap; }
.sg-table .tt a { color: inherit; text-decoration: none; }
.sg-table .tt a:hover b { text-decoration: underline; }
.sg-table .tt b { display: block; font-weight: 600; color: var(--text-primary); }
.sg-table .tt small { color: var(--text-muted); font-size: 12px; }
.sg-table .nowrap { white-space: nowrap; }
.sg-defile { overflow-x: auto; }

.sg-chrono { list-style: none; margin: 0 0 8px; padding: 0; }
.sg-chrono li { display: grid; grid-template-columns: 22px 1fr; gap: 12px; position: relative; padding-bottom: 16px; }
.sg-chrono li::after { content: ""; position: absolute; left: 10px; top: 22px; bottom: 0; width: 2px; background: var(--border); }
.sg-chrono li:last-child::after { display: none; }
.sg-chrono .p { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; background: var(--bg-tertiary); font-size: 11px; color: var(--text-secondary); }
.sg-chrono .p.on { background: var(--accent); color: #fff; }
.sg-chrono .q { font-size: 13px; line-height: 1.45; min-width: 0; }
.sg-chrono .q small { display: block; color: var(--text-muted); font-size: 12px; }
.sg-bulle { margin-top: 6px; padding: 10px 12px; border-radius: 10px; background: var(--bg-tertiary); font-size: 13px; white-space: pre-wrap; overflow-wrap: anywhere; }
.sg-bulle.interne { background: rgba(245, 158, 11, 0.10); border: 1px dashed rgba(245, 158, 11, 0.5); }

.sg-garde { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: 12px; background: var(--accent-soft);
    border: 1px solid var(--border); font-size: 12.5px; line-height: 1.5; color: var(--text-secondary); }
.sg-garde b { color: var(--text-primary); }

.sg-parcours { display: flex; margin: 10px 0 16px; }
.sg-parcours .e { flex: 1; text-align: center; font-size: 11.5px; color: var(--text-muted); position: relative; padding-top: 22px; min-width: 0; }
.sg-parcours .e::before { content: ""; position: absolute; top: 4px; left: 50%; transform: translateX(-50%); width: 12px; height: 12px;
    border-radius: 50%; background: var(--bg-tertiary); border: 2px solid var(--border); z-index: 1; }
.sg-parcours .e::after { content: ""; position: absolute; top: 10px; left: -50%; width: 100%; height: 2px; background: var(--border); }
.sg-parcours .e:first-child::after { display: none; }
.sg-parcours .e.fait { color: var(--text-secondary); }
.sg-parcours .e.fait::before { background: var(--accent); border-color: var(--accent); }
.sg-parcours .e.fait::after { background: var(--accent); }
.sg-parcours .e.ici { color: var(--accent); font-weight: 700; }
.sg-parcours .e.ici::before { background: var(--bg-secondary); border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.sg-texte { white-space: pre-wrap; overflow-wrap: anywhere; margin: 4px 0 0; font-size: 13.5px; line-height: 1.5; }
.sg-gestes { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

/* SIGNALEMENTS — lot 2 : capture annotée, pièces jointes, jauge, « Déjà signalé ? », relecture. */
.sg-capture { border: 1px solid var(--border); border-radius: 12px; overflow: hidden; background: var(--bg-tertiary); }
.sg-capture-toile { display: block; width: 100%; height: auto; cursor: crosshair; touch-action: none; }
.sg-outils { display: flex; gap: 6px; padding: 8px 10px; border-top: 1px solid var(--border); background: var(--bg-secondary); align-items: center; flex-wrap: wrap; }
.sg-outils .esp { flex: 1; }
.sg-outil { border: 1px solid var(--border); border-radius: 8px; padding: 5px 10px; font: inherit; font-size: 12px; font-weight: 600;
    color: var(--text-secondary); background: var(--bg-secondary); cursor: pointer; }
.sg-outil:hover { border-color: var(--text-muted); color: var(--text-primary); }
.sg-outil.is-on { border-color: #ef4444; color: #b91c1c; background: rgba(239, 68, 68, 0.08); }
.sg-fichiers-liste { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 4px; font-size: 13px; color: var(--text-secondary); }
.sg-fichiers-liste li::before { content: "📎 "; }

.sg-qualite-barre { height: 8px; border-radius: 99px; background: var(--bg-tertiary); overflow: hidden; margin: 6px 0 10px; }
.sg-qualite-barre span { display: block; height: 100%; background: linear-gradient(90deg, #f59e0b, #22c55e); transition: width 0.3s; }
.sg-qualite-note { font-size: 12px; color: var(--text-muted); font-weight: 600; }
.sg-check { list-style: none; margin: 0; padding: 0; display: grid; gap: 7px; font-size: 12.5px; }
.sg-check li { display: flex; gap: 8px; align-items: flex-start; line-height: 1.4; }
.sg-check li::before { content: "✓"; flex: none; width: 18px; height: 18px; border-radius: 50%; display: grid; place-items: center;
    font-size: 11px; font-weight: 700; background: rgba(34, 197, 94, 0.15); color: #15803d; }
.sg-check li.non::before { content: "!"; background: rgba(245, 158, 11, 0.18); color: #b45309; }
.sg-check li.non.facultatif::before { content: "+"; background: var(--bg-tertiary); color: var(--text-muted); }
.sg-check li.non { color: var(--text-secondary); }

.sg-sim { display: grid; gap: 8px; }
.sg-sim-l { display: flex; gap: 10px; align-items: center; padding: 9px 10px; border: 1px solid var(--border); border-radius: 10px;
    font-size: 13px; color: var(--text-primary); text-decoration: none; }
.sg-sim-l:hover { border-color: var(--accent); }
.sg-sim-l .t { flex: 1; min-width: 0; }
.sg-sim-l .t b { display: block; font-weight: 600; }
.sg-sim-l .t small { color: var(--text-muted); display: flex; gap: 4px; align-items: center; flex-wrap: wrap; margin-top: 2px; }
.sg-plus1 { border: 1px solid var(--accent); color: var(--accent); background: var(--accent-soft); border-radius: 999px; padding: 4px 10px;
    font-size: 12px; font-weight: 600; white-space: nowrap; }

.sg-relire { margin: auto; inset: 0; width: min(720px, calc(100vw - 32px)); max-height: calc(100vh - 64px); border: 0; border-radius: 16px; padding: 24px;
    background: var(--bg-secondary); color: var(--text-primary); box-shadow: 0 24px 60px rgba(10, 20, 60, 0.35); }
.sg-relire::backdrop { background: rgba(10, 20, 60, 0.45); }
.sg-relire-dl { grid-template-columns: 180px 1fr; font-size: 13px; gap: 10px 14px; }
.sg-relire-dl dd { white-space: pre-wrap; }
.sg-relire-image { max-width: 100%; border-radius: 8px; border: 1px solid var(--border); }

.sg-pieces { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 10px; margin: 12px 0 16px; }
.sg-piece { display: grid; gap: 4px; max-width: 100%; font-size: 12px; color: var(--text-secondary); text-decoration: none; }
.sg-piece img { max-width: 100%; max-height: 360px; border-radius: 8px; border: 1px solid var(--border); }
.sg-piece.fichier { padding: 8px 12px; border: 1px solid var(--border); border-radius: 10px; color: var(--accent); font-weight: 600; }
/* Un élément masqué par le script (attribut hidden) le reste, même s'il porte une classe à display. */
#sg-brouillon[hidden], .sg-carte[hidden], .sg-capture[hidden] { display: none; }
/* SIGNALEMENTS — lot 3 : la pastille d'un signalement venu du portail concessionnaire. */
.sg-source-portail { display: inline-block; padding: 1px 7px; margin-right: 6px; border-radius: 6px; font-size: 11px; font-weight: 650;
    background: rgba(124, 58, 237, 0.10); color: #7c3aed; vertical-align: 1px; }
[data-theme="dark"] .sg-source-portail { color: #a78bfa; }

/* ══ PLANIFICATIONS D'APPROVISIONNEMENT (/reapprovisionnement/planifications) ═══════════════
   Une saison pour toutes les pelles et chargeuses. Les cartes de la liste, la table de la saison,
   le calendrier des commandes, le bandeau de l'analyse d'une machine, la bande « Saison » du
   calendrier mensuel. Mêmes jetons que l'approvisionnement expérimental (.ax-page). */
.pl-etapes { list-style: none; margin: 0 0 16px; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px; }
.pl-etapes li { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; border: 1px solid var(--border); border-radius: var(--radius-lg, 12px); background: var(--bg-secondary); }
.pl-etapes strong { display: block; font-size: 14px; color: var(--text-primary); }
.pl-etapes span:not(.pl-etape-n) { font-size: 12.5px; color: var(--text-muted); line-height: 1.4; }
.pl-etape-n { flex: none; width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); font-weight: 700; font-size: 13px; }
.pl-filtres { display: flex; gap: 8px; margin: 4px 0 14px; flex-wrap: wrap; }
.pl-cartes { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 16px; }
.pl-carte { display: flex; flex-direction: column; gap: 12px; padding: 18px; }
.pl-carte-tete { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; }
.pl-carte-nom { display: block; font-size: 17px; font-weight: 700; color: var(--text-primary); text-decoration: none; }
.pl-carte-nom:hover { color: var(--accent); }
.pl-carte-periode { font-size: 13px; color: var(--text-muted); }
.pl-avance { display: flex; flex-direction: column; gap: 6px; font-size: 12px; color: var(--text-muted); }
.pl-avance-barre { position: relative; display: flex; height: 8px; border-radius: 999px; background: var(--bg-tertiary); overflow: hidden; }
.pl-avance-barre span { background: var(--ax-ok); }
.pl-avance-barre i { background: color-mix(in srgb, var(--ax-attention) 70%, transparent); }
.pl-carte-faits { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 16px; margin: 0; }
.pl-carte-faits dt { font-size: 11.5px; text-transform: uppercase; letter-spacing: .04em; color: var(--text-muted); }
.pl-carte-faits dd { margin: 2px 0 0; font-weight: 600; font-variant-numeric: tabular-nums; color: var(--text-primary); }
.pl-carte-modifie { margin: 0; font-size: 12px; color: var(--text-muted); }
.pl-carte-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: auto; }
.pl-carte-actions a.btn-primary { text-decoration: none; }
.ax-page .rp-badge.pl-a-analyser { color: var(--text-muted); }

/* Le tiroir de création : la période sur une ligne, les machines par famille. */
.pl-periode { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.pl-tiroir-section { display: flex; justify-content: space-between; align-items: baseline; margin: 18px 0 8px; font-size: 14px; }
.pl-tiroir-section span { font-weight: 500; font-size: 12.5px; color: var(--text-muted); }
.pl-famille { border: 1px solid var(--border); border-radius: var(--radius-md, 10px); padding: 8px 12px 10px; margin: 0 0 10px; }
.pl-famille legend { padding: 0 6px; }
.pl-coche { display: flex; align-items: center; gap: 8px; cursor: pointer; font-size: 13.5px; }
.pl-coche > span:last-child { color: var(--text-muted); font-size: 12.5px; }
.pl-machines { display: grid; gap: 4px; margin-top: 4px; }
.pl-machine { padding: 3px 4px; border-radius: 6px; }
.pl-machine:hover { background: var(--bg-tertiary); }
.pl-machine .mono { font-size: 12px; min-width: 120px; color: var(--text-muted); }
.pl-machine > span:last-child { color: var(--text-primary); font-size: 13.5px; }

/* La planification : retour, table de la saison, calendrier des commandes. */
.pl-retour { display: inline-block; margin-bottom: 4px; font-size: 13px; color: var(--text-muted); text-decoration: none; }
.pl-retour:hover { color: var(--accent); }
.pl-notes { padding: 12px 16px; margin-bottom: 16px; font-size: 13.5px; }
.pl-notes p { margin: 4px 0 0; white-space: pre-line; color: var(--text-secondary, var(--text-primary)); }
.pl-section-tete { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.pl-table td { vertical-align: top; }
.pl-table .cell-title { font-weight: 600; text-decoration: none; color: var(--text-primary); display: block; }
.pl-table .cell-title:hover { color: var(--accent); }
.pl-table .cell-sub { display: block; font-size: 11.5px; color: var(--text-muted); margin-top: 2px; }
.data-table.pl-table th { white-space: normal; line-height: 1.3; }
.data-table.pl-table td, .data-table.pl-table th { padding-left: 10px; padding-right: 10px; }
.pl-note-courte { max-width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pl-ok { color: var(--ax-ok); font-weight: 700; }
.pl-actions-ligne { white-space: nowrap; text-align: right; }
.pl-actions-ligne a.btn-primary { text-decoration: none; padding: 5px 12px; font-size: 12.5px; }
.pl-attente { display: inline-block; width: 38px; height: 10px; border-radius: 6px; background: linear-gradient(90deg, var(--bg-tertiary), var(--border), var(--bg-tertiary)); background-size: 200% 100%; animation: pl-attente 1.2s linear infinite; }
@keyframes pl-attente { from { background-position: 200% 0; } to { background-position: 0 0; } }
@media (prefers-reduced-motion: reduce) { .pl-attente { animation: none; } }

.pl-engagements { display: flex; align-items: flex-end; gap: 10px; height: 170px; padding: 8px 4px 0; margin-bottom: 14px; overflow-x: auto; }
.pl-eng-col { flex: 1 0 56px; max-width: 110px; display: flex; flex-direction: column; align-items: center; gap: 4px; height: 100%; }
.pl-eng-montant { font-size: 11.5px; font-weight: 600; color: var(--text-primary); font-variant-numeric: tabular-nums; }
.pl-eng-barre { flex: 1; width: 60%; display: flex; align-items: flex-end; }
.pl-eng-barre span { display: block; width: 100%; min-height: 3px; border-radius: 6px 6px 2px 2px; background: var(--graph-5, var(--accent)); }
.pl-eng-mois { font-size: 11.5px; color: var(--text-muted); text-transform: capitalize; }
.pl-commandes .cell-sub { display: block; font-size: 11.5px; color: var(--text-muted); }
.pl-commandes a { color: var(--text-primary); font-weight: 600; text-decoration: none; }
.pl-commandes a:hover { color: var(--accent); }

/* L'analyse d'une machine dans la planification : le fil d'Ariane de l'entête, puis le bandeau
   au-dessus de la fiche du produit — retour, précédente · liste · suivante, le rail de la saison
   (une case par machine, à sa couleur d'état), les trois états en contrôle segmenté, la note.
   Les couleurs d'état sont celles de la table de la saison : gris à analyser, orange en cours,
   vert analysé — et chaque état porte aussi son symbole (○ ◐ ✓), pas seulement sa couleur. */
.pl-fil { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-bottom: 4px; font-size: 13px; color: var(--text-muted); }
.pl-fil a { color: var(--text-muted); text-decoration: none; }
.pl-fil a:hover { color: var(--accent); text-decoration: underline; }
.pl-fil [aria-current] { color: var(--text-secondary); font-weight: 600; }

.pl-bandeau { --pl-gris: var(--text-muted); --pl-orange: var(--ax-attention); --pl-vert: var(--ax-ok);
    display: flex; flex-direction: column; gap: 14px; padding: 16px 18px; margin-bottom: 16px; border-left: 4px solid var(--accent); }
.pl-bandeau-ligne { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.pl-retour-saison { gap: 6px; font-weight: 600; font-size: 13px; padding: 6px 12px; }
.pl-bandeau-nav { display: flex; align-items: center; gap: 6px; flex: 1 1 420px; justify-content: center; min-width: 0; }
.pl-bandeau-nav select { width: auto; min-width: 0; flex: 0 1 460px; font-weight: 600; }
.pl-bandeau-nav .pl-nav-pas { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; font-size: 13px; font-weight: 600; white-space: nowrap; }
.pl-bandeau-rang { font-size: 12.5px; font-weight: 600; color: var(--text-secondary); white-space: nowrap; padding: 3px 10px; border-radius: 999px; background: var(--bg-tertiary); }

.pl-rail-bloc { display: flex; flex-direction: column; gap: 6px; }
.pl-rail { display: flex; gap: 3px; }
.pl-rail-case { flex: 1 1 0; min-width: 4px; height: 10px; border-radius: 3px; background: var(--bg-tertiary); border: 1px solid var(--border); transition: transform .12s ease; }
.pl-rail-case:hover { transform: scaleY(1.5); }
.pl-rail-case.is-en-cours { background: var(--pl-orange); border-color: var(--pl-orange); }
.pl-rail-case.is-analyse { background: var(--pl-vert); border-color: var(--pl-vert); }
.pl-rail-case.est-ici { height: 16px; margin-top: -3px; outline: 2px solid var(--accent); outline-offset: 1px; }
.pl-rail-case:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.pl-rail-legende { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--text-muted); }
.pl-rail-puce { width: 10px; height: 10px; border-radius: 3px; background: var(--pl-vert); }
@media (prefers-reduced-motion: reduce) { .pl-rail-case { transition: none; } }

.pl-etats { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.pl-etats .kpi-label { margin: 0; }
.pl-etats-seg { display: inline-flex; padding: 3px; gap: 3px; border: 1px solid var(--border); border-radius: 10px; background: var(--bg-secondary); }
.pl-etat { display: inline-flex; align-items: center; gap: 6px; padding: 6px 14px; border: 1px solid transparent; border-radius: 7px; background: transparent;
    color: var(--text-secondary); font-family: inherit; font-weight: 600; font-size: 13px; line-height: 1.2; cursor: pointer; transition: background .12s ease, color .12s ease; }
.pl-etat:hover:not(:disabled) { background: var(--bg-elevated); color: var(--text-primary); border-color: var(--border); }
.pl-etat:disabled { cursor: default; }
/* Le symbole de l'état, dessiné plutôt que tiré d'une police (◐ manque à beaucoup) :
   un cercle vide, un cercle à moitié plein, une coche. */
.pl-etat-icone { display: inline-grid; place-items: center; width: 12px; height: 12px; border-radius: 50%; box-sizing: border-box; font-size: 13px; line-height: 1; }
.pl-etat.is-a-analyser .pl-etat-icone { border: 2px solid var(--pl-gris); }
.pl-etat.is-en-cours .pl-etat-icone { border: 2px solid var(--pl-orange); background: linear-gradient(90deg, var(--pl-orange) 50%, transparent 50%); }
.pl-etat.is-analyse .pl-etat-icone { width: auto; height: auto; border-radius: 0; color: var(--pl-vert); }
.pl-etat.is-on { color: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.12); }
.pl-etat.is-on .pl-etat-icone { color: #fff; border-color: #fff; }
.pl-etat.is-on.is-en-cours .pl-etat-icone { background: linear-gradient(90deg, #fff 50%, transparent 50%); }
.pl-etat.is-on.is-a-analyser { background: var(--pl-gris); }
.pl-etat.is-on.is-en-cours { background: var(--pl-orange); }
.pl-etat.is-on.is-analyse { background: var(--pl-vert); }
.pl-etat.is-on:hover { color: #fff; border-color: transparent; }
.pl-etat.is-on.is-a-analyser:hover { background: var(--pl-gris); }
.pl-etat.is-on.is-en-cours:hover { background: var(--pl-orange); }
.pl-etat.is-on.is-analyse:hover { background: var(--pl-vert); }
.pl-enchainer { font-size: 13px; padding: 7px 14px; }
.pl-sauvegarde { margin-left: auto; font-size: 12.5px; color: var(--ax-ok); }
.pl-sauvegarde.is-lecture { color: var(--draft); }
.pl-bandeau-note { margin: 0; }
.pl-bandeau-note textarea { min-height: 44px; }
@media (max-width: 720px) {
    .pl-sauvegarde { margin-left: 0; }
    .pl-bandeau-nav { flex-wrap: wrap; justify-content: flex-start; }
    .pl-bandeau-nav select { min-width: 0; flex: 1 1 100%; order: -1; }
    .pl-bandeau-nav .pl-nav-pas { flex: 1; justify-content: center; }
    .pl-etats-seg { width: 100%; }
    .pl-etat { flex: 1; justify-content: center; padding: 6px 8px; }
    .pl-periode { grid-template-columns: 1fr; }
}

/* La saison sur le calendrier mensuel : une bande teintée, un trait sous les mois. */
/* L'accent, pas la couleur des scénarios (--graph-5) : la saison est une période, pas un achat. */
.ax-saison { fill: color-mix(in srgb, var(--accent) 6%, transparent); }
.ax-saison-trait { stroke: var(--accent); stroke-width: 3; stroke-linecap: round; }
.ax-saison-texte { font-size: 11px; font-weight: 700; fill: var(--accent); text-transform: uppercase; letter-spacing: .06em; }
.data-table.pl-table th:first-child, .data-table.pl-table td:first-child,
.data-table.pl-commandes th:nth-child(-n+3), .data-table.pl-commandes td:nth-child(-n+3) { text-align: left; }
.data-table.pl-table tr.ax-plan-groupe td, .data-table.pl-commandes tr.ax-plan-groupe td {
    background: var(--bg-tertiary); font-size: 11px; font-weight: 600; letter-spacing: 0.05em;
    text-transform: uppercase; color: var(--text-muted); text-align: left;
}
.data-table.pl-commandes tr.ax-plan-groupe td.num { text-align: right; text-transform: none; font-size: 12px; color: var(--text-primary); }

/* ── Comparer des planifications : une teinte par planification (A, B, C, D) ── */
.pl-page { --pl-0: var(--graph-1); --pl-1: var(--graph-2); --pl-2: var(--graph-4); --pl-3: var(--graph-3); }
.pl-lettre { display: inline-grid; place-items: center; width: 20px; height: 20px; border-radius: 6px; color: #fff; font-size: 11.5px; font-weight: 700; flex: none; vertical-align: -4px; }
.pl-teinte-0 { background: var(--pl-0); } .pl-teinte-1 { background: var(--pl-1); }
.pl-teinte-2 { background: var(--pl-2); } .pl-teinte-3 { background: var(--pl-3); }
.pl-fond-0 { background: var(--pl-0) !important; } .pl-fond-1 { background: var(--pl-1) !important; }
.pl-fond-2 { background: var(--pl-2) !important; } .pl-fond-3 { background: var(--pl-3) !important; }
a.pl-bouton-lien { text-decoration: none; display: inline-flex; align-items: center; }
.pl-choix { display: flex; align-items: center; gap: 12px 18px; flex-wrap: wrap; padding: 14px 16px; margin-bottom: 18px; }
.pl-choix-col { display: flex; align-items: center; gap: 8px; }
.pl-choix-col select { width: auto; min-width: 240px; }
.pl-legende { list-style: none; margin: 0; padding: 0; display: flex; gap: 14px; flex-wrap: wrap; font-size: 12.5px; color: var(--text-secondary); }
.pl-legende li { display: flex; align-items: center; gap: 6px; }
.pl-engagements-compare .pl-eng-col { max-width: 140px; flex-basis: 90px; }
.pl-eng-groupe { flex: 1; width: 80%; display: flex; align-items: flex-end; gap: 3px; }
.pl-eng-groupe .pl-eng-barre { width: auto; flex: 1; height: 100%; }
.data-table.pl-compare th[scope="row"], .data-table.pl-compare th:first-child, .data-table.pl-compare td:first-child { text-align: left; }
.data-table.pl-compare th { white-space: normal; }
.data-table.pl-compare th a { color: var(--text-primary); text-decoration: none; }
.data-table.pl-compare th a:hover { color: var(--accent); }
.data-table.pl-compare tr.ax-plan-groupe td { background: var(--bg-tertiary); font-size: 11px; font-weight: 600; letter-spacing: 0.05em; text-transform: uppercase; color: var(--text-muted); text-align: left; }
.data-table.pl-compare tr.pl-compare-fort td, .data-table.pl-compare tr.pl-compare-fort th { font-weight: 700; }
.data-table.pl-compare .cell-sub { display: block; font-size: 11.5px; color: var(--text-muted); }
.pl-compare-machines td { vertical-align: top; }
.pl-compare-machines td.pl-compare-cellule { text-align: left; min-width: 200px; }
.pl-compare-tete { display: flex; align-items: center; gap: 8px; margin-bottom: 2px; }
.pl-compare-lien { display: inline-block; margin-top: 4px; font-size: 12px; color: var(--accent); text-decoration: none; }
.pl-compare-machines tr.pl-differe > td:first-child { box-shadow: inset 3px 0 0 var(--ax-attention); }
.pl-ecart { font-weight: 700; color: var(--ax-attention); }

/* ── Le menu d'une planification : la saison, optimiser les achats, PO dans Odoo ── */
.pl-nav { display: flex; gap: 6px; flex-wrap: wrap; margin: 0 0 18px; padding: 6px; border: 1px solid var(--border); border-radius: var(--radius-lg, 12px); background: var(--bg-secondary); }
.pl-nav-lien { display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px; border-radius: var(--radius-md, 10px); color: var(--text-secondary); text-decoration: none; font-weight: 600; font-size: 13.5px; }
.pl-nav-lien:hover { background: var(--bg-tertiary); color: var(--text-primary); }
.pl-nav-lien.est-actif { background: var(--accent); color: #fff; }
.pl-nav-n { display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: var(--bg-tertiary); color: var(--text-secondary); font-size: 12px; }
.pl-nav-lien.est-fait .pl-nav-n { background: var(--ax-ok); color: #fff; }
.pl-nav-lien.est-actif .pl-nav-n { background: rgba(255,255,255,.25); color: #fff; }
.pl-nav-compte { font-size: 11.5px; font-weight: 600; padding: 1px 8px; border-radius: 999px; background: var(--bg-tertiary); color: var(--text-muted); }
.pl-nav-lien.est-actif .pl-nav-compte { background: rgba(255,255,255,.2); color: #fff; }

/* ── Optimiser les achats ── */
.pl-optim-reglages { display: flex; flex-wrap: wrap; gap: 12px 20px; align-items: flex-end; padding: 14px 16px; margin-bottom: 18px; }
.pl-optim-reglages .form-field { margin: 0; min-width: 170px; }
.pl-optim-fenetres { display: flex; gap: 6px; flex-wrap: wrap; }
.pl-po-liste { display: grid; gap: 14px; }
.pl-po { padding: 14px 16px; }
.pl-po.est-ecarte { opacity: .55; }
.pl-po-tete { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; margin-bottom: 10px; }
.pl-po-tete > div:first-child { flex: 1; min-width: 200px; }
.pl-po-titre { display: block; font-size: 15.5px; }
.pl-po-sous { font-size: 12.5px; color: var(--text-muted); }
.pl-po-date { display: flex; flex-direction: column; }
.data-table.pl-po-lignes th:first-child, .data-table.pl-po-lignes td:first-child,
.data-table.pl-po-lignes th:nth-child(5), .data-table.pl-po-lignes td:nth-child(5) { text-align: left; }
.data-table.pl-po-lignes .cell-sub { display: block; font-size: 11.5px; color: var(--text-muted); }
.data-table.pl-po-lignes .cell-title { display: block; font-weight: 600; }
.pl-avance-jours { font-style: normal; font-weight: 600; color: var(--ax-attention); margin-left: 4px; }
.pl-avant { color: var(--text-muted); text-decoration: line-through; }
.pl-optim-pied { display: flex; align-items: center; justify-content: flex-end; gap: 12px; flex-wrap: wrap; margin: 18px 0 8px; }
.pl-optim-pied .ax-champ-note { flex: 1; min-width: 260px; margin: 0; }

/* ── PO dans Odoo ── */
.pl-porte { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; padding: 14px 16px; margin-bottom: 18px; border-left: 4px solid var(--text-muted); }
.pl-porte strong { display: block; font-size: 18px; margin: 2px 0; }
.pl-porte p { margin: 0; font-size: 13px; color: var(--text-secondary); max-width: 620px; }
.pl-porte-reelle { border-left-color: var(--ax-ok); }
.pl-porte-simulation { border-left-color: var(--ax-attention); }
.pl-porte-desactivee { border-left-color: var(--ax-alerte); }
.pl-porte-feux { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; font-size: 12.5px; }
.pl-porte-feux li::before { content: "●"; margin-right: 6px; }
.pl-porte-feux li.est-vert::before { color: var(--ax-ok); }
.pl-porte-feux li.est-rouge::before { color: var(--ax-alerte); }
.data-table.pl-po-odoo td { vertical-align: top; text-align: left; }
.data-table.pl-po-odoo td.num, .data-table.pl-po-odoo th.num { text-align: right; }
.pl-ligne-ecartee td { opacity: .55; }
.pl-appel summary { cursor: pointer; font-size: 12px; color: var(--accent); }
.pl-appel pre { max-width: 520px; max-height: 220px; overflow: auto; font-size: 11px; background: var(--bg-tertiary); padding: 8px; border-radius: 8px; white-space: pre-wrap; }
.pl-page { --teinte: var(--accent); }
.pl-po-bouton { display: block; margin-top: 6px; padding: 5px 12px; font-size: 12.5px; }
.data-table.pl-po-odoo td:last-child { min-width: 240px; max-width: 420px; }
.pl-appel pre { max-width: 400px; }
/* Les petites tables d'un PO groupé, empilées en cartes : ni entête ni total collants (ils se chevaucheraient d'une carte à l'autre). */
.data-table.pl-po-lignes thead th, .data-table.pl-po-lignes tfoot td { position: static; }

/* ── Analyse d'appro : le choix du produit (écran libre) ── */
.ax-choix-produit { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px 20px; padding: 14px 16px; margin-bottom: 16px; }
.ax-choix-liste, .ax-choix-autre { display: flex; flex-direction: column; gap: 4px; margin: 0; }
.ax-choix-liste select { min-width: 340px; max-width: 100%; }
.ax-choix-autre-ligne { display: flex; gap: 6px; }
.ax-choix-autre-ligne input { width: 220px; }
.ax-choix-produit > .ax-champ-note { flex-basis: 100%; margin: 0; }
@media (max-width: 720px) { .ax-choix-liste select, .ax-choix-autre-ligne input { min-width: 0; width: 100%; } .ax-choix-liste, .ax-choix-autre { flex: 1 1 100%; } }
/* Le relevé des Booking de tous les produits — le contrôle de l'analyse d'appro. */
.ax-bookings { padding: 12px 16px; margin-bottom: 16px; }
.ax-bookings > summary { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; cursor: pointer; }
.ax-bookings-resume { color: var(--text-muted); font-size: 13px; }
.ax-bookings > .ax-carte-aide, .ax-bookings > .form-banner { margin: 10px 0; }
.ax-bookings-defilement { max-height: 360px; overflow: auto; }
.ax-bookings-table th:nth-child(-n+2), .ax-bookings-table td:nth-child(-n+2) { text-align: left; }
.ax-bookings-table td .rp-badge { margin-left: 6px; }
.ax-bookings-ici td { background: var(--accent-soft); font-weight: 600; }
.ax-bookings-variante td { background: rgba(217, 119, 6, 0.08); }
.ax-bookings > .ax-champ-note { margin: 8px 0 0; }

/* ── Analyse d'appro : la sécurité proposée par le système (une proposition, jamais appliquée seule) ── */
.ax-proposition-securite { margin: 10px 0 12px; padding: 10px 12px; border: 1px dashed color-mix(in srgb, var(--teinte, var(--accent)) 55%, var(--border)); border-radius: var(--radius-md, 10px); background: color-mix(in srgb, var(--teinte, var(--accent)) 5%, transparent); display: grid; gap: 6px; }
.ax-ps-tete { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 13px; color: var(--text-secondary); }
.ax-ps-etiquette { font-size: 11px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--teinte, var(--accent)); }
.ax-ps-valeur { font-size: 17px; color: var(--text-primary); }
.ax-ps-taux { width: auto; padding: 4px 8px; font-size: 13px; }
.ax-ps-detail { margin: 0; font-size: 12px; color: var(--text-muted); line-height: 1.45; }
.ax-ps-pied { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.ax-ps-actuel { font-size: 12.5px; color: var(--text-secondary); }
.ax-ps-actuel.est-ok { color: var(--ax-ok); font-weight: 600; }
.ax-ps-pied .btn-secondary { padding: 5px 12px; font-size: 12.5px; }


/* ── Le rapport exécutif d'une planification (…/rapport) : la saison en une page, pour la direction.
   Un seul aplat de marque (le chiffre de tête : le bleu RIPPA et sa tapisserie de mini-pelles, les
   jetons --fond-* et leur encre blanche, lisibles dans les deux thèmes) ; tout le reste sur
   les cartes habituelles. Acompte = --graph-1, solde = --graph-2 (validés ensemble, clair et sombre),
   cumul à l'accent dans son PROPRE graphique : jamais deux échelles sur le même. */
.pl-rx { display: flex; flex-direction: column; gap: 16px; }
.pl-rx-hero {
    display: flex; justify-content: space-between; align-items: center; gap: 24px; flex-wrap: wrap;
    padding: 28px 32px; border-radius: var(--radius-xl, 24px); color: var(--fond-encre);
    background: var(--fond-motif), var(--fond-degrade); box-shadow: var(--shadow-md, var(--shadow-sm));
    -webkit-print-color-adjust: exact; print-color-adjust: exact;
}
.pl-rx-hero-texte { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.pl-rx-statut { align-self: flex-start; display: inline-flex; align-items: center; gap: 6px; padding: 4px 12px; border-radius: 999px; background: rgba(255,255,255,.16); font-size: 12.5px; font-weight: 600; }
.pl-rx-statut.est-confirme { background: rgba(255,255,255,.95); color: #15803d; }
.pl-rx-saison { font-size: 13.5px; color: var(--fond-encre-2); }
.pl-rx-libelle { margin-top: 10px; font-size: 12px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--fond-encre-2); }
.pl-rx-montant { font-size: clamp(34px, 6vw, 56px); line-height: 1; font-weight: 800; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; }
.pl-rx-faits { font-size: 14px; color: var(--fond-encre-2); }
.pl-rx-sep { margin: 0 6px; }
.pl-rx-anneau { position: relative; flex: none; width: 128px; height: 128px; }
.pl-rx-anneau svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.pl-rx-anneau circle { fill: none; stroke-width: 10; }
.pl-rx-anneau-fond { stroke: var(--fond-trait); }
.pl-rx-anneau-plein { stroke: var(--fond-encre); stroke-linecap: round; transition: stroke-dasharray .4s ease; }
.pl-rx-anneau-valeur { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.pl-rx-anneau-valeur strong { font-size: 26px; font-weight: 800; font-variant-numeric: tabular-nums; }
.pl-rx-anneau-valeur small { font-size: 11px; color: var(--fond-encre-2); }

.pl-rx-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.pl-rx-kpi { display: flex; flex-direction: column; gap: 4px; padding: 16px 18px; border: 1px solid var(--border); border-radius: var(--radius-lg, 16px); background: var(--bg-secondary); box-shadow: var(--shadow-sm); }
.pl-rx-kpi strong { font-size: 24px; font-weight: 750; letter-spacing: -0.01em; color: var(--text-primary); font-variant-numeric: tabular-nums; }
.pl-rx-kpi .kpi-sub { font-size: 12.5px; color: var(--text-muted); }

.pl-rx-carte { padding: 18px 20px; }
.pl-rx-carte .section-title { margin-top: 0; }
.pl-rx-carte-tete { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px 20px; flex-wrap: wrap; }
.pl-rx-legende { margin: 10px 0 6px; }
.pl-rx-pastille { display: inline-block; width: 12px; height: 12px; border-radius: 4px; }
.pl-rx-trait { display: inline-block; width: 16px; height: 2px; border-radius: 2px; background: var(--accent); }
.pl-rx-paiement { background: var(--graph-1); }

.pl-rx-graphe { overflow-x: auto; }
.pl-rx-barres { display: flex; align-items: flex-end; gap: 8px; height: 220px; padding: 8px 4px 0; min-width: min-content; border-bottom: 1px solid var(--border); }
.pl-rx-col { flex: 1 0 88px; max-width: 120px; height: 100%; display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 0 2px; border-radius: 8px; }
.pl-rx-col.est-courant { background: var(--accent-soft); }
.pl-rx-col.est-passe .pl-rx-pile { opacity: .45; }
.pl-rx-col-valeur { min-height: 15px; font-size: 11px; font-weight: 600; color: var(--text-secondary); white-space: nowrap; font-variant-numeric: tabular-nums; }
.pl-rx-col-valeur.est-pointe { font-weight: 700; color: var(--text-primary); }
/* La barre du mois : les PO payés ce mois-là. */
.pl-rx-pile { flex: 1; width: 64%; display: flex; flex-direction: column; justify-content: flex-end; gap: 2px; }
.pl-rx-pile span { display: block; width: 100%; min-height: 3px; border-radius: 2px; }
.pl-rx-pile span:first-child { border-radius: 4px 4px 2px 2px; }
.pl-rx-col-mois { padding-bottom: 4px; font-size: 11.5px; color: var(--text-muted); text-transform: capitalize; white-space: nowrap; }
.pl-rx-cumul { margin-top: 14px; }
.pl-rx-cumul-titre { display: block; font-size: 12.5px; color: var(--text-secondary); margin-bottom: 4px; }
.pl-rx-cumul svg { display: block; width: 100%; min-width: 300px; height: 70px; overflow: visible; }
.pl-rx-cumul-aire { fill: var(--accent-soft); }
.pl-rx-cumul-ligne { fill: none; stroke: var(--accent); stroke-width: 2; vector-effect: non-scaling-stroke; stroke-linejoin: round; }

.pl-rx-deux { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 16px; }
.pl-rx-deux > * { min-width: 0; } /* un tableau large défile dans sa carte, il n'élargit pas la page */
.pl-rx-parts { list-style: none; margin: 0 0 10px; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.pl-rx-parts li { display: grid; grid-template-columns: minmax(120px, 1.2fr) 2fr auto; align-items: center; gap: 12px; }
.pl-rx-part-nom { min-width: 0; }
.pl-rx-part-nom .cell-title { display: block; font-weight: 600; font-size: 13.5px; color: var(--text-primary); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pl-rx-part-nom .cell-sub { display: block; font-size: 11.5px; color: var(--text-muted); }
.pl-rx-part-barre { height: 10px; border-radius: 999px; background: var(--bg-tertiary); overflow: hidden; }
.pl-rx-part-barre span { display: block; height: 100%; border-radius: 999px; background: var(--accent); }
.pl-rx-autres .pl-rx-part-barre span { background: var(--text-muted); }
.pl-rx-deplier { display: flex; align-items: center; gap: 6px; max-width: 100%; padding: 0; border: 0; background: none; font: inherit; color: inherit; cursor: pointer; text-align: left; }
.pl-rx-deplier:hover .cell-title, .pl-rx-deplier:focus-visible .cell-title { color: var(--accent); }
.pl-rx-chevron { flex: none; width: 12px; font-size: 12px; color: var(--text-muted); }
.pl-rx-parts li.pl-rx-autres-detail { display: block; padding: 4px 0 4px 18px; border-left: 2px solid var(--border); }
.pl-rx-autres-detail .pl-rx-parts { margin: 0; gap: 8px; }
.pl-rx-part-valeur { display: flex; flex-direction: column; align-items: flex-end; font-variant-numeric: tabular-nums; }
.pl-rx-part-valeur strong { font-size: 13.5px; color: var(--text-primary); }
.pl-rx-part-valeur small { font-size: 11.5px; color: var(--text-muted); }

.pl-rx-alertes { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.pl-rx-alerte { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border-radius: var(--radius-md, 12px); border-left: 4px solid var(--text-muted); background: var(--bg-tertiary); font-size: 13.5px; line-height: 1.45; color: var(--text-primary); }
.pl-rx-alerte-icone { flex: none; display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; color: #fff; font-size: 12px; font-weight: 800; background: var(--text-muted); }
.pl-rx-alerte.est-alerte { border-left-color: var(--ax-alerte); }
.pl-rx-alerte.est-alerte .pl-rx-alerte-icone { background: var(--ax-alerte); }
.pl-rx-alerte.est-attention { border-left-color: var(--ax-attention); }
.pl-rx-alerte.est-attention .pl-rx-alerte-icone { background: var(--ax-attention); }
.pl-rx-alerte.est-info { border-left-color: var(--accent); }
.pl-rx-alerte.est-info .pl-rx-alerte-icone { background: var(--accent); }
.pl-rx-rien { display: flex; gap: 8px; align-items: center; margin: 0; font-size: 14px; color: var(--text-primary); }
.pl-rx-rien span { color: var(--ax-ok); font-weight: 800; }

.pl-rx-saison-grille { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; margin-top: 8px; }
.pl-rx-saison-case { display: flex; flex-direction: column; gap: 6px; padding: 12px 14px; border-radius: var(--radius-md, 12px); background: var(--bg-tertiary); }
.pl-rx-saison-case strong { font-size: 22px; font-weight: 750; color: var(--text-primary); font-variant-numeric: tabular-nums; }
.pl-rx-saison-case .kpi-sub { font-size: 12px; color: var(--text-muted); }
.pl-rx-jauge { display: flex; gap: 2px; height: 8px; border-radius: 999px; overflow: hidden; background: var(--border); }
.pl-rx-jauge span { display: block; height: 100%; }
.pl-rx-jauge-ok { background: var(--ax-ok); }
.pl-rx-jauge-moyen { background: var(--ax-attention); }
.pl-rx-jauge-mal { background: var(--ax-alerte); }

/* La logistique (étape 4) résumée : le verdict, cinq cases, une bande d'occupation. */
.pl-rx-lien { font-size: 13px; font-weight: 600; color: var(--accent); text-decoration: none; white-space: nowrap; }
.pl-rx-lien:hover { text-decoration: underline; }
.pl-rx-lg-verdict { display: flex; gap: 10px; align-items: flex-start; margin: 8px 0 4px; padding: 10px 12px; border-radius: var(--radius-md, 12px); border-left: 4px solid var(--accent); background: var(--bg-tertiary); }
.pl-rx-lg-verdict > div { display: flex; flex-direction: column; gap: 2px; }
.pl-rx-lg-verdict strong { font-size: 15px; color: var(--text-primary); }
.pl-rx-lg-verdict span:not(.pl-rx-alerte-icone) { font-size: 13px; color: var(--text-secondary); }
.pl-rx-lg-verdict .pl-rx-alerte-icone { background: var(--accent); }
.pl-rx-lg-verdict.est-ok { border-left-color: var(--ax-ok); }
.pl-rx-lg-verdict.est-ok .pl-rx-alerte-icone { background: var(--ax-ok); }
.pl-rx-lg-verdict.est-attention { border-left-color: var(--ax-attention); }
.pl-rx-lg-verdict.est-attention .pl-rx-alerte-icone { background: var(--ax-attention); }
.pl-rx-lg-verdict.est-alerte { border-left-color: var(--ax-alerte); }
.pl-rx-lg-verdict.est-alerte .pl-rx-alerte-icone { background: var(--ax-alerte); }
.pl-rx-alerte.est-ok { border-left-color: var(--ax-ok); }
.pl-rx-lg-bande { margin-top: 14px; }
.pl-rx-lg-bande svg { display: block; width: 100%; height: 76px; overflow: visible; border-bottom: 1px solid var(--border); }
.pl-rx-lg-deborde { fill: var(--ax-alerte); opacity: .12; }
.pl-rx-lg-capacite { stroke: var(--text-primary); stroke-width: 1.5; stroke-dasharray: 6 4; vector-effect: non-scaling-stroke; }
.pl-rx-lg-bornes { display: flex; justify-content: space-between; margin-top: 4px; font-size: 11px; color: var(--text-muted); text-transform: capitalize; }

.data-table.pl-rx-echeancier td { vertical-align: top; }
.data-table.pl-rx-echeancier .cell-sub { display: block; font-size: 11.5px; color: var(--text-muted); }
/* Un nom de fournisseur passe à la ligne : sans cela, il dicte la largeur du tableau (et la réduction à l'impression). */
.data-table.pl-rx-echeancier td.pl-rx-fournisseur { white-space: normal; min-width: 150px; max-width: 220px; }
.data-table.pl-rx-echeancier thead th, .data-table.pl-rx-echeancier tfoot td { position: static; }

@media (max-width: 720px) {
    .pl-rx-hero { padding: 22px 20px; }
    .pl-rx-anneau { width: 104px; height: 104px; }
    .pl-rx-kpi { padding: 12px 14px; }
    .pl-rx-kpi strong { font-size: 19px; }
    .pl-rx-deux { grid-template-columns: 1fr; }
    .pl-rx-parts li { grid-template-columns: 1fr auto; }
    .pl-rx-part-barre { grid-column: 1 / -1; grid-row: 2; }
}
@media (prefers-reduced-motion: reduce) { .pl-rx-anneau-plein { transition: none; } }

/* ── La logistique d'une planification (…/logistique) : l'entrepôt, l'atelier PDI et le quai devant tout ce
   qui arrive et sort. Le verdict reprend l'aplat de marque du rapport exécutif ; les hypothèses vivent dans
   une colonne collante à gauche, les graphiques à droite partagent la MÊME grille de semaines (une colonne
   par semaine : survoler l'une la montre partout). Couleurs : familles = --graph-1 (mini-pelles), --graph-2
   (chargeuses), --graph-4 (autres) ; flux = --graph-6 (achats passés), --graph-4 (scénarios), --graph-5
   (sorties) — validés en clair ; « estimé » (PO proposés, prévision) = la même teinte, estompée. Le statut
   (--ax-*) ne sert qu'au statut : au-delà de la capacité, débordement. Jamais deux échelles sur un graphique. */
.pl-lg { display: flex; flex-direction: column; gap: 16px; }
.pl-lg-lecture { display: flex; align-items: center; gap: 12px; margin: 0 0 12px; font-size: 13px; color: var(--text-secondary); }
.pl-lg-lecture-barre { flex: 0 0 180px; height: 6px; border-radius: 999px; background: var(--bg-tertiary); overflow: hidden; }
.pl-lg-lecture-barre span { display: block; height: 100%; background: var(--accent); transition: width .3s ease; }

.pl-lg-verdict { font-size: clamp(26px, 4.4vw, 42px); line-height: 1.1; font-weight: 800; letter-spacing: -0.02em; }
.pl-lg-jauges { display: flex; gap: 28px; flex-wrap: wrap; }
.pl-lg-jauge { display: flex; flex-direction: column; align-items: center; gap: 4px; text-align: center; max-width: 170px; }
.pl-lg-jauge .pl-rx-anneau-valeur strong { font-size: 22px; }
.pl-lg-jauge-titre { font-size: 12.5px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; }
.pl-lg-jauge-sous { font-size: 12px; color: var(--fond-encre-2); }
.pl-lg-jauge-etat { margin-top: 2px; padding: 2px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; background: rgba(255,255,255,.95); color: #15803d; }
.pl-lg-jauge.est-attention .pl-lg-jauge-etat { color: #c2410c; }
.pl-lg-jauge.est-alerte .pl-lg-jauge-etat { color: #b91c1c; }
.pl-lg-jauge.est-alerte .pl-rx-anneau-plein { stroke: #fecaca; }
.pl-lg-jauge.est-attention .pl-rx-anneau-plein { stroke: #fed7aa; }

.pl-lg-kpis { grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); }
.pl-lg-kpis .pl-rx-kpi strong small { font-size: 14px; font-weight: 600; color: var(--text-muted); }
.pl-rx-kpi.est-alerte { border-color: color-mix(in srgb, var(--ax-alerte) 45%, var(--border)); box-shadow: inset 4px 0 0 var(--ax-alerte), var(--shadow-sm); }

/* Les deux colonnes : hypothèses (collantes) | graphiques. */
.pl-lg-corps { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 16px; align-items: start; }
.pl-lg-hypotheses { position: sticky; top: 12px; padding: 16px 18px; display: flex; flex-direction: column; gap: 10px; max-height: calc(100vh - 24px); overflow-y: auto; }
.pl-lg-hyp-tete { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.pl-lg-hyp-tete .section-title { margin: 0; }
.pl-lg-modifie { background: color-mix(in srgb, var(--ax-attention) 16%, transparent); color: var(--ax-attention); font-weight: 700; }
.pl-lg-groupe { margin: 0; padding: 10px 0 2px; border: 0; border-top: 1px solid var(--border); display: flex; flex-direction: column; gap: 10px; }
.pl-lg-groupe legend { padding: 0 6px 0 0; font-size: 11.5px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--text-muted); }
.pl-lg-champ { margin: 0; gap: 4px; }
.pl-lg-champ label { font-size: 13px; font-weight: 600; color: var(--text-primary); }
.pl-lg-champ .input { width: 100%; font-variant-numeric: tabular-nums; }
.pl-lg-aide { font-size: 11.5px; line-height: 1.4; color: var(--text-muted); }
.pl-lg-curseur { display: grid; grid-template-columns: 1fr 128px; align-items: center; gap: 10px; }
.pl-lg-curseur input[type=range] { width: 100%; accent-color: var(--accent); }
.pl-lg-trio { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.pl-lg-trio .pl-lg-champ label { font-size: 12px; font-weight: 600; color: var(--text-secondary); }
.pl-lg-duo { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.pl-lg-duo .pl-lg-champ label { font-size: 12px; font-weight: 600; color: var(--text-secondary); }
.pl-lg-derive { margin: -2px 0 0; font-size: 12.5px; font-weight: 700; color: var(--accent); }
.pl-lg-references { display: flex; flex-wrap: wrap; gap: 6px; }
.pl-lg-references .chip-toggle { font-size: 12px; }
.pl-lg-bascule { display: flex; gap: 8px; align-items: flex-start; font-size: 13px; color: var(--text-primary); cursor: pointer; }
.pl-lg-bascule input { margin-top: 2px; accent-color: var(--accent); }
.pl-lg-familles { display: flex; flex-wrap: wrap; gap: 6px; }
.pl-lg-familles .chip-toggle { display: inline-flex; align-items: center; gap: 6px; }
.pl-lg-hyp-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* LA LOGISTIQUE D'OPÉRATION (/preparation/logistique) : la fenêtre (horizon en direct, ou une
   planification projetée) au-dessus du consolidé commun (LogistiqueConsolide). */
.ol-projection { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px 24px; padding: 14px 18px; margin-bottom: 16px; }
.ol-projection-choix { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.ol-projection-libelle { font-size: 11.5px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--text-muted); margin-right: 4px; }
.ol-projection-plan { margin: 0; min-width: 260px; flex: 0 1 380px; }
.ol-projection-plan label { font-size: 11.5px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--text-muted); }
.ol-projection-note { flex: 1 1 100%; margin: 0; }
.ol-reprendre { justify-self: start; align-self: flex-start; }

/* Les bilans du consolidé logistique : « Au plus chargé » puis « Bilan par machine », chacun sur toute la
   largeur — le bilan se lit d'un coup d'œil, sans défiler de gauche à droite. */
/* Les trois vues de la logistique d'opération : vue d'ensemble · semaine · comparer. */
.ol-vues { display: inline-flex; gap: 0; margin: 0 0 16px; border: 1px solid var(--border); border-radius: var(--radius-sm); overflow: hidden; max-width: 100%; }
.ol-vue { border: 0; background: var(--bg-elevated); color: var(--text-secondary); font: 600 13.5px/1 'Inter', system-ui, sans-serif; padding: 9px 18px; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.ol-vue + .ol-vue { border-left: 1px solid var(--border); }
.ol-vue:hover { color: var(--text-primary); }
.ol-vue.est-active { background: var(--accent-soft); color: var(--accent); }
.ol-vue-compte { font-size: 11px; padding: 1px 7px; border-radius: 999px; background: var(--accent); color: #fff; }

/* La feuille de la semaine. */
.ol-semaine { display: flex; flex-direction: column; gap: 16px; }
.ol-semaine-tete { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; }
.ol-semaine-titre { flex: 1 1 260px; display: flex; flex-direction: column; gap: 2px; }
.ol-semaine-titre .section-title { margin: 0; }
.ol-semaine-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.ol-semaine-kpis { grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); }
.ol-semaine-deux { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(460px, 100%), 1fr)); gap: 16px; }
.ol-semaine-deux > * { min-width: 0; }
.data-table.ol-semaine-table thead th { position: static; padding: 8px 10px; white-space: normal; }
.data-table.ol-semaine-table tbody td { padding: 7px 10px; white-space: normal; }
.data-table.ol-semaine-table tbody td.num { white-space: nowrap; }
.data-table.ol-semaine-table tbody th { text-align: left; padding: 7px 10px; font-weight: 600; color: var(--text-secondary); white-space: nowrap; }
.data-table.ol-semaine-jours th.est-aujourdhui { color: var(--accent); }
.data-table.ol-semaine-table td.ol-semaine-machine { text-align: left; }
.data-table.ol-semaine-table td.ol-semaine-jour { white-space: nowrap; text-align: left; }
.data-table.ol-semaine-table td.ol-semaine-jour .cell-sub { color: inherit; font-weight: 600; }
.ol-semaine-machine strong { display: block; }
.ol-semaine-machine .cell-sub { font-size: 11px; }
.data-table.ol-semaine-table td.ol-semaine-liste { text-align: left; white-space: normal; font-size: 12.5px; }
.ol-semaine-retard td { color: var(--ax-alerte, #dc2626); }
.ol-semaine-atelier { margin: 4px 0 8px; }
.ol-semaine-phrase { margin: 0; font-weight: 600; font-size: 13.5px; }

/* Les « et si ». */
.ol-comparer { display: flex; flex-direction: column; gap: 16px; }
.ol-comparer-tete { display: flex; flex-direction: column; gap: 10px; }
.ol-comparer-tete .section-title { margin: 0 0 4px; }
.ol-comparer-ajouts { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
/* Colonnes égales (table-layout: fixed) : avec quatre variantes, les six colonnes se partagent la largeur
   au lieu de pousser la dernière hors de l'écran ; le texte d'une cellule passe à la ligne. La largeur
   plancher (style en ligne, posée par le composant) fait défiler le tableau sur un téléphone. */
.data-table.ol-comparer-table { table-layout: fixed; }
.ol-comparer-col-libelle { width: 200px; }
.data-table.ol-comparer-table thead th { position: static; vertical-align: top; padding: 8px; text-transform: none; letter-spacing: 0; }
.data-table.ol-comparer-table tbody th { text-align: left; font-weight: 600; color: var(--text-secondary); padding: 7px 10px; white-space: normal; }
.data-table.ol-comparer-table tbody td { padding: 6px 8px; white-space: normal; overflow-wrap: break-word; }
.ol-comparer-groupe th { background: var(--bg-tertiary); font-size: 11px !important; letter-spacing: .06em; text-transform: uppercase; color: var(--text-muted) !important; }
.ol-comparer-actuel { background: color-mix(in srgb, var(--accent-soft) 55%, transparent); font-weight: 600; }
.ol-comparer-nom { display: block; width: 100%; min-width: 0; font-weight: 600; resize: none; overflow: hidden; line-height: 1.3; height: auto; padding: 6px 8px; text-align: center; field-sizing: content; min-height: 0; }
.ol-comparer-boutons { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; justify-content: center; }
.ol-comparer-boutons button { padding: 4px 10px; font-size: 12px; }
.ol-comparer-saisie { width: 100%; max-width: 96px; min-width: 0; text-align: center; font-variant-numeric: tabular-nums; }
@media (max-width: 760px) { .ol-comparer-col-libelle { width: 132px; } .data-table.ol-comparer-table tbody th { padding: 7px 8px; font-size: 12.5px; } .data-table.ol-comparer-table tbody td { font-size: 12.5px; padding: 6px 4px; } }
/* Le libellé d'un groupe (« Hypothèses », « Résultat ») suit le défilement : sa cellule couvre toute la largeur. */
.ol-comparer-groupe-texte { position: sticky; left: 10px; }
.ol-comparer-saisie.est-change { border-color: var(--accent); background: var(--accent-soft); }
.ol-comparer-erreur { display: block; margin-top: 6px; font-size: 11.5px; color: var(--ax-alerte, #dc2626); white-space: normal; font-weight: 500; text-transform: none; }
.data-table.ol-comparer-table td.ol-comparer-mieux { color: var(--ax-ok, #16a34a); font-weight: 700; }
.data-table.ol-comparer-table td.ol-comparer-moins { color: var(--ax-alerte, #dc2626); font-weight: 700; }
.ol-comparer-verdict { font-weight: 700; }
.ol-comparer-verdict.est-ok { color: var(--ax-ok, #16a34a); }
.ol-comparer-verdict.est-attention { color: var(--ax-attention, #ea580c); }
.ol-comparer-verdict.est-alerte { color: var(--ax-alerte, #dc2626); }

.ol-rapprochement { padding: 14px 18px; margin-bottom: 16px; }
.ol-rapprochement > summary { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 14px; cursor: pointer; list-style: none; }
.ol-rapprochement > summary::-webkit-details-marker { display: none; }
.ol-rapprochement > summary::before { content: "▸"; color: var(--text-muted); }
.ol-rapprochement[open] > summary::before { content: "▾"; }
.ol-rapprochement[open] > summary { margin-bottom: 10px; }
.ol-rap-resume { font-size: 13.5px; font-weight: 600; }
.ol-rap-resume.est-ok { color: var(--ax-ok, #16a34a); }
.ol-rap-resume.est-attention { color: var(--ax-attention, #ea580c); }
.data-table.ol-rap-table thead th { padding: 8px 10px; white-space: normal; position: static; }
.data-table.ol-rap-table tbody td, .data-table.ol-rap-table tfoot td { padding: 6px 10px; }
.data-table.ol-rap-table th:first-child, .data-table.ol-rap-table td:first-child { text-align: left; }
.data-table.ol-rap-table td.ol-rap-constat { text-align: left; white-space: normal; min-width: 260px; font-size: 12.5px; }
.data-table.ol-rap-table tr.ol-rap-ecart td.ol-rap-constat { color: var(--ax-attention, #ea580c); font-weight: 600; }
.pl-lg-bilans { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.pl-lg-bilans > * { min-width: 0; }
.pl-lg-pic .pl-rx-parts { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(420px, 100%), 1fr)); gap: 10px 36px; }
.data-table.pl-lg-bilan thead th { padding: 8px 10px; white-space: normal; line-height: 1.25; vertical-align: bottom; }
.data-table.pl-lg-bilan tbody td, .data-table.pl-lg-bilan tfoot td { padding: 6px 10px; }
.data-table.pl-lg-bilan td.num { font-size: 14px; }
.data-table.pl-lg-bilan th:first-child, .data-table.pl-lg-bilan td:first-child { text-align: left; }
.pl-lg-bilan-cel { display: flex; align-items: center; gap: 8px; max-width: 420px; }
.pl-lg-bilan-nom { display: flex; flex-direction: column; min-width: 0; }
.pl-lg-bilan-nom strong { white-space: normal; overflow-wrap: anywhere; }
.pl-lg-bilan-nom .cell-sub { font-size: 11px; }
/* Les commandes à expédier : date promise, départ prévu, date posée à la main. */
.pl-lg-expeditions > summary { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 14px; }
.pl-lg-exp-resume { font-size: 13px; font-weight: 600; color: var(--ax-attention, #ea580c); text-transform: none; letter-spacing: 0; }
.pl-lg-exp-outils { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 18px; margin: 10px 0; }
.pl-lg-exp-outils .ax-champ-note { margin: 0; flex: 1 1 320px; }
.data-table.pl-lg-exp-table thead th { padding: 8px 10px; white-space: normal; position: static; }
.data-table.pl-lg-exp-table tbody td { padding: 6px 10px; text-align: left; }
.data-table.pl-lg-exp-table tbody td.num { text-align: right; }
.data-table.pl-lg-exp-table td.pl-lg-exp-client { white-space: normal; min-width: 140px; }
.data-table.pl-lg-exp-table tr.pl-lg-exp-attention td:first-child strong { color: var(--ax-attention, #ea580c); }
.pl-lg-exp-imposer { display: flex; gap: 6px; align-items: center; }
.pl-lg-exp-imposer .input { width: 150px; padding: 4px 8px; }
.pl-lg-exp-retirer { padding: 2px 9px; font-size: 15px; line-height: 1.2; }
.ol-sauvegarde { font-weight: 600; }
.ol-sauvegarde-ok { color: var(--ax-ok, #1f7a4d); }
.ol-sauvegarde-erreur { color: var(--danger, #c0392b); }

/* La gouttière de gauche est commune aux graphiques et au calendrier des arrivées : l'axe Y d'un côté,
   le nom des machines de l'autre, et les semaines tombent pile l'une sous l'autre d'un graphique à l'autre. */
.pl-lg-graphes { --pl-lg-gouttiere: 150px; display: flex; flex-direction: column; gap: 16px; min-width: 0; }

/* La semaine montrée : collante au-dessus des graphiques. */
.pl-lg-semaine { position: sticky; top: 12px; z-index: 3; padding: 12px 16px; display: flex; flex-direction: column; gap: 8px; box-shadow: var(--shadow-md, var(--shadow-sm)); }
.pl-lg-semaine-tete { display: flex; align-items: center; gap: 12px; }
.pl-lg-semaine-tete > div { flex: 1; display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.pl-lg-semaine-tete strong { font-size: 15px; color: var(--text-primary); }
.pl-lg-capitale { display: inline-block; }
.pl-lg-capitale::first-letter { text-transform: uppercase; }
.pl-lg-semaine-note { font-size: 12px; color: var(--text-muted); }
.pl-lg-fleche { width: 30px; height: 30px; border-radius: 50%; border: 1px solid var(--border); background: var(--bg-secondary); color: var(--text-primary); font-size: 18px; line-height: 1; cursor: pointer; }
.pl-lg-fleche:hover:not(:disabled) { border-color: var(--accent); color: var(--accent); }
.pl-lg-fleche:disabled { opacity: .35; cursor: default; }
.pl-lg-semaine-chiffres { display: grid; grid-template-columns: repeat(auto-fit, minmax(118px, 1fr)); gap: 8px; margin: 0; }
.pl-lg-semaine-chiffres > div { padding: 6px 10px; border-radius: var(--radius-md, 10px); background: var(--bg-tertiary); }
.pl-lg-semaine-chiffres > div.est-alerte { background: color-mix(in srgb, var(--ax-alerte) 12%, var(--bg-tertiary)); box-shadow: inset 3px 0 0 var(--ax-alerte); }
.pl-lg-semaine-chiffres dt { font-size: 11px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--text-muted); }
.pl-lg-semaine-chiffres dd { margin: 2px 0 0; font-size: 17px; font-weight: 750; color: var(--text-primary); font-variant-numeric: tabular-nums; }
.pl-lg-semaine-chiffres dd small { font-size: 11.5px; font-weight: 600; color: var(--text-muted); }
.pl-lg-semaine-machines { margin: 0; font-size: 12.5px; color: var(--text-secondary); }

/* Les graphiques : axe Y en HTML, zone SVG étirée, cibles par semaine, mois en HTML. */
.pl-lg-graphe { display: grid; grid-template-columns: var(--pl-lg-gouttiere, 44px) minmax(calc(var(--n, 52) * 11px), 1fr); grid-template-rows: auto auto; overflow-x: auto; padding-top: 6px; }
.pl-lg-axe-y { position: relative; grid-row: 1; grid-column: 1; }
.pl-lg-axe-y span { position: absolute; right: 8px; transform: translateY(50%); font-size: 11px; color: var(--text-muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.pl-lg-zone { position: relative; grid-row: 1; grid-column: 2; border-bottom: 1px solid var(--border); }
.pl-lg-zone-haute { height: 260px; }
.pl-lg-zone-moyenne { height: 200px; }
.pl-lg-zone-basse { height: 90px; }
.pl-lg-zone svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.pl-lg-axe-x { position: relative; grid-row: 2; grid-column: 2; height: 34px; }
.pl-lg-mois { position: absolute; top: 4px; padding-left: 3px; border-left: 1px solid var(--border); font-size: 11px; color: var(--text-muted); text-transform: capitalize; white-space: nowrap; }
.pl-lg-saison-barre { position: absolute; top: 21px; height: 11px; border-radius: 999px; background: var(--accent-soft); color: var(--accent); font-size: 9.5px; font-weight: 700; line-height: 11px; text-align: center; letter-spacing: .08em; text-transform: uppercase; overflow: hidden; }
.pl-lg-cibles { position: absolute; inset: 0; display: grid; }
.pl-lg-cible { cursor: crosshair; }
.pl-lg-cible:hover { background: color-mix(in srgb, var(--text-primary) 4%, transparent); }
/* Le graphique des flux s'ouvre au clic : une barre se choisit, son détail se déplie sous le graphique. */
.pl-lg-cibles.est-cliquable .pl-lg-cible { cursor: pointer; }
.pl-lg-cibles.est-cliquable .pl-lg-cible.est-ouverte { box-shadow: inset 0 0 0 2px var(--accent); border-radius: 4px; }
.pl-lg-flux-invite { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; margin-top: 6px; font-size: 12.5px; color: var(--text-muted); }
.pl-lg-flux-detail { margin-top: 10px; padding: 12px 14px 14px; border: 1px solid var(--border); border-top: 3px solid var(--accent); border-radius: var(--radius-md, 10px); background: color-mix(in srgb, var(--accent) 3%, var(--bg-secondary)); display: flex; flex-direction: column; gap: 12px; }
.pl-lg-flux-detail-tete { display: flex; align-items: center; gap: 10px; }
.pl-lg-flux-detail-tete > div { flex: 1; display: flex; align-items: baseline; flex-wrap: wrap; gap: 6px 14px; }
.pl-lg-flux-detail-tete strong { font-size: 15px; color: var(--text-primary); }
.pl-lg-fermer { margin-left: 4px; }
.pl-lg-flux-bilan { display: inline-flex; flex-wrap: wrap; gap: 6px; font-size: 12.5px; font-weight: 650; font-variant-numeric: tabular-nums; }
.pl-lg-flux-bilan > span { padding: 2px 9px; border-radius: 999px; background: var(--bg-tertiary); color: var(--text-secondary); }
.pl-lg-flux-bilan .est-entre { background: color-mix(in srgb, var(--graph-6) 16%, var(--bg-secondary)); color: var(--text-primary); }
.pl-lg-flux-bilan .est-sort { background: color-mix(in srgb, var(--graph-5) 16%, var(--bg-secondary)); color: var(--text-primary); }
.pl-lg-flux-bilan .est-net.est-negatif { color: var(--ax-attention, #ea580c); }
.pl-lg-flux-cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(380px, 100%), 1fr)); gap: 14px 22px; align-items: start; }
.pl-lg-flux-col { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.pl-lg-flux-titre { display: flex; align-items: baseline; justify-content: space-between; margin: 0; padding-bottom: 6px; border-bottom: 1px solid var(--border); font-size: 12px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--text-muted); }
.pl-lg-flux-titre span { font-size: 14px; letter-spacing: 0; text-transform: none; color: var(--text-primary); font-variant-numeric: tabular-nums; }
.pl-lg-flux-ref { font-size: 13.5px; color: var(--text-primary); font-variant-numeric: tabular-nums; }
a.pl-lg-flux-lien { font-weight: 700; color: var(--accent); text-decoration: none; border-radius: 4px; }
a.pl-lg-flux-lien:hover { text-decoration: underline; text-underline-offset: 3px; }
a.pl-lg-flux-lien:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.pl-lg-flux-externe { margin-left: 3px; font-size: 11px; font-weight: 600; opacity: .7; }
@media print { .pl-lg-flux-externe { display: none; } a.pl-lg-flux-lien { color: var(--text-primary); } }
.pl-lg-flux-machines { list-style: none; margin: 6px 0 0; padding: 6px 0 0; border-top: 1px dashed var(--border); display: grid; grid-template-columns: repeat(auto-fill, minmax(min(210px, 100%), 1fr)); gap: 3px 14px; }
.pl-lg-flux-machines li { display: flex; align-items: baseline; gap: 0; min-width: 0; font-size: 12.5px; color: var(--text-primary); }
.pl-lg-flux-machine { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pl-lg-flux-machine .cell-sub { display: inline; margin-left: 4px; font-size: 10.5px; color: var(--text-muted); }
.pl-lg-flux-machines strong { margin-left: 8px; font-variant-numeric: tabular-nums; }
/* La version compacte : une ligne par PO ou par commande, dépliable ; les mêmes colonnes d'une ligne à l'autre. */
.pl-lg-fx-tout { padding: 4px 12px; font-size: 12.5px; }
.pl-lg-fx-entete, .pl-lg-fx-ligne { display: grid; grid-template-columns: 18px 10px minmax(96px, auto) minmax(0, 1fr) 76px 66px 40px; align-items: center; column-gap: 8px; }
.pl-lg-fx-entete { padding: 0 8px 4px; font-size: 10.5px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--text-muted); }
.pl-lg-fx-entete > span:nth-child(2) { grid-column: 2 / 4; }
.pl-lg-fx-entete > span:nth-child(n+4) { text-align: right; }
.pl-lg-fx-liste { list-style: none; margin: 0; padding: 0; border: 1px solid var(--border); border-radius: var(--radius-sm, 8px); background: var(--bg-secondary); overflow: hidden; }
.pl-lg-fx + .pl-lg-fx { border-top: 1px solid var(--border); }
.pl-lg-fx-ligne { min-height: 34px; padding: 4px 8px; font-size: 12.5px; cursor: pointer; }
.pl-lg-fx-ligne:hover { background: color-mix(in srgb, var(--accent) 5%, var(--bg-secondary)); }
.pl-lg-fx.est-ouvert > .pl-lg-fx-ligne { background: color-mix(in srgb, var(--accent) 7%, var(--bg-secondary)); }
.pl-lg-fx-chevron { display: grid; place-items: center; width: 18px; height: 18px; padding: 0; border: 0; border-radius: 4px; background: none; color: var(--text-muted); font-size: 15px; line-height: 1; cursor: pointer; transition: transform .15s ease; }
.pl-lg-fx.est-ouvert .pl-lg-fx-chevron { transform: rotate(90deg); color: var(--accent); }
.pl-lg-fx-chevron:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.pl-lg-fx-ref { display: flex; align-items: center; gap: 4px; min-width: 0; white-space: nowrap; }
.pl-lg-fx-ref .pl-lg-flux-ref { font-size: 13px; }
.pl-lg-fx-ref .pl-lg-flux-etiquette { margin-left: 0; }
.pl-lg-fx-qui { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text-secondary); }
.pl-lg-fx-quand, .pl-lg-fx-nb { text-align: right; white-space: nowrap; color: var(--text-muted); font-variant-numeric: tabular-nums; }
.pl-lg-fx-qte { text-align: right; font-size: 13.5px; color: var(--text-primary); font-variant-numeric: tabular-nums; }
.pl-lg-fx-corps { padding: 2px 10px 10px 34px; background: color-mix(in srgb, var(--accent) 3%, var(--bg-secondary)); }
.pl-lg-fx-corps .pl-lg-flux-machines { margin-top: 4px; grid-template-columns: repeat(auto-fill, minmax(min(180px, 100%), 1fr)); }
.pl-lg-fx-info { display: flex; flex-wrap: wrap; gap: 2px 12px; margin: 0; font-size: 11.5px; color: var(--text-muted); }
.pl-lg-fx-info > span:first-child { font-weight: 600; color: var(--text-secondary); }
.pl-lg-fx-ref { overflow: hidden; }
.pl-lg-fx-ref .pl-lg-flux-ref { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.pl-lg-fx-ref .pl-lg-flux-etiquette { flex: none; }
/* Sur téléphone, une ligne sur deux rangées : la référence et les unités, puis la provenance et la date. */
@media (max-width: 560px) {
    .pl-lg-fx-entete { display: none; }
    .pl-lg-fx-ligne { grid-template-columns: 18px 10px minmax(0, 1fr) auto; row-gap: 1px; padding: 6px 8px; }
    .pl-lg-fx-ligne > .pl-lg-fx-chevron, .pl-lg-fx-ligne > .pl-rx-pastille { grid-row: 1; }
    .pl-lg-fx-ref { grid-column: 3; grid-row: 1; }
    .pl-lg-fx-qte { grid-column: 4; grid-row: 1; }
    .pl-lg-fx-qui { grid-column: 3; grid-row: 2; font-size: 11.5px; }
    .pl-lg-fx-quand { grid-column: 4; grid-row: 2; font-size: 11.5px; }
    .pl-lg-fx-nb { display: none; }
    .pl-lg-fx-corps { padding-left: 12px; }
    .pl-lg-flux-detail-tete { flex-wrap: wrap; row-gap: 8px; }
    .pl-lg-flux-detail-tete > div { order: -1; flex: 1 1 100%; }
    .pl-lg-flux-detail-tete .pl-lg-fx-tout { margin-right: auto; }
}
@media print { .pl-lg-fx-chevron, .pl-lg-fx-tout { display: none; } }
@media (prefers-reduced-motion: reduce) { .pl-lg-fx-chevron { transition: none; } }
.pl-lg-flux-etiquette { display: inline-block; margin-left: 4px; padding: 0 6px; border-radius: 999px; background: var(--bg-tertiary); font-size: 10.5px; font-weight: 650; color: var(--text-secondary); }
.pl-lg-flux-etiquette.est-alerte { background: color-mix(in srgb, var(--ax-alerte) 14%, var(--bg-secondary)); color: var(--ax-alerte); }
.pl-lg-flux-vide { margin: 0; font-size: 13px; color: var(--text-muted); }
.pl-lg-repere { position: absolute; right: 4px; transform: translateY(-115%); padding: 1px 6px; border-radius: 6px; background: var(--bg-secondary); font-size: 11px; font-weight: 700; color: var(--text-primary); pointer-events: none; }
.pl-lg-sous-titre { margin: 14px 0 2px; font-size: 12.5px; color: var(--text-secondary); }

.pl-lg-grille { stroke: var(--border); stroke-width: 1; vector-effect: non-scaling-stroke; }
.pl-lg-hors-saison { fill: var(--text-primary); opacity: .035; }
.pl-lg-sel { fill: var(--accent); opacity: .10; }
.pl-lg-deborde { fill: var(--ax-alerte); opacity: .10; }
.pl-lg-couche { stroke: var(--bg-secondary); stroke-width: 1.5; vector-effect: non-scaling-stroke; stroke-linejoin: round; }
.pl-lg-trait { fill: none; stroke-width: 2; vector-effect: non-scaling-stroke; }
.pl-lg-trait.est-capacite { stroke: var(--text-primary); stroke-dasharray: 6 4; }
.pl-lg-trait.est-seuil { stroke: var(--text-muted); stroke-dasharray: 2 4; }
.pl-lg-trait.est-requise { stroke: var(--ax-alerte); stroke-dasharray: 2 3; }
.pl-lg-zero { stroke: var(--text-secondary); stroke-width: 1; vector-effect: non-scaling-stroke; }
.pl-lg-file { fill: color-mix(in srgb, var(--graph-1) 22%, transparent); }
.pl-lg-file-ligne { fill: none; stroke: var(--graph-1); stroke-width: 2; vector-effect: non-scaling-stroke; stroke-linejoin: round; }

/* Les séries (fill pour le SVG, background pour les pastilles de légende). */
.pl-lg-f0 { fill: var(--graph-1); background: var(--graph-1); }
.pl-lg-f1 { fill: var(--graph-2); background: var(--graph-2); }
.pl-lg-f2 { fill: var(--graph-4); background: var(--graph-4); }
.pl-lg-hors { fill: var(--text-muted); background: var(--text-muted); opacity: .45; }
.pl-lg-achats { fill: var(--graph-6); background: var(--graph-6); }
.pl-lg-scenarios { fill: var(--graph-4); background: var(--graph-4); }
.pl-lg-proposes { fill: var(--graph-4); background: var(--graph-4); opacity: .42; }
.pl-lg-fermes { fill: var(--graph-5); background: var(--graph-5); }
.pl-lg-prevision { fill: var(--graph-5); background: var(--graph-5); opacity: .42; }
.pl-lg-pdi { fill: var(--graph-1); background: var(--graph-1); }
.pl-lg-pdi-exces { fill: var(--ax-alerte); background: var(--ax-alerte); }
/* Le quai d'expédition : avancé (vert : la place se libère plus tôt), retardé (orange : à confirmer), posé à la main. */
.pl-lg-exp-avancee { fill: var(--graph-3); background: var(--graph-3); }
.pl-lg-exp-retardee { fill: var(--ax-attention, #ea580c); background: var(--ax-attention, #ea580c); }
.pl-lg-exp-imposee { fill: var(--graph-4); background: var(--graph-4); }
.pl-lg-dues { stroke: var(--text-primary); stroke-width: 2.5; vector-effect: non-scaling-stroke; }
.pl-lg-ligne.est-dues { border-top: 3px solid var(--text-primary); width: 14px; }
.pl-lg-ligne { display: inline-block; width: 18px; height: 0; border-top: 2px dashed var(--text-primary); vertical-align: middle; }
.pl-lg-ligne.est-seuil { border-top: 2px dotted var(--text-muted); }
.pl-lg-ligne.est-requise { border-top: 2px dotted var(--ax-alerte); }
.pl-lg-puce { flex: none; display: inline-block; width: 9px; height: 9px; margin-right: 6px; border-radius: 3px; vertical-align: baseline; }

/* Le calendrier des arrivées : une teinte, du clair au foncé ; les chiffres en encre de texte.
   Il prend la grille des graphiques — la même gouttière, une colonne par semaine de même largeur,
   le même axe des mois en dessous — pour qu'une semaine y tombe sous la même semaine que plus haut. */
.pl-lg-cal { display: grid; grid-template-columns: var(--pl-lg-gouttiere, 150px) repeat(var(--n, 52), minmax(11px, 1fr)); row-gap: 2px; overflow-x: auto; padding-top: 6px; font-variant-numeric: tabular-nums; }
.pl-lg-cal-ligne { display: contents; }
.pl-lg-cal-nom { position: sticky; left: 0; z-index: 1; display: flex; align-items: center; gap: 6px; min-width: 0; min-height: 24px; padding: 0 8px 0 2px; font-size: 12.5px; font-weight: 600; color: var(--text-primary); white-space: nowrap; background: var(--bg-secondary); }
.pl-lg-cal-nom .pl-lg-puce { margin-right: 0; }
.pl-lg-cal-libelle { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.pl-lg-cal-total { flex: none; font-size: 12px; font-weight: 700; color: var(--text-primary); }
.pl-lg-cal-case { display: grid; place-items: center; min-height: 24px; margin: 0 1px; border-radius: 4px; font-size: 10.5px; font-weight: 700; color: var(--text-primary); background: var(--bg-tertiary); cursor: crosshair; overflow: hidden; }
.pl-lg-cal-case.est-hors { opacity: .6; }
.pl-lg-cal-case.est-pleine { background: color-mix(in srgb, var(--graph-1) var(--part, 30%), var(--bg-secondary)); opacity: 1; }
.pl-lg-cal-case.est-foncee { color: #fff; }
.pl-lg-cal-case.est-sel { background: var(--accent-soft); }
.pl-lg-cal-case.est-pleine.est-sel { background: color-mix(in srgb, var(--graph-1) var(--part, 30%), var(--bg-secondary)); box-shadow: inset 0 0 0 2px var(--text-primary); }
.pl-lg-cal-case.est-total { margin: 0; background: none; color: var(--text-secondary); cursor: default; border-top: 1px solid var(--border); border-radius: 0; }
.pl-lg-cal-nom.est-total { border-top: 1px solid var(--border); color: var(--text-secondary); }
.pl-lg-cal-nom.est-total .pl-lg-cal-total { color: var(--text-secondary); }
.pl-lg-cal > .pl-lg-axe-x { grid-row: auto; grid-column: 2 / -1; }

.pl-lg-details summary { cursor: pointer; margin: 0; }
.pl-lg-details[open] summary { margin-bottom: 10px; }
.data-table.pl-lg-tableau tr.est-sel td { background: var(--accent-soft); }
.data-table.pl-lg-tableau tr.pl-lg-hors-saison-ligne td { color: var(--text-muted); }
.data-table.pl-lg-bilan .cell-sub { display: block; font-size: 11px; color: var(--text-muted); }
.data-table.pl-lg-tableau thead th, .data-table.pl-lg-bilan thead th, .data-table.pl-lg-bilan tfoot td { position: static; }
.data-table.pl-lg-tableau thead th { white-space: normal; line-height: 1.25; vertical-align: bottom; padding: 8px 10px; }
.data-table.pl-lg-tableau tbody td { padding: 7px 10px; }

/* Un tableau à beaucoup de colonnes qui doit défiler (téléphone, tablette) garde sa première colonne —
   la machine, le jour, le libellé — figée à gauche : on sait toujours de quelle ligne on lit les chiffres. */
.data-table.tableau-fige > * > tr > :first-child { position: sticky; left: 0; z-index: 1; background: var(--bg-secondary); box-shadow: inset -1px 0 0 var(--border); }
.data-table.tableau-fige > thead > tr > :first-child,
.data-table.tableau-fige > tfoot > tr > :first-child,
.data-table.tableau-fige tr.ol-comparer-groupe > :first-child { background: var(--bg-tertiary); z-index: 2; }
.data-table.tableau-fige tr.ol-comparer-groupe > :first-child { box-shadow: none; }
.data-table.pl-lg-tableau.tableau-fige tr.est-sel > :first-child { background: linear-gradient(var(--accent-soft), var(--accent-soft)), var(--bg-secondary); }
@media print {
    .data-table.tableau-fige > * > tr > :first-child { position: static; box-shadow: none; }
    .ol-semaine .data-scroll { overflow: visible; }
    .data-table.ol-semaine-table, .data-table.ol-semaine-table td { white-space: normal; }
}
.pl-lg-methode { max-width: 920px; }
.pl-rx-alerte.est-ok { border-left-color: var(--ax-ok); }
.pl-rx-alerte.est-ok .pl-rx-alerte-icone { background: var(--ax-ok); }

@media (max-width: 1100px) {
    .pl-lg-corps { grid-template-columns: 1fr; }
    .pl-lg-hypotheses { position: static; max-height: none; }
    .pl-lg-hypotheses { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px 18px; }
    .pl-lg-hyp-tete, .pl-lg-hypotheses > .ax-carte-aide, .pl-lg-hyp-actions, .pl-lg-hypotheses > .ax-champ-note, .pl-lg-hypotheses > .form-banner, .pl-lg-hypotheses > .ol-reprendre { grid-column: 1 / -1; }
}
@media (max-width: 720px) {
    .pl-lg-graphes { --pl-lg-gouttiere: 110px; }
    .pl-lg-jauges { gap: 16px; }
    .pl-lg-semaine { position: static; }
    .pl-lg-zone-haute { height: 220px; }
}
@media print {
    .pl-lg-hypotheses, .pl-lg-semaine, .pl-lg-cibles, .pl-lg-flux-invite, .pl-lg-flux-detail-tete .pl-lg-fleche { display: none !important; }
    .pl-lg-corps { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) { .pl-lg-lecture-barre span { transition: none; } }

/* ═══ STATISTIQUES DE PDI (/preparation/statistiques) ═══════════════════════════
   La lecture de la Direction : les PDI par technicien. Des tableaux de chiffres, donc des
   colonnes à la largeur de leur contenu (les largeurs fixes du .table de base visent une autre
   grille) ; la table défile de côté sur un écran étroit, dans son .table-scroll. */
.pdis-periode { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 20px; margin-bottom: 18px; }
.pdis-raccourcis { display: flex; flex-wrap: wrap; gap: 6px; }
.pdis-raccourcis .est-choisi { border-color: var(--accent); color: var(--accent); box-shadow: 0 0 0 2px var(--accent-soft); }
.pdis-dates { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; font-size: 13px; color: var(--text-secondary); }
.pdis-dates label { display: inline-flex; align-items: center; gap: 6px; }
.pdis-kpis { margin-bottom: 14px; }
.pdis-alerte { margin: 0 0 12px; padding: 10px 14px; border-radius: var(--radius-sm); background: rgba(234, 179, 8, 0.14); color: var(--text-primary); font-size: 13.5px; }
.pdis-mode-emploi { margin: 0 0 8px; font-size: 13px; color: var(--text-muted); max-width: 900px; }

.table.pdis-table, .table.pdis-lignes { table-layout: auto; min-width: 560px; }
.table.pdis-table th, .table.pdis-table td,
.table.pdis-lignes th, .table.pdis-lignes td { width: auto; }
.table.pdis-table .num, .table.pdis-table th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.table.pdis-lignes td:first-child { white-space: nowrap; font-variant-numeric: tabular-nums; }
.table.pdis-table td.pdis-part, .table.pdis-table td:first-child, .table.pdis-table td:last-child { white-space: nowrap; font-variant-numeric: tabular-nums; }
.pdis-attention { color: #b45309; font-weight: 600; }
[data-theme="dark"] .pdis-attention { color: #fbbf24; }

.pdis-jauge { display: inline-block; width: 64px; height: 6px; margin-right: 8px; vertical-align: middle; border-radius: var(--radius-full); background: var(--bg-tertiary); overflow: hidden; }
.pdis-jauge > span { display: block; height: 100%; background: var(--accent); border-radius: inherit; }

.pdis-detail { margin-bottom: 10px; padding: 12px 16px; }
.pdis-detail > summary { cursor: pointer; font-size: 14px; }
.pdis-detail[open] > summary { margin-bottom: 10px; }

.pdis-noms { display: flex; flex-direction: column; gap: 12px; }
.pdis-noms p { margin: 0; font-size: 13px; }
.pdis-liste-noms { display: flex; flex-wrap: wrap; gap: 6px 18px; margin: 0; padding: 0; list-style: none; font-size: 14px; }
.pdis-liste-noms .btn-link { margin-left: 6px; }
.pdis-form-nom { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px 14px; font-size: 13px; color: var(--text-secondary); }
.pdis-form-nom label { display: flex; flex-direction: column; gap: 4px; }
.pdis-erreur { color: #dc2626; font-size: 13px; }
[data-theme="dark"] .pdis-erreur { color: #f87171; }

/* Le tableau de configuration des techniciens (/preparation/statistiques/techniciens) : un nom par
   numéro, modifiable sur sa ligne ; les numéros vus dans Odoo sans nom remontent en tête, surlignés. */
.pdis-config { display: flex; flex-direction: column; gap: 10px; }
.table.pdis-config-table td { vertical-align: middle; }
.table.pdis-config-table td:first-child { font-variant-numeric: tabular-nums; }
.pdis-config-nom { width: 100%; min-width: 200px; }
.pdis-config-numero { width: 80px; }
.pdis-config-a-nommer > td { background: rgba(234, 179, 8, 0.08); }
.pdis-config-motif { max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text-muted); font-size: 13px; }
.table.pdis-table td.pdis-config-actions { white-space: nowrap; }
.pdis-config-actions .btn-link { margin-left: 8px; }
.pdis-config-ajout > td { padding: 12px 14px; border-top: 2px solid var(--border); vertical-align: middle; font-size: 13px; }
.pdis-config-retire, .pdis-config-note { margin: 0; font-size: 13px; }
.pdis-config-retire .btn-link { margin-left: 6px; }

/* ═══════════════════════════════════════════════════════════════════════════
   LEADS RIPPA CHINE — la boîte (/leads-chine), la fiche et l'onglet de configuration.
   Voir docs/leads-rippa-chine.md.
   ═══════════════════════════════════════════════════════════════════════════ */
.lc-entete-actions { display: flex; gap: 8px; align-items: center; }
.lc-chiffres { margin-bottom: 16px; }
.lc-chiffres button.chiffre { text-align: left; font: inherit; color: inherit; cursor: pointer; }
.lc-chiffres .chiffre.is-active { outline: 2px solid var(--accent); outline-offset: -2px; }
.lc-boite { display: grid; gap: 12px; }
.lc-filtres { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.lc-filtre {
    border: 1px solid var(--border); background: var(--bg-secondary); color: var(--text-secondary);
    border-radius: 999px; padding: 5px 12px; font: inherit; font-size: 13px; cursor: pointer;
}
.lc-filtre b { font-variant-numeric: tabular-nums; margin-left: 4px; color: var(--text-primary); }
.lc-filtre.is-on { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); }
.lc-filtre.is-on b { color: var(--accent); }
.lc-synchro { margin-left: auto; font-size: 12px; color: var(--text-muted); }
.lc-defile { overflow-x: auto; }
.lc-table { width: 100%; border-collapse: collapse; min-width: 860px; font-size: 14px; }
.lc-table th {
    text-align: left; font-size: 12px; font-weight: 600; color: var(--text-muted); text-transform: uppercase;
    letter-spacing: 0.03em; padding: 8px 10px; border-bottom: 1px solid var(--border);
}
.lc-table td { padding: 10px; border-bottom: 1px solid var(--border); vertical-align: top; }
.lc-table tbody tr:hover { background: var(--bg-glass-hover); }
.lc-table tr.est-nouveau td:first-child { box-shadow: inset 3px 0 0 #f59e0b; }
.lc-table tr.est-retire { opacity: 0.65; }
/* La suppression (leads.supprimer) : une case par ligne, la barre de la sélection, la confirmation. */
.lc-table .lc-coche { width: 32px; padding-right: 0; }
.lc-table .lc-coche input { width: 16px; height: 16px; cursor: pointer; }
.lc-table tr.est-choisi td { background: var(--accent-soft); }
.lc-selection { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-top: 14px; padding: 10px 14px;
    border: 1px solid var(--accent); border-radius: 10px; background: var(--accent-soft); }
.lc-suppr-confirmer { margin-top: 10px; padding: 16px; border: 1px solid var(--status-danger); border-radius: 10px;
    background: color-mix(in srgb, var(--status-danger) 6%, transparent); }
.lc-suppr-confirmer h3 { margin: 0 0 8px; font-size: 16px; }
.lc-suppr-confirmer p { margin: 0 0 10px; font-size: 14px; }
.lc-suppr-numeros { font-family: var(--font-mono, ui-monospace, monospace); font-size: 12px; color: var(--text-secondary); }
.lc-suppr-compris { display: flex; gap: 8px; align-items: center; margin: 10px 0; font-size: 14px; }
.lc-suppr-actions { display: flex; gap: 8px; justify-content: flex-end; }
.btn-primary.btn-danger-plein { background: var(--status-danger); border-color: var(--status-danger); box-shadow: none; }
.btn-primary.btn-danger-plein:disabled { opacity: 0.45; cursor: not-allowed; transform: none; }
.lc-suppr-resultat { margin-top: 14px; }
.lc-suppr-resultat ul { margin: 6px 0 0 18px; }
.lc-supprimes { margin-top: 16px; }
.lc-supprimes summary { cursor: pointer; font-weight: 600; }
.lc-supprimes .lc-table { min-width: 0; margin-top: 8px; }
.lc-titre a { color: inherit; text-decoration: none; display: grid; gap: 2px; }
.lc-titre a:hover b { color: var(--accent); }
.lc-titre small, .lc-table small { color: var(--text-muted); font-size: 12px; }
.lc-archive { display: block; }
.lc-statut-chine { display: block; color: var(--text-secondary); }
/* Les leads confiés aux concessionnaires (docs/leads-concessionnaires.md) : la carte en vedette,
   les concessionnaires à choisir, les étapes du lead chez le concessionnaire, sa dernière note. */
.lc-carte-vedette { border: 2px solid var(--accent) !important; }
.lc-etiquette { display: block; font-weight: 600; font-size: 14px; color: var(--text-primary); margin: 8px 0 4px; }
.lc-choix-conc { display: grid; gap: 8px; margin: 8px 0 14px; }
.lc-choix-conc label { display: grid; grid-template-columns: 18px 1fr; gap: 10px; align-items: start; padding: 10px 12px; border: 1px solid var(--border); border-radius: var(--radius-md); cursor: pointer; font-size: 14px; }
.lc-choix-conc label.is-on { border-color: var(--accent); background: var(--accent-wash); }
.lc-choix-conc label.est-desactive { opacity: .6; cursor: not-allowed; }
.lc-choix-conc input { margin-top: 3px; }
.lc-choix-conc .nom { font-weight: 600; color: var(--text-primary); }
.lc-choix-conc .faits { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.lc-apercu-transfert { margin: 10px 0; padding: 12px 14px; border-radius: var(--radius-md); background: var(--bg-secondary); border: 1px solid var(--border-subtle); font-size: 13px; color: var(--text-secondary); }
.lc-apercu-transfert b { color: var(--text-primary); }
.lc-conc-tete { margin: 0 0 6px; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.lc-conc-tete small { flex-basis: 100%; color: var(--text-muted); font-size: 12px; }
.lc-etapes { list-style: none; margin: 8px 0 4px; padding: 0; }
.lc-etapes li { position: relative; padding: 0 0 14px 28px; font-size: 14px; color: var(--text-secondary); }
.lc-etapes li::before { content: ""; position: absolute; left: 6px; top: 4px; width: 12px; height: 12px; border-radius: 50%; border: 2px solid var(--border); background: var(--bg-elevated); box-sizing: border-box; }
.lc-etapes li::after { content: ""; position: absolute; left: 11px; top: 18px; bottom: 0; width: 2px; background: var(--border); }
.lc-etapes li:last-child::after { display: none; }
.lc-etapes li.fait::before { background: var(--status-success); border-color: var(--status-success); }
.lc-etapes li.fait::after { background: var(--status-success); }
.lc-etapes li.ici::before { background: var(--accent); border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.lc-etapes b { color: var(--text-primary); font-weight: 600; }
.lc-etapes small { display: block; color: var(--text-muted); font-size: 12px; }
.lc-citation { margin: 6px 0 10px; padding: 10px 14px; border-left: 3px solid var(--accent); background: var(--accent-wash); border-radius: 0 var(--radius-sm) var(--radius-sm) 0; font-size: 14px; color: var(--text-primary); white-space: pre-line; }
.lc-citation small { display: block; color: var(--text-muted); font-size: 12px; margin-top: 4px; white-space: normal; }
.lc-masque { display: flex; gap: 10px; align-items: center; padding: 12px 14px; border: 1px dashed var(--border); border-radius: var(--radius-md); color: var(--text-secondary); font-size: 14px; background: var(--bg-secondary); margin-top: 12px; }
.lc-motifs { display: grid; gap: 6px; margin: 8px 0; font-size: 14px; }
.lc-motifs label { display: flex; gap: 8px; align-items: center; }
.lc-sep { border: 0; border-top: 1px solid var(--border-subtle); margin: 16px 0; }
.lc-journal li.lc-ev-transfert { border-left-color: #0d9488; }
.lc-journal li.lc-ev-concessionnaire { border-left-color: #0d9488; }
.lc-conc-cellule b { display: block; color: var(--text-primary); }
.lc-conc-cellule small { display: block; }
.lc-num { text-align: right; font-variant-numeric: tabular-nums; }
.lc-barre { display: inline-block; height: 8px; border-radius: 4px; background: var(--accent); vertical-align: middle; margin-right: 6px; }
.lc-ref { font-variant-numeric: tabular-nums; font-family: var(--font-mono, ui-monospace, monospace); font-size: 13px; white-space: nowrap; }
.lc-trop { color: #b91c1c; font-weight: 600; }
[data-theme="dark"] .lc-trop { color: #f87171; }
.lc-etoiles { color: #f59e0b; margin-right: 6px; }
.page-subtitle .lc-ref { margin-right: 6px; }
.lc-fiche { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.lc-colonne { display: grid; gap: 16px; }
.lc-description, .lc-fil-texte { white-space: pre-wrap; overflow-wrap: anywhere; margin: 0; line-height: 1.5; }
.lc-fil, .lc-journal, .lc-personnes { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.lc-fil li, .lc-journal li { border-left: 2px solid var(--border); padding: 2px 0 2px 10px; }
.lc-fil li.est-note { border-left-color: #f59e0b; }
.lc-journal li.lc-ev-arrivee, .lc-journal li.lc-ev-revenu { border-left-color: var(--accent); }
.lc-journal li.lc-ev-retire { border-left-color: #ef4444; }
.lc-journal li.lc-ev-statut { border-left-color: #22c55e; }
.lc-fil-tete { font-size: 13px; color: var(--text-secondary); margin-bottom: 2px; }
.lc-fil-tete b { color: var(--text-primary); }
.lc-personnes li { display: flex; justify-content: space-between; gap: 8px; align-items: center; }
.lc-personnes small { color: var(--text-muted); }
.lc-gestes { display: flex; flex-wrap: wrap; gap: 8px; }
.lc-gestes .is-on { outline: 2px solid var(--accent); outline-offset: 2px; }
.lc-confirmer { display: grid; gap: 6px; margin-top: 12px; padding: 12px; border: 1px solid var(--border); border-radius: 10px; background: var(--bg-secondary); }
.lc-confirmer label { font-size: 13px; font-weight: 600; }
.lc-ligne-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 8px; }
.lc-ligne-actions select.input { flex: 1 1 220px; }
.lc-carte { margin-bottom: 16px; }
.lc-choix { display: grid; gap: 6px; margin: 8px 0; }
.lc-option { display: flex; gap: 8px; align-items: center; }
.lc-liste-chine { margin-top: 8px; padding: 12px; border: 1px solid var(--border); border-radius: 10px; }
.lc-cases { list-style: none; margin: 8px 0 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 4px 16px; max-height: 280px; overflow: auto; }
.lc-cases label { display: flex; gap: 8px; align-items: center; }
.lc-cases small { color: var(--text-muted); }
@media (max-width: 900px) {
    .lc-fiche { grid-template-columns: minmax(0, 1fr); }
    .lc-synchro { margin-left: 0; width: 100%; }
}
/* La pastille de l'onglet « Leads » : ce qui attend une prise en charge. Même rouge que la cloche. */
.section-pastille {
    min-width: 16px; height: 16px; padding: 0 4px; margin-left: 2px;
    border-radius: var(--radius-full);
    background: #dc2626; color: #fff;
    font-size: 10px; font-weight: 700; line-height: 16px; text-align: center;
    font-variant-numeric: tabular-nums;
}
/* Les styles de formulaire de /configuration vivent dans son CSS isolé, qui n'atteint pas les
   composants enfants : les écrans des leads les reprennent, bornés à eux. */
:is(.lc-carte, .lc-fiche) .champ-aide { margin-top: 2px; font-size: 12.5px; line-height: 1.55; color: var(--text-muted); }
:is(.lc-carte, .lc-fiche) .champ-aide code { font-family: 'JetBrains Mono', ui-monospace, monospace; font-size: 12px; background: var(--bg-tertiary); border-radius: 4px; padding: 1px 5px; color: var(--text-primary); }
.lc-carte .test-zone { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 14px; }
.lc-carte .activation { display: flex; align-items: flex-start; gap: 8px; font-weight: 600; font-size: 13.5px; color: var(--text-primary); cursor: pointer; }
.lc-carte .activation input { margin-top: 3px; accent-color: var(--accent); }
.lc-carte .activation-note { font-weight: 400; color: var(--text-secondary); }
:is(.lc-carte, .lc-fiche) .pill-danger { background: rgba(239, 68, 68, 0.12); color: #b91c1c; }
.lc-option, .lc-cases label { font-size: 14px; }
/* Phase 2 : l'aperçu d'une note de suivi, et la liste des notes sur la fiche d'un lead. */
.lc-apercu {
    margin: 0; padding: 10px 12px; white-space: pre-wrap; overflow-wrap: anywhere;
    font-family: inherit; font-size: 13px; line-height: 1.5; color: var(--text-secondary);
    background: var(--bg-tertiary); border: 1px solid var(--border); border-radius: 8px;
}
.lc-notes-chine { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.lc-notes-chine li { border-left: 2px solid var(--border); padding: 2px 0 2px 10px; }
.lc-notes-chine li.est-envoyee { border-left-color: #22c55e; }
.lc-notes-chine li.est-abandonnee { border-left-color: #ef4444; }

/* ── Logistique : « Ce qu'il faut retenir » compact (2026-11-19) ─────────────────────────────────
   Une ligne par constat, coupée à la largeur ; un clic la déplie. Les constats rassurants se replient
   derrière un bouton quand il y a des alertes. Tout se lit en entier à l'impression. */
.pl-lg-retenir { padding-top: 12px; padding-bottom: 12px; }
.pl-lg-retenir-tete { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; margin-bottom: 8px; }
.pl-lg-retenir-tete .section-title { margin: 0; }
.pl-lg-retenir-n { font-size: 12px; font-weight: 700; padding: 1px 8px; border-radius: 999px; color: #fff; }
.pl-lg-retenir-n.est-alerte { background: var(--ax-alerte); }
.pl-lg-retenir-n.est-attention { background: var(--ax-attention); }
.pl-lg-constats { gap: 3px; }
.pl-lg-constats .pl-rx-alerte { align-items: center; gap: 8px; padding: 4px 10px; border-left-width: 3px; font-size: 13px; line-height: 1.4; }
.pl-lg-constats .pl-rx-alerte-icone { width: 17px; height: 17px; font-size: 10.5px; }
.pl-lg-constat-texte { flex: 1; min-width: 0; padding: 0; border: 0; background: none; font: inherit; color: inherit; text-align: left;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis; cursor: pointer; }
.pl-lg-constat-texte:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
.pl-lg-constats .est-deplie { align-items: flex-start; }
.pl-lg-constats .est-deplie .pl-lg-constat-texte { white-space: normal; }
.pl-lg-constats .est-replie { display: none; }
.pl-lg-constats-plus { margin-top: 6px; padding: 2px 4px; border: 0; background: none; font: inherit; font-size: 12.5px; color: var(--accent); cursor: pointer; }
.pl-lg-constats-plus:hover { text-decoration: underline; }
@media print {
    .pl-lg-constats .est-replie { display: flex; }
    .pl-lg-constat-texte { white-space: normal; }
    .pl-lg-constats-plus { display: none; }
}

/* ── Logistique : en direct, et ce qui arrive d'Odoo (2026-11-19) ─────────────────────────────── */
.ol-direct { display: flex; align-items: center; gap: 6px; margin: 4px 0 0; font-size: 12.5px; color: var(--text-secondary); }
.ol-direct-point { flex: none; width: 8px; height: 8px; border-radius: 50%; background: var(--ax-ok, #16a34a);
    box-shadow: 0 0 0 0 color-mix(in srgb, var(--ax-ok, #16a34a) 60%, transparent); animation: ol-pouls 2.4s ease-out infinite; }
@keyframes ol-pouls { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--ax-ok, #16a34a) 55%, transparent); } 100% { box-shadow: 0 0 0 8px transparent; } }
@media (prefers-reduced-motion: reduce) { .ol-direct-point { animation: none; } }
.ol-arr-filtres { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0 10px; }
.ol-arr-n { margin-left: 4px; font-variant-numeric: tabular-nums; opacity: .75; }
.ol-arr-defile { max-height: 460px; overflow: auto; }
.ol-arr-table td { vertical-align: top; }
.ol-arr-table .ax-depasse { color: var(--ax-alerte); }

/* ═══ POSTE DU MÉCANICIEN (/preparation/mecanicien) ═══════════════════════════
   Le PDI d'une machine, au téléphone du mécanicien (docs/suivi-temps-mecanicien.md) : de gros doigts, des
   gants parfois, la lumière de l'atelier — de grandes cases, de grands boutons, une colonne. Jetons du thème
   seulement, sauf l'entête au bleu de marque (comme la barre) et le vert du « fait ». */
.poste { max-width: 980px; }
.poste-muted { color: var(--text-muted); }
.poste-qui { display: flex; align-items: center; gap: 14px; padding: 12px 16px; border-radius: 14px; background: var(--accent-soft);
  border: 1px solid var(--border); margin: 14px 0 16px; }
.poste-avatar { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; font-size: 16px;
  background: #1f3d73; color: #fff; flex: none; }
.poste-qui-nom { font-weight: 650; font-size: 16px; }
.poste-qui-det { font-size: 13px; color: var(--text-muted); }
.poste-attention { color: #b45309; font-weight: 600; }
.poste-cherche-carte { margin-bottom: 14px; }
.poste-libelle { display: block; font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--text-muted); margin: 6px 0 10px; }
.poste-cherche { display: flex; align-items: center; gap: 10px; padding: 6px 8px 6px 18px; border: 2px solid var(--accent); border-radius: 16px;
  background: var(--bg-secondary); box-shadow: 0 0 0 5px rgba(0,109,188,.10); }
.poste-cherche-champ { flex: 1; min-width: 0; border: 0; outline: 0; font-size: 30px; letter-spacing: .14em; padding: 10px 0; background: transparent;
  color: var(--text-primary); font-weight: 600; font-family: 'JetBrains Mono', ui-monospace, monospace; text-transform: uppercase; }
.poste-abc { flex: none; min-width: 58px; height: 48px; border-radius: 12px; border: 1px solid var(--border); background: var(--bg-tertiary);
  color: var(--text-secondary); font-weight: 700; font-size: 14px; cursor: pointer; }
.poste-abc.est-actif { border-color: var(--accent); color: var(--accent); }
.poste-aide { font-size: 13px; color: var(--text-muted); margin: 8px 4px 0; line-height: 1.5; }
.poste-trouve { margin: 4px 0 8px; }
.poste-resultat { display: grid; grid-template-columns: 1fr auto; gap: 8px 18px; align-items: center; padding: 16px 18px; border-radius: 14px;
  border: 1px solid var(--border); background: var(--bg-secondary); margin-bottom: 10px; }
.poste-resultat.est-choix { border: 2px solid var(--accent); box-shadow: var(--shadow-md); }
.poste-serie { font-family: 'JetBrains Mono', ui-monospace, monospace; font-size: 21px; font-weight: 500; letter-spacing: .03em; overflow-wrap: anywhere; }
.poste-serie mark { background: rgba(234,179,8,.32); color: inherit; border-radius: 4px; padding: 0 2px; font-weight: 700; }
.poste-serie-petite { font-size: 15px; }
.poste-resultat-modele { font-size: 15px; font-weight: 600; margin-top: 2px; }
.poste-resultat-det { font-size: 13px; color: var(--text-muted); display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-top: 4px; }
.poste-hors-pdi { margin: 10px 0 0; padding: 9px 12px; border-radius: 10px; background: rgba(239,68,68,.08); border: 1px solid rgba(239,68,68,.3);
  font-size: 13px; line-height: 1.5; }
.poste-gros-btn { font-size: 16px !important; padding: 13px 22px !important; border-radius: 12px !important; text-decoration: none; text-align: center; }
.poste-autres { margin: 4px 0 10px; font-size: 13px; color: var(--text-muted); }
.poste-autres summary { cursor: pointer; padding: 6px 4px; }
.poste-chip { display: inline-flex; align-items: center; gap: 6px; padding: 2px 9px; border-radius: 99px; font-size: 12px; font-weight: 650; }
.poste-chip.cours { background: rgba(34,197,94,.14); color: #15803d; }
.poste-chip.pause { background: rgba(234,179,8,.18); color: #a16207; }
.poste-chip.err { background: rgba(239,68,68,.14); color: #b91c1c; }
.poste-chip.gris { background: var(--bg-tertiary); color: var(--text-secondary); }
[data-theme="dark"] .poste-chip.cours { color: #86efac; }
[data-theme="dark"] .poste-chip.pause { color: #fcd34d; }
[data-theme="dark"] .poste-chip.err { color: #fca5a5; }
.poste-message { display: flex; flex-direction: column; gap: 6px; align-items: flex-start; padding: 14px 16px; border-radius: 14px;
  border: 1px dashed var(--border); background: var(--bg-tertiary); margin: 10px 0; }
.poste-message p { margin: 0; font-size: 13.5px; color: var(--text-secondary); line-height: 1.5; }
.poste-message-attention { border: 1px solid rgba(234,179,8,.5); background: rgba(234,179,8,.10); }
.poste-message-pause { border: 1px solid rgba(234,179,8,.5); background: rgba(234,179,8,.12); }
.poste-titre-liste { font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--text-muted); margin: 24px 0 10px; }
.poste-ligne { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 12px;
  border: 1px solid var(--border); background: var(--bg-secondary); margin-bottom: 8px; color: inherit; text-decoration: none; }
.poste-ligne:hover { border-color: var(--accent); }
.poste-ligne-det { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; font-size: 13px; color: var(--text-muted); margin-top: 3px; }
.poste-ligne-det strong { color: var(--text-primary); }
.poste-retour { display: inline-block; font-size: 13px; margin: 4px 0 10px; color: var(--accent); text-decoration: none; }

/* La page de la machine : l'entête au bleu de marque, collant en haut. */
.poste-entete { position: sticky; top: 64px; z-index: 4; display: grid; grid-template-columns: 1fr auto; gap: 12px 22px; align-items: center;
  padding: 16px 20px; border-radius: 18px; background: linear-gradient(135deg, #152c78, #0a4f8f); color: #fff; box-shadow: var(--shadow-md); }
.poste-entete .poste-serie { font-size: 22px; color: #fff; }
.poste-entete-det { display: flex; gap: 8px 18px; flex-wrap: wrap; align-items: center; font-size: 13.5px; color: rgba(255,255,255,.82); margin-top: 4px; }
.poste-entete-det b { color: #fff; font-weight: 600; }
.poste-chrono { text-align: right; }
.poste-chrono-v { font-family: 'JetBrains Mono', ui-monospace, monospace; font-size: 44px; font-weight: 600; line-height: 1; font-variant-numeric: tabular-nums; }
.poste-chrono-l { font-size: 11.5px; text-transform: uppercase; letter-spacing: .08em; color: rgba(255,255,255,.78); margin-bottom: 6px;
  display: flex; gap: 8px; justify-content: flex-end; align-items: center; }
.poste-pastille-vive { width: 10px; height: 10px; border-radius: 50%; background: #4ade80; box-shadow: 0 0 0 4px rgba(74,222,128,.25); }
.poste-pastille-pause { width: 10px; height: 10px; border-radius: 50%; background: #facc15; }
.poste-progres { grid-column: 1 / -1; display: flex; align-items: center; gap: 12px; }
.poste-jauge { flex: 1; height: 10px; border-radius: 99px; background: rgba(255,255,255,.18); overflow: hidden; }
.poste-jauge span { display: block; height: 100%; background: #4ade80; border-radius: 99px; transition: width .3s; }
.poste-progres-t { font-size: 14px; font-weight: 650; white-space: nowrap; }
.poste-entete-btns { grid-column: 1 / -1; display: flex; gap: 10px; justify-content: flex-end; }
.poste-btn-blanc { background: rgba(255,255,255,.14); color: #fff; border: 1px solid rgba(255,255,255,.35); padding: 11px 18px; border-radius: 11px;
  font-weight: 650; font-size: 15px; cursor: pointer; }
.poste-btn-fin { background: #fff; color: #152c78; padding: 11px 20px; border-radius: 11px; font-weight: 700; font-size: 15px; border: 0; cursor: pointer; }
.poste-btn-fin.est-pret { background: #22c55e; color: #fff; }
.poste-entete button:disabled { opacity: .6; cursor: default; }
.poste-panneau { border: 1px solid var(--border); border-radius: 16px; background: var(--bg-secondary); margin-top: 14px; padding: 16px 18px; box-shadow: var(--shadow-md); }
.poste-panneau h2 { margin: 0 0 4px; font-size: 18px; }
.poste-panneau-manque { border-color: rgba(239,68,68,.45); scroll-margin-top: 240px; }
.poste-panneau-btns { display: flex; justify-content: flex-end; gap: 10px; margin-top: 14px; flex-wrap: wrap; }
.poste-motifs { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 14px 0 12px; }
.poste-motif { padding: 14px; border: 1px solid var(--border); border-radius: 12px; font-size: 15px; font-weight: 600; background: var(--bg-secondary);
  color: var(--text-primary); text-align: left; cursor: pointer; }
.poste-motif.est-choix { border: 2px solid var(--accent); background: var(--accent-soft); }
.poste-input { width: 100%; box-sizing: border-box; padding: 11px 13px; border: 1px solid var(--border); border-radius: 10px; font-size: 16px;
  background: var(--bg-secondary); color: var(--text-primary); }
.poste-reste { border: 1px solid rgba(239,68,68,.35); border-radius: 12px; overflow: hidden; margin-top: 12px; }
.poste-reste-l { display: grid; grid-template-columns: auto 1fr; gap: 10px; align-items: center; padding: 10px 14px; border-bottom: 1px solid var(--border-subtle);
  font-size: 14px; color: inherit; text-decoration: none; }
.poste-reste-l:last-child { border-bottom: 0; }
.poste-reste-l:hover { background: var(--bg-tertiary); }
.poste-ancres { display: flex; gap: 8px; flex-wrap: wrap; margin: 16px 0 4px; }
.poste-ancre { padding: 7px 12px; border-radius: 99px; border: 1px solid var(--border); background: var(--bg-secondary); font-size: 13px; font-weight: 600;
  color: var(--text-secondary); text-decoration: none; }
.poste-ancre span { opacity: .7; margin-left: 4px; font-variant-numeric: tabular-nums; }
.poste-ancre.fait { border-color: rgba(34,197,94,.45); background: rgba(34,197,94,.10); color: #15803d; }
.poste-section { border: 1px solid var(--border); border-radius: 16px; background: var(--bg-secondary); margin-top: 14px; overflow: hidden; scroll-margin-top: 240px; }
.poste-section-t { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 12px 18px; background: var(--bg-tertiary);
  border-bottom: 1px solid var(--border); }
.poste-section-t h2 { margin: 0; font-size: 16.5px; font-weight: 650; }
.poste-section-c { white-space: nowrap; font-size: 13px; font-weight: 650; color: var(--text-secondary); }
.poste-section-c.fait { color: #15803d; }
.poste-etape { display: grid; grid-template-columns: 46px 1fr auto; gap: 12px; align-items: start; padding: 12px 18px; border-bottom: 1px solid var(--border-subtle);
  scroll-margin-top: 240px; }
.poste-etape:last-child { border-bottom: 0; }
.poste-case { width: 42px; height: 42px; border-radius: 10px; border: 2.5px solid #9aa3b8; display: grid; place-items: center; background: var(--bg-secondary);
  color: var(--text-primary); font-size: 20px; font-weight: 800; cursor: pointer; padding: 0; }
.poste-case:disabled { cursor: default; }
.poste-etape.coche .poste-case { background: #22c55e; border-color: #22c55e; color: #fff; }
.poste-etape.so .poste-case { background: var(--bg-tertiary); border-color: #b9bfcc; color: var(--text-muted); font-size: 11px; }
.poste-etape.auto .poste-case { border-style: dashed; color: var(--text-muted); font-size: 16px; }
.poste-etape.manque { background: rgba(239,68,68,.05); }
.poste-etape.manque .poste-case { border-color: #ef4444; }
.poste-etape-t { font-size: 15px; line-height: 1.4; color: var(--text-primary); padding-top: 2px; }
.poste-etape.coche .poste-etape-t, .poste-etape.so .poste-etape-t { color: var(--text-secondary); }
.poste-etape.so .poste-etape-t { text-decoration: line-through; text-decoration-color: var(--text-muted); }
.poste-etape-s { font-size: 12.5px; color: var(--text-muted); margin-top: 5px; display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.poste-etape-d { text-align: right; font-size: 12.5px; color: var(--text-muted); white-space: nowrap; padding-top: 4px; }
.poste-etape-d b { color: #15803d; font-weight: 650; }
.poste-mini { padding: 6px 12px; border-radius: 9px; border: 1px solid var(--border); background: var(--bg-secondary); font-size: 13px; font-weight: 600;
  color: var(--text-secondary); cursor: pointer; }
.poste-mini.accent { border-color: var(--accent); color: var(--accent); }
.poste-valeur { display: flex; gap: 10px; align-items: center; margin-top: 10px; flex-wrap: wrap; font-size: 14px; }
.poste-input-valeur { width: 120px; font-family: 'JetBrains Mono', ui-monospace, monospace; font-size: 18px; }
.poste-photos { display: flex; gap: 10px; margin-top: 10px; flex-wrap: wrap; }
.poste-photo { position: relative; width: 110px; height: 82px; border-radius: 10px; overflow: hidden; border: 1px solid var(--border); background: var(--bg-tertiary); }
.poste-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.poste-photo-retirer { position: absolute; top: 4px; right: 4px; width: 26px; height: 26px; border-radius: 50%; border: 0; background: rgba(0,0,0,.6);
  color: #fff; font-size: 16px; line-height: 1; cursor: pointer; }
.poste-photo-ajout { position: relative; width: 110px; height: 82px; border-radius: 10px; border: 2px dashed var(--accent); color: var(--accent);
  display: grid; place-items: center; font-size: 12.5px; font-weight: 650; text-align: center; cursor: pointer; box-sizing: border-box; padding: 4px; }
.poste-photo-ajout input[type=file] { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.poste-validation { border: 2px solid var(--accent); border-radius: 16px; background: var(--bg-secondary); margin-top: 16px; padding: 18px 20px; scroll-margin-top: 240px; }
.poste-validation h2 { margin: 0; font-size: 17px; }
.poste-champs { display: grid; grid-template-columns: 1.3fr .7fr; gap: 14px; margin: 12px 0; }
.poste-champ-l { display: block; font-size: 12px; font-weight: 650; color: var(--text-muted); margin-bottom: 4px; }
.poste-champ-v { display: block; padding: 10px 12px; border-radius: 10px; background: var(--bg-tertiary); font-size: 15px; }
.poste-signature { position: relative; height: 170px; border: 1.5px dashed #9aa3b8; border-radius: 12px; background: #fff; margin-top: 8px; }
.poste-signature canvas { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 1; touch-action: none; }
.poste-signature svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.poste-signature-faite { border-style: solid; margin-bottom: 10px; }
.poste-signature-ligne { position: absolute; left: 24px; right: 24px; bottom: 38px; border-bottom: 1px solid #c3c8d4; }
.poste-signature-x { position: absolute; left: 26px; bottom: 42px; font-size: 16px; color: #9aa3b8; }
.poste-pret { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-top: 16px; padding: 12px 14px; border-radius: 12px;
  background: rgba(34,197,94,.10); border: 1px solid rgba(34,197,94,.35); }
.poste-pret .btn-primary { margin-left: auto; background: #16a34a; }
.poste-lien { border: 0; background: none; padding: 0; color: var(--accent); font: inherit; text-decoration: underline; cursor: pointer; }
.poste-fin { text-align: center; padding: 24px 12px 6px; margin-top: 14px; border: 1px solid rgba(34,197,94,.35); border-radius: 16px; background: rgba(34,197,94,.06); }
.poste-fin-ico { width: 72px; height: 72px; border-radius: 50%; background: rgba(34,197,94,.16); color: #16a34a; display: grid; place-items: center;
  margin: 0 auto 10px; font-size: 38px; font-weight: 800; }
.poste-fin h1 { margin: 0 0 4px; font-size: 26px; }
.poste-recap { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin: 18px 0; text-align: left; }
.poste-fin-btns { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.poste-historique { margin: 18px 0 8px; font-size: 13px; color: var(--text-secondary); }
.poste-historique summary { cursor: pointer; padding: 6px 2px; }
.poste-historique ul { list-style: none; padding: 0; margin: 6px 0 0; }
.poste-historique li { padding: 5px 0; border-bottom: 1px solid var(--border-subtle); }
.poste-historique li b { font-weight: 600; font-variant-numeric: tabular-nums; margin-right: 6px; }
/* Les commentaires texte : sur la machine (sa section) ou sous une étape. */
.poste-commentaires-corps { padding: 14px 18px 16px; }
.poste-commentaires-corps > .poste-aide { margin: 0 0 12px; }
.poste-commentaires { display: flex; flex-direction: column; gap: 8px; }
.poste-commentaires-etape { margin-top: 10px; }
.poste-commentaire { padding: 10px 12px; border-radius: 12px; background: var(--bg-tertiary); border-left: 3px solid var(--accent); }
.poste-commentaire-t { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 12.5px; }
.poste-commentaire-t b { font-weight: 650; font-size: 13px; }
.poste-commentaire-etape { display: block; margin-top: 6px; font-size: 12.5px; font-weight: 600; color: var(--accent); text-decoration: none;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.poste-commentaire-etape:hover { text-decoration: underline; }
.poste-commentaire-retirer { margin-left: auto; font-size: 12.5px; }
.poste-commentaire-x { margin-top: 6px; font-size: 14.5px; line-height: 1.5; white-space: pre-wrap; overflow-wrap: anywhere; color: var(--text-primary); }
.poste-avatar-petit { width: 26px; height: 26px; font-size: 11px; }
.poste-commenter { margin-top: 14px; }
.poste-commenter-etape { margin-top: 10px; }
.poste-commenter-etape .poste-panneau-btns { margin-top: 8px; }
.poste-textarea { resize: vertical; min-height: 78px; line-height: 1.45; font-family: inherit; }
.poste-commenter-pied { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-top: 8px; font-size: 12.5px; }

@media (max-width: 640px) {
  .poste-resultat { grid-template-columns: 1fr; }
  .poste-resultat .btn-primary, .poste-resultat .btn-secondary { width: 100%; }
  .poste-cherche-champ { font-size: 24px; letter-spacing: .1em; }
  /* Au téléphone, la barre du haut prend deux rangées : l'entête ne colle plus, il cacherait la moitié de l'écran. */
  .poste-entete { position: static; grid-template-columns: 1fr; padding: 14px; gap: 8px; border-radius: 14px; }
  .poste-section, .poste-etape, .poste-validation, .poste-panneau-manque { scroll-margin-top: 130px; }
  .poste-entete .poste-serie { font-size: 16px; }
  .poste-chrono { text-align: left; display: flex; align-items: baseline; gap: 12px; }
  .poste-chrono-l { justify-content: flex-start; margin: 0; }
  .poste-chrono-v { font-size: 30px; }
  .poste-entete-btns { justify-content: stretch; }
  .poste-entete-btns button { flex: 1; }
  .poste-etape { grid-template-columns: 42px 1fr; padding: 12px 12px; gap: 10px; }
  .poste-etape-d { grid-column: 2; text-align: left; padding: 0; }
  .poste-etape-t { font-size: 14.5px; }
  .poste-section-t { padding: 11px 12px; }
  .poste-motifs { grid-template-columns: 1fr; }
  .poste-champs { grid-template-columns: 1fr; }
  .poste-recap { grid-template-columns: 1fr 1fr; }
  .poste-pret .btn-primary { margin-left: 0; width: 100%; }
}

/* ── LA TRÉSORERIE D'UNE PLANIFICATION (module, …/tresorerie, §13) ─────────────────────────────
   Ce que la saison fait à l'encaisse. Le verdict reprend l'aplat de marque du rapport exécutif ; les hypothèses
   vivent dans une colonne collante à gauche, comme à la logistique. Couleurs : entrées = --graph-3 (fermes pleines,
   prévision hachurée), achats de la planification = --graph-1, PO déjà passés = --graph-6, reste à commander proposé
   = --machine, frais d'importation = --graph-4 ; sous zéro en rouge. */
.tr-module { display: inline-flex; align-items: center; gap: 10px; padding: 6px 12px 6px 8px; border: 1px solid var(--border); border-radius: 999px; background: var(--bg-elevated); font: inherit; font-size: 13px; color: var(--text-secondary); cursor: pointer; }
.tr-module:disabled { cursor: default; opacity: .8; }
.tr-module strong { color: var(--text-primary); font-weight: 600; }
.tr-switch { position: relative; width: 36px; height: 20px; border-radius: 999px; background: var(--accent); flex: none; }
.tr-switch::after { content: ""; position: absolute; top: 2px; left: 18px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.2); }

.pl-nav-lien .tr-nav-icone svg { display: block; }
.tr-nav-option { font-size: 10.5px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; padding: 1px 7px; border-radius: 999px; background: var(--draft-soft); color: var(--draft); }
.pl-nav-lien.est-actif .tr-nav-option { background: rgba(255,255,255,.22); color: #fff; }
.tr-ajout { margin-left: auto; align-self: center; display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border: 1.5px dashed color-mix(in srgb, var(--accent) 50%, transparent); border-radius: 999px; color: var(--accent); font-size: 13px; font-weight: 600; background: var(--accent-soft); text-decoration: none; }
.tr-ajout:hover, .tr-ajout.est-actif { border-style: solid; }

.tr-activer { display: flex; gap: 20px; padding: 24px 26px; align-items: flex-start; max-width: 860px; }
.tr-activer-icone { flex: none; width: 52px; height: 52px; border-radius: 14px; display: grid; place-items: center; color: #fff; background: var(--fond-degrade); }
.tr-activer-texte { display: flex; flex-direction: column; gap: 10px; align-items: flex-start; }
.tr-activer-texte .section-title { margin: 0; }
.tr-activer-texte p { margin: 0; color: var(--text-secondary); line-height: 1.55; }
.tr-activer-liste { margin: 0 0 4px; padding-left: 18px; color: var(--text-secondary); font-size: 13.5px; line-height: 1.6; }

.tr-hero { margin-bottom: 16px; }
.tr-hero-droite { display: flex; align-items: center; gap: 28px; flex-wrap: wrap; }
.tr-hero-spark { display: flex; flex-direction: column; gap: 4px; padding: 12px 14px; border-radius: 16px; background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.14); }
.tr-hero-spark-t { font-size: 11.5px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: rgba(255,255,255,.75); }
.tr-spark { width: 260px; height: 84px; overflow: visible; }
.tr-spark-zero { stroke: rgba(255,255,255,.45); stroke-dasharray: 3 3; }
.tr-spark-aire { fill: rgba(255,255,255,.14); }
.tr-spark-ligne { fill: none; stroke: #fff; stroke-width: 2.2; stroke-linejoin: round; }
.tr-spark-creux { fill: #fca5a5; stroke: #fff; stroke-width: 1.5; }
.tr-spark-fin { fill: #6ee7b7; stroke: #fff; stroke-width: 1.5; }
.tr-hero-spark-b { display: flex; justify-content: space-between; gap: 10px; font-size: 11px; color: rgba(255,255,255,.7); }
.tr-hero .pl-rx-anneau-valeur small { max-width: 88px; text-align: center; line-height: 1.2; font-size: 10px; }

.tr-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; margin-bottom: 16px; }
.tr-kpi-burn strong small { font-size: 12px; font-weight: 500; color: var(--text-muted); }
.tr-kpis .pl-rx-kpi strong { font-size: 18px; white-space: nowrap; }
.pl-rx-kpi.est-pos strong { color: var(--graph-3); }
.pl-rx-kpi.est-neg { border-color: rgba(220,38,38,.35); box-shadow: 0 0 0 3px rgba(220,38,38,.06); }
.pl-rx-kpi.est-neg strong { color: #dc2626; }

.tr-compte { display: inline-flex; gap: 6px; }
.tr-compte span { font-size: 11.5px; font-weight: 600; padding: 2px 9px; border-radius: 999px; color: #fff; }
.tr-compte .est-alerte { background: #dc2626; }
.tr-compte .est-attention { background: #ea580c; }
.pl-rx-alertes.tr-retenir { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }

.tr-corps { display: grid; grid-template-columns: 290px minmax(0, 1fr); gap: 18px; align-items: start; margin-top: 16px; }
.tr-hyp { position: sticky; top: 16px; padding: 18px 18px 16px; display: flex; flex-direction: column; gap: 6px; }
.tr-hyp .section-title { margin: 0; }
.tr-aide { margin: 0 0 4px; font-size: 12.5px; color: var(--text-muted); }
.tr-groupe { margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--border); font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--accent); }
.tr-hyp .field-label { font-size: 12.5px; margin-top: 4px; display: flex; align-items: center; gap: 6px; font-weight: 600; color: var(--text-primary); }
.tr-facultatif { font-size: 10.5px; color: var(--text-muted); font-weight: 500; padding: 0 6px; border: 1px solid var(--border); border-radius: 999px; }
.tr-saisie { display: flex; align-items: center; gap: 6px; }
.tr-saisie .input { flex: 1; min-width: 0; height: 34px; text-align: right; font-variant-numeric: tabular-nums; }
.tr-saisie .input::placeholder { text-align: left; font-style: italic; }
.tr-saisie span { font-size: 12px; color: var(--text-muted); min-width: 24px; white-space: nowrap; }
.tr-ligne2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.tr-segment { display: grid; grid-template-columns: repeat(3, 1fr); padding: 3px; gap: 3px; border-radius: 10px; background: var(--bg-tertiary); }
.tr-segment.tr-segment-2 { grid-template-columns: 1fr 1fr; }
.tr-segment button { border: 0; background: transparent; border-radius: 8px; padding: 6px 4px; font: inherit; font-size: 11.5px; line-height: 1.2; color: var(--text-secondary); cursor: pointer; }
.tr-segment button.est-on { background: var(--bg-elevated); color: var(--accent); font-weight: 600; box-shadow: var(--shadow-sm); }
.tr-note { margin: 2px 0 0; font-size: 11.5px; color: var(--text-muted); line-height: 1.45; }
.tr-case { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--text-secondary); margin-top: 6px; }
.tr-hyp-pied { display: flex; gap: 8px; margin-top: 14px; }

.tr-graphes { display: flex; flex-direction: column; gap: 18px; min-width: 0; }
.tr-deux { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 18px; }
.tr-deux.tr-deux-large { grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); }
.tr-deux > .card { margin: 0; }
.tr-bascule { display: inline-flex; padding: 3px; gap: 3px; border-radius: 10px; background: var(--bg-tertiary); flex: none; }
.tr-bascule button { border: 0; background: transparent; padding: 5px 12px; border-radius: 8px; font: inherit; font-size: 12.5px; color: var(--text-secondary); cursor: pointer; }
.tr-bascule button.est-on { background: var(--bg-elevated); color: var(--accent); font-weight: 600; box-shadow: var(--shadow-sm); }
.tr-bascule button:disabled { opacity: .5; cursor: default; }
.tr-graphes .pl-rx-carte-tete .ax-carte-aide { margin: 4px 0 0; }
.tr-devise { font-size: 12px; font-weight: 500; color: var(--text-muted); margin-left: 6px; }

/* Légendes et pastilles */
.tr-leg { margin: 10px 0 4px; }
.tr-leg-bas { margin-top: 12px; }
.tr-pastille { display: inline-block; width: 11px; height: 11px; border-radius: 3px; vertical-align: -1px; margin-right: 6px; flex: none; }
.tr-pastille.tr-c-ferme { background: var(--graph-3); }
.tr-pastille.tr-c-prevu { background: repeating-linear-gradient(45deg, var(--graph-3) 0 2px, color-mix(in srgb, var(--graph-3) 16%, transparent) 2px 5px); }
.tr-pastille.tr-c-plan { background: var(--graph-1); }
.tr-pastille.tr-c-passe { background: var(--graph-6); }
.tr-pastille.tr-c-propose { background: var(--machine); }
.tr-pastille.tr-c-frais { background: var(--graph-4); }
.tr-pastille.tr-c-depenses { background: var(--graph-5); }
.tr-pastille.tr-c-cone { background: color-mix(in srgb, var(--graph-1) 14%, transparent); border: 1px dashed color-mix(in srgb, var(--graph-1) 55%, transparent); }
.tr-trait-net { display: inline-block; width: 16px; height: 3px; background: var(--text-primary); border-radius: 2px; }
.tr-trait-cumul { display: inline-block; width: 16px; height: 3px; background: linear-gradient(90deg, #dc2626 50%, var(--graph-3) 50%); border-radius: 2px; }
.tr-trait-credit { display: inline-block; width: 18px; border-top: 2px dashed #dc2626; }

/* Les graphiques */
.tr-graphe-zone { position: relative; }
.tr-svg { width: 100%; height: auto; display: block; font-family: inherit; }
.tr-axe { font-size: 10.5px; fill: var(--text-muted); }
.tr-saison { fill: color-mix(in srgb, var(--accent) 4%, transparent); }
.tr-saison-txt { font-weight: 700; letter-spacing: .08em; fill: color-mix(in srgb, var(--accent) 60%, transparent); font-size: 9.5px; }
.tr-survol { fill: color-mix(in srgb, var(--accent) 10%, transparent); }
.tr-grille { stroke: var(--border); stroke-width: 1; }
.tr-zero { stroke: var(--text-secondary); stroke-width: 1.2; }
.tr-c-ferme { fill: var(--graph-3); }
.tr-c-prevu-b { stroke: var(--graph-3); stroke-width: 1; }
.tr-prevu-fond { fill: color-mix(in srgb, var(--graph-3) 16%, transparent); }
.tr-prevu-trait { stroke: var(--graph-3); stroke-width: 2.4; }
.tr-c-plan { fill: var(--graph-1); }
.tr-c-passe { fill: var(--graph-6); }
.tr-c-propose { fill: var(--machine); }
.tr-c-frais { fill: var(--graph-4); }
.tr-c-depenses { fill: var(--graph-5); }
.tr-net { stroke: var(--text-primary); stroke-width: 2.6; stroke-linecap: round; }
.tr-val { font-size: 10.5px; font-weight: 600; fill: var(--text-primary); font-variant-numeric: tabular-nums; }
.tr-colonnes { position: absolute; top: 0; bottom: 26px; display: flex; }
.tr-colonne { flex: 1; border: 0; background: transparent; cursor: pointer; border-radius: 6px; }
.tr-colonne:hover { background: color-mix(in srgb, var(--accent) 6%, transparent); }
.tr-colonne:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.tr-detail { position: relative; margin-top: 10px; padding: 12px 40px 12px 16px; border: 1px solid var(--border); border-radius: 12px; background: var(--bg-glass); }
.tr-detail > strong { display: block; margin-bottom: 6px; text-transform: capitalize; }
.tr-detail dl { margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 4px 24px; font-size: 12.5px; }
.tr-detail dl > div { display: flex; justify-content: space-between; gap: 12px; }
.tr-detail dt { color: var(--text-secondary); display: flex; align-items: center; }
.tr-detail dd { margin: 0; font-weight: 600; font-variant-numeric: tabular-nums; }
.tr-detail .tr-detail-total dt { color: var(--text-primary); font-weight: 600; }
.tr-detail .est-neg, .tr-table td.est-neg { color: #dc2626; }
.tr-detail .est-pos { color: var(--graph-3); }
.tr-detail .btn-icon { position: absolute; top: 8px; right: 8px; }
.tr-hors-credit { fill: rgba(220,38,38,.07); }
.tr-credit { stroke: #dc2626; stroke-width: 1.4; stroke-dasharray: 6 4; }
.tr-credit-txt { font-size: 10.5px; font-weight: 600; fill: #dc2626; }
.tr-seuil { stroke: var(--text-secondary); stroke-width: 1.2; stroke-dasharray: 2 3; }
.tr-seuil-txt { font-size: 10.5px; font-weight: 600; fill: var(--text-secondary); }
.tr-cone { fill: color-mix(in srgb, var(--graph-1) 9%, transparent); }
.tr-pess, .tr-opt { fill: none; stroke: color-mix(in srgb, var(--graph-1) 55%, transparent); stroke-width: 1.3; stroke-dasharray: 4 4; }
.tr-g-pos { stop-color: var(--graph-3); }
.tr-g-neg { stop-color: #dc2626; }
.tr-cumul { fill: none; stroke: var(--graph-3); stroke-width: 2.6; stroke-linejoin: round; }
.tr-cumul.est-neg { stroke: #dc2626; }
.tr-creux { fill: #dc2626; stroke: #fff; stroke-width: 1.5; }
.tr-creux-halo { fill: rgba(220,38,38,.18); }
.tr-zero-v { stroke: var(--graph-3); stroke-width: 1; stroke-dasharray: 2 3; }
.tr-zero-pt { fill: var(--graph-3); stroke: #fff; stroke-width: 1.5; }
.tr-auj { stroke: var(--text-secondary); stroke-width: 1; stroke-dasharray: 2 3; }
.tr-auj-txt { font-weight: 600; fill: var(--text-secondary); }
.tr-bulle { fill: var(--bg-elevated); stroke-width: 1.2; filter: drop-shadow(0 2px 6px rgba(0,0,0,.08)); }
.tr-bulle.est-neg { stroke: rgba(220,38,38,.5); }
.tr-bulle.est-pos { stroke: color-mix(in srgb, var(--graph-3) 55%, transparent); }
.tr-bulle-t { font-size: 11.5px; font-weight: 700; fill: var(--text-primary); }
.tr-bulle-s { font-size: 10.5px; fill: var(--text-secondary); }
.tr-fin { font-size: 10.5px; font-weight: 600; fill: color-mix(in srgb, var(--graph-1) 85%, transparent); }

/* Du zéro à la fin (le pont) */
.tr-pont { display: flex; flex-direction: column; gap: 10px; margin-top: 12px; }
.tr-pont-l { display: grid; grid-template-columns: 150px 1fr 120px; align-items: center; gap: 10px; font-size: 12.5px; }
.tr-pont-nom { color: var(--text-secondary); line-height: 1.25; }
.tr-pont-piste { position: relative; height: 22px; }
.tr-pont-zero { position: absolute; top: -6px; bottom: -6px; width: 1px; background: var(--text-secondary); opacity: .6; }
.tr-pont-depart { position: absolute; top: 5px; width: 12px; height: 12px; margin-left: -6px; border-radius: 50%; background: var(--text-secondary); }
.tr-pont-barre { position: absolute; top: 0; height: 22px; border-radius: 5px; min-width: 2px; }
.tr-pont-barre.tr-c-plan { background: var(--graph-1); }
.tr-pont-barre.tr-c-passe { background: var(--graph-6); }
.tr-pont-barre.tr-c-propose { background: var(--machine); }
.tr-pont-barre.tr-c-frais { background: var(--graph-4); }
.tr-pont-barre.tr-c-depenses { background: var(--graph-5); }
.tr-pont-barre.tr-c-ferme { background: var(--graph-3); }
.tr-pont-barre.tr-c-prevu-p { background: repeating-linear-gradient(45deg, var(--graph-3) 0 3px, color-mix(in srgb, var(--graph-3) 16%, transparent) 3px 7px); border: 1px solid var(--graph-3); }
.tr-pont-barre.tr-c-net { background: linear-gradient(90deg, color-mix(in srgb, var(--graph-3) 75%, #000), var(--graph-3)); }
.tr-pont-barre.tr-c-net-neg { background: linear-gradient(90deg, #dc2626, #f87171); }
.tr-pont-v { text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; }
.tr-pont-v.est-neg { color: #dc2626; }
.tr-pont-v.est-pos { color: var(--graph-3); }
.tr-pont-l.est-total { padding-top: 10px; border-top: 1px solid var(--border); }
.tr-pont-l.est-total .tr-pont-nom { color: var(--text-primary); font-weight: 600; }

/* Les leviers */
.tr-leviers { list-style: none; margin: 12px 0 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.tr-leviers li { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; padding: 12px 14px; border: 1px solid var(--border); border-radius: 12px; background: var(--bg-glass); }
.tr-leviers li > div { flex: 1 1 100%; display: flex; flex-direction: column; gap: 2px; }
.tr-leviers li > div strong { font-size: 13.5px; }
.tr-leviers li > div span { font-size: 12px; color: var(--text-secondary); }
.tr-leviers li .btn-secondary { margin-left: auto; padding: 4px 12px; font-size: 12.5px; }
.tr-delta { font-size: 11.5px; font-weight: 600; padding: 3px 9px; border-radius: 999px; white-space: nowrap; }
.tr-delta.est-bien { background: color-mix(in srgb, var(--graph-3) 14%, transparent); color: var(--graph-3); }

/* Le cycle de l'argent */
.tr-cycle { display: flex; flex-direction: column; gap: 10px; margin-top: 8px; }
.tr-cycle-axe, .tr-cycle-l { display: grid; grid-template-columns: 170px 1fr 130px; gap: 12px; align-items: center; }
.tr-cycle-mois { display: flex; font-size: 10.5px; color: var(--text-muted); text-align: center; border-bottom: 1px solid var(--border); padding-bottom: 4px; overflow: hidden; }
.tr-cycle-mois span { flex: none; white-space: nowrap; overflow: hidden; }
.tr-cycle-nom { display: flex; flex-direction: column; font-size: 13px; min-width: 0; }
.tr-cycle-nom strong { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tr-cycle-nom small, .tr-cycle-j small { font-size: 11px; color: var(--text-muted); }
.tr-cycle-piste { position: relative; height: 24px; background: var(--bg-glass); border-radius: 6px; }
.tr-cy { position: absolute; top: 3px; height: 18px; }
.tr-cy-mer, .tr-pastille.tr-cy-mer { background: var(--graph-1); }
.tr-cy-mer { border-radius: 9px 0 0 9px; }
.tr-cy-pdi, .tr-pastille.tr-cy-pdi { background: var(--graph-2); }
.tr-cy-vente { background: linear-gradient(90deg, color-mix(in srgb, var(--graph-3) 25%, transparent), var(--graph-3)); border-radius: 0 9px 9px 0; }
.tr-cy-vente.est-ouvert { background: linear-gradient(90deg, color-mix(in srgb, var(--graph-3) 25%, transparent), color-mix(in srgb, var(--graph-3) 55%, transparent)); border-radius: 0; }
.tr-pastille.tr-cy-vente-p { background: linear-gradient(90deg, color-mix(in srgb, var(--graph-3) 25%, transparent), var(--graph-3)); }
.tr-cy-pay, .tr-cy-fin { position: absolute; top: 0; width: 2px; height: 24px; }
.tr-cy-pay { background: var(--graph-1); }
.tr-cy-fin { background: color-mix(in srgb, var(--graph-3) 75%, #000); }
.tr-cycle-j { display: flex; flex-direction: column; text-align: right; }
.tr-cycle-j strong { font-size: 15px; font-variant-numeric: tabular-nums; }

/* Ce qui pèse le plus (tornade) */
.tr-tornade { display: flex; flex-direction: column; gap: 9px; margin-top: 12px; }
.tr-tor-tete, .tr-tor-l { display: grid; grid-template-columns: 112px 1fr 2px 1fr; align-items: center; gap: 0 8px; }
.tr-tor-tete { font-size: 10.5px; color: var(--text-muted); text-transform: uppercase; letter-spacing: .06em; }
.tr-tor-tete span:nth-child(2) { text-align: right; }
.tr-tor-base { justify-self: center; font-weight: 700; color: var(--text-primary); text-transform: none; letter-spacing: 0; white-space: nowrap; font-size: 11.5px; }
.tr-tor-tete span:nth-child(2) { padding-right: 26px; }
.tr-tor-tete span:nth-child(4) { padding-left: 26px; }
.tr-tor-nom { font-size: 12.5px; color: var(--text-secondary); line-height: 1.2; }
.tr-tor-g, .tr-tor-d { display: flex; align-items: center; gap: 6px; height: 24px; min-width: 0; }
.tr-tor-zone { flex: 1; display: flex; min-width: 0; }
.tr-tor-g .tr-tor-zone { justify-content: flex-end; }
.tr-tor-g small, .tr-tor-d small { flex: none; width: 74px; font-size: 10.5px; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tr-tor-g small { text-align: right; }
.tr-tor-axe { height: 30px; background: var(--text-secondary); }
.tr-tor-b { height: 20px; display: flex; align-items: center; min-width: 34px; }
.tr-tor-g .tr-tor-b { justify-content: flex-start; border-radius: 4px 0 0 4px; }
.tr-tor-d .tr-tor-b { justify-content: flex-end; border-radius: 0 4px 4px 0; }
.tr-tor-b em { font-style: normal; font-size: 10.5px; font-weight: 700; padding: 0 5px; white-space: nowrap; }
.tr-tor-b.est-mal { background: #f87171; color: #fff; }
.tr-tor-b.est-bien { background: #34d399; color: #064e3b; }

/* L'effet des achats et le tableau */
.data-table.tr-compare { margin-top: 10px; font-size: 12.5px; table-layout: fixed; }
.tr-compare th, .tr-compare td { white-space: normal; padding: 9px 6px; }
.tr-compare th:first-child { width: 40%; }
.tr-compare td:first-child, .tr-compare th:first-child { text-align: left; }
.tr-compare td.num, .tr-compare th.num { white-space: nowrap; }
.tr-compare td .cell-sub { display: block; }
.tr-compare .tr-devise-th { font-weight: 500; color: var(--text-muted); }
.tr-compare tr.est-actuel td { background: var(--accent-soft); }
.tr-compare td.est-bien { color: var(--graph-3); font-weight: 600; }
.tr-compare td.est-mal { color: #dc2626; font-weight: 600; }
.tr-table { font-size: 12px; }
.tr-table th, .tr-table td { white-space: nowrap; padding: 7px 8px; }
.tr-table td:first-child, .tr-table th:first-child { position: sticky; left: 0; background: var(--bg-elevated); text-align: left; font-weight: 500; min-width: 210px; }
.tr-table th.est-saison { color: var(--accent); }
.tr-table tr.est-estime td { font-style: italic; color: var(--text-secondary); }
.tr-table tr.est-sous-total td { font-weight: 600; border-top: 1px solid var(--border); }
.tr-table tr.est-sortie td:not(:first-child) { color: var(--graph-1); }
.tr-table tr.est-net td { font-weight: 700; background: var(--bg-glass); }
.tr-table tr.est-cumul td { font-weight: 700; }
.tr-table td.est-neg { background: rgba(220,38,38,.07); }
.tr-table td.est-pos { color: var(--graph-3); background: color-mix(in srgb, var(--graph-3) 7%, transparent); }

@media (max-width: 1200px) {
    .tr-kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .tr-corps { grid-template-columns: 1fr; }
    .tr-hyp { position: static; }
}
@media (max-width: 900px) {
    .tr-deux, .tr-deux.tr-deux-large, .pl-rx-alertes.tr-retenir { grid-template-columns: 1fr; }
    .tr-cycle-axe, .tr-cycle-l { grid-template-columns: 120px 1fr 90px; }
}
@media (max-width: 720px) {
    .tr-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .tr-activer { flex-direction: column; padding: 20px; }
    .tr-spark { width: 200px; }
    .tr-pont-l { grid-template-columns: 110px 1fr 96px; }
    .tr-ajout { margin-left: 0; }
}

/* Les dépenses régulières (le burn rate), dans la colonne des hypothèses */
.tr-depense { display: flex; flex-direction: column; gap: 6px; padding: 10px; border: 1px solid var(--border); border-radius: 10px; background: var(--bg-glass); }
.tr-depense-tete { display: flex; gap: 6px; align-items: center; }
.tr-depense-libelle { flex: 1; min-width: 0; height: 32px; font-weight: 600; }
.tr-depense select.input { height: 34px; font-size: 12.5px; }
.tr-date { display: flex; flex-direction: column; gap: 2px; font-size: 11px; color: var(--text-muted); }
.tr-date .input { height: 32px; font-size: 12px; }
.tr-depense-ajout { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 2px; }
.tr-depense-ajout .btn-secondary { padding: 4px 10px; font-size: 12.5px; }
.tr-burn-total { margin: 4px 0 0; display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 8px; font-size: 12.5px; color: var(--text-secondary); }
.tr-burn-total strong { color: var(--graph-5); font-size: 15px; }
.tr-burn-total small { color: var(--text-muted); }
.tr-depense-montant { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 8px; }
.tr-depense-montant .tr-saisie span { min-width: 0; }
.tr-depense .tr-date .input { width: 100%; min-width: 0; padding-left: 6px; padding-right: 4px; }

/* ── CÉDULE D'EXPÉDITION (/reapprovisionnement/expeditions, docs/cedule-expedition.md) ─────────── */
.ce-barre-modif { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; padding: 10px 14px; margin: 0 0 14px;
    border: 1px solid var(--draft); background: var(--draft-soft); border-radius: 10px; }
.ce-barre-modif > span { flex: 1 1 220px; font-weight: 600; }
.ce-corps { display: grid; grid-template-columns: minmax(220px, 280px) 1fr; gap: 16px; align-items: start; margin-top: 16px; }
@media (max-width: 900px) { .ce-corps { grid-template-columns: 1fr; } }
.ce-parametres { position: sticky; top: 12px; }
.ce-liste { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.ce-exp { padding: 14px 16px; border-left: 4px solid var(--graph-1); }
.ce-exp.est-partie { border-left-color: var(--graph-3); opacity: .8; }
.ce-exp.est-enpartie { border-left-color: var(--graph-6); }
.ce-exp.est-enretard { border-left-color: var(--graph-2); }
.ce-exp-tete { display: flex; flex-wrap: wrap; gap: 12px 18px; align-items: end; margin-bottom: 10px; }
.ce-exp-n { font-weight: 700; font-size: 1.02rem; align-self: center; }
.ce-etat { align-self: center; }
.ce-exp.est-enretard .ce-etat { color: var(--graph-2); }
.ce-exp.est-partie .ce-etat { color: var(--graph-3); }
.ce-champ { display: flex; flex-direction: column; gap: 3px; font-size: .78rem; color: var(--text-secondary); }
.ce-champ .input { width: 150px; }
.ce-champ-court .input { width: 80px; }
.ce-exp-fait { display: flex; flex-direction: column; gap: 3px; font-size: .78rem; color: var(--text-secondary); }
.ce-exp-fait strong { font-size: .95rem; color: var(--text-primary); }
.ce-exp-tete .btn-icon { margin-left: auto; align-self: center; }
.data-table.ce-lignes td .input.ce-po { width: 100px; }
.data-table.ce-lignes td .input.ce-code { width: 190px; }
.data-table.ce-lignes td .input.ce-qte { width: 76px; text-align: right; }
.ce-libelle { display: block; font-size: .78rem; color: var(--text-secondary); margin-top: 2px; }
.ce-note { display: inline-block; font-size: .74rem; margin-top: 2px; padding: 1px 6px; border-radius: 6px; background: var(--accent-soft); }
.ce-ajout { margin-top: 8px; }
.ce-ecart td { background: var(--draft-soft); }
.ce-historique { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.ce-historique small { color: var(--text-secondary); margin-left: 6px; }
.ce-changements { margin: 8px 0 12px; padding-left: 18px; font-size: .88rem; columns: 2 320px; }
.ce-semer-exp { font-size: .95rem; margin: 16px 0 6px; }
.ce-cal-legende { display: flex; flex-wrap: wrap; gap: 16px; font-size: .82rem; color: var(--text-secondary); margin-bottom: 8px; }
.ce-pastille { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.ce-pastille.est-depart, .ce-cal-barre.est-depart { background: var(--graph-1); }
.ce-pastille.est-arrivee, .ce-cal-barre.est-arrivee { background: var(--graph-3); }
.ce-cal-grille { display: grid; grid-template-columns: repeat(var(--semaines), minmax(34px, 1fr)); gap: 4px; overflow-x: auto; padding-bottom: 4px; }
.ce-cal-col { display: grid; grid-template-rows: 90px auto 90px auto; text-align: center; border-radius: 6px; padding: 2px; }
.ce-cal-col.est-courante { background: var(--accent-soft); }
.ce-cal-haut, .ce-cal-bas { display: flex; flex-direction: column; align-items: center; gap: 2px; }
.ce-cal-haut { justify-content: flex-end; }
.ce-cal-bas { justify-content: flex-start; }
.ce-cal-barre { width: 70%; min-height: 3px; border-radius: 3px; }
.ce-cal-n { font-size: .72rem; font-weight: 600; }
.ce-cal-date { font-size: .7rem; color: var(--text-secondary); white-space: nowrap; padding: 3px 0; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.ce-cal-argent { font-size: .68rem; color: var(--text-secondary); white-space: nowrap; min-height: 1em; }
/* La carte « Ce que change la cédule » de la trésorerie. */
.tr-cedule-chiffres { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; margin: 4px 0 14px; }
.tr-cedule-chiffres > div { display: flex; flex-direction: column; gap: 2px; padding: 10px 12px; border: 1px solid var(--border); border-radius: 10px; }
.tr-cedule-chiffres span { font-size: .78rem; color: var(--text-secondary); }
.tr-cedule-chiffres strong { font-size: 1.15rem; }
.tr-cedule-chiffres small { color: var(--text-secondary); }
.tr-cedule-table { width: 100%; border-collapse: collapse; font-size: .86rem; }
.tr-cedule-table th, .tr-cedule-table td { padding: 5px 8px; border-bottom: 1px solid var(--border); text-align: left; }
.tr-cedule-table td { position: relative; }
.tr-cedule-table .num { text-align: right; position: relative; }
.tr-cedule-barre { position: absolute; left: 8px; top: 50%; height: 8px; margin-top: -4px; border-radius: 3px; opacity: .35; }
.tr-cedule-barre.est-avec { background: var(--graph-1); }
.tr-cedule-barre.est-sans { background: var(--graph-6); }
/* Le bouton « Cédule d'expédition » de la logistique d'opération : le nombre d'expéditions prévues. */
.ol-cedule-compte { display: inline-block; min-width: 1.5em; margin-left: 6px; padding: 0 6px; border-radius: 999px;
    background: var(--accent-soft); color: var(--accent); font-size: .78rem; font-weight: 700; text-align: center; }
.ce-proposee { background: var(--draft-soft); color: var(--text-primary); border: 1px dashed var(--draft); align-self: center; }
.ce-convenue { align-self: center; }
.ce-convenir { align-self: center; padding: 3px 10px; font-size: .8rem; }
.ce-exp.est-proposee { border-left-style: dashed; }
/* « Proposer une cédule » (/…/expeditions/proposer). */
.data-table.pr-table { white-space: normal; }
.data-table.pr-table td { padding: 8px 10px; }
.pr-priorite td { background: var(--draft-soft); }
.pr-porte { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; }
.pr-ligne { padding: 2px 8px; border-radius: 8px; background: var(--accent-soft); font-size: .84rem; white-space: nowrap; }
.pr-ligne small { color: var(--text-secondary); margin-left: 4px; }
.pr-modele { display: grid; grid-template-columns: 1fr 80px; gap: 8px; align-items: center; font-size: .86rem; margin: 4px 0; }
.pr-modele .input { text-align: right; padding: 4px 8px; }
.pr-accepter .btn-primary { margin-top: 6px; }
