/* base.css — Styles de base et composants partagés (repris de V5, direction « Soft UI »).
   Dépend de tokens.css. Contient : remise à zéro, typographie, coquille
   (navigation latérale, barre supérieure, contenu), boutons, formulaires,
   badges, avatars, onglets, tables, panneaux, cartes de post, toasts,
   modales, états vides, squelettes, bulles de chat et utilitaires. */

/* 1. Remise à zéro et base ------------------------------------------------ */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

html {
  background: var(--couleur-fond-bas);
}

body {
  margin: 0;
  min-width: 1024px;
  min-height: 100vh;
  background: linear-gradient(160deg, var(--couleur-fond-haut), var(--couleur-fond-bas)) no-repeat;
  color: var(--couleur-texte);
  font-family: var(--police-texte);
  font-size: var(--taille-15);
  line-height: var(--interligne-15);
  font-variant-numeric: tabular-nums;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, p, ul, ol, figure, dl, dd {
  margin: 0;
}

ul, ol {
  padding: 0;
  list-style: none;
}

/* Barres de défilement : pouce en pilule détaché du bord (bordure de la
   couleur de piste), plus sombre au survol, bleu pendant le glissement.
   Chrome/Edge/Safari : pseudo-éléments ::-webkit-scrollbar. Firefox : les
   propriétés standard, posées seulement là où les pseudo-éléments n'existent
   pas (Chrome 121+ ignorerait sinon les pseudo-éléments). */
::-webkit-scrollbar {
  width: var(--defilement-epaisseur);
  height: var(--defilement-epaisseur);
}

::-webkit-scrollbar-track,
::-webkit-scrollbar-corner {
  background: var(--defilement-piste);
}

::-webkit-scrollbar-thumb {
  background: var(--defilement-pouce);
  background-clip: padding-box;
  border: 2px solid transparent;
  border-radius: var(--rayon-pill);
}

::-webkit-scrollbar-thumb:hover {
  background-color: var(--defilement-pouce-survol);
}

::-webkit-scrollbar-thumb:active {
  background-color: var(--defilement-pouce-actif);
}

@supports not selector(::-webkit-scrollbar) {
  * {
    scrollbar-width: thin;
    scrollbar-color: var(--defilement-pouce) var(--defilement-piste);
  }
}

button, input, select, textarea {
  font: inherit;
  color: inherit;
  letter-spacing: inherit;
}

button {
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
  text-align: inherit;
}

a {
  color: inherit;
}

img, svg {
  display: block;
}

[hidden] {
  display: none !important;
}

:focus-visible {
  outline: 0;
  box-shadow: var(--halo-focus);
}

.visuellement-cache {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* 2. Typographie ------------------------------------------------------------ */

.titre-vue {
  font-family: var(--police-titres);
  font-weight: 700;
  font-size: var(--taille-34);
  line-height: var(--interligne-34);
  letter-spacing: -0.02em;
}

.titre-section {
  font-family: var(--police-titres);
  font-weight: 700;
  font-size: var(--taille-20);
  line-height: var(--interligne-20);
  letter-spacing: -0.01em;
}

.titre-bloc {
  font-weight: var(--graisse-demi);
  font-size: var(--taille-17);
  line-height: var(--interligne-17);
}

.titre-petit {
  font-weight: var(--graisse-demi);
  font-size: var(--taille-14);
  line-height: var(--interligne-14);
}

.texte-secondaire {
  color: var(--couleur-texte-2);
}

.texte-petit {
  font-size: var(--taille-13);
  line-height: var(--interligne-13);
}

.texte-succes { color: var(--couleur-succes); }
.texte-attention { color: var(--couleur-attention); }
.texte-erreur { color: var(--couleur-erreur); }
.texte-accent { color: var(--couleur-accent); }

.chiffre-cle {
  font-weight: 700;
  font-size: var(--taille-34);
  line-height: var(--interligne-34);
  letter-spacing: -0.02em;
}

.lien {
  color: var(--couleur-primaire);
  font-weight: var(--graisse-moyenne);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-color: var(--couleur-primaire-bordure);
}

.lien:hover {
  text-decoration-color: currentColor;
}

/* 3. Icônes ------------------------------------------------------------------ */

.icone {
  width: 20px;
  height: 20px;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.75;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.icone--sm {
  width: 16px;
  height: 16px;
}

.icone--lg {
  width: 28px;
  height: 28px;
  stroke-width: 1.5;
}

.icone--pleine {
  fill: currentColor;
  stroke: none;
}

/* 4. Coquille de l'application ------------------------------------------- */

.app {
  display: grid;
  grid-template-columns: var(--largeur-nav) minmax(0, 1fr);
  min-height: 100vh;
}

/* Rail d'icônes flottant : le libellé de chaque lien sort en infobulle au
   survol et au focus (il reste lu par les lecteurs d'écran). */
.nav-laterale {
  position: sticky;
  top: var(--esp-5);
  align-self: start;
  z-index: var(--z-deroulant);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--esp-4);
  width: 72px;
  margin: var(--esp-5) 0 var(--esp-5) var(--esp-5);
  padding: var(--esp-4) 0;
  border: var(--trait) solid var(--lisere-clair);
  border-radius: 24px;
  background: var(--degrade-surface);
  box-shadow: var(--relief);
}

.nav-laterale__marque {
  display: block;
  margin-bottom: var(--esp-1);
  border-radius: 13px;
  text-decoration: none;
}

.nav-laterale__logo {
  width: 44px;
  height: 44px;
  border-radius: 13px;
  box-shadow: 0 3px 8px var(--halo);
}

.nav-laterale__liens {
  display: grid;
  gap: var(--esp-3);
}

.nav-laterale__liens a {
  position: relative;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 13px;
  background: var(--degrade-surface);
  box-shadow: var(--relief-petit);
  color: var(--couleur-texte-2);
  text-decoration: none;
  transition: box-shadow var(--duree-rapide) var(--courbe), color var(--duree-rapide) var(--courbe);
}

.nav-laterale__liens a:hover {
  color: var(--couleur-primaire);
}

.nav-laterale__liens a:active {
  box-shadow: var(--creux-leger);
}

.nav-laterale__liens a[aria-current="page"] {
  background: var(--degrade-primaire);
  color: var(--couleur-texte-inverse);
  box-shadow: var(--reflet), var(--halo-bleu);
}

.nav-laterale__libelle {
  position: absolute;
  left: calc(100% + var(--esp-4));
  top: 50%;
  padding: var(--esp-1) var(--esp-3);
  border-radius: var(--rayon-sm);
  background: var(--couleur-surface-claire);
  box-shadow: var(--relief-petit);
  color: var(--couleur-texte);
  font-size: var(--taille-13);
  line-height: var(--interligne-13);
  font-weight: var(--graisse-demi);
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transform: translate(-4px, -50%);
  transition: opacity var(--duree-rapide) var(--courbe), transform var(--duree-rapide) var(--courbe);
}

.nav-laterale__liens a:hover .nav-laterale__libelle,
.nav-laterale__liens a:focus-visible .nav-laterale__libelle {
  opacity: 1;
  transform: translate(0, -50%);
}

.zone-principale {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.barre-sup {
  position: sticky;
  top: 0;
  z-index: var(--z-collant);
  height: calc(var(--hauteur-barre) + var(--esp-4));
  display: flex;
  align-items: center;
  gap: var(--esp-4);
  padding: var(--esp-4) var(--esp-8) 0;
  background: linear-gradient(var(--couleur-fond-haut) 70%, transparent);
}

.barre-sup__marque {
  display: flex;
  align-items: center;
  gap: var(--esp-3);
  min-width: 0;
}

.barre-sup__produit {
  font-weight: 700;
  font-size: var(--taille-17);
  letter-spacing: -0.01em;
}

.barre-sup__entreprise {
  padding: var(--esp-1) var(--esp-3);
  border-radius: var(--rayon-pill);
  box-shadow: var(--creux-leger);
  color: var(--couleur-texte-2);
  font-size: var(--taille-13);
  line-height: var(--interligne-13);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.barre-sup__actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: var(--esp-2);
}

.recherche {
  position: relative;
  flex: 1;
  max-width: 440px;
}

.recherche .icone {
  position: absolute;
  left: var(--esp-3);
  top: 50%;
  transform: translateY(-50%);
  color: var(--couleur-texte-3);
  pointer-events: none;
}

.recherche__saisie {
  width: 100%;
  height: var(--hauteur-controle);
  padding: 0 var(--esp-3) 0 var(--esp-10);
  border: 0;
  border-radius: var(--rayon-sm);
  background: var(--couleur-surface-2);
  box-shadow: var(--creux);
}

.recherche__saisie::placeholder {
  color: var(--couleur-texte-3);
}

.recherche__saisie:focus-visible {
  box-shadow: var(--creux-leger), var(--halo-focus);
}

.compte {
  display: inline-flex;
  align-items: center;
  gap: var(--esp-2);
  height: var(--hauteur-controle);
  padding: 0 var(--esp-3) 0 var(--esp-1);
  border-radius: var(--rayon-pill);
  background: var(--degrade-surface);
  box-shadow: var(--relief-petit);
  font-size: var(--taille-14);
  font-weight: var(--graisse-moyenne);
}

.compte:hover {
  color: var(--couleur-primaire);
}

.compte .avatar {
  background: var(--degrade-nuit);
  color: var(--couleur-texte-inverse);
  box-shadow: var(--reflet);
}

.pastille {
  position: absolute;
  top: 4px;
  right: 4px;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: var(--rayon-pill);
  background: var(--couleur-erreur);
  color: var(--couleur-texte-inverse);
  font-size: 11px;
  line-height: 16px;
  font-weight: var(--graisse-demi);
  text-align: center;
}

.contenu {
  width: 100%;
  max-width: var(--largeur-contenu-max);
  padding: var(--esp-6) var(--esp-8) var(--esp-16);
}

.en-tete-vue {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: var(--esp-6);
  margin-bottom: var(--esp-8);
}

.en-tete-vue__actions {
  display: flex;
  gap: var(--esp-2);
  flex: none;
}

.en-tete-vue .texte-secondaire {
  margin-top: var(--esp-1);
}

/* 5. Boutons ------------------------------------------------------------------ */

.bouton {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--esp-2);
  height: var(--hauteur-controle);
  padding: 0 var(--esp-5);
  border: 0;
  border-radius: var(--rayon-sm);
  font-size: var(--taille-14);
  line-height: 1;
  font-weight: var(--graisse-demi);
  white-space: nowrap;
  text-decoration: none;
  transition: box-shadow var(--duree-rapide) var(--courbe), transform var(--duree-rapide) var(--courbe), filter var(--duree-rapide) var(--courbe);
}

.bouton .icone {
  width: 18px;
  height: 18px;
}

/* Survol : le bouton s'élève ; pressé : il s'enfonce. */
.bouton:hover {
  transform: translateY(-1px);
}

.bouton:active {
  transform: none;
}

.bouton--primaire {
  background: var(--degrade-primaire);
  color: var(--couleur-texte-inverse);
  box-shadow: var(--reflet), var(--halo-bleu);
}

.bouton--primaire:hover {
  filter: brightness(1.05);
  box-shadow: var(--reflet), 0 0 0 3px var(--halo-anneau), 0 6px 14px var(--halo);
}

.bouton--primaire:active {
  background: linear-gradient(var(--couleur-primaire-bas), var(--couleur-primaire-haut));
  box-shadow: var(--enfonce);
}

/* Action sombre : « Voir », « Ouvrir », navigation vers un écran. */
.bouton--nuit {
  background: var(--degrade-nuit);
  color: var(--couleur-texte-inverse);
  box-shadow: var(--reflet), var(--ombre-nuit), -2px -2px 5px var(--ombre-claire);
}

.bouton--nuit:hover {
  filter: brightness(1.12);
}

.bouton--nuit:active {
  background: linear-gradient(var(--couleur-nuit-bas), var(--couleur-nuit-haut));
  box-shadow: var(--enfonce-fort);
}

.bouton--secondaire {
  background: var(--degrade-surface);
  color: var(--couleur-texte);
  box-shadow: var(--relief-petit);
}

.bouton--secondaire:hover {
  color: var(--couleur-primaire);
  box-shadow: var(--relief);
}

.bouton--secondaire:active,
.bouton--fantome:active {
  box-shadow: var(--creux-leger);
}

.bouton--fantome {
  background: transparent;
  color: var(--couleur-texte-2);
}

.bouton--fantome:hover {
  background: var(--degrade-surface);
  color: var(--couleur-texte);
  box-shadow: var(--relief-petit);
}

.bouton--danger {
  background: var(--degrade-erreur);
  color: var(--couleur-texte-inverse);
  box-shadow: var(--reflet), var(--ombre-erreur);
}

.bouton--danger:hover {
  filter: brightness(1.06);
}

.bouton--agent {
  background: var(--degrade-accent);
  color: var(--couleur-texte-inverse);
  box-shadow: var(--reflet), var(--ombre-accent);
}

.bouton--agent:hover {
  filter: brightness(1.06);
}

.bouton:disabled,
.bouton[aria-disabled="true"] {
  background: var(--couleur-surface-2);
  color: var(--couleur-texte-3);
  box-shadow: inset 0 0 0 var(--trait) var(--couleur-bordure);
  filter: none;
  transform: none;
  cursor: not-allowed;
}

.bouton--sm {
  height: var(--hauteur-controle-sm);
  padding: 0 var(--esp-4);
  font-size: var(--taille-13);
  border-radius: var(--rayon-xs);
}

.bouton--sm .icone {
  width: 16px;
  height: 16px;
}

.bouton--icone {
  width: var(--hauteur-controle);
  padding: 0;
  position: relative;
}

.bouton--sm.bouton--icone {
  width: var(--hauteur-controle-sm);
}

.bouton--large {
  width: 100%;
}

.groupe-boutons {
  display: flex;
  gap: var(--esp-2);
  align-items: center;
  flex-wrap: wrap;
}

/* 6. Formulaires ---------------------------------------------------------------- */

.champ {
  display: grid;
  gap: var(--esp-2);
  /* Correctif P10 : dans une grille de formulaire, un champ plus court que
     son voisin (sans texte d'aide) étirait ses lignes et décalait sa saisie. */
  align-content: start;
}

.champ__libelle {
  font-size: var(--taille-14);
  line-height: var(--interligne-14);
  font-weight: var(--graisse-moyenne);
}

.champ__libelle small {
  color: var(--couleur-texte-2);
  font-weight: var(--graisse-normale);
}

.champ__aide {
  font-size: var(--taille-13);
  line-height: var(--interligne-13);
  color: var(--couleur-texte-2);
}

.champ__erreur {
  font-size: var(--taille-13);
  line-height: var(--interligne-13);
  color: var(--couleur-erreur);
  display: flex;
  gap: var(--esp-1);
  align-items: center;
}

.saisie {
  width: 100%;
  height: var(--hauteur-controle);
  padding: 0 var(--esp-4);
  border: 0;
  border-radius: var(--rayon-sm);
  background: var(--couleur-surface-2);
  box-shadow: var(--creux);
  transition: box-shadow var(--duree-rapide) var(--courbe), background-color var(--duree-rapide) var(--courbe);
}

.saisie::placeholder {
  color: var(--couleur-texte-3);
}

.saisie:focus,
.saisie:focus-visible {
  outline: 0;
  background: var(--couleur-surface-claire);
  box-shadow: var(--creux-leger), var(--halo-focus);
}

.saisie:disabled,
.saisie[readonly] {
  background: transparent;
  color: var(--couleur-texte-3);
  box-shadow: inset 0 0 0 var(--trait) var(--couleur-bordure);
  cursor: not-allowed;
}

.saisie[readonly] {
  color: var(--couleur-texte-2);
  cursor: default;
}

.saisie--erreur,
.saisie--erreur:hover {
  box-shadow: var(--creux-leger), 0 0 0 2px var(--couleur-erreur);
}

textarea.saisie {
  height: auto;
  min-height: 120px;
  padding: var(--esp-3) var(--esp-4);
  line-height: var(--interligne-15);
  resize: vertical;
}

input[type="file"] {
  font-size: var(--taille-13);
  color: var(--couleur-texte-2);
}

input[type="file"]::file-selector-button {
  height: var(--hauteur-controle-sm);
  margin-right: var(--esp-3);
  padding: 0 var(--esp-4);
  border: 0;
  border-radius: var(--rayon-xs);
  background: var(--degrade-surface);
  box-shadow: var(--relief-petit);
  color: var(--couleur-texte);
  font: inherit;
  font-weight: var(--graisse-demi);
  cursor: pointer;
}

.selecteur {
  position: relative;
}

.selecteur select.saisie {
  appearance: none;
  padding-right: var(--esp-10);
  cursor: pointer;
}

.selecteur .icone {
  position: absolute;
  right: var(--esp-3);
  top: 50%;
  transform: translateY(-50%);
  pointer-events: none;
  color: var(--couleur-texte-2);
}

.case {
  display: inline-flex;
  align-items: flex-start;
  gap: var(--esp-2);
  font-size: var(--taille-14);
  line-height: var(--interligne-14);
  cursor: pointer;
}

.case input {
  appearance: none;
  width: 18px;
  height: 18px;
  margin: 1px 0 0;
  flex: none;
  border: 0;
  border-radius: var(--rayon-xs);
  background: var(--couleur-surface-2);
  box-shadow: var(--creux-leger);
  cursor: pointer;
  display: grid;
  place-content: center;
}

.case input[type="radio"] {
  border-radius: var(--rayon-pill);
}

.case input::after {
  content: "";
  width: 10px;
  height: 10px;
  transform: scale(0);
  transition: transform var(--duree-rapide) var(--courbe);
}

.case input[type="checkbox"]::after {
  width: 12px;
  height: 12px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E");
  background-size: contain;
}

.case input[type="radio"]::after {
  width: 8px;
  height: 8px;
  border-radius: var(--rayon-pill);
  background: var(--couleur-texte-inverse);
}

.case input:checked {
  background: var(--degrade-primaire);
  box-shadow: var(--reflet), 0 1px 4px var(--halo);
}

.case input:checked::after {
  transform: scale(1);
}

.case input:disabled {
  background: transparent;
  box-shadow: inset 0 0 0 var(--trait) var(--couleur-bordure);
  cursor: not-allowed;
}

.case input:disabled + span {
  color: var(--couleur-texte-3);
}

.interrupteur {
  display: inline-flex;
  align-items: center;
  gap: var(--esp-3);
  font-size: var(--taille-14);
  line-height: var(--interligne-14);
  cursor: pointer;
}

.interrupteur input {
  appearance: none;
  width: 52px;
  height: 30px;
  margin: 0;
  flex: none;
  border-radius: var(--rayon-pill);
  background: var(--couleur-surface-2);
  box-shadow: var(--creux);
  position: relative;
  cursor: pointer;
  transition: background-color var(--duree-normale) var(--courbe), box-shadow var(--duree-normale) var(--courbe);
}

.interrupteur input::after {
  content: "";
  position: absolute;
  top: 4px;
  left: 4px;
  width: 22px;
  height: 22px;
  border-radius: var(--rayon-pill);
  background: var(--degrade-curseur);
  box-shadow: var(--ombre-curseur);
  transition: transform var(--duree-normale) var(--courbe);
}

.interrupteur input:checked {
  background: var(--degrade-primaire);
  box-shadow: var(--reflet), 0 0 8px var(--halo);
}

.interrupteur input:checked::after {
  transform: translateX(22px);
}

.interrupteur input:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.grille-formulaire {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--esp-4) var(--esp-5);
}

.grille-formulaire .champ--pleine {
  grid-column: 1 / -1;
}

/* 7. Badges ---------------------------------------------------------------------- */

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 24px;
  padding: 0 var(--esp-3) 0 var(--esp-2);
  border: 0;
  border-radius: var(--rayon-pill);
  background: var(--couleur-surface-2);
  box-shadow: var(--creux-leger);
  font-size: var(--taille-12);
  line-height: 1;
  font-weight: var(--graisse-demi);
  white-space: nowrap;
}

.badge::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: var(--rayon-pill);
  background: currentColor;
  box-shadow: 0 0 6px currentColor;
}

.badge--brouillon {
  color: var(--couleur-texte-2);
}

.badge--planifie {
  color: var(--couleur-primaire);
}

.badge--publie {
  color: var(--couleur-succes);
}

.badge--echec {
  color: var(--couleur-erreur);
}

.badge--attente {
  color: var(--couleur-attention);
}

.badge--agent {
  color: var(--couleur-accent);
}

/* Prêt à planifier : validé par le dirigeant, pas encore daté (contour, là où « Programmé » est plein). */
.badge--pret {
  color: var(--couleur-primaire);
  box-shadow: var(--creux-leger), inset 0 0 0 var(--trait) var(--couleur-primaire-bordure);
}

.badge--sans-point::before {
  display: none;
}

.badge-reseau {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  flex: none;
  border-radius: var(--rayon-xs);
  color: var(--couleur-texte-inverse);
  font-size: var(--taille-13);
  font-weight: var(--graisse-demi);
  line-height: 1;
}

.badge-reseau .icone {
  width: 14px;
  height: 14px;
  stroke-width: 2;
}

.badge-reseau--instagram { background: var(--reseau-instagram); }
.badge-reseau--facebook { background: var(--reseau-facebook); }
.badge-reseau--linkedin { background: var(--reseau-linkedin); }
.badge-reseau--google { background: var(--reseau-google); }

.badge-reseau--lg {
  width: 32px;
  height: 32px;
  border-radius: var(--rayon-sm);
  font-size: var(--taille-17);
}

.badge-reseau--lg .icone {
  width: 18px;
  height: 18px;
}

.reseaux {
  display: inline-flex;
  gap: var(--esp-1);
}

.reseau-libelle {
  display: inline-flex;
  align-items: center;
  gap: var(--esp-2);
  font-size: var(--taille-14);
}

/* 8. Avatars --------------------------------------------------------------------- */

.avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  flex: none;
  border-radius: var(--rayon-pill);
  background: var(--couleur-primaire-teinte);
  color: var(--couleur-primaire);
  font-size: var(--taille-13);
  font-weight: 700;
  line-height: 1;
}

.avatar--sm {
  width: 24px;
  height: 24px;
  font-size: 11px;
}

.avatar--lg {
  width: 48px;
  height: 48px;
  font-size: var(--taille-17);
}

.avatar--agent {
  background: var(--degrade-accent);
  color: var(--couleur-texte-inverse);
  box-shadow: var(--reflet);
}

.avatar--agent .icone {
  width: 16px;
  height: 16px;
}

.avatar--neutre {
  background: var(--couleur-surface-2);
  color: var(--couleur-texte-2);
  box-shadow: var(--creux-leger);
}

/* 9. Onglets --------------------------------------------------------------------- */

.onglets {
  display: inline-flex;
  flex-wrap: wrap;
  gap: var(--esp-1);
  padding: 5px;
  border-radius: var(--rayon-sm);
  box-shadow: var(--creux);
}

.onglets__onglet {
  display: inline-flex;
  align-items: center;
  gap: var(--esp-2);
  height: 34px;
  padding: 0 var(--esp-4);
  border-radius: 8px;
  color: var(--couleur-texte-2);
  font-size: var(--taille-14);
  font-weight: var(--graisse-moyenne);
  text-decoration: none;
  transition: box-shadow var(--duree-rapide) var(--courbe), color var(--duree-rapide) var(--courbe);
}

.onglets__onglet:hover {
  color: var(--couleur-texte);
}

.onglets__onglet[aria-selected="true"],
.onglets__onglet[aria-current="page"] {
  background: var(--degrade-primaire);
  color: var(--couleur-texte-inverse);
  font-weight: var(--graisse-demi);
  box-shadow: var(--reflet), 0 2px 6px var(--halo);
}

.onglets__onglet[aria-selected="true"] .onglets__compte,
.onglets__onglet[aria-current="page"] .onglets__compte,
.onglets--segments .onglets__onglet[aria-pressed="true"] .onglets__compte {
  color: inherit;
  opacity: 0.85;
}

.onglets__compte {
  color: var(--couleur-texte-3);
  font-weight: var(--graisse-normale);
}

.onglets--segments {
  display: inline-flex;
  gap: var(--esp-1);
  padding: 4px;
  border-radius: var(--rayon-sm);
  box-shadow: var(--creux);
}

.onglets--segments .onglets__onglet {
  height: 30px;
  margin: 0;
  border-radius: 8px;
  font-size: var(--taille-13);
}

.onglets--segments .onglets__onglet[aria-selected="true"],
.onglets--segments .onglets__onglet[aria-pressed="true"] {
  background: var(--degrade-primaire);
  color: var(--couleur-texte-inverse);
  box-shadow: var(--reflet), 0 2px 6px var(--halo);
}

/* 10. Tables ---------------------------------------------------------------------- */

.table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0 var(--esp-2);
  font-size: var(--taille-14);
  line-height: var(--interligne-14);
}

.table th {
  padding: var(--esp-2) var(--esp-3);
  text-align: left;
  font-size: var(--taille-12);
  line-height: var(--interligne-12);
  font-weight: var(--graisse-demi);
  color: var(--couleur-texte-3);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  white-space: nowrap;
}

.table tbody tr {
  border-radius: var(--rayon-sm);
  box-shadow: var(--relief-petit);
  transition: box-shadow var(--duree-rapide) var(--courbe);
}

.table td {
  padding: var(--esp-3);
  background: var(--couleur-surface);
  vertical-align: middle;
}

.table td:first-child {
  border-radius: var(--rayon-sm) 0 0 var(--rayon-sm);
}

.table td:last-child {
  border-radius: 0 var(--rayon-sm) var(--rayon-sm) 0;
}

.table td:only-child {
  border-radius: var(--rayon-sm);
}

.table tbody tr:hover {
  box-shadow: var(--relief);
}

.table tbody tr:hover td {
  background: var(--couleur-surface-claire);
}

/* Ligne active (ouverte, sélectionnée) : éclairée en bleu. */
.table tbody tr[aria-selected="true"] td,
.table tbody tr.table__ligne--active td {
  background: var(--couleur-primaire-teinte);
}

.table tbody tr[aria-selected="true"],
.table tbody tr.table__ligne--active {
  box-shadow: var(--relief-petit), 0 0 0 2px var(--halo-anneau), 0 0 0 1px var(--couleur-primaire-bordure);
}

.table .nombre {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.table time {
  display: block;
  white-space: nowrap;
}

.table .actions {
  text-align: right;
  white-space: nowrap;
}

.table .principal {
  font-weight: var(--graisse-moyenne);
  color: var(--couleur-texte);
}

.table--dense td {
  padding: var(--esp-2) var(--esp-3);
}

.delta {
  display: block;
  font-size: var(--taille-12);
  line-height: var(--interligne-12);
}

/* 11. Panneaux et sections --------------------------------------------------- */

.panneau {
  background: var(--degrade-surface);
  border: var(--trait) solid var(--lisere-clair);
  border-radius: var(--rayon-md);
  box-shadow: var(--relief);
}

.panneau__entete {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--esp-4);
  padding: var(--esp-5) var(--esp-6) var(--esp-3);
}

.panneau__corps {
  padding: var(--esp-4) var(--esp-6) var(--esp-6);
}

.panneau__corps--sans-marge {
  padding: 0 var(--esp-3) var(--esp-3);
}

.panneau__pied {
  margin: 0 var(--esp-4) var(--esp-4);
  padding: var(--esp-3) var(--esp-4);
  border-radius: var(--rayon-sm);
  box-shadow: var(--creux-leger);
  font-size: var(--taille-13);
  color: var(--couleur-texte-2);
}

.panneau--agent {
  background: var(--degrade-agent);
}

.panneau--agent .panneau__entete {
  color: var(--couleur-accent);
}

.section-vue {
  display: grid;
  gap: var(--esp-4);
}

.section-vue__entete {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--esp-4);
}

.pile {
  display: grid;
  gap: var(--esp-8);
}

.pile--serree {
  gap: var(--esp-4);
}

.colonnes {
  display: grid;
  grid-template-columns: minmax(0, 1fr) var(--largeur-panneau-lateral);
  gap: var(--esp-8);
  align-items: start;
}

.ligne {
  display: flex;
  align-items: center;
  gap: var(--esp-2);
}

.ligne--espace {
  justify-content: space-between;
}

.liste-filets > li {
  padding: var(--esp-3) 0;
  border-bottom: var(--trait) solid var(--couleur-bordure);
  box-shadow: 0 1px 0 var(--ombre-claire);
}

.liste-filets > li:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.liste-filets > li:first-child {
  padding-top: 0;
}

.point {
  display: inline-block;
  width: 9px;
  height: 9px;
  flex: none;
  border-radius: var(--rayon-pill);
  background: var(--couleur-texte-3);
  box-shadow: 0 0 6px currentColor;
}

.point--succes { background: var(--couleur-succes); color: var(--couleur-succes); }
.point--attention { background: var(--couleur-attention); color: var(--couleur-attention); }
.point--erreur { background: var(--couleur-erreur); color: var(--couleur-erreur); }

/* Compteurs : bandeau de chiffres à filets, chaque compteur peut servir d'onglet */

.compteurs {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--esp-5);
}

.compteur {
  display: grid;
  gap: var(--esp-1);
  align-content: start;
  padding: var(--esp-4) var(--esp-5);
  border: var(--trait) solid var(--lisere-clair);
  border-radius: var(--rayon-md);
  background: var(--degrade-surface);
  box-shadow: var(--relief);
  text-align: left;
  color: var(--couleur-texte-2);
}

.compteur + .compteur {
  padding-left: var(--esp-5);
}

.compteur__valeur {
  color: var(--couleur-texte);
}

.compteur__libelle {
  font-size: var(--taille-14);
  line-height: var(--interligne-14);
}

.compteur__detail {
  font-size: var(--taille-13);
  line-height: var(--interligne-13);
  color: var(--couleur-texte-3);
}

button.compteur:hover .compteur__libelle {
  color: var(--couleur-texte);
}

button.compteur[aria-selected="true"] {
  box-shadow: var(--relief), 0 0 0 2px var(--halo-anneau), 0 0 0 1px var(--couleur-primaire-bordure);
}

button.compteur[aria-selected="true"] .compteur__libelle {
  color: var(--couleur-texte);
  font-weight: var(--graisse-demi);
}

.compteur--erreur .compteur__valeur {
  color: var(--couleur-erreur);
}

/* Bandeau d'invitation */

.bandeau {
  display: flex;
  align-items: center;
  gap: var(--esp-5);
  padding: var(--esp-4) var(--esp-5);
  border: var(--trait) solid var(--lisere-clair);
  border-radius: var(--rayon-md);
  background: var(--degrade-agent);
  box-shadow: var(--relief);
}

.bandeau__texte {
  flex: 1;
  display: grid;
  gap: var(--esp-1);
}

.bandeau__actions {
  display: flex;
  align-items: center;
  gap: var(--esp-2);
}

.progression {
  width: 160px;
  height: 8px;
  border-radius: var(--rayon-pill);
  box-shadow: var(--creux-leger);
  overflow: hidden;
}

.progression__barre {
  height: 100%;
  border-radius: var(--rayon-pill);
  background: var(--degrade-accent);
}

/* Paliers : un rail d'étapes franchies, dont on connaît le nombre à l'avance
   (les 5 étapes de l'onboarding, d'où les multiples de 20). */
.progression__barre--20 { width: 20%; }
.progression__barre--40 { width: 40%; }
.progression__barre--60 { width: 60%; }
.progression__barre--80 { width: 80%; }
.progression__barre--100 { width: 100%; }

/* Valeur libre : une mesure, pas un palier. La complétion du profil est une
   somme de poids par rubrique (25, 25, 12, 12, 10, 8, 8) et tombe donc sur
   n'importe quel entier — 62 %, 87 %. La largeur vient de la DONNÉE, portée
   par `--progression` sur l'élément ; ce n'est pas une valeur de design, et
   elle n'a donc rien à faire dans tokens.css. */
.progression__barre--valeur { width: calc(var(--progression, 0) * 1%); }

/* Menus déroulants */

.menu-deroulant {
  position: relative;
}

.menu-deroulant__panneau {
  position: absolute;
  top: calc(100% + var(--esp-2));
  right: 0;
  z-index: var(--z-deroulant);
  min-width: 300px;
  padding: var(--esp-2);
  border: var(--trait) solid var(--lisere-clair);
  border-radius: var(--rayon-md);
  background: var(--degrade-surface);
  box-shadow: var(--ombre-flottante);
}

.menu-deroulant__titre {
  padding: var(--esp-2) var(--esp-3);
  font-size: var(--taille-13);
  color: var(--couleur-texte-2);
}

.menu-deroulant__element {
  display: flex;
  align-items: flex-start;
  gap: var(--esp-3);
  width: 100%;
  padding: var(--esp-2) var(--esp-3);
  border-radius: var(--rayon-sm);
  font-size: var(--taille-14);
  line-height: var(--interligne-14);
  text-decoration: none;
}

.menu-deroulant__element:hover {
  background: var(--couleur-surface-claire);
  box-shadow: var(--relief-petit);
}

.menu-deroulant__element .texte-petit {
  display: block;
  color: var(--couleur-texte-2);
}

.menu-deroulant__separateur {
  height: 2px;
  margin: var(--esp-2);
  border-radius: var(--rayon-pill);
  box-shadow: var(--creux-leger);
}

/* 12. Cartes de post et visuels ----------------------------------------------- */

.visuel {
  position: relative;
  display: grid;
  place-items: center;
  overflow: hidden;
  border-radius: var(--rayon-sm);
  background: var(--visuel-1);
  color: var(--visuel-trait);
}

.visuel .icone {
  width: 32%;
  height: 32%;
  stroke-width: 1.25;
}

.visuel--2 { background: var(--visuel-2); }
.visuel--3 { background: var(--visuel-3); }
.visuel--4 { background: var(--visuel-4); }

.visuel--mini {
  width: 40px;
  height: 40px;
  flex: none;
  border-radius: var(--rayon-xs);
}

.visuel--carre {
  aspect-ratio: 1;
}

.visuel--paysage {
  aspect-ratio: 4 / 3;
}

.visuel--portrait {
  aspect-ratio: 4 / 5;
}

.carte-post {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr);
  gap: var(--esp-3);
  padding: var(--esp-3);
  border: var(--trait) solid var(--lisere-clair);
  border-radius: var(--rayon-md);
  background: var(--degrade-surface);
  box-shadow: var(--relief-petit);
}

.carte-post__visuel {
  width: 72px;
  height: 72px;
}

.carte-post__corps {
  display: grid;
  gap: var(--esp-2);
  align-content: start;
  min-width: 0;
}

.carte-post__texte {
  font-size: var(--taille-14);
  line-height: var(--interligne-14);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.carte-post__meta {
  display: flex;
  align-items: center;
  gap: var(--esp-2);
  font-size: var(--taille-13);
  line-height: var(--interligne-13);
  color: var(--couleur-texte-2);
}

.carte-post__meta time {
  margin-left: auto;
}

.carte-post--compacte {
  grid-template-columns: 48px minmax(0, 1fr);
  padding: var(--esp-2);
}

.carte-post--compacte .carte-post__visuel {
  width: 48px;
  height: 48px;
}

.carte-post--compacte .carte-post__texte {
  -webkit-line-clamp: 1;
}

/* 13. Toasts ------------------------------------------------------------------------ */

.toasts {
  position: fixed;
  bottom: var(--esp-6);
  left: calc(var(--largeur-nav) + var(--esp-8));
  z-index: var(--z-toast);
  display: grid;
  gap: var(--esp-2);
}

.toast {
  display: flex;
  align-items: center;
  gap: var(--esp-3);
  min-width: 320px;
  max-width: 480px;
  padding: var(--esp-3) var(--esp-4);
  border-radius: var(--rayon-sm);
  background: var(--degrade-nuit);
  color: var(--couleur-texte-inverse);
  font-size: var(--taille-14);
  line-height: var(--interligne-14);
  box-shadow: var(--reflet), var(--ombre-modale);
}

.toast .icone {
  width: 18px;
  height: 18px;
}

.toast--succes .icone { color: var(--couleur-succes-teinte); }
.toast--erreur .icone { color: var(--couleur-erreur-teinte); }
.toast--attention .icone { color: var(--couleur-attention-teinte); }

.toast__fermer {
  margin-left: auto;
  color: var(--couleur-texte-inverse);
  opacity: 0.7;
}

.toast__fermer:hover {
  opacity: 1;
}

.toast--statique {
  position: static;
}

/* 14. Modales (élément dialog natif) --------------------------------------- */

.modale {
  width: min(560px, calc(100vw - var(--esp-12)));
  padding: 0;
  border: var(--trait) solid var(--lisere-clair);
  border-radius: 22px;
  background: var(--degrade-surface);
  color: var(--couleur-texte);
  box-shadow: var(--ombre-modale);
}

.modale::backdrop {
  background: var(--couleur-voile);
  backdrop-filter: blur(3px);
}

.modale__entete {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--esp-4);
  padding: var(--esp-5) var(--esp-6) var(--esp-4);
}

.modale__titre {
  font-family: var(--police-titres);
  font-weight: 700;
  font-size: var(--taille-20);
  line-height: var(--interligne-20);
}

.modale__corps {
  padding: 0 var(--esp-6) var(--esp-5);
  display: grid;
  gap: var(--esp-4);
}

.modale__pied {
  display: flex;
  justify-content: flex-end;
  gap: var(--esp-2);
  padding: var(--esp-4) var(--esp-6) var(--esp-5);
}

.modale--statique {
  position: static;
  margin: 0;
  display: block;
}

/* 15. États vides et squelettes ---------------------------------------------- */

.etat-vide {
  display: grid;
  justify-items: center;
  gap: var(--esp-2);
  padding: var(--esp-12) var(--esp-6);
  border-radius: var(--rayon-md);
  box-shadow: var(--creux);
  text-align: center;
}

.etat-vide .icone--lg {
  color: var(--couleur-texte-3);
  margin-bottom: var(--esp-2);
}

.etat-vide p {
  max-width: 44ch;
  color: var(--couleur-texte-2);
}

.etat-vide .bouton {
  margin-top: var(--esp-3);
}

.squelette {
  display: block;
  border-radius: var(--rayon-xs);
  background: var(--couleur-surface-2);
  box-shadow: var(--creux-leger);
  animation: squelette-pulsation 1.4s ease-in-out infinite;
}

.squelette--texte {
  height: 12px;
}

.squelette--titre {
  height: 20px;
  width: 50%;
}

.squelette--rond {
  width: 32px;
  height: 32px;
  border-radius: var(--rayon-pill);
}

.squelette--bloc {
  height: 96px;
  border-radius: var(--rayon-sm);
}

@keyframes squelette-pulsation {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.45; }
}

@media (prefers-reduced-motion: reduce) {
  .squelette {
    animation: none;
  }
}

/* 16. Chat : messages et bulles ----------------------------------------------- */

.message {
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr);
  gap: var(--esp-3);
  align-items: start;
}

.message--utilisateur {
  grid-template-columns: minmax(0, 1fr) 32px;
}

.message--utilisateur .message__corps {
  justify-items: end;
}

.message__corps {
  display: grid;
  gap: var(--esp-1);
  min-width: 0;
}

.message__meta {
  font-size: var(--taille-13);
  line-height: var(--interligne-13);
  color: var(--couleur-texte-2);
}

.bulle {
  max-width: 64ch;
  padding: var(--esp-3) var(--esp-4);
  border-radius: var(--rayon-md);
  font-size: var(--taille-15);
  line-height: var(--interligne-15);
}

.bulle p + p {
  margin-top: var(--esp-2);
}

.bulle--utilisateur {
  background: var(--degrade-primaire);
  color: var(--couleur-texte-inverse);
  box-shadow: var(--reflet), 0 3px 8px var(--halo);
  border-top-right-radius: var(--rayon-xs);
}

.bulle--agent {
  background: var(--degrade-surface);
  border: var(--trait) solid var(--lisere-clair);
  box-shadow: var(--relief-petit);
  border-top-left-radius: var(--rayon-xs);
}

.bulle__actions {
  display: flex;
  gap: var(--esp-2);
  margin-top: var(--esp-3);
  flex-wrap: wrap;
}

.bulle__choix {
  display: flex;
  flex-wrap: wrap;
  gap: var(--esp-2);
  margin-top: var(--esp-3);
}

/* 17. Étoiles d'avis ----------------------------------------------------------- */

.etoiles {
  display: inline-flex;
  gap: 2px;
  color: var(--couleur-attention);
}

.etoiles .icone {
  width: 16px;
  height: 16px;
  fill: currentColor;
  stroke: none;
}

.etoiles .icone--vide {
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
  color: var(--couleur-texte-3);
}

/* 18. Tiroir latéral de détail ------------------------------------------------ */

.tiroir {
  position: fixed;
  top: var(--esp-3);
  right: var(--esp-3);
  bottom: var(--esp-3);
  z-index: var(--z-panneau);
  width: var(--largeur-panneau-lateral);
  display: flex;
  flex-direction: column;
  border: var(--trait) solid var(--lisere-clair);
  border-radius: 22px;
  background: var(--degrade-surface);
  box-shadow: var(--ombre-modale);
  transform: translateX(calc(100% + var(--esp-6)));
  visibility: hidden;
  transition: transform var(--duree-normale) var(--courbe), visibility var(--duree-normale);
}

.tiroir--ouvert {
  transform: none;
  visibility: visible;
}

.tiroir__entete {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--esp-3);
  padding: var(--esp-5) var(--esp-5) var(--esp-3);
}

.tiroir__corps {
  flex: 1;
  overflow: auto;
  padding: var(--esp-5);
  display: grid;
  gap: var(--esp-4);
  align-content: start;
}

.tiroir__pied {
  display: flex;
  justify-content: flex-end;
  gap: var(--esp-2);
  padding: var(--esp-4) var(--esp-5);
}

.definition {
  display: grid;
  grid-template-columns: 120px minmax(0, 1fr);
  gap: var(--esp-2) var(--esp-4);
  font-size: var(--taille-14);
  line-height: var(--interligne-14);
}

.definition dt {
  color: var(--couleur-texte-2);
}

/* 19. Zones de dépôt, puces et vignettes ------------------------------------ */

.zone-depot {
  display: grid;
  justify-items: center;
  gap: var(--esp-2);
  padding: var(--esp-6);
  border-radius: var(--rayon-md);
  box-shadow: var(--creux);
  text-align: center;
  color: var(--couleur-texte-2);
  font-size: var(--taille-14);
  line-height: var(--interligne-14);
}

.zone-depot .icone--lg {
  color: var(--couleur-texte-3);
}

.zone-depot--survol {
  background: var(--couleur-primaire-teinte);
  box-shadow: var(--creux-leger), var(--halo-focus);
}

.puces {
  display: flex;
  flex-wrap: wrap;
  gap: var(--esp-2);
}

.puce {
  display: inline-flex;
  align-items: center;
  gap: var(--esp-1);
  height: 30px;
  padding: 0 var(--esp-1) 0 var(--esp-3);
  border-radius: var(--rayon-pill);
  background: var(--degrade-surface);
  box-shadow: var(--relief-petit);
  font-size: var(--taille-13);
  line-height: 1;
}

.puce--visuel {
  height: 40px;
  padding-left: var(--esp-1);
}

.puce__vignette {
  width: 32px;
  height: 32px;
  overflow: hidden;
  border-radius: var(--rayon-xs);
}

.puce__vignette img,
.puce__vignette .visuel {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.puce__retirer {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: var(--rayon-pill);
  color: var(--couleur-texte-2);
}

.puce__retirer:hover {
  background: var(--couleur-surface-2);
  color: var(--couleur-texte);
}

.grille-visuels {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: var(--esp-3);
}

.vignette {
  display: grid;
  gap: var(--esp-1);
  width: 100%;
  border-radius: var(--rayon-sm);
  cursor: grab;
}

.vignette:active {
  cursor: grabbing;
}

.vignette .visuel {
  width: 100%;
}

.vignette img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: var(--rayon-sm);
}

.vignette__nom {
  font-size: var(--taille-13);
  line-height: var(--interligne-13);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.vignette--selectionnee .visuel,
.vignette--selectionnee img {
  box-shadow: 0 0 0 var(--trait-fort) var(--couleur-primaire);
}

/* 20. Fil de conversation et composeur ------------------------------------- */

.fil {
  display: grid;
  gap: var(--esp-5);
  align-content: start;
}

.composeur {
  display: grid;
  gap: var(--esp-2);
  padding: var(--esp-3);
  border-radius: var(--rayon-md);
  background: var(--couleur-surface-2);
  box-shadow: var(--creux);
}

.composeur:focus-within {
  background: var(--couleur-surface-claire);
  box-shadow: var(--creux-leger), var(--halo-focus);
}

.composeur--survol {
  background: var(--couleur-primaire-teinte);
  box-shadow: var(--creux-leger), var(--halo-focus);
}

.composeur textarea {
  width: 100%;
  min-height: 56px;
  padding: var(--esp-1) var(--esp-2);
  border: 0;
  background: transparent;
  resize: none;
  line-height: var(--interligne-15);
}

.composeur textarea:focus-visible {
  outline: none;
}

.composeur textarea::placeholder {
  color: var(--couleur-texte-3);
}

.composeur__barre {
  display: flex;
  align-items: center;
  gap: var(--esp-2);
}

.composeur__barre .composeur__envoyer {
  margin-left: auto;
}

/* 21. Graphiques SVG et barres ---------------------------------------------------- */

.graphique {
  display: block;
  width: 100%;
  height: auto;
  overflow: visible;
}

.graphique text {
  font-family: var(--police-texte);
  font-size: 12px;
  fill: var(--couleur-texte-2);
}

.graphique .axe {
  stroke: var(--couleur-bordure-forte);
  stroke-width: 1;
}

.graphique .grille {
  stroke: var(--couleur-bordure);
  stroke-width: 1;
}

.graphique .serie-1 { stroke: var(--graphique-1); fill: none; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.graphique .serie-2 { stroke: var(--graphique-2); fill: none; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.graphique .serie-3 { stroke: var(--graphique-3); fill: none; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.graphique .point-1 { fill: var(--graphique-1); stroke: var(--couleur-surface); stroke-width: 2; }
.graphique .point-2 { fill: var(--graphique-2); stroke: var(--couleur-surface); stroke-width: 2; }
.graphique .point-3 { fill: var(--graphique-3); stroke: var(--couleur-surface); stroke-width: 2; }
.graphique .aire-1 { fill: var(--graphique-1-teinte); }
.graphique .barre { fill: var(--graphique-1); }
.graphique .barre--2 { fill: var(--graphique-2); }
.graphique .barre--3 { fill: var(--graphique-3); }
.graphique .barre--claire { fill: var(--couleur-primaire-bordure); }
.graphique .barre--neutre { fill: var(--couleur-bordure); }
.graphique .survol { fill: transparent; }
.graphique .survol:hover { fill: var(--couleur-surface-2); }
.graphique .etiquette-forte { fill: var(--couleur-texte); font-weight: var(--graisse-demi); }

.legende {
  display: flex;
  flex-wrap: wrap;
  gap: var(--esp-4);
  font-size: var(--taille-13);
  line-height: var(--interligne-13);
  color: var(--couleur-texte-2);
}

.legende__element {
  display: inline-flex;
  align-items: center;
  gap: var(--esp-2);
}

.legende__trait {
  width: 16px;
  height: 3px;
  border-radius: var(--rayon-xs);
  background: var(--graphique-1);
}

.legende__trait--2 { background: var(--graphique-2); }
.legende__trait--3 { background: var(--graphique-3); }

.barre-svg {
  display: block;
  width: 100%;
  height: 8px;
}

.barre-svg .piste { fill: var(--couleur-surface-2); }
.barre-svg .valeur { fill: var(--graphique-1); }

/* Bouton à état pressé : choix proposés, réseaux cibles */

.bouton--secondaire[aria-pressed="true"] {
  background: var(--couleur-primaire-teinte);
  color: var(--couleur-primaire);
  box-shadow: var(--creux-leger), inset 0 0 0 var(--trait) var(--couleur-primaire-bordure);
}

.compteurs--3 { grid-template-columns: repeat(3, 1fr); }
.compteurs--5 { grid-template-columns: repeat(5, 1fr); }

/* 22. Éditeurs de listes structurées --------------------------------------- */

/* Deux familles : éditeur de liste (lignes à plusieurs champs) et éditeur de
   créneaux horaires (jour, ouverture, fermeture, saison facultative). Une seule
   structure, .editeur-ligne, la variante ne change que la trame des colonnes. */

.editeur {
  display: grid;
  gap: var(--esp-4);
}

.editeur__entete {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--esp-4);
}

.editeur__lignes {
  display: grid;
  gap: var(--esp-3);
}

.editeur-ligne {
  display: flex;
  align-items: end;
  gap: var(--esp-3);
  padding: var(--esp-4);
  border: var(--trait) solid var(--lisere-clair);
  border-radius: var(--rayon-sm);
  background: var(--degrade-surface);
  box-shadow: var(--relief-petit);
}

.editeur-ligne__champs {
  flex: 1;
  min-width: 0;
  display: grid;
  gap: var(--esp-4);
}

.editeur-ligne--liste .editeur-ligne__champs {
  grid-template-columns: 1.2fr 1.2fr 1fr;
}

.editeur-ligne--creneau .editeur-ligne__champs {
  grid-template-columns: 1fr 1fr 1fr 1.2fr;
}

.editeur-ligne__retirer {
  flex: none;
}

.editeur__ajout {
  justify-self: start;
}

/* 23. Puces éditables ------------------------------------------------------------- */

.editeur-puces {
  display: grid;
  gap: var(--esp-3);
}

.editeur-puces__ajout {
  display: flex;
  align-items: center;
  gap: var(--esp-2);
}

.editeur-puces__ajout .saisie {
  flex: 1;
  min-width: 0;
}

/* 24. Indicateur « corrigé par vous » ---------------------------------------- */

/* Marque humaine en bleu primaire sur un champ verrouillé, marque de l'agent en
   prune sur un champ laissé libre. Le champ verrouillé est en lecture seule. */

.champ__entete {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--esp-3);
  flex-wrap: wrap;
}

.marque-champ {
  display: inline-flex;
  align-items: center;
  gap: var(--esp-1);
  height: 22px;
  padding: 0 var(--esp-2);
  border: var(--trait) solid transparent;
  border-radius: var(--rayon-pill);
  font-size: var(--taille-12);
  line-height: 1;
  font-weight: var(--graisse-demi);
  white-space: nowrap;
}

.marque-champ--humain {
  background: var(--couleur-primaire-teinte);
  border-color: var(--couleur-primaire-bordure);
  color: var(--couleur-primaire);
}

.marque-champ--agent {
  background: var(--couleur-accent-teinte);
  border-color: var(--couleur-accent-bordure);
  color: var(--couleur-accent);
}

.champ--verrouille .saisie {
  background: var(--couleur-primaire-teinte);
  box-shadow: var(--creux-leger), inset 0 0 0 var(--trait) var(--couleur-primaire-bordure);
}

/* 25. Bulle de l'agent qui prépare des propositions --------------------- */

.bulle--preparation {
  display: grid;
  gap: var(--esp-2);
}

.bulle__points {
  display: inline-flex;
  align-items: center;
  gap: var(--esp-1);
}

.bulle__points span {
  width: var(--esp-2);
  height: var(--esp-2);
  border-radius: var(--rayon-pill);
  background: var(--couleur-accent);
  animation: bulle-preparation-pulsation calc(var(--duree-normale) * 6) var(--courbe) infinite;
}

.bulle__points span:nth-child(2) {
  animation-delay: var(--duree-normale);
}

.bulle__points span:nth-child(3) {
  animation-delay: calc(var(--duree-normale) * 2);
}

.bulle__preparation-texte {
  font-weight: var(--graisse-moyenne);
}

@keyframes bulle-preparation-pulsation {
  0%, 100% { opacity: 0.35; transform: scale(0.8); }
  50% { opacity: 1; transform: scale(1); }
}

@media (prefers-reduced-motion: reduce) {
  .bulle__points span {
    animation: none;
    opacity: 1;
  }
}

/* 26. Utilitaires ---------------------------------------------------------------- */

.marge-haut-2 { margin-top: var(--esp-2); }
.marge-haut-4 { margin-top: var(--esp-4); }
.marge-haut-6 { margin-top: var(--esp-6); }

.pleine-largeur {
  width: 100%;
}

.aligne-droite {
  text-align: right;
}

.sans-retour {
  white-space: nowrap;
}

.masquable[hidden] {
  display: none;
}

@media (max-width: 1200px) {
  .colonnes {
    grid-template-columns: minmax(0, 1fr);
  }

  .toasts {
    left: calc(var(--largeur-nav) + var(--esp-6));
  }
}

/* 23. Lien d'évitement et petits écrans (V5) ----------------------------------- */

.lien-evitement:focus {
  position: fixed;
  top: var(--esp-2);
  left: var(--esp-2);
  z-index: var(--z-toast);
  width: auto;
  height: auto;
  margin: 0;
  padding: var(--esp-2) var(--esp-3);
  clip: auto;
  border-radius: var(--rayon-sm);
  background: var(--couleur-surface-claire);
  box-shadow: var(--ombre-modale);
}

@media (max-width: 800px) {
  body {
    min-width: 0;
  }

  .app {
    grid-template-columns: minmax(0, 1fr);
    /* Correctif P10 : sans lignes explicites, une page plus courte que l'écran
       étirait la ligne du menu (min-height 100vh partagée entre les lignes). */
    grid-template-rows: auto 1fr;
  }

  /* Le rail devient un bandeau horizontal, libellés visibles. */
  .nav-laterale {
    position: static;
    flex-direction: row;
    align-items: center;
    width: auto;
    margin: var(--esp-3) var(--esp-4) 0;
    padding: var(--esp-2) var(--esp-3);
    border-radius: var(--rayon-md);
  }

  .nav-laterale__marque {
    margin: 0;
    flex: none;
  }

  .nav-laterale__logo {
    width: 36px;
    height: 36px;
    border-radius: 10px;
  }

  .nav-laterale__liens {
    display: flex;
    /* Correctif P10 : à 390 px, le 4e lien du menu admin (Tâches) sortait du
       cadre et n'était atteignable qu'en faisant défiler le menu. */
    flex-wrap: wrap;
    gap: var(--esp-2);
  }

  .nav-laterale__liens a {
    display: inline-flex;
    gap: var(--esp-2);
    width: auto;
    height: 36px;
    padding: 0 var(--esp-3);
    border-radius: 10px;
    white-space: nowrap;
    font-size: var(--taille-13);
  }

  .nav-laterale__libelle,
  .nav-laterale__liens a:hover .nav-laterale__libelle {
    position: static;
    padding: 0;
    background: none;
    box-shadow: none;
    color: inherit;
    font-weight: inherit;
    opacity: 1;
    transform: none;
  }

  .barre-sup__entreprise {
    display: none;
  }

  .barre-sup {
    position: static;
    padding: var(--esp-2) var(--esp-4) 0;
  }

  .barre-sup .compte > span:not(.avatar) {
    display: none;
  }

  .contenu {
    padding: var(--esp-6) var(--esp-4) var(--esp-12);
  }

  .en-tete-vue {
    flex-direction: column;
    align-items: flex-start;
  }

  .toasts {
    left: var(--esp-4);
  }
}

/* 27. Prospection (P0) : tables en cartes et zones à défilement ------------- */

/* Une table marquée .table--cartes devient une pile de cartes sous 800 px :
   chaque <td> porte data-libelle="…" (libellé de sa colonne), affiché devant
   la valeur. Aucun défilement horizontal (§5.12). */

.zone-defilement {
  position: relative; /* piège V5 : un .visuellement-cache dedans élargirait la page */
  overflow-x: auto;
}

@media (max-width: 800px) {
  .table--cartes,
  .table--cartes tbody,
  .table--cartes tr,
  .table--cartes td {
    display: block;
    width: 100%;
  }

  .table--cartes thead {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
  }

  .table--cartes tr {
    margin-bottom: var(--esp-3);
    padding: var(--esp-3) var(--esp-4);
    border-radius: var(--rayon-md);
    background: var(--couleur-surface);
  }

  .table--cartes td,
  .table--cartes td:first-child,
  .table--cartes td:last-child {
    background: transparent;
    border-radius: 0;
  }

  .table--cartes td {
    display: grid;
    grid-template-columns: minmax(0, 9rem) minmax(0, 1fr);
    gap: var(--esp-3);
    padding: var(--esp-1) 0;
    border: 0;
    overflow-wrap: anywhere;
  }

  .table--cartes td[data-libelle]::before {
    content: attr(data-libelle);
    color: var(--couleur-texte-2);
    font-size: var(--taille-13);
  }

  /* Correctifs P10 (cartes) :
     - une cellule à plusieurs éléments (nom + client, statut + badge, valeur +
       effectif) envoyait le 2e élément sous le libellé : le libellé occupe
       toute la colonne de gauche, les éléments s'empilent à droite ;
     - les cellules numériques gardent leur libellé et leur valeur à gauche ;
     - pas de marge sous la dernière carte d'un panneau. */
  .table--cartes td[data-libelle] {
    row-gap: 0;
  }

  .table--cartes td[data-libelle]::before {
    grid-row: 1 / span 12;
    font-family: var(--police-texte); /* pas la police de code d'une cellule technique */
    letter-spacing: normal;
  }

  .table--cartes td.nombre {
    text-align: left;
  }

  .table--cartes td > .badge {
    justify-self: start;
  }

  .table--cartes tr:last-child {
    margin-bottom: 0;
  }

  .zone-defilement {
    overflow-x: visible;
  }

  .table,
  .panneau,
  .contenu {
    min-width: 0;
  }
}

/* Recherche en cours (P14) ------------------------------------------------------ */
.avancement__indicateur {
  flex: none;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--couleur-accent);
  animation: avancement-pulsation 1.6s var(--courbe) infinite;
}

.avancement--fini .avancement__indicateur {
  background: var(--couleur-succes);
  animation: none;
}

.avancement__titre {
  font-weight: var(--graisse-demi);
}

@keyframes avancement-pulsation {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.3; }
}

@media (prefers-reduced-motion: reduce) {
  .avancement__indicateur { animation: none; }
}

.avancement--echec .avancement__indicateur {
  background: var(--couleur-erreur);
  animation: none;
}

/* Sous-étapes : terminées (coche), en cours (pastille animée), à venir (cercle). */
.avancement {
  flex-wrap: wrap;
}

.avancement__etapes {
  position: relative;
  flex-basis: 100%;
  display: grid;
  gap: var(--esp-2);
  margin: 0;
  padding: var(--esp-3) 0 0;
  border-top: var(--trait) solid var(--couleur-accent-bordure);
  list-style: none;
}

.avancement__etape {
  display: flex;
  align-items: center;
  gap: var(--esp-3);
  font-size: var(--taille-14);
}

.avancement__etape--a_venir {
  color: var(--couleur-texte-2);
}

.avancement__etape--en_cours .avancement__libelle {
  font-weight: var(--graisse-demi);
}

.avancement__puce {
  flex: none;
  width: 14px;
  height: 14px;
  border: 2px solid var(--couleur-bordure);
  border-radius: 50%;
}

.avancement__etape--fait .avancement__puce {
  border-color: var(--couleur-succes);
  background: var(--couleur-succes);
  box-shadow: inset 0 0 0 2px var(--couleur-surface);
}

.avancement__etape--en_cours .avancement__puce {
  border-color: var(--couleur-accent);
  background: var(--couleur-accent);
  animation: avancement-pulsation 1.6s var(--courbe) infinite;
}

@media (prefers-reduced-motion: reduce) {
  .avancement__etape--en_cours .avancement__puce { animation: none; }
}
