/* ════════════════════════════════════════════════════════════════════
   UNIVERS — charte Éditeur A du back-office (D-F18)
   ════════════════════════════════════════════════════════════════════
   Chargée APRÈS univers-socle.min.css (Bootstrap 5.3.3 recompilé avec les
   jetons de la charte). Le socle porte la palette ; cette feuille porte les
   composants : shell, menu, en-têtes, cartes, tableaux, pastilles, et les
   blocs propres au CRM (flux, cahier d'appel, agenda…).

   Règles :
   - aucune couleur en dur : uniquement les jetons --ad-c-* (publiés par le
     socle depuis src/main/scss/_editeur-a.scss) ;
   - le soleil est un FOND d'action, jamais un texte (1,37:1 sur blanc) ;
   - Inter, graisse plafonnée à 600 ; casse normale (pas de capitales).
   Contrôle : scripts/charte/controler_palette.py.
   Même charte que mail-adns / web-adns : CHARTE_EDITEUR_A_BACKOFFICE.md.
   ════════════════════════════════════════════════════════════════════ */

:root {
  /* Rôles (noms stables pour les gabarits ; valeurs = jetons de la charte) */
  --adns-text-strong:  var(--ad-c-encre);
  --adns-text-muted:   var(--ad-c-graphite);
  --adns-font-numeric: var(--bs-body-font-family);
  /* Indicateur d'attente (D-F17) : encre — un trait soleil sur blanc ne se voit pas (1,37:1) */
  --univers-attente-couleur: var(--ad-c-encre);

  --univers-header-height: 48px;       /* barre haute ; 56 px sous 1 200 px */
  --univers-rail:          14.5rem;    /* 232 px déplié */
  --univers-rail-replie:   4rem;       /* 64 px replié (bureau) */
  --univers-rail-w:        var(--univers-rail);  /* largeur réelle du menu : 0 sous 1 200 px */
  /* Plafond 1880 px (D-F15) : le repli du menu rend 100 % de l'espace au
     contenu jusqu'à ~1970 px ; au-delà (4K), pas de lignes sans fin. */
  --univers-content-max:   1880px;
  --univers-gutter:        40px;
}

body { font-feature-settings: "cv11", "ss01"; }
b, strong, th { font-weight: 600; }

/* Liens : encre soulignée d'un trait acier, encre au survol */
a { text-decoration-color: var(--ad-c-acier); text-underline-offset: .18em; }
a:hover { text-decoration-color: currentColor; }

/* Focus : contour encre 2 px décalé de 2 px, partout et seulement au clavier */
:focus-visible { outline: 2px solid var(--ad-c-encre); outline-offset: 2px; }
.btn:focus-visible,
.form-check-input:focus-visible,
.page-link:focus-visible,
.nav-link:focus-visible {
  box-shadow: none;
  outline: 2px solid var(--ad-c-encre);
  outline-offset: 2px;
}
::selection { background: var(--ad-c-soleil-pale); color: var(--ad-c-encre); }


/* ─────────────────────────────────────────────────────────────────────
   1. COQUILLE — « L inversé » : menu pleine hauteur, barre haute sur le contenu
      Menu 232 px (64 px replié, tiroir de 280 px sous 1 200 px) · barre 48 px (56 px sous 1 200 px)
      Paliers de largeur : ceux de Bootstrap (992, 1 200…) ; jamais 1 180 ni 1 280.
   ───────────────────────────────────────────────────────────────────── */
html { scroll-padding-top: calc(var(--univers-header-height) + 8px); }

/* Lien d'évitement : premier élément focalisable, visible au focus seulement */
.lien-evitement {
  position: fixed;
  top: 8px;
  left: 8px;
  z-index: 2000;
  padding: 8px 14px;
  border-radius: 8px;
  background: var(--ad-c-encre);
  color: var(--ad-c-blanc);
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
  transform: translateY(-200%);
}
.lien-evitement:focus { transform: none; outline: 2px solid var(--ad-c-blanc); outline-offset: 2px; box-shadow: 0 0 0 4px var(--ad-c-encre); }

/* Touche (C30) : 11/500 ardoise sur neige, filet, rayon 4 px */
kbd.kbd {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  padding: 0 5px;
  border: 1px solid var(--ad-c-filet-fort);
  border-radius: 4px;
  background: var(--ad-c-neige);
  color: var(--ad-c-ardoise);
  font-family: inherit;
  font-size: 11px;
  font-weight: 500;
  line-height: 1;
  box-shadow: none;
}
kbd.kbd + kbd.kbd { margin-left: 2px; }

/* Menu latéral */
.univers-rail {
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  width: var(--univers-rail);
  display: flex;
  flex-direction: column;
  background: var(--ad-c-brume);
  border-right: 1px solid var(--ad-c-filet);
  z-index: 1020;
}
.rail-tete {
  flex: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  height: var(--univers-header-height);
  padding: 0 12px;
}
.univers-marque {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  color: var(--ad-c-encre);
  text-decoration: none;
  white-space: nowrap;
}
.univers-monogramme {
  display: inline-flex;
  flex: none;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: var(--adns-produit);
  color: var(--ad-c-blanc);
  font-weight: 600;
  font-size: 14px;
}
.univers-marque-nom { font-weight: 600; font-size: 15px; }
.univers-marque-produit { overflow: hidden; text-overflow: ellipsis; font-size: 13px; color: var(--ad-c-graphite); }
.rail-fermer { display: none; }
.rail-demo {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 0 12px 4px;
  padding: 3px 10px 3px 8px;
  border-radius: 50rem;
  background: var(--ad-c-ambre-pale);
  color: var(--ad-c-ambre);
  font-size: 12px;
  font-weight: 500;
}
.rail-contenu {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 8px 8px 12px;
}
.rail-liste { list-style: none; margin: 0; padding: 0; }
.rail-groupe { margin-top: 12px; }
.rail-section {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 28px;
  margin: 0;
  padding: 0 8px;
  font-size: 12px;
  font-weight: 500;
  color: var(--ad-c-graphite);
  white-space: nowrap;
}
.rail-section-titre { margin: 0; font-size: inherit; font-weight: inherit; color: inherit; }
.rail-section-bouton {
  cursor: pointer;
  list-style: none;
  border-radius: 6px;
}
.rail-section-bouton::-webkit-details-marker { display: none; }
.rail-section-bouton:hover { color: var(--ad-c-encre); }
.rail-chevron { font-size: 12px; }
details.rail-groupe:not([open]) .rail-chevron { transform: rotate(-90deg); }

.rail-lien {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 32px;
  margin-bottom: 1px;
  padding: 0 8px;
  border: 1px solid transparent;
  border-radius: 8px;
  color: var(--ad-c-ardoise);
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
}
.rail-icone { font-size: 16px; flex: none; width: 18px; text-align: center; }
.rail-libelle { min-width: 0; flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rail-lien:hover { color: var(--ad-c-encre); background: var(--ad-c-neige); }
/* Entrée active : carte blanche à filet, liseré soleil de 3 px, texte encre 600 (charte §23.3) */
.rail-lien.active {
  color: var(--ad-c-encre);
  font-weight: 600;
  background: var(--ad-c-blanc);
  border-color: var(--ad-c-filet);
}
.rail-lien.active::before {
  content: "";
  position: absolute;
  left: 3px;
  top: 7px;
  bottom: 7px;
  width: 3px;
  border-radius: 2px;
  background: var(--ad-c-soleil);
}
/* Badge de travail en attente : encre sur blanc, 12/600, chiffres tabulaires.
   La place est réservée dès le chargement : le libellé ne bouge pas quand le nombre arrive. */
.rail-badge {
  flex: none;
  min-width: 22px;
  height: 20px;
  padding: 0 6px;
  border: 1px solid var(--ad-c-filet);
  border-radius: 50rem;
  background: var(--ad-c-blanc);
  color: var(--ad-c-encre);
  font-size: 12px;
  font-weight: 600;
  line-height: 18px;
  text-align: center;
  font-variant-numeric: tabular-nums;
  visibility: hidden;
}
.rail-badge-plein { visibility: visible; }

.rail-pied {
  flex: none;
  padding: 8px;
  border-top: 1px solid var(--ad-c-filet);
}
.rail-recents { margin-bottom: 8px; }
.rail-version { margin: 6px 8px 2px; font-size: 11px; line-height: 1.3; color: var(--ad-c-graphite); font-variant-numeric: tabular-nums; }
.rail-replie .rail-version { display: none; }
.rail-recents .rail-section { height: 24px; }

/* Menu compte (C4) */
.compte-bouton {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  height: 40px;
  padding: 0 8px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: var(--ad-c-encre);
  font-size: 13px;
  font-weight: 500;
  text-align: left;
}
.compte-bouton:hover, .compte-bouton[aria-expanded="true"] { background: var(--ad-c-neige); }
.compte-nom { min-width: 0; }
.compte-chevron { flex: none; font-size: 12px; color: var(--ad-c-graphite); }
.user-initiale {
  display: inline-flex;
  flex: none;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--ad-c-encre);
  color: var(--ad-c-blanc);
  font-size: 11px;
  font-weight: 600;
}
.compte-menu {
  min-width: 248px;
  padding: 6px;
  border: 1px solid var(--ad-c-filet);
  border-radius: 12px;
  box-shadow: 0 8px 24px color-mix(in srgb, var(--ad-c-encre) 16%, transparent);
}
.compte-identite { display: flex; flex-direction: column; gap: 2px; margin: 0; padding: 6px 10px 8px; }
.compte-identite-nom { font-size: 14px; font-weight: 600; color: var(--ad-c-encre); }
.compte-identite-meta { font-size: 12px; color: var(--ad-c-graphite); }
.compte-item {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 32px;
  padding: 0 10px;
  border-radius: 8px;
  color: var(--ad-c-encre);
  font-size: 14px;
  font-weight: 500;
}
.compte-item .bi { color: var(--ad-c-ardoise); }
.compte-item .kbd, .compte-item .compte-etat { margin-left: auto; }
.compte-etat { font-size: 12px; font-weight: 400; color: var(--ad-c-graphite); }
.compte-item:hover, .compte-item:focus { background: var(--ad-c-brume); color: var(--ad-c-encre); }
.compte-item:active { background: var(--ad-c-perle); color: var(--ad-c-encre); }

/* Colonne de contenu et barre haute */
.univers-colonne { margin-left: var(--univers-rail-w); min-height: 100vh; }
.univers-voile {
  position: fixed;
  inset: 0;
  background: color-mix(in srgb, var(--ad-c-encre) 35%, transparent);
  z-index: 1035;
}
.univers-barre {
  position: sticky;
  top: 0;
  z-index: 1030;
  display: flex;
  align-items: center;
  gap: 12px;
  height: var(--univers-header-height);
  padding: 0 16px 0 8px;
  background: var(--ad-c-blanc);
  border-bottom: 1px solid var(--ad-c-filet);
}
.barre-bouton {
  display: inline-flex;
  flex: none;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--ad-c-ardoise);
  font-size: 20px;
}
.barre-bouton:hover { background: var(--ad-c-brume); color: var(--ad-c-encre); }
.fil { flex: 1; min-width: 0; font-size: 13px; color: var(--ad-c-graphite); }
.fil-liste { display: flex; align-items: center; margin: 0; padding: 0; list-style: none; }
.fil-etape { min-width: 0; flex: 0 1 auto; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fil-etape + .fil-etape::before { content: "›"; content: "›" / ""; margin: 0 8px; color: var(--ad-c-graphite); }
.fil-etape a { color: var(--ad-c-graphite); text-decoration: none; }
.fil-etape a:hover { color: var(--ad-c-encre); text-decoration: underline; }
.fil-etape:last-child { color: var(--ad-c-encre); font-weight: 500; }
.barre-module { display: none; flex: 1; margin: 0; font-size: 14px; font-weight: 600; color: var(--ad-c-encre); }
.barre-actions { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.barre-recherche {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 280px;
  height: 32px;
  padding: 0 6px 0 10px;
  border: 1px solid var(--ad-c-filet-fort);
  border-radius: 8px;
  background: var(--ad-c-neige);
  color: var(--ad-c-graphite);
  font-size: 13px;
  text-align: left;
}
.barre-recherche:hover { border-color: var(--ad-c-acier); background: var(--ad-c-blanc); }
.barre-recherche-texte { flex: 1; }
.barre-recherche-touches { display: inline-flex; }
.barre-bouton-texte { display: inline-flex; align-items: center; gap: 6px; height: 32px; padding-top: 0; padding-bottom: 0; }
.univers-agent.active { background: var(--ad-c-brume); border-color: var(--ad-c-acier); }

.univers-main {
  padding: 24px 0;
  scroll-margin-top: var(--univers-header-height);
}
.univers-main:focus { outline: none; }
.univers-content {
  max-width: var(--univers-content-max);
  margin: 0 auto;
  /* max() : la gouttière ne descend jamais sous l'encoche (iPhone paysage). */
  padding-left: max(var(--univers-gutter), env(safe-area-inset-left));
  padding-right: max(var(--univers-gutter), env(safe-area-inset-right));
}

/* Animation du repli seulement après un geste de l'utilisateur (classe posée par univers-rail.js) :
   au premier rendu, une transition de largeur se joue sinon à chaque chargement de page. */
@media (prefers-reduced-motion: no-preference) {
  .rail-anime .univers-rail { transition: width .15s ease-out, transform .2s ease-out, visibility 0s linear 0s; }
  .rail-anime .univers-colonne { transition: margin-left .15s ease-out; }
}

/* Bureau, menu replié : 64 px, icônes seules. Chaque entrée garde son nom (libellé masqué
   visuellement, jamais supprimé), son infobulle « Contacts — G puis C » et ses badges en pastille. */
@media (min-width: 1200px) {
  body.rail-replie { --univers-rail-w: var(--univers-rail-replie); }
  .rail-replie .univers-rail { width: var(--univers-rail-replie); }
  .rail-replie .rail-libelle,
  .rail-replie .univers-marque-nom,
  .rail-replie .univers-marque-produit,
  .rail-replie .compte-nom,
  .rail-replie .compte-chevron {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
  }
  .rail-replie .rail-tete { justify-content: center; padding: 0; }
  .rail-replie .rail-demo { justify-content: center; margin: 0 8px 4px; padding: 4px; }
  .rail-replie .rail-lien { justify-content: center; padding: 0; }
  .rail-replie .rail-section-bouton { display: none; }
  .rail-replie .rail-section {
    height: 0;
    margin: 8px 12px;
    border-top: 1px solid var(--ad-c-filet);
    font-size: 0;
    overflow: hidden;
  }
  .rail-replie .rail-groupe { margin-top: 0; }
  .rail-replie .rail-recents { display: none; }
  .rail-replie .compte-bouton { justify-content: center; padding: 0; }
  .rail-replie .rail-badge {
    position: absolute;
    top: 5px;
    left: 24px;
    min-width: 0;
    width: 9px;
    height: 9px;
    padding: 0;
    border: 0;
    background: var(--ad-c-encre);
    box-shadow: 0 0 0 2px var(--ad-c-brume);
    font-size: 0;
  }
  .rail-replie .rail-lien.active .rail-badge { box-shadow: 0 0 0 2px var(--ad-c-blanc); }
  /* Libellé en étiquette au survol et au focus, par-dessus le contenu */
  .rail-replie .rail-lien[data-rail-titre]:hover::after,
  .rail-replie .rail-lien[data-rail-titre]:focus-visible::after {
    content: attr(data-rail-titre);
    position: absolute;
    left: calc(100% + 8px);
    top: 50%;
    transform: translateY(-50%);
    padding: 4px 8px;
    border-radius: 6px;
    background: var(--ad-c-encre);
    color: var(--ad-c-blanc);
    font-size: 12px;
    font-weight: 500;
    white-space: nowrap;
    z-index: 1;
    pointer-events: none;
  }
  .rail-replie .rail-contenu { overflow: visible; }
}

/* Sous 1 200 px : barre de 56 px et tiroir de 280 px ; le reste de la page est inerte tant qu'il est ouvert */
@media (max-width: 1199.98px) {
  :root {
    --univers-header-height: 56px;
    --univers-rail-w: 0px;
    --univers-gutter: 24px;
  }
  .univers-rail {
    width: min(280px, 85vw);
    z-index: 1040;
    transform: translateX(-100%);
    visibility: hidden;
  }
  .rail-ouvert .univers-rail { transform: none; visibility: visible; }
  .rail-fermer {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: var(--ad-c-ardoise);
  }
  .rail-fermer:hover { background: var(--ad-c-blanc); color: var(--ad-c-encre); }
  .barre-module { display: block; }
  .univers-barre { padding-left: max(8px, env(safe-area-inset-left)); padding-right: max(12px, env(safe-area-inset-right)); }
  .barre-bouton { width: 40px; height: 40px; }
  /* Cibles tactiles ≥ 44 px dans le tiroir */
  .rail-lien { min-height: 44px; font-size: 15px; }
  .compte-bouton { height: 48px; }
  .univers-main { padding: 16px 0; padding-bottom: max(16px, env(safe-area-inset-bottom)); }
  /* iOS zoome au focus sur tout champ < 16 px */
  .form-control, .form-select { font-size: 16px; }
  .barre-recherche { width: 40px; height: 40px; justify-content: center; padding: 0; }
  .barre-recherche-touches { display: none; }
  /* Le libellé reste le nom accessible du bouton : masqué visuellement, jamais supprimé */
  .barre-recherche-texte { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .barre-bouton-texte { height: 40px; }
}
@media (max-width: 575.98px) {
  :root { --univers-gutter: 16px; }
  .barre-bouton-libelle { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .barre-bouton-texte { width: 40px; justify-content: center; padding: 0; }
  .fil-etape:not(:last-child):not(:nth-last-child(2)) { display: none; }
  .barre-actions { gap: 4px; }
}
/* Petit écran : la page porte déjà son titre (h1) juste dessous, la barre ne le répète pas. */
@media (max-width: 767.98px) {
  body:has(main h1) .barre-module { display: none; }
}
/* « Récents » : la page courante y est repérée en brume ; le soleil reste à la seule entrée active du menu. */
.univers-rail .rail-lien.rail-courant { background: var(--ad-c-brume); color: var(--ad-c-encre); }
@media (prefers-reduced-motion: reduce) {
  .univers-rail, .univers-colonne { transition: none; }
}


/* ─────────────────────────────────────────────────────────────────────
   2. EN-TÊTE DE PAGE, CARTES, TABLEAUX
   ───────────────────────────────────────────────────────────────────── */
.univers-breadcrumb { font-size: 13px; margin-bottom: .75rem; color: var(--ad-c-graphite); }
.univers-breadcrumb a { color: var(--ad-c-graphite); }
.page-title {
  font-size: 1.75rem;
  font-weight: 600;
  letter-spacing: -.01em;
  color: var(--ad-c-encre);
  margin-bottom: 1.25rem;
}

.card { box-shadow: none; }
.card-header {
  display: flex;
  flex-wrap: wrap;   /* titre + compteur + recherche ne tiennent pas sur 390 px */
  align-items: center;
  gap: .6rem;
  border-bottom-color: var(--ad-c-filet);
}
.card-header-title {
  flex: 1;
  margin: 0;
  font-size: 15px;
  font-weight: 600;
  color: var(--ad-c-encre);
}
.card-footer { border-top: 0; background: transparent; }
.card-dashed { border-style: dashed; border-color: var(--ad-c-filet-fort); }

/* Pastille d'icône d'en-tête de carte */
.card-header-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  flex-shrink: 0;
  border-radius: var(--bs-border-radius-sm);
  font-size: 14px;
}
.icon-blue,
.icon-muted  { background: var(--ad-c-brume);      color: var(--ad-c-encre); }
.icon-purple { background: var(--ad-c-brume);      color: var(--ad-c-ardoise); }
.icon-green  { background: var(--ad-c-vert-pale);  color: var(--ad-c-vert); }
.icon-orange { background: var(--ad-c-ambre-pale); color: var(--ad-c-ambre); }

/* Tableaux : en-tête neige 13/600 graphite, lignes à filet perle */
.table > thead > tr > th {
  --bs-table-bg: var(--ad-c-neige);
  color: var(--ad-c-graphite);
  font-size: 13px;
  font-weight: 600;
  border-bottom-color: var(--ad-c-filet);
  white-space: nowrap;
}
/* Ligne sélectionnée : soleil-pâle (socle) + liseré encre. Le liseré va sur la
   première cellule : Bootstrap peint le fond des cellules par box-shadow, qui
   recouvrirait un liseré posé sur la ligne. */
.table > tbody > tr.table-active > :first-child { position: relative; }
.table > tbody > tr.table-active > :first-child::before {
  content: "";
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 3px;
  background: var(--ad-c-encre);
}

th .sort-link {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  color: inherit;
  text-decoration: none;
  white-space: nowrap;
}
th .sort-link i { font-size: 10px; opacity: .35; }
th .sort-link:hover i { opacity: .7; }
th .sort-link.active { color: var(--ad-c-encre); }
th .sort-link.active i { opacity: 1; }

/* Tableau BORNÉ (analyse UX du 15/09, P0-1) : un tableau paginé ne fixe pas la
   hauteur de la page ; il vit dans son cadre, en-tête visible au défilement.
   Limité aux écrans hauts : sous 700 px, 60 vh serait trop court. */
@media (min-height: 700px) {
  .table-bornee { max-height: 60vh; overflow-y: auto; }
  .table-bornee > table > thead > tr > th {
    position: sticky;
    top: 0;
    z-index: 2;
    box-shadow: inset 0 -1px 0 var(--ad-c-filet);
  }
}

/* Onglets : encre 600 et trait encre de 2 px */
.nav-tabs { border-bottom: 1px solid var(--ad-c-filet); gap: .25rem; }
.nav-tabs .nav-link {
  margin-bottom: -1px;
  border: 0;
  border-bottom: 2px solid transparent;
  border-radius: 0;
  color: var(--ad-c-ardoise);
  background: transparent;
}
.nav-tabs .nav-link:hover { color: var(--ad-c-encre); border-bottom-color: var(--ad-c-filet-fort); }
.nav-tabs .nav-link.active,
.nav-tabs .nav-item.show .nav-link {
  color: var(--ad-c-encre);
  font-weight: 600;
  background: transparent;
  border-bottom-color: var(--ad-c-encre);
}
/* Pilules et segments : entrée active en carte blanche à filet */
.nav-pills { background: var(--ad-c-brume); border-radius: 10px; padding: 3px; gap: 2px; display: inline-flex; }
.nav-pills .nav-link { border: 1px solid transparent; border-radius: 8px; padding: .3rem .8rem; }
.nav-pills .nav-link.active { border-color: var(--ad-c-filet); font-weight: 600; }

/* Alertes : aplat pâle, texte encre ; l'icône garde le ton */
.alert-success .bi { color: var(--ad-c-vert); }
.alert-warning .bi { color: var(--ad-c-ambre); }
.alert-danger  .bi { color: var(--ad-c-rouge); }

/* Badges Bootstrap : pilule 22 px, aplat pâle + texte plein */
.badge { line-height: 1.35; }
.text-bg-success { background: var(--ad-c-vert-pale) !important; color: var(--ad-c-vert) !important; }
.text-bg-warning { background: var(--ad-c-ambre-pale) !important; color: var(--ad-c-ambre) !important; }
.text-bg-danger  { background: var(--ad-c-rouge-pale) !important; color: var(--ad-c-rouge) !important; }
.text-bg-light,
.text-bg-secondary { background: var(--ad-c-brume) !important; color: var(--ad-c-ardoise) !important; }


/* ─────────────────────────────────────────────────────────────────────
   3. COMPOSANTS MAISON (fragments components.html)
   ───────────────────────────────────────────────────────────────────── */

/* Pastilles d'état : pilule, aplat pâle, texte plein 600, sans bordure */
.bl-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 22px;
  padding: 1px 9px;
  border: 0;
  border-radius: 50rem;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.4;
  white-space: nowrap;
  text-decoration: none;
}
.bl-badge:hover  { text-decoration: none; }
/* score = filtre actif, sélection : soleil-pâle. blue = information (sens d'un
   appel, « reçu », compteurs) : neutre — le jaune partout ne signalerait plus rien. */
.bl-badge-score  { background: var(--ad-c-soleil-pale); color: var(--ad-c-encre); }
.bl-badge-blue   { background: var(--ad-c-brume);       color: var(--ad-c-encre); }
.bl-badge-green,
.bl-badge-success { background: var(--ad-c-vert-pale);   color: var(--ad-c-vert); }  /* -success : statut CONFIRMEE des commandes, sans règle jusqu'ici */
.bl-badge-orange { background: var(--ad-c-ambre-pale);  color: var(--ad-c-ambre); }
.bl-badge-red    { background: var(--ad-c-rouge-pale);  color: var(--ad-c-rouge); }
.bl-badge-purple,
.bl-badge-muted  { background: var(--ad-c-brume);       color: var(--ad-c-ardoise); }

/* Adresse e-mail : adresse + badge mail-adns + signal + menu ⋯ (cadrage §9) */
.adresse-email { display: inline-flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.adresse-email-menu { color: var(--ad-c-graphite); line-height: 1; }
.adresse-email-menu:hover { color: var(--ad-c-encre); }

/* Qualifications (onglet Tags, vivier 4D) */
.qualif-chip        { cursor: default; }
.qualif-chip-mesure { background: var(--ad-c-brume); color: var(--ad-c-ardoise); }
.qualif-chip-val {
  padding: 0 6px;
  border-radius: 50rem;
  background: var(--ad-c-blanc);
  font-weight: 600;
}

/* Champ en lecture (AdnsFieldFront, mode display) — casse normale */
.adns-field { display: flex; flex-direction: column; margin-bottom: 14px; }
.adns-field-label {
  margin-bottom: 4px;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--ad-c-graphite);
}
.adns-field-value { font-size: 14px; line-height: 1.5; color: var(--ad-c-encre); }

/* Tuile KPI : blanche à filet, grand chiffre 600 */
.kpi-tile-value {
  font-size: 2.25rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  letter-spacing: -.02em;
  line-height: 1.1;
  color: var(--ad-c-encre);
}
@media (max-width: 575.98px) {
  .kpi-tile-value { font-size: 1.75rem; }
  .page-title { font-size: 1.5rem; }
}
.kpi-tile-label { font-size: 13px; font-weight: 500; color: var(--ad-c-graphite); }
.kpi-tile-meta  { font-size: 12px; color: var(--ad-c-graphite); }


/* Infobulles : le socle les habille en encre ; texte aligné à gauche (D-F13) */
.tooltip-inner { text-align: left; line-height: 1.45; }
/* Une icône devenue focusable (nom accessible posé par le module) montre son focus */
[role="img"]:focus-visible { border-radius: 2px; }


/* ─────────────────────────────────────────────────────────────────────
   4. FRISES ET FLUX
   ───────────────────────────────────────────────────────────────────── */
/* Séparateur de période dans les timelines (UX-4) */
.periode-separator td {
  --bs-table-bg: var(--ad-c-neige);
  padding: .35rem 1.1rem;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ad-c-graphite);
}

/* Flux « Ce qui se passe » : rail vertical continu, en-têtes de jour, pastille par type */
.flux-timeline { position: relative; padding: .35rem 1.1rem .9rem; }
.flux-timeline::before {
  content: "";
  position: absolute;
  left: calc(1.1rem + 15px);
  top: .75rem;
  bottom: .9rem;
  width: 2px;
  background: var(--ad-c-perle);
}
.flux-jour {
  position: relative;
  z-index: 1;
  display: inline-block;
  margin: .55rem 0 .15rem;
  padding: .1rem .5rem .1rem 0;
  background: var(--bs-card-bg, var(--ad-c-blanc));
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ad-c-graphite);
}
.flux-item { position: relative; display: flex; align-items: flex-start; gap: .7rem; padding: .4rem 0; }
.flux-dot {
  position: relative;
  z-index: 1;
  flex: none;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1px solid var(--ad-c-filet);
  background: var(--ad-c-blanc);
  color: var(--ad-c-graphite);
  font-size: 14px;
}
.flux-dot-contact,
.flux-dot-acte      { color: var(--ad-c-encre); border-color: var(--ad-c-filet-fort); background: var(--ad-c-brume); }
.flux-dot-organisme { color: var(--ad-c-ardoise); background: var(--ad-c-brume); }
/* Signaux « l'autre a agi » (lecture, clic) : même vert que les issues positives */
.flux-dot-facture,
.flux-dot-lecture,
.flux-dot-clic      { color: var(--ad-c-vert); border-color: transparent; background: var(--ad-c-vert-pale); }
.flux-body { flex: 1; min-width: 0; }
.flux-titre { display: flex; align-items: center; flex-wrap: wrap; gap: .4rem; line-height: 1.3; }
.flux-titre a { font-weight: 500; text-decoration: none; overflow-wrap: anywhere; }
.flux-titre a:hover { text-decoration: underline; }
.flux-meta { margin-top: .1rem; font-size: 12px; color: var(--ad-c-graphite); }
.flux-time { flex: none; padding-top: .35rem; font-size: 12px; color: var(--ad-c-graphite); white-space: nowrap; }

/* Feed d'activités (fiche personne, D-A9) */
.act-feed { padding-top: 12px; }
.act-feed-periode { margin: 14px 0 8px; font-size: 12.5px; font-weight: 600; color: var(--ad-c-graphite); }
.act-feed-item { position: relative; padding-left: 42px; padding-bottom: 16px; }
.act-feed-item::before {
  content: "";
  position: absolute;
  left: 15px;
  top: 34px;
  bottom: -2px;
  width: 1px;
  background: var(--ad-c-perle);
}
.act-feed-item:last-child::before { display: none; }
.act-feed-dot {
  position: absolute;
  left: 0;
  top: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 31px;
  height: 31px;
  border-radius: 50%;
  border: 1px solid var(--ad-c-filet);
  background: var(--ad-c-blanc);
  font-size: 14px;
}
.act-feed-tete { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; min-height: 31px; }
.act-feed-tete a { font-weight: 500; text-decoration: none; }
.act-feed-avatar {
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--ad-c-encre);
  color: var(--ad-c-blanc);
  font-size: 10px;
  font-weight: 600;
}
.act-feed-date { margin-left: auto; white-space: nowrap; }
.act-feed-apercu { max-width: 760px; margin-top: 2px; font-size: 13px; color: var(--ad-c-graphite); }
.act-feed-meta { display: flex; gap: 12px; margin-top: 2px; }

/* Frise d'état d'un mail (D-MAIL-14) : pleine = constatée, creuse = pas encore constatée */
.mail-frise { display: flex; align-items: center; flex-wrap: wrap; gap: 2px; margin: 0; padding: 0; list-style: none; }
.mail-frise li { display: flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 500; }
.mail-frise li + li::before {
  content: "";
  flex: none;
  width: 22px;
  height: 2px;
  margin: 0 8px;
  background: var(--ad-c-filet);
}
.mail-frise-dot {
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  font-size: 13px;
}
.mail-frise li.faite .mail-frise-dot { background: var(--ad-c-vert); color: var(--ad-c-blanc); }
.mail-frise li.attendue { color: var(--ad-c-graphite); font-weight: 400; }
.mail-frise li.attendue .mail-frise-dot {
  border: 2px dashed var(--ad-c-filet-fort);
  background: var(--ad-c-blanc);
  color: var(--ad-c-graphite);
}


/* ─────────────────────────────────────────────────────────────────────
   5. CAHIER D'APPEL (F-17) — registre du standard 3CX
   Couleurs réservées à ce qui distingue une ligne (sens, appel manqué).
   ───────────────────────────────────────────────────────────────────── */
.cahier-jour-separator td {
  --bs-table-bg: var(--ad-c-neige);
  padding: .5rem 1.1rem .25rem;
  border-bottom: 1px solid var(--ad-c-filet);
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ad-c-encre);
}
/* Le flex va sur un div INTERNE : posé sur le <td>, il sort la cellule du modèle
   table et la grille des colonnes se disloque (vu au rendu, 22/09). */
.cahier-jour-ligne { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; }
.cahier-jour-total { font-size: 12px; font-weight: 400; color: var(--ad-c-graphite); white-space: nowrap; }
.cahier-jour-manques { color: var(--ad-c-ambre); }

.cahier-appel-table td { vertical-align: middle; font-size: .8125rem; }
.cahier-appel-table thead th { position: sticky; top: 0; z-index: 2; }
.cahier-ligne-manquee td { opacity: .72; }
/* « 8 min / 33 s » sur deux lignes se relit deux fois */
.cahier-appel-table td.cahier-nombre { white-space: nowrap; }

.cahier-correspondant { font-weight: 500; text-decoration: none; }
.cahier-societe { font-size: 12px; line-height: 1.3; color: var(--ad-c-graphite); }
.cahier-inconnu { color: var(--ad-c-graphite); }
.cahier-numero { color: var(--ad-c-encre); text-decoration: none; white-space: nowrap; }
.cahier-numero:hover { text-decoration: underline; }
.cahier-operateur { font-size: 12px; font-variant-numeric: tabular-nums; color: var(--ad-c-graphite); }

.cahier-dit { line-height: 1.35; }
.cahier-resume { color: var(--ad-c-encre); text-decoration: none; }
.cahier-resume:hover { text-decoration: underline; }
.cahier-resume-parole { font-style: italic; color: var(--ad-c-graphite); }
.cahier-resume-vide { color: var(--ad-c-graphite); }

.cahier-recherche {
  display: flex;
  align-items: center;
  gap: .4rem;
  padding: .2rem .7rem;
  border: 1px solid var(--ad-c-acier);
  border-radius: 50rem;
  background: var(--ad-c-blanc);
  color: var(--ad-c-graphite);
}
.cahier-recherche:focus-within { border-color: var(--ad-c-encre); box-shadow: 0 0 0 1px var(--ad-c-encre); }
.cahier-recherche input { width: 220px; border: 0; outline: 0; background: transparent; font-size: 13px; }
.cahier-recherche-effacer { font-size: 12px; color: var(--ad-c-graphite); }
@media (max-width: 575.98px) {
  .cahier-recherche { flex: 1 1 100%; margin-left: 0 !important; }
  .cahier-recherche input { width: 100%; min-width: 0; }
}

/* Transcription (D-CA7) — ouverte à la demande sous la ligne d'appel */
.cahier-transcription-btn {
  min-height: 28px; /* cible ≥ 24 px (WCAG 2.5.8), relevé axe du 05/10 */
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  margin-right: .45rem;
  padding: .1rem .55rem;
  border: 1px solid var(--ad-c-filet-fort);
  border-radius: 50rem;
  background: var(--ad-c-blanc);
  color: var(--ad-c-encre);
  font-size: 12px;
  white-space: nowrap;
}
.cahier-transcription-btn:hover { background: var(--ad-c-brume); }
.cahier-transcription-btn .bi-chevron-right { transition: transform .15s ease; }
.cahier-transcription-btn.ouvert .bi-chevron-right { transform: rotate(90deg); }
.cahier-transcription-cellule { --bs-table-bg: var(--ad-c-neige); padding: 0 1.1rem 1rem; }
.cahier-transcription-panneau {
  padding: .75rem .9rem;
  border: 1px solid var(--ad-c-filet);
  border-radius: var(--bs-border-radius);
  background: var(--ad-c-blanc);
}
.cahier-transcription-entete { display: flex; align-items: center; gap: .6rem; margin-bottom: .6rem; }
.cahier-transcription-copier {
  padding: .1rem .55rem;
  border: 1px solid var(--ad-c-filet-fort);
  border-radius: 50rem;
  background: var(--ad-c-blanc);
  color: var(--ad-c-encre);
  font-size: 12px;
}
.cahier-transcription-segments { max-height: 22rem; margin: 0; padding: 0; overflow-y: auto; list-style: none; }
.cahier-transcription-segments li { display: flex; gap: .7rem; padding: .3rem 0; font-size: .8125rem; line-height: 1.55; }
/* Une ligne de 150 caractères ne se lit pas : mesure du texte plafonnée */
.cahier-transcription-segments li span:last-child { max-width: 78ch; }
.cahier-tc { min-width: 3.2rem; padding-top: .15rem; font-size: 12px; font-variant-numeric: tabular-nums; color: var(--ad-c-graphite); }
.cahier-transcription-garde {
  margin: .6rem 0 0;
  padding-top: .45rem;
  border-top: 1px dashed var(--ad-c-filet-fort);
  font-size: 12px;
  color: var(--ad-c-graphite);
}
.cahier-transcription-attente { padding: .6rem 0; font-size: 12.5px; color: var(--ad-c-graphite); }

/* Journal de pilotage (UNI-872) — même registre que le cahier : jour par jour, texte intégral */
.journal-jours { display: flex; flex-direction: column; gap: 1rem; }
.journal-jour { border: 1px solid var(--ad-c-filet); border-radius: var(--bs-border-radius); }
.journal-jour-titre {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  margin: 0;
  padding: .5rem 1.1rem;
  border-bottom: 1px solid var(--ad-c-filet);
  background: var(--ad-c-neige);
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ad-c-encre);
}
.journal-jour-total { font-size: 12px; font-weight: 400; color: var(--ad-c-graphite); white-space: nowrap; }
.journal-vide { margin: 0; padding: .6rem 1.1rem; font-size: 12.5px; color: var(--ad-c-graphite); }
.journal-entrees { margin: 0; padding: 0 1.1rem; list-style: none; }
.journal-entrees li { display: flex; gap: .8rem; padding: .55rem 0; border-bottom: 1px solid var(--ad-c-filet); }
.journal-entrees li:last-child { border-bottom: 0; }
.journal-heure {
  min-width: 2.8rem;
  padding-top: .1rem;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  color: var(--ad-c-graphite);
  text-decoration: none;
}
.journal-heure:hover { text-decoration: underline; }
/* Une ligne de 150 caractères ne se lit pas : mesure du texte plafonnée, comme la transcription */
.journal-texte { max-width: 90ch; min-width: 0; font-size: .8125rem; line-height: 1.55; overflow-wrap: anywhere; }
.journal-sujet { display: block; font-weight: 600; color: var(--ad-c-encre); }
.journal-contenu { white-space: pre-line; color: var(--ad-c-encre); }
.journal-cle {
  padding: 0 .3rem;
  border-radius: 4px;
  background: var(--ad-c-brume);
  color: var(--ad-c-encre);
  font-family: var(--bs-font-monospace);
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
}
.journal-cle:hover { text-decoration: underline; }


/* ─────────────────────────────────────────────────────────────────────
   6. AGENDA (P-A2) — FullCalendar aux couleurs de la charte
   Jamais de couleur en dur côté JSON : tout vit ici.
   ───────────────────────────────────────────────────────────────────── */
#agenda-calendrier .fc-event.agenda-evt {
  border-color: var(--ad-c-filet-fort);
  background: var(--ad-c-brume);
  color: var(--ad-c-encre);
  font-size: 12px;
}
#agenda-calendrier .fc-event.agenda-aregler {
  border-color: var(--ad-c-ambre);
  background: var(--ad-c-ambre-pale);
  color: var(--ad-c-ambre);
}
#agenda-calendrier .fc-list-event.agenda-aregler .fc-list-event-title a { color: var(--ad-c-ambre); }
/* FullCalendar pose la classe .fc sur #agenda-calendrier LUI-MÊME : un sélecteur
   « #agenda-calendrier .fc … » ne touchait rien (les boutons restaient au gris-bleu de FC). */
#agenda-calendrier .fc-button-primary {
  border-color: var(--ad-c-filet-fort);
  background: var(--ad-c-blanc);
  color: var(--ad-c-encre);
  font-weight: 600;
  text-transform: none;
  box-shadow: none;
}
#agenda-calendrier .fc-button-primary:hover { border-color: var(--ad-c-acier); background: var(--ad-c-brume); color: var(--ad-c-encre); }
#agenda-calendrier .fc-button-primary:not(:disabled).fc-button-active,
#agenda-calendrier .fc-button-primary:not(:disabled):active {
  border-color: var(--ad-c-encre);
  background: var(--ad-c-encre);
  color: var(--ad-c-blanc);
}
#agenda-calendrier .fc-button-primary:disabled { border-color: var(--ad-c-filet); background: var(--ad-c-blanc); color: var(--ad-c-graphite); }
/* Numéros de jour et en-têtes : des liens de navigation, pas du texte courant */
#agenda-calendrier a { color: var(--ad-c-encre); text-decoration: none; }
/* Jours hors du mois : FullCalendar les estompe à 30 % (1,98:1) ; graphite reste lisible (5,41:1) et distinct */
#agenda-calendrier .fc-day-other .fc-daygrid-day-top { opacity: 1; }
#agenda-calendrier .fc-day-other .fc-daygrid-day-number { color: var(--ad-c-graphite); }
#agenda-calendrier a:hover { text-decoration: underline; }
#agenda-calendrier .fc-daygrid-event-dot { border-color: currentColor; }
#agenda-calendrier .fc-toolbar-title { font-size: 1.25rem; font-weight: 600; }
#agenda-calendrier .fc-daygrid-day.fc-day-today { background: var(--ad-c-soleil-pale); }
.agenda-legende {
  display: inline-block;
  width: 12px;
  height: 12px;
  border: 1px solid var(--ad-c-filet-fort);
  border-radius: 3px;
  background: var(--ad-c-brume);
  vertical-align: -1px;
}
.agenda-legende-aregler { border-color: var(--ad-c-ambre); background: var(--ad-c-ambre-pale); }


/* ─────────────────────────────────────────────────────────────────────
   7. CONNEXION ET PAGES D'ERREUR
   ───────────────────────────────────────────────────────────────────── */
.login-body { display: flex; flex-direction: column; min-height: 100vh; background: var(--ad-c-brume); }
.login-page { flex: 1; display: flex; align-items: center; justify-content: center; padding: 24px 16px; }
.login-card { width: 100%; max-width: 360px; }
.login-brand {
  display: inline-flex;
  align-items: center;
  gap: .6rem;
  font-size: 20px;
  font-weight: 600;
  color: var(--ad-c-encre);
}
.login-brand small { font-size: 15px; font-weight: 400; color: var(--ad-c-graphite); }

/* Pied commun des surfaces publiques (D-P7), porté par le login */
.v7-footer { padding: 28px 0 40px; font-size: 13px; color: var(--ad-c-graphite); }
.v7-footer .v7-wrap {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 16px;
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 24px;
}
.v7-footer a { color: var(--ad-c-ardoise); }
.v7-brand-footer { font-weight: 600; color: var(--ad-c-encre); }
.v7-brand-footer small { font-weight: 400; color: var(--ad-c-graphite); }


/* ─────────────────────────────────────────────────────────────────────
   8. PAGES REÇUES PAR LE CLIENT (partage cloud /d/…, validation de commande /c/…)
   Pages publiques, sans menu : même charte que le CRM qui les envoie.
   ───────────────────────────────────────────────────────────────────── */
body.page-client { min-height: 100vh; background: var(--ad-c-brume); }
.page-client-marque {
  display: flex;
  align-items: center;
  gap: .6rem;
  margin-bottom: 1.5rem;
  color: var(--ad-c-encre);
}
.page-client-titre {
  font-size: 1.375rem;
  font-weight: 600;
  letter-spacing: -.01em;
  color: var(--ad-c-encre);
}
.page-client-icone { width: 44px; height: 44px; font-size: 20px; }
.page-client-emetteur { font-size: 1.125rem; font-weight: 600; color: var(--ad-c-encre); }


/* ─────────────────────────────────────────────────────────────────────
   9. COUCHE SUPÉRIEURE — palette (⌘K), aide des raccourcis, confirmation, toasts
      Dialogues natifs : showModal() passe dans la couche supérieure du navigateur,
      aucun z-index. Aucune animation d'ouverture sur la palette (conception §3.3).
   ───────────────────────────────────────────────────────────────────── */
dialog.palette,
dialog.aide,
dialog.uc-dialog {
  padding: 0;
  border: 1px solid var(--ad-c-filet);
  border-radius: 12px;
  background: var(--ad-c-blanc);
  color: var(--ad-c-encre);
  box-shadow: 0 16px 48px color-mix(in srgb, var(--ad-c-encre) 22%, transparent);
  overflow: hidden;
}
dialog.palette::backdrop,
dialog.aide::backdrop,
dialog.uc-dialog::backdrop { background: color-mix(in srgb, var(--ad-c-encre) 20%, transparent); }

/* Palette — 680 px, 760 px avec l'aperçu */
dialog.palette {
  width: min(680px, calc(100vw - 24px));
  max-width: none;
  margin: 10vh auto auto;
}
.palette-corps { display: flex; flex-direction: column; }
.palette-recherche {
  display: flex;
  align-items: center;
  gap: 12px;
  height: 48px;
  padding: 0 8px 0 16px;
  border-bottom: 1px solid var(--ad-c-filet);
  color: var(--ad-c-graphite);
}
.palette-recherche:focus-within { box-shadow: inset 0 -2px 0 var(--ad-c-encre); }
.palette-champ {
  flex: 1;
  min-width: 0;
  height: 100%;
  padding: 0;
  border: 0;
  outline: none;
  background: transparent;
  color: var(--ad-c-encre);
  font-size: 16px;
}
.palette-champ::placeholder { color: var(--ad-c-graphite); opacity: 1; }
.palette-fermer {
  display: inline-flex;
  flex: none;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--ad-c-graphite);
}
.palette-fermer:hover { background: var(--ad-c-brume); color: var(--ad-c-encre); }
.palette-portees { display: flex; flex-wrap: wrap; gap: 6px; padding: 8px 12px; border-bottom: 1px solid var(--ad-c-filet); }
.palette-portee {
  height: 28px;
  padding: 0 12px;
  border: 1px solid var(--ad-c-filet-fort);
  border-radius: 50rem;
  background: var(--ad-c-blanc);
  color: var(--ad-c-ardoise);
  font-size: 13px;
  font-weight: 500;
}
.palette-portee:hover { background: var(--ad-c-neige); color: var(--ad-c-encre); }
.palette-portee[aria-pressed="true"] { border-color: var(--ad-c-encre); background: var(--ad-c-encre); color: var(--ad-c-blanc); }
.palette-zone { display: grid; grid-template-columns: minmax(0, 1fr); }
.palette-resultats {
  max-height: min(380px, 52vh);
  min-height: 160px;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 4px 8px 8px;
}
.palette-groupe-titre {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 8px 4px;
  font-size: 12px;
  font-weight: 500;
  color: var(--ad-c-graphite);
}
.palette-groupe-nombre { font-variant-numeric: tabular-nums; }
.palette-option {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 40px;
  padding: 0 8px;
  border-radius: 8px;
  color: var(--ad-c-encre);
  text-decoration: none;
  cursor: pointer;
}
.palette-option:hover { color: var(--ad-c-encre); }
.palette-option-active { background: var(--ad-c-soleil-pale); box-shadow: inset 2px 0 0 var(--ad-c-encre); }
.palette-option-icone { flex: none; width: 18px; text-align: center; font-size: 16px; color: var(--ad-c-ardoise); }
.palette-option-texte { display: flex; flex: 1; align-items: baseline; gap: 8px; min-width: 0; }
.palette-option-titre { flex: 0 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; font-weight: 500; }
.palette-option-sous { flex: 1 1 0; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; color: var(--ad-c-graphite); }
.palette-option-touches { display: inline-flex; flex: none; margin-left: auto; }
.palette-note { margin: 0; padding: 12px 8px; font-size: 13px; color: var(--ad-c-graphite); }
.palette-apercu { display: none; }
.palette-apercu-vide { margin: 0; font-size: 13px; color: var(--ad-c-graphite); }
.palette-pied {
  display: none;
  flex-wrap: wrap;
  gap: 4px 16px;
  margin: 0;
  padding: 8px 16px;
  border-top: 1px solid var(--ad-c-filet);
  background: var(--ad-c-neige);
  font-size: 12px;
  color: var(--ad-c-graphite);
}
.palette-pied > span { display: inline-flex; align-items: center; gap: 4px; }
@media (min-width: 768px) { .palette-pied { display: flex; } }
@media (min-width: 1200px) {
  dialog.palette { width: 760px; }
  .palette-zone { grid-template-columns: minmax(0, 1fr) 340px; }
  .palette-resultats { height: min(380px, 52vh); }
  .palette-apercu:not([hidden]) {
    display: block;
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: 16px;
    border-left: 1px solid var(--ad-c-filet);
    max-height: min(380px, 52vh);
  }
}

/* Aide des raccourcis (C7) */
dialog.aide { width: min(560px, calc(100vw - 24px)); max-width: none; margin: 8vh auto auto; }
.aide-corps { max-height: 84vh; overflow-y: auto; padding: 16px 24px 20px; }
.aide-tete { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.aide-titre { margin: 0; font-size: 16px; font-weight: 600; }
.aide-groupe-titre { margin: 20px 0 4px; font-size: 12px; font-weight: 500; color: var(--ad-c-graphite); }
.aide-liste { margin: 0; }
.aide-ligne {
  display: flex;
  flex-direction: row-reverse;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 36px;
  padding: 4px 0;
  border-bottom: 1px solid var(--ad-c-perle);
  font-size: 14px;
}
.aide-ligne dt { display: inline-flex; flex: none; align-items: center; gap: 2px; font-weight: 400; }
.aide-ligne dd { margin: 0; }
.aide-puis { margin: 0 6px; font-size: 12px; color: var(--ad-c-graphite); }
@media (min-width: 576px) {
  .aide-liste-deux { display: grid; grid-template-columns: 1fr 1fr; column-gap: 32px; }
}
.aide-pied { margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--ad-c-filet); }
.aide-note { margin: 8px 0 0; font-size: 13px; color: var(--ad-c-graphite); }

/* Indicateur « G puis… » : dit que la touche G attend une lettre */
.raccourci-attente {
  position: fixed;
  left: 50%;
  bottom: 24px;
  z-index: 1060;
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 6px 12px;
  border-radius: 8px;
  background: var(--ad-c-encre);
  color: var(--ad-c-blanc);
  font-size: 13px;
  transform: translateX(-50%);
}
.raccourci-attente[hidden] { display: none; }
.raccourci-attente kbd.kbd { border-color: var(--ad-c-ardoise); background: transparent; color: var(--ad-c-blanc); }

/* Dialogue de confirmation (C25) — 440 px, focus initial sur « Retour » */
dialog.uc-dialog { width: min(440px, calc(100vw - 32px)); max-width: none; margin: auto; }
.uc-corps { padding: 20px 24px; }
.uc-titre { margin: 0 0 8px; font-size: 16px; font-weight: 600; color: var(--ad-c-encre); }
.uc-message { margin: 0; font-size: 14px; line-height: 1.5; color: var(--ad-c-ardoise); white-space: pre-line; }
.uc-pied { display: flex; justify-content: flex-end; gap: 8px; margin-top: 20px; }

/* Toasts (C5) — en bas à gauche, à 16 px du menu ; fond encre, texte blanc, jamais de couleur d'état en aplat.
   Popover manuel : les défauts du navigateur (inset, marge, bordure, fond) sont tous remis à zéro. */
.toasts {
  position: fixed;
  inset: auto auto max(16px, env(safe-area-inset-bottom)) calc(var(--univers-rail-w) + 16px);
  width: min(360px, calc(100vw - 32px));
  height: auto;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  overflow: visible;
  pointer-events: none;
}
.toasts-pile { display: flex; flex-direction: column; gap: 8px; }
.toasts-pile:not(:empty) + .toasts-pile:not(:empty) { margin-top: 8px; }
.toast-u {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 8px 12px 14px;
  border-radius: 12px;
  background: var(--ad-c-encre);
  color: var(--ad-c-blanc);
  font-size: 14px;
  line-height: 1.4;
  box-shadow: 0 8px 24px color-mix(in srgb, var(--ad-c-encre) 25%, transparent);
  pointer-events: auto;
}
.toast-u-icone { flex: none; margin-top: 1px; font-size: 16px; color: var(--ad-c-perle); }
.toast-u-erreur .toast-u-icone { color: var(--ad-c-rouge-pale); }
.toast-u-avertissement .toast-u-icone { color: var(--ad-c-ambre-pale); }
.toast-u-succes .toast-u-icone { color: var(--ad-c-vert-pale); }
.toast-u-texte { flex: 1; min-width: 0; margin: 0; overflow-wrap: anywhere; }
.toast-u-action {
  flex: none;
  min-height: 24px;
  padding: 0 4px;
  border: 0;
  background: transparent;
  color: var(--ad-c-blanc);
  font-size: 14px;
  font-weight: 500;
  text-decoration: underline;
  text-underline-offset: .18em;
}
.toast-u-action:hover { color: var(--ad-c-blanc); text-decoration-thickness: 2px; }
.toast-u-fermer {
  display: inline-flex;
  flex: none;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--ad-c-perle);
  font-size: 12px;
}
.toast-u-fermer:hover { background: color-mix(in srgb, var(--ad-c-blanc) 16%, transparent); color: var(--ad-c-blanc); }
.toasts :focus-visible { outline-color: var(--ad-c-blanc); }
@media (prefers-reduced-motion: no-preference) {
  .toast-u { animation: toast-entree .15s ease-out; }
}
@keyframes toast-entree { from { opacity: 0; transform: translateY(8px); } }


/* ─────────────────────────────────────────────────────────────────────
   10. CONNEXION ET ERREURS — carte centrée de 360 px sur fond brume
   ───────────────────────────────────────────────────────────────────── */
.login-entete { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 16px; }
.login-corps, .erreur-corps { padding: 24px; }
.login-titre { margin: 0 0 16px; font-size: 20px; font-weight: 600; letter-spacing: -.01em; color: var(--ad-c-encre); }
.login-message { display: flex; align-items: flex-start; gap: 8px; margin-bottom: 16px; padding: 10px 12px; font-size: 14px; }
.login-message .bi { flex: none; margin-top: 2px; }
.erreur-carte { width: 100%; max-width: 440px; }
.erreur-icone { display: block; margin-bottom: 12px; font-size: 24px; color: var(--ad-c-graphite); }
.erreur-titre { margin: 0 0 8px; font-size: 20px; font-weight: 600; letter-spacing: -.01em; color: var(--ad-c-encre); text-wrap: balance; }
.erreur-texte { margin: 0 0 16px; font-size: 14px; line-height: 1.5; color: var(--ad-c-ardoise); }
.erreur-incident { display: flex; align-items: center; gap: 8px; margin: 0 0 16px; font-size: 13px; color: var(--ad-c-graphite); }
.erreur-incident code { font-size: 13px; color: var(--ad-c-encre); }
.erreur-actions { display: flex; flex-wrap: wrap; gap: 8px; }

/* Corps texte brut d'un brouillon et cadres d'aperçu de fichier */
.brouillon-corps-texte { white-space: pre-line; max-height: 220px; overflow: auto; }
.apercu-fichier-cadre { height: 75vh; }
.btn-copie-fait { color: var(--ad-c-vert); }


/* ─────────────────────────────────────────────────────────────────────
   DIRECTION « TABLEAU DES DÉPARTS » (choix d'Antoine du 06/10/2026, méthode
   impeccable, seed b8d7677b). Univers se lit comme un tableau des départs :
   coquille claire, entrée active et compteurs en soleil (fond), heures en
   chiffres tabulaires, voyant soleil sur la ligne qui attend une réponse.
   Le soleil reste un FOND.
   ───────────────────────────────────────────────────────────────────── */

/* Coquille claire (retour d'Antoine du 06/10 : pas de noir) : menu blanc, l'entrée active et les
   compteurs portent le jaune ; la barre haute reste blanche. */
.univers-rail { background: var(--ad-c-blanc); border-right: 1px solid var(--ad-c-perle); }
.univers-rail .univers-monogramme { background: var(--ad-c-soleil); color: var(--ad-c-encre); }
.univers-rail .rail-lien.active { background: var(--ad-c-soleil); border-color: var(--ad-c-soleil); color: var(--ad-c-encre); font-weight: 600; box-shadow: none; }
.univers-rail .rail-lien.active .bi, .univers-rail .rail-lien.active i { color: var(--ad-c-encre); }
.univers-rail .rail-lien.active::before { display: none; }
.univers-rail .rail-badge { background: var(--ad-c-soleil); color: var(--ad-c-encre); box-shadow: none; font-variant-numeric: tabular-nums; }
.univers-rail .rail-lien.active .rail-badge { background: var(--ad-c-blanc); color: var(--ad-c-encre); }

/* Le voyant : la signature d'Univers, à réutiliser partout où le signal « attend votre réponse » existe.
   Pastille de 8 px, grise au repos ; allumée (classe .est-allume, ou dans une ligne .ligne-attente), elle prend le
   soleil et son halo. Le soleil reste un FOND. L'état se dit toujours aussi par un mot (texte masqué ou visible).
   Les lignes de liste (heure en tête, ligne éclairée) sont dans univers-listes.css. */
.voyant { display: inline-block; flex: none; width: 8px; height: 8px; border-radius: 50%; background: var(--ad-c-perle); }
/* Allumé : soleil + halo, et un anneau fin d'ambre à 60 % qui le tient sur la ligne pâle ET sur le blanc (le soleil
   seul sur fond soleil pâle ne dépassait pas 1,3:1 — WCAG 1.4.11). La couleur du fond ne bouge pas. */
.voyant.est-allume, .ligne-attente .voyant, .fiche-voyant, .chrono-voyant {
  background: var(--ad-c-soleil);
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--ad-c-ambre) 60%, transparent),
              0 0 0 4px color-mix(in srgb, var(--ad-c-soleil) 35%, transparent);
}
