/* ===========================================================================
   admin.css — Interface d'administration de la plateforme 2MI Construction
   ---------------------------------------------------------------------------
   Charte reprise du site vitrine (bleu ardoise, orange chantier, noir doux)
   mais traitée en interface de travail : densité d'information, lisibilité
   prolongée, hiérarchie claire. Aucune dépendance externe.
   =========================================================================== */

/* ------------------------------------------------------------- variables */
:root {
  /* Couleurs de marque */
  /* Couleurs du logo */
  --bleu: #365b6d;
  --bleu-fonce: #263f4c;
  --bleu-clair: #5f8799;
  --orange: #de722f;
  --orange-fonce: #c05f22;
  --orange-clair: #eb9a62;
  --noir-doux: #1f2d36;

  /* Neutres chauds, sobres */
  --fond: #f4f2ee;
  --surface: #ffffff;
  --surface-2: #f9f8f5;
  --bordure: #e6e2da;
  --bordure-forte: #d3cdc2;
  --texte: #22303a;
  --texte-doux: #59656e;
  --texte-faible: #8a939a;

  /* États, en teintes naturelles : sauge, ocre, terre cuite, ardoise */
  --succes: #4a7c59;
  --succes-fond: #ecf3ed;
  --alerte: #b07a1c;
  --alerte-fond: #faf1df;
  --danger: #b4533a;
  --danger-fond: #f8ebe6;
  --info: #3b6578;
  --info-fond: #e8eff2;

  /* Mesures */
  --rayon: 12px;
  --rayon-sm: 8px;
  --largeur-barre: 250px;
  --hauteur-entete: 56px;
  --ombre-1: 0 1px 2px rgba(34, 48, 58, 0.05), 0 1px 3px rgba(34, 48, 58, 0.04);
  --ombre-2: 0 6px 16px rgba(34, 48, 58, 0.07), 0 2px 4px rgba(34, 48, 58, 0.04);
  --ombre-3: 0 16px 40px rgba(34, 48, 58, 0.14);
  --transition: 140ms cubic-bezier(0.4, 0, 0.2, 1);

  --police: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  /* Références, numéros, codes : la police de l'interface, chiffres de même
     largeur (plus de police « machine à écrire »). */
  --police-references: var(--police);
}

/* ----------------------------------------------------------------- reset */
*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: var(--police);
  font-size: 14px;
  line-height: 1.5;
  color: var(--texte);
  background: var(--fond);
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 { margin: 0; font-weight: 650; line-height: 1.25; }
h1 { font-size: 1.45rem; letter-spacing: -0.01em; }
h2 { font-size: 1.1rem; }
h3 { font-size: 0.95rem; }
p { margin: 0 0 0.75rem; }
p:last-child { margin-bottom: 0; }

a { color: var(--bleu); text-decoration: none; }
a:hover { text-decoration: underline; }

img { max-width: 100%; height: auto; display: block; }

:focus-visible {
  outline: 2px solid var(--orange);
  outline-offset: 2px;
  border-radius: var(--rayon-sm);
}

.lien-evitement {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 100;
  background: var(--noir-doux);
  color: #fff;
  padding: 0.75rem 1.25rem;
}
.lien-evitement:focus { left: 0; }

.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* =========================================================== mise en page */

.appli {
  display: grid;
  grid-template-columns: var(--largeur-barre) minmax(0, 1fr);
  min-height: 100vh;
}

/* --- barre latérale --- */
.barre {
  background: var(--noir-doux);
  color: rgba(255, 255, 255, 0.8);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.barre__marque {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 1rem 1.15rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  color: #fff;
  text-decoration: none;
}
.barre__marque:hover { text-decoration: none; }
.barre__logo {
  width: 34px; height: 34px;
  display: grid; place-items: center;
  background: var(--orange);
  border-radius: var(--rayon-sm);
  font-weight: 800;
  font-size: 0.8rem;
  letter-spacing: -0.03em;
  color: #fff;
  flex-shrink: 0;
}
.barre__titre { font-size: 0.9rem; font-weight: 650; line-height: 1.2; }
.barre__sous-titre {
  font-size: 0.68rem;
  color: rgba(255, 255, 255, 0.5);
  text-transform: uppercase;
  letter-spacing: 0.07em;
}

.barre__nav { flex: 1; padding: 0.75rem 0.6rem; }
.barre__groupe { margin-bottom: 1.1rem; }
.barre__groupe-titre {
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: rgba(255, 255, 255, 0.38);
  padding: 0 0.6rem 0.4rem;
  font-weight: 600;
}
.barre__lien {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.5rem 0.6rem;
  border-radius: var(--rayon-sm);
  color: rgba(255, 255, 255, 0.78);
  font-size: 0.855rem;
  transition: background var(--transition), color var(--transition);
}
.barre__lien:hover {
  background: rgba(255, 255, 255, 0.07);
  color: #fff;
  text-decoration: none;
}
.barre__lien[aria-current="page"] {
  background: rgba(222, 114, 47, 0.16);
  color: #fff;
  font-weight: 600;
  box-shadow: inset 2px 0 0 var(--orange);
}
.barre__lien svg { width: 17px; height: 17px; flex-shrink: 0; opacity: 0.85; }
.barre__badge {
  margin-left: auto;
  background: var(--orange);
  color: #fff;
  border-radius: 999px;
  padding: 0.05rem 0.4rem;
  font-size: 0.68rem;
  font-weight: 700;
}

.barre__pied {
  padding: 0.75rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}
.barre__compte {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.4rem 0.5rem;
  border-radius: var(--rayon-sm);
  color: rgba(255, 255, 255, 0.85);
}
.barre__compte:hover { background: rgba(255, 255, 255, 0.07); text-decoration: none; }
.barre__avatar {
  width: 30px; height: 30px;
  border-radius: 50%;
  background: var(--bleu);
  display: grid; place-items: center;
  font-size: 0.7rem; font-weight: 700; color: #fff;
  flex-shrink: 0;
}
.barre__compte-nom { font-size: 0.8rem; font-weight: 600; line-height: 1.2; }
.barre__compte-role { font-size: 0.68rem; color: rgba(255, 255, 255, 0.45); }

/* --- zone principale --- */
.principal { min-width: 0; display: flex; flex-direction: column; }

.entete {
  position: sticky;
  top: 0;
  z-index: 20;
  height: var(--hauteur-entete);
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--bordure);
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0 1.5rem;
}
.entete__fil { display: flex; align-items: center; gap: 0.4rem; font-size: 0.8rem; color: var(--texte-faible); }
.entete__fil a { color: var(--texte-doux); }
.entete__fil span[aria-current] { color: var(--texte); font-weight: 600; }
.entete__actions { margin-left: auto; display: flex; align-items: center; gap: 0.5rem; }

.contenu { padding: 1.5rem; flex: 1; }
.contenu--etroit { max-width: 880px; }

.page-entete {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 1.25rem;
}
.page-entete__texte { min-width: 0; }
.page-entete__description { color: var(--texte-doux); margin-top: 0.2rem; max-width: 70ch; }
.page-entete__actions { margin-left: auto; display: flex; gap: 0.5rem; flex-wrap: wrap; }

/* ============================================================== composants */

/* --- cartes --- */
.carte {
  background: var(--surface);
  border: 1px solid var(--bordure);
  border-radius: var(--rayon);
  box-shadow: var(--ombre-1);
}
.carte__entete {
  padding: 0.85rem 1.15rem;
  border-bottom: 1px solid var(--bordure);
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.carte__entete h2, .carte__entete h3 { margin: 0; }
.carte__entete-actions { margin-left: auto; display: flex; gap: 0.4rem; }
.carte__corps { padding: 1.15rem; }
.carte__corps--serre { padding: 0; }
.carte__pied {
  padding: 0.85rem 1.15rem;
  border-top: 1px solid var(--bordure);
  background: var(--surface-2);
  border-radius: 0 0 var(--rayon) var(--rayon);
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

/* --- grilles --- */
.grille { display: grid; gap: 1rem; }
.grille--2 { grid-template-columns: repeat(auto-fit, minmax(min(280px, 100%), 1fr)); }
.grille--3 { grid-template-columns: repeat(auto-fit, minmax(min(230px, 100%), 1fr)); }
.grille--4 { grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); }
.pile { display: flex; flex-direction: column; gap: 1rem; }
.ligne { display: flex; gap: 0.5rem; align-items: center; flex-wrap: wrap; }
.ligne--fin { justify-content: flex-end; }
.ligne--espace { justify-content: space-between; }

/* --- indicateurs --- */
.indicateur {
  background: var(--surface);
  border: 1px solid var(--bordure);
  border-radius: var(--rayon);
  padding: 1rem 1.15rem;
  box-shadow: var(--ombre-1);
}
.indicateur__libelle {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--texte-faible);
  font-weight: 650;
}
.indicateur__valeur {
  font-size: 1.75rem;
  font-weight: 700;
  line-height: 1.1;
  margin-top: 0.35rem;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}
.indicateur__detail { font-size: 0.8rem; color: var(--texte-doux); margin-top: 0.25rem; }
.indicateur--accent { border-left: 3px solid var(--orange); }
.indicateur--bleu { border-left: 3px solid var(--bleu); }

/* --- boutons --- */
.bouton {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.48rem 0.9rem;
  border: 1px solid transparent;
  border-radius: var(--rayon-sm);
  font: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  line-height: 1.2;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
  transition: background var(--transition), border-color var(--transition), color var(--transition);
}
.bouton:hover { text-decoration: none; }
.bouton:disabled, .bouton[aria-disabled="true"] { opacity: 0.55; cursor: not-allowed; }
.bouton svg { width: 15px; height: 15px; }

.bouton--primaire { background: var(--orange); color: #fff; }
.bouton--primaire:hover:not(:disabled) { background: var(--orange-fonce); }

.bouton--bleu { background: var(--bleu); color: #fff; }
.bouton--bleu:hover:not(:disabled) { background: var(--bleu-fonce); }

.bouton--neutre { background: var(--surface); color: var(--texte); border-color: var(--bordure-forte); }
.bouton--neutre:hover:not(:disabled) { background: var(--surface-2); border-color: var(--texte-faible); }

.bouton--fantome { background: transparent; color: var(--texte-doux); }
.bouton--fantome:hover:not(:disabled) { background: rgba(0, 0, 0, 0.04); color: var(--texte); }

.bouton--danger { background: var(--danger); color: #fff; }
.bouton--danger:hover:not(:disabled) { background: #8f1e17; }

.bouton--petit { padding: 0.3rem 0.6rem; font-size: 0.78rem; }
.bouton--bloc { width: 100%; }

/* --- formulaires --- */
.champ { margin-bottom: 1rem; }
.champ:last-child { margin-bottom: 0; }

.champ__label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  margin-bottom: 0.3rem;
  color: var(--texte);
}
.champ__requis { color: var(--danger); }
.champ__aide { font-size: 0.78rem; color: var(--texte-faible); margin-top: 0.3rem; }

.champ input[type="text"],
.champ input[type="email"],
.champ input[type="password"],
.champ input[type="tel"],
.champ input[type="url"],
.champ input[type="number"],
.champ input[type="date"],
.champ input[type="search"],
.champ select,
.champ textarea {
  width: 100%;
  padding: 0.48rem 0.65rem;
  border: 1px solid var(--bordure-forte);
  border-radius: var(--rayon-sm);
  font: inherit;
  font-size: 0.875rem;
  color: var(--texte);
  background: var(--surface);
  transition: border-color var(--transition), box-shadow var(--transition);
}
.champ textarea { min-height: 110px; resize: vertical; line-height: 1.55; }
.champ select { cursor: pointer; }

.champ input:focus, .champ select:focus, .champ textarea:focus {
  outline: none;
  border-color: var(--bleu);
  box-shadow: 0 0 0 3px rgba(54, 91, 109, 0.14);
}

.champ--erreur input, .champ--erreur select, .champ--erreur textarea { border-color: var(--danger); }
.champ--erreur input:focus { box-shadow: 0 0 0 3px rgba(179, 38, 30, 0.14); }
.champ__erreur { display: block; color: var(--danger); font-size: 0.78rem; margin-top: 0.3rem; font-weight: 500; }

.champ--case { display: flex; align-items: flex-start; gap: 0.55rem; }
.champ--case input { margin-top: 0.18rem; width: 15px; height: 15px; accent-color: var(--orange); flex-shrink: 0; }
.champ--case .champ__label { margin-bottom: 0; font-weight: 500; }

.champs-grille { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 0 1rem; }

fieldset { border: none; margin: 0 0 1rem; padding: 0; }
legend { font-size: 0.8rem; font-weight: 600; margin-bottom: 0.4rem; padding: 0; }

.groupe-choix { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.groupe-choix label {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.35rem 0.7rem;
  border: 1px solid var(--bordure-forte);
  border-radius: 999px;
  font-size: 0.82rem;
  cursor: pointer;
  background: var(--surface);
  transition: border-color var(--transition), background var(--transition);
}
.groupe-choix label:hover { border-color: var(--bleu-clair); }
.groupe-choix input { accent-color: var(--orange); }
.groupe-choix input:checked + span { font-weight: 650; }
.groupe-choix label:has(input:checked) { border-color: var(--orange); background: rgba(222, 114, 47, 0.07); }

/* --- tableaux --- */
.tableau-enveloppe { overflow-x: auto; }
.tableau { width: 100%; border-collapse: collapse; font-size: 0.86rem; }
.tableau th, .tableau td { padding: 0.6rem 0.85rem; text-align: left; vertical-align: middle; }
.tableau thead th {
  background: var(--surface-2);
  border-bottom: 1px solid var(--bordure);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--texte-faible);
  font-weight: 650;
  white-space: nowrap;
}
.tableau tbody tr { border-bottom: 1px solid var(--bordure); }
.tableau tbody tr:last-child { border-bottom: none; }
.tableau tbody tr:hover { background: var(--surface-2); }
.tableau td.nombre { text-align: right; font-variant-numeric: tabular-nums; }
.tableau td.actions { text-align: right; white-space: nowrap; }
.tableau__principal { font-weight: 600; color: var(--texte); }
.tableau__secondaire { color: var(--texte-faible); font-size: 0.8rem; }

/* Encadré d'action irréversible, visuellement mis à l'écart du reste. */
.carte--danger { border-color: #e7c4c1; }
.carte--danger .carte__entete h2 { color: var(--danger); }

/* Intertitre de regroupement à l'intérieur d'un tableau (familles, sections). */
.tableau__groupe td {
  background: var(--surface-2);
  font-size: 0.74rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--orange-fonce);
  padding-top: 0.5rem;
  padding-bottom: 0.5rem;
}
.tableau__groupe:hover td { background: var(--surface-2); }
.tableau__ligne--inactive { opacity: 0.55; }

/* --- notation par étoiles numérotées (enquête de satisfaction) --- */

.notation {
  border: none;
  padding: 0;
  margin: 0 0 1.1rem;
}
.notation legend {
  font-size: 0.86rem;
  font-weight: 600;
  color: var(--texte);
  margin-bottom: 0.4rem;
  padding: 0;
}
.notation__etoiles { display: flex; align-items: center; gap: 0.35rem; flex-wrap: wrap; }

/* Le bouton radio lui-même est masqué visuellement mais reste focusable :
   la navigation au clavier et les lecteurs d'écran fonctionnent normalement. */
.notation__choix input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}
.notation__valeur {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border: 1px solid var(--bordure-forte);
  border-radius: 8px;
  font-weight: 650;
  color: var(--texte-doux);
  cursor: pointer;
  transition: background 0.12s, border-color 0.12s, color 0.12s;
}
.notation__choix:hover .notation__valeur { border-color: var(--orange); color: var(--orange-fonce); }
.notation__choix input:checked + .notation__valeur {
  background: var(--orange);
  border-color: var(--orange);
  color: #fff;
}
.notation__choix input:focus-visible + .notation__valeur {
  outline: 2px solid var(--orange);
  outline-offset: 2px;
}
.notation__legende {
  margin-left: 0.4rem;
  font-size: 0.74rem;
  color: var(--texte-faible);
}
.notation--erreur .notation__valeur { border-color: var(--danger); }

/* --- restitution des notes côté administration --- */

.note-barre {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}
.note-barre__piste {
  flex: 1;
  height: 7px;
  background: var(--bordure);
  border-radius: 999px;
  overflow: hidden;
  min-width: 70px;
}
.note-barre__part { height: 100%; background: var(--orange); border-radius: 999px; }
.note-barre__valeur {
  font-variant-numeric: tabular-nums;
  font-weight: 650;
  font-size: 0.86rem;
  white-space: nowrap;
}
.note-grande { font-size: 2rem; font-weight: 700; line-height: 1; }
.note-grande span { font-size: 0.9rem; font-weight: 500; color: var(--texte-faible); }

/* --- documents commerciaux : lignes de devis et de facture --- */

.lignes-document td { vertical-align: top; }
.lignes-document .ligne-titre td {
  background: var(--surface-2);
  font-weight: 700;
  color: var(--orange-fonce);
}
.lignes-document .ligne-texte td { color: var(--texte-doux); font-style: italic; }
.lignes-document .ligne-soustotal td {
  font-weight: 650;
  color: var(--texte-doux);
  border-top: 1px solid var(--bordure-forte);
}
.lignes-document .poignee {
  cursor: grab;
  color: var(--texte-faible);
  user-select: none;
  padding-right: 0.2rem;
}
.lignes-document tr.deplacee { opacity: 0.45; }
.lignes-document .montant { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }

/* Saisie directement dans la grille des lignes : discrète au repos, nette au focus. */
.saisie-ligne {
  width: 100%;
  padding: 0.25rem 0.35rem;
  border: 1px solid transparent;
  border-radius: 4px;
  background: transparent;
  font: inherit;
  font-size: 0.84rem;
  color: var(--texte);
}
.saisie-ligne:hover { border-color: var(--bordure); }
.saisie-ligne:focus {
  border-color: var(--orange);
  background: var(--surface);
  outline: 2px solid rgba(222, 114, 47, 0.18);
  outline-offset: 0;
}
.saisie-ligne--description {
  margin-top: 0.15rem;
  font-size: 0.78rem;
  color: var(--texte-doux);
  resize: vertical;
  min-height: 1.9rem;
}
select.saisie-ligne { padding-right: 0.1rem; }

/* Boutons de déplacement d'une ligne, empilés dans une colonne étroite. */
.deplacements { display: flex; flex-direction: column; gap: 0.1rem; }
.deplacements form { line-height: 1; }
.bouton-nu {
  border: none;
  background: none;
  cursor: pointer;
  padding: 0.05rem 0.25rem;
  color: var(--texte-faible);
  font-size: 0.8rem;
  line-height: 1.1;
  border-radius: 3px;
}
.bouton-nu:hover { color: var(--orange); background: var(--surface-2); }

/* Récapitulatif des totaux, calé à droite sous le tableau des lignes. */
.totaux {
  margin-left: auto;
  width: min(360px, 100%);
  font-size: 0.88rem;
}
.totaux__ligne {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.3rem 0;
}
.totaux__ligne span:last-child { font-variant-numeric: tabular-nums; font-weight: 600; }
.totaux__ligne--discret { color: var(--texte-doux); font-size: 0.82rem; }
.totaux__ligne--discret span:last-child { font-weight: 500; }
.totaux__ligne--fort {
  margin-top: 0.4rem;
  padding: 0.6rem 0.75rem;
  background: var(--noir-doux);
  color: #fff;
  border-radius: 6px;
  font-size: 1rem;
}
.totaux__ligne--fort span:last-child { font-size: 1.1rem; }
.totaux__ligne--acompte {
  margin-top: 0.4rem;
  padding-top: 0.5rem;
  border-top: 1px solid var(--bordure);
  color: var(--orange-fonce);
}
.totaux__ligne--acompte span:last-child { color: var(--orange-fonce); }

/* --- pastilles de statut --- */
.pastille {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.12rem 0.5rem;
  border-radius: 999px;
  font-size: 0.74rem;
  font-weight: 650;
  line-height: 1.5;
  white-space: nowrap;
  border: 1px solid transparent;
}
.pastille--neutre  { background: #eef0f2; color: var(--texte-doux); border-color: var(--bordure); }
.pastille--succes  { background: var(--succes-fond); color: var(--succes); border-color: #bfe3cf; }
.pastille--alerte  { background: var(--alerte-fond); color: var(--alerte); border-color: #f0ddba; }
.pastille--danger  { background: var(--danger-fond); color: var(--danger); border-color: #f3c9c5; }
.pastille--info    { background: var(--info-fond); color: var(--info); border-color: #c6dcea; }
.pastille--accent  { background: rgba(222, 114, 47, 0.1); color: var(--orange-fonce); border-color: rgba(222, 114, 47, 0.3); }

/* --- messages --- */
.message {
  display: flex;
  gap: 0.65rem;
  padding: 0.75rem 1rem;
  border-radius: var(--rayon);
  border: 1px solid;
  margin-bottom: 1rem;
  font-size: 0.875rem;
}
.message__icone { flex-shrink: 0; width: 18px; height: 18px; margin-top: 1px; }
.message__corps { min-width: 0; }
.message--succes { background: var(--succes-fond); border-color: #bfe3cf; color: #16603b; }
.message--erreur { background: var(--danger-fond); border-color: #f3c9c5; color: #8f1e17; }
.message--alerte { background: var(--alerte-fond); border-color: #f0ddba; color: #875408; }
.message--info   { background: var(--info-fond); border-color: #c6dcea; color: #1f4a69; }
.message ul { margin: 0.4rem 0 0; padding-left: 1.1rem; }

/* --- états vides --- */
.vide {
  text-align: center;
  padding: 2.5rem 1.5rem;
  color: var(--texte-doux);
}
.vide__titre { font-weight: 650; color: var(--texte); margin-bottom: 0.3rem; }

/* --- pagination --- */
.pagination { display: flex; align-items: center; gap: 0.3rem; }
.pagination__info { color: var(--texte-faible); font-size: 0.82rem; margin-right: auto; }
.pagination a, .pagination span {
  padding: 0.3rem 0.6rem;
  border-radius: var(--rayon-sm);
  font-size: 0.82rem;
  border: 1px solid var(--bordure);
  background: var(--surface);
  color: var(--texte-doux);
}
.pagination a:hover { border-color: var(--bleu-clair); text-decoration: none; color: var(--texte); }
.pagination [aria-current="page"] { background: var(--bleu); border-color: var(--bleu); color: #fff; font-weight: 650; }

/* --- barre de filtres --- */
.filtres {
  display: flex;
  gap: 0.5rem;
  align-items: flex-end;
  flex-wrap: wrap;
  padding: 0.85rem 1.15rem;
  border-bottom: 1px solid var(--bordure);
  background: var(--surface-2);
}
.filtres .champ { margin-bottom: 0; }
.filtres input, .filtres select { min-width: 160px; }

/* --- connexion --- */
.page-connexion {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 1.5rem;
  background:
    radial-gradient(circle at 20% 15%, rgba(54, 91, 109, 0.35), transparent 45%),
    radial-gradient(circle at 85% 80%, rgba(222, 114, 47, 0.22), transparent 42%),
    var(--noir-doux);
}
.connexion {
  width: 100%;
  max-width: 410px;
  background: var(--surface);
  border-radius: 10px;
  box-shadow: var(--ombre-3);
  overflow: hidden;
}
.connexion__entete {
  padding: 1.75rem 1.75rem 1.25rem;
  text-align: center;
  border-bottom: 1px solid var(--bordure);
}
.connexion__logo {
  width: 46px; height: 46px;
  margin: 0 auto 0.85rem;
  background: var(--orange);
  border-radius: 8px;
  display: grid; place-items: center;
  color: #fff; font-weight: 800; font-size: 1rem; letter-spacing: -0.04em;
}
/* Variante large du même encadré : formulaire d'avis, pages publiques qui
   demandent plus qu'un identifiant et un mot de passe. */
.connexion--large { max-width: 600px; }

.connexion__titre { font-size: 1.15rem; }
.connexion__sous-titre { color: var(--texte-doux); font-size: 0.86rem; margin-top: 0.25rem; }
.connexion__corps { padding: 1.5rem 1.75rem 1.75rem; }
.connexion__pied {
  padding: 0.9rem 1.75rem;
  background: var(--surface-2);
  border-top: 1px solid var(--bordure);
  text-align: center;
  font-size: 0.8rem;
  color: var(--texte-faible);
}

/* --- galerie de photos d'une réalisation --- */
.photos-liste { list-style: none; margin: 0; padding: 0; }

.photos-liste__element {
  display: flex;
  gap: 0.85rem;
  align-items: flex-start;
  padding: 0.85rem 1.15rem;
  border-bottom: 1px solid var(--bordure);
  cursor: grab;
  background: var(--surface);
  transition: background var(--transition);
}
.photos-liste__element:last-child { border-bottom: none; }
.photos-liste__element:hover { background: var(--surface-2); }
.photos-liste__element:active { cursor: grabbing; }

.photos-liste__rang {
  width: 1.5rem;
  padding-top: 0.5rem;
  text-align: right;
  flex-shrink: 0;
  font-family: var(--police-references);
  font-variant-numeric: tabular-nums;
  font-size: 0.78rem;
  color: var(--texte-faible);
}
.photos-liste__vignette {
  width: 110px;
  height: 82px;
  object-fit: cover;
  border-radius: 4px;
  border: 1px solid var(--bordure);
  flex-shrink: 0;
  background: var(--surface-2);
}
.photos-liste__infos { flex: 1; min-width: 0; }
.photos-liste__meta { margin: 0.4rem 0 0; font-size: 0.78rem; color: var(--texte-faible); }
.photos-liste__legende { margin: 0.2rem 0 0; font-size: 0.8rem; }
.photos-liste__deplacer { display: flex; gap: 0.3rem; margin-top: 0.4rem; flex-wrap: wrap; }
.photos-liste__actions {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  flex-shrink: 0;
  align-items: stretch;
}

@media (max-width: 560px) {
  .photos-liste__element { flex-wrap: wrap; }
  .photos-liste__actions { flex-direction: row; width: 100%; }
}

/* ------------------------------------------------ barre d'avancement --- */
.avancement {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}
.avancement__piste {
  flex: 1;
  height: 7px;
  min-width: 70px;
  background: var(--bordure);
  border-radius: 99px;
  overflow: hidden;
}
.avancement__barre {
  height: 100%;
  background: var(--orange);
  border-radius: 99px;
  transition: width var(--vitesse-normale, 300ms) ease;
}
.avancement__barre--termine { background: var(--succes); }
.avancement__valeur {
  font-variant-numeric: tabular-nums;
  font-size: 0.8rem;
  font-weight: 650;
  color: var(--texte-doux);
  min-width: 3ch;
  text-align: right;
}
.avancement--large .avancement__piste { height: 11px; }
.avancement--large .avancement__valeur { font-size: 0.95rem; }

/* --------------------------------------------------- fil des étapes --- */
.jalons {
  display: flex;
  align-items: flex-start;
  gap: 0;
  overflow-x: auto;
  padding: 0.5rem 0 0.25rem;
}
.jalon {
  flex: 1;
  min-width: 92px;
  text-align: center;
  position: relative;
  padding-top: 1.5rem;
}
.jalon::before {
  content: "";
  position: absolute;
  top: 7px;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--bordure);
}
.jalon:first-child::before { left: 50%; }
.jalon:last-child::before { right: 50%; }
.jalon__pastille {
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--surface);
  border: 2px solid var(--bordure-forte);
}
.jalon__libelle {
  font-size: 0.72rem;
  line-height: 1.25;
  color: var(--texte-faible);
  padding: 0 0.2rem;
}
.jalon--fait::before { background: var(--succes); }
.jalon--fait .jalon__pastille { background: var(--succes); border-color: var(--succes); }
.jalon--fait .jalon__libelle { color: var(--texte-doux); }
.jalon--courant .jalon__pastille {
  background: var(--orange);
  border-color: var(--orange);
  box-shadow: 0 0 0 4px rgba(222, 114, 47, 0.18);
}
.jalon--courant .jalon__libelle { color: var(--texte); font-weight: 650; }

/* --------------------------------------------------------- timeline --- */
.timeline { list-style: none; margin: 0; padding: 0; position: relative; }
.timeline::before {
  content: "";
  position: absolute;
  left: 9px;
  top: 6px;
  bottom: 6px;
  width: 2px;
  background: var(--bordure);
}
.timeline__element {
  position: relative;
  padding: 0 0 1.1rem 2rem;
}
.timeline__element:last-child { padding-bottom: 0; }
.timeline__point {
  position: absolute;
  left: 3px;
  top: 4px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--surface);
  border: 2px solid var(--bordure-forte);
}
.timeline__element--important .timeline__point {
  background: var(--orange);
  border-color: var(--orange);
}
.timeline__element--portail .timeline__point { border-color: var(--bleu); }
.timeline__entete {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
  flex-wrap: wrap;
}
.timeline__titre { font-weight: 600; font-size: 0.9rem; }
.timeline__date {
  font-size: 0.76rem;
  color: var(--texte-faible);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.timeline__detail {
  margin: 0.25rem 0 0;
  font-size: 0.84rem;
  color: var(--texte-doux);
  white-space: pre-wrap;
}
.timeline__meta { margin-top: 0.25rem; font-size: 0.74rem; color: var(--texte-faible); }

/* ------------------------------------------------------- liste d'étapes */
.etapes { list-style: none; margin: 0; padding: 0; }
.etape {
  border-bottom: 1px solid var(--bordure);
  padding: 0.85rem 1.15rem;
}
.etape:last-child { border-bottom: none; }
.etape__entete {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}
.etape__rang {
  font-family: var(--police-references);
  font-variant-numeric: tabular-nums;
  font-size: 0.76rem;
  color: var(--texte-faible);
  width: 1.6rem;
  flex-shrink: 0;
}
.etape__titre { font-weight: 600; flex: 1; min-width: 160px; }
.etape__corps { margin-top: 0.55rem; padding-left: 2.35rem; }
.etape__description { font-size: 0.84rem; color: var(--texte-doux); margin: 0 0 0.4rem; }
.etape__dates { font-size: 0.78rem; color: var(--texte-faible); }
.etape__formulaire {
  display: flex;
  gap: 0.4rem;
  align-items: flex-end;
  flex-wrap: wrap;
  margin-top: 0.6rem;
  padding-top: 0.6rem;
  border-top: 1px dashed var(--bordure);
}
.etape__formulaire .champ { margin-bottom: 0; }
.etape__formulaire select,
.etape__formulaire input[type="number"] { min-width: 110px; }

/* ------------------------------------------------- galerie de vignettes */
.vignettes {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(145px, 1fr));
  gap: 0.75rem;
}
.vignette {
  border: 1px solid var(--bordure);
  border-radius: var(--rayon);
  overflow: hidden;
  background: var(--surface);
  display: flex;
  flex-direction: column;
}
.vignette__image {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  background: var(--surface-2);
  display: block;
}
.vignette__corps { padding: 0.5rem 0.6rem; font-size: 0.76rem; }
.vignette__nom {
  display: block;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.vignette__actions {
  display: flex;
  gap: 0.25rem;
  padding: 0 0.5rem 0.5rem;
  flex-wrap: wrap;
}

/* --- divers --- */
.mono { font-family: var(--police-references); font-variant-numeric: tabular-nums; font-size: 0.88em; letter-spacing: 0.01em; }
.texte-doux { color: var(--texte-doux); }
.texte-faible { color: var(--texte-faible); }
.texte-petit { font-size: 0.8rem; }
.texte-droite { text-align: right; }
.nowrap { white-space: nowrap; }
.separateur { height: 1px; background: var(--bordure); border: 0; margin: 1.25rem 0; }

.chargement {
  display: inline-block;
  width: 13px; height: 13px;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: rotation 0.7s linear infinite;
}
@keyframes rotation { to { transform: rotate(360deg); } }

/* ===========================================================================
   ESPACE CLIENT
   Même système de composants, présentation plus calme et plus aérée : c'est
   une interface de consultation, pas un outil de production.
   =========================================================================== */

.portail { min-height: 100vh; display: flex; flex-direction: column; background: var(--fond); }

.portail__entete {
  background: var(--noir-doux);
  color: #fff;
  padding: 0.9rem 0;
}
.portail__barre {
  max-width: 1040px;
  margin: 0 auto;
  padding: 0 1.25rem;
  display: flex;
  align-items: center;
  gap: 1rem;
}

/* Deux colonnes asymétriques : un tableau de document à gauche a besoin de
   largeur, la colonne latérale ne porte que des encadrés. */
.grille--principale {
  display: grid;
  grid-template-columns: minmax(0, 2.4fr) minmax(0, 1fr);
  gap: 1rem;
}
@media (max-width: 1100px) {
  .grille--principale { grid-template-columns: minmax(0, 1fr); }
}

/* Résumé chiffré d'un devis dans la liste de l'espace client. */
.devis-resume {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--bordure);
}
.devis-resume__libelle {
  display: block;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--texte-faible);
}
.devis-resume__valeur { font-size: 1rem; font-weight: 650; color: var(--texte); }

/* Bloc d'acceptation : mis en avant, c'est l'action attendue de la page. */
.carte--decision { border-color: var(--orange); border-width: 1px; }
.carte--decision .carte__entete { background: #fdf4ee; }
.carte--decision .carte__entete h2 { color: var(--orange-fonce); }

/* Navigation des rubriques du portail, sous la barre d'identité. */
.portail__nav {
  margin-top: 0.9rem;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
}
.portail__nav-interieur {
  max-width: 1040px;
  margin: 0 auto;
  padding: 0 1.25rem;
  display: flex;
  gap: 0.35rem;
}
.portail__nav a {
  display: block;
  padding: 0.65rem 0.9rem;
  color: rgba(255, 255, 255, 0.68);
  font-size: 0.9rem;
  font-weight: 600;
  text-decoration: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
}
.portail__nav a:hover { color: #fff; }
.portail__nav a[aria-current="page"] {
  color: #fff;
  border-bottom-color: var(--orange);
}
.portail__marque {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  color: #fff;
  text-decoration: none;
}
.portail__marque:hover { text-decoration: none; }
.portail__logo {
  width: 36px; height: 36px;
  background: var(--orange);
  border-radius: var(--rayon-sm);
  display: grid; place-items: center;
  font-weight: 800; font-size: .8rem; letter-spacing: -.03em;
}
.portail__titre { font-size: 0.95rem; font-weight: 650; line-height: 1.2; }
.portail__sous-titre { font-size: 0.7rem; color: rgba(255,255,255,.55); }
.portail__actions { margin-left: auto; display: flex; align-items: center; gap: 0.75rem; }
.portail__compte { font-size: 0.82rem; color: rgba(255,255,255,.75); }

.portail__contenu {
  flex: 1;
  width: 100%;
  max-width: 1040px;
  margin: 0 auto;
  padding: 1.75rem 1.25rem 3rem;
}

.portail__pied {
  border-top: 1px solid var(--bordure);
  background: var(--surface);
  padding: 1.25rem;
  text-align: center;
  font-size: 0.8rem;
  color: var(--texte-faible);
}

.portail h1 { font-size: 1.6rem; margin-bottom: 0.3rem; }
.portail .carte { box-shadow: var(--ombre-1); }

/* Carte de dossier sur l'accueil client */
.dossier {
  display: block;
  background: var(--surface);
  border: 1px solid var(--bordure);
  border-radius: var(--rayon);
  padding: 1.25rem;
  text-decoration: none;
  color: inherit;
  box-shadow: var(--ombre-1);
  transition: box-shadow var(--transition), transform var(--transition);
}
.dossier:hover {
  text-decoration: none;
  box-shadow: var(--ombre-2);
  transform: translateY(-2px);
}
.dossier__titre { font-size: 1.05rem; font-weight: 650; margin-bottom: 0.2rem; }
.dossier__reference {
  font-family: var(--police-references);
  font-variant-numeric: tabular-nums;
  font-size: 0.74rem;
  color: var(--texte-faible);
}
.dossier__etat { margin: 0.65rem 0; }
.dossier__dates { font-size: 0.82rem; color: var(--texte-doux); margin-top: 0.65rem; }

/* Étapes vues par le client : plus lisibles, sans outils d'édition */
.suivi-etape {
  display: flex;
  gap: 0.9rem;
  padding: 0.9rem 0;
  border-bottom: 1px solid var(--bordure);
}
.suivi-etape:last-child { border-bottom: none; }
.suivi-etape__marqueur {
  width: 26px; height: 26px;
  border-radius: 50%;
  flex-shrink: 0;
  display: grid; place-items: center;
  font-size: 0.78rem; font-weight: 700;
  background: var(--surface-2);
  color: var(--texte-faible);
  border: 2px solid var(--bordure-forte);
}
.suivi-etape--terminee .suivi-etape__marqueur {
  background: var(--succes); border-color: var(--succes); color: #fff;
}
.suivi-etape--en_cours .suivi-etape__marqueur {
  background: var(--orange); border-color: var(--orange); color: #fff;
}
.suivi-etape--bloquee .suivi-etape__marqueur {
  background: var(--danger); border-color: var(--danger); color: #fff;
}
.suivi-etape__corps { flex: 1; min-width: 0; }
.suivi-etape__titre { font-weight: 650; }
.suivi-etape__texte { font-size: 0.86rem; color: var(--texte-doux); margin: 0.2rem 0 0; }
.suivi-etape__dates { font-size: 0.78rem; color: var(--texte-faible); margin-top: 0.3rem; }

.dossier__etat { display: flex; flex-wrap: wrap; align-items: center; gap: 0.4rem; }
.dossier__chiffres { display: flex; flex-wrap: wrap; gap: 0.3rem 1rem; margin: 0.5rem 0 0; font-size: 0.8rem; color: var(--texte-faible); }
.dossier__montant { font-weight: 650; font-size: 0.88rem; }
.dossier--proposition { border-style: dashed; border-color: var(--orange-clair); background: linear-gradient(180deg, #fff8f3 0%, var(--surface) 70%); }

/* Ce qui attend le client */
.a-faire-client { margin-bottom: 1.5rem; border-left: 4px solid var(--orange); }
.a-faire-client__liste { list-style: none; margin: 0; padding: 0; }
.a-faire-client__item { display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; padding: 0.8rem 1.25rem; border-top: 1px solid var(--bordure); }
.a-faire-client__texte { min-width: 0; }
.a-faire-client__item .bouton { flex: none; }

/* Page chantier : sommaire, lots et tâches */
.sommaire-chantier { display: flex; gap: 0.4rem; overflow-x: auto; margin: 0 0 1.25rem; padding-bottom: 0.2rem; }
.sommaire-chantier a { flex: none; padding: 0.35rem 0.8rem; border: 1px solid var(--bordure-forte); border-radius: 999px; background: var(--surface); font-size: 0.82rem; color: var(--texte); text-decoration: none; }
.sommaire-chantier a:hover { border-color: var(--bleu); color: var(--bleu); }
.portail [id] { scroll-margin-top: 1rem; }

.suivi-lot { border: 1px solid var(--bordure); border-radius: var(--rayon); margin-top: 0.75rem; background: var(--surface); }
.suivi-lot > .suivi-etape, .suivi-lot > .suivi-lot__mot { margin: 0 1rem; }
.suivi-lot__entete { display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; padding: 0.75rem 1rem; cursor: pointer; list-style: none; font-weight: 650; background: var(--surface-2); border-radius: var(--rayon); }
.suivi-lot__entete::-webkit-details-marker { display: none; }
.suivi-lot__entete::before { content: "▸"; color: var(--texte-faible); transition: transform var(--transition); }
.suivi-lot[open] > .suivi-lot__entete::before { transform: rotate(90deg); }
.suivi-lot[open] > .suivi-lot__entete { border-bottom: 1px solid var(--bordure); border-radius: var(--rayon) var(--rayon) 0 0; }
.suivi-lot__nom { flex: 1; min-width: 0; }
.suivi-lot__compte { flex: none; font-size: 0.8rem; font-weight: 600; color: var(--texte-doux); }
.suivi-lot__mot { padding: 0.6rem 0 0; font-size: 0.86rem; font-weight: 600; color: var(--texte-doux); }
.suivi-tache__mot { margin: 0.35rem 0 0; padding: 0.45rem 0.7rem; border-left: 3px solid var(--orange); background: var(--surface-2); font-size: 0.88rem; color: var(--texte-doux); }
.suivi-tache__photos { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 0.4rem; margin-top: 0.55rem; max-width: 520px; }
.suivi-tache__photos a { display: block; }
.suivi-tache__photos img { display: block; width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: var(--rayon-sm); background: var(--fond); }

/* Liste de pièces, partagée par la page chantier et « Tous mes documents » */
.liste-docs { list-style: none; margin: 0; padding: 0; }
.liste-docs__item { display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; padding: 0.75rem 1.25rem; border-top: 1px solid var(--bordure); }
.liste-docs__corps { display: flex; flex-direction: column; min-width: 0; }
.liste-docs__type { font-size: 0.72rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; color: var(--texte-faible); }
.liste-docs__titre { font-weight: 600; overflow-wrap: anywhere; }
.liste-docs__meta { font-size: 0.8rem; color: var(--texte-doux); }
.liste-docs__etat { display: flex; flex-wrap: wrap; justify-content: flex-end; align-items: center; gap: 0.4rem; flex: none; max-width: 45%; }

.filtres-docs { padding: 1rem 1.25rem; margin-bottom: 1rem; }
.filtres-docs__champs { display: grid; grid-template-columns: 2fr repeat(3, 1fr); gap: 0.75rem; }
.filtres-docs__champs .champ { margin-bottom: 0; }
.filtres-docs__actions { display: flex; gap: 0.5rem; margin-top: 0.75rem; }
.filtres-docs__bilan { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.75rem; margin: 0 0 1rem; }
.filtres-docs__bilan p { margin: 0; }
.groupe-docs { margin-bottom: 1.25rem; }
.groupe-docs h2 { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.5rem; }

@media (max-width: 700px) {
  .filtres-docs__champs { grid-template-columns: 1fr 1fr; }
  .filtres-docs__recherche { grid-column: 1 / -1; }
  .liste-docs__item, .a-faire-client__item { padding: 0.7rem 1rem; }
  .liste-docs__item { align-items: flex-start; }
}

@media (max-width: 700px) {
  .portail__barre { flex-wrap: wrap; }
  .portail__actions { width: 100%; justify-content: space-between; }
}

/* ================================================== navigation simplifiée */

/* Menu latéral : six entrées, plus grandes, chacune avec son pictogramme. */
.barre__nav .barre__lien {
  padding: 0.7rem 0.75rem;
  font-size: 0.95rem;
  margin-bottom: 0.15rem;
}
.barre__nav .barre__lien .icone { width: 20px; height: 20px; flex-shrink: 0; opacity: 0.85; }
.barre__nav .barre__lien[aria-current="page"] .icone { opacity: 1; color: var(--orange-clair); }

/* Onglets d'une rubrique, en tête des pages de liste. */
.onglets-rubrique {
  display: flex;
  gap: 0.25rem;
  margin: -0.25rem 0 1.25rem;
  border-bottom: 1px solid var(--bordure);
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
.onglets-rubrique::-webkit-scrollbar { display: none; }
.onglets-rubrique__lien {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.65rem 0.9rem;
  color: var(--texte-doux);
  font-weight: 600;
  font-size: 0.9rem;
  white-space: nowrap;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
}
.onglets-rubrique__lien:hover { color: var(--texte); text-decoration: none; }
.onglets-rubrique__lien[aria-current="page"] { color: var(--texte); border-bottom-color: var(--orange); }
.onglets-rubrique__badge,
.tuile__badge {
  background: var(--orange);
  color: #fff;
  border-radius: 999px;
  padding: 0.05rem 0.45rem;
  font-size: 0.7rem;
  font-weight: 700;
}

/* Tuiles : page « Plus » et page « Nouveau ». */
.tuiles {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 0.75rem;
}
.tuiles--liste { grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }
.tuile {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  min-height: 64px;
  padding: 0.9rem 1rem;
  background: var(--surface);
  border: 1px solid var(--bordure);
  border-radius: var(--rayon);
  box-shadow: var(--ombre-1);
  color: var(--texte);
  transition: box-shadow var(--transition), border-color var(--transition);
}
.tuile:hover { text-decoration: none; border-color: var(--bordure-forte); box-shadow: var(--ombre-2); }
.tuile__icone {
  width: 42px; height: 42px;
  flex-shrink: 0;
  display: grid; place-items: center;
  border-radius: var(--rayon);
  background: rgba(54, 91, 109, 0.09);
  color: var(--bleu);
}
.tuile__texte { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.tuile__titre { font-weight: 650; font-size: 0.95rem; }
.tuile__detail { font-size: 0.8rem; color: var(--texte-doux); }
.tuile > .icone:last-child { color: var(--texte-faible); flex-shrink: 0; }

.section-rapide { margin-bottom: 1.75rem; }
.section-rapide__titre {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.4rem;
}
.section-rapide__titre .icone { color: var(--orange); }

/* ======================================================= fiche chantier */

.lien-retour {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  margin: -0.35rem 0 0.75rem -0.2rem;
  padding: 0.35rem 0.4rem;
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--texte-doux);
  border-radius: var(--rayon-sm);
}
.lien-retour:hover { color: var(--texte); background: rgba(0, 0, 0, 0.04); text-decoration: none; }

.fiche-entete {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
}
.fiche-entete__texte { flex: 1; min-width: 0; }
.fiche-entete__ligne {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 0.3rem 0 0;
  color: var(--texte-doux);
}
.fiche-entete__contacts { display: flex; flex-wrap: wrap; gap: 0.5rem; margin: 0.6rem 0 0; }
.contact-rapide {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.4rem 0.7rem;
  border: 1px solid var(--bordure);
  border-radius: 999px;
  background: var(--surface);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--bleu);
  max-width: 100%;
}
.contact-rapide:hover { text-decoration: none; border-color: var(--bordure-forte); }
.fiche-entete__actions { display: flex; gap: 0.5rem; align-items: flex-start; }

/* Bouton « Ajouter » : une liste déroulante qui fonctionne sans JavaScript. */
.menu-ajout { position: relative; }
.menu-ajout > summary { list-style: none; cursor: pointer; }
.menu-ajout > summary::-webkit-details-marker { display: none; }
.menu-ajout__liste {
  position: absolute;
  right: 0;
  top: calc(100% + 0.4rem);
  z-index: 30;
  width: min(330px, calc(100vw - 2rem));
  background: var(--surface);
  border: 1px solid var(--bordure);
  border-radius: var(--rayon);
  box-shadow: var(--ombre-3);
  padding: 0.35rem;
}
.menu-ajout__lien {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.6rem 0.65rem;
  border-radius: var(--rayon-sm);
  color: var(--texte);
}
.menu-ajout__lien:hover { background: var(--fond); text-decoration: none; }
.menu-ajout__icone {
  width: 36px; height: 36px;
  flex-shrink: 0;
  display: grid; place-items: center;
  border-radius: var(--rayon-sm);
  background: rgba(222, 114, 47, 0.1);
  color: var(--orange-fonce);
}
.menu-ajout__titre { display: block; font-weight: 650; }
.menu-ajout__detail { display: block; font-size: 0.78rem; color: var(--texte-doux); }

/* Chiffres clés sous l'en-tête. */
.chiffres-chantier {
  display: grid;
  grid-template-columns: minmax(180px, 1.4fr) repeat(3, minmax(120px, 1fr));
  gap: 1px;
  background: var(--bordure);
  border: 1px solid var(--bordure);
  border-radius: var(--rayon);
  overflow: hidden;
  margin-bottom: 1rem;
}
.chiffre-chantier { background: var(--surface); padding: 0.75rem 1rem; display: flex; flex-direction: column; justify-content: center; gap: 0.2rem; }
.chiffre-chantier__libelle {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--texte-faible);
  font-weight: 600;
}
.chiffre-chantier__valeur { font-size: 1.1rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.chiffre-chantier__detail { font-size: 0.75rem; color: var(--alerte); font-weight: 600; }

/* Onglets de la fiche : défilent horizontalement sur téléphone. */
.onglets-fiche {
  display: flex;
  gap: 0.15rem;
  margin-bottom: 1.25rem;
  border-bottom: 1px solid var(--bordure);
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
  position: sticky;
  top: var(--hauteur-entete);
  z-index: 10;
  background: var(--fond);
}
.onglets-fiche::-webkit-scrollbar { display: none; }
.onglets-fiche__lien {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.75rem 0.95rem;
  white-space: nowrap;
  font-weight: 600;
  color: var(--texte-doux);
  border-bottom: 3px solid transparent;
  margin-bottom: -1px;
}
.onglets-fiche__lien:hover { color: var(--texte); text-decoration: none; }
.onglets-fiche__lien[aria-current="page"] { color: var(--texte); border-bottom-color: var(--orange); }

/* Liste « À faire ». */
.a-faire { list-style: none; margin: 0; padding: 0.35rem; }
.a-faire__lien {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.7rem 0.75rem;
  border-radius: var(--rayon-sm);
  border-left: 3px solid var(--bordure-forte);
  color: var(--texte);
  margin-bottom: 0.25rem;
  background: var(--surface-2);
}
.a-faire__lien:hover { background: var(--fond); text-decoration: none; }
.a-faire__lien--danger { border-left-color: var(--danger); }
.a-faire__lien--alerte { border-left-color: var(--alerte); }
.a-faire__lien--info { border-left-color: var(--info); }
.a-faire__lien .icone { color: var(--texte-faible); flex-shrink: 0; }

.mosaique { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.4rem; }
.mosaique img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: var(--rayon-sm); }

.tableau--fiche th { width: 38%; font-weight: 600; color: var(--texte-doux); vertical-align: top; }

/* Rapport de chantier. */
.bouton-photo {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  min-height: 64px;
  padding: 0.9rem;
  border: 2px dashed var(--bordure-forte);
  border-radius: var(--rayon);
  background: var(--surface-2);
  color: var(--bleu);
  font-weight: 650;
  cursor: pointer;
}
.bouton-photo:hover { border-color: var(--bleu); }
input:focus-visible + .bouton-photo, .bouton-photo:focus-within { outline: 2px solid var(--bleu); outline-offset: 2px; }
.bouton--grand { padding: 0.85rem 1rem; font-size: 1rem; }

@media (max-width: 700px) {
  .chiffres-chantier { grid-template-columns: repeat(3, 1fr); }
  .chiffre-chantier { padding: 0.65rem 0.7rem; }
  .chiffre-chantier__valeur { font-size: 0.95rem; }
  .chiffre-chantier--avancement { grid-column: 1 / -1; }
  .fiche-entete__actions { width: 100%; position: relative; }
  .fiche-entete__actions > * { flex: 1; }
  .fiche-entete__actions .bouton { width: 100%; justify-content: center; }
  /* La liste prend toute la largeur sous les deux boutons. */
  .menu-ajout { position: static; }
  .menu-ajout__liste { left: 0; right: 0; width: auto; }
  .onglets-fiche { top: var(--hauteur-entete); margin-left: -1rem; margin-right: -1rem; padding: 0 0.5rem; }
}

/* Assistant « Facturer ». */
.choix-facture { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 0.75rem; }
.choix-facture__carte {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  padding: 1rem;
  border: 1px solid var(--bordure);
  border-radius: var(--rayon);
  background: var(--surface-2);
}
.choix-facture__carte .bouton { margin-top: auto; }
.choix-facture__titre { font-weight: 700; font-size: 1rem; }
.choix-facture__detail { font-size: 0.82rem; color: var(--texte-doux); }
.choix-facture__pourcent { display: flex; align-items: center; gap: 0.4rem; font-weight: 600; }
.choix-facture__pourcent input { width: 5.5rem; text-align: right; }

/* Photos de réserves (le cadre de signature est dans signature.css). */
.resume-decision { font-weight: 650; padding: 0.6rem 0.75rem; background: var(--info-fond); border-radius: var(--rayon-sm); }
.liste-reserves { margin: 0.25rem 0 0; padding-left: 1.3rem; }
.liste-reserves li { margin-bottom: 0.35rem; }
.signature-apercu { margin: -0.5rem 0 1rem; }
.signature-apercu img { max-height: 90px; background: #fff; border: 1px solid var(--bordure); border-radius: var(--rayon-sm); padding: 0.25rem; }
.photos-reserve { display: flex; gap: 0.5rem; margin-top: 0.4rem; }
.photos-reserve a { display: flex; flex-direction: column; align-items: center; gap: 0.15rem; font-size: 0.7rem; color: var(--texte-doux); }
.photos-reserve img { width: 64px; height: 64px; object-fit: cover; border-radius: var(--rayon-sm); }

/* Barre du bas, sur téléphone et tablette uniquement. */
.barre-mobile { display: none; }

/* ============================================================= responsive */

.bouton-menu {
  display: none;
  background: none;
  border: 1px solid var(--bordure-forte);
  border-radius: var(--rayon-sm);
  padding: 0.35rem 0.5rem;
  cursor: pointer;
}

@media (max-width: 900px) {
  .appli { grid-template-columns: minmax(0, 1fr); }
  .barre {
    position: fixed;
    inset: 0 auto 0 0;
    width: var(--largeur-barre);
    z-index: 60;
    transform: translateX(-100%);
    transition: transform var(--transition);
    box-shadow: var(--ombre-3);
  }
  .barre[data-ouvert="true"] { transform: translateX(0); }
  .bouton-menu { display: inline-flex; }
  .voile-barre {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    z-index: 50;
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--transition);
  }
  .voile-barre[data-ouvert="true"] { opacity: 1; pointer-events: auto; }
  .contenu { padding: 1rem; padding-bottom: calc(5.5rem + env(safe-area-inset-bottom)); }
  .entete { padding: 0 1rem; }

  .barre-mobile {
    display: flex;
    position: fixed;
    left: 0; right: 0; bottom: 0;
    z-index: 40;
    background: var(--surface);
    border-top: 1px solid var(--bordure);
    box-shadow: 0 -2px 10px rgba(16, 24, 32, 0.06);
    padding: 0.3rem 0.25rem calc(0.3rem + env(safe-area-inset-bottom));
  }
  .barre-mobile__lien {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.15rem;
    min-height: 52px;
    padding: 0.25rem 0;
    background: none;
    border: 0;
    font: inherit;
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--texte-doux);
    cursor: pointer;
  }
  .barre-mobile__lien:hover { text-decoration: none; }
  .barre-mobile__lien[aria-current="page"] { color: var(--orange-fonce); }
  .barre-mobile__rond {
    width: 46px; height: 46px;
    margin-top: -1.1rem;
    display: grid; place-items: center;
    border-radius: 50%;
    background: var(--orange);
    color: #fff;
    box-shadow: var(--ombre-2);
  }
  .barre-mobile__lien--ajouter { color: var(--orange-fonce); }
}

/* ===================================================== éditeur de devis */

.editeur { display: flex; flex-direction: column; gap: 1rem; min-width: 0; }
.editeur__interieur { display: flex; flex-direction: column; gap: 1rem; }
.editeur__entete { position: sticky; top: calc(var(--hauteur-entete) + 0.5rem); z-index: 15; }
.editeur__entete .carte__corps { display: flex; flex-direction: column; gap: 0.7rem; }

.editeur__recherche { position: relative; }
.editeur__saisie {
  width: 100%;
  padding: 0.85rem 1rem 0.85rem 2.6rem;
  border: 2px solid var(--bordure-forte);
  border-radius: var(--rayon);
  font: inherit;
  font-size: 1rem;
  background: var(--surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' fill='none' stroke='%23869099' stroke-width='2' viewBox='0 0 24 24'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='m20 20-3.5-3.5'/%3E%3C/svg%3E") no-repeat 0.85rem center;
  transition: border-color var(--transition), box-shadow var(--transition);
}
.editeur__saisie:focus { outline: none; border-color: var(--orange); box-shadow: 0 0 0 4px rgba(222, 114, 47, 0.14); }
.editeur__propositions {
  position: absolute;
  left: 0; right: 0;
  top: calc(100% + 0.35rem);
  z-index: 40;
  max-height: min(60vh, 420px);
  overflow-y: auto;
  background: var(--surface);
  border: 1px solid var(--bordure);
  border-radius: var(--rayon);
  box-shadow: var(--ombre-3);
  padding: 0.3rem;
}
.proposition {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  width: 100%;
  text-align: left;
  padding: 0.6rem 0.75rem;
  border: 0;
  border-radius: var(--rayon-sm);
  background: none;
  font: inherit;
  cursor: pointer;
  color: var(--texte);
}
.proposition:hover, .proposition--active { background: rgba(222, 114, 47, 0.09); }
.proposition__titre { font-weight: 650; }
.proposition__detail { font-size: 0.78rem; color: var(--texte-doux); }
.proposition--libre { border-top: 1px dashed var(--bordure); margin-top: 0.2rem; }

.editeur__outils { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; }
.editeur__nature { padding: 0.4rem 0.6rem; border: 1px solid var(--bordure-forte); border-radius: var(--rayon-sm); font: inherit; font-size: 0.82rem; background: var(--surface); max-width: 100%; }
.editeur__modeles { position: relative; }
.editeur__modeles > summary { list-style: none; }
.editeur__modeles > summary::-webkit-details-marker { display: none; }
.editeur__menu {
  position: absolute; left: 0; top: calc(100% + 0.35rem); z-index: 40;
  width: min(320px, 85vw); padding: 0.5rem;
  background: var(--surface); border: 1px solid var(--bordure); border-radius: var(--rayon); box-shadow: var(--ombre-3);
  display: flex; flex-direction: column; gap: 0.3rem;
}
.editeur__menu-lien { display: flex; flex-direction: column; text-align: left; gap: 0.1rem; padding: 0.5rem 0.6rem; border: 0; border-radius: var(--rayon-sm); background: none; font: inherit; cursor: pointer; }
.editeur__menu-lien:hover { background: var(--fond); }
.editeur__menu-lien span { font-size: 0.78rem; color: var(--texte-doux); }
.editeur__sauvegarde { margin-left: auto; font-size: 0.78rem; color: var(--succes); font-weight: 600; }
.editeur__sauvegarde::before { content: "\2713  "; }
.editeur__sauvegarde--encours { color: var(--texte-faible); }
.editeur__sauvegarde--encours::before { content: "\21BB  "; }
.editeur__accueil strong { font-size: 1.05rem; }

.editeur__lots { display: flex; flex-direction: column; gap: 1rem; }
.lot-devis { background: var(--surface); border: 1px solid var(--bordure); border-radius: var(--rayon); box-shadow: var(--ombre-1); overflow: hidden; }
.lot-devis__entete {
  display: flex; align-items: center; gap: 0.6rem;
  padding: 0.6rem 0.85rem;
  background: linear-gradient(90deg, rgba(54, 91, 109, 0.08), transparent);
  border-bottom: 1px solid var(--bordure);
  border-left: 4px solid var(--bleu);
}
.lot-devis__entete--vide { color: var(--texte-faible); font-size: 0.82rem; border-left-color: var(--bordure-forte); }
.lot-devis__nom { flex: 1; min-width: 0; border: 1px solid transparent; border-radius: var(--rayon-sm); padding: 0.3rem 0.45rem; font: inherit; font-weight: 700; font-size: 1rem; background: transparent; color: var(--texte); }
.lot-devis__nom:hover:not(:disabled) { border-color: var(--bordure); background: var(--surface); }
.lot-devis__nom:focus { outline: none; border-color: var(--bleu); background: var(--surface); }
.lot-devis__total { font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.lot-devis__actions { display: flex; gap: 0.15rem; }
.lot-devis__vide { margin: 0; padding: 0.9rem; color: var(--texte-faible); font-size: 0.85rem; }
.lot-devis__ajout { display: block; width: calc(100% - 1.4rem); margin: 0.5rem 0.7rem 0.7rem; padding: 0.5rem 0.65rem; border: 1px dashed var(--bordure-forte); border-radius: var(--rayon-sm); font: inherit; font-size: 0.85rem; background: var(--surface-2); }
.lot-devis__ajout:focus { outline: none; border-style: solid; border-color: var(--bleu); background: var(--surface); }

.ligne-devis {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  grid-template-areas: "poignee designation" ". chiffres" ". pied" "taches taches";
  gap: 0.35rem 0.6rem;
  padding: 0.7rem 0.85rem 0.6rem 0.5rem;
  border-bottom: 1px solid var(--bordure);
  transition: background var(--transition);
}
.ligne-devis:last-of-type { border-bottom: 0; }
.ligne-devis--texte { grid-template-columns: 34px minmax(0, 1fr) auto; grid-template-areas: "poignee designation pied"; }
.ligne-devis--a-chiffrer { background: rgba(168, 105, 10, 0.05); }
.ligne-devis--nouvelle { animation: ligne-nouvelle 1.6s ease-out; }
@keyframes ligne-nouvelle { from { background: rgba(222, 114, 47, 0.22); } to { background: transparent; } }
.ligne-devis--glissee { opacity: 0.45; }
.ligne-devis--cible { box-shadow: inset 0 3px 0 var(--orange); }
.ligne-devis__poignee { grid-area: poignee; display: flex; flex-direction: column; align-items: center; gap: 0.1rem; }
.poignee { cursor: grab; color: var(--texte-faible); font-weight: 700; letter-spacing: -2px; user-select: none; padding: 0.15rem; }
.ligne-devis__designation { grid-area: designation; display: flex; flex-direction: column; gap: 0.25rem; min-width: 0; }
.ligne-devis__chiffres { grid-area: chiffres; display: flex; flex-wrap: wrap; align-items: flex-end; gap: 0.5rem; }
.ligne-devis__case { display: flex; flex-direction: column; gap: 0.1rem; font-size: 0.68rem; color: var(--texte-faible); text-transform: uppercase; letter-spacing: 0.04em; font-weight: 600; }
.ligne-devis__case .champ-ligne { width: 5.5rem; text-transform: none; letter-spacing: 0; }
.ligne-devis__case--prix .champ-ligne { width: 7rem; }
.ligne-devis__case select.champ-ligne { width: auto; }
.ligne-devis__total { margin-left: auto; font-weight: 700; font-size: 1rem; font-variant-numeric: tabular-nums; padding-bottom: 0.35rem; white-space: nowrap; }
.ligne-devis__pied { grid-area: pied; display: flex; flex-wrap: wrap; align-items: center; gap: 0.6rem; }
.ligne-devis__pied .bouton-icone:last-child { margin-left: auto; }
.ligne-devis--texte .ligne-devis__pied { align-self: start; }

.champ-ligne {
  width: 100%;
  padding: 0.4rem 0.55rem;
  border: 1px solid var(--bordure);
  border-radius: var(--rayon-sm);
  font: inherit;
  font-size: 0.875rem;
  background: var(--surface);
  color: var(--texte);
  transition: border-color var(--transition), box-shadow var(--transition);
}
.champ-ligne:hover:not(:disabled) { border-color: var(--bordure-forte); }
.champ-ligne:focus { outline: none; border-color: var(--bleu); box-shadow: 0 0 0 3px rgba(54, 91, 109, 0.14); }
.champ-ligne:disabled { background: transparent; border-color: transparent; color: var(--texte); }
.champ-ligne--designation { font-weight: 600; }
.champ-ligne--detail { font-size: 0.82rem; color: var(--texte-doux); resize: vertical; }
.champ-ligne--vide { border-color: var(--alerte); background: var(--alerte-fond); }
.champ-ligne--duree { width: 4rem; text-align: right; }
.champ-ligne--court { width: 4.5rem; text-align: right; }
textarea.champ-ligne { resize: vertical; line-height: 1.45; }

.lien-discret { border: 0; background: none; padding: 0; font: inherit; font-size: 0.78rem; font-weight: 600; color: var(--bleu); cursor: pointer; }
.lien-discret:hover { text-decoration: underline; }
.bouton-icone { border: 0; background: none; color: var(--texte-faible); font: inherit; font-size: 0.9rem; padding: 0.25rem 0.4rem; border-radius: var(--rayon-sm); cursor: pointer; line-height: 1; }
.bouton-icone:hover:not(:disabled) { background: var(--fond); color: var(--texte); }
.bouton-icone:disabled { opacity: 0.3; cursor: default; }
.bouton-icone--petit { font-size: 0.75rem; padding: 0.1rem 0.3rem; }
.recap-devis__duree { display: flex; flex-direction: column; gap: 0.15rem; padding-bottom: 0.8rem; margin-bottom: 0.8rem; border-bottom: 1px solid var(--bordure); }
.recap-devis__duree strong { font-size: 1.25rem; }
.recap-devis__etiquette { font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--texte-faible); font-weight: 600; }
.recap-devis__alertes { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-bottom: 0.8rem; }
.alerte-devis { border: 1px solid #c6dcea; background: var(--info-fond); color: var(--info); border-radius: 999px; padding: 0.35rem 0.8rem; font: inherit; font-size: 0.8rem; font-weight: 600; cursor: pointer; }
.alerte-devis--danger { border-color: #f0ddba; background: var(--alerte-fond); color: var(--alerte); }
.recap-devis__reglages { display: flex; flex-wrap: wrap; gap: 0.75rem 1.25rem; margin-bottom: 0.8rem; }
.recap-devis__reglage { display: inline-flex; align-items: center; gap: 0.35rem; font-size: 0.82rem; color: var(--texte-doux); }
.recap-devis__totaux { display: grid; grid-template-columns: 1fr auto; gap: 0.3rem 1rem; margin: 0; font-variant-numeric: tabular-nums; }
.recap-devis__totaux dt { color: var(--texte-doux); }
.recap-devis__totaux dd { margin: 0; text-align: right; font-weight: 600; }
.recap-devis__ttc { font-size: 1.15rem; font-weight: 800 !important; color: var(--texte) !important; padding-top: 0.35rem; border-top: 1px solid var(--bordure); }

@media (max-width: 700px) {
  .editeur__entete { top: calc(var(--hauteur-entete) + 0.25rem); }
  .editeur__sauvegarde { margin-left: 0; width: 100%; }
  .ligne-devis { grid-template-columns: 28px minmax(0, 1fr); padding-right: 0.6rem; }
  .ligne-devis__case .champ-ligne { width: 4.6rem; }
  .ligne-devis__case--prix .champ-ligne { width: 6rem; }
  .ligne-devis__total { width: 100%; text-align: right; padding-bottom: 0; }
}

/* ------------------------------------------ devis : planning des lots */

.ordre-travaux__simultane td { background: rgba(54, 91, 109, 0.05); }
.ordre-travaux__case { display: inline-flex; align-items: center; gap: 0.45rem; font-size: 0.85rem; color: var(--texte-doux); cursor: pointer; }

.lot-devis__planning { display: flex; flex-wrap: wrap; align-items: center; gap: 0.4rem 0.7rem; padding: 0.35rem 0.85rem; border-bottom: 1px solid var(--bordure); background: var(--surface-2); font-size: 0.78rem; color: var(--texte-doux); }
.lot-devis__planning--simultane { background: rgba(54, 91, 109, 0.06); }
.lot-devis__jours { font-weight: 600; }
.lot-devis__reglage-duree { display: inline-flex; align-items: center; gap: 0.3rem; }
.lot-devis__duree { width: 3.6rem; padding: 0.2rem 0.4rem; border: 1px solid var(--bordure); border-radius: var(--rayon-sm); font: inherit; font-size: 0.78rem; text-align: right; background: var(--surface); color: var(--texte); }
.lot-devis__planning--simultane .lot-devis__jours { color: var(--bleu); }
.lot-devis__mode { color: var(--texte-faible); }
.lot-devis__reglage-duree--regle .lot-devis__duree { border-color: var(--orange); font-weight: 600; }
.lot-devis__reglage-duree--regle .lot-devis__mode { color: var(--orange); font-weight: 600; }
.lot-devis__duree:focus { outline: 2px solid var(--orange); outline-offset: 1px; }
.recap-devis__auto { align-self: flex-start; margin-top: 0.5rem; }
.lot-devis__enchainement { padding: 0.2rem 0.4rem; border: 1px solid var(--bordure); border-radius: var(--rayon-sm); font: inherit; font-size: 0.78rem; background: var(--surface); color: var(--texte); max-width: 100%; }

.frise { display: flex; flex-direction: column; gap: 0.55rem; margin-top: 0.7rem; }
.frise__reperes { position: relative; height: 0.9rem; font-size: 0.66rem; color: var(--texte-faible); }
.frise__reperes span { position: absolute; top: 0; padding-left: 3px; border-left: 1px solid var(--bordure); }
.frise__ligne { display: flex; flex-direction: column; gap: 0.2rem; }
.frise__tete { display: flex; align-items: baseline; justify-content: space-between; gap: 0.5rem; }
.frise__nom { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; padding: 0; border: 0; background: none; font: inherit; font-size: 0.76rem; color: var(--texte-doux); text-align: left; cursor: pointer; }
.frise__nom:hover { color: var(--texte); text-decoration: underline; }
.frise__jours { flex: none; font-size: 0.7rem; color: var(--texte-faible); font-variant-numeric: tabular-nums; }
/* La piste : un trait fin à chaque semaine. */
.frise__piste { position: relative; height: 0.8rem; border-radius: 999px; background-color: var(--fond); background-image: linear-gradient(90deg, var(--bordure) 1px, transparent 1px); background-size: var(--semaine, 100%) 100%; }
.frise__barre { position: absolute; top: 0; bottom: 0; min-width: 6px; border-radius: 999px; background: linear-gradient(90deg, var(--orange), #e9965f); color: var(--orange); }
.frise__ligne--simultane .frise__barre { background: linear-gradient(90deg, var(--bleu), #5f8799); color: var(--bleu); }
.frise__ligne--regle .frise__nom { color: var(--texte); font-weight: 600; }
/* Réglable au doigt : barres hautes, poignée ronde à droite pour la durée. */
.frise--reglable { gap: 0.7rem; }
/* La poignée est posée après le bout de la barre : même un lot d'un jour garde un corps à faire glisser. */
.frise--reglable .frise__reperes, .frise--reglable .frise__piste { margin-right: 1.9rem; }
.frise--reglable .frise__piste { height: 1.75rem; border-radius: 0.6rem; }
.frise--reglable .frise__barre { border-radius: 0.6rem; cursor: grab; touch-action: pan-y; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; }
.frise--reglable .frise__barre::before { content: ""; position: absolute; inset: -0.45rem 0 -0.45rem -0.5rem; }
.frise--reglable .frise__barre:focus-visible { outline: 2px solid var(--texte); outline-offset: 2px; }
.frise--reglable .frise__barre.frise__barre--saisie { cursor: grabbing; opacity: 0.85; box-shadow: 0 0 0 3px rgba(222, 114, 47, 0.25); }
.frise__poignee { position: absolute; z-index: 1; top: 50%; right: -1.6rem; width: 1.4rem; height: 1.4rem; margin-top: -0.7rem; border-radius: 50%; border: 2px solid currentColor; background: var(--surface); cursor: ew-resize; touch-action: pan-y; }
.frise__poignee::before { content: ""; position: absolute; inset: -0.6rem -0.5rem -0.6rem -0.1rem; }
.frise__poignee::after { content: ""; position: absolute; inset: 0.3rem 0.42rem; border-left: 2px solid currentColor; border-right: 2px solid currentColor; opacity: 0.7; }
.recap-devis__note { color: var(--bleu); font-weight: 600; }

/* ------------------------------------------ devis : recherche et ajouts */

.editeur__ligne-recherche { display: flex; gap: 0.5rem; align-items: stretch; }
.editeur__ligne-recherche .editeur__recherche { flex: 1; min-width: 0; }
.editeur__catalogue { gap: 0.4rem; padding-inline: 1rem; white-space: nowrap; }
.editeur__catalogue-icone { font-size: 1rem; line-height: 1; }
.proposition__qte { font-weight: 600; color: var(--orange-fonce); }
.proposition__note { margin: 0; padding: 0.45rem 0.75rem 0.2rem; font-size: 0.7rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; color: var(--texte-faible); }
.proposition--outil { border-top: 1px dashed var(--bordure); margin-top: 0.2rem; }
.proposition--outil + .proposition--outil { border-top: 0; margin-top: 0; }
.proposition--outil .proposition__titre { color: var(--bleu); }
.editeur mark, .tiroir mark { background: rgba(222, 114, 47, 0.22); color: inherit; border-radius: 2px; padding: 0 1px; }

.editeur__departs { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 0.6rem; margin-top: 0.8rem; }
.depart { display: flex; flex-direction: column; gap: 0.2rem; text-align: left; padding: 0.85rem 1rem; border: 1px solid var(--bordure); border-radius: var(--rayon); background: var(--surface-2); font: inherit; color: var(--texte); cursor: pointer; transition: border-color var(--transition), background var(--transition); }
.depart:hover { border-color: var(--orange); background: var(--surface); }
.depart strong { font-size: 0.95rem; }
.depart span { font-size: 0.8rem; color: var(--texte-doux); }

.lot-devis__ajouts { display: flex; flex-wrap: wrap; gap: 0.4rem; padding: 0.55rem 0.7rem 0.7rem; border-top: 1px dashed var(--bordure); background: var(--surface-2); }
.lot-devis__ajouter { border: 1px dashed var(--bordure-forte); border-radius: var(--rayon-sm); background: var(--surface); padding: 0.45rem 0.75rem; font: inherit; font-size: 0.82rem; font-weight: 600; color: var(--bleu); cursor: pointer; }
.lot-devis__ajouter:hover { border-style: solid; border-color: var(--bleu); }

/* Panneau « Ajouter au devis » : à droite sur ordinateur, plein écran sur téléphone. */
:root { --largeur-tiroir: 460px; }
.tiroir {
  position: fixed;
  top: 0; right: 0; bottom: 0;
  z-index: 60;
  width: min(var(--largeur-tiroir), 100vw);
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border-left: 1px solid var(--bordure);
  box-shadow: -12px 0 32px rgba(16, 24, 32, 0.12);
  transform: translateX(100%);
  transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}
.tiroir--ouvert { transform: none; }
.tiroir[hidden], .tiroir-fond[hidden], .tiroir__panneau[hidden], .tiroir__lue[hidden], .libre__champ[hidden] { display: none; }
.tiroir-fond { display: none; }
.tiroir__entete { display: flex; align-items: center; gap: 0.6rem; padding: 0.75rem 0.9rem; border-bottom: 1px solid var(--bordure); }
.tiroir__entete strong { font-size: 1.02rem; }
.tiroir__raccourci { font-size: 0.68rem; color: var(--texte-faible); border: 1px solid var(--bordure); border-radius: 4px; padding: 0.05rem 0.35rem; font-family: var(--police-references); }
.tiroir__fermer { margin-left: auto; font-size: 1.1rem; padding: 0.4rem 0.55rem; }
.tiroir__onglets { display: flex; gap: 0.2rem; padding: 0.35rem 0.6rem 0; border-bottom: 1px solid var(--bordure); }
.tiroir__onglet { border: 0; background: none; font: inherit; font-weight: 650; font-size: 0.88rem; color: var(--texte-doux); padding: 0.55rem 0.7rem; border-bottom: 3px solid transparent; margin-bottom: -1px; cursor: pointer; }
.tiroir__onglet:hover { color: var(--texte); }
.tiroir__onglet--actif { color: var(--texte); border-bottom-color: var(--orange); }
.tiroir__cible { display: flex; align-items: center; gap: 0.5rem; padding: 0.45rem 0.9rem; font-size: 0.78rem; color: var(--texte-doux); border-bottom: 1px solid var(--bordure); background: var(--surface-2); }
.tiroir__cible-choix { flex: 1; min-width: 0; padding: 0.3rem 0.45rem; border: 1px solid var(--bordure-forte); border-radius: var(--rayon-sm); font: inherit; font-size: 0.82rem; background: var(--surface); color: var(--texte); }
.tiroir__panneau { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.tiroir__panneau--defile { overflow-y: auto; padding: 0.9rem 0.9rem 4.5rem; gap: 0.75rem; }
.tiroir__panneau--defile > * { flex: none; }
.tiroir__barre { display: flex; flex-direction: column; gap: 0.5rem; padding: 0.75rem 0.9rem 0.55rem; border-bottom: 1px solid var(--bordure); }
.tiroir__recherche {
  width: 100%;
  padding: 0.75rem 0.9rem 0.75rem 2.5rem;
  border: 2px solid var(--bordure-forte);
  border-radius: var(--rayon);
  font: inherit;
  font-size: 1rem;
  background: var(--surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' fill='none' stroke='%23869099' stroke-width='2' viewBox='0 0 24 24'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='m20 20-3.5-3.5'/%3E%3C/svg%3E") no-repeat 0.8rem center;
}
.tiroir__recherche:focus { outline: none; border-color: var(--orange); box-shadow: 0 0 0 4px rgba(222, 114, 47, 0.14); }
.tiroir__lue { margin: 0; font-size: 0.78rem; font-weight: 600; color: var(--orange-fonce); }
.puce-filtre { flex: none; display: inline-flex; align-items: center; gap: 0.35rem; padding: 0.32rem 0.7rem; border: 1px solid var(--bordure); border-radius: 999px; background: var(--surface); font: inherit; font-size: 0.78rem; font-weight: 600; color: var(--texte-doux); white-space: nowrap; cursor: pointer; }
.puce-filtre:hover { border-color: var(--bordure-forte); color: var(--texte); }
.puce-filtre--active, .puce-filtre--active:hover { background: var(--noir-doux); border-color: var(--noir-doux); color: #fff; }
.tiroir__liste { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 0.2rem 0.5rem 4.5rem; }
.tiroir__groupe { position: sticky; top: 0; z-index: 1; display: flex; justify-content: space-between; margin: 0.35rem 0 0; padding: 0.5rem 0.45rem 0.3rem; background: var(--surface); font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--texte-faible); }
.tiroir__note { margin: 0.45rem 0.45rem 0.2rem; font-size: 0.8rem; font-weight: 600; color: var(--alerte); }
.tiroir__vide { padding: 1rem 0.5rem 0.4rem; color: var(--texte-doux); }
.tiroir__vers-libre { padding: 0.8rem 0.45rem 0.2rem; }
.tiroir__aide { margin: 0; font-size: 0.8rem; color: var(--texte-doux); }
.tiroir__pied { position: sticky; bottom: -4.5rem; padding: 0.6rem 0 0.4rem; background: var(--surface); }

.article { display: flex; align-items: center; gap: 0.4rem; padding: 0.15rem 0.25rem; border-radius: var(--rayon-sm); }
.article:hover, .article--actif { background: rgba(222, 114, 47, 0.08); }
.article--actif { box-shadow: inset 3px 0 0 var(--orange); }
.article__principal { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 0.05rem; padding: 0.42rem 0.3rem; border: 0; background: none; font: inherit; text-align: left; color: var(--texte); cursor: pointer; }
.article__titre { font-weight: 600; font-size: 0.88rem; line-height: 1.3; }
.article__detail { font-size: 0.74rem; color: var(--texte-doux); }
.article__present { font-size: 0.72rem; font-weight: 700; color: var(--succes); }
.article__quantite { flex: none; display: inline-flex; align-items: center; gap: 0.2rem; font-size: 0.72rem; color: var(--texte-faible); }
.article__qte { width: 3.4rem; padding: 0.35rem 0.4rem; border: 1px solid var(--bordure); border-radius: var(--rayon-sm); font: inherit; font-size: 0.85rem; text-align: right; background: var(--surface); }
.article__qte:focus { outline: none; border-color: var(--bleu); box-shadow: 0 0 0 3px rgba(54, 91, 109, 0.14); }
.article__ajouter { flex: none; width: 2.2rem; height: 2.2rem; border: 0; border-radius: 50%; background: var(--orange); color: #fff; font-size: 1.3rem; font-weight: 700; line-height: 1; cursor: pointer; }
.article__ajouter:hover { background: var(--orange-fonce); }

.tiroir__rafale { width: 100%; min-height: 9.5rem; padding: 0.7rem 0.8rem; border: 2px solid var(--bordure-forte); border-radius: var(--rayon); font: inherit; font-size: 0.95rem; line-height: 1.55; resize: vertical; }
.tiroir__rafale:focus { outline: none; border-color: var(--orange); box-shadow: 0 0 0 4px rgba(222, 114, 47, 0.14); }
.rafale { display: flex; flex-direction: column; gap: 0.4rem; }
.rafale__ligne { display: flex; flex-direction: column; gap: 0.25rem; padding: 0.45rem 0.6rem; border: 1px solid var(--bordure); border-left: 4px solid var(--succes); border-radius: var(--rayon-sm); }
.rafale__ligne--verifier { border-left-color: var(--alerte); background: var(--alerte-fond); }
.rafale__ligne--libre { border-left-color: var(--bleu); }
.rafale__ligne--ignore { border-left-color: var(--bordure-forte); opacity: 0.6; }
.rafale__texte { font-size: 0.74rem; color: var(--texte-faible); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rafale__correspondance { display: flex; align-items: center; gap: 0.4rem; }
.rafale__qte { flex: none; min-width: 3rem; font-weight: 700; font-size: 0.82rem; }
.rafale__choix { flex: 1; min-width: 0; }
.rafale__etat { flex: none; font-size: 0.72rem; font-weight: 700; color: var(--texte-doux); }
.rafale__ligne--ok .rafale__etat { color: var(--succes); }
.rafale__ligne--verifier .rafale__etat { color: var(--alerte); }

.libre { display: flex; flex-direction: column; gap: 0.7rem; }
.libre__champ { display: flex; flex-direction: column; gap: 0.2rem; font-size: 0.75rem; font-weight: 600; color: var(--texte-doux); }
.libre__champ .champ-ligne { font-size: 0.95rem; padding: 0.55rem 0.65rem; }
.libre__chiffres { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0.5rem; }
.libre__total { margin: 0; min-height: 1.3em; font-weight: 700; text-align: right; }
.libre__case { display: flex; align-items: flex-start; gap: 0.5rem; font-size: 0.85rem; }

/* Confirmation d'ajout, avec « Annuler ». */
.bulle-action {
  position: fixed;
  left: 50%;
  bottom: calc(1rem + env(safe-area-inset-bottom));
  transform: translate(-50%, 1rem);
  z-index: 85;
  display: flex;
  align-items: center;
  gap: 0.9rem;
  max-width: calc(100vw - 2rem);
  padding: 0.55rem 0.55rem 0.55rem 1rem;
  border-radius: var(--rayon);
  background: var(--noir-doux);
  color: #fff;
  font-size: 0.86rem;
  font-weight: 600;
  box-shadow: var(--ombre-3);
  opacity: 0;
  transition: opacity 0.2s, transform 0.2s;
}
.bulle-action--visible { opacity: 1; transform: translate(-50%, 0); }
.tiroir .bulle-action { position: absolute; left: 0.9rem; right: 0.9rem; bottom: calc(0.9rem + env(safe-area-inset-bottom)); max-width: none; transform: translateY(1rem); }
.tiroir .bulle-action--visible { transform: none; }
.bulle-action__texte { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bulle-action__bouton { flex: none; padding: 0.32rem 0.75rem; border: 1px solid rgba(255, 255, 255, 0.45); border-radius: var(--rayon-sm); background: transparent; color: #fff; font: inherit; font-weight: 700; cursor: pointer; }
.bulle-action__bouton:hover { background: rgba(255, 255, 255, 0.12); }

/* Grand écran : le devis reste visible à côté du panneau. */
@media (min-width: 1280px) {
  .principal { transition: margin-right 0.2s; }
  body.avec-tiroir .principal { margin-right: var(--largeur-tiroir); }
  /* La colonne d'à côté (chantier, actions) passe dessous : le devis garde la largeur. */
  body.avec-tiroir .grille--principale { grid-template-columns: minmax(0, 1fr); }
}
@media (min-width: 901px) and (max-width: 1279px) {
  .tiroir-fond:not([hidden]) { display: block; position: fixed; inset: 0; z-index: 55; background: rgba(16, 24, 32, 0.18); }
}
@media (max-width: 900px) {
  .tiroir { width: 100vw; border-left: 0; box-shadow: none; }
  .tiroir__raccourci { display: none; }
  body.avec-tiroir { overflow: hidden; }
  .editeur__entete { position: static; }
  .editeur__catalogue { padding-inline: 0.8rem; }
  .article__principal { padding: 0.55rem 0.3rem; }
  .article__ajouter { width: 2.6rem; height: 2.6rem; }
  .libre__chiffres { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .bulle-action { bottom: calc(5.2rem + env(safe-area-inset-bottom)); }
}

/* ======================================================= visite technique */

.visite { display: flex; flex-direction: column; gap: 1rem; max-width: 980px; }
.visite__entete .carte__corps { display: flex; flex-direction: column; gap: 0.75rem; }
.visite__objet { font-size: 1.25rem; font-weight: 700; padding: 0.45rem 0.6rem; }
.visite__identite { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; }
.visite__client { font-weight: 700; font-size: 1rem; margin-right: 0.3rem; }
.visite__grille { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0.6rem; }
.visite__grille--adresse { grid-template-columns: 9.5rem minmax(0, 2fr) 7rem minmax(0, 1fr); }
.visite__champ { display: flex; flex-direction: column; gap: 0.2rem; min-width: 0; font-size: 0.74rem; font-weight: 600; color: var(--texte-doux); }
.visite__champ .champ-ligne { font-size: 0.95rem; padding: 0.55rem 0.6rem; }
.visite__champ--large { grid-column: 1 / -1; }
.visite__resume { display: flex; flex-wrap: wrap; align-items: center; gap: 0.4rem; }
.visite__puce { padding: 0.2rem 0.6rem; border-radius: 999px; background: var(--fond); font-size: 0.76rem; font-weight: 600; color: var(--texte-doux); }
.visite__actions { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.visite__sommaire { position: sticky; top: calc(var(--hauteur-entete) + 0.4rem); z-index: 12; display: flex; gap: 0.35rem; overflow-x: auto; padding: 0.35rem; border: 1px solid var(--bordure); border-radius: 999px; background: rgba(255, 255, 255, 0.94); backdrop-filter: blur(6px); box-shadow: var(--ombre-1); scrollbar-width: none; }
.visite__sommaire a { flex: none; padding: 0.35rem 0.8rem; border-radius: 999px; font-size: 0.82rem; font-weight: 650; color: var(--texte-doux); text-decoration: none; }
.visite__sommaire a:hover { background: var(--fond); color: var(--texte); }
.visite__section { scroll-margin-top: calc(var(--hauteur-entete) + 4rem); }
.visite__section .carte__corps { display: flex; flex-direction: column; gap: 0.75rem; }
.visite__aide { margin: 0; font-size: 0.82rem; color: var(--texte-doux); }
.visite__compte { margin-left: auto; padding: 0.1rem 0.55rem; border-radius: 999px; background: var(--fond); font-size: 0.74rem; font-weight: 700; color: var(--texte-doux); }

.visite__photos-actions { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 0.5rem; }
.visite__echecs { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; padding: 0.5rem 0.7rem; border-radius: var(--rayon-sm); background: var(--alerte-fond); color: var(--alerte); font-size: 0.85rem; font-weight: 600; }
.visite__galerie { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 0.7rem; }
.photo-visite { margin: 0; display: flex; flex-direction: column; border: 1px solid var(--bordure); border-radius: var(--rayon); overflow: hidden; background: var(--surface); }
.photo-visite__image { display: block; aspect-ratio: 4 / 3; background: var(--fond); }
.photo-visite__image img { width: 100%; height: 100%; object-fit: cover; display: block; }
.photo-visite figcaption { display: flex; flex-direction: column; gap: 0.3rem; padding: 0.45rem; }
.photo-visite figcaption .champ-ligne { font-size: 0.8rem; padding: 0.3rem 0.4rem; }
.photo-visite__pied { display: flex; align-items: center; justify-content: space-between; }

.visite__suppression { margin: 0 0 2rem; text-align: center; }
.lien-discret--danger { color: var(--danger); }

@media (max-width: 700px) {
  .visite__grille, .visite__grille--adresse { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .visite__grille--adresse .visite__champ--date { grid-column: 1 / -1; }
  .visite__galerie { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .visite__photos-actions .bouton--grand { flex: 1 1 100%; }
  .visite__sommaire { top: calc(var(--hauteur-entete) + 0.25rem); }
}

/* ============================================================== planning */

.gantt { --gantt-jour: 30px; --gantt-libelles: 240px; --gantt-repos: rgba(31, 37, 41, 0.045); }
.gantt__defilement { overflow-x: auto; -webkit-overflow-scrolling: touch; border: 1px solid var(--bordure); border-radius: var(--rayon); background: var(--surface); }
.gantt__grille {
  position: relative;
  display: grid;
  grid-template-columns: var(--gantt-libelles) repeat(var(--gantt-jours), var(--gantt-jour));
  grid-auto-rows: minmax(34px, auto);
  min-width: min-content;
}
.gantt__coin, .gantt__libelle {
  grid-column: 1;
  position: sticky;
  left: 0;
  /* Au-dessus des barres (prévu 2, réel 3, points 4, barre déplacée 5) : en
     défilant, elles passent sous la colonne des lots, jamais par-dessus. */
  z-index: 6;
  background: var(--surface);
  border-right: 1px solid var(--bordure);
}
.gantt__coin { display: flex; align-items: flex-end; padding: 0.5rem 0.75rem; font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--texte-faible); font-weight: 650; border-bottom: 1px solid var(--bordure); }
.gantt__semaine { padding: 0.35rem 0.4rem; font-size: 0.72rem; font-weight: 650; color: var(--texte-doux); border-left: 1px solid var(--bordure); background: var(--surface-2); white-space: nowrap; }
.gantt__jour { display: flex; flex-direction: column; align-items: center; justify-content: center; font-size: 0.72rem; font-weight: 600; color: var(--texte-doux); border-bottom: 1px solid var(--bordure); line-height: 1.1; padding: 0.15rem 0; }
.gantt__jour span { font-size: 0.6rem; font-weight: 500; color: var(--texte-faible); }
.gantt__jour--repos { background: var(--gantt-repos); color: var(--texte-faible); }
.gantt__jour--auj { color: #fff; background: var(--orange); border-radius: 6px 6px 0 0; }
.gantt__jour--auj span { color: rgba(255, 255, 255, 0.85); }
.gantt__libelle { display: flex; align-items: center; gap: 0.4rem; padding: 0.3rem 0.75rem; font-size: 0.82rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; border-bottom: 1px solid var(--bordure); }
.gantt__libelle--lot { font-weight: 700; background: var(--surface-2); }
.gantt__enchainement { display: inline-flex; margin: 0; }
.gantt__bascule { flex: none; display: inline-flex; align-items: center; justify-content: center; width: 1.4rem; height: 1.4rem; margin-right: 0.3rem; border: 1px solid var(--bordure); border-radius: var(--rayon-sm); background: var(--surface); color: var(--texte-faible); font: inherit; font-size: 0.8rem; font-weight: 700; line-height: 1; cursor: pointer; }
.gantt__bascule:hover { border-color: var(--bleu); color: var(--bleu); }
.gantt__bascule--simultane { border-color: var(--bleu); background: rgba(54, 91, 109, 0.1); color: var(--bleu); }
.gantt__bascule--fixe { cursor: default; }
.gantt__libelle--tache { padding-left: 1.4rem; color: var(--texte-doux); }
.gantt__pourcent { margin-left: auto; font-size: 0.72rem; font-weight: 700; color: var(--bleu); }
.gantt__fond {
  grid-column: 2 / -1;
  border-bottom: 1px solid var(--bordure);
  background: repeating-linear-gradient(90deg,
    transparent 0, transparent calc(var(--gantt-jour) * 5),
    var(--gantt-repos) calc(var(--gantt-jour) * 5), var(--gantt-repos) calc(var(--gantt-jour) * 7));
}
.gantt__barre { position: relative; z-index: 2; align-self: center; height: 18px; margin: 0 2px; border-radius: 5px; background: var(--bleu-clair); box-shadow: var(--ombre-1); }
.gantt__barre--lot { height: 12px; background: rgba(54, 91, 109, 0.22); overflow: hidden; }
.gantt__barre--lot .gantt__progression { display: block; height: 100%; background: var(--bleu); border-radius: 5px 0 0 5px; }
.gantt__barre--terminee, .gantt__barre--lot.gantt__barre--terminee .gantt__progression { background: var(--succes); }
.gantt__barre--en_cours { background: var(--orange); }
.gantt__barre--retard { background: var(--danger); }
.gantt__barre--imposee { box-shadow: inset 3px 0 0 var(--noir-doux), var(--ombre-1); }
.gantt__barre--ensemble { background-image: repeating-linear-gradient(135deg, rgba(255, 255, 255, 0.28) 0 4px, transparent 4px 8px); }
.gantt--interactif .gantt__barre[data-tache] { cursor: grab; touch-action: none; }
.gantt--interactif .gantt__barre[data-tache]:active { cursor: grabbing; }
.gantt__barre--deplacement { opacity: 0.85; outline: 2px dashed var(--noir-doux); outline-offset: 1px; z-index: 5; }
.gantt__poignee { position: absolute; right: -2px; top: -3px; bottom: -3px; width: 12px; cursor: ew-resize; touch-action: none; }
.gantt__poignee::after { content: ""; position: absolute; right: 4px; top: 5px; bottom: 5px; width: 3px; border-radius: 2px; background: rgba(255, 255, 255, 0.8); }
.gantt__aujourdhui { position: relative; z-index: 1; pointer-events: none; border-left: 2px solid var(--orange); margin-left: calc(var(--gantt-jour) / 2 - 1px); }
.gantt__puce { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: var(--bleu-clair); flex-shrink: 0; }
.gantt__puce--terminee { background: var(--succes); }
.gantt__puce--en_cours { background: var(--orange); }
.gantt__puce--retard { background: var(--danger); }
.gantt__legende { display: flex; flex-wrap: wrap; gap: 0.4rem 1rem; margin: 0.5rem 0 0; font-size: 0.75rem; color: var(--texte-faible); }
.gantt__legende span { display: inline-flex; align-items: center; gap: 0.35rem; }
.gantt__aide { margin-left: auto; }

/* Planning de suivi : prévu (figé, publié au client) et réel, lot par lot */
.gantt--suivi .gantt__libelle--suivi { flex-direction: column; align-items: flex-start; justify-content: center; gap: 0.15rem; min-height: 3rem; }
.gantt__nom { display: flex; align-items: center; max-width: 100%; }
.gantt__nom-texte { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gantt__resume { display: flex; flex-wrap: wrap; align-items: center; gap: 0.3rem; font-size: 0.7rem; font-weight: 600; color: var(--texte-faible); }
.gantt__ecart { padding: 0 0.4rem; border-radius: 999px; font-size: 0.68rem; font-weight: 700; white-space: nowrap; }
.gantt__ecart--retard { background: var(--alerte-fond); color: var(--alerte); }
.gantt__ecart--avance { background: var(--succes-fond); color: var(--succes); }
.gantt__ecart--temps { background: var(--info-fond); color: var(--info); }
.gantt__prevu { position: relative; z-index: 2; align-self: stretch; margin: 7px 1px; border: 1.5px dashed var(--bleu); border-radius: 6px; background: repeating-linear-gradient(135deg, rgba(54, 91, 109, 0.12) 0 6px, rgba(54, 91, 109, 0.04) 6px 12px); }
.gantt__prevu--filigrane { margin: 5px 1px; border-color: rgba(54, 91, 109, 0.45); background: none; }
.gantt__reel { position: relative; z-index: 3; align-self: center; height: 10px; margin: 0 3px; border-radius: 999px; background: var(--succes); box-shadow: var(--ombre-1); }
.gantt__reel--en_cours { background: linear-gradient(90deg, var(--orange) 0, var(--orange) calc(100% - 16px), rgba(222, 114, 47, 0.35) 100%); }
.gantt__point { position: relative; z-index: 4; align-self: center; justify-self: center; width: 10px; height: 10px; border: 2px solid #fff; border-radius: 50%; background: var(--noir-doux); box-shadow: 0 0 0 1px rgba(16, 24, 32, 0.2); }
.gantt__point--legende { display: inline-block; position: static; }
.gantt__brouillon { height: 16px; background: var(--orange); }
.gantt__temoin { display: inline-block; width: 18px; height: 10px; border-radius: 3px; }
.gantt__temoin--prevu { border: 1.5px dashed var(--bleu); background: rgba(54, 91, 109, 0.12); }
.gantt__temoin--reel { height: 6px; border-radius: 999px; background: linear-gradient(90deg, var(--succes) 50%, var(--orange) 50%); }
.gantt__temoin--brouillon { background: var(--orange); }
.gantt__temoin--filigrane { border: 1.5px dashed rgba(54, 91, 109, 0.5); }
.gantt__calque { display: inline-flex; align-items: center; gap: 0.35rem; cursor: pointer; }
.gantt--sans-prevu .gantt__prevu, .gantt--sans-reel .gantt__reel, .gantt--sans-reel .gantt__point { display: none; }

/* Planning modifiable au doigt : trois calques sur la même ligne */
.gantt { position: relative; }
.gantt--edition .gantt__prevu { margin: 4px 1px; border-color: rgba(54, 91, 109, 0.5); background: none; }
.gantt--edition .gantt__brouillon { align-self: center; height: 20px; margin: 0 2px; display: flex; align-items: center; overflow: hidden; }
.gantt--edition .gantt__reel { align-self: end; height: 6px; margin: 0 3px 5px; }
.gantt--edition .gantt__point { align-self: end; margin-bottom: 3px; width: 9px; height: 9px; }
.gantt__duree { padding: 0 0.4rem; font-size: 0.68rem; font-weight: 700; color: #fff; white-space: nowrap; pointer-events: none; }
.gantt--sans-brouillon .gantt__brouillon { display: none; }
.gantt--interactif .gantt__brouillon[data-lot] { cursor: grab; touch-action: none; }
.gantt--interactif .gantt__brouillon[data-lot]:hover { box-shadow: 0 0 0 2px rgba(222, 114, 47, 0.35), var(--ombre-1); }
.gantt--interactif .gantt__brouillon:active { cursor: grabbing; }
.gantt__brouillon .gantt__poignee { right: 0; width: min(14px, 40%); }
@media (pointer: coarse) { .gantt__brouillon .gantt__poignee { width: min(22px, 40%); } }
.gantt--attente { opacity: 0.6; pointer-events: none; transition: opacity var(--transition); }

/* Changer l'ordre des lots : poignée et repères d'insertion */
.gantt__poignee-lot { flex: none; display: inline-flex; align-items: center; justify-content: center; width: 1.1rem; margin-right: 0.15rem; color: var(--texte-faible); font-size: 0.85rem; letter-spacing: -2px; cursor: grab; touch-action: none; user-select: none; }
.gantt__poignee-lot:hover { color: var(--orange); }
.gantt__libelle--prise { opacity: 0.55; }
.gantt__libelle--avant { box-shadow: inset 0 3px 0 var(--orange); }
.gantt__libelle--apres { box-shadow: inset 0 -3px 0 var(--orange); }

/* Bulle des dates pendant le geste */
.gantt__bulle { position: absolute; z-index: 30; padding: 0.3rem 0.6rem; border-radius: 6px; background: var(--noir-doux); color: #fff; font-size: 0.78rem; font-weight: 600; white-space: nowrap; pointer-events: none; box-shadow: var(--ombre-2); }
.gantt__mode-emploi { margin: 0.5rem 0 0; font-size: 0.78rem; color: var(--texte-doux); }

/* Le lot retrouvé dans la liste des tâches */
.taches-lot--repere { box-shadow: 0 0 0 3px rgba(222, 114, 47, 0.45); border-radius: var(--rayon); transition: box-shadow 0.3s; }

/* Message après un geste, avec « Annuler » */
.planning-toast { position: fixed; left: 50%; bottom: calc(1rem + env(safe-area-inset-bottom)); z-index: 60; transform: translateX(-50%); display: flex; align-items: center; gap: 0.75rem; max-width: calc(100vw - 2rem); padding: 0.6rem 0.75rem 0.6rem 1rem; border-radius: 10px; background: var(--noir-doux); color: #fff; font-size: 0.86rem; box-shadow: var(--ombre-3); }
.planning-toast--erreur { background: var(--danger); }
.planning-toast .bouton { flex: none; }
@media (max-width: 700px) { .planning-toast { bottom: calc(4.5rem + env(safe-area-inset-bottom)); } }

/* Prévu à ce jour / réalisé, et le détail lot par lot */
.suivi-chiffres { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 0.75rem 1.5rem; margin-bottom: 1rem; }
.suivi-chiffres__libelle { display: flex; justify-content: space-between; font-size: 0.8rem; font-weight: 600; color: var(--texte-doux); margin-bottom: 0.25rem; }
.suivi-chiffres__barre { height: 10px; border-radius: 999px; background: var(--fond); overflow: hidden; }
.suivi-chiffres__barre span { display: block; height: 100%; border-radius: 999px; }
.suivi-chiffres__barre--prevu span { background: repeating-linear-gradient(135deg, rgba(54, 91, 109, 0.55) 0 6px, rgba(54, 91, 109, 0.35) 6px 12px); }
.suivi-chiffres__barre--reel span { background: var(--succes); }
.suivi-lots { list-style: none; margin: 1rem 0 0; padding: 0; display: grid; gap: 0.5rem; }
.suivi-lots li { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 0.25rem 1rem; padding: 0.55rem 0.75rem; border: 1px solid var(--bordure); border-radius: var(--rayon); font-size: 0.85rem; }
.suivi-lots__nom { font-weight: 650; }
.suivi-lots__detail { color: var(--texte-doux); font-size: 0.8rem; }
.planning-etat { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem 1rem; padding: 0.75rem 1.25rem; border-bottom: 1px solid var(--bordure); background: var(--surface-2); font-size: 0.86rem; }
.planning-etat--brouillon { background: var(--alerte-fond); }
.planning-etat__actions { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-left: auto; }
.planning-publier { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 0.5rem 0.75rem; }
.planning-publier .champ { margin: 0; }

@media (max-width: 700px) {
  .gantt { --gantt-jour: 26px; --gantt-libelles: 140px; }
  .gantt__aide { display: none !important; }
}

/* Liste des tâches par lot. */
.taches-lot { border-top: 1px solid var(--bordure); }
.taches-lot:first-child { border-top: 0; }
.taches-lot__entete { display: flex; align-items: center; gap: 0.6rem; padding: 0.65rem 1rem; background: var(--surface-2); font-weight: 700; }
.taches-lot__entete .avancement { flex: 0 0 140px; margin-left: auto; }
.tache-chantier { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 0.75rem; padding: 0.6rem 1rem; border-top: 1px solid var(--bordure); }
.tache-chantier--terminee .tache-chantier__titre { color: var(--texte-faible); text-decoration: line-through; text-decoration-color: rgba(0, 0, 0, 0.25); }
.tache-chantier__etat { width: 26px; height: 26px; border-radius: 50%; border: 2px solid var(--bordure-forte); display: grid; place-items: center; font-size: 0.8rem; color: #fff; }
.tache-chantier--terminee .tache-chantier__etat { background: var(--succes); border-color: var(--succes); }
.tache-chantier--retard .tache-chantier__etat { border-color: var(--danger); }
.tache-chantier__titre { font-weight: 600; }
.tache-chantier__infos { font-size: 0.78rem; color: var(--texte-doux); }
.tache-chantier__actions { display: flex; align-items: center; gap: 0.35rem; flex-wrap: wrap; justify-content: flex-end; }
.tache-chantier__edition { grid-column: 1 / -1; }
.tache-chantier__edition > summary { list-style: none; display: inline-block; cursor: pointer; font-size: 0.78rem; font-weight: 600; color: var(--bleu); }
.tache-chantier__edition > summary::-webkit-details-marker { display: none; }
.tache-chantier__form { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: flex-end; margin-top: 0.5rem; padding: 0.6rem; background: var(--surface-2); border-radius: var(--rayon-sm); }
.tache-chantier__form .champ { margin: 0; }
.taches-lot__nom { min-width: 0; }
.taches-lot__simultane { font-size: 0.72rem; font-weight: 700; color: var(--bleu); white-space: nowrap; }
.taches-lot__actions { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 0.15rem; font-weight: 400; }
.taches-lot__renommer { position: relative; }
.taches-lot__renommer > summary { list-style: none; }
.taches-lot__renommer > summary::-webkit-details-marker { display: none; }
.taches-lot__renommer[open] > form { position: absolute; right: 0; top: calc(100% + 0.3rem); z-index: 6; padding: 0.5rem; background: var(--surface); border: 1px solid var(--bordure); border-radius: var(--rayon); box-shadow: var(--ombre-3); min-width: 260px; }
.taches-lot__vide { margin: 0; padding: 0.6rem 1rem; font-size: 0.82rem; color: var(--texte-faible); border-top: 1px solid var(--bordure); }
.tache-chantier { scroll-margin-top: calc(var(--hauteur-entete) + 1rem); transition: background 0.4s; }
.tache-chantier--reperee { background: rgba(222, 114, 47, 0.12); }
.tache-chantier__principal { min-width: 0; }
.tache-chantier__ensemble { color: var(--bleu); font-weight: 600; }
.tache-chantier__commentaire { margin: 0.25rem 0 0; font-size: 0.82rem; color: var(--texte-doux); font-style: italic; }
.tache-chantier__photos { display: flex; flex-wrap: wrap; gap: 0.35rem; margin-top: 0.4rem; }
.tache-chantier__photo { display: block; width: 64px; height: 48px; border-radius: var(--rayon-sm); overflow: hidden; background: var(--fond); }
.tache-chantier__photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.tache-chantier__photo--interne { outline: 2px dashed var(--bordure-forte); opacity: 0.7; }
.duree-pas { display: inline-flex; align-items: center; gap: 0.1rem; padding: 0 0.15rem; border: 1px solid var(--bordure); border-radius: 999px; background: var(--surface); }
.duree-pas__valeur { min-width: 3.2rem; text-align: center; font-size: 0.8rem; font-weight: 700; }
.duree-pas__bouton { padding: 0.15rem 0.45rem; font-weight: 800; }
@media (max-width: 700px) {
  .tache-chantier { grid-template-columns: auto minmax(0, 1fr); }
  .tache-chantier__actions { grid-column: 1 / -1; justify-content: flex-start; }
  .taches-lot__entete .avancement { flex-basis: 90px; }
}

/* ============================================================= catalogue */

.revision-prix > summary { cursor: pointer; list-style: none; }
.revision-prix > summary::-webkit-details-marker { display: none; }
.revision-prix > summary::before { content: "\25B8  "; color: var(--texte-faible); }
.revision-prix[open] > summary::before { content: "\25BE  "; }

/* ================================================= signature à distance */

.recap-signature { margin: 0.5rem 0 0.75rem; border: 1px solid var(--bordure); border-radius: var(--rayon); overflow: hidden; }
.recap-signature th { width: 45%; }
.etape-signature { margin-top: 0.5rem; padding: 1rem; border: 1px solid var(--bordure); border-radius: var(--rayon); background: var(--surface-2); }
.etape-signature__numero { margin: 0 0 0.6rem; font-size: 0.72rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: var(--orange-fonce); }
.champ-code { font-size: 1.6rem !important; letter-spacing: 0.5em; text-align: center; font-variant-numeric: tabular-nums; padding: 0.6rem !important; }
.refus-signature { margin-top: 1rem; font-size: 0.85rem; color: var(--texte-doux); }
.refus-signature > summary { cursor: pointer; }
.liste-lots { margin: 0.5rem 0 0; padding-left: 1.1rem; font-size: 0.88rem; }
.liste-lots li { margin-bottom: 0.2rem; }

/* ======================================================= hors connexion */

/* Indicateur « rapports en attente », dans l'en-tête. */
.envois-attente { position: relative; }
.envois-attente[hidden] { display: none; }
.envois-attente__resume {
  list-style: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.35rem 0.7rem;
  border-radius: 999px;
  background: var(--info-fond);
  color: var(--info);
  font-size: 0.78rem;
  font-weight: 700;
  white-space: nowrap;
}
.envois-attente__resume::-webkit-details-marker { display: none; }
.envois-attente__resume::before { content: "\2601"; font-size: 0.95rem; line-height: 1; }
.envois-attente--alerte .envois-attente__resume { background: var(--alerte-fond); color: var(--alerte); }
.envois-attente__liste {
  position: absolute;
  right: 0;
  top: calc(100% + 0.4rem);
  z-index: 35;
  width: min(340px, calc(100vw - 1.5rem));
  padding: 0.85rem;
  background: var(--surface);
  border: 1px solid var(--bordure);
  border-radius: var(--rayon);
  box-shadow: var(--ombre-3);
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}
.envois-attente__ligne { padding-top: 0.5rem; border-top: 1px solid var(--bordure); }
[data-hors-ligne-envois] .envois-attente { margin-top: 1rem; }
[data-hors-ligne-envois] .envois-attente__liste { position: static; width: auto; box-shadow: none; margin-top: 0.5rem; }

/* Message bref en bas de l'écran. */
.bulle-info {
  position: fixed;
  left: 50%;
  bottom: calc(1rem + env(safe-area-inset-bottom));
  transform: translate(-50%, 1rem);
  z-index: 80;
  max-width: calc(100vw - 2rem);
  padding: 0.7rem 1rem;
  border-radius: var(--rayon);
  background: var(--noir-doux);
  color: #fff;
  font-weight: 600;
  font-size: 0.88rem;
  box-shadow: var(--ombre-3);
  opacity: 0;
  transition: opacity 0.25s, transform 0.25s;
}
.bulle-info--visible { opacity: 1; transform: translate(-50%, 0); }
.bulle-info--succes { background: var(--succes); }
.bulle-info--erreur { background: var(--danger); }
@media (max-width: 900px) {
  .bulle-info { bottom: calc(5.2rem + env(safe-area-inset-bottom)); }
}

/* ================================================ téléphone et tablette */

.apercu-vignettes { display: grid; grid-template-columns: repeat(auto-fill, minmax(72px, 1fr)); gap: 0.4rem; margin-top: 0.6rem; }
.apercu-vignettes img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: var(--rayon-sm); }

@media (max-width: 900px) {
  /* 16 px minimum : en dessous, Safari sur iPhone zoome à chaque saisie. */
  .champ input[type="text"],
  .champ input[type="email"],
  .champ input[type="password"],
  .champ input[type="tel"],
  .champ input[type="url"],
  .champ input[type="number"],
  .champ input[type="date"],
  .champ input[type="search"],
  .champ select,
  .champ textarea,
  .filtres input,
  .filtres select,
  .choix-facture__pourcent input { font-size: 16px; padding: 0.6rem 0.7rem; }

  /* Cibles tactiles confortables. */
  .bouton { min-height: 44px; padding: 0.6rem 1rem; font-size: 0.9rem; }
  .bouton--petit { min-height: 38px; padding: 0.45rem 0.8rem; font-size: 0.85rem; }
  .champ--case input[type="checkbox"], .champ--case input[type="radio"] { width: 22px; height: 22px; flex-shrink: 0; }
  .champ--case .champ__label { font-size: 0.9rem; padding-top: 0.15rem; }

  /* Fil d'Ariane réduit à la page courante : le lien « retour » des fiches
     remplace les étapes intermédiaires. */
  .entete__fil > :not(:last-child) { display: none; }
  .entete__fil { min-width: 0; }
  .entete__fil > :last-child { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 60vw; }
}

@media (max-width: 700px) {
  h1 { font-size: 1.3rem; }
  .page-entete { margin-bottom: 1rem; }
  .page-entete__actions { width: 100%; margin-left: 0; }
  .page-entete__actions > .bouton, .page-entete__actions > form { flex: 1; }
  .page-entete__actions .bouton { width: 100%; }
  .carte__entete { flex-wrap: wrap; gap: 0.4rem; }
  .carte__corps { padding: 0.9rem; }
  .grille--4 { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.6rem; }
  .indicateur { padding: 0.75rem 0.85rem; }
  .filtres { flex-direction: column; align-items: stretch; }
  .filtres > * { width: 100%; }
  .filtres--replie { display: none; }
  .bouton-filtres { margin: 0.75rem; width: calc(100% - 1.5rem); }

  /* Tableaux en cartes : une ligne = une carte « intitulé : valeur ». */
  .tableau--cartes thead { display: none; }
  .tableau--cartes, .tableau--cartes tbody, .tableau--cartes tr, .tableau--cartes td { display: block; width: 100%; }
  .tableau--cartes tbody tr {
    margin: 0 0 0.6rem;
    padding: 0.6rem 0.8rem;
    border: 1px solid var(--bordure);
    border-radius: var(--rayon);
    background: var(--surface);
  }
  .tableau--cartes tbody tr:last-child { border-bottom: 1px solid var(--bordure); margin-bottom: 0; }
  .tableau--cartes tbody tr:hover { background: var(--surface); }
  .tableau--cartes td {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 1rem;
    padding: 0.28rem 0;
    text-align: right;
    white-space: normal;
  }
  .tableau--cartes td::before {
    content: attr(data-label);
    flex-shrink: 0;
    max-width: 45%;
    text-align: left;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--texte-faible);
  }
  .tableau--cartes td:not([data-label])::before { content: none; }
  .tableau--cartes td:not([data-label]) { justify-content: flex-start; text-align: left; }
  /* La première cellule porte en général l'intitulé de la ligne : en titre. */
  .tableau--cartes td:first-child { font-size: 0.95rem; }
  .tableau--cartes td.actions { justify-content: flex-end; flex-wrap: wrap; padding-top: 0.5rem; }
  .tableau--cartes td[colspan] { justify-content: center; text-align: center; }
  .tableau--cartes td[colspan]::before { content: none; }
  .carte__corps--serre .tableau--cartes, .tableau-enveloppe .tableau--cartes { padding: 0.6rem; }

  /* Tableaux sans en-tête : intitulé au-dessus de la valeur. */
  .tableau--empile, .tableau--empile tbody, .tableau--empile tr,
  .tableau--empile th, .tableau--empile td { display: block; width: 100%; }
  .tableau--empile tr { padding: 0.45rem 0.85rem; }
  .tableau--empile th { padding: 0.2rem 0 0; font-size: 0.75rem; color: var(--texte-faible); width: auto !important; }
  .tableau--empile td { padding: 0.15rem 0 0.2rem; white-space: normal; text-align: left; }
  .tableau--empile td.actions, .tableau--empile td.texte-droite { text-align: left; }
  .tableau--empile td.actions { display: flex; flex-wrap: wrap; gap: 0.4rem; padding-top: 0.4rem; }
  .tableau .nowrap { white-space: normal; }

  /* Espace client. */
  .portail__nav-interieur { overflow-x: auto; scrollbar-width: none; padding: 0 0.5rem; }
  .portail__nav-interieur::-webkit-scrollbar { display: none; }
  .portail__nav a { white-space: nowrap; padding: 0.65rem 0.7rem; }
  .portail__contenu { padding: 1.25rem 1rem 2.5rem; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

@media print {
  .barre, .entete, .page-entete__actions, .bouton, .barre-mobile, .onglets-rubrique { display: none !important; }
  .appli { grid-template-columns: 1fr; }
  .carte { box-shadow: none; border-color: #ccc; }
}

/* État du chantier, en grand, en tête de fiche */
.etat-chantier { display: flex; flex-wrap: wrap; align-items: center; gap: 0.75rem 1.25rem; margin: 0 0 1.25rem; padding: 1rem 1.25rem; border: 1px solid var(--bordure); border-left: 6px solid var(--texte-faible); border-radius: var(--rayon); background: var(--surface); box-shadow: var(--ombre-1); }
.etat-chantier--succes { border-left-color: var(--succes); }
.etat-chantier--info { border-left-color: var(--info); }
.etat-chantier--accent { border-left-color: var(--orange); }
.etat-chantier--alerte { border-left-color: var(--alerte); }
.etat-chantier--danger { border-left-color: var(--danger); }
.etat-chantier__texte { display: flex; flex-direction: column; min-width: 0; }
.etat-chantier__libelle { font-size: 0.72rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: var(--texte-faible); }
.etat-chantier__valeur { font-size: 1.45rem; line-height: 1.2; letter-spacing: -0.01em; }
.etat-chantier--succes .etat-chantier__valeur { color: var(--succes); }
.etat-chantier--alerte .etat-chantier__valeur { color: var(--alerte); }
.etat-chantier--danger .etat-chantier__valeur { color: var(--danger); }
.etat-chantier__client { font-size: 0.8rem; color: var(--texte-doux); }
.etat-chantier__actions { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 0.5rem; margin-left: auto; }
.etat-chantier__changer { position: relative; }
.etat-chantier__changer > summary { list-style: none; cursor: pointer; }
.etat-chantier__changer > summary::-webkit-details-marker { display: none; }
.etat-chantier__formulaire { position: absolute; right: 0; z-index: 20; width: min(360px, 86vw); margin-top: 0.4rem; padding: 1rem; border: 1px solid var(--bordure); border-radius: var(--rayon); background: var(--surface); box-shadow: var(--ombre-3); }
.etat-chantier__alerte { flex-basis: 100%; margin: 0; padding: 0.55rem 0.75rem; border-radius: var(--rayon-sm); background: var(--alerte-fond); color: var(--alerte); font-size: 0.85rem; font-weight: 600; }
@media (max-width: 700px) {
  .etat-chantier__actions { margin-left: 0; width: 100%; }
  .etat-chantier__formulaire { position: static; width: 100%; }
}

/* Bascule entre deux vues d'une même carte */
.bascule-vue { display: inline-flex; padding: 2px; border: 1px solid var(--bordure); border-radius: 999px; background: var(--surface-2); }
.bascule-vue a { padding: 0.2rem 0.75rem; border-radius: 999px; font-size: 0.8rem; font-weight: 600; color: var(--texte-doux); text-decoration: none; }
.bascule-vue a[aria-current="page"] { background: var(--surface); color: var(--texte); box-shadow: var(--ombre-1); }
.planning-historique summary { cursor: pointer; }
.planning-historique ul { margin: 0.5rem 0 0; padding-left: 1.1rem; }

/* Confirmation avant de publier vers l'espace client */
.dialogue { width: min(440px, calc(100vw - 2rem)); padding: 0; border: none; border-radius: 12px; box-shadow: var(--ombre-3); color: var(--texte); }
.dialogue::backdrop { background: rgba(16, 24, 32, 0.45); }
.dialogue__corps { display: flex; gap: 0.9rem; padding: 1.25rem 1.25rem 1rem; }
.dialogue__icone { flex: none; display: inline-flex; align-items: center; justify-content: center; width: 2.4rem; height: 2.4rem; border-radius: 50%; background: var(--info-fond); color: var(--info); font-size: 1.2rem; }
.dialogue--client .dialogue__icone { background: #fff1e6; color: var(--orange); }
.dialogue__titre { margin: 0 0 0.35rem; font-size: 1.05rem; }
.dialogue__texte { margin: 0; color: var(--texte-doux); line-height: 1.5; }
/* Ce qui ne colle pas (cohérence) : dit avant de continuer, sans rien bloquer. */
.dialogue--avertir .dialogue__icone { background: var(--alerte-fond); color: var(--alerte); font-weight: 800; }
.dialogue__avertissements { margin: 0 0 0.7rem; padding: 0.6rem 0.8rem 0.6rem 1.7rem; border-radius: 8px; background: var(--alerte-fond); color: #6b4a10; font-size: 0.9rem; line-height: 1.45; }
.dialogue__avertissements li + li { margin-top: 0.3rem; }
.avertissements-apercu { margin-top: 0.45rem; padding: 0.55rem 0.75rem; border-radius: 8px; background: var(--alerte-fond); color: #6b4a10; font-size: 0.84rem; line-height: 1.45; }
.avertissements-apercu[hidden] { display: none; }
.avertissements-apercu ul { margin: 0.25rem 0 0; padding-left: 1.1rem; }
.dialogue__actions { display: flex; justify-content: flex-end; gap: 0.5rem; padding: 0.75rem 1.25rem; border-top: 1px solid var(--bordure); background: var(--surface-2); border-radius: 0 0 12px 12px; }

/* ===========================================================================
   Charte 2026 — aux couleurs du logo (bleu ardoise #365b6d, orange #de722f).
   Sobre et naturelle : fonds chauds, barre latérale claire, pastilles douces
   à point coloré, coins arrondis, ombres légères.
   =========================================================================== */

body { background: var(--fond); }

/* --- barre latérale claire, le logo en couleurs --- */
.barre { background: var(--surface); color: var(--texte-doux); border-right: 1px solid var(--bordure); }
.barre__marque { flex-direction: column; align-items: flex-start; gap: 0.4rem; padding: 1.15rem 1.2rem 1rem; border-bottom: 1px solid var(--bordure); color: var(--texte); }
.barre__logo-image { display: block; width: 132px; height: auto; }
.barre__sous-titre { color: var(--texte-faible); font-weight: 600; }
.barre__nav { padding: 0.85rem 0.7rem; }
.barre__groupe-titre { color: var(--texte-faible); }
.barre__lien { gap: 0.7rem; padding: 0.55rem 0.7rem; border-radius: 8px; color: var(--texte-doux); font-weight: 560; }
.barre__lien:hover { background: var(--fond); color: var(--texte); }
.barre__lien[aria-current="page"] { background: #e8eff2; color: var(--bleu-fonce); font-weight: 650; box-shadow: inset 3px 0 0 var(--orange); }
.barre__lien[aria-current="page"] svg { color: var(--bleu); opacity: 1; }
.barre__pied { border-top: 1px solid var(--bordure); }
.barre__compte { color: var(--texte); }
.barre__compte:hover { background: var(--fond); }
.barre__compte-role { color: var(--texte-faible); }
.barre__deconnexion { color: var(--texte-faible); }

/* --- en-tête et onglets --- */
.entete { background: rgba(255, 255, 255, 0.86); border-bottom-color: var(--bordure); }
.onglets-rubrique__lien[aria-current="page"], .onglets-fiche__lien[aria-current="page"] { color: var(--bleu-fonce); border-bottom-color: var(--orange); }

/* --- cartes --- */
.carte { border-radius: var(--rayon); border-color: var(--bordure); }
.carte__entete { padding: 0.95rem 1.2rem; }
.carte__entete h2 { font-size: 1rem; letter-spacing: -0.005em; }
.carte__pied { border-radius: 0 0 var(--rayon) var(--rayon); }

/* --- boutons --- */
.bouton { border-radius: 8px; font-weight: 600; }
.bouton--primaire { background: var(--orange); box-shadow: 0 1px 2px rgba(192, 95, 34, 0.28); }
.bouton--primaire:hover:not(:disabled) { background: var(--orange-fonce); }
.bouton--bleu { background: var(--bleu); }
.bouton--bleu:hover:not(:disabled) { background: var(--bleu-fonce); }
.bouton--neutre { background: var(--surface); border-color: var(--bordure-forte); color: var(--texte); }
.bouton--neutre:hover:not(:disabled) { background: var(--fond); }

/* --- pastilles : fond doux et point coloré --- */
.pastille { gap: 0.4rem; padding: 0.16rem 0.62rem 0.16rem 0.52rem; border: none; font-weight: 600; letter-spacing: 0.005em; }
.pastille::before { content: ""; flex: none; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.pastille--neutre { background: #efece6; color: #5b646b; }
.pastille--succes { background: var(--succes-fond); color: var(--succes); }
.pastille--alerte { background: var(--alerte-fond); color: #94661a; }
.pastille--danger { background: var(--danger-fond); color: var(--danger); }
.pastille--info { background: var(--info-fond); color: var(--info); }
.pastille--accent { background: #fbece1; color: var(--orange-fonce); }

/* --- messages : un liseré à gauche plutôt qu'un cadre --- */
.message { border: none; border-left: 4px solid; border-radius: var(--rayon-sm); }
.message--succes { background: var(--succes-fond); border-left-color: var(--succes); color: #2f5a3c; }
.message--erreur { background: var(--danger-fond); border-left-color: var(--danger); color: #873a27; }
.message--alerte { background: var(--alerte-fond); border-left-color: var(--alerte); color: #7c5512; }
.message--info { background: var(--info-fond); border-left-color: var(--info); color: #2c4c5b; }

/* --- tableaux et champs --- */
.tableau thead th { background: var(--surface-2); color: var(--texte-faible); }
.tableau tbody tr:hover td { background: #fbfaf7; }
.champ input[type="text"], .champ input[type="email"], .champ input[type="password"], .champ input[type="tel"],
.champ input[type="url"], .champ input[type="number"], .champ input[type="date"], .champ input[type="search"],
.champ select, .champ textarea { border-radius: 8px; border-color: var(--bordure-forte); }

/* --- téléphone : barre du bas --- */
@media (max-width: 900px) {
  .barre-mobile__lien[aria-current="page"] { color: var(--bleu); }
}

/* --- page de connexion et espace client --- */
.page-connexion {
  background:
    radial-gradient(circle at 15% 10%, rgba(54, 91, 109, 0.16), transparent 45%),
    radial-gradient(circle at 90% 85%, rgba(222, 114, 47, 0.14), transparent 40%),
    var(--fond);
}
.connexion__logo-image { display: block; width: 150px; height: auto; margin: 0 auto 1rem; }
.portail__entete { background: var(--surface); color: var(--texte); border-bottom: 1px solid var(--bordure); }
.portail__logo-image { display: block; width: 104px; height: auto; }
.portail__sous-titre { color: var(--texte-faible); }
.portail__compte { color: var(--texte-doux); }
.portail__actions .bouton--fantome { color: var(--texte-doux) !important; }
.portail__nav { border-top-color: var(--bordure); }
.portail__nav a { color: var(--texte-doux); }
.portail__nav a:hover { color: var(--texte); }
.portail__nav a[aria-current="page"] { color: var(--bleu-fonce); border-bottom-color: var(--orange); }

/* --- listes avec recherche --- */
.liste-recherche__origine { position: absolute !important; width: 1px !important; height: 1px !important; padding: 0 !important; margin: -1px !important; overflow: hidden !important; clip: rect(0 0 0 0) !important; border: 0 !important; opacity: 0; pointer-events: none; }
.liste-recherche { position: relative; width: 100%; }
.liste-recherche__saisie {
  width: 100%; padding: 0.48rem 2rem 0.48rem 0.65rem;
  border: 1px solid var(--bordure-forte); border-radius: 8px; background-color: var(--surface);
  font: inherit; font-size: 0.875rem; color: var(--texte);
  background-image: linear-gradient(45deg, transparent 50%, var(--texte-faible) 50%), linear-gradient(135deg, var(--texte-faible) 50%, transparent 50%);
  background-position: calc(100% - 15px) 52%, calc(100% - 10px) 52%;
  background-size: 5px 5px, 5px 5px; background-repeat: no-repeat;
}
.liste-recherche__saisie:focus { outline: none; border-color: var(--bleu); box-shadow: 0 0 0 3px rgba(54, 91, 109, 0.15); }
.liste-recherche__saisie--erreur { border-color: var(--danger); }
.liste-recherche__options {
  position: absolute; z-index: 50; left: 0; right: 0; top: calc(100% + 4px);
  max-height: 280px; overflow-y: auto; margin: 0; padding: 0.3rem; list-style: none;
  background: var(--surface); border: 1px solid var(--bordure); border-radius: 10px; box-shadow: var(--ombre-3);
}
.liste-recherche__option { padding: 0.5rem 0.65rem; border-radius: 6px; font-size: 0.875rem; cursor: pointer; }
.liste-recherche__option:hover, .liste-recherche__option--active { background: #e8eff2; color: var(--bleu-fonce); }
.liste-recherche__option--choisie { font-weight: 650; }
.liste-recherche__option[aria-disabled="true"] { opacity: 0.45; cursor: default; }
.liste-recherche__groupe { padding: 0.5rem 0.65rem 0.25rem; font-size: 0.7rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: var(--texte-faible); }
.liste-recherche__rien { padding: 0.6rem 0.65rem; font-size: 0.85rem; color: var(--texte-faible); }

/* --- facturer : bilan et quatre choix --- */
.bilan-facturation { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0.75rem 1.5rem; margin: 0 0 1.25rem; padding: 1.1rem 1.25rem; border: 1px solid var(--bordure); border-radius: var(--rayon); background: var(--surface); box-shadow: var(--ombre-1); }
.bilan-facturation__chiffre { display: flex; flex-direction: column; gap: 0.1rem; }
.bilan-facturation__chiffre strong { font-size: 1.35rem; letter-spacing: -0.01em; }
.bilan-facturation__chiffre--reste strong { color: var(--orange-fonce); }
.bilan-facturation__libelle { font-size: 0.72rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: var(--texte-faible); }
.bilan-facturation__detail { font-size: 0.78rem; color: var(--texte-faible); }
.bilan-facturation__barre { grid-column: 1 / -1; height: 8px; border-radius: 999px; background: var(--fond); overflow: hidden; }
.bilan-facturation__barre span { display: block; height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--bleu), var(--bleu-clair)); }
.choix-factures { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
.choix-factures__carte { display: flex; flex-direction: column; gap: 0.6rem; padding: 1.2rem; border: 1px solid var(--bordure); border-radius: var(--rayon); background: var(--surface); box-shadow: var(--ombre-1); }
.choix-factures__carte h2 { margin: 0; font-size: 1.05rem; }
.choix-factures__carte form { display: flex; flex-direction: column; gap: 0.6rem; margin-top: auto; }
.choix-factures__carte > .bouton { margin-top: auto; }
.choix-factures__carte--solde { border-color: rgba(222, 114, 47, 0.45); background: linear-gradient(180deg, #fff8f2 0%, var(--surface) 60%); }
.choix-factures__icone { display: inline-flex; align-items: center; justify-content: center; width: 2.4rem; height: 2.4rem; border-radius: 10px; background: #e8eff2; color: var(--bleu); font-size: 1.15rem; font-weight: 800; }
.choix-factures__carte--solde .choix-factures__icone { background: #fbece1; color: var(--orange-fonce); }
.choix-factures__texte { margin: 0; font-size: 0.86rem; color: var(--texte-doux); line-height: 1.5; }
.choix-factures__montant { margin: 0; font-size: 1.5rem; font-weight: 750; color: var(--orange-fonce); }
.choix-factures__montant span { font-size: 0.8rem; font-weight: 600; color: var(--texte-faible); }
.choix-factures__indisponible { margin: auto 0 0; padding: 0.55rem 0.7rem; border-radius: 8px; background: var(--fond); font-size: 0.84rem; color: var(--texte-doux); }
.choix-acompte { display: flex; flex-direction: column; gap: 0.6rem; }
.choix-acompte__modes { display: inline-flex; padding: 3px; border: 1px solid var(--bordure); border-radius: 999px; background: var(--surface-2); align-self: flex-start; }
.choix-acompte__modes label { display: inline-flex; align-items: center; padding: 0.25rem 0.8rem; border-radius: 999px; font-size: 0.82rem; font-weight: 600; color: var(--texte-doux); cursor: pointer; }
.choix-acompte__modes input { position: absolute; opacity: 0; pointer-events: none; }
.choix-acompte__modes label:has(input:checked) { background: var(--surface); color: var(--texte); box-shadow: var(--ombre-1); }
.choix-acompte__modes label:has(input:focus-visible) { outline: 2px solid var(--bleu); outline-offset: 1px; }
.choix-acompte__saisie { display: flex; align-items: center; gap: 0.4rem; font-weight: 600; color: var(--texte-doux); }
.choix-acompte__saisie input { width: 9rem; padding: 0.5rem 0.65rem; border: 1px solid var(--bordure-forte); border-radius: 8px; font: inherit; font-size: 1rem; }
.choix-acompte__saisie--montant { display: none; }
.choix-acompte:has(input[value="montant"]:checked) .choix-acompte__saisie--montant { display: flex; }
.choix-acompte:has(input[value="montant"]:checked) .choix-acompte__saisie--pourcent { display: none; }
@media (max-width: 760px) {
  .bilan-facturation { grid-template-columns: 1fr; }
  .choix-factures { grid-template-columns: 1fr; }
}
.barre__nav .barre__lien[aria-current] .icone { color: var(--bleu); }

/* Informations d'une pièce, lisibles sur la fiche (plus de page « en-tête ») */
.infos-doc { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 0.75rem 1.25rem; margin: 0; }
.infos-doc > div { min-width: 0; }
.infos-doc__large { grid-column: 1 / -1; }
.infos-doc dt { font-size: 0.72rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: var(--texte-faible); margin-bottom: 0.15rem; }
.infos-doc dd { margin: 0; white-space: pre-line; overflow-wrap: anywhere; }
.carte__details > .carte__details-bouton { display: block; padding: 0.7rem 1.2rem; border-top: 1px solid var(--bordure); font-weight: 600; color: var(--bleu); cursor: pointer; list-style: none; }
.carte__details > .carte__details-bouton::-webkit-details-marker { display: none; }
.carte__details > .carte__details-bouton::before { content: "✎ "; }
.carte__details[open] > .carte__details-bouton { background: var(--surface-2); }

/* Fiche technique produit : un nom, un PDF */
.fiche-technique__champs { display: grid; grid-template-columns: minmax(180px, 1.2fr) minmax(180px, 1fr) auto; gap: 0.6rem; align-items: end; margin-top: 0.35rem; }
@media (max-width: 760px) { .fiche-technique__champs { grid-template-columns: 1fr; } }

/* Menu au clic droit (ou appui long) sur une ligne */
[data-menu] { -webkit-touch-callout: none; }
.menu-contextuel { position: fixed; z-index: 90; min-width: 220px; max-width: min(320px, calc(100vw - 16px)); padding: 0.35rem; border: 1px solid var(--bordure); border-radius: 10px; background: var(--surface); box-shadow: var(--ombre-3); }
.menu-contextuel__titre { padding: 0.35rem 0.75rem 0.45rem; font-size: 0.72rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: var(--texte-faible); border-bottom: 1px solid var(--bordure); margin-bottom: 0.25rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.menu-contextuel hr { margin: 0.25rem 0; border: none; border-top: 1px solid var(--bordure); }
.menu-contextuel__action { display: block; width: 100%; padding: 0.5rem 0.75rem; border: 0; border-radius: 7px; background: none; text-align: left; font: inherit; font-size: 0.875rem; color: var(--texte); cursor: pointer; }
.menu-contextuel__action:hover, .menu-contextuel__action:focus-visible { background: #e8eff2; color: var(--bleu-fonce); outline: none; }
.menu-contextuel__action--danger { color: var(--danger); }
.menu-contextuel__action--danger:hover, .menu-contextuel__action--danger:focus-visible { background: var(--danger-fond); color: var(--danger); }
/* Bouton « ⋯ » ajouté à chaque porteur de menu : visible au doigt, au survol à la souris. */
.bouton-menu-auto { display: inline-flex; align-items: center; justify-content: center; width: 2rem; height: 2rem; margin-left: 0.35rem; padding: 0; border: 1px solid transparent; border-radius: 8px; background: none; color: var(--texte-faible); cursor: pointer; vertical-align: middle; transition: opacity 0.15s, background 0.15s; }
.bouton-menu-auto:hover, .bouton-menu-auto:focus-visible { background: #e8eff2; color: var(--bleu-fonce); border-color: var(--bordure); outline: none; }
.porteur-menu-auto { position: relative; }
.porteur-menu-auto > .bouton-menu-auto { position: absolute; top: 0.25rem; right: 0.25rem; margin: 0; background: var(--surface); box-shadow: var(--ombre-1, 0 1px 3px rgba(0, 0, 0, 0.15)); }
li.porteur-menu-auto { padding-right: 2.6rem; }
@media (hover: hover) and (pointer: fine) {
  .bouton-menu-auto { opacity: 0; }
  [data-menu]:hover > .bouton-menu-auto, [data-menu]:hover > td:last-child > .bouton-menu-auto, .bouton-menu-auto:focus-visible { opacity: 1; }
}
.ligne-situation td { background: #fbf7f1; }

/* Coûts et marge du chantier */
/* Six tuiles quand la marge est là ; le fond clair évite une case grise si une
   tuile passe seule à la ligne (les traits viennent des tuiles, pas du fond). */
.chiffres-chantier--marge { grid-template-columns: minmax(160px, 1.3fr) repeat(5, minmax(105px, 1fr)); background: var(--surface); }
.chiffres-chantier--marge .chiffre-chantier { box-shadow: 0 0 0 1px var(--bordure); }
@media (max-width: 700px) {
  .chiffres-chantier--marge { grid-template-columns: repeat(3, 1fr); }
  .chiffres-chantier--marge .chiffre-chantier--lien { grid-column: span 2; }
}
.chiffre-chantier--lien { color: inherit; }
.chiffre-chantier--lien:hover { background: var(--surface-2); text-decoration: none; }
.chiffre-chantier--danger .chiffre-chantier__valeur { color: var(--danger); }
.chiffre-chantier--alerte .chiffre-chantier__valeur { color: var(--alerte); }
.chiffre-chantier--succes .chiffre-chantier__valeur { color: var(--succes); }
.chiffre-chantier__detail--neutre { color: var(--texte-faible); font-weight: 500; }
.texte-danger { color: var(--danger); }
.marge__chiffres { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 0.75rem; }
.marge__chiffre { display: flex; flex-direction: column; gap: 0.15rem; padding: 0.7rem 0.85rem; border: 1px solid var(--bordure); border-radius: var(--rayon-sm); background: var(--surface-2); min-width: 0; }
.marge__chiffre--danger { border-color: #f3c9c5; background: var(--danger-fond); }
.marge__chiffre--danger .marge__valeur { color: var(--danger); }
.marge__chiffre--alerte { border-color: #f0ddba; background: var(--alerte-fond); }
.marge__chiffre--alerte .marge__valeur { color: var(--alerte); }
.marge__chiffre--succes { border-color: #bfe3cf; background: var(--succes-fond); }
.marge__chiffre--succes .marge__valeur { color: var(--succes); }
.marge__libelle { font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--texte-faible); font-weight: 600; }
.marge__valeur { font-size: 1.15rem; font-variant-numeric: tabular-nums; }
.marge__detail { font-size: 0.76rem; color: var(--texte-doux); }
.marge__barres { display: grid; gap: 0.4rem; margin-top: 0.9rem; }
.marge__barre { display: grid; grid-template-columns: 6.5rem minmax(0, 1fr) 4.5rem; align-items: center; gap: 0.6rem; font-size: 0.8rem; }
.marge__barre-nom { color: var(--texte-doux); }
.marge__barre-val { text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; }
.marge__jauge { height: 9px; border-radius: 999px; background: var(--fond); border: 1px solid var(--bordure); overflow: hidden; }
.marge__jauge-plein { height: 100%; border-radius: 999px; background: var(--bleu-clair); }
.marge__jauge-plein--avancement { background: var(--bleu); }
.marge__jauge-plein--succes { background: var(--succes); }
.marge__jauge-plein--alerte { background: var(--alerte); }
.marge__jauge-plein--danger { background: var(--danger); }
.marge__alertes { list-style: none; margin: 0.9rem 0 0; padding: 0; display: grid; gap: 0.4rem; }
.marge__treso { margin: 0.9rem 0 0; }
.marge__cible { margin-top: 0.4rem; }
.marge__cible > summary { cursor: pointer; color: var(--bleu); font-weight: 600; }
.couts-saisie__champs { display: flex; flex-wrap: wrap; gap: 0.6rem; align-items: flex-end; margin-top: 0.35rem; }
.couts-saisie__champs .champ { margin: 0; }
.couts-saisie__reference { flex: 2 1 220px; min-width: 0; }
.couts-saisie__quantite { flex: 0 1 7.5rem; }
.couts-saisie__categorie { flex: 0 1 11rem; }
.couts-saisie__date { flex: 0 1 10.5rem; }
.couts-saisie__total { display: flex; flex-direction: column; min-width: 7rem; font-variant-numeric: tabular-nums; }
.couts-saisie__total strong { font-size: 1.05rem; }
.couts-totaux { display: flex; flex-wrap: wrap; gap: 0.4rem; align-items: center; }
.couts-ajout { display: grid; grid-template-columns: 11rem minmax(200px, 1fr) 10rem 8rem auto; gap: 0.6rem; align-items: end; }
@media (max-width: 760px) {
  .couts-ajout { grid-template-columns: 1fr; }
  .couts-saisie__champs > * { flex: 1 1 100%; }
  .marge__barre { grid-template-columns: 5.5rem minmax(0, 1fr) 4rem; }
}
.tache-chantier__liste-fiches li { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; }
/* Espace client : fiches d'une tâche */
.suivi-tache__fiches { list-style: none; margin: 0.45rem 0 0; padding: 0; display: grid; gap: 0.2rem; font-size: 0.9rem; }
.suivi-tache__fiches a { font-weight: 600; }
.suivi-tache__fiche-type { margin-left: 0.4rem; font-size: 0.78rem; color: var(--texte-faible); }

/* Fiche produit d'une tâche : petit bouton à côté de « Terminer », formulaire replié */
.bouton-fiche { display: inline-flex; align-items: center; gap: 0.3rem; }
.bouton-fiche svg { flex: none; }
.tache-chantier__fiche-form { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 0.45rem; align-items: center; margin-top: 0.5rem; padding: 0.6rem; background: var(--surface-2); border-radius: var(--rayon-sm); }
.tache-chantier__fiche-form[hidden] { display: none; }
.tache-chantier__fiche-form input[type="text"] { flex: 1 1 220px; }
.tache-chantier__fiche-form input[type="file"] { flex: 1 1 200px; font-size: 0.8rem; }
.tache-chantier__liste-fiches { list-style: none; margin: 0.4rem 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 0.35rem; }
.fiche-produit { display: inline-flex; align-items: center; gap: 0.3rem; padding: 0.2rem 0.55rem; border: 1px solid var(--bordure); border-radius: 999px; background: var(--surface-2); font-size: 0.8rem; font-weight: 600; color: var(--bleu); }
.fiche-produit:hover { border-color: var(--bleu-clair); text-decoration: none; }
[data-si-nature][hidden] { display: none; }

/* Frais généraux et marge de l'année */
.annees-bilan { display: flex; flex-wrap: wrap; gap: 0.35rem; align-items: center; }
.bilan-annee { margin: 0; display: grid; gap: 0; max-width: 640px; }
.bilan-annee__ligne { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; padding: 0.55rem 0; border-bottom: 1px solid var(--bordure); }
.bilan-annee__ligne dt { font-weight: 600; display: flex; flex-direction: column; }
.bilan-annee__ligne dt span { font-weight: 400; font-size: 0.78rem; color: var(--texte-faible); }
.bilan-annee__ligne dd { margin: 0; font-variant-numeric: tabular-nums; font-weight: 600; white-space: nowrap; }
.bilan-annee__ligne--total dt, .bilan-annee__ligne--total dd { color: var(--bleu); }
.bilan-annee__ligne--resultat { border-bottom: none; border-top: 2px solid var(--texte); margin-top: 0.15rem; }
.bilan-annee__ligne--resultat dt, .bilan-annee__ligne--resultat dd { font-size: 1.15rem; color: var(--succes); }
.bilan-annee__ligne--perte dt, .bilan-annee__ligne--perte dd { color: var(--danger); }
.texte-alerte { color: var(--alerte); }

/* -------------------------- la transformation (ouverture du dossier des travaux) */
.transformation { margin-top: 1rem; padding-top: 1rem; border-top: 1px solid var(--bordure); }
.transformation__titre { margin: 0 0 0.6rem; font-weight: 600; }
.transformation__paire { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.9rem; max-width: 600px; }
.transformation__cote { display: flex; flex-direction: column; gap: 0.35rem; align-items: flex-start; }
.transformation__cote a { display: block; width: 100%; }
.transformation__cote img,
.transformation__vide { display: block; width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 8px; border: 1px solid var(--bordure); background: var(--fond-2, #f3f4f5); }
.transformation__vide { border-style: dashed; }
.transformation__etiquette { font-size: 0.74rem; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; color: var(--texte-doux); }
@media (max-width: 480px) { .transformation__paire { grid-template-columns: 1fr; } }
.frais-ajout__champs { display: flex; flex-wrap: wrap; gap: 0.6rem; align-items: flex-end; margin-top: 0.35rem; }
.frais-ajout__champs .champ { margin: 0; }
.frais-ajout__libelle { flex: 2 1 240px; min-width: 0; }
.frais-ajout__montant { flex: 0 1 8rem; }
.frais-liste { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--bordure); }
.frais-ligne { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 0.25rem 1rem; align-items: center; padding: 0.7rem 1.25rem; border-bottom: 1px solid var(--bordure); }
.frais-ligne--hors-annee { opacity: 0.6; }
.frais-ligne__principal { display: flex; flex-direction: column; min-width: 0; }
.frais-ligne__montant { display: flex; flex-direction: column; align-items: flex-end; font-variant-numeric: tabular-nums; }
.frais-ligne__edition { grid-column: 1 / -1; }
.frais-ligne__edition > summary { cursor: pointer; font-size: 0.78rem; font-weight: 600; color: var(--bleu); display: inline-block; list-style: none; }
.frais-ligne__edition > summary::-webkit-details-marker { display: none; }
@media (max-width: 760px) {
  .frais-ajout__champs > * { flex: 1 1 100%; }
  .frais-ligne { padding: 0.7rem 1rem; }
}

/* ------------------------------------------------------- assistant devis */
.assistant-saisie { position: relative; display: flex; gap: 0.5rem; align-items: flex-start; }
.assistant-saisie textarea { flex: 1; min-height: 5.5rem; }
.bouton-micro { flex: none; width: 3rem; height: 3rem; border-radius: 50%; border: 1px solid var(--bordure-forte); background: var(--surface); font-size: 1.3rem; cursor: pointer; display: grid; place-items: center; }
.bouton-micro:hover { border-color: var(--orange); }
.bouton-micro--actif { background: var(--orange); border-color: var(--orange); color: #fff; animation: micro-pulse 1.2s ease-in-out infinite; }
.bouton-micro[hidden] { display: none; }
@keyframes micro-pulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(222, 114, 47, 0.45); } 50% { box-shadow: 0 0 0 10px rgba(222, 114, 47, 0); } }
.assistant-depart .carte__pied { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; }
.assistant__entete { display: flex; justify-content: space-between; align-items: flex-end; gap: 1rem; flex-wrap: wrap; margin-bottom: 1rem; }
.assistant__titre { margin: 0 0 0.2rem; font-size: 1.45rem; }
.assistant__grille { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(280px, 1fr); gap: 1.25rem; align-items: start; }
.assistant__cote { display: grid; gap: 1.25rem; }
.assistant__fil { display: flex; flex-direction: column; gap: 0.75rem; max-height: min(62vh, 640px); overflow-y: auto; padding: 0.25rem 0.1rem 0.75rem; }
.message-ia { max-width: 88%; padding: 0.7rem 0.9rem; border-radius: 14px; border: 1px solid var(--bordure); background: var(--surface-2); }
.message-ia--utilisateur { align-self: flex-end; background: var(--info-fond); border-color: #c6dcea; border-bottom-right-radius: 4px; }
.message-ia--assistant { align-self: flex-start; border-bottom-left-radius: 4px; }
.message-ia--erreur { background: var(--danger-fond); border-color: #f3c9c5; }
.message-ia__texte { margin: 0; white-space: pre-wrap; }
.message-ia__questions { margin: 0.5rem 0 0; padding-left: 1.2rem; font-weight: 600; color: var(--bleu-fonce); }
.message-ia__details { margin-top: 0.45rem; font-size: 0.85rem; }
.message-ia__details > summary { cursor: pointer; color: var(--bleu); font-weight: 600; }
.message-ia__details ul { margin: 0.35rem 0 0; padding-left: 1.1rem; color: var(--texte-doux); }
.message-ia__heure { display: block; margin-top: 0.35rem; font-size: 0.7rem; color: var(--texte-faible); }
.assistant__travail, .assistant__erreur { display: flex; flex-wrap: wrap; align-items: center; gap: 0.6rem; margin: 0.6rem 0; padding: 0.7rem 0.9rem; border-radius: var(--rayon-sm); }
.assistant__travail { background: var(--info-fond); color: var(--info); }
.assistant__erreur { background: var(--danger-fond); color: var(--danger); }
.assistant__roue { width: 18px; height: 18px; border-radius: 50%; border: 3px solid rgba(59, 101, 120, 0.25); border-top-color: var(--info); animation: roue 0.9s linear infinite; }
@keyframes roue { to { transform: rotate(360deg); } }
.assistant__saisie { border-top: 1px solid var(--bordure); padding-top: 0.75rem; margin-top: 0.5rem; }
.assistant__actions { display: flex; justify-content: space-between; align-items: center; gap: 0.6rem; flex-wrap: wrap; margin-top: 0.6rem; }
.assistant__mains-libres--actif { background: var(--orange); border-color: var(--orange); color: #fff; }
.assistant__choix-client { margin: 0.6rem 0; border-color: var(--orange-clair); }
.assistant-client { display: flex; flex-wrap: wrap; gap: 0.6rem; align-items: flex-end; }
.assistant-client select { min-width: 240px; }
.assistant__objet { margin: 0 0 0.5rem; font-weight: 600; }
.assistant__chiffres { display: grid; grid-template-columns: auto 1fr; gap: 0.25rem 1rem; margin: 0; }
.assistant__chiffres dt { color: var(--texte-doux); font-size: 0.85rem; }
.assistant__chiffres dd { margin: 0; text-align: right; font-weight: 700; font-variant-numeric: tabular-nums; }
.assistant__liens { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 0.8rem; }
.assistant__documents { list-style: none; margin: 0 0 0.7rem; padding: 0; display: grid; gap: 0.35rem; }
.document-ia { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 0.5rem; align-items: center; }
.document-ia__nom { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.assistant__ajout-documents { display: flex; flex-wrap: wrap; gap: 0.4rem; align-items: center; }
.assistant__ajout-documents input[type="text"] { flex: 1 1 100%; }
.assistant__fichier { flex: 1 1 160px; font-size: 0.8rem; }
.assistant__cout { white-space: nowrap; }
.choix-modeles { border: none; margin: 0 0 1rem; padding: 0; display: grid; gap: 0.5rem; }
.choix-modele { display: flex; gap: 0.6rem; align-items: flex-start; padding: 0.65rem 0.8rem; border: 1px solid var(--bordure); border-radius: var(--rayon-sm); cursor: pointer; }
.choix-modele:has(input:checked) { border-color: var(--bleu); background: var(--info-fond); }
.choix-modele__corps { display: flex; flex-direction: column; gap: 0.1rem; }
.dialogue-catalogue { max-width: min(640px, calc(100vw - 32px)); border: 1px solid var(--bordure); border-radius: var(--rayon); padding: 1.25rem; box-shadow: var(--ombre-3); }
.dialogue-catalogue::backdrop { background: rgba(31, 45, 54, 0.45); }
.dialogue-catalogue h2 { margin: 0 0 0.4rem; font-size: 1.15rem; }
.dialogue-catalogue__lignes { list-style: none; margin: 0.8rem 0; padding: 0; max-height: 50vh; overflow-y: auto; display: grid; gap: 0.35rem; }
.dialogue-catalogue__lignes label { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 0.15rem 0.55rem; align-items: start; cursor: pointer; }
.dialogue-catalogue__prix { grid-column: 2; font-size: 0.82rem; color: var(--texte-doux); display: flex; flex-wrap: wrap; gap: 0.4rem; align-items: center; }
.dialogue-catalogue__actions { display: flex; justify-content: flex-end; gap: 0.5rem; flex-wrap: wrap; }
.visite__notes { min-height: 12rem; }
.visite__documents-ajout { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; margin-bottom: 0.75rem; }
.visite__documents-ajout input[type="text"] { flex: 2 1 240px; }
.visite__fichier { flex: 1 1 200px; font-size: 0.85rem; }
.visite__documents { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.45rem; }
.document-visite { display: grid; grid-template-columns: auto minmax(0, 1fr) auto auto; gap: 0.6rem; align-items: center; padding: 0.45rem 0.55rem; border: 1px solid var(--bordure); border-radius: var(--rayon-sm); }
.document-visite__type { display: grid; place-items: center; min-width: 3rem; height: 2.2rem; padding: 0 0.4rem; border-radius: 6px; background: var(--info-fond); color: var(--info); font-weight: 700; font-size: 0.72rem; }
.document-visite__type:hover { text-decoration: none; background: var(--bleu); color: #fff; }
.document-visite__corps { display: flex; flex-direction: column; min-width: 0; }
.visite__suite { border-color: var(--orange-clair); }
.visite__suite-titre { margin: 0 0 0.6rem; font-size: 1.05rem; }
@media (max-width: 900px) {
  .assistant__grille { grid-template-columns: 1fr; }
  .assistant__fil { max-height: none; }
  .message-ia { max-width: 96%; }
}
@media (max-width: 600px) {
  .document-visite { grid-template-columns: auto minmax(0, 1fr) auto; }
  .document-visite > .bouton { display: none; }
}

/* Documents d'une tâche : type affiché, documents internes en retrait */
.tache-chantier__fiche-form select { flex: 0 1 auto; }
.tache-chantier__visible { display: inline-flex; align-items: center; gap: 0.3rem; font-size: 0.8rem; color: var(--texte-doux); white-space: nowrap; }
.fiche-produit__type { padding: 0 0.35rem; border-radius: 999px; background: var(--fond); font-size: 0.68rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.03em; color: var(--texte-doux); }
.fiche-produit--interne { border-style: dashed; color: var(--texte-doux); background: var(--surface); }
.fiche-produit__interne { font-size: 0.68rem; font-weight: 600; color: var(--texte-faible); }

/* Sous-traitance confiée depuis les tâches */
.taches__rappel { margin: 0; padding: 0.5rem 1rem; border-bottom: 1px solid var(--bordure); }
.bouton-confier { display: inline-flex; align-items: center; gap: 0.3rem; }
.bouton-confier svg { flex: none; }
.sous-traitant-tache { display: inline-flex; align-items: center; gap: 0.3rem; padding: 0.2rem 0.6rem; border-radius: 999px; background: var(--info-fond); color: var(--info); font-size: 0.8rem; font-weight: 650; white-space: nowrap; max-width: 16rem; overflow: hidden; text-overflow: ellipsis; }
.sous-traitant-tache:hover { text-decoration: none; filter: brightness(0.97); }
.taches-lot__entete .sous-traitant-tache, .taches-lot__entete .bouton-confier { font-weight: 600; }
.dialogue-confier { width: min(560px, calc(100vw - 32px)); border: 1px solid var(--bordure); border-radius: var(--rayon); padding: 1.25rem; box-shadow: var(--ombre-3); }
.dialogue-confier::backdrop { background: rgba(31, 45, 54, 0.45); }
.dialogue-confier form { display: flex; flex-direction: column; gap: 0.7rem; }
.dialogue-confier h2 { margin: 0; font-size: 1.15rem; }
.dialogue-confier__quoi { margin: 0; font-weight: 650; color: var(--texte-doux); }
.dialogue-confier__alerte { margin: 0; }
.dialogue-confier .champ { margin: 0; }
.dialogue-confier__actions { display: flex; justify-content: flex-end; gap: 0.5rem; flex-wrap: wrap; }
.choix-envoi__groupe { border: 0; margin: 0; padding: 0; display: grid; gap: 0.4rem; }
.choix-envoi { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 0.55rem; align-items: start; padding: 0.55rem 0.7rem; border: 1px solid var(--bordure); border-radius: var(--rayon-sm); cursor: pointer; }
.choix-envoi:has(input:checked) { border-color: var(--orange); background: #fff8f3; }
.choix-envoi input { margin-top: 0.2rem; }
.choix-envoi > span { display: flex; flex-direction: column; gap: 0.1rem; }
.renvoi-intervention > summary { list-style: none; }
.renvoi-intervention > summary::-webkit-details-marker { display: none; }
/* Dossier du sous-traitant (page publique) */
.dossier-st__titre { margin: 1.2rem 0 0.5rem; font-size: 1rem; }
.dossier-st__taches, .dossier-st__documents { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.5rem; }
.dossier-st__taches li { padding: 0.55rem 0.7rem; border: 1px solid var(--bordure); border-left: 4px solid var(--orange); border-radius: var(--rayon-sm); }
.dossier-st__documents li { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: baseline; }

/* Contrat de travaux rédigé par l'application */
.contrat-texte { display: flex; flex-direction: column; gap: 0.9rem; }
.contrat-texte__intro { margin: 0; color: var(--texte-doux); }
.contrat-texte__article h3, .contrat-texte > h3 { margin: 0 0 0.3rem; font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--texte-faible); }
.contrat-texte__article p { margin: 0; font-size: 0.92rem; line-height: 1.55; }
.contrat-bref { margin: 0; padding-left: 1.1rem; display: grid; gap: 0.25rem; }

/* Fenêtre « Confier » : ce qui est masqué l'est vraiment (les classes .message et .champ fixent leur affichage). */
.dialogue-confier [hidden] { display: none !important; }

/* Photos d'une tâche : avant, pendant, après — montrées en vraies vignettes. */
.tache-chantier__photos { gap: 0.45rem; margin-top: 0.5rem; }
.tache-chantier__photo { position: relative; width: 104px; height: 78px; border-radius: 10px; box-shadow: var(--ombre-1); transition: transform var(--transition), box-shadow var(--transition); }
.tache-chantier__photo:hover { transform: translateY(-1px); box-shadow: var(--ombre-2); }
.tache-chantier__moment { position: absolute; left: 4px; bottom: 4px; padding: 0.05rem 0.42rem; border-radius: 999px; font-size: 0.64rem; font-weight: 700; letter-spacing: 0.02em; color: #fff; background: rgba(31, 45, 54, 0.74); }
.tache-chantier__moment--pendant { background: rgba(192, 95, 34, 0.9); }
.tache-chantier__moment--apres { background: rgba(74, 124, 89, 0.92); }
@media (max-width: 700px) { .tache-chantier__photo { width: 88px; height: 66px; } }

/*
 * Vidéos de chantier, rangées avec les photos : même case, mêmes coins. En
 * petite vignette, la première image et un triangle (elle se lit en l'ouvrant) ;
 * dans les grandes cases, le lecteur du navigateur, la vidéo entière sur fond sombre.
 */
.tache-chantier__photo video,
.mosaique video { display: block; width: 100%; height: 100%; object-fit: cover; background: var(--noir-doux); }
.mosaique video { height: auto; aspect-ratio: 1; border-radius: var(--rayon-sm); }
.mosaique__video { position: relative; display: block; }
.tache-chantier__lecture,
.mosaique__video::after { position: absolute; top: 50%; left: 50%; width: 26px; height: 26px; margin: -13px 0 0 -13px; border-radius: 50%; background: rgba(31, 45, 54, 0.72) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23ffffff'%3E%3Cpath d='M9 7v10l8-5z'/%3E%3C/svg%3E") center / 16px no-repeat; pointer-events: none; }
.mosaique__video::after { content: ""; }
.vignette__image--video { object-fit: contain; background: var(--noir-doux); }
.transformation__cote video { display: block; width: 100%; aspect-ratio: 4 / 3; object-fit: contain; border-radius: 8px; border: 1px solid var(--bordure); background: var(--noir-doux); }
/* Une vidéo choisie avant l'envoi : une tuile à son nom (pas d'image tant qu'elle n'est pas envoyée). */
.photo-choisie--video,
.apercu-video { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0.15rem; padding: 0.3rem; background: var(--noir-doux); color: #fff; text-align: center; }
.apercu-video { aspect-ratio: 1; border-radius: var(--rayon-sm); overflow: hidden; }
.photo-choisie--video strong,
.apercu-video strong { font-size: 0.72rem; letter-spacing: 0.04em; text-transform: uppercase; }
.photo-choisie--video span,
.apercu-video span { max-width: 100%; overflow: hidden; font-size: 0.62rem; line-height: 1.2; text-overflow: ellipsis; white-space: nowrap; opacity: 0.85; }
.bouton-photos-tache { display: inline-flex; align-items: center; gap: 0.3rem; }
.bouton-photos-tache svg { flex: none; }
.tache-chantier__photos-form { grid-column: 1 / -1; display: grid; gap: 0.55rem; max-width: 560px; margin-top: 0.5rem; padding: 0.75rem; background: var(--surface-2); border-radius: var(--rayon-sm); }
.tache-chantier__photos-form[hidden] { display: none; }
.tache-chantier__photos-form input[type="text"] { width: 100%; }
.choix-moment { display: inline-flex; justify-self: start; gap: 2px; padding: 3px; background: var(--surface); border: 1px solid var(--bordure); border-radius: 999px; }
.choix-moment__option { position: relative; }
.choix-moment__option input { position: absolute; inset: 0; margin: 0; opacity: 0; cursor: pointer; }
.choix-moment__option span { display: block; padding: 0.38rem 1rem; border-radius: 999px; font-size: 0.84rem; font-weight: 650; color: var(--texte-doux); transition: background var(--transition), color var(--transition); }
.choix-moment__option input:checked + span { background: var(--noir-doux); color: #fff; }
.choix-moment__option input:focus-visible + span { outline: 2px solid var(--bleu); outline-offset: 1px; }
.bouton-photo--tache { min-height: 56px; padding: 0.7rem; font-size: 0.92rem; }
.tache-chantier__photos-apercu { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.tache-chantier__photos-apercu:empty { display: none; }
.photo-choisie { position: relative; width: 76px; height: 76px; border-radius: 10px; overflow: hidden; background: var(--fond); animation: photo-choisie 0.35s cubic-bezier(0.2, 0.8, 0.2, 1); }
.photo-choisie img { width: 100%; height: 100%; object-fit: cover; }
.photo-choisie__retirer { position: absolute; top: 3px; right: 3px; display: grid; place-items: center; width: 26px; height: 26px; padding: 0; border: 0; border-radius: 50%; background: rgba(31, 45, 54, 0.78); color: #fff; font-size: 1.05rem; line-height: 1; cursor: pointer; }
@keyframes photo-choisie { from { opacity: 0; transform: scale(0.85); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .photo-choisie { animation: none; } }

/* Ligne d'une tâche : la case, le texte (toujours large), les boutons empilés
   à droite, tous de la même largeur. Tout le reste (formulaires « Photos » et
   « Document », « Modifier ») passe dessous, sur toute la largeur : rien ne
   peut plus écraser la colonne du texte. */
.tache-chantier { grid-template-columns: auto minmax(12rem, 1fr) auto; align-items: start; }
.tache-chantier > * { grid-column: 1 / -1; }
.tache-chantier > .tache-chantier__etat { grid-column: 1; grid-row: 1; margin-top: 0.1rem; }
.tache-chantier > .tache-chantier__principal { grid-column: 2; grid-row: 1; }
.tache-chantier > .tache-chantier__actions { grid-column: 3; grid-row: 1; }
.tache-chantier__actions { flex-direction: column; flex-wrap: nowrap; align-items: stretch; justify-content: flex-start; gap: 0.35rem; width: 9.75rem; }
.tache-chantier__actions > *,
.tache-chantier__actions form .bouton { width: 100%; }
.tache-chantier__actions .bouton { justify-content: flex-start; }
.tache-chantier__actions .bouton--primaire { justify-content: center; }
.tache-chantier__actions .sous-traitant-tache { max-width: none; padding: 0.42rem 0.7rem; border-radius: var(--rayon-sm); }
@media (max-width: 700px) {
  .tache-chantier { grid-template-columns: auto minmax(0, 1fr); }
  .tache-chantier > .tache-chantier__actions { grid-column: 1 / -1; grid-row: 2; }
  .tache-chantier__actions { flex-direction: row; flex-wrap: wrap; width: auto; }
  .tache-chantier__actions > *,
  .tache-chantier__actions form .bouton { width: auto; }
  /* L'en-tête d'un lot passe à la ligne plutôt que de déborder. */
  .taches-lot__entete { flex-wrap: wrap; row-gap: 0.35rem; }
}

/* ============================================= tâches : boutons et panneaux */
/* Le rond d'une tâche à faire la termine : il s'éclaire au survol. */
.tache-chantier__etat svg { width: 14px; height: 14px; }
a.tache-chantier__etat { color: transparent; text-decoration: none; transition: border-color var(--transition), background var(--transition), color var(--transition); }
a.tache-chantier__etat:hover,
a.tache-chantier__etat:focus-visible { border-color: var(--succes); background: var(--succes-fond); color: var(--succes); text-decoration: none; }
.tache-chantier--terminee .tache-chantier__etat { color: #fff; }
.tache-chantier__actions .bouton svg { flex: none; }
.bouton-points { padding-inline: 0.45rem; }
.taches-lot__entete .bouton-points { margin-left: 0.15rem; }
.taches-lot__entete .avancement { margin-left: auto; }

/* La tuile « + » au bout des miniatures. */
.vignette-ajout {
  display: grid;
  place-items: center;
  width: 104px;
  height: 78px;
  padding: 0;
  border: 2px dashed var(--bordure-forte);
  border-radius: 10px;
  background: var(--surface-2);
  color: var(--texte-faible);
  cursor: pointer;
  transition: border-color var(--transition), color var(--transition);
}
.vignette-ajout:hover,
.vignette-ajout:focus-visible { border-color: var(--bleu); color: var(--bleu); }

/* Les panneaux sous une tâche : Ajouter (photos, document), Modifier, Renommer. */
.panneau-tache {
  display: grid;
  gap: 0.75rem;
  max-width: 640px;
  margin: 0.55rem 0 0.2rem;
  padding: 0.9rem 1rem 1rem;
  border: 1px solid var(--bordure);
  border-radius: 14px;
  background: var(--surface-2);
}
.panneau-tache[hidden] { display: none; }
.panneau-tache--lot { margin: 0.4rem 1rem 0.6rem; }
.panneau-tache input[type="text"],
.panneau-tache select { width: 100%; }
.panneau-tache .champ__label { margin-bottom: -0.4rem; }
.panneau-tache__boutons { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.panneau-tache__boutons .bouton { min-height: 44px; }
.panneau-ajout__onglets { display: flex; align-items: center; gap: 0.35rem; padding-bottom: 0.6rem; border-bottom: 1px solid var(--bordure); }
.panneau-ajout__onglet {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  min-height: 40px;
  padding: 0.45rem 1rem;
  border: 0;
  border-radius: 999px;
  background: transparent;
  font: inherit;
  font-weight: 650;
  color: var(--texte-doux);
  cursor: pointer;
}
.panneau-ajout__onglet:hover { background: var(--bordure); color: var(--texte); }
.panneau-ajout__onglet[aria-selected="true"] { background: var(--noir-doux); color: #fff; }
.panneau-ajout__fermer {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  margin-left: auto;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--texte-faible);
  cursor: pointer;
}
.panneau-ajout__fermer:hover { background: var(--bordure); color: var(--texte); }
.panneau-ajout__volet { display: grid; gap: 0.75rem; }
.panneau-ajout__volet[hidden] { display: none; }
.panneau-ajout__gros { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 0.5rem; }

/* Choix en pastilles (moment d'une photo, type de document) : un geste. */
.choix-pastilles { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.choix-pastilles__option { position: relative; }
.choix-pastilles__option input { position: absolute; inset: 0; margin: 0; opacity: 0; cursor: pointer; }
.choix-pastilles__option span {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 0.4rem 1rem;
  border: 1px solid var(--bordure-forte);
  border-radius: 999px;
  background: var(--surface);
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--texte);
  transition: background var(--transition), border-color var(--transition), color var(--transition);
}
.choix-pastilles__option input:checked + span { border-color: var(--noir-doux); background: var(--noir-doux); color: #fff; }
.choix-pastilles__option input:focus-visible + span { outline: 2px solid var(--bleu); outline-offset: 2px; }

/* Gros boutons : appareil photo, galerie, fichier. */
.gros-bouton {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  min-height: 58px;
  padding: 0.8rem 1rem;
  border: 2px dashed var(--bordure-forte);
  border-radius: 12px;
  background: var(--surface);
  color: var(--bleu);
  font-weight: 700;
  text-align: center;
  cursor: pointer;
  transition: border-color var(--transition), background var(--transition);
}
.gros-bouton:hover,
.gros-bouton:focus-within { border-color: var(--bleu); background: #f2f6f8; }
.gros-bouton svg { flex: none; }
.gros-bouton--large span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* À la souris, pas d'appareil photo : « Choisir des photos » suffit. */
@media (hover: hover) and (pointer: fine) { .gros-bouton--appareil { display: none; } }
.photos-choisies { display: flex; flex-wrap: wrap; gap: 0.45rem; }
.photos-choisies:empty { display: none; }

/* Interrupteur « Visible par le client ». */
.interrupteur { position: relative; display: inline-flex; align-items: center; gap: 0.65rem; justify-self: start; font-size: 0.92rem; font-weight: 600; color: var(--texte); cursor: pointer; }
.interrupteur input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.interrupteur__piste { position: relative; flex: none; width: 46px; height: 28px; border-radius: 999px; background: var(--bordure-forte); transition: background 0.2s; }
.interrupteur__piste::after { content: ""; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.22); transition: transform 0.2s; }
.interrupteur input:checked + .interrupteur__piste { background: var(--succes); }
.interrupteur input:checked + .interrupteur__piste::after { transform: translateX(18px); }
.interrupteur input:focus-visible + .interrupteur__piste { outline: 2px solid var(--bleu); outline-offset: 2px; }

@media (max-width: 700px) {
  .vignette-ajout { width: 88px; height: 66px; }
  .panneau-tache { padding: 0.8rem; }
  .panneau-tache__boutons .bouton { flex: 1; }
  .panneau-tache--lot { margin: 0.4rem 0.75rem 0.6rem; }
}

/* ------------------------------------------------------------ assistant IA */
.agent { max-width: 56rem; margin: 0 auto; display: flex; flex-direction: column; gap: 1rem; }
.agent__entete { display: flex; align-items: flex-end; justify-content: space-between; gap: 0.75rem; flex-wrap: wrap; }
.agent__titre { margin: 0; font-size: 1.5rem; letter-spacing: -0.01em; }
.agent__sous-titre { margin: 0.2rem 0 0; color: var(--texte-doux); font-size: 0.95rem; }
.agent__entete-actions { display: flex; gap: 0.5rem; align-items: center; }
.agent__entete-actions .bouton { display: inline-flex; align-items: center; gap: 0.35rem; min-height: 40px; }
.agent__court { display: none; }

.agent__conversation { display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--bordure); border-radius: 18px; box-shadow: var(--ombre-1); overflow: hidden; }
/* Le fil remplit l'écran : l'en-tête, la saisie et son pied restent visibles sans faire défiler la page. */
.agent__fil { display: flex; flex-direction: column; gap: 0.8rem; padding: 1.25rem 1.25rem 0.9rem; height: 60vh; height: clamp(18rem, calc(100dvh - 19.5rem), 48rem); overflow-y: auto; overscroll-behavior: contain; scroll-behavior: smooth; }

.agent__accueil { margin: auto; text-align: center; max-width: 32rem; padding: 1rem 0; }
.agent__bulle-micro { display: inline-grid; place-items: center; width: 4rem; height: 4rem; border-radius: 50%; background: linear-gradient(140deg, var(--orange), var(--orange-fonce)); color: #fff; box-shadow: 0 10px 24px rgba(222, 114, 47, 0.28); margin-bottom: 0.75rem; }
.agent__accueil-titre { margin: 0; font-size: 1.2rem; font-weight: 700; }
.agent__accueil-texte { margin: 0.35rem 0 0.9rem; color: var(--texte-doux); }
.agent__suggestions { display: flex; flex-wrap: wrap; justify-content: center; gap: 0.5rem; }
.agent__suggestion { border: 1px solid var(--bordure-forte); background: var(--surface-2); color: var(--texte); border-radius: 999px; padding: 0.55rem 0.95rem; font: inherit; font-size: 0.9rem; cursor: pointer; min-height: 44px; transition: border-color var(--transition), background var(--transition); }
.agent__suggestion:hover { border-color: var(--orange); background: #fff7f1; }

.agent-message { display: flex; }
.agent-message--utilisateur { justify-content: flex-end; }
.agent-message__bulle { max-width: min(85%, 38rem); padding: 0.7rem 0.95rem; border-radius: 16px; background: var(--surface-2); border: 1px solid var(--bordure); line-height: 1.45; overflow-wrap: anywhere; }
.agent-message--utilisateur .agent-message__bulle { background: var(--bleu); border-color: var(--bleu); color: #fff; border-bottom-right-radius: 5px; }
.agent-message--assistant .agent-message__bulle { border-bottom-left-radius: 5px; }
.agent-message--erreur .agent-message__bulle { background: var(--danger-fond); border-color: #f0cbbf; color: var(--danger); }
.agent-message--compte-rendu .agent-message__bulle { background: #f3f8f4; border-color: #d3e5d7; }
.agent-message--provisoire { opacity: 0.7; }
.agent-message__bulle p { margin: 0; }
.agent-message__bulle p + p, .agent-message__bulle p + .agent__liste, .agent-message__bulle .agent__liste + p { margin-top: 0.45rem; }
.agent__liste { margin: 0.35rem 0 0; padding-left: 1.2rem; }
.agent__liste li + li { margin-top: 0.15rem; }
.agent-message__heure { display: block; margin-top: 0.35rem; font-size: 0.7rem; opacity: 0.65; }
.agent-message__vocal { margin-left: 0.35rem; }

.agent-liens { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-top: 0.55rem; }
.agent-lien { display: inline-flex; align-items: center; padding: 0.35rem 0.75rem; border-radius: 999px; background: var(--surface); border: 1px solid var(--bordure-forte); font-size: 0.85rem; font-weight: 600; color: var(--bleu); min-height: 36px; }
.agent-lien:hover { border-color: var(--bleu); text-decoration: none; }
.agent-lien span { margin-left: 0.3rem; }

.agent-faits { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.45rem; }
.agent-fait { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 0.55rem; align-items: start; }
.agent-fait__icone { display: grid; place-items: center; width: 1.5rem; height: 1.5rem; border-radius: 50%; font-weight: 800; font-size: 0.85rem; background: var(--succes-fond); color: var(--succes); }
.agent-fait--annule .agent-fait__icone { background: var(--surface-2); color: var(--texte-faible); }
.agent-fait--erreur .agent-fait__icone { background: var(--danger-fond); color: var(--danger); }
.agent-fait__texte { display: block; color: var(--texte-doux); font-size: 0.9rem; margin-top: 0.1rem; }

.agent__travail { display: flex; align-items: center; gap: 0.6rem; margin: 0; padding: 0.5rem 0.9rem; border-radius: 999px; background: var(--info-fond); color: var(--info); font-size: 0.9rem; align-self: flex-start; }
.agent__travail[hidden] { display: none; }
.agent__points { display: inline-flex; gap: 3px; }
.agent__points span { width: 6px; height: 6px; border-radius: 50%; background: currentColor; animation: agent-points 1.1s ease-in-out infinite; }
.agent__points span:nth-child(2) { animation-delay: 0.15s; }
.agent__points span:nth-child(3) { animation-delay: 0.3s; }
@keyframes agent-points { 0%, 80%, 100% { opacity: 0.25; transform: translateY(0); } 40% { opacity: 1; transform: translateY(-3px); } }

.agent__proposition { flex: none; margin: 0.2rem 0 0; padding: 1rem 1.1rem; border-radius: 14px; border: 2px solid var(--orange-clair); background: #fffaf6; box-shadow: 0 8px 20px rgba(222, 114, 47, 0.12); animation: agent-apparition 0.25s ease-out; }
.agent__proposition[hidden] { display: none; }
.agent__proposition-titre { margin: 0 0 0.5rem; font-size: 0.78rem; font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase; color: var(--orange-fonce); }
.agent__actions { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.7rem; }
.agent__action-titre { display: block; font-size: 1.02rem; }
.agent__action-details { margin: 0.3rem 0 0; padding-left: 1.1rem; color: var(--texte-doux); font-size: 0.92rem; }
.agent__action-details li + li { margin-top: 0.15rem; }
.agent__client { margin: 0.75rem 0 0; padding: 0.55rem 0.75rem; border-radius: var(--rayon-sm); background: var(--alerte-fond); color: #7a5410; font-size: 0.9rem; }
.agent__proposition-boutons { display: flex; justify-content: flex-end; gap: 0.6rem; margin-top: 0.9rem; }
.agent__proposition-boutons form { margin: 0; display: flex; }
.agent__proposition-boutons .bouton { min-height: 46px; min-width: 7rem; font-size: 1rem; justify-content: center; }
.agent__proposition-aide { margin: 0.45rem 0 0; text-align: right; }
@keyframes agent-apparition { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

.agent__alerte { margin: 0 1.25rem 0.75rem; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.6rem; padding: 0.65rem 0.85rem; border-radius: var(--rayon-sm); background: var(--danger-fond); color: var(--danger); font-size: 0.92rem; }
.agent__alerte--info { background: var(--info-fond); color: var(--info); }
.agent__alerte[hidden] { display: none; }

.agent__saisie { display: flex; align-items: flex-end; gap: 0.6rem; padding: 0.75rem 1rem; border-top: 1px solid var(--bordure); background: var(--surface); margin: 0; }
.agent__champ { flex: 1; min-width: 0; }
.agent__texte { display: block; width: 100%; resize: none; min-height: 52px; max-height: 180px; padding: 0.8rem 1rem; border: 1px solid var(--bordure-forte); border-radius: 26px; font: inherit; font-size: 1rem; line-height: 1.35; background: var(--surface-2); color: var(--texte); }
.agent__texte:focus { outline: none; border-color: var(--bleu-clair); background: #fff; box-shadow: 0 0 0 3px rgba(95, 135, 153, 0.18); }
.agent__micro, .agent__envoyer { flex: none; display: grid; place-items: center; width: 52px; height: 52px; border-radius: 50%; border: none; cursor: pointer; transition: transform var(--transition), background var(--transition); color: #fff; }
.agent__micro { background: linear-gradient(140deg, var(--orange), var(--orange-fonce)); box-shadow: 0 6px 16px rgba(222, 114, 47, 0.3); }
.agent__micro[hidden] { display: none; }
.agent__micro:active, .agent__envoyer:active { transform: scale(0.94); }
.agent__micro--actif { animation: micro-pulse 1.2s ease-in-out infinite; }
.agent__micro:disabled, .agent__envoyer:disabled { opacity: 0.45; cursor: default; box-shadow: none; }
.agent__envoyer { background: var(--bleu); }
.agent__saisie--ecoute .agent__texte { border-color: var(--orange); background: #fffaf6; }

.agent__pied { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 0.3rem 0.9rem; padding: 0 1rem 0.7rem; font-size: 0.8rem; color: var(--texte-faible); }
.agent__voix { display: inline-flex; align-items: center; gap: 0.4rem; cursor: pointer; color: var(--texte-doux); min-height: 32px; }
.agent__voix[hidden] { display: none; }
.agent__voix input { width: 1.05rem; height: 1.05rem; accent-color: var(--bleu); margin: 0; }
.agent__options-voix { display: flex; flex-wrap: wrap; align-items: center; gap: 0.1rem 1rem; }
.agent__mains-libres { font-weight: 650; color: var(--texte); }
.agent__mains-libres input { accent-color: var(--orange); }

/* Pendant qu'il parle : le micro passe au bleu, un appui lui coupe la parole. */
.agent__micro--parle { background: linear-gradient(140deg, var(--bleu-clair), var(--bleu)); box-shadow: 0 6px 16px rgba(54, 91, 109, 0.3); animation: micro-parle 1.6s ease-in-out infinite; }
@keyframes micro-parle { 0%, 100% { box-shadow: 0 0 0 0 rgba(54, 91, 109, 0.4); } 50% { box-shadow: 0 0 0 11px rgba(54, 91, 109, 0); } }

/* Mains libres : la conversation à la voix est en cours. */
.agent__dialogue { display: flex; align-items: center; gap: 0.65rem; margin: 0 1rem 0.65rem; padding: 0.4rem 0.4rem 0.4rem 0.9rem; border-radius: 999px; background: linear-gradient(135deg, #fff7f1, #fff); border: 1px solid rgba(222, 114, 47, 0.28); box-shadow: 0 6px 18px -12px rgba(222, 114, 47, 0.55); font-size: 0.9rem; color: var(--texte); animation: agent-apparition 0.3s ease-out; }
.agent__dialogue[hidden] { display: none; }
.agent__dialogue--parle { background: linear-gradient(135deg, #eef4f7, #fff); border-color: rgba(54, 91, 109, 0.25); box-shadow: 0 6px 18px -12px rgba(54, 91, 109, 0.5); }
.agent__dialogue--veille { background: linear-gradient(135deg, #f4f4f2, #fff); border-color: var(--bordure-forte); box-shadow: none; color: var(--texte-doux); }
.agent__dialogue--veille .agent__dialogue-onde span { background: var(--gris-moyen, #9aa3a8); height: 4px; }
.agent__dialogue-texte { flex: 1; min-width: 0; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.agent__dialogue-onde { display: inline-flex; align-items: center; gap: 3px; height: 18px; flex: none; }
.agent__dialogue-onde span { width: 3px; height: 6px; border-radius: 3px; background: var(--orange); }
.agent__dialogue--parle .agent__dialogue-onde span { background: var(--bleu); }
.agent__dialogue--ecoute .agent__dialogue-onde span,
.agent__dialogue--parle .agent__dialogue-onde span { animation: dialogue-onde 0.9s ease-in-out infinite; }
.agent__dialogue-onde span:nth-child(2) { animation-delay: 0.15s; }
.agent__dialogue-onde span:nth-child(3) { animation-delay: 0.3s; }
@keyframes dialogue-onde { 0%, 100% { height: 5px; } 50% { height: 17px; } }
.agent__dialogue-fin { flex: none; min-height: 36px; padding: 0.35rem 0.95rem; border: 1px solid var(--bordure-forte); border-radius: 999px; background: #fff; color: var(--texte); font: inherit; font-size: 0.85rem; font-weight: 650; cursor: pointer; }
.agent__dialogue-fin:hover { border-color: var(--orange); color: var(--orange-fonce); }

.agent__historique { padding: 0; }
.agent__historique-titre { cursor: pointer; padding: 0.9rem 1.1rem; font-weight: 700; }
.agent__recentes { list-style: none; margin: 0; padding: 0 0.6rem 0.6rem; display: grid; gap: 0.2rem; }
.agent__recente { display: flex; flex-direction: column; gap: 0.1rem; padding: 0.55rem 0.6rem; border-radius: var(--rayon-sm); color: var(--texte); }
.agent__recente:hover { background: var(--surface-2); text-decoration: none; }
.agent__recente--active { background: var(--info-fond); }
.agent__recente-titre { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* La fiche dont parle la conversation (ouverte depuis un devis, une visite, un chantier, un client). */
.agent__origine { display: flex; align-items: center; gap: 0.35rem; max-width: 100%; margin: -0.2rem 0 0; padding: 0.4rem 0.85rem; border-radius: 999px; background: var(--info-fond); color: var(--info); font-size: 0.9rem; align-self: flex-start; white-space: nowrap; }
.agent__origine[hidden] { display: none; }
.agent__origine a { min-width: 0; overflow: hidden; text-overflow: ellipsis; font-weight: 700; color: var(--bleu); }
/* Avec le bandeau, le fil raccourcit d'autant : la saisie reste visible sans faire défiler. */
.agent:has(> .agent__origine:not([hidden])) .agent__fil { height: clamp(16rem, calc(100dvh - 22.5rem), 46rem); }

/* Trombone : photos et plans pour le chiffrage. */
.agent__joindre { flex: none; display: grid; place-items: center; width: 44px; height: 44px; margin-bottom: 4px; border-radius: 50%; border: 1px solid var(--bordure-forte); background: var(--surface-2); color: var(--texte-doux); cursor: pointer; transition: border-color var(--transition), color var(--transition); }
.agent__joindre:hover { border-color: var(--bleu); color: var(--bleu); }
.agent__joindre:focus-within { outline: 2px solid var(--bleu-clair); outline-offset: 2px; }
.agent__joindre:has(input:disabled) { opacity: 0.45; cursor: default; }
.agent-pieces__titre { font-weight: 700; }
.agent-pieces { display: flex; flex-wrap: wrap; gap: 0.35rem; margin-top: 0.45rem; }
.agent-piece { display: inline-flex; align-items: center; max-width: 100%; padding: 0.3rem 0.65rem; border-radius: 999px; background: rgba(255, 255, 255, 0.16); border: 1px solid rgba(255, 255, 255, 0.35); color: inherit; font-size: 0.85rem; min-height: 32px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.agent-piece:hover { background: rgba(255, 255, 255, 0.26); text-decoration: none; }
.agent__joindre[hidden] { display: none; }

/* Dépôt de fichiers (assistant-depot.js) : astuce iPhone, carte du dépôt, bilan, panneau d'envoi, voile. */
.agent__accueil-astuce { margin: -0.4rem auto 0.9rem; max-width: 26rem; font-size: 0.85rem; color: var(--texte-faible); }
/* Bouton « Dossier » : sur ordinateur seulement (montré par le script). */
@media (hover: none) and (pointer: coarse) {
  .agent__dossier { display: none; }
}
/* La carte d'un dépôt, dans la bulle du dirigeant (texte blanc sur bleu) ; le bilan, dans celle de l'assistant. */
.agent-depot { min-width: min(17rem, 62vw); }
.agent-depot__titre { margin: 0; font-weight: 700; }
.agent-depot__detail { margin: 0.1rem 0 0; font-size: 0.85rem; opacity: 0.85; }
.agent-depot__etat { margin: 0.45rem 0 0; font-size: 0.9rem; }
.agent-depot__barre { height: 0.45rem; margin-top: 0.35rem; border-radius: 999px; background: rgba(127, 127, 127, 0.3); overflow: hidden; }
.agent-depot__barre span { display: block; width: 0; height: 100%; border-radius: 999px; background: var(--orange); transition: width 0.3s ease; }
.agent-depot__actions { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-top: 0.6rem; }
.agent-depot__actions[hidden] { display: none; }
.agent-depot a { color: inherit; text-decoration: underline; text-underline-offset: 2px; }
.agent-depot .agent-lien { color: var(--bleu); text-decoration: none; }
.agent-depot__pieces { margin-top: 0.55rem; }
.agent-depot__pieces > summary { cursor: pointer; padding: 0.25rem 0; font-size: 0.9rem; font-weight: 650; }
.agent-depot__liste { margin: 0.35rem 0 0; padding-left: 1.1rem; font-size: 0.9rem; }
.agent-depot__liste li + li { margin-top: 0.2rem; }
.agent-depot__pieces .agent-depot__liste { list-style: none; padding-left: 0; }
.agent-depot__rang { display: inline-block; min-width: 2em; opacity: 0.75; }
.agent-depot__info, .agent-depot__raison, .agent-depot__note { opacity: 0.8; }
.agent-depot__note { margin: 0.35rem 0 0; font-size: 0.85rem; }
.agent-depot__suite { margin-top: 0.45rem; }
.agent-depot--bilan { min-width: 0; margin-top: 0.45rem; }
.agent-depot__sous-titre { margin: 0.55rem 0 0; font-size: 0.9rem; font-weight: 650; }
.agent-depot__liste--illisibles { color: var(--danger); }
/* Le panneau d'envoi de Documents, placé dans la conversation juste au-dessus de la saisie : il ne cache jamais le micro. */
.esp-envoi.agent-envoi { position: static; z-index: auto; display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; column-gap: 0.75rem; width: auto; margin: 0 1rem 0.65rem; padding: 0.7rem 0.9rem; background: var(--surface-2); box-shadow: none; }
.esp-envoi.agent-envoi[hidden] { display: none; }
.agent-envoi .esp-envoi__titre { grid-column: 1; grid-row: 1; margin: 0; font-size: 0.95rem; }
.agent-envoi .esp-envoi__boutons { grid-column: 2; grid-row: 1; flex-wrap: wrap; justify-content: flex-end; gap: 0.5rem; margin: 0; }
.agent-envoi .esp-envoi__boutons:empty { display: none; }
.agent-envoi .esp-envoi__boutons .bouton { min-height: 40px; }
.agent-envoi .esp-envoi__barre, .agent-envoi .esp-envoi__detail, .agent-envoi .esp-envoi__erreurs { grid-column: 1 / -1; }
.agent-envoi .esp-envoi__barre { margin-top: 0.45rem; background: var(--bordure); }
/* Pendant un envoi, le fil raccourcit de la hauteur réelle du panneau, erreurs comprises (--agent-envoi, mesurée par
   assistant-depot.js ; à défaut, la hauteur d'un envoi sans erreur) : la saisie reste visible sans faire défiler. */
.agent:has([data-depot-envoi]:not([hidden])) .agent__fil { height: clamp(9rem, calc(100dvh - 19.5rem - var(--agent-envoi, 7.5rem)), calc(48rem - var(--agent-envoi, 7.5rem))); }
.agent:has(> .agent__origine:not([hidden])):has([data-depot-envoi]:not([hidden])) .agent__fil { height: clamp(8rem, calc(100dvh - 22.5rem - var(--agent-envoi, 7.5rem)), calc(46rem - var(--agent-envoi, 7.5rem))); }
/* Au-delà de quelques lignes, la liste des erreurs défile dans le panneau : il reste court. */
.agent-envoi .esp-envoi__erreurs { max-height: 6rem; overscroll-behavior: contain; }
/* Le voile du glisser-déposer : le message tient sur un téléphone. */
.esp-depot.agent-voile p { max-width: min(30rem, calc(100% - 2rem)); text-align: center; line-height: 1.4; border-radius: 1.2rem; }
@media (max-width: 900px) {
  .agent-envoi .esp-envoi__erreurs { max-height: 3.6rem; }
  .agent:has([data-depot-envoi]:not([hidden])) .agent__fil { height: max(8rem, calc(100dvh - 21rem - var(--agent-envoi, 7.5rem))); }
  .agent:has(> .agent__origine:not([hidden])):has([data-depot-envoi]:not([hidden])) .agent__fil { height: max(7rem, calc(100dvh - 23.6rem - var(--agent-envoi, 7.5rem))); }
}
@media (max-width: 560px) {
  .agent__dossier { display: none; }
  .esp-envoi.agent-envoi { margin: 0 0.65rem 0.55rem; padding: 0.6rem 0.75rem; }
  .agent-envoi .esp-envoi__boutons { grid-column: 1 / -1; grid-row: auto; justify-content: flex-start; margin-top: 0.5rem; }
  .agent:has([data-depot-envoi]:not([hidden])) .agent__fil { height: max(8rem, calc(100dvh - 21rem - var(--agent-envoi, 9rem))); }
  .agent:has(> .agent__origine:not([hidden])):has([data-depot-envoi]:not([hidden])) .agent__fil { height: max(7rem, calc(100dvh - 23.6rem - var(--agent-envoi, 9rem))); }
}

@media (max-width: 900px) {
  /* Téléphone et tablette : la conversation occupe l'écran, la saisie reste juste au-dessus de la barre du bas. */
  .agent__fil { height: 55vh; height: max(15rem, calc(100dvh - 21rem)); padding: 1rem 0.85rem 0.75rem; }
  .agent:has(> .agent__origine:not([hidden])) .agent__fil { height: max(13rem, calc(100dvh - 23.6rem)); }
}
@media (max-width: 560px) {
  .agent { gap: 0.7rem; }
  .agent__titre { font-size: 1.3rem; }
  .agent__sous-titre { display: none; }
  .agent__entete { align-items: center; flex-wrap: nowrap; }
  .agent__long { display: none; }
  .agent__court { display: inline; }
  .agent__conversation { border-radius: 14px; }
  .agent-message__bulle { max-width: 90%; }
  .agent__proposition { padding-left: 0.85rem; padding-right: 0.85rem; }
  .agent__alerte { margin-left: 0.65rem; margin-right: 0.65rem; }
  .agent__proposition-boutons form { flex: 1; }
  .agent__proposition-boutons .bouton { flex: 1; min-width: 0; }
  .agent__proposition-aide { text-align: center; }
  .agent__saisie { padding: 0.6rem 0.65rem; gap: 0.45rem; }
  .agent__micro, .agent__envoyer { width: 48px; height: 48px; }
  .agent__joindre { width: 40px; height: 40px; }
  .agent__origine { font-size: 0.85rem; }
  .agent__texte { min-height: 48px; padding: 0.7rem 0.9rem; }
  .agent__pied { padding: 0 0.75rem 0.6rem; }
  .agent__dialogue { margin: 0 0.65rem 0.55rem; }
}
@media (prefers-reduced-motion: reduce) {
  .agent__points span, .agent__micro--actif, .agent__micro--parle, .agent__proposition, .agent__dialogue, .agent__dialogue-onde span { animation: none; }
  .agent__fil { scroll-behavior: auto; }
}

/* ===================================== écrans tactiles : vérification 10/2026 */
/*
 * Vérification de l'ensemble (iPhone, iPad, ordinateur). Sur iPhone et iPad,
 * un champ écrit en dessous de 16 px fait zoomer la page dès qu'on le touche,
 * et elle reste zoomée : tous les champs (pas seulement ceux des formulaires
 * « .champ ») passent à 16 px sur les écrans tactiles, iPad en paysage compris,
 * et dans les petites fenêtres.
 */
@media (hover: none) and (pointer: coarse), (max-width: 900px) {
  input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="file"]):not([type="color"]),
  select,
  textarea { font-size: 16px !important; }

  /* Cibles tactiles : petites icônes (monter, descendre, supprimer…) et liens
     discrets assez grands pour un doigt (éditeur de devis surtout). */
  .bouton-icone { display: inline-grid; place-items: center; min-width: 40px; min-height: 40px; font-size: 1rem; }
  .bouton-icone--petit { min-width: 38px; min-height: 34px; font-size: 0.95rem; }
  .lien-discret { display: inline-flex; align-items: center; min-height: 36px; padding: 0.3rem 0.1rem; font-size: 0.85rem; }
  .ligne-devis { grid-template-columns: 40px minmax(0, 1fr); padding-left: 0.35rem; }
  .ligne-devis--texte { grid-template-columns: 40px minmax(0, 1fr) auto; }
  .ligne-devis__poignee { gap: 0; }
  .lot-devis__actions { gap: 0; }
}

/* Plusieurs boutons dans une cellule d'actions (accès à l'espace client…) :
   ils passent à la ligne quand la colonne est étroite (iPad, fiche en deux
   colonnes) au lieu de faire déborder la page. */
.tableau td.actions:has(> form + form, > a + form, > form + a) { white-space: normal; }
.tableau td.actions > form + form, .tableau td.actions > a + form, .tableau td.actions > form + a { margin: 0.2rem 0 0.2rem 0.3rem; }

/* Fiches « intitulé / valeur » dans une colonne étroite (L'essentiel du
   chantier, coordonnées) : une longue adresse e-mail se coupe au lieu
   d'élargir la carte au-delà de l'écran. */
.tableau--fiche td, .tableau--fiche th, .carte__corps--serre .tableau td { overflow-wrap: anywhere; }

/* Téléphone : le nom du lot garde toute la ligne ; total et flèches passent dessous. */
@media (max-width: 560px) {
  .lot-devis__entete { flex-wrap: wrap; row-gap: 0.15rem; }
  .lot-devis__nom { flex: 1 1 100%; }
  .lot-devis__total { margin-right: auto; padding-left: 0.45rem; }
}

/* Écran tactile : glisser une ligne au doigt ne marche pas ; les flèches suffisent. */
@media (hover: none) and (pointer: coarse) {
  .ligne-devis__poignee .poignee { display: none; }
}

/* ------------------------------------------- devis signé : le contrat */
/* L'étape qui suit l'accord du client, en tête de la page du devis. */
.etape-contrat { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.75rem 1.25rem; margin: 0 0 1.25rem; padding: 0.95rem 1.15rem; background: var(--surface); border: 1px solid var(--bordure); border-left: 4px solid var(--succes); border-radius: var(--rayon); box-shadow: var(--ombre-1); }
.etape-contrat--a-faire { border-left-color: var(--orange); background: #fffaf6; }
.etape-contrat--alerte { border-left-color: var(--danger); background: var(--danger-fond); }
.etape-contrat__texte { display: flex; flex-direction: column; gap: 0.2rem; flex: 1 1 22rem; min-width: 0; }
.etape-contrat__titre { font-size: 1.02rem; }
.etape-contrat__texte span { color: var(--texte-doux); font-size: 0.9rem; }
.etape-contrat__action form { margin: 0; }
@media (max-width: 560px) {
  .etape-contrat__action, .etape-contrat__action form, .etape-contrat__action .bouton { width: 100%; }
}

/* ===================================================== communication === */
/* Prospection par e-mail, publicité, référencement et planning. */
.texte-succes { color: var(--succes); }
.com-nav { margin-bottom: 1.1rem; }
.com-bloc { margin-bottom: 1rem; }
.com-indicateurs { margin-bottom: 1rem; }
a.com-indicateur { color: inherit; transition: transform var(--transition), box-shadow var(--transition); }
a.com-indicateur:hover { text-decoration: none; transform: translateY(-2px); box-shadow: var(--ombre-2); }
.com-indicateur__sur { font-size: 1rem; font-weight: 600; color: var(--texte-faible); }

/* Alertes de la vue d'ensemble */
.com-alertes { list-style: none; margin: 0 0 1rem; padding: 0; display: grid; gap: 0.5rem; }
.com-alerte { display: flex; align-items: center; gap: 0.75rem; flex-wrap: wrap; padding: 0.7rem 0.9rem; border-radius: var(--rayon-sm); border: 1px solid var(--bordure); border-left: 4px solid var(--info); background: var(--surface); }
.com-alerte__texte { flex: 1 1 18rem; min-width: 0; }
.com-alerte--erreur { border-left-color: var(--danger); background: var(--danger-fond); }
.com-alerte--alerte { border-left-color: var(--alerte); background: var(--alerte-fond); }
.com-alerte--succes { border-left-color: var(--orange); background: #fdf4ee; }
.com-alerte--info { border-left-color: var(--bleu-clair); }

/* Pastille de canal */
.com-canal { display: inline-flex; align-items: center; padding: 0.1rem 0.5rem; border-radius: 999px; font-size: 0.72rem; font-weight: 650; letter-spacing: 0.01em; white-space: nowrap; background: var(--surface-2); color: var(--texte-doux); border: 1px solid transparent; }
.com-canal--email { background: #e8eff2; color: var(--bleu-fonce); }
.com-canal--google_ads { background: #e9f0fa; color: #2d5a9e; }
.com-canal--meta_ads { background: #edeffa; color: #4a55a2; }
.com-canal--fiche_google { background: var(--succes-fond); color: var(--succes); }
.com-canal--reseaux { background: #f5eef8; color: #7a4a8c; }
.com-canal--site { background: var(--alerte-fond); color: var(--alerte); }
.com-canal--terrain { background: #fdf0e7; color: var(--orange-fonce); }
.com-canal--relation { background: #f1efe9; color: var(--texte-doux); }

/* Case ronde « fait » */
.com-coche { flex: none; width: 24px; height: 24px; border-radius: 50%; border: 2px solid var(--bordure-forte); background: var(--surface); cursor: pointer; position: relative; transition: border-color var(--transition), background var(--transition), transform var(--transition); }
.com-coche:hover:not(:disabled) { border-color: var(--succes); transform: scale(1.06); }
.com-coche:disabled { cursor: default; opacity: 0.55; }
.com-coche--faite { background: var(--succes); border-color: var(--succes); }
.com-coche--faite::after, .com-coche:hover:not(:disabled)::after { content: ""; position: absolute; left: 7px; top: 3px; width: 6px; height: 11px; border: solid #fff; border-width: 0 2px 2px 0; transform: rotate(45deg); }
.com-coche:hover:not(:disabled):not(.com-coche--faite)::after { border-color: var(--succes); }

/* Listes */
.com-taches, .com-liste, .com-cases, .com-statuts { list-style: none; margin: 0; padding: 0.35rem; }
.com-tache { display: flex; align-items: center; gap: 0.75rem; padding: 0.6rem 0.65rem; border-radius: var(--rayon-sm); }
.com-tache + .com-tache { border-top: 1px solid var(--bordure); border-radius: 0; }
.com-tache form { margin: 0; display: flex; }
.com-tache__texte { display: flex; flex-wrap: wrap; align-items: center; gap: 0.25rem 0.5rem; min-width: 0; }
.com-tache__texte .texte-petit { flex-basis: 100%; }
.com-tache--retard .com-tache__texte strong { color: var(--alerte); }
.com-liste__lien, .com-liste__ligne { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 0.15rem 0.75rem; padding: 0.6rem 0.65rem; border-radius: var(--rayon-sm); color: var(--texte); }
.com-liste__lien:hover { background: var(--surface-2); text-decoration: none; }
.com-liste li + li { border-top: 1px solid var(--bordure); }
.com-liste__principal { font-weight: 600; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.com-liste__secondaire { grid-column: 1 / -1; font-size: 0.8rem; color: var(--texte-doux); }
.com-liste__ligne--actions { grid-template-columns: minmax(0, 1fr) auto; }
.com-liste__ligne--actions .com-liste__secondaire { grid-column: 1; }
.com-liste__ligne--actions form { grid-row: 1 / span 2; grid-column: 2; }
.com-liste__avancement { grid-column: 1 / -1; }
.com-liste--serree .com-liste__ligne { padding: 0.45rem 0.65rem; }
.com-cellule-avancement { min-width: 140px; }

/* Barres d'envoi des quatorze derniers jours */
.com-barres { display: grid; grid-template-columns: repeat(14, minmax(0, 1fr)); align-items: end; gap: 6px; height: 150px; }
.com-barres__jour { display: grid; grid-template-rows: 1.2rem 1fr auto; height: 100%; text-align: center; min-width: 0; }
.com-barres__valeur { font-size: 0.72rem; font-weight: 650; color: var(--texte-doux); font-variant-numeric: tabular-nums; }
.com-barres__barre { align-self: end; height: max(3px, var(--h)); border-radius: 6px 6px 2px 2px; background: linear-gradient(180deg, var(--bleu-clair), var(--bleu)); transform-origin: bottom; animation: com-monte 700ms cubic-bezier(0.2, 0.8, 0.2, 1) both; }
.com-barres__barre { animation-delay: calc(var(--i, 0) * 35ms); }
.com-barres__barre--erreur { background: linear-gradient(180deg, var(--orange-clair), var(--orange)); }
.com-barres__libelle { font-size: 0.66rem; color: var(--texte-faible); padding-top: 0.3rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@keyframes com-monte { from { transform: scaleY(0); } to { transform: scaleY(1); } }

/* Score (anneau) */
.com-score { --c: var(--bleu-clair); position: relative; width: 104px; height: 104px; border-radius: 50%; flex: none; display: grid; place-content: center; text-align: center; background: conic-gradient(var(--c) calc(var(--score, 0) * 3.6deg), var(--bordure) 0); }
.com-score::before { content: ""; position: absolute; inset: 9px; border-radius: 50%; background: var(--surface); }
.com-score > * { position: relative; }
.com-score__valeur { font-size: 1.7rem; font-weight: 750; line-height: 1; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.com-score__libelle { font-size: 0.66rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--texte-faible); font-weight: 650; margin-top: 0.15rem; }
.com-score--bon { --c: var(--succes); }
.com-score--moyen { --c: var(--orange); }
.com-score--faible { --c: var(--danger); }
.com-score--grand { width: 128px; height: 128px; }
.com-score--grand .com-score__valeur { font-size: 2.2rem; }
.com-visibilite { display: flex; gap: 1.25rem; align-items: center; flex-wrap: wrap; }
.com-visibilite__groupes { flex: 1 1 16rem; display: grid; gap: 0.45rem; min-width: 0; }
.com-jauge { display: grid; gap: 0.15rem; }
.com-jauge__libelle { font-size: 0.78rem; color: var(--texte-doux); }

/* Assistant (planning, rédaction) */
.com-assistant { margin-bottom: 1rem; border-color: #d9e3e8; background: linear-gradient(180deg, #f7fafb, var(--surface) 70%); }
.com-assistant__pastille { display: inline-grid; place-content: center; width: 30px; height: 30px; border-radius: 9px; font-size: 0.72rem; font-weight: 800; letter-spacing: 0.04em; color: #fff; background: linear-gradient(135deg, var(--bleu), var(--bleu-clair)); box-shadow: 0 4px 10px rgba(54, 91, 109, 0.25); flex: none; }
.com-demande__ligne { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 0 1rem; }
.com-attente { display: flex; align-items: center; gap: 1rem; }
.com-attente__roue, .com-bouton-occupe::before { width: 26px; height: 26px; border-radius: 50%; border: 3px solid #d9e3e8; border-top-color: var(--bleu); animation: com-tourne 0.9s linear infinite; flex: none; }
.com-bouton-occupe::before { content: ""; width: 14px; height: 14px; border-width: 2px; margin-right: 0.45rem; }
@keyframes com-tourne { to { transform: rotate(360deg); } }
.com-proposition__resume { font-size: 1rem; line-height: 1.55; max-width: 75ch; }
.com-conseils { margin: 0 0 1rem; padding-left: 1.2rem; color: var(--texte-doux); }
.com-conseils li { margin-bottom: 0.2rem; }
.com-proposition__barre { padding: 0.5rem 0; border-bottom: 1px solid var(--bordure); margin-bottom: 0.25rem; }
.com-proposees { list-style: none; margin: 0 0 1rem; padding: 0; max-height: 34rem; overflow: auto; }
.com-proposee + .com-proposee { border-top: 1px solid var(--bordure); }
.com-proposee__case { display: grid; grid-template-columns: auto 6.5rem auto minmax(0, 1fr); align-items: start; gap: 0.6rem; padding: 0.65rem 0.25rem; cursor: pointer; }
.com-proposee__case input { margin-top: 0.2rem; }
.com-proposee__date { font-variant-numeric: tabular-nums; font-size: 0.85rem; color: var(--texte-doux); padding-top: 0.05rem; }
.com-proposee__texte { display: grid; gap: 0.15rem; min-width: 0; }
.com-proposee__texte > span { color: var(--texte-doux); font-size: 0.9rem; }
.com-proposition__actions { gap: 0.75rem; }

/* Puces à cocher */
.com-puces { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.com-puce { position: relative; display: inline-flex; cursor: pointer; }
.com-puce input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.com-puce span { display: inline-flex; align-items: center; gap: 0.35rem; padding: 0.38rem 0.75rem; border: 1px solid var(--bordure); border-radius: 999px; background: var(--surface); font-size: 0.84rem; font-weight: 600; color: var(--texte-doux); transition: background var(--transition), border-color var(--transition), color var(--transition); }
.com-puce span em { font-style: normal; font-size: 0.72rem; font-weight: 700; color: var(--texte-faible); }
.com-puce:hover span { border-color: var(--bordure-forte); color: var(--texte); }
.com-puce input:checked + span { background: var(--bleu); border-color: var(--bleu); color: #fff; }
.com-puce input:checked + span em { color: rgba(255, 255, 255, 0.75); }
.com-puce input:focus-visible + span { outline: 2px solid var(--orange); outline-offset: 2px; }
.com-puces--petites .com-puce span { padding: 0.28rem 0.6rem; font-size: 0.78rem; }

/* Blocs repliables présentés comme des cartes */
.com-ajout { margin-bottom: 1rem; }
.com-ajout__titre { cursor: pointer; list-style: none; }
.com-ajout__titre::-webkit-details-marker { display: none; }
.com-ajout__titre::after { content: "+"; margin-left: auto; font-size: 1.2rem; font-weight: 600; color: var(--texte-faible); }
.com-ajout[open] > .com-ajout__titre::after { content: "−"; }
.com-ajout:not([open]) > .com-ajout__titre { border-bottom: 0; }
.com-formulaire-action { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 0 1rem; align-items: end; }
.com-formulaire-action__large { grid-column: 1 / -1; }
.com-plier > summary { cursor: pointer; font-weight: 600; font-size: 0.86rem; color: var(--bleu); margin-bottom: 0.4rem; }

/* Planning par semaine */
.com-semaines { display: grid; gap: 1rem; }
.com-semaine { background: var(--surface); border: 1px solid var(--bordure); border-radius: var(--rayon); box-shadow: var(--ombre-1); overflow: hidden; }
.com-semaine--courante { border-color: var(--orange); box-shadow: 0 0 0 3px rgba(222, 114, 47, 0.08), var(--ombre-1); }
.com-semaine--passee { opacity: 0.8; }
.com-semaine__entete { display: flex; align-items: center; gap: 0.6rem; padding: 0.75rem 1.1rem; border-bottom: 1px solid var(--bordure); background: var(--surface-2); }
.com-semaine__entete h2 { font-size: 1rem; }
.com-semaine__budget { margin-left: auto; font-weight: 650; font-variant-numeric: tabular-nums; color: var(--texte-doux); }
.com-actions { list-style: none; margin: 0; padding: 0; }
.com-action { display: flex; gap: 0.85rem; align-items: flex-start; padding: 0.8rem 1.1rem; }
.com-action + .com-action { border-top: 1px solid var(--bordure); }
.com-action form { margin: 0; }
.com-action > form { padding-top: 0.05rem; }
.com-action__corps { flex: 1; min-width: 0; }
.com-action__ligne { display: flex; align-items: center; flex-wrap: wrap; gap: 0.35rem 0.55rem; }
.com-action__jour { font-size: 0.8rem; color: var(--texte-faible); font-weight: 600; min-width: 5.2rem; text-transform: capitalize; }
.com-action__titre { font-weight: 650; }
.com-action__ia { font-size: 0.62rem; font-weight: 800; letter-spacing: 0.05em; padding: 0.05rem 0.35rem; border-radius: 5px; color: var(--bleu); background: #e8eff2; }
.com-action__details { margin: 0.25rem 0 0; font-size: 0.88rem; color: var(--texte-doux); }
.com-action__plus { margin-top: 0.35rem; }
.com-action__plus > summary { font-size: 0.78rem; font-weight: 600; color: var(--bleu); cursor: pointer; width: max-content; }
.com-action__plus[open] { padding: 0.75rem; margin-top: 0.5rem; border: 1px solid var(--bordure); border-radius: var(--rayon-sm); background: var(--surface-2); }
.com-action__plus .ligne { margin-top: 0.4rem; }
.com-action--fait .com-action__titre { text-decoration: line-through; text-decoration-color: var(--texte-faible); color: var(--texte-doux); }
.com-action--annule { opacity: 0.6; }
.com-action--retard { background: linear-gradient(90deg, var(--alerte-fond), transparent 45%); }

/* État de l'envoi */
.com-etat-envoi { display: flex; align-items: center; gap: 0.8rem; flex-wrap: wrap; padding: 0.8rem 1rem; margin-bottom: 1rem; border-radius: var(--rayon); border: 1px solid var(--bordure); background: var(--surface); box-shadow: var(--ombre-1); }
.com-etat-envoi__texte { flex: 1 1 20rem; min-width: 0; }
.com-etat-envoi__voyant { width: 12px; height: 12px; border-radius: 50%; flex: none; background: var(--texte-faible); box-shadow: 0 0 0 4px rgba(138, 147, 154, 0.18); }
.com-etat-envoi--actif .com-etat-envoi__voyant, .com-interrupteur--allume .com-etat-envoi__voyant { background: var(--succes); box-shadow: 0 0 0 4px rgba(74, 124, 89, 0.18); animation: com-pouls 2.4s ease-in-out infinite; }
.com-etat-envoi--a-regler .com-etat-envoi__voyant { background: var(--orange); box-shadow: 0 0 0 4px rgba(222, 114, 47, 0.18); }
@keyframes com-pouls { 50% { box-shadow: 0 0 0 7px rgba(74, 124, 89, 0.06); } }
.com-interrupteur { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; padding: 1rem 1.15rem; }
.com-interrupteur__etat { display: flex; align-items: center; gap: 0.85rem; min-width: 0; flex: 1 1 20rem; }
.com-interrupteur__etat h2 { font-size: 1.05rem; }
.com-interrupteur form { margin: 0; }

/* Prospection */
.com-grille-prospection { grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); align-items: start; }
.com-statuts a { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 0.6rem; padding: 0.5rem 0.65rem; border-radius: var(--rayon-sm); color: var(--texte); }
.com-statuts a:hover { background: var(--surface-2); text-decoration: none; }
.com-statuts strong { font-variant-numeric: tabular-nums; }
.com-statut { width: 10px; height: 10px; border-radius: 50%; background: var(--bordure-forte); }
.com-statut--contacte { background: var(--bleu-clair); }
.com-statut--a_repondu { background: var(--orange); }
.com-statut--interesse, .com-statut--converti { background: var(--succes); }
.com-statut--rebond { background: var(--danger); }
.com-statut--douteuse { background: var(--alerte); }
.com-regles__liste { margin: 0; padding: 1rem 1.15rem 1rem 2.2rem; display: grid; gap: 0.45rem; font-size: 0.88rem; color: var(--texte-doux); }
.com-fiche { display: grid; gap: 0.6rem; margin: 0; }
.com-fiche > div { display: grid; grid-template-columns: 8.5rem minmax(0, 1fr); gap: 0.75rem; }
.com-fiche dt { color: var(--texte-faible); font-size: 0.82rem; font-weight: 600; }
.com-fiche dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.com-indices { display: block; font-size: 0.84rem; color: var(--texte-doux); line-height: 1.5; }
.com-boutons-statut { display: grid; gap: 0.4rem; }
.com-boutons-statut form { margin: 0; }

/* Import */
.com-depot { position: relative; display: grid; justify-items: center; gap: 0.25rem; padding: 1.6rem 1rem; border: 2px dashed var(--bordure-forte); border-radius: var(--rayon); background: var(--surface-2); text-align: center; cursor: pointer; transition: border-color var(--transition), background var(--transition); }
.com-depot input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.com-depot:hover, .com-depot--survol { border-color: var(--bleu-clair); background: #f3f7f9; }
.com-depot--choisi { border-style: solid; border-color: var(--succes); background: var(--succes-fond); }
.com-depot__titre { font-weight: 700; color: var(--bleu); }
.com-depot__aide { font-size: 0.8rem; color: var(--texte-doux); }
.com-depot--petit { padding: 1rem; }
.com-depot--ligne { flex: 1 1 18rem; padding: 0.6rem 0.9rem; justify-items: start; text-align: left; }
.com-coller > summary { cursor: pointer; font-weight: 600; font-size: 0.86rem; color: var(--bleu); }
.com-colonnes { margin: 0; padding-left: 1.1rem; display: grid; gap: 0.3rem; }
.com-rejets { margin-top: 0.75rem; font-size: 0.85rem; }
.com-rejets summary { cursor: pointer; color: var(--texte-doux); }

/* Éditeur de campagne */
.com-editeur { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(320px, 1fr); gap: 1rem; align-items: start; }
.com-editeur__principal { display: grid; gap: 1rem; min-width: 0; }
.com-editeur__apercu { position: sticky; top: calc(var(--hauteur-entete) + 3.6rem); min-width: 0; }
.com-editeur__boutons { gap: 0.75rem; }
.com-numero { display: inline-grid; place-content: center; width: 26px; height: 26px; border-radius: 50%; background: var(--noir-doux); color: #fff; font-size: 0.8rem; font-weight: 750; flex: none; }
.com-options { display: grid; gap: 0.5rem; }
.com-options .champ { max-width: 22rem; margin-bottom: 0.25rem; }
.com-case { display: flex; align-items: flex-start; gap: 0.5rem; font-size: 0.9rem; cursor: pointer; }
.com-case input { margin-top: 0.2rem; }
.com-compte { margin: 0; padding: 0.7rem 0.9rem; border-radius: var(--rayon-sm); background: #eef3f5; color: var(--bleu-fonce); font-weight: 650; }
.com-compte--vide { background: var(--alerte-fond); color: var(--alerte); }
.com-redaction { padding: 0.9rem 1rem; border: 1px solid #d9e3e8; border-radius: var(--rayon); background: linear-gradient(135deg, #f5f9fa, #fff); display: grid; gap: 0.6rem; }
.com-redaction__entete { display: flex; align-items: center; gap: 0.6rem; }
.com-redaction .champ { margin: 0; }
.com-redaction__etat--travail { color: var(--bleu); font-weight: 600; }
.com-redaction__etat--travail::before { content: ""; display: inline-block; vertical-align: -2px; width: 12px; height: 12px; margin-right: 0.4rem; border-radius: 50%; border: 2px solid #d9e3e8; border-top-color: var(--bleu); animation: com-tourne 0.9s linear infinite; }
.com-redaction__etat--fait { color: var(--succes); font-weight: 600; }
.com-redaction__etat--erreur { color: var(--danger); font-weight: 600; }
.com-variables { display: flex; flex-wrap: wrap; align-items: center; gap: 0.35rem; }
.com-variable { border: 1px dashed var(--bordure-forte); background: var(--surface); border-radius: 999px; padding: 0.22rem 0.65rem; font: inherit; font-size: 0.78rem; font-weight: 600; color: var(--bleu); cursor: pointer; }
.com-variable:hover { border-style: solid; border-color: var(--bleu-clair); background: #f3f7f9; }
.com-etape { margin: 0; padding: 0.9rem 1rem 0.2rem; border: 1px solid var(--bordure); border-radius: var(--rayon); background: var(--surface-2); }
.com-etape__titre { font-size: 0.95rem; font-weight: 700; padding: 0 0.35rem; color: var(--texte); }
.com-etape__delai { display: flex; align-items: center; flex-wrap: wrap; gap: 0.45rem; margin-bottom: 0.7rem; font-size: 0.86rem; color: var(--texte-doux); }
.com-etape__delai input { width: 4.2rem; }
.com-etape textarea { font-family: var(--police); line-height: 1.55; }

/* Aperçu d'un e-mail */
.com-apercu .carte__entete { flex-wrap: wrap; }
.com-apercu__onglets { display: flex; gap: 0.2rem; margin-left: auto; padding: 0.2rem; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--bordure); }
.com-apercu__onglet { border: 0; background: none; padding: 0.25rem 0.65rem; border-radius: 999px; font: inherit; font-size: 0.78rem; font-weight: 650; color: var(--texte-doux); cursor: pointer; }
.com-apercu__onglet--actif { background: var(--surface); color: var(--texte); box-shadow: var(--ombre-1); }
.com-apercu__courrier { padding: 1rem 1.15rem 1.25rem; }
.com-apercu__entetes { display: grid; gap: 0.35rem; padding-bottom: 0.75rem; margin-bottom: 0.9rem; border-bottom: 1px solid var(--bordure); font-size: 0.88rem; }
.com-apercu__entetes div { display: grid; grid-template-columns: 3.5rem minmax(0, 1fr); gap: 0.5rem; }
.com-apercu__entetes span { color: var(--texte-faible); }
.com-apercu__entetes strong { min-width: 0; overflow-wrap: anywhere; }
.com-apercu__texte { font-family: Arial, Helvetica, sans-serif; font-size: 0.93rem; line-height: 1.6; color: #22303a; max-height: 70vh; overflow: auto; }
.com-apercu__texte p { margin: 0 0 0.85rem; }
.com-apercu__pied { font-size: 0.78rem; color: var(--texte-faible); }
.com-texte-mail { white-space: pre-wrap; overflow-wrap: anywhere; font-family: Arial, Helvetica, sans-serif; font-size: 0.92rem; line-height: 1.6; }

/* Détail d'une campagne */
.com-sequence { list-style: none; margin: 0; padding: 0.5rem 1.15rem 1rem; }
.com-sequence__etape { position: relative; display: flex; gap: 0.85rem; padding: 0.75rem 0; }
.com-sequence__etape + .com-sequence__etape::before { content: ""; position: absolute; left: 13px; top: -0.75rem; height: 1.5rem; width: 2px; background: var(--bordure); }
.com-sequence__rang { display: inline-grid; place-content: center; width: 28px; height: 28px; border-radius: 50%; background: var(--bleu); color: #fff; font-weight: 750; font-size: 0.82rem; flex: none; position: relative; }
.com-sequence__texte { display: grid; gap: 0.2rem; min-width: 0; flex: 1; }
.com-sequence__corps > summary { font-size: 0.78rem; font-weight: 600; color: var(--bleu); cursor: pointer; width: max-content; }
.com-sequence__corps .com-texte-mail { margin-top: 0.5rem; padding: 0.75rem; border-radius: var(--rayon-sm); background: var(--surface-2); border: 1px solid var(--bordure); }

/* Réglages */
.com-dns ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.5rem; }
.com-dns__ligne, .com-verif { display: grid; grid-template-columns: 6.5rem minmax(0, 1fr); gap: 0.6rem; align-items: start; }
.com-dns__ligne div, .com-verif div { display: grid; gap: 0.1rem; min-width: 0; overflow-wrap: anywhere; }
.com-guide__etapes { margin: 0; padding: 1rem 1.15rem 1rem 2.4rem; display: grid; gap: 0.6rem; font-size: 0.88rem; color: var(--texte-doux); }
.com-guide__etapes strong { color: var(--texte); }

/* Publicité */
.com-periode select { min-width: 12rem; }
.com-menu { position: relative; display: inline-block; text-align: left; }
.com-menu > summary { list-style: none; }
.com-menu > summary::-webkit-details-marker { display: none; }
.com-menu__panneau { position: absolute; right: 0; top: calc(100% + 6px); z-index: 30; width: min(380px, 86vw); padding: 1rem; background: var(--surface); border: 1px solid var(--bordure); border-radius: var(--rayon); box-shadow: var(--ombre-3); }
.com-depense { flex-wrap: wrap; }
.com-depense select, .com-depense input { flex: 1 1 9rem; min-width: 0; }
.com-budget { width: 9rem; }
.com-utm__resultat { display: flex; align-items: center; gap: 0.6rem; padding: 0.6rem 0.75rem; border-radius: var(--rayon-sm); background: var(--surface-2); border: 1px solid var(--bordure); }
.com-utm__resultat code { flex: 1; min-width: 0; font-size: 0.8rem; overflow-wrap: anywhere; color: var(--bleu-fonce); }
.com-case-visibilite { display: flex; gap: 0.75rem; align-items: flex-start; padding: 0.65rem 0.65rem; }
.com-case-visibilite + .com-case-visibilite { border-top: 1px solid var(--bordure); }
.com-case-visibilite form { margin: 0; }
.com-case-visibilite__texte { display: grid; gap: 0.15rem; min-width: 0; flex: 1; }
.com-case-visibilite--faite .com-case-visibilite__texte > span:first-child { color: var(--texte-doux); }
.com-case-visibilite__liens { display: flex; gap: 0.75rem; flex-wrap: wrap; }
.com-case-visibilite__lien summary { cursor: pointer; color: var(--bleu); width: max-content; }
.com-case-visibilite__lien form { margin-top: 0.35rem; }
.com-case-visibilite__lien input { flex: 1 1 14rem; min-width: 0; }

/* Référencement */
.com-sante { grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); align-items: start; }
.com-sante__score .carte__corps { display: flex; align-items: center; gap: 1.25rem; flex-wrap: wrap; }
.com-sante__texte { flex: 1 1 14rem; min-width: 0; }
.com-verifs { list-style: none; margin: 0; padding: 0.9rem 1.15rem; display: grid; gap: 0.65rem; }
.com-problemes { list-style: none; margin: 0; padding: 0; }
.com-probleme { padding: 0.85rem 1.15rem; border-left: 4px solid var(--info); }
.com-probleme + .com-probleme { border-top: 1px solid var(--bordure); }
.com-probleme--critique { border-left-color: var(--danger); }
.com-probleme--important { border-left-color: var(--alerte); }
.com-probleme__entete { display: flex; align-items: center; flex-wrap: wrap; gap: 0.5rem; }
.com-probleme__conseil { margin: 0.3rem 0 0; color: var(--texte-doux); font-size: 0.9rem; max-width: 80ch; }
.com-probleme__pages { margin-top: 0.35rem; font-size: 0.82rem; }
.com-probleme__pages summary { cursor: pointer; color: var(--bleu); width: max-content; }
.com-probleme__pages ul { margin: 0.35rem 0 0; padding-left: 1.1rem; overflow-wrap: anywhere; }
.com-gsc { display: grid; gap: 1rem; }
.com-gsc__totaux { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 0.75rem; }
.com-gsc__totaux div { display: grid; padding: 0.75rem 0.9rem; border-radius: var(--rayon-sm); background: var(--surface-2); border: 1px solid var(--bordure); }
.com-gsc__totaux strong { font-size: 1.4rem; font-variant-numeric: tabular-nums; }
.com-gsc__totaux span { font-size: 0.8rem; color: var(--texte-doux); }
.com-gsc__opportunites { padding: 0.85rem 1rem; border-radius: var(--rayon-sm); background: #fdf4ee; border: 1px solid #f3d7c4; }
.com-gsc__opportunites h3 { color: var(--orange-fonce); margin-bottom: 0.25rem; }
.com-gsc__opportunites ul { margin: 0.4rem 0 0; padding-left: 1.1rem; display: grid; gap: 0.2rem; }
.com-gsc__import { flex-wrap: wrap; }
.com-evolution { display: inline-block; margin-left: 0.35rem; font-size: 0.72rem; font-weight: 700; }
.com-evolution--hausse { color: var(--succes); }
.com-evolution--baisse { color: var(--danger); }
.com-avis { display: grid; gap: 0.35rem; }
.com-avis input { flex: 1 1 16rem; min-width: 0; }

/* Référencement géré d'ici : corrections en un clic, aperçu Google page par page, historique. */
.com-gerer { grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); align-items: start; }
.com-corrections { list-style: none; margin: 0; padding: 0.2rem 0; }
.com-correction { display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; padding: 0.75rem 1.15rem; border-top: 1px solid var(--bordure); }
.com-correction:first-child { border-top: 0; }
.com-correction__choix { display: flex; align-items: flex-start; gap: 0.7rem; min-width: 0; cursor: pointer; }
.com-correction__choix input { flex: none; width: 1.1rem; height: 1.1rem; margin: 0.15rem 0 0; accent-color: var(--orange); }
.com-correction__texte { display: flex; flex-direction: column; gap: 0.15rem; min-width: 0; }
.com-correction--ok .com-correction__choix { cursor: default; }
.com-correction--ok .com-correction__texte strong { color: var(--texte-doux); font-weight: 600; }
.com-gerer__pied { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem 1rem; }
.com-verification { display: grid; gap: 0.75rem; align-content: start; }
.com-verification p { margin: 0; }
.com-verification .champ { margin: 0; }
.com-verification .bouton { justify-self: start; }

.com-proposition-seo { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 0.75rem 1rem; border-bottom: 1px solid var(--bordure); }
.com-proposition-seo > div { display: flex; flex-direction: column; gap: 0.25rem; flex: 1 1 20rem; min-width: 0; }
.com-proposition-seo--attente { align-items: center; justify-content: flex-start; background: #fff8f2; }
.com-proposition-seo--prete { background: linear-gradient(135deg, #fff6ee, #fff 70%); }
.com-proposition-seo__conseils { margin: 0.45rem 0 0; padding-left: 1.1rem; display: grid; gap: 0.2rem; font-size: 0.88rem; color: var(--texte-doux); }

.com-pages-seo__aide { margin: 0; padding-bottom: 0.3rem; }
.com-pages-seo__liste { display: grid; grid-template-columns: minmax(0, 1fr); gap: 0.6rem; padding: 0.3rem 1.15rem 1.15rem; }
.com-page-seo { min-width: 0; border: 1px solid var(--bordure); border-radius: var(--rayon); background: var(--surface); transition: border-color var(--transition), box-shadow var(--transition); }
.com-page-seo[open] { box-shadow: 0 12px 30px -22px rgba(27, 42, 51, 0.5); }
.com-page-seo--proposee { border-color: rgba(222, 114, 47, 0.55); box-shadow: 0 0 0 3px rgba(222, 114, 47, 0.12); }
.com-page-seo__resume { display: flex; align-items: center; gap: 0.75rem; min-width: 0; min-height: 52px; padding: 0.7rem 1rem; cursor: pointer; list-style: none; }
.com-page-seo__resume::-webkit-details-marker { display: none; }
.com-page-seo__resume::after { content: ""; flex: none; width: 8px; height: 8px; margin-left: auto; border-right: 2px solid var(--texte-faible); border-bottom: 2px solid var(--texte-faible); transform: rotate(45deg); transition: transform var(--transition); }
.com-page-seo[open] > .com-page-seo__resume::after { transform: rotate(-135deg); }
.com-page-seo__nom { flex: none; min-width: 10rem; font-weight: 700; }
.com-page-seo__actuel { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--texte-doux); font-size: 0.9rem; }
.com-page-seo__corps { display: grid; grid-template-columns: minmax(0, 1fr); gap: 0.9rem; padding: 0 1rem 1rem; }
.com-page-seo__champs { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 0.75rem 1rem; }
.com-page-seo__champs .champ { margin: 0; }
.com-page-seo__champs textarea { resize: vertical; }
.com-page-seo__pourquoi { margin: 0; padding: 0.55rem 0.8rem; border-radius: var(--rayon-sm); background: #fff3ea; font-size: 0.88rem; }
.com-page-seo__plus > summary { width: max-content; max-width: 100%; margin-bottom: 0.6rem; cursor: pointer; font-size: 0.88rem; font-weight: 600; color: var(--bleu); }
.com-compteur { margin-left: 0.4rem; font-size: 0.78rem; font-weight: 500; color: var(--texte-faible); font-variant-numeric: tabular-nums; }
.com-compteur--court { color: var(--alerte); }
.com-compteur--long { color: var(--danger); font-weight: 700; }

/* L'aperçu Google : la police et les couleurs du vrai, pour juger d'un coup d'œil. */
.com-serp { display: grid; grid-template-columns: minmax(0, 1fr); gap: 0.2rem; max-width: 640px; padding: 0.9rem 1rem; border: 1px solid var(--bordure); border-radius: var(--rayon-sm); background: #fff; font-family: Arial, Helvetica, sans-serif; }
.com-serp__site { display: flex; align-items: center; gap: 0.6rem; min-width: 0; font-size: 0.82rem; color: #202124; }
.com-serp__site > span:last-child { display: flex; flex-direction: column; min-width: 0; line-height: 1.3; }
.com-serp__site strong { font-weight: 400; }
.com-serp__url { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #4d5156; font-size: 0.75rem; }
.com-serp__favicon { display: grid; place-items: center; flex: none; width: 26px; height: 26px; border-radius: 50%; background: #f1f3f4; color: var(--bleu); font-size: 0.8rem; font-weight: 700; }
.com-serp__titre { margin-top: 0.25rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #1a0dab; font-size: 1.25rem; line-height: 1.3; }
.com-serp__description { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; color: #4d5156; font-size: 0.875rem; line-height: 1.55; }

.com-historique-seo { list-style: none; margin: 0; padding: 0 0 0.4rem; }
.com-historique-seo__ligne { display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; padding: 0.7rem 1.15rem; border-top: 1px solid var(--bordure); }
.com-historique-seo__ligne > div { display: flex; flex-direction: column; gap: 0.15rem; min-width: 0; }
.com-historique-seo__ligne--annulee strong { color: var(--texte-faible); font-weight: 600; text-decoration: line-through; }

@media (max-width: 900px) {
  .com-gerer { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 700px) {
  .com-page-seo__champs { grid-template-columns: minmax(0, 1fr); }
  .com-page-seo__resume { flex-wrap: wrap; gap: 0.2rem 0.6rem; }
  .com-page-seo__nom { min-width: 0; }
  .com-page-seo__actuel { order: 3; flex-basis: 100%; }
  .com-pages-seo__liste { padding: 0.3rem 0.75rem 0.9rem; }
  .com-correction, .com-historique-seo__ligne { padding: 0.7rem 0.85rem; }
  .com-serp__titre { white-space: normal; font-size: 1.1rem; }
}

@media (max-width: 1100px) {
  .com-editeur { grid-template-columns: minmax(0, 1fr); }
  .com-editeur__apercu { position: static; }
  .com-grille-prospection, .com-sante { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 700px) {
  .com-barres { gap: 3px; height: 120px; }
  .com-barres__libelle { font-size: 0.58rem; }
  .com-barres__jour:nth-child(odd) .com-barres__libelle { visibility: hidden; }
  .com-proposee__case { grid-template-columns: auto minmax(0, 1fr); }
  .com-proposee__date, .com-proposee__case .com-canal { grid-column: 2; justify-self: start; }
  .com-proposee__texte { grid-column: 2; }
  .com-fiche > div { grid-template-columns: minmax(0, 1fr); gap: 0.1rem; }
  .com-action { padding: 0.75rem 0.85rem; }
  .com-action__jour { min-width: 0; }
  .com-dns__ligne, .com-verif { grid-template-columns: minmax(0, 1fr); }
}
@media (prefers-reduced-motion: reduce) {
  .com-barres__barre, .com-etat-envoi__voyant, .com-attente__roue, .com-redaction__etat--travail::before, .com-bouton-occupe::before { animation: none !important; }
  a.com-indicateur:hover { transform: none; }
}

/* ------------------------------------------ qualité et travaux retirés (tâches) */
/* Une non-conformité sous sa tâche : constat, action corrective, photos du défaut et de la reprise. */
.nc-tache { position: relative; display: grid; gap: 0.35rem; max-width: 640px; margin: 0.55rem 0 0.2rem; padding: 0.7rem 0.85rem 0.75rem 1rem; border: 1px solid #f1d3bf; border-left: 4px solid var(--orange); border-radius: 12px; background: #fff8f3; scroll-margin-top: calc(var(--hauteur-entete) + 1rem); }
.nc-tache--corrigee { border-color: var(--bordure); border-left-color: var(--succes); background: var(--surface); }
.nc-tache__entete { display: flex; flex-wrap: wrap; align-items: center; gap: 0.35rem 0.5rem; }
.nc-tache__icone { display: inline-grid; place-items: center; color: var(--orange-fonce); }
.nc-tache--corrigee .nc-tache__icone { color: var(--succes); }
.nc-tache__titre { font-size: 0.86rem; }
.nc-tache__visibilite { display: inline-flex; align-items: center; gap: 0.25rem; margin-left: auto; font-size: 0.74rem; font-weight: 600; color: var(--texte-faible); }
.nc-tache__visibilite--client { color: var(--succes); }
.nc-tache__constat { margin: 0; font-weight: 600; overflow-wrap: anywhere; }
.nc-tache__action { margin: 0; font-size: 0.88rem; overflow-wrap: anywhere; }
.nc-tache__action span { display: block; font-size: 0.68rem; font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase; color: var(--succes); }
.nc-tache__dates { margin: 0; }
.nc-tache__photos { margin-top: 0.1rem; }
.nc-tache__photos .tache-chantier__photo { position: relative; }
.nc-tache__boutons { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-top: 0.15rem; }
.nc-tache .panneau-tache { margin-top: 0.3rem; background: var(--surface); }
.panneau-nc__titre { display: flex; align-items: center; gap: 0.45rem; margin: 0; font-weight: 750; color: var(--orange-fonce); }
.panneau-nc textarea { width: 100%; }
.panneau-nc .champ { margin: 0; }
.panneau-nc .champ input[type="date"] { max-width: 12rem; }

/* Travaux retirés du devis (moins-value), sous la tâche. */
.retrait-tache { display: flex; flex-wrap: wrap; align-items: center; gap: 0.3rem 0.6rem; max-width: 640px; margin: 0.5rem 0 0.2rem; padding: 0.55rem 0.8rem; border: 1px dashed var(--bordure-forte); border-radius: 12px; background: var(--surface-2); font-size: 0.86rem; }
.retrait-tache__badge { display: inline-flex; align-items: center; gap: 0.3rem; padding: 0.12rem 0.55rem; border-radius: 999px; background: var(--noir-doux); color: #fff; font-size: 0.72rem; font-weight: 750; white-space: nowrap; }
.retrait-tache__texte { min-width: 0; }
.retrait-tache__motif { flex-basis: 100%; font-size: 0.82rem; font-style: italic; color: var(--texte-doux); overflow-wrap: anywhere; }
.retrait-tache form { margin: 0 0 0 auto; }
.tache-chantier--non_realisee .tache-chantier__titre { color: var(--texte-faible); text-decoration: line-through; text-decoration-style: dashed; text-decoration-color: rgba(0, 0, 0, 0.3); }
.tache-chantier--non_realisee .tache-chantier__etat { background: var(--texte-faible); border-color: var(--texte-faible); }

/* Sous-traitant montré au client (l'œil le signale). */
.sous-traitant-tache--client { background: var(--succes-fond); color: var(--succes); }

/* Fenêtre « Confier » : ce que le client en verra. */
.confier-client { display: grid; gap: 0.55rem; min-width: 0; margin: 0; padding: 0.7rem 0.85rem 0.8rem; border: 1px solid var(--bordure); border-radius: var(--rayon-sm); background: var(--surface-2); }
.confier-client legend { padding: 0 0.3rem; }
.confier-client .interrupteur { font-size: 0.88rem; }

/* L'écran « Ne sera pas réalisée ». */
.retrait-ligne__designation { margin: 0 0 0.7rem; font-size: 1.05rem; font-weight: 700; overflow-wrap: anywhere; }
.retrait-ligne__chiffres { display: grid; grid-template-columns: repeat(auto-fit, minmax(9rem, 1fr)); gap: 0.5rem; margin: 0; }
.retrait-ligne__chiffres div { min-width: 0; padding: 0.5rem 0.65rem; border-radius: var(--rayon-sm); background: var(--surface-2); }
.retrait-ligne__chiffres dt { font-size: 0.7rem; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; color: var(--texte-faible); }
.retrait-ligne__chiffres dd { margin: 0.1rem 0 0; font-weight: 700; font-variant-numeric: tabular-nums; }
.retrait-ligne__resultat { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.35rem; margin: 1rem 0; padding: 0.85rem 1rem; border-radius: 12px; background: var(--succes-fond); color: var(--succes); }
.retrait-ligne__resultat strong { font-size: 1.35rem; font-weight: 800; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
[data-retrait] .choix-envoi__groupe { margin-bottom: 0.9rem; }

/* « Facturer » : les travaux retirés des devis, déduits. */
.retraits-facturer__liste,
.liste-simple { margin: 0; padding: 0; list-style: none; }
.retraits-facturer__liste li { display: flex; justify-content: space-between; gap: 1rem; padding: 0.65rem 1rem; border-top: 1px solid var(--bordure); }
.retraits-facturer__liste li:first-child,
.liste-simple li:first-child { border-top: 0; }
.retraits-facturer__liste li > span:first-child { min-width: 0; overflow-wrap: anywhere; }
.retraits-facturer__montant { flex: none; font-weight: 750; text-align: right; font-variant-numeric: tabular-nums; }
.liste-simple li { padding: 0.55rem 1rem; border-top: 1px solid var(--bordure); overflow-wrap: anywhere; }
/* ------------------------------------------------ messagerie de la fiche client */
.messagerie { overflow: hidden; margin-bottom: 1.25rem; scroll-margin-top: calc(var(--hauteur-entete) + 1rem); }
.messagerie__entete { flex-wrap: wrap; gap: 0.5rem; }
.messagerie__entete h2 { display: inline-flex; align-items: center; gap: 0.5rem; }
.messagerie__nouveaux { padding: 0.1rem 0.55rem; border-radius: 999px; background: var(--orange); color: #fff; font-size: 0.72rem; font-weight: 750; }
.messagerie__outils { display: flex; flex-wrap: wrap; align-items: center; gap: 0.4rem; }
.messagerie__actualiser { margin: 0; }
.messagerie__filtres { display: inline-flex; padding: 0.18rem; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--bordure); }
.messagerie__filtres button { padding: 0.25rem 0.7rem; border: 0; border-radius: 999px; background: none; color: var(--texte-doux); font: inherit; font-size: 0.8rem; font-weight: 650; cursor: pointer; }
.messagerie__filtres button[aria-pressed="true"] { background: var(--surface); color: var(--texte); box-shadow: 0 1px 3px rgba(31, 45, 54, 0.12); }
.messagerie__fil { display: flex; flex-direction: column; gap: 0.55rem; max-height: min(560px, 62vh); overflow-y: auto; padding: 0.9rem 1rem 1rem; background: var(--surface-2); border-top: 1px solid var(--bordure); border-bottom: 1px solid var(--bordure); overscroll-behavior: contain; }
.messagerie__vide { margin: 0; padding: 0.9rem 1rem; color: var(--texte-faible); font-size: 0.88rem; }
.messagerie__fil .messagerie__vide { padding: 0.4rem 0; text-align: center; }
.messagerie__jour { display: flex; align-items: center; gap: 0.6rem; margin: 0.4rem 0 0.1rem; color: var(--texte-faible); font-size: 0.72rem; font-weight: 700; letter-spacing: 0.03em; text-transform: uppercase; }
.messagerie__jour::before, .messagerie__jour::after { content: ""; flex: 1; height: 1px; background: var(--bordure); }
[data-filtre="recu"] .mail:not([data-sens="recu"]), [data-filtre="envoye"] .mail:not([data-sens="envoye"]) { display: none; }
[data-filtre="recu"] .messagerie__jour, [data-filtre="envoye"] .messagerie__jour { display: none; }

.mail { position: relative; max-width: min(88%, 620px); padding: 0.6rem 0.8rem 0.55rem; border: 1px solid var(--bordure); border-radius: 14px 14px 14px 4px; background: var(--surface); box-shadow: 0 1px 2px rgba(31, 45, 54, 0.05); align-self: flex-start; }
.mail--envoye, .mail--envoye_ailleurs { align-self: flex-end; border-radius: 14px 14px 4px 14px; background: #fff6ef; border-color: #f1d8c6; }
.mail--auto { background: var(--surface); border-style: dashed; border-color: var(--bordure-forte); }
.mail--nouveau { border-color: var(--orange); box-shadow: 0 0 0 3px rgba(222, 114, 47, 0.14); }
.mail__entete { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.15rem 0.5rem; margin-bottom: 0.15rem; font-size: 0.76rem; color: var(--texte-faible); }
.mail__auteur { font-weight: 750; color: var(--texte); }
.mail__etiquette { padding: 0 0.45rem; border-radius: 999px; background: var(--fond); color: var(--texte-doux); font-size: 0.68rem; font-weight: 700; }
.mail__badge { padding: 0 0.45rem; border-radius: 999px; background: var(--orange); color: #fff; font-size: 0.66rem; font-weight: 750; }
.mail__heure { margin-left: auto; font-variant-numeric: tabular-nums; }
.mail__objet { margin: 0 0 0.25rem; font-weight: 700; font-size: 0.9rem; overflow-wrap: anywhere; }
.mail__texte { max-height: 12.5em; overflow: hidden; font-size: 0.88rem; line-height: 1.5; white-space: pre-wrap; overflow-wrap: anywhere; color: var(--texte); }
.mail--auto .mail__texte { max-height: 4.6em; color: var(--texte-doux); }
.mail--long:not(.mail--deplie) .mail__texte[data-mail-texte] { -webkit-mask-image: linear-gradient(180deg, #000 70%, transparent); mask-image: linear-gradient(180deg, #000 70%, transparent); }
.mail--deplie .mail__texte { max-height: none; }
.mail__deplier { margin-top: 0.15rem; padding: 0; border: 0; background: none; color: var(--bleu); font: inherit; font-size: 0.78rem; font-weight: 700; cursor: pointer; }
.mail__historique { margin-top: 0.35rem; font-size: 0.8rem; }
.mail__historique summary { cursor: pointer; color: var(--texte-faible); font-weight: 650; }
.mail__texte--cite { max-height: none; margin-top: 0.3rem; padding-left: 0.6rem; border-left: 2px solid var(--bordure-forte); color: var(--texte-doux); font-size: 0.82rem; }
.mail__pieces { display: flex; flex-wrap: wrap; gap: 0.3rem; margin: 0.4rem 0 0; padding: 0; list-style: none; }
.mail__pieces a, .mail__pieces span { display: inline-flex; align-items: center; gap: 0.3rem; padding: 0.18rem 0.6rem; border: 1px solid var(--bordure); border-radius: 999px; background: var(--surface); color: var(--bleu); font-size: 0.78rem; font-weight: 650; text-decoration: none; }
.mail__pieces small { color: var(--texte-faible); font-weight: 500; }
.mail__ignorees { margin: 0.35rem 0 0; font-size: 0.76rem; color: var(--alerte); }
.mail__pied { display: flex; flex-wrap: wrap; align-items: center; gap: 0.3rem 0.6rem; margin-top: 0.4rem; font-size: 0.75rem; color: var(--texte-faible); }
.mail__statut { padding: 0.05rem 0.5rem; border-radius: 999px; font-weight: 700; background: var(--fond); }
.mail__statut--succes { background: var(--succes-fond); color: var(--succes); }
.mail__statut--alerte { background: var(--alerte-fond); color: var(--alerte); }
.mail__statut--danger { background: #f8e4de; color: var(--danger); }
.mail__repondre { display: inline-flex; align-items: center; gap: 0.3rem; margin-left: auto; padding: 0.2rem 0.65rem; border: 1px solid var(--bordure); border-radius: 999px; background: var(--surface); color: var(--bleu); font: inherit; font-size: 0.78rem; font-weight: 700; cursor: pointer; }
.mail__repondre:hover { border-color: var(--bleu); }

.messagerie__ecrire { display: grid; gap: 0.5rem; padding: 0.85rem 1rem 0.9rem; }
.messagerie__a { display: flex; flex-wrap: wrap; align-items: center; gap: 0.4rem 0.6rem; font-size: 0.88rem; }
.messagerie__a label { font-weight: 700; color: var(--texte-doux); }
.messagerie__a select { flex: 1; width: auto; min-width: 0; cursor: pointer; }
.messagerie__ecrire input[type="text"], .messagerie__ecrire textarea, .messagerie__a select {
  width: 100%;
  padding: 0.5rem 0.7rem;
  border: 1px solid var(--bordure-forte);
  border-radius: var(--rayon-sm);
  font: inherit;
  font-size: 0.9rem;
  color: var(--texte);
  background: var(--surface);
  transition: border-color var(--transition), box-shadow var(--transition);
}
.messagerie__ecrire textarea { min-height: 96px; resize: vertical; line-height: 1.55; }
.messagerie__ecrire input[type="text"]:focus, .messagerie__ecrire textarea:focus, .messagerie__a select:focus {
  outline: none;
  border-color: var(--bleu);
  box-shadow: 0 0 0 3px rgba(54, 91, 109, 0.14);
}
.messagerie__reponse { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; margin: 0; padding: 0.35rem 0.6rem; border-radius: 8px; background: var(--info-fond); color: var(--info); font-size: 0.82rem; font-weight: 650; }
.messagerie__reponse[hidden] { display: none; }
.messagerie__reponse-annuler { padding: 0 0.4rem; border: 0; background: none; color: inherit; font-size: 1.1rem; line-height: 1; cursor: pointer; }
.messagerie__bas { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; }
.messagerie__bas .bouton--primaire { margin-left: auto; }
.messagerie__joindre { cursor: pointer; }
.messagerie__pieces-choisies { min-width: 0; font-size: 0.78rem; color: var(--texte-doux); overflow-wrap: anywhere; }
.messagerie__note { margin: 0; font-size: 0.76rem; color: var(--texte-faible); line-height: 1.45; }
@media (max-width: 700px) {
  .mail { max-width: 94%; }
  .messagerie__fil { max-height: 70vh; padding: 0.7rem; }
}

/* --- échéances : une seule liste pour tout ce qui a une date --- */
.texte-centre { text-align: center; }
.indicateur--danger { border-left: 3px solid var(--danger); }
.indicateur--danger .indicateur__valeur { color: var(--danger); }
a.indicateur--lien { display: block; color: inherit; text-decoration: none; transition: border-color var(--transition), box-shadow var(--transition); }
a.indicateur--lien:hover { border-color: var(--bordure-forte); box-shadow: var(--ombre-2); }
.echeances-bilan { margin-bottom: 1rem; }
.echeances-filtres { display: flex; flex-wrap: wrap; gap: 0.4rem; margin: 0 0 1rem; }
.puce-filtre__nombre { display: inline-grid; place-items: center; min-width: 1.25rem; height: 1.25rem; padding: 0 0.3rem; border-radius: 999px; background: var(--orange); color: #fff; font-size: 0.68rem; }
.puce-filtre--active .puce-filtre__nombre { background: #fff; color: var(--noir-doux); }
.echeances-carte { overflow: visible; }
.echeances-groupe + .echeances-groupe { border-top: 1px solid var(--bordure); }
.echeances-groupe__titre { display: flex; align-items: center; gap: 0.5rem; padding: 0.85rem 1.15rem; font-weight: 700; font-size: 0.95rem; cursor: pointer; list-style: none; }
.echeances-groupe__titre::-webkit-details-marker { display: none; }
.echeances-groupe__titre::before { content: ""; width: 0.45rem; height: 0.45rem; border-right: 2px solid var(--texte-faible); border-bottom: 2px solid var(--texte-faible); transform: rotate(-45deg); transition: transform var(--transition); }
.echeances-groupe[open] > .echeances-groupe__titre::before { transform: rotate(45deg); }
.echeances-groupe__nombre { padding: 0.05rem 0.5rem; border-radius: 999px; background: var(--fond); color: var(--texte-doux); font-size: 0.75rem; font-weight: 650; }
.echeances-groupe__note { margin: -0.4rem 1.15rem 0.6rem 2.1rem; }
.echeances { margin: 0; padding: 0; list-style: none; }
.echeance { display: grid; grid-template-columns: auto minmax(0, 1fr) auto auto; align-items: center; gap: 0.35rem 0.9rem; padding: 0.7rem 1.15rem; border-top: 1px solid var(--bordure); }
.echeances--fiche .echeance:first-child { border-top: 0; }
.echeance__point { width: 0.6rem; height: 0.6rem; border-radius: 50%; background: var(--succes); }
.echeance--retard .echeance__point { background: var(--danger); box-shadow: 0 0 0 4px var(--danger-fond); }
.echeance--bientot .echeance__point { background: var(--orange); }
.echeance--a_renseigner .echeance__point { background: transparent; border: 2px solid var(--info); }
.echeance__texte { display: flex; flex-direction: column; gap: 0.1rem; min-width: 0; }
.echeance__titre { font-weight: 650; color: var(--texte); text-decoration: none; overflow-wrap: anywhere; }
a.echeance__titre:hover { color: var(--bleu); text-decoration: underline; }
.echeance__sujet { font-size: 0.85rem; color: var(--texte-doux); overflow-wrap: anywhere; }
.echeance__detail { font-size: 0.78rem; color: var(--texte-faible); overflow-wrap: anywhere; }
.echeance__quand { display: flex; flex-direction: column; align-items: flex-end; gap: 0.2rem; text-align: right; }
.echeance__date { font-size: 0.78rem; color: var(--texte-faible); white-space: nowrap; }
.echeance__action { display: flex; justify-content: flex-end; min-width: 0; }
.fait { position: relative; }
.fait > summary { list-style: none; cursor: pointer; white-space: nowrap; }
.fait > summary::-webkit-details-marker { display: none; }
.fait[open] > summary { background: var(--fond); }
.fait__panneau { position: absolute; z-index: 40; right: 0; top: calc(100% + 6px); width: min(20rem, 86vw); display: flex; flex-direction: column; gap: 0.1rem; padding: 0.9rem; border: 1px solid var(--bordure); border-radius: 12px; background: var(--surface); box-shadow: var(--ombre-3); text-align: left; }
.fait__panneau .champ { margin-bottom: 0.55rem; }
.fait__suite { margin: 0 0 0.6rem; }
.periodicite { display: flex; align-items: center; gap: 0.5rem; }
.periodicite input { max-width: 9rem; }
.periodicite__unite { color: var(--texte-doux); font-size: 0.9rem; }
.periodicite__raccourcis { display: flex; flex-wrap: wrap; gap: 0.35rem; margin-top: 0.45rem; }
.echeance-calcul { margin: -0.2rem 0 0.8rem; padding: 0.45rem 0.7rem; border-radius: 8px; background: var(--info-fond); color: var(--info); font-weight: 600; }
.echeance-calcul[hidden] { display: none; }
.echeance-resume { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0.75rem; margin: 0; }
.echeance-resume dt { font-size: 0.72rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; color: var(--texte-faible); }
.echeance-resume dd { margin: 0.15rem 0 0; font-weight: 600; }
.pieces-echeance { margin: 0 0 0.75rem; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 0.35rem; }
.pieces-echeance li { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.5rem; overflow-wrap: anywhere; }
.pieces-echeance__retirer { display: inline; margin-left: auto; }
.lien-bouton { padding: 0; border: 0; background: none; color: var(--texte-faible); font: inherit; font-size: 0.8rem; text-decoration: underline; cursor: pointer; }
.lien-bouton:hover { color: var(--danger); }
.ajout-pieces .ligne { flex-wrap: wrap; }
.ajout-pieces input[type="file"] { flex: 1; min-width: 0; }
.ajout-rapide { border-top: 1px solid var(--bordure); }
.ajout-rapide > details > summary { list-style: none; display: inline-flex; cursor: pointer; }
.ajout-rapide > details > summary::-webkit-details-marker { display: none; }
.ajout-rapide__form { margin-top: 0.9rem; }
.carte--repliable > summary { list-style: none; cursor: pointer; }
.carte--repliable > summary::-webkit-details-marker { display: none; }
.carte--repliable:not([open]) > summary { border-bottom: 0; }
.carte--repliable > summary h2::after { content: " ›"; color: var(--texte-faible); }
.carte--repliable[open] > summary h2::after { content: ""; }
.plus-details { margin-top: 0.5rem; border-top: 1px dashed var(--bordure); padding-top: 0.75rem; }
.plus-details > summary { cursor: pointer; font-weight: 600; font-size: 0.9rem; color: var(--bleu); margin-bottom: 0.6rem; }
@media (min-width: 701px) { .tableau--formations .actions { width: 1%; } }
.formation__intitule { min-width: 0; text-align: left; overflow-wrap: anywhere; }
.tableau--cartes .formation__intitule { text-align: right; }
@media (max-width: 700px) {
  .echeance { grid-template-columns: auto minmax(0, 1fr); padding: 0.75rem 1rem; }
  .echeance__quand { grid-column: 2; flex-direction: row; flex-wrap: wrap; align-items: center; justify-content: flex-start; gap: 0.4rem; text-align: left; }
  .echeance__action { grid-column: 2; justify-content: flex-start; }
  .echeance__action:empty { display: none; }
  .fait__panneau { position: static; width: 100%; margin-top: 0.5rem; box-shadow: var(--ombre-1); }
  .echeance-resume { grid-template-columns: 1fr; }
  .echeances-groupe__note { margin-left: 1rem; }
  /* Les trois compteurs tiennent sur une ligne : la liste reste visible sans défiler. */
  .echeances-bilan { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0.5rem; }
  .echeances-bilan .indicateur { padding: 0.6rem 0.7rem; }
  .echeances-bilan .indicateur__libelle { font-size: 0.62rem; letter-spacing: 0.03em; }
  .echeances-bilan .indicateur__valeur { font-size: 1.35rem; }
  .echeances-bilan .indicateur__detail { display: none; }
}

/* --- planning des équipes : une ligne par personne, une colonne par jour --- */
.pl-barre-outils { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.6rem; margin: 0 0 0.9rem; }
.pl-navigation { display: flex; flex-wrap: wrap; align-items: center; gap: 0.4rem; }
.pl-navigation__periode { margin-left: 0.4rem; font-size: 0.95rem; }
.pl-vues { display: flex; flex-wrap: wrap; gap: 0.35rem; }
.pl-carte { overflow: hidden; }
.pl { --pl-nom: 11rem; --pl-h: 2.25rem; --pl-col: 4.4rem; overflow-x: auto; -webkit-overflow-scrolling: touch; }
.pl__tete, .pl__ligne { display: grid; grid-template-columns: var(--pl-nom) minmax(calc(var(--jours) * var(--pl-col)), 1fr); min-width: calc(var(--pl-nom) + var(--jours) * var(--pl-col)); }
.pl__tete { position: sticky; top: 0; z-index: 3; background: var(--surface-2); border-bottom: 1px solid var(--bordure); }
.pl__coin { position: sticky; left: 0; z-index: 2; display: flex; align-items: center; padding: 0.55rem 0.8rem; background: var(--surface-2); border-right: 1px solid var(--bordure); font-size: 0.72rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; color: var(--texte-faible); }
.pl__jours { display: grid; grid-template-columns: repeat(var(--jours), minmax(0, 1fr)); }
.pl__jour { padding: 0.45rem 0.15rem; border-left: 1px solid var(--bordure); text-align: center; font-size: 0.74rem; color: var(--texte-doux); white-space: nowrap; overflow: hidden; }
.pl__jour-num { font-weight: 700; color: var(--texte); }
.pl__jour--aujourdhui { background: rgba(222, 114, 47, 0.14); }
.pl__jour--aujourdhui .pl__jour-num { color: var(--orange-fonce); }
.pl__jour--ferme { color: var(--texte-faible); background: repeating-linear-gradient(135deg, transparent 0 6px, rgba(34, 48, 58, 0.05) 6px 12px); }
.pl__jour--semaine, .pl__case--semaine { border-left: 2px solid var(--bordure-forte) !important; }
.pl__ligne { border-bottom: 1px solid var(--bordure); }
.pl__ligne:last-child { border-bottom: 0; }
.pl__personne { position: sticky; left: 0; z-index: 2; display: flex; flex-direction: column; justify-content: center; min-width: 0; padding: 0.4rem 0.8rem; background: var(--surface); border-right: 1px solid var(--bordure); }
.pl__nom { overflow: hidden; font-size: 0.88rem; font-weight: 650; color: var(--texte); text-decoration: none; text-overflow: ellipsis; white-space: nowrap; }
a.pl__nom:hover { color: var(--bleu); }
.pl__fonction { overflow: hidden; font-size: 0.72rem; color: var(--texte-faible); text-overflow: ellipsis; white-space: nowrap; }
.pl__piste { display: grid; grid-template-columns: repeat(var(--jours), minmax(0, 1fr)); row-gap: 0.25rem; padding: 0.3rem 0; }
.pl__case { grid-row: 1 / -1; min-height: var(--pl-h); margin: -0.3rem 0; padding: 0; border: 0; border-left: 1px solid var(--bordure); background: transparent; }
button.pl__case { cursor: pointer; }
button.pl__case:hover { background: rgba(54, 91, 109, 0.07); }
button.pl__case:focus-visible { outline: 2px solid var(--bleu); outline-offset: -2px; }
.pl__case--aujourdhui { background: rgba(222, 114, 47, 0.07); }
.pl__case--ferme { background: repeating-linear-gradient(135deg, transparent 0 6px, rgba(34, 48, 58, 0.05) 6px 12px); }
.pl__barre { position: relative; z-index: 1; display: flex; align-self: center; align-items: center; gap: 0.35rem; min-width: 0; height: calc(var(--pl-h) - 0.15rem); margin: 0 3px; padding: 0 0.5rem; overflow: hidden; border: 0; border-radius: 7px; background: var(--couleur, var(--bleu)); box-shadow: 0 1px 2px rgba(0, 0, 0, 0.14); color: #fff; font: inherit; font-size: 0.76rem; text-align: left; text-decoration: none; white-space: nowrap; cursor: pointer; }
.pl__barre:hover { filter: brightness(1.07); }
.pl__barre:focus-visible { outline: 2px solid var(--texte); outline-offset: 1px; }
.pl__barre-ref { flex: none; font-weight: 700; opacity: 0.85; }
.pl__barre-texte { overflow: hidden; text-overflow: ellipsis; }
.pl__barre--absence { border: 1px solid var(--bordure); background: repeating-linear-gradient(135deg, #f1f3f5 0 7px, #e4e8ec 7px 14px); box-shadow: none; color: var(--texte-doux); font-weight: 600; }
.pl__barre--partage { box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.8), 0 1px 2px rgba(0, 0, 0, 0.14); }
.pl__barre--tache { border-radius: 999px; }
.pl__barre--tiers { border: 1.5px dashed var(--couleur); background: var(--surface); box-shadow: none; color: var(--couleur); }
.pl__section { position: sticky; left: 0; padding: 0.5rem 0.8rem; border-top: 1px solid var(--bordure); border-bottom: 1px solid var(--bordure); background: var(--surface-2); font-size: 0.72rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; color: var(--texte-faible); }
.pl-bas { margin-top: 1rem; align-items: start; }
.pl-legende { display: flex; flex-direction: column; gap: 0.55rem; margin: 0; padding: 0.7rem 1.15rem 1rem; list-style: none; }
.pl-legende li { display: flex; flex-wrap: wrap; align-items: center; gap: 0.55rem; }
.pl-legende li .bouton { margin-left: auto; }
.pl-legende__pastille { flex: none; width: 0.85rem; height: 0.85rem; border-radius: 3px; background: var(--couleur); }
@media (max-width: 700px) {
  .pl { --pl-nom: 7.5rem; --pl-col: 3.4rem; }
  .pl__jour-nom { display: block; }
}

/* --- fenêtre « Placer » --- */
.dialogue-planning { width: min(34rem, 94vw); max-height: 92vh; padding: 0; overflow: auto; border: 0; border-radius: 16px; box-shadow: var(--ombre-3); }
.dialogue-planning::backdrop { background: rgba(20, 30, 38, 0.45); }
.dialogue-planning__tete { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; padding: 1rem 1.2rem 0.4rem; }
.dialogue-planning__tete h2 { margin: 0; font-size: 1.1rem; }
.dialogue-planning__fermer { padding: 0 0.3rem; border: 0; background: none; color: var(--texte-faible); font-size: 1.6rem; line-height: 1; cursor: pointer; }
.dialogue-planning__onglets { display: flex; gap: 0.4rem; padding: 0 1.2rem 0.4rem; }
.dialogue-planning__onglets[hidden] { display: none; }
.dialogue-planning__volet { padding: 0.5rem 1.2rem 1.15rem; }
.dialogue-planning__volet[hidden] { display: none; }
.dialogue-planning__qui { margin: 0 0 0.8rem; }
.dialogue-planning__actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 0.5rem; margin-top: 0.9rem; }
.dialogue-planning [data-raccourcis-dates] { margin: -0.3rem 0 0.8rem; }
.choix-personnes { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.choix-personne { display: inline-flex; align-items: center; gap: 0.4rem; padding: 0.45rem 0.75rem; border: 1px solid var(--bordure); border-radius: 999px; font-size: 0.86rem; cursor: pointer; }
.choix-personne:has(input:checked) { border-color: var(--bleu); background: var(--info-fond); }
.choix-personne input { margin: 0; }

/* --- agenda d'une personne (Mon planning, fiche salarié, accueil) --- */
.agenda-semaine + .agenda-semaine { margin-top: 1.2rem; }
.agenda-semaine__titre { margin: 0 0 0.4rem; font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--texte-faible); }
.agenda { display: flex; flex-direction: column; margin: 0; padding: 0; list-style: none; }
.agenda__jour { display: grid; grid-template-columns: 10rem minmax(0, 1fr); gap: 0.8rem; padding: 0.65rem 0; border-top: 1px solid var(--bordure); }
.agenda__jour:first-child { border-top: 0; }
.agenda__jour--aujourdhui .agenda__date { color: var(--orange-fonce); }
.agenda__jour--ferme { opacity: 0.6; }
.agenda__date { font-size: 0.88rem; font-weight: 650; }
.agenda__aujourdhui { display: inline-block; margin-left: 0.3rem; padding: 0.05rem 0.45rem; border-radius: 999px; background: var(--orange); color: #fff; font-size: 0.68rem; font-weight: 700; vertical-align: middle; }
.agenda__chantier { display: flex; flex-direction: column; gap: 0.12rem; padding: 0.1rem 0 0.1rem 0.7rem; border-left: 4px solid var(--couleur); }
.agenda__chantier + .agenda__chantier { margin-top: 0.55rem; }
.agenda__titre { font-weight: 650; color: var(--texte); text-decoration: none; overflow-wrap: anywhere; }
a.agenda__titre:hover { color: var(--bleu); text-decoration: underline; }
.agenda__adresse, .agenda__taches { font-size: 0.8rem; color: var(--texte-doux); overflow-wrap: anywhere; }
.agenda__partage { font-size: 0.78rem; color: var(--alerte); }
@media (max-width: 700px) {
  .agenda__jour { grid-template-columns: 1fr; gap: 0.25rem; }
}

/* --- équipe d'un chantier --- */
.equipe-chantier { margin: 0; padding: 0; list-style: none; }
.equipe-chantier__membre { display: flex; align-items: flex-start; gap: 0.7rem; padding: 0.7rem 1.15rem; border-top: 1px solid var(--bordure); }
.equipe-chantier__membre:first-child { border-top: 0; }
.avatar-initiales { display: grid; flex: none; place-items: center; width: 2.1rem; height: 2.1rem; border-radius: 50%; background: var(--info-fond); color: var(--bleu-fonce); font-size: 0.8rem; font-weight: 700; }
.equipe-chantier__texte { display: flex; flex: 1; flex-direction: column; gap: 0.25rem; min-width: 0; }
.equipe-chantier__nom { font-weight: 650; color: var(--texte); text-decoration: none; }
a.equipe-chantier__nom:hover { color: var(--bleu); }
.equipe-chantier__periodes { display: flex; flex-wrap: wrap; gap: 0.35rem; }
.periode-puce { display: inline-flex; align-items: center; gap: 0.25rem; padding: 0.15rem 0.2rem 0.15rem 0.6rem; border-radius: 999px; background: var(--fond); font-size: 0.78rem; }
.periode-puce form { display: inline; }
.periode-puce button { padding: 0 0.3rem; border: 0; background: none; color: var(--texte-faible); font-size: 1rem; line-height: 1; cursor: pointer; }
.periode-puce button:hover { color: var(--danger); }
.equipe-tache { display: inline-flex; flex-wrap: wrap; gap: 0.3rem; }
.equipe-tache__personne { display: inline-flex; align-items: center; gap: 0.25rem; padding: 0.05rem 0.45rem; border-radius: 999px; background: var(--info-fond); color: var(--bleu-fonce); font-size: 0.74rem; font-weight: 600; }
.finances-groupe { margin: 1.4rem 0 0.6rem; font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--texte-faible); }
.finances-groupe:first-child { margin-top: 0; }
/* --- cases à cocher dans un libellé (agenda, rendez-vous) --- */
.case-a-cocher { display: flex; align-items: flex-start; gap: 0.5rem; font-size: 0.88rem; cursor: pointer; }
.case-a-cocher input { flex-shrink: 0; width: 16px; height: 16px; margin: 0.15rem 0 0; accent-color: var(--orange); }
.formulaire__actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 0.5rem; margin-top: 1.1rem; }

/* --- planning : deux façons de voir (chantiers, équipes) --- */
.pl-visions { display: inline-flex; flex-wrap: wrap; gap: 2px; margin: 0 0 0.85rem; padding: 3px; border: 1px solid var(--bordure); border-radius: 11px; background: var(--surface-2); }
.pl-visions__choix { padding: 0.45rem 0.95rem; border-radius: 8px; color: var(--texte-doux); font-size: 0.88rem; font-weight: 600; text-decoration: none; }
.pl-visions__choix:hover { color: var(--texte); text-decoration: none; }
.pl-visions__choix--actif { background: var(--surface); color: var(--texte); box-shadow: var(--ombre-1); }
.pl--chantiers { --pl-nom: 15rem; --pl-col: 2.9rem; }
.pl__chantier .pl__nom { white-space: nowrap; }
.pl__chantier-ref { display: inline-block; margin-right: 0.2rem; padding: 0 0.35rem; border-radius: 4px; background: var(--couleur); color: #fff; font-size: 0.72rem; font-weight: 700; }
.pl__retard { color: var(--danger); font-weight: 600; }
.pl__piste--chantier { row-gap: 0.2rem; }
.pl__barre--chantier .pl__barre-texte { font-weight: 600; }
.pl__barre-avancement { flex: none; margin-left: auto; padding-left: 0.4rem; font-size: 0.7rem; font-weight: 700; opacity: 0.85; }
.pl__barre--retard { background: repeating-linear-gradient(135deg, var(--couleur) 0 6px, rgba(255, 255, 255, 0.45) 6px 12px), var(--couleur); opacity: 0.8; }
.pl__barre--provisoire { border: 1.5px dashed var(--couleur); background: var(--surface); box-shadow: none; color: var(--couleur); }
.pl__ligne--provisoire .pl__nom { color: var(--texte-doux); }
.pl__presence { z-index: 1; display: grid; place-items: center; align-self: center; justify-self: center; min-width: 1.35rem; height: 1.35rem; padding: 0 0.25rem; border-radius: 999px; background: var(--info-fond); color: var(--bleu-fonce); font-size: 0.7rem; font-weight: 700; pointer-events: none; }
.pl__rdv-chantier { z-index: 2; align-self: center; justify-self: end; width: 0.75rem; height: 0.75rem; margin-right: 4px; padding: 0; border: 2px solid var(--surface); border-radius: 50%; background: var(--couleur); cursor: pointer; }
.pl--compact { --pl-col: 1.55rem; --pl-nom: 13rem; }
.pl--compact .pl__jour { padding: 0.45rem 0; overflow: visible; font-size: 0.64rem; text-align: left; }
.pl--compact .pl__presence { min-width: 1.1rem; height: 1.1rem; padding: 0; font-size: 0.6rem; }
.pl--compact .pl__barre-avancement { display: none; }
.pl__jour-semaine { padding-left: 2px; font-weight: 700; color: var(--texte); }
.pl-legende-chantiers { display: flex; flex-wrap: wrap; gap: 0.4rem 1.2rem; margin: 0.7rem 0 0; }
.pl-legende-chantiers > span { display: inline-flex; align-items: center; gap: 0.35rem; }
.pl__presence--legende { display: inline-grid; }
.pl__barre-legende { display: inline-block; width: 1.6rem; height: 0.7rem; border-radius: 3px; }
.pl__barre-legende--retard { background: repeating-linear-gradient(135deg, #365b6d 0 4px, #9db1bb 4px 8px); }
.pl__barre-legende--provisoire { border: 1.5px dashed #365b6d; }
.pl__rdv-chantier--legende { --couleur: #de722f; display: inline-block; cursor: default; }
@media (max-width: 700px) {
  .pl--chantiers { --pl-nom: 9rem; }
  .pl--compact { --pl-nom: 8rem; }
}

/* --- planning : ce que chacun a noté dans son agenda --- */
.pl__agenda { z-index: 1; display: flex; flex-direction: column; gap: 2px; min-width: 0; padding: 0 3px 2px; }
.pl__agenda-evt { display: flex; align-items: center; gap: 0.25rem; min-width: 0; padding: 0.1rem 0.3rem; border: 0; border-left: 3px solid var(--couleur); border-radius: 4px; background: var(--surface-2); color: var(--texte); font: inherit; font-size: 0.68rem; text-align: left; cursor: pointer; }
.pl__agenda-evt:hover { background: var(--info-fond); }
.pl__agenda-heure { flex: none; font-weight: 700; color: var(--texte-doux); }
.pl__agenda-titre { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pl__agenda-evt--fait .pl__agenda-titre { text-decoration: line-through; opacity: 0.6; }
.pl__agenda-plus { align-self: flex-start; padding: 0 0.3rem; border: 0; background: none; color: var(--bleu); font: inherit; font-size: 0.68rem; cursor: pointer; }
.pl-fiche { width: min(27rem, 94vw); }
.pl-fiche__lignes { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 0.35rem 0.9rem; margin: 0 0 0.4rem; font-size: 0.88rem; }
.pl-fiche__lignes dt { color: var(--texte-faible); }
.pl-fiche__lignes dd { margin: 0; font-weight: 600; overflow-wrap: anywhere; }

/* --- agenda en liste (Ma semaine, fiche du salarié) : ce qui est noté --- */
.agenda__notes { display: flex; flex-direction: column; gap: 0.3rem; margin: 0; padding: 0; list-style: none; }
.agenda__chantier + .agenda__notes, .pastille + .agenda__notes { margin-top: 0.55rem; }
.agenda__note { display: flex; gap: 0.5rem; padding-left: 0.7rem; border-left: 4px solid var(--couleur); font-size: 0.84rem; }
.agenda__note-heure { flex: none; min-width: 5.6rem; color: var(--texte-doux); font-weight: 600; }
.agenda__note-titre { overflow-wrap: anywhere; }
.agenda__note--fait .agenda__note-titre { text-decoration: line-through; opacity: 0.6; }

/* --- Mon planning : le calendrier (jour, semaine) --- */
.ag-carte { overflow: hidden; }
.ag { --ag-heure: 3.1rem; --ag-gouttiere: 3.4rem; display: flex; flex-direction: column; }
.ag__tete, .ag__bande, .ag__corps { display: grid; grid-template-columns: var(--ag-gouttiere) repeat(var(--ag-jours), minmax(0, 1fr)); }
.ag__tete { border-bottom: 1px solid var(--bordure); background: var(--surface-2); }
.ag__coin { border-right: 1px solid var(--bordure); }
.ag__coin--bande { display: flex; align-items: center; justify-content: center; font-size: 0.6rem; letter-spacing: 0.04em; text-transform: uppercase; color: var(--texte-faible); }
.ag__jour-tete { display: flex; flex-direction: column; align-items: center; gap: 0.1rem; padding: 0.45rem 0.2rem; border-left: 1px solid var(--bordure); color: var(--texte-doux); text-decoration: none; }
.ag__jour-tete:hover { background: rgba(54, 91, 109, 0.06); text-decoration: none; }
.ag__jour-nom { font-size: 0.7rem; letter-spacing: 0.04em; text-transform: uppercase; }
.ag__jour-num { display: grid; place-items: center; width: 2rem; height: 2rem; border-radius: 50%; color: var(--texte); font-size: 1.05rem; font-weight: 700; }
.ag__jour-tete--aujourdhui .ag__jour-nom { color: var(--orange-fonce); }
.ag__jour-tete--aujourdhui .ag__jour-num { background: var(--orange); color: #fff; }
.ag__jour-tete--weekend, .ag__bande-jour--weekend { background: rgba(34, 48, 58, 0.03); }
.ag__bande { border-bottom: 1px solid var(--bordure-forte); }
.ag__bande-jour { display: flex; flex-direction: column; gap: 3px; min-width: 0; min-height: 2.3rem; padding: 4px; border-left: 1px solid var(--bordure); cursor: pointer; }
.ag__bande-jour--aujourdhui { background: rgba(222, 114, 47, 0.05); }
.ag__chantier { display: flex; align-items: center; gap: 0.3rem; min-width: 0; padding: 0.22rem 0.45rem; border: 0; border-radius: 6px; background: var(--couleur); color: #fff; font: inherit; font-size: 0.74rem; text-align: left; cursor: pointer; }
.ag__chantier:hover { filter: brightness(1.08); }
.ag__chantier-ref { flex: none; font-weight: 700; opacity: 0.85; }
.ag__chantier-texte { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ag__absence, .ag__ferie { display: block; padding: 0.2rem 0.45rem; border-radius: 6px; background: repeating-linear-gradient(135deg, #f1f3f5 0 6px, #e4e8ec 6px 12px); color: var(--texte-doux); font-size: 0.74rem; font-weight: 600; }
.ag__tache-jour { display: flex; align-items: center; gap: 0.3rem; min-width: 0; padding: 0.2rem 0.45rem; border: 1px solid var(--bordure); border-left: 3px solid var(--couleur); border-radius: 6px; background: var(--surface); color: var(--texte); font: inherit; font-size: 0.74rem; text-align: left; cursor: pointer; }
.ag__tache-texte { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ag__tache-jour--fait .ag__tache-texte { text-decoration: line-through; opacity: 0.6; }
.ag__coche { display: inline-grid; flex: none; place-items: center; width: 0.95rem; height: 0.95rem; margin-right: 0.15rem; border: 1.5px solid currentColor; border-radius: 4px; font-size: 0.62rem; line-height: 1; vertical-align: -0.12rem; }
.ag__corps { position: relative; max-height: max(26rem, calc(100vh - 19rem)); overflow-y: auto; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; }
.ag__heure { position: relative; height: var(--ag-heure); border-right: 1px solid var(--bordure); }
.ag__heure span { position: absolute; top: -0.55em; right: 0.35rem; padding: 0 0.1rem; background: var(--surface); color: var(--texte-faible); font-size: 0.66rem; white-space: nowrap; }
.ag__heure:first-child span { display: none; }
.ag__colonne { position: relative; height: calc(var(--ag-heures) * var(--ag-heure)); border-left: 1px solid var(--bordure); background-image: repeating-linear-gradient(to bottom, var(--bordure) 0 1px, transparent 1px calc(var(--ag-heure) / 2), rgba(230, 226, 218, 0.55) calc(var(--ag-heure) / 2) calc(var(--ag-heure) / 2 + 1px), transparent calc(var(--ag-heure) / 2 + 1px) var(--ag-heure)); cursor: cell; }
.ag__colonne--weekend { background-color: rgba(34, 48, 58, 0.03); }
.ag__colonne--aujourdhui { background-color: rgba(222, 114, 47, 0.04); }
.ag__evt { position: absolute; top: calc(var(--d) / 60 * var(--ag-heure)); left: calc(var(--col) / var(--cols) * (100% - 6px) + 2px); z-index: 1; display: flex; flex-direction: column; width: calc((100% - 6px) / var(--cols) - 2px); height: max(1.35rem, calc(var(--l) / 60 * var(--ag-heure) - 2px)); padding: 0.2rem 0.4rem; overflow: hidden; border: 0; border-left: 3px solid var(--couleur); border-radius: 6px; background: var(--surface); background: color-mix(in srgb, var(--couleur) 15%, white); box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08); color: var(--texte); font: inherit; font-size: 0.74rem; line-height: 1.25; text-align: left; cursor: grab; touch-action: manipulation; -webkit-touch-callout: none; user-select: none; }
.ag__evt:hover { z-index: 2; box-shadow: 0 2px 6px rgba(0, 0, 0, 0.14); }
.ag__evt:focus-visible { outline: 2px solid var(--bleu); outline-offset: 1px; }
.ag__evt-heure { color: var(--texte-doux); font-size: 0.66rem; font-weight: 600; white-space: nowrap; }
.ag__evt-titre { display: -webkit-box; overflow: hidden; font-weight: 650; -webkit-line-clamp: 3; -webkit-box-orient: vertical; }
.ag__evt-lieu { overflow: hidden; color: var(--texte-doux); font-size: 0.66rem; text-overflow: ellipsis; white-space: nowrap; }
.ag__evt--court { flex-direction: row; align-items: center; gap: 0.35rem; padding-top: 0; padding-bottom: 0; }
.ag__evt--court .ag__evt-titre { -webkit-line-clamp: 1; }
.ag__evt--fait .ag__evt-titre { text-decoration: line-through; opacity: 0.6; }
.ag__evt--creneau { border-left-style: dashed; background: repeating-linear-gradient(135deg, rgba(47, 127, 115, 0.08) 0 6px, rgba(47, 127, 115, 0.16) 6px 12px); }
.ag__evt--souleve { z-index: 5; box-shadow: 0 10px 24px rgba(0, 0, 0, 0.22); cursor: grabbing; transform: scale(1.02); }
.ag__evt--enregistre { opacity: 0.65; }
.ag__evt-poignee { position: absolute; right: 0; bottom: 0; left: 0; height: 8px; cursor: ns-resize; }
.ag__evt-poignee::after { content: ""; position: absolute; bottom: 2px; left: 50%; width: 1.4rem; height: 3px; margin-left: -0.7rem; border-radius: 2px; background: var(--couleur); opacity: 0; }
.ag__evt:hover .ag__evt-poignee::after { opacity: 0.6; }
.ag__maintenant { position: absolute; top: calc(var(--d) / 60 * var(--ag-heure)); right: 0; left: 0; z-index: 3; height: 2px; background: #d93a2b; pointer-events: none; }
.ag__maintenant::before { content: ""; position: absolute; top: -4px; left: -5px; width: 10px; height: 10px; border-radius: 50%; background: #d93a2b; }
.ag--jour { --ag-gouttiere: 3.8rem; }
@media (pointer: coarse) {
  .ag__evt-poignee { height: 14px; }
  .ag__evt-poignee::after { opacity: 0.55; }
}
@media (max-width: 700px) {
  .ag { --ag-gouttiere: 2.7rem; --ag-heure: 3.4rem; }
  .ag__corps { max-height: calc(100vh - 15rem); }
  .ag__heure span { right: 0.2rem; font-size: 0.6rem; }
}

/* --- Mon planning : la vue mois --- */
.ag-mois__tete, .ag-mois__semaine { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.ag-mois__tete div { padding: 0.5rem 0.2rem; border-bottom: 1px solid var(--bordure); background: var(--surface-2); color: var(--texte-faible); font-size: 0.7rem; letter-spacing: 0.04em; text-align: center; text-transform: uppercase; }
.ag-mois__jour { display: flex; flex-direction: column; gap: 0.2rem; min-width: 0; min-height: 6.4rem; padding: 0.3rem; border-bottom: 1px solid var(--bordure); border-left: 1px solid var(--bordure); cursor: pointer; }
.ag-mois__semaine .ag-mois__jour:first-child { border-left: 0; }
.ag-mois__jour--weekend { background: rgba(34, 48, 58, 0.025); }
.ag-mois__jour--hors { background: var(--surface-2); }
.ag-mois__jour--hors .ag-mois__num { color: var(--texte-faible); }
.ag-mois__num { display: grid; align-self: flex-start; place-items: center; min-width: 1.6rem; height: 1.6rem; border-radius: 50%; color: var(--texte); font-size: 0.82rem; font-weight: 650; text-decoration: none; }
.ag-mois__num:hover { background: var(--info-fond); text-decoration: none; }
.ag-mois__jour--aujourdhui .ag-mois__num { background: var(--orange); color: #fff; }
.ag-mois__lignes { display: flex; flex: 1; flex-direction: column; gap: 2px; min-width: 0; }
.ag-mois__ligne { display: block; min-width: 0; padding: 0.1rem 0.35rem; overflow: hidden; border: 0; border-radius: 4px; font: inherit; font-size: 0.7rem; text-align: left; text-decoration: none; text-overflow: ellipsis; white-space: nowrap; cursor: pointer; }
.ag-mois__ligne--chantier { background: var(--couleur); color: #fff; }
.ag-mois__ligne--chantier .ag__chantier-ref { margin-right: 0.2rem; }
.ag-mois__ligne--evt { border-left: 3px solid var(--couleur); border-radius: 0 4px 4px 0; background: var(--surface-2); color: var(--texte); }
.ag-mois__ligne--absence { background: repeating-linear-gradient(135deg, #f1f3f5 0 6px, #e4e8ec 6px 12px); color: var(--texte-doux); }
.ag-mois__ligne--fait { text-decoration: line-through; opacity: 0.6; }
.ag-mois__heure { margin-right: 0.25rem; color: var(--texte-doux); font-weight: 650; }
.ag-mois__plus { padding-left: 0.35rem; color: var(--bleu); font-size: 0.7rem; }
@media (max-width: 700px) {
  .ag-mois__jour { min-height: 4.6rem; padding: 0.15rem; }
  .ag-mois__ligne { padding: 0 0.2rem; font-size: 0.6rem; }
  .ag-mois__heure, .ag-mois__ligne--chantier .ag__chantier-texte { display: none; }
}

/* --- Mon planning : légende et fenêtre « Ajouter » --- */
.ag-legende { display: flex; flex-wrap: wrap; gap: 0.4rem 1rem; margin: 0.8rem 0 0; padding: 0; color: var(--texte-doux); font-size: 0.76rem; list-style: none; }
.ag-legende li { display: inline-flex; align-items: center; gap: 0.35rem; }
.ag-legende__pastille { width: 0.8rem; height: 0.8rem; border-radius: 3px; background: var(--couleur); }
.ag-legende__pastille--chantier { background: linear-gradient(90deg, #365b6d 50%, #c0601f 50%); }
.ag-legende__pastille[data-creneau] { border: 1.5px dashed var(--couleur); background: rgba(47, 127, 115, 0.12); }
.dialogue-agenda { width: min(37rem, 96vw); }
.ag-types { display: flex; flex-wrap: wrap; gap: 0.35rem; margin-bottom: 0.8rem; }
.ag-types__option span::before { content: ""; display: inline-block; width: 0.55rem; height: 0.55rem; margin-right: 0.35rem; border-radius: 50%; background: var(--couleur); vertical-align: 0.05rem; }
.ag-aide-creneau { margin: -0.3rem 0 0.7rem; }
.ag-quand { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 0.6rem; }
.ag-quand [hidden] { display: none; }
.ag-durees { display: flex; flex-wrap: wrap; align-items: center; gap: 0.35rem; margin: -0.3rem 0 0.8rem; }
.ag-durees--journee .puce-filtre { opacity: 0.45; }
.ag-journee { display: inline-flex; align-items: center; gap: 0.35rem; margin-left: auto; font-size: 0.84rem; cursor: pointer; }
.ag-journee input { accent-color: var(--orange); }
.ag-reserve { margin: 0.2rem 0 0.8rem; padding: 0.6rem 0.8rem; border-radius: 8px; background: var(--info-fond); font-size: 0.86rem; overflow-wrap: anywhere; }
.ag-reserve[hidden] { display: none; }
.ag-plus { margin: 0.4rem 0 0.2rem; padding-top: 0.6rem; border-top: 1px solid var(--bordure); }
.ag-plus summary { margin-bottom: 0.6rem; color: var(--bleu); font-size: 0.86rem; font-weight: 600; cursor: pointer; }
.ag-prive { margin: 0.2rem 0 0.4rem; }
.ag-repeter { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; margin-top: 0.5rem; }
.ag-repeter[hidden] { display: none; }
.ag-repeter input[type="date"] { width: auto; }
.ag-actions .bouton[hidden] { display: none; }
.ag-actions [data-action-supprimer], .ag-actions [data-action-serie] { margin-right: auto; }
.ag-actions [data-action-serie] { margin-right: auto; margin-left: -0.3rem; }
.ag-fiche-chantier { width: min(28rem, 94vw); }
.ag-fiche-chantier__corps p { margin: 0 0 0.6rem; }
.ag-fiche-chantier__titre { margin-top: 0.6rem !important; font-weight: 650; }
.ag-fiche-chantier__corps ul { margin: 0 0 0.8rem 1.1rem; padding: 0; }
.ag-fiche-chantier__corps .bouton { margin: 0 0.4rem 0.4rem 0; }
@media (max-width: 520px) {
  .ag-quand { grid-template-columns: 1fr 1fr; }
  .ag-quand .champ:first-child { grid-column: 1 / -1; }
  .ag-journee { margin-left: 0; }
}

/* --- Mon lien de rendez-vous --- */
.rdv-lien__etat { margin: 0 0 0.6rem; }
.rdv-lien__ligne { display: flex; flex-wrap: wrap; align-items: center; gap: 0.4rem; }
.rdv-lien__adresse { flex: 1 1 18rem; min-width: 0; font-family: var(--police-references); font-size: 0.84rem; }
.rdv-lien__aide { margin: 0.7rem 0 0.3rem; }
.rdv-lien--ferme .rdv-lien__adresse { color: var(--texte-faible); }
.rdv-reglages { margin-top: 1rem; }
.rdv-reglages__ouvert { margin-bottom: 0.9rem; font-weight: 600; }
.rdv-plages { margin: 0.4rem 0 1rem; padding: 0; border: 0; }
.rdv-plages__jour { display: flex; flex-wrap: wrap; align-items: center; gap: 0.4rem 0.8rem; padding: 0.45rem 0; border-top: 1px solid var(--bordure); }
.rdv-plages__nom { min-width: 7.5rem; font-weight: 600; }
.rdv-plages__heures { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 0.3rem; }
.rdv-plages__heures input { width: 6.8rem; }
.rdv-plages__et { margin: 0 0.3rem; color: var(--texte-faible); font-size: 0.82rem; }
.rdv-plages__jour--off .rdv-plages__heures { opacity: 0.35; pointer-events: none; }
.rdv-reservations { margin: 0; padding: 0; list-style: none; }
.rdv-reservations li { display: flex; flex-direction: column; gap: 0.15rem; padding: 0.7rem 1.15rem; border-top: 1px solid var(--bordure); }
.rdv-reservations li:first-child { border-top: 0; }
.rdv-reservations__quand { font-weight: 650; }

/* --- page publique de prise de rendez-vous --- */
.rdv-public__message { margin: 0 0 0.8rem; padding: 0.8rem 1rem; border-left: 3px solid var(--orange); border-radius: 0 8px 8px 0; background: var(--surface-2); }
.rdv-public__infos { margin-bottom: 1.1rem; }
.rdv-public__jours, .rdv-public__coordonnees { min-width: 0; margin: 0 0 1.2rem; padding: 0; border: 0; }
.rdv-public__jour { margin-bottom: 0.45rem; border: 1px solid var(--bordure); border-radius: 10px; background: var(--surface); }
.rdv-public__jour summary { display: flex; align-items: center; gap: 0.5rem; padding: 0.7rem 0.9rem; font-weight: 650; list-style: none; cursor: pointer; }
.rdv-public__jour summary::-webkit-details-marker { display: none; }
.rdv-public__jour summary::after { content: "›"; color: var(--texte-faible); font-size: 1.2rem; line-height: 1; transform: rotate(90deg); }
.rdv-public__jour[open] summary::after { transform: rotate(-90deg); }
.rdv-public__jour-nombre { margin-left: auto; color: var(--texte-faible); font-size: 0.78rem; font-weight: 500; }
.rdv-public__heures { display: grid; grid-template-columns: repeat(auto-fill, minmax(5.2rem, 1fr)); gap: 0.4rem; padding: 0 0.9rem 0.9rem; }
.rdv-public__heure { position: relative; }
.rdv-public__heure input { position: absolute; inset: 0; opacity: 0; }
.rdv-public__heure span { display: block; padding: 0.55rem 0; border: 1.5px solid var(--bordure-forte); border-radius: 8px; font-weight: 650; text-align: center; cursor: pointer; }
.rdv-public__heure input:checked + span { border-color: var(--orange); background: var(--orange); color: #fff; }
.rdv-public__heure input:focus-visible + span { outline: 2px solid var(--bleu); outline-offset: 2px; }
.rdv-public__piege { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.rdv-public__confirmation { padding: 0.8rem 0; text-align: center; }
.rdv-public__coche { display: inline-grid; place-items: center; width: 3.4rem; height: 3.4rem; margin-bottom: 0.8rem; border-radius: 50%; background: var(--succes-fond); color: var(--succes); font-size: 1.7rem; font-weight: 700; }
.rdv-public__quand { font-size: 1.05rem; }
.rdv-public__rgpd { margin-top: 0.6rem; text-align: center; }

/* --- fiche chantier : rapport de fin de chantier --- */
.rapport-fin__texte { margin-bottom: 0.7rem; }
.rapport-fin__actions { display: flex; flex-wrap: wrap; align-items: center; gap: 0.45rem; }
.rapport-fin__aide { margin: 0.6rem 0 0; }
.rapport-fin__liste { display: flex; flex-direction: column; gap: 0.3rem; margin: 0.8rem 0 0; padding: 0.7rem 0 0; border-top: 1px solid var(--bordure); list-style: none; font-size: 0.86rem; }
.rapport-fin__liste a { display: inline-flex; align-items: center; gap: 0.35rem; }
.rapport-fin__liste li { display: flex; flex-wrap: wrap; align-items: center; gap: 0.45rem; }

/* ------------------------------------------------- la messagerie : les SMS */
.mail--sms { border-radius: 18px 18px 18px 6px; }
.mail--envoye.mail--sms { border-radius: 18px 18px 6px 18px; }
.mail--sms .mail__texte { font-size: 0.95rem; }
.mail__etiquette--sms { background: var(--info-fond); color: var(--info); }
.messagerie[data-filtre="sms"] .mail:not([data-canal="sms"]) { display: none; }
.messagerie[data-filtre="sms"] .messagerie__jour { display: none; }
.messagerie__ecrire--sms { border-top: 1px dashed var(--bordure-forte); }
.messagerie__ecrire--sms textarea { min-height: 4.2em; }
.sms-exemple { display: inline-block; padding: 0.35rem 0.6rem; border-radius: 10px; background: var(--info-fond); color: var(--texte); font-size: 0.82rem; line-height: 1.4; }
.ligne--nouveau td { background: rgba(222, 114, 47, 0.06); }

/* ------------------------------------------- prospection : compte et planification */
.com-choix { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 0.6rem; align-items: start; padding: 0.75rem 0.85rem; border: 1px solid var(--bordure); border-radius: 10px; cursor: pointer; }
.com-choix:has(input:checked) { border-color: var(--orange); background: rgba(222, 114, 47, 0.05); }
.com-choix input { margin-top: 0.2rem; }
form:has(input[name="compte"][value="plateforme"]:checked) [data-compte-dedie],
.grille:has(input[name="compte"][value="plateforme"]:checked) [data-compte-dedie] { display: none; }
.com-lancer { display: inline-flex; flex-wrap: wrap; align-items: flex-end; gap: 0.5rem; }
.com-lancer__quand { display: inline-flex; flex-direction: column; gap: 0.15rem; font-size: 0.75rem; color: var(--texte-doux); }
.com-lancer__quand input { height: 2.4rem; }

/* --------------------------------------------------- espace de fichiers (Documents) */
.esp { position: relative; margin-top: 1rem; }
.esp__barre { display: flex; flex-wrap: wrap; align-items: center; gap: 0.6rem; margin-bottom: 0.75rem; }
.esp__recherche { flex: 1 1 16rem; min-width: 0; }
.esp__recherche input { width: 100%; height: 2.5rem; padding: 0 0.9rem; border: 1px solid var(--bordure-forte); border-radius: 999px; background: var(--surface); font: inherit; }
.esp__actions { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; }
.esp__choisir { cursor: pointer; }
.esp__corbeille { gap: 0.35rem; }
.esp__corbeille--active { border-color: var(--orange); color: var(--orange-fonce); }
.esp__chemin { display: flex; flex-wrap: wrap; align-items: center; gap: 0.35rem; padding: 0.55rem 0.2rem; font-size: 0.95rem; }
.esp__chemin a { color: var(--texte-doux); padding: 0.15rem 0.35rem; border-radius: 6px; }
.esp__chemin a[aria-current="page"] { color: var(--texte); font-weight: 650; }
.esp__chemin span[aria-hidden] { color: var(--texte-faible); }
.esp__chiffres { margin-left: auto; }
.esp__reserve { font-size: 0.78rem; padding: 0.1rem 0.5rem; border-radius: 999px; background: var(--alerte-fond); color: #6b4a10; }
.esp__outils-dossier { display: flex; flex-wrap: wrap; align-items: center; gap: 0.15rem 0.6rem; margin: -0.2rem 0 0.75rem; }
.esp__form-ligne { display: inline; margin: 0; }
.esp .bouton--lien { background: none; border: none; padding: 0.25rem 0.1rem; color: var(--bleu); text-decoration: underline; text-underline-offset: 2px; cursor: pointer; font: inherit; font-size: 0.85rem; }
.esp .bouton--lien:disabled { color: var(--texte-faible); text-decoration: none; cursor: default; }
.esp__danger, .esp .bouton--lien.esp__danger, .esp-menu__liste .esp__danger { color: var(--danger); }
.esp__sous-titre { font-size: 0.95rem; margin: 1.4rem 0 0.5rem; color: var(--texte-doux); }

/* Les dossiers en tuiles. */
.esp__dossiers { list-style: none; margin: 0 0 1rem; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(12.5rem, 1fr)); gap: 0.6rem; }
.esp-dossier { position: relative; border: 1px solid var(--bordure); border-radius: var(--rayon); background: var(--surface); box-shadow: var(--ombre-1); transition: border-color var(--transition), box-shadow var(--transition); }
.esp-dossier:hover { border-color: var(--bordure-forte); box-shadow: var(--ombre-2); }
.esp-dossier__lien { display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto auto; column-gap: 0.65rem; align-items: center; padding: 0.8rem 2.4rem 0.8rem 0.85rem; color: var(--texte); text-decoration: none; }
.esp-dossier__lien:hover { text-decoration: none; }
.esp-dossier__lien .esp-icone { grid-row: 1 / 3; font-size: 1.6rem; }
.esp-dossier__nom { font-weight: 650; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; line-height: 1.25; word-break: break-word; }
.esp-dossier__detail { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.esp-menu { position: absolute; top: 50%; right: 0.35rem; transform: translateY(-50%); width: 2rem; height: 2rem; border: none; border-radius: 8px; background: transparent; color: var(--texte-doux); font-size: 1.2rem; line-height: 1; cursor: pointer; }
.esp-menu:hover, .esp-menu:focus-visible { background: var(--surface-2); color: var(--texte); }

/* Les fichiers en liste. */
.esp__fichiers { list-style: none; margin: 0; padding: 0; border: 1px solid var(--bordure); border-radius: var(--rayon); background: var(--surface); overflow: hidden; }
.esp-fichier { position: relative; display: flex; align-items: center; gap: 0.25rem; border-top: 1px solid var(--bordure); padding-right: 2.6rem; }
.esp-fichier:first-child { border-top: none; }
.esp-fichier:hover { background: var(--surface-2); }
.esp-fichier__lien { flex: 1; min-width: 0; display: grid; grid-template-columns: 2.6rem 1fr; grid-template-rows: auto auto; column-gap: 0.7rem; align-items: center; padding: 0.55rem 0.8rem; color: var(--texte); text-decoration: none; }
.esp-fichier__lien:hover { text-decoration: none; }
.esp-fichier__lien .esp-icone, .esp-fichier__vignette { grid-row: 1 / 3; width: 2.6rem; height: 2.6rem; }
.esp-fichier__vignette { object-fit: cover; border-radius: 6px; background: var(--surface-2); }
.esp-fichier__nom { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 550; }
.esp-fichier__detail { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.esp-fichier__telecharger { flex: none; display: inline-flex; align-items: center; justify-content: center; width: 2rem; height: 2rem; border-radius: 8px; color: var(--texte-doux); text-decoration: none; }
.esp-fichier__telecharger:hover { background: var(--surface); color: var(--texte); text-decoration: none; }
.esp-fichier--corbeille { padding-right: 0.6rem; gap: 0.5rem; }
.esp-fichier--corbeille .esp-fichier__lien { cursor: default; }
.esp__fichiers--compact .esp-fichier { padding-right: 0.4rem; }
.esp-icone { display: inline-flex; align-items: center; justify-content: center; font-size: 1.45rem; line-height: 1; border-radius: 8px; }
.esp-fichier .esp-icone { background: var(--surface-2); }
.esp-fichier .esp-icone--pdf { background: #fbe9e5; }
.esp-fichier .esp-icone--image, .esp-fichier .esp-icone--tableur { background: #e8f0ea; }
.esp-fichier .esp-icone--plan { background: #e8eff2; }
.esp-fichier .esp-icone--video, .esp-fichier .esp-icone--audio { background: #f1ebf6; }

.esp__vide { padding: 2.5rem 1.25rem; border: 2px dashed var(--bordure-forte); border-radius: var(--rayon); text-align: center; background: var(--surface); }
.esp__vide-titre { font-weight: 650; font-size: 1.05rem; margin: 0 0 0.35rem; }
.esp__vide p:last-child { margin-bottom: 0; max-width: 34rem; margin-inline: auto; }
.esp__astuce { margin: 0.6rem 0.2rem 0; }
.esp__corbeille-entete { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.6rem; margin-bottom: 0.6rem; }
.esp__corbeille-entete p { margin: 0; max-width: 46rem; }

/* Glisser-déposer : le voile de dépôt, la cible survolée, l'élément glissé. */
.esp-depot { position: fixed; inset: 0; z-index: 60; display: flex; align-items: center; justify-content: center; background: rgba(54, 91, 109, 0.14); border: 3px dashed var(--bleu); pointer-events: none; }
.esp-depot[hidden] { display: none; }
.esp-depot p { padding: 0.9rem 1.4rem; border-radius: 999px; background: var(--surface); box-shadow: var(--ombre-3); font-weight: 650; color: var(--bleu-fonce); }
.esp-cible-active { outline: 2px solid var(--orange); outline-offset: 2px; background: #fff7f1; }
.esp-glisse { opacity: 0.45; }

/* Le panneau d'envoi. */
.esp-envoi { position: fixed; right: 1rem; bottom: 1rem; z-index: 70; width: min(23rem, calc(100vw - 2rem)); padding: 0.9rem 1rem; border-radius: 12px; background: var(--surface); box-shadow: var(--ombre-3); border: 1px solid var(--bordure); }
.esp-envoi[hidden] { display: none; }
.esp-envoi__titre { margin: 0 0 0.5rem; font-weight: 650; }
.esp-envoi__barre { height: 0.5rem; border-radius: 999px; background: var(--surface-2); overflow: hidden; }
.esp-envoi__barre span { display: block; height: 100%; background: var(--orange); border-radius: 999px; transition: width 0.2s ease; }
.esp-envoi__detail { margin: 0.35rem 0 0; color: var(--texte-doux); }
.esp-envoi__erreurs { margin: 0.5rem 0 0; padding-left: 1.1rem; color: var(--danger); max-height: 9rem; overflow: auto; }
.esp-envoi__boutons { display: flex; justify-content: flex-end; margin-top: 0.6rem; }

/* Le menu « ⋯ ». */
.esp-menu__liste { position: absolute; z-index: 80; min-width: 13rem; padding: 0.3rem; border: 1px solid var(--bordure); border-radius: 10px; background: var(--surface); box-shadow: var(--ombre-3); }
.esp-menu__liste button { display: block; width: 100%; padding: 0.55rem 0.75rem; border: none; border-radius: 7px; background: none; text-align: left; font: inherit; color: var(--texte); cursor: pointer; }
.esp-menu__liste button:hover, .esp-menu__liste button:focus-visible { background: var(--surface-2); }

/* Les fenêtres : nom, dossier de destination. */
.esp-dialogue__champ { width: 100%; height: 2.5rem; margin-top: 0.5rem; padding: 0 0.75rem; border: 1px solid var(--bordure-forte); border-radius: 8px; font: inherit; }
.esp-dialogue--large { width: min(520px, calc(100vw - 2rem)); }
.esp-arbre { list-style: none; margin: 0.4rem 0 0; padding: 0; max-height: min(55vh, 26rem); overflow: auto; border: 1px solid var(--bordure); border-radius: 8px; }
.esp-arbre li { border-top: 1px solid var(--bordure); }
.esp-arbre li:first-child { border-top: none; }
.esp-arbre__choix { display: flex; align-items: center; gap: 0.45rem; padding: 0.45rem 0.6rem 0.45rem calc(0.6rem + max(var(--niveau, 0), 0) * 1.1rem); cursor: pointer; }
.esp-arbre__choix:hover { background: var(--surface-2); }

/* La visionneuse de photos. */
.esp-visionneuse { width: 100vw; max-width: 100vw; height: 100vh; max-height: 100vh; margin: 0; padding: 0; border: none; background: rgba(12, 18, 24, 0.94); color: #fff; }
.esp-visionneuse::backdrop { background: rgba(12, 18, 24, 0.94); }
.esp-visionneuse[open] { display: flex; align-items: center; justify-content: center; }
.esp-visionneuse img { max-width: calc(100vw - 2rem); max-height: calc(100vh - 6rem); object-fit: contain; border-radius: 6px; }
.esp-visionneuse__barre { position: fixed; left: 0; right: 0; bottom: 0; display: flex; align-items: center; gap: 0.5rem; padding: 0.75rem 1rem; background: linear-gradient(transparent, rgba(0, 0, 0, 0.55)); }
.esp-visionneuse__nom { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 0.92rem; }
.esp-visionneuse__fleche { position: fixed; top: 50%; transform: translateY(-50%); width: 3rem; height: 3rem; border: none; border-radius: 50%; background: rgba(255, 255, 255, 0.14); color: #fff; font-size: 2rem; line-height: 1; cursor: pointer; }
.esp-visionneuse__fleche:hover { background: rgba(255, 255, 255, 0.26); }
.esp-visionneuse__fleche--g { left: 1rem; }
.esp-visionneuse__fleche--d { right: 1rem; }

@media (max-width: 760px) {
  .esp__actions { width: 100%; }
  .esp__actions .bouton { flex: 1 1 auto; justify-content: center; }
  .esp__choisir--dossier { display: none; }
  .esp__chiffres { width: 100%; margin-left: 0; }
  .esp__dossiers { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 560px) {
  .esp__dossiers { grid-template-columns: 1fr; gap: 0.45rem; }
  .esp-dossier__lien { padding-block: 0.65rem; }
  .esp-fichier__telecharger { display: none; }
  .esp-fichier { padding-right: 2.4rem; }
}

/* ------------------------------------------------- tableau de bord de direction */
.pil-a-traiter { margin-bottom: 0.5rem; }
.pil-points { list-style: none; margin: 0; padding: 0; }
.pil-point { border-top: 1px solid var(--bordure); }
.pil-point:first-child { border-top: none; }
.pil-point__lien { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 0.35rem 0.85rem; padding: 0.7rem 1.15rem; color: var(--texte); text-decoration: none; }
.pil-point__lien:hover { background: var(--surface-2); text-decoration: none; }
.pil-point__niveau .pastille { white-space: nowrap; }
.pil-point__texte { min-width: 0; font-weight: 550; }
.pil-point__detail { color: var(--texte-doux); font-size: 0.86rem; white-space: nowrap; text-align: right; }

/* Les trois bandes : activité, aujourd'hui, qualité. */
.pil-bande { margin-top: 2.25rem; }
.pil-bande__entete { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 0.75rem 1.5rem; margin-bottom: 1rem; padding-bottom: 0.65rem; border-bottom: 1px solid var(--bordure); }
.pil-bande__titre { margin: 0; font-size: 1.35rem; letter-spacing: -0.01em; }
.pil-bande__sous-titre { margin: 0.2rem 0 0; color: var(--texte-doux); font-size: 0.88rem; }

/* Les tuiles de chiffres clés. */
.pil-tuiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0.75rem; margin-bottom: 1rem; }
.pil-tuile { min-width: 0; }
.pil-tuile .indicateur__valeur { font-size: 1.6rem; white-space: nowrap; }
.pil-tuile .indicateur__detail { line-height: 1.45; }
.pil-tuile--premiere { border-left: 3px solid var(--bleu); }
.pil-tuile--danger { border-left: 3px solid var(--danger); }
.pil-ecart { color: var(--texte-doux); white-space: nowrap; }
.pil-ecart--hausse, .pil-ecart--baisse, .pil-ecart--stable { font-weight: 650; }
.pil-ecart--hausse { color: var(--succes); }
.pil-ecart--baisse { color: var(--danger); }
.pil-texte-danger { color: var(--danger); }
.pil-texte-alerte { color: var(--alerte); font-weight: 600; }

/* Les cartes. */
.pil-grille { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; align-items: start; margin-bottom: 1rem; }
.pil-grille--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.pil-carte { min-width: 0; margin-bottom: 1rem; container-type: inline-size; }
.pil-grille > .pil-carte { margin-bottom: 0; }
.pil-carte .carte__entete h3 { font-size: 1rem; }
.pil-carte__pied { border-top: 1px solid var(--bordure); padding-top: 0.75rem; padding-bottom: 0.9rem; }
.pil-note { margin: 0.75rem 0 0; font-size: 0.8rem; color: var(--texte-doux); line-height: 1.5; }
.pil-note--haut { margin: 0 0 0.7rem; }
.pil-carte__pied .pil-note { margin: 0; }
.pil-note--alerte { padding: 0.55rem 0.75rem; border-radius: 8px; background: var(--alerte-fond); color: #6b4a10; }
.pil-sous-titre { margin: 1.15rem 0 0.4rem; font-size: 0.84rem; font-weight: 650; color: var(--texte); }

/* Le graphe des douze mois : colonnes en HTML, lisibles à toutes les largeurs. */
.pil-legende { display: flex; flex-wrap: wrap; gap: 0.3rem 1rem; margin: 0 0 0 auto; padding: 0; list-style: none; font-size: 0.8rem; color: var(--texte-doux); }
.pil-legende li { display: inline-flex; align-items: center; gap: 0.4rem; }
.pil-legende__barre { width: 10px; height: 12px; border-radius: 3px 3px 0 0; background: var(--bleu); }
.pil-legende__repere { width: 16px; height: 2px; border-radius: 1px; background: var(--texte); }
.pil-graphe { position: relative; margin: 0; }
.pil-graphe__zone { display: grid; grid-template-columns: 3.6rem minmax(0, 1fr); height: 13.5rem; margin-top: 0.4rem; }
.pil-graphe__axe { position: relative; }
.pil-graphe__axe span { position: absolute; right: 0.6rem; transform: translateY(50%); font-size: 0.72rem; color: var(--texte-faible); font-variant-numeric: tabular-nums; white-space: nowrap; }
.pil-graphe__trace { position: relative; }
.pil-graphe__ligne { position: absolute; left: 0; right: 0; height: 0; border-top: 1px solid var(--bordure); }
.pil-graphe__ligne--base { border-top-color: var(--bordure-forte); }
.pil-graphe__colonnes { position: absolute; inset: 0; display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); margin: 0; padding: 0; list-style: none; }
.pil-graphe__colonne { position: relative; border-radius: 6px 6px 0 0; outline: none; }
.pil-graphe__colonne:hover, .pil-graphe__colonne--active { background: rgba(54, 91, 109, 0.07); }
.pil-graphe__colonne:focus-visible { box-shadow: inset 0 0 0 2px var(--orange); }
.pil-graphe__barre { position: absolute; bottom: 0; left: 50%; width: min(24px, 56%); min-height: 2px; transform: translateX(-50%); border-radius: 4px 4px 0 0; background: var(--bleu); }
.pil-graphe__colonne--en-cours .pil-graphe__barre { opacity: 0.55; }
.pil-graphe__repere { position: absolute; left: 50%; width: calc(min(24px, 56%) + 10px); height: 2px; transform: translate(-50%, 50%); border-radius: 1px; background: var(--texte); box-shadow: 0 0 0 1px var(--surface); }
.pil-graphe__mois { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); margin: 0.35rem 0 0 3.6rem; padding: 0; list-style: none; font-size: 0.72rem; color: var(--texte-faible); text-align: center; }
.pil-graphe__bulle { position: absolute; z-index: 5; min-width: 12.5rem; padding: 0.55rem 0.75rem; border: 1px solid var(--bordure); border-radius: 10px; background: var(--surface); box-shadow: var(--ombre-3); font-size: 0.8rem; pointer-events: none; }
.pil-graphe__bulle[hidden] { display: none; }
.pil-graphe__bulle strong { display: block; margin-bottom: 0.25rem; color: var(--texte); }
.pil-graphe__bulle-ligne { display: flex; justify-content: space-between; gap: 1rem; color: var(--texte-doux); }
.pil-graphe__bulle-ligne b { color: var(--texte); font-weight: 650; font-variant-numeric: tabular-nums; }
.pil-donnees { margin-top: 0.75rem; }
.pil-donnees summary { cursor: pointer; font-size: 0.82rem; color: var(--bleu); }
.pil-donnees .tableau-enveloppe { margin-top: 0.5rem; border: 1px solid var(--bordure); border-radius: 8px; }

/* Barres horizontales : libellé et valeur, la piste dessous ; sur une ligne
   quand la carte est assez large. */
.pil-barres { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.7rem; }
.pil-barres__ligne { display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "libelle valeur" "piste piste"; align-items: baseline; gap: 0.3rem 0.75rem; font-size: 0.86rem; }
.pil-barres__libelle { grid-area: libelle; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pil-barres__valeur { grid-area: valeur; }
.pil-barres__piste { grid-area: piste; display: block; height: 0.6rem; border-radius: 999px; background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--bordure); overflow: hidden; }
.pil-barres__piste span { display: block; height: 100%; border-radius: 999px; background: var(--bleu); }
.pil-barres__ligne--faible .pil-barres__piste span { background: var(--texte-faible); }
.pil-barres__ligne--danger .pil-barres__piste span { background: var(--danger); }
.pil-barres__ligne--danger .pil-barres__libelle { color: var(--danger); font-weight: 650; }
.pil-barres__valeur { text-align: right; font-weight: 650; font-variant-numeric: tabular-nums; white-space: nowrap; line-height: 1.25; }
.pil-barres__valeur small, .pil-liste__valeur small, .pil-chiffres small { display: block; font-size: 0.74rem; font-weight: 400; color: var(--texte-faible); }
.pil-barres__valeur small { display: inline; margin-left: 0.4rem; }
@container (min-width: 30rem) {
  .pil-barres__ligne { grid-template-columns: minmax(6.5rem, 10rem) minmax(0, 1fr) auto; grid-template-areas: "libelle piste valeur"; align-items: center; }
  .pil-barres__valeur small { display: block; margin-left: 0; }
}

/* Du premier contact à la signature. */
.pil-entonnoir { list-style: none; margin: 0 0 0.4rem; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0.55rem; }
.pil-entonnoir li { position: relative; min-width: 0; padding: 0.65rem 0.4rem; border-radius: 10px; background: var(--surface-2); text-align: center; }
.pil-entonnoir li + li::before { content: "›"; position: absolute; left: -0.28rem; top: 50%; transform: translate(-50%, -50%); color: var(--texte-faible); font-size: 1.1rem; line-height: 1; }
.pil-entonnoir__nombre { display: block; font-size: 1.45rem; font-weight: 700; line-height: 1.1; font-variant-numeric: tabular-nums; }
.pil-entonnoir__libelle { display: block; font-size: 0.78rem; }
.pil-entonnoir__detail { display: block; margin-top: 0.15rem; font-size: 0.72rem; color: var(--texte-faible); }

/* Chiffres en liste, et le petit compte de résultat. */
.pil-chiffres { margin: 0.9rem 0 0; }
.pil-chiffres > div { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; padding: 0.45rem 0; border-top: 1px solid var(--bordure); font-size: 0.86rem; }
.pil-chiffres > div:first-child { border-top: none; }
.pil-chiffres dt { color: var(--texte-doux); }
.pil-chiffres dd { margin: 0; text-align: right; font-weight: 650; font-variant-numeric: tabular-nums; }
.pil-chiffres--compte { margin-top: 0; }
.pil-chiffres > .pil-chiffres__total { border-top-color: var(--bordure-forte); }
.pil-chiffres__total dt { color: var(--texte); font-weight: 650; }

/* Listes : clients, devis à relancer. */
.pil-liste { list-style: none; margin: 0; padding: 0; }
.pil-liste li { display: flex; justify-content: space-between; align-items: center; gap: 0.8rem; padding: 0.6rem 1.15rem; border-top: 1px solid var(--bordure); font-size: 0.88rem; }
.pil-liste li:first-child { border-top: none; }
.pil-liste a { min-width: 0; font-weight: 600; }
.pil-liste a small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 0.76rem; font-weight: 400; color: var(--texte-faible); }
.pil-liste__valeur { flex: none; text-align: right; font-weight: 650; white-space: nowrap; font-variant-numeric: tabular-nums; }
.pil-liste--serree li { padding: 0.5rem 0; }

/* Jauge des frais couverts, avancement et marge des chantiers. */
.pil-jauge { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 0.75rem; margin-top: 1rem; font-size: 0.86rem; }
.pil-jauge .pil-barres__piste { grid-area: auto; }
.pil-jauge__valeur { font-weight: 650; font-variant-numeric: tabular-nums; }
.pil-avancement { display: inline-block; vertical-align: middle; width: 3.5rem; height: 0.4rem; margin-right: 0.4rem; border-radius: 999px; background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--bordure); overflow: hidden; }
.pil-avancement span { display: block; height: 100%; background: var(--bleu); }
.pil-chantiers td { vertical-align: top; }
.pil-marge { font-weight: 650; }
.pil-marge--danger { color: var(--danger); }
.pil-marge--alerte { color: var(--alerte); }
.pil-marge--succes { color: var(--succes); }

@media (max-width: 1100px) {
  .pil-tuiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .pil-grille--3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .pil-grille--3 > :nth-child(3) { grid-column: 1 / -1; }
}
@media (max-width: 860px) {
  .pil-grille, .pil-grille--3 { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 560px) {
  .pil-bande { margin-top: 1.75rem; }
  .pil-periodes { display: grid; grid-template-columns: 1fr 1fr; width: 100%; border-radius: 14px; }
  .pil-periodes a { text-align: center; border-radius: 12px; }
  .pil-tuiles { gap: 0.5rem; }
  .pil-tuile { padding: 0.8rem 0.85rem; }
  .pil-tuile .indicateur__valeur { font-size: 1.2rem; }
  .pil-graphe__zone { grid-template-columns: 2.9rem minmax(0, 1fr); height: 11rem; }
  .pil-graphe__axe span { right: 0.4rem; font-size: 0.68rem; }
  .pil-graphe__mois { margin-left: 2.9rem; font-size: 0.68rem; }
  .pil-graphe__mois li:nth-child(odd) { visibility: hidden; }
  .pil-point__lien { grid-template-columns: minmax(0, 1fr); gap: 0.3rem; padding: 0.7rem 0.9rem; }
  .pil-point__detail { text-align: left; white-space: normal; font-size: 0.8rem; }
  .pil-liste li { padding-inline: 0.9rem; }
  .pil-liste--serree li { padding-inline: 0; }
}
/* Le mois en cours, en tête de l'accueil de la direction. */
.pil-resume { display: flex; flex-wrap: wrap; align-items: center; gap: 0.45rem 1.4rem; margin-bottom: 1.25rem; padding: 0.8rem 1.1rem; border: 1px solid var(--bordure); border-left: 3px solid var(--bleu); border-radius: var(--rayon); background: var(--surface); box-shadow: var(--ombre-1); color: var(--texte); font-size: 0.9rem; text-decoration: none; }
.pil-resume:hover { border-color: var(--bordure-forte); border-left-color: var(--bleu); box-shadow: var(--ombre-2); text-decoration: none; }
.pil-resume strong { font-variant-numeric: tabular-nums; }
.pil-resume__titre { font-size: 0.72rem; font-weight: 650; letter-spacing: 0.06em; text-transform: uppercase; color: var(--texte-faible); }
.pil-resume__lien { display: inline-flex; align-items: center; gap: 0.25rem; margin-left: auto; color: var(--bleu); font-weight: 600; }
@media (max-width: 560px) {
  .pil-resume { flex-direction: column; align-items: flex-start; }
  .pil-resume__lien { margin-left: 0; }
}
@media (max-width: 700px) {
  /* En carte, le chantier fait le titre : sans intitulé, sur toute la largeur. */
  .pil-chantiers.tableau--cartes td:first-child { display: block; padding-bottom: 0.45rem; text-align: left; }
  .pil-chantiers.tableau--cartes td:first-child::before { content: none; }
}

/* Modèle d'e-mail : le message tel qu'il sera reçu. */
.apercu-email { display: block; width: 100%; height: 760px; border: 1px solid var(--bordure, #e3e0da); border-radius: 12px; background: #f6f4f0; }
@media (max-width: 700px) { .apercu-email { height: 640px; } }

/* Conditions du marché : le texte, article par article (fiche du devis). */
.conditions-texte { border-top: 1px solid var(--bordure); padding-top: 0.6rem; }
.conditions-texte__bouton { display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; cursor: pointer; font-weight: 600; color: var(--bleu); list-style: none; padding: 0.3rem 0; }
.conditions-texte__bouton::-webkit-details-marker { display: none; }
.conditions-texte__bouton::before { content: "✎"; }
.conditions-article { border: 1px solid var(--bordure); border-radius: 12px; background: var(--surface); margin-top: 0.4rem; overflow: hidden; }
.conditions-article[open] { border-color: var(--bordure-forte); box-shadow: var(--ombre-1, 0 1px 2px rgba(0, 0, 0, 0.05)); }
.conditions-article__resume { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; padding: 0.6rem 0.75rem; min-height: 44px; cursor: pointer; list-style: none; font-size: 0.9rem; }
.conditions-article__resume::-webkit-details-marker { display: none; }
.conditions-article[open] > .conditions-article__resume { background: var(--surface-2); border-bottom: 1px solid var(--bordure); }
.conditions-article__titre { display: flex; align-items: center; gap: 0.5rem; font-weight: 600; min-width: 0; }
.conditions-article__numero { flex: none; display: inline-flex; align-items: center; justify-content: center; min-width: 1.5rem; height: 1.5rem; padding: 0 0.3rem; border-radius: 999px; background: #e8eff2; color: var(--bleu-fonce); font-size: 0.75rem; font-weight: 700; }
.conditions-article--retire .conditions-article__titre { color: var(--texte-faible); text-decoration: line-through; }
.conditions-article__corps { padding: 0.75rem; gap: 0.6rem; }
.conditions-article__corps .champ-ligne { width: 100%; }
.conditions-article__texte { min-height: 11rem; line-height: 1.5; resize: vertical; }
.conditions-article__actions { display: flex; flex-wrap: wrap; gap: 0.4rem; }

/* Photos d'un procès-verbal de réception (gestion et espace client) : vignettes en grille, retrait d'un geste. */
.photos-pv { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 0.5rem; }
.photos-pv--reserve { grid-template-columns: repeat(auto-fill, 72px); margin-top: 0.45rem; align-items: start; }
.photos-pv__titre { grid-column: 1 / -1; font-size: 0.7rem; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; color: var(--texte-faible); }
.photo-pv { position: relative; display: block; margin: 0; aspect-ratio: 1; border-radius: 12px; overflow: hidden; background: var(--fond); border: 1px solid var(--bordure); }
.photo-pv a { display: block; width: 100%; height: 100%; }
.photo-pv img { display: block; width: 100%; height: 100%; object-fit: cover; }
.photo-pv form { position: absolute; top: 4px; right: 4px; margin: 0; }
.photo-pv__retirer { display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px; padding: 0; border: none; border-radius: 50%; background: rgba(38, 63, 76, 0.82); color: #fff; font-size: 0.8rem; line-height: 1; cursor: pointer; }
.photo-pv__retirer:hover, .photo-pv__retirer:focus-visible { background: var(--danger, #b3261e); outline: none; }

/* Fiche chantier : quatre chiffres hors taxes après l'avancement (travaux, facturé, dépensé, marge). */
.chiffres-chantier--marge { grid-template-columns: minmax(160px, 1.3fr) repeat(4, minmax(115px, 1fr)); }
@media (max-width: 720px) {
  .chiffres-chantier--marge { grid-template-columns: repeat(2, 1fr); }
  .chiffres-chantier--marge .chiffre-chantier--lien { grid-column: auto; }
}

/* Le détail d'une réserve (libellé, photos, levée) reste d'un bloc quand le tableau passe en cartes sur téléphone. */
.reserve-detail { flex: 1; min-width: 0; text-align: left; }
.reserve-detail .tableau__principal { display: block; }

/* Lecteur PDF de l'application installée (voir la fin de js/admin.js) : par-dessus la page, avec un retour. */
.lecteur-pdf-ouvert, .lecteur-pdf-ouvert body { overflow: hidden; }
.lecteur-pdf { position: fixed; inset: 0; z-index: 4000; display: flex; flex-direction: column; background: #eceff1; }
.lecteur-pdf__barre { display: flex; align-items: center; gap: 0.4rem; padding: calc(env(safe-area-inset-top, 0px) + 0.5rem) 0.6rem 0.5rem; background: var(--surface); border-bottom: 1px solid var(--bordure); }
.lecteur-pdf__retour, .lecteur-pdf__action { flex: none; min-height: 40px; padding: 0 0.75rem; border: 1px solid var(--bordure); border-radius: 10px; background: var(--surface); color: var(--bleu-fonce); font: inherit; font-size: 0.9rem; font-weight: 600; cursor: pointer; }
.lecteur-pdf__retour { border-color: transparent; padding-left: 0.3rem; font-size: 1rem; }
.lecteur-pdf__titre { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 0.9rem; font-weight: 600; color: var(--texte); text-align: center; }
.lecteur-pdf__pages { flex: 1; overflow: auto; -webkit-overflow-scrolling: touch; padding: 8px 8px calc(env(safe-area-inset-bottom, 0px) + 16px); text-align: center; }
.lecteur-pdf__page { display: block; width: 100%; height: auto; margin: 0 auto 8px; background: #fff; box-shadow: 0 1px 3px rgba(34, 48, 58, 0.18); }
.lecteur-pdf__pages--grand .lecteur-pdf__page { width: 220%; max-width: none; }
.lecteur-pdf__etat { margin: 3rem 1rem; color: var(--texte-doux); font-size: 0.95rem; }
@media (max-width: 420px) { .lecteur-pdf__titre { display: none; } .lecteur-pdf__retour { margin-right: auto; } }

/* Cartes de chiffres (listes, pilotage) : plus de liseré de couleur sur le côté. Une carte nette,
   un libellé en clair, et un simple point de couleur pour celle qui compte. */
.indicateur { border-radius: 10px; box-shadow: none; padding: 0.95rem 1.1rem; }
.indicateur__libelle { text-transform: none; letter-spacing: 0; font-size: 0.84rem; font-weight: 600; color: var(--texte-doux); }
.indicateur--accent, .indicateur--bleu, .indicateur--danger, .pil-tuile--premiere, .pil-tuile--danger { border-left: 1px solid var(--bordure); }
.indicateur--accent .indicateur__libelle::before, .indicateur--bleu .indicateur__libelle::before, .indicateur--danger .indicateur__libelle::before,
.pil-tuile--premiere .indicateur__libelle::before, .pil-tuile--danger .indicateur__libelle::before { content: ""; display: inline-block; width: 0.45rem; height: 0.45rem; margin-right: 0.45rem; border-radius: 50%; background: var(--orange); vertical-align: 0.08em; }
.indicateur--bleu .indicateur__libelle::before, .pil-tuile--premiere .indicateur__libelle::before { background: var(--bleu); }
.indicateur--danger .indicateur__libelle::before, .pil-tuile--danger .indicateur__libelle::before { background: var(--danger); }

/* ---------------------------------------------------------------------------
   Finitions (novembre 2026) : mêmes écrans, même organisation, un dessin plus
   net. Plus de liseré de couleur sur le côté des encadrés, plus d'ombre sous
   les cartes, des libellés en clair plutôt qu'en petites capitales espacées.
   --------------------------------------------------------------------------- */
:root { --fond: #f5f4f1; --bordure: #e4e1da; --rayon: 14px; }

/* Cartes : un trait fin, pas d'ombre. */
.carte { box-shadow: none; }
.carte__entete h2 { letter-spacing: -0.005em; }

/* Tableaux : en-têtes en clair. */
.tableau thead th { text-transform: none; letter-spacing: 0; font-size: 0.8rem; font-weight: 600; color: var(--texte-doux); background: transparent; }
.tableau tbody tr:hover { background: var(--surface-2); }

/* Libellés des chiffres : en clair, eux aussi. */
.chiffre-chantier__libelle, .marge__libelle, .etat-chantier__libelle, .bilan-facturation__libelle, .com-score__libelle, .pil-resume__titre, .recap-devis__etiquette {
  text-transform: none; letter-spacing: 0; font-size: 0.8rem; font-weight: 600;
}

/* Messages et encadrés : un fond teinté et un trait fin tout autour, sans barre épaisse à gauche. */
.message { border: 1px solid transparent; border-radius: 10px; }
.message--succes { border-color: #cfe3d4; }
.message--erreur { border-color: #efcfc5; }
.message--alerte { border-color: #efdcb5; }
.message--info { border-color: #cfdde4; }
.a-faire-client, .etat-chantier, .com-alerte, .com-probleme, .pil-resume, .rafale__ligne, .dossier-st__taches li, .nc-tache, .etape-contrat {
  border-left-width: 1px;
}
.a-faire-client { border-left-color: var(--bordure); }
.suivi-tache__mot, .rdv-public__message { border-left: 0; border-radius: 10px; }

/* Menu : la page en cours sur un fond doux, sans trait de couleur. */
.barre__lien[aria-current="page"], .article--actif { box-shadow: none; }
.barre__lien[aria-current="page"] { background: #e9eff2; color: var(--bleu-fonce); }

/* Boutons : coins un peu plus ronds, bouton principal sans ombre colorée. */
.bouton { border-radius: 10px; }
.bouton--primaire { box-shadow: none; }
.bouton--neutre { border-color: var(--bordure); }
.bouton--neutre:hover:not(:disabled) { border-color: var(--bordure-forte); background: var(--surface-2); }

/* Champs : même arrondi que les boutons, contour plus doux. */
.champ input[type="text"], .champ input[type="email"], .champ input[type="password"], .champ input[type="tel"], .champ input[type="url"],
.champ input[type="number"], .champ input[type="date"], .champ input[type="search"], .champ select, .champ textarea { border-radius: 10px; }

/* Pastilles d'état : un peu plus discrètes. */
.pastille { font-weight: 600; }

/* ===========================================================================
   Gestion — « Liquid Glass » (novembre 2026)
   Demande du dirigeant : l'esthétique du dernier système d'Apple, sans rien
   déplacer. Cette couche ne change donc que la matière : un fond doux, des
   surfaces de verre (translucides, arête lumineuse, coins amples), des
   boutons et des champs en capsule. Elle ne vaut que pour la gestion
   (`body.gestion`, posé par base/layout-admin.njk) : l'espace client a sa
   propre feuille, le site public n'est pas concerné.
   Le flou d'arrière-plan n'est posé que sur ce qui flotte (menu, en-tête,
   barre du bas, onglets collants, menus, fenêtres) : sur des dizaines de
   cartes il ralentirait un téléphone, et sur un fond uni il ne se verrait pas.
   =========================================================================== */
body.gestion {
  --police: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --fond: #eef1f4;
  --surface: #ffffff;
  --surface-2: rgba(246, 248, 250, 0.72);
  --bordure: rgba(38, 63, 76, 0.1);
  --bordure-forte: rgba(38, 63, 76, 0.18);
  --rayon: 20px;
  --rayon-sm: 12px;
  --verre: linear-gradient(180deg, rgba(255, 255, 255, 0.82), rgba(255, 255, 255, 0.62));
  --verre-fort: linear-gradient(180deg, rgba(255, 255, 255, 0.94), rgba(255, 255, 255, 0.8));
  --verre-flou: blur(22px) saturate(1.8);
  --verre-arete: inset 0 1px 0 rgba(255, 255, 255, 0.9), inset 0 0 0 1px rgba(255, 255, 255, 0.55);
  --verre-ombre: 0 1px 1px rgba(31, 45, 54, 0.03), 0 12px 32px -20px rgba(31, 45, 54, 0.28);
  background: var(--fond);
}
/* Le fond : trois lueurs très douces aux couleurs de l'entreprise, fixes derrière la page. */
body.gestion::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(62rem 40rem at 8% -12%, rgba(54, 91, 109, 0.2), transparent 62%),
    radial-gradient(48rem 34rem at 104% 6%, rgba(222, 114, 47, 0.11), transparent 60%),
    radial-gradient(60rem 44rem at 55% 118%, rgba(95, 135, 153, 0.18), transparent 62%),
    #eef1f4;
}

/* --- Ce qui flotte : verre avec flou --- */
body.gestion .barre,
body.gestion .entete,
body.gestion .barre-mobile,
body.gestion .onglets-fiche,
body.gestion .menu-contextuel,
body.gestion .lecteur-pdf__barre {
  background: var(--verre);
  -webkit-backdrop-filter: var(--verre-flou);
  backdrop-filter: var(--verre-flou);
}
body.gestion .barre { border-right: 1px solid rgba(255, 255, 255, 0.7); box-shadow: 1px 0 0 rgba(38, 63, 76, 0.06); }
body.gestion .barre__marque, body.gestion .barre__pied { border-color: rgba(38, 63, 76, 0.08); }
body.gestion .barre__lien { border-radius: 12px; }
body.gestion .barre__lien:hover, body.gestion .barre__compte:hover { background: rgba(255, 255, 255, 0.6); }
body.gestion .barre__lien[aria-current="page"] {
  background: var(--verre-fort);
  color: var(--bleu-fonce);
  box-shadow: var(--verre-arete), 0 6px 16px -10px rgba(31, 45, 54, 0.35);
}
body.gestion .barre__badge { border-radius: 999px; }
body.gestion .barre__compte { border-radius: 14px; }

body.gestion .entete { border-bottom: 1px solid rgba(38, 63, 76, 0.07); box-shadow: inset 0 -1px 0 rgba(255, 255, 255, 0.6); }

/* --- Les surfaces posées : verre clair, arête lumineuse, ombre portée très douce --- */
body.gestion .carte,
body.gestion .indicateur,
body.gestion .chiffres-chantier,
body.gestion .etat-chantier,
body.gestion .etape-contrat,
body.gestion .pil-resume,
body.gestion .vide {
  background: var(--verre);
  border: 1px solid rgba(255, 255, 255, 0.75);
  border-radius: var(--rayon);
  box-shadow: var(--verre-arete), var(--verre-ombre);
}
body.gestion .carte__entete { border-bottom-color: rgba(38, 63, 76, 0.07); }
body.gestion .carte .carte, body.gestion .carte .indicateur { box-shadow: var(--verre-arete); }
body.gestion .indicateur { border-radius: 18px; }
body.gestion .indicateur__valeur { letter-spacing: -0.03em; }
body.gestion .chiffres-chantier { overflow: hidden; gap: 0; }
body.gestion .chiffres-chantier .chiffre-chantier { background: transparent; box-shadow: none; border-right: 1px solid rgba(38, 63, 76, 0.07); }
body.gestion .chiffres-chantier .chiffre-chantier:last-child { border-right: 0; }
body.gestion .marge__chiffre { background: rgba(255, 255, 255, 0.55); border-color: rgba(38, 63, 76, 0.08); border-radius: 16px; }
body.gestion .etat-chantier, body.gestion .etape-contrat, body.gestion .pil-resume { border-left: 1px solid rgba(255, 255, 255, 0.75); }

/* --- Titres : la typographie d'Apple, serrée et nette --- */
body.gestion h1 { font-size: 1.6rem; font-weight: 700; letter-spacing: -0.022em; }
body.gestion h2 { letter-spacing: -0.012em; }

/* --- Tableaux : pas de fond d'en-tête, des filets très fins --- */
body.gestion .tableau thead th { background: transparent; border-bottom-color: rgba(38, 63, 76, 0.09); }
body.gestion .tableau td { border-color: rgba(38, 63, 76, 0.06); }
body.gestion .tableau tbody tr:hover { background: rgba(255, 255, 255, 0.55); }

/* --- Boutons : des capsules. Le principal en verre teinté bleu ardoise, l'orange reste l'accent. --- */
body.gestion .bouton { border-radius: 999px; font-weight: 600; transition: transform 120ms ease, box-shadow 160ms ease, background 160ms ease; }
body.gestion .bouton:active:not(:disabled) { transform: scale(0.97); }
body.gestion .bouton--petit { border-radius: 999px; }
body.gestion .bouton--primaire {
  background: linear-gradient(180deg, #4d7387 0%, #365b6d 100%);
  color: #fff;
  border-color: rgba(38, 63, 76, 0.35);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.28), 0 8px 18px -10px rgba(38, 63, 76, 0.7);
}
body.gestion .bouton--primaire:hover:not(:disabled) { background: linear-gradient(180deg, #446a7e 0%, #2f5263 100%); }
body.gestion .bouton--neutre {
  background: var(--verre-fort);
  border-color: rgba(38, 63, 76, 0.12);
  box-shadow: var(--verre-arete), 0 4px 12px -8px rgba(31, 45, 54, 0.3);
}
body.gestion .bouton--neutre:hover:not(:disabled) { background: #fff; border-color: rgba(38, 63, 76, 0.2); }
body.gestion .bouton--fantome { border-radius: 999px; }
body.gestion .bouton--danger { box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.22); }
body.gestion .bouton-photo, body.gestion .gros-bouton { border-radius: 18px; background: rgba(255, 255, 255, 0.55); }

/* --- Champs : verre clair, anneau bleu doux au clavier --- */
body.gestion .champ input[type="text"], body.gestion .champ input[type="email"], body.gestion .champ input[type="password"],
body.gestion .champ input[type="tel"], body.gestion .champ input[type="url"], body.gestion .champ input[type="number"],
body.gestion .champ input[type="date"], body.gestion .champ input[type="search"], body.gestion .champ select, body.gestion .champ textarea,
body.gestion .champ-ligne {
  background: rgba(255, 255, 255, 0.78);
  border-color: rgba(38, 63, 76, 0.14);
  border-radius: 12px;
  box-shadow: inset 0 1px 2px rgba(31, 45, 54, 0.05);
}
body.gestion .champ input:focus, body.gestion .champ select:focus, body.gestion .champ textarea:focus, body.gestion .champ-ligne:focus {
  background: #fff;
  border-color: rgba(54, 91, 109, 0.55);
  box-shadow: 0 0 0 4px rgba(54, 91, 109, 0.14);
  outline: none;
}

/* --- Onglets : la page en cours dans une pastille de verre --- */
body.gestion .onglets-rubrique, body.gestion .onglets-fiche { border-bottom-color: rgba(38, 63, 76, 0.08); gap: 0.2rem; }
body.gestion .onglets-fiche { border-radius: 0 0 16px 16px; padding: 0 0.3rem; }
body.gestion .onglets-rubrique__lien, body.gestion .onglets-fiche__lien { border-bottom-color: transparent; border-radius: 12px; margin: 0.3rem 0; padding-top: 0.45rem; padding-bottom: 0.45rem; }
body.gestion .onglets-rubrique__lien:hover, body.gestion .onglets-fiche__lien:hover { background: rgba(255, 255, 255, 0.55); }
body.gestion .onglets-rubrique__lien[aria-current="page"], body.gestion .onglets-fiche__lien[aria-current="page"] {
  background: var(--verre-fort);
  color: var(--bleu-fonce);
  border-bottom-color: transparent;
  box-shadow: var(--verre-arete), 0 6px 14px -10px rgba(31, 45, 54, 0.4);
}

/* --- Étiquettes d'état et messages : matière légère, couleurs gardées --- */
body.gestion .pastille { border-radius: 999px; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.45); }
body.gestion .message { border-radius: 16px; box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.6); }

/* --- Menus et fenêtres : verre épais, grande ombre --- */
body.gestion .menu-contextuel { border: 1px solid rgba(255, 255, 255, 0.8); border-radius: 16px; box-shadow: var(--verre-arete), 0 24px 50px -20px rgba(31, 45, 54, 0.45); }
body.gestion .dialogue { border-radius: 24px; background: rgba(255, 255, 255, 0.92); -webkit-backdrop-filter: var(--verre-flou); backdrop-filter: var(--verre-flou); box-shadow: var(--verre-arete), 0 30px 70px -24px rgba(31, 45, 54, 0.5); }
body.gestion dialog::backdrop { background: rgba(31, 45, 54, 0.28); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }

/* --- Téléphone : la barre du bas devient une capsule de verre flottante --- */
@media (max-width: 900px) {
  body.gestion .barre { background: rgba(255, 255, 255, 0.86); }
  body.gestion .barre-mobile {
    left: 10px;
    right: 10px;
    bottom: calc(8px + env(safe-area-inset-bottom));
    padding: 0.25rem 0.3rem;
    border: 1px solid rgba(255, 255, 255, 0.8);
    border-radius: 26px;
    box-shadow: var(--verre-arete), 0 14px 34px -14px rgba(31, 45, 54, 0.45);
  }
  body.gestion .barre-mobile__lien { border-radius: 20px; }
  body.gestion .barre-mobile__lien[aria-current="page"] { color: var(--bleu-fonce); background: rgba(255, 255, 255, 0.7); box-shadow: var(--verre-arete); }
  body.gestion .barre-mobile__rond { margin-top: -0.9rem; background: linear-gradient(180deg, #4d7387, #365b6d); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.3), 0 10px 20px -8px rgba(38, 63, 76, 0.7); }
  body.gestion .barre-mobile__lien--ajouter { color: var(--bleu-fonce); }
  body.gestion .contenu { padding-bottom: calc(6.4rem + env(safe-area-inset-bottom)); }
  body.gestion .carte, body.gestion .indicateur { border-radius: 18px; }
}

/* Écrans sans flou d'arrière-plan : le verre devient presque opaque, tout reste lisible. */
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  body.gestion .barre, body.gestion .entete, body.gestion .barre-mobile, body.gestion .onglets-fiche, body.gestion .menu-contextuel { background: rgba(255, 255, 255, 0.96); }
}
@media (prefers-reduced-transparency: reduce) {
  body.gestion .barre, body.gestion .entete, body.gestion .barre-mobile, body.gestion .onglets-fiche, body.gestion .menu-contextuel { background: #fff; -webkit-backdrop-filter: none; backdrop-filter: none; }
}
@media print {
  body.gestion::before { display: none; }
  body.gestion .carte, body.gestion .indicateur { background: #fff; box-shadow: none; border-color: #ddd; }
}

/* Éditeur de devis : les lots en verre, sans barre de couleur sur le côté. */
body.gestion .lot-devis { background: var(--verre); border: 1px solid rgba(255, 255, 255, 0.75); box-shadow: var(--verre-arete), var(--verre-ombre); overflow: hidden; }
body.gestion .lot-devis__entete { border-left: 0; background: rgba(54, 91, 109, 0.06); border-bottom-color: rgba(38, 63, 76, 0.07); }

/* ---------------------------------------------------------------------------
   Gestion — « Liquid Glass », second passage (11 novembre 2026)
   Retours du dirigeant : l'orange un peu plus présent, l'allure d'Apple plus
   franche, et le bas du menu latéral coupé sur l'iPhone (application
   installée) : son nom et « Se déconnecter » n'étaient plus atteignables.
   --------------------------------------------------------------------------- */

/* --- Le menu latéral tient dans l'écran : la liste défile, le pied reste visible --- */
body.gestion .barre { height: 100vh; height: 100dvh; overflow: hidden; }
body.gestion .barre__nav { flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: none; }
body.gestion .barre__nav::-webkit-scrollbar { display: none; }
body.gestion .barre__marque, body.gestion .barre__pied { flex: none; }

/* --- Ordinateur : le menu devient un panneau de verre flottant --- */
@media (min-width: 901px) {
  body.gestion .barre {
    top: 10px;
    height: calc(100vh - 20px);
    height: calc(100dvh - 20px);
    margin: 10px 0 10px 10px;
    border: 1px solid rgba(255, 255, 255, 0.85);
    border-radius: 28px;
    box-shadow: var(--verre-arete), 0 24px 48px -28px rgba(31, 45, 54, 0.45);
  }
}

/* --- Téléphone : le tiroir respecte l'encoche et la barre d'accueil de l'iPhone --- */
@media (max-width: 900px) {
  body.gestion .barre {
    inset: 0 auto 0 0;
    height: auto;
    max-height: none;
    width: min(var(--largeur-barre), 86vw);
    padding-top: env(safe-area-inset-top);
    border-radius: 0 28px 28px 0;
    border-right: 1px solid rgba(255, 255, 255, 0.85);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.9), rgba(255, 255, 255, 0.8));
  }
  body.gestion .barre__pied { padding-bottom: calc(0.9rem + env(safe-area-inset-bottom)); }
  body.gestion .barre__deconnexion { min-height: 44px; }
  body.gestion .voile-barre { background: rgba(31, 45, 54, 0.28); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); }
  body.gestion .entete { padding-top: env(safe-area-inset-top); height: calc(var(--hauteur-entete) + env(safe-area-inset-top)); }
  body.gestion .onglets-fiche { top: calc(var(--hauteur-entete) + env(safe-area-inset-top)); }
}

/* --- L'orange, plus présent : l'action principale, la page en cours, les réglages --- */
body.gestion { accent-color: var(--orange); }
body.gestion::before {
  background:
    radial-gradient(60rem 40rem at 6% -14%, rgba(54, 91, 109, 0.22), transparent 62%),
    radial-gradient(52rem 36rem at 106% 4%, rgba(222, 114, 47, 0.2), transparent 60%),
    radial-gradient(40rem 30rem at 0% 100%, rgba(222, 114, 47, 0.1), transparent 60%),
    radial-gradient(60rem 44rem at 62% 120%, rgba(95, 135, 153, 0.2), transparent 62%),
    #eef1f4;
}
body.gestion .bouton--primaire {
  background: linear-gradient(180deg, #ee8a47 0%, #de722f 100%);
  border-color: rgba(192, 95, 34, 0.55);
  color: #fff;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.38), 0 10px 22px -12px rgba(222, 114, 47, 0.9);
}
body.gestion .bouton--primaire:hover:not(:disabled) { background: linear-gradient(180deg, #e97f3a 0%, #cf6626 100%); }
body.gestion .barre__lien[aria-current="page"] svg { color: var(--orange); }
body.gestion .barre__lien[aria-current="page"]::after { content: ""; width: 6px; height: 6px; margin-left: auto; border-radius: 50%; background: var(--orange); box-shadow: 0 0 0 3px rgba(222, 114, 47, 0.16); }
body.gestion .barre__lien[aria-current="page"]:has(.barre__badge)::after { display: none; }
body.gestion .barre__badge { background: linear-gradient(180deg, #ee8a47, #de722f); color: #fff; box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.35); }
body.gestion .barre__avatar { background: linear-gradient(160deg, #4d7387, #263f4c); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.3), 0 0 0 2px rgba(222, 114, 47, 0.55); }
body.gestion .avancement__barre { background: linear-gradient(90deg, #de722f, #f0a063); }
body.gestion .avancement__barre--termine { background: linear-gradient(90deg, #4a7c59, #6fa37f); }
body.gestion a:not(.bouton):not(.barre__lien):not(.onglets-rubrique__lien):not(.onglets-fiche__lien):not(.barre-mobile__lien):hover { color: var(--orange-fonce); }
body.gestion .champ input:focus, body.gestion .champ select:focus, body.gestion .champ textarea:focus, body.gestion .champ-ligne:focus {
  border-color: rgba(222, 114, 47, 0.6);
  box-shadow: 0 0 0 4px rgba(222, 114, 47, 0.16);
}
body.gestion :focus-visible { outline-color: var(--orange); }

/* --- Onglets : un vrai contrôle segmenté, la page en cours dans sa pastille blanche --- */
body.gestion .onglets-rubrique, body.gestion .onglets-fiche {
  gap: 2px;
  padding: 4px;
  border: 1px solid rgba(255, 255, 255, 0.7);
  border-radius: 999px;
  background: rgba(118, 130, 140, 0.14);
  box-shadow: inset 0 1px 2px rgba(31, 45, 54, 0.08);
}
body.gestion .onglets-rubrique { width: fit-content; max-width: 100%; margin-top: 0; }
body.gestion .onglets-fiche { background: rgba(232, 236, 240, 0.72); margin-top: 0.4rem; }
body.gestion .onglets-rubrique__lien, body.gestion .onglets-fiche__lien { margin: 0; padding: 0.42rem 0.95rem; border: 0; border-radius: 999px; font-size: 0.88rem; }
body.gestion .onglets-rubrique__lien[aria-current="page"], body.gestion .onglets-fiche__lien[aria-current="page"] {
  background: #fff;
  color: var(--bleu-fonce);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.9) inset, 0 3px 10px -4px rgba(31, 45, 54, 0.35), 0 0 0 0.5px rgba(31, 45, 54, 0.06);
}

/* --- Matière : coins plus amples, reflet en biais, relief au survol --- */
body.gestion { --rayon: 24px; --rayon-sm: 14px; --verre: linear-gradient(135deg, rgba(255, 255, 255, 0.9) 0%, rgba(255, 255, 255, 0.6) 55%, rgba(255, 255, 255, 0.72) 100%); }
body.gestion .carte, body.gestion .indicateur, body.gestion .chiffres-chantier, body.gestion .etat-chantier, body.gestion .lot-devis { border-radius: 24px; }
body.gestion .indicateur { transition: transform 180ms ease, box-shadow 180ms ease; }
@media (hover: hover) {
  body.gestion .indicateur:hover { transform: translateY(-2px); box-shadow: var(--verre-arete), 0 18px 36px -22px rgba(31, 45, 54, 0.4); }
}
body.gestion .indicateur__valeur { font-size: 1.9rem; font-weight: 700; }
body.gestion h1 { font-size: 1.75rem; letter-spacing: -0.028em; }
body.gestion .entete { background: linear-gradient(180deg, rgba(255, 255, 255, 0.78), rgba(255, 255, 255, 0.52)); -webkit-backdrop-filter: blur(28px) saturate(1.9); backdrop-filter: blur(28px) saturate(1.9); }
body.gestion .champ input[type="text"], body.gestion .champ input[type="email"], body.gestion .champ input[type="password"],
body.gestion .champ input[type="tel"], body.gestion .champ input[type="url"], body.gestion .champ input[type="number"],
body.gestion .champ input[type="date"], body.gestion .champ input[type="search"], body.gestion .champ select, body.gestion .champ textarea,
body.gestion .champ-ligne { border-radius: 14px; }
body.gestion .champ input[type="search"] { border-radius: 999px; }
body.gestion .pastille { -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
body.gestion .message { border-radius: 18px; }
body.gestion .menu-contextuel { border-radius: 20px; padding: 0.45rem; }
body.gestion .dialogue { border-radius: 28px; }
body.gestion .tableau-enveloppe { border-radius: 0 0 24px 24px; }
body.gestion ::selection { background: rgba(222, 114, 47, 0.22); }

@media (max-width: 900px) {
  body.gestion .barre-mobile { border-radius: 30px; bottom: calc(6px + env(safe-area-inset-bottom)); }
  body.gestion .barre-mobile__lien[aria-current="page"] { color: var(--orange-fonce); }
  body.gestion .barre-mobile__rond { background: linear-gradient(180deg, #ee8a47, #de722f); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.4), 0 10px 22px -8px rgba(222, 114, 47, 0.85); }
  body.gestion .barre-mobile__lien--ajouter { color: var(--orange-fonce); }
  body.gestion .carte, body.gestion .indicateur, body.gestion .chiffres-chantier, body.gestion .etat-chantier, body.gestion .lot-devis { border-radius: 22px; }
  body.gestion h1 { font-size: 1.6rem; }
}

/* Retours du 11 novembre : sur ordinateur, la barre du haut flotte elle aussi, arrondie comme le menu ;
   plus de point orange sur la ligne en cours du menu (l'icône orange et la pastille de verre suffisent). */
body.gestion .barre__lien[aria-current="page"]::after { content: none; }
@media (min-width: 901px) {
  body.gestion .entete {
    top: 10px;
    margin: 10px 10px 0;
    border: 1px solid rgba(255, 255, 255, 0.85);
    border-radius: 22px;
    box-shadow: var(--verre-arete), 0 16px 34px -26px rgba(31, 45, 54, 0.45);
  }
  body.gestion .onglets-fiche { top: calc(var(--hauteur-entete) + 18px); }
}

/* Logo du menu (gestion) : au centre, sur un socle de verre. Sans animation (retirée à la demande du dirigeant). */
body.gestion .barre__marque {
  align-items: center;
  gap: 0.55rem;
  margin: 0.6rem 0.6rem 0;
  padding: 1.15rem 0.8rem 0.95rem;
  border: 1px solid rgba(255, 255, 255, 0.85);
  border-radius: 22px;
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.95), rgba(255, 255, 255, 0.55));
  box-shadow: var(--verre-arete), 0 12px 26px -20px rgba(31, 45, 54, 0.5);
  text-align: center;
  text-decoration: none;
}
body.gestion .barre__logo-image { width: 152px; max-width: 100%; }
body.gestion .barre__sous-titre { padding: 0.14rem 0.7rem; border-radius: 999px; background: rgba(54, 91, 109, 0.08); color: var(--bleu); font-size: 0.68rem; font-weight: 700; letter-spacing: 0.16em; }
@media (max-width: 900px) {
  body.gestion .barre__marque { margin-top: 0.5rem; }
  body.gestion .barre__logo-image { width: 140px; }
}

/* ---------------------------------------------------------------------------
   Gestion — coins hauts des cartes (11 novembre 2026)
   Sur les grandes listes, la barre de filtres (fond teinté, coins droits)
   dépassait de l'arrondi de sa carte : les coins étaient ronds en bas, pas en
   haut. Le premier bloc d'une carte reprend maintenant l'arrondi de la carte,
   et le dernier aussi.
   --------------------------------------------------------------------------- */
body.gestion .carte > :first-child { border-top-left-radius: inherit; border-top-right-radius: inherit; }
body.gestion .carte > :last-child { border-bottom-left-radius: inherit; border-bottom-right-radius: inherit; }
body.gestion .carte > form:first-child > .filtres:first-child { border-top-left-radius: inherit; border-top-right-radius: inherit; }

/* ---------------------------------------------------------------------------
   Gestion — retours du 12 novembre 2026
   1. Le sélecteur d'onglets d'une fiche (Documents, chantier, Communication)
      prenait toute la largeur de la page : il s'arrête maintenant à ses
      onglets, comme celui des rubriques.
   2. Menu en sélecteur : les entrées du menu latéral ont la même apparence
      que ce sélecteur. Une piste grisée les réunit, la page en cours y est
      une pastille blanche.
   --------------------------------------------------------------------------- */
body.gestion .onglets-fiche { width: fit-content; max-width: 100%; }
@media (max-width: 900px) {
  body.gestion .onglets-fiche { margin-left: 0; margin-right: 0; padding: 4px; }
}

body.gestion .barre__piste {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 4px;
  border: 1px solid rgba(255, 255, 255, 0.7);
  border-radius: 26px;
  background: rgba(118, 130, 140, 0.14);
  box-shadow: inset 0 1px 2px rgba(31, 45, 54, 0.08);
}
body.gestion .barre__piste .barre__lien {
  margin: 0;
  padding: 0.56rem 0.9rem;
  border-radius: 999px;
  color: var(--texte-doux);
  font-size: 0.9rem;
  font-weight: 600;
}
body.gestion .barre__piste .barre__lien:hover { background: rgba(255, 255, 255, 0.55); color: var(--texte); }
body.gestion .barre__piste .barre__lien[aria-current="page"] {
  background: #fff;
  color: var(--bleu-fonce);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.9) inset, 0 3px 10px -4px rgba(31, 45, 54, 0.35), 0 0 0 0.5px rgba(31, 45, 54, 0.06);
}

/* ---------------------------------------------------------------------------
   Communication › Fréquentation du site (13 novembre 2026)
   --------------------------------------------------------------------------- */
body.gestion .freq-barres { height: 190px; gap: 3px; }
body.gestion .freq-barres .com-barres__valeur { font-size: 0.66rem; }
body.gestion .freq-barres__repos .com-barres__barre { opacity: 0.55; }
body.gestion .freq-barres--heures { height: 96px; margin-top: 1.1rem; }
body.gestion .freq-tendance { font-weight: 700; }
body.gestion .freq-tendance--plus { color: var(--succes, #2f7d57); }
body.gestion .freq-tendance--moins { color: var(--orange); }
body.gestion .freq-jauge { display: block; height: 4px; margin-top: 0.3rem; border-radius: 999px; background: linear-gradient(90deg, var(--bleu) var(--p), rgba(31, 45, 54, 0.08) var(--p)); }
body.gestion .freq-jauge--large { height: 8px; margin: 0; }
body.gestion .freq-appareils { list-style: none; margin: 0 0 0.6rem; padding: 0; display: grid; gap: 0.55rem; }
body.gestion .freq-appareils li { display: grid; grid-template-columns: 7rem 1fr 3.4rem; align-items: center; gap: 0.7rem; }
body.gestion .freq-appareils strong { text-align: right; font-variant-numeric: tabular-nums; }
body.gestion .com-bloc .tableau td.texte-droite { white-space: nowrap; }

/* ---------------------------------------------------------------------------
   E-mails et SMS : la boîte de l'entreprise (17 novembre 2026)
   Reçus, Envoyés, un message, Écrire ; SMS libres.
   --------------------------------------------------------------------------- */
body.gestion .boite-nav { margin-bottom: 1.1rem; }
body.gestion .boite-nav__compte { display: inline-block; min-width: 1.25rem; margin-left: 0.25rem; padding: 0 0.4rem; border-radius: 999px; background: var(--orange); color: #fff; font-size: 0.7rem; font-weight: 750; line-height: 1.25rem; text-align: center; }
body.gestion .boite { overflow: hidden; }
body.gestion .boite__filtres { align-items: flex-end; }
body.gestion .boite__recherche { flex: 1 1 14rem; }
body.gestion .boite__vues { display: inline-flex; flex-wrap: wrap; gap: 0.15rem; margin-left: auto; padding: 0.18rem; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--bordure); }
body.gestion .boite__vues a { padding: 0.28rem 0.75rem; border-radius: 999px; color: var(--texte-doux); font-size: 0.8rem; font-weight: 650; text-decoration: none; white-space: nowrap; }
body.gestion .boite__vues a[aria-current="true"] { background: var(--surface); color: var(--texte); box-shadow: 0 1px 3px rgba(31, 45, 54, 0.12); }
body.gestion .boite__liste { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--bordure); }
body.gestion .boite__ligne { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 0.2rem 0.8rem; padding: 0.15rem 1rem 0.15rem 0; border-bottom: 1px solid var(--bordure); }
body.gestion .boite__ligne:last-child { border-bottom: 0; }
body.gestion .boite__ligne:hover { background: var(--surface-2); }
body.gestion .boite__lien { display: grid; grid-template-columns: minmax(9rem, 15rem) minmax(0, 1fr) auto; align-items: baseline; gap: 0.15rem 0.9rem; min-width: 0; padding: 0.6rem 0 0.6rem 1rem; color: var(--texte-doux); text-decoration: none; }
body.gestion .boite__lien:hover { text-decoration: none; }
body.gestion .boite__qui { display: flex; flex-direction: column; min-width: 0; }
body.gestion .boite__nom { overflow: hidden; color: var(--texte); font-size: 0.9rem; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
body.gestion .boite__adresse { overflow: hidden; color: var(--texte-faible); font-size: 0.74rem; text-overflow: ellipsis; white-space: nowrap; }
body.gestion .boite__point { display: inline-block; width: 0.5rem; height: 0.5rem; margin-right: 0.35rem; border-radius: 50%; background: var(--orange); vertical-align: middle; }
body.gestion .boite__qui .boite__point { position: absolute; margin: 0.42rem 0 0 -0.75rem; }
body.gestion .boite__sujet { overflow: hidden; font-size: 0.86rem; text-overflow: ellipsis; white-space: nowrap; }
body.gestion .boite__objet { color: var(--texte); }
body.gestion .boite__extrait { color: var(--texte-faible); }
body.gestion .boite__date { color: var(--texte-faible); font-size: 0.76rem; font-variant-numeric: tabular-nums; white-space: nowrap; }
body.gestion .boite__ligne--nouveau .boite__nom, body.gestion .boite__ligne--nouveau .boite__objet { font-weight: 750; }
body.gestion .boite__ligne--nouveau .boite__date { color: var(--orange); font-weight: 700; }
body.gestion .boite__ligne--auto .boite__nom, body.gestion .boite__ligne--auto .boite__objet { color: var(--texte-doux); font-weight: 500; }
body.gestion .boite__marques { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 0.3rem; max-width: 22rem; }
body.gestion .boite__marque { padding: 0.08rem 0.55rem; border-radius: 999px; background: var(--fond); color: var(--texte-doux); font-size: 0.7rem; font-weight: 700; text-decoration: none; white-space: nowrap; }
body.gestion a.boite__marque:hover { color: var(--texte); text-decoration: none; }
body.gestion .boite__marque--client { background: var(--info-fond); color: var(--info); }
body.gestion .boite__marque--inconnu { background: transparent; border: 1px dashed var(--bordure-forte); color: var(--texte-faible); font-weight: 600; }
body.gestion .boite__marque--auto { background: transparent; border: 1px solid var(--bordure); font-weight: 600; }
body.gestion .boite-message__texte { font-size: 0.95rem; line-height: 1.6; white-space: pre-wrap; overflow-wrap: anywhere; color: var(--texte); }
body.gestion .boite-message .mail__historique { margin-top: 0.9rem; }
body.gestion .boite-message .mail__pieces { margin-top: 0.9rem; }
body.gestion .boite-echanges { list-style: none; margin: 0; padding: 0; }
body.gestion .boite-echanges li { display: flex; flex-direction: column; gap: 0.05rem; padding: 0.5rem 1rem; border-bottom: 1px solid var(--bordure); }
body.gestion .boite-echanges li:last-child { border-bottom: 0; }
body.gestion .boite-echanges a { font-size: 0.88rem; font-weight: 600; overflow-wrap: anywhere; }
body.gestion .boite-ecrire { max-width: 46rem; }
body.gestion .boite-ecrire .messagerie__a input[type="email"], body.gestion .sms-libre input[type="tel"] { flex: 1; min-width: 0; padding: 0.5rem 0.7rem; border: 1px solid var(--bordure-forte); border-radius: 10px; background: var(--surface); color: var(--texte); font: inherit; font-size: 0.92rem; }
body.gestion .boite-ecrire .messagerie__a input[type="email"]:focus, body.gestion .sms-libre input[type="tel"]:focus { outline: 2px solid var(--bleu-clair); outline-offset: 1px; }
body.gestion .boite-ecrire textarea { min-height: 14rem; }
body.gestion .sms-libre { margin-bottom: 1.25rem; }
body.gestion .sms-libre .messagerie__ecrire { border-top: 0; }
@media (max-width: 760px) {
  body.gestion .boite__ligne { grid-template-columns: minmax(0, 1fr); padding: 0 0 0.55rem; }
  body.gestion .boite__lien { grid-template-columns: minmax(0, 1fr) auto; padding: 0.65rem 0.9rem 0.25rem 1.1rem; }
  body.gestion .boite__sujet { grid-column: 1 / -1; grid-row: 2; white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
  body.gestion .boite__date { grid-column: 2; grid-row: 1; }
  body.gestion .boite__marques { justify-content: flex-start; max-width: none; padding: 0 0.9rem 0 1.1rem; }
  body.gestion .boite__vues { margin-left: 0; width: 100%; border-radius: 14px; }
}

/* ---------------------------------------------------------------------------
   24 novembre 2026 — téléphone : flèches de l'application installée, barre du
   bas qui tient sa place, champs date dans leur cadre.
   --------------------------------------------------------------------------- */

/* Flèches « page précédente / suivante » : seulement dans l'application installée (Safari a déjà les siennes). */
.entete__parcours { display: none; }
.appli-installee .entete__parcours { display: inline-flex; gap: 0.15rem; flex-shrink: 0; }
.entete__fleche { display: inline-grid; place-items: center; width: 40px; height: 40px; padding: 0; border: 0; border-radius: 50%; background: rgba(54, 91, 109, 0.08); color: var(--bleu-fonce); cursor: pointer; -webkit-tap-highlight-color: transparent; }
.entete__fleche:active:not(:disabled) { background: rgba(54, 91, 109, 0.2); }
.entete__fleche:disabled { opacity: 0.28; cursor: default; }
.entete__fil { min-width: 0; overflow: hidden; white-space: nowrap; }
.entete__fil > * { flex-shrink: 0; }
.entete__fil > :last-child { flex-shrink: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 900px) {
  .appli-installee .entete { gap: 0.6rem; }
  /* Le menu est déjà dans la barre du bas : la place va aux flèches. */
  .appli-installee .entete .bouton-menu { display: none; }
}
@media print { .entete__parcours { display: none !important; } }

/* Barre du bas : sur sa propre couche, sans flou d'arrière-plan (Safari la « décrochait » pendant le défilement). */
@media (max-width: 900px) {
  html:has(body.gestion) { overflow-x: clip; }
  body.gestion { overflow-x: clip; }
  body.gestion .barre-mobile {
    background: rgba(255, 255, 255, 0.95);
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
    -webkit-transform: translate3d(0, 0, 0);
    transform: translate3d(0, 0, 0);
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
    transition: opacity 120ms ease;
  }
  body.gestion .barre-mobile.barre-mobile--cachee { opacity: 0; pointer-events: none; visibility: hidden; }
}

/* Champs date et heure : jamais plus larges que leur cadre (Safari leur donne une largeur propre). */
body.gestion .champ, body.gestion .grille > *, body.gestion .champs-grille > *, body.gestion fieldset { min-width: 0; }
body.gestion input[type="date"], body.gestion input[type="time"], body.gestion input[type="datetime-local"], body.gestion input[type="month"] {
  box-sizing: border-box;
  min-width: 0;
  max-width: 100%;
}
body.gestion .champ input[type="time"], body.gestion .champ input[type="datetime-local"], body.gestion .champ input[type="month"] {
  width: 100%;
  padding: 0.48rem 0.65rem;
  border: 1px solid rgba(38, 63, 76, 0.14);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.78);
  font: inherit;
  font-size: 0.875rem;
  color: var(--texte);
}
@supports (-webkit-touch-callout: none) {
  body.gestion input[type="date"], body.gestion input[type="time"], body.gestion input[type="datetime-local"], body.gestion input[type="month"] {
    -webkit-appearance: none;
    appearance: none;
    display: block;
    min-height: 44px;
    text-align: left;
  }
  body.gestion input::-webkit-date-and-time-value { margin: 0; min-height: 1.4em; text-align: left; }
}
@media (max-width: 900px) {
  body.gestion .champ input[type="time"], body.gestion .champ input[type="datetime-local"], body.gestion .champ input[type="month"] { font-size: 16px; padding: 0.6rem 0.7rem; }
}
@media (max-width: 520px) {
  /* Deux dates côte à côte sur un petit écran : l'une sous l'autre plutôt qu'écrasées. */
  body.gestion .grille--4:has(input[type="date"]), body.gestion .champs-grille:has(input[type="date"]), body.gestion .grille--3:has(input[type="date"]) { grid-template-columns: minmax(0, 1fr); }
}

/* Saisir les frais d'un chantier en une fois */
.finances-groupe-ligne { justify-content: space-between; align-items: center; gap: 0.6rem; flex-wrap: wrap; }
.frais-lignes { display: flex; flex-direction: column; gap: 0.5rem; }
.frais-lignes [data-frais-liste] { display: flex; flex-direction: column; gap: 0.5rem; }
.frais-lignes__titre { margin: 0.5rem 0 0; }
.frais-ligne { display: grid; grid-template-columns: minmax(0, 1fr) 7rem 9rem 7rem; gap: 0.6rem; align-items: end; padding: 0.55rem 0.7rem; border: 1px solid rgba(38, 63, 76, 0.09); border-radius: 14px; background: rgba(255, 255, 255, 0.5); }
.frais-ligne--saisie { border-color: rgba(222, 114, 47, 0.45); background: rgba(255, 255, 255, 0.85); }
.frais-ligne--depense { grid-template-columns: 9rem minmax(0, 1fr) 8rem 10rem; }
.frais-ligne--depense:has([data-tiers]:not([hidden])) { grid-template-columns: 9rem 11rem minmax(0, 1fr) 8rem 10rem; }
.frais-ligne__nom { display: flex; flex-direction: column; align-self: center; min-width: 0; }
.frais-ligne__deja { font-size: 0.76rem; color: var(--texte-faible); }
.frais-ligne__champ { display: flex; flex-direction: column; gap: 0.2rem; min-width: 0; }
.frais-ligne__champ[hidden] { display: none; }
.frais-ligne__champ > span { font-size: 0.74rem; color: var(--texte-faible); }
.frais-ligne__champ .champ-ligne { width: 100%; min-width: 0; }
.frais-ligne__total { align-self: center; text-align: right; font-weight: 650; font-variant-numeric: tabular-nums; }
.frais-total { position: sticky; bottom: 0.75rem; z-index: 12; display: flex; align-items: center; justify-content: space-between; gap: 0.8rem; flex-wrap: wrap; padding: 0.8rem 1.1rem; }
body.gestion .frais-total { background: rgba(255, 255, 255, 0.96); }
.frais-total strong { font-size: 1.2rem; margin-left: 0.4rem; font-variant-numeric: tabular-nums; }
@media (max-width: 700px) {
  .frais-ligne, .frais-ligne--depense, .frais-ligne--depense:has([data-tiers]:not([hidden])) { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .frais-ligne__nom, .frais-ligne__quoi { grid-column: 1 / -1; }
  .frais-ligne__total { grid-column: 1 / -1; }
  .frais-ligne__total:empty { display: none; }
  .frais-ligne .champ-ligne { font-size: 16px; min-height: 44px; }
  .frais-total { position: static; }
}

/* Suivi de la prospection */
.com-synthese { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0.6rem; margin-bottom: 0.9rem; }
.com-synthese > div { display: flex; flex-direction: column; gap: 0.1rem; padding: 0.7rem 0.85rem; border: 1px solid rgba(38, 63, 76, 0.08); border-radius: 14px; background: rgba(255, 255, 255, 0.55); min-width: 0; }
.com-synthese span { font-size: 0.74rem; color: var(--texte-faible); }
.com-synthese strong { font-size: 1.12rem; letter-spacing: -0.02em; }
.com-synthese em { font-style: normal; font-size: 0.74rem; color: var(--texte-doux); }
.com-jours__barre { display: block; height: 4px; margin-top: 3px; margin-left: auto; width: var(--w, 0); max-width: 100%; border-radius: 4px; background: linear-gradient(90deg, var(--orange-clair), var(--orange)); }
.com-journal { list-style: none; margin: 0.5rem 0 0; padding: 0; display: grid; gap: 0.3rem; font-size: 0.8rem; }
.com-journal__ligne span { color: var(--texte-faible); margin-right: 0.3rem; }
.com-journal__ligne--alerte { color: var(--orange-fonce); }
.com-journal__ligne--erreur { color: var(--danger); }
.com-avant__corps { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.4rem; }
.com-raisons { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.28rem; font-size: 0.86rem; }
.com-raisons__retenus { font-size: 1rem; color: var(--bleu-fonce); }
.avis-vues { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.com-etat-envoi { flex-wrap: wrap; }
@media (max-width: 800px) {
  .com-synthese { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .com-avant__corps { grid-template-columns: minmax(0, 1fr); }
}

body.gestion a.puce-filtre--active, body.gestion a.puce-filtre--active:hover { color: #fff; }
.com-jours td.texte-droite { text-align: left; }
.com-jours__barre { margin-left: 0; }
.avis-recherche { margin: 0; flex: 0 1 18rem; }

.com-jours a { overflow-wrap: anywhere; }
@media (max-width: 700px) { .com-jours__barre { display: none; } }
