/* ─── DASHBOARD DEMANDES ───
   Complète /style.css (tokens :root, .app-header, .field, .submit-btn, .toast).
   Règle projet : tout conteneur piloté par el.hidden dont une règle pose un
   display: doit avoir sa règle [hidden] { display: none }. */

#lock-screen[hidden],
#list-screen[hidden],
#offline-banner[hidden],
#test-banner[hidden],
.lock-error[hidden],
.list-empty[hidden],
.avatar[hidden],
.refresh-btn[hidden] { display: none; }

/* ─── HEADER ─── */
.back-link {
  font-size: 1.375rem;
  line-height: 1;
  color: var(--text2);
  text-decoration: none;
  padding: 0.25rem 0.5rem 0.25rem 0;
}

.refresh-btn {
  font-family: var(--font);
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--gold);
  background: var(--gold-bg);
  border: 1px solid var(--gold-border);
  border-radius: 100px;
  padding: 6px 14px;
  cursor: pointer;
}

.header-actions { display: flex; gap: 0.5rem; align-items: center; }

/* ─── MODE TEST ─── */
.test-btn { color: var(--text3); background: var(--bg); border-color: var(--border); }
.test-btn.active { color: var(--orange); background: var(--orange-bg); border-color: var(--orange); }

#test-banner {
  background: var(--orange-bg);
  color: var(--orange);
  border: 1.5px dashed var(--orange);
  border-radius: var(--radius-sm);
  padding: 0.75rem 1rem;
  font-size: 0.8125rem;
  font-weight: 600;
  margin-top: 1rem;
}

/* ─── AVATARS « QUI FAIT QUOI » ───
   Photo /demandes/avatars/<prenom>.webp en background si le fichier existe
   (déposé par Jerome) ; sinon le fond coloré + initiales restent visibles. */
.avatar {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  font-size: 0.6875rem;
  font-weight: 800;
  color: var(--white);
  background-color: var(--text3);
  vertical-align: -8px;
  margin-right: 6px;
  flex-shrink: 0;
  overflow: hidden;
}
/* La photo couvre les initiales quand elle existe ; un 404 rend l'img
   transparente (alt vide) et laisse les initiales visibles */
.avatar img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}
.av-jeremy { background-color: #2563EB; } /* bleu (pas de --blue dans style.css) */
.av-chris  { background-color: var(--green); }
.av-axel   { background-color: var(--orange); }

.td-statut { white-space: nowrap; }

/* ─── ÉCRAN CODE ─── */
#lock-screen { display: flex; justify-content: center; padding-top: 3rem; }

.lock-card {
  width: 100%;
  max-width: 360px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2rem 1.5rem;
  text-align: center;
  box-shadow: var(--shadow-sm);
}

.lock-card form { text-align: left; margin-top: 1.5rem; }
.lock-card .submit-btn { margin-bottom: 0; }

.lock-error {
  color: var(--red);
  font-size: 0.8125rem;
  font-weight: 600;
  margin-bottom: 0.75rem;
}

/* ─── BARRE FILTRE : pastilles par étape + recherche ─── */
.list-bar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.75rem;
  padding: 1rem 0 0.75rem;
}

.filter-chips { display: flex; flex-wrap: wrap; gap: 0.5rem; }

.chip {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-family: var(--font);
  font-size: 0.8125rem;
  font-weight: 700;
  color: var(--text2);
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 100px;
  padding: 0.5rem 0.875rem;
  cursor: pointer;
  white-space: nowrap;
  -webkit-tap-highlight-color: transparent;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.chip:hover { border-color: var(--gold-border); }
.chip.active { color: var(--gold); background: var(--gold-bg); border-color: var(--gold-border); }
.chip.active.st-new    { color: var(--orange); background: var(--orange-bg); border-color: var(--orange); }
.chip.active.st-planif { color: var(--cyan); background: var(--cyan-light); border-color: var(--cyan); }
.chip.active.st-fait   { color: var(--green); background: var(--green-bg); border-color: var(--green); }
.chip.active.p-jeremy  { color: #2563EB; background: #EFF6FF; border-color: #2563EB; }
.chip.active.p-chris   { color: var(--green); background: var(--green-bg); border-color: var(--green); }
.chip.active.p-axel    { color: var(--orange); background: var(--orange-bg); border-color: var(--orange); }

.chip-count {
  display: inline-block;
  min-width: 1.25rem;
  padding: 0.0625rem 0.25rem;
  margin-left: 0.125rem;
  background: rgba(0,0,0,0.07);
  border-radius: 100px;
  font-size: 0.6875rem;
  text-align: center;
}
.chip.active .chip-count { color: var(--white); background: var(--gold); }
.chip.active.st-new .chip-count    { background: var(--orange); }
.chip.active.st-planif .chip-count { background: var(--cyan); }
.chip.active.st-fait .chip-count   { background: var(--green); }
.chip.active.p-jeremy .chip-count  { background: #2563EB; }
.chip.active.p-chris .chip-count   { background: var(--green); }
.chip.active.p-axel .chip-count    { background: var(--orange); }
/* La pastille est en flex centré : l'avatar s'aligne tout seul, sans décalage */
.chip .avatar { width: 24px; height: 24px; font-size: 0.625rem; vertical-align: 0; margin-right: 0; }
.chip .chip-count { margin-left: 0; }

.search-field { flex: 1; min-width: 220px; max-width: 340px; margin-bottom: 0; margin-left: auto; }
.search-field input { min-height: 2.5rem; }

.list-count {
  font-size: 0.8125rem;
  font-weight: 700;
  color: var(--text3);
  min-width: 1.5rem;
  text-align: center;
}

/* Compteur + nombre de leads par page (09/10/2026) */
.list-count-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-left: auto;
}

.par-page {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text3);
  white-space: nowrap;
}

.par-page select {
  padding: 0.25rem 0.5rem;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-family: inherit;
  font-size: 0.8125rem;
  font-weight: 700;
  cursor: pointer;
}

.par-page select:focus-visible { outline: 2px solid var(--border-focus); outline-offset: 1px; }

.list-empty {
  text-align: center;
  color: var(--text3);
  font-size: 0.875rem;
  padding: 2rem 0;
}

/* ─── NOUVEAU LEAD (création manuelle) ───
   Desktop/tablette : modal centrée. Mobile : bottom sheet (usage en déplacement). */
.lead-btn {
  font-family: var(--font);
  font-size: 0.8125rem;
  font-weight: 700;
  color: var(--white);
  background: var(--gold);
  border: 1px solid var(--gold);
  border-radius: 100px;
  padding: 0.5rem 1rem;
  min-height: 2.5rem;
  cursor: pointer;
  white-space: nowrap;
  -webkit-tap-highlight-color: transparent;
}
.lead-btn:hover { background: var(--gold-light); border-color: var(--gold-light); }

#lead-backdrop {
  position: fixed;
  inset: 0;
  z-index: 1001;
  background: rgba(0, 0, 0, 0.4);
}
#lead-backdrop[hidden] { display: none; }

#lead-sheet {
  position: fixed;
  z-index: 1002;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: min(520px, calc(100vw - 2rem));
  max-height: min(85vh, 760px);
  overflow-y: auto;
  overscroll-behavior: contain;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 16px 50px rgba(0, 0, 0, 0.25);
  padding: 1rem 1.25rem 1.25rem;
}
#lead-sheet[hidden] { display: none; }
#lead-sheet .submit-btn { margin-top: 0.25rem; }

.sheet-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 0.75rem;
  font-size: 0.9375rem;
}
.sheet-close {
  border: none;
  background: none;
  font-size: 1rem;
  color: var(--text3);
  cursor: pointer;
  padding: 0.375rem 0.625rem;
}

@media (max-width: 700px) {
  #lead-sheet {
    top: auto;
    left: 0;
    right: 0;
    bottom: 0;
    transform: none;
    width: auto;
    max-height: 88vh;
    border-radius: var(--radius) var(--radius) 0 0;
    padding-bottom: calc(1rem + env(safe-area-inset-bottom));
  }
}

/* ─── PAGINATION (25 demandes/page) ─── */
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  padding: 1.25rem 0 1.5rem;
}
.pagination[hidden] { display: none; }

.page-btn {
  font-family: var(--font);
  font-size: 0.8125rem;
  font-weight: 700;
  color: var(--text2);
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 100px;
  padding: 0.625rem 1.125rem;
  min-height: 2.75rem;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.page-btn:hover:not([disabled]) { border-color: var(--gold-border); color: var(--gold); }
.page-btn[disabled] { opacity: 0.4; cursor: default; }
.page-info { font-size: 0.8125rem; font-weight: 700; color: var(--text3); white-space: nowrap; }

/* ─── BOUTON SUPPRIMER (= archivage Notion, avec confirmation) ─── */
.delete-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin-top: 1rem;
  padding: 0.5rem 1rem;
  min-height: 2.75rem;
  border: 1.5px solid var(--red);
  border-radius: 100px;
  background: var(--red-bg);
  color: var(--red);
  font-family: var(--font);
  font-size: 0.8125rem;
  font-weight: 700;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.delete-btn:hover { background: var(--red); color: var(--white); }
.delete-btn[disabled] { opacity: 0.5; cursor: wait; }

#offline-banner {
  background: var(--orange-bg);
  color: var(--orange);
  border: 1px solid currentColor;
  border-radius: var(--radius-sm);
  padding: 0.75rem 1rem;
  font-size: 0.8125rem;
  font-weight: 600;
  margin-top: 1rem;
}

/* ─── CARTES ─── */
.demande-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 0.75rem;
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.demande-card summary {
  list-style: none;
  cursor: pointer;
  padding: 0.875rem 1rem;
  -webkit-tap-highlight-color: transparent;
}
.demande-card summary::-webkit-details-marker { display: none; }
.demande-card[open] summary { border-bottom: 1px solid var(--border); }

.card-top {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.5rem;
}

.card-nom { font-weight: 700; font-size: 0.9375rem; }
.card-date { font-size: 0.75rem; color: var(--text3); white-space: nowrap; }

.card-sub {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.375rem;
  font-size: 0.75rem;
}

.badge-statut {
  background: var(--gold-bg);
  border: 1px solid var(--gold-border);
  color: var(--text);
  border-radius: 100px;
  padding: 3px 10px;
  font-weight: 600;
  white-space: nowrap;
}

/* ─── COULEURS PAR ÉTAPE DU PIPELINE ───
   new = à traiter, vente = avant-vente, planif = intervention à venir,
   fait = réalisé/à encaisser, clos = terminé, off = refusé/en pause */
.badge-statut.st-new,    .statut-btn.st-new    { background: var(--orange-bg); border-color: var(--orange); color: var(--orange); }
.badge-statut.st-vente,  .statut-btn.st-vente  { background: var(--gold-bg); border-color: var(--gold); color: var(--gold); }
.badge-statut.st-planif, .statut-btn.st-planif { background: var(--cyan-light); border-color: var(--cyan); color: var(--cyan); }
.badge-statut.st-fait,   .statut-btn.st-fait   { background: var(--green-bg); border-color: var(--green); color: var(--green); }
.badge-statut.st-clos,   .statut-btn.st-clos,
.badge-statut.st-off,    .statut-btn.st-off    { background: var(--bg); border-color: var(--border); color: var(--text3); }
/* Statut hors liste (fiche pas encore migrée, option renommée…) : visible, jamais muet */
.badge-statut.st-inconnu, .statut-btn.st-inconnu { background: var(--bg); border-style: dashed; border-color: var(--text3); color: var(--text3); }

/* ─── LISTE DÉROULANTE STATUT CUSTOM (avatar intégré) ───
   Desktop/tablette : menu flottant sous le bouton. Mobile (<700px) :
   bottom sheet plein écran, grosses zones tactiles (usage en déplacement). */
.statut-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: 100%;
  min-height: 2.25rem;
  border: 1.5px solid var(--border);
  border-radius: 100px;
  background: var(--bg);
  padding: 0.3rem 0.75rem;
  font-family: var(--font);
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.statut-btn .avatar { margin-right: 0; vertical-align: 0; }
.statut-btn-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.statut-caret { font-size: 0.625rem; opacity: 0.6; margin-left: 2px; }
.statut-btn[disabled] { opacity: 0.5; cursor: wait; }
.edit-block .statut-btn, .field .statut-btn { width: 100%; justify-content: flex-start; min-height: 3rem; }
.field .statut-btn .statut-caret { margin-left: auto; }

#statut-menu {
  position: fixed;
  z-index: 1000;
  min-width: 320px;
  max-width: 400px;
  max-height: min(60vh, 540px);
  overflow-y: auto;
  overscroll-behavior: contain;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 10px 36px rgba(0,0,0,0.18);
  padding: 0.375rem;
}
#statut-menu[hidden] { display: none; }

/* Fond assombri du bottom sheet — mobile uniquement */
#statut-backdrop {
  position: fixed;
  inset: 0;
  z-index: 999;
  background: rgba(0, 0, 0, 0.35);
}
#statut-backdrop[hidden] { display: none; }
@media (min-width: 701px) {
  #statut-backdrop { display: none; }
}

.statut-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 2.75rem;
  padding: 0.5rem 0.625rem;
  border: none;
  background: none;
  border-radius: var(--radius-sm);
  font-family: var(--font);
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text);
  text-align: left;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.statut-item:hover, .statut-item:active { background: var(--gold-bg); }
.statut-item.current { background: var(--gold-bg); }
.statut-item .avatar { width: 34px; height: 34px; font-size: 0.75rem; margin-right: 0; vertical-align: 0; }
.statut-item .statut-check { margin-left: auto; color: var(--green); font-weight: 800; visibility: hidden; }
.statut-item.current .statut-check { visibility: visible; }
.statut-sep { border-top: 1px dashed var(--border); margin: 0.375rem 0.5rem; }

/* Mobile : bottom sheet pleine largeur, cibles tactiles élargies */
@media (max-width: 700px) {
  #statut-menu {
    top: auto !important;
    left: 0 !important;
    right: 0;
    bottom: 0;
    min-width: 0;
    max-width: none;
    max-height: 75vh;
    border-radius: var(--radius) var(--radius) 0 0;
    padding: 0.5rem 0.5rem calc(0.75rem + env(safe-area-inset-bottom));
    box-shadow: 0 -10px 40px rgba(0,0,0,0.25);
  }
  .statut-item { min-height: 3rem; font-size: 0.9375rem; }
  .statut-item .avatar { width: 40px; height: 40px; font-size: 0.8125rem; }
}

.badge-statut .avatar { width: 22px; height: 22px; font-size: 0.5625rem; vertical-align: -6px; margin-right: 5px; }

.card-ville { color: var(--text2); font-weight: 600; }
.card-montant { color: var(--green); font-weight: 700; }
.card-erreur { font-size: 0.875rem; }

/* ─── CORPS DE CARTE ─── */
.card-body { padding: 1rem; }

.erreur-auto {
  background: var(--red-bg);
  color: var(--red);
  border-radius: var(--radius-sm);
  padding: 0.625rem 0.875rem;
  font-size: 0.8125rem;
  font-weight: 600;
  margin-bottom: 0.75rem;
}

.contact-row { display: flex; gap: 0.5rem; flex-wrap: wrap; margin-bottom: 0.625rem; }

.contact-btn {
  background: var(--cyan-light);
  color: var(--cyan);
  border-radius: 100px;
  padding: 6px 14px;
  font-size: 0.8125rem;
  font-weight: 700;
  text-decoration: none;
}

.card-adresse { font-size: 0.8125rem; color: var(--text2); margin-bottom: 0.625rem; }

.card-infos {
  list-style: none;
  font-size: 0.8125rem;
  margin-bottom: 0.625rem;
}
.card-infos li { display: flex; justify-content: space-between; padding: 2px 0; }
.card-infos li span { color: var(--text3); font-weight: 600; }

.card-message {
  font-size: 0.8125rem;
  color: var(--text2);
  background: var(--bg);
  border-radius: var(--radius-sm);
  padding: 0.625rem 0.875rem;
  margin-bottom: 0.75rem;
  white-space: pre-wrap;
}

/* ─── BLOC ÉDITION ─── */
.edit-block {
  border-top: 1px dashed var(--border);
  padding-top: 0.875rem;
  margin-top: 0.25rem;
}

/* ─── BLOCS TITRÉS de la carte dépliée (05/10/2026 — même logique que les
   sections de l'app Visites : Client / Projet / Suivi / Facturation) ─── */
.bloc {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.875rem;
  margin-bottom: 0.75rem;
}

.bloc-titre {
  font-size: 0.6875rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--gold);
  margin-bottom: 0.75rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--gold-bg);
}

.bloc .field:last-child { margin-bottom: 0; }
.bloc .card-infos { border-top: 1px dashed var(--border); margin-top: 0.625rem; padding-top: 0.5rem; }
.bloc .marqueurs { margin-top: 0.625rem; }

/* ─── BLOC VISITE TERRAIN (13/10/2026) ─── Constat relevé pendant la visite :
   type de client, essence, accès, mobilier, détail complet et photos.
   ÉDITABLE depuis le 14/10/2026 — mêmes champs que le reste de la fiche. */
/* Une seule case ici : elle ne doit pas s'étirer sur les deux colonnes */
.bloc-visite .check-grid { margin-bottom: 0.75rem; }

/* Le constat est un texte long et structuré en sections : plus petit que les
   autres champs, assez haut pour se lire sans scroller ligne à ligne */
.field textarea.visite-constat {
  font-size: 0.8125rem;
  line-height: 1.5;
  min-height: 11rem;
}

/* Vignettes : défilement horizontal plutôt qu'une grille qui casse le mobile */
.visite-photos {
  display: flex;
  gap: 0.5rem;
  overflow-x: auto;
  padding: 0.625rem 0 0.25rem;
  -webkit-overflow-scrolling: touch;
}
.visite-photos a { flex: 0 0 auto; }
.visite-photos img {
  width: 84px;
  height: 84px;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid var(--border);
  display: block;
}

.visite-fiche {
  display: inline-block;
  margin-top: 0.5rem;
  font-size: 0.8125rem;
  font-weight: 700;
  color: var(--text2);
}

/* Desktop / tablette : les photos tiennent sur plusieurs lignes, pas de scroll */
@media (min-width: 701px) {
  .visite-photos { flex-wrap: wrap; overflow-x: visible; }
  .visite-photos img { width: 96px; height: 96px; }
}

.check-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem 0.75rem;
  margin-bottom: 0.75rem;
}

.check-grid label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text2);
  cursor: pointer;
}

.check-grid input {
  width: 20px;
  height: 20px;
  accent-color: var(--gold);
  flex-shrink: 0;
}

.date-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}

/* iOS écrase la hauteur des champs date vides (même piège que type=month) */
.field input[type="date"] {
  -webkit-appearance: none;
  appearance: none;
  min-height: 3rem;
  text-align: left;
}

/* ─── PRESTATION MULTI (terrasse ET bardage possibles — 05/10/2026) ───
   Pleine largeur, cases alignées à gauche quel que soit l'écran (retour
   Jerome 05/10 : « le bazar, même pas aligné » sur mobile/tablette) */
.prest-group {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 0.375rem 0.75rem;
}
.prest-opt {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  text-align: left;
  gap: 0.5rem;
  font-size: 0.875rem;
  line-height: 1.25;
  cursor: pointer;
}
/* Spécificité renforcée : dans le détail desktop, « .detail-grid .field input
   { width:160px } » écrasait la taille des cases → checkboxes de 160px qui
   poussaient les libellés et débordaient sur la colonne Notes (bug 05/10) */
.prest-opt input,
.detail-grid .field .prest-opt input {
  flex-shrink: 0;
  width: 1.05rem;
  height: 1.05rem;
  margin: 0;
  accent-color: var(--cyan, #00ADE5);
}

/* ─── PLAGE D'INTERVENTION (du → au, avec horaires — 05/10/2026) ─── */
.interv-grid {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 0.375rem;
  align-items: center;
}
.interv-grid input[type="date"] { min-width: 0; }
.interv-sep { color: var(--text3); font-weight: 700; }
/* Cartes mobile/tablette (< 900px) : les 2 dates l'une sous l'autre plutôt
   qu'écrasées côte à côte */
@media (max-width: 899px) {
  .interv-grid { grid-template-columns: 1fr; }
  .interv-sep { display: none; }
}
.detail-grid .interv-grid input { width: auto; }
.td-interv {
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
  cursor: pointer;
}
.td-interv:hover { color: var(--gold); text-decoration: underline dotted; }
.td-interv-vide { color: var(--text3); font-weight: 600; }
.td-interv:hover .td-interv-vide { color: var(--gold); }

/* Panneau flottant de planification (clic sur la cellule Intervention) */
#interv-menu {
  position: fixed;
  z-index: 60;
  background: var(--white);
  border: 1px solid var(--gold-border);
  border-radius: 14px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.16);
  padding: 1rem 1.125rem;
  width: min(420px, calc(100vw - 16px));
}
#interv-menu[hidden] { display: none; }
.interv-menu-titre {
  font-size: 0.8125rem;
  font-weight: 800;
  color: var(--gold);
  margin-bottom: 0.75rem;
  padding-bottom: 0.625rem;
  border-bottom: 2px solid var(--gold-bg);
}
.im-row {
  display: grid;
  grid-template-columns: 4.5rem 1fr 6.5rem;
  gap: 0.5rem;
  align-items: center;
  margin-bottom: 0.5rem;
}
.im-label {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text2, #57534E);
}
.im-label small {
  display: block;
  font-weight: 400;
  text-transform: none;
  letter-spacing: 0;
  color: var(--text3);
}
#interv-menu input {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  min-height: 2.75rem;
  padding: 0.375rem 0.625rem;
  background: var(--bg, #F7F3EC);
  border: 1.5px solid var(--border);
  border-radius: 10px;
  font: inherit;
  font-size: 0.9375rem;
  color: inherit;
}
#interv-menu input:focus {
  outline: none;
  border-color: var(--gold);
  background: var(--white);
}
.im-note {
  margin-top: 0.625rem;
  font-size: 0.75rem;
  color: var(--text3);
}
#interv-backdrop {
  position: fixed;
  inset: 0;
  z-index: 59;
  background: transparent;
}
#interv-backdrop[hidden] { display: none; }

/* Pastille 🗓️ intervention sur l'en-tête des cartes mobile/tablette */
.card-interv {
  white-space: nowrap;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--gold);
  background: var(--gold-bg);
  border: 1px solid var(--gold-border);
  border-radius: 999px;
  padding: 0.1rem 0.5rem;
  font-variant-numeric: tabular-nums;
}
.card-interv[hidden] { display: none; }

/* ─── MARQUEURS PIPELINE (lecture seule) ─── */
.marqueurs {
  list-style: none;
  border-top: 1px dashed var(--border);
  margin-top: 0.875rem;
  padding-top: 0.75rem;
  font-size: 0.75rem;
  color: var(--text3);
}
.marqueurs li { display: flex; justify-content: space-between; padding: 2px 0; }
.marqueurs li span { font-weight: 600; }

@media (max-width: 380px) {
  .date-grid, .check-grid { grid-template-columns: 1fr; }
}

/* ─── DESKTOP (bureau) : table éditable ─── */
@media (min-width: 900px) {
  main.form-container { max-width: 1480px; }
}

.ligne-detail[hidden] { display: none; }

.table-wrap {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  overflow-x: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}
.table-wrap::-webkit-scrollbar { height: 6px; }
.table-wrap::-webkit-scrollbar-track { background: transparent; }
.table-wrap::-webkit-scrollbar-thumb { background: var(--border); border-radius: 100px; }

.demandes-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}

.demandes-table th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: var(--card);
  text-align: left;
  font-size: 0.6875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text3);
  padding: 0.75rem;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

.demandes-table td {
  padding: 0.625rem 0.75rem;
  border-top: 1px solid var(--border);
  vertical-align: middle;
}

.demandes-table tbody tr:first-child td { border-top: none; }
.ligne { cursor: pointer; }
.ligne:hover { background: var(--gold-bg); }
.ligne.open { background: var(--gold-bg); }
.ligne.open td { border-bottom: none; }

.td-date { color: var(--text3); white-space: nowrap; }
.td-nom { font-weight: 700; white-space: nowrap; }
.td-tel { color: var(--cyan); font-weight: 600; text-decoration: none; white-space: nowrap; }
.td-adresse {
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--text2);
}

/* Contrôles compacts dans la table (hors .field, donc stylés ici) */
.demandes-table select,
.demandes-table input {
  background: var(--bg);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.4rem 0.5rem;
  font-family: var(--font);
  font-size: 0.8125rem;
  color: var(--text);
}
.demandes-table select { min-width: 190px; cursor: pointer; }
.demandes-table .statut-btn { background: var(--bg); } /* le bouton custom remplace l'ancien select statut */
.demandes-table input[type="number"] { width: 90px; text-align: right; }
.td-surface input { width: 60px; text-align: right; }
.td-montant { white-space: nowrap; }
.td-montant::after { content: ' €'; color: var(--text3); font-size: 0.75rem; }
.demandes-table input[type="date"] { width: 140px; }
.demandes-table select:focus,
.demandes-table input:focus {
  outline: none;
  border-color: var(--border-focus);
  background: var(--white);
}

.expand-btn {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 0.875rem;
  color: var(--text3);
  padding: 0.25rem;
  transition: transform 0.15s;
}
.expand-btn.open { transform: rotate(90deg); }

.ligne-detail td {
  background: var(--bg);
  padding: 1rem 1.25rem;
}

.detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  max-width: 800px;
}
.detail-grid p { font-size: 0.8125rem; color: var(--text2); margin-bottom: 0.5rem; }
.detail-client-titre {
  font-size: 0.6875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text3);
}
.detail-nom { font-weight: 700; color: var(--text); }
.detail-grid a { color: var(--cyan); font-weight: 600; text-decoration: none; }
.detail-grid .card-message { background: var(--white); }
.detail-grid .check-grid { margin-bottom: 0.875rem; }
.detail-grid .marqueurs { border-top: 1px dashed var(--border); }
.detail-grid .field input { width: 160px; }
.detail-grid .field textarea { width: 100%; resize: vertical; }
