/* Govimmo · Prospection — feuille de style unique, sans dépendance externe.
   Jaune = quota et attente uniquement. Un seul bouton plein par carte : l'action qui fait avancer. */
:root {
  --fond: #f4f2ec;
  --surface: #ffffff;
  --encre: #1b2130;
  --doux: #5d6576;
  --tres-doux: #8b92a1;
  --ligne: #e2ded3;
  --primaire: #0d5c55;
  --primaire-fonce: #08453f;
  --primaire-clair: #e2eeec;
  --attente-fond: #fbefc6;
  --attente-texte: #6a5200;
  --attente-bord: #efd27a;
  --danger: #a4321f;
  --danger-clair: #f7e5e1;
  --ok: #276b45;
  --ok-clair: #e3f1e8;
  --rayon: 12px;
  --ombre: 0 1px 2px rgba(27, 33, 48, .06), 0 2px 8px rgba(27, 33, 48, .04);
  --police: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--fond); color: var(--encre); font: 15px/1.5 var(--police); padding-bottom: 76px; }
a { color: var(--primaire); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 22px; letter-spacing: -.01em; margin: 4px 0 4px; }
h2 { font-size: 17px; margin: 28px 0 10px; }
h3 { font-size: 15px; margin: 0 0 6px; }
p { margin: 0 0 10px; }
small, .doux { color: var(--doux); }
.tres-doux { color: var(--tres-doux); }

/* En-tête */
.entete { position: sticky; top: 0; z-index: 10; background: var(--encre); color: #fff; }
.entete .interieur { max-width: 860px; margin: 0 auto; display: flex; align-items: center; gap: 14px; padding: 10px 16px; }
.marque { font-weight: 700; letter-spacing: .01em; color: #fff; white-space: nowrap; }
.marque span { color: #9fd2c9; font-weight: 500; }
.nav-haut { display: none; gap: 4px; margin-left: 8px; }
.nav-haut a { white-space: nowrap; color: #c9cfdb; padding: 6px 10px; border-radius: 8px; font-size: 14px; }
.nav-haut a.actif, .nav-haut a:hover { background: rgba(255, 255, 255, .1); color: #fff; text-decoration: none; }
.entete .droite { margin-left: auto; display: flex; gap: 8px; align-items: center; }

/* Pastilles */
.pastille { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; padding: 3px 9px; border-radius: 999px; background: #eceae4; color: var(--doux); white-space: nowrap; }
.pastille.attente { background: var(--attente-fond); color: var(--attente-texte); border: 1px solid var(--attente-bord); }
.pastille.ok { background: var(--ok-clair); color: var(--ok); }
.pastille.danger { background: var(--danger-clair); color: var(--danger); }
.pastille.primaire { background: var(--primaire-clair); color: var(--primaire); }
.pastille.sombre { background: rgba(255, 255, 255, .12); color: #fff; }
.compteur { display: inline-block; min-width: 18px; padding: 0 5px; border-radius: 9px; background: var(--danger); color: #fff; font-size: 11px; line-height: 18px; text-align: center; font-weight: 700; }

/* Bandeaux */
.bandeau { padding: 9px 16px; font-size: 13.5px; text-align: center; }
.bandeau.simulation { background: var(--attente-fond); color: var(--attente-texte); border-bottom: 1px solid var(--attente-bord); }
.bandeau.danger { background: var(--danger); color: #fff; }
.bandeau a { color: inherit; text-decoration: underline; }

/* Page */
main { max-width: 860px; margin: 0 auto; padding: 18px 16px 30px; }
.titre-page { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.flash { padding: 10px 14px; border-radius: 10px; margin-bottom: 12px; font-size: 14px; }
.flash.ok { background: var(--ok-clair); color: var(--ok); }
.flash.erreur { background: var(--danger-clair); color: var(--danger); }

/* Cartes */
.carte { background: var(--surface); border: 1px solid var(--ligne); border-radius: var(--rayon); box-shadow: var(--ombre); padding: 14px 16px; margin-bottom: 12px; }
.carte.relance { border-left: 4px solid var(--primaire); }
.carte.reponse { border-left: 4px solid var(--ok); }
.carte.valide { border-left: 4px solid var(--attente-bord); }
.carte .tete { display: flex; justify-content: space-between; gap: 10px; align-items: flex-start; margin-bottom: 8px; }
.carte .entreprise { font-weight: 700; font-size: 15.5px; }
.carte .meta { font-size: 12.5px; color: var(--doux); margin-top: 2px; }
.carte .objet { font-weight: 600; margin: 8px 0 4px; }
.carte .texte { white-space: pre-wrap; font-size: 14.5px; line-height: 1.55; margin: 6px 0 10px; }
.carte .texte .suffixe { color: var(--tres-doux); }
.carte.partie { opacity: 0; transform: translateX(30px); transition: all .25s ease; }
.vide { text-align: center; padding: 44px 16px; color: var(--doux); }
.vide .grand { font-size: 17px; color: var(--encre); font-weight: 600; margin-bottom: 6px; }

/* Boutons */
.actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
button, .bouton { font: inherit; font-size: 14px; font-weight: 600; border-radius: 10px; padding: 9px 14px; cursor: pointer; border: 1px solid var(--ligne); background: var(--surface); color: var(--encre); display: inline-flex; align-items: center; gap: 6px; text-decoration: none; min-height: 40px; }
button:hover, .bouton:hover { border-color: #c9c3b5; text-decoration: none; }
.principal { background: var(--primaire); border-color: var(--primaire); color: #fff; }
.principal:hover { background: var(--primaire-fonce); border-color: var(--primaire-fonce); }
.discret { border-color: transparent; background: transparent; color: var(--doux); }
.discret:hover { background: #efece5; }
.danger-texte { color: var(--danger); }
button:disabled { opacity: .5; cursor: not-allowed; }
.actions .pousse { margin-left: auto; }

/* Formulaires */
label { display: block; font-size: 13px; font-weight: 600; color: var(--doux); margin: 10px 0 4px; }
input[type=text], input[type=email], input[type=number], input[type=password], input[type=url], select, textarea {
  width: 100%; font: inherit; font-size: 15px; padding: 9px 11px; border: 1px solid var(--ligne); border-radius: 9px; background: #fff; color: var(--encre); }
textarea { min-height: 120px; resize: vertical; line-height: 1.5; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--primaire-clair); border-color: var(--primaire); }
.case { display: flex; align-items: center; gap: 8px; font-weight: 500; color: var(--encre); }
.case input { width: 18px; height: 18px; }
.grille { display: grid; grid-template-columns: 1fr; gap: 0 14px; }
.aide { font-size: 12.5px; color: var(--tres-doux); margin-top: 3px; }
.variable { background: var(--attente-fond); color: var(--attente-texte); padding: 0 4px; border-radius: 4px; font-family: var(--mono); font-size: 12px; }
fieldset { border: 1px solid var(--ligne); border-radius: var(--rayon); padding: 6px 16px 16px; margin: 0 0 16px; background: var(--surface); }
legend { font-weight: 700; padding: 0 6px; }

/* Listes et tableaux */
.filtres { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.filtres input, .filtres select { width: auto; flex: 1 1 140px; }
.ligne-prospect { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 11px 14px; border-bottom: 1px solid var(--ligne); color: var(--encre); }
.ligne-prospect:hover { background: #faf9f6; text-decoration: none; }
.ligne-prospect:last-child { border-bottom: none; }
.liste { background: var(--surface); border: 1px solid var(--ligne); border-radius: var(--rayon); overflow: hidden; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th { text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--doux); font-weight: 600; padding: 8px 10px; border-bottom: 1px solid var(--ligne); }
td { padding: 9px 10px; border-bottom: 1px solid var(--ligne); }
tr:last-child td { border-bottom: none; }
td.nombre, th.nombre { text-align: right; font-variant-numeric: tabular-nums; }
.barre { height: 6px; background: #ece9e1; border-radius: 3px; overflow: hidden; min-width: 60px; }
.barre > span { display: block; height: 100%; background: var(--primaire); }

/* Tableau de bord */
.chiffres { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.chiffre { background: var(--surface); border: 1px solid var(--ligne); border-radius: var(--rayon); padding: 12px 14px; }
.chiffre .valeur { font-size: 26px; font-weight: 700; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.chiffre .libelle { font-size: 12.5px; color: var(--doux); }

/* Fil d'historique */
.fil { border-left: 2px solid var(--ligne); margin-left: 6px; padding-left: 16px; }
.fil .element { position: relative; margin-bottom: 14px; }
.fil .element::before { content: ""; position: absolute; left: -22px; top: 6px; width: 10px; height: 10px; border-radius: 50%; background: var(--ligne); }
.fil .element.envoye::before { background: var(--primaire); }
.fil .element.recu::before { background: var(--ok); }
.fil .element.erreur::before { background: var(--danger); }
.fil .contenu { white-space: pre-wrap; font-size: 14px; background: #faf9f6; border-radius: 8px; padding: 8px 10px; margin-top: 4px; }
.etapes { display: flex; gap: 6px; flex-wrap: wrap; }

/* Contacts d'une fiche */
.contact { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--ligne); flex-wrap: wrap; }
.contact:last-of-type { border-bottom: none; }
.contact > div:first-child { flex: 1 1 260px; }
.contact details { margin: 0; }
.contact summary { cursor: pointer; font-size: 13px; font-weight: 600; color: var(--doux); }

/* Pièces jointes d'un email */
.piece-jointe { margin: 4px 0 10px; padding: 8px 10px; background: #faf9f6; border: 1px dashed var(--ligne); border-radius: 9px; }
.piece-jointe .actions { gap: 6px; }
.piece-jointe .forme-piece { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.piece-jointe input[type=file] { width: auto; max-width: 100%; font: inherit; font-size: 13px; padding: 5px 7px; border: 1px solid var(--ligne); border-radius: 8px; background: #fff; }
.petit { min-height: 0; padding: 3px 9px; font-size: 12px; }

/* Navigation basse (mobile) */
.nav-bas { position: fixed; bottom: 0; left: 0; right: 0; background: var(--surface); border-top: 1px solid var(--ligne); display: flex; z-index: 10; padding-bottom: env(safe-area-inset-bottom); }
.nav-bas a { flex: 1; text-align: center; padding: 8px 2px 9px; font-size: 11px; color: var(--doux); position: relative; }
.nav-bas a .ic { display: block; font-size: 19px; line-height: 1.2; }
.nav-bas a.actif { color: var(--primaire); font-weight: 700; }
.nav-bas a .compteur { position: absolute; top: 3px; left: 50%; margin-left: 6px; }
.nav-bas a:hover { text-decoration: none; }

.cache { display: none !important; }
.toast { position: fixed; left: 50%; bottom: 90px; transform: translateX(-50%); background: var(--encre); color: #fff; padding: 10px 16px; border-radius: 10px; font-size: 14px; z-index: 50; max-width: 90vw; box-shadow: 0 6px 24px rgba(0,0,0,.2); }

@media (min-width: 760px) {
  body { padding-bottom: 0; }
  .nav-bas { display: none; }
  .nav-haut { display: flex; }
  .grille.deux { grid-template-columns: 1fr 1fr; }
  .chiffres { grid-template-columns: repeat(4, 1fr); }
  .toast { bottom: 30px; }
}
