/* ==========================================================================
   PLOMBIER — feuille de style du module métier (pivot « métiers d'urgence »).

   Consomme les TOKENS officiels de carillon-ui.css (palette bleu nuit / bleu
   France / blanc chaud / vermillon / vert, rayons 14/10/18, ombres, typo
   Fraunces + Inter). Chaque variable porte un repli littéral → la feuille rend
   aussi en autonomie (banc de recette), même si carillon-ui.css n'est pas là.

   Règles d'identité NON négociables (dossier CarillonPro, maquette 04) :
     - Action = bleu France. Urgence / engagement = vermillon UNIQUEMENT.
       Succès confirmé = vert UNIQUEMENT. Le simulé n'est NI l'un NI l'autre :
       liseré bleu nuit pointillé, informatif.
     - Cartes à rayon, bordure gris bleuté, ombre légère. Titres en sérif.
     - Icônes SVG trait (Lucide) : 24px, stroke currentColor. Zéro emoji.
     - Mobile terrain : cibles ≥ 48px, une main, ≥ 360/390px.
   ========================================================================== */

/* Base commune des icônes du module (sprite + glyphes inline). */
.plb-ic { width: 22px; height: 22px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; }

/* --------------------------------------------------------------------------
   0. BADGE « SIMULÉ » TRANSVERSAL (délégation LEAD — messages/billing/mobile).
   Kill-switch serveur : provider/status "simulated" dans la donnée. Le badge
   est NEUTRE et informatif : gris bleuté + liseré bleu nuit POINTILLÉ —
   distinct du vermillon (urgence/engagement) et du vert (succès confirmé).
   S'appuie sur la classe .badge existante (repli honorable si cette feuille
   n'est pas encore chargée) et la précise ici.
   -------------------------------------------------------------------------- */
.badge.sim-badge,
body .badge.sim-badge,
body.ui-revolution .item-head .badge.sim-badge {
  background: var(--gris-bleute, #e8eef7);
  color: var(--carillon-nuit, #071c3b);
  border: 1.5px dashed var(--carillon-nuit, #071c3b);
  border-radius: 999px;
  padding: 3px 10px;
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  white-space: nowrap;
}

/* NC-PU-016 — select « Métier » avec icône du sprite (zéro emoji) : l'icône du
   métier sélectionné est posée DANS le champ, le select garde son comportement
   natif (clavier/lecteur d'écran inchangés). Sync : carillon-admin-ui.js. */
.field-select-iconed { position: relative; display: block; }
.field-select-iconed .field-select-icon {
  position: absolute; left: 11px; top: 50%; transform: translateY(-50%);
  display: inline-flex; pointer-events: none; color: var(--bleu-france, #2e5aac);
}
.field-select-iconed .field-select-icon svg {
  width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.8;
}
.field-select-iconed select { width: 100%; padding-left: 36px; }

/* --------------------------------------------------------------------------
   0bis. DIALOGUE DE VALIDATION HUMAINE (carillon-confirm-ui.js — T0 UX-01/02/09).
   Récap destinataire/canal/mode avant TOUT envoi ou approbation. Bouton de
   confirmation bleu France quand l'action est SIMULÉE, vermillon quand elle
   est RÉELLE ou destructive (doctrine : rouge = validations engageantes).
   -------------------------------------------------------------------------- */
.cc-overlay {
  position: fixed; inset: 0; z-index: 640;
  display: grid; place-items: center; padding: 18px;
  background: rgba(7, 28, 59, 0.55);
}
.cc-dialog {
  width: min(460px, 100%);
  background: var(--surface, #fff);
  border-radius: var(--radius, 14px);
  box-shadow: 0 22px 60px rgba(7, 28, 59, 0.35);
  padding: 20px 22px;
}
.cc-title {
  margin: 0 0 14px;
  font-family: var(--font-titres, Fraunces, Georgia, serif);
  font-size: 1.25rem; font-weight: 600; color: var(--carillon-nuit, #071c3b);
}
.cc-recap { display: grid; gap: 7px; margin-bottom: 12px; }
.cc-row {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 8px 12px; background: var(--blanc-chaud, #faf7f0);
  border-radius: var(--radius-sm, 10px);
}
.cc-row > span { color: var(--muted, #596579); font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.05em; }
.cc-row > strong { color: var(--carillon-nuit, #071c3b); font-size: 0.92rem; text-align: right; overflow-wrap: anywhere; }
.cc-real {
  display: inline-flex; align-items: center; padding: 3px 10px;
  background: #fdecee; color: var(--carillon-rouge, #e63946);
  border: 1.5px solid var(--carillon-rouge, #e63946); border-radius: 999px;
  font-size: 0.7rem; font-weight: 800; letter-spacing: 0.06em; white-space: nowrap;
}
.cc-body {
  margin: 0 0 10px; padding: 10px 12px; max-height: 120px; overflow: auto;
  background: var(--gris-bleute, #eef2f9); border-radius: var(--radius-sm, 10px);
  color: var(--carillon-nuit, #071c3b); font-size: 0.88rem; line-height: 1.5;
}
.cc-note { margin: 0 0 16px; color: var(--muted, #596579); font-size: 0.82rem; }
.cc-actions { display: flex; justify-content: flex-end; gap: 10px; }
.cc-actions .btn { min-height: 44px; }
.cc-actions .cc-danger {
  background: var(--carillon-rouge, #e63946); border-color: var(--carillon-rouge, #e63946); color: #fff;
}
.cc-actions .cc-danger:hover { background: #c9202e; border-color: #c9202e; }
@media (max-width: 440px) {
  .cc-actions { flex-direction: column-reverse; }
  .cc-actions .btn { width: 100%; }
}

/* PLB-VAL-004 — chips de PROVENANCE des champs pré-remplis du devis
   (« fiche client », « dossier », « catalogue »…) ; « À confirmer » = vermillon
   (adresse de facturation jamais recopiée du chantier, NC-IND-005). */
.badge.prefill-src {
  margin-left: 6px;
  font-size: 0.62rem;
  padding: 1px 7px;
  vertical-align: middle;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* LOT A REFONTE — barre d'actions PAR CONVERSATION (tri manuel) + affordance
   « Ouvrir » sur chaque ligne de liste. Cibles ≥ 40px, une seule grammaire. */
.msg-conv-actions {
  display: flex; flex-wrap: wrap; gap: 8px;
  margin: 0 0 14px; padding: 10px 12px;
  background: var(--blanc-chaud, #faf7f0);
  border-radius: var(--radius-sm, 10px);
}
.msg-conv-actions .btn { min-height: 40px; }
.msg-open-hint {
  display: inline-block; padding: 3px 10px;
  border: 1px solid var(--line, #d9e2ee); border-radius: 999px;
  color: var(--carillon-bleu, #1546a0); font-size: 0.74rem; font-weight: 700;
  opacity: 0; transition: opacity 120ms ease;
}
.msg-row:hover .msg-open-hint, .msg-row:focus-visible .msg-open-hint, .msg-row.selected .msg-open-hint { opacity: 1; }
@media (prefers-reduced-motion: reduce) { .msg-open-hint { transition: none; } }
@media (max-width: 800px) { .msg-open-hint { opacity: 1; } }

/* --------------------------------------------------------------------------
   LOT B REFONTE (P1 lisibilité) — devis LARGE + récap permanent + footer
   sticky ; fiche client 88% ; exploiter la largeur (2 colonnes ≥ 900px).
   CSS pur : cette feuille charge APRÈS app.css/carillon-ui → la cascade suffit.
   -------------------------------------------------------------------------- */
/* Devis : modale LARGE (app.css la bride à max-width 720 — on lève les deux) ;
   la carte ne scrolle plus elle-même (le formulaire est l'UNIQUE ascenseur). */
.modal-card.quote-modal-card {
  width: min(1060px, 94vw);
  max-width: min(1060px, 94vw);
  overflow: hidden;
}

/* LE formulaire devient le SEUL conteneur de scroll (avant : overflow hidden
   de la carte rognait le bas du formulaire — « vertical étroit » de l'audit). */
.quote-modal-card > form {
  min-height: 0;
  overflow-y: auto;
  scrollbar-width: thin;
  padding: 0 22px 0;
}
/* Une seule barre de défilement : les lignes reprennent leur hauteur naturelle. */
.quote-modal-card .quote-lines { overflow: visible; max-height: none; }

/* Téléphone (feuille en bas d'écran) : la carte tient ENTIÈRE dans le viewport
   — footer sticky réellement visible (av. : 820px de haut pour 798 dispo,
   les actions sortaient de l'écran de 6px + scroll parasite du shell). */
@media (max-width: 800px) {
  /* !important assumé et documenté : DEUX couches legacy redondantes imposent
     ~820px (100vh-24) alors que l'offset réel du shell est 46px → le footer
     sortait de l'écran. Cas d'école ED-001 (theme-final impliquée) : ce hack
     tombe avec le retrait T1 des couche legacy. */
  .modal-card.quote-modal-card,
  body.phone-mode .modal-card.quote-modal-card {
    max-height: calc(100dvh - 60px) !important;
  }
}

/* A11y (racine du footer hors écran) : sous prefers-reduced-motion, la frame
   d'ENTRÉE de modal-pop (scale .98 + translateY 14px) reste FIGÉE — la carte
   déborde du viewport en bas. Sans animation, pas de transform résiduel. */
@media (prefers-reduced-motion: reduce) {
  .modal-card { animation: none !important; transform: none !important; }
}

/* Récap HT/TVA/TTC PERMANENT : collé au-dessus du footer pendant le scroll. */
.quote-modal-card .quote-totals {
  position: sticky;
  bottom: 76px;
  z-index: 3;
  background: var(--surface, #fff);
  border-top: 1px solid var(--line, #d9e2ee);
  padding-top: 10px;
  box-shadow: 0 -8px 16px -12px rgba(7, 28, 59, 0.25);
}
/* Footer sticky : Fermer / Enregistrer toujours accessibles. */
.quote-modal-card .modal-actions {
  position: sticky;
  bottom: 0;
  z-index: 4;
  background: var(--surface, #fff);
  margin-top: 0;
  padding: 12px 0 16px;
  border-top: 1px solid var(--line, #d9e2ee);
}

/* Exploiter la largeur : les rangées .form-grid existantes (2 colonnes) font
   déjà le travail — la nouvelle largeur de la carte les libère. Aucune grille
   ajoutée au niveau du form (un 2e étage re-divisait les champs par 4). */

/* Fiche client : 88% de largeur (au lieu de 720px). La grille interne
   .fiche-grid (230/1fr/250) existe déjà — la largeur la libère ; on donne
   juste de l'air aux colonnes latérales sur grand écran. */
.modal-card.customer-case-modal-card { width: min(88vw, 1280px); max-width: 88vw; }
@media (min-width: 1024px) {
  .customer-case-modal-card .fiche-grid { grid-template-columns: 280px minmax(0, 1fr) 300px; }
}
@media (max-width: 800px) {
  .modal-card.customer-case-modal-card { width: 100%; max-width: 100%; }
}

/* --------------------------------------------------------------------------
   LOT E1 REFONTE — TIROIR DE DÉTAIL (carillon-drawer-ui.js) : KPI/cartes =
   points d'entrée. Panneau droit (desktop) / feuille pleine largeur (mobile).
   -------------------------------------------------------------------------- */
.cdrawer-overlay {
  position: fixed; inset: 0; z-index: 620;
  background: rgba(7, 28, 59, 0.38);
  display: flex; justify-content: flex-end;
}
.cdrawer {
  width: min(480px, 92vw);
  height: 100%;
  display: flex; flex-direction: column;
  background: var(--surface, #fff);
  box-shadow: -18px 0 50px rgba(7, 28, 59, 0.28);
  animation: cdrawer-in 160ms ease-out;
}
/* Variante POPUP (détail d'un rendez-vous) : la fenêtre s'ouvre au centre. */
.cdrawer-overlay.is-centered { align-items: center; justify-content: center; padding: 20px; }
.cdrawer.is-modal {
  width: min(560px, 96vw); height: auto; max-height: min(88vh, 760px);
  border-radius: 16px; box-shadow: 0 24px 60px rgba(7, 28, 59, 0.34);
  animation: cdrawer-pop 160ms ease-out;
}
.cdrawer.is-modal .cdrawer-body { overflow: auto; }
@keyframes cdrawer-pop { from { transform: scale(0.97); opacity: 0.5; } to { transform: none; opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .cdrawer.is-modal { animation: none; } }
@keyframes cdrawer-in { from { transform: translateX(24px); opacity: 0.6; } to { transform: none; opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .cdrawer { animation: none; } }
.cdrawer-head {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 12px;
  padding: 18px 20px 14px;
  border-bottom: 1px solid var(--line, #d9e2ee);
  flex: none;
}
.cdrawer-eyebrow { margin: 0; color: var(--muted, #596579); font-size: 0.72rem; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; }
.cdrawer-title { margin: 2px 0 0; font-family: var(--font-titres, Fraunces, Georgia, serif); font-size: 1.25rem; font-weight: 600; color: var(--carillon-nuit, #071c3b); }
.cdrawer-count {
  display: inline-grid; place-items: center; min-width: 26px; height: 26px; padding: 0 7px;
  background: var(--gris-bleute, #e8eef7); color: var(--carillon-bleu-fonce, #0f3578);
  border-radius: 999px; font-family: Inter, system-ui, sans-serif; font-size: 0.82rem; font-weight: 800; vertical-align: middle;
}
.cdrawer-close {
  flex: none; display: grid; place-items: center; width: 40px; height: 40px;
  background: var(--blanc-chaud, #faf7f0); border: 1px solid var(--line, #d9e2ee);
  border-radius: 10px; cursor: pointer; color: var(--carillon-nuit, #071c3b);
}
.cdrawer-close svg { width: 16px; height: 16px; }
.cdrawer-close:hover { border-color: var(--carillon-bleu, #1546a0); }
.cdrawer-body { flex: 1; min-height: 0; overflow-y: auto; scrollbar-width: thin; padding: 14px 20px; }
.cdrawer-empty { color: var(--muted, #596579); }
.cdrawer-actions {
  flex: none; display: flex; justify-content: flex-end; gap: 10px;
  padding: 12px 20px 16px; border-top: 1px solid var(--line, #d9e2ee);
}
.cdrawer-actions .btn { min-height: 44px; }

/* Rangées de liste standard du tiroir (consommateurs). */
.cdrawer-row {
  display: flex; align-items: center; gap: 12px; width: 100%;
  padding: 11px 12px; margin-bottom: 8px; text-align: left;
  background: var(--blanc-chaud, #faf7f0); border: 1px solid transparent;
  border-radius: var(--radius-sm, 10px); cursor: pointer; font: inherit;
}
.cdrawer-row:hover, .cdrawer-row:focus-visible { border-color: var(--carillon-bleu, #1546a0); }
.cdrawer-row-main { flex: 1; min-width: 0; }
.cdrawer-row-main strong { display: block; color: var(--carillon-nuit, #071c3b); font-size: 0.92rem; }
.cdrawer-row-main small { color: var(--muted, #596579); font-size: 0.8rem; }
.cdrawer-row .montant { font-variant-numeric: tabular-nums; color: var(--carillon-nuit, #071c3b); font-weight: 700; }
@media (max-width: 800px) {
  .cdrawer-overlay { justify-content: stretch; }
  .cdrawer { width: 100%; }
}

/* KPI cliquables (billing + module) : affordance sans casser la carte. */
button.billing-kpi { text-align: left; font: inherit; cursor: pointer; border: 1px solid var(--line, #d9e2ee); }
button.billing-kpi:hover, button.billing-kpi:focus-visible { border-color: var(--carillon-bleu, #1546a0); }
button.plb-kpi { text-align: left; font: inherit; cursor: pointer; }
button.plb-kpi:hover, button.plb-kpi:focus-visible { border-color: var(--carillon-bleu, #1546a0); }

/* --------------------------------------------------------------------------
   LOT E3a REFONTE — PLANNING SEMAINE = VRAIE GRILLE CSS (module plombier).
   Colonnes jours × rangées heures ; en-têtes jours et rail horaire FIGÉS
   (sticky) pendant le défilement ; la grille défile DANS son cadre (le body
   ne défile jamais horizontalement). Hooks E3b (data-plb-drop) inertes.
   -------------------------------------------------------------------------- */
.plb-week-label { color: var(--muted, #596579); font-size: 0.9rem; margin-left: 10px; }
.plb-view-toggle { display: inline-flex; gap: 4px; padding: 4px; background: var(--gris-bleute, #e8eef7); border-radius: 999px; }
.plb-view-btn {
  min-height: 40px; padding: 7px 16px; border: 0; border-radius: 999px;
  background: transparent; color: var(--carillon-bleu-fonce, #0f3578);
  font: inherit; font-weight: 700; font-size: 0.88rem; cursor: pointer;
}
.plb-view-btn.active { background: var(--carillon-bleu, #1546a0); color: #fff; }

/* Rail « À planifier » (E3b : deviendra la source du glisser-déposer). */
.plb-toplace { margin: 0 0 14px; padding: 12px 14px; background: var(--surface, #fff); border: 1px dashed var(--carillon-bleu, #1546a0); border-radius: var(--radius, 14px); }
.plb-toplace-row { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0 6px; }
.plb-toplace-chip {
  display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 8px 14px;
  background: var(--gris-bleute, #e8eef7); color: var(--carillon-nuit, #071c3b);
  border-radius: 999px; font-size: 0.85rem; font-weight: 600;
}
.plb-toplace-chip small { color: var(--muted, #596579); }
.plb-toplace-chip { border: 1.5px solid transparent; cursor: grab; font: inherit; }
.plb-toplace-chip:hover, .plb-toplace-chip:focus-visible { border-color: var(--carillon-bleu, #1546a0); }
.plb-toplace-chip.is-dragging { opacity: 0.45; cursor: grabbing; }
.plb-toplace-hint { color: var(--muted, #596579); font-size: 0.78rem; }

/* Suivi terrain : étape non disponible (à programmer d'abord). */
.plb-step-hint {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 14px; background: var(--gris-bleute, #e8eef7);
  border-radius: var(--radius-sm, 10px);
  color: var(--carillon-bleu-fonce, #0f3578); font-size: 0.86rem; font-weight: 600;
}
.plb-step-hint .plb-ic, .plb-step-hint svg { width: 16px; height: 16px; }

/* Suivi terrain : édition du compte-rendu en place. */
.plb-report-editbox { display: grid; gap: 8px; }
.plb-report-editbox.hidden { display: none; }
.plb-report-input {
  width: 100%; padding: 10px 12px; font: inherit;
  border: 1px solid var(--line, #d9e2ee); border-radius: var(--radius-sm, 10px);
  background: var(--surface, #fff); color: var(--carillon-nuit, #071c3b);
}
.plb-block-head .btn.ghost.small { min-height: 36px; padding: 5px 10px; }

/* E3b : cellule survolée pendant le glisser = cible déclarée. */
.plb-week-cell.is-dropover {
  outline: 2px dashed var(--carillon-bleu, #1546a0);
  outline-offset: -3px;
  background: rgba(21, 70, 160, 0.07);
}

/* --------------------------------------------------------------------------
   AUD-10..15 (audit patron 22/07) — TAKEOVER planning plombier : UN seul
   écran, UNE seule ligne de contrôles. Le mobilier générique est masqué
   (jamais supprimé — un métier non-plombier retrouve tout) :
   AUD-10 grosses cartes stats → chips compactes dans la ligne du module ;
   AUD-11/12 double en-tête + contrôles épars → barre unique du module ;
   AUD-13 aside « À planifier » générique vide à droite → masqué, pleine
   largeur ; AUD-15 « Ajout manuel détaillé » → masqué (flux modale unique).
   -------------------------------------------------------------------------- */
body.plb-planning-takeover [data-panel="planning"] #planningStats,
body.plb-planning-takeover [data-panel="planning"] .planning-manual-details,
body.plb-planning-takeover [data-panel="planning"] .planning-calendar-main > .panel-head.calendar-toolbar,
body.plb-planning-takeover [data-panel="planning"] #planningAgentStatus,
body.plb-planning-takeover [data-panel="planning"] #planningToPlace {
  display: none;
}
body.plb-planning-takeover [data-panel="planning"] .planning-shell {
  grid-template-columns: minmax(0, 1fr);
}

/* La barre unique du module : nav semaine + libellé + chips + vue + action. */
.plb-plan-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 18px; }
.plb-plan-nav { display: inline-flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.plb-nav-btn {
  display: inline-grid; place-items: center; min-width: 40px; min-height: 40px;
  padding: 6px 12px; background: var(--surface, #fff);
  border: 1px solid var(--line, #d9e2ee); border-radius: 10px;
  font: inherit; font-weight: 700; color: var(--carillon-nuit, #071c3b); cursor: pointer;
}
.plb-nav-btn:hover, .plb-nav-btn:focus-visible { border-color: var(--carillon-bleu, #1546a0); }
.plb-nav-btn.is-now { background: var(--gris-bleute, #e8eef7); border-color: var(--carillon-bleu, #1546a0); }
.plb-ic-flip { transform: scaleX(-1); }
.plb-plan-chip {
  display: inline-flex; align-items: center; min-height: 28px; padding: 3px 11px;
  background: var(--gris-bleute, #e8eef7); color: var(--carillon-bleu-fonce, #0f3578);
  border-radius: 999px; font-size: 0.8rem; font-weight: 700; white-space: nowrap;
}
.plb-plan-chip.is-warn { background: #fdecee; color: #c9202e; }
.plb-plan-actions { display: inline-flex; align-items: center; gap: 10px; margin-left: auto; flex-wrap: wrap; }
.plb-slot-toggle {
  display: inline-flex; align-items: center; gap: 3px; min-height: 44px;
  padding: 4px; border: 1px solid var(--line, #d9e2ee); border-radius: 999px;
  background: var(--surface, #fff);
}
.plb-slot-toggle > span { padding: 0 7px 0 9px; color: var(--muted, #596579); font-size: .76rem; font-weight: 750; }
.plb-slot-btn {
  /* 40x44 minimum : cible tactile mobile (mesure recette 27/07 : 34px refusait
     le doigt sur le choix de granularite du planning). */
  min-height: 40px; min-width: 44px; padding: 5px 12px; border: 0; border-radius: 999px;
  background: transparent; color: var(--carillon-bleu-fonce, #0f3578);
  font: inherit; font-size: .78rem; font-weight: 800; cursor: pointer;
}
.plb-slot-btn:hover, .plb-slot-btn:focus-visible { background: var(--gris-bleute, #e8eef7); outline: none; }
.plb-slot-btn.active { background: var(--carillon-bleu, #1546a0); color: #fff; }

/* RET-12 : le mode quart d'heure reste lisible sans gonfler chaque ligne. */
.plb-week.is-step-15 .plb-week-cell { min-height: 32px; padding: 2px 4px; }
.plb-week.is-step-15 .plb-week-hour { padding: 5px 8px; font-size: .68rem; }
.plb-week.is-step-15 .plb-week-card {
  grid-template-columns: 22px minmax(0, 1fr); gap: 4px;
  min-height: 30px; padding: 3px 5px;
}
.plb-week.is-step-15 .plb-appointment-avatar.is-week { width: 22px; height: 22px; font-size: .6rem; }
.plb-week.is-step-15 .plb-week-card-copy > strong { font-size: .68rem; }
.plb-week.is-step-15 .plb-week-customer,
.plb-week.is-step-15 .plb-week-card-meta { display: none; }

/* AUD-14 : la grille occupe la hauteur disponible — l'objectif est la JOURNÉE
   ENTIÈRE visible sans ascenseur (07:00→19:00), la barre unique ayant libéré
   le haut de l'écran. Cellules compressées sur les écrans bas. */
body.plb-planning-takeover .plb-planning-host .plb-week-wrap { max-height: calc(100dvh - 235px); }
/* Pleine largeur takeover : colonnes fluides (pas de scroll horizontal, qui
   volerait 10px de hauteur à la journée) ; le contenu des cartes tronque. */
body.plb-planning-takeover .plb-planning-host .plb-week {
  min-width: 100%;
  grid-template-columns: 64px repeat(var(--plb-days, 7), minmax(0, 1fr));
}
body.plb-planning-takeover .plb-planning-host .plb-week-cell { min-width: 0; min-height: 52px; }
body.plb-planning-takeover .plb-planning-host .plb-week-card { min-width: 0; overflow: hidden; }
body.plb-planning-takeover .plb-planning-host .plb-week-card * { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* AUD-16 : en plombier le module interventions porte aussi le suivi terrain ;
   la sous-nav générique « Intervention / Suivi du jour » (héritée production
   d'un ancien profil alimentaire) disparaît — non destructif, elle revient
   pour tout autre métier. */
body.plb-production-takeover [data-panel="production"] .prod-subnav { display: none; }

/* AUD-19 (tous métiers, comme le badge SIMULÉ §0) : guide de démarrage — le
   bouton de fin d'étape (« Continuer ») restait sous le pli du panneau
   scrollable : le tout premier artisan ne trouvait pas comment terminer
   l'accueil. Le pied d'étape reste collé en bas du scroller, le contenu
   défile dessous. Scopé au guide : les autres modales ont leur pied en
   enfant direct de la carte, jamais dans un panneau. */
#onboardingModal .onboarding-panel > .modal-actions {
  position: sticky;
  bottom: 0;
  z-index: 2;
  margin-top: 12px;
  padding: 10px 0 4px;
  background: var(--surface, #fff);
  border-top: 1px solid var(--line, #d9e2ee);
}
@media (max-height: 820px) {
  body.plb-planning-takeover .plb-planning-host .plb-week-cell { min-height: 30px; }
  body.plb-planning-takeover .plb-planning-host .plb-week-hour { padding: 5px 8px; }
  body.plb-planning-takeover .plb-planning-host .plb-week-card { padding: 3px 7px; font-size: 11px; line-height: 1.3; }
}

/* Montage in-app : le board planning de l'app doit BORNER le cadre (sinon la
   grille min-content pousse la page — 193px de débordement mesurés). */
.plb-planning-host { min-width: 0; max-width: 100%; overflow: hidden; display: block; }
.plb-planning-host .plb-page { max-width: 100%; }
.plb-planning-host .plb-week-wrap { max-width: 100%; }

/* Le cadre : SEUL conteneur de défilement (2 axes), hauteur bornée. */
.plb-week-wrap {
  overflow: auto;
  max-height: min(680px, 68vh);
  border: 1px solid var(--line, #d9e2ee);
  border-radius: var(--radius, 14px);
  background: var(--surface, #fff);
  scrollbar-width: thin;
}
.plb-week-wrap:focus-visible { outline: 3px solid var(--carillon-bleu, #1546a0); outline-offset: 2px; }

/* LA grille : 1 colonne rail + 7 colonnes jours ; largeur mini par jour →
   sur petit écran elle défile dans le cadre, jamais dans la page. */
.plb-week {
  display: grid;
  grid-template-columns: 64px repeat(var(--plb-days, 7), minmax(132px, 1fr));
  min-width: max-content;
}
.plb-week-corner {
  position: sticky; top: 0; left: 0; z-index: 5;
  background: var(--surface, #fff);
  border-bottom: 1px solid var(--line, #d9e2ee);
}
.plb-week-dayhead {
  position: sticky; top: 0; z-index: 4;
  padding: 10px 12px;
  background: var(--surface, #fff);
  border-bottom: 1px solid var(--line, #d9e2ee);
  border-left: 1px solid var(--gris-bleute, #e8eef7);
}
.plb-week-dayhead strong { display: block; color: var(--carillon-nuit, #071c3b); font-size: 0.9rem; text-transform: capitalize; }
.plb-week-dayhead span { color: var(--muted, #596579); font-size: 0.78rem; font-variant-numeric: tabular-nums; }
.plb-week-dayhead.is-today { box-shadow: inset 0 -3px 0 var(--carillon-bleu, #1546a0); }
.plb-week-dayhead.is-today strong { color: var(--carillon-bleu, #1546a0); }
.plb-week-hour {
  position: sticky; left: 0; z-index: 3;
  padding: 8px 10px;
  background: var(--surface, #fff);
  border-top: 1px solid var(--gris-bleute, #e8eef7);
  color: var(--muted, #596579); font-size: 0.78rem; font-weight: 700;
  font-variant-numeric: tabular-nums; text-align: right;
}
.plb-week-cell {
  min-height: 58px;
  padding: 4px;
  border-top: 1px solid var(--gris-bleute, #e8eef7);
  border-left: 1px solid var(--gris-bleute, #e8eef7);
  display: grid; gap: 4px; align-content: start;
}
.plb-week-cell.is-today { background: rgba(21, 70, 160, 0.035); }

/* Carte RDV dans sa cellule : bleu France, vermillon si urgence. */
.plb-week-card {
  display: block; width: 100%; text-align: left;
  padding: 6px 9px; border: 0; border-left: 3px solid var(--carillon-bleu, #1546a0);
  border-radius: 8px; background: var(--gris-bleute, #e8eef7);
  font: inherit; cursor: pointer;
}
.plb-week-card strong { display: block; color: var(--carillon-nuit, #071c3b); font-size: 0.78rem; line-height: 1.25; }
.plb-week-card span { display: block; color: var(--muted, #596579); font-size: 0.72rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.plb-week-card:hover, .plb-week-card:focus-visible { background: #dbe6f6; }
.plb-week-card.is-urgent { border-left-color: var(--carillon-rouge, #e63946); background: #fdecee; }
.plb-week-card.is-urgent strong { color: #c9202e; }

@media (max-width: 800px) {
  .plb-week { grid-template-columns: 52px repeat(var(--plb-days, 7), minmax(118px, 1fr)); }
  .plb-week-wrap { max-height: 62vh; }
}

/* RET-10 — planning pleine zone, sans le double ascenseur historique. */
body.plb-planning-takeover:not(.phone-mode) [data-panel="planning"].active,
body.plb-planning-takeover:not(.phone-mode) [data-panel="planning"] .planning-shell,
body.plb-planning-takeover:not(.phone-mode) [data-panel="planning"] .planning-calendar-main {
  width: 100%; max-width: none; min-width: 0;
}
body.plb-planning-takeover:not(.phone-mode) [data-panel="planning"] .planning-shell {
  display: grid; grid-template-columns: minmax(0, 1fr); min-height: 0;
}
body.plb-planning-takeover:not(.phone-mode) [data-panel="planning"] .planning-calendar-main {
  min-height: calc(100dvh - 112px);
  padding: clamp(12px, 1.5vw, 20px);
  overflow: visible;
}
body.plb-planning-takeover:not(.phone-mode) #planningBoard.plb-planning-host {
  width: 100%; height: auto !important; max-height: none !important;
  overflow: visible !important;
}
body.plb-planning-takeover:not(.phone-mode) .plb-planning-host .plb-page {
  width: 100%; max-width: none;
}
body.plb-planning-takeover:not(.phone-mode) .plb-planning-host .plb-week-wrap {
  width: 100%;
  min-height: clamp(380px, calc(100dvh - 245px), 760px);
  max-height: none;
  overflow: visible;
}

.plb-plan-legend {
  display: flex; align-items: center; gap: 8px; width: 100%;
  margin: -2px 0 10px; padding: 7px 9px;
  overflow-x: auto; scrollbar-width: thin;
  border: 1px solid var(--line, #d9e2ee); border-radius: 10px;
  background: #f8fafc; color: var(--muted, #596579);
  font-size: 0.72rem; white-space: nowrap;
}
.plb-plan-legend > strong { color: var(--carillon-nuit, #071c3b); font-size: 0.74rem; }
.plb-plan-legend-item { display: inline-flex; align-items: center; gap: 5px; font-weight: 700; }
.plb-plan-legend-item i { width: 9px; height: 9px; border-radius: 50%; background: #64748b; }
.plb-plan-legend-item.is-metier i { background: #1546a0; }
.plb-plan-legend-item.is-admin i { background: #6f42a1; }
.plb-plan-legend-item.is-unqualified i { background: #64748b; }
.plb-plan-legend-item.is-p0 i { background: #c71f37; box-shadow: 0 0 0 3px rgba(199,31,55,.14); }
.plb-plan-legend-item.is-p1 i { background: #d65012; }
.plb-plan-legend-item.is-p2 i { background: #b77900; }
.plb-plan-legend-item.is-p3 i { background: #287271; }
.plb-plan-legend-item.is-a-venir i { background: #1546a0; }
.plb-plan-legend-item.is-en-cours i { background: #1c7a48; box-shadow: 0 0 0 3px rgba(28,122,72,.14); }
.plb-plan-legend-item.is-honore i { background: #64748b; }
.plb-plan-legend-item.is-annule i { background: #b3212f; }
.plb-plan-legend-item.is-a-regulariser i { background: #b5711a; }

.plb-week-card {
  display: grid; grid-template-columns: 26px minmax(0, 1fr); align-items: start;
  gap: 6px; min-height: 52px; padding: 6px 7px;
  border-left-width: 4px;
}
.plb-week-card-copy { display: block; min-width: 0; }
.plb-week-card-copy > strong {
  display: block; color: var(--carillon-nuit, #071c3b);
  font-size: 0.76rem; line-height: 1.25;
}
.plb-week-card .plb-week-customer {
  display: block; margin-top: 1px; color: var(--muted, #596579);
  font-size: 0.68rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.plb-appointment-avatar {
  display: inline-grid; place-items: center; flex: 0 0 auto;
  width: 34px; height: 34px; overflow: hidden;
  border: 1px solid #b8cae6; border-radius: 50%;
  background: #dceafb; color: #0b3b82;
  font-size: 0.68rem; font-weight: 900; letter-spacing: .02em;
}
.plb-appointment-avatar.is-week { width: 26px; height: 26px; font-size: 0.58rem; }
.plb-appointment-avatar.is-list { width: 38px; height: 38px; }
.plb-appointment-avatar.is-admin { border-color: #cbb8df; background: #eee7fa; color: #4c2a75; }
.plb-appointment-avatar img { width: 100%; height: 100%; object-fit: cover; }
.plb-appointment-avatar-icon { width: 15px; height: 15px; }

.plb-week-card .plb-week-card-meta,
.plb-plan-row-badges { display: flex; align-items: center; gap: 4px; min-width: 0; margin-top: 4px; }
.plb-week-card .plb-plan-kind,
.plb-week-card .plb-plan-urgency,
.plb-week-card .plb-plan-state,
.plb-plan-row .plb-plan-kind,
.plb-plan-row .plb-plan-urgency,
.plb-plan-row .plb-plan-state {
  display: inline-flex; align-items: center; gap: 3px; min-width: 0;
  padding: 2px 5px; border-radius: 999px;
  font-size: 0.7rem; font-weight: 800; line-height: 1.15; white-space: nowrap;
}
body.plb-planning-takeover .plb-planning-host .plb-week-card .plb-plan-kind > span,
body.plb-planning-takeover .plb-planning-host .plb-week-card .plb-plan-urgency > span,
body.plb-planning-takeover .plb-planning-host .plb-week-card .plb-plan-state > span {
  display: inline;
  color: inherit;
  font-size: inherit;
  overflow: visible;
  text-overflow: clip;
  white-space: nowrap;
}

.plb-plan-kind-icon,
.plb-plan-urgency-icon,
.plb-plan-state-icon { width: 10px; height: 10px; flex: 0 0 auto; }
.plb-plan-state { display: inline-flex; align-items: center; gap: 3px; padding: 2px 6px; border-radius: 999px; font-size: .7rem; font-weight: 850; white-space: nowrap; }
.plb-plan-notice { display: inline-flex; align-items: center; gap: 3px; padding: 2px 6px; border-radius: 999px; font-size: .7rem; font-weight: 850; white-space: nowrap; }
.plb-plan-notice.is-contact { background: #fff0bf; color: #725000; }
.plb-plan-notice.is-validation { background: #e7effb; color: #1546a0; }
.plb-plan-notice.is-simulated { background: #edf1f5; color: #455568; }
.plb-plan-notice.is-sent { background: #e7f5ed; color: #1c7a48; }
.plb-plan-state.is-a_venir { background: #e7effb; color: #1546a0; }
.plb-plan-state.is-en_cours { background: #e7f5ed; color: #1c7a48; }
.plb-plan-state.is-honore { background: #edf1f5; color: #455568; }
.plb-plan-state.is-annule { background: #fdf3f4; color: #b3212f; }
.plb-plan-state.is-a_regulariser { background: #fff4e3; color: #8a570f; }
.plb-plan-kind.is-metier { background: #dceafb; color: #0b3b82; }
.plb-plan-kind.is-admin { background: #eee7fa; color: #4c2a75; }
.plb-plan-kind.is-unqualified { background: #e8edf3; color: #455568; }
.plb-plan-urgency.is-p0 { background: #fbd9df; color: #8f1027; }
.plb-plan-urgency.is-p1 { background: #ffe1d2; color: #8e2f05; }
.plb-plan-urgency.is-p2 { background: #fff0bf; color: #725000; }
.plb-plan-urgency.is-p3 { background: #d9efed; color: #185856; }
.plb-plan-urgency.is-unqualified { background: #e8edf3; color: #455568; }
.plb-plan-urgency.is-none { background: #eee7fa; color: #4c2a75; }

.plb-week-card.is-kind-admin { box-shadow: inset 0 0 0 1px rgba(111,66,161,.16); }
.plb-week-card.is-urgency-p0 { border-left-color: #c71f37; background: #fff0f2; }
.plb-week-card.is-urgency-p1 { border-left-color: #d65012; background: #fff3ed; }
.plb-week-card.is-urgency-p2 { border-left-color: #b77900; background: #fff8e4; }
.plb-week-card.is-urgency-p3 { border-left-color: #287271; background: #eef8f7; }
.plb-week-card.is-urgency-unqualified { border-left-color: #64748b; background: #f2f5f8; }
.plb-week-card.is-urgency-none { border-left-color: #6f42a1; background: #f7f2fb; }
.plb-week-card.is-kind-admin.is-urgency-none { border-left-color: #6f42a1; background: #f7f2fb; }
.plb-week-card.is-state-en_cours { box-shadow: inset 0 0 0 2px rgba(28,122,72,.3); }
.plb-week-card.is-state-honore { opacity: .78; }
.plb-week-card.is-state-annule { opacity: .68; text-decoration-color: #b3212f; }
.plb-week-card.is-state-a_regulariser { box-shadow: inset 0 0 0 2px rgba(181,113,26,.28); }
.plb-week-card.is-urgent strong { color: var(--carillon-nuit, #071c3b); }

@keyframes plb-urgent-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(199,31,55,0); }
  50% { box-shadow: 0 0 0 3px rgba(199,31,55,.16); }
}
.plb-week-card.is-urgency-p0 { animation: plb-urgent-pulse 1.2s ease-in-out 3; }
.plb-week-card.is-urgency-p1 { animation: plb-urgent-pulse 1.6s ease-in-out 2; }

.plb-plan-contact { display: flex; align-items: center; gap: 10px; min-width: 0; }
.plb-plan-row-badges { justify-content: flex-end; flex-wrap: wrap; margin-top: 0; }
.plb-plan-row.is-state-en_cours { background: #f2fbf6; box-shadow: inset 3px 0 0 #1c7a48; }
.plb-plan-row.is-state-honore { background: #f8fafc; opacity: .82; }
.plb-plan-row.is-state-annule { background: #fdf3f4; opacity: .75; }
.plb-plan-row.is-state-a_regulariser { background: #fffaf2; box-shadow: inset 3px 0 0 #b5711a; }

@media (prefers-reduced-motion: reduce) {
  .plb-week-card.is-urgent { animation: none !important; transition: none !important; }
}
@media (min-width: 641px) and (max-width: 800px) {
  body.plb-planning-takeover .plb-planning-host .plb-week {
    min-width: max-content;
    grid-template-columns: 52px repeat(var(--plb-days, 7), minmax(88px, 1fr));
  }
}
@media (max-width: 640px) {
  body.plb-planning-takeover .plb-planning-host .plb-week {
    min-width: max-content;
    grid-template-columns: 52px repeat(var(--plb-days, 7), minmax(112px, 1fr));
  }
  body.plb-planning-takeover #planningBoard.plb-planning-host {
    height: auto !important; max-height: none !important; overflow: visible !important;
  }
  /* Tous les repères restent visibles sans geste horizontal caché : la
     légende faisait 998 px dans un cadre de 336 px à 390. */
  .plb-plan-legend {
    flex-wrap: wrap;
    row-gap: 6px;
    margin-bottom: 8px;
    overflow-x: visible;
    white-space: normal;
  }
  .plb-plan-row { grid-template-columns: 1fr; align-items: start; gap: 8px; }
  .plb-plan-row-badges { justify-content: flex-start; }
}
@media (max-width: 640px) {
  .plb-plan-actions { width: 100%; margin-left: 0; justify-content: space-between; }
  .plb-slot-toggle { order: 1; }
}

/* --------------------------------------------------------------------------
   LOT E2 REFONTE — CATALOGUE (carillon-catalogue-ui.js) : cartes cohérentes +
   recherche/filtres/pagination. Identité : surface/r14, bleu France action,
   marge affichée seulement si la donnée existe, « prix sur demande » jamais 0 €.
   -------------------------------------------------------------------------- */
.cat-toolbar {
  display: flex; flex-wrap: wrap; align-items: center; gap: 10px;
  margin: 0 0 16px;
}
.cat-search { flex: 1 1 260px; }
.cat-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.cat-toolbar input[type="search"], .cat-toolbar select {
  width: 100%; min-height: 44px; padding: 9px 12px;
  border: 1px solid var(--line, #d9e2ee); border-radius: var(--radius-sm, 10px);
  background: var(--surface, #fff); color: var(--carillon-nuit, #071c3b); font: inherit;
}
.cat-toolbar select { flex: 0 1 auto; width: auto; }
.cat-count { margin-left: auto; color: var(--muted, #596579); font-size: 0.85rem; font-weight: 600; white-space: nowrap; }

.cat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(232px, 1fr)); gap: 14px; }
.cat-card {
  display: flex; flex-direction: column; text-align: left; padding: 0; overflow: hidden;
  background: var(--surface, #fff); border: 1px solid var(--line, #d9e2ee);
  border-radius: var(--radius, 14px); box-shadow: var(--shadow, 0 1px 2px rgba(7, 28, 59, 0.06));
  font: inherit; cursor: pointer;
}
.cat-card:hover, .cat-card:focus-visible { border-color: var(--carillon-bleu, #1546a0); }
.cat-card-visual {
  display: grid; place-items: center; height: 96px;
  background: var(--gris-bleute, #e8eef7); color: var(--carillon-bleu, #1546a0);
}
.cat-card-visual img { width: 100%; height: 100%; object-fit: cover; }
.cat-card-visual svg { width: 30px; height: 30px; }
.cat-card-visual .cat-service-icon { width: 38px; height: 38px; }
.cat-card-visual.is-drain { background: #e7f6fb; color: #086b88; }
.cat-card-visual.is-leak-search { background: #e9f1ff; color: #1546a0; }
.cat-card-visual.is-leak { background: #e5f3ff; color: #006dba; }
.cat-card-visual.is-faucet { background: #eef3f8; color: #344f6b; }
.cat-card-visual.is-sanitary { background: #f0edff; color: #5a43a8; }
.cat-card-visual.is-heating { background: #fff0e7; color: #c14d16; }
.cat-card-visual.is-maintenance { background: #eef8f7; color: #1d746c; }
.cat-card-visual.is-installation { background: #f4f1ea; color: #735c27; }

.cat-card-body { display: grid; gap: 3px; padding: 12px 14px 14px; }
.cat-card-body strong { color: var(--carillon-nuit, #071c3b); font-size: 0.95rem; line-height: 1.3; }
.cat-card-cat { color: var(--muted, #596579); font-size: 0.76rem; text-transform: uppercase; letter-spacing: 0.05em; }
.cat-card-price { color: var(--carillon-bleu-fonce, #0f3578); font-weight: 800; font-size: 1rem; font-variant-numeric: tabular-nums; }
.cat-card-price em { color: var(--muted, #596579); font-weight: 600; font-style: italic; font-size: 0.88rem; }
.cat-card-marge { color: var(--muted, #596579); font-size: 0.78rem; }
.cat-empty {
  padding: 28px; text-align: center; color: var(--muted, #596579);
  background: var(--blanc-chaud, #faf7f0); border-radius: var(--radius, 14px);
}
.cat-pager { display: flex; align-items: center; justify-content: center; gap: 14px; margin-top: 16px; }
.cat-pager .btn { min-height: 44px; }
.cat-page-label { color: var(--muted, #596579); font-size: 0.88rem; font-variant-numeric: tabular-nums; }
@media (max-width: 800px) {
  .cat-count { margin-left: 0; width: 100%; }
}

/* Note « traitée en mode simulation » (détail message) : neutre, pas verte. */
body .msg-sent-note.msg-sim-note {
  display: flex;
  align-items: center;
  gap: 9px;
  color: var(--muted, #596579);
}
body .msg-sent-note.msg-sim-note strong { color: var(--carillon-nuit, #071c3b); }

/* Sur la carte mission mobile (fond surface blanche) : alignement en ligne
   avec l'heure — le rendu neutre par défaut reste lisible tel quel. */
body .mission-card .badge.sim-badge,
body .mission-time .badge.sim-badge {
  vertical-align: middle;
  margin-left: 6px;
}

/* --------------------------------------------------------------------------
   1. BANNIÈRE & BADGE « SIMULÉ » — le simulé est TOUJOURS déclaré (GATE).
   -------------------------------------------------------------------------- */
.plb-sim-banner {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0 0 18px;
  padding: 12px 16px;
  background: var(--gris-bleute, #e8eef7);
  border: 1px solid var(--carillon-bleu, #1546a0);
  border-radius: var(--radius-sm, 10px);
}
.plb-sim-banner-ic { width: 24px; height: 24px; color: var(--carillon-bleu, #1546a0); }
.plb-sim-banner strong { display: block; color: var(--carillon-nuit, #071c3b); font-size: 0.95rem; }
.plb-sim-banner span { color: var(--muted, #596579); font-size: 0.86rem; }

.plb-sim {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border: 1.5px dashed var(--carillon-nuit, #071c3b);
  border-radius: 999px;
  background: #fff;
  color: var(--carillon-nuit, #071c3b);
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  white-space: nowrap;
}
.plb-sim-ic { width: 13px; height: 13px; }

/* --------------------------------------------------------------------------
   2. CHIPS — urgence (vermillon si P0/P1), statut, priorité.
   -------------------------------------------------------------------------- */
.plb-urg {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 11px;
  border-radius: 999px;
  background: var(--gris-bleute, #e8eef7);
  color: #2c3850;
  font-size: 0.78rem;
  font-weight: 700;
  white-space: nowrap;
}
.plb-urg b { font-weight: 800; }
.plb-urg.is-strong { background: #fdecee; color: #c9202e; }
.plb-urg-ic { width: 14px; height: 14px; }

.plb-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 11px;
  border: 1px solid transparent;
  border-radius: 999px;
  font-size: 0.76rem;
  font-weight: 700;
  white-space: nowrap;
}
.plb-chip-ic { width: 13px; height: 13px; flex: none; }
/* Palettes AA distinctes + icônes : la couleur n'est jamais le seul signal. */
.plb-chip-wait { background: var(--gris-bleute, #e8eef7); color: var(--carillon-bleu-fonce, #0f3578); }
.plb-chip-go { background: #eaf1fb; color: var(--carillon-bleu, #1546a0); }
.plb-chip-neutral { background: #f1f3f6; border-color: #c7cdd6; color: #374151; }
.plb-chip-pending { background: #fff4d6; border-color: #e3b341; color: #6b4a00; }
.plb-chip-planned { background: #eaf1fb; border-color: #99b6e8; color: #0f3578; }
.plb-chip-travel { background: #efeafd; border-color: #b9a6e6; color: #51358a; }
.plb-chip-onsite { background: #e4f5f7; border-color: #86c8cf; color: #075b65; }
.plb-chip-active { background: #e5efff; border-color: #7da7e8; color: #103f87; }
.plb-chip-review { background: #fff0e2; border-color: #e5a661; color: #7a3e00; }
.plb-chip-done { background: #e9f5ef; border-color: #85c69f; color: #0b6537; }
.plb-chip-danger { background: #fdecee; border-color: #e29aa3; color: #941b27; }

/* --------------------------------------------------------------------------
   3. TABLEAU DE BORD (maquette 04 accueil).
   -------------------------------------------------------------------------- */
.plb-home { width: 100%; max-width: none; }
.plb-eyebrow { margin: 0; color: var(--muted, #596579); font-size: 0.85rem; letter-spacing: 0.05em; text-transform: uppercase; }
.plb-greeting {
  margin: 4px 0 0;
  font-family: var(--font-titres, Fraunces, Georgia, serif);
  font-size: clamp(1.8rem, 2.6vw, 2.4rem);
  font-weight: 600;
  color: var(--ink, #071c3b);
  line-height: 1.15;
}
/* Densité 02/08 : le sous-titre « Voici votre journée… » paraphrasait
   l'eyebrow « · aujourd'hui » — supprimé, le titre porte la marge. */
.plb-greeting { margin-bottom: 18px; }

/* Une seule direction dominante avant les chiffres. Elle évite de demander
   au patron de comparer mentalement les quatre KPI pour savoir où commencer. */
.plb-focus-card {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr) auto;
  align-items: center;
  gap: 16px;
  margin-bottom: 16px;
  padding: 16px 18px;
  background: #f1f6ff;
  border: 1px solid #9db8e4;
  border-left: 4px solid var(--carillon-bleu, #1546a0);
  border-radius: var(--radius, 14px);
}
.plb-focus-card.is-clear {
  background: #eef8f3;
  border-color: #9bcfb1;
  border-left-color: #0d7a3e;
}
.plb-focus-icon {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: #fff;
  color: var(--carillon-bleu-fonce, #0f3578);
}
.plb-focus-card.is-clear .plb-focus-icon { color: #0d7a3e; }
.plb-focus-icon .plb-ic { width: 22px; height: 22px; }
.plb-focus-body { min-width: 0; }
.plb-focus-body small {
  display: block;
  margin-bottom: 2px;
  color: var(--carillon-bleu-fonce, #0f3578);
  font-size: .76rem;
  font-weight: 800;
  letter-spacing: .04em;
  text-transform: uppercase;
}
.plb-focus-body h2 {
  margin: 0;
  color: var(--ink, #071c3b);
  font-family: var(--font-interface, Inter, sans-serif);
  font-size: 1.05rem;
  font-weight: 750;
  line-height: 1.3;
}
.plb-focus-body p { margin: 3px 0 0; color: #46566d; font-size: .86rem; }
.plb-focus-card > .btn { min-width: 132px; justify-content: center; }

/* Carte de priorité — icône en pastille, verbe métier, action à droite. */
.plb-priority {
  display: flex;
  align-items: center;
  gap: 22px;
  padding: 24px 26px;
  margin-bottom: 20px;
  background: var(--surface, #fff);
  border: 1px solid var(--line, #d9e2ee);
  border-radius: var(--radius, 14px);
  box-shadow: var(--shadow, 0 1px 2px rgba(7, 28, 59, 0.06));
}
.plb-priority.is-urgent { border: 1.5px solid var(--carillon-rouge, #e63946); }
.plb-priority-icon {
  display: grid;
  place-items: center;
  width: 72px;
  height: 72px;
  flex: none;
  border-radius: 50%;
  background: var(--gris-bleute, #e8eef7);
  color: var(--carillon-bleu, #1546a0);
}
.plb-priority.is-urgent .plb-priority-icon { background: #fdecee; color: var(--carillon-rouge, #e63946); }
.plb-priority-icon .plb-ic { width: 34px; height: 34px; }
.plb-priority-body { flex: 1; min-width: 0; }
.plb-priority-eyebrow { display: block; color: var(--carillon-bleu, #1546a0); font-weight: 700; font-size: 0.9rem; margin-bottom: 2px; }
.plb-priority.is-urgent .plb-priority-eyebrow { color: #c9202e; }
.plb-priority-title {
  margin: 0;
  font-family: var(--font-titres, Fraunces, Georgia, serif);
  font-size: clamp(1.3rem, 2.4vw, 1.8rem);
  font-weight: 600;
  color: var(--ink, #071c3b);
  line-height: 1.12;
}
.plb-priority-meta { margin: 6px 0 0; color: var(--muted, #596579); font-size: 0.92rem; }
.plb-priority-cta { flex: none; display: inline-flex; align-items: center; gap: 8px; min-height: 48px; padding: 13px 22px; font-size: 1rem; font-weight: 700; }
.plb-priority-cta .plb-ic { width: 16px; height: 16px; }

/* KPI — pastille d'icône, libellé haut-de-casse, valeur forte. */
.plb-kpis { display: grid; grid-template-columns: repeat(4, minmax(150px, 1fr)); gap: 12px; margin-bottom: 18px; }
.plb-kpi {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  min-height: 88px;
  padding: 14px 16px;
  background: var(--surface, #fff);
  border: 1px solid var(--line, #d9e2ee);
  border-radius: var(--radius, 14px);
  box-shadow: var(--shadow, 0 1px 2px rgba(7, 28, 59, 0.06));
}
.plb-kpi-ic { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 12px; background: var(--gris-bleute, #e8eef7); color: var(--carillon-bleu, #1546a0); }
.plb-kpi-ic .plb-ic { width: 21px; height: 21px; }
.plb-kpi small { display: block; font-size: 0.76rem; color: #46566d; }
.plb-kpi strong { display: block; font-size: 1.5rem; color: var(--ink, #071c3b); font-variant-numeric: tabular-nums; line-height: 1.1; }
.plb-kpi-foot { color: #46566d; font-size: 0.76rem; font-weight: 600; }
.plb-kpi.tone-info .plb-kpi-ic { background: #e8f0ff; color: #1546a0; }
.plb-kpi.tone-attention { border-color: #e4c36d; background: #fffbeb; }
.plb-kpi.tone-attention .plb-kpi-ic { background: #fff1c7; color: #835500; }
.plb-kpi.tone-attention strong { color: #6b4700; }
.plb-kpi.tone-success .plb-kpi-ic { background: #e8f6ee; color: #0d7a3e; }
.plb-kpi.tone-success strong { color: #0b6537; }

/* Deux colonnes : journée | à valider. */
.plb-home-cols {
  display: grid;
  grid-template-columns: minmax(320px, .9fr) minmax(420px, 1.1fr);
  align-items: start;
  gap: 16px;
}

.plb-panel {
  padding: 18px 20px;
  background: var(--surface, #fff);
  border: 1px solid var(--line, #d9e2ee);
  border-radius: var(--radius, 14px);
  box-shadow: var(--shadow, 0 1px 2px rgba(7, 28, 59, 0.06));
  margin-bottom: 16px;
}
.plb-panel-head { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.plb-panel-head h2 {
  margin: 0;
  font-family: var(--font-titres, Fraunces, Georgia, serif);
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--ink, #071c3b);
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.plb-panel-head h2 .plb-ic { width: 18px; height: 18px; color: var(--carillon-bleu, #1546a0); }
.plb-panel-head--explained { align-items: flex-start; }
.plb-panel-head--explained > div { min-width: 0; }
.plb-panel-help {
  margin: 4px 0 0;
  color: var(--muted, #596579);
  font-size: .84rem;
  line-height: 1.4;
  overflow-wrap: anywhere;
}
.plb-panel-head--explained .plb-valid-count { flex: none; margin-left: auto; }
.plb-count {
  display: inline-grid; place-items: center; min-width: 24px; height: 24px; padding: 0 8px;
  border-radius: 999px; background: var(--gris-bleute, #e8eef7); color: var(--carillon-bleu-fonce, #0f3578);
  font-size: 0.8rem; font-weight: 800;
}
.plb-valid-count {
  display: inline-grid; place-items: center; min-width: 24px; height: 24px; padding: 0 8px;
  border-radius: 999px; background: #c9202e; color: #fff; font-size: 0.8rem; font-weight: 800;
}
.plb-followups-more {
  width: 100%;
  min-height: 44px;
  margin-top: 8px;
  border: 1px dashed #9db0ca;
  background: #f8fafc;
  color: var(--carillon-bleu-fonce, #0f3578);
  font: inherit;
  font-size: .84rem;
  font-weight: 750;
  cursor: pointer;
}
.plb-followups-more:hover { background: var(--gris-bleute, #e8eef7); border-style: solid; }

/* Timeline verticale : rail continu, passé / actuel / à venir et curseur horaire. */
.plb-timeline { list-style: none; margin: 0; padding: 0; display: grid; gap: 0; }
.plb-tl-row,
.plb-tl-now { display: grid; grid-template-columns: 62px 42px minmax(0, 1fr) auto; align-items: center; column-gap: 10px; }
.plb-tl-row { min-height: 64px; padding: 4px 0; border-radius: 10px; }
.plb-tl-time { color: var(--carillon-bleu-fonce, #0f3578); font-weight: 750; font-variant-numeric: tabular-nums; font-size: 0.86rem; text-align: right; }
.plb-tl-marker { position: relative; display: grid; place-items: center; align-self: stretch; }
.plb-tl-marker::before {
  content: ""; position: absolute; z-index: 0; top: 0; bottom: 0; left: 50%; width: 2px;
  transform: translateX(-50%); background: #cbd7e8;
}
.plb-tl-dot {
  position: relative; z-index: 1; display: grid; place-items: center; width: 34px; height: 34px;
  border-radius: 50%; border: 2px solid #aebbd0; background: #fff; color: #53627a;
}
.plb-tl-dot .plb-ic { width: 15px; height: 15px; }
.plb-tl-body { min-width: 0; padding: 7px 0; }
.plb-tl-body strong { display: block; font-size: 0.96rem; color: var(--ink, #071c3b); }
.plb-tl-body small { display: block; color: var(--muted, #596579); font-size: 0.82rem; }
.plb-tl-phase { display: block; margin-bottom: 2px; color: #596579; font-size: 0.68rem; font-weight: 800; letter-spacing: 0.045em; text-transform: uppercase; }
.plb-tl-row.is-past .plb-tl-dot { border-color: #85c69f; background: #e9f5ef; color: #0b6537; }
.plb-tl-row.is-past .plb-tl-body strong { color: #465367; }
.plb-tl-row.is-past .plb-tl-phase { color: #0b6537; }
.plb-tl-row.is-current { background: #eef4ff; box-shadow: inset 3px 0 #1546a0; }
.plb-tl-row.is-current .plb-tl-dot { border-color: #1546a0; background: #1546a0; color: #fff; box-shadow: 0 0 0 4px #dbe8ff; }
.plb-tl-row.is-current .plb-tl-phase { color: #0f3578; }
.plb-tl-row.is-future .plb-tl-dot { border-color: #aebbd0; background: #fff; color: #53627a; }
.plb-tl-now { min-height: 28px; color: #c9202e; }
.plb-tl-now-label { font-size: 0.7rem; font-weight: 850; text-align: right; text-transform: uppercase; letter-spacing: 0.035em; }
.plb-tl-now-marker { position: relative; align-self: stretch; }
.plb-tl-now-marker::before { content: ""; position: absolute; inset: 0 auto 0 50%; width: 2px; transform: translateX(-50%); background: #cbd7e8; }
.plb-tl-now-marker::after {
  content: ""; position: absolute; z-index: 1; top: 50%; left: 50%; width: 10px; height: 10px;
  transform: translate(-50%, -50%); border: 2px solid #fff; border-radius: 50%; background: #c9202e; box-shadow: 0 0 0 2px #c9202e;
}
.plb-tl-now-time { grid-column: 3 / -1; color: #941b27; font-size: 0.74rem; font-weight: 750; }
@media (max-width: 620px) {
  .plb-tl-row, .plb-tl-now { grid-template-columns: 52px 36px minmax(0, 1fr); column-gap: 7px; }
  .plb-tl-row > .plb-chip { grid-column: 3; justify-self: start; margin: 0 0 6px; }
  .plb-tl-dot { width: 30px; height: 30px; }
  .plb-tl-now-time { grid-column: 3; }
}

.plb-empty { color: var(--muted, #596579); font-size: 0.92rem; padding: 12px 2px; }
/* Densité 02/08 : la tagline « Carillon veille, vous décidez. » (ligne morte
   en pied de tableau de bord) a été retirée avec son style. */

/* Cartes « à valider ». */
.plb-valid-card { padding: 14px 16px; border: 1px solid var(--line, #d9e2ee); border-radius: var(--radius-sm, 10px); background: var(--surface, #fff); margin-bottom: 10px; }

.plb-followups { display: grid; gap: 8px; }
.plb-followup {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 11px 12px;
  border: 1px solid var(--line, #d9e2ee);
  border-radius: var(--radius-sm, 10px);
  background: var(--surface, #fff);
  color: var(--ink, #172033);
  text-align: left;
  cursor: pointer;
  overflow: hidden;
}
.plb-followup:hover { border-color: var(--carillon-bleu, #1546a0); background: #f5f8fd; }
.plb-followup-icon { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: #eaf1fb; color: var(--carillon-bleu, #1546a0); }
.plb-followup-icon .plb-ic { width: 17px; height: 17px; }
.plb-followup > span:nth-child(2) { display: grid; gap: 3px; min-width: 0; }
.plb-followup strong,
.plb-followup small {
  min-width: 0;
  overflow-wrap: anywhere;
  word-break: break-word;
}
.plb-followup small {
  color: var(--muted, #596579);
  line-height: 1.35;
  white-space: normal;
}
.plb-followup-open { color: var(--carillon-bleu, #1546a0); font-size: 0.82rem; font-weight: 750; white-space: nowrap; }
.plb-followups-more { margin: 4px 0 0; color: var(--muted, #596579); font-size: 0.84rem; text-align: center; }
.plb-valid-head { display: flex; align-items: flex-start; gap: 12px; min-width: 0; }
.plb-valid-head > div { flex: 1; min-width: 0; }
.plb-valid-head strong { display: block; font-size: 0.94rem; color: var(--ink, #071c3b); overflow-wrap: anywhere; word-break: break-word; }
.plb-valid-head > div > span { display: block; color: var(--muted, #596579); font-size: 0.84rem; line-height: 1.35; overflow-wrap: anywhere; word-break: break-word; white-space: normal; }
.plb-valid-head > .plb-chip,
.plb-valid-head > .plb-sim { flex: none; }
.plb-valid-ch { width: 40px; height: 40px; padding: 9px; flex: none; border-radius: 10px; background: var(--gris-bleute, #e8eef7); color: var(--carillon-bleu, #1546a0); box-sizing: border-box; }
.plb-valid-actions { display: flex; flex-wrap: wrap; gap: 9px; margin-top: 12px; }
.plb-valid-actions .btn { flex: 1 1 150px; min-width: 0; min-height: 44px; }

@media (max-width: 620px) {
  .plb-followup { grid-template-columns: auto minmax(0, 1fr); align-items: start; }
  .plb-followup-open { grid-column: 2; justify-self: start; }
  .plb-valid-head { display: grid; grid-template-columns: 40px minmax(0, 1fr); }
  .plb-valid-head > .plb-chip,
  .plb-valid-head > .plb-sim { grid-column: 2; justify-self: start; }
}

/* --------------------------------------------------------------------------
   4. DEMANDES + CONVERSATION (cœur du parcours e2e).
   -------------------------------------------------------------------------- */
.plb-split { display: grid; grid-template-columns: minmax(280px, 360px) minmax(0, 1fr); gap: 16px; align-items: start; }
@media (max-width: 900px) { .plb-split { grid-template-columns: minmax(0, 1fr); } }

.plb-list { background: var(--surface, #fff); border: 1px solid var(--line, #d9e2ee); border-radius: var(--radius, 14px); padding: 12px; box-shadow: var(--shadow, 0 1px 2px rgba(7, 28, 59, 0.06)); }
.plb-list-head { display: flex; align-items: center; gap: 10px; padding: 4px 6px 12px; }
.plb-list-head h2 { margin: 0; font-family: var(--font-titres, Fraunces, Georgia, serif); font-size: 1.2rem; font-weight: 600; }

.plb-row {
  display: grid; grid-template-columns: 42px minmax(0, 1fr) auto; align-items: center; gap: 11px; width: 100%;
  padding: 11px 10px; border: none; background: transparent; border-radius: var(--radius-sm, 10px); cursor: pointer; text-align: left;
}
.plb-row:hover { background: var(--surface-douce, #f3f6fa); }
.plb-row.selected { background: var(--gris-bleute, #e8eef7); }
.plb-row-main { min-width: 0; }
.plb-row-main strong { display: block; font-size: 0.94rem; color: var(--ink, #071c3b); }
.plb-row-main span { display: block; color: var(--muted, #596579); font-size: 0.84rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.plb-row-meta { display: inline-flex; align-items: center; gap: 6px; }
.plb-row-ch { width: 18px; height: 18px; color: var(--muted, #596579); }

.plb-avatar {
  display: grid; place-items: center; width: 42px; height: 42px; flex: none; border-radius: 50%;
  background: var(--gris-bleute, #e8eef7); color: var(--carillon-bleu-fonce, #0f3578); font-weight: 800; font-size: 0.9rem;
}
.plb-avatar.big { width: 52px; height: 52px; font-size: 1.05rem; }
.plb-avatar.sm { width: 34px; height: 34px; font-size: 0.8rem; }

.plb-detail { background: var(--surface, #fff); border: 1px solid var(--line, #d9e2ee); border-radius: var(--radius, 14px); padding: 20px 22px; box-shadow: var(--shadow, 0 1px 2px rgba(7, 28, 59, 0.06)); }
.plb-detail-head { display: flex; align-items: center; gap: 12px; padding-bottom: 14px; border-bottom: 1px solid var(--gris-bleute, #e8eef7); }
.plb-detail-head > div { flex: 1; min-width: 0; }
.plb-detail-head strong { display: block; font-size: 1.05rem; color: var(--ink, #071c3b); }
.plb-detail-head span { color: var(--muted, #596579); font-size: 0.86rem; }

/* Le dossier client se lit comme un parcours métier, pas comme une suite
   d'écrans techniques. Le texte et les icônes doublent toujours la couleur. */
.plb-journey {
  margin: 16px 0 18px;
  padding: 14px 16px;
  border: 1px solid #d9e2ee;
  border-radius: 14px;
  background: #f8fafc;
  overflow-x: auto;
}
.plb-journey ol {
  display: grid;
  grid-template-columns: repeat(5, minmax(112px, 1fr));
  min-width: 600px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.plb-journey li {
  position: relative;
  display: grid;
  justify-items: center;
  gap: 7px;
  padding: 0 8px;
  color: #596b7d;
  text-align: center;
  font-size: .76rem;
  font-weight: 700;
}
.plb-journey li:not(:last-child)::after {
  content: "";
  position: absolute;
  top: 17px;
  left: calc(50% + 24px);
  width: calc(100% - 48px);
  height: 2px;
  background: #cfd9e5;
}
.plb-journey-icon {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border: 2px solid #cfd9e5;
  border-radius: 50%;
  background: #fff;
}
.plb-journey-icon .plb-ic { width: 17px; height: 17px; }
.plb-journey li.is-done { color: #0b6537; }
.plb-journey li.is-done .plb-journey-icon {
  border-color: #0d7a3e;
  background: #e8f6ee;
  color: #0d7a3e;
}
.plb-journey li.is-done:not(:last-child)::after { background: #72b991; }
.plb-journey li.is-current { color: #123f91; }
.plb-journey li.is-current .plb-journey-icon {
  border-color: #1546a0;
  background: #e8f0ff;
  color: #1546a0;
  box-shadow: 0 0 0 4px rgba(21, 70, 160, .12);
}

.plb-empty-state {
  display: grid;
  justify-items: center;
  align-content: center;
  gap: 8px;
  min-height: 190px;
  padding: 24px;
  color: #46566d;
  text-align: center;
}
.plb-empty-state-icon {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: 14px;
  background: #edf3ff;
  color: #1546a0;
}
.plb-empty-state-icon .plb-ic { width: 23px; height: 23px; }
.plb-empty-state strong { color: #17212b; font-size: 1rem; }
.plb-empty-state p { max-width: 390px; margin: 0; line-height: 1.5; }
.plb-empty-state .btn { min-height: 44px; margin-top: 4px; }

.plb-zone-title { margin: 16px 0 8px; font-size: 0.78rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted, #596579); }
.plb-bubble-row { display: grid; grid-template-columns: 34px minmax(0, 1fr) auto; align-items: start; gap: 10px; margin-bottom: 14px; }
.plb-bubble { background: var(--surface-douce, #f3f6fa); border-radius: 4px 14px 14px 14px; padding: 12px 14px; color: var(--ink, #071c3b); font-size: 0.94rem; line-height: 1.5; }
.plb-bubble-row time { color: var(--muted, #596579); font-size: 0.78rem; white-space: nowrap; }
.plb-photo-tag { display: inline-flex; align-items: center; gap: 6px; margin-top: 8px; color: var(--muted, #596579); font-size: 0.82rem; }
.plb-photo-tag .plb-ic { width: 15px; height: 15px; }

.plb-zone { margin: 12px 0; padding: 14px 16px; border-radius: var(--radius-sm, 10px); border: 1px solid var(--line, #d9e2ee); }
.plb-zone-understood { background: #f6f9fe; border-left: 3px solid var(--carillon-bleu, #1546a0); }
.plb-zone-decision { background: var(--surface-douce, #f3f6fa); }
.plb-zone-proposal { background: #fff; }
.plb-zone-label { display: flex; align-items: center; gap: 8px; margin: 0 0 10px; font-weight: 700; font-size: 0.9rem; color: var(--carillon-bleu-fonce, #0f3578); }
.plb-zone-label .plb-ic { width: 17px; height: 17px; color: var(--carillon-bleu, #1546a0); }

.plb-understood-grid { display: grid; gap: 6px; }
.plb-u-row { display: flex; justify-content: space-between; gap: 12px; padding: 5px 0; border-bottom: 1px solid var(--gris-bleute, #e8eef7); font-size: 0.9rem; }
.plb-u-row:last-child { border-bottom: none; }
.plb-u-row span { color: var(--muted, #596579); }
.plb-u-row strong { color: var(--ink, #071c3b); text-align: right; }
.plb-conf-track { height: 7px; margin-top: 10px; border-radius: 999px; background: var(--gris-bleute, #e8eef7); overflow: hidden; }
.plb-conf-track span { display: block; height: 100%; background: var(--carillon-bleu, #1546a0); border-radius: 999px; }
.plb-conf-label { color: var(--muted, #596579); font-size: 0.8rem; }

.plb-decision-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.plb-parcours { font-family: var(--font-titres, Fraunces, Georgia, serif); font-size: 1.15rem; font-weight: 600; color: var(--ink, #071c3b); }
.plb-sla { display: inline-flex; align-items: center; gap: 6px; padding: 4px 11px; border-radius: 999px; background: #fff; border: 1px solid var(--line, #d9e2ee); color: var(--carillon-bleu-fonce, #0f3578); font-size: 0.82rem; font-weight: 700; }
.plb-sla .plb-ic { width: 14px; height: 14px; }
.plb-decision-missing { margin: 10px 0 0; color: var(--muted, #596579); font-size: 0.86rem; }

.plb-proposal-body { padding: 12px 14px; border-left: 3px solid var(--carillon-bleu, #1546a0); background: var(--surface-douce, #f3f6fa); border-radius: 0 8px 8px 0; color: var(--ink, #071c3b); font-size: 0.92rem; line-height: 1.5; }
.plb-approval { display: flex; align-items: center; gap: 12px; margin: 12px 0; padding: 12px 14px; border: 1.5px solid var(--carillon-rouge, #e63946); border-radius: var(--radius-sm, 10px); background: #fff; }
.plb-approval .plb-ic { width: 22px; height: 22px; color: var(--carillon-rouge, #e63946); flex: none; }
.plb-approval strong { display: block; color: #c9202e; font-size: 0.94rem; }
.plb-approval span { color: var(--muted, #596579); font-size: 0.85rem; }
.plb-detail-actions { display: flex; gap: 10px; margin-top: 14px; flex-wrap: wrap; }
.plb-detail-actions .btn { min-height: 46px; }

/* --------------------------------------------------------------------------
   5. PAGES SIMPLES — planning, clients, billing, matériel.
   -------------------------------------------------------------------------- */
.plb-page { max-width: 1120px; }
.plb-detail-nav { display: flex; margin: 0 0 12px; }

.plb-page-head { display: flex; align-items: center; gap: 12px; margin: 4px 0 16px; }
.plb-page-head h1 { margin: 0; font-family: var(--font-titres, Fraunces, Georgia, serif); font-size: clamp(1.5rem, 3vw, 2.1rem); font-weight: 600; color: var(--ink, #071c3b); }
.plb-banner-ok { display: inline-flex; align-items: center; gap: 7px; margin-left: auto; color: #0e6b3a; font-size: 0.88rem; font-weight: 600; }
.plb-banner-ok .plb-ic { width: 17px; height: 17px; }

.plb-planning { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.plb-plan-row { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 14px; padding: 12px 4px; border-bottom: 1px solid var(--gris-bleute, #e8eef7); }
.plb-plan-row:last-child { border-bottom: none; }
.plb-plan-time { font-variant-numeric: tabular-nums; font-weight: 700; color: var(--carillon-bleu-fonce, #0f3578); font-size: 0.9rem; white-space: nowrap; }
.plb-plan-body { min-width: 0; }
.plb-plan-body strong { display: block; color: var(--ink, #071c3b); font-size: 0.96rem; }
.plb-plan-body small { color: var(--muted, #596579); font-size: 0.82rem; }

.plb-client-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 14px; }
.plb-client-card { display: flex; gap: 14px; padding: 16px 18px; background: var(--surface, #fff); border: 1px solid var(--line, #d9e2ee); border-radius: var(--radius, 14px); box-shadow: var(--shadow, 0 1px 2px rgba(7, 28, 59, 0.06)); }
.plb-client-card > div { min-width: 0; }
.plb-client-card strong { display: block; color: var(--ink, #071c3b); }
.plb-client-card small { color: var(--muted, #596579); font-size: 0.85rem; }
.plb-client-addr { display: flex; align-items: center; gap: 6px; margin: 8px 0 4px; color: var(--muted, #596579); font-size: 0.85rem; }
.plb-client-addr .plb-ic { width: 15px; height: 15px; color: var(--carillon-bleu, #1546a0); }
.plb-client-last { color: var(--carillon-bleu-fonce, #0f3578); font-size: 0.82rem; font-weight: 600; }

.plb-doc-list { display: grid; gap: 8px; }
.plb-doc-row { display: flex; align-items: center; gap: 12px; padding: 12px 4px; border-bottom: 1px solid var(--gris-bleute, #e8eef7); }
.plb-doc-row:last-child { border-bottom: none; }
.plb-doc-ic { display: grid; place-items: center; width: 42px; height: 42px; flex: none; border-radius: 10px; background: var(--gris-bleute, #e8eef7); color: var(--carillon-bleu, #1546a0); }
.plb-doc-row > div { flex: 1; min-width: 0; }
.plb-doc-row strong { display: block; color: var(--ink, #071c3b); font-size: 0.94rem; }
.plb-doc-row small { color: var(--muted, #596579); font-size: 0.82rem; }
.plb-doc-amount { font-variant-numeric: tabular-nums; font-weight: 700; color: var(--ink, #071c3b); }
.plb-doc-row .btn.sm { min-height: 40px; padding: 8px 14px; }

.plb-stock { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.plb-stock-row { display: grid; grid-template-columns: minmax(90px, auto) minmax(0, 1fr) auto auto; align-items: center; gap: 12px; padding: 11px 4px; border-bottom: 1px solid var(--gris-bleute, #e8eef7); }
.plb-stock-row:last-child { border-bottom: none; }
.plb-stock-fam { color: var(--muted, #596579); font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.04em; }
.plb-doc-row.is-selected {
  padding-inline: 10px; border: 1px solid #7da7e8; border-radius: 10px;
  background: #eef4ff; box-shadow: 0 0 0 3px rgba(21, 70, 160, 0.12);
  outline: 3px solid #1546a0; outline-offset: 2px;
}
.plb-stock-row strong { color: var(--ink, #071c3b); font-size: 0.92rem; }
.plb-stock-qty { font-variant-numeric: tabular-nums; font-weight: 700; color: var(--ink, #071c3b); }
.plb-stock-ok { color: #0d7a3e; font-size: 0.8rem; font-weight: 600; }
.plb-stock-alert { display: inline-flex; align-items: center; gap: 5px; color: #c9202e; font-size: 0.8rem; font-weight: 700; }
.plb-stock-alert .plb-ic { width: 14px; height: 14px; }
.plb-stock-row.low strong { color: #c9202e; }

/* --------------------------------------------------------------------------
   MATÉRIEL + RÉGLAGES — système Finance commun.
   Ces deux surfaces évitent volontairement le beige, l'orange décoratif, les
   titres éditoriaux et les cartes vitrines. Elles partagent la densité de
   Devis & factures : fond blanc, grilles utiles et panneaux de contexte.
   -------------------------------------------------------------------------- */
.plb-finance-page {
  width: 100%; max-width: none; color: #071c3b;
  font-family: var(--font-ui, Inter, ui-sans-serif, system-ui, sans-serif);
}
.plb-finance-page h1, .plb-finance-page h2, .plb-finance-page h3 {
  font-family: var(--font-ui, Inter, ui-sans-serif, system-ui, sans-serif);
  letter-spacing: -.025em;
}
.plb-finance-page-head {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 16px;
  margin: 0 0 18px;
}
.plb-finance-page-head > div { min-width: 0; }
.plb-finance-page-head h1 { margin: 0; font-size: clamp(1.65rem, 2.3vw, 2.25rem); line-height: 1.12; font-weight: 760; }
.plb-finance-page-head p:last-child { margin: 7px 0 0; color: #596579; font-size: .92rem; }
.plb-finance-kicker { margin: 0 0 5px; color: #1546a0; font-size: .72rem; font-weight: 850; letter-spacing: .06em; text-transform: uppercase; }
.plb-source-chip, .plb-human-chip {
  display: inline-flex; align-items: center; flex: none; min-height: 28px; padding: 4px 9px;
  border: 1px solid #c9d8ef; border-radius: 7px; background: #f4f7fc; color: #1546a0;
  font-size: .75rem; font-weight: 750; white-space: nowrap;
}
.plb-human-chip { background: #eef3ff; border-color: #b9ccf7; }
.plb-finance-kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin: 0 0 18px; }
.plb-finance-kpis article {
  display: grid; grid-template-columns: 38px minmax(0, 1fr); align-items: center; gap: 10px; min-height: 88px;
  padding: 13px 15px; border: 1px solid #dce5f1; border-radius: 10px; background: #fff; box-shadow: 0 1px 2px rgba(7,28,59,.035);
}
.plb-finance-kpis article > span { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 10px; background: #edf3fe; color: #1546a0; }
.plb-finance-kpis article > span .plb-ic { width: 20px; height: 20px; }
.plb-finance-kpis article small, .plb-finance-kpis article em { display: block; color: #596579; font-size: .74rem; font-style: normal; }
.plb-finance-kpis article small { font-weight: 720; }
.plb-finance-kpis article strong { display: block; color: #071c3b; font-size: 1.42rem; line-height: 1.05; font-variant-numeric: tabular-nums; }
.plb-finance-kpis article.is-alert > span { background: #fff0f2; color: #c9202e; }
.plb-finance-tabs, .plb-settings-tabs { display: flex; align-items: end; gap: 4px; margin: 0 0 18px; border-bottom: 1px solid #dce5f1; overflow-x: auto; scrollbar-width: thin; }
.plb-finance-tabs button, .plb-settings-tabs button {
  min-height: 40px; padding: 9px 14px; border: 0; border-bottom: 2px solid transparent; background: transparent;
  color: #42526b; font: inherit; font-size: .87rem; font-weight: 720; white-space: nowrap; cursor: pointer;
}
.plb-finance-tabs button.active, .plb-settings-tabs button.active { border-bottom-color: #1546a0; color: #1546a0; }
.plb-finance-tabs button[aria-disabled="true"] { color: #8a96a8; cursor: not-allowed; }
.plb-finance-tabs button:disabled { opacity: .72; }
.plb-material-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(290px, 350px); gap: 18px; align-items: start; }
.plb-material-main, .plb-finance-panel { min-width: 0; border: 1px solid #dce5f1; border-radius: 10px; background: #fff; box-shadow: 0 1px 2px rgba(7,28,59,.035); }
.plb-material-main { overflow: hidden; }
.plb-material-filters { display: grid; grid-template-columns: minmax(180px, 1fr) minmax(190px, .48fr); gap: 10px; padding: 14px; border-bottom: 1px solid #e5ebf4; }
.plb-material-filters input, .plb-material-filters select {
  width: 100%; min-height: 42px; padding: 8px 11px; border: 1px solid #cfd9e8; border-radius: 7px; background: #fff; color: #071c3b; font: inherit; font-size: .86rem;
}
.plb-material-table-wrap { overflow-x: auto; }
.plb-material-table { width: 100%; min-width: 710px; border-collapse: collapse; font-size: .84rem; }
.plb-material-table th { padding: 12px 13px; border-bottom: 1px solid #dce5f1; color: #4f6077; font-size: .73rem; font-weight: 800; text-align: left; text-transform: uppercase; letter-spacing: .035em; white-space: nowrap; }
.plb-material-table td { padding: 11px 13px; border-bottom: 1px solid #e8edf5; color: #203451; vertical-align: middle; }
.plb-material-table tbody tr:last-child td { border-bottom: 0; }
.plb-material-table tbody tr.is-selected { background: #f1f5fd; }
.plb-material-table tbody tr.is-low td { color: #8f1d2a; }
.plb-material-table td > button { display: grid; gap: 2px; width: 100%; padding: 0; border: 0; background: transparent; color: inherit; font: inherit; text-align: left; cursor: pointer; }
.plb-material-table td > button strong { color: #071c3b; font-size: .87rem; }
.plb-material-table td > button small { color: #66758b; font-size: .75rem; }
.plb-table-empty { padding: 24px 4px; color: #596579; text-align: center; }
.plb-material-aside { display: grid; gap: 14px; }
.plb-finance-panel { padding: 16px; }
.plb-finance-panel-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; margin-bottom: 14px; }
.plb-finance-panel-head h2 { margin: 0; color: #071c3b; font-size: 1.02rem; font-weight: 760; }
.plb-finance-panel-head p:last-child, .plb-finance-panel > p { margin: 5px 0 0; color: #596579; font-size: .82rem; line-height: 1.45; }
.plb-material-metrics { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1px; margin: 0; border-block: 1px solid #e2e8f1; background: #e2e8f1; }
.plb-material-metrics > div { min-width: 0; padding: 11px 7px; background: #fff; }
.plb-material-metrics dt { color: #66758b; font-size: .68rem; font-weight: 800; text-transform: uppercase; }
.plb-material-metrics dd { margin: 4px 0 0; color: #071c3b; font-size: .92rem; font-weight: 780; overflow-wrap: anywhere; }
.plb-material-metrics dd.is-alert { color: #c9202e; }
.plb-material-detail-row { display: flex; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px solid #e8edf5; font-size: .78rem; }
.plb-material-detail-row span { color: #66758b; }
.plb-material-detail-row strong { color: #203451; text-align: right; }
.plb-material-order { border-color: #a9c1f4; }
.plb-material-order .btn { width: 100%; margin-top: 14px; justify-content: center; }
.plb-material-order-note { padding: 9px 10px; border-radius: 7px; background: #f4f7fc; color: #42526b !important; }

/* Réglages : surfaces opérationnelles, connecteurs volontairement non activés. */
.plb-settings-summary-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; margin-bottom: 18px; }
.plb-settings-legal { display: grid; gap: 0; margin-bottom: 14px; }
.plb-settings-legal-row { display: grid; grid-template-columns: minmax(120px, .72fr) minmax(0, 1.25fr); gap: 12px; padding: 8px 0; border-bottom: 1px solid #e8edf5; font-size: .82rem; }
.plb-settings-legal-row span { color: #596579; }
.plb-settings-legal-row strong { color: #203451; overflow-wrap: anywhere; }
.plb-settings-policy, .plb-settings-audit { display: grid; gap: 0; margin: 0; padding: 0; list-style: none; }
.plb-settings-policy li, .plb-settings-audit li { display: flex; gap: 10px; align-items: flex-start; padding: 10px 0; border-bottom: 1px solid #e8edf5; }
.plb-settings-policy li:last-child, .plb-settings-audit li:last-child { border-bottom: 0; }
.plb-settings-policy .plb-ic, .plb-settings-audit .plb-ic { width: 19px; height: 19px; flex: none; color: #1546a0; }
.plb-settings-policy strong, .plb-settings-audit strong { display: block; color: #203451; font-size: .82rem; }
.plb-settings-policy small, .plb-settings-audit small { display: block; margin-top: 3px; color: #66758b; font-size: .75rem; line-height: 1.35; }
.plb-settings-integration { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 10px; align-items: center; padding: 11px 0; border-bottom: 1px solid #e8edf5; }
.plb-settings-integration:last-child { border-bottom: 0; }
.plb-settings-integration strong { color: #203451; font-size: .9rem; }
.plb-settings-integration small { grid-column: 1 / -1; color: #66758b; font-size: .75rem; line-height: 1.35; }
.plb-settings-operations { scroll-margin-top: 16px; }
.plb-settings-section-head { display: flex; justify-content: space-between; gap: 16px; margin: 0 0 12px; }
.plb-settings-section-head h2 { margin: 0; color: #071c3b; font-size: 1.05rem; font-weight: 760; }
.plb-settings-section-head p:last-child { margin: 5px 0 0; color: #596579; font-size: .82rem; }
.plb-settings-page .plb-param-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.plb-settings-page .plb-panel { border-color: #dce5f1; border-radius: 10px; box-shadow: 0 1px 2px rgba(7,28,59,.035); }
.plb-settings-page .plb-panel-head h2 { font-family: var(--font-ui, Inter, ui-sans-serif, system-ui, sans-serif); font-size: 1rem; font-weight: 760; }
.plb-settings-page .plb-field, .plb-settings-page .plb-hours-row, .plb-settings-page .plb-price-row { background: #f8faff; border: 1px solid #e1e8f2; }
.plb-settings-page .plb-locked-panel { background: #071c3b; border-color: #071c3b; }
.plb-settings-page .plb-prices {
  height: min(660px, 68vh);
  overflow-y: auto;
  overscroll-behavior: contain;
  contain: layout paint;
  padding-right: 4px;
  scrollbar-width: thin;
}
.plb-settings-page .plb-save-bar { border-color: #c9d8ef; }
.plb-settings-tickets { grid-column: 1 / -1; }
.plb-settings-tickets > .btn { margin-bottom: 12px; }
.plb-client-edit-section {
  display: grid; gap: 10px; padding: 14px; border: 1px solid #dce5f1;
  border-radius: 10px; background: #f8faff;
}
.plb-client-edit-section h3 { margin: 0; color: #071c3b; font-size: .95rem; }

/* Le sous-menu historique des Réglages est remplacé par les onglets compacts
   ci-dessus une fois le module plombier monté. Le masquer à cette condition
   évite deux navigations concurrentes et deux titres de page. */
[data-panel="settings"]:has(.plb-settings-page) > .page-desktop,
[data-panel="settings"]:has(.plb-settings-page) > .settings-subnav { display: none; }
[data-panel="settings"]:has(.plb-settings-page) > .settings-subpanel:not([data-settings-panel="metier"]),
[data-panel="settings"]:has(.plb-settings-page) [data-settings-panel="metier"] > .reglage-aide,
[data-panel="settings"]:has(.plb-settings-page) #monMetierPanel,
[data-panel="settings"]:has(.plb-settings-page) #monMetierDureesPanel { display: none !important; }
[data-panel="settings"]:has(.plb-settings-page) > [data-settings-panel="metier"] { display: block !important; }

/* L'onglet Inventory reste techniquement commun au socle, mais son contenu
   générique est masqué par le montage JS pour le plombier. Cette règle ne fait
   qu'autoriser son entrée de navigation métier. */
body.trade-plumber .sidebar .nav-btn[data-tab="inventory"] { display: flex !important; }

@media (max-width: 980px) {
  .plb-material-layout { grid-template-columns: minmax(0, 1fr); }
  .plb-material-aside { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .plb-finance-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 680px) {
  /* Le module monté fournit déjà son h1 et sa description. Masquer seulement
     l'en-tête global de ces pages évite deux titres concurrents en phone. */
  body.trade-plumber.phone-mode:has([data-panel="inventory"].active .plb-material-page) .topbar-title,
  body.trade-plumber.phone-mode:has([data-panel="settings"].active .plb-settings-page) .topbar-title,
  body.trade-plumber.phone-mode:has([data-panel="planning"].active .plb-planning-host .plb-page) .topbar-title,
  body.trade-plumber.phone-mode:has([data-panel="production"].active #plbInterventionsHost .plb-page) .topbar-title,
  body.trade-plumber.phone-mode:has([data-panel="customers"].active .plb-client-page) .topbar-title { display: none; }
  .plb-finance-page-head { align-items: stretch; flex-direction: column; }
  .plb-finance-kpis, .plb-settings-summary-grid, .plb-material-aside, .plb-settings-page .plb-param-grid { grid-template-columns: minmax(0, 1fr); }
  .plb-material-filters { grid-template-columns: minmax(0, 1fr); }
  .plb-settings-legal-row { grid-template-columns: minmax(0, 1fr); gap: 3px; }
  /* Les deux champs time natifs dépassaient le panneau à 390px. On garde
     chaque jour lisible, sans créer de défilement horizontal de page. */
  .plb-settings-page .plb-hours-row { flex-wrap: wrap; gap: 7px; }
  .plb-settings-page .plb-hours-inputs { width: 100%; justify-content: space-between; }
  .plb-settings-page .plb-hours-inputs input { box-sizing: border-box; min-width: 0; width: calc((100% - 24px) / 2); }
  .plb-settings-page .plb-prices { height: min(560px, 64vh); }
  .plb-finance-page .btn { min-height: 44px; }
}

@media (max-width: 400px) {
  /* À 390 px, les 49 px de « Planning » étaient ellipsés dans 46 px. */
  body.trade-plumber.phone-mode .sidebar .nav > .nav-btn[data-tab="planning"] span {
    font-size: .59rem;
  }
}

/* --------------------------------------------------------------------------
   6. INTERVENTIONS — liste + fiche terrain.
   -------------------------------------------------------------------------- */
.plb-itv-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 14px; }
.plb-itv-kpis {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(112px, 1fr));
  gap: 10px; margin: 0 0 16px;
}
.plb-itv-kpi {
  display: grid; grid-template-columns: 34px minmax(0, 1fr); align-items: center; gap: 9px;
  min-height: 68px; padding: 9px 11px; border: 1px solid var(--line, #d9e2ee);
  border-radius: 12px; background: var(--surface, #fff);
}
.plb-itv-kpi > span { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; background: #e8eef7; color: #1546a0; }
.plb-itv-kpi .plb-ic { width: 17px; height: 17px; }
.plb-itv-kpi small { display: block; color: var(--muted, #596579); font-size: .67rem; font-weight: 800; line-height: 1.15; text-transform: uppercase; letter-spacing: .035em; }
.plb-itv-kpi strong { display: block; color: var(--carillon-nuit, #071c3b); font-size: 1.35rem; line-height: 1.05; font-variant-numeric: tabular-nums; }
.plb-itv-kpi.is-danger > span { background: #ffeaed; color: #c71f37; }
.plb-itv-kpi.is-orange > span { background: #fff0e8; color: #c44a12; }
.plb-itv-kpi.is-amber > span { background: #fff7df; color: #9a6700; }
.plb-itv-kpi.is-green > span { background: #e8f6ef; color: #117a4d; }
.plb-itv-kpi.is-muted > span { background: #eef1f4; color: #627083; }

.plb-itv-stock {
  margin-top: 16px; padding: 16px 18px; border: 1px solid var(--line, #d9e2ee);
  border-radius: var(--radius, 14px); background: linear-gradient(135deg, #f8fbff, #fff);
}
.plb-itv-stock-head, .plb-itv-stock-head > div { display: flex; align-items: center; gap: 11px; }
.plb-itv-stock-head { justify-content: space-between; flex-wrap: wrap; }
.plb-itv-stock-head h2 { margin: 1px 0 0; color: var(--carillon-nuit, #071c3b); font-family: var(--font-titres, Fraunces, Georgia, serif); font-size: 1.18rem; }
.plb-itv-stock-head small { display: block; color: var(--muted, #596579); font-size: .72rem; font-weight: 750; }
.plb-itv-stock-icon { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 12px; background: #e8eef7; color: #1546a0; }
.plb-itv-stock-icon .plb-ic { width: 21px; height: 21px; }
.plb-itv-stock-metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin-top: 14px; }
.plb-itv-stock-metrics > span { padding: 10px 12px; border-radius: 10px; background: #fff; border: 1px solid #e4eaf2; }
.plb-itv-stock-metrics strong { display: block; color: #0f3578; font-size: 1.2rem; font-variant-numeric: tabular-nums; }
.plb-itv-stock-metrics small { display: block; color: var(--muted, #596579); font-size: .72rem; }
.plb-itv-stock-metrics .is-alert strong { color: #c71f37; }
.plb-itv-stock-alert, .plb-itv-stock-ok { margin: 10px 0 0; padding: 9px 11px; border-radius: 9px; font-size: .8rem; }
.plb-itv-stock-alert { background: #fff0f2; color: #9f1730; }
.plb-itv-stock-ok { background: #eaf7f0; color: #126a47; }

@media (max-width: 640px) {
  .plb-itv-stock-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .plb-itv-stock-head .btn { width: 100%; justify-content: center; }
}

.plb-itv-card { padding: 16px 18px; background: var(--surface, #fff); border: 1px solid var(--line, #d9e2ee); border-radius: var(--radius, 14px); box-shadow: var(--shadow, 0 1px 2px rgba(7, 28, 59, 0.06)); }
.plb-itv-card.is-urgent { border-left: 3px solid var(--carillon-rouge, #e63946); }
.plb-itv-top { display: flex; gap: 8px; margin-bottom: 10px; }
.plb-itv-card h3 { margin: 0 0 4px; font-family: var(--font-titres, Fraunces, Georgia, serif); font-size: 1.1rem; font-weight: 600; color: var(--ink, #071c3b); }
.plb-itv-meta { margin: 0 0 12px; color: var(--muted, #596579); font-size: 0.85rem; }
.plb-itv-progress { height: 7px; border-radius: 999px; background: var(--gris-bleute, #e8eef7); overflow: hidden; margin-bottom: 4px; }
.plb-itv-progress span { display: block; height: 100%; background: var(--carillon-bleu, #1546a0); }
.plb-itv-card small { color: var(--muted, #596579); font-size: 0.8rem; }
.plb-itv-open { display: inline-flex; align-items: center; gap: 6px; margin-top: 12px; }
.plb-itv-open .plb-ic { width: 15px; height: 15px; }

/* Fiche terrain — carte dominante. */
.plb-terrain { max-width: 640px; }
.plb-mission { padding: 22px 24px; background: var(--surface, #fff); border: 1px solid var(--line, #d9e2ee); border-radius: var(--radius-panel, 18px); box-shadow: var(--shadow-hover, 0 4px 14px rgba(7, 28, 59, 0.1)); }
.plb-mission.is-urgent { border: 1.5px solid var(--carillon-rouge, #e63946); }
.plb-mission-top { display: flex; gap: 8px; margin-bottom: 12px; }
.plb-mission-title { margin: 0; font-family: var(--font-titres, Fraunces, Georgia, serif); font-size: 1.5rem; font-weight: 600; color: var(--ink, #071c3b); line-height: 1.15; }
.plb-mission-client { margin: 4px 0 14px; color: var(--muted, #596579); font-size: 0.92rem; }

/* Barre d'actions terrain — une main, cibles ≥ 48px. */
.plb-terrain-actions { display: grid; grid-template-columns: repeat(auto-fit, minmax(72px, 1fr)); gap: 8px; margin: 16px 0; }
.plb-taction {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 5px;
  min-height: 66px; padding: 10px 6px; text-decoration: none;
  border: 1px solid var(--line, #d9e2ee); border-radius: var(--radius-sm, 10px);
  background: var(--surface, #fff); color: var(--carillon-bleu-fonce, #0f3578);
  font-size: 0.78rem; font-weight: 650; cursor: pointer; transition: background 160ms ease, border-color 160ms ease;
}
.plb-taction:hover { background: var(--gris-bleute, #e8eef7); border-color: var(--carillon-bleu, #1546a0); }
.plb-taction .plb-ic { width: 22px; height: 22px; color: var(--carillon-bleu, #1546a0); }

.plb-block { margin: 14px 0; padding: 14px 16px; border: 1px solid var(--line, #d9e2ee); border-radius: var(--radius-sm, 10px); background: var(--surface, #fff); }
.plb-block-head { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.plb-block-head strong { color: var(--ink, #071c3b); font-size: 0.95rem; }
.plb-block-head small { margin-left: auto; color: var(--muted, #596579); font-variant-numeric: tabular-nums; }

.plb-check { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.plb-check-toggle {
  display: grid; grid-template-columns: 28px minmax(0, 1fr) auto; align-items: center; gap: 12px; width: 100%;
  min-height: 48px; padding: 8px 4px; border: none; background: transparent; cursor: pointer; text-align: left; border-radius: 8px;
}
.plb-check-toggle:hover { background: var(--surface-douce, #f3f6fa); }
.plb-check-box { display: grid; place-items: center; width: 24px; height: 24px; border: 1.5px solid var(--line, #d9e2ee); border-radius: 50%; background: #fff; color: #fff; }
.plb-check li.done .plb-check-box { background: var(--carillon-vert, #168a4b); border-color: var(--carillon-vert, #168a4b); }
.plb-check-box .plb-ic { width: 14px; height: 14px; stroke-width: 3; }
.plb-check-label { color: var(--ink, #071c3b); font-size: 0.92rem; }
.plb-check li.done .plb-check-label { color: var(--muted, #596579); }
.plb-check-time { color: var(--muted, #596579); font-size: 0.8rem; font-variant-numeric: tabular-nums; white-space: nowrap; }

.plb-photos-row { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 10px; }
.plb-photos-row figure { margin: 0; }
.plb-photos-row figcaption { font-size: 0.78rem; color: var(--muted, #596579); margin-bottom: 4px; }
.plb-photos-row img { width: 100%; height: 110px; object-fit: cover; border-radius: 10px; display: block; background: var(--surface-douce, #f3f6fa); }
.plb-photos-arrow { color: var(--carillon-bleu, #1546a0); }
.plb-photo-empty { display: grid; place-content: center; justify-items: center; gap: 4px; height: 110px; border: 1.5px dashed var(--line, #d9e2ee); border-radius: 10px; color: var(--muted, #596579); font-size: 0.78rem; }
.plb-photo-empty .plb-ic { width: 22px; height: 22px; }

.plb-report { margin: 0; color: var(--ink, #071c3b); font-size: 0.92rem; line-height: 1.5; }
.plb-mission-footer { display: flex; gap: 10px; margin-top: 16px; flex-wrap: wrap; }
.plb-mission-footer .btn { flex: 1; min-height: 50px; justify-content: center; }
.plb-signed { display: inline-flex; align-items: center; gap: 7px; color: #0d7a3e; font-weight: 700; }
.plb-signed .plb-ic { width: 18px; height: 18px; }

/* --------------------------------------------------------------------------
   7. BANC DE DÉMONSTRATION — switcher d'écrans + bascule mobile.
   -------------------------------------------------------------------------- */
.plb-demo { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 18px; align-items: start; }
@media (max-width: 800px) { .plb-demo { grid-template-columns: minmax(0, 1fr); } }
.plb-demo-nav { display: grid; gap: 4px; padding: 12px; background: var(--carillon-nuit, #071c3b); border-radius: var(--radius, 14px); position: sticky; top: 12px; }
@media (max-width: 800px) { .plb-demo-nav { grid-auto-flow: column; grid-auto-columns: max-content; overflow-x: auto; position: static; } }
.plb-demo-tab {
  display: flex; align-items: center; gap: 10px; min-height: 46px; padding: 10px 14px;
  border: none; background: transparent; border-radius: var(--radius-sm, 10px); cursor: pointer;
  color: #c6d2e6; font-size: 0.92rem; font-weight: 600; text-align: left; white-space: nowrap;
}
.plb-demo-tab .plb-ic { width: 20px; height: 20px; stroke: currentColor; }
.plb-demo-tab:hover { background: rgba(255, 255, 255, 0.08); color: #fff; }
.plb-demo-tab.active { background: var(--carillon-bleu, #1546a0); color: #fff; }
.plb-demo-mobile { margin-top: 8px; border-top: 1px solid rgba(255, 255, 255, 0.14); padding-top: 14px; }
.plb-demo-stage { background: var(--blanc-chaud, #faf8f3); border-radius: var(--radius, 14px); padding: 22px; min-height: 400px; }
/* Bascule « mobile terrain » : on cadre l'aperçu comme un écran de téléphone. */
.plb-demo-stage.is-mobile { max-width: 412px; margin: 0 auto; border: 1px solid var(--line, #d9e2ee); box-shadow: var(--shadow-strong, 0 18px 40px rgba(7, 28, 59, 0.16)); }

/* --------------------------------------------------------------------------
   8. MOBILE TERRAIN — pile, cibles généreuses, une main.
   -------------------------------------------------------------------------- */
.plb-mobile .plb-mission, .plb-demo-stage.is-mobile .plb-mission { padding: 18px; border-radius: 16px; }
.plb-mobile .plb-mission-title, .plb-demo-stage.is-mobile .plb-mission-title { font-size: 1.3rem; }
.plb-mobile-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin: 0 0 12px;
}
.plb-mobile-summary button {
  display: grid;
  justify-items: start;
  min-width: 0;
  min-height: 64px;
  padding: 10px 12px;
  border: 1px solid var(--line, #d9e2ee);
  border-radius: 12px;
  background: #fff;
  color: var(--ink, #071c3b);
  cursor: pointer;
  text-align: left;
}
.plb-mobile-summary button:last-child { background: #fffbeb; border-color: #e4c36d; }
.plb-mobile-summary strong { font-size: 1.25rem; line-height: 1; font-variant-numeric: tabular-nums; }
.plb-mobile-summary span { margin-top: 4px; color: #46566d; font-size: .7rem; font-weight: 700; }
.plb-day-clear {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  margin-top: 12px;
  box-shadow: none;
}
.plb-day-clear-icon {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 11px;
  background: var(--gris-bleute, #e8eef7);
  color: var(--carillon-bleu, #1546a0);
}
.plb-day-clear-icon .plb-ic { width: 20px; height: 20px; }
.plb-day-clear .btn { grid-column: 1 / -1; width: 100%; justify-content: center; }
@media (max-width: 440px) {
  /* Une main, sans débordement : 2×2 gros boutons (≥48px) plutôt que 4 colonnes
     écrasées — recette 390×844 (audit : zéro débordement horizontal). */
  .plb-terrain-actions { grid-template-columns: repeat(2, 1fr); }
  .plb-taction { min-height: 56px; }
  .plb-mission-footer { flex-direction: column; }
  .plb-mission-footer .btn { width: 100%; }
  .plb-demo-stage { padding: 12px; }
  /* Rangées denses (billing, versions admin) : on enveloppe au lieu de déborder. */
  .plb-doc-row, .plb-version-row { flex-wrap: wrap; }
  .plb-doc-row .btn { width: 100%; justify-content: center; }
  .plb-field strong { overflow-wrap: anywhere; }
  .plb-mobile .plb-sim-banner {
    gap: 9px;
    margin-bottom: 12px;
    padding: 9px 11px;
  }
  .plb-mobile .plb-sim-banner-ic { width: 20px; height: 20px; }
  .plb-mobile .plb-sim-banner strong { font-size: .8rem; }
  .plb-mobile .plb-sim-banner span { display: none; }
  .plb-mobile .plb-focus-card {
    grid-template-columns: 40px minmax(0, 1fr);
    gap: 10px;
    padding: 13px 14px;
  }
  .plb-mobile .plb-focus-icon { width: 38px; height: 38px; }
  .plb-mobile .plb-focus-card > .btn {
    grid-column: 1 / -1;
    width: 100%;
  }
  .plb-mobile .plb-focus-body h2 { font-size: .96rem; }
  .plb-mobile .plb-focus-body p { font-size: .8rem; }
  .plb-mobile .plb-block { padding: 12px; }
}
.plb-demo-stage, .plb-mission, .plb-page { min-width: 0; }

@media (max-width: 1100px) {
  .plb-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .plb-home-cols { grid-template-columns: 1fr; }
}

@media (max-width: 800px) {
  .plb-greeting { font-size: 1.75rem; margin-bottom: 14px; }
  .plb-priority,
  .plb-focus-card {
    grid-template-columns: 48px minmax(0, 1fr);
  }
  .plb-priority-cta,
  .plb-focus-card > .btn {
    grid-column: 1 / -1;
    width: 100%;
  }
  .plb-kpis { gap: 8px; }
  .plb-kpi { min-height: 78px; padding: 11px 12px; }
}

/* Focus clavier VISIBLE sur tous les contrôles du module (le reset global de
   l'app supprime l'outline sans remplacement ; l'audit exige un parcours
   clavier praticable). :focus-visible = clavier uniquement, pas de halo souris. */
[data-plb-root] button:focus-visible,
[data-plb-root] a:focus-visible,
[data-plb-root] input:focus-visible,
[data-plb-root] select:focus-visible,
.plb-demo-tab:focus-visible {
  outline: 3px solid var(--carillon-bleu, #1546a0);
  outline-offset: 2px;
  border-radius: 6px;
}

/* Itinéraire variante « mission » SUR CARTE BLANCHE (.plb-mission) : la feuille
   carillon-itineraire.css la peint en blanc pour la carte bleu nuit du mobile ;
   ici on rétablit des encres lisibles (identité : nuit / bleu France). */
.plb-mission .itineraire-mission .itineraire-address { color: var(--carillon-nuit, #071c3b); }
.plb-mission .itineraire-mission .itineraire-pin { color: var(--carillon-bleu, #1546a0); }
.plb-mission .itineraire-mission .itineraire-btn {
  background: var(--carillon-bleu, #1546a0);
  border-color: var(--carillon-bleu, #1546a0);
  color: #fff;
}
.plb-mission .itineraire-mission .itineraire-btn:hover { background: var(--carillon-bleu-fonce, #0f3578); }
.plb-mission .itineraire-mission .itineraire-distance,
.plb-mission .itineraire-mission .itineraire-missing,
.plb-mission .itineraire-mission .itineraire-dist-value { color: var(--muted, #596579); }

/* --------------------------------------------------------------------------
   9. TOAST de repli (banc autonome) — le noyau prime quand il est là.
   -------------------------------------------------------------------------- */
.plb-toast {
  position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 20px);
  z-index: 400; max-width: min(92vw, 420px); padding: 13px 18px;
  background: var(--carillon-nuit, #071c3b); color: #fff; border-radius: var(--radius-sm, 10px);
  box-shadow: var(--shadow-strong, 0 18px 40px rgba(7, 28, 59, 0.16)); font-size: 0.9rem;
  opacity: 0; transition: opacity 220ms ease, transform 220ms ease; pointer-events: none;
}
.plb-toast.show { opacity: 1; transform: translate(-50%, 0); }

@media (prefers-reduced-motion: reduce) { .plb-toast { transition: none; } }

/* --------------------------------------------------------------------------
   13. ÉCRANS ENTREPRISE / RÉGLAGES / ADMIN (maquettes 13-15).
   Même grammaire que le reste du module : panneaux blancs, rayons 14px,
   bleu nuit pour les titres, vermillon UNIQUEMENT via les chips d'urgence
   et les mots-clés sécurité.
   -------------------------------------------------------------------------- */
.plb-ent-grid, .plb-param-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 14px; }
.plb-admin-grid { display: grid; grid-template-columns: 1.4fr 1fr; gap: 14px; }
.plb-admin-grid .plb-admin-content { grid-column: 1 / -1; }
@media (max-width: 860px) { .plb-admin-grid { grid-template-columns: 1fr; } }

.plb-panel-ic { width: 20px; height: 20px; color: var(--bleu-france, #2e5aac); }
.plb-panel-sub { margin: -4px 0 12px; color: var(--muted, #596579); font-size: 0.85rem; }
.plb-panel-note {
  display: flex; align-items: flex-start; gap: 8px; margin: 12px 0 0;
  padding: 10px 12px; background: var(--gris-bleute, #eef2f9);
  border-radius: var(--radius-sm, 10px); color: var(--muted, #596579); font-size: 0.82rem;
}
.plb-note-ic { width: 16px; height: 16px; flex: none; margin-top: 1px; color: var(--bleu-france, #2e5aac); }

/* Fiche : rangées label/valeur ; champ vide = déclaré « À compléter ». */
.plb-fields { display: grid; gap: 10px; }
.plb-field { display: grid; gap: 2px; padding: 9px 12px; background: var(--blanc-chaud, #faf7f0); border-radius: var(--radius-sm, 10px); }
.plb-field small { color: var(--muted, #596579); font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.05em; }
.plb-field strong { color: var(--carillon-nuit, #071c3b); font-size: 0.95rem; }
.plb-field.is-missing strong { color: var(--muted, #596579); font-style: italic; font-weight: 600; }
.plb-field-foot { color: var(--muted, #596579); font-size: 0.78rem; }

/* Réglages : horaires + astreinte. */
.plb-hours { display: grid; gap: 6px; }
.plb-hours-row { display: flex; justify-content: space-between; padding: 8px 12px; background: var(--blanc-chaud, #faf7f0); border-radius: var(--radius-sm, 10px); }
.plb-hours-row strong { color: var(--carillon-nuit, #071c3b); font-size: 0.9rem; }
.plb-hours-row span { color: var(--carillon-nuit, #071c3b); font-variant-numeric: tabular-nums; }
.plb-hours-row.is-closed span { color: var(--muted, #596579); font-style: italic; }
.plb-oncall {
  display: flex; align-items: center; gap: 10px; margin-top: 12px; padding: 11px 12px;
  border: 1px solid var(--line, #e3e0d8); border-radius: var(--radius-sm, 10px);
}
.plb-oncall.is-on { border-color: var(--bleu-france, #2e5aac); background: var(--gris-bleute, #eef2f9); }
.plb-oncall-ic { color: var(--bleu-france, #2e5aac); }
.plb-oncall strong { display: block; color: var(--carillon-nuit, #071c3b); font-size: 0.9rem; }
.plb-oncall span { color: var(--muted, #596579); font-size: 0.82rem; }
.plb-oncall .plb-chip { margin-left: auto; }

/* Réglages : zones actives (chips à bascule, cibles >= 40px). */
.plb-zones { display: flex; flex-wrap: wrap; gap: 8px; }
.plb-zone-chip {
  display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 8px 14px;
  background: var(--blanc-chaud, #faf7f0); border: 1.5px solid var(--line, #e3e0d8);
  border-radius: 999px; color: var(--muted, #596579); font-size: 0.85rem; font-weight: 600; cursor: pointer;
}
.plb-zone-chip.is-on { background: var(--gris-bleute, #eef2f9); border-color: var(--bleu-france, #2e5aac); color: var(--carillon-nuit, #071c3b); }
.plb-zone-ic { width: 15px; height: 15px; color: var(--bleu-france, #2e5aac); }

/* Réglages : prix bornés (positionnement en lecture — la borne est la règle). */
.plb-prices { display: grid; gap: 12px; }
.plb-price-row { display: grid; gap: 6px; padding: 10px 12px; background: var(--blanc-chaud, #faf7f0); border-radius: var(--radius-sm, 10px); }
.plb-price-row strong { color: var(--carillon-nuit, #071c3b); font-size: 0.9rem; }
.plb-price-row small { display: block; color: var(--muted, #596579); font-size: 0.78rem; }
/* Reglages d'exploitation : champs REELS, plus une jauge decorative. Les prix
   sont saisis, bornes par le catalogue metier et reverifies cote serveur. */
.plb-price-input { display: inline-flex; align-items: center; gap: 6px; }
.plb-price-input input {
  width: 92px; padding: 7px 9px; border: 1px solid var(--line, #d9e2ee); border-radius: 8px;
  font: inherit; text-align: right; font-variant-numeric: tabular-nums;
  color: var(--carillon-nuit, #071c3b); background: var(--surface, #fff);
}
.plb-price-input input:focus-visible,
.plb-hours-inputs input:focus-visible { outline: 2px solid var(--carillon-bleu, #1546a0); outline-offset: 1px; }
.plb-price-input input:invalid { border-color: var(--rouge, #b42318); background: #fff5f4; }
.plb-price-input i { font-style: normal; color: var(--muted, #596579); }
.plb-price-filter { display: block; margin: 0 0 8px; }
.plb-price-filter input {
  width: 100%; padding: 8px 11px; border: 1px solid var(--line, #d9e2ee); border-radius: 9px;
  font: inherit; color: var(--carillon-nuit, #071c3b); background: var(--surface, #fff);
}
.plb-prices { max-height: 420px; overflow-y: auto; }
.plb-hours-inputs { display: inline-flex; align-items: center; gap: 6px; }
.plb-hours-inputs input {
  padding: 6px 8px; border: 1px solid var(--line, #d9e2ee); border-radius: 8px;
  font: inherit; color: var(--carillon-nuit, #071c3b); background: var(--surface, #fff);
}
/* Barre d'enregistrement : elle n'apparait QUE s'il y a quelque chose a
   enregistrer, et reste visible au defilement — sinon l'artisan quitte la page
   en croyant avoir enregistre. */
.plb-save-bar {
  position: sticky; bottom: 0; z-index: 5; display: flex; align-items: center; gap: 10px;
  margin-top: 14px; padding: 10px 14px; border: 1px solid var(--line, #d9e2ee);
  border-radius: 12px; background: var(--surface, #fff);
  box-shadow: 0 -2px 12px rgba(7, 28, 59, 0.10);
}
.plb-save-bar[hidden] { display: none; }
.plb-save-note { flex: 1; color: var(--carillon-ambre-fonce, #8a5a00); font-weight: 700; font-size: 0.85rem; }
.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;
}

/* « Géré par CarillonPro » : verrouillé, visible, jamais caché. */
.plb-locked-panel { background: var(--carillon-nuit, #071c3b); }
.plb-locked-panel .plb-panel-head h2, .plb-locked-panel .plb-panel-head .plb-panel-ic { color: #fff; }
.plb-locked-list { display: grid; gap: 12px; margin: 0; padding: 0; list-style: none; }
.plb-locked-list li { display: flex; gap: 10px; align-items: flex-start; }
.plb-locked-list li .plb-ic { width: 17px; height: 17px; flex: none; margin-top: 2px; color: rgba(255, 255, 255, 0.75); }
.plb-locked-list strong { display: block; color: #fff; font-size: 0.9rem; }
.plb-locked-list span { color: rgba(255, 255, 255, 0.72); font-size: 0.82rem; line-height: 1.45; }

/* Admin : bandeau espace installateur (gate déclarée) + versions immuables. */
.plb-admin-gate {
  display: flex; gap: 12px; align-items: flex-start; margin-bottom: 16px; padding: 13px 16px;
  background: var(--carillon-nuit, #071c3b); border-radius: var(--radius, 14px);
}
.plb-admin-gate-ic { width: 22px; height: 22px; flex: none; color: #fff; }
.plb-admin-gate strong { display: block; color: #fff; font-size: 0.95rem; }
.plb-admin-gate span { color: rgba(255, 255, 255, 0.75); font-size: 0.83rem; line-height: 1.45; }

.plb-versions { display: grid; gap: 8px; }
.plb-version-row {
  display: flex; align-items: center; gap: 12px; padding: 11px 12px;
  background: var(--blanc-chaud, #faf7f0); border: 1.5px solid transparent; border-radius: var(--radius-sm, 10px);
}
.plb-version-row.is-bound { border-color: var(--bleu-france, #2e5aac); background: var(--gris-bleute, #eef2f9); }
.plb-version-row > div { flex: 1; min-width: 0; }
.plb-version-num {
  flex: none; display: inline-flex; align-items: center; justify-content: center;
  width: 38px; height: 38px; background: var(--carillon-nuit, #071c3b); color: #fff;
  border-radius: 10px; font-weight: 800; font-size: 0.85rem;
}
.plb-version-row strong { display: block; color: var(--carillon-nuit, #071c3b); font-size: 0.9rem; }
.plb-version-row small { color: var(--muted, #596579); font-size: 0.78rem; }
.plb-bound-tag { display: inline-flex; align-items: center; gap: 5px; color: var(--bleu-france, #2e5aac); font-size: 0.82rem; font-weight: 700; }

.plb-admin-cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; }
.plb-admin-cols h3 { margin: 0 0 8px; color: var(--carillon-nuit, #071c3b); font-size: 0.82rem; text-transform: uppercase; letter-spacing: 0.05em; }
.plb-mini-list { display: flex; flex-wrap: wrap; gap: 6px; margin: 0; padding: 0; list-style: none; }
.plb-mini-list li { display: inline-flex; align-items: center; gap: 6px; }
.plb-mini-list li > span:last-child:not(.plb-chip) { color: var(--muted, #596579); font-size: 0.8rem; }
.plb-mini-text { display: grid; gap: 6px; }
.plb-mini-text li { color: var(--carillon-nuit, #071c3b); font-size: 0.86rem; }
.plb-safety p { display: flex; gap: 6px; margin: 0 0 8px; color: var(--muted, #596579); font-size: 0.82rem; }
.plb-safety-words { display: flex; flex-wrap: wrap; gap: 6px; }
.plb-safety-words span {
  padding: 4px 10px; background: #fdeeec; color: var(--vermillon, #c73e33);
  border-radius: 999px; font-size: 0.8rem; font-weight: 700;
}
.plb-template-preview {
  margin: 0; padding: 10px 12px; background: var(--blanc-chaud, #faf7f0);
  border-left: 3px solid var(--bleu-france, #2e5aac); border-radius: 0 10px 10px 0;
  color: var(--carillon-nuit, #071c3b); font-size: 0.85rem; line-height: 1.5;
}

/* Annuaire Clients : surface large, financière et responsive. */
.plb-client-page { width: 100%; max-width: none; }
.plb-client-page-head { align-items: flex-start; justify-content: space-between; }
.plb-client-page-head > div { min-width: 0; }
.plb-client-page-head .plb-kicker { margin: 0 0 5px; color: var(--carillon-bleu, #1546a0); font-size: .76rem; font-weight: 900; letter-spacing: .08em; }
.plb-client-page-head p:last-child { margin: 7px 0 0; color: var(--muted, #596579); }
.plb-client-kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 16px; }
.plb-client-kpis article { display: grid; gap: 5px; padding: 14px 16px; border: 1px solid var(--line, #d9e2ee); border-radius: 14px; background: #fff; box-shadow: var(--shadow, 0 1px 2px rgba(7,28,59,.06)); }
.plb-client-kpis span { color: var(--muted, #596579); font-size: .78rem; font-weight: 800; text-transform: uppercase; letter-spacing: .04em; }
.plb-client-kpis strong { color: var(--carillon-nuit, #071c3b); font-size: 1.35rem; font-variant-numeric: tabular-nums; }
.plb-client-toolbar { display: grid; grid-template-columns: minmax(240px, 1fr) minmax(210px, auto); gap: 12px; align-items: end; padding: 14px; border: 1px solid var(--line, #d9e2ee); border-radius: 14px; background: #f8fbff; }
.plb-client-toolbar label { display: grid; gap: 5px; color: var(--muted, #596579); font-size: .78rem; font-weight: 800; }
.plb-client-toolbar input, .plb-client-toolbar select { width: 100%; min-height: 44px; border: 1px solid var(--line, #d9e2ee); border-radius: 10px; padding: 9px 12px; background: #fff; color: var(--carillon-nuit, #071c3b); }
.plb-client-toolbar input:focus, .plb-client-toolbar select:focus { border-color: var(--carillon-bleu, #1546a0); outline: 3px solid rgba(21,70,160,.13); }
.plb-client-result { margin: 11px 2px; color: var(--muted, #596579); font-size: .82rem; font-weight: 700; }
.plb-client-page .plb-client-grid { grid-template-columns: repeat(auto-fit, minmax(min(390px, 100%), 1fr)); align-items: start; }
.plb-client-page .plb-client-card { display: grid; gap: 13px; min-width: 0; padding: 17px; }
.plb-client-page .plb-client-card.is-expanded { grid-column: 1 / -1; border-color: #7da7e8; box-shadow: 0 0 0 3px rgba(21,70,160,.1); }
.plb-client-card-head { display: grid; grid-template-columns: 54px minmax(0, 1fr); align-items: center; gap: 12px; }
.plb-client-avatar { display: grid; place-items: center; width: 54px; height: 54px; overflow: hidden; border-radius: 50%; background: #e6effd; color: var(--carillon-bleu-fonce, #0f3578); border: 2px solid #c5d9f6; font-weight: 900; }
.plb-client-avatar img { width: 100%; height: 100%; object-fit: cover; }
.plb-client-initials { font-size: 1rem; letter-spacing: .03em; }
.plb-client-identity { display: grid; gap: 3px; min-width: 0; }
.plb-client-page .plb-client-identity strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 1rem; }
.plb-client-page .plb-client-identity small { overflow-wrap: anywhere; }
.plb-client-source { width: fit-content; margin-top: 4px; padding: 3px 8px; border-radius: 999px; background: #eaf7ef; color: #137044; font-size: .7rem; font-weight: 800; }
.plb-client-card:has(.plb-client-addr:first-of-type) .plb-client-source { max-width: 100%; }
.plb-client-page .plb-client-addr { min-height: 22px; margin: 0; overflow-wrap: anywhere; }
.plb-client-metrics { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); overflow: hidden; border: 1px solid #e3eaf3; border-radius: 11px; background: #fbfcfe; }
.plb-client-metrics > span { display: grid; gap: 2px; min-width: 0; padding: 10px; border-right: 1px solid #e3eaf3; }
.plb-client-metrics > span:last-child { border-right: 0; }
.plb-client-metrics strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--carillon-nuit, #071c3b); font-size: .92rem; font-variant-numeric: tabular-nums; }
.plb-client-metrics small { color: var(--muted, #596579); font-size: .7rem; }
.plb-client-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 7px; }
.plb-client-actions .btn.sm { min-height: 38px; padding: 7px 11px; }
.plb-client-actions .danger { margin-left: auto; color: #a3212d; }
.plb-client-detail { display: grid; gap: 9px; padding-top: 11px; border-top: 1px solid var(--line, #d9e2ee); }
.plb-client-detail[hidden] { display: none; }
.plb-client-detail ul { display: grid; gap: 7px; margin: 0; padding: 0; list-style: none; }
.plb-client-detail li { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 10px; background: #f6f9fd; }
.plb-client-detail li > span:first-child { display: grid; gap: 3px; min-width: 0; }
.plb-client-detail li strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .86rem; }
.plb-client-detail li small { color: var(--muted, #596579); font-size: .74rem; }
.plb-client-empty { grid-column: 1 / -1; display: grid; justify-items: center; gap: 5px; min-height: 180px; place-content: center; border: 1px dashed #b8c7da; border-radius: 14px; background: #fbfcfe; text-align: center; }
.plb-client-empty span { color: var(--muted, #596579); }

@media (max-width: 900px) {
  .plb-client-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .plb-client-toolbar { grid-template-columns: 1fr; }
  .plb-client-page .plb-client-grid { grid-template-columns: 1fr; }
}

@media (max-width: 560px) {
  .plb-client-page-head { gap: 8px; }
  .plb-client-kpis { gap: 8px; }
  .plb-client-kpis article { padding: 11px 12px; }
  .plb-client-page .plb-client-card { padding: 14px; }
  .plb-client-metrics { grid-template-columns: 1fr; }
  .plb-client-metrics > span { grid-template-columns: minmax(0,1fr) auto; align-items: center; border-right: 0; border-bottom: 1px solid #e3eaf3; }
  .plb-client-metrics > span:last-child { border-bottom: 0; }
  .plb-client-actions .btn { flex: 1 1 140px; }
  .plb-client-actions .danger { margin-left: 0; }
}
/* La vue terrain est montée après la coquille mobile. Cette règle tardive
   empêche le masque desktop de conserver la carte à display:none sur téléphone. */
@media (max-width: 800px) {
  body.phone-mode #mobileMissionCard.plb-mobile {
    display: grid !important;
  }
  .plb-journey {
    margin-inline: -2px;
    padding: 12px;
    scrollbar-width: thin;
  }
  .plb-journey ol {
    grid-template-columns: repeat(5, 104px);
    min-width: 520px;
  }
  .plb-journey li { padding-inline: 4px; font-size: .72rem; }
  .plb-empty-state { min-height: 160px; padding: 20px 14px; }
}

/* --------------------------------------------------------------------------
   Popup DÉTAIL d'un rendez-vous + centrage des avatars (mandat patron 27/07).
   -------------------------------------------------------------------------- */
.plb-appt-detail { display: grid; gap: 10px; }
.plb-appt-detail-head { display: flex; align-items: center; gap: 12px; }
.plb-appt-detail-head > div { display: grid; gap: 2px; min-width: 0; }
.plb-appt-detail-head strong { font-size: 1rem; color: var(--carillon-nuit, #071c3b); }
.plb-appt-detail-head small { color: var(--muted, #596579); }
.plb-appt-detail-badges { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.plb-appt-detail-row {
  display: grid; grid-template-columns: 150px 1fr; gap: 10px; align-items: start;
  padding: 7px 0; border-top: 1px solid var(--line, #d9e2ee);
}
.plb-appt-detail-row small { color: var(--muted, #596579); font-weight: 700; }
.plb-appt-detail-row span { color: var(--carillon-nuit, #071c3b); overflow-wrap: anywhere; }
@media (max-width: 560px) { .plb-appt-detail-row { grid-template-columns: 1fr; gap: 2px; } }

/* Une ligne de planning devenue cliquable doit le montrer. */
.plb-plan-row[data-plb-appt-row] { cursor: pointer; }
.plb-plan-row[data-plb-appt-row]:hover { background: #eef4fd; }
.plb-plan-row[data-plb-appt-row]:focus-visible { outline: 2px solid var(--carillon-bleu, #1546a0); outline-offset: 2px; }

/* CENTRAGE DES INITIALES — `.plb-week-card span { display:block }` (spécificité
   supérieure) écrasait le `inline-grid` de l'avatar : les initiales tombaient
   en haut à gauche du cercle. On rétablit la grille centrée là où l'avatar vit,
   au lieu d'affaiblir la règle générique des cartes. */
.plb-week-card .plb-appointment-avatar,
.plb-plan-row .plb-appointment-avatar,
.plb-appt-detail .plb-appointment-avatar {
  display: inline-grid; place-items: center; text-align: center; line-height: 1;
}
.plb-client-avatar, .plb-client-initials { display: inline-grid; place-items: center; text-align: center; line-height: 1; }

/* KPI par client + édition de la fiche (mandat patron 27/07). */
.plb-client-metrics { display: flex; flex-wrap: wrap; gap: 8px; }
.plb-client-kpi {
  display: grid; gap: 1px; min-width: 92px; flex: 1 1 92px;
  padding: 7px 9px; border: 1px solid var(--line, #d9e2ee); border-radius: 10px;
  background: var(--surface, #fff);
}
.plb-client-kpi strong { font-size: 0.95rem; color: var(--carillon-nuit, #071c3b); line-height: 1.15; }
.plb-client-kpi small { color: var(--muted, #596579); font-size: 0.7rem; font-weight: 700; }
.plb-client-kpi.is-paid { border-color: #b7e0c8; background: #f2fbf5; }
.plb-client-kpi.is-paid strong { color: #1c7a48; }
.plb-client-kpi.is-unpaid { border-color: #f2c0c6; background: #fdf3f4; }
.plb-client-kpi.is-unpaid strong { color: #b3212f; }

.plb-client-edit { display: grid; gap: 10px; }
.plb-client-edit-field { display: grid; gap: 3px; }
.plb-client-edit-field span { color: var(--muted, #596579); font-size: 0.78rem; font-weight: 800; }
.plb-client-edit-field input {
  padding: 9px 11px; border: 1px solid var(--line, #d9e2ee); border-radius: 9px;
  font: inherit; color: var(--carillon-nuit, #071c3b); background: var(--surface, #fff);
}
.plb-client-edit-field input:focus-visible { outline: 2px solid var(--carillon-bleu, #1546a0); outline-offset: 1px; }
.plb-client-edit-note { margin: 2px 0 0; color: var(--muted, #596579); font-size: 0.76rem; }
/* SAISIE REFUSÉE : le champ fautif se voit, et la raison est écrite en clair
   au-dessus du formulaire — plus de bandeau volant qui disparaît tout seul. */
.plb-client-edit-field.is-required em { color: #b3212f; font-style: normal; }
.plb-client-edit-field input.is-invalid { border-color: #b3212f; background: #fdf3f4; }
.plb-client-edit-field input.is-invalid:focus-visible { outline-color: #b3212f; }
.plb-client-edit-errors {
  margin: 0; padding: 9px 12px 9px 28px; list-style: disc;
  border: 1px solid #f2c0c6; border-radius: 9px; background: #fdf3f4;
  color: #8f1a26; font-size: 0.8rem; line-height: 1.35;
}
.plb-client-edit-note.is-safe { padding: 8px 10px; border: 1px solid #b7e0c8; border-radius: 9px; background: #f2fbf5; color: #1c6b43; }
.plb-client-edit-note.is-alert { padding: 8px 10px; border: 1px solid #f0c489; border-radius: 9px; background: #fffaf2; color: #7c500f; }
.plb-client-edit-field select, .plb-client-edit-field textarea {
  width: 100%; padding: 9px 11px; border: 1px solid var(--line, #d9e2ee); border-radius: 9px;
  font: inherit; color: var(--carillon-nuit, #071c3b); background: var(--surface, #fff);
}
.plb-client-edit-field textarea { resize: vertical; min-height: 104px; }
.plb-client-edit-field select:focus-visible, .plb-client-edit-field textarea:focus-visible { outline: 2px solid var(--carillon-bleu, #1546a0); outline-offset: 1px; }
.plb-reschedule-review { display: grid; gap: 12px; }
.plb-reschedule-change { display: grid; grid-template-columns: minmax(0,1fr) auto minmax(0,1fr); align-items: center; gap: 10px; padding: 10px; border: 1px solid var(--line, #d9e2ee); border-radius: 10px; background: #f8fafc; }
.plb-reschedule-change span { display: grid; gap: 2px; }
.plb-reschedule-change small { color: var(--muted, #596579); font-size: .72rem; font-weight: 800; }
.plb-reschedule-change strong { color: var(--carillon-nuit, #071c3b); font-size: .86rem; }
@media (max-width: 520px) {
  .plb-plan-status-filters { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 3px; }
  .plb-plan-status-filters .plb-plan-chip { flex: 0 0 auto; min-height: 44px; }
  .plb-reschedule-change { grid-template-columns: 1fr; }
  .plb-reschedule-change > span[aria-hidden] { transform: rotate(90deg); justify-self: center; }
}
.plb-client-edit-errors[hidden] { display: none; }

/* FICHE CRÉÉE À L'INSTANT : sans repère, la nouvelle carte atterrissait en bas
   de liste et l'écran semblait n'avoir rien fait. */
.plb-client-card.is-new { border-color: #1c7a48; box-shadow: 0 0 0 2px rgba(28, 122, 72, 0.18); }
.plb-client-new-flag {
  margin: 0; align-self: start; justify-self: start;
  padding: 3px 9px; border-radius: 999px;
  background: #e7f5ed; color: #1c7a48;
  font-size: 0.72rem; font-weight: 800; letter-spacing: 0.02em;
}
/* Le bouton suit le champ SIRET qu'il complète : aligné a droite, sans occuper
   la largeur d'une ligne de formulaire. */
.plb-siret-lookup { justify-self: start; margin: -4px 0 2px; font-size: 0.8rem; padding: 6px 12px; }

/* Installation du chat sur le site de l'artisan. La balise doit rester lisible
   en entier : c'est ce qu'il va copier-coller, une troncature le piegerait. */
.plb-chatsite { display: grid; gap: 10px; }
.plb-chatsite textarea {
  padding: 9px 11px; border: 1px solid var(--line, #d9e2ee); border-radius: 9px;
  font: inherit; color: var(--carillon-nuit, #071c3b); background: var(--surface, #fff);
  resize: vertical; width: 100%;
}
.plb-chatsite textarea[readonly] {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 0.78rem;
  background: var(--surface-2, #f4f7fc); color: var(--muted, #596579);
}
.plb-chatsite textarea:focus-visible { outline: 2px solid var(--carillon-bleu, #1546a0); outline-offset: 1px; }
.plb-chatsite-actions { display: flex; flex-wrap: wrap; gap: 8px; }

/* Le plombier rend son propre « Profil entreprise » dans l'onglet Dossier
   administratif : la carte équivalente de l'onglet Entreprise ferait doublon
   (redondance relevée par le patron le 27/07). */
body.trade-plumber [data-doublon-dossier-administratif] { display: none; }

/* Rapports d'intervention : classement, signatures, partage (27/07). */
.plb-report-list { display: grid; gap: 10px; }
.plb-report-card {
  display: flex; flex-wrap: wrap; align-items: center; gap: 12px;
  padding: 12px 14px; border: 1px solid var(--line, #d9e2ee); border-radius: 12px;
  background: var(--surface, #fff);
}
.plb-report-main { display: grid; gap: 2px; flex: 1 1 220px; min-width: 0; }
.plb-report-main strong { color: var(--carillon-nuit, #071c3b); }
.plb-report-main small { color: var(--muted, #596579); }
.plb-report-state { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.plb-report-actions { display: flex; gap: 6px; align-items: center; }
.plb-report-sign, .plb-report-share {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 8px; border-radius: 999px;
  font-size: 0.74rem; font-weight: 800;
}
.plb-report-sign.is-ok { background: #eaf7f0; color: #1c7a48; border: 1px solid #b7e0c8; }
.plb-report-sign.is-todo { background: #fdf3f4; color: #b3212f; border: 1px solid #f2c0c6; }
.plb-report-sign-icon { width: 13px; height: 13px; }
.plb-report-share { background: #eef3fc; color: #1546a0; border: 1px solid #c6d8f4; }

.plb-sign-wrap { display: grid; gap: 14px; }
.plb-sign-slot {
  display: grid; gap: 6px; padding: 12px;
  border: 1px dashed var(--line, #d9e2ee); border-radius: 12px;
}
.plb-sign-slot.is-signed { border-style: solid; background: #f6faf7; }
.plb-sign-slot > small { color: var(--muted, #596579); font-weight: 800; text-transform: uppercase; font-size: 0.7rem; letter-spacing: .04em; }
.plb-sign-slot input[type="text"] {
  padding: 8px 10px; border: 1px solid var(--line, #d9e2ee); border-radius: 8px; font: inherit;
}
.plb-sign-canvas {
  width: 100%; height: 130px; background: #fff; touch-action: none;
  border: 1px solid var(--line, #d9e2ee); border-radius: 8px; cursor: crosshair;
}
.plb-sign-slot-actions { display: flex; gap: 8px; justify-content: flex-end; }

/* --------------------------------------------------------------------------
   TOURNÉE DU JOUR — 3 colonnes (maquette patron 27/07).
   -------------------------------------------------------------------------- */
.plb-tour-list { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; }
.plb-tour-row {
  display: grid; align-items: center; gap: 12px;
  grid-template-columns: 62px minmax(0, 1fr) 108px minmax(0, 190px);
  padding: 10px 12px; border: 1px solid var(--line, #d9e2ee); border-radius: 12px;
  background: var(--surface, #fff);
}
.plb-tour-row.is-urgent { border-color: #f2c0c6; background: #fdf6f7; }
.plb-tour-row.is-live { border-color: #b7cdf2; background: #f5f8fe; }
.plb-tour-row.is-done { opacity: .68; }

.plb-tour-when { display: flex; align-items: center; gap: 8px; }
.plb-tour-hour { font-weight: 900; color: var(--carillon-bleu, #1546a0); font-size: .82rem; }
.plb-tour-rank {
  display: inline-grid; place-items: center; width: 22px; height: 22px; flex: 0 0 auto;
  border-radius: 50%; background: var(--carillon-bleu, #1546a0); color: #fff;
  font-size: .72rem; font-weight: 900;
}
.plb-tour-row.is-urgent .plb-tour-rank { background: var(--carillon-rouge, #e63946); }

.plb-tour-who { display: grid; gap: 1px; min-width: 0; }
.plb-tour-who strong { color: var(--carillon-nuit, #071c3b); font-size: .9rem; }
.plb-tour-who small { color: var(--muted, #596579); font-size: .78rem; }
.plb-tour-addr {
  display: inline-flex; align-items: center; gap: 4px;
  color: var(--muted, #596579); font-size: .74rem; overflow-wrap: anywhere;
}
.plb-tour-addr .plb-ic { width: 12px; height: 12px; flex: 0 0 auto; }

.plb-tour-travel { display: flex; justify-content: flex-start; }
.plb-tour-trip {
  display: grid; grid-template-columns: 16px 1fr; grid-template-rows: auto auto;
  align-items: center; gap: 0 6px;
  padding: 5px 9px; border: 1px solid var(--line, #d9e2ee); border-radius: 9px;
  background: #f7f9fc;
}
.plb-tour-trip .plb-tour-ic { grid-row: span 2; width: 15px; height: 15px; color: var(--muted, #596579); }
.plb-tour-trip strong { font-size: .8rem; color: var(--carillon-nuit, #071c3b); line-height: 1.1; }
.plb-tour-trip small { font-size: .72rem; color: var(--muted, #596579); line-height: 1.1; }
.plb-tour-trip.is-empty {
  display: inline-flex; align-items: center; color: var(--muted, #596579);
  font-size: .74rem; font-weight: 700;
}

.plb-tour-state { display: grid; gap: 5px; justify-items: end; min-width: 0; }
.plb-tour-badge {
  padding: 2px 7px; border-radius: 999px; font-size: .68rem; font-weight: 900; letter-spacing: .04em;
}
.plb-tour-badge.is-urgent { background: #fdecee; color: #b3212f; border: 1px solid #f2c0c6; }
.plb-tour-status { font-size: .76rem; font-weight: 800; }
.plb-tour-status.is-todo { color: #b3212f; }
.plb-tour-status.is-live { color: var(--carillon-bleu, #1546a0); }
.plb-tour-status.is-planned, .plb-tour-status.is-done { color: var(--muted, #596579); }

.plb-tour-contacts {
  display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px;
  max-width: 100%;
}
.plb-tour-contact {
  display: inline-flex; align-items: center; gap: 4px;
  min-width: 0; white-space: nowrap;
  min-height: 32px; padding: 4px 9px; border: 1px solid var(--line, #d9e2ee); border-radius: 999px;
  background: var(--surface, #fff); color: var(--carillon-bleu, #1546a0);
  font: inherit; font-size: .74rem; font-weight: 800; text-decoration: none; cursor: pointer;
}
.plb-tour-contact:hover, .plb-tour-contact:focus-visible { background: #eef4fd; }
.plb-tour-contact .plb-tour-ic { width: 13px; height: 13px; }
.plb-tour-contact.is-off { color: var(--muted, #596579); background: #f4f6f9; cursor: not-allowed; }

.plb-tour-foot {
  display: flex; flex-wrap: wrap; gap: 14px; align-items: center;
  margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--line, #d9e2ee);
  color: var(--muted, #596579); font-size: .78rem;
}
.plb-tour-foot-item { display: inline-flex; align-items: center; gap: 5px; }
.plb-tour-foot-item strong { color: var(--carillon-nuit, #071c3b); }
.plb-tour-foot-item .plb-tour-ic { width: 14px; height: 14px; }

/* Mobile : la ligne se replie en deux niveaux, cibles tactiles préservées. */
@media (max-width: 720px) {
  .plb-tour-row { grid-template-columns: 56px minmax(0, 1fr); grid-template-areas: "when who" "travel state"; }
  .plb-tour-when { grid-area: when; }
  .plb-tour-who { grid-area: who; }
  .plb-tour-travel { grid-area: travel; }
  .plb-tour-state { grid-area: state; justify-items: end; }
  .plb-tour-contact { min-height: 40px; }
}

/* La tournée porte 4 colonnes d'information : elle a besoin de la colonne
   LARGE du tableau de bord (maquette patron : tournée à gauche, validations à
   droite). Sans cela la colonne « client » tombait à 37 px. */
@media (min-width: 1100px) {
  .plb-home-cols:has(.plb-tour-list) { grid-template-columns: minmax(0, 1.45fr) minmax(320px, 1fr); }
}
/* Repli pour les navigateurs sans :has() — la ligne se replie proprement. */
@media (max-width: 1099px) {
  .plb-tour-row { grid-template-columns: 56px minmax(0, 1fr); grid-template-areas: "when who" "travel state"; }
  .plb-tour-when { grid-area: when; }
  .plb-tour-who { grid-area: who; }
  .plb-tour-travel { grid-area: travel; }
  .plb-tour-state { grid-area: state; }
}

/* Repères de tournée demandés par le patron : le rendez-vous EN COURS en vert,
   le SUIVANT en orange. Ces deux états priment sur le statut générique. */
.plb-tour-row.is-now {
  border-color: #7fc9a2; background: #f2fbf6;
  box-shadow: inset 3px 0 0 #1c7a48;
}
.plb-tour-row.is-next {
  border-color: #f0c489; background: #fffaf2;
  box-shadow: inset 3px 0 0 #b5711a;
}
.plb-tour-row.is-now .plb-tour-rank { background: #1c7a48; }
.plb-tour-row.is-next .plb-tour-rank { background: #b5711a; }
.plb-tour-row.is-now .plb-tour-hour { color: #1c7a48; }
.plb-tour-row.is-next .plb-tour-hour { color: #b5711a; }
.plb-tour-status.is-now { color: #1c7a48; font-weight: 900; }
.plb-tour-status.is-next { color: #b5711a; font-weight: 900; }
/* Un rendez-vous urgent reste rouge, mais l'état « en cours » garde son liseré. */
.plb-tour-row.is-urgent.is-now { border-color: #7fc9a2; }

/* Icône du TYPE d'intervention, lisible d'un coup d'œil. */
.plb-tour-title { display: inline-flex; align-items: center; gap: 7px; min-width: 0; }
.plb-tour-type {
  display: inline-grid; place-items: center; flex: 0 0 auto;
  width: 26px; height: 26px; border-radius: 8px;
  background: #eef3fc; color: var(--carillon-bleu, #1546a0);
  border: 1px solid #d5e2f7;
}
.plb-tour-type .plb-tour-ic { width: 15px; height: 15px; }
.plb-tour-type.is-urgence { background: #fdecee; color: #b3212f; border-color: #f2c0c6; }
.plb-tour-type.is-administratif { background: #f3eefb; color: #5b2fa8; border-color: #ddd0f2; }
.plb-tour-type.is-etat_des_lieux { background: #eef7fb; color: #12657f; border-color: #c9e4ef; }
.plb-tour-type.is-entretien { background: #f0f7ee; color: #2f6b28; border-color: #cfe6ca; }
.plb-tour-type.is-installation { background: #fdf5e9; color: #8a5a12; border-color: #f0dfc0; }

/* --------------------------------------------------------------------------
   ÉCRAN ADMINISTRATION — suivi des documents + contacts utiles (27/07).
   -------------------------------------------------------------------------- */
.plb-admin-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin-bottom: 14px; }
.plb-admin-kpis article {
  display: grid; gap: 2px; padding: 11px 13px;
  border: 1px solid var(--line, #d9e2ee); border-radius: 12px; background: var(--surface, #fff);
}
.plb-admin-kpis span { color: var(--muted, #596579); font-size: .74rem; font-weight: 800; }
.plb-admin-kpis strong { font-size: 1.25rem; color: var(--carillon-nuit, #071c3b); }
.plb-admin-kpis article.is-late { border-color: #f2c0c6; background: #fdf3f4; }
.plb-admin-kpis article.is-late strong { color: #b3212f; }
.plb-admin-kpis article.is-soon { border-color: #f0c489; background: #fffaf2; }
.plb-admin-kpis article.is-soon strong { color: #b5711a; }

.plb-doc-list, .plb-contact-list { display: grid; gap: 9px; }
.plb-doc-card, .plb-contact-card {
  display: flex; flex-wrap: wrap; align-items: center; gap: 12px;
  padding: 11px 13px; border: 1px solid var(--line, #d9e2ee); border-radius: 12px;
  background: var(--surface, #fff);
}
.plb-doc-main, .plb-contact-main { display: grid; gap: 2px; flex: 1 1 240px; min-width: 0; }
.plb-doc-main strong, .plb-contact-main strong { color: var(--carillon-nuit, #071c3b); }
.plb-doc-main small, .plb-contact-main small { color: var(--muted, #596579); font-size: .78rem; }
.plb-doc-last.is-empty { font-style: italic; }
.plb-doc-state { display: grid; gap: 3px; justify-items: start; }
.plb-doc-etat { padding: 2px 8px; border-radius: 999px; font-size: .73rem; font-weight: 800; }
.plb-doc-etat.is-todo { background: #fdf3f4; color: #b3212f; border: 1px solid #f2c0c6; }
.plb-doc-etat.is-doing { background: #fffaf2; color: #b5711a; border: 1px solid #f0c489; }
.plb-doc-etat.is-done { background: #f2fbf6; color: #1c7a48; border: 1px solid #b7e0c8; }
.plb-doc-etat.is-archived { background: #f4f6f9; color: #596579; border: 1px solid #d9e2ee; }
.plb-doc-echeance { font-size: .74rem; color: var(--muted, #596579); }
.plb-doc-echeance.is-late { color: #b3212f; font-weight: 800; }
.plb-doc-echeance.is-soon { color: #b5711a; font-weight: 800; }
.plb-doc-card.is-todo { box-shadow: inset 3px 0 0 #e0a3ab; }
.plb-doc-histo ul { display: grid; gap: 5px; margin: 5px 0 0; padding-left: 16px; }
.plb-doc-histo li { color: var(--muted, #596579); font-size: .8rem; }
.plb-doc-histo li strong { color: var(--carillon-nuit, #071c3b); margin-right: 6px; }

.plb-contact-side { display: grid; gap: 5px; justify-items: start; }
.plb-contact-tel {
  display: inline-flex; align-items: center; gap: 5px;
  color: var(--carillon-bleu, #1546a0); font-weight: 800; text-decoration: none;
}
.plb-contact-manque { color: #b5711a; font-size: .78rem; font-weight: 700; }
.plb-contact-liens { display: flex; flex-wrap: wrap; gap: 10px; }
.plb-contact-lien { color: var(--carillon-bleu, #1546a0); font-size: .76rem; }
.plb-contact-source { color: var(--muted, #596579); font-size: .72rem; font-style: italic; }
.plb-contact-note { color: var(--carillon-nuit, #071c3b); }
.plb-contact-card.is-todo { border-style: dashed; }
.plb-admin-lieu { margin: 0 0 9px; color: var(--muted, #596579); font-size: .82rem; }

/* --------------------------------------------------------------------------
   ÉCRAN ÉQUIPE — utilisateurs, rôles, charge (mandat patron 28/07).
   -------------------------------------------------------------------------- */
.plb-op-list { display: grid; gap: 9px; margin-bottom: 14px; }
.plb-op-card {
  display: flex; flex-wrap: wrap; align-items: center; gap: 12px;
  padding: 11px 13px; border: 1px solid var(--line, #d9e2ee); border-radius: 12px;
  background: var(--surface, #fff);
}
.plb-op-card.is-off { opacity: .62; border-style: dashed; }
.plb-op-main { display: flex; align-items: center; gap: 10px; flex: 1 1 240px; min-width: 0; }
.plb-op-main > div { display: grid; gap: 1px; min-width: 0; }
.plb-op-main strong { color: var(--carillon-nuit, #071c3b); }
.plb-op-main small { color: var(--muted, #596579); font-size: .78rem; }
.plb-op-avatar {
  display: inline-grid; place-items: center; flex: 0 0 auto;
  width: 36px; height: 36px; border-radius: 50%;
  background: #dceafb; color: #0b3b82; font-size: .78rem; font-weight: 900;
}
.plb-op-invite {
  display: inline-block; margin-top: 2px; padding: 1px 7px; border-radius: 999px;
  background: #fffaf2; color: #b5711a; border: 1px solid #f0c489;
  font-size: .7rem; font-weight: 800;
}
.plb-op-invite.is-off { background: #f4f6f9; color: #596579; border-color: #d9e2ee; }
.plb-op-charge { display: grid; gap: 1px; justify-items: end; min-width: 116px; }
.plb-op-charge strong { font-size: 1rem; color: var(--carillon-nuit, #071c3b); }
.plb-op-charge small { color: var(--muted, #596579); font-size: .72rem; }
.plb-op-charge.is-free strong { color: #1c7a48; }
.plb-op-charge.is-busy strong { color: #b5711a; }
.plb-op-charge.is-over strong { color: #b3212f; }

.plb-affect-list { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; }
.plb-affect-list li {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px;
  padding: 10px 12px; border: 1px solid var(--line, #d9e2ee); border-radius: 10px;
  background: #fffdf7;
}
.plb-affect-list li > span:first-child { display: grid; gap: 1px; min-width: 0; }
.plb-affect-actions { display: flex; gap: 6px; }

/* ==========================================================================
   Graphiques CarillonCharts dans l'app artisan (spéc. 02/08 — lots A1-A5).
   Le module carillon-charts.css porte les composants ; ici, uniquement la
   mise en page de leurs emplacements dans les écrans plombier.
   ========================================================================== */

/* Densité 02/08 — rangée KPI fusionnée du tableau de bord : les tuiles
   tuileKpi (tendance intégrée) sont des BOUTONS (point d'entrée E1), le
   donut « Demandes par canal » occupe la 4e cellule de la même rangée.
   L'ex-carte « Activité » pleine largeur a disparu avec ses styles. */
.plb-kpi-tuile {
  display: block; width: 100%; margin: 0; padding: 0;
  border: 0; background: none; text-align: left; font: inherit; cursor: pointer;
}
.plb-kpi-tuile .cch-tuile { height: 100%; }
.plb-kpi-tuile:hover .cch-tuile,
.plb-kpi-tuile:focus-visible .cch-tuile { border-color: var(--carillon-bleu, #1546a0); }
.plb-kpi-tuile:focus-visible { outline: 2px solid var(--carillon-bleu, #1546a0); outline-offset: 2px; border-radius: 14px; }
.plb-kpis--fusion { align-items: stretch; }
.plb-kpi-donutcell {
  display: grid; align-content: center; min-width: 0;
  padding: 12px 14px; border: 1px solid var(--line, #d9e2ee);
  border-radius: 14px; background: var(--surface, #ffffff);
}
.plb-kpi-donutcell .cch-vide { padding: 6px 2px; }
/* Cellule étroite (1/4 de rangée) : anneau au-dessus de la légende valorisée. */
.plb-kpi-donutcell .cch-donut-corps { grid-template-columns: 1fr; gap: 8px; justify-items: start; }

/* Densité 02/08 — avancement de tournée en pastille du head (ex-jauge). */
.plb-tour-avance {
  display: inline-flex; align-items: center; margin-left: auto; padding: 2px 10px;
  border-radius: 999px; background: var(--gris-bleute, #e8eef7);
  color: var(--carillon-bleu-fonce, #0f3578); font-size: 0.78rem; font-weight: 700;
  white-space: nowrap;
}
.plb-tour-avance + .plb-count { margin-left: 8px; }

/* A2 — bandeau financier : tuiles à gauche, donut encaissements à droite. */
.plb-billing-viz-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 18px;
  align-items: start;
}
.plb-billing-tuiles {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 12px;
}
/* Vermillon UNIQUEMENT pour le retard réel (échéance dépassée, solde dû). */
.plb-tuile-retard .cch-tuile-sous { color: var(--carillon-rouge, #e63946); font-weight: 600; }

/* Densité 02/08 — bandeau Clients en tuiles standard (ex-articles maison). */
.plb-client-kpis--tuiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.plb-client-kpis--tuiles .cch-tuile { height: 100%; }

/* Densité 02/08 — jauge de fond payé / impayé DANS les cellules KPI de la
   carte client (ex-mini-barres qui répétaient les mêmes montants).
   Vert = payé (succès confirmé), vermillon = impayé — sémantique verrouillée. */
.plb-client-kpi { position: relative; overflow: hidden; }
.plb-client-kpi-jauge {
  position: absolute; left: 0; bottom: 0; height: 4px;
  border-radius: 0 2px 2px 0; background: #64748b; pointer-events: none;
}
.plb-client-kpi.is-paid .plb-client-kpi-jauge { background: #1c7a48; }
.plb-client-kpi.is-unpaid .plb-client-kpi-jauge { background: #b3212f; }

/* Risques du site (Géorisques) : une ligne sous l'adresse de la carte client.
   Fait du site, pas une urgence : aucun vermillon. */
.plb-client-risques {
  display: flex; flex-wrap: wrap; align-items: center; gap: 5px;
  margin: 2px 0 10px; color: var(--muted, #596579); font-size: 0.78rem;
}
.plb-client-risques.is-nonmesure { font-style: italic; }
.plb-risque {
  display: inline-flex; align-items: center; padding: 1px 8px;
  border: 1px solid var(--line, #d9e2ee); border-radius: 999px;
  background: var(--gris-bleute, #e8eef7); color: var(--carillon-nuit, #071c3b);
  font-size: 0.72rem; font-weight: 700; white-space: nowrap;
}
.plb-risque.is-nonmesure { background: transparent; color: var(--muted, #596579); font-weight: 600; font-style: italic; }

/* RappelConso (packs alimentaires) : bandeau une-ligne en tête du stock.
   « À vérifier » n'est pas un fait établi — neutre, jamais de vermillon. */
.plb-rappelconso {
  display: grid; gap: 3px; margin: 0 0 14px; padding: 10px 14px;
  border: 1px solid var(--line, #d9e2ee); border-left: 4px solid var(--carillon-bleu, #1546a0);
  border-radius: 10px; background: var(--surface, #ffffff);
}
.plb-rappelconso strong { color: var(--carillon-nuit, #071c3b); font-size: 0.9rem; }
.plb-rappelconso span { color: var(--muted, #596579); font-size: 0.8rem; }
.plb-rappelconso small { color: var(--muted, #596579); font-size: 0.72rem; }
.plb-rappelconso-hint { margin: 0 0 12px; color: var(--muted, #596579); font-size: 0.8rem; font-style: italic; }

/* Densité 02/08 — chips mix métier / administratif de la barre d'outils du
   planning (ex-donut du bloc « Charge de la semaine ») + chip-ancre
   « À planifier » (bouton vers le bandeau du dessous). */
.plb-plan-chip.is-metier i, .plb-plan-chip.is-admin i {
  width: 9px; height: 9px; margin-right: 5px; border-radius: 50%;
}
.plb-plan-chip.is-metier i { background: #1546a0; }
.plb-plan-chip.is-admin i { background: #6f42a1; }
button.plb-plan-chip { border: 0; font: inherit; font-size: 0.8rem; font-weight: 700; cursor: pointer; }
button.plb-plan-chip:hover, button.plb-plan-chip:focus-visible { text-decoration: underline; }
button.plb-plan-chip:focus-visible { outline: 2px solid var(--carillon-bleu, #1546a0); outline-offset: 2px; }
.plb-plan-status-filters { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; width: 100%; }
.plb-plan-status-filters .plb-plan-chip { min-height: 36px; border: 1px solid var(--line, #d9e2ee); background: #fff; text-decoration: none; }
.plb-plan-status-filters .plb-plan-chip.active { border-color: #1546a0; box-shadow: 0 0 0 2px rgba(21,70,160,.12); }
.plb-plan-status-filters .is-status-a_venir { color: #1546a0; }
.plb-plan-status-filters .is-status-en_cours { color: #1c7a48; }
.plb-plan-status-filters .is-status-honore { color: #455568; }
.plb-plan-status-filters .is-status-annule { color: #b3212f; }
.plb-plan-status-filters .is-status-a_regulariser { color: #8a570f; }

/* APP-CLIENT-MOBILE-RESOLUTION-20260822 — la densite desktop ci-dessus est
   declaree apres l'ancien media query et ramenait les controles du planning a
   36/40 px sur telephone. Le mode responsive calcule par l'application garde
   une cible tactile reelle de 44 px, sans gonfler la version bureau. */
body.phone-mode.trade-plumber [data-panel="planning"] .plb-nav-btn,
body.phone-mode.trade-plumber [data-panel="planning"] .plb-view-btn,
body.phone-mode.trade-plumber [data-panel="planning"] .plb-slot-btn,
body.phone-mode.trade-plumber [data-panel="planning"] .plb-plan-status-filters .plb-plan-chip {
  min-height: 44px;
}
body.phone-mode.trade-plumber .plb-page-head {
  flex-wrap: wrap;
  align-items: flex-start;
}
body.phone-mode.trade-plumber .plb-page-head > :first-child {
  min-width: 0;
}
body.phone-mode.trade-plumber [data-panel="inventory"] .plb-finance-tabs button,
body.phone-mode.trade-plumber [data-panel="inventory"] .plb-material-table td > button,
body.phone-mode.trade-plumber [data-panel="settings"] .plb-settings-tabs button {
  min-height: 44px;
}

/* A5 — état vide illustré : le module rend l'illustration + textes, on
   conserve le centrage et le bouton d'action de l'état vide historique. */
.plb-empty-state--illu .cch-vide { padding: 0; }
.plb-empty-state--illu .cch-vide strong { color: #17212b; font-size: 1rem; }
.plb-empty-state--illu .cch-vide p { max-width: 390px; font-size: inherit; line-height: 1.5; }

/* Empilement mobile : une colonne, le donut sous les tuiles / barres. */
@media (max-width: 720px) {
  .plb-billing-viz-grid { grid-template-columns: 1fr; }
  .plb-client-kpis--tuiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
