/* ════════════════════════════════════════════════════════
   Vitalrest — Intérim
   ════════════════════════════════════════════════════════ */
:root {
  --navy: #0f2040;
  --navy-2: #1b3160;
  --bleu: #2563be;
  --bleu-fonce: #1d4f9a;
  --bleu-pale: #e9f0fb;
  --vert: #8ab61a;
  --fond: #f3f5f8;
  --surface: #ffffff;
  --bordure: #dce1e9;
  --grille: #e8ecf2;
  --texte: #16213a;
  --texte-2: #465269;
  --texte-3: #6a7489;
  --attenue: #c5ccd8;
  --danger: #b42318;
  --danger-fond: #fdecea;
  --alerte: #8a5a00;
  --alerte-fond: #fff4dc;
  --ok: #276b2c;
  --ok-fond: #e8f4e8;
  --mission: #6b4fbb;       /* mission réalisée (facturée ou au suivi) */
  --mission-fond: #efeafa;
  --nv: #5b21b6;            /* 3WM : rapproché d'un BL non validé dans Adoria (commande livrable sans réception validée) */
  --nv-fond: #f3eefe;
  --parametrage: #0f6464;    /* paramétrage des modules (contrôle de gestion, administrateur) : marque ⚙ */
  --parametrage-fond: #e5f2f2;
  /* DGA › Clôture des achats : états d'un site × mois (bande de tendance, répartition, graphique) ; vert, rouge, orange et
     gris foncé validés pour la vision des couleurs (deutéranopie) ; pastilles : textes --ok, --danger, --alerte sur fond clair */
  --cloture-juste: #4a9a50;
  --cloture-sous: #a3211a;
  --cloture-sur: #2563be;
  --cloture-sur-texte: #ffffff;
  --cloture-sur-fond: #e3ecf9;
  --cloture-rien: #4a5361;
  --cloture-hachure: #e3e7ee;
  --rayon: 8px;
  --ombre: 0 1px 2px rgba(15, 32, 64, .06), 0 2px 10px rgba(15, 32, 64, .04);
  color-scheme: light;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html, body { margin: 0; }
body {
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 14px;
  line-height: 1.45;
  color: var(--texte);
  background: var(--fond);
}
h1, h2, h3 { margin: 0; font-weight: 650; }
h2 { font-size: 16px; }
h3 { font-size: 14px; }
a { color: var(--bleu); }
button, input, select { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--bleu); outline-offset: 2px; }

/* ── Boutons ─────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 14px; border-radius: 6px; border: 1px solid var(--bordure);
  background: var(--surface); color: var(--texte); cursor: pointer; white-space: nowrap;
}
.btn:hover { border-color: var(--bleu); color: var(--bleu); }
.btn:disabled, .btn[aria-disabled="true"] { opacity: .55; cursor: not-allowed; }
.btn-primaire { background: var(--bleu); border-color: var(--bleu); color: #fff; font-weight: 600; }
.btn-primaire:hover { background: var(--bleu-fonce); border-color: var(--bleu-fonce); color: #fff; }
.btn-large { width: 100%; justify-content: center; padding: 10px 14px; }
.btn-lien { border-color: transparent; background: none; color: var(--bleu); padding: 7px 8px; }
.btn-lien:hover { text-decoration: underline; border-color: transparent; }
.btn-danger { color: var(--danger); border-color: transparent; background: none; padding: 3px 6px; }
.btn-danger:hover { color: var(--danger); border-color: var(--danger); }
.btn-danger-plein { background: var(--danger); border-color: var(--danger); color: #fff; font-weight: 600; }
.btn-danger-plein:hover { background: #8f1b12; border-color: #8f1b12; color: #fff; }

/* ── Confirmation (suppressions) ─────────── */
.confirmation {
  width: min(460px, calc(100vw - 32px)); padding: 20px; border: 1px solid var(--bordure); border-top: 4px solid var(--danger);
  border-radius: var(--rayon); background: var(--surface); color: var(--texte); box-shadow: 0 16px 48px rgba(15, 32, 64, .3);
}
.confirmation::backdrop { background: rgba(15, 32, 64, .45); }
.confirmation h2 { margin-bottom: 8px; }
.confirmation p { margin: 0 0 10px; }
.confirmation-details { padding: 8px 10px; border-radius: 6px; background: var(--fond); font-size: 13px; color: var(--texte-2); }
.confirmation .formulaire-actions { justify-content: flex-end; margin-top: 14px; }
.btn-entete { background: transparent; border-color: rgba(255, 255, 255, .35); color: #fff; }
.btn-entete:hover { border-color: #fff; color: #fff; }

/* ── Champs ──────────────────────────────── */
input, select {
  border: 1px solid var(--bordure); border-radius: 6px; background: var(--surface);
  padding: 7px 10px; min-height: 36px;
}
input:focus, select:focus { border-color: var(--bleu); outline: none; box-shadow: 0 0 0 3px var(--bleu-pale); }
.champ { display: flex; flex-direction: column; gap: 4px; font-size: 12px; font-weight: 600; color: var(--texte-2); }
.grille-seuils { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px 16px; margin: 8px 0 14px; align-items: end; }
.champ input, .champ select { font-weight: 400; color: var(--texte); font-size: 14px; }
.champ-aide { font-weight: 400; color: var(--texte-3); }

/* ── Connexion ───────────────────────────── */
.connexion {
  min-height: 100vh; display: grid; place-items: center; padding: 16px;
  background: linear-gradient(160deg, var(--navy) 0%, var(--navy-2) 100%);
}
.connexion-carte { width: min(380px, 100%); display: flex; flex-direction: column; gap: 14px; padding: 28px; }
.connexion-logo { display: block; width: 220px; height: auto; margin: 0 auto 2px; }
.connexion-titre { margin: 0; text-align: center; font-size: 24px; font-weight: 800; letter-spacing: .08em; color: var(--navy); }
.connexion-titre span { display: block; margin-top: 2px; font-size: 13px; font-weight: 500; letter-spacing: 0; color: var(--texte-3); }
.aide { margin: 0; font-size: 12px; color: var(--texte-3); }
.message-erreur { margin: 0; min-height: 1em; color: var(--danger); font-size: 13px; }
.message-ok { margin: 0; color: var(--ok); font-size: 13px; }

/* ── Marque (bouton : retour au sommaire) ── */
.marque { display: flex; align-items: center; gap: 12px; color: #fff; padding: 0; border: 0; background: none; text-align: left; cursor: pointer; border-radius: 8px; }
.marque:hover .marque-logo { box-shadow: 0 0 0 2px var(--vert); }
.marque:focus-visible { outline-color: #fff; outline-offset: 4px; }
.marque-logo { display: inline-flex; align-items: center; padding: 4px 10px; border-radius: 8px; background: #fff; }
.marque-logo img { display: block; width: auto; height: 30px; }
.marque-nom { display: flex; flex-direction: column; font-weight: 800; font-size: 17px; letter-spacing: .08em; line-height: 1.1; }
.marque-module { font-size: 11px; font-weight: 400; letter-spacing: .02em; opacity: .75; }

/* Environnement de recette : bandeau au-dessus de l'écran (public/js/app.js, /api/auth/config) */
.bandeau-recette { padding: 6px 24px; background: var(--alerte-fond); color: var(--alerte); border-bottom: 2px solid var(--alerte); font-size: 13px; font-weight: 700; text-align: center; }

/* ── En-tête & onglets ───────────────────── */
.entete {
  display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
  padding: 10px 24px; background: var(--navy); color: #fff; border-bottom: 3px solid var(--vert);
}
.entete-annee { display: flex; align-items: center; gap: 8px; font-size: 12px; color: rgba(255, 255, 255, .8); }
.entete-annee select, .entete-annee .combo-saisie { background: var(--navy-2); color: #fff; border-color: rgba(255, 255, 255, .25); min-height: 32px; padding: 4px 8px; }
/* Bascule de module (Intérim · Fins de mois) dans l'en-tête sombre */
.entete-module { border-color: rgba(255, 255, 255, .3); }
.entete-module button { background: transparent; color: rgba(255, 255, 255, .8); border-right-color: rgba(255, 255, 255, .3); font-weight: 600; }
.entete-module button[aria-pressed="true"] { background: #fff; color: var(--navy, #14213d); }
.entete-utilisateur { margin-left: auto; display: flex; flex-direction: column; align-items: flex-end; line-height: 1.25; }
.u-nom { font-weight: 600; }
.u-perimetre { font-size: 12px; color: rgba(255, 255, 255, .7); }

/* Navigation à deux niveaux (public/js/app.js, construireNav) : barre des modules (pastilles ; domaine en petit titre ; Import et
   Administration à droite), puis barre des onglets du module choisi (onglets soulignés, petits titres de groupe s'il y en a
   plusieurs) ; chaque barre défile seule sur petit écran */
.onglets { display: flex; flex-direction: column; background: var(--surface); border-bottom: 1px solid var(--bordure); }
.onglets button { font: inherit; cursor: pointer; white-space: nowrap; }
.nav-modules { display: flex; align-items: flex-end; gap: 4px 0; padding: 6px 24px; overflow-x: auto; }
.nav-accueil, .nav-module, .nav-outil {
  border: 1px solid transparent; background: none; border-radius: 8px; padding: 6px 12px; color: var(--texte-2); font-size: 13.5px; font-weight: 600;
}
.nav-accueil:hover, .nav-module:hover, .nav-outil:hover { background: var(--fond); color: var(--navy); }
.nav-module[aria-pressed="true"], .nav-accueil[aria-current="page"], .nav-outil[aria-current="page"] { background: var(--navy); border-color: var(--navy); color: #fff; }
.nav-accueil { margin-right: 10px; }
.nav-accueil::before { content: '⌂'; margin-right: 6px; font-weight: 700; }
.nav-domaine { display: flex; flex-direction: column; gap: 2px; margin-right: 10px; padding-left: 10px; border-left: 1px solid var(--bordure); }
.nav-domaine[hidden] { display: none; }
.nav-domaine-titre { padding-left: 12px; font-size: 10.5px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--texte-3); white-space: nowrap; }
.nav-domaine-modules { display: flex; gap: 2px; }
.nav-gestion { display: flex; gap: 2px; margin-left: auto; padding-left: 10px; }
@media (max-width: 1340px) { .nav-accueil, .nav-module, .nav-outil { padding: 6px 9px; font-size: 13px; } .nav-domaine-titre { padding-left: 9px; } }
.nav-module .badge-onglet { margin-left: 6px; }
.nav-onglets { display: flex; padding: 0 24px; border-top: 1px solid var(--grille); background: #fbfcfd; overflow-x: auto; }
.nav-onglets[hidden], .nav-onglets-module[hidden], .nav-groupe[hidden] { display: none; }
.nav-onglets-module { display: flex; flex: 1 0 auto; align-items: flex-end; }
.nav-groupe { display: flex; flex-direction: column; }
.nav-titres .nav-groupe + .nav-groupe { margin-left: 8px; padding-left: 8px; border-left: 1px solid var(--bordure); }
.nav-groupe-titre { display: none; padding: 7px 12px 0; font-size: 10px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--texte-3); white-space: nowrap; }
.nav-titres .nav-groupe-titre { display: block; }
.nav-groupe-boutons { display: flex; gap: 2px; }
.nav-groupe-boutons button { border: 0; border-bottom: 2px solid transparent; background: none; padding: 10px 12px 9px; color: var(--texte-2); font-weight: 500; }
.nav-titres .nav-groupe-boutons button { padding-top: 4px; }
.nav-groupe-boutons button:hover { color: var(--bleu); }
.nav-groupe-boutons button[aria-current="page"] { color: var(--bleu); border-bottom-color: var(--bleu); font-weight: 650; }
/* Paramétrage du module (contrôle de gestion, administrateur) : bouton ⚙ au bout de la barre des onglets */
.nav-parametrage { display: flex; align-items: flex-end; margin-left: auto; padding-left: 12px; }
.nav-parametrage button { border: 0; border-bottom: 2px solid transparent; background: none; padding: 10px 12px 9px; color: var(--parametrage); font-weight: 600; }
.nav-parametrage button:hover { border-bottom-color: var(--parametrage); }

/* Paramétrage dans les modules : volets et cartes réservés au contrôle de gestion et à l'administrateur, marqués ⚙ */
.segments button.volet-parametrage { color: var(--parametrage); font-weight: 600; }
.segments button.volet-parametrage::before { content: '⚙ '; }
.segments button.volet-parametrage[aria-pressed="true"] { background: var(--parametrage); color: #fff; }
.carte-parametrage { border-left: 4px solid var(--parametrage); }
.badge-parametrage { display: inline-block; margin-left: 8px; padding: 1px 8px; border-radius: 10px; background: var(--parametrage-fond); color: var(--parametrage);
  font-size: 11px; font-weight: 700; letter-spacing: .02em; vertical-align: middle; white-space: nowrap; }

/* Recherche « Aller à » (Ctrl K) : bouton de l'en-tête, fenêtre de recherche */
.btn-aller {
  display: inline-flex; align-items: center; gap: 8px; min-width: 230px; padding: 6px 10px; border: 1px solid rgba(255, 255, 255, .25);
  border-radius: 8px; background: rgba(255, 255, 255, .08); color: rgba(255, 255, 255, .85); font: inherit; font-size: 13px; cursor: pointer;
}
.btn-aller:hover, .btn-aller:focus-visible { background: rgba(255, 255, 255, .16); color: #fff; }
.btn-aller kbd { margin-left: auto; padding: 0 6px; border: 1px solid rgba(255, 255, 255, .3); border-radius: 4px; font: 11px/1.6 inherit; color: rgba(255, 255, 255, .7); }
.btn-aller-icone { position: relative; flex: none; width: 11px; height: 11px; margin: 0 3px 3px 0; border: 2px solid currentColor; border-radius: 50%; }
.btn-aller-icone::after { content: ''; position: absolute; right: -5px; bottom: -4px; width: 6px; height: 2px; background: currentColor; transform: rotate(45deg); }
.aller { width: min(660px, calc(100vw - 32px)); margin: 9vh auto auto; padding: 0; border: 1px solid var(--bordure); border-radius: 12px; box-shadow: 0 24px 64px rgba(15, 32, 64, .35); }
.aller::backdrop { background: rgba(15, 32, 64, .4); }
.aller-saisie { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-bottom: 1px solid var(--bordure); color: var(--texte-3); }
.aller-saisie input { flex: 1; min-height: 0; padding: 6px 0; border: 0; font-size: 16px; color: var(--texte); }
.aller-saisie input:focus { box-shadow: none; }
.aller-saisie kbd { padding: 0 6px; border: 1px solid var(--bordure); border-radius: 4px; font: 11px/1.6 inherit; }
.aller-liste { max-height: min(60vh, 540px); margin: 0; padding: 6px; overflow-y: auto; list-style: none; }
.aller-section { padding: 10px 10px 4px; font-size: 10.5px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--texte-3); }
.aller-option { display: grid; grid-template-columns: 1fr auto; gap: 1px 12px; padding: 7px 10px; border-radius: 8px; cursor: pointer; }
.aller-option[aria-selected="true"] { background: var(--bleu-pale); }
.aller-option-titre { font-weight: 600; color: var(--texte); }
.aller-option-chemin { font-size: 12px; color: var(--texte-3); text-align: right; white-space: nowrap; }
.aller-option-texte { grid-column: 1 / -1; overflow: hidden; font-size: 12px; color: var(--texte-2); text-overflow: ellipsis; white-space: nowrap; }
.aller-option mark { background: #fff1b8; color: inherit; border-radius: 2px; }
.aller-vide { padding: 18px 12px; color: var(--texte-3); }
.aller-aide { margin: 0; padding: 8px 16px; border-top: 1px solid var(--bordure); font-size: 12px; color: var(--texte-3); }
@media (max-width: 900px) { .btn-aller { min-width: 0; } .btn-aller-texte, .btn-aller kbd { display: none; } }

/* ── Filtres ─────────────────────────────── */
.filtres {
  display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px 12px;
  padding: 12px 24px; background: var(--surface); border-bottom: 1px solid var(--bordure);
}
.filtre { display: flex; flex-direction: column; gap: 3px; font-size: 11px; font-weight: 600; color: var(--texte-3); }
.filtre select, .filtre input, .filtre .combo { min-width: 150px; font-size: 13px; font-weight: 400; color: var(--texte); }
.filtre-recherche input { min-width: 220px; }
/* Barre de filtres figée en haut de la page ; navigation dans l'organisation */
.filtres { position: sticky; top: 0; z-index: 40; box-shadow: 0 2px 6px rgba(15, 32, 64, .06); }
.filtres-module { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 8px 12px; }
.filtres-module[hidden] { display: none; }
.filtres-onglets { display: inline-flex; align-items: center; gap: 4px; margin-left: auto; font-size: 12.5px; }
.filtres-onglets .nav-fleche { border: 1px solid var(--bordure); background: var(--surface); border-radius: 6px; padding: 1px 9px; cursor: pointer; font: inherit; line-height: 1.4; }
.filtres-onglet { color: var(--texte-2); font-weight: 600; min-width: 110px; text-align: center; white-space: nowrap; }
.filtre-nav { flex-basis: 100%; display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: 12.5px; padding-top: 2px; }
.filtre-nav[hidden] { display: none; }
.filtre-nav .nav-fil { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; }
.filtre-nav .nav-niveau { border: 1px solid transparent; background: none; border-radius: 6px; padding: 2px 8px; color: var(--texte-2); cursor: pointer; font: inherit; }
.filtre-nav .nav-niveau:hover { background: var(--fond, #f4f6fa); }
.filtre-nav .nav-niveau[aria-current="true"] { border-color: var(--bleu, #2563be); color: var(--bleu, #2563be); font-weight: 650; background: #eef3fc; }
.filtre-nav .nav-sep { color: var(--texte-3); }
.filtre-nav .nav-fleche { border: 1px solid var(--bordure); background: var(--surface); border-radius: 6px; padding: 1px 9px; cursor: pointer; font: inherit; line-height: 1.4; }
.filtre-nav .nav-fleche:disabled { opacity: .4; cursor: default; }
.filtre-nav .nav-commandes { display: inline-flex; align-items: center; gap: 4px; flex: none; margin-left: -4px; }
.filtre-nav .nav-position { color: var(--texte-3); width: 72px; text-align: center; font-variant-numeric: tabular-nums; white-space: nowrap; }
.filtre-nav .nav-fil { min-width: 0; }
.filtre-nav .nav-niveau { max-width: 260px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.filtre-nav .nav-aide { color: var(--texte-3); margin-left: auto; }
@media (max-width: 760px) { .filtre-nav .nav-aide { display: none; } .filtres { position: static; } }

/* ── Contenu ─────────────────────────────── */
.contenu { padding: 20px 24px 40px; max-width: 1400px; margin: 0 auto; transition: opacity .15s; }
.contenu[data-vue="mc"] { max-width: none; } /* main courante : toute la largeur, le mois entier à l'écran */
.contenu.chargement { opacity: .45; pointer-events: none; }
.vue { display: flex; flex-direction: column; gap: 16px; }
.carte { background: var(--surface); border: 1px solid var(--bordure); border-radius: var(--rayon); box-shadow: var(--ombre); }
.carte-corps { padding: 16px; }
.carte-titre {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  padding: 14px 16px 0;
}
.carte-titre p { margin: 2px 0 0; font-size: 12px; color: var(--texte-3); }
.grille-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(360px, 1fr)); gap: 16px; }
.grille-2 > * { min-width: 0; } /* un tableau large défile dans sa carte, sans élargir la page */
.barre-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.barre-actions .espace { flex: 1; }
.discret { color: var(--texte-3); font-size: 12px; }

/* ── Sommaire ────────────────────────────── */
.sommaire-entete { padding: 14px 16px; display: flex; align-items: center; justify-content: space-between; gap: 8px 16px; flex-wrap: wrap; }
.sommaire-entete p { margin: 2px 0 0; }
/* Ce qui vous attend : une ligne par onglet, pastilles menant à la liste concernée */
.sommaire-attente { border-left: 3px solid var(--vert); }
.sommaire-attente h2 { margin-bottom: 8px; font-size: 15px; }
.sommaire-attente p { margin: 0; }
.sommaire-a-faire { display: flex; flex-direction: column; gap: 6px; margin: 0; padding: 0; list-style: none; }
.sommaire-a-faire li { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; }
.sommaire-attente-onglet { min-width: 220px; padding: 0; border: 0; background: none; font: inherit; font-weight: 600; color: var(--navy); text-align: left; cursor: pointer; }
.sommaire-attente-onglet:hover { color: var(--bleu); text-decoration: underline; }
.sommaire-attente-puces { display: flex; flex-wrap: wrap; gap: 6px; }
.sommaire-puce { position: relative; z-index: 1; border: 0; cursor: pointer; }
.sommaire-puce:hover { background: var(--bleu); color: #fff; }
/* Modules ouverts, domaine par domaine : une carte par module, ses onglets en liens (titre, texte sur deux lignes au plus) */
.sommaire-onglets { display: flex; flex-direction: column; gap: 18px; }
.sommaire-groupe { display: flex; flex-direction: column; gap: 10px; }
.sommaire-groupe-titre { font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--texte-3); }
.sommaire-modules { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 12px; align-items: start; }
.sommaire-carte { display: flex; flex-direction: column; gap: 8px; padding: 14px 16px; border-left: 3px solid var(--bleu); }
.sommaire-module-entete h3 { font-size: 16px; }
.sommaire-module-entete p { margin: 2px 0 0; font-size: 13px; color: var(--texte-3); }
.sommaire-module-lien { padding: 0; border: 0; background: none; font: inherit; color: var(--navy); cursor: pointer; text-align: left; }
.sommaire-module-lien:hover { color: var(--bleu); }
.sommaire-liens { display: flex; flex-direction: column; margin: 0 -8px; padding: 0; list-style: none; }
.sommaire-lien { display: flex; flex-direction: column; gap: 1px; width: 100%; padding: 6px 8px; border: 0; border-radius: 6px; background: none; font: inherit; text-align: left; cursor: pointer; }
.sommaire-lien:hover, .sommaire-lien:focus-visible { background: var(--bleu-pale); }
.sommaire-lien-titre { display: flex; align-items: center; gap: 6px; font-weight: 600; color: var(--navy); }
.sommaire-lien:hover .sommaire-lien-titre { color: var(--bleu); }
.sommaire-lien-texte { display: -webkit-box; overflow: hidden; -webkit-box-orient: vertical; -webkit-line-clamp: 2; font-size: 12.5px; line-height: 1.4; color: var(--texte-2); }
/* Import : tous les dépôts de fichiers ; volet choisi (référentiels communs ou module), index des cartes, petits titres */
.import-modules { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.import-modules:empty { display: none; }
.import-index { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; font-size: 13px; }
.import-index:empty { display: none; }
.import-index ul { display: flex; flex-wrap: wrap; gap: 2px 4px; margin: 0; padding: 0; list-style: none; }
.import-index li + li::before { content: '·'; margin-right: 4px; color: var(--texte-3); }
.import-groupe { margin: 8px 0 -6px; font-size: 12px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--texte-3); }
.import-rh, .import-hote { display: contents; } /* cartes au fil de l'onglet */
.carte-empilee { display: flex; flex-direction: column; gap: 16px; }
.carte-lien-import .carte-corps { padding: 10px 16px; }
.carte-lien-import p { margin: 0; color: var(--texte-2); }
.liste-liens { margin: 0; padding-left: 18px; }
.liste-liens li { margin: 2px 0; }

/* ── Processus et procédures (bas du sommaire) ── */
.procedure { display: flex; flex-direction: column; gap: 10px; }
.procedure-bloc { border: 1px solid var(--bordure); border-radius: var(--rayon); background: var(--surface); }
.procedure-bloc[open] { border-color: #c9daf3; }
.procedure-bloc > summary {
  display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 12px; margin: 0; padding: 12px 16px; cursor: pointer;
  list-style: none; border-radius: var(--rayon);
}
.procedure-bloc > summary::-webkit-details-marker { display: none; }
.procedure-bloc > summary::before { content: "▸"; color: var(--bleu); transition: transform .15s; }
.procedure-bloc[open] > summary::before { transform: rotate(90deg); }
.procedure-bloc > summary:hover { background: var(--bleu-pale); }
.procedure-bloc[open] > summary { border-bottom: 1px solid var(--grille); border-radius: var(--rayon) var(--rayon) 0 0; }
.procedure-bloc-titre { font-size: 15px; font-weight: 650; color: var(--navy); }
.procedure-bloc-public { font-size: 12px; font-weight: 400; color: var(--texte-3); }
.procedure-corps { display: flex; flex-direction: column; gap: 14px; padding: 14px 16px 16px; }
.procedure-objectif { margin: 0; color: var(--texte-2); }
.procedure-flux { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 22px; margin: 0; padding: 0; list-style: none; counter-reset: jalon; }
.procedure-flux li { position: relative; padding: 4px 10px; border-radius: 6px; background: var(--bleu); color: #fff; font-size: 12px; font-weight: 600; }
.procedure-flux li:not(:last-child)::after { content: "▸"; position: absolute; right: -16px; top: 50%; transform: translateY(-50%); color: var(--vert); font-size: 14px; }
.procedure-etapes { display: flex; flex-direction: column; gap: 14px; margin: 0; padding: 0; list-style: none; counter-reset: etape; }
.procedure-etape { position: relative; padding-left: 38px; counter-increment: etape; }
.procedure-etape::before {
  content: counter(etape); position: absolute; left: 0; top: 0; width: 26px; height: 26px; border-radius: 50%;
  display: grid; place-items: center; background: var(--navy); color: #fff; font-size: 12px; font-weight: 700;
}
.procedure-etape h3 { font-size: 14px; color: var(--navy); line-height: 26px; }
.procedure-meta { display: flex; flex-wrap: wrap; gap: 2px 14px; margin: 2px 0 6px; font-size: 12px; color: var(--texte-3); }
.procedure-meta strong { font-weight: 600; color: var(--texte-2); margin-right: 3px; }
.procedure-onglet { padding: 0; font-size: 12px; }
.procedure-intertitre { margin: 6px 0 2px; font-size: 10.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--bleu); }
.procedure-intertitre-controle { color: var(--ok); }
.procedure-actions, .procedure-controles, .procedure-reperes ul { margin: 0; padding-left: 18px; font-size: 13px; }
.procedure-actions li, .procedure-controles li, .procedure-reperes li { margin: 2px 0; }
.procedure-controles { list-style: none; padding-left: 0; }
.procedure-controles li { position: relative; padding-left: 18px; }
.procedure-controles li::before { content: ""; position: absolute; left: 1px; top: 4px; width: 9px; height: 9px; border: 1.5px solid var(--vert); border-radius: 2px; }
.procedure-reperes { padding: 12px 16px; border: 1px solid var(--bordure); border-radius: var(--rayon); background: var(--fond); }
.procedure-reperes h3 { margin-bottom: 4px; color: var(--navy); }
.procedure-reperes li::marker { color: var(--vert); }
.procedure-rythme td { vertical-align: top; }

/* ── Phase de test (Administration › Comptes) ── */
.phase-test { display: flex; flex-direction: column; gap: 12px; }
.phase-test-choix { margin: 0; padding: 12px 14px; border: 1px solid var(--bordure); border-radius: var(--rayon); }
.phase-test-choix legend { padding: 0 6px; font-size: 12px; font-weight: 650; color: var(--texte-2); }
.phase-test-choix .filtre { max-width: 260px; margin-bottom: 8px; }
.phase-test-liste { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 2px 12px; max-height: 240px; overflow-y: auto; }
.phase-test-liste label { display: flex; align-items: center; gap: 6px; padding: 3px 4px; border-radius: 4px; font-size: 13px; cursor: pointer; }
.phase-test-liste label:hover { background: var(--bleu-pale); }
.phase-test-liste input { min-height: 0; margin: 0; }
.phase-test-liste small { margin-left: auto; }
.phase-test-resume { margin: 0; padding: 8px 12px; border-radius: 6px; background: var(--fond); font-size: 13px; }
/* Administration › Accès par rôle : matrice modules et onglets × rôles (première colonne et en-tête figés) */
.acces { display: flex; flex-direction: column; gap: 12px; }
.acces .table-defil { max-height: 70vh; overflow: auto; }
.table-acces { width: max-content; min-width: 100%; border-collapse: separate; border-spacing: 0; }
.table-acces th, .table-acces td { padding: 5px 8px; }
.table-acces thead th { position: sticky; top: 0; z-index: 2; }
.table-acces tbody th, .table-acces thead th:first-child { position: sticky; left: 0; z-index: 1; background: var(--surface); text-transform: none; letter-spacing: 0;
  font-size: 13px; color: var(--texte); font-weight: 500; min-width: 240px; border-right: 1px solid var(--bordure); }
.table-acces thead th:first-child { z-index: 3; background: #fafbfc; font-size: 11px; text-transform: uppercase; color: var(--texte-3); font-weight: 650; }
.table-acces input[type="checkbox"] { width: 16px; height: 16px; min-height: 0; margin: 0; cursor: pointer; accent-color: var(--bleu); }
.table-acces input[type="checkbox"]:disabled { cursor: not-allowed; }
.acces-role { min-width: 52px; }
.acces-role > * { display: block; margin: 0 auto; }
.acces-role-code { color: var(--texte); font-size: 11px; }
.acces-role small { font-size: 10px; text-transform: none; letter-spacing: 0; margin-bottom: 3px; }
.acces-tous { background: var(--fond); border-right: 1px solid var(--bordure); }
.table-acces thead th.acces-tous { background: var(--fond); }
.table-acces tr.acces-module th, .table-acces tr.acces-module td { background: var(--bleu-pale); border-top: 1px solid #c9daf3; font-weight: 650; }
.table-acces tr.acces-module td.acces-tous { background: #dde7f7; }
.acces-domaine { display: inline-block; margin-right: 4px; padding: 0 6px; border-radius: 4px; background: var(--surface); color: var(--texte-3); font-size: 11px; font-weight: 600; }
.table-acces th.acces-onglet { padding-left: 24px; }
.table-acces th.acces-onglet small { margin-left: 4px; font-size: 11px; }
.table-acces td.acces-modifie { background: var(--alerte-fond); box-shadow: inset 0 0 0 1px #f0c36d; }
.table-acces td.acces-reserve { cursor: help; }
.acces-resume { margin: 4px 0 0; padding-left: 18px; font-size: 13px; }
.phase-test-modifie { background: var(--alerte-fond); color: var(--alerte); }

/* ── Indicateurs ─────────────────────────── */
.indicateurs { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; }
.indicateur { padding: 14px 16px; }
.indicateur-libelle { font-size: 12px; color: var(--texte-3); font-weight: 600; }
.indicateur-valeur { font-size: 24px; font-weight: 650; margin-top: 4px; letter-spacing: -.01em; }
.indicateur-detail { font-size: 12px; color: var(--texte-3); margin-top: 2px; }
.indicateur.principal .indicateur-valeur { color: var(--navy); font-size: 28px; }

/* ── Graphiques ──────────────────────────── */
.graphique { position: relative; height: 280px; padding: 8px 16px 12px; }
.graphique-bas { padding: 0 16px 12px; font-size: 12px; }

/* ── Tableaux ────────────────────────────── */
.table-defil { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { padding: 8px 12px; text-align: left; border-bottom: 1px solid var(--grille); vertical-align: middle; }
th { font-size: 11px; text-transform: uppercase; letter-spacing: .04em; color: var(--texte-3); font-weight: 650; background: #fafbfc; white-space: nowrap; }
td.nombre, th.nombre { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
tbody tr:hover { background: #f8fafc; }
tfoot td { font-weight: 650; border-top: 2px solid var(--bordure); border-bottom: 0; }
.cellule-site { max-width: 280px; }
.cellule-site small { display: block; color: var(--texte-3); }
.cellule-site small.ecart-site { color: var(--alerte); font-weight: 600; }
.vide { padding: 32px 16px; text-align: center; color: var(--texte-3); }

.part { display: flex; align-items: center; gap: 8px; justify-content: flex-end; }
.part-barre { width: 80px; height: 6px; border-radius: 3px; background: var(--grille); overflow: hidden; }
.part-barre span { display: block; height: 100%; background: var(--bleu); border-radius: 3px; }

/* ── Badges & messages ───────────────────── */
.badge { display: inline-block; padding: 1px 8px; border-radius: 10px; font-size: 11px; font-weight: 600; background: var(--grille); color: var(--texte-2); white-space: nowrap; }
.badge-saisie { background: var(--bleu-pale); color: var(--bleu-fonce); }
.badge-oui { background: var(--ok-fond); color: var(--ok); }
.badge-alerte { background: var(--alerte-fond); color: var(--alerte); cursor: help; }
.encart { padding: 12px 16px; border-radius: var(--rayon); border: 1px solid; font-size: 13px; }
.encart p { margin: 4px 0 0; }
.encart-info { background: var(--bleu-pale); border-color: #c9daf3; color: var(--navy); }
.encart-alerte { background: var(--alerte-fond); border-color: #f1d8a6; color: var(--alerte); }
.encart-erreur { background: var(--danger-fond); border-color: #f4c7c3; color: var(--danger); }
.encart-ok { background: var(--ok-fond); border-color: #c4e2c5; color: var(--ok); }

/* ── Axes d'analyse ──────────────────────── */
.segments { display: inline-flex; flex-wrap: wrap; border: 1px solid var(--bordure); border-radius: 6px; overflow: hidden; }
.segments button { border: 0; border-right: 1px solid var(--bordure); background: var(--surface); padding: 7px 12px; cursor: pointer; color: var(--texte-2); }
.segments button:last-child { border-right: 0; }
.segments button[aria-pressed="true"] { background: var(--bleu); color: #fff; font-weight: 600; }

/* ── Formulaires ─────────────────────────── */
.formulaire { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 14px; }
.formulaire .champ-large { grid-column: span 2; }
.formulaire-actions { display: flex; gap: 10px; align-items: center; margin-top: 16px; flex-wrap: wrap; }
.depot-fichier {
  display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 24px;
  border: 2px dashed var(--attenue); border-radius: var(--rayon); background: #fafbfc; text-align: center; cursor: pointer;
}
.depot-fichier:hover, .depot-fichier.survol { border-color: var(--bleu); background: var(--bleu-pale); }
.depot-fichier input { display: none; }
.depot-fichier strong { color: var(--bleu); }
.rattacher { display: flex; gap: 6px; align-items: center; }
.rattacher input { min-width: 220px; }

/* ── Notification ────────────────────────── */
.notification {
  position: fixed; right: 20px; bottom: 20px; z-index: 70; max-width: 420px; /* au-dessus du volet des PDF (60) */
  padding: 12px 16px; border-radius: var(--rayon); background: var(--navy); color: #fff; box-shadow: 0 6px 24px rgba(15, 32, 64, .25);
}
.notification.erreur { background: var(--danger); }

/* ── Petits écrans ───────────────────────── */
@media (max-width: 720px) {
  .entete, .nav-modules, .nav-onglets, .filtres { padding-left: 16px; padding-right: 16px; }
  .contenu { padding: 16px; }
  .grille-2 { grid-template-columns: 1fr; }
  .formulaire .champ-large { grid-column: auto; }
  .filtre, .filtre select, .filtre input, .filtre-recherche input { min-width: 0; width: 100%; }
  .filtres { display: grid; grid-template-columns: 1fr 1fr; }
  .filtre-recherche { grid-column: 1 / -1; }
  .entete-utilisateur { margin-left: 0; align-items: flex-start; }
}

/* Tri des colonnes */
.tri { border: 0; background: none; padding: 0; font: inherit; color: inherit; text-transform: inherit; letter-spacing: inherit; cursor: pointer; }
.tri:hover { color: var(--bleu); }
th.nombre .tri { text-align: right; }
details summary { cursor: pointer; font-weight: 600; margin: 4px 0 8px; }
.liste-orga { margin: 0 0 10px; padding-left: 18px; font-size: 13px; }
.liste-orga li { margin: 2px 0; }
#organisation { display: flex; flex-direction: column; gap: 10px; }
#organisation .formulaire-actions { margin-top: 4px; }
.encart ul { margin: 6px 0 0; padding-left: 18px; }

/* ── Demandes d'intérim : calendrier ─────── */
.demande-grille { display: grid; grid-template-columns: minmax(0, 1fr) minmax(300px, 380px); gap: 20px; align-items: start; }
.formulaire-demande { grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }
.calendrier-bloc { display: flex; flex-direction: column; gap: 10px; }
.calendrier { border: 1px solid var(--bordure); border-radius: var(--rayon); padding: 10px; background: #fafbfc; }
.cal-entete { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.cal-mois { flex: 1; display: flex; align-items: center; justify-content: space-between; }
.cal-agrandir { font-size: 16px; line-height: 1; padding: 4px 9px; }
.cal-entete strong { font-size: 15px; }
.cal-nav { font-size: 20px; line-height: 1; padding: 2px 10px; }
.cal-grille { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.cal-nom { text-align: center; font-size: 11px; font-weight: 650; color: var(--texte-3); padding: 2px 0; }
.cal-case { position: relative; display: flex; min-width: 0; }
.cal-jour {
  flex: 1; min-width: 0; position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center;
  min-height: 44px; border: 1px solid var(--bordure); border-radius: 6px; background: var(--surface);
  cursor: pointer; font-weight: 600; font-variant-numeric: tabular-nums; padding: 2px;
}
.cal-jour small { font-size: 10px; font-weight: 500; }
.cal-jour:hover:not(:disabled) { border-color: var(--bleu); }
.cal-jour.weekend { background: #f1f3f7; }
.cal-jour.aujourdhui { border-color: var(--navy); box-shadow: inset 0 0 0 1px var(--navy); }
.cal-jour.declare::after {
  content: ''; position: absolute; top: 4px; right: 4px; width: 8px; height: 8px; border-radius: 50%;
  background: var(--ok); box-shadow: 0 0 0 1.5px var(--surface);
}
/* Étape la moins avancée du jour : orange à valider RS, bleu attente DR, vert validée */
.cal-jour.etape-demande::after { background: #d98e04; }
.cal-jour.etape-rs::after { background: var(--bleu); }
.cal-jour.etape-dr::after { background: var(--ok); }
.cal-jour.etape-realise::after { background: var(--mission); }
.cal-jour.choisi { background: var(--bleu); border-color: var(--bleu); color: #fff; }
.cal-jour:disabled { opacity: .35; cursor: not-allowed; }
.cal-legende { display: flex; align-items: center; gap: 4px 8px; margin: 8px 0 0; font-size: 11px; color: var(--texte-3); flex-wrap: wrap; }
.cal-legende > span { white-space: nowrap; }
.pastille { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 4px; vertical-align: -1px; }
.pastille.choisi { background: var(--bleu); }
.pastille.etape-demande { background: #d98e04; border-radius: 50%; }
.pastille.etape-rs { background: var(--bleu); border-radius: 50%; }
.pastille.etape-dr { background: var(--ok); border-radius: 50%; }
.pastille.etape-realise { background: var(--mission); border-radius: 50%; }
.total-demande {
  display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 10px; padding: 8px 12px;
  border-radius: 6px; background: var(--bleu-pale); color: var(--navy); font-size: 13px;
}
.total-demande strong { font-size: 20px; font-variant-numeric: tabular-nums; }
.total-demande span:last-child { color: var(--texte-2); }
.jours-choisis { display: flex; flex-wrap: wrap; gap: 6px; }
.jour-choisi {
  display: inline-flex; align-items: center; gap: 4px; padding: 3px 4px 3px 8px; border: 1px solid var(--bordure);
  border-radius: 6px; background: var(--surface); font-size: 12px;
}
.jour-choisi input { width: 58px; min-height: 28px; padding: 2px 4px; font-size: 12px; }
.btn-retirer { border: 0; background: none; cursor: pointer; color: var(--texte-3); font-size: 16px; line-height: 1; padding: 0 4px; }
.btn-retirer:hover { color: var(--danger); }
.actions-demande { display: flex; gap: 4px; flex-wrap: wrap; }
.commentaire-demande { display: block; max-width: 280px; color: var(--texte-3); font-style: italic; }
.btn-valider { background: var(--ok-fond); border-color: #c4e2c5; color: var(--ok); font-weight: 600; padding: 4px 10px; }
.btn-valider:hover { background: var(--ok); border-color: var(--ok); color: #fff; }
.poste-rattacher { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.poste-rattacher select { max-width: 220px; }
.badge-attente { background: var(--alerte-fond); color: var(--alerte); }
.badge-refus { background: var(--danger-fond); color: var(--danger); }
.badge-realise { background: var(--mission-fond); color: var(--mission); }
.badge-onglet { display: inline-block; min-width: 18px; padding: 0 6px; margin-left: 4px; border-radius: 9px; background: var(--vert); color: var(--navy); font-size: 11px; font-weight: 700; text-align: center; }

/* Calendrier agrandi : pleine largeur, volet de saisie en dessous, détail par jour et total par semaine */
.demande-grille.agrandie { grid-template-columns: 1fr; }
.cal-grille.agrandie { grid-template-columns: repeat(7, minmax(0, 1fr)) 80px; gap: 6px; }
.cal-grille.agrandie .cal-jour {
  min-height: 92px; align-items: stretch; justify-content: flex-start; gap: 3px; padding: 5px 6px; text-align: left;
}
.cal-grille.agrandie .cal-jour small { font-size: 12px; font-weight: 700; }
/* Demandes déclarées : boutons posés sur la case (ouvrent le volet du jour) */
.cal-details { position: absolute; left: 5px; right: 5px; bottom: 5px; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.cal-ligne {
  display: block; width: 100%; padding: 1px 5px; border: 0; border-left: 3px solid var(--attenue); border-radius: 3px;
  background: var(--grille); color: var(--texte); font-size: 11px; font-weight: 500; line-height: 1.35; text-align: left;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; cursor: pointer;
}
.cal-ligne:hover, .cal-ligne:focus-visible { filter: brightness(.95); text-decoration: underline; }
.cal-ligne.etape-demande { border-left-color: #d98e04; background: var(--alerte-fond); }
.cal-ligne.etape-rs { border-left-color: var(--bleu); background: var(--bleu-pale); }
.cal-ligne.etape-dr { border-left-color: var(--ok); background: var(--ok-fond); }
.cal-ligne.etape-realise { border-left-color: var(--mission); background: var(--mission-fond); }
.cal-grille.agrandie .cal-jour.declare::after { top: 7px; right: 7px; }
.cal-aide { margin: 4px 0 0; }
.cal-semaine {
  display: flex; align-items: center; justify-content: center; border-radius: 6px;
  font-size: 13px; font-weight: 650; font-variant-numeric: tabular-nums; color: var(--navy);
}
.cal-semaine:not(:empty) { background: var(--bleu-pale); }
.cal-semaine.depasse { background: var(--danger-fond); color: var(--danger); cursor: help; }
.cal-declare-mois { margin-left: 4px; }

/* Site choisi en premier, mis en évidence */
.choix-site {
  display: flex; flex-wrap: wrap; align-items: flex-end; gap: 6px 16px; margin-bottom: 16px; padding: 12px 14px;
  border: 1px solid #c9daf3; border-left: 4px solid var(--bleu); border-radius: var(--rayon); background: var(--bleu-pale);
}
.choix-site > .champ { font-size: 13px; color: var(--navy); }
#champ-region, #champ-secteur { flex: 0 1 220px; }
.choix-site select, .choix-site .combo-saisie { min-height: 44px; font-size: 15px; font-weight: 600; width: 100%; }
.champ-site { flex: 1 1 360px; }
/* Nouvel intervenant : nom puis prénom */
.nouvel-intervenant { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 10px 14px; align-items: end;
  padding: 10px 12px; border: 1px dashed var(--bleu); border-radius: var(--rayon); background: var(--bleu-pale); }
.nouvel-intervenant p { margin: 0; grid-column: 1 / -1; }
#demande-agence-autre { margin-top: 6px; }
.site-choisi { flex: 1 1 100%; margin: 0; font-size: 13px; color: var(--texte-2); }
.site-choisi.ok { color: var(--ok); font-weight: 600; }
.sans-site .choix-site { border-left-color: #d98e04; box-shadow: 0 0 0 3px var(--alerte-fond); }

/* Volet du jour : demandes du site ce jour-là, actions selon le niveau (au-dessus de la barre des filtres figée, 40) */
.volet {
  position: fixed; top: 0; right: 0; bottom: 0; z-index: 45; width: min(440px, 100vw);
  display: flex; flex-direction: column; background: var(--surface);
  border-left: 1px solid var(--bordure); box-shadow: -8px 0 32px rgba(15, 32, 64, .18);
}
.volet-entete { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 16px; border-bottom: 1px solid var(--bordure); }
.volet-entete h2:focus { outline: none; }
.volet-entete p { margin: 2px 0 0; }
.volet-fermer { font-size: 24px; line-height: 1; padding: 0 8px; }
.volet-corps { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 12px; padding: 16px; }
.volet-demande {
  display: flex; flex-direction: column; gap: 4px; padding: 12px; font-size: 13px;
  border: 1px solid var(--bordure); border-left: 4px solid var(--attenue); border-radius: var(--rayon);
}
.volet-demande p { margin: 0; }
.volet-demande.etape-demande { border-left-color: #d98e04; }
.volet-demande.etape-rs { border-left-color: var(--bleu); }
.volet-demande.etape-dr { border-left-color: var(--ok); }
.volet-demande.etape-realise { border-left-color: var(--mission); }
.volet-demande.etape-close { opacity: .7; }
.volet-demande.cible { box-shadow: 0 0 0 3px var(--bleu-pale); }
.volet-demande-titre { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.volet-demande .actions-demande { margin-top: 6px; }
.volet-note { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 4px; }
.volet-note small { display: inline; }

/* Notation des demandes réalisées (1 à 5) */
.cellule-note { white-space: nowrap; }
.cellule-note small { display: block; }
.notation { display: inline-flex; gap: 2px; }
.smiley {
  width: 30px; height: 30px; padding: 0; border: 1px solid transparent; border-radius: 50%; background: none;
  font-size: 18px; line-height: 1; cursor: pointer; filter: grayscale(1); opacity: .5;
}
.smiley:hover, .smiley:focus-visible { filter: none; opacity: 1; }
.smiley[aria-pressed="true"] { filter: none; opacity: 1; border-color: var(--bleu); background: var(--bleu-pale); }
.note-lue { font-weight: 600; }

/* Valorisation des heures */
.provision-demande { flex-basis: 100%; font-size: 13px; }
.provision-demande strong { font-size: 15px; }
.tarif-total { font-weight: 650; }
.tarif-faible { color: var(--texte-3); }

@media (max-width: 900px) {
  .demande-grille { grid-template-columns: 1fr; }
}
@media (max-width: 720px) {
  .cal-grille.agrandie { grid-template-columns: repeat(7, minmax(0, 1fr)) 52px; gap: 3px; }
  .cal-grille.agrandie .cal-jour { min-height: 64px; padding: 3px; }
  .cal-grille.agrandie .cal-ligne { font-size: 0; min-height: 8px; padding: 0; }
  .cal-grille.agrandie .cal-ligne.plus { display: none; }
  .cal-semaine { font-size: 11px; }
}

/* ── Listes déroulantes avec recherche (listes.js) ── */
.combo { position: relative; display: block; min-width: 0; }
.entete-annee .combo, .rattacher .combo { display: inline-block; }
.combo-saisie { width: 100%; padding-right: 28px; cursor: pointer; text-overflow: ellipsis; }
.combo-saisie:focus { cursor: text; }
.combo::after {
  content: ''; position: absolute; right: 11px; top: 50%; width: 7px; height: 7px; margin-top: -5px;
  border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(45deg);
  opacity: .55; pointer-events: none;
}
/* <select> d'origine : conservé (valeur, événements, lecteurs d'écran via le champ) mais invisible */
.combo-natif { position: absolute; left: 0; bottom: 0; width: 1px; height: 1px; min-height: 0; padding: 0; border: 0; opacity: 0; pointer-events: none; }
.combo-liste {
  position: absolute; z-index: 40; left: 0; right: 0; top: calc(100% + 2px); max-height: 280px; overflow-y: auto; margin: 0; padding: 4px 0;
  list-style: none; background: var(--surface); border: 1px solid var(--bordure); border-radius: 6px; box-shadow: 0 8px 24px rgba(15, 32, 64, .16);
  min-width: 220px; font-size: 14px; font-weight: 400; color: var(--texte); text-transform: none; letter-spacing: normal;
}
.combo-liste li { padding: 6px 12px; cursor: pointer; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.combo-liste li.actif { background: var(--bleu-pale); color: var(--bleu-fonce); }
.combo-liste li[aria-selected="true"] { font-weight: 650; }
.combo-liste li.combo-vide { color: var(--texte-3); cursor: default; }
.entete-annee .combo-saisie { width: 96px; padding-right: 24px; }

/* ── Période, comparaison et rapports ── */
.filtre-mois select, .filtre-mois .combo { min-width: 120px; }
.filtres-autre { display: contents; }
.filtres-autre[hidden] { display: none !important; }
.barre-rapport { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px 16px; padding: 10px 16px; }
.barre-rapport small { display: block; margin-top: 2px; }
.indicateur-evolution { margin-top: 4px; font-size: 12px; font-weight: 600; color: var(--texte-3); }
/* Coûts : hausse en rouge, baisse en vert */
.indicateur-evolution.hausse, .evolution.hausse { color: var(--danger); }
.indicateur-evolution.baisse, .evolution.baisse { color: var(--ok); }
.evolution { font-weight: 650; }
.elements-compares { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px 14px; margin-bottom: 14px; }
.element-compare { display: inline-flex; align-items: flex-end; gap: 6px; }
.element-compare .filtre .combo, .element-compare .filtre select { min-width: 220px; }
.pastille-serie { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 6px; vertical-align: 0; }
.element-compare > .pastille-serie { margin: 0 0 13px; }
.serie-0 { background: #2563be; } .serie-1 { background: #8ab61a; } .serie-2 { background: #d98e04; }
.serie-3 { background: #b42318; } .serie-4 { background: #6b4fbb; } .serie-5 { background: #0f8a8a; }
.table-comparaison th[scope="row"] { font-size: 12px; text-transform: none; letter-spacing: 0; color: var(--texte-2); background: none; }
.table-comparaison thead th { white-space: normal; min-width: 130px; }

/* ── Tutoriel (public/js/tutoriel.js) ─────── */
:root { --tuto: #a85a00; --tuto-halo: rgba(217, 142, 4, .22); }
.visuellement-cache {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.btn-entete[aria-pressed="true"] { background: rgba(255, 255, 255, .16); border-color: #fff; font-weight: 600; }
.tutoriel {
  position: fixed; left: 20px; bottom: 20px; z-index: 25; width: 380px; max-width: calc(100vw - 40px);
  max-height: calc(100vh - 40px); overflow-y: auto;
  background: var(--surface); border: 1px solid var(--bordure); border-top: 4px solid var(--tuto);
  border-radius: var(--rayon); box-shadow: 0 10px 32px rgba(15, 32, 64, .22);
}
.tutoriel.a-droite { left: auto; right: 20px; }
.tutoriel-entete { display: flex; align-items: center; gap: 8px; padding: 10px 10px 8px 16px; border-bottom: 1px solid var(--grille); }
.tutoriel-marque { font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--tuto); }
.tutoriel-parcours-titre { flex: 1; min-width: 0; font-weight: 600; color: var(--texte-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tutoriel-icone {
  width: 30px; height: 30px; flex: none; padding: 0; border: 1px solid transparent; border-radius: 6px;
  background: none; color: var(--texte-2); font-size: 20px; line-height: 1; cursor: pointer;
}
.tutoriel-icone:hover { border-color: var(--bordure); color: var(--texte); }
.tutoriel-choix { display: flex; flex-wrap: wrap; gap: 6px 5px; padding: 10px 14px 0; }
.tutoriel-choix button {
  padding: 4px 8px; border: 1px solid var(--bordure); border-radius: 999px; background: var(--surface);
  color: var(--texte-2); font-size: 12px; cursor: pointer;
}
.tutoriel-choix-saut { flex-basis: 100%; height: 0; }
.tutoriel-choix button[aria-pressed="true"] { border-color: var(--tuto); background: var(--alerte-fond); color: var(--tuto); font-weight: 600; }
.tutoriel-corps { display: flex; flex-direction: column; gap: 8px; padding: 12px 16px 14px; }
.tutoriel-corps p { margin: 0; }
.tutoriel-progression { font-size: 12px; color: var(--texte-3); }
.tutoriel-barre { width: 100%; height: 4px; border: 0; border-radius: 2px; background: var(--grille); appearance: none; -webkit-appearance: none; }
.tutoriel-barre::-webkit-progress-bar { background: var(--grille); border-radius: 2px; }
.tutoriel-barre::-webkit-progress-value { background: var(--tuto); border-radius: 2px; }
.tutoriel-barre::-moz-progress-bar { background: var(--tuto); border-radius: 2px; }
.tutoriel-titre { font-size: 16px; }
.tutoriel-titre:focus { outline: none; }
.tutoriel-texte { color: var(--texte-2); }
.tutoriel-detail { padding: 6px 10px; border-radius: 6px; background: var(--fond); font-size: 13px; }
.tutoriel-detail.ok { background: var(--ok-fond); color: var(--ok); font-weight: 600; }
.tutoriel-detail.alerte { background: var(--alerte-fond); color: var(--alerte); font-weight: 600; }
.tutoriel-ailleurs { padding: 6px 10px; border-radius: 6px; background: var(--bleu-pale); font-size: 13px; }
.tutoriel-actions { display: flex; justify-content: space-between; gap: 8px; margin-top: 2px; }
.tutoriel-sommaire summary { margin: 2px 0 0; font-size: 13px; color: var(--texte-2); }
.tutoriel-sommaire ol { list-style: none; margin: 6px 0 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.tutoriel-sommaire li button {
  display: flex; align-items: center; gap: 8px; width: 100%; padding: 4px 6px; border: 0; border-radius: 6px;
  background: none; text-align: left; font-size: 13px; color: var(--texte-2); cursor: pointer;
}
.tutoriel-sommaire li button:hover { background: var(--fond); }
.tutoriel-sommaire li button[aria-current="step"] { background: var(--alerte-fond); color: var(--texte); font-weight: 600; }
.tutoriel-sommaire li button.faite { color: var(--ok); }
.tutoriel-sommaire small { font-weight: 400; color: var(--texte-2); }
.tutoriel-puce {
  display: inline-flex; align-items: center; justify-content: center; flex: none; width: 20px; height: 20px;
  border: 1px solid var(--bordure); border-radius: 50%; font-size: 11px; background: var(--surface);
}
.faite .tutoriel-puce { border-color: var(--ok); background: var(--ok-fond); }
.tutoriel-reduit { display: flex; align-items: center; gap: 4px; padding: 4px 4px 4px 6px; }
.tutoriel-pastille {
  flex: 1; min-width: 0; padding: 6px 8px; border: 0; background: none; text-align: left; cursor: pointer;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px;
}
/* Place laissée sous le contenu pour ne pas masquer le bas de page */
/* Hauteur réelle du panneau (--tuto-h, mise à jour par tutoriel.js) : le bas de page reste atteignable */
body.avec-tutoriel .contenu { padding-bottom: calc(var(--tuto-h, 340px) + 40px); }
/* Champ de l'étape en cours */
.tuto-cible {
  outline: 3px solid var(--tuto); outline-offset: 4px; border-radius: 6px;
  box-shadow: 0 0 0 10px var(--tuto-halo); animation: tuto-halo 1.4s ease-out 2;
}
@keyframes tuto-halo {
  0% { box-shadow: 0 0 0 0 var(--tuto-halo); }
  100% { box-shadow: 0 0 0 10px var(--tuto-halo); }
}
/* Élément mis en évidence et focalisé au clavier : l'anneau de focus reste distinct */
.tuto-cible:focus-visible { outline: 3px solid var(--bleu); outline-offset: 2px; box-shadow: 0 0 0 6px var(--bleu-pale); }
@media (prefers-reduced-motion: reduce) {
  .tuto-cible { animation: none; }
}
/* Volet du jour ouvert : au-dessus du tutoriel, qui passe à gauche pour ne pas masquer ses boutons */
body.volet-ouvert .tutoriel.a-droite { left: 20px; right: auto; }
body.volet-ouvert.avec-tutoriel-a-droite .notification { left: auto; right: 20px; }
body.avec-tutoriel.avec-tutoriel-a-droite .notification { right: auto; left: 20px; }
@media (max-width: 720px) {
  .tutoriel, .tutoriel.a-droite { left: 8px; right: 8px; bottom: 8px; width: auto; max-width: none; max-height: 48vh; }
  body.avec-tutoriel .contenu { padding-bottom: calc(var(--tuto-h, 48vh) + 24px); }
  body.avec-tutoriel .notification, body.avec-tutoriel.avec-tutoriel-a-droite .notification { top: 8px; bottom: auto; left: 8px; right: 8px; max-width: none; }
}

/* Note moyenne du prestataire et de l'intervenant choisis (formulaire de demande) */
.champ-note { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.note-moyenne { font-size: 12px; font-weight: 600; color: var(--alerte); }
.note-moyenne:empty { display: none; }

/* Filtres selon l'onglet : Demandes (liste) sans période ; Tarifs (matrice par région) : DO, DR et prestataire */
#filtres[data-vue="demandes"] .filtre-temps, #filtres[data-vue="tarifs"] .filtre-temps,
#filtres[data-vue="tarifs"] .filtre-local { display: none !important; }
/* Gestion des tournants : maille seule (mois propre à chaque onglet) */
#filtres[data-vue="psites"] .filtre-temps, #filtres[data-vue="pnibelis"] .filtre-temps, #filtres[data-vue="pcessions"] .filtre-temps,
#filtres[data-vue="psites"] .filtre-comparer, #filtres[data-vue="pnibelis"] .filtre-comparer, #filtres[data-vue="pcessions"] .filtre-comparer,
#filtres[data-vue="psites"] .filtre-prestataire, #filtres[data-vue="pnibelis"] .filtre-prestataire, #filtres[data-vue="pcessions"] .filtre-prestataire,
#filtres[data-vue="psites"] .filtre-recherche, #filtres[data-vue="pnibelis"] .filtre-recherche, #filtres[data-vue="pcessions"] .filtre-recherche,
#filtres[data-vue="tplanning"] .filtre-temps, #filtres[data-vue="tcessions"] .filtre-temps, #filtres[data-vue="tcouts"] .filtre-temps, #filtres[data-vue="hsdemandes"] .filtre-temps, #filtres[data-vue="hsconstat"] .filtre-temps, #filtres[data-vue="treferentiel"] .filtre-temps,
#filtres[data-vue="tplanning"] .filtre-comparer, #filtres[data-vue="tcessions"] .filtre-comparer, #filtres[data-vue="tcouts"] .filtre-comparer, #filtres[data-vue="hsdemandes"] .filtre-comparer, #filtres[data-vue="hsconstat"] .filtre-comparer, #filtres[data-vue="treferentiel"] .filtre-comparer,
#filtres[data-vue="tplanning"] .filtre-prestataire, #filtres[data-vue="tcessions"] .filtre-prestataire, #filtres[data-vue="tcouts"] .filtre-prestataire, #filtres[data-vue="hsdemandes"] .filtre-prestataire, #filtres[data-vue="hsconstat"] .filtre-prestataire, #filtres[data-vue="treferentiel"] .filtre-prestataire,
#filtres[data-vue="tplanning"] .filtre-recherche, #filtres[data-vue="tcessions"] .filtre-recherche, #filtres[data-vue="tcouts"] .filtre-recherche, #filtres[data-vue="hsdemandes"] .filtre-recherche, #filtres[data-vue="hsconstat"] .filtre-recherche, #filtres[data-vue="treferentiel"] .filtre-recherche { display: none !important; }
/* Module CEA (Tableau de bord CEA, Reporting CEA, DGA, Achats et provisions, Facturation, Factures 3WM) : maille seule ; mois de référence propre au module (sélecteur de la
   vue) ; ni période, ni comparaison (N-1 et budget du CEA), ni prestataire, ni recherche */
#filtres[data-vue="tbcea"] .filtre-temps, #filtres[data-vue="dga"] .filtre-temps, #filtres[data-vue="inventaire"] .filtre-temps, #filtres[data-vue="cea"] .filtre-temps, #filtres[data-vue="achats"] .filtre-temps, #filtres[data-vue="facturation"] .filtre-temps, #filtres[data-vue="cdg"] .filtre-temps, #filtres[data-vue="troisvoies"] .filtre-temps,
#filtres[data-vue="tbcea"] .filtre-comparer, #filtres[data-vue="dga"] .filtre-comparer, #filtres[data-vue="inventaire"] .filtre-comparer, #filtres[data-vue="cea"] .filtre-comparer, #filtres[data-vue="achats"] .filtre-comparer, #filtres[data-vue="facturation"] .filtre-comparer, #filtres[data-vue="cdg"] .filtre-comparer, #filtres[data-vue="troisvoies"] .filtre-comparer,
#filtres[data-vue="tbcea"] .filtre-prestataire, #filtres[data-vue="dga"] .filtre-prestataire, #filtres[data-vue="inventaire"] .filtre-prestataire, #filtres[data-vue="cea"] .filtre-prestataire, #filtres[data-vue="achats"] .filtre-prestataire, #filtres[data-vue="facturation"] .filtre-prestataire, #filtres[data-vue="cdg"] .filtre-prestataire, #filtres[data-vue="troisvoies"] .filtre-prestataire,
#filtres[data-vue="tbcea"] .filtre-recherche, #filtres[data-vue="dga"] .filtre-recherche, #filtres[data-vue="inventaire"] .filtre-recherche, #filtres[data-vue="cea"] .filtre-recherche, #filtres[data-vue="achats"] .filtre-recherche, #filtres[data-vue="facturation"] .filtre-recherche, #filtres[data-vue="cdg"] .filtre-recherche, #filtres[data-vue="troisvoies"] .filtre-recherche { display: none !important; }

/* ── Rapprochement : taux à atteindre (100 %) ── */
.ratio { font-weight: 650; white-space: nowrap; }
.ratio.ratio-ok { color: var(--ok); }
.ratio.ratio-moyen { color: var(--alerte); }
.ratio.ratio-bas { color: var(--danger); }
.indicateur.ratio-ok .indicateur-valeur { color: var(--ok); }
.indicateur.ratio-moyen .indicateur-valeur { color: var(--alerte); }
.indicateur.ratio-bas .indicateur-valeur { color: var(--danger); }
.lien-maille { padding: 0; font-weight: 600; text-align: left; white-space: normal; }
.table-rapprochement td:first-child { min-width: 180px; }

/* ── Factures comptables : rapprochement avec le suivi intérim ── */
.table-factures td small { display: block; }
.table-factures tr.ligne-ouverte > td { background: var(--bleu-pale); }
.table-factures tr.detail-groupe > td { padding: 4px 8px 12px 24px; background: var(--fond); }
.table-factures tr.detail-groupe table { font-size: 12px; width: auto; min-width: 60%; margin-bottom: 8px; }
.table-factures tr.detail-groupe caption { text-align: left; font-weight: 600; padding: 6px 0 4px; color: var(--texte-2); }
.table-factures tr.detail-groupe tfoot td { font-weight: 700; border-top: 2px solid var(--bordure); }
.bilan-rapprochement { margin: 4px 0 0; font-size: 13px; }
.badge-manuel { display: inline-block; margin-left: 6px; padding: 1px 6px; border-radius: 8px; font-size: 11px; font-weight: 600; background: var(--bleu-pale); color: var(--bleu); }
.alerte-texte { color: var(--alerte); font-weight: 600; margin: 6px 0; }
.editeur-rapprochement h3 { margin: 4px 0; font-size: 15px; }
.reaff-totaux { position: sticky; top: 0; z-index: 1; display: flex; flex-wrap: wrap; gap: 8px 24px; align-items: flex-end; padding: 8px 12px; margin: 8px 0;
  background: var(--surface); border: 1px solid var(--bordure); border-radius: 6px; }
.reaff-totaux > div { display: flex; flex-direction: column; }
.reaff-totaux strong { font-size: 16px; }
.reaff-totaux .ratio-ok strong { color: var(--ok); }
.reaff-totaux .ratio-moyen strong { color: var(--alerte); }
.reaff-totaux p { flex-basis: 100%; margin: 0; }
.table-factures tr.detail-groupe .editeur-rapprochement table { min-width: 70%; }
.reaff-bloc td { background: var(--bleu-pale); }
.reaff-bloc .btn-lien { padding: 0; font-weight: 600; }
.editeur-rapprochement input[type="checkbox"] { width: 16px; height: 16px; cursor: pointer; }
.cellule-suivi { white-space: nowrap; }
.cellule-suivi small { display: block; }

/* ── Factures PDF des prestataires ── */
.sous-titre-carte { margin: 18px 0 4px; font-size: 15px; }
#table-factures-pdf select, #table-factures-enregistrees select { max-width: 220px; margin-bottom: 4px; }
#table-factures-pdf td small { display: block; }
/* Rejet « mauvaise affectation comptable » : encart du volet PDF, panneau d'une pièce, liste des rejets */
.rejet-compta .champ { margin-top: 8px; }
.rejet-compta textarea { width: 100%; font: inherit; }
#table-rejets td small, #table-plateforme td small { display: block; }
#table-factures-pdf tr.detail-groupe > td { padding: 4px 8px 12px 24px; background: var(--fond); }
#table-factures-pdf tr.detail-groupe table { font-size: 12px; width: 100%; }
#table-factures-pdf tr.detail-groupe tfoot td { font-weight: 700; border-top: 2px solid var(--bordure); }

/* ── Demandes sans ligne au suivi : traitement ── */
tr.panneau-traitement > td { padding: 8px 12px 14px 24px; background: var(--fond); }
tr.panneau-traitement h3 { margin: 4px 0; font-size: 15px; }
tr.panneau-traitement table { font-size: 12px; width: auto; min-width: 60%; margin: 8px 0; }
tr.panneau-traitement input[type="checkbox"] { width: 16px; height: 16px; cursor: pointer; }
tr.panneau-traitement .champ { display: flex; flex-direction: column; gap: 4px; max-width: 640px; margin: 8px 0; }
tr.panneau-traitement .champ input { padding: 6px 8px; border: 1px solid var(--bordure); border-radius: 6px; font: inherit; }
.indicateur .btn-lien { padding: 0; margin-top: 4px; align-self: flex-start; }
.bilan-import ul { margin: 6px 0; padding-left: 20px; }

/* ── Analyse : détail déroulant ── */
.lien-deroulant { padding: 0; font-weight: 600; text-align: left; white-space: normal; display: inline-flex; gap: 6px; align-items: baseline; }
.lien-deroulant::before { content: '▸'; display: inline-block; width: 1em; color: var(--texte-3); }
.lien-deroulant[aria-expanded="true"]::before { content: '▾'; }
tr.ligne-ouverte > td { background: var(--bleu-pale); }
tr.sous-ligne > td { background: var(--fond); font-size: 13px; }
tr.sous-ligne .sous-libelle { display: inline-block; padding-left: 22px; color: var(--texte-2); }
tr.sous-ligne .sous-libelle .lien-deroulant { font-weight: 500; color: var(--texte-2); }
tr.sous-ligne-ouverte > td { background: var(--bleu-pale); }
tr.sous-ligne-2 > td { background: var(--fond); font-size: 12.5px; }
tr.sous-ligne-2 .sous-libelle-2 { display: inline-block; padding-left: 48px; color: var(--texte-3); }
.barre-detail-analyse { padding: 0 20px 10px; align-items: center; }

/* ── Connexion Microsoft 365 ── */
.connexion-sso { display: flex; flex-direction: column; gap: 14px; }
.btn-microsoft { display: inline-flex; align-items: center; justify-content: center; gap: 10px; text-decoration: none; }
.logo-microsoft { display: inline-grid; grid-template-columns: 8px 8px; gap: 2px; }
.logo-microsoft span { width: 8px; height: 8px; background: #f25022; }
.logo-microsoft span:nth-child(2) { background: #7fba00; }
.logo-microsoft span:nth-child(3) { background: #00a4ef; }
.logo-microsoft span:nth-child(4) { background: #ffb900; }
.separateur-connexion { display: flex; align-items: center; gap: 10px; margin: 0; color: var(--texte-3); font-size: 12px; }
.separateur-connexion::before, .separateur-connexion::after { content: ''; flex: 1; border-top: 1px solid var(--bordure); }

/* ── Comptes ── */
.grille-compte { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px 16px; align-items: end; }
.grille-compte .formulaire-actions { grid-column: 1 / -1; }
.grille-compte input[readonly] { background: var(--fond); color: var(--texte-2); }
tr.compte-inactif td { color: var(--texte-3); }
td .message-erreur { display: block; font-size: 12px; }

/* ── Demandes par mail et SMS ── */
.modeles-distance { margin-bottom: 12px; }
.modeles-distance summary { cursor: pointer; font-weight: 600; }
.deux-colonnes { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 16px; margin-top: 8px; }
.deux-colonnes h3 { font-size: 13px; margin-bottom: 4px; }
.deux-colonnes pre { white-space: pre-wrap; background: var(--fond); border: 1px solid var(--bordure); border-radius: 6px; padding: 10px; font-size: 12px; }
.codes-generes { display: flex; flex-wrap: wrap; gap: 6px 14px; font-family: ui-monospace, monospace; }
.champ-ligne { width: 100%; min-width: 220px; padding: 6px 8px; border: 1px solid var(--bordure); border-radius: 6px; font: inherit; }
.badge-canal { font-size: 10px; }

/* ── Administration ── */
.sections-admin { margin-bottom: 16px; flex-wrap: wrap; }
/* Administration : deux familles de sections, titrées (administration générale, paramétrage des modules) */
.admin-nav { display: flex; flex-direction: column; gap: 8px; margin-bottom: 16px; }
.admin-nav .sections-admin { margin-bottom: 0; }
.admin-famille { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; }
.admin-famille-titre { min-width: 190px; font-size: 11px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--texte-3); }
.admin-famille-parametrage .admin-famille-titre { color: var(--parametrage); }
.admin-famille-parametrage .segments button[aria-pressed="true"] { background: var(--parametrage); }
.parametrage-modules { display: grid; grid-template-columns: repeat(auto-fill, minmax(360px, 1fr)); gap: 16px; }
.parametrage-module .carte-titre h2 { display: flex; align-items: center; gap: 8px; }
.parametrage-liste { margin: 0; padding: 0; list-style: none; }
.parametrage-liste li { display: flex; flex-direction: column; gap: 2px; padding: 8px 0; border-top: 1px solid var(--grille); }
.parametrage-liste li:first-child { border-top: 0; padding-top: 0; }
.parametrage-liste .parametrage-titre { display: flex; justify-content: space-between; gap: 8px; align-items: baseline; font-weight: 600; color: var(--navy); }
.parametrage-liste small { color: var(--texte-3); }
.parametrage-actions { display: flex; flex-shrink: 0; gap: 10px; white-space: nowrap; font-weight: 400; }
.parametrage-module.parametrage-cible { box-shadow: 0 0 0 3px var(--parametrage-fond), var(--ombre); border-color: var(--parametrage); }
.centre { text-align: center; }
.droit-oui { color: var(--ok); font-weight: 700; }
#table-droits td, #table-droits th { white-space: normal; }

/* Onglet Factures : saisie manuelle d'une facture ; onglet Rapprochement : choix de l'arrêté */
.champ-inline { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; color: var(--texte-2); }
.champ-inline select { font-weight: 400; font-size: 13px; }
.panneau-saisie { display: flex; flex-direction: column; gap: 10px; padding: 8px 0; }
.panneau-saisie h3 { margin: 0; font-size: 15px; }
.grille-formulaire { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 10px; align-items: end; }
.champ-case { flex-direction: row; align-items: center; gap: 6px; }
.table-saisie { table-layout: fixed; width: 100%; }
.table-saisie th, .table-saisie td { padding: 4px 3px; }
.table-saisie th:nth-child(1) { width: 22%; } .table-saisie th:nth-child(2) { width: 15%; }
.table-saisie th:nth-child(3), .table-saisie th:nth-child(4) { width: 18%; }
.table-saisie th:nth-child(5) { width: 9%; } .table-saisie th:nth-child(6) { width: 11%; } .table-saisie th:nth-child(7) { width: 7%; }
.saisie-actions { white-space: nowrap; }
.table-saisie input { width: 100%; min-width: 0; font-size: 12px; padding: 4px 5px; box-sizing: border-box; }
.table-saisie [data-action="saisie-retirer-ligne"] { padding: 2px; font-size: 16px; }
.table-saisie input.nombre { text-align: right; }

/* Second volet : PDF de la facture à gauche, saisie à droite */
.volet-pdf { position: fixed; inset: 0; z-index: 60; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px; padding: 12px;
  background: rgba(15, 32, 64, 0.55); }
.volet-pdf > div { background: var(--surface, #fff); border-radius: 8px; overflow: auto; min-height: 0; }
.volet-pdf-document { display: flex; flex-direction: column; }
.volet-pdf-titre { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 8px 12px; border-bottom: 1px solid var(--bordure, #dde3ec); }
/* Visionneuse : barre d'outils, panneau des pages repliable, document déplacé à la souris */
.visionneuse { flex: 1; display: flex; flex-direction: column; min-height: 0; }
.vis-barre { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; padding: 6px 8px; border-bottom: 1px solid var(--bordure); }
.vis-btn { padding: 4px 9px; }
.vis-btn[aria-pressed="true"] { background: var(--fond); }
.vis-compteur, .vis-niveau { font-size: 12px; color: var(--texte-2); min-width: 64px; text-align: center; }
.vis-sep { width: 1px; height: 20px; background: var(--bordure); margin: 0 4px; }
.vis-corps { flex: 1; display: grid; grid-template-columns: 140px minmax(0, 1fr); min-height: 0; }
.vis-corps.vis-sans-pages { grid-template-columns: 0 minmax(0, 1fr); }
.vis-sans-pages .vis-miniatures { display: none; }
.vis-miniatures { overflow-y: auto; padding: 8px; border-right: 1px solid var(--bordure); background: var(--fond); display: flex; flex-direction: column; gap: 8px; }
.vis-miniature { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 4px; border: 2px solid transparent; border-radius: 4px; background: none; cursor: pointer; font-size: 11px; color: var(--texte-2); }
.vis-miniature canvas { max-width: 110px; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2); }
.vis-miniature.vis-active { border-color: var(--bleu); }
.vis-document { overflow: auto; background: #525659; padding: 12px; cursor: grab; user-select: none; touch-action: none; min-height: 60vh; outline: none; color: #fff; }
.vis-document.vis-prise { cursor: grabbing; }
.vis-page { width: max-content; margin: 0 auto 12px; background: #fff; box-shadow: 0 2px 6px rgba(0, 0, 0, 0.35); }
.vis-page canvas { display: block; }
.vis-xml { flex: 1; margin: 0; padding: 12px; overflow: auto; font-size: 12px; white-space: pre-wrap; background: var(--fond); }
.volet-pdf-saisie { padding: 12px 16px; }
@media (max-width: 900px) { .volet-pdf { grid-template-columns: 1fr; grid-template-rows: 45vh 1fr; } }
.visuellement-masque { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.table-saisie input.saisie-anomalie { border-color: var(--danger); background: var(--danger-fond); }
.table-saisie input.saisie-anomalie::placeholder { color: var(--danger); }

/* Factures déposées (onglet Import) : regroupées par état */
.depot-en-cours { margin: 8px 0; }
.depot-resume { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0 4px; }
.depot-compteur { display: inline-flex; gap: 6px; align-items: baseline; padding: 4px 12px; border-radius: 999px; border: 1px solid var(--bordure, #dde3ec); text-decoration: none; color: inherit; font-size: 13px; }
.depot-compteur strong { font-size: 15px; }
.depot-groupe { margin-top: 14px; border-left: 4px solid var(--bordure, #dde3ec); padding-left: 12px; }
.depot-groupe h4 { margin: 0; font-size: 14px; }
.depot-groupe > p { margin: 2px 0 6px; }
.depot-ocr, .depot-corriger { border-color: var(--alerte); }
.depot-illisible { border-color: var(--danger); }
.depot-prete { border-color: var(--bleu, #2563be); }
.depot-integree { border-color: var(--ok); }
.depot-compteur.depot-ocr, .depot-compteur.depot-corriger { background: var(--alerte-fond); }
.depot-compteur.depot-illisible { background: var(--danger-fond); }
.depot-compteur.depot-integree { background: var(--ok-fond); }
.point-a-traiter { color: var(--alerte); font-weight: 600; }
#saisie-erreur { margin: 10px 0 0; }
.table-depot td > small { display: block; }
.depot-doublon { border-color: var(--danger); }
.depot-compteur.depot-doublon { background: var(--danger-fond); }
#table-pdf-traiter tr.ligne-doublon td { background: var(--danger-fond); }
#pdf-doublons { margin-bottom: 10px; }
#pdf-doublons .barre-actions { margin-top: 8px; }
#pdf-selection { align-items: center; margin-bottom: 8px; }
#pdf-selection-compte { color: var(--texte-2); font-size: .9em; }
#table-pdf-traiter .colonne-choix { width: 28px; text-align: center; }
#table-pdf-traiter tr.ligne-prete td { background: var(--bleu-pale); }
#pdf-prets { margin-bottom: 10px; }
#pdf-prets .barre-actions { margin-top: 8px; }
.depot-groupe > .barre-actions { margin: 4px 0 8px; }
.indicateur-anticipation { border-left: 4px solid var(--bordure, #dde3ec); }
.indicateur-anticipation.ratio-ok { border-left-color: var(--ok); }
.indicateur-anticipation.ratio-moyen { border-left-color: var(--alerte); }
.indicateur-anticipation.ratio-bas { border-left-color: var(--danger); background: var(--danger-fond); }
#carte-anticipation { margin-bottom: 16px; }

/* ── Bulles d'aide (public/js/aide.js) : termes soulignés en pointillé, définition au survol ou au focus ── */
.aide-terme, .aide-terme .tri {
  text-decoration: underline dotted rgba(70, 82, 105, .5); text-decoration-thickness: 1px; text-underline-offset: 3px; cursor: help;
}
.aide-terme:focus-visible { outline: 2px solid var(--bleu); outline-offset: 2px; border-radius: 3px; }
.bulle-aide {
  position: absolute; z-index: 80; max-width: 320px; padding: 8px 11px; border-radius: 8px;
  background: var(--navy); color: #fff; font-size: 12.5px; font-weight: 400; line-height: 1.45; text-align: left;
  text-transform: none; letter-spacing: normal; white-space: normal; box-shadow: 0 8px 24px rgba(15, 32, 64, .25);
  pointer-events: none; opacity: 0; transform: translateY(-3px); transition: opacity .12s ease, transform .12s ease;
}
.bulle-aide.au-dessus { transform: translateY(3px); }
.bulle-aide.visible { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { .bulle-aide { transition: none; } }

/* Clôture mensuelle : dossiers, panneau de traitement, bandeau du Rapprochement */
.table-cloture tr.ligne-vous > td:first-child { font-weight: 600; }
tr.panneau-cloture > td { padding: 8px 12px 14px 24px; background: var(--fond); }
tr.panneau-cloture .champ { max-width: 720px; margin: 8px 0; }
tr.panneau-cloture textarea { padding: 6px 8px; border: 1px solid var(--bordure); border-radius: 6px; font: inherit; font-weight: 400; resize: vertical; }
.historique-cloture { margin: 6px 0; padding-left: 18px; font-size: 13px; }
.historique-cloture li { margin: 2px 0; }
.panneau-cloture .avertissement { color: var(--alerte); font-size: 13px; margin: 6px 0; }
.bandeau-cloture { margin-bottom: 12px; }

/* Envois automatiques et adresses des sites (Administration › Demandes par mail) */
#table-envois td small, #table-distance td small { display: block; margin-top: 2px; }
#table-envois .case { display: flex; gap: 6px; align-items: center; font-weight: 600; }
#carte-envois textarea { padding: 6px 8px; border: 1px solid var(--bordure); border-radius: 6px; font: inherit; font-weight: 400; max-width: 640px; }

/* ── Prestataires : prestataire choisi (écarts aux conventions), formulaire des conventions ── */
#table-prestataires tr.ligne-choisie td { background: var(--ok-fond); }
td.alerte-texte { margin: 0; }
.form-convention { margin-bottom: 16px; }
.form-convention .formulaire-actions { margin-top: 0; }

/* ── Module CEA : arbre de l'organisation (DO → DR → secteur → sous-secteur → site → sites enfants), compte d'exploitation,
   DGA, commentaires (pastille 💬 et pop-up) ── */
.table-arbre td.arbre-libelle { min-width: 260px; white-space: nowrap; }
.table-arbre .arbre-niveau-1 { padding-left: 26px; }
.table-arbre .arbre-niveau-2 { padding-left: 44px; }
.table-arbre .arbre-niveau-3 { padding-left: 62px; }
.table-arbre .arbre-niveau-4 { padding-left: 80px; }
.table-arbre .arbre-niveau-5, .table-arbre .arbre-niveau-6 { padding-left: 98px; }
.arbre-fleche { border: 0; background: none; width: 1.4em; padding: 0; margin-right: 2px; cursor: pointer; color: var(--texte-3); font-size: 13px; }
.arbre-fleche:hover { color: var(--bleu); }
.arbre-fleche-vide { display: inline-block; width: 1.4em; margin-right: 2px; }
.table-arbre, .table-compte { width: auto; min-width: 100%; }
.table-arbre th, .table-arbre td { padding: 7px 9px; }
.arbre-nom { padding: 0; font-weight: 600; text-align: left; white-space: nowrap; display: inline; }
.arbre-nom.choisi { color: var(--navy); text-decoration: underline; text-underline-offset: 3px; }
.arbre-niveau { margin-left: 8px; font-size: 11px; }
tr.arbre-choisie > td { background: var(--bleu-pale); }
.table-arbre tbody tr:has(.arbre-niveau-0) > td { font-weight: 600; }
.badge-consolide { margin-left: 6px; background: var(--bleu-pale); color: var(--bleu-fonce); cursor: help; }
.colonne-total { font-weight: 650; }
.evolution.favorable { color: var(--ok); }
.evolution.defavorable { color: var(--danger); }
.table-compte td:first-child { min-width: 240px; white-space: nowrap; }
.table-compte th.groupe-colonnes { text-align: center; }
.table-compte .separation { border-left: 2px solid var(--bordure); }
.table-compte tr.ligne-n1 > td:first-child { font-weight: 600; }
.table-compte tr.ligne-total-cea > td { font-weight: 700; background: var(--bleu-pale); }
.table-compte tr.ligne-indicateur > td { font-style: italic; color: var(--texte-2); }
.table-compte tr.ligne-titre-dga > th { text-align: left; background: var(--fond); color: var(--navy); font-size: 12px; text-transform: uppercase; letter-spacing: .03em; }
.table-compte td.hors-periode { opacity: .5; }
.badge-commentaire {
  margin-left: 6px; padding: 0 7px; border: 1px solid #c9daf3; border-radius: 10px; background: var(--bleu-pale); color: var(--bleu-fonce);
  font-size: 11px; font-weight: 600; cursor: pointer; line-height: 18px;
}
.badge-commentaire:hover, .badge-commentaire[aria-expanded="true"] { background: var(--bleu); border-color: var(--bleu); color: #fff; }
.badge-commentaire:focus-visible { outline: 2px solid var(--bleu); outline-offset: 2px; }
.bulle-cea {
  position: absolute; z-index: 85; width: min(420px, calc(100vw - 16px)); max-height: 340px; overflow: auto; padding: 10px 12px;
  border-radius: 8px; background: var(--surface); color: var(--texte); border: 1px solid var(--bordure); border-top: 3px solid var(--bleu);
  box-shadow: 0 10px 28px rgba(15, 32, 64, .22); font-size: 12.5px; line-height: 1.45; pointer-events: none;
}
.bulle-cea.epinglee { pointer-events: auto; }
.bulle-cea.bulle-cea-large { width: min(560px, calc(100vw - 16px)); max-height: min(480px, 70vh); }
.bulle-cea-site { font-weight: 700; color: var(--navy); }
h2 .badge-commentaire { font-size: 12px; vertical-align: middle; }
.bulle-cea p { margin: 0; white-space: pre-line; }
.bulle-cea-titre { font-weight: 700; color: var(--navy); margin-bottom: 6px !important; }
.bulle-cea-item { padding: 6px 0; border-top: 1px solid var(--grille); }
.bulle-cea-meta { font-size: 11px; font-weight: 600; color: var(--texte-3); text-transform: uppercase; letter-spacing: .02em; }
.liste-commentaires { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.liste-commentaires li { padding: 10px 12px; border: 1px solid var(--grille); border-radius: var(--rayon); }
.liste-commentaires p { margin: 0; }
.commentaire-entete { font-size: 12.5px; color: var(--texte-2); margin-bottom: 4px !important; }
.commentaire-texte { white-space: pre-line; }
.badge-source-rma { background: var(--bleu-pale); color: var(--bleu-fonce); }
.badge-source-dga { background: var(--ok-fond); color: var(--ok); }
.badge-source-ecart { background: var(--alerte-fond); color: var(--alerte); }
.details-import { margin-top: 10px; font-size: 13px; }
.details-import summary { cursor: pointer; color: var(--texte-2); }
/* Tableaux figés : en-tête et libellés (première colonne) restent visibles au défilement, dans un cadre de hauteur bornée */
/* Tableaux figés : défilement propre, à la hauteur de l'écran sous la barre de filtres (--haut-filtres, mesurée) : en-têtes et
   première colonne restent visibles quand on descend */
.table-haute, .table-defil:has(> .table-figee) { max-height: calc(100vh - var(--haut-filtres, 0px) - 32px); overflow: auto; }
.carte:has(.table-figee) { scroll-margin-top: calc(var(--haut-filtres, 0px) + 8px); }
/* Détail 3WM ouvert à la demande (paire de fournisseurs) : amené sous la barre de filtres figée, jamais dessous */
#troisvoies-paire { scroll-margin-top: calc(var(--haut-filtres, 0px) + 8px); }
/* Factures 3WM : listes (n° de BL et de BC, ligne cliquable) et panneau de détail à droite (commande → réception → facture,
   BL rattachés, articles, décision en pied) ; au-dessus de la barre des filtres (40) et du bouton d'assistance (60), sous les
   notifications ; carte agrandie (80) : sous la barre figée */
.table-3wm td { vertical-align: middle; }
.table-3wm th, .table-3wm td { padding: 8px 8px; }
.table-3wm .actions-ligne { white-space: nowrap; }
.table-3wm .actions-ligne .btn-lien { padding: 4px 4px; font-size: 12.5px; }
.table-3wm td:first-child:has(> input[type="checkbox"]), .table-3wm th:first-child:empty { width: 28px; padding-right: 0; }
.table-3wm .tv-num { font-weight: 600; font-variant-numeric: tabular-nums; }
.table-3wm .btn-lien.tv-num { padding: 0; }
/* Réception non validée (commande livrable sans BL validé dans Adoria) : couleur propre, repérable d'un coup d'œil — badge,
   n° de BL, liseré de la ligne, encart du panneau */
.tv-nv { font-style: italic; color: var(--nv); }
.badge-nv { background: var(--nv-fond); color: var(--nv); box-shadow: inset 0 0 0 1px var(--nv); cursor: help; }
.table-3wm tr.tv-ligne-nv > td:first-child { box-shadow: inset 3px 0 0 var(--nv), inset -1px 0 0 var(--bordure); }
.table-3wm.tv-avec-sel tr.tv-ligne-nv > td:first-child { box-shadow: inset 3px 0 0 var(--nv); }
.encart-nv { background: var(--nv-fond); border-color: #d6c8f5; color: var(--nv); }
.tv-sous { display: block; color: var(--texte-3); font-size: 11.5px; font-weight: 400; line-height: 1.3; white-space: nowrap; }
.tv-tronque { display: block; max-width: 140px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tv-badges-ligne { display: inline-flex; flex-wrap: wrap; gap: 3px 4px; max-width: 150px; }
tr.tv-ligne { cursor: pointer; scroll-margin-top: calc(var(--haut-filtres, 0px) + 44px); }
tr.tv-ligne:hover > td { background: #f6f8fc; }
tr.tv-ligne.arbre-choisie:hover > td { background: var(--bleu-pale); }
/* Listes 3WM figées (cadre .table-haute) : en-tête, ligne Total et colonne Site restent visibles au défilement ; avec la
   case de sélection en tête, case et Site figées ensemble ; survol et ligne choisie gardent leur fond sur les cellules figées */
.table-3wm.tv-avec-sel :is(thead th, tbody td, tfoot td):first-child { width: 46px; min-width: 46px; max-width: 46px; padding-left: 4px; padding-right: 4px; text-align: center; box-shadow: none; }
.table-3wm.tv-avec-sel :is(thead th, tbody td, tfoot td):nth-child(2) { position: sticky; left: 46px; z-index: 1; background: var(--surface); box-shadow: inset -1px 0 0 var(--bordure); }
.table-3wm.tv-avec-sel thead th:nth-child(2) { z-index: 4; background: #fafbfc; }
.table-3wm.table-figee tr.tv-ligne:hover > td { background: #f6f8fc; }
.table-3wm.table-figee tr.tv-ligne.arbre-choisie > td { background: var(--bleu-pale); }
.table-3wm th.tri-serveur .tv-sous { text-transform: none; letter-spacing: 0; }
/* Date cliquable (liste, panneau) : pièces de ce jour selon la date de facture, de livraison ou de commande */
.tv-date { padding: 0; border: 0; background: none; font: inherit; color: inherit; cursor: pointer; text-decoration: underline dotted; text-underline-offset: 2px; }
.tv-date:hover, .tv-date:focus-visible { color: var(--bleu); text-decoration: underline; }
/* Période (ruban figé des filtres) : date retenue, du … au, jour / semaine / mois, période voisine */
/* Ruban : zone du module sur toute la largeur quand elle porte la période (les filtres voisins gardent leur place, en mobile
   comme sur grand écran) */
.filtres-module:has(.periode-3wm) { flex-basis: 100%; }
.periode-3wm { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; }
.periode-3wm .segments { flex-wrap: nowrap; white-space: nowrap; }
.periode-3wm-dates { display: inline-flex; flex-wrap: nowrap; align-items: center; gap: 6px; }
.periode-3wm-titre { font-size: 12.5px; color: var(--texte-2); }
.periode-3wm .segments button { padding: 5px 10px; }
.periode-3wm input[type="date"] { width: 138px; }
.periode-3wm .periode-3wm-pas { padding: 4px 6px; }
/* Petits écrans : la barre de période occupe toute la largeur du ruban (grille à deux colonnes) et passe à la ligne */
@media (max-width: 720px) {
  .filtres-module:has(.periode-3wm) { grid-column: 1 / -1; min-width: 0; }
  .periode-3wm, .periode-3wm-dates { flex-wrap: wrap; min-width: 0; }
  .periode-3wm input[type="date"] { width: 132px; }
}
/* Articles du BL dans le panneau : cadre défilant, en-tête et colonne Article figés */
.volet-3wm .tv-articles-defil { max-height: 55vh; }
.volet-3wm { z-index: 65; width: min(900px, 100vw); }
body:has(.carte-plein-ecran) .volet-3wm { z-index: 85; top: var(--haut-filtres, 0px); }
body:has(.volet-3wm) .notification { z-index: 95; }
.volet-3wm h2 { margin: 0; font-size: 18px; overflow-wrap: anywhere; }
.tv-surtitre { margin: 0 0 2px; font-size: 11px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--texte-3); }
.tv-badges { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.tv-nav { flex-wrap: nowrap; align-items: center; }
.tv-nav .btn-lien { font-size: 15px; padding: 4px 8px; }
.tv-nav .btn-lien:disabled { opacity: .35; cursor: default; }
.tv-flux { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr) auto minmax(0, 1fr); gap: 6px; }
.tv-etape { display: flex; flex-direction: column; gap: 2px; min-width: 0; padding: 10px 12px; border: 1px solid var(--bordure); border-radius: var(--rayon); background: var(--surface); }
.tv-etape-vide { background: var(--fond); border-style: dashed; }
.tv-etape-titre { font-size: 11px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--texte-3); }
.tv-etape-num { font-size: 17px; font-weight: 700; color: var(--texte); font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.tv-etape-vide .tv-etape-num { font-size: 15px; font-weight: 600; color: var(--texte-2); }
.tv-etape-ligne { font-size: 12px; color: var(--texte-2); overflow-wrap: anywhere; }
.tv-etape-montant { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; margin-top: auto; padding-top: 6px; border-top: 1px dashed var(--grille); font-size: 12px; color: var(--texte-2); }
.tv-etape-montant strong { font-size: 15px; color: var(--texte); font-variant-numeric: tabular-nums; white-space: nowrap; }
.tv-etape .tv-etape-action { align-self: flex-start; padding: 6px 0 0; }
.tv-lien { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; width: 92px; text-align: center; }
.tv-fleche { font-size: 20px; line-height: 1; color: var(--texte-3); }
.tv-ecart { font-size: 11.5px; font-weight: 600; line-height: 1.3; padding: 2px 6px; border-radius: 10px; background: var(--grille); color: var(--texte-2); }
.tv-lien-ok .tv-ecart { background: var(--ok-fond); color: var(--ok); }
.tv-lien-alerte .tv-ecart { background: var(--alerte-fond); color: var(--alerte); }
.tv-lien-alerte .tv-fleche { color: var(--alerte); }
.tv-lien small { font-size: 10.5px; color: var(--texte-3); }
.tv-constat { margin: 0; font-size: 13px; color: var(--texte-2); }
/* Litiges Adoria (lignes refusées à la réception) : marque cerclée — rouge : avoir attendu ; orange : à vérifier (ou BL pas
   encore facturé) ; grise : déduit ou avoir reçu */
.badge-litige { background: var(--surface); color: var(--danger); box-shadow: inset 0 0 0 1px var(--danger); cursor: help; }
.badge-litige-verifier { background: var(--surface); color: var(--alerte); box-shadow: inset 0 0 0 1px var(--alerte); cursor: help; }
.badge-litige-regle { background: var(--surface); color: var(--texte-2); box-shadow: inset 0 0 0 1px var(--bordure); cursor: help; }
.tv-litige { margin: 0; padding: 8px 10px; border-radius: var(--rayon); background: var(--grille); font-size: 13px; color: var(--texte-2); }
.tv-litige-attendu { background: var(--danger-fond); color: var(--texte); }
.tv-litige-attendu strong { color: var(--danger); }
.tv-litige-verifier { background: var(--alerte-fond); color: var(--texte); }
.tv-litige-verifier strong { color: var(--alerte); }
/* Avoirs : suggestions et listes du panneau ; chronologie d'une pièce (étape, date, délai, détail) */
.tv-suggestions, .tv-avoirs-liste { margin: 0; padding-left: 18px; font-size: 13px; }
.tv-suggestions li, .tv-avoirs-liste li { margin: 2px 0; }
.tv-avoir-global { margin: 4px 0 0; font-size: 12.5px; color: var(--alerte); }
.tv-chrono { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; font-size: 13px; }
.tv-chrono-etape { display: grid; grid-template-columns: 170px 150px 52px minmax(0, 1fr); gap: 8px; align-items: baseline; padding: 4px 8px; border-left: 3px solid var(--bordure); }
.tv-chrono-libelle { font-weight: 650; color: var(--texte); }
.tv-chrono-date { font-variant-numeric: tabular-nums; }
.tv-chrono-delai { color: var(--texte-2); font-variant-numeric: tabular-nums; text-align: right; }
.tv-chrono-detail { color: var(--texte-2); }
.tv-chrono-retard { border-left-color: var(--alerte); background: var(--alerte-fond); }
@media (max-width: 720px) { .tv-chrono-etape { grid-template-columns: minmax(0, 1fr) auto auto; } .tv-chrono-detail { grid-column: 1 / -1; } }
.tv-section h3 { margin: 4px 0 6px; font-size: 14px; }
.tv-section > .discret, .tv-articles-corps > p { margin: 4px 0; }
.volet-3wm .table-3wm { font-size: 12.5px; }
.volet-3wm .table-3wm th, .volet-3wm .table-3wm td { padding: 6px 8px; }
.volet-3wm .table-3wm td.tv-article { min-width: 170px; white-space: normal; }
.indicateurs-3wm { grid-template-columns: repeat(7, minmax(0, 1fr)); }
.indicateurs-3wm .indicateur { padding: 12px 14px; }
@media (max-width: 1250px) { .indicateurs-3wm { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (max-width: 640px) { .indicateurs-3wm { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
/* Factures 3WM, tableau de bord par organisation : nœud choisi (titre, période), huit indicateurs sur deux rangées */
.tv-tableau-titre { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 14px; margin: 4px 0 10px; }
.tv-tableau-titre h2 { margin: 0; font-size: 17px; }
.indicateurs-tableau-3wm { grid-template-columns: repeat(4, minmax(0, 1fr)); margin-bottom: 16px; }
.indicateurs-tableau-3wm .indicateur { padding: 12px 14px; }
@media (max-width: 640px) { .indicateurs-tableau-3wm { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.indicateurs-tableau-3wm .btn-lien { white-space: normal; text-align: left; }
/* Factures 3WM, suivi des avoirs : sous-titre des avoirs à affecter, listes d'avoirs dans les cellules */
.tv-suivi-sous-titre { margin: 18px 0 8px; font-size: 15px; }
#troisvoies-suivi-table .tv-avoirs-liste { margin: 0; padding: 0; list-style: none; font-size: 12px; text-align: left; }
#troisvoies-suivi-table td.tv-suivi-avoirs { min-width: 240px; max-width: 340px; white-space: normal; }
.tv-avoir-recu { color: var(--ok); }
.tv-avoir-candidat { color: var(--texte-2); }
.table-tableau-3wm td.nombre .btn-lien { padding: 0; font-variant-numeric: tabular-nums; }
.table-tableau-3wm thead th { white-space: normal; vertical-align: bottom; }
.table-tableau-3wm th.nombre { min-width: 72px; }
.volet-pied { padding: 10px 16px 14px; border-top: 1px solid var(--bordure); background: var(--fond); }
.volet-pied > .discret { margin: 0 0 6px; }
.volet-pied .champ { margin: 0; }
.volet-pied textarea { width: 100%; min-height: 44px; padding: 6px 8px; border: 1px solid var(--bordure); border-radius: 6px; font: inherit; font-size: 13px; font-weight: 400; resize: vertical; }
.volet-pied .formulaire-actions { margin-top: 8px; }
@media (max-width: 720px) {
  .tv-flux { grid-template-columns: minmax(0, 1fr); }
  .tv-lien { flex-direction: row; width: auto; }
  .tv-fleche { transform: rotate(90deg); }
}
.table-figee thead { position: sticky; top: 0; z-index: 3; }
.table-figee thead th { background: #fafbfc; box-shadow: inset 0 -1px 0 var(--bordure); }
.table-figee thead th:first-child, .table-figee tbody td:first-child, .table-figee tfoot td:first-child {
  position: sticky; left: 0; z-index: 1; background: var(--surface); box-shadow: inset -1px 0 0 var(--bordure);
}
.table-figee thead th:first-child { z-index: 4; background: #fafbfc; }
.table-figee tfoot { position: sticky; bottom: 0; z-index: 2; background: var(--surface); }
.table-figee tfoot td { background: var(--surface); }
.table-figee tbody tr:hover > td:first-child { background: #f8fafc; }
.table-figee tr.ligne-total-cea > td:first-child, .table-figee tr.arbre-choisie > td:first-child { background: var(--bleu-pale); }
/* Colonnes de référence (budget, N-1) en retrait ; colonnes CEA (définitif ou réalisé) mises en avant */
.table-compte th.col-ref, .table-compte td.col-ref { background: #f5f6f8; color: var(--texte-2); }
.table-compte th.col-cea { background: var(--bleu-pale); color: var(--bleu-fonce); }
.table-compte td.col-cea { background: #f4f8fe; color: var(--navy); font-weight: 650; }
.table-compte tr.ligne-total-cea > td.col-ref, .table-compte tr.ligne-total-cea > td.col-cea { background: var(--bleu-pale); }
.table-compte tr.ligne-indice > td { border-top: 1px dashed var(--bordure); }
.statut-mois { display: block; font-size: 10px; font-weight: 500; text-transform: none; letter-spacing: 0; color: var(--texte-3); }
/* Synthèse : organisation en colonnes (fil d'Ariane, en-têtes cliquables pour descendre d'un niveau) */
.fil-ariane { margin: 0 0 10px; font-size: 13px; display: flex; flex-wrap: wrap; gap: 4px; align-items: center; }
.fil-ariane .btn-lien { padding: 0; }
.table-compte th.colonne-org { white-space: normal; min-width: 110px; max-width: 180px; vertical-align: bottom; }
.table-compte th.colonne-org .btn-lien { padding: 0; font-size: 12px; font-weight: 650; text-align: right; white-space: normal; }
.table-compte th.colonne-org .arbre-niveau { display: block; margin-left: 0; }
.barre-arbre { margin-bottom: 6px; }
/* Tuiles du module : valeur du mois, cumul depuis janvier, écarts au budget ; tableau de bord : 4 par ligne */
.indicateurs-tb { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 1100px) { .indicateurs-tb { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px) { .indicateurs-tb { grid-template-columns: minmax(0, 1fr); } }
.table-unites th { white-space: normal; vertical-align: bottom; }
.table-unites td:first-child { white-space: normal; min-width: 240px; }
.table-unites td:first-child .btn-lien { padding: 0; white-space: normal; text-align: left; }
/* Mois et cumul côte à côte, au même poids ; couleur propre à chacun (écart au budget du mois, du cumul) */
.indicateur-duo { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 10px; margin-top: 6px; }
.indicateur-bloc { min-width: 0; }
.indicateur-bloc + .indicateur-bloc { border-left: 1px dashed var(--grille); padding-left: 10px; }
.indicateur-periode { font-size: 11px; font-weight: 600; letter-spacing: .02em; color: var(--texte-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.indicateur-cea .indicateur-valeur { font-size: 18px; margin-top: 2px; overflow-wrap: anywhere; }
.indicateur-bloc .indicateur-ecart { margin-top: 1px; white-space: normal; }
.indicateur-bloc .cumul-detail { display: block; margin-top: 1px; white-space: normal; font-weight: 400; }
.indicateur-bloc.ratio-ok .indicateur-valeur { color: var(--ok); }
.indicateur-bloc.ratio-moyen .indicateur-valeur { color: var(--alerte); }
.indicateur-bloc.ratio-bas .indicateur-valeur { color: var(--danger); }
.indicateur-cea .indicateur-detail { margin-top: 6px; }
#cea-indicateurs .indicateur-cea .indicateur-valeur { font-size: 16px; }
.champ-clients-cea select { max-width: 230px; }
/* Indicateurs CDG : période des tableaux (mois / cumul) ; détail du parc clients */
.reglages-cdg { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 10px 16px; }
.details-parc { margin-top: 10px; font-size: 13px; }
.graphique.graphique-bas { height: 220px; margin-top: 12px; }
.table-compte tr.ligne-total > td { font-weight: 700; background: var(--bleu-pale); }
.texte-alerte { color: var(--danger); font-weight: 600; }
.btn-exclure { padding: 0 4px; font-size: 11.5px; opacity: .75; }
.liste-exceptions { margin: 8px 0; padding-left: 18px; }
.form-exceptions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 8px; }
.details-parc summary { cursor: pointer; color: var(--texte-2); }
.indicateur-ecart { font-size: 12px; font-weight: 600; white-space: nowrap; }
.indicateur-cumul { margin-top: 8px; padding-top: 6px; border-top: 1px dashed var(--grille); font-size: 13px; font-weight: 600; color: var(--texte-2); }
.champ-mois-cea select { font-weight: 650; }
.liste-alertes { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 6px 16px; }
.liste-alertes .btn-lien { padding: 0; white-space: normal; text-align: left; }
@media (max-width: 720px) {
  .table-arbre td.arbre-libelle { min-width: 200px; }
  .table-compte td:first-child { min-width: 180px; }
  .table-haute, .table-defil:has(> .table-figee) { max-height: 80vh; }
}

/* ── DGA › Clôture des achats : segment du volet, ligne de lecture, pastilles d'état (« symbole libellé », lisibles sans la
   couleur), bande de tendance janvier → M (une case par mois), barre de répartition des sites, chiffres provisoires ── */
.segments-volet { vertical-align: middle; margin-left: 6px; }
.segments-volet button { flex: 1 1 auto; }
/* Barre de contexte de la DGA (sélecteur de mois et segment du volet) : le texte passe à la ligne, l'export reste à droite */
#dga-contexte > div:first-child { flex: 1 1 0; min-width: min(100%, 380px); }
/* Sites à relancer (plus large) et qualité de clôture côte à côte ; l'un sous l'autre sur écran étroit */
.grille-cloture { grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); align-items: start; }
.grille-cloture .graphique { height: 340px; }
#dga-qualite .carte-titre { flex-wrap: wrap; gap: 8px; }
/* Synthèse et détail : en-têtes sur deux lignes, pastilles resserrées (les mois tiennent dans la largeur de la carte) */
.table-cloture thead th { white-space: normal; vertical-align: bottom; }
.table-cloture thead th.nombre { min-width: 88px; }
.table-compte .pastille-cloture { padding: 0 5px; font-size: 10.5px; }
.table-compte td.verdict-cloture { white-space: normal; }
.table-compte.table-cloture th, .table-compte.table-cloture td { padding: 8px 9px; }
@media (max-width: 1100px) { .grille-cloture { grid-template-columns: minmax(0, 1fr); } }
.table-relancer th, .table-relancer td { padding: 7px 8px; }
.segments button:disabled { cursor: not-allowed; opacity: .55; }
.lecture-cloture { flex-basis: 100%; margin: 0; line-height: 1.5; }
.lecture-cloture strong { color: var(--texte-2); font-weight: 650; }
.lecture-solde { margin: 0 0 0.6rem; line-height: 1.5; }
.indicateur-cumul .cumul-detail { display: block; margin-top: 1px; white-space: normal; font-weight: 400; }
.pastille-cloture { display: inline-block; padding: 1px 8px; border-radius: 10px; font-size: 11.5px; font-weight: 650; line-height: 18px; white-space: nowrap; }
.pastille-cloture.cloture-juste { color: var(--ok); background: var(--ok-fond); }
.pastille-cloture.cloture-sous { color: var(--danger); background: var(--danger-fond); }
.pastille-cloture.cloture-sur { color: var(--cloture-sur); background: var(--cloture-sur-fond); }
.pastille-cloture.cloture-non_declare { color: #fff; background: var(--cloture-rien); }
.pastille-cloture.cloture-en_cours { color: var(--texte-2); background: repeating-linear-gradient(135deg, var(--fond) 0 4px, var(--cloture-hachure) 4px 8px); }
.bande-cloture { display: inline-flex; gap: 2px; vertical-align: middle; }
.bande-case {
  display: inline-flex; align-items: center; justify-content: center; width: 14px; height: 14px; border-radius: 3px;
  font-size: 9px; font-weight: 700; line-height: 1; color: #fff; cursor: help;
}
.bande-case.cloture-juste { background: var(--cloture-juste); }
.bande-case.cloture-sous { background: var(--cloture-sous); }
.bande-case.cloture-sur { background: var(--cloture-sur); color: var(--cloture-sur-texte); }
.bande-case.cloture-non_declare { background: var(--cloture-rien); }
.bande-case.cloture-en_cours { background: repeating-linear-gradient(135deg, var(--fond) 0 3px, var(--cloture-hachure) 3px 6px); color: var(--texte-3); }
.bande-case.cloture-vide { border: 1px dashed var(--attenue); }
.repartition-cloture-cellule { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; font-size: 12px; cursor: help; }
.repartition-cloture { display: inline-flex; gap: 1px; width: 84px; height: 9px; border-radius: 3px; overflow: hidden; background: var(--grille); }
.repartition-cloture > span { display: block; height: 100%; }
.repartition-cloture > .cloture-juste { background: var(--cloture-juste); }
.repartition-cloture > .cloture-sous { background: var(--cloture-sous); }
.repartition-cloture > .cloture-sur { background: var(--cloture-sur); }
.repartition-cloture > .cloture-non_declare { background: var(--cloture-rien); }
.texte-cloture-sous { color: var(--danger); font-weight: 650; }
.texte-cloture-sur { color: var(--cloture-sur); font-weight: 650; }
/* Mois non jugé (factures en cours) : chiffres provisoires en italique grisé */
.provisoire, .table-compte td.provisoire, .table-compte th.provisoire { font-style: italic; color: var(--texte-3); font-weight: 400; }
.table-relancer td:first-child { white-space: normal; min-width: 150px; }
.table-relancer td:first-child .btn-lien { padding: 0; white-space: normal; text-align: left; }
.pied-relancer { margin: 8px 0 0; }

/* Notation : consigne au survol ou au focus des boutons (notation factuelle, au regard de la convention) */
.notation { position: relative; }
.notation-consigne { display: none; position: absolute; z-index: 20; top: calc(100% + 6px); right: 0; width: 280px; padding: 8px 10px;
  background: var(--navy); color: #fff; border-radius: 6px; font-size: 12px; font-weight: 400; line-height: 1.4; text-align: left; white-space: normal;
  box-shadow: 0 4px 14px rgba(15, 32, 64, .25); pointer-events: none; }
.notation:hover .notation-consigne, .notation:focus-within .notation-consigne { display: block; }

/* Facturation : factures d'un site (dépliables) */
.facture-mc { border-bottom: 1px solid var(--bordure); padding: 6px 0; }
.facture-mc summary { cursor: pointer; }

/* Onglet Facturation : barre de réglages (mois, portée, filtres, fil d'Ariane) et vues */
.reglages-facturation { padding: 10px 16px; display: flex; flex-direction: column; gap: 8px; }
.reglages-ligne { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px 16px; }
.reglages-filtres { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 14px; }
.reglages-facturation .fil-ariane { margin: 0; }
.champ-inline.filtre-actif select, .champ-inline.filtre-actif .combo-saisie { border-color: var(--bleu); background: var(--bleu-pale); font-weight: 600; }
.vues-facturation { margin: 4px 0 12px; }
.vues-facturation button { padding: 8px 16px; font-weight: 600; }
/* Sous-volets de la rubrique affichée (deuxième ligne, sous la barre des volets d'un onglet) */
.sous-volets { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: -4px 0 12px; }
.sous-volets .segments button { padding: 5px 12px; font-size: 13px; }
.pastille-compte { display: inline-block; min-width: 18px; padding: 0 5px; margin-left: 4px; border-radius: 9px; background: var(--danger); color: #fff; font-size: 11px; line-height: 18px; text-align: center; }
.table-moyenne { max-height: 420px; overflow: auto; }
.reglages-filtres select { width: auto; min-width: 0; max-width: 180px; }
#facturation-arbre thead th, #facturation-ecarts thead th { white-space: normal; vertical-align: bottom; min-width: 84px; }
#facturation-arbre thead th:first-child, #facturation-ecarts thead th:first-child { min-width: 220px; }

/* Module CEA : sites CD (challenge développement) en vert, bascule SA / SA + CD / CD */
.noeud-cd, .noeud-cd:hover, .arbre-nom.noeud-cd { color: #4d7c0f; }
.badge-cd { background: #ecf5dc; color: #4d7c0f; border: 1px solid #c9e29a; }
.segments-sacd { margin-left: 6px; vertical-align: middle; }
.segments-sacd button { padding: 5px 10px; }
.segments-sacd button[data-sacd="CD"][aria-pressed="true"] { background: #6b9b12; }

/* Module CEA : bascule consommation déclarée / réelle et mention des mois recalculés */
.segments-conso { margin-left: 6px; vertical-align: middle; }
.segments-conso button { padding: 5px 10px; }
.barre-rapport .mention-conso { flex-basis: 100%; margin: 0; }

/* Module CEA : fenêtre « Comment c'est calculé » */
.confirmation.methodes { width: min(780px, calc(100vw - 32px)); border-top-color: var(--bleu); padding: 0; }
.methodes form { display: flex; flex-direction: column; max-height: min(82vh, 900px); }
.methodes-entete { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--bordure); }
.methodes-entete h2 { margin: 0; font-size: 17px; }
.methodes-contenu { overflow: auto; padding: 4px 20px 18px; }
.methodes-contenu h3 { margin: 16px 0 6px; font-size: 13px; text-transform: uppercase; letter-spacing: .04em; color: var(--texte-2); }
.methodes-contenu dl { margin: 0; display: grid; grid-template-columns: minmax(150px, 30%) 1fr; gap: 6px 16px; }
.methodes-contenu dt { font-weight: 600; }
.methodes-contenu dd { margin: 0; }
.methodes-lecture { display: block; margin-top: 2px; font-size: 12px; color: var(--texte-3); }
@media (max-width: 640px) { .methodes-contenu dl { grid-template-columns: 1fr; } .methodes-contenu dd { margin-bottom: 6px; } }
.bouton-methodes { white-space: nowrap; }

/* Barres de réglages : boutons d'action toujours à droite, réglages repliés à gauche */
.barre-rapport > div:first-child { flex: 1 1 520px; min-width: 0; }
.barre-rapport > .barre-actions { flex: 0 0 auto; }

/* ── Achats denrées & UU : types de fournisseurs, mercuriale, référentiel (contrôle de gestion) ── */
.pastille-type { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 6px; vertical-align: -1px; background: #c5ccd8; }
.pastille-type[data-type="grossiste"] { background: #2563be; }
.pastille-type[data-type="boulangerie"] { background: #d98e04; }
.pastille-type[data-type="fruits_legumes"] { background: #8ab61a; }
.pastille-type[data-type="viande"] { background: #b42318; }
.pastille-type[data-type="mer"] { background: #0f8a8a; }
.pastille-type[data-type="cremerie"] { background: #e3c35a; }
.pastille-type[data-type="boissons"] { background: #6b4fbb; }
.pastille-type[data-type="hygiene"] { background: #7a8aa6; }
.pastille-type[data-type="local"] { background: #3f7d3a; }
.badge-mercuriale { margin-left: 4px; background: var(--bleu-pale); color: var(--bleu-fonce); }
#achats-fournisseurs-table tr.ligne-choisie td { background: var(--bleu-pale); }
#achats-fournisseurs .barre-actions, #achats-referentiel .barre-actions { flex-wrap: wrap; gap: 8px; }
#achats-recherche, #achats-ref-recherche { min-width: 200px; padding: 6px 10px; border: 1px solid var(--bordure); border-radius: 6px; font: inherit; }
.table-referentiel select, .table-referentiel input[type="text"] { padding: 4px 6px; border: 1px solid var(--bordure); border-radius: 5px; font: inherit; font-size: 13px; max-width: 100%; }
.table-referentiel .champ-groupe { width: 160px; }
.table-referentiel .champ-taux { width: 70px; text-align: right; }
.table-referentiel td { vertical-align: middle; }
.indicateur-reserve { border-left: 3px solid var(--bleu); }
.table-referentiel select { min-width: 190px; }
#achats-detail .carte-corps.grille-2 { grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); }
.table-referentiel .champ-membres { width: 220px; margin-top: 4px; }
.table-referentiel .champ-evolutions { width: 170px; margin-top: 4px; }
.table-referentiel input[type="month"] { width: 130px; margin-top: 4px; }

/* Reporting CEA, organisation en colonnes : CEA · Budget · Écart */
.table-triple .separation-triple { border-right: 2px solid var(--bordure, #d5dbe5); }
.table-triple th.colonne-org { text-align: center; }

/* Reporting CEA : synthèse par organisation en plein écran */
.carte-plein-ecran { position: fixed; inset: calc(var(--haut-filtres, 0px) + 8px) 10px 10px; z-index: 80; display: flex; flex-direction: column; overflow: hidden; box-shadow: 0 10px 40px rgba(15, 32, 64, .35); }
.carte-plein-ecran .carte-corps { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.carte-plein-ecran .table-haute { max-height: none; flex: 1; min-height: 0; }
.carte-plein-ecran .carte-corps { overflow: auto; }
.carte-plein-ecran .table-defil { max-height: none; }
/* Plein écran : barre de filtres et navigation (◀ ▶, niveaux) fixées au-dessus du tableau, pour continuer à naviguer */
body:has(.carte-plein-ecran) .filtres { position: fixed; top: 0; left: 0; right: 0; z-index: 90; }

/* Achats › Réception des factures : saisi le mois de la pièce en gras, saisi les mois suivants en couleur */
.table-reception td.reception-mois { font-weight: 700; }
.table-reception td.reception-retard { background: #fdeee4; }
/* Planning de fin de mois (onglet Achats denrées & UU, vue Réception) */
#achats-fdm-table input[type="date"] { width: 9.5em; }
#achats-fdm-table input[type="text"] { width: 14em; }
#achats-fdm-table input.fdm-propose { border-style: dashed; color: var(--texte-2); }
#achats-fdm-table .fdm-detectee { display: block; font-size: 11px; }
.table-reception tfoot tr.discret th, .table-reception tfoot tr.discret td { font-weight: 400; font-style: italic; }

/* DGA › Suivi du mois : états (symbole + libellé, lisibles sans la couleur), décalage et stock colorés, phrase d'action */
.pastille-suivi { display: inline-block; padding: 1px 8px; border-radius: 10px; font-size: 11.5px; font-weight: 650; line-height: 18px; white-space: nowrap; }
.pastille-suivi.suivi-depassement { color: var(--danger); background: var(--danger-fond); }
.pastille-suivi.suivi-vigilance, .pastille-suivi.suivi-surstock { color: var(--alerte); background: var(--alerte-fond); }
.pastille-suivi.suivi-rupture { color: #fff; background: var(--cloture-rien); }
.pastille-suivi.suivi-conforme { color: var(--ok); background: var(--ok-fond); }
.pastille-suivi.suivi-sans_adoria, .pastille-suivi.suivi-sans_budget { color: var(--texte-2); background: var(--fond); }
.pastille-suivi.suivi-adoria_insuffisant { color: var(--texte-2); background: var(--fond); border: 1px dashed var(--bordure); }
.texte-suivi-depassement { color: var(--danger); font-weight: 650; }
.texte-suivi-vigilance { color: var(--alerte); font-weight: 650; }
.texte-suivi-ok { color: var(--ok); }
.phrase-suivi { border-left: 4px solid var(--ok); }
.phrase-suivi.suivi-depassement { border-left-color: var(--danger); }
.phrase-suivi.suivi-vigilance, .phrase-suivi.suivi-surstock { border-left-color: #d98e04; }
.phrase-suivi.suivi-rupture { border-left-color: var(--cloture-rien); }
.phrase-suivi.suivi-adoria_insuffisant, .phrase-suivi.suivi-sans_adoria { border-left-color: var(--bordure); }
.phrase-suivi p { margin: 4px 0; }

/* DGA › Suivi du mois : anneau des achats du mois à côté des tuiles */
.suivi-haut { display: grid; grid-template-columns: minmax(250px, 300px) 1fr; gap: 12px; align-items: stretch; }
.suivi-haut > .indicateurs { align-content: start; }
.suivi-anneau .carte-corps { padding: 14px 16px; }
.suivi-anneau-graphique { position: relative; height: 170px; margin: 8px 0 10px; }
.suivi-anneau-centre { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; pointer-events: none; text-align: center; line-height: 1.25; }
.suivi-anneau-centre strong { font-size: 24px; font-weight: 650; letter-spacing: -.01em; }
.suivi-anneau-centre span { font-size: 12px; color: var(--texte-2); }
.suivi-anneau-centre .discret { font-size: 11px; margin-top: 2px; }
.suivi-anneau-legende { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; font-size: 12.5px; color: var(--texte-2); }
.suivi-anneau-legende li { display: flex; align-items: center; gap: 8px; }
.suivi-anneau-legende li strong { margin-left: auto; color: var(--texte); font-variant-numeric: tabular-nums; }
.suivi-anneau-projete { border-top: 1px solid var(--grille); padding-top: 6px; }
.puce-legende { width: 10px; height: 10px; border-radius: 3px; flex: none; }
.suivi-anneau-livres { background: var(--bleu); }
.suivi-anneau-reste { background: var(--grille); border: 1px solid var(--bordure); }
.suivi-anneau-depasse { background: var(--danger); }
@media (max-width: 760px) { .suivi-haut { grid-template-columns: 1fr; } }

/* DGA › Suivi du mois : les 3 mois précédents, en sections */
.table-historique { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.table-historique th, .table-historique td { padding: 8px 14px; border-bottom: 1px solid var(--grille); }
.table-historique thead th { font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--texte-2); border-bottom: 2px solid var(--bordure); vertical-align: bottom; }
.table-historique tbody th { text-align: left; font-weight: 500; color: var(--texte); min-width: 260px; text-transform: none; letter-spacing: 0; font-size: 13px; background: transparent; }
.table-historique tbody tr:not(.historique-section):hover td, .table-historique tbody tr:not(.historique-section):hover th { background: var(--bleu-pale); }
.table-historique .historique-section th { background: var(--fond); color: var(--texte-3); font-size: 11.5px; font-weight: 650; text-transform: uppercase; letter-spacing: .05em; padding-top: 10px; }
.table-historique .historique-secondaire th, .table-historique .historique-secondaire td { color: var(--texte-3); font-size: 12.5px; }
.table-historique .historique-secondaire th { padding-left: 26px; }
.table-historique .historique-cle th, .table-historique .historique-cle td { font-weight: 650; }
.historique-etat { display: block; margin-top: 2px; font-size: 10.5px; font-weight: 500; text-transform: none; letter-spacing: 0; color: var(--ok); }
.historique-etat-attente { color: var(--texte-3); }
.historique-attente { color: var(--attenue); font-style: italic; font-weight: 400; }
.historique-retenu { color: var(--ok); }
.historique-ecarte { color: var(--alerte); }
.pastille-historique { display: inline-block; min-width: 54px; padding: 1px 8px; border-radius: 10px; text-align: center; font-size: 12px; }
.pastille-historique.historique-haut { color: var(--ok); background: var(--ok-fond); }
.pastille-historique.historique-neutre { color: var(--texte-2); background: var(--fond); }
.pastille-historique.historique-moyen { color: var(--alerte); background: var(--alerte-fond); }
.pastille-historique.historique-bas { color: var(--danger); background: var(--danger-fond); }

/* Intégration Adoria des denrées : jauge face à la cible et au seuil minimal */
.jauge-integration { position: relative; height: 8px; margin: 8px 0 6px; border-radius: 4px; background: var(--grille); overflow: visible; }
.jauge-integration .jauge-remplie { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 4px; background: var(--attenue); }
.jauge-integration.jauge-ok .jauge-remplie { background: var(--cloture-juste); }
.jauge-integration.jauge-moyen .jauge-remplie { background: #d98e04; }
.jauge-integration.jauge-bas .jauge-remplie { background: var(--danger); }
.jauge-integration .jauge-repere { position: absolute; top: -3px; bottom: -3px; width: 2px; background: var(--texte-2); }
.jauge-integration .jauge-min { background: var(--texte-3); opacity: .6; }
/* Tuile cliquable (Intégration Adoria → DGA › Suivi du mois) */
.tuile-lien { cursor: pointer; display: grid; }
.tuile-lien > .indicateur { height: 100%; }
.tuile-lien:hover > .indicateur, .tuile-lien:focus-visible > .indicateur { border-color: var(--bleu); }

/* Clôture des achats par site : provision au-delà du rythme de réception des factures */
.pastille-cloture.cloture-provision_elevee { color: var(--alerte); background: var(--alerte-fond); }
.texte-cloture-elevee { color: var(--alerte); font-weight: 650; }
#dga-sites-cloture td:nth-child(2) { color: var(--texte-2); white-space: nowrap; }

/* Tri des tableaux de listes (table[data-triable]) : en-tête cliquable, sens affiché */
table[data-triable] th.triable { cursor: pointer; user-select: none; }
table[data-triable] th.triable:hover { text-decoration: underline; }
table[data-triable] th.triable[aria-sort="ascending"]::after { content: " ↑"; }
table[data-triable] th.triable[aria-sort="descending"]::after { content: " ↓"; }

/* Contrôle des stocks (DGA › Suivi du mois) : cases mois par mois */
.bande-case.controle-coherent { background: #e3f1e4; color: #2e7d32; }
.bande-case.controle-au_dessus { background: #fdf0d8; color: #b26a00; }
.bande-case.controle-en_dessous { background: #fbe3e1; color: #b3261e; }

/* Factures 3WM : actions de ligne, décision en lot, pagination */
.actions-ligne { white-space: nowrap; }
.actions-ligne .btn-lien + .btn-lien { margin-left: 8px; }
/* Correspondance en cours d'enregistrement (confirmer, refuser) : ligne grisée jusqu'à la réponse */
.tv-en-cours { opacity: .55; cursor: progress; }
.barre-lot { margin-bottom: 12px; }
.barre-lot .champ-recherche { flex: 1; min-width: 240px; }
.pagination { justify-content: center; gap: 16px; margin-top: 8px; }

/* Livraisons : calendrier (frise fournisseurs × jours, semaine type, bons) */
.navigation-calendrier { display: inline-flex; align-items: center; gap: 8px; }
.navigation-calendrier strong { min-width: 150px; text-align: center; }
.cal-barre { display: flex; flex-wrap: wrap; gap: 10px 16px; align-items: center; margin-bottom: 8px; }
.cal-choix { display: inline-flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.cal-choix input { width: 300px; max-width: 70vw; padding: 7px 10px; border: 1px solid var(--bordure, #e3e7ee); border-radius: 6px; font: inherit; background: var(--surface, #fff); color: inherit; }
.cal-choix input:focus { outline: 2px solid var(--bleu); outline-offset: 0; }
.cal-resume { margin: 2px 0 8px; }
.cal-filtres { display: flex; flex-wrap: wrap; gap: 6px 8px; align-items: center; margin-bottom: 10px; font-size: 12.5px; }
.cal-filtres button.cal-bon { cursor: pointer; border: 1px solid rgba(0, 0, 0, .08); font: inherit; font-size: 12px; }
.cal-filtres button.cal-bon[aria-pressed="false"] { opacity: .35; text-decoration: line-through; }
#livraisons-calendrier:focus { outline: none; }
.cal-bon { display: inline-block; font-size: 11.5px; line-height: 1.3; border-radius: 4px; padding: 1px 6px; white-space: nowrap; }
.liv-conforme { background: #e3f1e4; color: #1f6b25; }
.liv-site { background: #fdebd3; color: #9a4f00; }
.liv-fournisseur { background: #fbe3e1; color: #a1221b; }
.liv-permanente { background: #ede7f6; color: #5b3d99; }
.liv-inconnue { background: #eceff3; color: #4b5563; }
.liv-sans_calendrier { background: #f3e8f8; color: #7a2f93; }
.cal-legende-prevu { display: inline-block; background: #dbe9fb; border: 1px solid #b9d2f3; border-radius: 4px; padding: 1px 6px; font-size: 12px; }
.frise-defil { overflow: auto; max-height: 68vh; border: 1px solid var(--bordure, #e3e7ee); border-radius: 8px; background: var(--surface, #fff); }
.carte-plein-ecran .frise-defil { max-height: none; }
table.frise-livraisons { width: max-content; border-collapse: separate; border-spacing: 0; font-size: 12px; }
.frise-livraisons th, .frise-livraisons td { border-bottom: 1px solid #edf0f4; padding: 0; }
.frise-livraisons thead th { position: sticky; top: 0; z-index: 2; background: var(--surface, #fff); }
.frise-livraisons thead tr + tr th { top: 24px; border-bottom: 1px solid var(--bordure, #e3e7ee); }
.frise-livraisons .frise-mois-titre { height: 24px; padding: 3px 8px; text-align: left; font-weight: 700; border-left: 2px solid #9aa4b2; white-space: nowrap; }
.frise-livraisons .frise-nom { position: sticky; left: 0; z-index: 1; background: var(--surface, #fff); text-align: left; width: 230px; min-width: 230px; max-width: 230px; padding: 4px 10px; border-right: 1px solid var(--bordure, #e3e7ee); vertical-align: middle; }
.frise-livraisons thead .frise-nom { z-index: 3; vertical-align: bottom; }
.frise-livraisons tbody .frise-nom { text-transform: none; letter-spacing: 0; color: inherit; font-size: 12.5px; white-space: normal; }
.frise-livraisons th.fj, .frise-livraisons .frise-mois-titre { text-transform: none; letter-spacing: 0; }
.frise-nom .btn-lien { display: block; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-align: left; font-weight: 600; padding: 0; }
.frise-nom small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--texte-discret, #6b7280); font-weight: 400; font-size: 11px; line-height: 1.35; }
.frise-livraisons th.fj { width: 26px; min-width: 26px; text-align: center; font-weight: 600; padding: 2px 0; line-height: 1.15; font-size: 11px; }
.frise-livraisons th.fj span { display: block; font-weight: 400; font-size: 9.5px; color: var(--texte-discret, #6b7280); }
.frise-livraisons td.fj { width: 26px; min-width: 26px; height: 36px; text-align: center; vertical-align: middle; }
.frise-livraisons .fj-we { background-color: #f3f4f7; }
.frise-livraisons .fj-lundi { border-left: 1px solid #d5dae3; }
.frise-livraisons .fj-mois { border-left: 2px solid #9aa4b2; }
.frise-livraisons th.fj-auj { color: var(--bleu, #2563be); box-shadow: inset 0 -3px 0 var(--bleu, #2563be); }
.frise-livraisons td.fc-prevu { background-color: #dbe9fb; }
.frise-livraisons td.fj-we.fc-prevu { background-color: #cfe0f7; }
.frise-livraisons td.fj-choisi { box-shadow: inset 0 0 0 2px var(--navy, #1b2a4a); }
.frise-livraisons tr.frise-choisie th.frise-nom { box-shadow: inset 4px 0 0 var(--bleu, #2563be); background: #f2f7fe; }
.frise-livraisons tr.frise-choisie td { background-image: linear-gradient(rgba(37, 99, 190, .07), rgba(37, 99, 190, .07)); }
.frise-livraisons tbody tr:hover td { background-image: linear-gradient(rgba(27, 42, 74, .04), rgba(27, 42, 74, .04)); }
.fc-bon { position: relative; display: inline-flex; align-items: center; justify-content: center; width: 21px; height: 21px; border: 0; border-radius: 5px; padding: 0; font-size: 11px; font-weight: 700; line-height: 1; cursor: pointer; }
.fc-bon.liv-conforme { background: #3f9a48; color: #fff; }
.fc-bon.liv-site { background: #e8860c; color: #fff; }
.fc-bon.liv-fournisseur { background: #d23a30; color: #fff; }
.fc-bon.liv-permanente { background: #7b5cc2; color: #fff; }
.fc-bon.liv-inconnue { background: #8a94a3; color: #fff; }
.fc-bon.liv-sans_calendrier { background: #a54fc0; color: #fff; }
.fc-bon:hover, .fc-bon:focus-visible { outline: 2px solid var(--navy, #1b2a4a); outline-offset: 1px; }
.fc-bon sup { position: absolute; top: -6px; right: -6px; min-width: 13px; padding: 0 3px; border-radius: 7px; background: var(--navy, #1b2a4a); color: #fff; font-size: 9px; line-height: 13px; }
#livraisons-semaine td.sem-prevu { background: #dbe9fb; }
#livraisons-semaine td.sem-ajout { background: #fbe3e1; color: #a1221b; font-weight: 700; }
#livraisons-semaine td.sem-inutile { color: #9a4f00; font-style: italic; font-weight: 700; }
.cal-detail { margin-top: 14px; padding-top: 10px; border-top: 1px solid var(--bordure, #e3e7ee); }
.cal-detail-titre { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; justify-content: space-between; margin-bottom: 6px; }
.cal-detail-titre h3 { margin: 0; font-size: 15px; }
.titre-graphique { margin: 4px 16px 0; font-size: 13.5px; font-weight: 650; }
#livraisons-evolution .carte-titre { flex-wrap: wrap; gap: 10px; }

/* Onglet Inventaire : composition du stock, saisie du stock complémentaire et des produits finis */
.compo-barre { display: flex; height: 10px; margin: 10px 0 8px; border-radius: 5px; overflow: hidden; background: var(--grille); }
.compo-barre span { display: block; height: 100%; }
.compo-frais { background: #8ab61a; }
.compo-surgeles { background: #2563be; }
.compo-epicerie { background: #d98e04; }
.compo-autres { background: #9aa6bd; }
.compo-legende { list-style: none; margin: 0; padding: 0; display: grid; gap: 3px; font-size: 12px; color: var(--texte-2); }
.compo-legende li { display: flex; align-items: center; gap: 6px; }
.compo-legende li strong { margin-left: auto; color: var(--texte); font-variant-numeric: tabular-nums; }
.compo-legende li .discret { min-width: 72px; text-align: right; font-variant-numeric: tabular-nums; }
.indicateur-composition { grid-row: span 2; }
#inventaire-detail h3 { margin: 18px 0 6px; font-size: 14px; color: var(--navy); }
#inventaire-detail h3:first-child { margin-top: 0; }
.formulaire-ligne { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px 14px; margin: 10px 0; }
.formulaire-ligne label { display: grid; gap: 4px; font-size: 12px; color: var(--texte-2); }
.formulaire-ligne .champ-large { flex: 1 1 340px; }
.formulaire-ligne .champ-large input { width: 100%; }
.champ-court { width: 84px; text-align: right; }
.inventaire-base { margin: 0; font-size: 13px; color: var(--texte-2); }
.inventaire-total { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 20px; margin-top: 18px; padding: 12px 14px; border-radius: 8px; background: var(--bleu-pale); }
.inventaire-total > div:first-child { display: grid; gap: 2px; }
.inventaire-total strong { font-size: 22px; color: var(--navy); font-variant-numeric: tabular-nums; }
.inventaire-total > p { flex-basis: 100%; margin: 0; }
.inv-conversion { display: block; font-size: 11.5px; white-space: nowrap; }
.inv-conversion .champ-mini { width: 52px; font-size: 11.5px; padding: 1px 4px; }
.inv-contenance { display: inline-flex; align-items: center; gap: 6px; }
.inv-apercu { align-self: center; font-size: 13px; }
.inv-apercu .alerte-texte, .inv-conversion .alerte-texte { margin: 0 0 0 6px; font-size: inherit; }
.champ-mini { text-align: right; }

/* ── Gestion des tournants (planning du périmètre, temps par tournant, cessions, référentiel) ── */
.tr-mois { display: inline-flex; align-items: center; gap: 4px; margin: 0 8px; }
.tr-mois .nav-fleche { border: 1px solid var(--bordure); background: var(--surface); border-radius: 6px; padding: 1px 9px; cursor: pointer; font: inherit; }
.tr-mois .nav-fleche:disabled { opacity: .4; cursor: default; }
table.tr-planning { width: max-content; border-collapse: separate; border-spacing: 0; font-size: 12px; }
table.tr-planning th.tr-nom { position: sticky; left: 0; z-index: 2; background: var(--surface); min-width: 210px; max-width: 250px; text-align: left; white-space: normal; text-transform: none; }
table.tr-planning thead th.tr-nom { z-index: 3; }
table.tr-planning th.tr-nom .discret { display: block; font-size: 11px; font-weight: 400; }
table.tr-planning th.tr-nom .btn-lien { padding: 0; font-weight: 650; text-align: left; }
table.tr-planning th.tr-jour { width: 34px; min-width: 34px; text-align: center; padding: 4px 0; font-size: 11px; }
table.tr-planning th.tr-jour span { display: block; font-weight: 400; color: var(--texte-2); font-size: 10px; }
.tr-case { width: 34px; min-width: 34px; height: 30px; text-align: center; font-size: 10.5px; font-weight: 650; padding: 0 1px; border: 1px solid #fff; white-space: nowrap; }
[data-tr-case] { cursor: pointer; }
td.tr-case[data-tr-case]:hover { outline: 2px solid var(--bleu); outline-offset: -2px; }
.tr-we { background: #f1f3f7; }
.tr-ferie { background: #e9ecf2; }
.tr-case.tr-vide { background: #fff4e5; box-shadow: inset 0 -2px 0 #f0a020; }
.tr-ratt { background: #e4e8ef; color: #34445e; }
.tr-abs { color: #7a8599; font-style: italic; font-weight: 500; background: #f7f8fa; }
.tr-partage { font-size: 9px; letter-spacing: -.02em; }
.tr-choisi { outline: 2px solid var(--bleu) !important; outline-offset: -2px; box-shadow: inset 0 0 0 99px rgba(37, 99, 190, .16); }
.tr-c0 { background: #dbeafe; color: #1e3a8a; } .tr-c1 { background: #dcfce7; color: #14532d; } .tr-c2 { background: #fef3c7; color: #78350f; }
.tr-c3 { background: #fce7f3; color: #831843; } .tr-c4 { background: #ede9fe; color: #4c1d95; } .tr-c5 { background: #cffafe; color: #164e63; }
.tr-c6 { background: #ffedd5; color: #7c2d12; } .tr-c7 { background: #e0e7ff; color: #312e81; } .tr-c8 { background: #f5f5d4; color: #4d4d0a; } .tr-c9 { background: #d1fae5; color: #064e3b; }
.tr-legendes { display: flex; flex-wrap: wrap; gap: 4px; margin: 0 0 8px; }
.tr-legende { display: inline-block; padding: 1px 7px; border-radius: 4px; font-size: 11px; font-weight: 650; margin: 0 2px 2px 0; }
.tr-couvert { background: #dcfce7; color: #166534; font-weight: 600; font-size: 9.5px; }
.tr-planning-zone.tr-avec-editeur { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 16px; align-items: start; }
.tr-editeur { position: sticky; top: 130px; }
.tr-editeur .carte-titre { display: flex; flex-wrap: nowrap; justify-content: space-between; align-items: flex-start; gap: 8px; }
.tr-editeur .carte-titre > div { flex: 1 1 auto; min-width: 0; }
.tr-editeur .carte-titre h2 { margin: 0; }
.tr-choix-liste { display: flex; flex-wrap: wrap; gap: 4px; }
.tr-choix { border: 1px solid var(--bordure); background: var(--surface); border-radius: 6px; padding: 4px 8px; font-size: 12px; cursor: pointer; font-family: inherit; }
.tr-choix:hover { border-color: var(--bleu); }
.tr-choix[aria-pressed="true"] { background: var(--bleu); border-color: var(--bleu); color: #fff; box-shadow: 0 0 0 2px rgba(37, 99, 190, .25); }
.tr-champs .tr-choix-liste, .tr-champs .tr-intertitre { grid-column: 1 / -1; }
.tr-champs label.tr-case-a-cocher { grid-column: 1 / -1; }
.tr-pinceau-etat { margin: 0 0 6px; padding: 6px 8px; border-radius: 6px; background: #eef3fc; font-size: 12.5px; }
.tr-pinceau-etat.discret { background: #f6f7fa; }
.tr-planning-zone.tr-avec-editeur .tr-case[data-tr-case] { cursor: crosshair; }
.tr-choix-ratt { font-weight: 650; }
.tr-intertitre { font-size: 11px; font-weight: 650; text-transform: uppercase; letter-spacing: .03em; color: var(--texte-2); margin: 10px 0 4px; }
.tr-champs { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 10px; }
.tr-champs label { display: flex; flex-direction: column; font-size: 12px; gap: 3px; }
.tr-champs .tr-commentaire { grid-column: 1 / -1; }
label.tr-case-a-cocher { flex-direction: row; align-items: center; gap: 6px; }
.tr-temps-zone { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(320px, 1fr); gap: 16px; align-items: start; }
table.tr-jours tr[data-tr-case] { cursor: pointer; }
table.tr-jours tr[data-tr-case]:hover td { background: #eef3fc; }
table.tr-jours tr.tr-choisi td { background: rgba(37, 99, 190, .14); }
table.tr-jours tr.tr-we td { color: var(--texte-2); background: #f6f7fa; }
table.tr-jours tr.tr-vide td { background: #fffaf2; }
table.tr-jours tr.tr-vide td:first-child { box-shadow: inset 3px 0 0 #f0a020; }
.tr-fiche-ligne { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; align-items: center; }
.tr-fiche-ligne h2 { margin: 0 0 2px; }
.tr-perimetre { max-width: 60%; }
.tr-fiche-form { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px; }
.tr-fiche-form label { display: flex; flex-direction: column; font-size: 12px; gap: 3px; }
table.tr-matrice th, table.tr-matrice td { font-size: 11.5px; }
.tr-cellule-ratt { background: #f6fbe8; }
.tr-ligne-choisie th.tr-nom { box-shadow: inset 3px 0 0 var(--bleu); }
@media (max-width: 1100px) { .tr-planning-zone.tr-avec-editeur, .tr-temps-zone { grid-template-columns: 1fr; } .tr-editeur { position: static; } }

/* ── Fiches techniques (Production) ── */
/* Niveaux d'allergènes (C contient, T traces, ? non démontré, A absent vérifié), signes de qualité (EGalim, durable hors EGalim,
   à qualifier), sources Adoria, groupes de regroupement, lignes dépliées des listes */
:root {
  --egalim: #3f6b0c;
  --egalim-fond: #ecf5dc;
  --egalim-bord: #c9e29a;
  --alg-inconnu-fond: #eef1f5;
  --alg-inconnu: #4a5361;
  --derogation: #8f1b12;
  --derogation-fond: #fbe4e1;
}
/* Sources Adoria : une ligne de pastilles compactes (nom, état, précision), bord coloré selon l'état */
.fiches-sources { flex-basis: 100%; display: flex; flex-wrap: wrap; gap: 6px 8px; margin: 0; padding: 0; list-style: none; }
.fiches-source { display: inline-flex; flex-wrap: wrap; align-items: baseline; gap: 2px 6px; padding: 4px 10px; border-radius: 6px; border: 1px solid var(--bordure); border-left: 4px solid var(--attenue); background: var(--surface); font-size: 12px; min-width: 0; max-width: 100%; }
.fiches-source strong { font-size: 12px; color: var(--navy); }
.fiches-source-plus { color: var(--texte-3); font-size: 11.5px; }
.fiches-source-plus::before { content: "· "; }
.fiches-source-ok { border-left-color: var(--ok); }
.fiches-source-ok > span:first-of-type { color: var(--ok); }
.fiches-source-attente { border-left-color: var(--alerte); background: var(--alerte-fond); }
.fiches-source-attente > span:first-of-type { color: var(--alerte); font-weight: 600; }
.fiches-source-erreur { border-left-color: var(--danger); background: var(--danger-fond); }
.fiches-source-erreur > span:first-of-type { color: var(--danger); font-weight: 600; }
.fiches-source-vide > span:first-of-type { color: var(--texte-3); }
.fiches-avertissements, .fiches-volets-ligne { flex-basis: 100%; }
.fiches-volets-ligne { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; }
/* Volets : nombre à traiter en pastille */
.volet-compte { display: inline-block; min-width: 18px; margin-left: 4px; padding: 0 5px; border-radius: 9px; background: var(--danger-fond); color: var(--danger); font-size: 11px; font-weight: 700; line-height: 17px; text-align: center; font-variant-numeric: tabular-nums; }
.segments button[aria-pressed="true"] .volet-compte { background: #fff; }
.fiches-filtres { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; margin-bottom: 8px; }
.fiches-filtres select { max-width: 170px; }
.fiches-filtres .combo-saisie { width: 170px; }
.fiches-filtres .champ-statut-fiches .combo-saisie { width: 215px; }
.fiches-filtres input[type="search"] { width: 190px; max-width: 100%; }
.fiches-alg-absents { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; margin: 6px 0 0; font-size: 12.5px; color: var(--texte-2); }
.fiches-filtres-secondaires { flex-basis: 100%; margin: 0; padding-top: 8px; border-top: 1px dashed var(--grille); }
.fiches-filtres-secondaires[hidden] { display: none; }
#vue-fiches button.fiches-plus-filtres:not(.btn) { font-weight: 600; }
/* Filtres posés : nombre de fiches, une pastille par filtre (× la retire), « Effacer les filtres » */
.fiches-actifs { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin: 0 0 10px; font-size: 12.5px; }
.fiches-resultat { font-weight: 650; color: var(--navy); }
.fiches-pastilles { display: inline-flex; flex-wrap: wrap; gap: 6px; margin: 0; padding: 0; list-style: none; }
.fiches-pastilles li { display: inline-flex; }
.pastille-filtre { display: inline-flex; align-items: center; gap: 6px; padding: 2px 4px 2px 10px; border: 1px solid #c9daf3; border-radius: 12px; background: var(--bleu-pale); color: var(--bleu-fonce); font: inherit; font-size: 12px; cursor: pointer; }
.pastille-filtre:hover, .pastille-filtre:focus-visible { border-color: var(--bleu); }
.pastille-filtre-x { display: inline-block; width: 16px; height: 16px; border-radius: 50%; line-height: 16px; text-align: center; font-weight: 700; }
.pastille-filtre:hover .pastille-filtre-x { background: var(--bleu); color: #fff; }
.segments button[aria-pressed="true"] .discret { color: inherit; opacity: .85; }
/* Décisions : validation ou refus en lot des décisions sélectionnées */
.fiches-lot { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin: 0 0 10px; padding: 8px 12px; border: 1px solid var(--grille); border-radius: 6px; background: var(--surface); font-size: 12.5px; }
.fiches-lot label { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; color: var(--texte-2); }
.fiches-lot input[type="checkbox"], #fiches-table-decisions .colonne-choix input { min-height: 0; margin: 0; }
#fiches-table-decisions .colonne-choix { width: 32px; text-align: center; }
.fiches-sous-tete { display: flex; justify-content: flex-start; }
.champ-case-fiches input { min-height: 0; }
/* Cellules d'allergène : lettre du niveau proposé */
.alg { text-align: center; font-weight: 700; font-size: 12px; font-variant-numeric: tabular-nums; }
td.alg { padding: 6px 4px; min-width: 30px; }
span.alg { display: inline-block; min-width: 20px; padding: 0 4px; border-radius: 4px; line-height: 18px; }
th.alg-entete { text-align: center; padding: 8px 4px; font-size: 10px; letter-spacing: 0; }
.alg-c { background: var(--danger-fond); color: var(--danger); }
.alg-t { background: var(--alerte-fond); color: var(--alerte); }
.alg-i { background: var(--alg-inconnu-fond); color: var(--alg-inconnu); }
.alg-a { background: var(--ok-fond); color: var(--ok); }
.alg-ecart { box-shadow: inset 0 0 0 2px var(--danger); }
.alg-probable { outline: 2px dashed var(--alerte); outline-offset: -3px; }
.alg-contredit { box-shadow: inset 0 0 0 2px var(--danger); text-decoration: underline wavy var(--danger); }
tr.alg-ligne-ecart td:first-child { box-shadow: inset 3px 0 0 var(--danger); }
.alg-ecart-texte { color: var(--danger); font-weight: 600; }
.fiches-legende { margin: 10px 0 0; font-size: 12px; color: var(--texte-2); line-height: 1.8; }
/* Gravité, statuts, décisions */
.gravite-critique { background: var(--danger-fond); color: var(--danger); }
.gravite-majeure { background: var(--alerte-fond); color: var(--alerte); }
.gravite-mineure { background: var(--bleu-pale); color: var(--bleu-fonce); }
.gravite-info { background: var(--grille); color: var(--texte-2); }
.statut-alg-non_conforme { background: var(--danger-fond); color: var(--danger); }
.statut-alg-a_completer { background: var(--alerte-fond); color: var(--alerte); }
.statut-alg-conforme { background: var(--ok-fond); color: var(--ok); }
.statut-ob-obsolete { background: var(--danger-fond); color: var(--danger); }
.statut-ob-a_revoir { background: var(--alerte-fond); color: var(--alerte); }
.statut-ob-saine { background: var(--ok-fond); color: var(--ok); }
.decision-proposee { background: var(--alerte-fond); color: var(--alerte); }
.decision-validee { background: var(--bleu-pale); color: var(--bleu-fonce); }
.decision-constatee { background: var(--ok-fond); color: var(--ok); }
.decision-refusee, .decision-annulee { background: var(--grille); color: var(--texte-3); }
.badge-derogation { background: var(--derogation-fond); color: var(--derogation); border: 1px solid var(--derogation); }
.badge.manque { font-weight: 600; }
/* Signes de qualité */
.signe { font-weight: 600; }
.signe-egalim { background: var(--egalim-fond); color: var(--egalim); border: 1px solid var(--egalim-bord); }
.signe-durable { background: var(--bleu-pale); color: var(--bleu-fonce); border: 1px solid #c9daf3; }
.signe-aqualifier { background: var(--surface); color: var(--alerte); border: 1px dashed var(--alerte); }
.niveau-total { background: var(--egalim-fond); color: var(--egalim); }
.niveau-mixte { background: var(--alerte-fond); color: var(--alerte); }
.role-garder_signe { background: var(--egalim-fond); color: var(--egalim); }
.role-garder_standard { background: var(--bleu-pale); color: var(--bleu-fonce); }
.role-a_examiner { background: var(--alerte-fond); color: var(--alerte); }
/* Listes : lignes cliquables, ligne choisie, lignes dépliées */
.table-fiches td, .table-fiches th { padding: 6px 8px; }
tr.fiches-ligne { cursor: pointer; }
tr.fiches-ligne-choisie td { background: var(--bleu-pale); }
tr.fiches-ligne:focus { outline: none; }
tr.fiches-ligne:focus-visible td { box-shadow: inset 0 2px 0 var(--bleu), inset 0 -2px 0 var(--bleu); }
/* Détail : fiche précédente / suivante de la liste ; carte focalisée (raccourcis clavier) sans contour */
#fiches-detail:focus { outline: none; }
.fiches-detail-nav { display: inline-flex; align-items: center; gap: 8px; margin-right: 8px; }
.fiches-detail-nav .discret { font-variant-numeric: tabular-nums; white-space: nowrap; }
#vue-fiches button.btn-lien:not(.btn) { padding: 0; border: 0; background: none; color: var(--bleu); cursor: pointer; font: inherit; text-align: left; }
#vue-fiches button.btn-lien:not(.btn):hover { text-decoration: underline; }
.fiches-code { font-weight: 650; white-space: nowrap; }
.fiches-nom { min-width: 180px; max-width: 320px; white-space: normal; }
td.fiches-criteres { min-width: 220px; white-space: normal; }
.critere { display: inline-block; margin: 1px 2px 1px 0; padding: 0 6px; border-radius: 9px; font-size: 11px; font-weight: 600; background: var(--alerte-fond); color: var(--alerte); white-space: nowrap; }
.critere-non-evalue { background: var(--grille); color: var(--texte-3); font-weight: 500; font-style: italic; }
.critere-non-evalue-ligne { color: var(--texte-3); }
tr.ligne-detail > td { background: #fafbfc; padding: 10px 14px 14px; white-space: normal; }
.table-figee tbody tr.ligne-detail > td:first-child { position: static; box-shadow: none; }
tr.ligne-detail:hover { background: none; }
.fiches-deplie h3 { margin: 10px 0 6px; font-size: 13px; }
.fiches-deplie-colonnes { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 24px; }
.fiches-liste-courte { margin: 4px 0; padding-left: 18px; font-size: 12.5px; }
.fiches-liste-courte li { margin: 2px 0; }
.fiches-sous-table { font-size: 12px; }
.fiches-sous-table th, .fiches-sous-table td { padding: 5px 8px; }
/* Sous-tableau d'une ligne dépliée dans un tableau figé : ni en-tête ni première colonne collants */
.table-figee .fiches-sous-table thead, .table-figee .fiches-sous-table thead th:first-child, .table-figee .fiches-sous-table tbody td:first-child { position: static; box-shadow: none; }
.table-figee .fiches-sous-table tbody td:first-child { background: transparent; }
.fiches-motif { min-width: 220px; min-height: 30px; padding: 4px 8px; font-size: 12px; }
.fiches-ecarter, .fiches-actions-ligne { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.fiches-actions-ligne .btn { padding: 4px 10px; }
.fiches-motif-texte { min-width: 200px; max-width: 360px; white-space: normal; }
.fiches-motif-texte small { display: block; }
tr.fiches-ecartee td { color: var(--texte-3); }
td.fiches-retard { color: var(--danger); font-weight: 700; }
.fiches-pagination { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 8px 12px; margin-top: 10px; }
.fiches-aller input { width: 76px; min-height: 0; padding: 4px 6px; }
/* Tuiles de l'onglet : 5 puis 4 sur grand écran (9 tuiles), 2 colonnes (dernière en pleine largeur), puis 1 */
/* Tuiles cliquables (liste qu'elles comptent), resserrées ; tuile de la liste affichée surlignée */
#fiches-indicateurs { grid-template-columns: repeat(20, minmax(0, 1fr)); gap: 10px; }
#fiches-indicateurs > * { grid-column: span 4; }
#fiches-indicateurs > :nth-child(n+6) { grid-column: span 5; }
#fiches-indicateurs .indicateur { padding: 10px 14px; }
#fiches-indicateurs .indicateur-valeur { font-size: 22px; margin-top: 2px; }
#fiches-indicateurs .indicateur.principal .indicateur-valeur { font-size: 24px; }
#fiches-indicateurs .tuile-lien[aria-current="true"] > .indicateur { border-color: var(--bleu); box-shadow: inset 0 3px 0 var(--bleu); }
#fiches-indicateurs .tuile-lien:focus { outline: none; }
#fiches-indicateurs .tuile-lien:focus-visible > .indicateur { outline: 2px solid var(--bleu); outline-offset: 1px; }
@media (max-width: 1100px) {
  #fiches-indicateurs { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  #fiches-indicateurs > *, #fiches-indicateurs > :nth-child(n+6) { grid-column: auto; }
  #fiches-indicateurs > :last-child:nth-child(odd) { grid-column: 1 / -1; }
}
@media (max-width: 560px) { #fiches-indicateurs { grid-template-columns: minmax(0, 1fr); } }
/* Identité d'une fiche : nom d'abord, puis « GTIN · étiquette Adoria » en petit (jamais le GTIN seul) */
.fiche-ident { display: inline-flex; flex-direction: column; align-items: flex-start; gap: 1px; min-width: 0; max-width: 100%; vertical-align: top; }
.fiche-ident-nom { font-weight: 600; white-space: normal; overflow-wrap: anywhere; }
#vue-fiches button.fiche-ident-nom:not(.btn) { font-weight: 600; }
.fiche-ident-code { font-size: 11px; font-weight: 400; color: var(--texte-3); font-variant-numeric: tabular-nums; white-space: normal; }
/* Dans un texte ou une liste : nom et « GTIN · étiquette » sur la même ligne */
p > .fiche-ident, li > .fiche-ident { display: inline; }
p > .fiche-ident > .fiche-ident-code, li > .fiche-ident > .fiche-ident-code { margin-left: 6px; }
.fiche-etiquette { display: inline-block; padding: 0 5px; border-radius: 4px; background: var(--grille); color: var(--texte-2); font-size: 10.5px; font-weight: 600; white-space: nowrap; }
/* Tri fait par le serveur (toute la liste filtrée) : en-tête souligné en pointillé, flèche du sens */
th.tri-serveur .btn-tri { padding: 0; border: 0; background: none; font: inherit; color: inherit; text-transform: inherit; letter-spacing: inherit; cursor: pointer; text-decoration: underline dotted; text-underline-offset: 3px; }
th.tri-serveur .btn-tri:hover, th.tri-serveur .btn-tri:focus-visible { text-decoration: underline; }
th.tri-serveur[aria-sort="ascending"] .btn-tri::after { content: " ↑"; }
th.tri-serveur[aria-sort="descending"] .btn-tri::after { content: " ↓"; }
/* Complétude (10 points) */
.badge.completude { font-variant-numeric: tabular-nums; }
.completude-ok { background: var(--ok-fond); color: var(--ok); }
.completude-moyenne { background: var(--alerte-fond); color: var(--alerte); }
.completude-faible { background: var(--danger-fond); color: var(--danger); }
.completude-points { display: flex; flex-wrap: wrap; gap: 6px; margin: 4px 0 0; padding: 0; list-style: none; }
.completude-point { display: inline-flex; align-items: center; gap: 4px; padding: 2px 9px; border-radius: 10px; border: 1px solid var(--bordure); font-size: 12px; font-weight: 600; }
.completude-point-ok { background: var(--ok-fond); color: var(--ok); border-color: #c4e2c5; }
.completude-point-ko { background: var(--danger-fond); color: var(--danger); }
.completude-point-inconnu { background: var(--grille); color: var(--texte-3); font-style: italic; }
/* Fiche remplaçante : recherche par nom, GTIN ou étiquette, résultats cliquables */
.fiches-pivot-choix { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin: 0 0 8px; }
.fiches-pivot-recherche { margin-bottom: 6px; }
.fiches-pivot-liste { display: grid; gap: 4px; max-height: 300px; overflow-y: auto; margin: 4px 0 0; padding: 0; list-style: none; }
.fiches-pivot-liste li { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 8px; }
.fiches-pivot-liste .btn { padding: 2px 4px; }
.fiches-pivot-option[aria-pressed="true"] { font-weight: 700; text-decoration: underline; }
.fiches-pivot-option:focus-visible { outline: 2px solid var(--bleu); outline-offset: 1px; }
/* Libellés en double : variante (étiquette Adoria différente de la fiche à garder), à examiner, jamais remplacée d'office */
.fiches-sous-table tr.fiches-variante > td { background: var(--alerte-fond); }
/* Regroupements */
.fiches-bilan-table th[scope="row"] { text-transform: none; letter-spacing: 0; font-size: 13px; color: var(--texte); background: none; font-weight: 600; }
.fiches-ponderation { margin: 10px 0 0; }
.fiches-groupe { border: 1px solid var(--bordure); border-radius: var(--rayon); margin: 0 0 8px; background: var(--surface); }
.fiches-groupe > summary { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; margin: 0; padding: 10px 14px; list-style-position: inside; }
.fiches-groupe[open] > summary { border-bottom: 1px solid var(--grille); }
.fiches-groupe-titre { font-weight: 650; color: var(--navy); }
.fiches-groupe-resume { font-weight: 400; font-size: 12px; color: var(--texte-2); }
.fiches-groupe-corps { padding: 8px 14px 12px; }
.fiches-groupe-corps h3 { margin: 12px 0 4px; font-size: 13px; }
.type-groupe-doublon { background: var(--danger-fond); color: var(--danger); }
.type-groupe-variante { background: var(--alerte-fond); color: var(--alerte); }
.type-groupe-voisine { background: var(--bleu-pale); color: var(--bleu-fonce); }
.fiches-exclus { margin: 4px 0; padding-left: 18px; font-size: 12.5px; }
.fiches-exclus li { margin: 3px 0; }
/* Détail d'une fiche */
.fiches-detail-corps { display: flex; flex-direction: column; gap: 14px; }
.fiches-detail-section h3 { margin: 0 0 6px; font-size: 14px; color: var(--navy); }
.fiches-detail-section > p { margin: 4px 0; }
.fiches-detail-grille { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 24px; }
.fiches-resume { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 8px 16px; margin: 0; }
.fiches-resume > div { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.fiches-resume dt { font-size: 11px; font-weight: 650; text-transform: uppercase; letter-spacing: .03em; color: var(--texte-3); }
.fiches-resume dd { margin: 0; font-size: 13px; }
.fiches-sources-alg { margin: 0; padding-left: 16px; font-size: 12px; }
#fiches-table-composition td small { display: block; }
.fiches-form { border-top: 1px solid var(--grille); padding-top: 12px; }
.fiches-form fieldset { border: 1px solid var(--bordure); border-radius: 6px; margin: 0 0 10px; padding: 8px 12px; }
.fiches-form fieldset:disabled { opacity: .55; }
.fiches-form legend { font-size: 12px; font-weight: 650; color: var(--texte-2); padding: 0 4px; }
.fiches-choix label, .fiches-cases label { display: inline-flex; align-items: center; gap: 5px; margin: 2px 14px 2px 0; font-size: 13px; }
.fiches-choix input, .fiches-cases input { min-height: 0; }
.fiches-avertissement p:first-child { margin-top: 0; }
@media (max-width: 1100px) {
  .fiches-sources { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .fiches-detail-grille, .fiches-deplie-colonnes { grid-template-columns: minmax(0, 1fr); }
  .fiches-nom { min-width: 140px; }
}
@media (max-width: 560px) {
  .fiches-sources { grid-template-columns: minmax(0, 1fr); }
  .fiches-filtres { flex-direction: column; align-items: stretch; }
  .fiches-filtres .champ-inline { justify-content: space-between; }
  .fiches-filtres select, .fiches-filtres input[type="search"] { max-width: none; flex: 1 1 auto; }
  .fiches-motif { min-width: 0; width: 100%; }
  .fiches-volets button { flex: 1 1 45%; }
  .fiches-resume { grid-template-columns: minmax(0, 1fr); }
}
/* Module EVP : formulaire de demande, refus, réglages */
.evp-form { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 10px; }
.evp-form label { display: flex; flex-direction: column; font-size: 12px; gap: 3px; }
.evp-form .evp-commentaire { grid-column: span 2; }
.evp-actions { white-space: nowrap; }
.evp-actions .btn { padding: 3px 8px; font-size: 12px; margin-right: 4px; }
.evp-refus { display: flex; gap: 4px; margin-top: 4px; }
.evp-refus input { min-width: 160px; }
.evp-reglages { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; align-items: start; }
@media (max-width: 900px) { .evp-reglages { grid-template-columns: 1fr; } }
.badge-refus { background: #f3f4f6; color: #6b7280; }
/* Saisie guidée des heures supplémentaires : site → salariés → jours → heures */
.evp-etapes { display: grid; grid-template-columns: minmax(180px, .8fr) minmax(260px, 1.4fr) minmax(250px, 1fr) minmax(250px, 1fr); gap: 16px; align-items: start; }
.evp-etape h3 { font-size: 13px; margin: 0 0 8px; display: flex; align-items: center; gap: 6px; }
.evp-num { display: inline-grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; background: var(--bleu); color: #fff; font-size: 11px; }
.evp-etape select, .evp-etape input[type="search"], .evp-autre input { width: 100%; }
.evp-salaries { max-height: 320px; overflow: auto; margin-top: 6px; }
.evp-salarie { display: flex; flex-direction: column; align-items: flex-start; text-align: left; min-width: 150px; }
.evp-salarie span { font-size: 10.5px; color: var(--texte-2); font-weight: 400; }
.evp-salarie[aria-pressed="true"] span { color: rgba(255, 255, 255, .85); }
.evp-autre { display: flex; gap: 6px; margin-top: 8px; }
.evp-cal { display: grid; grid-template-columns: repeat(7, 1fr); gap: 3px; }
.evp-cal-tete { font-size: 10.5px; color: var(--texte-2); text-align: center; font-weight: 650; }
.evp-jour { border: 1px solid var(--bordure); background: var(--surface); border-radius: 6px; padding: 6px 0; font: inherit; font-size: 12.5px; cursor: pointer; position: relative; }
.evp-jour:hover { border-color: var(--bleu); }
.evp-jour.evp-we { background: #f6f7fa; color: var(--texte-2); }
.evp-jour[aria-pressed="true"] { background: var(--bleu); border-color: var(--bleu); color: #fff; }
.evp-jour.evp-deja::after { content: ""; position: absolute; top: 3px; right: 3px; width: 5px; height: 5px; border-radius: 50%; background: #f0a020; }
.evp-heures { width: 72px; }
.evp-champ { display: flex; flex-direction: column; font-size: 12px; gap: 3px; margin-top: 8px; }
.evp-recap { margin-top: 10px; padding: 8px; border-radius: 6px; background: #eef3fc; font-size: 13px; }
.evp-etape .tr-choix-liste + .tr-choix-liste { margin-top: 8px; }
@media (max-width: 1200px) { .evp-etapes { grid-template-columns: 1fr 1fr; } }
@media (max-width: 700px) { .evp-etapes { grid-template-columns: 1fr; } }
.tr-couv-clic { cursor: pointer; }
.tr-couv-clic:hover { outline: 2px solid var(--bleu); outline-offset: -2px; }
.tr-couv-choix { margin-bottom: 10px; padding: 8px; border-radius: 6px; background: #f6fbe8; }
.evp-nature { margin-bottom: 12px; }
.evp-jour.evp-ferie { box-shadow: inset 0 -3px 0 #8ab61a; font-weight: 650; }
.evp-jour:disabled { opacity: .35; cursor: not-allowed; }

/* ── Planning des sites : heures sur site, cessions (grisées), salariés reçus, absences, heures sup. */
.ps-planning td.tr-case[data-action] { cursor: pointer; }
.ps-planning td.tr-case[data-action]:hover { outline: 2px solid var(--bleu); outline-offset: -2px; }
.tr-case.ps-travail { background: var(--bleu-pale); color: var(--navy); }
.tr-case.ps-cycle { background: var(--bleu-pale); color: var(--texte-2); font-style: italic; font-weight: 500; }
.tr-case.ps-recu { background: var(--ok-fond); color: var(--ok); }
.ps-planning .ps-sem { background: var(--fond); font-weight: 600; }
.ps-semaines td { border-left: 2px solid var(--bord, #d5dbe5); }
.ps-site-courant { font-weight: 600; margin: 0 8px; }
.tr-case.ps-alerte { box-shadow: inset 0 0 0 2px var(--danger); }
.ps-alerte-puce { color: var(--danger); }
.tr-case.ps-interim { background: #efe9fb; color: #6d3fc0; }
.tr-case.ps-cede { background: #eceef2; color: var(--texte-3); font-weight: 500; font-size: 9.5px; }
.tr-case.ps-absence { background: var(--alerte-fond); color: var(--alerte); }
.tr-case.ps-repos { color: var(--texte-3); font-weight: 500; }
.tr-case.ps-hors { color: var(--attenue); }
.tr-case.ps-ailleurs { background: repeating-linear-gradient(45deg, #fff, #fff 3px, #f1f3f7 3px, #f1f3f7 6px); }
.tr-case.ps-stock { background: var(--danger-fond); color: var(--danger); }
.tr-case.ps-choisi { outline: 2px solid var(--vert); outline-offset: -2px; box-shadow: inset 0 0 0 30px rgba(138, 182, 26, .18); }
.ps-hs { color: var(--danger); font-size: 8.5px; margin-left: 1px; }
.ps-groupe th { background: var(--fond); text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: .04em; color: var(--texte-2); }
td.ps-ok { color: var(--ok); }
td.ps-ecart { color: var(--danger); font-weight: 650; }
table.ps-heures th[scope="row"] { position: sticky; left: 0; background: var(--surface); text-align: left; white-space: nowrap; min-width: 190px; }
table.ps-heures td.nombre { min-width: 38px; font-size: 11px; }
table.ps-cycles td.nombre { min-width: 42px; }
#psites-heures .graphique { height: 260px; margin-bottom: 12px; }

/* Planning du périmètre des tournants : jours du planning sans affectation, coût du jour, palette en plein écran */
.tr-case.tr-prevu { color: var(--texte-3); font-weight: 500; font-style: italic; }
.tr-cout-jour { font-size: 10px; color: var(--texte-2); }
.tr-planning-zone:has(#tplanning-grille.carte-plein-ecran) #tplanning-grille.carte-plein-ecran { right: 350px; }
.tr-planning-zone:has(#tplanning-grille.carte-plein-ecran) #tr-editeur { position: fixed; top: calc(var(--haut-filtres, 0px) + 8px); right: 10px; bottom: 10px; width: 330px; z-index: 81; overflow: auto; box-shadow: 0 10px 40px rgba(15, 32, 64, .35); }

/* ── Assistant RH « Vita RH » (chatbot) ── */
.vita-chat { display: flex; flex-direction: column; overflow: hidden; padding: 0; }
.vita-tete { display: flex; align-items: center; gap: 12px; padding: 14px 18px; background: linear-gradient(120deg, var(--navy) 0%, var(--navy-2) 60%, var(--bleu-fonce) 100%); color: #fff; }
.vita-tete h2 { margin: 0; font-size: 17px; color: #fff; }
.vita-tete p { margin: 2px 0 0; font-size: 12.5px; color: rgba(255, 255, 255, .82); display: flex; align-items: center; gap: 6px; }
.vita-identite { flex: 1; min-width: 0; }
.vita-point { width: 8px; height: 8px; border-radius: 50%; background: var(--vert); box-shadow: 0 0 0 3px rgba(138, 182, 26, .25); flex: none; }
.vita-point-off { background: var(--attenue); box-shadow: none; }
.vita-nouvelle { background: rgba(255, 255, 255, .12); color: #fff; border-color: rgba(255, 255, 255, .35); }
.vita-nouvelle:hover { background: rgba(255, 255, 255, .22); }
.vita-avatar { width: 38px; height: 38px; flex: none; }
.vita-avatar svg { width: 100%; height: 100%; display: block; }
.vita-av-fond { fill: var(--vert); }
.vita-av-v { fill: none; stroke: #fff; stroke-width: 3.4; stroke-linecap: round; stroke-linejoin: round; }
.vita-av-point { fill: var(--navy); }
.vita-avatar-petit { width: 30px; height: 30px; margin-top: 2px; }
.vita-avatar-grand { width: 64px; height: 64px; margin: 0 auto 6px; }
.vita-fil { display: flex; flex-direction: column; gap: 14px; padding: 18px; min-height: 340px; max-height: 62vh; overflow-y: auto; background: var(--fond); scroll-behavior: smooth; }
.vita-accueil { text-align: center; width: 100%; max-width: 900px; margin: 8px auto; }
.vita-accueil h3 { margin: 6px 0 4px; font-size: 20px; color: var(--navy); }
.vita-accueil > p { margin: 0 auto 14px; color: var(--texte-2); max-width: 620px; line-height: 1.5; }
.vita-themes { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; text-align: left; }
.vita-theme { display: flex; flex-direction: column; gap: 3px; padding: 12px; border: 1px solid var(--bordure); border-radius: 12px; background: var(--surface); cursor: pointer; font: inherit; color: inherit; transition: border-color .15s, box-shadow .15s, transform .15s; }
.vita-theme:hover, .vita-theme:focus-visible { border-color: var(--bleu); box-shadow: 0 4px 14px rgba(37, 99, 190, .14); transform: translateY(-1px); outline: none; }
.vita-theme-icone { font-size: 20px; }
.vita-theme-titre { font-weight: 600; color: var(--navy); font-size: 13.5px; }
.vita-theme-question { font-size: 12.5px; color: var(--texte-3); line-height: 1.35; }
.vita-msg { display: flex; gap: 10px; align-items: flex-start; }
.vita-moi { justify-content: flex-end; }
.vita-bulle { max-width: 78%; padding: 10px 14px; border-radius: 16px; line-height: 1.5; overflow-wrap: break-word; }
.vita-moi .vita-bulle { background: var(--bleu); color: #fff; border-bottom-right-radius: 4px; }
.vita-reponse { max-width: 82%; display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.vita-ia .vita-bulle { max-width: 100%; background: var(--surface); border: 1px solid var(--bordure); border-top-left-radius: 4px; box-shadow: var(--ombre); }
.vita-ia .vita-bulle p { margin: 0 0 8px; }
.vita-ia .vita-bulle p:last-child, .vita-ia .vita-bulle ul:last-child, .vita-ia .vita-bulle ol:last-child { margin-bottom: 0; }
.vita-ia .vita-bulle ul, .vita-ia .vita-bulle ol { margin: 0 0 8px; padding-left: 20px; }
.vita-ia .vita-bulle li + li { margin-top: 3px; }
.vita-sources { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; font-size: 12px; }
.vita-sources-titre { color: var(--texte-3); text-transform: uppercase; letter-spacing: .04em; font-size: 10.5px; font-weight: 600; }
.vita-source { padding: 2px 9px; border-radius: 999px; background: var(--bleu-pale); color: var(--bleu-fonce); }
.vita-outils { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; }
.vita-outil { border: 0; background: transparent; color: var(--texte-3); font: inherit; font-size: 12px; padding: 2px 6px; border-radius: 6px; cursor: pointer; }
.vita-outil:hover, .vita-outil:focus-visible { background: var(--grille); color: var(--texte); outline: none; }
.vita-merci { font-size: 12px; color: var(--ok); padding: 2px 6px; }
.vita-suites { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 2px; }
.vita-suite { border: 1px solid var(--bleu); background: var(--surface); color: var(--bleu-fonce); border-radius: 999px; padding: 5px 12px; font: inherit; font-size: 12.5px; cursor: pointer; text-align: left; }
.vita-suite:hover, .vita-suite:focus-visible { background: var(--bleu-pale); outline: none; }
.vita-ecrit { display: inline-flex; align-items: center; gap: 10px; color: var(--texte-3); font-style: italic; }
.vita-points { display: inline-flex; gap: 4px; }
.vita-points i { width: 7px; height: 7px; border-radius: 50%; background: var(--bleu); opacity: .35; animation: vita-point 1.2s infinite ease-in-out; }
.vita-points i:nth-child(2) { animation-delay: .2s; }
.vita-points i:nth-child(3) { animation-delay: .4s; }
@keyframes vita-point { 0%, 80%, 100% { opacity: .25; transform: translateY(0); } 40% { opacity: 1; transform: translateY(-3px); } }
.vita-apparait { opacity: 0; animation: vita-apparait .45s ease-out forwards; }
@keyframes vita-apparait { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
.vita-d1 { animation-delay: .05s; } .vita-d2 { animation-delay: .35s; } .vita-d3 { animation-delay: .65s; } .vita-d4 { animation-delay: .95s; }
.vita-d5 { animation-delay: 1.25s; } .vita-d6 { animation-delay: 1.55s; } .vita-d7 { animation-delay: 1.85s; } .vita-d8 { animation-delay: 2.15s; }
.vita-d9 { animation-delay: 2.45s; } .vita-d10 { animation-delay: 2.75s; } .vita-d11 { animation-delay: 3.05s; } .vita-d12 { animation-delay: 3.35s; }
@media (prefers-reduced-motion: reduce) { .vita-apparait { animation: none; opacity: 1; } .vita-points i { animation: none; opacity: .7; } .vita-theme { transition: none; } }
.vita-saisie { display: flex; gap: 8px; align-items: flex-end; margin: 12px 18px 0; padding: 6px 6px 6px 14px; border: 1px solid var(--bordure); border-radius: 22px; background: var(--surface); transition: border-color .15s, box-shadow .15s; }
.vita-saisie:focus-within { border-color: var(--bleu); box-shadow: 0 0 0 3px rgba(37, 99, 190, .12); }
.vita-saisie textarea { flex: 1; border: 0; outline: none; resize: none; font: inherit; line-height: 1.45; padding: 6px 0; min-height: 30px; max-height: 180px; background: transparent; }
.vita-envoyer { width: 36px; height: 36px; border-radius: 50%; border: 0; background: var(--bleu); color: #fff; font-size: 15px; cursor: pointer; flex: none; }
.vita-envoyer:hover { background: var(--bleu-fonce); }
.vita-envoyer:disabled { background: var(--attenue); cursor: default; }
.vita-note { margin: 6px 18px 14px; font-size: 11.5px; color: var(--texte-3); text-align: center; }
.vita-gestion .carte-titre { align-items: center; }
.vita-reglage { border: 1px solid var(--bordure); border-radius: var(--rayon); padding: 10px 14px; margin: 10px 0 14px; }
.vita-reglage legend { font-weight: 600; padding: 0 4px; }
.vita-reglage label { display: flex; gap: 8px; align-items: center; margin: 6px 0; font-weight: normal; cursor: pointer; }
.vita-reglage input[type="radio"] { width: 16px; height: 16px; min-height: 0; padding: 0; margin: 0; flex: none; box-shadow: none; }
.vita-reglage p { margin: 6px 0 0; }
@media (max-width: 760px) { .vita-themes { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 640px) { .vita-bulle, .vita-reponse { max-width: 92%; } .vita-fil { padding: 12px; } .vita-avatar-petit { display: none; } }
#assistant-docs .champs-ligne { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; margin: 8px 0; }
#assistant-docs textarea { width: 100%; margin-top: 8px; }
#assistant-docs .barre-actions { margin-top: 8px; }

/* Assistance : bouton flottant de toutes les pages, volet question / signalement / mes demandes */
.assistance-bouton {
  position: fixed; right: 20px; bottom: 20px; z-index: 60; padding: 10px 16px; border: 0; border-radius: 999px;
  background: var(--navy); color: #fff; font-weight: 700; font-size: 14px; cursor: pointer; box-shadow: 0 4px 14px rgba(15, 32, 64, .3);
}
.assistance-bouton:hover, .assistance-bouton[aria-expanded="true"] { background: var(--bleu); }
.assistance-bouton:focus-visible { outline: 3px solid var(--vert); outline-offset: 2px; }
.assistance {
  position: fixed; right: 20px; bottom: 72px; z-index: 61; display: flex; flex-direction: column;
  width: min(420px, calc(100vw - 32px)); height: min(640px, calc(100vh - 96px)); background: var(--surface);
  border: 1px solid var(--bordure); border-top: 4px solid var(--vert); border-radius: 10px; box-shadow: 0 12px 32px rgba(15, 32, 64, .25);
}
.assistance[hidden] { display: none; }
.assistance-entete { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 10px 14px; border-bottom: 1px solid var(--bordure); }
.assistance-entete h2 { margin: 0; font-size: 15px; color: var(--navy); }
.assistance-volets { padding: 8px 14px 0; }
#assistance-corps { flex: 1 1 auto; display: flex; flex-direction: column; gap: 10px; min-height: 0; overflow-y: auto; padding: 10px 14px 14px; }
.assist-fil { display: flex; flex-direction: column; gap: 8px; }
.assist-message { max-width: 92%; padding: 8px 11px; border-radius: 10px; font-size: 13px; line-height: 1.45; }
.assist-message p { margin: 0 0 6px; } .assist-message p:last-child { margin-bottom: 0; }
.assist-message ul { margin: 4px 0; padding-left: 18px; }
.assist-bot { align-self: flex-start; background: var(--fond); color: var(--texte); border-bottom-left-radius: 2px; }
.assist-moi { align-self: flex-end; background: var(--bleu); color: #fff; border-bottom-right-radius: 2px; }
.assist-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.assist-actions .btn { padding: 4px 10px; font-size: 12.5px; }
.assist-saisie { display: flex; gap: 6px; align-items: flex-end; position: sticky; bottom: -14px; margin: 0 -14px -14px; padding: 8px 14px 14px; background: var(--surface); border-top: 1px solid var(--grille); }
.assist-saisie textarea { flex: 1 1 auto; resize: vertical; min-height: 40px; font: inherit; font-size: 13px; padding: 6px 8px; border: 1px solid var(--bordure); border-radius: 6px; }
.assist-effacer { align-self: center; font-size: 12px; }
.assist-formulaire { display: flex; flex-direction: column; gap: 10px; }
.assist-formulaire textarea { font: inherit; font-size: 13px; padding: 6px 8px; border: 1px solid var(--bordure); border-radius: 6px; resize: vertical; }
.assist-gravite { display: flex; flex-wrap: wrap; gap: 4px 14px; margin: 0; padding: 6px 10px; border: 1px solid var(--bordure); border-radius: 6px; font-size: 13px; }
.assist-gravite legend { padding: 0 4px; font-size: 12px; font-weight: 600; color: var(--texte-2); }
.assist-demandes { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.assist-demandes li { padding: 8px 10px; border: 1px solid var(--bordure); border-radius: 6px; font-size: 13px; }
.assist-demandes li > div { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.assist-demandes p { margin: 6px 0 0; }
.assist-reponse { padding: 6px 8px; border-left: 3px solid var(--ok); background: var(--ok-fond); }
.assist-probleme-texte { white-space: pre-wrap; margin: 0 0 10px; }
/* Élément montré par l'assistant ou choisi dans le signalement */
.assistance-repere { outline: 3px solid var(--vert); outline-offset: 3px; animation: assistance-repere 1.2s ease-in-out 3; }
@keyframes assistance-repere { 50% { outline-color: rgba(138, 182, 26, .25); } }
@media (prefers-reduced-motion: reduce) { .assistance-repere { animation: none; } }
@media print { .assistance-bouton, .assistance { display: none !important; } }
@media (max-width: 600px) { .assistance { right: 16px; bottom: 68px; } .assistance-bouton { right: 16px; bottom: 16px; } }
.assistance-entete strong { font-size: 15px; color: var(--navy); }
.assist-formulaire .case { display: flex; gap: 6px; align-items: center; font-size: 13px; }
#assistance-demandes tr.ligne-choisie td { background: var(--bleu-pale); }
/* Aide au planning (onglet paide) */
.champ-bloc { display: flex; flex-direction: column; gap: 4px; font-size: 13px; margin-bottom: 8px; }
.champ-bloc textarea { width: 100%; max-width: 900px; font: inherit; padding: 6px 8px; border: 1px solid var(--grille); border-radius: 6px; }
.ap-jours { white-space: nowrap; }
.ap-jours label { display: inline-flex; flex-direction: column; align-items: center; font-size: 10px; margin-right: 2px; }
.ap-nombre { width: 56px; }
.ap-actions { white-space: nowrap; }
#paide-planning-table tr.ligne-choisie td { background: var(--bleu-pale); }
.ap-motif td.ap-jour { text-align: center; min-width: 78px; font-size: 12px; }
.ap-motif td.ap-R, .ap-motif td.ap-F { color: var(--texte-2); background: var(--grille); }
.ap-motif td.ap-alerte { background: var(--alerte-fond); }
.ap-motif td.ap-grave { background: var(--danger-fond); color: var(--danger); }
.ap-alertes { margin: 8px 0 0; padding-left: 18px; font-size: 13px; }
.ap-couverture th, .ap-couverture td { font-size: 11px; padding: 2px 3px; }
.ap-couverture .ap-cj { text-align: center; min-width: 22px; }
.ap-couverture .ap-lundi { border-left: 2px solid var(--grille); }
.ap-couverture td.ap-ok { background: var(--ok-fond); color: var(--ok); }
.ap-couverture td.ap-manque { background: var(--danger-fond); color: var(--danger); font-weight: 700; }
.ap-couverture td.ap-sans { background: transparent; }
.ap-couverture tr.ap-heures td { color: var(--texte-2); }
.ap-ecart { color: var(--danger); font-weight: 700; }
#paide-planning-table td.ap-code select { width: 190px; min-width: 190px; }
#paide-planning-table select[data-ap="decalage"] { width: 90px; min-width: 90px; }
#paide-planning-table td.ap-code { min-width: 200px; }
#paide-planning-table td, #paide-planning-table th { padding-left: 6px; padding-right: 6px; }
/* Aide au planning : planning proposé du mois (week-ends en vert) */
.ap-mois th, .ap-mois td { font-size: 11px; padding: 3px 4px; text-align: center; border-left: 1px solid var(--grille); }
.ap-mois th.ap-nom, .ap-mois tbody th, .ap-mois tr.ap-total-jour th { text-align: left; white-space: nowrap; min-width: 190px; font-weight: 600; }
.ap-mois .ap-sem { background: var(--navy); color: #fff; }
.ap-mois .ap-we { background: #c9f2c7; }
.ap-mois tr.ap-codes td { font-weight: 700; font-size: 12px; }
.ap-mois tr.ap-codes td.ap-cR, .ap-mois tr.ap-codes td.ap-cF { color: var(--texte-2); font-weight: 500; }
.ap-mois tr.ap-codes { border-top: 2px solid var(--bordure); }
.ap-mois tr.ap-heures-sal td, .ap-mois tr.ap-heures-sal th { color: var(--texte-2); font-weight: 400; }
.ap-mois tr.ap-total-jour td { font-weight: 600; background: var(--bleu-pale); }
.ap-mois tr.ap-total-jour td.ap-we { background: #b4e8b1; }
/* Frise des horaires : blocs de présence et curseurs superposés (deux par bloc) */
.ap-frise { display: flex; flex-direction: column; gap: 6px; overflow-x: auto; }
.ap-ligne-frise { display: grid; grid-template-columns: 240px minmax(560px, 1fr); gap: 12px; align-items: center; border: 1px solid var(--grille); border-radius: 6px; padding: 6px 10px; }
.ap-ligne-frise.ap-axe { border: 0; padding-top: 0; padding-bottom: 0; }
.ap-ligne-besoin { background: var(--bleu-pale); }
.ap-frise-lib { display: flex; gap: 10px; align-items: center; font-size: 12px; }
.ap-numero { display: inline-flex; align-items: center; justify-content: center; min-width: 28px; height: 28px; border-radius: 50%; background: var(--navy); color: #fff; font-weight: 700; font-size: 14px; }
.ap-numero-besoin { background: var(--bleu); }
.ap-piste { position: relative; height: 40px; }
.ap-piste-axe { height: 18px; border-bottom: 1px solid var(--bordure); }
.ap-graduation { position: absolute; bottom: 2px; transform: translateX(-50%); font-size: 10px; color: var(--texte-2); }
.ap-bloc { position: absolute; top: 18px; height: 14px; background: var(--navy); border-radius: 2px; }
.ap-bloc-besoin { background: var(--bleu); opacity: 0.85; }
.ap-bloc-besoin.ap-service-matin { background: #e0a100; }
.ap-bloc-besoin.ap-service-gouter { background: #8ab61a; }
.ap-bloc-besoin.ap-service-soir { background: #6b4fbb; }
.ap-borne { position: absolute; top: -15px; font-size: 10px; white-space: nowrap; color: var(--texte); }
.ap-borne-d { left: 0; transform: translateX(-50%); }
.ap-borne-f { right: 0; transform: translateX(50%); }
.ap-piste input[type="range"] { position: absolute; left: 0; right: 0; top: 14px; width: 100%; height: 22px; margin: 0; padding: 0; min-height: 0; border: 0; background: transparent; pointer-events: none; -webkit-appearance: none; appearance: none; box-shadow: none; }
.ap-piste input[type="range"]::-webkit-slider-runnable-track { background: transparent; border: 0; }
.ap-piste input[type="range"]::-moz-range-track { background: transparent; border: 0; }
.ap-piste input[type="range"]::-webkit-slider-thumb { -webkit-appearance: none; pointer-events: auto; width: 12px; height: 22px; border-radius: 3px; background: #fff; border: 2px solid var(--bleu); cursor: ew-resize; }
.ap-piste input[type="range"]::-moz-range-thumb { pointer-events: auto; width: 10px; height: 20px; border-radius: 3px; background: #fff; border: 2px solid var(--bleu); cursor: ew-resize; }
.ap-piste input[type="range"]:focus-visible::-webkit-slider-thumb { box-shadow: 0 0 0 3px var(--bleu-pale); }
.ap-piste input[type="range"]:disabled::-webkit-slider-thumb { display: none; }
.ap-mois tbody th, .ap-mois tr.ap-total-jour th { text-transform: none; letter-spacing: 0; }
/* Aide au planning : lien avec Nibelis */
.ap-mois td.ap-diff { outline: 2px solid #e08a00; outline-offset: -2px; background: #fff3dc; }
.ap-report { margin: 0 0 12px; padding: 8px 12px; border: 1px solid var(--grille); border-left: 4px solid var(--bleu); border-radius: 6px; background: var(--surface); font-size: 13px; }
.ap-report summary { cursor: pointer; }
.ap-report ol { margin: 8px 0; padding-left: 20px; }
.ap-report li { margin: 3px 0; }
.ap-lien { font-size: 11px; color: var(--bleu-fonce); font-weight: 600; }

/* ── Main courante (Pilotage FDM › Chiffre d'affaires) : en-tête de l'onglet, grille type tableur (en-têtes et colonnes
   d'identification figés, jours en défilement), saisie du jour, contrôles, annexe vivres crus, pièces jointes, référentiel
   des prix, suivi des validations (public/js/main-courante.js) ── */
:root {
  --mc-l1: 76px;   /* outils de ligne (▲▼ 🔒 👁 ✕) */
  --mc-l2: 62px;   /* code article */
  --mc-l3: 160px;  /* libellé de l'article */
  --mc-l4: 176px;  /* libellé complémentaire */
  --mc-jour: 40px;
  --mc-haut: 28px; /* hauteur d'une ligne de la grille */
  --mc-tete: #f4f6fa;
  --mc-section: #eef2f8;
  --mc-we: #f1f3f7;
  --mc-ferie: #e7ebf2;
  --mc-auj: #fff6d6;
  --mc-auj-bord: #e8c25a;
  --mc-sel: rgba(37, 99, 190, .16);
  --mc-saisi: #9a4a00;
  --mc-saisi-fond: #fde8d7;
}
/* En-tête : site, mois, statut global, échéance, chaîne de validation */
.mc-entete { display: flex; flex-direction: column; gap: 4px; padding: 12px 16px; }
.mc-entete-ligne { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; }
.mc-champ-site select, .mc-champ-site .combo { min-width: 300px; }
.mc-mois { display: inline-flex; align-items: center; gap: 6px; }
.mc-mois .nav-fleche, .mc-jour-nav .nav-fleche { border: 1px solid var(--bordure); background: var(--surface); border-radius: 6px; padding: 2px 10px; cursor: pointer; font: inherit; line-height: 1.4; }
.mc-mois .nav-fleche:hover, .mc-jour-nav .nav-fleche:hover { border-color: var(--bleu); color: var(--bleu); }
.mc-jour-nav .nav-fleche:disabled { opacity: .4; cursor: default; }
.mc-mois-libelle { min-width: 128px; text-align: center; font-size: 15px; color: var(--navy); }
.mc-echeance { font-size: 13px; color: var(--texte-2); }
.mc-echeance.mc-retard { color: var(--danger); font-weight: 650; }
.mc-lieu { margin: 0; }
.mc-statut { display: inline-block; padding: 1px 9px; border-radius: 10px; font-size: 11.5px; font-weight: 650; line-height: 18px; white-space: nowrap; }
.mc-statut-aucune { background: var(--grille); color: var(--texte-2); }
.mc-statut-preparation { background: var(--bleu-pale); color: var(--bleu-fonce); }
.mc-statut-proposee { background: var(--alerte-fond); color: var(--alerte); }
.mc-statut-validee_plus1 { background: var(--mission-fond); color: var(--mission); }
.mc-statut-validee { background: var(--ok-fond); color: var(--ok); }
.mc-statut-controlee { background: var(--ok); color: #fff; }
.mc-volets { align-self: flex-start; }
.mc-compte { display: inline-block; min-width: 18px; padding: 0 5px; border-radius: 9px; background: var(--grille); color: var(--texte-2); font-size: 11px; font-weight: 700; line-height: 16px; text-align: center; }
.segments button[aria-pressed="true"] .mc-compte { background: rgba(255, 255, 255, .25); color: #fff; }
.mc-compte.mc-a-bloquant { background: var(--danger); color: #fff; }
.mc-compte.mc-a-alerte { background: var(--alerte-fond); color: var(--alerte); }
.mc-compte.mc-a-info { background: var(--bleu-pale); color: var(--bleu-fonce); }
.mc-indicateurs .indicateur .btn-lien { padding: 4px 0 0; }
.mc-barre { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; }
.mc-barre .espace, .mc-outils-carte .espace { flex: 1; }
.mc-enreg-global.mc-enreg-erreur { color: var(--danger); font-weight: 650; }
.mc-reprise.encart { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; }
.mc-note { margin: 0; }
.mc-raccourcis dl { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 4px 24px; margin: 0 0 8px; }
.mc-raccourcis dl > div { display: grid; grid-template-columns: 200px 1fr; gap: 8px; align-items: baseline; }
.mc-raccourcis dt { font-weight: 650; font-size: 12.5px; color: var(--navy); }
.mc-raccourcis dd { margin: 0; font-size: 12.5px; color: var(--texte-2); }

/* Carte d'une main courante : nom, type, statut, totaux, actions du circuit, état de l'enregistrement */
.mc-carte-titre { align-items: flex-start; padding-bottom: 10px; }
.mc-carte-nom { display: flex; align-items: flex-start; gap: 8px; flex: 1 1 360px; min-width: 0; }
.mc-carte-nom h2 { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.mc-replier { flex: none; width: 28px; height: 28px; border: 1px solid var(--bordure); border-radius: 6px; background: var(--surface); color: var(--texte-2); cursor: pointer; font: inherit; }
.mc-replier:hover { border-color: var(--bleu); color: var(--bleu); }
.mc-carte-totaux { display: flex; flex-direction: column; align-items: flex-end; font-size: 12.5px; color: var(--texte-2); font-variant-numeric: tabular-nums; white-space: nowrap; }
.mc-carte-totaux strong { font-size: 18px; color: var(--navy); }
.mc-enreg { font-weight: 600; }
.mc-enreg-ok { color: var(--ok); }
.mc-enreg-sale, .mc-enreg-encours { color: var(--texte-3); }
.mc-enreg-erreur { color: var(--danger); }
.mc-reessayer { padding: 0 4px; font-size: 12px; }
.mc-encart { margin: 0 16px 10px; }
.mc-motif { margin: 0 16px 10px; padding: 10px 12px; border-radius: 8px; background: var(--alerte-fond); }
.mc-carte-corps { display: flex; flex-direction: column; gap: 10px; padding-top: 4px; }
.mc-outils-carte { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.mc-bascule { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border: 1px solid var(--bordure); border-radius: 6px; background: var(--surface); color: var(--texte-2); cursor: pointer; font: inherit; font-size: 12.5px; }
.mc-bascule:hover { border-color: var(--bleu); color: var(--bleu); }
.mc-bascule[aria-pressed="true"] { background: #eef3fc; border-color: var(--bleu); color: var(--bleu); font-weight: 650; }

/* Grille du mois */
.mc-defil { position: relative; overflow: auto; max-height: calc(100vh - 150px); border: 1px solid var(--bordure); border-radius: 6px; background: var(--surface); }
.carte-plein-ecran .mc-defil { max-height: none; flex: 1; min-height: 0; }
.mc-grille { width: max-content; border-collapse: separate; border-spacing: 0; font-size: 12.5px; }
.mc-grille th, .mc-grille td { height: var(--mc-haut); padding: 0 4px; border-bottom: 1px solid var(--grille); border-right: 1px solid var(--grille); white-space: nowrap; vertical-align: middle; }
.mc-grille thead th { position: sticky; top: 0; z-index: 3; padding: 2px 4px; background-color: var(--mc-tete); text-align: center; font-size: 10.5px; box-shadow: inset 0 -1px 0 var(--bordure); }
.mc-grille .mc-f { position: sticky; z-index: 1; background-color: var(--surface); }
.mc-grille thead .mc-f { z-index: 5; background-color: var(--mc-tete); }
.mc-grille .mc-f1 { left: 0; width: var(--mc-l1); min-width: var(--mc-l1); max-width: var(--mc-l1); }
.mc-grille .mc-f2 { left: var(--mc-l1); width: var(--mc-l2); min-width: var(--mc-l2); max-width: var(--mc-l2); }
.mc-grille .mc-f3 { left: calc(var(--mc-l1) + var(--mc-l2)); width: var(--mc-l3); min-width: var(--mc-l3); max-width: var(--mc-l3); overflow: hidden; text-overflow: ellipsis; }
.mc-grille .mc-f4 { left: calc(var(--mc-l1) + var(--mc-l2) + var(--mc-l3)); width: var(--mc-l4); min-width: var(--mc-l4); max-width: var(--mc-l4); overflow: hidden; text-overflow: ellipsis; box-shadow: inset -2px 0 0 var(--bordure); }
.mc-grille.mc-sans-libelle .mc-f4 { left: calc(var(--mc-l1) + var(--mc-l2)); }
.mc-grille thead .mc-f4 { box-shadow: inset -2px 0 0 var(--bordure), inset 0 -1px 0 var(--bordure); }
.mc-grille .mc-fs { left: 0; text-align: left; white-space: normal; text-transform: none; letter-spacing: 0; font-size: 12px; box-shadow: inset -2px 0 0 var(--bordure); }
.mc-grille .mc-code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 11.5px; color: var(--texte-2); }
.mc-grille .mc-lib { color: var(--texte-2); }
.mc-grille .mc-comp { font-weight: 600; }
.mc-grille .mc-c-tva { width: 42px; min-width: 42px; text-align: right; color: var(--texte-3); }
.mc-grille .mc-c-pu { width: 88px; min-width: 88px; padding: 0 2px; }
.mc-grille .mc-c-ht { width: 84px; min-width: 84px; text-align: right; font-variant-numeric: tabular-nums; }
.mc-grille .mc-c-qte { width: 54px; min-width: 54px; text-align: right; font-weight: 650; }
.mc-grille .mc-c-q { width: 62px; min-width: 62px; text-align: right; color: var(--texte-2); }
.mc-grille .mc-j { width: var(--mc-jour); min-width: var(--mc-jour); max-width: var(--mc-jour); padding: 0; text-align: right; font-variant-numeric: tabular-nums; }
.mc-grille td.mc-j { padding-right: 5px; }
.mc-grille td.mc-j:has(> input) { padding: 0; }
.mc-grille thead .mc-j { line-height: 1.1; padding: 2px 0; }
.mc-grille thead .mc-j span { display: block; font-size: 9.5px; font-weight: 500; color: var(--texte-3); }
/* Jours resserrés (mois entier à l'écran : largeur calculée par main-courante.js, --mc-jour posé sur la zone) */
.mc-grille.mc-serre .mc-j { font-size: 10.5px; }
.mc-grille.mc-serre td.mc-j { padding-right: 2px; }
.mc-grille.mc-serre .mc-j .mc-saisie { padding: 0 2px; }
.mc-grille.mc-serre thead .mc-j span { font-size: 8.5px; }
.mc-grille .mc-we, .mc-jour-table .mc-we { background-color: var(--mc-we); }
.mc-grille .mc-ferie { background-color: var(--mc-ferie); }
.mc-grille thead .mc-ferie span { color: var(--danger); }
.mc-grille .mc-auj { background-color: var(--mc-auj); box-shadow: inset 1px 0 0 var(--mc-auj-bord), inset -1px 0 0 var(--mc-auj-bord); }
.mc-grille thead .mc-auj { color: var(--alerte); }
/* Sections, lignes, pied */
.mc-grille tr.mc-section > th, .mc-grille tr.mc-section > td { height: 26px; background-color: var(--mc-section); border-bottom-color: #d6dfec; color: var(--navy); font-weight: 650; }
.mc-section-nom { font-weight: 700; color: var(--navy); }
.mc-ajouter { padding: 0 6px; font-size: 12px; font-weight: 600; }
.mc-ligne:hover > td { background-color: #f8fafc; }
.mc-ligne:hover > td.mc-we, .mc-ligne:hover > td.mc-ferie { background-color: #eceff4; }
.mc-ligne.mc-verrou > td, .mc-ligne.mc-genere > td { color: var(--texte-3); }
.mc-ligne.mc-verrou > td.mc-f, .mc-ligne.mc-genere > td.mc-f { background-color: #f7f8fa; }
.mc-ligne.mc-genere .mc-comp { font-style: italic; }
.mc-ligne.mc-cachee > td:not(.mc-f1) { opacity: .5; text-decoration: line-through; }
.mc-grille tfoot > tr > * { position: sticky; z-index: 2; background-color: var(--mc-tete); color: var(--navy); font-weight: 700; border-top: 1px solid var(--bordure); }
.mc-grille tfoot tr.mc-total > * { bottom: var(--mc-haut); }
.mc-grille tfoot tr.mc-total-ttc > * { bottom: 0; }
.mc-grille tfoot .mc-f { z-index: 4; }
.mc-grille tfoot th { text-transform: none; letter-spacing: 0; font-size: 12px; text-align: left; }
/* Cases saisissables : sans cadre, cadre bleu sur la case active ; sélection rectangulaire ; case en lecture seule active */
.mc-grille .mc-saisie, .mc-jour-table .mc-saisie { display: block; width: 100%; height: calc(var(--mc-haut) - 1px); min-height: 0; padding: 0 5px; border: 0; border-radius: 0; background: transparent; font: inherit; font-variant-numeric: tabular-nums; text-align: right; color: var(--texte); }
.mc-grille .mc-saisie:focus, .mc-jour-table .mc-saisie:focus { outline: none; border: 0; background: #fff; box-shadow: inset 0 0 0 2px var(--bleu); }
.mc-grille .mc-texte { text-align: left; font-weight: 600; }
.mc-grille td[data-mc-k]:focus, .mc-jour-table td[data-mc-k]:focus { outline: 2px solid var(--bleu); outline-offset: -2px; }
.mc-grille td.mc-sel, .mc-jour-table td.mc-sel { box-shadow: inset 0 0 0 999px var(--mc-sel); }
.mc-grille.mc-lecture td[data-mc-k] { cursor: cell; }
.mc-pu { display: flex; align-items: center; gap: 2px; }
.mc-pu .mc-saisie { flex: 1; min-width: 0; }
.mc-pu .mc-val { flex: 1; text-align: right; padding-right: 3px; font-variant-numeric: tabular-nums; }
/* Pastille de la source du prix : V en vigueur, P proposé, S saisi (proposé à l'enregistrement), L libre, ? sans prix */
.mc-src { flex: none; display: inline-grid; place-items: center; width: 15px; height: 15px; border-radius: 4px; font-size: 9.5px; font-weight: 800; line-height: 1; cursor: help; }
.mc-src-valide { background: var(--ok-fond); color: var(--ok); }
.mc-src-propose { background: var(--alerte-fond); color: var(--alerte); }
.mc-src-saisi { background: var(--mc-saisi-fond); color: var(--mc-saisi); }
.mc-src-libre { background: var(--grille); color: var(--texte-2); }
.mc-src-absent { background: var(--danger-fond); color: var(--danger); }
/* Contrôles marqués sur les cases : coin coloré (alerte, info), fond rouge (bloquant) ; message au survol */
.mc-grille td.mc-a-bloquant, .mc-jour-table td.mc-a-bloquant { background-color: var(--danger-fond); background-image: linear-gradient(225deg, var(--danger) 7px, transparent 7px); }
.mc-grille td.mc-a-alerte, .mc-jour-table td.mc-a-alerte { background-image: linear-gradient(225deg, #d98e04 7px, transparent 7px); }
/* Effectifs proposés par le client, à confirmer : valeur du client présaisie en rouge (Entrée : acceptée ; autre nombre : corrigée) */
.mc-grille td.mc-eff, .mc-jour-table td.mc-eff, .mc-grille td.mc-eff .mc-saisie, .mc-jour-table td.mc-eff .mc-saisie { color: var(--danger); font-weight: 750; }
.mc-grille td.mc-eff, .mc-jour-table td.mc-eff { box-shadow: inset 0 0 0 1px var(--danger); }
.mc-eff-encart { background: var(--danger-fond); border-color: #f4c7c3; color: var(--danger); }
.mc-eff-encart .formulaire-actions { margin-top: 8px; }
.mc-grille td.mc-a-info, .mc-jour-table td.mc-a-info { background-image: linear-gradient(225deg, var(--bleu) 6px, transparent 6px); }
.mc-eclair { animation: mc-eclair 1.6s ease-out; }
@keyframes mc-eclair { 0%, 45% { box-shadow: inset 0 0 0 2px #d98e04; background-color: var(--alerte-fond); } }
/* Outils de ligne : monter / descendre, verrou, masquage, retrait (vide seulement) */
.mc-grille .mc-outils { padding: 0 2px; text-align: left; }
.mc-fleches { display: inline-flex; flex-direction: column; vertical-align: middle; }
.mc-btn-ligne { width: 17px; height: 22px; padding: 0; border: 0; border-radius: 4px; background: none; color: var(--texte-3); cursor: pointer; font-size: 11px; line-height: 1; vertical-align: middle; opacity: .5; }
.mc-fleches .mc-btn-ligne { height: 12px; font-size: 7.5px; }
.mc-ligne:hover .mc-btn-ligne, .mc-ligne:focus-within .mc-btn-ligne, .mc-btn-ligne[aria-pressed="true"] { opacity: 1; }
.mc-btn-ligne:hover { background: var(--bleu-pale); color: var(--bleu); }
.mc-btn-ligne.mc-retirer:hover { background: var(--danger-fond); color: var(--danger); }
.mc-genere-icone { font-size: 11px; opacity: .6; cursor: help; }
/* Ajout d'une ligne (articles du référentiel de la section, ligne libre) */
.mc-ajout { padding: 10px 12px; border: 1px solid #c9daf3; border-radius: 8px; background: var(--bleu-pale); }
.mc-ajout-titre { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 6px; color: var(--navy); }
.mc-ajout-liste { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 8px; padding: 0; list-style: none; }
.mc-choix-ligne { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border: 1px solid var(--bordure); border-radius: 6px; background: var(--surface); cursor: pointer; font: inherit; font-size: 12.5px; }
.mc-choix-ligne:hover, .mc-choix-ligne:focus-visible { border-color: var(--bleu); color: var(--bleu); }

/* Saisie du jour : un jour à la fois, rappel de la veille et de l'habituel */
.mc-jour-nav { position: sticky; top: 0; z-index: 30; display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; padding: 10px 14px; }
.mc-jour-libelle { min-width: 230px; text-align: center; font-size: 15px; color: var(--navy); }
.mc-defil-jour { max-width: 900px; }
.mc-jour-table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 13px; }
.mc-jour-table th, .mc-jour-table td { height: 32px; padding: 2px 8px; border-bottom: 1px solid var(--grille); }
.mc-jour-table thead th { position: sticky; top: 0; z-index: 2; background-color: var(--mc-tete); }
.mc-jour-table tfoot td, .mc-jour-table tfoot th { position: sticky; bottom: 0; z-index: 2; background-color: var(--mc-tete); text-transform: none; letter-spacing: 0; font-size: 12.5px; color: var(--navy); }
.mc-jour-table tr.mc-section > th { background-color: var(--mc-section); text-transform: none; letter-spacing: 0; font-size: 12px; text-align: left; }
.mc-jour-table .mc-j { width: 96px; padding: 0; text-align: right; }
.mc-jour-table .mc-saisie { height: 31px; font-size: 15px; font-weight: 650; }
.mc-jour-table .mc-code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 11.5px; color: var(--texte-2); width: 70px; }
.mc-jour-table .mc-comp { font-weight: 600; }
.mc-veille { color: var(--texte-3); }
.mc-veille-btn { padding: 0 4px; font-size: 12px; }

/* Panneaux de la carte : contrôles, annexe vivres crus, pièces jointes, commentaire */
.mc-panneau { padding-top: 10px; border-top: 1px solid var(--grille); }
.mc-panneau textarea { width: 100%; padding: 6px 8px; border: 1px solid var(--bordure); border-radius: 6px; font: inherit; font-size: 13px; resize: vertical; }
.mc-controles h3 { margin: 6px 0 4px; font-size: 12px; }
.mc-controles ul { display: flex; flex-direction: column; gap: 2px; margin: 0 0 6px; padding: 0; list-style: none; max-height: 320px; overflow-y: auto; }
.mc-anomalie { display: block; width: 100%; padding: 4px 8px; border: 0; border-left: 3px solid var(--attenue); border-radius: 4px; background: var(--fond); color: var(--texte); cursor: pointer; font: inherit; font-size: 12.5px; text-align: left; }
.mc-anomalie:hover, .mc-anomalie:focus-visible { background: var(--bleu-pale); }
.mc-anomalie.mc-a-bloquant { border-left-color: var(--danger); }
.mc-anomalie.mc-a-alerte { border-left-color: #d98e04; }
.mc-anomalie.mc-a-info { border-left-color: var(--bleu); }
.mc-controles li { display: flex; align-items: stretch; gap: 0; }
.mc-code-anomalie { flex: none; align-self: center; width: 190px; padding: 0 8px; font-size: 12px; font-weight: 700; color: var(--texte-2); }
.mc-controles li.mc-a-bloquant .mc-code-anomalie { color: var(--danger); }
.mc-controles li.mc-a-alerte .mc-code-anomalie { color: var(--alerte); }
.mc-niveau.mc-a-bloquant { color: var(--danger); }
.mc-niveau.mc-a-alerte { color: var(--alerte); }
.mc-niveau.mc-a-info { color: var(--bleu-fonce); }
.mc-annexe-table td { padding: 3px 4px; }
.mc-annexe-table input, .mc-annexe-table select { width: 100%; min-height: 30px; padding: 3px 6px; font-size: 13px; }
.mc-annexe-table input.nombre { text-align: right; font-variant-numeric: tabular-nums; }
.mc-annexe-table td:first-child { width: 112px; }
.mc-annexe-table td:nth-child(6) { width: 92px; }
.mc-annexe-table td:nth-child(7) { width: 120px; }
.mc-annexe-table tr.mc-annexe-incomplete > td { background: var(--alerte-fond); }
.mc-annexe-totaux { width: auto; margin-top: 8px; }
.mc-annexe-totaux caption { padding-bottom: 4px; color: var(--texte-2); font-size: 12px; font-weight: 650; text-align: left; }
.mc-depot { padding: 14px; }

/* Référentiel des prix, suivi des validations */
.mc-prix-table td small, .mc-suivi-table td small { display: block; font-size: 11px; color: var(--texte-3); }
.mc-prix-lib { max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mc-prix-actions { white-space: nowrap; }
.mc-prix-actions .btn-lien { padding: 2px 4px; }
.mc-statut-prix { display: inline-block; padding: 1px 8px; border-radius: 10px; font-size: 11px; font-weight: 650; white-space: nowrap; }
.mc-statut-prix-propose { background: var(--alerte-fond); color: var(--alerte); }
.mc-statut-prix-valide { background: var(--ok-fond); color: var(--ok); }
.mc-statut-prix-absent { background: var(--danger-fond); color: var(--danger); }
.mc-statut-prix-libre { background: var(--grille); color: var(--texte-2); }
.mc-prix-table td small.mc-rejet-prix { color: var(--danger); }
.mc-lot { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.mc-suivi-tuiles { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
.mc-tuile-statut { display: block; border: 1px solid var(--bordure); color: inherit; cursor: pointer; font: inherit; text-align: left; }
.mc-tuile-statut .indicateur-libelle, .mc-tuile-statut .indicateur-valeur { display: block; }
.mc-tuile-statut:hover { border-color: var(--bleu); }
.mc-tuile-choisie { border-color: var(--bleu); box-shadow: 0 0 0 2px rgba(37, 99, 190, .2); }
.mc-ligne-retard td:first-child { box-shadow: inset 3px 0 0 var(--danger); }

@media (max-width: 1500px) {
  :root { --mc-l4: 150px; }
  .mc-grille .mc-c-pu { width: 80px; min-width: 80px; }
  .mc-grille .mc-c-q { width: 54px; min-width: 54px; }
}
@media (max-width: 1100px) {
  :root { --mc-l3: 120px; --mc-l4: 150px; }
}
@media (max-width: 720px) {
  :root { --mc-l1: 60px; --mc-l4: 120px; }
  .mc-champ-site select, .mc-champ-site .combo { min-width: 200px; }
  .mc-carte-totaux { align-items: flex-start; }
}
@media (prefers-reduced-motion: reduce) { .mc-eclair { animation: none; } }
@media print {
  .mc-outils-carte, .mc-barre, .mc-grille .mc-outils, .mc-ajouter { display: none !important; }
  .mc-defil { max-height: none; overflow: visible; }
}
.mc-grille td.mc-refus, .mc-jour-table td.mc-refus { animation: mc-refus .7s ease-out; }
@keyframes mc-refus { 0%, 50% { box-shadow: inset 0 0 0 2px var(--danger); background-color: var(--danger-fond); } }
@media (prefers-reduced-motion: reduce) { .mc-grille td.mc-refus, .mc-jour-table td.mc-refus { animation: none; box-shadow: inset 0 0 0 2px var(--danger); } }
/* Fin de mois du site : étapes jusqu'à la constatation du CA, CA par nature ; duplication, reconduction ; dépôt des mains
   courantes de référence */
.mc-etapes { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 8px; margin: 0; padding: 0; list-style: none; }
.mc-etape { display: flex; align-items: flex-start; gap: 10px; padding: 10px 12px; border: 1px solid var(--bordure); border-left-width: 4px; border-radius: var(--rayon); background: var(--surface); }
.mc-etape strong { display: block; font-size: 13px; color: var(--navy); }
.mc-etape small { display: block; margin-top: 2px; font-size: 12px; color: var(--texte-2); }
.mc-etape-picto { flex: none; display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; font-size: 13px; font-weight: 800; line-height: 1; }
.mc-etape-fait { border-left-color: var(--ok); }
.mc-etape-fait .mc-etape-picto { background: var(--ok); color: #fff; }
.mc-etape-en_cours { border-left-color: #d98e04; }
.mc-etape-en_cours .mc-etape-picto { background: var(--alerte-fond); color: var(--alerte); }
.mc-etape-a_faire { border-left-color: var(--bordure); }
.mc-etape-a_faire .mc-etape-picto { background: var(--grille); color: var(--texte-3); }
.mc-fdm-natures { width: auto; min-width: 640px; }
.mc-fdm-natures th[scope="row"] { text-align: left; text-transform: none; letter-spacing: 0; font-size: 12.5px; color: var(--texte); white-space: nowrap; }
.mc-fdm-natures tr.mc-sous-ligne > * { color: var(--texte-2); font-size: 12px; }
.mc-fdm-natures tr.mc-sous-ligne th[scope="row"] { padding-left: 24px; font-weight: 400; }
.mc-fdm-natures tr.ligne-total > * { font-weight: 700; background: var(--bleu-pale); }
.mc-dupliquer { background: var(--bleu-pale); }
.mc-dupliquer p { flex-basis: 100%; margin: 0; }
.mc-dupliquer label.champ-inline { display: inline-flex; align-items: center; gap: 6px; min-height: 36px; font-size: 12.5px; }
.mc-dupliquer input[type="checkbox"], .mc-recurrente input[type="checkbox"] { width: 16px; height: 16px; min-height: 0; margin: 0; cursor: pointer; }
.mc-depot-ref h3 { margin: 12px 0 6px; font-size: 13px; color: var(--navy); }
.mc-depot-ref td small { display: block; font-size: 11px; color: var(--texte-3); }
.mc-depot-details summary { margin: 10px 0 6px; cursor: pointer; font-weight: 650; color: var(--navy); }
.mc-prix-section { white-space: nowrap; }
.mc-prix-section input[type="checkbox"], .mc-prix-table th input[type="checkbox"] { min-height: 0; margin: 0 4px 0 0; vertical-align: -2px; }

/* Cartographie des tarifs (onglet Facturation) : grille des prestations (repas puis convives), fourchettes */
#tarifs-table-grille tr.sous-total td { font-weight: 650; background: var(--bleu-pale); }
#tarifs-table-grille tr.ligne-choisie td { background: var(--ok-fond); }
#tarifs-table-grille .retrait { display: inline-block; width: 16px; }
#tarifs-graphique-fourchettes { height: 220px; }
#tarifs-deciles > .carte-corps > .grille-2 { grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr); align-items: start; }
#tarifs-tendances > .carte-corps.grille-2 { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: start; }
#tarifs-table-deciles tr.ligne-choisie td { background: var(--ok-fond); font-weight: 650; }
/* Matrices (groupes × repas, repas × convives) : case et colonne de la prestation choisie ; détail d'un groupe : prix à plus
   de 10 % de la médiane du groupe ; site déplié (toutes ses prestations) ; zoom de la répartition des prix */
#tarifs-table-matrice td.case-choisie, #tarifs-table-repas-convives td.case-choisie { background: var(--ok-fond); }
#tarifs-table-matrice th.colonne-choisie, #tarifs-table-detail th.colonne-choisie { color: var(--bleu-fonce); box-shadow: inset 0 -2px 0 var(--bleu); }
#tarifs-table-matrice tr.ligne-choisie td, #tarifs-table-detail tr.ligne-choisie td, #tarifs-table-fourchettes tr.ligne-choisie td { background: var(--bleu-pale); }
#tarifs-table-repas-convives tr.sous-total td, #tarifs-table-site tr.sous-total td { font-weight: 650; background: var(--bleu-pale); }
#tarifs-table-detail td.tarif-bas { color: var(--danger); font-weight: 650; }
#tarifs-table-detail td.tarif-haut { color: var(--ok); font-weight: 650; }
.tarifs-detail-site { padding: 6px 0 12px 18px; white-space: normal; }
.tarifs-detail-site > p { margin: 0 0 6px; }
.tarifs-detail-site table { width: auto; min-width: 60%; }
.tarifs-zoom { align-items: center; margin-bottom: 8px; }
.tarifs-zoom input[type="number"] { width: 90px; }
#tarifs-table-matrice td.discret { color: var(--texte-3); font-size: inherit; }
@media (max-width: 720px) {
  #tarifs-deciles > .carte-corps > .grille-2, #tarifs-tendances > .carte-corps.grille-2 { grid-template-columns: 1fr; }
}

/* ── Extranet clients (Pilotage FDM › Chiffre d'affaires, public/js/extranet.js) : volets, commandes et leur détail, report
   dans la main courante, formulaires (comptes clients, documents, catalogue, offres), suivi des demandes ── */
#vue-extranet .carte { padding-bottom: 16px; }
#vue-extranet .carte > :not(.carte-titre) { margin: 12px 16px 0; }
#vue-extranet .case { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--texte-2); }
#vue-extranet .case input { min-height: 0; }
#vue-extranet textarea { width: 100%; min-height: 60px; padding: 6px 8px; border: 1px solid var(--bordure); border-radius: 6px; font: inherit; font-weight: 400; resize: vertical; }
#vue-extranet .btn-petit { padding: 3px 9px; font-size: 12px; }
.ex-puces { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px !important; }
.ex-puces .badge { cursor: pointer; border: 0; font-size: 12px; padding: 3px 10px; }
.ex-statut-envoyee { background: var(--alerte-fond); color: var(--alerte); }
.ex-statut-acceptee, .ex-statut-realisee { background: var(--bleu-pale); color: var(--bleu-fonce); }
.ex-statut-facturee { background: var(--ok-fond); color: var(--ok); }
.ex-statut-refusee, .ex-statut-annulee { background: var(--grille); color: var(--texte-3); }
#ex-table-commandes tr.ex-ouverte td, #ex-table-ecarts tr.ex-ouverte td { background: var(--bleu-pale); }
.ex-actions { white-space: nowrap; }
.ex-detail { padding: 8px 4px; display: flex; flex-direction: column; gap: 8px; white-space: normal; }
.ex-detail p { margin: 0; }
.ex-lignes { width: auto; min-width: 60%; }
.ex-historique { margin: 0; padding-left: 18px; font-size: 12px; color: var(--texte-2); }
.ex-report { padding: 10px 0; border-top: 1px solid var(--grille); }
.ex-report p { margin: 0 0 8px; display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: center; }
.ex-formulaire { padding: 14px; border: 1px solid var(--grille); border-radius: 8px; background: var(--fond); display: flex; flex-direction: column; gap: 10px; }
.ex-formulaire h3 { margin: 0; }
.ex-formulaire .grille-champs { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 10px; align-items: end; }
.ex-sites { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 4px 12px; max-height: 220px; overflow-y: auto; margin: 0;
  border: 1px solid var(--bordure); border-radius: 6px; padding: 8px 10px; background: var(--surface); }
.ex-sites legend { font-size: 12px; font-weight: 600; color: var(--texte-2); padding: 0 4px; }
.ex-depot { padding: 10px 12px; border-radius: 6px; background: var(--surface); border: 1px solid var(--bordure); }
.ex-depot p { margin: 0 0 6px; }
.ex-erreurs { margin: 6px 0; padding-left: 18px; color: var(--danger); font-size: 12px; }
.ex-suivi { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.ex-suivi input[type="text"] { min-width: 180px; }
.ex-offre { border: 1px solid var(--bordure); border-radius: 8px; padding: 10px 14px; margin: 0 0 12px; display: flex; flex-direction: column; gap: 8px; }
.ex-offre legend { font-weight: 650; padding: 0 6px; }
/* Extranet clients : vivres crus (budget soins, illustration de la famille), factures reçues du SFTP */
.ex-soins { background: #f3e8fb; color: #6b2fa0; }
/* Budget pharmacie (bon séparé, remboursé par le client) ; report sans main courante du budget : création suggérée */
.ex-pharmacie { background: #e0f3f3; color: #0b5f66; }
/* Vivre cru facturé en ligne de main courante (facturations annexes, jamais l'annexe vivres crus) ; annonce de la carte de report */
.ex-mc { background: #fff1db; color: #8a4b00; }
.ex-report-mc { margin: 0 0 6px; font-size: 12.5px; }
.ex-report-suggestion { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; font-size: 13px; color: var(--texte-2); }
.ex-report-suggestion a.btn { text-decoration: none; }
/* Report au 1er du mois suivant (main courante du mois de la date plus en préparation) */
.ex-report-au1er { font-size: 13px; flex-basis: 100%; }
/* Articles des contrats (réservés aux BPU) ; lignes de grille à vérifier ; validation des relevés par les clients */
.ex-contrat { background: var(--bleu-pale); color: var(--bleu-fonce); }
.ex-demassifie { background: var(--vert-pale, #eef6dc); color: var(--vert-fonce, #4a6a0a); }
tr.ex-ligne-alerte td { background: var(--alerte-fond); }
.ex-validation-a_valider { background: var(--alerte-fond); color: var(--alerte); }
.ex-validation-validee, .ex-validation-reputee_validee { background: var(--ok-fond); color: var(--ok); }
.ex-validation-contestee { background: #fde8e8; color: #a11d1d; }
.ex-validations { padding: 12px 14px; border: 1px solid var(--grille); border-radius: 8px; background: var(--surface); display: flex; flex-direction: column; gap: 8px; margin-bottom: 12px; }
.ex-validations h3, .ex-validations h4, .ex-validations p { margin: 0; }
.badge-ok { background: var(--ok-fond); color: var(--ok); }
.ex-icone { vertical-align: middle; margin-right: 6px; }
.ex-recues { padding: 12px 14px; border: 1px solid var(--grille); border-radius: 8px; background: var(--surface); display: flex; flex-direction: column; gap: 8px; }
.ex-recues h3, .ex-recues p { margin: 0; }
/* Catalogue dynamique : produits achetés proches d'un article à rattacher ; tarifs des sites (marge propre saisie dans le tableau) */
#ex-dynamique h3 { margin: 16px 0 6px; }
.ex-candidat { margin: 0 0 6px; display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: center; }
.ex-candidat:last-child { margin-bottom: 0; }
#ex-table-ecarts input.champ-court { width: 72px; text-align: right; }
#vue-extranet .ex-formulaire select, #vue-extranet .ex-formulaire input[type="text"], #vue-extranet .ex-formulaire input[type="date"], #vue-extranet .ex-formulaire input[type="month"] { width: 100%; }
/* Dé-lotissement : unités par colis et unité vendue saisies dans les tableaux du catalogue dynamique */
#ex-dynamique td input.champ-court { width: 96px; }
#ex-dynamique td select { min-width: 96px; }
#ex-dynamique input[aria-invalid="true"] { border-color: var(--danger); box-shadow: 0 0 0 1px var(--danger); }
#table-assistant-docs tr.ligne-choisie td { background: var(--bleu-pale); }
#ad-lot .depot-fichier { margin: 8px 0; }
#table-assistant-lot input[type="text"] { width: 100%; min-width: 220px; }
#table-assistant-lot textarea { width: 100%; font-family: inherit; font-size: 13px; }

/* ── Fin de mois (onglets Fin de mois, Cessions de denrées, Produits & charges annexes) ── */
.fdm-entete-ligne { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 20px; }
.fdm-mois { display: inline-flex; align-items: center; gap: 8px; }
.fdm-mois strong { min-width: 130px; text-align: center; text-transform: capitalize; }
.fdm-indicateurs { margin-bottom: 16px; }
.fdm-boutons { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.fdm-favorable { color: var(--ok); }
.fdm-defavorable { color: var(--danger); }
.fdm-groupe th { background: var(--bleu-pale); color: var(--navy); }
.fdm-sous-total td { background: #fafbfc; font-weight: 650; }
.fdm-rubrique { padding-left: 24px; }
input.fdm-nombre { width: 110px; text-align: right; }
input.fdm-court { width: 70px; }
input.fdm-motif { width: 100%; min-width: 160px; }
.fdm-controles { margin-top: 12px; }
.fdm-commentaire { margin-bottom: 14px; }
.fdm-commentaire label { display: block; font-size: 13px; }
.fdm-commentaire textarea { display: block; width: 100%; margin-top: 4px; }
.fdm-commentaire p { margin: 4px 0 0; white-space: pre-wrap; }
.fdm-amorce { font-weight: 650; color: var(--navy); }
.fdm-requis .fdm-amorce { color: var(--alerte); }
.fdm-sources { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 8px 20px; margin: 0; }
.fdm-sources dt { font-size: 12px; font-weight: 650; color: var(--texte-3); }
.fdm-sources dd { margin: 2px 0 0; font-size: 13px; }
.fdm-historique { margin: 0; padding-left: 18px; font-size: 13px; }
.fdm-formulaire { display: flex; flex-wrap: wrap; gap: 10px 16px; align-items: center; margin-bottom: 12px; }
.fdm-motif { margin-top: 10px; }
.fdm-rejet { color: var(--alerte); font-weight: 600; }
#vue-fdm td small, #vue-cessions td small, #vue-annexes td small { display: block; }
.fdm-bef { margin-top: 18px; }
.fdm-bef h3 { margin: 0 0 4px; font-size: 14px; color: var(--navy); }
.fdm-bef td.fdm-recommandee { background: var(--ok-fond); }
.fdm-bef-histo { margin: 10px 0 0; padding-left: 18px; font-size: 12.5px; color: var(--texte-2); }
.fdm-hors { margin-top: 14px; }
.fdm-hors h3 { margin: 0 0 4px; font-size: 13.5px; color: var(--navy); }
.fdm-hors p { font-size: 12.5px; }
.fdm-bef-vide { margin-top: 12px; }
.fdm-justesse, .fdm-constat { margin-top: 18px; }
.fdm-justesse h3, .fdm-constat h3 { margin: 0 0 4px; font-size: 14px; color: var(--navy); }
.fdm-justesse caption, .fdm-constat caption { caption-side: top; text-align: left; font-weight: 650; font-size: 13px; color: var(--navy); padding: 8px 0 4px; }
.fdm-justesse td.fdm-recommandee { background: var(--ok-fond); }
.fdm-justesse tfoot th { text-align: left; font-weight: 650; }

/* Extranet : câblage (volet « Ajouts au catalogue », segments du catalogue, catalogue national, prix cliquables, BPU de sites) */
#ex-entete .segments button .ex-compteur { display: inline-block; min-width: 18px; margin-left: 4px; padding: 0 5px; border-radius: 9px; background: var(--alerte-fond); color: var(--alerte); font-size: 11.5px; font-weight: 700; line-height: 18px; text-align: center; }
#ex-entete .segments button[aria-pressed="true"] .ex-compteur { background: #fff; color: var(--bleu-fonce); }
/* Prix cliquable : ouvre la trace du prix (module du référentiel) */
.lien-prix { border: 0; background: none; padding: 0; margin: 0; font: inherit; color: var(--bleu); cursor: pointer; text-decoration: underline dotted; text-underline-offset: 3px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.lien-prix:hover { text-decoration-style: solid; color: var(--bleu-fonce); }
.lien-prix:focus-visible { outline: 2px solid var(--bleu); outline-offset: 2px; border-radius: 2px; }
/* Formulaires repliés (article, import d'une liste, BPU, grille d'un contrat) */
.ex-repli { margin: 0 0 12px; border: 1px solid var(--bordure); border-radius: var(--rayon); background: var(--surface); }
.ex-repli > summary { margin: 0; padding: 9px 14px; list-style: none; color: var(--navy); }
.ex-repli > summary::-webkit-details-marker { display: none; }
.ex-repli > summary::before { content: "▸"; display: inline-block; margin-right: 8px; color: var(--bleu); transition: transform .15s; }
.ex-repli[open] > summary::before { transform: rotate(90deg); }
.ex-repli > summary:hover { background: var(--bleu-pale); }
.ex-repli > .ex-formulaire { border: 0; border-top: 1px solid var(--grille); border-radius: 0 0 var(--rayon) var(--rayon); }
.ex-pagination { justify-content: space-between; margin: 6px 0; font-size: 13px; color: var(--texte-2); }
.ex-remplace { background: var(--grille); color: var(--texte-2); }
#ex-table-grille select, .ex-table-grille select { max-width: 340px; font-size: 12.5px; }
#ex-table-conserves td:last-child { white-space: normal; min-width: 220px; }
#ex-actualisation h3 { margin: 14px 0 6px; font-size: 14px; color: var(--navy); }
@media (max-width: 640px) {
  .sous-volets .segments { display: flex; width: 100%; }
  .sous-volets .segments button { flex: 1 1 auto; }
  .ex-pagination { justify-content: flex-start; }
}
#ex-import-bpu .ex-depot > p select, #ex-import-bpu .ex-lot-corps > p select { width: auto; max-width: 100%; }
/* Import des BPU (2.78.0) : en-tête du BPU (valeur lue dans la fiche de la feuille : badge « fiche »), fichier de plusieurs BPU (une
   feuille par BPU : tableau des feuilles, aperçu de chacune repliable, résultat de l'application) */
.ex-entete-bpu { margin: 4px 0 0; padding: 8px 12px 10px; min-width: 0; border: 1px solid var(--grille); border-radius: 6px; background: var(--fond); }
.ex-entete-bpu legend { padding: 0 4px; font-size: 12px; font-weight: 650; color: var(--texte-2); }
.ex-entete-bpu .discret { margin: 8px 0 0; }
.ex-fiche { margin-left: 4px; background: var(--bleu-pale); color: var(--bleu-fonce); font-weight: 600; }
p.ex-fiche-lue { margin: 6px 0 0; font-size: 12.5px; color: var(--texte-2); }
p.ex-entete-erreurs { margin: 6px 0 0; font-size: 12.5px; font-weight: 600; color: var(--danger); }
.ex-lot-annonce { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; margin: 0 0 10px; padding: 8px 12px; border-radius: 6px; background: var(--bleu-pale); }
.ex-depot .ex-lot-annonce p { margin: 0; flex: 1 1 320px; }
.ex-lot { display: flex; flex-direction: column; gap: 10px; }
.ex-lot-tete { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 14px; }
.ex-depot .ex-lot-tete p { margin: 0; flex: 1 1 320px; }
.ex-lot-feuille { border: 1px solid var(--bordure); border-radius: 6px; background: var(--fond); }
.ex-lot-feuille > summary { padding: 8px 12px; cursor: pointer; color: var(--navy); }
.ex-lot-feuille > summary .badge { margin-left: 6px; }
.ex-lot-feuille > p { margin: 8px 12px; }
.ex-lot-corps { display: flex; flex-direction: column; gap: 6px; padding: 0 12px 12px; }
.ex-depot .ex-lot-corps p { margin: 0; }
p.ex-lot-resultat { font-size: 13px; }
#ex-table-lot-bpu td:last-child { white-space: normal; min-width: 220px; }
/* Fichier d'un contrat (2.87.0) : feuille laissée de côté (case « Importer » décochée : grisée, aperçu replié), grille de prestations
   annexes (avertissements, prix aux sites par statut, référence choisie), lien d'import du volet Prestations annexes */
#ex-table-lot-bpu td:first-child { width: 1%; text-align: center; }
#ex-table-lot-bpu tr.ex-lot-ecartee td:not(:first-child), .ex-table-prestations tr.ex-lot-ecartee td { opacity: .55; }
details.ex-lot-feuille.ex-lot-ecartee > summary { opacity: .6; }
.ex-avertissements { margin: 6px 0; padding-left: 18px; color: var(--alerte); font-size: 12px; }
.ex-prix-sites { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 3px; font-size: 12.5px; }
.ex-prix-sites .badge { margin-right: 4px; }
.ex-table-prestations tbody td:nth-child(6) { min-width: 230px; }
#vue-extranet .ex-formulaire .ex-table-prestations select { width: 100%; max-width: 320px; font-size: 12.5px; }
.ex-table-prestations td:nth-child(2) { min-width: 220px; white-space: normal; }
.ex-table-prestations td:last-child { min-width: 200px; white-space: normal; }
.ec-import-contrat { margin: 6px 0 0; display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; }
/* Fichier corrigé du lot (revue 2.87.0) : remplace le fichier du lot, feuilles non appliquées relues */
.ex-lot-fichier { margin: 6px 0 0; display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; font-size: 13px; }
.ex-lot-fichier input[type="file"] { max-width: 100%; }
/* Extranet (2.68.0) : volet et conteneur du module du catalogue en colonne ; sections repliables de l'Administration et gestion des
   articles du catalogue national (details.carte.ex-section : titre, compteur, détail), sous-sections des réglages ; cartes des
   modules (contrôle du mois) allégées dans une section ; détail d'un BPU (produit lié, mercuriale) */
#ex-volet, .ex-module { display: flex; flex-direction: column; gap: 16px; }
#ex-entete .sous-volets, #fiches-contexte .sous-volets { margin: 10px 0 0; }
#vue-extranet details.ex-section { padding: 0; }
#vue-extranet details.carte.ex-section > summary { margin: 0; padding: 14px 16px; list-style: none; cursor: pointer; display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; border-radius: var(--rayon); }
#vue-extranet details.carte.ex-section > summary::-webkit-details-marker { display: none; }
#vue-extranet details.carte.ex-section > summary::before { content: "▸"; display: inline-block; color: var(--bleu); transition: transform .15s; }
#vue-extranet details.carte.ex-section[open] > summary::before { transform: rotate(90deg); }
#vue-extranet details.carte.ex-section > summary:hover { background: var(--bleu-pale); }
#vue-extranet details.carte.ex-section[open] > summary { border-bottom: 1px solid var(--grille); border-radius: var(--rayon) var(--rayon) 0 0; }
#vue-extranet details.carte.ex-section > summary:focus-visible { outline: 2px solid var(--bleu); outline-offset: -2px; }
.ex-section-titre { font-size: 16px; font-weight: 650; color: var(--navy); }
.ex-section-detail { font-size: 12.5px; }
.ex-section .ex-compteur { display: inline-block; min-width: 20px; padding: 0 6px; border-radius: 10px; background: var(--alerte-fond); color: var(--alerte); font-size: 12px; font-weight: 700; line-height: 20px; text-align: center; }
#vue-extranet details.carte.ex-section > .ex-section-corps { margin: 0; padding: 12px 16px 16px; display: flex; flex-direction: column; gap: 12px; }
#vue-extranet .ex-section-corps .carte { box-shadow: none; border-color: var(--grille); }
#vue-extranet .ex-sous-section { margin: 0; }
#vue-extranet .ex-sous-section > .ex-section-corps { padding: 12px 14px; border-top: 1px solid var(--grille); display: flex; flex-direction: column; gap: 10px; }
#vue-extranet .ex-sous-section > .ex-section-corps > div > p:first-child { margin-top: 0; }
#ex-table-bpu tr.ex-ouverte td { background: var(--bleu-pale); }
#ex-table-bpu-lignes td { vertical-align: top; }
#ex-table-bpu-lignes td.ex-bpu-produit { min-width: 200px; }
.ex-bpu-actions { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; }
.ex-mercuriale { margin: 0; padding-left: 16px; display: flex; flex-direction: column; gap: 4px; font-size: 12.5px; min-width: 240px; }
.ex-mercuriale li .discret { display: block; }
.ex-mercuriale li.ex-lie > span:first-child { font-weight: 650; color: var(--bleu-fonce); }
#ex-dynamique > .barre-actions > p { flex: 1 1 320px; margin: 0; }

/* Extranet : référentiel des vivres crus (public/js/extranet-referentiel.js) — segments Référentiel, Existant (annexes), Catalogue d'un
   compte, volet Ajouts au catalogue, fenêtre de trace d'un prix */
.rf-segment { display: flex; flex-direction: column; gap: 16px; }
.rf-barre { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.rf-barre .espace { flex: 1; }
.rf-barre .segments button { padding: 5px 10px; font-size: 12.5px; }
.rf-barre-compte { padding: 10px 12px; border: 1px solid var(--grille); border-radius: 8px; background: var(--fond); }
.rf-barre-compte select { width: auto; min-width: 260px; max-width: 520px; }
.rf-hors { white-space: nowrap; }
/* Tuiles resserrées (lien « Voir » sous le détail) ; libellés et actions des tableaux */
#vue-extranet .rf-segment .indicateurs { gap: 10px; }
#vue-extranet .rf-segment .indicateur { padding-bottom: 10px; }
#vue-extranet .rf-segment .indicateur > * { margin: 8px 14px 0; }
#vue-extranet .rf-segment .indicateur-valeur { font-size: 22px; margin-top: 2px; }
#vue-extranet .rf-segment .indicateur .btn-lien { padding: 0; font-size: 12px; }
.rf-table th, .rf-table td { padding: 8px 8px; }
.rf-table td.rf-libelle { min-width: 200px; }
.rf-table td.rf-correspondance { min-width: 160px; }
.rf-variantes { font-style: italic; }
.rf-boutons { display: flex; flex-direction: column; align-items: stretch; gap: 4px; }
#vue-extranet .rf-boutons .btn-petit { padding: 2px 8px; }
.rf-boutons .btn { justify-content: center; }
.rf-fiche { margin: 0 0 6px; font-size: 12.5px; color: var(--texte-2); }
.rf-barre-compte input[type="search"] { width: 200px; }
.rf-recherche { display: inline-flex; align-items: center; gap: 6px; margin: 0; }
.rf-recherche input[type="search"], form.rf-barre input[type="search"] { min-width: 260px; }
.rf-actions { padding-top: 2px; }
.rf-charge { font-style: italic; }
.rf-pagination { display: inline-flex; align-items: center; gap: 8px; margin-left: auto; font-size: 13px; color: var(--texte-2); }
.rf-fichier { position: relative; overflow: hidden; }
.rf-fichier input[type="file"] { position: absolute; inset: 0; opacity: 0; cursor: pointer; font-size: 0; }
.rf-fichier:focus-within { outline: 2px solid var(--bleu); outline-offset: 2px; }
.rf-mode { background: var(--grille); color: var(--texte-2); }
.rf-score { background: var(--bleu-pale); color: var(--bleu-fonce); font-variant-numeric: tabular-nums; }
.rf-globale { background: var(--navy); color: #fff; }
.rf-max { background: var(--bleu); color: #fff; }
.rf-anciens { flex-basis: 100%; color: var(--alerte); }
.rf-refus { padding: 6px 10px; border-left: 3px solid var(--danger); background: var(--fond); }
.rf-tuile-alerte .indicateur-valeur { color: var(--alerte); }
.rf-table td { vertical-align: top; }
.rf-table td.nombre { vertical-align: top; }
tr.rf-coche td { background: var(--bleu-pale); }
.rf-sous-titre { margin: 16px 0 6px; font-size: 13px; color: var(--navy); }
.rf-panneau { padding: 12px 14px; border: 1px solid var(--bordure); border-radius: 8px; background: var(--fond); display: flex; flex-direction: column; gap: 8px; }
.rf-panneau h3 { margin: 0; font-size: 14px; color: var(--navy); }
.rf-panneau p { margin: 0; }
.rf-panneau .ex-sites { max-height: 160px; }
.rf-details > summary { cursor: pointer; font-size: 12.5px; color: var(--texte-2); }
/* Réimport du catalogue en Excel : une partie par type de changement (case « Appliquer »), conflits en évidence, cases à forcer */
.rf-partie { display: flex; flex-direction: column; gap: 6px; padding: 10px 12px; border: 1px solid var(--grille); border-radius: 8px; background: var(--surface); }
.rf-partie-entete { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; }
.rf-partie-entete h4 { margin: 0; font-size: 13.5px; color: var(--navy); }
.rf-partie .aide { margin: 0; }
tr.rf-conflit td { background: var(--alerte-fond); }
.rf-forcer { padding: 6px 10px; border-left: 3px solid var(--alerte); background: var(--fond); }
/* Cases à libellé long des panneaux (export, aperçu du réimport) : le texte passe à la ligne */
#vue-extranet .rf-panneau > label.case, #vue-extranet .rf-partie label.case { display: flex; align-items: flex-start; white-space: normal; }
#vue-extranet .rf-panneau > label.case input, #vue-extranet .rf-partie label.case input { margin-top: 2px; flex: none; }
.rf-liste { margin: 4px 0 0; padding-left: 18px; font-size: 12px; }
.rf-liste li { margin: 2px 0; }
.rf-detail { display: flex; flex-direction: column; gap: 8px; white-space: normal; }
.rf-detail h4 { margin: 0; font-size: 13px; color: var(--navy); }
.rf-candidats { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 6px; }
.rf-candidats li { display: grid; grid-template-columns: minmax(240px, 1fr) auto auto; gap: 4px 12px; align-items: start; }
.rf-candidat-prix { font-size: 12.5px; white-space: nowrap; }
.rf-compte-ligne { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; padding: 10px 12px; border: 1px solid var(--grille); border-radius: 8px; background: var(--fond); }
.rf-choix { display: flex; flex-direction: column; gap: 8px; margin: 0; border: 0; padding: 0; }
fieldset.rf-choix > legend { padding: 0; margin-bottom: 4px; font-size: 12px; font-weight: 650; color: var(--texte-2); }
.rf-option { display: flex; align-items: flex-start; gap: 8px; font-size: 13px; cursor: pointer; }
.rf-option input { margin-top: 3px; min-height: 0; }
.rf-sous-bloc { margin-left: 24px; }
.rf-resultats { margin: 6px 0 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 4px; font-size: 13px; }
.rf-accepter { background: var(--surface); }
.rf-choisi { margin: 0; padding: 6px 10px; border-radius: 6px; background: var(--bleu-pale); color: var(--bleu-fonce); font-size: 13px; }
.rf-dialogue { width: min(560px, calc(100vw - 32px)); border-top-color: var(--bleu); }
.rf-dialogue .rf-dialogue-boutons { justify-content: flex-end; margin-top: 14px; }
.rf-dialogue .rf-choix { margin: 6px 0 0; }
/* Trace d'un prix : étapes du calcul, recalcul à ce jour, lignes d'achat (unités par livraison saisissables) */
.confirmation.rf-trace { width: min(1180px, calc(100vw - 32px)); max-height: calc(100vh - 48px); padding: 0; border-top-color: var(--bleu); display: flex; flex-direction: column; }
.rf-trace:not([open]) { display: none; }
.rf-trace-entete { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 14px 20px; border-bottom: 1px solid var(--bordure); }
.rf-trace-entete h2 { margin: 0; font-size: 17px; }
.rf-trace-entete p { margin: 2px 0 0; }
.rf-trace-fermer { margin: 0; }
.rf-trace-contenu { overflow: auto; padding: 12px 20px 18px; display: flex; flex-direction: column; gap: 10px; }
.rf-trace-prix { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 12px; font-size: 13px; color: var(--texte-2); }
.rf-trace-valeur { font-size: 24px; font-weight: 650; color: var(--navy); font-variant-numeric: tabular-nums; }
.rf-etapes { margin: 0; padding-left: 22px; display: flex; flex-direction: column; gap: 6px; font-size: 13px; }
.rf-etapes li { display: grid; grid-template-columns: minmax(170px, 210px) minmax(110px, auto) 1fr; gap: 2px 14px; align-items: baseline; }
.rf-etape-titre { font-weight: 600; }
.rf-etape-valeur { font-variant-numeric: tabular-nums; font-weight: 650; white-space: nowrap; }
.rf-etape-detail { color: var(--texte-3); font-size: 12px; }
.rf-adate { margin: 0; padding: 8px 12px; border-left: 3px solid var(--bleu); background: var(--bleu-pale); font-size: 13px; }
.rf-table-achats { font-size: 12px; }
.rf-table-achats th, .rf-table-achats td { padding: 6px 8px; vertical-align: top; }
.rf-table-achats td:nth-child(3) { min-width: 180px; }
.rf-table-achats input.champ-court { width: 76px; }
.rf-table-achats tfoot td { font-size: 12.5px; white-space: normal; background: var(--fond); }
@media (max-width: 760px) {
  .rf-etapes li, .rf-candidats li { grid-template-columns: 1fr; }
  .rf-recherche input[type="search"], form.rf-barre input[type="search"], .rf-barre-compte input[type="search"] { min-width: 0; width: 100%; }
  .rf-barre-compte select { min-width: 0; width: 100%; }
  .rf-barre-compte select { max-width: 100%; }
}

/* ── Extranet clients : fournitures sans commande, suivi du mois, contrôle du mois (public/js/extranet-suivi.js, classes es-) ── */
.es-cache { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.es-sans-commande { background: #efeafa; color: #5a3fa6; }
.es-hc { background: var(--alerte-fond); color: var(--alerte); }
.es-barre { flex-wrap: wrap; gap: 8px 12px; margin: 0 0 12px; }
.es-barre-vues { flex-wrap: wrap; gap: 8px 12px; margin: 14px 0 8px; }
.es-tuiles { margin: 0 0 8px; }
.es-tuiles .indicateur { padding: 12px 14px; }
.es-tuile-sans { border-left: 3px solid #7a5cc4; }
.es-tuile-alerte { border-left: 3px solid var(--alerte); }
.es-budgets { margin: 0 0 6px; }
.es-alertes { margin: 0 0 12px; padding: 8px 12px 8px 28px; border-radius: 6px; background: var(--alerte-fond); color: var(--alerte); font-size: 13px; }
.es-alertes li + li { margin-top: 2px; }
/* Grille jour par jour : couleur de la case selon l'origine du donné */
.es-grille-defil { max-width: 100%; }
.es-grille { font-size: 12px; border-collapse: separate; border-spacing: 0; }
.es-grille th, .es-grille td { padding: 3px 4px; white-space: nowrap; }
.es-grille tbody th { text-align: left; font-weight: 500; position: sticky; left: 0; background: var(--surface); z-index: 1; max-width: 260px; overflow: hidden; text-overflow: ellipsis; }
.es-grille thead th { font-size: 11px; line-height: 1.2; }
.es-grille tbody th { text-transform: none; letter-spacing: normal; font-size: 12.5px; color: var(--texte); }
.es-attente, td.es-attente { background: #f1f3f7; color: var(--texte-2); }
.es-numero { white-space: nowrap; }
.es-actions { display: flex; flex-wrap: wrap; gap: 4px; min-width: 180px; }
.es-grille .es-we { background: #f4f6fa; }
.es-case { border: 0; background: transparent; padding: 2px 4px; min-width: 26px; font: inherit; font-variant-numeric: tabular-nums; cursor: pointer; border-radius: 4px; color: inherit; }
.es-case:hover, .es-case:focus-visible { outline: 2px solid var(--bleu); outline-offset: -1px; }
.es-case-choisie { outline: 2px solid var(--navy); }
.es-sur, td.es-sur { background: var(--bleu-pale); color: var(--bleu-fonce); }
.es-sans, td.es-sans { background: #efeafa; color: #5a3fa6; }
.es-mixte, td.es-mixte { background: #e6e1f7; color: #3f2f86; }
.es-ecart, td.es-ecart { background: var(--alerte-fond); color: var(--alerte); }
.es-non-donne, td.es-non-donne { background: var(--danger-fond); color: var(--danger); }
.es-legende { display: flex; flex-wrap: wrap; gap: 6px 10px; margin: 0 0 8px; font-size: 12px; }
.es-legende span { padding: 2px 8px; border-radius: 10px; }
.es-jour { margin: 12px 0 0; padding: 10px 12px; border: 1px solid var(--grille); border-radius: 8px; background: var(--fond); }
.es-jour h3 { margin: 0 0 8px; font-size: 14px; }
.es-releve { margin: 16px 0 0; padding: 12px 14px; border: 1px solid var(--grille); border-radius: 8px; background: var(--surface); display: flex; flex-direction: column; gap: 8px; }
.es-releve h3, .es-releve p { margin: 0; }
.es-mcs { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 6px; }
.es-mcs li { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 6px 0; border-bottom: 1px solid var(--grille); }
.es-avertissement { color: var(--alerte); font-size: 13px; }
/* Fenêtre de saisie d'une fourniture sans commande */
.confirmation.es-dialogue { width: min(980px, calc(100vw - 32px)); max-height: calc(100vh - 32px); overflow: auto; border-top-color: #7a5cc4; }
.es-form-fourniture { display: flex; flex-direction: column; gap: 10px; }
.es-dialogue .case { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--texte-2); }
.es-dialogue .case input { min-height: 0; width: auto; }
.es-form-fourniture h2, .es-form-fourniture p { margin: 0; }
.es-champs { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 10px; align-items: end; }
.es-canaux { display: flex; flex-wrap: wrap; gap: 4px 14px; margin: 0; padding: 6px 10px; border: 1px solid var(--grille); border-radius: 6px; }
.es-canaux legend { font-size: 12px; font-weight: 600; color: var(--texte-2); padding: 0 4px; }
.es-lignes-fourniture { font-size: 13px; }
.es-lignes-fourniture td { vertical-align: top; }
.es-lignes-fourniture .es-col-article { min-width: 320px; white-space: normal; }
.es-lignes-fourniture .es-col-article input[type="text"] { width: 100%; min-width: 260px; }
.es-lignes-fourniture input.champ-court { width: 80px; text-align: right; }
.es-lignes-fourniture input[aria-invalid="true"] { border-color: var(--danger); box-shadow: 0 0 0 1px var(--danger); }
.es-ligne-hc td { background: #fffaf0; }
.es-hc-champs { display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; }
.es-hc-champs input[type="text"] { flex: 1 1 220px; min-width: 200px; }
.es-hc-champs label { display: inline-flex; gap: 4px; align-items: center; font-size: 12px; color: var(--texte-2); }
.es-hc-champs select { width: auto; max-width: 240px; }
.es-ligne-hc select[data-es-f="unite"], .es-ligne-hc .combo:has(select[data-es-f="unite"]) { min-width: 110px; }
.es-inconnu { display: block; color: var(--danger); font-size: 12px; }
.es-messages { display: flex; flex-direction: column; gap: 4px; }
.es-avertissements { margin: 0; padding-left: 18px; color: var(--alerte); font-size: 12.5px; }
.es-total { font-size: 14px; }
.es-dialogue-boutons { justify-content: flex-end; }
/* Contrôle du mois */
.es-points { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 4px; font-size: 13px; }
.es-point-bloquant { color: var(--texte); }
.es-detail-site h4 { margin: 8px 0 4px; font-size: 13.5px; }
.es-table-hc { font-size: 12.5px; }
/* Lignes hors catalogue déjà acceptées ou corrigées : repliées sous un lien */
.es-hc-traitees { margin: 8px 0 4px; font-size: 13px; }
.es-resultat ul { margin: 0; padding-left: 18px; font-size: 13px; }
.es-resultat .es-ko { color: var(--danger); }
#es-table-controle tr.ex-ouverte td { background: var(--bleu-pale); }
@media (max-width: 760px) {
  .es-lignes-fourniture .es-col-article { min-width: 220px; }
  .es-lignes-fourniture .es-col-article input[type="text"] { min-width: 180px; }
}
/* ── Revalorisation tarifaire (onglet revalo) ── */
.rv-large { grid-column: 1 / -1; }
.rv-large input, .rv-large textarea, #rv-courrier textarea, #rv-taux textarea { width: 100%; font: inherit; }
.rv-famille { margin: 14px 0; padding: 10px 12px; border: 1px solid var(--grille); border-radius: 8px; background: var(--fond); }
.rv-famille h3, .rv-famille legend { margin: 0 0 8px; font-size: 14px; }
.rv-taux { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; margin: 8px 0 0; }
.rv-termes input, .rv-lignes input, .rv-lignes select { font: inherit; }
.rv-lignes .champ-ligne { min-width: 240px; }
/* Circuit de validation d'un courrier : +1 du site → DR → validation globale du DO */
.rv-circuit { display: flex; flex-wrap: wrap; gap: 6px 18px; margin: 8px 0 0; padding: 0; list-style: none; font-size: 0.9em; }
.rv-circuit .rv-etape { padding: 2px 10px; border-radius: 12px; border: 1px solid currentColor; opacity: 0.7; }
.rv-circuit .rv-etape-faite { opacity: 1; }
.rv-circuit .rv-etape-attendue { opacity: 1; font-weight: 600; }
.rv-lignes .rv-article { max-width: 280px; }
.rv-copies { margin: 4px 0 10px; padding-left: 18px; font-size: 13px; }
.rv-copies .rv-exclue { color: var(--texte-3); text-decoration: line-through; }
.rv-anomalies { margin: 8px 0 0; padding: 0; list-style: none; display: grid; gap: 4px; font-size: 13px; }
.rv-anomalies .rv-bloquant { color: var(--danger); }
.rv-documents { margin: 6px 0; padding-left: 18px; }
.rv-invalide { border-color: var(--danger) !important; background: var(--danger-fond); }
/* Volet Indices : suivi des indices de l'INSEE */
.rv-indices-corps { display: grid; gap: 12px; }
/* Revalorisation : filtres d'organisation sous les volets (DO, région, secteur, sous-secteur, grand compte, type de contrat, site) */
.rv-organisation { margin: 10px 0 0; }
.rv-filtres { margin: 10px 0 0; }
.rv-filtres > summary { cursor: pointer; color: var(--texte-2); font-size: 13px; }
.rv-filtres[open] > summary { margin-bottom: 4px; }
#rv-sous-volets { margin: 10px 0 0; }
.rv-etape-afaire + .rv-etape-afaire { margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--grille); }
.rv-etape-titre { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; margin-bottom: 8px; }
.rv-etape-titre h3 { margin: 0; font-size: 15px; }
.rv-etape-titre .barre-actions { margin: 0; }
.rv-force { color: var(--alerte); cursor: help; font-weight: 600; }
.rv-nouvelle { margin-top: 16px; }
.rv-nouvelle > summary { cursor: pointer; color: var(--bleu); font-weight: 600; }
.rv-nouvelle .formulaire-ligne { margin-top: 8px; }
#rv-afaire { padding: 12px 0 14px; }
#rv-afaire > .ex-puces, #rv-afaire > .vide, #rv-afaire .rv-etape-titre, #rv-afaire .rv-nouvelle { margin-left: 16px; margin-right: 16px; }
/* Tarifs à aligner : phrase d'explication sous le titre de la section ; actions de la fiche sous le tableau des prestations */
#rv-afaire .rv-etape-note { margin: 0 16px 8px; }
#rv-aligner-fiche { padding: 10px 16px 14px; }
#rv-revisions > .barre-actions { padding: 12px 16px 4px; margin: 0; }
.rv-resume { display: flex; flex-wrap: wrap; gap: 8px 28px; margin: 0 0 10px; }
.rv-resume > div { min-width: 110px; }
.rv-resume dt { font-size: 12px; color: var(--texte-2); text-transform: uppercase; letter-spacing: .03em; }
.rv-resume dd { margin: 2px 0 0; font-size: 18px; font-weight: 600; }
.rv-actions { position: relative; }
.rv-menu { position: relative; display: inline-block; }
.rv-menu > summary { list-style: none; cursor: pointer; }
.rv-menu > summary::-webkit-details-marker { display: none; }
.rv-menu > summary::after { content: ' ▾'; }
.rv-menu-liste { position: absolute; z-index: 30; top: calc(100% + 4px); left: 0; display: grid; gap: 4px; min-width: 230px; padding: 6px; background: var(--surface); border: 1px solid var(--bordure); border-radius: 6px; box-shadow: var(--ombre); }
.rv-menu-liste .btn { width: 100%; text-align: left; }
#rv-volet { display: flex; flex-direction: column; gap: 16px; }
.rv-pli > summary { cursor: pointer; padding: 14px 16px; list-style-position: inside; }
.rv-pli > summary .rv-pli-titre { font-size: 16px; font-weight: 600; }
.rv-pli[open] > summary { border-bottom: 1px solid var(--grille); }
.rv-pli .carte-corps + .carte-corps { border-top: 1px solid var(--grille); }
.rv-pli h3 { margin: 0 0 8px; font-size: 15px; }
/* Lecture du courrier dans l'outil : visionneuse à gauche, décision à droite (volet des PDF) */
.volet-pdf.rv-lecture { grid-template-columns: minmax(0, 3fr) minmax(320px, 2fr); }
.volet-pdf.rv-lecture:focus { outline: none; }
.rv-lecture-outils { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 6px 10px; }
.rv-lecture-outils .segments { margin: 0; }
.rv-lecture-attente { margin: 24px 16px; }
.rv-lecture-panneau h2 { margin: 0 0 4px; font-size: 18px; overflow-wrap: anywhere; }
.rv-lecture-panneau > p { margin: 6px 0; }
.rv-lecture-panneau .barre-actions { margin-top: 12px; }
.rv-lecture-taux { width: 100%; margin: 10px 0 6px; border-collapse: collapse; font-size: 13px; }
.rv-lecture-taux th, .rv-lecture-taux td { padding: 5px 6px; border-bottom: 1px solid var(--grille); text-align: left; vertical-align: top; }
.rv-lecture-taux .nombre { text-align: right; white-space: nowrap; }
.rv-lecture-rejets { margin: 8px 0; font-size: 13px; }
.rv-lecture-rejets ul { margin: 4px 0 0; padding-left: 18px; }
@media (max-width: 900px) { .volet-pdf.rv-lecture { grid-template-columns: 1fr; } }
#rv-organisation .fiches-actifs { margin: 8px 0 0; }
.rv-indices-corps h3 { margin: 6px 0 0; font-size: 15px; }
/* Fiche d'un indice : évolution (courbe des valeurs, série raccordée en pointillés, glissement sur un an), substitution proposée */
.rv-evolution { position: relative; height: 280px; }
.rv-evolution-chiffres { margin: 0; font-size: 13px; color: var(--texte-2); }
.rv-substitution { padding: 8px 12px; border: 1px solid var(--bordure); border-left: 4px solid var(--bleu); border-radius: var(--rayon); background: var(--bleu-pale); }
.rv-substitution p { margin: 4px 0; }
/* Transmission d'un courrier signé : envoi (date, mode), puis diffusion (espace client, copies internes, contacts clients) */
.rv-transmettre .formulaire-ligne { margin: 0 0 10px; }
.rv-diffusion { display: grid; gap: 6px; margin: 0 0 12px; font-size: 14px; }
.rv-diffusion p { margin: 0 0 0 24px; }
.rv-diffusion-client { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.rv-diffusion-client input[type="text"] { flex: 1 1 260px; max-width: 520px; }
.rv-indices-corps .formulaire-ligne { margin: 0; }
.rv-indices-corps .formulaire-ligne label.rv-case { display: flex; align-self: center; }
.rv-case input[type="checkbox"] { width: 16px; height: 16px; min-height: 0; margin: 0; accent-color: var(--bleu); }
#rv-table-revisions tr td:first-child { width: 28px; }

/* ── Extranet : catalogue du site, catalogue national, prestations annexes (2.68.0) ── */
/* public/js/extranet-catalogue.js : volets en colonne, barres d'outils et de lot, tuiles-filtres, bandeau du site et taux modifiables sur
   place, champs courts (taux, prix proposés), recherche, pagination, dialogue d'un motif, choix d'un article (acceptation d'une demande),
   lignes cochées, doublons de prestations ; téléphone : champs à la largeur, aucun défilement horizontal de la page */
#vue-extranet .ec-volet { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
#vue-extranet .ec-barre { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin: 10px 0; min-width: 0; }
#vue-extranet .ec-barre .segments button { padding: 5px 10px; font-size: 12.5px; }
#vue-extranet .ec-actions-lot { padding: 8px 10px; border: 1px solid var(--grille); border-radius: var(--rayon); background: var(--fond); }
#vue-extranet .ec-actions-lot .champ-inline select { width: auto; }
#vue-extranet .ec-indicateurs { margin: 12px 0 4px; }
#vue-extranet .ec-tuile { display: block; width: 100%; text-align: left; font: inherit; color: inherit; cursor: pointer; border: 1px solid var(--bordure); }
#vue-extranet .ec-tuile > span { display: block; }
#vue-extranet .ec-tuile:hover { border-color: var(--bleu); }
#vue-extranet .ec-tuile:focus-visible { outline: 2px solid var(--bleu); outline-offset: 2px; }
#vue-extranet .ec-tuile-active { border-color: var(--bleu); background: var(--bleu-pale); }
#vue-extranet .ec-tuile-alerte .indicateur-valeur { color: var(--alerte); }
#vue-extranet .ec-bandeau { display: flex; flex-direction: column; gap: 6px; margin: 10px 0; padding: 10px 12px; border: 1px solid var(--grille); border-radius: var(--rayon); background: var(--fond); font-size: 13px; }
#vue-extranet .ec-bandeau-ligne { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; }
#vue-extranet .ec-taux { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin: 0; }
#vue-extranet .ec-taux label { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; color: var(--texte-2); }
#vue-extranet .ec-applique { color: var(--navy); }
#vue-extranet .ec-aide-taux { flex-basis: 100%; font-size: 12px; }
#vue-extranet input.ec-mini { width: 64px; min-width: 0; text-align: right; }
#vue-extranet input.ec-mini.ec-prix { width: 84px; }
#vue-extranet td.ec-produit { min-width: 200px; }
#vue-extranet .ec-sous-titre { margin: 16px 0 6px; font-size: 14px; color: var(--navy); }
#vue-extranet .ec-fenetre { margin: 6px 0 0; font-size: 12.5px; }
#vue-extranet .ec-recherche { display: inline-flex; align-items: center; gap: 6px; margin: 0; min-width: 0; }
#vue-extranet .ec-recherche input[type="search"] { min-width: 260px; }
#vue-extranet .ec-codes textarea { min-width: 220px; min-height: 34px; resize: vertical; font: inherit; }
#vue-extranet .ec-sous-bloc textarea { width: 100%; min-height: 48px; resize: vertical; font: inherit; }
#vue-extranet .ec-pagination { display: inline-flex; align-items: center; gap: 8px; margin-left: auto; font-size: 13px; color: var(--texte-2); }
#vue-extranet tr.ec-coche td { background: var(--bleu-pale); }
#vue-extranet .ec-choix { display: flex; flex-direction: column; gap: 8px; margin: 0; padding: 0; border: 0; min-width: 0; }
#vue-extranet fieldset.ec-choix > legend { padding: 0; margin-bottom: 4px; font-size: 12px; font-weight: 650; color: var(--texte-2); }
#vue-extranet .ec-option { display: flex; align-items: flex-start; gap: 8px; font-size: 13px; cursor: pointer; }
#vue-extranet .ec-option input { margin-top: 3px; min-height: 0; }
#vue-extranet .ec-sous-bloc { margin-left: 24px; min-width: 0; }
#vue-extranet .ec-resultats { margin: 6px 0 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 4px; font-size: 13px; }
#vue-extranet .ec-refus { padding: 6px 10px; border-left: 3px solid var(--danger); background: var(--danger-fond); }
#vue-extranet .ec-accepter h4 { margin: 0; }
#vue-extranet .ec-doublons { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 8px; }
#vue-extranet .ec-doublon { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 12px; padding: 8px 0; border-bottom: 1px solid var(--grille); font-size: 13px; }
#vue-extranet .ec-doublon:last-child { border-bottom: 0; }
#vue-extranet .ec-repli { margin: 0; }
#vue-extranet .ec-repli > form, #vue-extranet .ec-repli > .table-defil { margin: 0 14px 14px; }
#vue-extranet .carte .ec-repli { margin-top: 12px; }
.confirmation.ec-dialogue { width: min(560px, calc(100vw - 32px)); border-top-color: var(--bleu); }
.confirmation.ec-dialogue .ec-dialogue-boutons { justify-content: flex-end; margin-top: 14px; }
.confirmation.ec-dialogue input[type="text"] { width: 100%; }
@media (max-width: 640px) {
  #vue-extranet .ec-barre > * { max-width: 100%; }
  #vue-extranet .ec-recherche { width: 100%; }
  #vue-extranet .ec-recherche input[type="search"], #vue-extranet .ec-codes, #vue-extranet .ec-codes textarea { min-width: 0; width: 100%; }
  #vue-extranet .ec-barre .champ-inline select { max-width: 100%; min-width: 0; }
  #vue-extranet .ec-pagination { margin-left: 0; }
  #vue-extranet .ec-sous-bloc { margin-left: 0; }
  #vue-extranet input.ec-mini { width: 56px; }
  #vue-extranet input.ec-mini.ec-prix { width: 72px; }
  #vue-extranet td.ec-produit { min-width: 160px; }
  #vue-extranet .ec-indicateurs { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  #vue-extranet .ec-indicateurs .indicateur { padding: 10px 12px; }
  #vue-extranet .ec-indicateurs .indicateur-valeur { font-size: 20px; }
}

/* ── Onglet Carte (module Intérim) : carte de France par département (public/js/carte-france.js), détail à droite ── */
.cf-grille { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(280px, 1fr); gap: 20px; align-items: start; }
@media (max-width: 1100px) { .cf-grille { grid-template-columns: 1fr; } }
.cf-cadre { position: relative; }
.cf-svg { display: block; width: 100%; height: auto; max-height: 78vh; }
.cf-svg .cf-dep { cursor: pointer; transition: opacity .12s; }
.cf-svg .cf-dep:hover, .cf-svg .cf-dep:focus { opacity: .82; outline: none; stroke: var(--navy); stroke-width: 1.6; }
.cf-svg .cf-code, .cf-svg .cf-contour { pointer-events: none; }
.cf-bulle { position: absolute; z-index: 5; display: flex; flex-direction: column; gap: 2px; max-width: 280px; padding: 8px 10px;
  background: var(--surface); border: 1px solid var(--bordure); border-radius: 6px; box-shadow: 0 4px 14px rgba(15, 32, 64, .16);
  font-size: 12px; color: var(--texte-2); pointer-events: none; }
.cf-bulle strong { color: var(--texte); font-size: 13px; }
.cf-legende { display: flex; flex-wrap: wrap; gap: 6px 16px; margin: 10px 0 0; padding: 0; list-style: none; font-size: 12px; color: var(--texte-2); }
.cf-legende li { display: flex; align-items: center; gap: 6px; }
.cf-pastille { display: inline-block; width: 14px; height: 14px; border-radius: 3px; border: 1px solid var(--bordure); }
.cf-detail-titre { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.cf-detail-titre h3 { margin: 0 0 8px; }
.cf-chiffres { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-bottom: 12px; }
.cf-chiffre { display: flex; flex-direction: column; padding: 8px 10px; background: var(--fond); border-radius: 6px; }
.cf-chiffre span { font-size: 12px; color: var(--texte-3); }
.cf-chiffre strong { font-size: 16px; color: var(--texte); }
.cf-detail h4 { margin: 12px 0 4px; font-size: 13px; }
.cf-table-detail { width: 100%; font-size: 12px; }
#cf-table .hors-total td { font-style: italic; color: var(--texte-2); }

/* Tableau de bord : heures par type de jour (courbe semaine par semaine, synthèse) ; couleurs = SERIES_JOURS de app.js */
.graphique.cj-graphique { height: 320px; }
#cj-table .hors-total td { font-style: italic; color: var(--texte-2); }
.cj-pastille { display: inline-block; width: 14px; height: 3px; margin: 0 8px 3px 0; border-radius: 2px; vertical-align: middle; }
.cj-ouvre { background: #2563be; }
.cj-vacances { background: #14966a; }
.cj-weekend { background: #eb6834; }
.cj-ouvreInconnu { height: 0; border-top: 2px dashed #9aa6bd; background: none; }
.cj-ferie { width: 8px; height: 8px; margin: 0 11px 1px 3px; border-radius: 1px; background: #b9459a; transform: rotate(45deg); }
