/* ============================================================================
   VOX, version B « Atelier »
   Chargee apres app.css (une ligne dans base.html).
   Regles : .claude/skills/ui-amelioration/SKILL.md
     · palette conservee, contrastes corriges (ambre texte, gris secondaire)
     · Oswald majuscule pour les titres de page et les chiffres, Barlow ailleurs
     · barre d'onglets mobile (< 900 px) avec la dictee au centre
     · cartes blanches sans liseré, statuts en point de couleur
   Les tailles des nouveaux composants sont en px : la racine est a 19,2 px
   (app.css) et les maquettes validees sont dessinees en px.
   ============================================================================ */

:root {
  --header-height: 56px;
  --color-text-muted: #5E5645;   /* 4,9:1 sur le fond beige (#6E6552 : 3,9:1) */
  --color-border: #D6CCB7;
  --color-accent-text: #8A6410;  /* ambre lisible sur blanc (5,4:1) */
  --color-divider: #EFEAE0;
  --color-hover: #FAF8F3;
  --tabbar-height: 64px;
  --font-display: 'Oswald', 'Arial Narrow', Arial, sans-serif;
}

/* ---- Typographie calme : Barlow en casse normale hors titres ------------- */
.btn, .badge, .form-label, .sidebar__item, .header__user-name, .card__title, .card__label, .client-name, .client-pick-item__name, .line-item__title, .line-item__fields .line-item__label, .line-item__total-cell .line-item__label, .voice-box__text strong, .voice-box__title, .email-row__label, .result-badge, .filter-chip, .dropzone__label, .dropzone__title, .dropzone__subtitle, .dropzone__hint, .quote-terms__label, .advance-row__label, .empty-state, .unsaved-badge, .modal__header h3, .import-type, .metier-tag, .action-tag, .catalog-section h2, .btn-save-edit, .btn-cancel-edit, .btn--google, .auth-divider, .loading-overlay__text, .generating-overlay__title, .form-suffix, .sync-badge, .table th, .quote-table th {
  font-family: var(--font-body);
  text-transform: none;
  letter-spacing: 0;
}
.table th, .quote-table th {
  font-size: 12px;
  letter-spacing: .06em;
  text-transform: uppercase;
}
.form-label { color: var(--color-text-muted); }

/* ---- En-tete -------------------------------------------------------------- */
/* Zone sure iOS (application installee, encoche) : le raccourci padding
   ecrasait le padding-top de app.css, le contenu passait sous la barre d'etat. */
.header { border-bottom: 0; gap: 8px; padding: env(safe-area-inset-top, 0px) 16px 0; }
.header__back {
  border: 0;
  border-radius: 10px;
  min-width: 44px;
  min-height: 44px;
  margin-left: -10px;
  color: #F4EDE3;
}
.header__logo { height: 30px; }
.header__user-name { font-size: 15px; font-weight: 500; color: #E8E1D2; }
.header__avatar { width: 36px; height: 36px; font-family: var(--font-body); font-size: 14px; line-height: 1; }
.header__avatar svg { width: 18px; height: 18px; }  /* pas encore de prenom : icone */
.header .sync-badge {
  background: none;
  height: auto;
  padding: 0;
  gap: 6px;
  font-size: 13px;
  font-weight: 500;
}
.header .sync-badge--online { color: #A9D8BC; }
.header .sync-badge--online .sync-badge__dot { background: #3FAE6E; }
.header .sync-badge--offline { color: #F2A29A; }
.header .sync-badge--syncing { color: #F2C27A; }

/* ---- Menu lateral --------------------------------------------------------- */
.sidebar { padding: 12px 0 24px; }
.sidebar__voice {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 44px;
  margin: 4px 14px 6px;
  border-radius: 12px;
  background: var(--color-accent);
  color: var(--color-header);
  font: 600 15px var(--font-body);
  text-decoration: none;
}
.sidebar__voice:hover { background: #D9A227; }
/* « Mes premiers pas » mis en avant, entre Dicter et Pilotage. */
.sidebar__item.sidebar__item--highlight {
  margin: 6px 14px 4px;
  padding-left: 12px;
  border: 1px solid rgba(201, 151, 29, .55);
  border-radius: 12px;
  background: rgba(201, 151, 29, .12);
  color: #F2D58A;
}
.sidebar__item.sidebar__item--highlight:hover { background: rgba(201, 151, 29, .2); }
.sidebar__item.sidebar__item--highlight.sidebar__item--active { background: rgba(201, 151, 29, .24); color: #F6DE9C; }
.sidebar__voice svg { width: 18px; height: 18px; }
.sidebar__section {
  font: 600 12px/1 var(--font-body);
  letter-spacing: .1em;
  color: #9A917B;
  padding: 18px 22px 8px;
}
.sidebar__item {
  gap: 12px;
  height: 40px;
  margin: 0 10px;
  padding: 0 12px;
  border-left: 0;
  border-radius: 10px;
  font-size: 14px; /* 14 px, hauteur de ligne 1 : texte centré dans les 40 px (mesuré) */
  font-weight: 500;
  line-height: 1;
  color: #E8E1D2;
}
.sidebar__item:hover { background: #2C2A20; color: #fff; }
/* Entree active : couleur, graisse et barre a gauche (pas la couleur seule). */
.sidebar__item--active { background: #2A281E; color: #D9A227; font-weight: 700; box-shadow: inset 3px 0 0 #D9A227; }
.sidebar__item--logout { margin-top: 0; color: #A69D86; }
.sidebar__item--button {
  width: calc(100% - 20px);
  background: none;
  border: 0;
  cursor: pointer;
  text-align: left;
}
.sidebar__icon { width: 20px; font-size: 0; }
.sidebar__icon .lucide, .sidebar__icon svg { width: 18px; height: 18px; }

/* ---- Barre d'onglets (mobile) --------------------------------------------- */
.tabbar { display: none; }

@media (max-width: 899px) {
  .sidebar__voice { display: none; }

  .tabbar {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 95;
    display: flex;
    align-items: flex-start;
    padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
    background: var(--color-header);
  }
  .tabbar__item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    min-height: 52px;
    padding: 0;
    border: 0;
    background: none;
    color: #A69D86;
    font: 600 11px/1.1 var(--font-body);
    text-decoration: none;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
  }
  .tabbar__item svg { width: 22px; height: 22px; }
  /* Onglet actif : couleur et trait souligne (pas la couleur seule). */
  .tabbar__item--active { color: #D9A227; font-weight: 700; text-decoration: underline; text-underline-offset: 4px; text-decoration-thickness: 2px; }
  .tabbar__item--voice { color: #F4EDE3; }
  .tabbar__mic {
    width: 56px;
    height: 56px;
    margin-top: -24px;
    border-radius: 50%;
    background: var(--color-accent);
    color: var(--color-header);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 0 5px var(--color-header);
  }
  .tabbar__mic svg { width: 26px; height: 26px; }
  .tabbar__item:focus-visible { outline: 2px solid #D9A227; outline-offset: -2px; border-radius: 10px; }

  /* Le contenu, le tiroir et les messages flottants passent au-dessus de la barre. */
  .body--with-tabbar .main--with-sidebar {
    padding-bottom: calc(var(--tabbar-height) + 32px + env(safe-area-inset-bottom));
  }
  .body--with-tabbar .sidebar,
  .body--with-tabbar .sidebar-backdrop {
    bottom: calc(var(--tabbar-height) + env(safe-area-inset-bottom));
  }
  .body--with-tabbar .pp-chip,
  .body--with-tabbar .error-toast {
    bottom: calc(var(--tabbar-height) + 16px + env(safe-area-inset-bottom));
  }
}

/* ---- Titres de page et sections ------------------------------------------ */
.page-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}
.page-head .btn { min-height: 44px; }
.page-title, h1.section__title,
.section-title h1,
.section__title h1 {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 30px;
  line-height: 1.15;
  text-transform: uppercase;
  letter-spacing: .01em;
  color: var(--color-text);
}
.page-subtitle {
  margin: 2px 0 0;
  font: 500 14px/1.4 var(--font-body);
  color: var(--color-text-muted);
}
.section-title,
.section__title {
  background: none;
  border: 0;
  box-shadow: none;
  border-radius: 0;
  padding: 0;
  margin: 0 0 16px;
}
/* Titres de section (Prestations, Conditions...) : gras, 13 px + 80 %. */
.section-label {
  margin: 0 0 10px;
  font: 700 23.4px/1.2 var(--font-body);
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--color-text-muted);
}
.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}
.section-head .section-label { margin: 0; }
.link {
  /* Sur le fond de page (creme), l'ambre de --color-accent-text descend sous
     4,5:1 : teinte plus sombre (gap-accessibilite-application-08). */
  color: #6B4D0B;
  font: 600 14px var(--font-body);
  text-decoration: none;
}
.link:hover { color: #6B4D0B; text-decoration: underline; }

@media (min-width: 900px) {
  .page-title, .section-title h1, .section__title h1 { font-size: 34px; }
  .page-subtitle { font-size: 15px; }
}

/* ---- Boutons -------------------------------------------------------------- */
.btn {
  font-family: var(--font-body);
  font-size: 16px;
  font-weight: 600;
  text-transform: none;
  letter-spacing: 0;
  border-width: 1px;
  border-radius: 12px;
  box-shadow: none;
}
.btn svg { width: 18px; height: 18px; }
.btn--primary, .btn--danger, .btn--outline { box-shadow: none; }
.btn--primary { color: var(--color-header); }
.btn--primary:hover { background: #D9A227; border-color: #D9A227; color: var(--color-header); }
.btn--outline {
  background: #fff;
  color: var(--color-text);
  border: 1px solid #CFC5B0;
}
.btn--outline:hover { border-color: var(--color-accent-text); color: var(--color-text); }
.btn--soft { background: #F3EFE6; color: var(--color-text); border-color: #F3EFE6; }
.btn--soft:hover { background: #EAE4D6; border-color: #EAE4D6; }
.btn--small { font-size: 14px; padding: 6px 14px; }

/* ---- Badges et statuts ---------------------------------------------------- */
.badge {
  height: 28px;
  padding: 0 12px;
  border-radius: 999px;
  font-family: var(--font-body);
  font-size: 12px;
  letter-spacing: .03em;
}

/* Statut = point de couleur + libelle (app/core/status_badges.py : classe
   status--<ton>, etat dans data-status, lu par le JavaScript). */
.status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: auto;
  padding: 0;
  border: 0;
  background: none;
  font: 600 13px/1.2 var(--font-body);
  text-transform: none;
  letter-spacing: 0;
  white-space: nowrap;
}
.status::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: currentColor;
  flex-shrink: 0;
}
/* Pastille teintée (choix du 28/09/2026) : fond pâle, texte foncé,
   contraste du texte d'au moins 7:1 sur chaque fond. */
.status {
  gap: 7px;
  min-height: 30px;
  padding: 0 12px;
  border-radius: 999px;
  font: 700 14px/1 var(--font-body);
}
/* Une couleur par sens, commune aux devis et aux factures (choix du
   02/10/2026). « À relancer » : plein pour la facture en retard, seule
   pastille foncée d'une liste ; pastel pour le devis expiré. */
.status.status--prep { color: #4A4436; background: #ECE7DC; }          /* en préparation, 7,8:1 */
.status.status--wait { color: #1A4677; background: #DEEAF7; }          /* en attente du client, 7,9:1 */
.status.status--signed { color: #56157D; background: #EDE2F5; }        /* accord obtenu, à facturer, 9,3:1 */
.status.status--done { color: #18502F; background: #DAEFE1; }          /* encaissé, terminé, 7,8:1 */
.status.status--alert { color: #FFFFFF; background: #A61E14; }         /* à relancer, plein, 7,5:1 */
.status.status--alert-soft { color: #8A1C1C; background: #F9DEDA; }    /* à relancer, pastel, 7,3:1 */
.status.status--closed { color: #454B52; background: #E6E9EC; }        /* clos sans suite, 7,2:1 */

/* ---- Recherche et filtres ------------------------------------------------- */
div.search-bar {
  padding: 0;
  border: 0;
  background: none;
  box-shadow: none;
  margin-bottom: 12px;
}
.search-bar__input {
  height: 48px;
  padding: 0 14px 0 44px;
  border: 1.5px solid transparent;
  border-radius: 12px;
  background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%235E5645' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3Cpath d='m21 21-4.3-4.3'/%3E%3C/svg%3E") no-repeat 14px center / 20px;
  box-shadow: 0 1px 2px rgba(31, 28, 18, .08);
  font: 400 16px var(--font-body);
}
.search-bar__input:focus {
  outline: none;
  border-color: var(--color-accent);
  box-shadow: 0 0 0 3px rgba(201, 151, 29, .18);
}
.filter-chips {
  flex-wrap: nowrap;
  gap: 8px;
  /* 4 px autour, compenses par une marge negative : la zone tactile de
     44 px des puces (::after) et leur liseré (ombre de 1 px) ne sont pas
     rognes par le defilement horizontal. */
  margin: -4px -16px 12px -4px;
  padding: 4px 16px 4px 4px;
  overflow-x: auto;
  scrollbar-width: none;
}
.filter-chips::-webkit-scrollbar { display: none; }
.filter-chip {
  flex-shrink: 0;
  height: 36px;
  padding: 0 14px;
  border: 0;
  background: #fff;
  color: var(--color-text);
  font-size: 14px;
  font-weight: 600;
  line-height: 1;
  white-space: nowrap;
}
.filter-chip:has(input:checked) {
  background: var(--color-accent);
  border-color: var(--color-accent);
  color: var(--color-header);
  /* Filtre actif : couleur et trait souligne (pas la couleur seule). */
  text-decoration: underline;
  text-underline-offset: 4px;
  text-decoration-thickness: 2px;
}

/* ---- Cartes et lignes de documents ---------------------------------------- */
.card-b {
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 1px 2px rgba(31, 28, 18, .08);
  overflow: hidden;
}
.card-b__empty { margin: 0; padding: 16px; color: var(--color-text-muted); font-size: 15px; }

/* Trois colonnes : le nom s'etend au-dessus de la pastille, qui deborde
   sous le montant (« En retard · 25 % payé ») sans rogner le nom. */
.doc-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  grid-template-areas: "name name amount" "meta status status";
  column-gap: 12px;
  row-gap: 4px;
  align-items: baseline;
  padding: 14px 16px;
  background: #fff;
  color: var(--color-text);
  font-family: var(--font-body);
  text-decoration: none;
}
/* .quote-card (app.css) : remis a plat pour la ligne. */
.quote-card.doc-row {
  position: static;
  margin: 0;
  padding: 14px 16px;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}
.doc-row + .doc-row { border-top: 1px solid var(--color-divider); }
.doc-row:hover { background: var(--color-hover); }
.doc-row__name {
  grid-area: name;
  font-size: 16px;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.doc-row__meta {
  grid-area: meta;
  min-width: 0;
  font-size: 13px;
  color: var(--color-text-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.doc-row__date { display: none; }
.doc-row__status { grid-area: status; justify-self: end; }
.doc-row__amount {
  grid-area: amount;
  justify-self: end;
  font-size: 15px;
  font-weight: 600;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.doc-row--head { display: none; }
.doc-list:empty::after {
  content: attr(data-empty);
  display: block;
  padding: 16px;
  color: var(--color-text-muted);
  font: 400 15px var(--font-body);
}
.doc-list > .htmx-indicator { padding: 16px; }

@media (min-width: 900px) {
  /* Colonne Etat : 212 px, place de « En retard · 99 % payé ». */
  .card-b--table .doc-row {
    grid-template-columns: minmax(0, 1.2fr) minmax(0, 1.4fr) minmax(0, 1fr) 212px 130px;
    grid-template-areas: "name meta date status amount";
    align-items: center;
    padding: 12px 20px;
  }
  .card-b--table .doc-row__meta { font-size: 14px; }
  .card-b--table .doc-row__meta-date { display: none; }
  .card-b--table .doc-row__date {
    display: block;
    grid-area: date;
    font-size: 14px;
    color: var(--color-text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .card-b--table .doc-row__status { justify-self: start; }
  .card-b--table .doc-row--head {
    display: grid;
    padding-top: 12px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--color-divider);
  }
  .doc-row--head:hover { background: #fff; }
  .doc-row--head > span {
    font: 600 12px/1.2 var(--font-body);
    letter-spacing: .06em;
    text-transform: uppercase;
    color: var(--color-text-muted);
  }
}
.doc-row--head + .doc-row { border-top: 0; }

/* ---- Tableau de bord ------------------------------------------------------ */
.dash { display: flex; flex-direction: column; gap: 20px; }
.dash__alert {
  margin-top: 12px;
  padding: 12px 16px;
  border-radius: 12px;
  background: #F7E2E0;
  color: #A32626;
  font: 600 15px var(--font-body);
}
.dash__alert a { color: inherit; text-decoration: underline; white-space: nowrap; }
.dash__voice { display: flex; flex-direction: column; align-items: center; gap: 10px; }
.dash__alt { padding: 4px 8px; }
.voice-card {
  display: flex;
  align-items: center;
  gap: 16px;
  width: 100%;
  padding: 18px;
  border-radius: 16px;
  background: var(--color-header);
  text-decoration: none;
}
.voice-card:hover { background: #2C2A20; }
.voice-card__text { display: flex; flex-direction: column; gap: 4px; flex: 1; min-width: 0; }
.voice-card__title { color: #fff; font: 600 19px/1.2 var(--font-body); }
.voice-card__sub { color: #C4BAA3; font: 400 14px/1.35 var(--font-body); }
.voice-card__mic {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--color-accent);
  color: var(--color-header);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.voice-card__mic svg { width: 26px; height: 26px; }

.tint {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.tint svg { width: 20px; height: 20px; }
.tint--amber { background: #FBF1D4; color: var(--color-accent-text); }
.tint--red { background: #F7E2E0; color: #A32626; }
.tint--blue { background: #E2ECF6; color: #245A93; }

.todo-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  color: var(--color-text);
  font-family: var(--font-body);
  text-decoration: none;
}
.todo-row + .todo-row { border-top: 1px solid var(--color-divider); }
.todo-row:hover { background: var(--color-hover); }
.todo-row__text { display: flex; flex-direction: column; gap: 2px; flex: 1; min-width: 0; }
.todo-row__title { font-size: 17px; font-weight: 600; line-height: 1.25; }
.todo-row__desc { font-size: 14px; color: var(--color-text-muted); }
.todo-row__chevron { width: 18px; height: 18px; color: #8C836C; flex-shrink: 0; }
.todo-clear {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  padding: 14px 16px;
  font: 400 15px/1.35 var(--font-body);
  color: var(--color-text-muted);
}
.todo-clear svg { width: 18px; height: 18px; color: #236140; flex-shrink: 0; }

.kpis { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.kpi {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 14px 16px;
  border: 0 solid var(--color-divider);
  color: var(--color-text);
  font-family: var(--font-body);
  text-decoration: none;
}
.kpi:nth-child(odd) { border-right-width: 1px; }
.kpi:nth-child(-n+2) { border-bottom-width: 1px; }
.kpi:hover { background: var(--color-hover); }
.kpi__label { font-size: 13px; font-weight: 500; color: var(--color-text-muted); }
.kpi__value {
  font: 500 24px/1.2 var(--font-display);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

@media (min-width: 900px) {
  .dash {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 340px;
    grid-template-areas:
      "greet greet"
      "kpis kpis"
      "recent todo";
    gap: 24px;
    align-items: start;
    max-width: 1120px;
  }
  .dash__greeting { grid-area: greet; }
  .dash__kpis { grid-area: kpis; }
  .dash__recent { grid-area: recent; }
  .dash__todo { grid-area: todo; }
  .dash__voice { display: none; }
  .kpis { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .kpi { padding: 18px 22px; border-width: 0; }
  .kpi:nth-child(odd), .kpi:nth-child(-n+2) { border-width: 0; }
  .kpi + .kpi { border-left-width: 1px; }
  .kpi__label { font-size: 14px; }
  .kpi__value { font-size: 30px; }
  /* Colonne etroite : references tronquees (titre « Réf. ») ; statut a
     176 px, place de « Acquitté à 100 % ». */
  .dash .card-b--table .doc-row {
    grid-template-columns: minmax(0, 1.4fr) minmax(0, .6fr) 84px 176px 104px;
    column-gap: 10px;
    padding-left: 18px;
    padding-right: 18px;
  }
}

/* ---- Fiche devis ---------------------------------------------------------- */
.qdetail { display: flex; flex-direction: column; gap: 16px; }
.qhero {
  margin: -20px -16px 4px;
  padding: 8px 20px 22px;
  background: var(--color-header);
  color: #fff;
  font-family: var(--font-body);
}
.qhero__top { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.qhero__ref { min-width: 0; color: #C4BAA3; font-size: 14px; font-weight: 500; overflow-wrap: anywhere; }
.qhero__client {
  margin: 6px 0 0;
  font: 700 24px/1.2 var(--font-body);
  color: #fff;
  text-transform: none;
  letter-spacing: 0;
}
.qhero__client a { color: inherit; text-decoration: none; }
/* Objet du chantier sous le client (fiche, page du client, facture). */
.qhero__subject { margin-top: 4px; font: 500 16px/1.35 var(--font-body); color: #E9E2D0; overflow-wrap: anywhere; }
.qhero__site { margin-top: 2px; font: 400 14px/1.35 var(--font-body); color: #C9BFA9; overflow-wrap: anywhere; }
.qhero__client a:hover { text-decoration: underline; }
.qhero__total {
  margin-top: 6px;
  font: 500 36px/1.15 var(--font-display);
  color: #D9A227;
  font-variant-numeric: tabular-nums;
}
.qhero__total span { font-size: 16px; color: #C4BAA3; }
.qhero__dates { margin-top: 6px; font-size: 14px; color: #C4BAA3; }
/* Statuts eclaircis sur fond encre. */

.qsection { display: flex; flex-direction: column; }
/* Catalogue apres l'enregistrement : articles ajoutes (carte de la fiche),
   prix changes (fenetre .qcat-dialog, tableau coche ligne par ligne). */
.qcat { display: flex; flex-direction: column; gap: 10px; font-family: var(--font-body); }
.qcat__lead { margin: 0; line-height: 1.45; }
.qcat__question { margin: 4px 0 0; font: 600 16px/1.4 var(--font-body); color: var(--color-text); }
.qcat__actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 4px; }
.vox-dialog.qcat-dialog { width: min(680px, calc(100vw - 32px)); }
.qcat-dialog .vox-dialog__box { max-height: calc(100dvh - 48px); overflow-y: auto; }
/* Focus pose sur le titre a l'ouverture : aucune case ne parait choisie. */
.qcat-dialog .vox-dialog__title:focus { outline: none; }
.qcat-table { width: 100%; border-collapse: collapse; font: 400 15px/1.35 var(--font-body); font-variant-numeric: tabular-nums; }
.qcat-table th,
.qcat-table td { padding: 8px 6px; border-bottom: 1px solid var(--color-divider); text-align: center; vertical-align: middle; }
.qcat-table thead th { font: 600 12px/17px var(--font-body); letter-spacing: .06em; text-transform: uppercase; color: var(--color-text-muted); }
.qcat-table thead .sort-head { position: relative; }
.qcat-table thead .sort-head__arrow { position: absolute; left: calc(100% - 2px); }
.qcat-table tbody tr:last-child > * { border-bottom: 0; }
.qcat-table__label { width: 46%; font-weight: 600; overflow-wrap: anywhere; }
.qcat-table__unit { font-weight: 400; color: var(--color-text-muted); white-space: nowrap; }
.qcat-table__old { color: var(--color-text-muted); white-space: nowrap; }
.qcat-table__new { font-weight: 700; white-space: nowrap; }
.qcat-table__check { display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; cursor: pointer; }
.qcat-table__check input { width: 22px; height: 22px; margin: 0; accent-color: var(--color-accent); cursor: pointer; }
/* Fenetre « Ce que VOX retient de ce devis » : prix et ouvrages en sections,
   une case par proposition, la facon de l'ajouter dans un menu dessous. */
.learn .learn-section { display: flex; flex-direction: column; gap: 8px; margin-top: 8px; padding-top: 14px; border-top: 1px solid var(--color-divider); }
.learn-section__title { margin: 0; font: 600 13px/18px var(--font-body); letter-spacing: .06em; text-transform: uppercase; color: var(--color-text-muted); }
.learn-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.learn-item { display: flex; flex-direction: column; gap: 4px; padding: 10px 12px; border: 1px solid var(--color-divider); border-radius: 12px; }
.learn-item__text { margin: 0; font: 400 15px/1.4 var(--font-body); color: var(--color-text); overflow-wrap: anywhere; }
.learn-item__check { display: flex; align-items: center; gap: 10px; min-height: 44px; font: 600 15px/1.35 var(--font-body); color: var(--color-text); cursor: pointer; }
.learn-item__check input { flex: none; width: 22px; height: 22px; margin: 0; accent-color: var(--color-accent); cursor: pointer; }
.learn-item__choice { width: 100%; min-height: 44px; padding: 8px 40px 8px 12px; border: 1px solid #CFC5B0; border-radius: 10px; font: 400 15px/1.35 var(--font-body); color: var(--color-text); appearance: none; -webkit-appearance: none; background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%235E5645' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") no-repeat right 12px center / 18px; text-overflow: ellipsis; }
.learn-item__choice:focus { outline: none; border-color: var(--color-accent); box-shadow: 0 0 0 3px rgba(201, 151, 29, .18); }
.learn__close { margin-top: 16px; justify-content: flex-end; }
@media (max-width: 599px) {
  /* Une ligne par article : libelle, puis les deux prix, case a droite. */
  .qcat-table thead { display: none; }
  .qcat-table tr {
    display: grid;
    grid-template-columns: 1fr 1fr 44px;
    grid-template-areas: "label label pick" "old new pick";
    column-gap: 8px;
    row-gap: 4px;
    padding: 10px 0;
    border-bottom: 1px solid var(--color-divider);
  }
  .qcat-table tbody tr:last-child { border-bottom: 0; }
  .qcat-table td { padding: 0; border: 0; text-align: left; }
  .qcat-table__label { grid-area: label; width: auto; }
  .qcat-table__old { grid-area: old; }
  .qcat-table__new { grid-area: new; }
  .qcat-table__pick { grid-area: pick; align-self: center; }
  .qcat-table__old::before,
  .qcat-table__new::before { content: attr(data-label); display: block; font: 600 12px/17px var(--font-body); letter-spacing: .04em; text-transform: uppercase; color: var(--color-text-muted); }
  .qcat-dialog .vox-dialog__actions { flex-direction: column-reverse; }
}
.qline { display: flex; gap: 12px; padding: 14px 16px; font-family: var(--font-body); }
.qline + .qline { border-top: 1px solid var(--color-divider); }
.qline__text { display: flex; flex-direction: column; gap: 3px; flex: 1; min-width: 0; }
.qline__desc { font-size: 16px; font-weight: 600; line-height: 1.3; overflow-wrap: anywhere; }
.qline__calc { font-size: 14px; color: var(--color-text-muted); font-variant-numeric: tabular-nums; }
.qline--center { align-items: center; }
.qline__total { font-size: 15px; font-weight: 600; white-space: nowrap; font-variant-numeric: tabular-nums; }
.qtotals { padding: 8px 0; border-top: 1px solid #E2DACA; background: var(--color-hover); font-family: var(--font-body); }
.qtotals__row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 7px 16px;
  font-size: 15px;
  font-variant-numeric: tabular-nums;
}
.qtotals__row span:first-child { color: var(--color-text-muted); }
/* Lignes des totaux separees comme les lignes du document. */
.qtotals__row + .qtotals__row { border-top: 1px solid var(--color-divider); }
.qtotals__row--total { padding-top: 10px; font-size: 17px; font-weight: 700; }
.qtotals__row--total span:first-child { color: var(--color-text); }
.qinfo { padding: 6px 0; font-family: var(--font-body); }
.qinfo__row { display: flex; flex-direction: column; gap: 2px; padding: 8px 16px; font-size: 15px; }
.qinfo__label { font-size: 13px; font-weight: 600; color: var(--color-text-muted); }
/* Conditions du devis sous les totaux (page du client) : separees des
   totaux comme les lignes du document. */
.qinfo--terms { border-top: 1px solid #E2DACA; }
.qinfo--terms .qinfo__row + .qinfo__row { border-top: 1px solid var(--color-divider); }
.qinfo__text { white-space: pre-line; overflow-wrap: anywhere; }
.qnote { display: flex; gap: 12px; padding: 14px 16px; font-family: var(--font-body); }
.qnote > svg { width: 18px; height: 18px; margin-top: 2px; color: var(--color-text-muted); flex-shrink: 0; }
.qnote__label { display: block; font-size: 13px; font-weight: 600; color: var(--color-text-muted); }
.qnote__content { margin: 4px 0 0; font-size: 15px; white-space: pre-line; }
.qbilling { display: flex; flex-direction: column; gap: 10px; padding: 16px; }
/* Echeancier d'un devis signe : une ligne par echeance, sa facture ou son
   bouton (app/core/payment_schedule.py). */
.qsched { list-style: none; margin: 0; padding: 0; font-family: var(--font-body); }
.qsched__row { display: flex; align-items: center; gap: 12px; min-height: 48px; padding: 10px 0; }
.qsched__row + .qsched__row { border-top: 1px solid var(--color-divider); }
.qsched__main { display: flex; flex-direction: column; gap: 2px; flex: 1; min-width: 0; }
.qsched__label { font-size: 16px; font-weight: 600; line-height: 1.3; color: var(--color-text); }
.qsched__meta { font-size: 14px; line-height: 1.35; color: var(--color-text-muted); font-variant-numeric: tabular-nums; }
.qsched__invoice { flex-shrink: 0; font-size: 14px; font-weight: 600; color: #8A6410; white-space: nowrap; }
.qsched__wait { flex-shrink: 0; font-size: 14px; color: var(--color-text-muted); white-space: nowrap; }
.qbilling .qsched__btn { flex-shrink: 0; width: auto; min-height: 44px; }
/* Vide, la zone reste dans l'arbre d'accessibilite (role=status) : un
   lecteur d'ecran annonce le premier message (gap-accessibilite-application-07). */
.qresult:empty { display: block; min-height: 0; margin: 0; padding: 0; border: 0; }
.qactions { margin-top: 4px; }

.action-row {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  min-height: 52px;
  padding: 0 16px;
  border: 0;
  background: none;
  color: var(--color-text);
  font: 500 16px var(--font-body);
  text-align: left;
  text-decoration: none;
  cursor: pointer;
}
.action-row + .action-row { border-top: 1px solid var(--color-divider); }
.action-row:hover { background: var(--color-hover); }
.action-row > svg { width: 20px; height: 20px; color: var(--color-text-muted); flex-shrink: 0; }
.action-row > span { flex: 1; }
.action-row > .action-row__chevron { width: 18px; height: 18px; color: #8C836C; }
.action-row:disabled { opacity: .6; cursor: default; }
.action-row--danger, .action-row--danger > svg { color: #A32626; }

.qbar { display: flex; gap: 10px; }
.qbar .btn { flex: 1; width: auto; min-height: 50px; }
.qbar .qbar__main { flex-grow: 1.4; }

@media (max-width: 899px) {
  .qbar {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 95;
    padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
    background: #fff;
    border-top: 1px solid #E2DACA;
  }
  .main:has(.qbar) { padding-bottom: calc(100px + env(safe-area-inset-bottom)); }
  /* Toasts et bulle du guide au-dessus de la barre d'actions. */
  body:has(.qbar) .error-toast,
  body:has(.qbar) .pp-chip { bottom: calc(92px + env(safe-area-inset-bottom)); }
}

@media (min-width: 900px) {
  .qdetail { max-width: 760px; }
  .qhero { margin: 0; padding: 22px 26px; border-radius: 16px; }
  /* Actions juste sous l'en-tete : sans barre fixe, elles resteraient en bas de page. */
  .qdetail > * { order: 3; }
  .qdetail > .qhero { order: 1; }
  .qdetail > .qbar { order: 2; justify-content: flex-end; }
  .qbar .btn { flex: 0 0 auto; min-width: 170px; }
}

/* ---- Lignes de devis et facture en edition --------------------------------
   Trois cellules dans une grille de quatre colonnes : les champs gardaient leur
   largeur intrinseque et la page debordait de 280 px sur mobile. */
.line-item__fields { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.line-item__fields input { width: 100%; min-width: 0; }
.line-item__fields > .line-item__total-cell {
  grid-column: 1 / -1;
  flex-direction: row;
  justify-content: space-between;
  align-items: baseline;
}
.line-item__total { color: var(--color-text); }

@media (min-width: 700px) {
  .line-item__fields { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .line-item__fields > .line-item__total-cell { grid-column: auto; flex-direction: column; align-items: flex-end; }
}

/* ---- Ambre en texte sur fond clair : 2,7:1 avec #C9971D, 5,4:1 avec #8A6410 -- */
.totals__row--total .totals__amount, .total-row--highlight, .quote-card__ref, .quote-card__total, .line-item__tag a, .line-item__action, .email-row__label, .product-price, .text-accent, .auth-card__footer a {
  color: var(--color-accent-text);
}

/* ---- Comptabilite : tableau a 7 colonnes, defilement horizontal dans son cadre
   plutot que toute la page (debordait de 278 px sur mobile). */
#acc-tab-content { overflow-x: auto; -webkit-overflow-scrolling: touch; }
#acc-tab-content .acc-table { min-width: 560px; }

/* ============================================================================
   Sections par domaine : chaque domaine n'ecrit qu'entre ses deux marqueurs.
   ============================================================================ */

/* ==== [factures] debut ==== */
/* ---- Fiche facture : reprend .qdetail/.qhero/.qline/.qbar de la fiche devis */

.idetail__links .action-row { padding-top: 8px; padding-bottom: 8px; line-height: 1.3; }
.idetail__links .action-row strong { font-weight: 600; overflow-wrap: anywhere; }

.qtotals__row.idetail__due { font-weight: 700; }
.qtotals__row.idetail__due span:first-child { color: var(--color-accent-text); }

.qline .idetail__receipt {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 44px;
  margin: -12px 0;
  padding: 0 4px;
  color: var(--color-accent-text);
  font: 600 14px var(--font-body);
  text-decoration: none;
  white-space: nowrap;
}
.idetail__receipt svg { width: 16px; height: 16px; }
.idetail__receipt:hover { text-decoration: underline; }

.idetail__pay { display: flex; flex-direction: column; gap: 14px; padding: 16px; }
.idetail__pay .form-group { margin: 0; }
.idetail__pay .form-input { min-height: 48px; font-size: 16px; }
.idetail__pay .btn { width: 100%; min-height: 48px; }

.idetail__result:not(:empty) {
  padding: 12px 16px;
  border-radius: 12px;
  background: #fff;
  color: var(--color-text);
  font: 500 15px/1.4 var(--font-body);
  box-shadow: 0 1px 2px rgba(31, 28, 18, .08);
}

/* Encaissement : chaque champ a la largeur de ce qu'il contient.
   Telephone : montant et mode cote a cote, puis date, note, bouton.
   Des 700 px : montant, mode, date sur une ligne ; note et bouton dessous. */
.idetail__encaisser { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px; }
.idetail__encaisser .form-group:nth-of-type(3) { grid-column: 1; }
.idetail__encaisser .form-group:nth-of-type(4),
.idetail__encaisser .btn { grid-column: 1 / -1; }
@media (min-width: 700px) {
  .idetail__encaisser.idetail__encaisser { grid-template-columns: 150px 170px 190px minmax(0, 1fr); gap: 12px 14px; }
  .idetail__encaisser .form-group:nth-of-type(3) { grid-column: 3; }
  .idetail__encaisser .form-group:nth-of-type(4) { grid-column: 1 / 4; }
  .idetail__encaisser.idetail__encaisser .btn { grid-column: 4; justify-self: end; align-self: end; width: auto; }
}

/* Echeance : champ et bouton sur une ligne, aide juste dessous (14 px, comme
   la note interne). */
.idetail__echeance { display: flex; flex-direction: column; gap: 8px; padding: 14px 16px; }
.idetail__echeance .form-label { margin: 0; }
.idetail__echeance-row { display: flex; gap: 10px; align-items: stretch; }
.idetail__echeance-row .date-fr { flex: 1 1 200px; max-width: 260px; }
.idetail__echeance-row .form-input { min-height: 48px; font-size: 16px; }
.idetail__echeance-row .btn { flex: 0 0 auto; width: auto; min-height: 48px; padding: 0 18px; }
.idetail__echeance .form-hint { margin: 0; font-size: 14px; line-height: 1.4; color: var(--color-text-muted); }

@media (min-width: 900px) {
  .idetail__pay { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 16px; padding: 20px; }
  .idetail__pay .btn { grid-column: 1 / -1; justify-self: end; width: auto; }
}

/* ---- Edition facture : lignes en cartes blanches, barre d'actions .qbar ---- */
.iedit { display: flex; flex-direction: column; gap: 16px; }
.iedit__head { align-items: flex-start; margin-bottom: 0; }
.iedit__heading { min-width: 0; }
.iedit__heading .page-subtitle { overflow-wrap: anywhere; }
.iedit .unsaved-badge {
  flex-shrink: 0;
  margin-top: 6px;
  background: #FBF1D4;
  color: var(--color-accent-text);
  font: 600 13px/1 var(--font-body);
  border-radius: 999px;
}
.iedit__hint { margin: -4px 0 10px; font: 400 14px/1.4 var(--font-body); color: var(--color-text-muted); }

.iedit .line-item {
  margin: 0 0 12px;
  padding: 12px 16px 16px;
  border: 0;
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 1px 2px rgba(31, 28, 18, .08);
}
.iedit .line-item--editing { background: #FAFDF8; }
.iedit .line-item__header { gap: 10px; margin-bottom: 4px; align-items: flex-start; }
.iedit .line-item__title {
  min-width: 0;
  text-transform: none;
  letter-spacing: 0;
  overflow-wrap: anywhere;
}
.iedit .line-item__delete {
  margin: 0 -8px 0 0;
  border: 0;
  border-radius: 10px;
  color: #A32626;
}
.iedit .line-item__delete:hover { background: #F7E2E0; }
.iedit .line-item__delete svg { width: 20px; height: 20px; }
.iedit .line-item__tag {
  display: flex;
  flex-wrap: wrap;
  gap: 0 16px;
  margin: 0 0 8px;
  font-size: 14px;
}
.iedit .line-item__tag a.line-item__action {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 44px;
  color: var(--color-accent-text);
  font: 600 14px var(--font-body);
  text-decoration: none;
}
.iedit .line-item__tag a.line-item__action:hover { text-decoration: underline; }
.iedit .line-item__action svg { width: 16px; height: 16px; }
.iedit .line-item__fields input { box-shadow: none; font-variant-numeric: tabular-nums; }
.iedit .line-item__fields .line-item__label,
.iedit .line-item__total-cell .line-item__label { font: 600 13px var(--font-body); color: var(--color-text-muted); }
.iedit .line-item__total { font: 700 17px var(--font-body); font-variant-numeric: tabular-nums; }
/* .line-item__fields > div (app.css, 0-1-1) empilait libelle et total. */
.iedit .line-item__fields > .line-item__total-cell {
  flex-direction: row;
  justify-content: space-between;
  align-items: baseline;
  padding-top: 4px;
}
.iedit .line-item__total--flash { color: var(--color-success); }

.iedit__add { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.iedit__add .btn { min-height: 48px; padding-left: 10px; padding-right: 10px; font-size: 15px; }

.iedit__totals { border-top: 0; }
.iedit .totals--flash .qtotals__row--total span:last-child { color: var(--color-success); }
.iedit .qtotals__row span:last-child { transition: color .3s ease; }

.iedit__due { display: flex; flex-direction: column; gap: 6px; padding: 16px; }
.iedit__due .form-input { min-height: 48px; font-size: 16px; }

.iedit__result:not(:empty) {
  padding: 12px 16px;
  border-radius: 12px;
  background: #F7E2E0;
  color: #A32626;
  font: 600 15px/1.4 var(--font-body);
}

/* Barre d'actions : libelles sur une ligne a 390 px. */
.idetail .qbar .btn, .iedit .qbar .btn { padding-left: 12px; padding-right: 12px; font-size: 15px; white-space: nowrap; }
.iedit .qbar .btn { flex: 1 1 0; }

@media (min-width: 700px) {
  .iedit .line-item__fields > .line-item__total-cell { flex-direction: column; align-items: flex-end; padding-top: 0; }
}

@media (min-width: 900px) {
  .iedit { max-width: 760px; }
  .iedit .qbar .btn { flex: 0 0 auto; }
  .iedit .qbar { justify-content: flex-end; }
}

/* ---- Nouvelle facture : dicter (carte encre) ou partir d'un devis signe ---- */
.inew { display: flex; flex-direction: column; gap: 16px; max-width: 640px; }
.inew .page-head { margin-bottom: 0; }
.inew__choices { display: flex; flex-direction: column; gap: 12px; }
#quote-pick-modal .modal__close,
#article-modal .modal__close { display: flex; align-items: center; justify-content: center; min-width: 44px; min-height: 44px; }
#quote-pick-modal .modal__close svg,
#article-modal .modal__close svg { width: 20px; height: 20px; }

/* ---- Choix du client ------------------------------------------------------- */
.ipick { display: flex; flex-direction: column; max-width: 640px; }
.ipick .client-pick-item { border: 0; border-radius: 0; background: none; }
.ipick .client-pick-item + .client-pick-item { border-top: 1px solid var(--color-divider); }
.ipick .client-pick-item__link {
  gap: 12px;
  min-height: 56px;
  padding: 12px 16px;
  color: var(--color-text);
  text-decoration: none;
}
.ipick .client-pick-item__link:hover { background: var(--color-hover); }
.ipick .client-pick-item__text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.ipick .client-pick-item__name { font: 600 16px/1.3 var(--font-body); text-transform: none; overflow-wrap: anywhere; }
.ipick .client-pick-item__sub { font-size: 14px; color: var(--color-text-muted); }
.ipick__new { align-self: flex-start; min-height: 48px; margin-top: 16px; }

/* ---- Dictee d'une facture -------------------------------------------------- */
.idict__client { color: var(--color-text); font-weight: 600; }
.idict .voice-box {
  gap: 14px;
  margin: 8px 0 12px;
  padding: 14px 16px;
  border: 2px solid transparent;
  border-radius: 16px;
  box-shadow: 0 1px 2px rgba(31, 28, 18, .08);
}
.idict .voice-box--recording { border-color: #A32626; background: #FFF7F6; }
.idict .voice-box__icon-wrap { background: var(--color-accent); color: var(--color-header); }
.idict .voice-box__icon-wrap svg { width: 26px; height: 26px; }
.idict .voice-box--recording .voice-box__icon-wrap { background: #A32626; color: #fff; }
.idict .voice-box__title { font: 600 17px/1.25 var(--font-body); }
.idict .voice-box__subtitle { font-size: 14px; }
.idict .form-input { font-size: 16px; }
.idict .form-hint { margin: 2px 0 0; font-size: 14px; line-height: 1.4; }
.idict__generate { width: 100%; min-height: 52px; }
.idict__error {
  padding: 12px 16px;
  border-radius: 12px;
  background: #F7E2E0;
  color: #A32626;
  font: 600 15px/1.4 var(--font-body);
}

@media (min-width: 900px) {
  .idict, .idict__generate { max-width: 640px; }
}
/* ==== [factures] fin ==== */

/* ==== [devis] debut ==== */
/* Nouveau devis, choix du client, edition du devis, lien client.
   Tout est scope (.vb-page, .qedit, .voice-box--b...) : l'edition des
   factures, qui partage .line-item et .voice-box, n'est pas touchee. */

/* ---- Pages : colonne aeree, largeur de lecture sur ordinateur ------------ */
.vb-page, .qedit { display: flex; flex-direction: column; gap: 16px; }
.qedit { gap: 20px; }
.vb-page > *, .qedit > * { margin-top: 0; margin-bottom: 0; }
.vb-client, .qedit__client { color: var(--color-text); font-weight: 600; }
/* Client du devis sous le titre : juste sous la taille du titre (30 / 34 px). */
.qedit__client {
  display: block;
  margin: 2px 0 4px;
  font-size: 28px;
  line-height: 1.2;
  overflow-wrap: anywhere;
}
@media (min-width: 900px) {
  .qedit__client { font-size: 32px; }
}
.vb-result-zone:empty, .vb-result:empty { display: block; min-height: 0; margin: 0; padding: 0; border: 0; }

@media (min-width: 900px) {
  .vb-page, .qedit { max-width: 760px; }
}

.vb-label {
  display: block;
  margin: 0 0 6px;
  font: 600 14px/1.3 var(--font-body);
  color: var(--color-text-muted);
  text-transform: none;
  letter-spacing: 0;
}
.vb-optional { font-weight: 400; }
.vb-hint { margin: 0; font: 400 14px/1.4 var(--font-body); color: var(--color-text-muted); }
.vb-hint--lead { font-size: 15px; }
.vb-hint--center { text-align: center; }
.vb-textarea {
  display: block;
  width: 100%;
  min-height: 96px;
  padding: 12px 14px;
  border-radius: 12px;
  background: #fff;
  box-shadow: none;
  font: 400 16px/1.45 var(--font-body);
  white-space: pre-wrap;
}
.vb-main { width: 100%; min-height: 56px; font-size: 17px; }
.vb-alert, .vb-result {
  padding: 12px 16px;
  border-radius: 12px;
  background: #F7E2E0;
  color: #A32626;
  font: 600 15px/1.4 var(--font-body);
}
.vb-alert-card {
  display: flex;
  gap: 12px;
  padding: 14px 16px;
  color: #A32626;
  font: 500 15px/1.4 var(--font-body);
}
.vb-alert-card > svg { width: 20px; height: 20px; flex-shrink: 0; margin-top: 1px; }
.vb-alert-card p { margin: 0; }

/* ---- Zone de dictee : grande cible, micro ambre, etat enregistrement net -- */
.voice-box.voice-box--b {
  display: flex;
  align-items: center;
  gap: 16px;
  min-height: 92px;
  margin: 0;
  padding: 18px;
  border: 0;
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 1px 2px rgba(31, 28, 18, .08);
  font-family: var(--font-body);
}
.voice-box--b:hover { background: var(--color-hover); }
.voice-box--b:focus-visible { outline: 3px solid #D9A227; outline-offset: 2px; }
.voice-box--b .voice-box__icon-wrap {
  width: 64px;
  height: 64px;
  min-width: 64px;
  background: var(--color-accent);
}
.voice-box--b .voice-box__icon-wrap svg { width: 28px; height: 28px; color: var(--color-header); }
.voice-box__body { display: flex; flex-direction: column; gap: 3px; flex: 1; min-width: 0; }
.voice-box--b .voice-box__title {
  font: 600 18px/1.25 var(--font-body);
  color: var(--color-text);
  text-transform: none;
  letter-spacing: 0;
}
.voice-box--b .voice-box__subtitle { font: 400 14px/1.35 var(--font-body); color: var(--color-text-muted); }
.voice-box--b .sound-wave { margin-top: 8px; }

.voice-box--b.voice-box--ink { background: var(--color-header); box-shadow: none; }
.voice-box--b.voice-box--ink:hover { background: #2C2A20; }
.voice-box--ink .voice-box__title { color: #fff; }
.voice-box--ink .voice-box__subtitle { color: #C4BAA3; }

/* Enregistrement : cadre rouge, micro rouge qui pulse, titre « Enregistrement… ». */
.voice-box--b.voice-box--recording { background: #FDF1EF; box-shadow: inset 0 0 0 2px #C42E2E; }
.voice-box--b.voice-box--recording .voice-box__icon-wrap { background: #C42E2E; }
.voice-box--b.voice-box--recording .voice-box__icon-wrap svg { color: #fff; }
.voice-box--b.voice-box--recording .voice-box__title { color: #A32626; }
.voice-box--b.voice-box--ink.voice-box--recording { background: var(--color-header); box-shadow: inset 0 0 0 2px #E0685F; }
.voice-box--b.voice-box--ink.voice-box--recording .voice-box__title { color: #fff; }
.voice-box--ink .sound-wave__bar { background: #F2A29A; }

@media (prefers-reduced-motion: reduce) {
  .voice-box--b.voice-box--recording .voice-box__icon-wrap,
  .voice-box--b .sound-wave__bar { animation: none; }
}

.vb-dictate .voice-box { margin-bottom: 16px; }
.vb-dictate .vb-hint { margin-top: 8px; }
#predictate-group .vb-textarea { margin-top: 12px; }

/* Generation (nouveau devis) : carte blanche a la place du formulaire. */
.vb-generating {
  margin: 0;
  padding: 32px 24px;
  border: 0;
  border-radius: 16px;
  box-shadow: 0 1px 2px rgba(31, 28, 18, .08);
}
/* Correction (edition) : voile plein ecran, le bouton est souvent loin en bas. */
.vb-overlay {
  position: fixed;
  inset: 0;
  z-index: 300;
  margin: 0;
  padding: 32vh 24px 0;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  background: rgba(250, 248, 243, .97);
  text-align: center;
}

/* ---- Choix du client ------------------------------------------------------ */
/* Un champ « Créer ou rechercher un client » et une seule liste : 3 clients
   recents, puis la ligne « Nouveau client ». Pendant la saisie, la ligne
   « Créer « nom » » remonte en tete, au-dessus des clients trouves. */
.vb-picks { display: flex; flex-direction: column; gap: 10px; }
.vb-picks .search-bar { margin-bottom: 0; }
.vb-picks .search-bar__input { border-color: var(--color-border); }
.vb-pick-list > [hidden] { display: none; }
/* Trait entre deux lignes, quel que soit l'ordre ou les lignes masquees : le
   trait du haut de la premiere ligne visible est rogne par la carte. */
.vb-pick-list > * { margin-top: -1px; border-top: 1px solid var(--color-divider); }
.vb-picks .client-pick-item { border-bottom: 0; border-radius: 0; background: #fff; }
/* Client choisi apres une dictee : ligne verte, remontee en tete, puis ouverture. */
.vb-picks .client-pick-item--picked { position: relative; z-index: 1; background: #E6F4EC; box-shadow: inset 4px 0 0 var(--color-success); transition: background .2s; }
.vb-picks .client-pick-item--picked .client-pick-item__name { color: #1E6B42; }
.vb-picks .client-pick-item--picked .client-pick-item__chevron { color: var(--color-success); }
.vb-picks .client-pick-item__link,
.vb-new__btn {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 60px;
  padding: 10px 16px;
  border: 0;
  background: #fff;
  color: var(--color-text);
  font-family: var(--font-body);
  text-align: left;
  text-decoration: none;
  cursor: pointer;
}
.vb-picks .client-pick-item__link:hover,
.vb-new__btn:hover { background: var(--color-hover); }
.client-pick-item__text { display: flex; flex-direction: column; gap: 2px; flex: 1; min-width: 0; }
.vb-picks .client-pick-item__name,
.vb-new__title {
  font: 600 16px/1.3 var(--font-body);
  text-transform: none;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.vb-picks .client-pick-item__name small { font-size: 14px; font-weight: 500; color: var(--color-text-muted); }
.vb-picks .client-pick-item__sub {
  margin: 0;
  font-size: 13px;
  color: var(--color-text-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.client-pick-item__chevron { width: 18px; height: 18px; color: #8C836C; flex-shrink: 0; }
.vb-new { margin: 0; background: #fff; }
.vb-new__title { color: var(--color-accent-text, #8A6410); }
.vb-new__icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  min-width: 36px;
  border-radius: 50%;
  background: #F4E7C6;
  color: #8A6410;
}
.vb-new__icon svg { width: 20px; height: 20px; }
@media (prefers-reduced-motion: no-preference) {
  .vb-new--moved { animation: vb-new-in .25s ease-out; }
}
@keyframes vb-new-in { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }

/* ---- Lien client (fiche devis) -------------------------------------------- */
.qshare { display: flex; flex-direction: column; gap: 6px; padding: 14px 16px; font-family: var(--font-body); }
.qshare__url {
  color: var(--color-accent-text);
  font: 600 15px/1.35 var(--font-body);
  overflow-wrap: anywhere;
  text-decoration: none;
}
.qshare__url:hover { text-decoration: underline; }
.qshare__state { margin: 0; font-size: 14px; line-height: 1.4; color: var(--color-text-muted); }
.qshare__actions { display: flex; gap: 10px; margin-top: 8px; }
.qshare__actions .btn { flex: 1; width: auto; min-height: 44px; }
/* Messagerie choisie sur PC (E-mail) : rappel discret et lien pour changer. */
.qshare__mail { margin: 2px 0 0; font-size: 13px; color: var(--color-text-muted); }
.qshare__mail-change {
  margin-left: 6px; padding: 0; border: 0; background: none; font: inherit;
  color: inherit; text-decoration: underline; cursor: pointer;
}

/* ---- Edition du devis ----------------------------------------------------- */
.qedit__head { align-items: flex-start; }
.qedit .unsaved-badge {
  flex-shrink: 0;
  gap: 6px;
  height: 28px;
  margin-top: 6px;
  padding: 0 10px;
  border-radius: 999px;
  background: #FBF1D4;
  color: var(--color-accent-text);
  font: 600 13px/1 var(--font-body);
  text-transform: none;
  letter-spacing: 0;
}
.qedit .unsaved-badge__dot { background: var(--color-accent-text); }
.qedit__hint { margin: 0 0 10px; font: 400 14px/1.4 var(--font-body); color: var(--color-text-muted); }
.qedit__refine .qedit__hint { margin: 10px 0; }

/* Ligne : designation, puis quantite et prix larges, total a l'encre. */
.qedit .line-item {
  margin: 0;
  padding: 14px 16px;
  border: 0;
  border-radius: 0;
  background: #fff;
  box-shadow: none;
  transition: background .2s;
}
.qedit .line-item + .line-item { border-top: 1px solid var(--color-divider); }
.qedit .line-item--editing { background: #FBFAF6; }
.qedit .line-item__header { display: flex; align-items: flex-start; gap: 8px; margin: 0 0 10px; }
/* Numéro de ligne, devis et facture : carré encre, chiffre blanc, centré
   sur la hauteur du libellé quel que soit son nombre de lignes. Plein et
   foncé, il ne ressemble ni à un champ (beige) ni à un bouton (ambre).
   Barlow 18 px dans 32 px avec 1 px de marge basse : chiffre centré à
   0,25 px près sur toutes les lignes, en densités 1, 2 et 3 (mesuré) ; sans
   cette marge, l'écart va jusqu'à 1,25 px selon la position de la ligne.
   Sélecteur à trois classes : la règle commune des pastilles (padding 0)
   vient plus bas. */
:is(.qedit, .iedit) .line-item__header > .line-item__number {
  align-self: center;
  width: 32px;
  height: 32px;
  margin: 0;
  padding: 0 0 1px;
  flex-shrink: 0;
  box-sizing: border-box;
  border: 0;
  border-radius: 8px;
  background: var(--color-header);
  color: #fff;
  font: 700 18px/1 var(--font-body);
}
.qedit .line-item__title {
  flex: 1;
  min-width: 0;
  letter-spacing: 0;
  text-transform: none;
  overflow-wrap: anywhere;
}
.qedit .line-item__delete {
  width: 44px;
  height: 44px;
  margin: 2px -10px 0 0;
  border: 0;
  border-radius: 10px;
  background: #F7E2E0;
  color: #A32626;
}
.qedit .line-item__delete:hover { background: #F0CFCB; }
.qedit .line-item__delete svg { width: 20px; height: 20px; }

/* Quantite, prix unitaire HT et unite : trois cases sur une ligne, mobile
   comme ordinateur, devis comme facture. Libelle centre au-dessus de sa
   case. Chaque case prend la largeur de sa valeur (--n caracteres, pose par
   le template puis par fitField), 8 caracteres au plus (1,1ch par
   caractere : les chiffres tabulaires de Barlow depassent un peu le « 0 »
   qui definit ch). Total HT sous les
   cases sur mobile, a droite sur ordinateur. Valeurs en 16 px au moins :
   Safari sur iPhone agrandit la page sur un champ plus petit. Colonnes en
   minmax(0, ...) : une valeur hors norme (prix a 8 chiffres et
   « demi-journée » a 360 px) reduit sa case au lieu de renvoyer l'unite a
   la ligne. */
:is(.qedit, .iedit) .line-item__fields {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, max-content)) minmax(0, 1fr);
  gap: 10px 12px;
  align-items: end;
}
:is(.qedit, .iedit) .line-item__fields > div:not(.line-item__total-cell) {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  min-width: 0;
}
:is(.qedit, .iedit) .line-item__fields .line-item__label {
  max-width: 100%;
  overflow: hidden;
  font: 600 13px/1.2 var(--font-body);
  color: var(--color-text-muted);
  text-align: center;
  text-overflow: ellipsis;
  text-transform: none;
  letter-spacing: 0;
  white-space: nowrap;
}
:is(.qedit, .iedit) .line-item__fields input,
:is(.qedit, .iedit) .line-item__fields select.line-item__unit {
  box-sizing: border-box;
  max-width: 100%;
  min-width: 48px;
  height: 52px;
  min-height: 52px;
  margin: 0;
  border: 1.5px solid var(--color-field-border);
  border-radius: 12px;
  background-color: #F7F4EE;
  box-shadow: none;
  color: var(--color-text);
  font: 600 16px var(--font-body);
  font-variant-numeric: tabular-nums;
}
:is(.qedit, .iedit) .line-item__fields input {
  width: calc(clamp(2, var(--n, 4), 8) * 1.1ch + 22px);
  padding: 0 8px;
  text-align: center;
}
/* Unite en menu deroulant, dessinee comme les deux autres cases : chevron
   discret a droite, largeur de l'unite choisie. */
:is(.qedit, .iedit) .line-item__fields select.line-item__unit {
  appearance: none;
  -webkit-appearance: none;
  width: calc(clamp(1, var(--n, 4), 12) * .85ch + 42px);
  padding: 0 26px 0 10px;
  background: #F7F4EE url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%238C836C' stroke-width='1.5'/%3E%3C/svg%3E") no-repeat right 10px center;
  line-height: 49px;
  cursor: pointer;
}
@supports (field-sizing: content) {
  :is(.qedit, .iedit) .line-item__fields select.line-item__unit { width: auto; field-sizing: content; }
}
:is(.qedit, .iedit) .line-item__fields input:focus,
:is(.qedit, .iedit) .line-item__fields select.line-item__unit:focus {
  outline: none;
  border-color: var(--color-accent);
  background-color: #fff;
  box-shadow: 0 0 0 3px rgba(201, 151, 29, .18);
}
:is(.qedit, .iedit) .line-item__fields input.field-just-edited { border-color: #2E7D52; }
:is(.qedit, .iedit) .line-item__fields > .line-item__total-cell {
  grid-column: 1 / -1;
  flex-direction: row;
  justify-content: space-between;
  align-items: baseline;
  padding-top: 0;
}
:is(.qedit, .iedit) .line-item__total-cell .line-item__label { font: 600 14px var(--font-body); color: var(--color-text-muted); }
:is(.qedit, .iedit) .line-item__total {
  font: 700 18px var(--font-body);
  color: var(--color-text);
  font-variant-numeric: tabular-nums;
}
.qedit .line-item__total--flash { color: #236140; }

@media (min-width: 700px) {
  :is(.qedit, .iedit) .line-item__fields { column-gap: 16px; }
  :is(.qedit, .iedit) .line-item__fields input,
  :is(.qedit, .iedit) .line-item__fields select.line-item__unit { font-size: 18px; }
  :is(.qedit, .iedit) .line-item__fields > .line-item__total-cell {
    grid-column: auto;
    flex-direction: column;
    align-items: flex-end;
    gap: 6px;
  }
  :is(.qedit, .iedit) .line-item__total { line-height: 52px; }
}

/* Telephone etroit (360 px) : « 1 demi-journée a 25000 » tient sur la
   ligne avec des marges plus courtes. */
@media (max-width: 389px) {
  :is(.qedit, .iedit) .line-item__fields { column-gap: 8px; }
  :is(.qedit, .iedit) .line-item__fields .line-item__label { font-size: 12px; }
  :is(.qedit, .iedit) .line-item__fields input {
    width: calc(clamp(2, var(--n, 4), 8) * 1.1ch + 16px);
    padding: 0 5px;
  }
  :is(.qedit, .iedit) .line-item__fields select.line-item__unit {
    padding: 0 22px 0 8px;
    background-position: right 8px center;
  }
}

/* Pied de ligne : liens catalogue discrets (44 px). */
.qedit .line-item__foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0 8px;
  margin-top: 6px;
}
.qedit .line-item__tag {
  display: flex;
  justify-content: flex-end;
  gap: 2px;
  margin: 0 -10px 0 auto;
  font-size: inherit;
  line-height: normal;
  color: inherit;
}
.qedit .line-item__action {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 44px;
  padding: 0 10px;
  border-radius: 10px;
  color: var(--color-accent-text);
  font: 600 14px var(--font-body);
  text-decoration: none;
  white-space: nowrap;
}
.qedit .line-item__action:hover { background: #FBF1D4; color: #6B4D0B; }
.qedit .line-item__action svg { width: 16px; height: 16px; }

/* Cases a cocher calmes : bordure fine, ambre une fois cochee. */
.qedit .form-checkbox input[type="checkbox"] { border: 1.5px solid #B9AE95; border-radius: 6px; }
.qedit .form-checkbox input[type="checkbox"]:checked { border-color: var(--color-accent); }

.qedit__add {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  padding: 12px 16px;
  border-top: 1px solid var(--color-divider);
}
.qedit__add .btn { min-height: 48px; padding: 0 10px; font-size: 15px; }
.qedit .qtotals__row span { transition: color .3s ease; }
.qedit .totals--flash .qtotals__row--total span:last-child { color: #236140; }

/* Conditions : libelle a gauche, petit champ a droite. Champs et unites de
   largeur fixe : les deux champs gardent la meme taille et restent alignes
   quels que soient l'unite (« % », « mois ») et le texte de la ligne. */
:is(.qedit, .sched-card) .advance-row {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 12px;
  margin: 0;
  padding: 12px 16px;
  font-weight: 400;
}
:is(.qedit, .sched-card) .advance-row + .advance-row, .qedit__check { border-top: 1px solid var(--color-divider); }
.advance-row__main { display: flex; flex-direction: column; gap: 2px; flex: 1; min-width: 0; }
:is(.qedit, .sched-card) .advance-row__label {
  font: 600 16px/1.3 var(--font-body);
  color: var(--color-text);
  text-transform: none;
  letter-spacing: 0;
}
:is(.qedit, .sched-card) .advance-row__text { font: 400 14px/1.35 var(--font-body); color: var(--color-text-muted); }
:is(.qedit, .sched-card) .advance-row__text strong { color: var(--color-text); font-weight: 600; }
.qedit__num { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
:is(.qedit, .sched-card) .advance-row__input {
  width: 80px;
  height: 48px;
  padding: 0 10px;
  border: 1.5px solid var(--color-border);
  border-radius: 12px;
  background: #F7F4EE;
  font: 600 18px var(--font-body);
  font-variant-numeric: tabular-nums;
}
:is(.qedit, .sched-card) .advance-row__input:focus {
  outline: none;
  border-color: var(--color-accent);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(201, 151, 29, .18);
}
.qedit__suffix { flex: 0 0 5em; white-space: nowrap; font: 500 15px var(--font-body); color: var(--color-text-muted); }
.qedit__check { margin: 0; padding: 8px 16px; font: 500 15px/1.35 var(--font-body); }

.qedit__refine #refine-btn { width: 100%; min-height: 48px; margin-top: 10px; }

/* Barre du bas : libelles longs sur deux lignes plutot que de deborder. */
.qedit .qbar .btn { padding: 0 12px; line-height: 1.2; white-space: normal; }
@media (min-width: 900px) {
  .qedit .qbar { justify-content: flex-end; }
  .qedit .qbar .btn { min-width: 210px; }
}

/* Fenetre catalogue et message de reussite. */
.qedit__modal .modal__content { border-radius: 16px; }
.qedit__modal .modal__header h3 { font: 600 18px var(--font-body); }
.qedit__modal .modal__close {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 0;
  border-radius: 10px;
  color: var(--color-text-muted);
}
.qedit__modal .modal__close svg { width: 20px; height: 20px; }
.success-toast--b {
  top: calc(var(--header-height) + 12px + env(safe-area-inset-top));
  width: max-content;
  max-width: calc(100% - 32px);
  padding: 12px 18px;
  border-radius: 12px;
  background: var(--color-header);
  color: #fff;
  font: 600 15px/1.35 var(--font-body);
  text-align: center;
  box-shadow: 0 8px 24px rgba(31, 28, 18, .2);
}
/* Echeancier : echeances entre l'acompte et le solde (formulaire du devis,
   echeancier par defaut de /account ; static/js/echeancier.js). Une
   echeance tient sur deux lignes : pourcentage, puis moment. */
.sched .advance-row { border-top: 1px solid var(--color-divider); }
/* Echeancier par defaut de /account : meme lignes, dans un cadre. */
.sched-card { border: 1px solid var(--color-divider); border-radius: 12px; }
:is(.qedit, .sched-card) .sched-row { flex-wrap: wrap; row-gap: 8px; }
.sched-row__when { display: flex; align-items: center; gap: 8px; flex: 1 0 100%; min-width: 0; }
.sched-row .sched-row__select {
  flex: 1 1 auto;
  min-width: 0;
  height: 48px;
  padding: 0 10px;
  font: 500 15px var(--font-body);
  text-overflow: ellipsis;
}
.sched-row__remove {
  display: grid;
  place-items: center;
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 0;
  border-radius: 12px;
  background: none;
  color: #A32626;
  cursor: pointer;
}
.sched-row__remove:hover, .sched-row__remove:focus-visible { background: #F7E2E0; }
.sched-error { margin: 0; padding: 8px 16px; color: #A32626; font: 600 14px/1.35 var(--font-body); }
.sched-add { padding: 10px 16px 12px; border-top: 1px solid var(--color-divider); }
.sched-add:has(> .btn[hidden]) { display: none; }
.sched-add .btn { width: auto; }

/* Objet du chantier (formulaires du devis et de la facture). */
.doc-subject { padding: 12px 16px; }
.doc-site { padding: 12px 16px; }
.doc-site__summary { cursor: pointer; min-height: 44px; display: flex; align-items: center; font: 600 15px/1.3 var(--font-body); }
.doc-site[open] .doc-site__summary { margin-bottom: 8px; }
/* Zone de texte d'une ligne qui grandit avec l'objet (fitSubject). */
.doc-subject .doc-subject__input { display: block; min-height: 44px; resize: none; overflow: hidden; line-height: 1.4; overflow-wrap: anywhere; }
/* ==== [devis] fin ==== */

/* ==== [clients-catalogue] debut ==== */
/* Liste des clients, fiche client, formulaires client, Mes articles, gestion
   des articles. Les classes .catalog-item / .icon-btn / .form-input servent
   aussi ailleurs (modales du devis, compte) : tout est borne a ces ecrans. */

/* ---- Liste des clients : ligne = lien vers la fiche + deux icones -------- */
.client-row {
  display: flex;
  align-items: center;
  background: #fff;
  font-family: var(--font-body);
}
.client-row + .client-row { border-top: 1px solid var(--color-divider); }
.client-row:not(.client-row--head):hover { background: var(--color-hover); }
.client-row.htmx-swapping { opacity: .4; transition: opacity .8s ease; }
.client-row__link {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 14px 4px 14px 16px;
  color: var(--color-text);
  text-decoration: none;
}
.client-row__name {
  font-size: 16px;
  font-weight: 600;
  line-height: 1.3;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.client-row__meta {
  font-size: 13px;
  color: var(--color-text-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.client-row__phone, .client-row__email, .client-row__city { display: none; }
.client-row__actions { display: flex; flex-shrink: 0; padding-right: 6px; }
.client-row__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 0;
  border-radius: 10px;
  background: none;
  color: var(--color-text-muted);
  cursor: pointer;
}
.client-row__btn svg { width: 18px; height: 18px; }
.client-row__btn:hover { background: #F3EFE6; color: var(--color-text); }
.client-row__btn--danger { color: #A32626; }
.client-row__btn--danger:hover { background: #F7E2E0; color: #A32626; }
.client-row__btn:focus-visible { outline: 2px solid var(--color-accent); outline-offset: -2px; }
.client-row--head { display: none; }
.client-extra { margin-top: 16px; }
/* Facture / encaisse : une ligne sous les coordonnees sur mobile, une colonne
   a deux montants sur ordinateur. Vert : tout est encaisse ; rouge : ecart. */
.client-row__billing {
  display: flex;
  flex-wrap: wrap;
  column-gap: 12px;
  font-size: 13px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.client-row__billing-item { white-space: nowrap; }
.client-row__billing-label { font-weight: 400; }
.client-row__billing--ok { color: #236140; }
.client-row__billing--gap { color: #A32626; }
.client-row__billing--none { display: none; color: var(--color-text-muted); }

/* Exporter / Importer le carnet : deux actions cote a cote. */
.client-extra--duo { display: flex; }
.client-extra--duo .action-row {
  flex: 1 1 0;
  min-width: 0;
  padding-top: 10px;
  padding-bottom: 10px;
  line-height: 1.3;
}
.client-extra--duo .action-row + .action-row { border-top: 0; border-left: 1px solid var(--color-divider); }
/* Mobile : icone au-dessus du libelle, deux lignes de texte au plus. */
@media (max-width: 599px) {
  .client-extra--duo .action-row {
    flex-direction: column;
    justify-content: center;
    gap: 6px;
    padding: 12px 10px;
    font-size: 15px;
    text-align: center;
  }
  .client-extra--duo .action-row > span { flex: none; }
}
.client-import__hint { margin: 8px 2px 0; font-size: 13px; line-height: 1.4; color: var(--color-text-muted); }
#client-import-overlay { margin: 16px 0 0; }
.client-import-panel:empty { display: none; }
.client-import-panel { margin-top: 16px; scroll-margin-top: calc(var(--header-height) + 12px); }
.client-import { overflow: hidden; }
.client-import__head { padding: 16px; border-bottom: 1px solid var(--color-divider); }
.client-import__title { margin: 0; font: 600 18px/1.3 var(--font-body); color: var(--color-text); }
.client-import__lead { margin: 4px 0 0; font-size: 14px; line-height: 1.45; color: var(--color-text-muted); }
.client-import__warn { margin: 8px 0 0; font-size: 14px; font-weight: 600; color: #A32626; }
.client-import__list { list-style: none; margin: 0; padding: 0; max-height: 420px; overflow-y: auto; }
.client-import__list li + li { border-top: 1px solid var(--color-divider); }
.client-import__row {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 52px;
  padding: 8px 16px;
  cursor: pointer;
}
.client-import__row:hover { background: var(--color-hover); }
.client-import__row input { width: 20px; height: 20px; flex-shrink: 0; accent-color: var(--color-accent); }
.client-import__text { display: flex; flex-direction: column; min-width: 0; }
.client-import__name { font-size: 15px; font-weight: 600; overflow-wrap: anywhere; }
.client-import__meta { font-size: 13px; color: var(--color-text-muted); overflow-wrap: anywhere; }
.client-import__actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 12px 16px;
  border-top: 1px solid var(--color-divider);
}
.client-import__actions .btn { width: auto; min-height: 44px; }
.client-import .cp-notice svg { width: 20px; height: 20px; flex-shrink: 0; }

@media (min-width: 900px) {
  .client-table .client-row__link {
    display: grid;
    grid-template-columns: minmax(0, 1.3fr) minmax(0, .8fr) minmax(0, 1.4fr) minmax(0, .8fr) minmax(0, 1fr);
    column-gap: 16px;
    align-items: center;
    padding: 12px 8px 12px 20px;
  }
  .client-table .client-row__meta { display: none; }
  .client-table .client-row__phone,
  .client-table .client-row__email,
  .client-table .client-row__city {
    display: block;
    font-size: 14px;
    color: var(--color-text-muted);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .client-table .client-row--head {
    display: flex;
    border-bottom: 1px solid var(--color-divider);
  }
  .client-table .client-row--head .client-row__link > span {
    font: 600 12px/1.2 var(--font-body);
    letter-spacing: .06em;
    text-transform: uppercase;
    color: var(--color-text-muted);
  }
  .client-table .client-row--head .client-row__actions { width: 94px; }
  .client-table .client-row__billing {
    flex-direction: column;
    align-items: center;
    row-gap: 1px;
    font-size: 14px;
    text-align: center;
  }
  .client-table .client-row__billing--none { display: flex; font-weight: 400; }
  .client-table .client-row--head .client-row__billing { display: block; }
  /* Libelles lus par les lecteurs d'ecran, le titre de colonne suffit a l'oeil. */
  .client-table .client-row__billing-label {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
  }
}

/* ---- Formulaires client (creation, modification) -------------------------- */
.client-form { display: flex; flex-direction: column; gap: 16px; max-width: 640px; }
.client-form__card { padding: 16px 16px 0; }
.client-form .form-group { margin-bottom: 16px; min-width: 0; }
.client-form .form-label,
.catalog-add .form-label,
.catalog-manage__field .form-label {
  margin: 0 0 6px;
  font: 600 14px/1.3 var(--font-body);
  letter-spacing: 0;
  text-transform: none;
  color: var(--color-text-muted);
}
.client-form .form-input,
.catalog-add .form-input,
.catalog-manage-page .catalog-manage__client-form .form-input {
  height: 48px;
  padding: 0 14px;
  border-radius: 10px;
  box-shadow: none;
  font: 400 16px var(--font-body);
}
.client-form__pair { display: grid; grid-template-columns: minmax(0, 1fr); column-gap: 12px; }
.client-form__place { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); column-gap: 12px; }
.client-form__submit { min-height: 50px; }
/* Notes diverses : plusieurs lignes, hauteur ajustable. */
.client-form textarea.client-form__notes {
  height: auto;
  min-height: 96px;
  padding: 12px 14px;
  line-height: 1.45;
  resize: vertical;
}
.client-form + .client-extra { max-width: 640px; }

@media (min-width: 600px) {
  .client-form__pair { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* Dictee de la fiche : carte encre, comme la carte « Dicter » de l'accueil. */
.client-form .voice-box {
  margin: 0;
  min-height: 0;
  padding: 16px;
  gap: 14px;
  border: 0;
  border-radius: 16px;
  background: var(--color-header);
  box-shadow: none;
}
.client-form .voice-box:hover { background: #2C2A20; }
.client-form .voice-box__icon-wrap {
  width: 52px;
  height: 52px;
  min-width: 52px;
  background: var(--color-accent);
  color: var(--color-header);
}
.client-form .voice-box__icon-wrap svg { width: 24px; height: 24px; }
.client-form__voice-text { min-width: 0; }
.client-form .voice-box__title { font: 600 17px/1.25 var(--font-body); color: #fff; }
.client-form .voice-box__subtitle { margin-top: 3px; font: 400 14px/1.35 var(--font-body); color: #C4BAA3; }
.client-form .voice-box--recording { background: #2A1A16; }
.client-form .voice-box--recording .voice-box__icon-wrap { background: #C4453C; color: #fff; }
.client-form .voice-box--recording .voice-box__title { color: #F2A29A; }

/* ---- Fiche client ---------------------------------------------------------- */
.client-hero__contacts { list-style: none; margin: 8px 0 0; padding: 0; }
.client-hero__contacts li {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  color: #E8E1D2;
  font-size: 15px;
}
.client-hero__contacts a {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  min-height: 44px;
  color: inherit;
  text-decoration: none;
}
.client-hero__contacts a:hover span { text-decoration: underline; }
.client-hero__contacts span { min-width: 0; overflow-wrap: anywhere; }
.client-hero__contacts svg { width: 18px; height: 18px; color: #C4BAA3; flex-shrink: 0; }
.client-hero__empty { margin: 8px 0 0; font-size: 14px; color: #C4BAA3; }
.client-hero__empty a { color: #D9A227; font-weight: 600; }
.client-hero__notes {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: 8px 0 0;
  color: #E8E1D2;
  font-size: 15px;
  line-height: 1.45;
}
.client-hero__notes span { min-width: 0; overflow-wrap: anywhere; white-space: pre-line; }
.client-hero__notes svg { width: 18px; height: 18px; margin-top: 2px; color: #C4BAA3; flex-shrink: 0; }
.client-kpis .kpi:hover { background: none; }
/* Deux actions de meme largeur : « Nouveau devis » ne passe plus sur deux lignes. */
@media (max-width: 899px) {
  .client-fiche .qbar .btn { flex: 1 1 0; min-width: 0; padding-left: 12px; padding-right: 12px; }
}
.client-kpis .kpi__value { font-size: 22px; white-space: normal; }
.client-kpis .client-kpis__due { color: #A32626; }

@media (min-width: 900px) {
  .client-kpis .kpi { padding: 16px 18px; }
  .client-kpis .kpi__value { font-size: 24px; }
}

/* ---- Mes articles : catalogue a gauche, remplissage a droite -------------- */
.catalog-b { display: flex; flex-direction: column; gap: 24px; }
.catalog-add {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 16px;
  background: var(--color-hover);
  border-bottom: 1px solid var(--color-divider);
}
.catalog-add__fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.catalog-add__field { min-width: 0; }
.catalog-add__field--name { grid-column: 1 / -1; }
.catalog-add .form-input { width: 100%; background-color: #fff; }
.catalog-add__hint { margin: 0; font: 400 13px/1.35 var(--font-body); color: var(--color-text-muted); }
.catalog-add__buttons { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.catalog-add__buttons .btn { min-height: 48px; }
.catalog-add .catalog-form__error { margin: 0; }

@media (min-width: 600px) {
  .catalog-add__fields { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr) minmax(0, 1fr); }
  .catalog-add__field--name { grid-column: auto; }
  .catalog-add__buttons { display: flex; justify-content: flex-end; }
  .catalog-add__buttons .btn { width: auto; min-width: 150px; }
}

@media (min-width: 900px) {
  .catalog-b {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 340px;
    align-items: start;
    max-width: 1120px;
  }
}

/* Lignes d'articles (Mes articles et colonne « Catalogue existant »). */
.card-b .catalog-item {
  margin: 0;
  border: 0;
  border-radius: 0;
  background: #fff;
}
.card-b .catalog-item + .catalog-item { border-top: 1px solid var(--color-divider); }
.card-b .catalog-item__view { padding: 10px 8px 10px 16px; gap: 8px; border-bottom: 0; }
.card-b .catalog-item__main { gap: 3px; }
.card-b .catalog-item__name {
  font: 600 16px/1.3 var(--font-body);
  color: var(--color-text);
  overflow-wrap: anywhere;
}
.card-b .catalog-item__meta { gap: 4px 8px; margin: 0; font: 400 14px/1.3 var(--font-body); }
.card-b .catalog-item__price { font-weight: 600; color: var(--color-text); }
.card-b .catalog-item__unit-pill {
  display: inline;
  height: auto;
  margin-left: -4px;
  padding: 0;
  border: 0;
  background: none;
  font: 400 14px/1.3 var(--font-body);
  letter-spacing: 0;
  text-transform: none;
  color: var(--color-text-muted);
}
.card-b .catalog-item__actions { gap: 0; flex-shrink: 0; }
.card-b .icon-btn {
  width: 44px;
  height: 44px;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 10px;
  background: none;
  box-shadow: none;
  color: var(--color-text-muted);
  transform: none;
}
.card-b .icon-btn svg { width: 20px; height: 20px; }
.card-b .icon-btn:hover { background: #F3EFE6; color: var(--color-text); transform: none; }
.card-b .icon-btn--delete { color: #A32626; }
.card-b .icon-btn--delete:hover { background: #F7E2E0; color: #A32626; }
.card-b .icon-btn:focus-visible { outline: 2px solid var(--color-accent); outline-offset: -2px; }
.card-b .catalog-empty { margin: 0; padding: 16px; font: 400 15px var(--font-body); color: var(--color-text-muted); }

/* Edition en ligne d'un article (le JS bascule l'affichage en flex). */
.card-b .catalog-item__edit { gap: 12px; padding: 12px 16px 16px; border-radius: 0; background: var(--color-hover); }
.card-b .catalog-item__edit-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px 12px;
}
.catalog-item__field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
  font: 600 14px/1.3 var(--font-body);
  color: var(--color-text-muted);
}
.catalog-item__field--name { grid-column: 1 / -1; }
.card-b .catalog-item__field input,
.card-b .catalog-item__field select {
  flex: none;
  width: 100%;
  min-width: 0;
  max-width: none;
  height: 48px;
  min-height: 48px;
  padding: 0 12px;
  border: 1.5px solid var(--color-border);
  border-radius: 10px;
  background: #fff;
  font: 400 16px var(--font-body);
  color: var(--color-text);
}
.card-b .catalog-item__field input:focus,
.card-b .catalog-item__field select:focus,
.catalog-manage-page .catalog-manage-row input:focus,
.catalog-manage-page .catalog-manage-row select:focus {
  outline: none;
  border-color: var(--color-accent);
  box-shadow: 0 0 0 3px rgba(201, 151, 29, .18);
}
.catalog-item__edit-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.card-b .btn-save-edit,
.card-b .btn-cancel-edit {
  width: 100%;
  min-height: 48px;
  border-radius: 12px;
  font: 600 16px var(--font-body);
  letter-spacing: 0;
  text-transform: none;
}
.card-b .btn-save-edit { background: var(--color-header); border: 1px solid var(--color-header); color: #fff; }
.card-b .btn-save-edit:hover { background: #2C2A20; border-color: #2C2A20; }
.card-b .btn-cancel-edit { background: #fff; border: 1px solid #CFC5B0; color: var(--color-text); }
.card-b .btn-cancel-edit:hover { background: #fff; border-color: var(--color-accent-text); color: var(--color-text); }

@media (min-width: 600px) {
  .catalog-b__main .catalog-item__edit-fields { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr) minmax(0, 1fr); }
  .catalog-b__main .catalog-item__field--name { grid-column: auto; }
  .catalog-item__edit-actions { display: flex; justify-content: flex-end; }
  .card-b .catalog-item__edit-actions button { width: auto; min-width: 140px; }
}

/* Remplir le catalogue : catalogue de base et import d'un ancien document. */
.catalog-base-link { min-height: 64px; padding-top: 10px; padding-bottom: 10px; }
.catalog-base-link > span { display: flex; flex-direction: column; gap: 2px; line-height: 1.25; }
.catalog-base-link small { font-size: 13px; color: var(--color-text-muted); }
.catalog-photo-link { border-top: 1px solid var(--color-divider); }
.catalog-base-picker > summary { list-style: none; }
.catalog-base-picker > summary::-webkit-details-marker { display: none; }
.catalog-base-picker > summary > .action-row__chevron { transition: transform .15s; }
.catalog-base-picker[open] > summary > .action-row__chevron { transform: rotate(90deg); }
.catalog-base-picker__list { margin: 0; padding: 0; list-style: none; border-top: 1px solid var(--color-divider); }
.catalog-base-picker__list li + li { border-top: 1px solid var(--color-divider); }
.catalog-base-picker__item { min-height: 48px; padding-left: 50px; font-size: 15px; }
.catalog-import {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 16px;
  border-top: 1px solid var(--color-divider);
}
.catalog-import .dropzone {
  margin: 0;
  border: 1.5px dashed #CFC5B0;
  border-radius: 12px;
  background: var(--color-hover);
  box-shadow: none;
}
.catalog-import .dropzone:hover,
.catalog-import .dropzone--hover { border-color: var(--color-accent); background: #FBF1D4; }
.catalog-import .dropzone:focus-visible { outline: 2px solid var(--color-accent); outline-offset: 2px; }
.catalog-import .dropzone__inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 20px 16px;
  text-align: center;
}
.catalog-import .dropzone__icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  margin: 0;
  border-radius: 12px;
  background: #FBF1D4;
  color: var(--color-accent-text);
  opacity: 1;
  font-size: 0;
}
.catalog-import .dropzone__icon svg { width: 22px; height: 22px; }
.catalog-import .dropzone__title { font: 600 16px/1.3 var(--font-body); color: var(--color-text); }
.catalog-import .dropzone__subtitle { margin: 0; font: 400 13px/1.35 var(--font-body); color: var(--color-text-muted); }
.catalog-import__hint { margin: 0; font: 400 13px/1.4 var(--font-body); color: var(--color-text-muted); }
.catalog-import .catalog-form__error { margin: 0; }
#import-preview-zone:empty { display: none; }

/* ---- Gestion des articles (import, catalogue de base) --------------------- */
.catalog-manage-page .catalog-manage-intro { margin: 4px 0 0; font: 500 14px/1.45 var(--font-body); }
.catalog-manage-page .catalog-manage-intro strong { color: var(--color-text); }
.catalog-manage-page .qbar { margin: 0 0 16px; flex-wrap: nowrap; }
@media (max-width: 899px) {
  .catalog-manage-page .qbar .btn { min-width: 0; }
  .catalog-manage-page .qbar .qbar__main { flex-grow: 2; }
}
.catalog-manage-page .form-error { margin: 0 0 16px; }
.catalog-manage-page .catalog-manage { gap: 24px; margin: 0; }
.catalog-manage-page .catalog-manage__col {
  padding: 0;
  border: 0;
  border-radius: 0;
  background: none;
  overflow: visible;
}
.catalog-manage-page .catalog-manage__col h2 {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin: 0 0 10px;
  font: 600 13px/1.2 var(--font-body);
  letter-spacing: .08em;
  color: var(--color-text-muted);
}
.catalog-manage-page .counter { font: 500 13px var(--font-body); letter-spacing: 0; }
.catalog-manage-page .catalog-manage-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 100px) 44px;
  gap: 8px;
  align-items: center;
  margin: 0;
  padding: 12px 8px 12px 16px;
  border: 0;
  border-radius: 0;
  background: #fff;
}
.catalog-manage-page .catalog-manage-row + .catalog-manage-row { border-top: 1px solid var(--color-divider); }
.catalog-manage-page .catalog-manage-row .cm-name { grid-column: 1 / -1; margin-right: 8px; }
.catalog-manage-page .catalog-manage-row input,
.catalog-manage-page .catalog-manage-row select {
  width: 100%;
  max-width: none;
  min-width: 0;
  height: 48px;
  padding: 0 12px;
  border: 1.5px solid var(--color-border);
  border-radius: 10px;
  background: #fff;
  font: 400 16px var(--font-body);
  color: var(--color-text);
}
.catalog-manage-page .catalog-manage-row .cm-price { text-align: right; font-variant-numeric: tabular-nums; }
.catalog-manage__danger { margin-top: 24px; }

/* Remarques de l'IA sur la lecture du document importe. */
.catalog-manage-page .catalog-manage__notes { margin: 0 0 16px; align-items: flex-start; font-weight: 400; }
.catalog-manage-page .catalog-manage__notes svg { width: 20px; height: 20px; flex-shrink: 0; margin-top: 1px; color: var(--color-accent-text); }

/* Encart « Nouveau client detecte » apres import d'un document. */
.catalog-manage-page .catalog-manage__client-card {
  margin: 0 0 16px;
  padding: 16px;
  border: 0;
  border-radius: 16px;
  background: #fff;
}
.catalog-manage__client-title { margin: 0; font: 600 17px/1.3 var(--font-body); text-transform: none; letter-spacing: 0; }
.catalog-manage__client-intro { margin: 4px 0 14px; font: 400 14px/1.4 var(--font-body); color: var(--color-text-muted); }
.catalog-manage__client-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; }
.catalog-manage__field { display: flex; flex-direction: column; min-width: 0; }
.catalog-manage-page .catalog-manage__client-form .form-input { width: 100%; border: 1.5px solid var(--color-border); }
.catalog-manage-page .catalog-manage__client-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 14px;
}
.catalog-manage-page .catalog-manage__client-actions .btn { min-height: 48px; }
.catalog-manage-page .catalog-manage__client-card--match {
  padding: 14px 16px;
  background: #E7F2EA;
  color: #236140;
  font: 400 15px/1.4 var(--font-body);
}

@media (min-width: 600px) {
  .catalog-manage__client-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .catalog-manage__field--wide { grid-column: 1 / -1; }
  .catalog-manage-page .catalog-manage__client-actions { display: flex; justify-content: flex-end; }
  .catalog-manage-page .catalog-manage__client-actions .btn { width: auto; min-width: 150px; }
}

@media (min-width: 900px) {
  .catalog-manage-page .qbar { padding: 0; border: 0; }
  .catalog-manage-page .catalog-manage__client-card,
  .catalog-manage-page .catalog-manage__notes { max-width: 760px; }
}

/* ==== [clients-catalogue] fin ==== */

/* ==== [compte-pilotage] debut ==== */
/* Compte, comptabilite, statistiques, premiers pas, conflits, connexion,
   page client publique, administration, modale d'avis. Styles propres a une
   seule page : dans le <style> de son template (accounting, statistics,
   admin, admin_feedback). */

/* ---- Pile de sections ------------------------------------------------------ */
.cp { display: flex; flex-direction: column; gap: 20px; }
.cp > .page-head { margin-bottom: 0; }
.cp-section { display: flex; flex-direction: column; min-width: 0; }
.cp-section > .section-label, .cp-section > .section-head { margin-bottom: 10px; }
.card-b--pad { padding: 16px; }
.cp-lead { margin: 0; font: 400 15px/1.45 var(--font-body); color: var(--color-text-muted); }
@media (min-width: 900px) {
  .cp--narrow { max-width: 760px; }
  .cp--wide { max-width: 1120px; }
  .card-b--pad { padding: 20px 22px; }
}

/* Encadre d'information : pastille + phrase (jours gratuits, succes, erreur). */
.cp-notice {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  font: 500 15px/1.4 var(--font-body);
  color: var(--color-text);
}
.cp-notice p { margin: 0; }
.cp-notice a { color: var(--color-accent-text); font-weight: 600; }
.cp-notice--ok { background: #E4F1E8; color: #1F5537; }
.cp-notice--error { background: #F7E2E0; color: #A32626; }
.tint--green { background: #E4F1E8; color: #236140; }

/* Vide avec coche (aucun conflit, rien a faire). */
.cp-empty {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  padding: 16px;
  font: 400 15px/1.4 var(--font-body);
  color: var(--color-text-muted);
}
.cp-empty svg { width: 18px; height: 18px; color: #236140; flex-shrink: 0; }

/* Action destructive discrete : texte rouge, sans cadre. */
.btn--quiet-danger {
  width: auto;
  min-height: 44px;
  padding: 0 10px;
  background: none;
  border-color: transparent;
  color: #A32626;
}
.btn--quiet-danger:hover { background: #F7E2E0; border-color: #F7E2E0; color: #A32626; }

/* ---- Formulaires version B : libelle au-dessus, champ de 48 px -------------- */
.form-b .form-group { margin: 0 0 18px; }
.form-b .form-group:last-child { margin-bottom: 0; }
.form-b .form-label {
  display: block;
  margin: 0 0 6px;
  font: 600 14px/1.3 var(--font-body);
  letter-spacing: 0;
  text-transform: none;
  color: var(--color-text-muted);
}
.form-b .form-input {
  width: 100%;
  min-height: 48px;
  padding: 10px 14px;
  border: 1px solid #CFC5B0;
  border-radius: 12px;
  background-color: #fff;
  box-shadow: none;
  font: 400 16px/1.4 var(--font-body);
  color: var(--color-text);
}
.form-b .form-input::placeholder { color: #6E6552; }
.form-b .form-input:focus {
  outline: none;
  border-color: var(--color-accent);
  box-shadow: 0 0 0 3px rgba(201, 151, 29, .18);
}
.form-b .form-input:disabled { background-color: #F3EFE6; color: var(--color-text-muted); }
.form-b textarea.form-input { min-height: 120px; line-height: 1.45; }
.form-b select.form-input {
  appearance: none;
  -webkit-appearance: none;
  padding-right: 42px;
  background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%235E5645' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") no-repeat right 14px center / 18px;
}
.form-b .form-hint {
  display: block;
  margin: 6px 0 0;
  font: 400 13px/1.4 var(--font-body);
  color: var(--color-text-muted);
}
.form-b .form-row { display: grid; grid-template-columns: minmax(0, 1fr); gap: 18px 12px; margin: 0 0 18px; }
.form-b .form-row:last-child { margin-bottom: 0; }
.form-b .form-row > .form-group { margin: 0; }
.form-b .account-field--fixed { width: 100%; max-width: 360px; }
.form-b .account-field--no-spin { width: 140px; }
.form-b .form-group--checkbox { margin-bottom: 18px; }
.form-b .form-checkbox {
  align-items: flex-start;
  gap: 12px;
  padding: 10px 0;
  font: 500 15px/1.4 var(--font-body);
  color: var(--color-text);
}
.form-b .form-checkbox input[type="checkbox"] {
  width: 24px;
  height: 24px;
  margin: -1px 0 0;
  border: 2px solid #CFC5B0;
  border-radius: 6px;
}
.form-b .form-checkbox input[type="checkbox"]:checked {
  background: var(--color-accent);
  border-color: var(--color-accent);
}
.form-b .form-checkbox input[type="checkbox"]:checked::after { left: 6px; top: 2px; border-color: var(--color-header); }
.form-b .btn--block { display: flex; min-height: 52px; }
.form-b .form-error, .login-card .form-error {
  margin: 0 0 16px;
  padding: 12px 14px;
  border: 0;
  border-radius: 12px;
  background: #F7E2E0;
  color: #A32626;
  font: 500 15px/1.4 var(--font-body);
}
@media (min-width: 600px) {
  .form-b .form-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* ---- Mon compte ------------------------------------------------------------ */
.acct-save {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 2px 0 0;
  font: 500 14px/1.4 var(--font-body);
  color: var(--color-text-muted);
}
.form-b .acct-intro { margin: 0 0 16px; font-size: 14px; }
.acct-email-password { margin-top: 12px; }
.acct-email-change { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin-top: 10px; }
.acct-email-change .btn { width: auto; min-height: 44px; }
.form-b .acct-email-change .form-hint { flex: 1 1 200px; margin: 0; }
.form-b .acct-metier-status { margin-top: 10px; }
/* Lien « Autre métier » de Mes articles (/account#corps-de-metier) : titre sous l'en-tête fixe. */
.acct-metiers { scroll-margin-top: calc(var(--header-height) + 12px); }
.acct-logo { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.acct-logo #logo-preview-zone { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.acct-logo #logo-preview-zone:not(:has(*)) { display: none; }
.form-b .logo-preview { max-width: 180px; max-height: 80px; margin: 0; border-radius: 10px; }
.acct-logo #logo-trigger { width: auto; min-height: 44px; }
.form-b .metier-buttons {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 10px;
}
.form-b .metier-btn {
  min-height: 48px;
  padding: 0 12px;
  border: 1px solid #CFC5B0;
  border-radius: 12px;
  background: #fff;
  color: var(--color-text);
  font: 600 15px/1.2 var(--font-body);
}
.form-b .metier-btn:hover { border-color: var(--color-accent-text); }
.form-b .metier-btn--active,
.form-b .metier-btn--active:hover {
  background: var(--color-accent);
  border-color: var(--color-accent);
  color: var(--color-header);
}
.form-b .metier-btn--general { background: #F3EFE6; border-color: #F3EFE6; font-style: normal; }
@media (min-width: 600px) {
  .form-b .metier-buttons { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

/* ---- Conflits de synchronisation (cartes construites par le script) -------- */
.sc-list { display: flex; flex-direction: column; gap: 16px; }
.sc-card { font-family: var(--font-body); }
.sc-card__head { padding: 14px 16px 12px; border-bottom: 1px solid var(--color-divider); }
.sc-card__title { font-size: 17px; font-weight: 600; color: var(--color-text); }
.sc-card__id { margin-top: 2px; font-size: 13px; color: var(--color-text-muted); overflow-wrap: anywhere; }
.sc-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; padding: 16px; }
.sc-version__title { font-size: 15px; font-weight: 600; color: var(--color-text); }
.sc-version__meta { margin-top: 2px; font-size: 13px; color: var(--color-text-muted); }
.sc-version__data {
  max-height: 240px;
  margin: 8px 0 0;
  padding: 10px 12px;
  overflow: auto;
  border-radius: 10px;
  background: #F7F4EE;
  font-size: 13px;
  line-height: 1.45;
  white-space: pre-wrap;
  word-break: break-word;
}
.sc-actions { display: flex; flex-wrap: wrap; gap: 10px; padding: 0 16px 16px; }
.sc-actions .btn { flex: 1 1 200px; width: auto; min-height: 48px; }
@media (min-width: 700px) {
  .sc-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .sc-actions { justify-content: flex-end; }
  .sc-actions .btn { flex: 0 0 auto; }
}

/* ---- Chiffres cles a nombre variable (statistiques 6, administration 5) ----
   Filets par l'ecart de 1 px de la grille : aucun calcul de bordure. */
.kpis--grid { gap: 1px; background: var(--color-divider); }
.kpis--grid .kpi,
.kpis--grid .kpi:nth-child(odd),
.kpis--grid .kpi:nth-child(-n+2),
.kpis--grid .kpi + .kpi { border-width: 0; background: #fff; }
.kpis--grid a.kpi:hover { background: var(--color-hover); }
.kpis--grid .kpi:last-child:nth-child(odd) { grid-column: 1 / -1; }
.kpis--grid .kpi__value { font-size: 22px; }
.kpi__sub { font: 400 13px/1.35 var(--font-body); color: var(--color-text-muted); }
.kpi__delta { display: inline-flex; align-items: center; gap: 2px; font-weight: 600; }
.kpi__delta svg { width: 14px; height: 14px; }
.kpi__delta--up { color: #236140; }
.kpi__delta--down { color: #A32626; }
@media (min-width: 900px) {
  .kpis--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .kpis--5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
  .kpis--grid .kpi:last-child:nth-child(odd) { grid-column: auto; }
  .kpis--grid .kpi__value { font-size: 28px; }
}

/* ---- Connexion et inscription : carte centree, sans menu ------------------- */
.login-page { min-height: calc(100dvh - var(--header-height) - 40px); padding: 8px 0; }
.login-card {
  max-width: 420px;
  border: 0;
  border-radius: 16px;
  box-shadow: 0 1px 2px rgba(31, 28, 18, .08), 0 8px 24px rgba(31, 28, 18, .08);
}
.login-card__header { padding: 28px 24px 0; background: #fff; text-align: center; }
.login-card__mark { display: block; width: 56px; height: 56px; margin: 0 auto 14px; border-radius: 14px; }
.login-card__title.page-title { color: var(--color-text); letter-spacing: .01em; }
.login-card__subtitle { margin: 6px 0 0; font: 500 15px/1.4 var(--font-body); color: var(--color-text-muted); }
.login-card__body { padding: 22px 24px 20px; }
.login-card .btn--google {
  min-height: 48px;
  border: 1px solid #CFC5B0;
  border-radius: 12px;
  background: #fff;
  color: var(--color-text);
  font: 600 16px var(--font-body);
  box-shadow: none;
}
.login-card .auth-divider { margin: 18px 0; font: 500 14px var(--font-body); color: var(--color-text-muted); }
.login-card .auth-card__footer { margin: 16px 0 0; padding: 0; text-align: center; font: 400 15px/1.5 var(--font-body); color: var(--color-text-muted); }
.login-card .auth-card__footer a { color: var(--color-accent-text); font-weight: 600; text-decoration: none; }
.login-card .auth-card__footer a:hover { text-decoration: underline; }
.login-card .auth-card__footer--legal { margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--color-divider); font-size: 13px; }
.login-card .auth-card__footer--legal a { color: var(--color-text-muted); font-weight: 500; text-decoration: underline; }

/* ---- Page client publique (/q/<jeton>) --------------------------------------- */
.pq { display: flex; flex-direction: column; gap: 16px; }
.pq .qhero { margin-bottom: 0; }
.pq-hero__for { margin-top: 10px; font-size: 15px; color: #E8E1D2; }
.pq-hero__call {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  margin-top: 10px;
  padding: 0 14px;
  border-radius: 12px;
  background: #2C2A20;
  color: #F4EDE3;
  font: 600 15px var(--font-body);
  text-decoration: none;
}
.pq-hero__call:hover { background: #3A382D; }
.pq-hero__call svg { width: 18px; height: 18px; color: #D9A227; }
.pq-accept .btn--primary { width: 100%; min-height: 52px; margin-top: 8px; font-size: 17px; }
/* Refus du client : discret sous l'accord, confirmation depliee. */
.pq-reject { margin-top: 12px; overflow: hidden; }
.pq-reject summary { list-style: none; }
.pq-reject summary::-webkit-details-marker { display: none; }
.pq-reject__form { padding: 4px 16px 16px; }
.pq-reject__form p { margin: 0 0 12px; font-size: 15px; line-height: 1.45; color: var(--color-text-muted); }
.pq-accept .form-hint { margin-top: 12px; }
.pq-accord > svg { color: #236140; }
@media (min-width: 900px) {
  .pq { max-width: 640px; margin: 0 auto; }
}

/* ---- Modale d'avis ----------------------------------------------------------- */
.feedback-modal { border-radius: 16px; }
.feedback-modal form { padding: 18px 20px 20px; }
.feedback-modal__header { gap: 12px; margin-bottom: 14px; }
.feedback-modal__header h2 {
  font: 600 19px/1.3 var(--font-body);
  text-transform: none;
  letter-spacing: 0;
  color: var(--color-text);
}
.feedback-modal__close {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  margin: -8px -10px -8px 0;
  padding: 0;
  border-radius: 10px;
  flex-shrink: 0;
}
.feedback-modal__close:hover { background: #F3EFE6; color: var(--color-text); }
.feedback-modal__close svg { width: 22px; height: 22px; }
.feedback-types { gap: 8px; }
.feedback-type {
  position: relative;
  min-height: 44px;
  padding: 0 16px;
  border: 1px solid #CFC5B0;
  font: 600 15px var(--font-body);
}
.feedback-type input { position: absolute; opacity: 0; pointer-events: none; }
.feedback-type:has(input:focus-visible) { outline: 2px solid var(--color-accent); outline-offset: 2px; }
.feedback-type:has(input:checked) {
  background: var(--color-accent);
  border-color: var(--color-accent);
  color: var(--color-header);
}
.feedback-modal__thanks h2 { font: 600 19px/1.3 var(--font-body); }

/* ---- Bandeau d'impersonation ------------------------------------------------- */
.impersonation-banner { background: #A32626; box-shadow: none; font-family: var(--font-body); }
.impersonation-banner__inner { gap: 8px 16px; font-size: 15px; }
.impersonation-banner__inner > svg { width: 18px; height: 18px; flex-shrink: 0; }
.impersonation-banner__quit {
  width: auto;
  min-height: 40px;
  padding: 0 14px;
  border-radius: 10px;
  color: #A32626;
  font: 600 14px var(--font-body);
}
/* ---- Notifications de la cloche (/account#notifications) -------------------
   Tableau des types recus, puis reglette des heures calmes (journee de 24 h,
   heures calmes en encre). Sous 600 px, chaque ligne s'empile : libelle et
   moment a gauche, case a droite. */
.acct-notifs { scroll-margin-top: calc(var(--header-height) + 12px); }
.cp .notif-prefs { width: 100%; border-collapse: collapse; font-family: var(--font-body); }
.cp .notif-prefs th,
.cp .notif-prefs td { padding: 10px 8px; border-bottom: 1px solid #D6CCB7; text-align: center; vertical-align: middle; }
.cp .notif-prefs thead th { font: 600 12px/1.2 var(--font-body); letter-spacing: .06em; text-transform: uppercase; color: var(--color-text-muted); }
.cp .notif-prefs tbody tr:last-child > * { border-bottom: 0; }
.cp .notif-prefs__label { font: 600 15px/1.35 var(--font-body); color: var(--color-text); }
.cp .notif-prefs__label label { cursor: pointer; }
.cp .notif-prefs__when { font: 400 14px/1.4 var(--font-body); color: var(--color-text-muted); }
.cp .notif-pref {
  appearance: none;
  -webkit-appearance: none;
  position: relative;
  display: block;
  width: 24px;
  height: 24px;
  margin: 0 auto;
  border: 2px solid #CFC5B0;
  border-radius: 6px;
  background: #fff;
  cursor: pointer;
}
/* Titre centre au-dessus de sa colonne : la fleche du tri sort du calcul. */
.cp .notif-prefs thead .sort-head { position: relative; }
.cp .notif-prefs thead .sort-head__arrow { position: absolute; left: calc(100% - 2px); }
.cp .notif-pref:checked { background: var(--color-accent); border-color: var(--color-accent); }
.cp .notif-pref:checked::after {
  content: "";
  position: absolute;
  left: 6px;
  top: 2px;
  width: 6px;
  height: 11px;
  border: solid var(--color-header);
  border-width: 0 2.5px 2.5px 0;
  transform: rotate(45deg);
}
.cp .notif-pref:focus-visible { outline: 2px solid #6B4D0B; outline-offset: 2px; }
@media (max-width: 599px) {
  .cp .notif-prefs thead { display: none; }
  .cp .notif-prefs tbody tr {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas: "label check" "when check";
    align-items: center;
    column-gap: 12px;
    padding: 10px 0;
    border-bottom: 1px solid #D6CCB7;
  }
  .cp .notif-prefs tbody tr:last-child { border-bottom: 0; }
  .cp .notif-prefs th,
  .cp .notif-prefs td { padding: 0; border: 0; text-align: left; }
  .cp .notif-prefs__label { grid-area: label; }
  .cp .notif-prefs__when { grid-area: when; font-size: 13px; }
  .cp .notif-prefs__check { grid-area: check; display: flex; align-items: center; justify-content: center; min-width: 44px; min-height: 44px; }
}
.cp .quiet {
  --quiet-awake: #EAE4D6;
  margin: 22px 0 0;
  padding: 18px 0 0;
  border: 0;
  border-top: 1px solid #D6CCB7;
}
.cp .quiet legend { float: left; width: 100%; margin: 0 0 4px; padding: 0; }
.cp .quiet .form-checkbox { clear: both; }
/* Reglette des heures calmes : un seul rail de midi a midi, un bouton par
   bout de la zone ambre (debut a gauche, fin a droite). Les champs range
   gardent la valeur et le clavier ; le glisser passe par le script
   (account.html), d'ou pointer-events: none sur les champs. --a et --b :
   positions 0 a 24 des deux boutons. */
.cp .quiet__values { display: flex; justify-content: space-between; gap: 12px; margin-top: 6px; font: 600 15px/1.4 var(--font-body); color: var(--color-text); }
.cp .quiet__values output { margin-left: 4px; font-variant-numeric: tabular-nums; color: var(--color-accent-text); }
.cp .quiet__slider {
  --thumb: 26px;
  position: relative;
  height: 44px;
  margin-top: 4px;
  touch-action: none;
  cursor: pointer;
}
.cp .quiet__track {
  position: absolute;
  top: 50%;
  left: calc(var(--thumb) / 2);
  right: calc(var(--thumb) / 2);
  height: 10px;
  transform: translateY(-50%);
  border-radius: 5px;
  background: var(--quiet-awake);
  box-shadow: inset 0 0 0 1px rgba(22, 22, 15, .16);
}
.cp .quiet__fill {
  position: absolute;
  top: 0;
  bottom: 0;
  left: calc(100% * var(--a) / 24);
  right: calc(100% * (24 - var(--b)) / 24);
  border-radius: 5px;
  background: var(--color-accent);
}
.cp .quiet__thumb {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  background: none;
  pointer-events: none;
  appearance: none;
  -webkit-appearance: none;
}
.cp .quiet__thumb::-webkit-slider-runnable-track { height: 100%; background: none; }
.cp .quiet__thumb::-moz-range-track { background: none; }
.cp .quiet__thumb::-webkit-slider-thumb {
  width: var(--thumb);
  height: var(--thumb);
  margin-top: calc((44px - var(--thumb)) / 2);
  border: 3px solid var(--color-accent);
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(22, 22, 15, .3);
  appearance: none;
  -webkit-appearance: none;
}
.cp .quiet__thumb::-moz-range-thumb {
  box-sizing: border-box;
  width: var(--thumb);
  height: var(--thumb);
  border: 3px solid var(--color-accent);
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(22, 22, 15, .3);
}
.cp .quiet__thumb:focus-visible { outline: none; }
.cp .quiet__thumb:focus-visible::-webkit-slider-thumb { box-shadow: 0 0 0 3px #6B4D0B; }
.cp .quiet__thumb:focus-visible::-moz-range-thumb { box-shadow: 0 0 0 3px #6B4D0B; }
.cp .quiet__ticks { position: relative; height: 16px; margin-top: 2px; font: 400 13px/16px var(--font-body); color: var(--color-text-muted); font-variant-numeric: tabular-nums; }
.cp .quiet__ticks span {
  position: absolute;
  left: calc(13px + (100% - 26px) * var(--p) / 24);
  transform: translateX(-50%);
  white-space: nowrap;
}
.cp .quiet .form-hint { margin: 10px 0 0; }
.cp .quiet--off .quiet__values,
.cp .quiet--off .quiet__slider,
.cp .quiet--off .quiet__ticks { opacity: .45; }
.cp .quiet--off .quiet__slider { cursor: not-allowed; }
.cp #notif-save { margin: 14px 0 0; }

/* ---- Abonnement (pages/abonnement.html) ------------------------------------ */
.abo .abo-state p { margin: 0 0 10px; font: 400 15px/1.5 var(--font-body); color: var(--color-text); }
.abo .abo-state p:last-child { margin-bottom: 0; }
.abo .abo-state .abo-state__title { margin: 0 0 6px; font: 700 18px/1.3 var(--font-body); }
.abo .abo-state .abo-state__title--alert { color: #A32626; }
.abo .abo-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; margin-top: 16px; }
.abo .abo-actions form { margin: 0; }
.abo .abo-actions .btn { width: auto; min-height: 44px; }
.abo .abo-list { margin: 0 0 18px; padding-left: 20px; font: 400 15px/1.5 var(--font-body); color: var(--color-text); }
.abo .abo-list li { margin: 2px 0; }
.abo .abo-form .form-checkbox span { line-height: 1.4; }
.abo .abo-form .form-hint { margin-top: 12px; }
.abo .abo-form .form-hint a { color: var(--color-accent-text); font-weight: 600; }
.abo .abo-payments { width: 100%; border-collapse: collapse; font: 400 15px/1.4 var(--font-body); font-variant-numeric: tabular-nums; }
.abo .abo-payments th,
.abo .abo-payments td { padding: 10px 8px; border-bottom: 1px solid #D6CCB7; text-align: center; vertical-align: middle; }
.abo .abo-payments thead th { font: 600 12px/1.2 var(--font-body); letter-spacing: .06em; text-transform: uppercase; color: var(--color-text-muted); }
.abo .abo-payments tbody tr:last-child > * { border-bottom: 0; }
.abo .abo-payments td:nth-last-child(-n+2) { white-space: nowrap; } /* montant et facture */
.abo .abo-payments a { color: var(--color-accent-text); font-weight: 600; }
.abo .abo-payments thead .sort-head { position: relative; }
.abo .abo-payments thead .sort-head__arrow { position: absolute; left: calc(100% - 2px); }
/* ==== [compte-pilotage] fin ====

/* Coche centrée dans sa case, quelle que soit l'épaisseur de bordure. */
.form-checkbox input[type="checkbox"]:checked::after,
.form-b .form-checkbox input[type="checkbox"]:checked::after {
  left: 50%;
  top: 50%;
  width: 6px;
  height: 11px;
  border-width: 0 2.5px 2.5px 0;
  transform: translate(-50%, -60%) rotate(45deg);
}

/* Numéros dans une pastille ronde : centrage exact, chiffres à chasse fixe.
   Le texte se cale au pixel entier. Barlow en 14 px, hauteur de ligne 1,
   dans une pastille de diamètre pair : chiffre centré quelle que soit la
   position de la pastille dans la page (mesuré). En 13, 15 ou 16 px, il
   dévie de 0,3 à 0,7 px selon la position. */
.line-item__number,
.iedit .line-item__number,
.qedit .line-item__number,
.pp-badge {
  display: inline-grid;
  place-items: center;
  padding: 0;
  line-height: 1;
  letter-spacing: 0;
  text-align: center;
  text-indent: 0;
  font-variant-numeric: tabular-nums lining-nums;
}

/* Boutons : texte et icône centrés en hauteur et en largeur, sur tous les
   écrans. line-height 1 + hauteur minimale : le centrage ne dépend plus des
   jambages de la police ni du retour à la ligne. */
.btn,
.metier-btn,
.client-row__btn,
.btn-save-edit,
.btn-cancel-edit,
.icon-btn,
.modal__close,
.feedback-modal__close,
.demo-pdf-preview__close,
.line-item__delete,
.ob-mic-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  line-height: 1.15;
  vertical-align: middle;
}
.btn--block, .btn.btn--block { display: flex; }
.btn > svg, .btn > i, .icon-btn > svg, .icon-btn > i { flex-shrink: 0; display: block; }
.ob-btn { align-items: center; justify-content: center; text-align: center; line-height: 1.15; }

/* En-tête : « Donner mon avis » avant le badge réseau, déconnexion après
   l'avatar (la section Compte du menu a été retirée le 28/09/2026). */
.header__feedback,
.header__logout {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 36px;
  border: 1px solid #3A382D;
  border-radius: 10px;
  background: transparent;
  color: #E8E1D2;
  font: 500 14px/1 var(--font-body);
  text-decoration: none;
  cursor: pointer;
}
.header__feedback { padding: 0 12px; margin-right: 12px; }
.header__logout { width: 36px; margin-left: 10px; padding: 0; }
.header__feedback:hover, .header__logout:hover { background: #2C2A20; color: #fff; }
.header__feedback svg, .header__logout svg { width: 18px; height: 18px; }
.header__user { display: flex; align-items: center; }
@media (max-width: 899px) {
  .header__feedback { width: 36px; padding: 0; margin-right: 8px; }
  .header__feedback span { display: none; }
  .header__user-name { display: none; }
}

/* Ligne d'ouvrage dans l'editeur : ce qu'elle suit, sous ses cases. */
.line-item__ouvrage { margin: 6px 0 0; font: 400 13px/1.4 var(--font-body); color: var(--color-text-muted); overflow-wrap: anywhere; }

/* Mes ouvrages (app/core/ouvrages.py), dans Mon compte : un bloc par
   prestation, une phrase par composant, ses reglages sur une ligne. */
.ouvr { display: flex; flex-direction: column; gap: 18px; }
.ouvr__group { display: flex; flex-direction: column; gap: 8px; }
.ouvr__anchor { margin: 0; font: 700 16px/1.35 var(--font-body); color: var(--color-text); overflow-wrap: anywhere; }
.ouvr__list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.ouvr__row { display: flex; flex-direction: column; gap: 8px; padding: 12px; border: 1px solid var(--color-divider); border-radius: 12px; }
.ouvr__sentence { margin: 0; font: 400 15px/1.45 var(--font-body); color: var(--color-text); overflow-wrap: anywhere; }
.ouvr__edit { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px 12px; }
.ouvr__field { display: flex; flex-direction: column; gap: 4px; }
.ouvr__field-label { font: 600 13px/1.3 var(--font-body); color: var(--color-text-muted); }
.form-b .ouvr__qty { width: 9ch; min-width: 0; min-height: 44px; text-align: center; }
.ouvr__per { display: flex; align-items: center; gap: 8px; }
.ouvr__per-unit { font: 500 16px/1 var(--font-body); color: var(--color-text); }
.form-b .ouvr__mode { width: auto; min-height: 44px; }
.ouvr__round { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; font: 600 15px/1.3 var(--font-body); color: var(--color-text); cursor: pointer; }
.ouvr__round input { width: 22px; height: 22px; margin: 0; accent-color: var(--color-accent); }
.ouvr__actions { display: flex; align-items: center; gap: 8px; margin-left: auto; }
/* Propositions tirees des devis importes, en tete de Mes ouvrages. */
.ouvr__proposals { display: flex; flex-direction: column; gap: 8px; padding-bottom: 18px; border-bottom: 1px solid var(--color-divider); }
.ouvr__proposals .form-hint { margin: 0; }
.ouvr__proposals-form { display: flex; flex-direction: column; gap: 12px; }
.ouvr__proposal-actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 12px; }
.ouvr__message { margin: 0; padding: 10px 12px; border-radius: 10px; background: #F4EEDF; font: 600 15px/1.4 var(--font-body); color: var(--color-text); }
/* Conditions d'un ouvrage (minimum, seuil, lieu), repliees sous ses cases. */
.ouvr__more { flex-basis: 100%; }
.ouvr__more > summary { list-style: none; }
.ouvr__more > summary::-webkit-details-marker { display: none; }
.ouvr__more-summary { cursor: pointer; min-height: 44px; display: flex; align-items: center; gap: 6px; font: 600 15px/1.3 var(--font-body); color: var(--color-text); }
.ouvr__more-chevron { width: 18px; height: 18px; transition: transform .15s; }
.ouvr__more[open] .ouvr__more-chevron { transform: rotate(90deg); }
.ouvr__more-fields { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px 12px; padding-top: 4px; }
/* « Ajouter un ouvrage » : formulaire replie en fin de liste. */
.ouvr__add { border-top: 1px solid var(--color-divider); padding-top: 12px; }
.ouvr__add > summary { list-style: none; }
.ouvr__add > summary::-webkit-details-marker { display: none; }
.ouvr__add-summary { cursor: pointer; min-height: 44px; display: inline-flex; align-items: center; gap: 8px; font: 700 16px/1.3 var(--font-body); color: var(--color-accent); }
.ouvr__add-summary svg { width: 20px; height: 20px; }
.ouvr__add-form { display: flex; flex-direction: column; gap: 12px; padding-top: 8px; }
.ouvr__kinds { display: flex; flex-wrap: wrap; gap: 4px 16px; margin: 0; padding: 0; border: 0; }
.ouvr__kinds legend { padding: 0; margin-bottom: 4px; }
.ouvr__add-row { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px 12px; }
.ouvr__field--wide { flex: 1 1 220px; min-width: 0; }
.form-b .ouvr__unit { width: 9ch; min-width: 0; min-height: 44px; text-align: center; }
.ouvr__add-row[hidden], .ouvr__field[hidden], .ouvr__round[hidden], .ouvr__field-label[hidden] { display: none; }

/* Mots confirmes pour les dictees (app/core/vocabulary.py) : lien sous le
   champ de dictee, liste de Mon compte. */
.vocab-fix { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; margin: 6px 0 10px; }
.vocab-fix__open {
  display: inline-flex; align-items: center; gap: 6px;
  min-height: 44px; padding: 0; border: 0; background: none; cursor: pointer;
  font: 600 15px var(--font-body); color: var(--color-text);
  text-decoration: underline; text-underline-offset: 3px;
}
.vocab-fix__open svg { width: 18px; height: 18px; }
.vocab-fix__done { margin: 0; font: 400 14px/1.4 var(--font-body); color: var(--color-text-muted); }
.vocab-fix__done:empty { display: none; }
.vocab { display: flex; flex-direction: column; gap: 12px; }
.vocab__list { list-style: none; margin: 0; padding: 0; }
.vocab__row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 6px 0; font-family: var(--font-body); overflow-wrap: anywhere; }
.vocab__row + .vocab__row { border-top: 1px solid var(--color-divider); }
.vocab__heard { color: var(--color-text-muted); }
.vocab__add { display: grid; gap: 0 12px; align-items: end; }
@media (min-width: 640px) {
  .vocab__add { grid-template-columns: 1fr 1fr auto; }
  .vocab__add .btn { margin-bottom: 16px; }
}

/* Fenetre de confirmation (static/js/dialogs.js), a la place de confirm()
   et prompt() du navigateur : carte blanche, action principale a droite,
   rouge pour une suppression. */
.vox-dialog {
  width: min(440px, calc(100vw - 32px));
  max-width: none;
  margin: auto;
  padding: 0;
  border: 1px solid var(--color-border);
  border-radius: 16px;
  background: #fff;
  color: var(--color-text);
  box-shadow: 0 16px 48px rgba(22, 22, 15, .3);
}
.vox-dialog::backdrop { background: rgba(22, 22, 15, .55); }
.vox-dialog [hidden] { display: none !important; }
.vox-dialog__box { display: flex; flex-direction: column; gap: 8px; margin: 0; padding: 20px; }
.vox-dialog__title { margin: 0; font: 700 18px/1.3 var(--font-body); color: var(--color-text); }
.vox-dialog__text { margin: 0; font: 400 16px/1.45 var(--font-body); color: var(--color-text-muted); }
.vox-dialog__field {
  width: 100%;
  min-height: 48px;
  margin-top: 4px;
  padding: 0 12px;
  border: 1.5px solid var(--color-field-border);
  border-radius: 12px;
  background: #F7F4EE;
  font: 500 15px var(--font-body);
  color: var(--color-text);
}
.vox-dialog__actions { display: flex; gap: 10px; margin-top: 12px; }
.vox-dialog__actions .btn {
  flex: 1 1 0;
  min-height: 48px;
  margin: 0;
  padding: 0 12px;
  line-height: 1.2;
  white-space: normal;
}
/* voxChoose : un bouton pleine largeur par choix. */
.vox-dialog__choices { display: flex; flex-direction: column; gap: 8px; margin-top: 8px; }
.vox-dialog__choice { width: 100%; min-height: 48px; margin: 0; justify-content: flex-start; padding: 0 16px; }
.vox-dialog__actions .btn--danger { background: #A32626; border-color: #A32626; color: #fff; box-shadow: none; }
.vox-dialog__actions .btn--danger:hover { background: #8C1F1F; border-color: #8C1F1F; }

/* Liste qui n'a pas pu se charger : message et bouton Reessayer. */
.list-error {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 24px 16px;
  text-align: center;
  color: var(--color-text-muted);
}

/* ---- Accessibilité : contours, focus, cibles tactiles ----------------------
   Contour des champs et des cases à 3:1 au moins sur leur fond (WCAG 1.4.11) :
   #8C836C fait 3,76:1 sur blanc ; #D6CCB7 reste pour les cartes et séparateurs.
   Focus clavier : anneau d'encre à 2 px, lisible sur toutes les surfaces.
   Commandes de l'en-tête et puces : zone de 44 px sans changer le dessin. */
:root { --color-field-border: #8C836C; }
.form-input,
.input,
.form-b .form-input,
.catalog-form input,
.catalog-form select,
.qedit .line-item__fields input,
.iedit .line-item__fields input,
.qedit .advance-row__input,
.sched-card .advance-row__input,
.form-checkbox input[type="checkbox"],
.form-b .form-checkbox input[type="checkbox"],
.qedit .form-checkbox input[type="checkbox"] {
  border-color: var(--color-field-border);
}
.search-bar__input { border: 1.5px solid var(--color-field-border); }
/* Tuiles (cartes blanches posées sur le fond beige) : liseré de 1 px de la
   couleur des champs, seul contour lisible sur #DBD3C1 (#D6CCB7 y est
   invisible). Séparateurs internes inchangés. */
:root { --color-tile-border: var(--color-field-border); }
.card-b,
.login-card,
.iedit .line-item {
  border: 1px solid var(--color-tile-border);
}
/* Désignation d'une ligne de devis ou de facture : texte modifiable dessiné
   comme les champs quantité et prix (fond beige, contour), crayon ambre à
   droite. Crayon en CSS : présent aussi sur les lignes insérées par script,
   que Lucide ne repasse pas. */
.qedit .line-item__title,
.iedit .line-item__title {
  box-sizing: border-box;
  min-height: 48px;
  padding: 12px 42px 12px 14px;
  border: 1.5px solid var(--color-field-border);
  border-radius: 12px;
  background: #F7F4EE url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='none' stroke='%238A6410' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M21.17 6.81a1 1 0 0 0-3.99-3.99L3.84 16.17a2 2 0 0 0-.5.83l-1.32 4.35a.5.5 0 0 0 .62.62l4.35-1.32a2 2 0 0 0 .83-.5z'/%3E%3C/svg%3E") no-repeat right 14px center;
  font: 600 16px/1.35 var(--font-body);
  cursor: text;
}
.qedit .line-item__title:hover,
.iedit .line-item__title:hover { background-color: #F1ECE1; }
.qedit .line-item__title:focus,
.iedit .line-item__title:focus {
  outline: none;
  border-color: var(--color-accent);
  background-color: #fff;
  box-shadow: 0 0 0 3px rgba(201, 151, 29, .18);
}
:is(input, select, textarea, [contenteditable="true"]):focus-visible,
.voice-box:focus-visible,
.catalog-item--clickable:focus-visible {
  outline: 2px solid #6B4D0B !important;
  outline-offset: 2px;
}
.header__avatar,
.header__logout,
.header__feedback,
.btn--small,
.filter-chip { position: relative; }
.header__avatar::after,
.header__logout::after,
.header__feedback::after,
.btn--small::after,
.filter-chip::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: max(100%, 44px);
  height: max(100%, 44px);
  transform: translate(-50%, -50%);
}

/* ---- Dictees gardees sur le telephone (page Devis) et renvoi d'un
   enregistrement iOS dont l'envoi a echoue. */
.dictees-attente { display: flex; flex-direction: column; gap: 10px; margin-bottom: 16px; }
.dictees-attente[hidden] { display: none; }
.dictees-attente__titre { margin: 0; font: 600 15px/1.4 var(--font-body); color: var(--color-text); }
.dictees-attente__liste { display: flex; flex-direction: column; gap: 6px; margin: 0; padding: 0; list-style: none; }
.dictees-attente__liste li { display: flex; align-items: center; justify-content: space-between; gap: 12px; font: 400 14px/1.4 var(--font-body); }
.dictees-attente > .btn { align-self: flex-start; }
.voice-retry {
  position: fixed;
  left: 16px;
  right: 16px;
  bottom: calc(80px + env(safe-area-inset-bottom, 0px));
  z-index: 9998;
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: 480px;
  margin: 0 auto;
  padding: 14px 16px;
  border-radius: 12px;
  background: #16160F;
  color: #F4EDE3;
  box-shadow: 0 4px 16px rgba(0, 0, 0, .35);
}
.voice-retry__text { margin: 0; font: 500 15px/1.4 var(--font-body); }
.voice-retry__actions { display: flex; gap: 8px; }

/* Panneau de diagnostic de la dictee (?diag-dictee=1, static/voice.js). */
.voice-diag {
  position: fixed;
  top: calc(8px + env(safe-area-inset-top, 0px));
  left: 8px;
  right: 8px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  max-height: 45vh;
  border-radius: 8px;
  background: rgba(10, 10, 6, .92);
  color: #F4EDE3;
  font: 400 11px/1.35 ui-monospace, monospace;
}
.voice-diag__head { display: flex; align-items: center; gap: 8px; padding: 6px 8px; border-bottom: 1px solid rgba(244, 237, 227, .2); }
.voice-diag__head span { flex: 1; }
.voice-diag__head button { padding: 4px 8px; border: 1px solid rgba(244, 237, 227, .4); border-radius: 6px; background: none; color: inherit; font: inherit; }
.voice-diag__list { margin: 0; padding: 6px 8px 8px 8px; overflow-y: auto; list-style: none; overflow-wrap: anywhere; }

/* Deconnexion : formulaire natif sans effet sur la mise en page de l'en-tete. */
.header__logout-form { display: contents; }
button.header__logout { appearance: none; -webkit-appearance: none; }

/* Texte lu par les lecteurs d'ecran seulement (annonces de base.html). */
.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;
}

/* Puce de filtre au clavier : contour lisible (5,2:1), l'ambre ne suffit pas. */
.filter-chip:has(input:focus-visible) { outline: 2px solid #6B4D0B; outline-offset: 2px; }

/* Liste paginee : « Voir plus » sous les 50 premieres cartes (db-08). */
.doc-list__more { display: flex; justify-content: center; padding: 12px 0; }

/* [lisere] Liseré des boutons et pastilles : trait encre translucide de
   1 px, qui fonce la couleur de la bulle qu'il entoure (taupe sur blanc,
   ambre brûlé sur ambre). Ombre et non bordure : aucune taille ne change
   et le contour de focus reste libre. Les boutons qui ont déjà un trait
   visible (.btn--outline, .btn--google, boutons de l'en-tête) le gardent. */
:root {
  --lisere: rgba(22, 22, 15, .16);
  --lisere-danger: rgba(163, 38, 38, .28);
  --lisere-primaire: #8A6410;
}
.btn,
.filter-chip,
.acc-tab,
.sidebar__voice,
.header__avatar,
.vox-dialog__actions .btn--danger {
  box-shadow: 0 0 0 1px var(--lisere);
}
.btn--quiet-danger { box-shadow: 0 0 0 1px var(--lisere-danger); }
/* Actions principales (Nouveau devis, Nouvelle facture, Enregistrer...) :
   trait ambre brule plein, plus sombre que le liseré commun (option B de
   la planche du 02/10/2026). */
.btn--primary,
.btn--primary:hover { box-shadow: 0 0 0 1px var(--lisere-primaire); }
.btn--outline,
.btn--google { box-shadow: none; }

/* [dates] Champ de date jj/mm/aaaa (static/js/date-fr.js) : champ texte
   visible, bouton calendrier a droite, champ natif cache qui garde la
   valeur ISO. */
.date-fr { position: relative; display: block; min-width: 0; }
.date-fr .date-fr__text { display: block; width: 100%; padding-right: 48px; font-variant-numeric: tabular-nums; }
.date-fr--no-picker .date-fr__text.date-fr__text { padding-right: 14px; }
.date-fr__native {
  position: absolute;
  left: 0;
  bottom: 0;
  width: 1px;
  height: 1px;
  padding: 0;
  border: 0;
  opacity: 0;
  pointer-events: none;
}
.date-fr__picker {
  position: absolute;
  top: 50%;
  right: 4px;
  width: 40px;
  height: 40px;
  transform: translateY(-50%);
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 10px;
  background: none;
  color: var(--color-text-muted);
  cursor: pointer;
}
.date-fr__picker:hover { background: var(--color-hover); color: var(--color-text); }
.date-fr__picker:focus-visible { outline: 2px solid #6B4D0B; outline-offset: 0; }
.date-fr__picker svg { width: 20px; height: 20px; }

/* [tri] Titres de colonne cliquables (static/js/table-sort.js) : la flèche
   donne le sens, ↑ croissant, ↓ décroissant, ↕ colonne non triée. */
.sort-head {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin: -4px -6px;
  padding: 4px 6px;
  border: 0;
  border-radius: 6px;
  background: none;
  color: inherit;
  font: inherit;
  letter-spacing: inherit;
  text-transform: inherit;
  cursor: pointer;
}
.sort-head:hover { color: var(--color-text); background: var(--color-hover); }
.sort-head:focus-visible { outline: 2px solid #6B4D0B; outline-offset: 1px; }
.sort-head__arrow { font-size: 13px; line-height: 1; opacity: .45; }
.sort-head[data-dir] { color: var(--color-text); }
.sort-head[data-dir] .sort-head__arrow { opacity: 1; }

/* Titre de colonne : même taille pour toutes les colonnes, quelle que soit
   celle des valeurs. */
.doc-row--head .sort-head { font: 600 12px/1.2 var(--font-body); letter-spacing: .06em; text-transform: uppercase; }

/* Listes en colonnes (ordinateur) : chaque titre centré au-dessus de sa
   colonne, valeurs centrées dessous. */
@media (min-width: 900px) {
  .card-b--table .doc-row > span {
    justify-self: center;
    max-width: 100%;
    text-align: center;
  }
}

/* Catalogue : libellés centrés au-dessus de leur champ. */
.catalog-add__field .form-label { text-align: center; }

/* [notifications] Cloche de l'en-tête, entre l'avatar et la déconnexion
   (base.html, static/js/notifications.js) : compteur rouge des non lues,
   sonnerie à l'arrivée d'une notification (jamais en continu), menu
   déroulant sous la cloche. */
.notif { position: relative; display: flex; margin-left: 10px; }
.header__notif {
  appearance: none;
  -webkit-appearance: none;
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  min-height: 36px;
  padding: 0;
  border: 1px solid #3A382D;
  border-radius: 10px;
  background: transparent;
  color: #E8E1D2;
  cursor: pointer;
}
.header__notif:hover,
.header__notif[aria-expanded="true"] { background: #2C2A20; color: #fff; }
.header__notif:focus-visible { outline: 2px solid #E8C25A; outline-offset: 2px; }
.header__notif svg { width: 18px; height: 18px; transform-origin: 50% 3px; }
/* Cible tactile de 44 px autour du bouton de 36 px. */
.header__notif::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 44px;
  height: 44px;
  transform: translate(-50%, -50%);
}
.notif__count {
  position: absolute;
  top: -8px;
  right: -9px;
  z-index: 1;
  display: inline-grid;
  place-items: center;
  min-width: 21px;
  height: 21px;
  padding: 0 5px;
  border-radius: 11px;
  background: #D32F2F;
  color: #fff;
  box-shadow: 0 0 0 2px #16160F;
  font: 700 13px/1 var(--font-body);
  font-variant-numeric: tabular-nums;
  pointer-events: none;
}
.notif__count[hidden] { display: none; }
@keyframes notif-ring {
  0%, 100% { transform: rotate(0); }
  10%, 30%, 50% { transform: rotate(16deg); }
  20%, 40%, 60% { transform: rotate(-16deg); }
  70% { transform: rotate(8deg); }
  85% { transform: rotate(-4deg); }
}
@keyframes notif-pop {
  0% { transform: scale(.3); }
  70% { transform: scale(1.18); }
  100% { transform: scale(1); }
}
.header__notif--ring svg { animation: notif-ring 1.1s ease-in-out 2; }
.header__notif--ring .notif__count { animation: notif-pop .45s ease-out; }
@media (prefers-reduced-motion: reduce) {
  .header__notif--ring svg,
  .header__notif--ring .notif__count { animation: none; }
}

.notif__panel {
  position: absolute;
  top: calc(100% + 12px);
  right: -56px;
  z-index: 200;
  display: flex;
  flex-direction: column;
  width: 460px;
  max-height: min(72vh, 600px);
  overflow: hidden;
  border: 1px solid var(--color-tile-border, #8C836C);
  border-radius: 14px;
  background: #fff;
  color: var(--color-text);
  box-shadow: 0 14px 34px rgba(22, 22, 15, .3);
  font-family: var(--font-body);
  text-align: left;
}
.notif__panel[hidden] { display: none; }
@media (max-width: 599px) {
  .notif__panel {
    position: fixed;
    top: calc(var(--header-height) + env(safe-area-inset-top, 0px) + 8px);
    left: 8px;
    right: 8px;
    width: auto;
    max-height: calc(100dvh - var(--header-height) - 120px);
  }
}
.notif__body { display: flex; flex-direction: column; min-height: 0; }
.notif__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px 12px;
  border-bottom: 1px solid #D6CCB7;
}
.notif__title { margin: 0; font: 600 17px/1.2 var(--font-body); color: var(--color-text); text-transform: none; letter-spacing: 0; }
.notif__settings { font: 500 14px/1.3 var(--font-body); color: var(--color-accent-text); text-decoration: underline; text-underline-offset: 2px; }
.notif__list { flex: 1 1 auto; min-height: 0; margin: 0; padding: 0; overflow-y: auto; list-style: none; overscroll-behavior: contain; }
.notif-item { display: flex; flex-direction: column; gap: 8px; padding: 12px 16px; border-bottom: 1px solid #D6CCB7; }
.notif-item:last-child { border-bottom: 0; }
.notif-item--unread { background: #FBF4E2; }
.notif-item__main { display: flex; align-items: flex-start; gap: 12px; color: inherit; text-decoration: none; }
.notif-item__main:hover .notif-item__title { text-decoration: underline; text-underline-offset: 2px; }
.notif-item .tint { width: 36px; height: 36px; border-radius: 10px; }
.notif-item .tint svg { width: 18px; height: 18px; }
.notif-item__text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.notif-item__title { font: 500 15px/1.3 var(--font-body); color: var(--color-text); }
.notif-item--unread .notif-item__title { font-weight: 700; }
.notif-item--unread .notif-item__title::before {
  content: "";
  display: inline-block;
  width: 8px;
  height: 8px;
  margin: 0 7px 2px 0;
  border-radius: 50%;
  background: #D32F2F;
  vertical-align: middle;
}
.notif-item__body { font: 400 14px/1.4 var(--font-body); color: var(--color-text); overflow-wrap: anywhere; }
.notif-item__when { font: 400 13px/1.3 var(--font-body); color: var(--color-text-muted); }
.notif-item__action { align-self: flex-start; margin-left: 48px; }
.notif__foot {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
  padding: 10px 16px;
  border-top: 1px solid #D6CCB7;
  background: #FAF7F0;
}
.notif__foot .btn { padding: 6px 10px; white-space: nowrap; }
@media (max-width: 599px) {
  .notif__foot .btn { flex: 1 1 auto; }
}
.notif__empty { margin: 0; padding: 28px 16px; font: 400 15px/1.4 var(--font-body); color: var(--color-text-muted); text-align: center; }
.notif__body > .list-error { padding: 16px; }

/* Navigateur de Facebook ou d'Instagram (static/js/navigateur-integre.js). */
.in-app-notice { margin: 0 0 16px; padding: 14px 16px; border-radius: 10px; background: #FBF3DD; border: 1px solid #E8CF8A; color: #16160F; }
.in-app-notice[hidden] { display: none; }
.in-app-notice__title { margin: 0 0 4px; font-weight: 700; }
.in-app-notice__text { margin: 0 0 12px; font-size: 14px; line-height: 1.4; }
.in-app-notice__actions { display: grid; gap: 8px; }
.in-app-notice__hint { margin: 10px 0 0; font-size: 13px; line-height: 1.4; color: #5A5444; }


/* ---- Prix estimés : catalogue de base jamais modifié, lignes à vérifier ----
   Ambre de la charte (texte #8A6410 sur #FBF3DA : 5,1:1). */
.catalog-item__estimate,
.line-item__estimate {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 999px;
  background: #FBF3DA;
  color: var(--color-accent-text);
  font: 600 12px/1.4 var(--font-body);
  white-space: nowrap;
}
/* Consigne complète sur la ligne : passe à la ligne sur un téléphone étroit. */
.line-item__estimate { margin-top: 6px; white-space: normal; border-radius: 12px; }
.catalog-verify {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin: 4px 0 0;
  padding: 0 16px 12px;
}
.catalog-verify[hidden] { display: none; }
.catalog-verify__filter {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 40px;
  padding: 6px 14px;
  border: 1px solid var(--color-border);
  border-radius: 999px;
  background: #fff;
  color: var(--color-text);
  font: 600 14px/1.2 var(--font-body);
  cursor: pointer;
}
.catalog-verify__filter svg { width: 16px; height: 16px; color: var(--color-accent-text); }
.catalog-verify__filter[aria-pressed="true"] { background: #FBF3DA; border-color: var(--color-accent-text); }
.catalog-verify__ok { width: auto; min-height: 40px; }
.estimate-banner {
  display: flex;
  flex: 1 0 100%;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 12px;
  border-radius: 10px;
  background: #FBF3DA;
  color: var(--color-accent-text);
  font: 600 14px/1.3 var(--font-body);
}
.estimate-banner[hidden] { display: none; }
.estimate-banner__text { min-width: 0; }
.estimate-banner__go {
  min-height: 36px;
  padding: 4px 10px;
  border: 0;
  background: none;
  color: var(--color-accent-text);
  font: 700 14px/1.2 var(--font-body);
  text-decoration: underline;
  cursor: pointer;
}
.qbar:has(.estimate-banner:not([hidden])) { flex-wrap: wrap; }
@media (max-width: 899px) {
  .main:has(.estimate-banner:not([hidden])) { padding-bottom: calc(150px + env(safe-area-inset-bottom)); }
}

/* Accueil : retard dans « À encaisser ». */
.kpi__sub--alert { color: #A32626; font-weight: 600; }
/* Administration : case de l'etat du serveur qui demande une action. */
.kpi__value--alert { color: #A32626; }

/* Photos jointes au devis (partials/quote_photos.html, lien du client). */
.qphotos { display: flex; flex-direction: column; gap: 12px; padding: 14px 16px; }
.qphotos__grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(96px, 1fr));
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.qphotos__grid:empty, .qphotos__grid[hidden] { display: none; }
.qphotos__item {
  position: relative;
  aspect-ratio: 1;
  overflow: hidden;
  border-radius: 10px;
  background: var(--color-divider);
}
.qphotos__item img, .qphotos__link { display: block; width: 100%; height: 100%; }
.qphotos__item img { object-fit: cover; }
.qphotos__item--pending img { opacity: .55; }
.qphotos__badge {
  position: absolute;
  left: 6px;
  right: 6px;
  bottom: 6px;
  padding: 2px 6px;
  border-radius: 6px;
  background: rgba(22, 22, 15, .78);
  color: #fff;
  font: 600 11px/1.3 var(--font-body);
  text-align: center;
}
.qphotos__remove {
  position: absolute;
  top: 4px;
  right: 4px;
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 50%;
  background: rgba(22, 22, 15, .72);
  color: #fff;
  font: 700 18px/1 var(--font-body);
  cursor: pointer;
}
.qphotos__remove svg { width: 18px; height: 18px; }
.qphotos__add { align-self: flex-start; cursor: pointer; }
.qphotos--busy .qphotos__add { opacity: .6; pointer-events: none; }
.qphotos .form-hint { margin: 0; }

/* « Faire signer ici » (pages/quote_sign.html) : plein ecran par-dessus
   l'en-tete et le menu, le client ne touche qu'a ce devis. */
.signhere {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  background: #fff;
  overflow-y: auto;
  overscroll-behavior: contain;
}
.signhere__bar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: calc(10px + env(safe-area-inset-top)) 16px 10px;
  border-bottom: 1px solid #E2DACA;
}
.signhere__title { margin: 0; font: 600 18px/1.2 var(--font-display); text-transform: uppercase; letter-spacing: .4px; }
.signhere__body {
  display: flex;
  flex-direction: column;
  gap: 18px;
  width: 100%;
  max-width: 640px;
  margin: 0 auto;
  padding: 16px 16px calc(24px + env(safe-area-inset-bottom));
}
.signhere__summary { display: flex; flex-direction: column; gap: 4px; }
.signhere__ref { color: var(--color-text-muted); font: 500 14px/1.3 var(--font-body); }
.signhere__subject { margin: 0; font: 600 16px/1.35 var(--font-body); }
.signhere__total { margin: 4px 0; font: 700 32px/1.1 var(--font-display); }
.signhere__total span { font-size: 16px; color: var(--color-text-muted); }
.signhere__pdf { padding-left: 0; padding-right: 0; }
.signhere__form { display: flex; flex-direction: column; gap: 14px; }
.signhere__pad {
  position: relative;
  height: 220px;
  border: 1.5px dashed #B9AE95;
  border-radius: 12px;
  background: #FAF8F3;
}
.signhere__canvas { display: block; width: 100%; height: 100%; touch-action: none; cursor: crosshair; }
.signhere__placeholder {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: #9C927D;
  font: 500 16px/1 var(--font-body);
  pointer-events: none;
}
.signhere__placeholder[hidden] { display: none; }
.signhere__clear { position: absolute; top: 8px; right: 8px; }
.signhere__error { margin: 0; color: #A32626; font: 600 14px/1.4 var(--font-body); }
.signhere__error[hidden] { display: none; }
@media (orientation: landscape) and (max-height: 500px) {
  .signhere__pad { height: 160px; }
}

/* ==== [admin] debut ====
   Administration (super-admin) : quatre onglets, Synthese, Comptes,
   IA, Serveur, plus Retours. Choix du 13/10/2026 (option B, canevas
   « Administration VOX »). Tout est borne a la racine .adm. Graphiques
   dessines par le serveur (app/core/admin_charts.py), couleurs validees par
   le controle de palette de la skill dataviz : ambre #A8770F (3,95:1) pour
   la periode en cours, greige #C2B69B pour le reste. */
@media (min-width: 900px) {
  .adm.cp--wide { max-width: 1320px; }
}
.adm .btn { width: auto; }
.adm-muted { color: var(--color-text-muted); font-weight: 400; }
.adm-empty { margin: 0; padding: 14px 0 4px; font: 400 15px/1.45 var(--font-body); color: var(--color-text-muted); }
.adm-scope { margin: -8px 0 0; font: 400 14px/1.45 var(--font-body); color: var(--color-text-muted); }

/* Onglets : trait ambre et graisse sur l'onglet actif (pas la couleur
   seule). Sous 720 px, les cinq tiennent sur une ligne : icone au-dessus du
   libelle, compteur pose sur l'icone. */
.adm-head { margin-bottom: 0; }
.adm-tabs {
  display: flex;
  gap: 4px;
  margin: -6px -16px 0;
  padding: 0 16px;
  border-bottom: 1px solid #BFB399;
  overflow-x: auto;
  scrollbar-width: none;
}
.adm-tabs::-webkit-scrollbar { display: none; }
.adm-tab {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
  min-height: 46px;
  padding: 0 14px;
  margin-bottom: -1px;
  border-bottom: 3px solid transparent;
  border-radius: 10px 10px 0 0;
  color: var(--color-text-muted);
  font: 600 15px/1 var(--font-body);
  text-decoration: none;
  white-space: nowrap;
}
.adm-tab:hover { color: var(--color-text); background: rgba(255, 255, 255, .35); }
.adm-tab:focus-visible { outline: 2px solid var(--color-header); outline-offset: -2px; }
.adm-tab--on { color: var(--color-header); font-weight: 700; border-bottom-color: var(--color-accent); }
.adm-tab__count {
  min-width: 22px;
  height: 21px;
  padding: 0 7px;
  border-radius: 11px;
  background: rgba(22, 22, 15, .08);
  color: #4A4436;
  font: 600 13px/21px var(--font-body);
  text-align: center;
}
.adm-tab__count--alert { background: #F9DEDA; color: #8A1C1C; }
/* Porte le compteur des retours remis à jour hors bande, sans boîte à lui. */
.adm-tab__slot { display: contents; }
/* Tri de la liste des comptes : libellé devant ses deux puces. */
/* Bouton d'essai d'un canal d'alerte (Sentry), sa réponse dessous. */
.adm-test { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; padding-top: 12px; }
.adm-chips__label { align-self: center; margin-right: 2px; font: 500 13px/1.2 var(--font-body); color: var(--color-text-muted); }
.adm-tab__dot { width: 8px; height: 8px; border-radius: 50%; background: #2E7D52; }
.adm-tab svg { display: none; }
@media (max-width: 719px) {
  .adm-tabs { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 0; padding: 0 6px; overflow: visible; }
  .adm-tab { position: relative; flex-direction: column; justify-content: center; gap: 5px; min-height: 60px; padding: 9px 2px 7px; font-size: 13px; }
  .adm-tab svg { display: block; width: 22px; height: 22px; }
  .adm-tab__count { position: absolute; top: 4px; left: calc(50% + 6px); min-width: 17px; height: auto; padding: 0 5px; border-radius: 9px; font: 600 12px/17px var(--font-body); }
  .adm-tab__dot { position: absolute; top: 8px; left: calc(50% + 10px); }
}
@media (min-width: 900px) {
  .adm-tabs { margin: -6px 0 0; padding: 0; flex-wrap: wrap; }
}

/* Grilles et cartes */
.adm-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 20px; align-items: start; }
.adm-card { padding: 16px; }
.adm-col { display: flex; flex-direction: column; gap: 20px; min-width: 0; }
.adm-card--flush { padding: 0; }
.adm-card__pad { padding: 16px; }
.adm-card__sep { border-top: 1px solid var(--color-divider); }
.adm-card__head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 4px 12px; }
.adm-card__title { margin: 0; font: 600 17px/1.3 var(--font-body); color: var(--color-text); }
.adm-card__title--small { font-size: 15px; }
.adm-card__note { margin: 2px 0 0; font: 400 13px/1.4 var(--font-body); color: var(--color-text-muted); }
.adm-card__link { display: inline-block; margin-top: 12px; }
.adm-card .adm-chart { margin-top: 10px; }
@media (min-width: 760px) {
  .adm-grid--11 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .adm-grid--3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (min-width: 1100px) {
  .adm-grid--21 { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
  .adm-grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .adm-card { padding: 18px 20px; }
  .adm-card--flush { padding: 0; }
  .adm-card__pad { padding: 18px 20px; }
}

/* A traiter : pastille teintee, phrase, lien */
.adm-todo {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr);
  gap: 8px 14px;
  align-items: center;
  padding: 12px 0;
  border-top: 1px solid var(--color-divider);
}
.adm-card__head + .adm-todo { margin-top: 6px; border-top: 0; }
.adm-todo__text { min-width: 0; }
.adm-todo__title { margin: 0; font: 600 15px/1.35 var(--font-body); color: var(--color-text); }
.adm-todo__detail { margin: 2px 0 0; font: 400 13px/1.4 var(--font-body); color: var(--color-text-muted); }
.adm-todo__acts { display: flex; flex-wrap: wrap; gap: 8px; grid-column: 2; justify-self: start; }
.adm-todo__hidden { margin-top: 10px; }
.adm-todo__show { position: relative; padding: 0; border: 0; background: none; font: inherit; color: var(--color-accent-text); font-weight: 600; cursor: pointer; }
.adm-todo__show::after { content: ""; position: absolute; inset: -12px -6px; }
.adm-todo__show:focus-visible { outline: 2px solid var(--color-header); outline-offset: 2px; }
@media (min-width: 600px) {
  .adm-todo { grid-template-columns: 40px minmax(0, 1fr) auto; }
  .adm-todo__acts { grid-column: auto; justify-self: end; }
}
.adm-tint { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; }
.adm-tint svg { width: 20px; height: 20px; }
.adm-tint--red { background: #F9DEDA; color: #A32626; }
.adm-tint--amber { background: #FBF3DA; color: #8A6410; }
.adm-tint--blue { background: #DEEAF7; color: #1A4677; }
.adm-tint--gray { background: #ECE7DC; color: #4A4436; }

/* Etat du serveur : coche verte, ou triangle rouge s'il reste un point */
.adm-state { display: flex; align-items: center; gap: 12px; }
.adm-state--big { flex-wrap: wrap; gap: 12px 18px; }
.adm-state__ico {
  width: 44px;
  height: 44px;
  flex-shrink: 0;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: #DAEFE1;
  color: #18502F;
}
.adm-state__ico svg { width: 22px; height: 22px; }
.adm-state__ico--alert { background: #F9DEDA; color: #A32626; }
.adm-state__text { flex: 1 1 260px; min-width: 0; }
.adm-state__act { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; }
.admin-alert-test:empty { display: none; }
.adm-mini-checks { margin: 12px 0 0; padding: 0; list-style: none; }
.adm-mini-checks li {
  display: grid;
  grid-template-columns: 8px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 7px 0;
  border-top: 1px solid var(--color-divider);
  font: 400 14px/1.3 var(--font-body);
  color: var(--color-text-muted);
}
.adm-mini-checks b { color: var(--color-text); font-weight: 600; white-space: nowrap; }
.adm-mini-checks__bad b { color: #A32626; }
.adm-dot { width: 8px; height: 8px; border-radius: 50%; background: #2E7D52; flex-shrink: 0; }
.adm-dot--alert { background: #A32626; }
.adm-dot--amber { background: var(--color-accent); }

/* Chiffres cles : 2 colonnes, puis 3, puis 6. Libelle, valeur et detail
   alignes d'une case a l'autre (sous-grille), meme quand un libelle tient
   sur deux lignes. */
.adm-kpis .kpi { display: grid; grid-row: span 3; grid-template-rows: subgrid; row-gap: 2px; align-content: start; padding: 14px 16px; }
.adm-kpi-suffix { font: 500 14px var(--font-body); color: var(--color-text-muted); }
@media (min-width: 700px) {
  .adm-kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (min-width: 1240px) {
  .adm-kpis { grid-template-columns: repeat(6, minmax(0, 1fr)); }
}

/* Graphiques en colonnes (partials/admin_charts.html). Un graphique large
   (720 points) a sa version etroite sous 600 px : le texte y reste lisible. */
.adm-chart { display: block; width: 100%; height: auto; }
.adm-chart--narrow { display: none; }
@media (max-width: 599px) {
  .adm-chart--wide { display: none; }
  .adm-chart--narrow { display: block; }
}
.adm-chart text,
.adm-chart__tick,
.adm-chart__x { font-family: var(--font-body); font-size: 12px; fill: #7A6F57; }
.adm-chart .adm-chart__value { font-size: 13px; font-weight: 600; fill: var(--color-text); }
.adm-chart__grid { stroke: var(--color-divider); stroke-width: 1; }
.adm-chart__grid--base { stroke: #D6CCB7; }
.adm-chart__col { fill: #C2B69B; }
.adm-chart__col--recent { fill: #A8770F; }
.adm-chart__future { stroke: #D6CCB7; stroke-width: 3; stroke-linecap: round; }

/* Parcours des artisans : rampe ambre, du plus clair au plus fonce */
.adm-funnel { display: flex; flex-direction: column; gap: 6px; margin: 12px 0 10px; padding: 0; list-style: none; }
.adm-funnel__row { display: grid; grid-template-columns: 116px minmax(0, 1fr) 24px 44px; gap: 10px; align-items: center; }
.adm-funnel__label { font: 500 14px/1.25 var(--font-body); color: var(--color-text); }
.adm-funnel__track { height: 20px; border-radius: 0 5px 5px 0; background: #F6F2EA; overflow: hidden; }
.adm-funnel__bar { display: block; height: 100%; min-width: 3px; border-radius: 0 5px 5px 0; }
.adm-funnel__bar--1 { background: #D6A433; }
.adm-funnel__bar--2 { background: #BC8C1B; }
.adm-funnel__bar--3 { background: #9C7314; }
.adm-funnel__bar--4 { background: #7A590D; }
.adm-funnel__bar--5 { background: #583F07; }
.adm-funnel__count { font: 600 15px/1 var(--font-body); text-align: right; font-variant-numeric: tabular-nums; }
.adm-funnel__share { font: 400 13px/1 var(--font-body); color: var(--color-text-muted); text-align: right; font-variant-numeric: tabular-nums; }

/* Derniers evenements et retours */
.adm-event {
  display: grid;
  grid-template-columns: 84px 8px minmax(0, 1fr);
  gap: 12px;
  align-items: baseline;
  padding: 8px 0;
  border-top: 1px solid var(--color-divider);
  font: 400 14px/1.4 var(--font-body);
}
.adm-card__note + .adm-event { margin-top: 8px; border-top: 0; }
.adm-event time { color: var(--color-text-muted); font-variant-numeric: tabular-nums; }
.adm-event .adm-dot { align-self: center; }
.adm-fb { padding: 12px 0; border-top: 1px solid var(--color-divider); }
.adm-card__head + .adm-fb { border-top: 0; }
.adm-fb__head { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; margin: 0; font: 600 15px/1.3 var(--font-body); }
.adm-fb__text { margin: 4px 0 2px; font: 400 14px/1.45 var(--font-body); color: var(--color-text); overflow-wrap: anywhere; }

/* Petites etiquettes : tons des pastilles d'etat, 13 px dans 21 px (regle
   de centrage de la skill ui-amelioration). */
.adm-tag {
  display: inline-flex;
  align-items: center;
  height: 21px;
  padding: 0 8px;
  border-radius: 999px;
  font: 600 13px/1 var(--font-body);
  white-space: nowrap;
}
.adm-tag--prep { color: #4A4436; background: #ECE7DC; }
.adm-tag--wait { color: #1A4677; background: #DEEAF7; }
.adm-tag--done { color: #18502F; background: #DAEFE1; }
.adm-tag--alert { color: #fff; background: #A61E14; }
.adm-tag--alert-soft { color: #8A1C1C; background: #F9DEDA; }
.adm-tag--closed { color: #454B52; background: #E6E9EC; }

/* Comptes : liste a gauche, fiche a droite. Sous 1100 px, une seule a la
   fois : la fiche ouverte remplace la liste, « Tous les comptes » y ramene. */
.adm-md { display: grid; grid-template-columns: minmax(0, 1fr); gap: 20px; align-items: start; }
.adm-list { min-width: 0; }
.adm-side { display: flex; flex-direction: column; gap: 6px; min-width: 0; scroll-margin-top: calc(var(--header-height) + 12px); }
.adm-back { display: inline-flex; align-items: center; gap: 6px; align-self: flex-start; min-height: 44px; font: 600 15px/1 var(--font-body); color: #8A6410; text-decoration: none; }
.adm-back svg { width: 18px; height: 18px; }
.adm-back:hover { text-decoration: underline; }
@media (min-width: 1100px) {
  .adm-md { grid-template-columns: minmax(340px, 400px) minmax(0, 1fr); }
  .adm-back { display: none; }
}
@media (max-width: 1099px) {
  .adm-md--fiche .adm-list,
  .adm-md:not(.adm-md--fiche) .adm-side { display: none; }
}
.adm-list__tools { display: flex; flex-direction: column; gap: 10px; padding: 14px; border-bottom: 1px solid var(--color-divider); }
.adm-search {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 48px;
  padding: 0 14px;
  border: 1.5px solid var(--color-field-border);
  border-radius: 12px;
  background: #fff;
  color: var(--color-text-muted);
}
.adm-search svg { width: 18px; height: 18px; flex-shrink: 0; }
.adm-search input { flex: 1; min-width: 0; height: 100%; border: 0; outline: 0; background: none; font: 400 16px var(--font-body); color: var(--color-text); }
.adm-search:focus-within { outline: 2px solid var(--color-header); outline-offset: 1px; }
.adm-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.adm-chip {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 36px;
  padding: 0 13px;
  border-radius: 999px;
  background: #fff;
  color: var(--color-text);
  font: 600 14px/1 var(--font-body);
  text-decoration: none;
  white-space: nowrap;
  box-shadow: 0 0 0 1px var(--lisere);
}
.adm-chip::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: max(100%, 44px);
  height: max(100%, 44px);
  transform: translate(-50%, -50%);
}
.adm-chip:hover { background: var(--color-hover); }
.adm-chip--on {
  background: var(--color-accent);
  color: var(--color-header);
  box-shadow: 0 0 0 1px var(--lisere-primaire);
  text-decoration: underline;
  text-underline-offset: 4px;
  text-decoration-thickness: 2px;
}
.adm-chip--on:hover { background: var(--color-accent); }
.adm-chip__count { font-weight: 500; opacity: .8; }
.adm-list__toggle { align-self: flex-start; }
.adm-row {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 11px 14px;
  border-top: 1px solid var(--color-divider);
  color: var(--color-text);
  text-decoration: none;
}
.adm-rows > .adm-row:first-child { border-top: 0; }
.adm-row:hover { background: var(--color-hover); }
.adm-row:focus-visible { outline: 2px solid var(--color-header); outline-offset: -2px; }
.adm-row--on { background: #F3EDE0; box-shadow: inset 0 0 0 2px var(--color-accent); }
.adm-row--on:hover { background: #F3EDE0; }
.adm-av {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  background: #ECE7DC;
  color: #4A4436;
  font: 600 14px/1 var(--font-body);
}
.adm-av--test { background: #F3EFE6; color: #6E6552; box-shadow: inset 0 0 0 1px #D6CCB7; }
.adm-av--ink { background: var(--color-header); color: #D9A227; }
.adm-av--xl { width: 60px; height: 60px; font-size: 20px; }
.adm-row__mid { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.adm-row__name { font: 600 15px/1.25 var(--font-body); overflow-wrap: anywhere; }
.adm-row__sub,
.adm-row__meta { font: 400 13px/1.35 var(--font-body); color: var(--color-text-muted); }
.adm-row__sub { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.adm-row__tags { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
.adm-low { color: #A32626; font-weight: 600; }
.adm-row .status { min-height: 26px; padding: 0 10px; font-size: 13px; gap: 6px; }
.adm-deleted { border-top: 1px solid var(--color-divider); }
.adm-deleted summary {
  padding: 14px;
  font: 600 14px/1.4 var(--font-body);
  color: var(--color-text-muted);
  cursor: pointer;
}
.adm-deleted__list { margin: 0; padding: 0 14px 12px; list-style: none; }
.adm-deleted__list li {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 12px;
  padding: 10px 0;
  border-top: 1px solid var(--color-divider);
  font: 400 14px/1.35 var(--font-body);
  overflow-wrap: anywhere;
}

/* Fiche d'un compte */
.adm-fiche { min-width: 0; }
.adm-fiche > .adm-empty { padding: 18px; }
.adm-fiche__head { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 14px 18px; padding: 18px 16px 16px; border-bottom: 1px solid var(--color-divider); }
.adm-fiche__id { flex: 1 1 260px; min-width: 0; }
.adm-fiche__name { margin: 0; font: 700 22px/1.2 var(--font-body); color: var(--color-text); overflow-wrap: anywhere; }
.adm-fiche__tags { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 8px 0 0; }
.adm-fiche__company { margin: 8px 0 0; font: 500 15px/1.35 var(--font-body); }
.adm-fiche__contact { margin: 2px 0 0; font: 400 14px/1.4 var(--font-body); color: var(--color-text-muted); overflow-wrap: anywhere; }
.adm-fiche__acts { display: flex; flex-wrap: wrap; gap: 8px; }
.adm-counts {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  margin: 0;
  background: var(--color-divider);
  border-bottom: 1px solid var(--color-divider);
}
.adm-counts div { padding: 10px 16px; background: #fff; }
.adm-counts dt { font: 400 13px/1.3 var(--font-body); color: var(--color-text-muted); }
.adm-counts dd { margin: 0; font: 500 24px/1.15 var(--font-display); font-variant-numeric: tabular-nums; }
.adm-counts--small { margin: 8px 0 12px; border: 1px solid var(--color-divider); border-radius: 12px; overflow: hidden; }
.adm-counts--small dd { font-size: 20px; }
@media (min-width: 760px) {
  .adm-counts:not(.adm-counts--small) { grid-template-columns: repeat(6, minmax(0, 1fr)); }
}
@media (min-width: 900px) {
  .adm-counts--small { grid-template-columns: repeat(6, minmax(0, 1fr)); }
}
.adm-fiche__body { display: grid; grid-template-columns: minmax(0, 1fr); gap: 22px 32px; padding: 18px 16px; }
@media (min-width: 760px) {
  .adm-fiche__body { grid-template-columns: repeat(2, minmax(0, 1fr)); padding: 20px; }
  .adm-fiche__head { padding: 20px; }
}
.adm-h {
  display: block;
  margin: 0 0 10px;
  font: 700 12px/1.2 var(--font-body);
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--color-text-muted);
}
.adm-steps { margin: 0; padding: 0; list-style: none; }
.adm-step {
  position: relative;
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 6px 0;
}
.adm-step + .adm-step::before {
  content: "";
  position: absolute;
  left: 10px;
  top: -6px;
  width: 2px;
  height: 12px;
  background: #E3DCCB;
}
.adm-step__ico {
  position: relative;
  z-index: 1;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: #fff;
  box-shadow: inset 0 0 0 2px #C2B69B;
}
.adm-step--done .adm-step__ico { background: #2E7D52; color: #fff; box-shadow: none; }
.adm-step__ico svg { width: 13px; height: 13px; stroke-width: 3; }
.adm-step__label { font: 500 14px/1.3 var(--font-body); color: var(--color-text-muted); }
.adm-step--done .adm-step__label { color: var(--color-text); }
.adm-step__when { font: 400 13px/1.3 var(--font-body); color: var(--color-text-muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.adm-weeks { display: flex; align-items: flex-end; gap: 8px; height: 72px; border-bottom: 1px solid #D6CCB7; }
.adm-weeks__col { flex: 1; display: flex; justify-content: center; align-items: flex-end; height: 100%; }
.adm-weeks__bar { display: block; width: 100%; max-width: 18px; border-radius: 3px 3px 0 0; background: #C2B69B; }
.adm-weeks__bar--now { background: #A8770F; }
.adm-weeks__bar--zero { background: #E3DCCB; }
.adm-weeks__axis { display: flex; justify-content: space-between; margin: 6px 0 0; font: 400 12px/1 var(--font-body); color: #7A6F57; }
.adm-gauge { margin-top: 16px; }
.adm-gauge__row { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 2px 10px; margin: 0 0 6px; font: 400 13px/1.35 var(--font-body); color: var(--color-text-muted); }
.adm-gauge__row b { color: var(--color-text); font-weight: 600; }
.adm-gauge__row--alone { margin-top: 16px; }
.adm-meter { display: block; position: relative; height: 6px; border-radius: 3px; background: #EFEAE0; overflow: hidden; }
.adm-meter__fill { position: absolute; inset: 0 auto 0 0; border-radius: 3px; background: #A8770F; }
.adm-meter--low .adm-meter__fill { background: #A32626; }
.adm-seg { display: inline-flex; flex-wrap: wrap; gap: 2px; padding: 3px; border-radius: 12px; background: #E9E3D6; }
.adm-seg__btn {
  min-height: 40px;
  padding: 0 16px;
  border: 0;
  border-radius: 9px;
  background: none;
  color: #4A4436;
  font: 500 14px/1 var(--font-body);
  cursor: pointer;
}
.adm-seg__btn:hover:not(:disabled) { background: rgba(255, 255, 255, .55); }
.adm-seg__btn:disabled { cursor: default; }
.adm-seg__btn--on { background: #fff; color: var(--color-header); font-weight: 700; box-shadow: 0 1px 2px rgba(31, 28, 18, .18); }
.adm-seg__btn:focus-visible { outline: 2px solid var(--color-header); outline-offset: 1px; }
.adm-fiche__billing { margin-top: 10px; font-size: 14px; }
.adm-gift { display: flex; flex-wrap: wrap; align-items: center; gap: 0 10px; margin-top: 18px; }
.adm-gift__label { flex: 0 0 100%; }
.adm-gift__unit { font: 500 14px/1.3 var(--font-body); color: var(--color-text); }
.adm .adm-gift__input { width: 76px; min-height: 44px; padding: 0 10px; text-align: center; font-size: 16px; }
.adm-notes {
  display: block;
  width: 100%;
  min-height: 96px;
  padding: 10px 12px;
  border: 1.5px solid var(--color-field-border);
  border-radius: 12px;
  background: #fff;
  font: 400 16px/1.45 var(--font-body);
  color: var(--color-text);
  resize: vertical;
}
.adm-notes:focus { outline: 2px solid var(--color-header); outline-offset: 1px; }
.adm-fiche__foot { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; padding: 12px 16px 16px; border-top: 1px solid var(--color-divider); }
.adm-fiche__spacer { flex: 1; }

/* IA : budget par compte (trait rouge a 80 % : alerte a 8 € sur 10 €) */
.adm-budget {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 4px 12px;
  align-items: center;
  padding: 8px 0;
  border-top: 1px solid var(--color-divider);
}
.adm-card__note + .adm-budget { margin-top: 8px; border-top: 0; }
.adm-budget__who { display: flex; flex-direction: column; min-width: 0; font: 400 13px/1.3 var(--font-body); }
.adm-budget__who b { font: 600 14px/1.3 var(--font-body); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.adm-budget__track { grid-column: 1 / -1; grid-row: 2; position: relative; height: 10px; border-radius: 0 4px 4px 0; background: #F3EFE6; }
.adm-budget__track::after { content: ""; position: absolute; left: 80%; top: -4px; bottom: -4px; width: 2px; border-radius: 1px; background: #A32626; }
.adm-budget__fill { display: block; height: 100%; min-width: 3px; border-radius: 0 4px 4px 0; background: #A8770F; }
.adm-budget__fill--alert { background: #A32626; }
.adm-budget__value { font: 600 14px/1 var(--font-body); font-variant-numeric: tabular-nums; }

/* Tableaux d'administration : titres et valeurs centres. Dans une carte de
   moins de 680 px (860 px pour le tableau des usages), chaque ligne
   s'empile : premiere cellule en titre, les autres precedees de leur
   data-label, deux par ligne (quatre pour les usages au-dela de 500 px). */
.adm-table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; container-type: inline-size; }
.adm-table { width: 100%; border-collapse: collapse; font: 400 14px/1.35 var(--font-body); font-variant-numeric: tabular-nums; }
.adm-table th,
.adm-table td { padding: 10px 12px; text-align: center; border-bottom: 1px solid var(--color-divider); white-space: nowrap; vertical-align: middle; }
.adm-table th { font: 600 12px/1.2 var(--font-body); letter-spacing: .06em; text-transform: uppercase; color: var(--color-text-muted); }
.adm-table tbody tr:last-child td { border-bottom: 0; }
.adm-table tbody tr:hover td { background: var(--color-hover); }
.adm-table code { font: 500 12px/1.3 ui-monospace, Menlo, monospace; color: #4A4436; }
.adm-table__usage { white-space: normal; }
.adm-table__usage b,
.adm-table__usage code { display: block; }
.adm-table__usage b { font: 600 14px/1.3 var(--font-body); }
@container (max-width: 679px) {
  .adm-table thead { display: none; }
  .adm-table,
  .adm-table tbody { display: block; }
  .adm-table tr { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 14px; padding: 12px 16px; border-bottom: 1px solid var(--color-divider); }
  .adm-table tbody tr:last-child { border-bottom: 0; }
  .adm-table td { min-width: 0; padding: 0; border: 0; text-align: left; white-space: normal; overflow-wrap: anywhere; }
  .adm-table td:first-child { grid-column: 1 / -1; font-weight: 600; }
  .adm-table td[data-label]::before { content: attr(data-label); display: block; font: 400 12px/1.4 var(--font-body); color: var(--color-text-muted); }
  .adm-table td:empty { display: none; }
  .adm-table tbody tr:hover td { background: none; }
}
@container (max-width: 859px) {
  .adm-table--wide thead { display: none; }
  .adm-table--wide,
  .adm-table--wide tbody { display: block; }
  .adm-table--wide tr { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 14px; padding: 12px 16px; border-bottom: 1px solid var(--color-divider); }
  .adm-table--wide tbody tr:last-child { border-bottom: 0; }
  .adm-table--wide td { min-width: 0; padding: 0; border: 0; text-align: left; white-space: normal; overflow-wrap: anywhere; }
  .adm-table--wide td:first-child { grid-column: 1 / -1; font-weight: 600; }
  .adm-table--wide td[data-label]::before { content: attr(data-label); display: block; font: 400 12px/1.4 var(--font-body); color: var(--color-text-muted); }
  .adm-table--wide tbody tr:hover td { background: none; }
}
@container (min-width: 500px) and (max-width: 859px) {
  .adm-table--wide tr { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

/* IA : qualite des devis */
.adm-hero { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 12px; margin: 12px 0 0; }
.adm-hero__value { font: 500 40px/1 var(--font-display); color: var(--color-text); }
.adm-hero__text { font: 500 15px/1.4 var(--font-body); color: var(--color-text); }
.adm-legend { display: flex; flex-wrap: wrap; gap: 6px 16px; margin: 14px 0 4px; font: 400 13px/1.3 var(--font-body); color: var(--color-text-muted); }
.adm-legend span { display: inline-flex; align-items: center; gap: 6px; }
.adm-swatch { display: inline-block; width: 10px; height: 10px; border-radius: 3px; }
.adm-swatch--kept { background: #2E7D52; }
.adm-swatch--modified { background: #D2A030; }
.adm-swatch--removed { background: #C42E2E; }
.adm-version {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 6px 14px;
  align-items: center;
  padding: 10px 0;
  border-top: 1px solid var(--color-divider);
  font: 400 13px/1.35 var(--font-body);
}
.adm-version b { display: block; font: 600 14px/1.3 var(--font-body); }
@media (min-width: 600px) {
  .adm-version { grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr); }
}
.adm-stack { display: flex; gap: 2px; height: 14px; border-radius: 4px; overflow: hidden; background: #F3EFE6; }
.adm-stack__part { display: block; height: 100%; }
.adm-version__shares { display: block; margin-top: 4px; }
.adm-emptybox { display: flex; gap: 12px; align-items: flex-start; margin-top: 12px; padding: 14px; border-radius: 12px; background: #F6F2EA; }
.adm-emptybox svg { width: 20px; height: 20px; flex-shrink: 0; color: #8A6410; }
.adm-emptybox p { margin: 0; font: 400 14px/1.45 var(--font-body); color: var(--color-text-muted); }
.adm-emptybox b { color: var(--color-text); }
.adm-h--gap { margin-top: 16px; }

/* Serveur : un controle par ligne */
.adm-check {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr) auto;
  gap: 2px 12px;
  align-items: start;
  padding: 12px 0;
  border-top: 1px solid var(--color-divider);
}
.adm-card__title + .adm-check { margin-top: 6px; border-top: 0; }
.adm-check__ico {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: #DAEFE1;
  color: #18502F;
}
.adm-check__ico svg { width: 14px; height: 14px; stroke-width: 3; }
.adm-check--alert .adm-check__ico { background: #F9DEDA; color: #A32626; }
.adm-check__name { font: 600 15px/1.35 var(--font-body); }
.adm-check__value { font: 600 15px/1.35 var(--font-body); text-align: right; }
.adm-check--alert .adm-check__value { color: #A32626; }
.adm-check__sub { grid-column: 2 / 4; font: 400 13px/1.45 var(--font-body); color: var(--color-text-muted); overflow-wrap: anywhere; }

/* Serveur : consoles en pied de chaque carte de controles, puis la carte
   « Acces directs » (un service par ligne : icone, nom, usage, fleche). */
.adm-consoles { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 4px; padding-top: 12px; border-top: 1px solid var(--color-divider); }
.adm-consoles--bare { margin: 0; padding: 0; border: 0; }
.adm-consoles .btn svg { width: 15px; height: 15px; }
.adm-links { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px 24px; margin-top: 14px; }
.adm-links__group { min-width: 0; }
.adm-links__list { margin: 0; padding: 0; list-style: none; }
.adm-link {
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr) 18px;
  gap: 12px;
  align-items: center;
  min-height: 56px;
  padding: 8px 10px;
  margin: 0 -10px;
  border-radius: 12px;
  color: var(--color-text);
  text-decoration: none;
}
.adm-link:hover { background: var(--color-hover); }
.adm-link:focus-visible { outline: 2px solid var(--color-header); outline-offset: 1px; }
.adm-link__ico { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; background: #F3EFE6; color: #4A4436; }
.adm-link__ico svg { width: 18px; height: 18px; }
.adm-link__text { display: flex; flex-direction: column; min-width: 0; font: 400 13px/1.35 var(--font-body); color: var(--color-text-muted); }
.adm-link__text b { font: 600 15px/1.3 var(--font-body); color: var(--color-text); }
.adm-link__out { display: grid; place-items: center; color: #8A6410; }
.adm-link__out svg { width: 16px; height: 16px; }
@media (min-width: 760px) {
  .adm-links { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (min-width: 1280px) {
  .adm-links { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .adm-links.adm-monitoring { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
.adm-monitoring { margin-top: 10px; }
.adm-h + .adm-check { padding-top: 4px; border-top: 0; }
.adm-monitoring__error { color: #A32626; font-weight: 600; }

/* Audience : periodes et consoles d'Umami, un bloc par site (chiffres,
   visites, classements), puis le parcours de la visite a l'abonnement. */
.adm-aud-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 16px; }
.adm-loading { min-height: 120px; }
.adm-aud,
.adm-aud-site { display: flex; flex-direction: column; gap: 20px; min-width: 0; }
.adm-aud-site { gap: 14px; }
.adm-aud-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 4px 16px; margin-top: 4px; }
.adm-aud-title { margin: 0; font: 600 20px/1.3 var(--font-body); color: var(--color-text); }
.adm-aud-steps { margin: 12px 0 0; padding-left: 22px; font: 400 15px/1.5 var(--font-body); color: var(--color-text); }
.adm-aud-steps li + li { margin-top: 6px; }
.adm-aud-steps code { font: 500 13px/1.3 ui-monospace, Menlo, monospace; }
.adm-rank { min-width: 0; }
.adm-rank__list { display: flex; flex-direction: column; gap: 10px; margin: 12px 0 0; padding: 0; list-style: none; }
.adm-rank__row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 12px; align-items: baseline; }
.adm-rank__label { overflow: hidden; font: 500 14px/1.3 var(--font-body); color: var(--color-text); text-overflow: ellipsis; white-space: nowrap; }
.adm-rank__value { font: 600 14px/1.3 var(--font-body); font-variant-numeric: tabular-nums; white-space: nowrap; }
.adm-rank__value small { font-size: 13px; font-weight: 400; color: var(--color-text-muted); }
.adm-rank__track { grid-column: 1 / -1; height: 6px; border-radius: 3px; background: #F3EFE6; }
.adm-rank__bar { display: block; height: 100%; min-width: 3px; border-radius: 3px; background: #C2B69B; }
.adm-funnel--wide .adm-funnel__row { grid-template-columns: 128px minmax(0, 1fr) 52px 44px; }
@media (min-width: 760px) {
  .adm-funnel--wide .adm-funnel__row { grid-template-columns: 170px minmax(0, 1fr) 64px 48px; }
}
/* Retours : une carte par retour, statut en trois boutons, note en ligne. */
.adm-fbk__scope { margin: 0; }
.adm-fbk-list { display: flex; flex-direction: column; gap: 14px; }
.adm-fbk { min-width: 0; }
.adm-fbk__head { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; }
.adm-fbk__date { margin-left: auto; font: 400 13px/1.3 var(--font-body); color: var(--color-text-muted); white-space: nowrap; }
.adm-fbk__title { margin: 10px 0 0; font: 600 17px/1.3 var(--font-body); color: var(--color-text); overflow-wrap: anywhere; }
.adm-fbk__meta { margin: 4px 0 0; font: 400 13px/1.45 var(--font-body); color: var(--color-text-muted); overflow-wrap: anywhere; }
.adm-fbk__meta code { font: 500 12px/1.3 ui-monospace, Menlo, monospace; color: #4A4436; }
.adm-fbk__desc { max-width: 75ch; margin: 10px 0 0; font: 400 15px/1.5 var(--font-body); color: var(--color-text); white-space: pre-wrap; overflow-wrap: anywhere; }
.adm-fbk__foot { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--color-divider); }
.adm-fbk__note { flex: 1 1 240px; min-width: 0; }
.adm-fbk__note .form-input { width: 100%; }
/* ==== [admin] fin ==== */
