/* PolyGold Gestion — styles. Téléphone d'abord. */
:root {
  --encre: #16323A;        /* bleu pétrole profond : en-tête, textes forts */
  --encre-2: #244A54;
  --or: #D9A73A;           /* or PolyGold : action principale */
  --or-fonce: #9A7214;
  --fond: #EEF2F2;         /* gris froid, évoque le polycarbonate */
  --surface: #FFFFFF;
  --trait: #D5DEDF;
  --texte: #1B2A2E;
  --texte-2: #55686D;
  --alerte: #B23A2B;
  --ok: #1F7A55;
  --rayon: 14px;
  --rapide: 130ms; --moyen: 220ms; --lent: 300ms;
  --entree: cubic-bezier(0.16, 1, 0.3, 1);
  --sortie: cubic-bezier(0.55, 0, 1, 0.45);
}
* { box-sizing: border-box; }
/* iPhone : pas de rebond de la page entière (la barre du bas restait entraînée en tirant vers le haut). Sur iOS, il faut le régler sur html, pas seulement sur body. */
html { -webkit-text-size-adjust: 100%; overscroll-behavior: none; background: var(--fond); }
body {
  margin: 0; background: var(--fond); color: var(--texte);
  font: 400 16px/1.5 Figtree, system-ui, -apple-system, "Segoe UI", sans-serif;
  font-variant-numeric: tabular-nums; overscroll-behavior-y: none; touch-action: manipulation;
  min-height: 100dvh;
}
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; padding: 0; touch-action: manipulation; }
:focus-visible { outline: 3px solid var(--or); outline-offset: 2px; }
h1, h2, p { margin: 0; }
.cache { display: none !important; }

/* ---------- Connexion ---------- */
.porte {
  min-height: 100dvh; background: var(--encre); color: #fff;
  display: grid; grid-template-rows: auto 1fr; justify-items: center;
  padding: calc(env(safe-area-inset-top) + 28px) 20px calc(env(safe-area-inset-bottom) + 24px);
}
.marque { display: flex; align-items: center; gap: 12px; }
.marque img { width: 44px; height: 44px; border-radius: 10px; }
.marque b { font-size: 22px; font-weight: 700; letter-spacing: -0.01em; }
.marque span { display: block; font-size: 14px; color: #A9BFC3; font-weight: 400; }
.porte-corps { width: 100%; max-width: 380px; align-self: center; padding: 24px 0; animation: monte var(--lent) var(--entree); }
.porte h1 { font-size: 26px; line-height: 1.2; font-weight: 600; margin-bottom: 6px; letter-spacing: -0.01em; }
.porte .aide { color: #A9BFC3; margin-bottom: 22px; min-height: 24px; }
.porte .aide.erreur { color: #FFB4A6; }
.personnes { display: grid; gap: 10px; }
.personne {
  display: flex; align-items: center; gap: 14px; width: 100%; min-height: 60px; padding: 10px 16px;
  background: var(--encre-2); border-radius: var(--rayon); color: #fff; font-size: 18px; font-weight: 500; text-align: left;
  transition: transform var(--rapide), background-color var(--rapide);
}
.personne:active { transform: scale(0.97); }
@media (hover: hover) { .personne:hover { background: #2D5A66; } }
.pastille { flex: none; width: 38px; height: 38px; border-radius: 50%; background: var(--or); color: var(--encre); display: grid; place-items: center; font-weight: 700; }
.points { display: flex; gap: 14px; justify-content: center; margin: 4px 0 26px; }
.points i { width: 16px; height: 16px; border-radius: 50%; border: 2px solid #6F8A90; transition: background-color var(--rapide), border-color var(--rapide), transform var(--rapide); }
.points i.plein { background: var(--or); border-color: var(--or); transform: scale(1.1); }
.points.secoue { animation: secoue 360ms var(--entree); }
.pave { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; max-width: 320px; margin: 0 auto; }
.pave button {
  height: 64px; border-radius: 16px; background: var(--encre-2); color: #fff; font-size: 26px; font-weight: 500;
  transition: transform var(--rapide), background-color var(--rapide);
}
.pave button:active { transform: scale(0.95); background: #33636F; }
.pave button.discret { background: transparent; font-size: 16px; color: #C9D8DB; }
.pave button:disabled { opacity: 0.4; }
.lien-clair { display: block; margin: 22px auto 0; min-height: 44px; padding: 0 12px; color: #C9D8DB; text-decoration: underline; text-underline-offset: 3px; }
.bouton.bio { margin-top: 22px; }
.saisie-invisible { position: absolute; opacity: 0; pointer-events: none; height: 0; width: 0; }

/* ---------- Coquille ---------- */
.entete {
  position: sticky; top: 0; z-index: 5; background: var(--encre); color: #fff;
  padding: calc(env(safe-area-inset-top) + 10px) 16px 10px; display: flex; align-items: center; gap: 12px;
}
.entete h1 { font-size: 19px; font-weight: 600; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.entete .retour, .entete .qui { min-width: 44px; min-height: 44px; display: grid; place-items: center; border-radius: 12px; color: #fff; }
.entete .retour { font-size: 24px; margin-left: -8px; }
.entete .retour:active, .entete .qui:active { background: var(--encre-2); }
.entete .qui .pastille { width: 34px; height: 34px; font-size: 14px; }
.page { max-width: 760px; margin: 0 auto; padding: 18px 16px calc(env(safe-area-inset-bottom) + 40px); animation: monte var(--moyen) var(--entree); }
.page > h2 { font-size: 15px; font-weight: 600; color: var(--texte-2); margin: 22px 4px 8px; }
.page > h2:first-child { margin-top: 0; }
.bonjour { font-size: 24px; font-weight: 600; letter-spacing: -0.01em; line-height: 1.25; margin: 4px 4px 2px; }
.sous { color: var(--texte-2); margin: 0 4px 18px; }

.liste { background: var(--surface); border-radius: var(--rayon); overflow: hidden; border: 1px solid var(--trait); }
.ligne {
  display: flex; align-items: center; gap: 12px; width: 100%; min-height: 60px; padding: 10px 14px; text-align: left;
  border-top: 1px solid var(--trait); transition: background-color var(--rapide);
}
.ligne:first-child { border-top: 0; }
button.ligne:active { background: #E4ECEC; }
@media (hover: hover) { button.ligne:hover { background: #F4F8F8; } }
.ligne .corps { flex: 1; min-width: 0; }
.ligne .titre { font-weight: 600; overflow-wrap: anywhere; }
.ligne .detail { color: var(--texte-2); font-size: 14px; overflow-wrap: anywhere; }
.ligne .fleche { color: #8FA2A6; font-size: 20px; flex: none; }
.ligne .pastille { background: #DCE7E8; color: var(--encre); }
.ligne.inactif .titre, .ligne.inactif .pastille { opacity: 0.5; }
.ligne.bientot { color: var(--texte-2); }
.ligne.bientot .titre { font-weight: 500; }
.etiquette { flex: none; font-size: 13px; font-weight: 600; padding: 3px 9px; border-radius: 999px; background: #E3ECED; color: var(--encre); white-space: nowrap; }
.etiquette.or { background: #F6E8C5; color: #6B4E08; }
.etiquette.rouge { background: #F6DAD5; color: #8A2619; }

.bouton {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 50px; padding: 10px 20px; border-radius: 12px;
  background: var(--or); color: #2A1F02; font-weight: 600; text-align: center;
  transition: transform var(--rapide), background-color var(--rapide), opacity var(--rapide);
}
.bouton:active { transform: scale(0.97); }
@media (hover: hover) { .bouton:hover { background: #E3B54E; } }
.bouton.large { width: 100%; }
.bouton.second { background: var(--surface); color: var(--encre); border: 1px solid var(--trait); }
@media (hover: hover) { .bouton.second:hover { background: #F4F8F8; } }
.bouton.danger { background: var(--surface); color: var(--alerte); border: 1px solid #E5BDB6; }
.bouton[disabled] { opacity: 0.55; pointer-events: none; }
.bouton.attente::before { content: ""; width: 16px; height: 16px; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent; animation: tourne 700ms linear infinite; }
.actions { display: grid; gap: 10px; margin-top: 18px; }

.champ { display: block; margin-bottom: 16px; }
.champ > span { display: block; font-weight: 600; margin-bottom: 6px; }
.champ input, .champ select {
  width: 100%; min-height: 50px; padding: 10px 14px; border-radius: 12px; border: 1px solid #B9C7C9; background: #fff; font-size: 16px;
}
.champ input:focus, .champ select:focus { outline: 3px solid var(--or); outline-offset: 1px; border-color: var(--or-fonce); }
.message-erreur { color: var(--alerte); font-weight: 500; margin: -6px 0 14px; }
.vide { text-align: center; color: var(--texte-2); padding: 34px 16px; }
.vide .bouton { margin-top: 14px; }

/* tableau de bord */
#tb { margin-bottom: 26px; }
.tb-tete { background: var(--encre); color: #fff; border-radius: var(--rayon); padding: 18px 18px 16px; margin-bottom: 18px; }
.tb-tete.os-bloc { height: 152px; opacity: 0.35; }
.tb-etiquette { color: #A9BFC3; font-weight: 500; }
.tb-grand { font-size: clamp(32px, 9.5vw, 46px); font-weight: 700; letter-spacing: -0.02em; line-height: 1.15; color: var(--or); margin: 2px 0 8px; overflow-wrap: anywhere; }
.tb-grand.negatif { color: #FFB4A6; }
.tb-grand small { font-size: 0.45em; font-weight: 600; letter-spacing: 0; color: #C9D8DB; }
.tb-calcul { color: #DCE7E8; }
.tb-calcul span { font-weight: 600; white-space: nowrap; }
.tb-source { color: #A9BFC3; font-size: 14px; margin-top: 8px; }
.tb-colonnes h2 { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; font-size: 15px; font-weight: 600; color: var(--texte-2); margin: 20px 4px 8px; }
.tb-colonnes > div > h2:first-child { margin-top: 0; }
.tb-colonnes h2 .montant { color: var(--texte); font-size: 16px; }
.montant { white-space: nowrap; font-variant-numeric: tabular-nums; }
.tb-bloc { background: var(--surface); border: 1px solid var(--trait); border-radius: var(--rayon); margin-bottom: 8px; overflow: hidden; }
.tb-bloc summary { display: flex; align-items: center; gap: 12px; min-height: 56px; padding: 8px 14px; cursor: pointer; list-style: none; }
.tb-bloc summary::-webkit-details-marker { display: none; }
.tb-bloc summary::before { content: "›"; color: #8FA2A6; font-size: 20px; width: 12px; flex: none; transition: transform var(--moyen) var(--entree); }
.tb-bloc[open] summary::before { transform: rotate(90deg); }
.tb-bloc summary .titre { flex: 1; min-width: 0; font-weight: 600; }
.tb-bloc summary .montant { font-weight: 700; }
.tb-bloc summary:active { background: #E4ECEC; }
.tb-ligne { display: flex; justify-content: space-between; align-items: baseline; gap: 14px; padding: 9px 14px 9px 38px; border-top: 1px solid var(--trait); }
.tb-ligne > span:first-child { min-width: 0; overflow-wrap: anywhere; color: var(--texte-2); }
.tb-bloc.statique .tb-ligne { padding-left: 14px; }
.tb-bloc.statique .tb-ligne:first-child { border-top: 0; }
.tb-ligne.alerte > span { color: var(--alerte); font-weight: 600; }
@media (min-width: 1100px) { .tb-colonnes { display: grid; grid-template-columns: 1fr 1fr; gap: 0 20px; align-items: start; } }

/* clients */
.cache-visuel { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
.recherche { display: block; margin-bottom: 12px; }
.recherche input { width: 100%; min-height: 50px; padding: 10px 16px; border-radius: 999px; border: 1px solid #B9C7C9; background: #fff; font-size: 16px; }
.recherche input:focus { outline: 3px solid var(--or); outline-offset: 1px; }
.puces { display: flex; gap: 8px; overflow-x: auto; padding: 2px 16px 10px; margin: 0 -16px; scrollbar-width: none; overscroll-behavior-x: contain; }
.puces::-webkit-scrollbar { display: none; }
.puce { flex: none; min-height: 44px; padding: 0 14px; border-radius: 999px; background: var(--surface); border: 1px solid var(--trait); font-weight: 500; white-space: nowrap; transition: background-color var(--rapide), color var(--rapide); }
.puce span { color: var(--texte-2); font-weight: 400; margin-left: 2px; }
.puce.choisie { background: var(--encre); color: #fff; border-color: var(--encre); }
.puce.choisie span { color: #C9D8DB; }
.compte { color: var(--texte-2); font-size: 14px; margin: 0 4px 8px; min-height: 21px; }
.ligne > .etiquette + .etiquette { display: none; }
.bouton.nouveau { margin-bottom: 14px; }
@media (min-width: 700px) { .bouton.nouveau { width: auto; float: right; margin-left: 12px; } .recherche { overflow: hidden; } }
.fiche-tete { background: var(--encre); color: #fff; border-radius: var(--rayon); padding: 18px; }
.fiche-nom { font-size: 22px; font-weight: 600; line-height: 1.25; overflow-wrap: anywhere; }
.fiche-sous { color: #C9D8DB; margin-top: 2px; }
.fiche-marques { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.tb-ligne .valeur { text-align: right; min-width: 0; overflow-wrap: anywhere; color: var(--texte); }
.ligne > .montant { flex: none; font-weight: 600; }
a.bouton { text-decoration: none; }
.actions.cote .large-2 { grid-column: 1 / -1; }
@media (max-width: 699px) { .actions.cote { grid-template-columns: 1fr 1fr; } }

/* devis */
.etiquette.vert { background: #D5ECDF; color: #14533A; }
.ligne .droite { flex: none; display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.ligne .droite .montant { font-weight: 600; }
.ligne.seule { background: var(--surface); border: 1px solid var(--trait); border-radius: var(--rayon); }
.tb-ligne.fort > span { color: var(--texte); font-weight: 700; font-size: 17px; }
.totaux { margin-top: 16px; margin-bottom: 20px; }
.conditions { padding: 12px 14px; white-space: pre-line; color: var(--texte-2); }
.edl { background: var(--surface); border: 1px solid var(--trait); border-radius: var(--rayon); padding: 12px 14px; margin-bottom: 8px; }
.edl-tete { display: flex; align-items: flex-start; gap: 10px; }
.edl-tete .titre { flex: 1; min-width: 0; font-weight: 600; overflow-wrap: anywhere; padding-top: 10px; }
.edl-retirer { flex: none; min-height: 44px; padding: 0 10px; color: var(--alerte); font-weight: 500; border-radius: 10px; }
.edl-retirer:active { background: #F6DAD5; }
.edl-champs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 4px; }
.edl-champs label > span { display: block; font-size: 14px; color: var(--texte-2); margin-bottom: 4px; }
.edl-champs input { width: 100%; min-height: 48px; padding: 8px 10px; border-radius: 10px; border: 1px solid #B9C7C9; font-size: 16px; text-align: right; font-variant-numeric: tabular-nums; }
.edl-champs input:focus { outline: 3px solid var(--or); outline-offset: 1px; }
.edl-champs input.faux { border-color: var(--alerte); background: #FBEDEA; }
.edl-pied { display: flex; justify-content: flex-end; align-items: center; gap: 10px; margin-top: 10px; font-weight: 700; }
.champ textarea { width: 100%; padding: 10px 14px; border-radius: 12px; border: 1px solid #B9C7C9; background: #fff; font: inherit; font-size: 16px; resize: vertical; }
.champ textarea:focus { outline: 3px solid var(--or); outline-offset: 1px; }
#e-ajouter { margin-top: 4px; }
.panneau .recherche { position: sticky; top: -20px; background: var(--surface); padding: 8px 0; z-index: 1; margin-bottom: 4px; }

.note { background: #F6E8C5; color: #3D2C03; border-radius: 12px; padding: 12px 14px; margin-top: 14px; }

.bouton.petit { min-height: 44px; padding: 6px 14px; border-radius: 10px; font-size: 15px; }
.ligne .corps.lien { text-align: left; min-height: 44px; }
#w-reste .tb-bloc { margin-top: 0; }

/* squelettes de chargement */
.os { height: 60px; border-top: 1px solid var(--trait); display: flex; align-items: center; gap: 12px; padding: 0 14px; }
.os:first-child { border-top: 0; }
.os::before { content: ""; width: 38px; height: 38px; border-radius: 50%; background: #E1E9EA; flex: none; }
.os::after { content: ""; height: 14px; width: 55%; border-radius: 7px; background: #E1E9EA; animation: pulse 1.1s ease-in-out infinite alternate; }

/* journal */
.jour { font-size: 14px; font-weight: 600; color: var(--texte-2); margin: 20px 4px 8px; }
.jour:first-child { margin-top: 0; }
.ligne .heure { flex: none; width: 46px; color: var(--texte-2); font-size: 14px; }

/* panneau (fenêtre du bas sur téléphone, centrée sur PC) */
.voile { position: fixed; inset: 0; z-index: 20; background: rgba(14, 32, 37, 0.55); display: grid; align-items: end; animation: fondu var(--moyen) var(--entree); overscroll-behavior: contain; }
.panneau {
  background: var(--surface); border-radius: 20px 20px 0 0; padding: 20px 18px calc(env(safe-area-inset-bottom) + 20px);
  max-height: 92dvh; overflow-y: auto; overscroll-behavior: contain; width: 100%; animation: glisse var(--lent) var(--entree); transform-origin: bottom;
}
.panneau h2 { font-size: 20px; font-weight: 600; margin-bottom: 4px; }
.panneau .intro { color: var(--texte-2); margin-bottom: 18px; }
.code-affiche { font-size: 40px; font-weight: 700; letter-spacing: 0.18em; text-align: center; padding: 18px 8px; margin: 6px 0 12px; background: #F6E8C5; color: #3D2C03; border-radius: 14px; user-select: all; }
@media (min-width: 700px) {
  .voile { align-items: center; justify-items: center; }
  .panneau { max-width: 460px; border-radius: 20px; padding: 26px; }
  .page { padding-top: 26px; }
  .actions.cote { grid-template-columns: 1fr 1fr; }
}
@media (min-width: 1100px) {
  .page { max-width: 880px; }
  .tuiles { display: grid; grid-template-columns: 1fr 1fr; gap: 0 20px; align-items: start; }
}

#toast {
  position: fixed; left: 50%; bottom: calc(env(safe-area-inset-bottom) + 20px); transform: translate(-50%, 20px); z-index: 40;
  background: var(--encre); color: #fff; padding: 12px 18px; border-radius: 12px; max-width: min(92vw, 420px); text-align: center;
  opacity: 0; pointer-events: none; transition: opacity var(--moyen) var(--entree), transform var(--moyen) var(--entree);
}
#toast.visible { opacity: 1; transform: translate(-50%, 0); }
#toast.erreur { background: var(--alerte); }

@keyframes monte { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes glisse { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }
@keyframes fondu { from { opacity: 0; } to { opacity: 1; } }
@keyframes tourne { to { transform: rotate(360deg); } }
@keyframes pulse { from { opacity: 1; } to { opacity: 0.45; } }
@keyframes secoue { 0%, 100% { transform: translateX(0); } 20% { transform: translateX(-9px); } 40% { transform: translateX(8px); } 60% { transform: translateX(-6px); } 80% { transform: translateX(4px); } }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 1ms !important; transition-duration: 1ms !important; }
}

/* show-room : vente rapide */
.sous-titre { font-size: 15px; font-weight: 600; color: var(--texte-2); margin: 22px 4px 8px; }
.articles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
@media (min-width: 700px) { .articles { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (min-width: 1100px) { .articles { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.article { position: relative; background: var(--surface); border: 1px solid var(--trait); border-radius: var(--rayon); transition: border-color var(--rapide), box-shadow var(--rapide); }
.article.pris { border-color: var(--or-fonce); box-shadow: inset 0 0 0 1px var(--or-fonce); }
.article-plus { display: flex; flex-direction: column; gap: 2px; width: 100%; min-height: 112px; padding: 12px 12px 12px; text-align: left; border-radius: var(--rayon); transition: transform var(--rapide), background-color var(--rapide); }
.article-plus:active { transform: scale(0.97); background: #F4F8F8; }
.article-nom { font-weight: 600; line-height: 1.25; overflow-wrap: anywhere; padding-right: 30px; flex: 1; }
.article-prix { font-weight: 700; font-size: 18px; }
.article-stock { color: var(--texte-2); font-size: 13px; }
.article-stock.zero { color: var(--alerte); }
.article-qte { position: absolute; top: -8px; right: -6px; min-width: 30px; height: 30px; padding: 0 8px; border-radius: 15px; background: var(--encre); color: #fff; font-weight: 700; display: grid; place-items: center; pointer-events: none; animation: monte var(--moyen) var(--entree); }
.article-moins { position: absolute; right: 6px; bottom: 6px; width: 46px; height: 46px; border-radius: 12px; background: #EEF2F2; color: var(--encre); font-size: 24px; font-weight: 600; display: grid; place-items: center; transition: transform var(--rapide), background-color var(--rapide); }
.article-moins:active { transform: scale(0.94); background: #DCE7E8; }
.barre-espace { height: 84px; }
.barre-panier { position: fixed; left: 0; right: 0; bottom: 0; z-index: 10; display: flex; align-items: center; gap: 12px; padding: 12px 16px calc(env(safe-area-inset-bottom) + 12px); background: var(--encre); color: #fff;
  transform: translateY(110%); opacity: 0; pointer-events: none; transition: transform var(--lent) var(--entree), opacity var(--moyen) var(--entree); }
.barre-panier.visible { transform: none; opacity: 1; pointer-events: auto; }
.barre-texte { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.25; color: #C9D8DB; }
.barre-texte b { color: #fff; font-size: 22px; font-weight: 700; }
.barre-panier .bouton { min-width: 150px; }
@media (min-width: 900px) { .barre-panier { left: 50%; right: auto; bottom: 20px; width: min(560px, 92vw); transform: translate(-50%, 140%); border-radius: 16px; padding: 12px 16px; box-shadow: 0 10px 30px rgba(14, 32, 37, 0.3); } .barre-panier.visible { transform: translate(-50%, 0); } }
.champ-titre { font-weight: 600; margin: 4px 0 8px; }
.choix { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.choix .puce { min-height: 48px; padding: 0 16px; }
.rendu { font-size: 20px; font-weight: 700; color: var(--ok); margin: -6px 0 16px; }
.rendu.manque { color: var(--alerte); }
.pas { flex: none; display: flex; align-items: center; gap: 4px; }
.pas button { width: 44px; height: 44px; border-radius: 10px; background: #EEF2F2; font-size: 22px; font-weight: 600; color: var(--encre); transition: transform var(--rapide), background-color var(--rapide); }
.pas button:active { transform: scale(0.94); background: #DCE7E8; }
.pas b { min-width: 34px; text-align: center; font-size: 18px; }
.edl-pied .remise { margin-right: auto; display: flex; align-items: center; gap: 8px; font-weight: 500; color: var(--texte-2); font-size: 15px; }
.edl-pied .remise input { width: 76px; min-height: 44px; padding: 6px 10px; border-radius: 10px; border: 1px solid #B9C7C9; font-size: 16px; text-align: right; }
.fait { text-align: center; padding: 6px 0 4px; }
.coche { display: inline-grid; place-items: center; width: 56px; height: 56px; border-radius: 50%; background: #D5ECDF; color: var(--ok); font-size: 30px; font-weight: 700; margin-bottom: 10px; animation: monte var(--lent) var(--entree); }
.fait-total { font-size: 34px; font-weight: 700; letter-spacing: -0.02em; margin: 4px 0 10px; }
.fait-total small { font-size: 0.45em; color: var(--texte-2); font-weight: 600; }
.fait .rendu { margin: 0 0 10px; }

/* étape 7 : cartes, alertes, cases, signature */
.point { flex: none; width: 12px; height: 12px; border-radius: 50%; background: var(--or); }
.point.rouge { background: var(--alerte); }
#alertes:not(:empty) { margin-bottom: 22px; }
#alertes .sous-titre { margin-top: 0; }
.carte { background: var(--surface); border: 1px solid var(--trait); border-radius: var(--rayon); padding: 14px; margin-bottom: 10px; }
.carte.passee { background: #F7F9F9; }
.carte-tete { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; margin-bottom: 4px; }
.carte-tete .titre { font-weight: 700; font-size: 17px; min-width: 0; overflow-wrap: anywhere; }
.carte .detail { color: var(--texte-2); font-size: 14px; overflow-wrap: anywhere; }
.carte-lignes { margin-top: 10px; border-top: 1px solid var(--trait); }
.carte-lignes > div { display: flex; justify-content: space-between; align-items: baseline; gap: 14px; padding: 8px 0; border-bottom: 1px solid var(--trait); }
.carte-lignes > div > span:first-child { min-width: 0; overflow-wrap: anywhere; }
.carte-lignes .valeur { text-align: right; min-width: 0; overflow-wrap: anywhere; color: var(--texte-2); font-size: 14px; }
.carte-lignes .fort { font-weight: 700; }
.carte-histo { margin-top: 10px; font-size: 14px; color: var(--texte-2); }
.carte-histo p { margin: 4px 0; overflow-wrap: anywhere; }
.carte-histo b { color: var(--texte); font-weight: 600; }
.carte-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.carte-actions .bouton { flex: 1 1 auto; }
.bouton.petit.danger { min-height: 44px; }
@media (min-width: 1100px) { .grille-cartes { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; align-items: start; } }
.case { display: flex; align-items: center; gap: 12px; min-height: 48px; padding: 4px 2px; cursor: pointer; }
.case input { width: 24px; height: 24px; flex: none; accent-color: var(--encre); }
.case span { min-width: 0; overflow-wrap: anywhere; }
.cases { max-height: 260px; overflow-y: auto; border: 1px solid var(--trait); border-radius: 12px; padding: 4px 12px; margin-bottom: 16px; overscroll-behavior: contain; }
.champ.serre { margin-bottom: 8px; }
.edl-champs.deux { grid-template-columns: 1fr auto; }
.edl-champs { align-items: end; }
.edl-champs .edl-retirer { min-height: 48px; }
.signature { display: block; width: 100%; height: auto; aspect-ratio: 640 / 260; background: #fff; border: 2px dashed #B9C7C9; border-radius: 12px; touch-action: none; margin-bottom: 10px; }
.carte-lignes > div:has(.valeur) > span:first-child { flex: none; }
.carte-lignes .valeur { flex: 1; }

/* étape 8 : simulateur de logo en 3D */
.vue3d { position: relative; width: 100%; aspect-ratio: 4 / 3; max-height: 56vh; border-radius: var(--rayon); overflow: hidden; border: 1px solid var(--trait); background: radial-gradient(circle at 50% 35%, #FFFFFF 0%, #DDE6E7 70%, #C5D2D4 100%); }
.vue3d-vide { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; padding: 20px; color: var(--texte-2); pointer-events: none; }
.compte.centre { text-align: center; margin-top: 8px; }
.bat-grille { margin-top: 14px; }
.bouton.serre { margin: -6px 0 16px; }
.champ input[type="range"] { padding: 0; min-height: 44px; border: 0; background: none; accent-color: var(--encre); }
.champ input[type="color"] { padding: 4px; height: 50px; }
.champ input[type="file"] { padding: 10px; font-size: 16px; }
.fige .champ, .fige .case { opacity: 0.65; }
@media (min-width: 1100px) { .bat-grille { display: grid; grid-template-columns: 1.15fr 1fr; gap: 0 26px; align-items: start; } .bat-grille > div:first-child { position: sticky; top: 84px; } }
.bat-grille > div:first-child { position: sticky; top: calc(env(safe-area-inset-top) + 64px); z-index: 2; background: var(--fond); padding: 6px 0 2px; margin-bottom: 8px; }
@media (max-width: 1099px) { .bat-grille .vue3d { max-height: 34vh; } .bat-grille .compte.centre { margin: 6px 0 4px; font-size: 13px; } }

/* documents et scanner (moteur repris de l'appli Sola Perso, aux couleurs PolyGold) */
.dc-actions { margin: 0 0 14px; }
.deux-champs { display: grid; grid-template-columns: 1fr 1fr; gap: 0 10px; }
.deux-champs .champ { min-width: 0; }
.champ.doute input, .champ.doute select { background: #FFF3A8; border-color: #C99700; box-shadow: 0 0 0 2px #F5D34A; }
.champ.doute > span::after { content: " (à vérifier)"; color: #7A5A00; font-weight: 500; }
.dd-form { margin-top: 18px; }
.scan-pages { display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 10px; margin: 4px 0 14px; }
.scan-pages:empty { display: none; }
.scan-p { position: relative; border: 1px solid var(--trait); border-radius: 10px; overflow: hidden; background: #fff; aspect-ratio: 3 / 4; }
.scan-p img { width: 100%; height: 100%; object-fit: cover; display: block; }
.scan-p button { position: absolute; top: 4px; right: 4px; width: 32px; height: 32px; border-radius: 50%; background: rgba(0, 0, 0, .6); color: #fff; font-size: 18px; line-height: 1; }
.scan-p span { position: absolute; left: 6px; bottom: 4px; font-size: 12px; background: rgba(255, 255, 255, .85); border-radius: 6px; padding: 0 5px; }
.sheet-bg { position: fixed; inset: 0; background: rgba(14, 32, 37, .55); z-index: 260; display: flex; align-items: flex-end; justify-content: center; animation: fondu var(--moyen) var(--entree); overscroll-behavior: contain; }
.sheet { background: #fff; width: 100%; max-width: 640px; max-height: 92dvh; overflow: auto; border-radius: 20px 20px 0 0; padding: 16px 16px calc(16px + env(safe-area-inset-bottom)); animation: glisse var(--lent) var(--entree); overscroll-behavior: contain; }
.sheet h3 { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 0 0 8px; font-size: 20px; font-weight: 600; }
.sheet .x { width: 44px; height: 44px; border-radius: 50%; background: #EEF2F2; font-size: 24px; color: var(--encre); flex: none; }
.sheet .small { font-size: 14px; color: var(--texte-2); }
.sheet .actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 14px; }
.sheet .btn { min-height: 50px; padding: 8px 12px; border-radius: 12px; font-weight: 600; background: var(--surface); color: var(--encre); border: 1px solid var(--trait); }
.sheet .btn.ball { background: var(--or); color: #2A1F02; border-color: var(--or); }
.sheet .btn:disabled { opacity: .55; }
@media (min-width: 700px) { .sheet-bg { align-items: center; } .sheet { border-radius: 20px; } }
.lien-btn { display: block; margin: 10px auto 0; color: var(--texte-2); text-decoration: underline; font-size: 14px; min-height: 44px; }
.recadre { position: relative; touch-action: none; user-select: none; -webkit-user-select: none; margin: 0 auto; max-height: 62vh; width: fit-content; max-width: 100%; }
.recadre img { display: block; max-width: 100%; max-height: 62vh; border-radius: 10px; }
.recadre svg { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.recadre polygon { fill: rgba(217, 167, 58, .2); stroke: #D9A73A; stroke-width: 6; vector-effect: non-scaling-stroke; }
.recadre .coin { position: absolute; width: 44px; height: 44px; margin: -22px 0 0 -22px; border-radius: 50%; background: rgba(255, 255, 255, .35); border: 3px solid #D9A73A; box-shadow: 0 1px 6px rgba(0, 0, 0, .35); touch-action: none; cursor: grab; }
.recadre .coin::after { content: ""; position: absolute; left: 50%; top: 50%; width: 8px; height: 8px; margin: -4px; border-radius: 50%; background: #D9A73A; }
.cam { position: fixed; inset: 0; z-index: 200; background: #000; display: flex; flex-direction: column; touch-action: none; }
.cam video, .cam svg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; }
.cam svg polygon { fill: rgba(217, 167, 58, .25); stroke: #D9A73A; stroke-width: 8; vector-effect: non-scaling-stroke; stroke-linejoin: round; opacity: 0; transition: opacity .15s; }
.cam svg.vu polygon { opacity: 1; }
.cam svg.pret polygon { stroke: #7CFC9A; fill: rgba(124, 252, 154, .25); }
.cam.flash::after { content: ""; position: absolute; inset: 0; background: #fff; opacity: .7; }
.cam-haut { position: relative; z-index: 2; display: flex; align-items: center; gap: 10px; padding: calc(env(safe-area-inset-top) + 10px) 14px 10px; background: linear-gradient(rgba(0, 0, 0, .65), transparent); color: #fff; }
.cam-msg { flex: 1; text-align: center; font-weight: 600; font-size: 15px; text-shadow: 0 1px 3px #000; }
.cam-x { width: 44px; height: 44px; border-radius: 50%; background: rgba(255, 255, 255, .18); color: #fff; font-size: 26px; }
.cam-auto { min-width: 72px; height: 44px; border-radius: 22px; border: 2px solid rgba(255, 255, 255, .6); color: #fff; font-weight: 700; }
.cam-auto.on { background: var(--or); border-color: var(--or); color: #2A1F02; }
.cam-modes { position: relative; z-index: 2; display: flex; justify-content: center; gap: 6px; padding: 0 12px; }
.cam-modes button { height: 44px; padding: 0 14px; border-radius: 22px; border: 1.5px solid rgba(255, 255, 255, .55); background: rgba(0, 0, 0, .35); color: #fff; font-size: 14px; font-weight: 600; }
.cam-modes button.on { background: #fff; color: #111; border-color: #fff; }
.cam-bas { position: absolute; left: 0; right: 0; bottom: 0; z-index: 2; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 16px calc(env(safe-area-inset-bottom) + 18px); background: linear-gradient(transparent, rgba(0, 0, 0, .75)); }
.cam-pages { flex: 1; display: flex; gap: 6px; overflow-x: auto; min-width: 0; }
.cam-p { position: relative; flex: none; width: 44px; height: 56px; border: 2px solid #fff; border-radius: 6px; overflow: hidden; background: #222; }
.cam-p img { width: 100%; height: 100%; object-fit: cover; }
.cam-p span { position: absolute; right: 2px; bottom: 1px; font-size: 11px; font-weight: 700; color: #fff; text-shadow: 0 0 3px #000; }
.cam-dec { flex: none; width: 72px; height: 72px; border-radius: 50%; border: 5px solid #fff; background: rgba(255, 255, 255, .85); box-shadow: 0 0 0 3px rgba(0, 0, 0, .25); }
.cam-dec:active { transform: scale(.94); }
.cam-dec:disabled { opacity: .5; }
.cam-fin { flex: 1; max-width: 150px; height: 48px; border-radius: 24px; background: var(--or); color: #2A1F02; font-weight: 700; font-size: 15px; }
.cam-fin:disabled { opacity: .45; }

/* contacts à confirmer */
.contact-carte { margin-bottom: 12px; padding: 14px; }
.contact-carte .titre { font-weight: 700; margin: 0 0 4px; }
.contact-carte .titre a { color: inherit; }
.contact-carte .detail { margin: 0 0 8px; }
.contact-carte .adresse { overflow-wrap: anywhere; }
.contact-carte .actions { margin-top: 10px; }
#ce-choix { margin-bottom: 12px; }

/* recherche générale */
.entete .loupe { margin-right: -4px; }
.fausse-recherche { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 50px; padding: 10px 16px; margin: 4px 0 16px; border-radius: 999px; border: 1px solid #B9C7C9; background: #fff; color: #5B6E72; font-size: 16px; text-align: left; }
.fausse-recherche span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fausse-recherche:active { background: #F3F6F6; }
.fausse-recherche:focus-visible { outline: 3px solid var(--or); outline-offset: 1px; }
#rg-ici .sous-titre, #rg-base .sous-titre { margin: 14px 0 8px; }
.contact-carte .detail a { color: inherit; }

/* boîte de réception */
.message-recu { white-space: pre-wrap; overflow-wrap: anywhere; background: #F3F6F6; border: 1px solid var(--trait); border-radius: var(--rayon); padding: 12px 14px; margin: 0 0 16px; max-height: 38vh; overflow: auto; overscroll-behavior: contain; font-size: 15px; line-height: 1.5; }
.ligne .point:not(.or):not(.rouge) { background: #C3CFD1; }

/* ---------- fichiers joints (envoi) et pièces jointes reçues ---------- */
.pieces { display: grid; gap: 8px; margin: 0 0 16px; }
.piece { display: flex; align-items: center; gap: 8px; min-width: 0; background: var(--surface); border: 1px solid var(--trait); border-radius: var(--rayon); padding: 4px 4px 4px 14px; }
.piece-nom { flex: 1; min-width: 0; overflow-wrap: anywhere; font-weight: 500; line-height: 1.3; padding: 6px 0; }
.piece-nom small { color: var(--texte-2); font-weight: 400; font-size: 13px; }
.piece-retirer { flex: none; width: 44px; height: 44px; border-radius: 10px; color: var(--texte-2); font-size: 18px; transition: background-color var(--rapide); }
.piece-retirer:active { background: #E6ECED; }
.piece-ajout { position: relative; cursor: pointer; text-align: center; }
.cache-fichier { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.piece-ajout:focus-within { outline: 2px solid var(--or); outline-offset: 2px; }
.pieces-recues { margin: 0 0 16px; display: grid; gap: 8px; }
.pieces-titre { margin: 0; font-size: 13px; font-weight: 700; color: var(--texte-2); text-transform: uppercase; letter-spacing: .04em; }
.piece-recue { min-width: 0; }
.piece-recue .ligne { width: 100%; border: 1px solid var(--trait); border-radius: var(--rayon); }
.piece-recue .titre { overflow-wrap: anywhere; }
.piece-image { display: block; max-width: 100%; max-height: 46vh; margin: 0 auto 8px; border-radius: var(--rayon); border: 1px solid var(--trait); background: #fff; }
.piece-legende { margin: 0 0 8px; font-size: 13px; color: var(--texte-2); overflow-wrap: anywhere; text-align: center; }
.piece-recue .actions { margin: 0; }

/* ---------- navigation : barre du bas (téléphone, tablette), colonne de gauche (PC) ---------- */
.cadre { min-height: 100dvh; }
.nav { position: fixed; left: 0; right: 0; bottom: 0; z-index: 8; background: var(--surface); border-top: 1px solid var(--trait); padding-bottom: env(safe-area-inset-bottom); }
.nav-marque, .nav-creer, .nav-sous { display: none; }
.nav-liste { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; max-width: 640px; margin: 0 auto; }
.nav-lien { position: relative; display: grid; justify-items: center; gap: 1px; min-height: 58px; padding: 8px 2px 6px; color: var(--texte-2); font-size: 12.5px; font-weight: 500; transition: color var(--rapide); }
.nav-lien svg { width: 24px; height: 24px; }
.nav-lien.ici { color: var(--encre); font-weight: 700; }
.nav-lien.ici::before { content: ""; position: absolute; top: 0; left: 26%; right: 26%; height: 3px; border-radius: 0 0 3px 3px; background: var(--or); }
.nav-lien:active { background: #F1F5F5; }
.nav-pastille { position: absolute; top: 5px; left: calc(50% + 6px); min-width: 19px; height: 19px; padding: 0 5px; border-radius: 999px; background: var(--alerte); color: #fff; font: 700 11.5px/19px Figtree, system-ui, sans-serif; font-style: normal; text-align: center; }
.cadre:not(.nu) .page { padding-bottom: calc(env(safe-area-inset-bottom) + 150px); }
.cadre:not(.nu) ~ #toast, body:has(.cadre:not(.nu)) #toast { bottom: calc(env(safe-area-inset-bottom) + 78px); }
.flottant { position: fixed; right: 16px; bottom: calc(env(safe-area-inset-bottom) + 72px); z-index: 9; width: 58px; height: 58px; border-radius: 50%; display: grid; place-items: center; background: var(--or); color: #2A1F02; box-shadow: 0 6px 18px rgba(22, 50, 58, 0.28); transition: transform var(--rapide); }
.flottant svg { width: 28px; height: 28px; stroke-width: 2.4; }
.flottant:active { transform: scale(0.94); }
.cadre.nu .nav, .cadre.nu .flottant { display: none; }
.page.large { max-width: 1180px; }
@media (min-width: 1100px) {
  .cadre:not(.nu) { padding-left: 236px; }
  .nav { top: 0; right: auto; width: 236px; border-top: 0; background: var(--encre); color: #fff; padding: 18px 12px 20px; overflow-y: auto; overscroll-behavior: contain; display: flex; flex-direction: column; gap: 6px; }
  .nav-marque { display: block; text-align: left; padding: 4px 10px 14px; color: #fff; border-radius: 10px; }
  .nav-marque b { display: block; font-size: 21px; font-weight: 700; letter-spacing: -0.01em; }
  .nav-marque span { font-size: 13.5px; color: #A9BFC3; }
  .nav-creer { display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 46px; margin: 0 0 12px; border-radius: 12px; background: var(--or); color: #2A1F02; font-weight: 700; transition: background-color var(--rapide), transform var(--rapide); }
  .nav-creer:hover { background: #E3B54E; } .nav-creer:active { transform: scale(0.98); }
  .nav-liste { display: flex; flex-direction: column; gap: 2px; max-width: none; margin: 0; }
  .nav-lien { display: flex; align-items: center; justify-items: start; gap: 12px; min-height: 46px; padding: 0 12px; border-radius: 10px; color: #C9D8DB; font-size: 16px; text-align: left; }
  .nav-lien:hover { background: var(--encre-2); color: #fff; } .nav-lien:active { background: var(--encre-2); }
  .nav-lien.ici { background: var(--or); color: #2A1F02; }
  .nav-lien.ici::before { display: none; }
  .nav-lien span { flex: 1; }
  .nav-pastille { position: static; }
  .nav-sous { display: grid; gap: 1px; margin: 2px 0 8px 22px; padding-left: 12px; border-left: 2px solid var(--encre-2); }
  .nav-sous-lien { text-align: left; min-height: 36px; padding: 4px 10px; border-radius: 8px; color: #C9D8DB; font-size: 14.5px; }
  .nav-sous-lien:hover { background: var(--encre-2); color: #fff; }
  .nav-sous-lien.ici { color: #fff; font-weight: 700; background: var(--encre-2); }
  .flottant { display: none; }
  .cadre:not(.nu) .page { padding-bottom: 60px; }
  .cadre .entete { background: var(--surface); color: var(--texte); border-bottom: 1px solid var(--trait); }
  .cadre .entete .retour, .cadre .entete .qui { color: var(--encre); }
  .cadre .entete .retour:active, .cadre .entete .qui:active, .cadre .entete .retour:hover, .cadre .entete .loupe:hover { background: #EEF2F2; }
  body:has(.cadre:not(.nu)) #toast { bottom: 24px; left: calc(50% + 118px); }
}

/* ---------- accueil : pilotage ---------- */
.acc-tete { display: grid; gap: 4px; }
.acc-creer { margin-bottom: 8px; }
.acc-creer .puce { display: inline-flex; align-items: center; gap: 6px; padding: 0 14px 0 10px; font-weight: 600; }
.acc-creer .puce svg { width: 18px; height: 18px; color: var(--or-fonce); stroke-width: 2.6; }
.tb-bouton { display: block; width: 100%; text-align: left; transition: transform var(--rapide); }
.tb-bouton > span { display: block; }
.tb-bouton:active { transform: scale(0.995); }
.tb-bouton .tb-source { text-decoration: underline; text-decoration-color: rgba(255, 255, 255, 0.35); text-underline-offset: 3px; }
.kpis { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin: 0 0 6px; }
.kpi { display: flex; flex-direction: column; gap: 2px; min-width: 0; min-height: 118px; text-align: left; background: var(--surface); border: 1px solid var(--trait); border-top: 4px solid #B9C7C9; border-radius: var(--rayon); padding: 11px 13px 12px; transition: transform var(--rapide), box-shadow var(--rapide); }
.kpi.rouge { border-top-color: var(--alerte); } .kpi.or { border-top-color: var(--or); } .kpi.vert { border-top-color: var(--ok); }
.kpi-nom { font-size: 13.5px; font-weight: 600; color: var(--texte-2); line-height: 1.3; }
.kpi-valeur { font-size: clamp(22px, 6.4vw, 30px); font-weight: 700; letter-spacing: -0.02em; line-height: 1.15; color: var(--encre); overflow-wrap: anywhere; }
.kpi.rouge .kpi-valeur { color: var(--alerte); }
.kpi-detail { font-size: 13px; color: var(--texte-2); line-height: 1.35; overflow-wrap: anywhere; }
.kpi:active { transform: scale(0.98); }
@media (hover: hover) { .kpi:hover, .rub:hover { box-shadow: 0 4px 14px rgba(22, 50, 58, 0.1); } }
.os-kpi { border-top-color: var(--trait); animation: pulse 0.9s ease-in-out infinite alternate; }
.action-ligne { flex: none; font-size: 14px; font-weight: 700; color: var(--or-fonce); white-space: nowrap; }
.carte { background: var(--surface); border: 1px solid var(--trait); border-radius: var(--rayon); padding: 12px 14px 14px; }
.prev { width: 100%; border-collapse: collapse; font-size: 15px; }
.prev th, .prev td { padding: 9px 4px; text-align: right; border-bottom: 1px solid var(--trait); white-space: nowrap; }
.prev th:first-child { text-align: left; font-weight: 500; white-space: normal; }
.prev thead th { font-size: 12.5px; font-weight: 600; color: var(--texte-2); padding-top: 2px; }
.prev .plus { color: var(--ok); } .prev .moins { color: var(--alerte); } .prev .fort { font-weight: 700; }
.prev-note { display: block; width: 100%; text-align: left; margin-top: 10px; padding: 10px 12px; border-radius: 10px; background: #F3F6F6; font-size: 14.5px; line-height: 1.4; }
.prev-note.rouge { background: #FBEDEA; color: #6E1F14; }
.prev-pied { margin-top: 10px; font-size: 12.5px; color: var(--texte-2); line-height: 1.4; }
.evo { display: block; width: 100%; text-align: left; }
.evo > span { display: block; }
.evo-barres { display: flex !important; align-items: flex-end; gap: 4px; height: 132px; padding-top: 4px; }
.evo-col { flex: 1; min-width: 0; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: stretch; gap: 4px; }
.evo-col small { font-size: 11px; color: var(--texte-2); text-align: center; overflow: hidden; }
.evo-pile { display: flex; flex-direction: column; border-radius: 4px 4px 0 0; overflow: hidden; min-height: 0; }
.evo i.avec { background: var(--encre); } .evo i.sans { background: var(--or); }
.evo-pile i { display: block; min-height: 0; }
.evo-legende { display: flex !important; gap: 16px; margin: 10px 0 6px; font-size: 13px; color: var(--texte-2); }
.evo-legende span { display: inline-flex; align-items: center; gap: 6px; }
.evo-legende i { width: 11px; height: 11px; border-radius: 3px; }
.evo-texte { font-size: 14.5px; line-height: 1.45; }
.conseil .titre { font-weight: 500; }
.acc-section { font-size: 20px; font-weight: 700; letter-spacing: -0.01em; color: var(--encre); margin: 30px 4px 0; padding-top: 18px; border-top: 1px solid var(--trait); }
.rubs { display: grid; gap: 10px; }
.rub { display: flex; align-items: center; gap: 10px; min-width: 0; min-height: 68px; text-align: left; background: var(--surface); border: 1px solid var(--trait); border-left: 4px solid var(--encre); border-radius: var(--rayon); padding: 10px 12px 10px 14px; transition: transform var(--rapide), box-shadow var(--rapide); }
.rub:active { transform: scale(0.985); }
.rub-corps { flex: 1; min-width: 0; display: grid; gap: 1px; }
.rub-nom { font-weight: 700; color: var(--encre); line-height: 1.3; }
.rub-detail { font-size: 14px; color: var(--texte-2); line-height: 1.35; }
.rub .fleche { color: #8FA3A7; font-size: 20px; }
.rubs.creer { margin: 10px 0 16px; }
.rubs.creer .rub { border-left-color: var(--or); }
@media (min-width: 700px) {
  .kpis { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
  .kpi-valeur { font-size: 28px; }
  .rubs { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .acc-tete { grid-template-columns: 1fr minmax(260px, 380px); align-items: center; gap: 16px; }
  .acc-tete .fausse-recherche { margin: 0 0 14px; }
}
@media (min-width: 1100px) {
  .rubs { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .acc-deux { display: grid; grid-template-columns: 1fr 1fr; gap: 0 20px; align-items: start; }
  .panneau .rubs { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .page.large .tb-grand { font-size: 46px; }
}
@media (max-width: 699px) { .acc-creer, #toutes { display: none; } .acc-tete .sous { margin-bottom: 10px; } .page.large .tb-tete { padding: 14px 16px 13px; margin-bottom: 12px; } .page.large .tb-grand { font-size: 36px; margin: 0 0 4px; } .page.large .tb-calcul { font-size: 14.5px; } }
.cadre.saisie .flottant { display: none; }

/* ---------- relevés de banque, réglages, listes de clients ---------- */
.fichier-releve { position: relative; cursor: pointer; text-align: center; margin-bottom: 14px; }
.fichier-releve:focus-within { outline: 3px solid var(--encre); outline-offset: 2px; }
.lecture { display: flex; align-items: center; gap: 14px; margin-bottom: 14px; }
.roue { flex: none; width: 26px; height: 26px; border-radius: 50%; border: 3px solid var(--trait); border-top-color: var(--or); animation: tourne 0.8s linear infinite; }
.carte-titre { font-weight: 700; margin-bottom: 4px; }
.carte .tb-ligne { padding-left: 0; padding-right: 0; }
.carte .note { margin: 10px 0 12px; }
.note.vert { background: #E3F2EA; color: #14533A; } .note.rouge { background: #FBEDEA; color: #6E1F14; }
#rl-lecture .carte { margin-bottom: 16px; }
.montant.plus { color: var(--ok); }
.rang { flex: none; width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: #E3ECED; color: var(--encre); font-weight: 700; font-size: 14px; }
.charge { display: grid; grid-template-columns: minmax(0, 1fr) 112px 44px; gap: 8px; align-items: center; margin-bottom: 8px; }
.charge input { min-height: 48px; min-width: 0; padding: 0 12px; border: 1px solid #B9C7C9; border-radius: 12px; background: #fff; font-size: 16px; }
.charge .ch-montant { text-align: right; }
#rg-corps .carte { display: grid; gap: 2px; }
#rg-corps .carte .champ { margin-bottom: 10px; }
#rg-corps textarea { width: 100%; }
#rl-liste .ligne .etiquette { display: inline-block; margin-top: 5px; } #rl-liste .ligne .titre { overflow-wrap: break-word; }

/* ---------- résultat et impôts ---------- */
.rs-choix { margin-bottom: 10px; } .serre-champ { margin-bottom: 0; }
.rs-kpis .kpi { min-height: 104px; cursor: default; }
.tb-ligne.total { background: #F3F6F6; font-weight: 700; }
.tb-ligne small { color: var(--texte-2); font-weight: 400; font-size: 12.5px; }
.montant.moins, .prev .moins { color: var(--alerte); }
.courbes { display: block; width: 100%; height: auto; }
.courbes .grille { stroke: #E3ECED; stroke-width: 1; } .courbes .axe { stroke: #8FA3A7; stroke-width: 1.2; }
.courbes .gr { font: 500 15px Figtree, system-ui, sans-serif; fill: #55686D; }
.courbes polyline { fill: none; stroke-width: 2.6; stroke-linejoin: round; stroke-linecap: round; }
.courbes .c-ventes { stroke: var(--encre); } .courbes circle.c-ventes { fill: var(--encre); stroke: #fff; stroke-width: 1.5; }
.courbes .c-marge { stroke: var(--or); } .courbes circle.c-marge { fill: var(--or); stroke: #fff; stroke-width: 1.5; }
.courbes .c-net { stroke: var(--ok); } .courbes circle.c-net { fill: var(--ok); stroke: #fff; stroke-width: 1.5; }
.courbes .c-objectif { stroke: #8FA3A7; } .courbes .pointille { stroke-dasharray: 6 6; stroke-width: 2; }
.courbes-legende { flex-wrap: wrap; row-gap: 4px; }
.courbes-legende i.c-ventes { background: var(--encre); } .courbes-legende i.c-marge { background: var(--or); } .courbes-legende i.c-net { background: var(--ok); } .courbes-legende i.c-objectif { background: #8FA3A7; }
.defile { overflow-x: auto; overscroll-behavior-x: contain; background: var(--surface); border: 1px solid var(--trait); border-radius: var(--rayon); padding: 6px 12px; }
.mois-table { min-width: 520px; }
.barre-ligne { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 10px; padding: 9px 0; border-bottom: 1px solid var(--trait); }
.barre-nom { font-weight: 500; overflow-wrap: anywhere; }
.barre-fond { grid-column: 1 / -1; height: 8px; border-radius: 4px; background: #E3ECED; overflow: hidden; }
.barre-fond i { display: block; height: 100%; background: var(--encre); border-radius: 4px; }
.barre-ligne small { grid-column: 1 / -1; color: var(--texte-2); font-size: 12.5px; }
.rang.date { width: 46px; height: 46px; border-radius: 12px; display: grid; place-items: center; align-content: center; font-size: 11px; line-height: 1.1; font-weight: 500; }
.rang.date b { font-size: 17px; }
.regles p { margin: 0 0 10px; font-size: 14.5px; line-height: 1.5; } .regles p:last-child { margin: 0; }
.charge { grid-template-columns: minmax(0, 1fr) 96px 44px; }
.charge .ch-cat { grid-column: 1 / 2; grid-row: 2; min-height: 44px; border: 1px solid #B9C7C9; border-radius: 12px; background: #fff; font-size: 16px; padding: 0 8px; min-width: 0; }
.charge .ch-montant { grid-row: 1 / 3; align-self: stretch; } .charge .piece-retirer { grid-row: 1 / 3; }
@media (min-width: 700px) { .rs-kpis { grid-template-columns: repeat(4, minmax(0, 1fr)); } .charge { grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr) 120px 44px; } .charge .ch-cat, .charge .ch-montant, .charge .piece-retirer { grid-column: auto; grid-row: auto; } }
.prev-note { min-height: 44px; }

/* ---------- Accueil : santé de SDCo (jauge) et courbe de caisse ---------- */
.sante { display: grid; grid-template-columns: 112px minmax(0, 1fr); gap: 14px; align-items: center; background: var(--surface); border: 1px solid var(--trait); border-left: 6px solid var(--ok); border-radius: var(--rayon); padding: 14px 16px; margin-bottom: 14px; }
.sante.orange { border-left-color: var(--or); } .sante.rouge { border-left-color: var(--alerte); background: #FFF8F6; }
.sante.os-sante { height: 112px; opacity: 0.35; display: block; }
.jauge { width: 112px; height: auto; display: block; }
.jauge path { fill: none; stroke-width: 11; stroke-linecap: round; }
.jauge .z-rouge { stroke: #E3A196; } .jauge .z-orange { stroke: #EBCB82; } .jauge .z-vert { stroke: #8CC7AC; }
.sante.rouge .z-rouge { stroke: var(--alerte); } .sante.orange .z-orange { stroke: var(--or); } .sante.vert .z-vert { stroke: var(--ok); }
.jauge .aiguille { stroke: var(--encre); stroke-width: 4; stroke-linecap: round; transform-origin: 60px 60px; animation: aiguille 700ms var(--entree) both; }
.jauge .pivot { fill: var(--encre); }
@keyframes aiguille { from { transform: rotate(calc(-1 * var(--ang) - 90deg)); } to { transform: rotate(0deg); } }
.sante-mot { display: flex; align-items: center; gap: 8px; font-size: 19px; font-weight: 700; color: var(--encre); line-height: 1.25; }
.sante-pastille { width: 10px; height: 10px; border-radius: 50%; background: var(--ok); flex: none; }
.sante.orange .sante-pastille { background: var(--or); } .sante.rouge .sante-pastille { background: var(--alerte); }
.sante.rouge .sante-mot { color: var(--alerte); }
.sante-phrase { margin-top: 4px; font-size: 15px; line-height: 1.45; color: var(--texte); }
.sante-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.sante-actions .puce { min-height: 44px; }
@media (max-width: 420px) { .sante { grid-template-columns: 1fr; justify-items: start; } .jauge { width: 128px; margin: 0 auto 2px; justify-self: center; } }

.courbe { width: 100%; height: auto; display: block; overflow: visible; }
.courbe .aire { fill: rgba(31, 122, 85, 0.12); } .courbe .aire.neg { fill: rgba(178, 58, 43, 0.18); }
.courbe .zone-rouge { fill: rgba(178, 58, 43, 0.05); }
.courbe .trace { fill: none; stroke: var(--ok); stroke-width: 3; stroke-linejoin: round; stroke-linecap: round; stroke-dasharray: 600; stroke-dashoffset: 600; animation: trace 900ms var(--entree) 120ms forwards; }
.courbe .trace.neg { stroke: var(--alerte); }
@keyframes trace { to { stroke-dashoffset: 0; } }
.courbe .ligne-zero { stroke: var(--texte-2); stroke-width: 1; stroke-dasharray: 3 3; }
.courbe .trait-zero { stroke: var(--alerte); stroke-width: 1.5; stroke-dasharray: 4 3; }
.courbe .pt { fill: #fff; stroke: var(--ok); stroke-width: 2.5; } .courbe .pt.neg { stroke: var(--alerte); }
.courbe text { font-family: inherit; font-variant-numeric: tabular-nums; }
.courbe .val { font-size: 12.5px; font-weight: 700; fill: var(--texte); } .courbe .val.neg { fill: var(--alerte); }
.courbe .axe { font-size: 11px; fill: var(--texte-2); }
.courbe .date-zero { font-size: 11px; font-weight: 700; fill: var(--alerte); }
.courbe-legende { margin-top: 6px; font-size: 14.5px; color: var(--texte-2); } .courbe-legende.rouge { color: #6E1F14; }
.prev-detail { margin-top: 8px; }
.prev-detail summary { cursor: pointer; min-height: 44px; display: flex; align-items: center; font-size: 14.5px; font-weight: 600; color: var(--or-fonce); list-style: none; }
.prev-detail summary::-webkit-details-marker { display: none; }
.prev-detail summary::after { content: '›'; margin-left: 6px; transition: transform var(--moyen) var(--entree); }
.prev-detail[open] summary::after { transform: rotate(90deg); }
@media (prefers-reduced-motion: reduce) { .jauge .aiguille, .courbe .trace { animation: none; stroke-dashoffset: 0; } }

/* ---------- Accueil : « À faire » en cartes, anneau de la journée ---------- */
.afaire-tete { display: flex; align-items: center; gap: 14px; background: var(--surface); border: 1px solid var(--trait); border-radius: var(--rayon); padding: 12px 14px; margin-bottom: 12px; }
.anneau-boite { position: relative; width: 64px; height: 64px; flex: none; }
.anneau { width: 64px; height: 64px; transform: rotate(-90deg); }
.anneau circle { fill: none; stroke-width: 7; }
.fond-anneau { stroke: #E3EAEB; }
.plein-anneau { stroke: var(--ok); stroke-linecap: round; stroke-dashoffset: var(--fin); animation: anneau 800ms var(--entree) both; }
@keyframes anneau { from { stroke-dashoffset: 163.4; } to { stroke-dashoffset: var(--fin); } }
.anneau-chiffre { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 19px; color: var(--encre); }
.anneau-chiffre small { font-size: 12px; font-weight: 600; color: var(--texte-2); margin-left: 1px; }
.afaire-phrase { font-size: 16px; font-weight: 600; color: var(--encre); line-height: 1.35; }
.afaire-tete.fini { background: #EEF8F3; border-color: #BFE0D0; }
.afaire-tete.fini .anneau-boite { animation: fete 600ms var(--entree) 500ms both; }
@keyframes fete { 0% { transform: scale(1); } 40% { transform: scale(1.12) rotate(-6deg); } 100% { transform: scale(1); } }
.taches-titre { font-size: 13px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--texte-2); margin: 4px 4px 8px; }
.taches-titre.urgent { color: var(--alerte); }
.taches { display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; margin-bottom: 12px; }
.tache { display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "texte action" "montant action"; align-items: center; gap: 2px 12px; text-align: left; min-height: 56px; background: var(--surface); border: 1px solid var(--trait); border-left: 5px solid var(--or); border-radius: 12px; padding: 12px 14px; transition: transform var(--rapide) var(--entree), box-shadow var(--rapide) var(--entree); }
.tache.urgente { border-left-color: var(--alerte); background: #FFF8F6; }
.tache-texte { grid-area: texte; font-weight: 600; line-height: 1.35; min-width: 0; }
.tache-montant { grid-area: montant; font-size: 14px; color: var(--texte-2); font-variant-numeric: tabular-nums; }
.tache-action { grid-area: action; font-size: 14px; font-weight: 700; color: var(--or-fonce); white-space: nowrap; }
.tache:active { transform: scale(0.98); }
@media (hover: hover) { .tache:hover { box-shadow: 0 4px 14px rgba(22, 50, 58, 0.1); } }
@media (min-width: 700px) { .taches { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1100px) { .taches { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (prefers-reduced-motion: reduce) { .plein-anneau, .afaire-tete.fini .anneau-boite { animation: none; } }

/* ---------- Accueil en onglets (comme l'appli Padel) ---------- */
.onglets-acc { position: sticky; top: 0; z-index: 5; background: var(--fond); padding-top: 8px; margin-bottom: 6px; }
.onglets-acc .puce { font-weight: 600; transition: background-color var(--rapide), color var(--rapide), transform var(--rapide) var(--entree); }
.onglets-acc .puce:active { transform: scale(0.97); }
.acc-panneau { animation: panneau var(--moyen) var(--entree) both; }
@keyframes panneau { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.acc-panneau .acc-creer { display: flex; margin-bottom: 10px; }
.kpis.kpis-3 { grid-template-columns: minmax(0, 1fr); }
@media (min-width: 700px) { .kpis.kpis-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 699px) { .acc-panneau #toutes { display: block; } }
@media (prefers-reduced-motion: reduce) { .acc-panneau { animation: none; } }

/* ---------- Impôts et comptable ---------- */
.cf-bloc { background: var(--surface); border: 1px solid var(--trait); border-left: 6px solid #C3CFD1; border-radius: var(--rayon); padding: 14px 16px; margin-bottom: 12px; }
.cf-bloc.rouge { border-left-color: var(--alerte); background: #FFF8F6; } .cf-bloc.or { border-left-color: var(--or); } .cf-bloc.vert { border-left-color: var(--ok); }
.cf-tete { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.cf-titre { font-size: 17px; font-weight: 700; color: var(--encre); } .cf-bloc.rouge .cf-titre { color: var(--alerte); }
.cf-detail { font-size: 14px; color: var(--texte-2); margin-top: 2px; }
.cf-gros { font-size: 24px; font-weight: 800; white-space: nowrap; color: var(--encre); text-align: right; line-height: 1.1; } .cf-bloc.rouge .cf-gros { color: var(--alerte); }
.cf-gros small { display: block; font-size: 12px; font-weight: 600; color: var(--texte-2); }
.cf-liste { margin-top: 8px; }
.cf-liste summary { min-height: 44px; display: flex; align-items: center; cursor: pointer; font-size: 14.5px; font-weight: 600; color: var(--or-fonce); list-style: none; }
.cf-liste summary::-webkit-details-marker { display: none; }
.cf-liste summary::after { content: '›'; margin-left: 6px; transition: transform var(--moyen) var(--entree); } .cf-liste[open] summary::after { transform: rotate(90deg); }
.cf-ligne { display: flex; justify-content: space-between; gap: 12px; padding: 10px 0; border-top: 1px solid var(--trait); color: inherit; text-decoration: none; min-height: 44px; }
.cf-num { font-weight: 600; min-width: 0; } .cf-num small, .cf-montant small { display: block; font-weight: 400; font-size: 13px; color: var(--texte-2); }
.cf-montant { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.cf-note { font-size: 13px; color: var(--texte-2); margin-top: 6px; }
.cf-action { width: 100%; margin-top: 10px; }
@media (min-width: 700px) { .cf-action { width: auto; } }
/* Étape 28 : onglets des menus */
.puce-nb { display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 6px; margin-left: 6px; border-radius: 999px; background: var(--rouge, #C0392B); color: #fff; font-style: normal; font-size: 12px; font-weight: 700; font-variant-numeric: tabular-nums; }
.puce.choisie .puce-nb { background: #fff; color: var(--encre); }
/* Étape 29 : disposition de l'appli Padel (bandeau, catégories, tuiles avec icône, barre du bas sombre) */
.sec-t { font-size: 12.5px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--texte-2); margin: 20px 4px 8px; overflow-wrap: anywhere; }
.esp-tete { display: flex; align-items: center; gap: 14px; background: var(--encre); color: #fff; border-radius: 18px; padding: 16px 18px; margin: 2px 0 4px; }
.esp-tete .esp-ico { font-size: 30px; line-height: 1; }
.esp-tete b { display: block; font-size: 20px; color: var(--or); }
.esp-tete small { display: block; font-size: 14px; color: #D3E0E2; line-height: 1.35; }
.tuiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.tuile { position: relative; display: flex; flex-direction: column; align-items: flex-start; gap: 3px; min-width: 0; min-height: 112px; text-align: left; background: var(--surface); border: 1px solid var(--trait); border-left: 5px solid var(--encre-2); border-radius: var(--rayon); padding: 14px 12px 12px; transition: transform var(--rapide), box-shadow var(--rapide); }
.tuile:active { transform: scale(0.97); }
.tuile-ico { font-size: 26px; line-height: 1; margin-bottom: 6px; }
.tuile b { font-size: 16px; font-weight: 700; color: var(--encre); line-height: 1.25; overflow-wrap: anywhere; }
.tuile small { font-size: 13px; color: var(--texte-2); line-height: 1.3; overflow-wrap: anywhere; }
.tuile .etiquette { margin-top: 6px; }
@media (hover: hover) { .tuile:hover, .esp-carte:hover { box-shadow: 0 4px 14px rgba(22, 50, 58, 0.12); } }
.esp-grille { display: grid; grid-template-columns: 1fr; gap: 10px; }
.esp-carte { display: grid; grid-template-columns: 52px 1fr auto; grid-template-rows: auto auto; column-gap: 12px; align-items: center; text-align: left; background: var(--encre); color: #fff; border-radius: 18px; padding: 14px 16px; min-height: 84px; transition: transform var(--rapide); }
.esp-carte:active { transform: scale(0.98); }
.esp-carte .esp-ico { grid-row: 1 / 3; width: 52px; height: 52px; border-radius: 14px; display: grid; place-items: center; font-size: 28px; background: rgba(255,255,255,.12); }
.esp-carte b { font-size: 18px; color: var(--or); }
.esp-carte small { grid-column: 2; font-size: 13.5px; color: #D3E0E2; line-height: 1.35; }
.esp-carte i { grid-row: 1 / 3; grid-column: 3; font-style: normal; font-size: 24px; color: #A9BFC3; }
.esp-n { display: inline-block; margin-top: 4px; padding: 1px 8px; border-radius: 999px; background: var(--alerte); color: #fff; font-weight: 700; font-size: 12.5px; }
.ar-band { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; margin: 12px 0 4px; padding: 14px 16px; border-radius: 16px; background: #FBE9E6; color: var(--alerte); border: 1px solid #F0C4BC; min-height: 60px; }
.ar-band span { font-size: 22px; } .ar-band b { flex: 1; font-size: 16px; } .ar-band b small { display: block; font-weight: 500; font-size: 13.5px; color: #8E3A2E; }
.ar-band i { font-style: normal; font-size: 22px; }
.ar-band.zero { background: #E5F3EC; color: var(--ok); border-color: #BFE0CF; }
.rapides { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.rapides button { display: grid; justify-items: center; align-content: center; gap: 4px; min-height: 76px; padding: 10px 6px; border-radius: 14px; background: var(--surface); border: 1px solid var(--trait); font-size: 13px; font-weight: 600; color: var(--encre); text-align: center; line-height: 1.25; }
.rapides button svg { width: 22px; height: 22px; color: var(--or-fonce); stroke-width: 2.6; }
.rapides button:active { transform: scale(0.97); }
@media (min-width: 700px) { .tuiles { grid-template-columns: repeat(3, minmax(0, 1fr)); } .esp-grille { grid-template-columns: repeat(2, minmax(0, 1fr)); } .rapides { grid-template-columns: repeat(6, minmax(0, 1fr)); } }
@media (min-width: 1100px) { .esp-grille { grid-template-columns: repeat(4, minmax(0, 1fr)); } .esp-carte { grid-template-columns: 1fr auto; } .esp-carte .esp-ico { grid-row: auto; margin-bottom: 8px; } .esp-carte b, .esp-carte small { grid-column: 1; } .esp-carte i { grid-row: 1 / 4; grid-column: 2; } }
/* barre du bas sombre, icônes comme l'appli Padel */
@media (max-width: 1099px) {
  .nav { background: var(--encre); border-top: 0; }
  .nav-lien { color: #A9BFC3; }
  .nav-lien .ni { font-size: 23px; line-height: 26px; filter: saturate(.85); }
  .nav-lien.ici { color: #fff; }
  .nav-lien.ici .ni { filter: none; }
  .nav-lien:active { background: var(--encre-2); }
  .nav-lien.ici::before { background: var(--or); left: 30%; right: 30%; height: 4px; }
}
.nav-lien .ni { display: inline-block; font-style: normal; }
@media (min-width: 1100px) { .nav-lien .ni { font-size: 20px; width: 24px; text-align: center; } }
.nav-lien span.ni { flex: none; }
@media (min-width: 1100px) { .esp-carte { align-items: start; align-content: start; } .esp-carte i { align-self: center; } }
/* Étape 30 : carte « mission » à la place de l'aiguille, étiquette de l'espace dans l'en-tête */
.mission { background: var(--surface); border: 1px solid var(--trait); border-radius: 18px; padding: 16px 16px 14px; margin: 10px 0 4px; }
.mission.rouge, .mission.orange { background: linear-gradient(160deg, #FFF8E8, #FFFFFF 70%); border-color: #EBD9A8; }
.mission.vert { background: linear-gradient(160deg, #EAF6F0, #FFFFFF 70%); border-color: #BFE0CF; }
.mission-titre { display: flex; align-items: center; gap: 8px; font-size: 19px; font-weight: 800; color: var(--encre); }
.mission-titre span { font-size: 24px; }
.jours { display: flex; align-items: center; gap: 10px; margin-top: 12px; }
.jours-piste { flex: 1; height: 14px; border-radius: 999px; background: #E6ECEC; overflow: hidden; }
.jours-piste i { display: block; height: 100%; width: var(--p); border-radius: inherit; background: linear-gradient(90deg, var(--or), #E9C46A); animation: remplir 800ms var(--entree) both; }
.mission.vert .jours-piste i { background: linear-gradient(90deg, var(--ok), #5FB98C); }
@keyframes remplir { from { width: 0; } }
.jours-fin { flex: none; font-size: 13px; font-weight: 700; color: var(--texte-2); }
.jours-texte { margin-top: 6px; font-size: 15px; color: var(--texte); line-height: 1.4; }
.mission-but { margin-top: 12px; padding: 12px 14px; border-radius: 14px; background: var(--encre); color: #fff; }
.mission-but b { color: var(--or); font-size: 17px; } .mission-but p { line-height: 1.4; }
.mission-aide { margin-top: 3px; font-size: 14px; color: #D3E0E2; }
.mission-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.mission-actions .bouton { flex: 1 1 160px; min-height: 48px; }
@media (prefers-reduced-motion: reduce) { .jours-piste i { animation: none; } }
.esp-tag { display: inline-block; vertical-align: 2px; margin-right: 8px; padding: 2px 8px; border-radius: 6px; background: var(--or); color: #2A1F02; font-size: 11.5px; font-weight: 800; letter-spacing: .05em; }
.entete h1 { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* Étape 31 : listes en cartes (façon tuiles Padel), filtres qui passent à la ligne, geste suivant en un bouton */
.puces { flex-wrap: wrap; overflow-x: visible; padding: 2px 0 10px; margin: 0; }
.liste.cartes { background: none; border: 0; border-radius: 0; overflow: visible; display: grid; gap: 8px; }
.liste.cartes > .ligne { border: 1px solid var(--trait); border-top: 1px solid var(--trait); border-left: 5px solid var(--c, var(--encre-2)); border-radius: var(--rayon); background: var(--surface); }
.liste.cartes > .ligne.inactif { opacity: .75; }
.carte-l.c-vert { --c: var(--ok); } .carte-l.c-or { --c: var(--or); } .carte-l.c-rouge { --c: var(--alerte); } .carte-l.c-gris { --c: #A8B6B9; } .carte-l.c-bleu { --c: #4F8FA3; }
.ligne-ico { flex: none; width: 42px; height: 42px; border-radius: 12px; background: #EEF2F2; display: grid; place-items: center; font-size: 21px; line-height: 1; }
.ligne.carte-l { gap: 12px; }
.ligne.carte-l:has(.ligne-action) { flex-wrap: wrap; }
.ligne .ouvrir { display: flex; align-items: center; gap: 12px; flex: 1 1 100%; min-width: 0; text-align: left; }
.ligne-action { margin-left: 54px; flex: 1 1 auto; min-height: 44px; border-radius: 12px; background: var(--or); color: #2A1F02; font-weight: 700; padding: 0 16px; transition: transform var(--rapide); }
.ligne-action:active { transform: scale(0.97); }
@media (min-width: 700px) { .ligne.carte-l:has(.ligne-action) { flex-wrap: nowrap; } .ligne .ouvrir { flex: 1 1 auto; } .ligne-action { margin-left: 0; flex: none; } }
.rapides.deux { grid-template-columns: repeat(2, minmax(0, 1fr)); margin-bottom: 14px; }
.rapides.deux button { min-height: 88px; font-size: 15px; }
.rap-ico { font-size: 26px; line-height: 1; }
@media (min-width: 700px) { .rapides.deux { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 600px) {
  .entete h1 { white-space: normal; font-size: 17px; line-height: 1.2; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
  #page > .puces .puce, .puces .puce { min-height: 44px; padding: 0 12px; }
}
/* Étape 32 : réponse et devis préparés depuis un mail */
.proposer-ia { margin: 12px 0 4px; }
.devis-propose { margin: 10px 0; padding: 14px; border-radius: 16px; background: #FFF8E8; border: 1px solid #EBD9A8; }
.devis-propose.cree { background: #E5F3EC; border-color: #BFE0CF; }
.dp-titre { font-weight: 800; color: var(--encre); font-size: 16px; }
.dp-lignes { margin-top: 8px; display: grid; gap: 6px; }
.dp-ligne { display: flex; justify-content: space-between; gap: 10px; padding: 8px 10px; border-radius: 10px; background: var(--surface); font-size: 14.5px; }
.dp-ligne span:first-child { min-width: 0; overflow-wrap: anywhere; } .dp-ligne small { display: block; color: var(--texte-2); font-size: 12.5px; }
.dp-ligne .montant { flex: none; font-weight: 600; text-align: right; } .dp-ligne .montant small { display: inline; color: var(--ok); }
.dp-total { margin-top: 8px; font-size: 14.5px; } .dp-sous { margin-top: 8px; font-size: 14px; font-weight: 700; color: var(--or-fonce); }
.dp-manque { margin: 4px 0 0 18px; font-size: 14px; color: var(--texte); }
.dp-joindre { display: flex; align-items: center; gap: 10px; margin-top: 10px; min-height: 44px; font-weight: 600; }
.dp-joindre input { width: 22px; height: 22px; accent-color: var(--ok); }
.sig-note { margin: -4px 2px 8px; font-size: 13px; color: var(--texte-2); }
/* Étape 34 : coordonnées du client sur le devis */
.coord-client { padding: 14px 16px; }
.coord-client p { margin: 0 0 8px; line-height: 1.5; overflow-wrap: anywhere; }
.coord-client .manque-client { background: #FFF6E0; border: 1px solid #EBD39A; color: #5A4006; border-radius: 10px; padding: 10px 12px; font-size: 14.5px; }
.coord-client .ok-client { color: #1E6B45; font-weight: 600; font-size: 14.5px; margin: 0; }
.coord-client .bouton { display: inline-flex; min-height: 44px; align-items: center; text-decoration: none; }
/* Étape 35 : nom du client cliquable assez grand au doigt */
.contact-carte .titre a, .tb-bloc .detail a[href^="#/client/"] { display: inline-flex; align-items: center; min-height: 44px; min-width: 44px; }
/* Étape 36 : un mot très long (référence bancaire) ne pousse plus la carte hors de l'écran */
.liste .ligne { min-width: 0; max-width: 100%; }
.liste .ligne .corps { min-width: 0; flex: 1 1 auto; }
.liste .ligne .titre, .liste .ligne .detail { overflow-wrap: anywhere; }
/* Étape 36 : dans les fiches, l'intitulé (E-mail, Adresse, Note…) n'est plus écrasé par une longue valeur */
.tb-ligne > span:first-child { overflow-wrap: break-word; min-width: min(38%, 8.5em); }
/* Étape 37 : actions du compte de test, quand on choisit de les voir */
.ligne.ligne-test { opacity: .72; border-left: 3px dashed #B8C4C7; }
/* Étape 39 : vérification avant envoi, suivi des réponses déjà envoyées */
.verif-envoi { border: 2px solid #D9A73A; background: #FFFBF0; border-radius: 14px; padding: 14px 16px; margin-top: 12px; }
.verif-envoi .ve-titre { font-weight: 700; font-size: 17px; margin: 0 0 8px; }
.verif-envoi .ve-alerte { background: #FDECEC; border: 1px solid #F0B8B8; color: #7A1F1F; border-radius: 10px; padding: 8px 10px; margin: 0 0 10px; font-size: 14.5px; }
.verif-envoi dl { display: grid; grid-template-columns: auto 1fr; gap: 6px 12px; margin: 0 0 10px; font-size: 15px; }
.verif-envoi dt { color: #55686D; }
.verif-envoi dd { margin: 0; font-weight: 600; overflow-wrap: anywhere; min-width: 0; }
.verif-envoi .ve-texte { white-space: pre-wrap; background: #fff; border: 1px solid #E3E8EA; border-radius: 10px; padding: 10px 12px; max-height: 260px; overflow: auto; font-size: 14.5px; line-height: 1.5; overscroll-behavior: contain; }
.verif-envoi .ve-note { color: #55686D; font-size: 13.5px; margin: 8px 0 4px; }
.historique-envois { background: #EEF7F1; border: 1px solid #BFE0CB; border-radius: 12px; padding: 10px 12px; margin: 0 0 12px; }
.historique-envois .he-titre { margin: 0 0 6px; font-weight: 700; color: #1E6B45; }
.he-envoi summary { cursor: pointer; min-height: 44px; display: flex; align-items: center; font-size: 14.5px; overflow-wrap: anywhere; }
.he-envoi .he-texte { white-space: pre-wrap; font-size: 14px; line-height: 1.5; background: #fff; border-radius: 8px; padding: 8px 10px; max-height: 220px; overflow: auto; }
.ligne .deja { color: #1E6B45; font-weight: 600; }
/* Étape 40 : signatures des mails */
.ve-signature select { width: 100%; min-height: 44px; font-size: 16px; border-radius: 10px; border: 1px solid #C9D3D6; padding: 0 10px; background: #fff; }
.ve-sig-apercu { font-weight: 400; color: #55686D; font-size: 13.5px; margin-top: 4px; }
.lien-discret { display: inline-flex; align-items: center; min-height: 44px; font-weight: 600; font-size: 14px; color: #16323A; }
.sig-apercu { border-left: 3px solid #D9A73A; padding: 6px 0 6px 12px; font-size: 14px; line-height: 1.55; color: #1B2A2E; background: #fff; border-radius: 0 8px 8px 0; }
.sig-apercu .or { color: #9A7214; font-weight: 700; }
.os.mini { display: inline-block; width: 140px; height: 16px; }
/* Stock : photo de la liste des prix et 4 jauges (show-room, dépôt, total, minimum) */
.ligne.carte-stock { align-items: flex-start; text-align: left; }
.ks-photo { flex: none; width: 64px; height: 64px; border-radius: 12px; background: #fff; border: 1px solid var(--trait); overflow: hidden; display: grid; place-items: center; font-size: 26px; }
.ks-photo img { width: 100%; height: 100%; object-fit: contain; display: block; }
.ks-tete { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; }
.ks-tete .titre { min-width: 0; overflow-wrap: anywhere; }
.jauges { display: grid; grid-template-columns: auto minmax(40px, 1fr) auto; align-items: center; gap: 4px 10px; margin-top: 8px; width: 100%; }
.jg-nom { font-size: 13px; color: var(--texte-2); white-space: nowrap; }
.jg-barre { height: 10px; border-radius: 6px; background: #E3EAEB; overflow: hidden; }
.jg-plein { display: block; height: 100%; border-radius: 6px; transform-origin: left; animation: jg-entree var(--lent) var(--entree); }
.jg-plein.lieu { background: #4F8FA3; }
.jg-plein.mini { background: #A8B6B9; }
.jg-plein.tot-vert { background: var(--ok); } .jg-plein.tot-or { background: var(--or); } .jg-plein.tot-rouge { background: var(--alerte); } .jg-plein.tot-gris { background: var(--encre-2); }
.jg-n { font-size: 14px; font-weight: 600; text-align: right; min-width: 4.2ch; }
.jg-n.neg { color: var(--alerte); }
.jauges .jg-nom:nth-child(7), .jauges .jg-n:nth-child(9) { font-weight: 700; color: var(--texte); }
@keyframes jg-entree { from { transform: scaleX(0); } to { transform: scaleX(1); } }
@media (prefers-reduced-motion: reduce) { .jg-plein { animation: none; } }
@media (min-width: 900px) { #k-liste.cartes { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.jg-plein.leger { opacity: .6; }
/* Stock : quantité conseillée sur la carte d'un article sous le minimum (agent 1, 18/11) */
.carte-stock .ks-conseil { display: block; margin-top: 6px; color: var(--alerte); font-weight: 600; }

/* Livraisons : directe, disponible, à facturer */
.choix-deux { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 12px 0 4px; }
.choix-deux .puce { white-space: normal; line-height: 1.25; padding: 8px 10px; text-align: center; }
.edl-champs.deux-egaux { grid-template-columns: 1fr 1fr; }
.detail .neg, .neg { color: var(--alerte); font-weight: 600; }
.manque { display: inline-block; margin-top: 4px; }
/* Dossier client : cases à cocher pour compléter la fiche */
.ligne.coche { display: flex; gap: 12px; align-items: flex-start; cursor: pointer; }
.ligne.coche input { flex: none; width: 24px; height: 24px; margin-top: 2px; accent-color: var(--or); }
/* Aperçu « voir l'appli comme » */
.apercu-bandeau { position: fixed; left: 50%; transform: translateX(-50%); top: calc(env(safe-area-inset-top) + 6px); z-index: 30; display: flex; align-items: center; gap: 10px; max-width: calc(100% - 24px); padding: 6px 6px 6px 14px; border-radius: 999px; background: var(--or); color: #2A1F02; font-size: 14px; box-shadow: 0 6px 18px rgba(22, 50, 58, 0.28); }
.apercu-bandeau span { min-width: 0; line-height: 1.3; }
.apercu-bandeau .bouton { flex: none; background: var(--encre); color: #fff; }
button.lien { color: var(--encre); text-decoration: underline; text-underline-offset: 3px; font-weight: 600; text-align: left; min-height: 32px; }
/* Livraison : étapes du livreur */
.etapes { display: grid; gap: 10px; margin: 12px 0 4px; }
.etape { border: 1px solid var(--trait); border-radius: 14px; padding: 12px; background: #FBFCFC; }
.etape-titre { display: flex; align-items: center; gap: 10px; font-weight: 700; color: var(--encre); margin-bottom: 8px; }
.etape-n { flex: none; display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: var(--or); color: #2A1F02; font-weight: 800; }
.etape-boutons { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 8px; }
.etape-boutons .bouton { min-height: 52px; font-size: 16px; }
.etape .lien { margin-top: 6px; }
.bouton[disabled] { opacity: .45; }
/* Aperçu « voir comme » : bande en bas, au-dessus de la barre */
.apercu-bandeau { left: 0; right: 0; transform: none; top: auto; bottom: calc(env(safe-area-inset-bottom) + 64px); max-width: none; border-radius: 0; justify-content: space-between; padding: 8px 12px; font-size: 13.5px; box-shadow: 0 -2px 10px rgba(22, 50, 58, 0.2); }
@media (min-width: 1100px) { .apercu-bandeau { left: 236px; bottom: 0; } }
a.lien { color: var(--encre); font-weight: 600; text-underline-offset: 3px; }
.bloc-notif { display: grid; gap: 10px; margin: 0 0 16px; padding: 14px; border-radius: 14px; background: #FFF6E0; border: 1px solid #E8C979; }
.bloc-notif p { margin: 0; line-height: 1.45; }
/* Nouveau client depuis un document : client déjà existant */
div.alerte { margin: 14px 0; padding: 12px 14px; border-radius: 12px; background: #FFF3E0; border: 1px solid #E8A33D; color: #5A3700; }
div.alerte p { margin: 0 0 10px; }
/* Catalogue et tarifs : pièces du dossier */
.ligne .boutons-ligne { display: flex; gap: 8px; flex-wrap: wrap; flex-shrink: 0; }
@media (max-width: 699px) { .ligne:has(> .boutons-ligne) { flex-wrap: wrap; } .ligne .boutons-ligne { width: 100%; } .ligne .boutons-ligne .bouton { flex: 1; } }
.corps .boutons-ligne { margin-top: 8px; }
.alerte-texte { color: #7A4A00; }
/* Historique du client */
.ligne.hx { align-items: flex-start; }
.hx-icone { flex: 0 0 32px; font-size: 20px; line-height: 1.3; text-align: center; }
.hx-texte, .hx-convenu, .hx-rappel { display: block; margin-top: 4px; font-size: 15px; line-height: 1.45; white-space: pre-line; overflow-wrap: anywhere; }
.hx-convenu { padding: 6px 8px; border-radius: 8px; background: #FFF6DC; }
.hx-rappel { color: #7A4A00; font-weight: 600; }
.hx-mois { margin: 14px 4px 6px; font-size: 13px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--gris, #5c6d73); }
.ligne.hx[data-lien] { cursor: pointer; }
.hx-annuler { display: inline-block; margin-top: 6px; font-size: 14px; min-height: 32px; }
.ligne.hx.inactif .titre, .ligne.hx.inactif .hx-texte { text-decoration: line-through; text-decoration-thickness: 1px; }
.resume-texte { font-size: 16px; line-height: 1.55; }
.resume-liste { margin: 4px 0 8px; padding-left: 20px; line-height: 1.5; }
.resume-liste li { margin: 4px 0; }
.ligne.hx[data-uid] { cursor: pointer; }
.hx-nature { display: block; font-size: 11px; font-weight: 600; color: var(--gris, #5c6d73); text-align: right; }
/* Recouvrement */
.rc-carte { margin-bottom: 12px; }
.rc-carte.rc-vieux { border-left: 4px solid #C0392B; }
.rc-haut { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; }
.rc-haut .titre { min-width: 0; overflow-wrap: anywhere; }
.rc-du { margin: 0; font-size: 20px; font-weight: 700; text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.rc-du small { display: block; font-size: 12px; font-weight: 500; color: var(--gris, #5c6d73); }
.rc-promesse { margin: 8px 0; padding: 6px 10px; border-radius: 8px; font-weight: 600; }
.rc-promesse.vert { background: #E6F4EA; color: #1E6B34; } .rc-promesse.or { background: #FFF6DC; color: #7A4A00; } .rc-promesse.rouge { background: #FDECEA; color: #A12B1F; }
.rc-factures { margin: 8px 0; }
.rc-tranche { display: grid; grid-template-columns: minmax(110px, 1fr) 2fr auto; gap: 10px; align-items: center; padding: 6px 0; }
.rc-barre { height: 12px; border-radius: 6px; background: #EEF1F2; overflow: hidden; }
.rc-plein { display: block; height: 100%; border-radius: 6px; background: #D9A73A; }
.rc-plein.t0 { background: #7FB38D; } .rc-plein.t2 { background: #E08A3C; } .rc-plein.t3 { background: #C0392B; }
.rc-carte { padding: 14px; }
.rc-factures a.ligne, .rc-factures a.ligne .titre, .rc-factures a.ligne .montant { color: inherit; text-decoration: none; }
.rc-factures a.ligne .titre { font-weight: 600; }
.rc-carte .titre a { color: inherit; text-decoration: none; font-weight: 700; }
.rc-carte .boutons-ligne { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.rc-carte .boutons-ligne .bouton { flex: 1 1 40%; }
@media (min-width: 700px) { .rc-carte .boutons-ligne .bouton { flex: 0 1 auto; } }
.rc-net { display: block; margin-top: 2px; font-size: 14px; }
