/* =====================================================================
   TOUTENVÉLO LE HAVRE — APP COMMERCIAL
   styles.css — thème sombre, accent vert lime TEV (cohérent avec Hub,
   Communication, Tournée). Pensé téléphone d'abord : Louis note un appel
   depuis la rue, Jean regarde le pipeline sur grand écran.
   ===================================================================== */

:root {
  --fond:        #141509;
  --surface:     #262624;
  --surface-2:   #30302d;
  --ligne:       #3d3d38;
  --lime:        #a8c63c;
  --lime-sombre: #8aa62f;
  --texte:       #f2f1ec;
  --texte-doux:  #a3a29a;
  --vert:        #6fa84a;
  --orange:      #e0913a;
  --rouge:       #c05a5a;
  --ocean:       #3f9fbf;
  --violet:      #a98be0;
  --rayon:       12px;
  --rayon-s:     8px;
  --ombre:       0 2px 12px rgba(0, 0, 0, .35);
}

* { box-sizing: border-box; }
html, body {
  margin: 0; padding: 0; background: var(--fond); color: var(--texte);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  font-size: 15px; line-height: 1.45; -webkit-font-smoothing: antialiased;
}
body { padding-bottom: 60px; }
a { color: var(--lime); text-decoration: none; }
a:hover { text-decoration: underline; }
.mono { font-variant-numeric: tabular-nums; }
.doux { color: var(--texte-doux); }
.petit { font-size: 13px; }
.gros { font-size: 18px; font-weight: 700; }
.droite { text-align: right; }
.cache { display: none !important; }
.retard { color: var(--rouge); }
.bientot { color: var(--orange); }

/* ---------- barre du haut ---------- */
.topbar { position: sticky; top: 0; z-index: 40; background: var(--fond); border-bottom: 1px solid var(--ligne); }
.topbar .dedans { max-width: 1100px; margin: 0 auto; padding: 10px 16px; display: flex; align-items: center; gap: 14px; }
.topbar .titre { font-size: 17px; font-weight: 700; letter-spacing: -.01em; margin: 0; white-space: nowrap; }
.topbar .version { font-size: 11px; color: var(--texte-doux); font-weight: 400; margin-left: 6px; }
.topbar nav { display: flex; gap: 4px; flex: 1; overflow-x: auto; }
.topbar nav a { color: var(--texte-doux); padding: 6px 10px; border-radius: var(--rayon-s); font-size: 14px; white-space: nowrap; }
.topbar nav a.actif, .topbar nav a:hover { color: var(--texte); background: var(--surface); text-decoration: none; }
.topbar nav a .nb { font-size: 11px; background: var(--rouge); color: #fff; border-radius: 999px; padding: 0 6px; margin-left: 4px; font-weight: 700; }
/* l'espace du widget compte d'auth.js (en haut à droite) */
.topbar .dedans { padding-right: 150px; }
@media (max-width: 600px) { .topbar .dedans { padding-right: 56px; } }

/* ---------- page ---------- */
.page { max-width: 1100px; margin: 0 auto; padding: 14px 16px; }
.page.large { max-width: 1500px; }
h2 { font-size: 16px; margin: 22px 0 10px; color: var(--texte-doux); font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }
h2:first-child { margin-top: 6px; }
.entete-section { display: flex; align-items: baseline; gap: 10px; margin: 22px 0 10px; flex-wrap: wrap; }
.entete-section h2 { margin: 0; flex: 1; }
.entete-section .nb { color: var(--texte-doux); font-size: 13px; }

/* ---------- boutons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 6px; background: var(--surface-2); color: var(--texte);
  border: 1px solid var(--ligne); border-radius: var(--rayon-s); padding: 9px 14px; font-size: 14px; font-weight: 600;
  cursor: pointer; font-family: inherit; line-height: 1.2; text-decoration: none; white-space: nowrap;
}
.btn:hover { border-color: var(--texte-doux); text-decoration: none; }
.btn:disabled { opacity: .5; cursor: default; }
.btn.primaire { background: var(--lime); color: #141509; border-color: var(--lime); }
.btn.primaire:hover { background: var(--lime-sombre); }
.btn.danger { color: var(--rouge); }
.btn.petit { padding: 6px 10px; font-size: 13px; }
.btn.lien { background: none; border: none; color: var(--lime); padding: 4px 6px; }

/* ---------- bandeaux ---------- */
.bandeau {
  background: var(--surface); border: 1px solid var(--ligne); border-radius: var(--rayon); padding: 12px 14px; margin-bottom: 14px;
  display: flex; flex-wrap: wrap; align-items: center; gap: 10px;
}
.bandeau .texte { flex: 1; min-width: 200px; font-size: 14px; }
.bandeau.attention { border-color: var(--orange); }
.bandeau.erreur { border-color: var(--rouge); }
.bandeau.info { border-color: var(--ocean); }

/* ---------- filtres ---------- */
.filtres { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 14px; }
.filtres .espace { flex: 1; }
.filtres select { width: auto; padding: 7px 10px; font-size: 14px; }
.chip { background: var(--surface); border: 1px solid var(--ligne); color: var(--texte-doux); border-radius: 999px; padding: 6px 12px; font-size: 13px; cursor: pointer; font-family: inherit; }
.chip.actif { background: var(--lime); color: #141509; border-color: var(--lime); font-weight: 600; }
.recherche { position: relative; flex: 1; min-width: 180px; }
.recherche input { width: 100%; background: var(--surface); border: 1px solid var(--ligne); color: var(--texte); border-radius: 999px; padding: 8px 14px 8px 34px; font-size: 14px; font-family: inherit; }
.recherche .loupe { position: absolute; left: 12px; top: 7px; color: var(--texte-doux); }
.bascule { display: inline-flex; border: 1px solid var(--ligne); border-radius: 999px; overflow: hidden; }
.bascule button { background: none; border: none; color: var(--texte-doux); padding: 7px 14px; font-size: 13px; cursor: pointer; font-family: inherit; }
.bascule button.actif { background: var(--surface-2); color: var(--texte); font-weight: 600; }

/* ---------- tuiles de résumé ---------- */
.resume { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 8px; margin-bottom: 16px; }
.resume .tuile { background: var(--surface); border: 1px solid var(--ligne); border-radius: var(--rayon); padding: 10px 12px; color: var(--texte); display: block; }
.resume .tuile:hover { border-color: var(--texte-doux); text-decoration: none; }
.resume .tuile .chiffre { font-size: 24px; font-weight: 700; line-height: 1.1; font-variant-numeric: tabular-nums; }
.resume .tuile .etiquette { font-size: 12px; color: var(--texte-doux); text-transform: uppercase; letter-spacing: .04em; margin-top: 2px; }
.resume .tuile .sous { font-size: 12px; color: var(--texte-doux); margin-top: 4px; }
.resume .tuile.retard .chiffre { color: var(--rouge); }
.resume .tuile.ok .chiffre { color: var(--lime); }

/* ---------- cartes et listes ---------- */
.carte {
  background: var(--surface); border: 1px solid var(--ligne); border-radius: var(--rayon); padding: 12px 14px; margin-bottom: 8px;
  display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; color: var(--texte);
}
a.carte:hover { border-color: var(--texte-doux); text-decoration: none; }
.carte .ligne1 { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.carte .nom { font-weight: 700; font-size: 16px; }
.carte .ligne2 { color: var(--texte-doux); font-size: 13px; grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 4px 14px; }
.carte .cote { grid-column: 2; grid-row: 1; align-self: start; text-align: right; font-size: 13px; color: var(--texte-doux); white-space: nowrap; }
.carte.retard { border-left: 3px solid var(--rouge); }
.carte.aujourdhui { border-left: 3px solid var(--lime); }
.carte .action { grid-column: 1 / -1; font-size: 14px; display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; }
.carte .action .quand { font-weight: 600; white-space: nowrap; }
.vide { text-align: center; color: var(--texte-doux); padding: 40px 10px; }
.squelette { height: 64px; background: var(--surface); border-radius: var(--rayon); margin-bottom: 8px; opacity: .6; animation: pulse 1.2s infinite; }
@keyframes pulse { 50% { opacity: .3; } }

.badge { display: inline-block; font-size: 11px; font-weight: 700; letter-spacing: .04em; padding: 2px 7px; border-radius: 6px; text-transform: uppercase; background: var(--surface-2); color: var(--texte-doux); white-space: nowrap; }
.badge.a_contacter { background: var(--surface-2); color: var(--texte-doux); }
.badge.contact_pris { background: #1f3a46; color: #8fd0ea; }
.badge.besoin_qualifie { background: #2a3a4e; color: #a9c4f0; }
.badge.devis_envoye { background: #4a3316; color: #f0b86a; }
.badge.negociation { background: #3d2f45; color: #d3a8ee; }
.badge.gagne { background: #2b4020; color: #b5e08a; }
.badge.perdu { background: #402424; color: #e09a9a; }
.badge.en_veille { background: #33321f; color: #d9d27a; }
.badge.prospect { background: var(--surface-2); color: var(--texte-doux); }
.badge.client { background: #2b4020; color: #b5e08a; }
.badge.inactif { background: #402424; color: #e09a9a; }
.badge.retard { background: #402424; color: #e09a9a; }

/* ---------- tableau de bord : tuiles cliquables, entonnoir, tableau + volet « À faire » ---------- */
.resume button.tuile { font-family: inherit; text-align: left; cursor: pointer; width: 100%; font-size: inherit; line-height: inherit; }
.resume .tuile.active { border-color: var(--lime); box-shadow: inset 0 0 0 1px var(--lime); }

.entonnoir { display: grid; grid-template-columns: repeat(8, 1fr); gap: 6px; margin-bottom: 18px; }
.entonnoir .etape {
  background: var(--surface); border: 1px solid var(--ligne); border-radius: var(--rayon-s); padding: 8px 8px 6px; cursor: pointer;
  font-family: inherit; color: var(--texte); display: grid; grid-template-columns: 14px 1fr; grid-template-rows: auto auto; gap: 0 8px; align-items: end; text-align: left;
}
.entonnoir .etape:hover { border-color: var(--texte-doux); }
.entonnoir .etape.active { border-color: var(--lime); box-shadow: inset 0 0 0 1px var(--lime); }
.entonnoir .etape.separe { margin-left: 10px; }
.entonnoir .etape .barre { grid-row: 1 / 3; align-self: stretch; background: var(--surface-2); border-radius: 4px; position: relative; min-height: 38px; }
.entonnoir .etape .barre span { position: absolute; left: 0; right: 0; bottom: 0; background: var(--texte-doux); border-radius: 4px; }
.entonnoir .etape.contact_pris .barre span { background: #8fd0ea; }
.entonnoir .etape.besoin_qualifie .barre span { background: #a9c4f0; }
.entonnoir .etape.devis_envoye .barre span { background: var(--orange); }
.entonnoir .etape.negociation .barre span { background: var(--violet); }
.entonnoir .etape.en_veille .barre span { background: #d9d27a; }
.entonnoir .etape.gagne .barre span { background: var(--vert); }
.entonnoir .etape.perdu .barre span { background: var(--rouge); }
.entonnoir .etape .nb { font-size: 20px; font-weight: 700; line-height: 1.1; font-variant-numeric: tabular-nums; }
.entonnoir .etape .nom { font-size: 12px; color: var(--texte-doux); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.entonnoir .etape .montant { grid-column: 2; font-size: 11px; color: var(--texte-doux); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 2px; }

.tdb { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 16px; align-items: start; }
.tdb-cote { background: var(--surface); border: 1px solid var(--ligne); border-radius: var(--rayon); padding: 12px 14px; position: sticky; top: 62px; max-height: calc(100vh - 80px); overflow-y: auto; }
.afaire-entete { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin-bottom: 6px; }
.afaire-entete h2 { margin: 0; }
.afaire-titre { font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--texte-doux); font-weight: 600; margin: 12px 0 4px; }
.afaire-titre.retard { color: var(--rouge); }
.afaire-titre.ok { color: var(--lime); }
.afaire-titre .nb { font-weight: 400; }
.afaire-item { display: block; padding: 7px 10px; border-radius: var(--rayon-s); background: var(--fond); border: 1px solid var(--ligne); margin-bottom: 5px; color: var(--texte); font-size: 13px; }
.afaire-item:hover { border-color: var(--texte-doux); text-decoration: none; }
.afaire-item.retard { border-left: 3px solid var(--rouge); }
.afaire-item.aujourdhui { border-left: 3px solid var(--lime); }
.afaire-item .quand { display: block; font-size: 11px; font-weight: 600; color: var(--texte-doux); }
.afaire-item.retard .quand { color: var(--rouge); }
.afaire-item.aujourdhui .quand { color: var(--lime); }
.afaire-item .compte { display: block; font-weight: 700; }
.afaire-item .action { display: block; color: var(--texte-doux); overflow-wrap: anywhere; }
.afaire-plus { display: block; font-size: 12px; padding: 2px 10px 6px; }
.afaire-vide { color: var(--texte-doux); font-size: 13px; padding: 10px 0; }

.tableau.sujets th.triable { cursor: pointer; user-select: none; white-space: nowrap; }
.tableau.sujets th.triable:hover { color: var(--texte); }
.tableau.sujets th.triable.actif { color: var(--lime); }
.tableau.sujets th.triable.actif[data-sens=asc]::after { content: ' ↑'; }
.tableau.sujets th.triable.actif[data-sens=desc]::after { content: ' ↓'; }
.tableau.sujets td { padding: 8px 8px; }
.tableau.sujets tr.ligne-retard td:first-child { box-shadow: inset 3px 0 0 var(--rouge); }
.tableau.sujets tr.ligne-jour td:first-child { box-shadow: inset 3px 0 0 var(--lime); }
.tableau.sujets .principal { font-weight: 600; overflow-wrap: break-word; }
.tableau.sujets th:first-child, .tableau.sujets td:first-child { min-width: 150px; }
.tableau.sujets th:nth-child(2), .tableau.sujets td:nth-child(2) { min-width: 170px; }
.tableau.sujets .principal.doux-fort { font-weight: 500; }
.tableau.sujets .secondaire { font-size: 12px; color: var(--texte-doux); overflow-wrap: break-word; }
.tableau.sujets .quand { font-size: 13px; font-weight: 600; white-space: nowrap; }
.tableau.sujets .quand.retard { color: var(--rouge); }
.tableau.sujets .quand.aujourdhui { color: var(--lime); }
.tableau.sujets .quand.doux { color: var(--texte-doux); font-weight: 400; }
.tableau.sujets .cellule-etape { width: 150px; }
.tableau.sujets select.etape-ligne { padding: 4px 24px 4px 8px; font-size: 12px; font-weight: 700; letter-spacing: .03em; text-transform: uppercase; border-radius: 6px; border: none; cursor: pointer; width: auto; max-width: 150px; background: var(--surface-2); color: var(--texte-doux); }
.tableau.sujets select.etape-ligne.contact_pris { background: #1f3a46; color: #8fd0ea; }
.tableau.sujets select.etape-ligne.besoin_qualifie { background: #2a3a4e; color: #a9c4f0; }
.tableau.sujets select.etape-ligne.devis_envoye { background: #4a3316; color: #f0b86a; }
.tableau.sujets select.etape-ligne.negociation { background: #3d2f45; color: #d3a8ee; }
.tableau.sujets select.etape-ligne.gagne { background: #2b4020; color: #b5e08a; }
.tableau.sujets select.etape-ligne.perdu { background: #402424; color: #e09a9a; }
.tableau.sujets select.etape-ligne.en_veille { background: #33321f; color: #d9d27a; }
.tableau.sujets select.etape-ligne option { background: var(--surface); color: var(--texte); text-transform: none; font-weight: 400; }
.tableau.sujets td .vide { padding: 30px 10px; }

@media (max-width: 1300px) { .tableau.sujets .col-dernier { display: none; } }
@media (max-width: 1000px) {
  .tdb { grid-template-columns: minmax(0, 1fr); }
  .tdb-cote { position: static; max-height: none; order: -1; }
  .entonnoir { grid-template-columns: repeat(4, 1fr); }
  .entonnoir .etape.separe { margin-left: 0; }
}
@media (max-width: 700px) {
  .tableau.sujets .col-resp, .tableau.sujets .col-montant, .tableau.sujets .col-dernier { display: none; }
  .tableau.sujets .cellule-etape { width: auto; }
  .tableau.sujets th:first-child, .tableau.sujets td:first-child { min-width: 120px; }
  .tableau.sujets th:nth-child(2), .tableau.sujets td:nth-child(2) { min-width: 130px; }
  .entonnoir { gap: 4px; }
  .entonnoir .etape { padding: 6px 6px 5px; grid-template-columns: 10px 1fr; gap: 0 6px; }
  .entonnoir .etape .nom { white-space: normal; font-size: 11px; line-height: 1.15; }
  .entonnoir .etape .nb { font-size: 17px; }
}

/* ---------- cartes de sujet (fiche compte) ---------- */
.carte-sujet { display: block; background: var(--fond); border: 1px solid var(--ligne); border-radius: var(--rayon-s); padding: 10px 12px; color: var(--texte); }
.carte-sujet:hover { border-color: var(--texte-doux); text-decoration: none; }
.carte-sujet.retard { border-left: 3px solid var(--rouge); }
.carte-sujet.aujourdhui { border-left: 3px solid var(--lime); }
.carte-sujet .compte { font-weight: 700; font-size: 14px; overflow-wrap: anywhere; }
.carte-sujet .titre-carte { font-size: 13px; color: var(--texte-doux); margin-bottom: 6px; overflow-wrap: anywhere; }
.carte-sujet .pied-carte { display: flex; justify-content: space-between; gap: 8px; font-size: 12px; color: var(--texte-doux); flex-wrap: wrap; }
.carte-sujet .pied-carte .quand.retard { color: var(--rouge); font-weight: 600; }
.carte-sujet .pied-carte .quand.aujourdhui { color: var(--lime); font-weight: 600; }
.liste-cartes { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 8px; }
.liste-cartes .carte-sujet { background: var(--surface); }
.deplacer-vers { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 8px; }
.deplacer-vers button { font-size: 11px; padding: 3px 7px; }

/* ---------- fiche ---------- */
.retour { display: inline-block; margin-bottom: 10px; font-size: 14px; }
.fiche-entete { margin-bottom: 12px; }
.fiche-entete h1 { margin: 0 0 4px; font-size: 24px; line-height: 1.2; overflow-wrap: anywhere; }
.fiche-entete .sous { color: var(--texte-doux); font-size: 14px; display: flex; flex-wrap: wrap; gap: 4px 12px; align-items: center; }
.etapes { list-style: none; display: flex; flex-wrap: wrap; gap: 4px; margin: 8px 0 12px; padding: 0; font-size: 12px; }
.etapes li { padding: 5px 11px; border-radius: 999px; background: var(--surface); color: var(--texte-doux); border: 1px solid var(--ligne); cursor: pointer; font-family: inherit; }
.etapes li:hover { border-color: var(--texte-doux); }
.etapes li.faite { color: var(--vert); border-color: #2b4020; }
.etapes li.courante { background: var(--lime); color: #141509; border-color: var(--lime); font-weight: 700; cursor: default; }
.etapes li.fin { margin-left: auto; }
.bloc { background: var(--surface); border: 1px solid var(--ligne); border-radius: var(--rayon); padding: 12px 14px; margin-bottom: 12px; }
.bloc p { margin: 0 0 10px; }
.bloc p:last-child { margin-bottom: 0; }
.bloc.action-suivante { border-color: var(--lime); }
.bloc.action-suivante.retard { border-color: var(--rouge); }
.deux-colonnes { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; align-items: start; }
.fiche { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 14px; }
.fiche .champ { background: var(--surface); border-radius: var(--rayon-s); padding: 8px 10px; }
.fiche .champ .etiquette { font-size: 11px; text-transform: uppercase; letter-spacing: .04em; color: var(--texte-doux); }
.fiche .champ .valeur { font-size: 15px; overflow-wrap: anywhere; }
.fiche .champ .valeur.vide { color: var(--texte-doux); font-style: italic; }
.fiche .champ.large { grid-column: 1 / -1; }

/* ---------- journal ---------- */
.historique { list-style: none; margin: 0 0 10px; padding: 0; border-left: 2px solid var(--ligne); }
.historique li { padding: 6px 0 6px 16px; font-size: 14px; position: relative; }
.historique li::before { content: ''; position: absolute; left: -5px; top: 13px; width: 8px; height: 8px; border-radius: 50%; background: var(--ligne); }
.historique li.appel::before, .historique li.email::before { background: var(--ocean); }
.historique li.rdv::before, .historique li.visite::before { background: var(--violet); }
.historique li.devis::before { background: var(--orange); }
.historique li.etape::before { background: var(--lime); }
.historique li.creation::before { background: var(--texte-doux); }
.historique .entete-evt { display: flex; flex-wrap: wrap; gap: 4px 8px; align-items: baseline; }
.historique .quand { color: var(--texte-doux); font-size: 12px; }
.historique .qui { color: var(--texte-doux); font-size: 12px; }
.historique .texte-evenement { background: var(--surface); border-radius: var(--rayon-s); padding: 8px 10px; margin-top: 4px; overflow-wrap: anywhere; }
.historique .texte-evenement.doux { background: none; padding: 2px 0; }
.historique .lien-sujet { font-size: 12px; }
.types-echange { display: flex; flex-wrap: wrap; gap: 4px; }
.types-echange button { background: var(--surface-2); border: 1px solid var(--ligne); color: var(--texte-doux); border-radius: 999px; padding: 5px 10px; font-size: 13px; cursor: pointer; font-family: inherit; }
.types-echange button.actif { background: var(--lime); color: #141509; border-color: var(--lime); font-weight: 600; }

/* ---------- contacts ---------- */
.contacts { list-style: none; margin: 0; padding: 0; }
.contacts li { display: flex; flex-wrap: wrap; gap: 4px 12px; align-items: baseline; padding: 8px 0; border-bottom: 1px solid var(--ligne); }
.contacts li:last-child { border-bottom: none; }
.contacts li .nom { font-weight: 600; }
.contacts li .fonction { color: var(--texte-doux); font-size: 13px; }
.contacts li .coord { font-size: 13px; }
.contacts li .modif { margin-left: auto; }

/* ---------- tableaux ---------- */
.tableau { width: 100%; border-collapse: collapse; font-size: 14px; }
.tableau th, .tableau td { text-align: left; padding: 7px 8px; border-bottom: 1px solid var(--ligne); vertical-align: middle; }
.tableau th { color: var(--texte-doux); font-weight: 600; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; }
.tableau td.num, .tableau th.num { text-align: right; font-variant-numeric: tabular-nums; }
.tableau tr.cliquable { cursor: pointer; }
.tableau tr.cliquable:hover td { background: var(--surface); }
.defilable { overflow-x: auto; -webkit-overflow-scrolling: touch; }

/* ---------- modale ---------- */
.voile { position: fixed; inset: 0; background: rgba(0, 0, 0, .6); z-index: 50; display: none; align-items: flex-end; justify-content: center; }
.voile.ouvert { display: flex; }
.modale { background: var(--fond); border: 1px solid var(--ligne); border-radius: var(--rayon) var(--rayon) 0 0; width: 100%; max-width: 720px; max-height: 92vh; overflow-y: auto; padding: 16px; box-shadow: var(--ombre); }
@media (min-width: 700px) { .voile { align-items: center; } .modale { border-radius: var(--rayon); } }
.modale .entete { display: flex; align-items: flex-start; gap: 10px; margin-bottom: 12px; }
.modale .entete h3 { margin: 0; font-size: 18px; flex: 1; }
.modale .fermer { background: none; border: none; color: var(--texte-doux); font-size: 22px; cursor: pointer; padding: 0 6px; }
.modale .explication { color: var(--texte-doux); font-size: 13px; margin: -6px 0 12px; }

/* ---------- formulaires ---------- */
.formulaire { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.formulaire label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--texte-doux); text-transform: uppercase; letter-spacing: .04em; }
.formulaire label.large { grid-column: 1 / -1; }
.formulaire label.ligne { flex-direction: row; align-items: center; gap: 8px; text-transform: none; font-size: 14px; color: var(--texte); }
.formulaire label.ligne input[type=checkbox] { width: auto; }
.formulaire .aide { font-size: 12px; color: var(--texte-doux); text-transform: none; letter-spacing: 0; }
input[type=text], input[type=number], input[type=date], input[type=datetime-local], input[type=email], input[type=tel], input[type=url], select, textarea {
  width: 100%; background: var(--surface); border: 1px solid var(--ligne); color: var(--texte);
  border-radius: var(--rayon-s); padding: 9px 10px; font-size: 15px; font-family: inherit;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--lime); }
textarea { min-height: 70px; resize: vertical; }
.actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 14px; flex-wrap: wrap; }
.actions .gauche { margin-right: auto; }

/* ---------- onglets ---------- */
.onglets { display: flex; gap: 4px; border-bottom: 1px solid var(--ligne); margin-bottom: 14px; overflow-x: auto; }
.onglets button { background: none; border: none; color: var(--texte-doux); padding: 10px 14px; cursor: pointer; font-size: 14px; font-family: inherit; border-bottom: 2px solid transparent; white-space: nowrap; }
.onglets button.actif { color: var(--texte); border-bottom-color: var(--lime); font-weight: 600; }

/* ---------- toast ---------- */
.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%) translateY(20px); background: var(--surface-2); color: var(--texte);
  border: 1px solid var(--ligne); padding: 10px 16px; border-radius: 999px; font-size: 14px; opacity: 0; pointer-events: none;
  transition: all .25s; z-index: 60; max-width: 90vw; text-align: center;
}
.toast.visible { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.ok { border-color: var(--vert); }
.toast.erreur { border-color: var(--rouge); }

@media (max-width: 700px) {
  .fiche, .formulaire, .deux-colonnes { grid-template-columns: 1fr; }
  .carte { grid-template-columns: 1fr; }
  .carte .cote { grid-column: 1; grid-row: auto; text-align: left; }
  .etapes li.fin { margin-left: 0; }
}
