/* Looply : styles communs (ordinateur + téléphone) */
:root {
  --fond: #f6f7f5;
  --carte: #ffffff;
  --bord: #e3e7e4;
  --texte: #16181d;
  --gris: #5b616e;
  --gris-titre: #4a5550;
  --vert: #1f5a3e;
  --vert-fonce: #16402c;
  --vert-clair: #e6f0ea;
  --vert-moyen: #a9cdb9;
  --entete-tableau: #f1f4f2;
  --orange: #a14a06;
  --orange-fond: #fdf1e6;
  --bleu: #24527a;
  --bleu-fond: #e8f0f8;
  --rouge: #8a1c12;
  --rouge-fond: #fdecea;
  --rouge-bord: #f2bcb5;
  --rayon: 12px;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--fond); color: var(--texte);
  font-family: Inter, system-ui, -apple-system, "Segoe UI", sans-serif; font-size: 14px;
  -webkit-text-size-adjust: 100%;
}
a { color: var(--vert); }
a:hover { color: var(--vert-fonce); }
button, input, select, textarea { font: inherit; color: inherit; }
.chargement { padding: 40px; color: var(--gris); }

/* ---------- Connexion ---------- */
.connexion { min-height: 100vh; min-height: 100dvh; box-sizing: border-box; display: flex; align-items: center; justify-content: center; padding: 24px; }
.connexion form {
  width: 100%; max-width: 360px; background: var(--carte); border: 1px solid var(--bord);
  border-radius: 16px; padding: 28px 24px; display: flex; flex-direction: column; gap: 14px;
}
.connexion .marque { margin: 0 0 6px; }
.champ { display: flex; flex-direction: column; gap: 5px; }
.champ label { font-size: 13px; font-weight: 600; color: var(--gris-titre); }
.champ input {
  height: 42px; padding: 0 12px; border: 1px solid #dcdee3; border-radius: 10px; background: #fff;
}
.champ input:focus { outline: 2px solid var(--vert-moyen); border-color: var(--vert); }
.erreur { color: var(--rouge); font-size: 13px; min-height: 18px; }

/* ---------- Boutons ---------- */
.btn {
  height: 40px; padding: 0 16px; border-radius: 10px; border: 1px solid #dcdee3; background: #fff;
  font-weight: 500; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  text-decoration: none; color: var(--texte); white-space: nowrap;
}
.btn:hover { background: #f4f6f4; color: var(--texte); }
.btn-principal { background: var(--vert); border-color: var(--vert); color: #fff; font-weight: 600; }
.btn-principal:hover { background: var(--vert-fonce); color: #fff; }
.btn:disabled { opacity: .6; cursor: default; }

/* ---------- Marque ---------- */
.marque { display: flex; align-items: center; gap: 10px; }
.marque .pastille {
  width: 32px; height: 32px; flex: none; display: inline-flex;
}
.marque .pastille svg { display: block; }
.marque .nom { font-weight: 800; font-size: 21px; letter-spacing: -0.03em; line-height: 1; white-space: nowrap; color: #16201a; }
.marque .nom .oo { color: var(--vert); }

/* ---------- Mise en page ordinateur ---------- */
.coque { display: flex; min-height: 100%; }
.menu {
  width: 212px; flex: none; background: #fff; border-right: 1px solid var(--bord);
  padding: 24px 16px 18px; display: flex; flex-direction: column; gap: 2px;
  position: sticky; top: 0; height: 100vh; overflow-y: auto;
}
.menu .marque { margin: 0 8px 14px; padding-bottom: 16px; border-bottom: 1px solid var(--bord); }
.menu .section { font-size: 12.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--gris-titre); padding: 16px 12px 6px; }
.menu .section:first-of-type { padding-top: 4px; }
.menu a.lien {
  display: flex; align-items: center; gap: 10px; height: 36px; padding: 0 12px; border-radius: 8px;
  text-decoration: none; color: var(--gris);
}
.menu a.lien:hover { background: #f4f6f4; color: var(--texte); }
.menu a.lien.actif { background: var(--vert-clair); color: var(--vert-fonce); font-weight: 600; }
.menu a.lien.actif svg { stroke: var(--vert); }
.menu .vide { flex: 1; }
.profil { position: relative; }
.profil > button {
  width: 100%; display: flex; align-items: center; gap: 10px; padding: 8px 10px; border: 1px solid var(--bord);
  border-radius: 10px; background: #fff; text-align: left; cursor: pointer;
}
.avatar {
  width: 34px; height: 34px; border-radius: 50%; background: #cfe3d7; color: var(--vert-fonce);
  display: inline-flex; align-items: center; justify-content: center; font-weight: 600; font-size: 13px; flex: none;
}
.bandeau a.avatar { width: 40px; height: 40px; text-decoration: none; }
.avatar img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; display: block; }
.photo-profil { display: inline-flex; align-items: center; gap: 10px; }
.photo-boutons { display: inline-flex; gap: 8px; }
.photo-boutons label.btn { cursor: pointer; }
.profil .sous { display: block; font-size: 12px; color: var(--gris); }
.profil-menu {
  position: absolute; bottom: calc(100% + 6px); left: 0; right: 0; background: #fff; border: 1px solid var(--bord);
  border-radius: 10px; padding: 6px; box-shadow: 0 6px 20px rgba(0,0,0,.08); display: flex; flex-direction: column;
}
.profil-menu[hidden] { display: none; }
.profil-menu a, .profil-menu button {
  text-align: left; padding: 8px 10px; border: 0; background: none; border-radius: 6px; cursor: pointer;
  text-decoration: none; color: var(--texte);
}
.profil-menu a:hover, .profil-menu button:hover { background: #f4f6f4; }
.version { padding: 10px 12px 0; font-size: 11px; color: #6b7068; }

.contenu { flex: 1; min-width: 0; padding: 22px 32px 40px; display: flex; flex-direction: column; gap: 14px; }
.entete-page { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.entete-page h1 { margin: 0; font-weight: 600; font-size: 24px; }
.entete-page .sous-titre { color: var(--gris); font-size: 13px; margin-top: 2px; }
.actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }

/* ---------- Sélecteur d'année ---------- */
.annees { display: flex; align-items: center; gap: 2px; background: #e9ece9; border-radius: 10px; padding: 3px; }
.annees button {
  font-size: 13px; height: 32px; padding: 0 12px; border: 0; border-radius: 8px; background: transparent;
  color: var(--gris); cursor: pointer;
}
.annees button.actif { background: var(--vert); color: #fff; font-weight: 600; }
/* Choix de la date des Ventes (vente / encaissement), même dessin en plus petit */
.choix-date { display: flex; align-items: center; gap: 2px; background: #e9ece9; border-radius: 10px; padding: 3px; flex: none; }
.choix-date button {
  font-size: 12px; height: 28px; padding: 0 10px; border: 0; border-radius: 8px; background: transparent;
  color: var(--gris); cursor: pointer; white-space: nowrap;
}
.choix-date > span { font-size: 12px; color: var(--gris); padding: 0 6px 0 8px; }
.choix-date button.actif { background: #fff; color: var(--vert); font-weight: 600; box-shadow: 0 1px 2px rgba(0,0,0,.08); }

/* ---------- Bannières ---------- */
.banniere {
  display: flex; align-items: center; gap: 12px; background: var(--rouge-fond); border: 1px solid var(--rouge-bord);
  color: var(--rouge); border-radius: 10px; padding: 8px 14px; font-size: 13px;
}
.banniere span { flex: 1; }
.banniere a { color: var(--rouge); font-weight: 600; white-space: nowrap; }

/* ---------- Cartes chiffres ---------- */
.cartes { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; }
.carte { background: var(--carte); border: 1px solid var(--bord); border-radius: var(--rayon); padding: 14px 18px; }
.carte .titre { font-size: 13px; color: var(--gris); }
.carte .valeur { font-size: 24px; font-weight: 600; margin-top: 2px; color: var(--vert); white-space: nowrap; }
.carte .detail { font-size: 12px; color: var(--gris); margin-top: 2px; }
.carte .detail.alerte { color: var(--orange); }

/* ---------- Blocs ---------- */
.bloc { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.bloc-titre { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.bloc-titre h2 { margin: 0; font-weight: 600; font-size: 15px; }
.legende { display: flex; gap: 14px; font-size: 12px; color: var(--gris); }
.legende i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 5px; vertical-align: -1px; }
.panneau { background: #fff; border: 1px solid var(--bord); border-radius: var(--rayon); }

/* ---------- Graphique CA par mois ---------- */
.graph { padding: 14px 20px; }
.barres { display: flex; align-items: flex-end; gap: 14px; height: 190px; margin-top: 8px; border-bottom: 1px solid var(--bord); }
.barre { flex: 1; display: flex; flex-direction: column; justify-content: flex-end; height: 100%; min-width: 0; position: relative; }
.barre .total { text-align: center; font-size: 11px; font-weight: 600; color: #33403a; margin-bottom: 3px; white-space: nowrap; }
.barre .pile { border-radius: 6px 6px 0 0; overflow: hidden; display: flex; flex-direction: column; }
.barre .infobulle {
  display: none; position: absolute; bottom: calc(100% - 20px); left: 50%; transform: translateX(-50%);
  background: var(--texte); color: #fff; font-size: 12px; padding: 6px 9px; border-radius: 6px; white-space: nowrap; z-index: 5;
}
.barre:hover .infobulle { display: block; }
.mois { display: flex; gap: 14px; font-size: 11px; color: var(--gris); margin-top: 5px; }
.mois span { flex: 1; text-align: center; min-width: 0; }

/* ---------- Tableaux denses ---------- */
.tableau { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 13px; }
.tableau th {
  position: sticky; top: 0; background: var(--entete-tableau); font-size: 12px; color: #33403a; font-weight: 700;
  text-align: left; padding: 6px 10px; white-space: nowrap;
}
.tableau th:first-child { border-top-left-radius: var(--rayon); padding-left: 16px; }
.tableau th:last-child { border-top-right-radius: var(--rayon); padding-right: 16px; }
.tableau td {
  padding: 7px 10px; border-top: 1px solid var(--bord); white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  max-width: 0;
}
.tableau td:first-child { padding-left: 16px; }
.tableau td:last-child { padding-right: 16px; }
.tableau .centre { text-align: center; }
.tableau .droite { text-align: right; }
.tableau tr.vide td { color: var(--gris); text-align: center; padding: 18px; }

/* ---------- Pastilles de statut (picto + texte) ---------- */
.statut {
  display: inline-flex; align-items: center; gap: 4px; max-width: 100%; vertical-align: middle;
  font-size: 12px; font-weight: 600; border-radius: 999px; padding: 2px 8px; white-space: nowrap;
}
.statut > svg { flex: none; }
.statut > span { overflow: hidden; text-overflow: ellipsis; }
.statut.bleu { color: #0C447C; background: #E6F1FB; }
.statut.bleu-plein { color: #fff; background: #185FA5; }
.statut.orange { color: #633806; background: #FAEEDA; }
.statut.vert-eau { color: #085041; background: #E1F5EE; }
.statut.violet { color: #3C3489; background: #EEEDFE; }
.statut.vert-clair { color: #3B6D11; background: #EAF3DE; }
.statut.vert-plein { color: #fff; background: var(--vert); }
.statut.vert { color: var(--vert); background: var(--vert-clair); }
.statut.rouge { color: #791F1F; background: #FCEBEB; }
.statut.rose { color: #72243E; background: #FBEAF0; }
.statut.gris { color: #5F5E5A; background: #F1EFE8; }


/* ---------- Outils communs ---------- */
.txt-gris { color: var(--gris); }
.txt-vert { color: var(--vert); }
.txt-rouge { color: #a23b2c; }
.tiret { color: #b9bec4; }
.masque { position: absolute; left: -9999px; }
.icone-info { display: inline-flex; vertical-align: middle; color: var(--vert); cursor: help; }
.seul-tel, .seul-tel-flex { display: none; }
.lien-bouton { border: 0; background: none; padding: 0 6px; color: var(--vert); text-decoration: underline; cursor: pointer; font-size: 13px; }
.btn-petit { height: 34px; padding: 0 12px; font-size: 13px; border-radius: 8px; }
.cartes.quatre { grid-template-columns: repeat(4, minmax(0, 1fr)); }

/* ---------- Barre d'outils des listes : puces, filtres actifs, recherche ---------- */
.barre-outils { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.puces { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.puce {
  font-size: 13px; height: 32px; padding: 0 11px; border-radius: 999px; white-space: nowrap; flex: none;
  background: #fff; border: 1px solid var(--bord); cursor: pointer;
}
.puces.seul-tel-flex { display: none; }
.puce .nb { opacity: .75; margin-left: 3px; }
.puce.actif { background: var(--vert); border-color: var(--vert); color: #fff; font-weight: 600; }
.recherche { margin-left: auto; width: 200px; }
.recherche.large { width: 260px; }
.recherche input {
  width: 100%; height: 34px; border: 1px solid var(--bord); border-radius: 8px; background: #fff; font-size: 13px; padding: 0 10px;
}
.barre-filtres { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; min-height: 0; }
.barre-filtres:empty { display: none; }
.filtres-titre { font-size: 13px; color: var(--gris); margin-right: 2px; }
.etiquette-filtre {
  display: inline-flex; align-items: center; gap: 4px; height: 28px; padding: 0 4px 0 10px; border-radius: 999px;
  background: var(--vert-clair); color: var(--vert-fonce); font-size: 12px; font-weight: 500; max-width: 340px;
}
.etiquette-filtre button { width: 22px; height: 22px; border: 0; border-radius: 999px; background: transparent; color: inherit; cursor: pointer; flex: none; }
.etiquette-filtre button:hover { background: #d5e8dc; }
.total-filtre { font-size: 13px; color: var(--gris); margin-left: 6px; }
.total-filtre b { color: var(--texte); font-weight: 600; }

/* ---------- Tableaux filtrables ---------- */
.zone-tableau { position: relative; }
.tableau.fixe { table-layout: fixed; }
.tableau th .entete { display: flex; align-items: center; gap: 3px; }
.tableau th.droite .entete { justify-content: flex-end; }
.tableau th.centre .entete { justify-content: center; }
.titre-tri { border: 0; background: none; padding: 0; font: inherit; color: inherit; cursor: pointer; white-space: nowrap; }
.titre-tri:hover { color: var(--vert); }
.btn-filtre {
  width: 22px; height: 22px; flex: none; border: 0; border-radius: 6px; padding: 0; display: inline-flex;
  align-items: center; justify-content: center; background: transparent; color: #7a808a; cursor: pointer;
}
.btn-filtre:hover { background: #e3e9e5; }
.btn-filtre.actif { background: #d5e8dc; color: var(--vert); }
.tableau tbody tr:hover td { background: #fafbfa; }
.tableau td .statut { max-width: 100%; }

/* Fenêtre de filtre d'une colonne */
.popover {
  position: absolute; z-index: 30; width: 250px; background: #fff; border: 1px solid #d6dbd8; border-radius: 12px;
  box-shadow: 0 12px 32px rgba(20,30,25,.16); padding: 10px; display: flex; flex-direction: column; gap: 6px;
}
.popover .option {
  text-align: left; font-size: 13px; height: 30px; padding: 0 8px; border: 0; border-radius: 6px; background: transparent; cursor: pointer;
}
.popover .option:hover { background: #f4f6f4; }
.popover .separateur { height: 1px; background: var(--bord); }
.popover input[type="search"] { height: 32px; border: 1px solid var(--bord); border-radius: 8px; font-size: 13px; padding: 0 10px; width: 100%; }
.liste-valeurs { max-height: 240px; overflow-y: auto; display: flex; flex-direction: column; }
.liste-valeurs label, .feuille fieldset label {
  display: flex; align-items: center; gap: 8px; min-height: 30px; font-size: 13px; cursor: pointer;
}
.liste-valeurs label[hidden] { display: none; }
.liste-valeurs label.tout { font-weight: 500; }
.liste-valeurs input, .feuille input[type="checkbox"] { width: 16px; height: 16px; accent-color: var(--vert); flex: none; margin: 0; }
.liste-valeurs .nom, .feuille .nom { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.liste-valeurs .nb, .feuille .nb { color: var(--gris); }
.champ-compact { display: flex; flex-direction: column; gap: 4px; font-size: 12px; font-weight: 600; color: var(--gris-titre); }
.popover .boutons, .feuille .boutons { display: flex; gap: 8px; justify-content: flex-end; margin-top: 4px; }

/* Feuille « Filtres » (téléphone) */
.feuille-fond { position: fixed; inset: 0; z-index: 50; background: rgba(20,24,22,.35); display: flex; align-items: flex-end; }
.feuille {
  width: 100%; max-height: 85vh; overflow-y: auto; background: #fff; border-radius: 16px 16px 0 0;
  padding: 14px 16px calc(14px + env(safe-area-inset-bottom)); display: flex; flex-direction: column; gap: 10px;
}
.feuille-titre { display: flex; justify-content: space-between; align-items: center; font-size: 16px; }
.feuille fieldset { border: 0; border-top: 1px solid var(--bord); margin: 0; padding: 8px 0 0; }
.feuille legend { font-size: 13px; font-weight: 700; color: var(--gris-titre); padding: 0; margin-bottom: 4px;
  width: 100%; display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.feuille legend .lien-bouton { font-size: 13px; font-weight: 500; }
.feuille fieldset label { min-height: 40px; font-size: 14px; }

/* ---------- Écran en construction ---------- */
.en-construction { padding: 28px; color: var(--gris); }


/* ---------- Lignes cliquables ---------- */
.tableau tr.cliquable { cursor: pointer; }
.tableau tr.cliquable:focus-visible td { background: var(--vert-clair); outline: none; }
.ligne-tel.cliquable { cursor: pointer; }
.ligne-tel.cliquable:active { background: #f4f6f4; }

/* ---------- Panneau de formulaire (à droite sur ordinateur) ---------- */
body.panneau-actif { overflow: hidden; }
.panneau-fond { position: fixed; inset: 0; z-index: 60; background: rgba(20,30,25,.38); display: flex; justify-content: flex-end; }
.panneau-form {
  width: 560px; max-width: 100%; height: 100%; background: #fff; box-shadow: -12px 0 32px rgba(0,0,0,.14);
  display: flex; flex-direction: column;
}
.panneau-entete { padding: 18px 26px 14px; border-bottom: 1px solid var(--bord); display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.panneau-entete .surtitre { font-size: 13px; color: var(--gris); }
.panneau-entete .titre { font-size: 20px; font-weight: 600; margin-top: 2px; }
.btn-fermer { width: 40px; height: 40px; flex: none; border-radius: 10px; border: 1px solid #dcdee3; background: #fff; font-size: 16px; cursor: pointer; }
.panneau-corps {
  flex: 1; min-height: 0; overflow-y: auto; padding: 16px 26px 20px;
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 14px; align-content: start;
}
.grille-form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 14px; }
.large { grid-column: 1 / -1; }
.champ-form, .libelle-form { font-size: 13px; color: var(--gris); font-weight: 500; }
.champ-form { display: block; min-width: 0; }
.champ-form input, .champ-form select, .champ-form textarea {
  display: block; width: 100%; margin-top: 4px; height: 40px; border: 1px solid #d6dbd8; border-radius: 10px;
  background: #fff; font-size: 14px; padding: 0 12px; color: var(--texte);
}
.champ-form textarea { height: auto; padding: 8px 12px; resize: vertical; line-height: 1.45; }
.champ-form input:focus, .champ-form select:focus, .champ-form textarea:focus { outline: 2px solid var(--vert-moyen); border-color: var(--vert); }
.champ-form input:disabled { background: #f1f4f2; color: #8a9089; }
/* Texte centré dans toutes les cases d'une ligne (y compris les dates sur Safari) ; les zones de texte restent à gauche */
.champ-form input, .champ-form select { text-align: center; text-align-last: center; line-height: normal; }
.champ-form input[type="date"] {
  -webkit-appearance: none; appearance: none; display: flex; align-items: center; justify-content: center; line-height: 38px;
}
.champ-form input[type="date"]::-webkit-date-and-time-value { text-align: center; margin: 0; }
.champ-form input[type="date"]::-webkit-datetime-edit { padding: 0; }
.champ-form input.nombre { font-variant-numeric: normal; }
/* Date : pas d'espaces autour des « / » ajoutés par le navigateur */
.champ-form input[type="date"]::-webkit-datetime-edit-text { padding: 0; }
.champ-form.calcule input { background: #f1f4f2; border-color: var(--bord); font-weight: 700; }
.champ-form[hidden] { display: none; }
.libelle-form { margin-bottom: 4px; }
.choix { display: flex; gap: 6px; }
.choix button {
  flex: 1; min-width: 0; height: 36px; border-radius: 10px; font-size: 13px; background: #fff; color: var(--texte);
  border: 1px solid #d6dbd8; cursor: pointer; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding: 0 6px;
}
.choix.retour { flex-wrap: wrap; }
.choix.retour button { flex: 1 1 22%; }
.choix button.actif { background: var(--vert); border-color: var(--vert); color: #fff; font-weight: 600; }
.case-form { display: flex; align-items: center; gap: 10px; min-height: 40px; font-size: 14px; cursor: pointer; }
.case-form input { width: 18px; height: 18px; accent-color: var(--vert); margin: 0; flex: none; }
.aligne-bas { align-self: end; }
.cases-ligne { display: flex; flex-wrap: wrap; column-gap: 18px; }
.encart {
  background: var(--fond); border: 1px dashed #d6dbd8; border-radius: 10px; padding: 10px 12px;
  display: flex; flex-direction: column; gap: 8px; font-size: 13px;
}
.encart-ligne { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.encart-titre { font-weight: 700; color: var(--gris-titre); }
.noir { color: var(--texte); }
.btn-contour { color: var(--vert); border-color: var(--vert); font-weight: 600; background: #fff; align-self: flex-start; }
.dep-existante { display: flex; justify-content: space-between; gap: 10px; color: var(--gris); }
.dep-nouvelle, .ligne-achat {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 10px; padding: 10px; background: #fff;
  border: 1px solid var(--bord); border-radius: 10px;
}
.ligne-achat { grid-template-columns: minmax(0, 1fr) 110px 36px; align-items: end; }
.ligne-achat .info-achat { grid-column: 1 / -1; font-size: 12px; color: var(--gris); }
.btn-retirer { width: 36px; height: 40px; border: 1px solid #dcdee3; border-radius: 10px; background: #fff; cursor: pointer; color: var(--gris); }
.repartition { font-size: 13px; }
.txt-orange { color: var(--orange); }
.sous-titre-form { font-weight: 700; font-size: 13px; color: var(--gris-titre); margin: 6px 0 8px; padding-top: 10px; border-top: 1px solid var(--bord); }
.bloc-plateforme[hidden] { display: none; }
.panneau-erreur {
  margin: 0 26px 10px; background: var(--rouge-fond); border: 1px solid var(--rouge-bord); color: var(--rouge);
  border-radius: 10px; padding: 8px 12px; font-size: 13px;
}
.panneau-erreur ul { margin: 4px 0 0; padding-left: 18px; }
.panneau-erreur .lien-bouton { color: var(--rouge); padding: 0; text-align: left; }
.panneau-pied { padding: 12px 26px; border-top: 1px solid var(--bord); display: flex; justify-content: flex-end; gap: 10px; align-items: center; flex-wrap: wrap; }
.panneau-pied .espace { flex: 1; }
.pied-info { flex: 1 1 100%; font-size: 12px; color: var(--gris); }
.btn-danger { color: var(--rouge); border-color: var(--rouge-bord); margin-right: auto; }
.btn-danger:hover { background: var(--rouge-fond); color: var(--rouge); }

/* Écran « Ajouter » */
.ligne-ajout {
  display: flex; align-items: center; gap: 14px; width: 100%; padding: 14px 16px; border: 0; border-top: 1px solid var(--bord);
  background: none; text-align: left; cursor: pointer; text-decoration: none; color: inherit;
}
.ligne-ajout:first-child { border-top: 0; }
.ligne-ajout svg { color: var(--vert); }
.ligne-ajout b { display: block; }
.ligne-ajout .txt-gris { font-size: 12px; }

/* Message bref */
.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 80; background: var(--texte); color: #fff;
  padding: 10px 16px; border-radius: 10px; font-size: 13px; box-shadow: 0 6px 20px rgba(0,0,0,.18);
}
.toast a { color: #a9cdb9; font-weight: 600; }
.drive-etat { color: var(--vert); font-weight: 600; margin-top: 8px; }
.drive-etat a { font-weight: 500; }


/* ---------- Fiche vente : cotisations, notes d'achat, facture (6.3) ---------- */
.bloc-cotisations[hidden] { display: none; }
.avec-stylo { display: flex; gap: 6px; margin-top: 4px; }
.avec-stylo input { margin-top: 0 !important; flex: 1; min-width: 0; }
.btn-stylo {
  width: 40px; height: 40px; flex: none; border: 1px solid #d6dbd8; border-radius: 10px; background: #fff; color: var(--vert);
  cursor: pointer; display: inline-flex; align-items: center; justify-content: center; font-size: 16px;
}
.btn-stylo:hover { background: var(--vert-clair); }
.info-cotisations { font-size: 12px; color: var(--gris); margin-top: 6px; }
.info-cotisations:empty { display: none; }
.note-achat { display: flex; flex-direction: column; gap: 4px; padding-top: 4px; }
.note-achat textarea {
  width: 100%; border: 1px solid #d6dbd8; border-radius: 10px; background: #fff; font-size: 13px; padding: 6px 10px;
  resize: vertical; line-height: 1.45;
}
.note-achat a { font-weight: 600; white-space: nowrap; }
.etat-facture { font-weight: 500; margin-left: 6px; }
.encart-facture { margin-bottom: 10px; border-style: solid; background: var(--vert-clair); border-color: var(--vert-moyen); }
.champ-form textarea:disabled, .champ-form input:disabled { background: #f1f4f2; color: #5f665f; }
.choix button:disabled { opacity: .55; cursor: default; }
.choix button[hidden] { display: none; }
.btn-contour-plein { color: var(--vert); border-color: var(--vert); font-weight: 600; }
.btn[hidden] { display: none; }

/* ---------- Écran Facture (grande fenêtre / plein écran téléphone) ---------- */
.fenetre-fond { position: fixed; inset: 0; z-index: 70; background: rgba(20,30,25,.45); display: flex; align-items: center; justify-content: center; padding: 20px; }
.fenetre {
  width: 1120px; max-width: 100%; height: 100%; max-height: 980px; background: #fff; border-radius: 16px;
  box-shadow: 0 20px 48px rgba(0,0,0,.2); display: flex; flex-direction: column; overflow: hidden;
}
.fenetre .titre .statut { font-size: 12px; vertical-align: 3px; margin-left: 6px; }
.fenetre .titre .txt-gris { font-size: 13px; font-weight: 400; }
.fenetre-corps { flex: 1; min-height: 0; display: flex; gap: 0; }
.facture-apercu { flex: 1; min-width: 0; overflow: auto; background: #e9ece9; padding: 20px; display: flex; justify-content: center; align-items: flex-start; }
.page-facture { width: 100%; max-width: 640px; height: auto; background: #fff; box-shadow: 0 2px 14px rgba(0,0,0,.12); }
.pdf-pages { width: 100%; max-width: 640px; display: flex; flex-direction: column; gap: 16px; }
.facture-ancienne { background: #fff; border-radius: 12px; padding: 28px; color: var(--gris); max-width: 520px; line-height: 1.6; }
.facture-cote { width: 340px; flex: none; padding: 18px 20px; display: flex; flex-direction: column; gap: 14px; overflow-y: auto; border-left: 1px solid var(--bord); }
.facture-bloc { border: 1px solid var(--bord); border-radius: 12px; padding: 14px 16px; font-size: 13px; line-height: 1.55; }
.facture-bloc p { margin: 8px 0 0; }
.facture-bloc-titre { font-weight: 600; font-size: 15px; margin-bottom: 6px; }
.nom-fichier { font-weight: 600; word-break: break-word; }
.controles { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.controles li { display: flex; gap: 8px; align-items: flex-start; }
.marque-controle {
  width: 20px; height: 20px; flex: none; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700;
}
.controles .ok .marque-controle { background: var(--vert-clair); color: var(--vert); }
.controles .ko .marque-controle { background: var(--rouge-fond); color: var(--rouge); }
.controles .ko { color: var(--rouge); }
.controles .detail { color: var(--rouge); }
.facture-message { background: var(--rouge-fond); border: 1px solid var(--rouge-bord); color: var(--rouge); border-radius: 10px; padding: 8px 12px; font-size: 13px; }
.facture-message[hidden] { display: none; }
.facture-boutons { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; margin-top: auto; }

/* ---------- Écran Factures ---------- */
.actions-facture { display: inline-flex; gap: 4px; justify-content: flex-end; }
.btn-icone {
  width: 28px; height: 24px; margin: -4px 0; border: 1px solid transparent; border-radius: 8px; background: transparent; color: var(--vert);
  cursor: pointer; display: inline-flex; align-items: center; justify-content: center;
}
.btn-icone:hover { background: var(--vert-clair); }
.btn-icone:disabled { color: #b9bec4; cursor: default; background: transparent; }
.liste-tel .ligne-tel .nom-pdf { font-weight: 600; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- Téléphone ---------- */
.bandeau, .barre-bas, .fab, .fab-bulle, .fab-voile { display: none; }
.liste-tel { display: none; }

@media (max-width: 760px) {
  body { font-size: 14px; }
  .coque { flex-direction: column; }
  .menu { display: none; }
  .bandeau {
    display: flex; align-items: center; justify-content: space-between; position: sticky; top: 0; z-index: 10;
    background: #fff; border-bottom: 1px solid var(--bord);
    padding: calc(10px + env(safe-area-inset-top)) 16px 10px;
  }
  .contenu { padding: 14px 14px calc(90px + env(safe-area-inset-bottom)); gap: 12px; }
  .entete-page h1 { font-size: 20px; }
  .entete-page .actions .btn { display: none; }
  .cartes { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .carte { padding: 10px 12px; }
  .carte .valeur { font-size: 20px; }
  .graph { padding: 10px 10px; }
  .barres { gap: 4px; height: 150px; }
  .barre .total { font-size: 9px; }
  .mois { gap: 4px; font-size: 10px; }
  .tableau-ordi { display: none; }
  .liste-tel { display: block; }
  .ligne-tel { padding: 9px 14px; border-top: 1px solid var(--bord); display: flex; flex-direction: column; gap: 3px; }
  .ligne-tel:first-child { border-top: 0; }
  .ligne-tel .haut { display: flex; justify-content: space-between; gap: 10px; }
  .ligne-tel .objet { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .ligne-tel .bas { display: flex; justify-content: space-between; gap: 10px; font-size: 12px; color: var(--gris); }
  .barre-bas {
    display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; background: #fff;
    border-top: 1px solid var(--bord); padding: 6px 6px calc(6px + env(safe-area-inset-bottom));
    justify-content: space-around; align-items: center;
  }
  /* Barre du bas (0.18.0) : 6 onglets ; le « + » est un bouton flottant à part */
  .barre-bas { padding: 4px 2px calc(6px + env(safe-area-inset-bottom)); }
  .barre-bas a {
    flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; align-items: center; gap: 2px; text-decoration: none;
    color: var(--gris); font-size: 10.5px; padding: 4px 0; white-space: nowrap; letter-spacing: -0.01em;
  }
  .barre-bas a .icone { width: 40px; height: 28px; border-radius: 14px; display: inline-flex; align-items: center; justify-content: center; }
  .barre-bas a .icone svg { width: 21px; height: 21px; }
  .barre-bas a.actif { color: var(--vert); font-weight: 700; }
  .barre-bas a.actif .icone { background: var(--vert-clair); }
  .banniere { align-items: flex-start; flex-wrap: wrap; }
  .seul-tel { display: inline; }
  .btn.seul-tel { display: inline-flex; }
  .seul-tel-flex, .puces.seul-tel-flex { display: flex; }
  .seul-ordi, .seul-ordi-grille { display: none !important; }
  .puces { flex-wrap: nowrap; overflow-x: auto; width: 100%; padding-bottom: 2px; scrollbar-width: none; }
  .puces::-webkit-scrollbar { display: none; }
  .recherche, .recherche.large { margin-left: 0; flex: 1; width: auto; }
  .barre-outils .barre-filtres { width: 100%; }
  .barre-filtres .total-filtre { margin-left: 0; }
  .ligne-tel .bas > span:first-child { display: flex; align-items: center; gap: 6px; min-width: 0; overflow: hidden; white-space: nowrap; }
  /* Formulaires en plein écran */
  .panneau-fond { background: #fff; }
  .panneau-form { width: 100%; box-shadow: none; }
  .panneau-entete { padding: calc(12px + env(safe-area-inset-top)) 16px 10px; }
  .panneau-entete .titre { font-size: 18px; }
  .panneau-corps { padding: 12px 16px 20px; gap: 10px 10px; }
  .panneau-erreur { margin: 0 16px 8px; }
  .panneau-pied { padding: 10px 16px calc(10px + env(safe-area-inset-bottom)); }
  .panneau-pied .btn[data-fermer] { display: none; }
  .panneau-pied .btn-principal { flex: 1; }
  .champ-form input, .champ-form select, .champ-form textarea { font-size: 16px; }
  .choix button { font-size: 12.5px; padding: 0 2px; }
  .choix.retour button { flex: 1 1 30%; }
  .ligne-achat { grid-template-columns: minmax(0, 1fr) 92px 36px; }
  .toast { bottom: calc(146px + env(safe-area-inset-bottom)); max-width: calc(100vw - 32px); }
  /* Écran Facture en plein écran */
  .fenetre-fond { padding: 0; background: #fff; }
  .fenetre { border-radius: 0; max-height: none; box-shadow: none; }
  .fenetre-corps { flex-direction: column; overflow-y: auto; }
  .facture-apercu { flex: none; overflow: visible; padding: 12px; }
  .facture-cote { width: auto; border-left: 0; overflow: visible; padding: 14px 16px calc(14px + env(safe-area-inset-bottom)); }
  .facture-boutons { position: sticky; bottom: 0; background: #fff; padding: 8px 0 calc(4px + env(safe-area-inset-bottom)); }
  .facture-boutons .btn { flex: 1; }
  .panneau-pied .btn-contour-plein { flex: 1 1 auto; }
}

/* ---------- Fiche achat : ventes de cet achat (0.4.1) ---------- */
.ventes-achat { width: 100%; border-collapse: collapse; font-size: 13px; margin-top: 6px; table-layout: fixed; }
.ventes-achat th { text-align: left; font-weight: 700; color: var(--gris-titre); padding: 4px 6px; border-bottom: 1px solid var(--bord); }
.ventes-achat td { padding: 5px 6px; border-bottom: 1px solid var(--bord); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ventes-achat .droite { text-align: right; }
.ventes-achat .centre { text-align: center; }
.ventes-achat tr.cliquable { cursor: pointer; }
.ventes-achat tr.cliquable:hover td, .ventes-achat tr.cliquable:focus-visible td { background: var(--vert-clair); }
.ventes-achat tr.hors-total td { color: var(--gris); opacity: .7; }
.ventes-achat-total { display: flex; flex-wrap: wrap; gap: 4px 16px; justify-content: flex-end; margin-top: 8px; font-size: 13px; }
a.lien-revendu { color: inherit; text-decoration: underline; text-decoration-color: var(--vert-moyen); text-underline-offset: 3px; }
a.lien-revendu:hover { color: var(--vert); }

/* ---------- Dépenses (0.5.0) ---------- */
.favoris { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.favoris-titre { font-size: 13px; font-weight: 600; color: var(--gris-titre); margin-right: 4px; }
.categories-ligne { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 4px 18px; padding: 8px 12px; }
.categories-ligne .ligne-categorie { display: flex; flex-direction: column; gap: 6px; padding: 8px; }
.categories-ligne .cat-haut { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; min-width: 0; }
.cat-nom { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.cat-montant { white-space: nowrap; font-size: 13px; }
.cat-montant .txt-gris { font-size: 12px; }
.categories-ligne .cat-barre { width: 100%; }
.categories-vide { padding: 8px; font-size: 13px; }
a.carte-lien { text-decoration: none; color: inherit; display: block; }
a.carte-lien:hover { border-color: var(--vert-moyen); color: inherit; }
.souligne-lien { color: var(--vert); text-decoration: underline; }
.suivi-colis { font-size: 13px; }
.suivi-colis[hidden] { display: none; }
.lien-alerte { color: inherit; text-decoration: underline; text-underline-offset: 2px; }
.encadre { padding: 14px 16px; display: flex; flex-direction: column; gap: 10px; }
.categories { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.ligne-categorie { width: 100%; border: 0; background: none; padding: 5px 4px; border-radius: 8px; cursor: pointer; display: grid; grid-template-columns: 1fr 38px; gap: 3px 8px; text-align: left; font-size: 13px; }
.ligne-categorie:hover { background: var(--vert-clair); }
.cat-haut { display: flex; justify-content: space-between; gap: 8px; grid-column: 1; }
.cat-barre { grid-column: 1; height: 6px; border-radius: 3px; background: var(--entete-tableau); overflow: hidden; }
.cat-barre i { display: block; height: 100%; background: var(--vert-moyen); border-radius: 3px; }
.cat-pct { grid-column: 2; grid-row: 1 / span 2; align-self: center; text-align: right; font-size: 12px; }
.livret-reste { display: flex; justify-content: space-between; align-items: baseline; font-size: 14px; }
.livret-reste b { font-size: 20px; }
.livret-detail { font-size: 12px; }
.liste-remb { list-style: none; margin: 0; padding: 0; font-size: 13px; }
.liste-remb li { display: flex; justify-content: space-between; gap: 8px; padding: 6px 4px; border-top: 1px solid var(--bord); cursor: pointer; border-radius: 6px; }
.liste-remb li:hover { background: var(--vert-clair); }
.info-form { font-size: 12px; margin-top: -4px; }
@media (max-width: 1100px) { .categories-ligne { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 760px) { .categories-ligne { grid-template-columns: minmax(0, 1fr); gap: 0; padding: 4px 6px; } }
@media (max-width: 760px) { .favoris .puce { font-size: 12px; } }

/* ---------- Info-bulle des commentaires (0.5.1) ---------- */
.infobulle-flottante {
  position: fixed; z-index: 100; max-width: 320px; background: var(--texte); color: #fff;
  font-size: 12px; line-height: 1.45; padding: 7px 10px; border-radius: 8px; white-space: pre-wrap;
  box-shadow: 0 4px 14px rgba(0,0,0,.18); pointer-events: none;
}

/* ---------- Déclarations (0.6.0) ---------- */
.case-tableau { width: 17px; height: 17px; margin: 0; accent-color: var(--vert); cursor: pointer; vertical-align: middle; }
.tableau tfoot td { background: var(--entete-tableau); border-top: 1px solid var(--bord); }
.tableau tfoot td:first-child { border-bottom-left-radius: var(--rayon); }
.tableau tfoot td:last-child { border-bottom-right-radius: var(--rayon); }
/* Prélèvement passé, pas encore coché « Prélevé » */
.tableau tr.a-verifier td, .tableau tr.a-verifier:hover td { background: var(--orange-fond); }
.ligne-tel.a-verifier { background: var(--orange-fond); }
.ecart { display: inline-flex; align-items: center; gap: 4px; color: var(--rouge); font-weight: 600; cursor: help; }
.ecart svg { width: 14px; height: 14px; flex: none; }
.souligne { cursor: help; text-decoration: underline dotted; text-underline-offset: 3px; }
.case-tel { display: inline-flex; align-items: center; gap: 6px; color: var(--texte); }

/* ---------- Paramètres (0.7.0) ---------- */
.param-grille { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; align-items: start; }
.param-colonne { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.param-seul { display: flex; flex-direction: column; gap: 14px; max-width: 720px; }
.param-bloc { padding: 14px 18px; display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.param-entete { display: flex; justify-content: space-between; align-items: center; gap: 10px; min-height: 34px; }
.param-entete h2 { margin: 0; font-size: 15px; font-weight: 600; }
.param-entete h2 .txt-gris { font-weight: 400; font-size: 13px; }
.param-corps { margin-top: 4px; }
.param-pied { display: flex; flex-direction: column; align-items: flex-end; gap: 8px; }
.param-pied .panneau-erreur { align-self: stretch; margin: 0; }
.param-note { margin: 0; font-size: 12px; color: var(--gris); line-height: 1.45; }
.param-ligne {
  display: flex; justify-content: space-between; align-items: center; gap: 10px; min-height: 36px;
  padding: 4px 6px; border-top: 1px solid var(--bord); font-size: 13px;
}
.param-ligne:first-child { border-top: 0; }
.param-ligne[hidden] { display: none; }
.param-ligne.cliquable { cursor: pointer; border-radius: 6px; }
.param-ligne.cliquable:hover, .param-ligne.cliquable:focus-visible { background: var(--vert-clair); outline: none; }
.param-droite { display: inline-flex; align-items: center; gap: 10px; }
.code-chip {
  display: inline-block; min-width: 44px; text-align: center; font-size: 11px; font-weight: 700; letter-spacing: .03em;
  padding: 2px 7px; border-radius: 6px; background: var(--vert-clair); color: var(--vert);
}
.taux-grille { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.taux-colonne { display: flex; flex-direction: column; min-width: 0; }
.taux-titre { font-size: 12px; font-weight: 700; color: var(--gris-titre); padding: 0 6px 4px; border-bottom: 1px solid var(--bord); }
.taux-colonne .param-ligne:first-of-type { border-top: 0; }
.taux-colonne .param-ligne > span { white-space: nowrap; font-variant-numeric: tabular-nums; }
.taux-colonne .param-ligne > b { white-space: nowrap; }
.a-venir { display: block; font-size: 11px; color: var(--orange); }
.taux-ajout { align-self: flex-start; margin-top: 4px; padding-left: 6px; }
.taux-total {
  display: flex; justify-content: space-between; align-items: center; gap: 10px; font-size: 13px;
  background: var(--fond); border-radius: 8px; padding: 8px 12px;
}
.taux-total b { color: var(--vert); font-size: 15px; white-space: nowrap; }
.param-defile { overflow-x: auto; }
.param-tableau td, .param-tableau th { padding: 6px 8px; }
.param-tableau td { max-width: none; white-space: normal; overflow: visible; }
.param-tableau td:last-child, .param-tableau th:last-child { padding-right: 8px; }
.param-tableau td:nth-child(n+2), .param-tableau th:nth-child(n+2) { text-align: center; }
.param-tableau td.ordre-favori { white-space: nowrap; width: 1%; }
.btn-ordre {
  width: 26px; height: 26px; border: 1px solid #dcdee3; border-radius: 6px; background: #fff; cursor: pointer;
  color: var(--gris); font-size: 13px; line-height: 1; padding: 0;
}
.btn-ordre:disabled { opacity: .35; cursor: default; }
.retour-param { display: inline-block; font-size: 13px; text-decoration: none; margin-bottom: 4px; }
@media (max-width: 1100px) { .param-grille { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 760px) {
  .param-liste-tel.seul-tel { display: block; }
  .ligne-tel.param-lien { flex-direction: row; align-items: center; justify-content: space-between; gap: 10px; text-decoration: none; color: inherit; }
  .param-lien-texte { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
  .param-lien-texte .txt-gris { font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .param-bloc { padding: 12px 14px; }
  .taux-grille { grid-template-columns: minmax(0, 1fr); }
  .param-bloc .grille-form { grid-template-columns: minmax(0, 1fr); }
  .param-tableau .col-cat { display: none; }
  .param-seul .param-entete { justify-content: flex-end; }
  .param-seul .param-entete h2 { display: none; }
  .param-seul .param-entete:not(:has(button)) { display: none; }
}

/* ---------- Analyse globale (0.8.0) ---------- */
.barres-groupes { gap: 14px; }
.groupe { flex: 1; display: flex; align-items: flex-end; gap: 3px; height: 100%; min-width: 0; position: relative; }
.groupe .barre-n { flex: 1; display: flex; flex-direction: column; justify-content: flex-end; height: 100%; min-width: 0; }
.groupe .nb { text-align: center; font-size: 10.5px; font-weight: 600; color: var(--vert); margin-bottom: 2px; }
.groupe .b { background: var(--vert); border-radius: 6px 6px 0 0; }
.groupe .n1 .nb { color: #7a827d; }
.groupe .n1 .b { background: #cfd6d2; }
.groupe .infobulle {
  display: none; position: absolute; bottom: calc(100% - 20px); left: 50%; transform: translateX(-50%);
  background: var(--texte); color: #fff; font-size: 12px; padding: 6px 9px; border-radius: 6px; white-space: nowrap; z-index: 5;
}
.groupe:hover .infobulle { display: block; }
.analyse-deux { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; align-items: start; }
.analyse-bas { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); gap: 12px; align-items: start; }
.tableau-analyse td { max-width: none; }
.analyse-vide, .analyse-encadre { padding: 16px 20px; }
.repartition { display: flex; height: 26px; border-radius: 6px; overflow: hidden; }
.repartition div { display: flex; align-items: center; font-size: 12px; font-weight: 600; }
.repartition .via { background: var(--vert); color: #fff; padding-left: 8px; }
.repartition .direct { flex: 1; background: var(--vert-moyen); color: var(--vert-fonce); justify-content: flex-end; padding-right: 8px; }
.repartition-legende, .jauge-legende { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 4px 14px; font-size: 12px; color: var(--gris); margin-top: 8px; }
.repartition-legende i, .jauge-legende i { display: inline-block; width: 9px; height: 9px; border-radius: 3px; margin-right: 5px; }
.repartition-legende b, .jauge-legende b { color: var(--texte); font-weight: 600; }
.jauges { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 40px; }
.jauge-haut { display: flex; justify-content: space-between; gap: 8px; font-size: 13px; }
.jauge-haut b { font-weight: 600; }
.jauge-piste { position: relative; height: 10px; background: #eef1ef; border-radius: 5px; margin-top: 6px; overflow: hidden; }
.jauge-piste div { position: absolute; left: 0; top: 0; bottom: 0; }
.jauge-piste .d { background: var(--vert); }
.jauge-piste .t { background: var(--vert-moyen); }
.jauge-piste .t.alerte { background: var(--orange); }
.jauge-legende { justify-content: flex-start; margin-top: 6px; }
.sous-titre-bloc { font-weight: 400; font-size: 12px; color: var(--gris); }
.analyse-pied { font-size: 11px; margin-top: -2px; }
@media (max-width: 1100px) {
  .analyse-deux, .analyse-bas { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 760px) {
  .groupe .n1 { display: none; }
  .groupe .nb { font-size: 9px; }
  .barres-groupes { gap: 4px; }
  .analyse-note-tel { display: block; font-size: 12px; text-align: center; }
}

/* ---------- Pagination des tableaux (0.8.1) ---------- */
.pagination { display: flex; align-items: center; justify-content: space-between; gap: 10px 16px; flex-wrap: wrap; padding: 8px 16px; border-top: 1px solid var(--bord); font-size: 13px; }
.pagination:empty { display: none; }
.pages { display: flex; align-items: center; gap: 2px; }
.btn-page { min-width: 30px; height: 30px; padding: 0 8px; border: 0; border-radius: 8px; background: transparent; cursor: pointer; font-size: 13px; color: var(--texte); }
.btn-page:hover:not(:disabled) { background: var(--vert-clair); }
.btn-page.actif { background: var(--vert); color: #fff; font-weight: 600; }
.btn-page:disabled { color: #b9bec4; cursor: default; }
.pages .points { padding: 0 4px; color: var(--gris); }
.par-page { display: flex; align-items: center; gap: 6px; }
.par-page select { height: 30px; border: 1px solid var(--bord); border-radius: 8px; background: #fff; padding: 0 6px; font-size: 13px; }
@media (max-width: 760px) {
  .pagination { justify-content: center; padding: 8px 10px; }
  .pagination > .txt-gris { width: 100%; text-align: center; }
}

/* ---------- Écran Exports ---------- */
.exports-tel { display: none; }
.exports-ordi { display: flex; flex-direction: column; gap: 14px; }
.export-sauvegarde { padding: 20px 22px; display: flex; gap: 28px; align-items: center; }
.export-desc { flex: 1; min-width: 0; }
.export-boutons { display: flex; flex-direction: column; gap: 8px; width: 240px; flex: none; }
.export-titre { font-weight: 600; font-size: 15px; }
.export-titre.grand { font-size: 16px; }
.export-texte { color: var(--gris); font-size: 13px; line-height: 1.5; margin-top: 6px; }
.export-note { color: var(--gris); font-size: 12px; margin-top: 8px; }
.export-section { margin: 2px 0 0; font-weight: 600; font-size: 16px; }
.export-grille { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.export-carte { background: #fff; border: 1px solid var(--bord); border-radius: var(--rayon); padding: 16px 18px; display: flex; flex-direction: column; gap: 8px; }
.export-carte .export-texte { margin-top: 0; line-height: 1.45; }
.export-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-top: auto; }
.export-actions select, .export-ligne-tel select {
  height: 34px; border: 1px solid var(--bord); border-radius: 8px; background: #fff; padding: 0 8px; font-size: 13px;
}
.export-ligne-tel { display: flex; align-items: center; gap: 10px; padding: 8px 6px 8px 14px; border-top: 1px solid var(--bord); }
.export-ligne-tel:first-child { border-top: 0; }
.export-ligne-tel > span { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.export-ligne-tel b { font-size: 13px; }
.export-ligne-tel .txt-gris { font-size: 11px; }
.export-ligne-tel select { align-self: flex-start; margin-top: 4px; font-size: 16px; }
.btn-telecharger { width: 44px; height: 44px; flex: none; border: 0; border-radius: 10px; background: transparent; color: var(--vert); display: inline-flex; align-items: center; justify-content: center; cursor: pointer; }
.btn-telecharger:active { background: var(--vert-clair); }
.btn-telecharger:disabled { color: #b9bec4; }
/* Contrôle Google Sheet (période d'essai, 0.22.0) : à supprimer avec le Google Sheet */
.export-ligne-tel.controle-gs .btn { flex: none; min-width: 92px; }
@media (max-width: 1100px) { .export-sauvegarde { flex-direction: column; align-items: stretch; } .export-boutons { width: auto; } }
@media (max-width: 760px) {
  .exports-ordi { display: none; }
  .exports-tel { display: flex; flex-direction: column; gap: 10px; }
}

/* ---------- Annonces et Estimation (6.5) ---------- */
.outil-claude { max-width: 720px; padding: 20px 22px; }
.outil-titre { font-weight: 700; font-size: 15px; margin-bottom: 14px; }
.outil-form { display: grid; gap: 14px; }
.outil-form .champ-form[hidden] { display: none; }
.outil-form textarea { text-align: left; }
.outil-form select optgroup { font-style: normal; color: var(--gris); }
.outil-statut { font-size: 12px; margin-top: -8px; text-align: center; }
.outil-pied { display: flex; justify-content: flex-end; margin-top: 16px; }
.message-claude { margin-top: 16px; border-top: 1px solid var(--bord); padding-top: 12px; font-size: 13px; }
.message-claude summary { cursor: pointer; color: var(--vert); font-weight: 600; }
.message-claude pre {
  white-space: pre-wrap; font-family: inherit; font-size: 12.5px; line-height: 1.5; background: #f6f8f7;
  border: 1px solid var(--bord); border-radius: 8px; padding: 10px 12px; margin: 10px 0;
}
@media (max-width: 760px) {
  .outil-claude { padding: 16px; }
  .outil-pied .btn { width: 100%; }
}

/* ---------- Virements vers perso (0.11.0) ---------- */
.cibles-entete { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 6px; }
.champ-form input.cibles-recherche { margin: 0 0 6px; }
.cibles-liste { display: flex; flex-direction: column; border: 1px solid var(--bord); border-radius: 10px; max-height: 320px; overflow-y: auto; background: #fff; }
.cible-remb { display: grid; grid-template-columns: minmax(0, 1fr) 104px; gap: 8px; align-items: center; padding: 8px 10px; border-top: 1px solid var(--bord); }
.cible-remb:first-child { border-top: 0; }
.cible-remb[hidden] { display: none; }
.cible-remb.cochee { background: var(--vert-clair); }
.cible-case { display: flex; gap: 10px; align-items: center; cursor: pointer; min-width: 0; color: var(--texte); }
.champ-form .cible-case input { width: 18px; height: 18px; margin: 0; flex: none; accent-color: var(--vert); padding: 0; }
.cible-texte { display: flex; flex-direction: column; min-width: 0; font-size: 13px; }
.cible-texte > * { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cible-texte .txt-gris { font-size: 12px; }
.champ-form input.cible-montant { margin: 0; height: 34px; }
.cible-vide { padding: 10px; font-size: 13px; }
.virements-annee { display: flex; justify-content: space-between; align-items: baseline; font-size: 14px; border-top: 1px solid var(--bord); padding-top: 10px; }
.virements-annee b { font-size: 16px; }
.liste-remb li .statut { margin-right: 6px; }
.liste-remb .remb-gauche { display: flex; align-items: center; gap: 4px; min-width: 0; flex-wrap: wrap; }

/* ---------- Trésorerie (0.13.0) ---------- */
.onglets { display: flex; gap: 4px; border-bottom: 1px solid #dfe4e0; }
.onglet {
  font-size: 14px; padding: 8px 16px 10px; border: 0; background: transparent; border-bottom: 3px solid transparent;
  margin-bottom: -1px; color: var(--gris); font-weight: 500; display: flex; flex-direction: column; align-items: flex-start;
  gap: 1px; cursor: pointer; white-space: nowrap;
}
.onglet .sous { font-size: 12px; font-weight: 500; color: #6b7068; }
.onglet:hover { color: var(--texte); }
.onglet.actif { border-bottom-color: var(--vert); color: var(--vert-fonce); font-weight: 700; }
.onglet.actif .sous { color: var(--vert); }
.carte .valeur.noir { color: var(--texte); }
.carte .valeur.txt-orange { color: var(--orange); }
.carte .valeur.txt-rouge { color: #a23b2c; }
.lien-carte { border: 0; background: none; padding: 0; font: inherit; color: var(--gris); text-decoration: underline; cursor: pointer; }
.lien-carte:hover { color: var(--vert); }
.gras { font-weight: 600; }
.graph-panneau { padding: 12px 12px 4px; }
.graph-svg { display: block; width: 100%; height: auto; font-family: Inter, system-ui, sans-serif; }
.graph-colonne:hover rect[fill="transparent"] { fill: rgba(31, 90, 62, .05); }
.releve-titre { align-items: center; flex-wrap: wrap; }
.releve-titre .puces { margin-left: auto; }
.seul-ordi-flex { display: flex; }
.tableau-releve td .lien-code, .tableau-reste .lien-code { color: var(--vert); text-decoration: underline; text-underline-offset: 2px; }
.tableau-releve tr.ligne-pointage td { background: #f3f8f5; }
.pointage-libelle { display: inline-flex; align-items: center; gap: 6px; color: var(--vert-fonce); font-weight: 600; vertical-align: middle; }
.pointage-libelle + .txt-gris { margin-left: 4px; }
.statut.contour { background: #fff; color: var(--vert); border: 1px solid var(--vert-moyen); padding: 1px 8px; }
.statut.contour.rouge { color: var(--rouge); border-color: var(--rouge-bord); }
.note-bas { font-size: 12px; color: var(--gris); }
.chevron { display: inline-block; width: 12px; margin-right: 4px; color: var(--gris); transition: transform .15s; }
.chevron.ouvert { transform: rotate(90deg); }
.tableau-releve tr.ouverte td { background: #f3f8f5; }
.tableau-releve tr.detail-ligne td { background: #f3f8f5; border-top: 0; white-space: normal; overflow: visible; max-width: none; padding-top: 0; padding-bottom: 10px; cursor: default; }
.detail-releve { display: grid; grid-template-columns: max-content 110px; gap: 3px 24px; font-size: 13px; padding-left: 16px; }
.detail-releve b { text-align: right; font-weight: 600; }
.detail-releve .lien-bouton { padding: 0; }
.detail-actions { grid-column: 1 / -1; display: flex; gap: 14px; margin-top: 4px; }
.detail-actions .txt-rouge { color: #a23b2c; }
.livret-grille { display: grid; grid-template-columns: minmax(0, 1fr) 284px; gap: 16px; align-items: start; }
.livret-gauche { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.tableau-reste td { white-space: normal; max-width: none; vertical-align: middle; }
.tableau-reste td:first-child { padding-left: 10px; }
.tableau-reste th:first-child { padding-left: 10px; }
.reste-avance { display: flex; flex-direction: column; gap: 1px; }
.reste-avance .txt-gris { font-size: 11px; }
.tableau-reste tfoot td { border-radius: 0 !important; }
.reste-bouton { padding: 12px 14px 14px; border-top: 1px solid var(--bord); }
.reste-bouton .btn { width: 100%; }
.sous-section { font-size: 13px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--gris-titre); margin-top: 2px; }
.bandeau-orange {
  display: flex; align-items: center; gap: 12px; background: #fdf6ec; border: 1px solid #f0d3ad; color: #6b3a06;
  border-radius: 10px; padding: 9px 14px; font-size: 13px;
}
.bandeau-orange > span { flex: 1; }
.bandeau-orange a { color: #6b3a06; font-weight: 600; white-space: nowrap; }
.provisions-deux { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 14px; align-items: stretch; }
.provisions-deux > .bloc > .panneau { flex: 1; }
.graph-plein { display: flex; align-items: center; }
.tableau-mois td, .tableau-mois th { padding-left: 8px; padding-right: 8px; }
.tableau-mois td { max-width: none; overflow: visible; }
#corps-onglet { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.tableau-mois .statut { font-size: 11.5px; }
.impots-vide {
  display: flex; align-items: center; gap: 14px; background: #fff; border: 1px dashed #cfd6d2; border-radius: var(--rayon);
  padding: 14px 18px; color: var(--gris-titre);
}
.impots-vide > span { flex: 1; display: flex; flex-direction: column; gap: 2px; font-size: 13px; }
.impots-vide b { color: var(--texte); font-size: 14px; }
.impots-vide a { font-weight: 600; white-space: nowrap; font-size: 13px; }
.btn-tel-large { width: 100%; height: 44px; font-weight: 600; }
.voir-tout { align-self: flex-start; padding: 0; }
@media (max-width: 1100px) {
  .livret-grille, .provisions-deux { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 760px) {
  .seul-ordi-flex { display: none; }
  .cartes.quatre { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .carte .valeur { overflow: hidden; text-overflow: ellipsis; }
  .onglets { background: #e9ece9; border-radius: 10px; padding: 3px; border-bottom: 0; gap: 2px; }
  .onglet { flex: 1; align-items: center; border: 0; border-radius: 8px; margin: 0; padding: 9px 4px; font-size: 14px; }
  .onglet .sous { display: none; }
  .onglet.actif { background: var(--vert); color: #fff; font-weight: 600; }
  .releve-titre { flex-wrap: nowrap; }
  .releve-titre .btn { margin-left: auto; border-radius: 999px; }
  .ligne-releve .haut b { white-space: nowrap; }
  .ligne-releve .bas > span:last-child { white-space: nowrap; }
  .ligne-tel.ligne-pointage { background: #f3f8f5; }
  .detail-tel { margin-top: 6px; padding: 8px 0 2px; border-top: 1px dashed var(--bord); }
  .detail-tel .detail-releve { grid-template-columns: minmax(0, 1fr) max-content; padding-left: 0; gap: 3px 12px; }
  .ligne-mois .haut { align-items: center; }
  .ligne-mois .haut .objet { white-space: normal; }
  .bandeau-orange { align-items: flex-start; }
  .reste-tel { display: flex; flex-direction: column; gap: 8px; }
}

/* ---------- Logos des plateformes (0.14.0) : logo + nom en noir ---------- */
.pf { display: inline-flex; align-items: center; gap: 7px; max-width: 100%; vertical-align: middle; min-width: 0; }
.pf-logo {
  flex: none; display: inline-flex; align-items: center; justify-content: center; border-radius: 22%;
  overflow: hidden; line-height: 1;
}
.pf-logo img { width: 100%; height: 100%; display: block; object-fit: cover; }
.pf-initiales { background: #e9edeb; color: var(--gris-titre); font-weight: 700; letter-spacing: -.02em; }
.pf-nom { color: var(--texte); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.txt-gris .pf-nom { color: inherit; }
.choix button.avec-logo { display: inline-flex; align-items: center; justify-content: center; }
.choix button.avec-logo .pf { gap: 6px; }
.choix button.actif .pf-nom { color: #fff; }
.choix button.actif .pf-logo { box-shadow: 0 0 0 1.5px #fff; }
th .pf { font-weight: inherit; }
.pf-entete { display: inline-flex; flex-direction: column; align-items: flex-end; gap: 4px; max-width: 100%; }
/* Paramètres › plateforme : logo actuel + boutons */
.logo-pf-choix { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.logo-pf-choix .pf-logo { box-shadow: 0 0 0 1px #e3e7e5; }
.logo-pf-choix input[type="file"] { display: none; }
.logo-pf-choix label.btn { cursor: pointer; }
.pf-logo:has(img) { box-shadow: 0 0 0 1px rgba(22, 24, 29, .07); }

/* Bannières de l'accueil (ordinateur) */
.pile-bannieres { display: flex; flex-direction: column; gap: 14px; }
.pile-bannieres:empty { display: none; }

/* ---------- Téléphone, piste B « Un chiffre clé » (0.16.0) ----------
   Fond gris clair, blocs blancs arrondis sans bordure, un grand chiffre par écran,
   chiffres secondaires en grille sous un trait, listes groupées par mois. */
.vue-tel { display: none !important; }
@media (max-width: 760px) {
  .vue-tel { display: block !important; }
  .vue-ordi { display: none !important; }
  .contenu { padding: 14px 0 calc(150px + env(safe-area-inset-bottom)); gap: 0; }
  .contenu > * { margin-left: 16px; margin-right: 16px; }
  .contenu > .tb-entete, .contenu > .tb-chiffre, .contenu > .tb-grille, .contenu > .tb-graph,
  .contenu > .tb-h2, .contenu > .tb-sh, .contenu > .tb-resume { margin-left: 20px; margin-right: 20px; }
  .contenu > * + * { margin-top: 12px; }
  .contenu > .chargement { padding: 24px 4px; }

  /* Bandeau et barre du bas */
  .bandeau { padding: calc(12px + env(safe-area-inset-top)) 18px 12px; }
  .bandeau .marque .pastille { width: 28px; height: 28px; }
  .bandeau .marque .nom { font-size: 19px; }
  .bandeau a.avatar { width: 34px; height: 34px; }
  .barre-bas { padding: 8px 2px calc(8px + env(safe-area-inset-bottom)); align-items: flex-start; }
  .barre-bas a { color: #6b7068; }
  .barre-bas a.actif { color: var(--vert); font-weight: 700; }
  /* Onglet en cours : pastille vert clair derrière l'icône (0.18.0) */
  .barre-bas a .icone { width: 52px; height: 30px; border-radius: 15px; transition: background .15s ease; }
  .barre-bas a.actif .icone { background: var(--vert-clair); }

  /* Bouton « + » flottant et sa bulle d'actions (0.18.0) */
  .fab {
    display: inline-flex; align-items: center; justify-content: center; position: fixed; z-index: 32;
    right: 18px; bottom: calc(78px + env(safe-area-inset-bottom)); width: 56px; height: 56px; border-radius: 50%;
    border: 0; padding: 0; background: var(--vert); color: #fff; box-shadow: 0 6px 18px rgba(31,90,62,.34);
    -webkit-tap-highlight-color: transparent; cursor: pointer;
  }
  .fab svg { width: 26px; height: 26px; transition: transform .2s ease; }
  .fab[aria-expanded="true"] svg { transform: rotate(45deg); }
  .fab:active { transform: scale(.96); }
  body.panneau-actif .fab, body.panneau-actif .fab-bulle, body.panneau-actif .fab-voile { display: none !important; }
  .fab-voile { display: block; position: fixed; inset: 0; z-index: 30; background: rgba(22,24,29,.30); }
  .fab-bulle {
    display: flex; flex-direction: column; position: fixed; z-index: 31; right: 18px; left: 18px; margin-left: auto; max-width: 320px;
    bottom: calc(146px + env(safe-area-inset-bottom)); background: #fff; border-radius: 18px; padding: 6px;
    box-shadow: 0 12px 32px rgba(22,24,29,.22); transform-origin: bottom right; animation: fab-bulle .16s ease-out;
  }
  .fab-bulle::after {
    content: ''; position: absolute; right: 20px; bottom: -7px; width: 14px; height: 14px; background: #fff;
    transform: rotate(45deg); border-radius: 0 0 3px 0;
  }
  .fab-voile[hidden], .fab-bulle[hidden] { display: none; }
  .fab-bulle button {
    display: flex; align-items: center; gap: 12px; width: 100%; padding: 10px; border: 0; background: none;
    border-radius: 12px; text-align: left; font: inherit; color: var(--texte); cursor: pointer; -webkit-tap-highlight-color: transparent;
  }
  .fab-bulle button + button { position: relative; }
  .fab-bulle button + button::before { content: ''; position: absolute; top: 0; left: 56px; right: 10px; border-top: 1px solid #eef1ef; }
  .fab-bulle button:active { background: var(--vert-clair); }
  .fab-ico { width: 34px; height: 34px; border-radius: 10px; flex: none; display: inline-flex; align-items: center; justify-content: center; background: var(--vert); color: #fff; }
  .fab-ico svg { width: 18px; height: 18px; }
  .fab-texte { display: flex; flex-direction: column; min-width: 0; }
  .fab-texte b { font-size: 14.5px; font-weight: 600; }
  .fab-texte span { font-size: 12px; color: var(--gris); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  @keyframes fab-bulle { from { opacity: 0; transform: translateY(8px) scale(.96); } to { opacity: 1; transform: none; } }

  /* Titre de l'écran */
  .tb-entete { padding-top: 2px; }
  .tb-retour { display: inline-flex; align-items: center; gap: 2px; font-size: 14px; font-weight: 500; text-decoration: none; margin: 0 0 6px -4px; }
  .tb-entete-ligne { display: flex; align-items: flex-end; justify-content: space-between; gap: 10px; }
  .tb-entete-titre { min-width: 0; }
  .tb-entete h1 { margin: 0; font-size: 22px; font-weight: 700; letter-spacing: -0.02em; }
  .tb-sous-titre { font-size: 12px; color: var(--gris); margin-top: 1px; }
  .tb-sous-titre a { text-decoration: none; }

  /* Sélecteurs (années, date) : gris, choix en blanc */
  .annees, .choix-date { background: #e9edeb; border-radius: 9px; padding: 2px; gap: 0; }
  .annees button, .choix-date button { height: auto; font-size: 12px; padding: 6px 9px; border-radius: 7px; color: var(--gris); }
  .annees button.actif, .choix-date button.actif { background: #fff; color: var(--texte); font-weight: 600; box-shadow: 0 1px 2px rgba(0,0,0,.06); }

  /* Grand chiffre et grille */
  .contenu > .tb-chiffre { margin-top: 16px; }
  .tb-chiffre-libelle { font-size: 13px; color: var(--gris); }
  .tb-chiffre-valeur { font-size: 36px; font-weight: 700; letter-spacing: -0.03em; color: var(--vert); line-height: 1.15; white-space: nowrap; }
  .tb-chiffre-valeur.orange { color: var(--orange); }
  .tb-chiffre-valeur.noir { color: var(--texte); }
  .tb-chiffre-detail { font-size: 12px; color: var(--gris); margin-top: 2px; }
  .tb-grille { display: grid !important; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; border-top: 1px solid var(--bord); padding-top: 14px; }
  .contenu > .tb-grille { margin-top: 16px; }
  .tb-case { min-width: 0; color: inherit; text-decoration: none; }
  .tb-k { font-size: 12px; color: var(--gris); }
  .tb-kv { font-size: 18px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .tb-kv.orange { color: var(--orange); }
  .tb-kv.vert { color: var(--vert); }
  .tb-kv.rouge { color: #a23b2c; }
  .tb-kd { font-size: 11px; color: var(--gris); }
  .tb-kd .alerte, .tb-kd.alerte { color: var(--orange); }

  /* Petit graphique */
  .contenu > .tb-graph { margin-top: 16px; margin-bottom: 0; }
  .tb-barres { display: flex; align-items: flex-end; gap: 6px; height: 64px; }
  .tb-barres > span { flex: 1; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; min-width: 0; }
  .tb-pile { display: flex; flex-direction: column; border-radius: 3px 3px 0 0; overflow: hidden; }
  .tb-pile > span { display: block; flex: none; }
  .tb-mois { display: flex; gap: 6px; margin-top: 4px; font-size: 10px; color: #7a807c; text-align: center; }
  .tb-mois span { flex: 1; min-width: 0; overflow: hidden; }
  .tb-graph figcaption { display: flex; gap: 14px; margin-top: 6px; font-size: 11px; color: var(--gris); }
  .tb-graph figcaption span { display: inline-flex; align-items: center; gap: 5px; }
  .tb-graph figcaption i { width: 8px; height: 8px; border-radius: 2px; display: inline-block; }

  /* Titres de section, en-têtes de mois */
  .tb-h2 { display: flex !important; justify-content: space-between; align-items: baseline; }
  .contenu > .tb-h2 { margin-top: 22px; }
  .tb-h2 h2 { margin: 0; font-size: 15px; font-weight: 600; }
  .tb-h2 .tb-nb { color: var(--gris); font-weight: 500; }
  .tb-h2 a { font-size: 13px; font-weight: 500; text-decoration: none; }
  .tb-sh { display: flex; justify-content: space-between; gap: 10px; margin: 16px 4px 6px; font-size: 12px; font-weight: 600; color: var(--gris); text-transform: uppercase; letter-spacing: .04em; }
  .tb-sh:first-child { margin-top: 4px; }

  /* Blocs blancs et lignes */
  .tb-blk { background: #fff; border-radius: 14px; overflow: hidden; }
  .tb-blk + .tb-blk { margin-top: 10px; }
  .tb-row {
    display: flex; align-items: center; gap: 10px; width: 100%; padding: 11px 14px; border: 0; border-bottom: 1px solid #eef1ef;
    background: none; color: inherit; text-decoration: none; text-align: left; font: inherit; cursor: pointer;
  }
  .tb-row:last-child { border-bottom: 0; }
  .tb-row:active { background: #f4f6f4; }
  .tb-texte { flex: 1; min-width: 0; }
  .tb-t { display: block; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .tb-m { display: flex; align-items: center; gap: 5px; font-size: 12px; color: var(--gris); margin-top: 3px; white-space: nowrap; overflow: hidden; }
  .tb-m > * { flex: none; }
  .tb-m .tb-coupe { flex: 0 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
  .tb-m .pf-nom { color: var(--gris); }
  .tb-m .orange { color: var(--orange); font-weight: 600; }
  .tb-droite { flex: none; text-align: right; display: flex; flex-direction: column; align-items: flex-end; gap: 3px; max-width: 48%; }
  .tb-droite b { font-weight: 600; display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
  .tb-droite b .icone-info { color: var(--vert); }
  .tb-sous { font-size: 12px; font-weight: 600; color: var(--gris); max-width: 100%; display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 4px; }
  .tb-sous.orange { color: var(--orange); }
  .tb-ico { width: 32px; height: 32px; border-radius: 10px; display: inline-flex; align-items: center; justify-content: center; flex: none; }
  .tb-ico svg { width: 18px; height: 18px; }
  .tb-ico.rouge { background: #fdecea; color: #b42318; }
  .tb-ico.orange { background: var(--orange-fond); color: var(--orange); }
  .tb-ico.vert { background: var(--vert-clair); color: var(--vert); }
  .tb-ico.plein { background: var(--vert); color: #fff; }
  .tb-ico.avatar { background: #cfe3d7; color: var(--vert-fonce); font-weight: 600; font-size: 13px; overflow: hidden; }
  .tb-ico.avatar img { width: 100%; height: 100%; object-fit: cover; }
  .tb-chevron { color: #9aa19c; flex: none; display: inline-flex; }
  .tb-vide { padding: 14px; color: var(--gris); font-size: 13px; text-align: center; }
  .tb-row.rouge { color: #b42318; font-weight: 500; }
  .tb-version { font-size: 12px; color: var(--gris); margin: 16px 20px 0 !important; }

  /* Listes (Achats, Ventes, Dépenses) : recherche, Filtres, puces, résumé */
  .zone-tableau.panneau { background: transparent; border: 0; border-radius: 0; }
  .zone-tableau .liste-tel { display: block; }
  .barre-outils { gap: 8px; }
  .barre-outils .recherche { order: 1; flex: 1; }
  .barre-outils #btn-feuille { order: 2; }
  .barre-outils .puces { order: 3; }
  .barre-outils .barre-filtres { order: 4; }
  .recherche input {
    height: 40px; border: 0; border-radius: 12px; background: #e9edeb url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%235b616e' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='M20 20l-3.5-3.5'/%3E%3C/svg%3E") no-repeat 12px center;
    padding: 0 12px 0 36px; font-size: 16px;
  }
  #btn-feuille { height: 40px; border: 0; border-radius: 12px; background: #fff; font-size: 13px; }
  .puces { gap: 6px; margin: 0 -16px; padding: 0 16px 2px; width: calc(100% + 32px); }
  .puce { border: 0; background: #fff; font-size: 12px; height: 32px; padding: 0 12px; }
  .puce.actif { background: var(--vert); }
  .barre-filtres .total-filtre { display: none; }
  .tb-resume { display: flex !important; align-items: center; justify-content: space-between; gap: 6px 10px; flex-wrap: wrap; font-size: 12px; color: var(--gris); }
  .resume-total b { color: var(--texte); font-weight: 600; }
  .pagination { border-top: 0; padding: 14px 4px 0; }
  .btn-page { width: 32px; height: 32px; }
  .btn-page:not(.actif):not(:disabled) { background: #fff; }

  /* Bannières rouges remplacées par le bloc « À faire » sur l'accueil */
  .contenu > .banniere { margin-top: 12px; }
}
@media (max-width: 760px) {
  /* Dépenses : favoris, par catégorie */
  .favoris { gap: 6px; }
  .favoris .puce { font-size: 12px; }
  .bloc { gap: 0; }
  .bloc > .bloc-titre { margin: 10px 4px 8px; }
  .bloc > .bloc-titre h2 { font-size: 15px; }
  .panneau.categories-ligne { border: 0; border-radius: 14px; padding: 0; gap: 0; }
  .categories-ligne .ligne-categorie { padding: 11px 14px; border-bottom: 1px solid #eef1ef; border-radius: 0; }
  .categories-ligne .ligne-categorie:last-child { border-bottom: 0; }
  .cat-barre { background: #eef1ef; }
}
@media (max-width: 760px) {
  /* Morceaux piste B placés dans un conteneur .vue-tel (contenu calculé) */
  .vue-tel > .tb-chiffre, .vue-tel > .tb-grille, .vue-tel > .tb-graph, .vue-tel > .tb-h2, .vue-tel > .tb-sh { margin-left: 4px; margin-right: 4px; }
  .vue-tel > .tb-chiffre { margin-top: 16px; }
  .vue-tel > .tb-grille, .vue-tel > .tb-graph { margin-top: 16px; }
  .vue-tel > .tb-h2 { margin-top: 22px; margin-bottom: 8px; }
  .vue-tel > .vue-tel { margin-top: 14px; }
  .contenu > .tb-h2 + * { margin-top: 8px; }
}
/* Blocs « Plus » et « Ajouter » : aussi sur ordinateur (écrans surtout utilisés sur téléphone) */
.tb-plein.tb-blk { background: #fff; border: 1px solid var(--bord); border-radius: var(--rayon); overflow: hidden; }
.tb-plein .tb-row { display: flex; align-items: center; gap: 12px; width: 100%; padding: 12px 16px; border: 0; border-bottom: 1px solid #eef1ef; background: none; color: inherit; text-decoration: none; text-align: left; font: inherit; cursor: pointer; }
.tb-plein .tb-row:last-child { border-bottom: 0; }
.tb-plein .tb-row:hover { background: #f7f9f8; }
.tb-plein .tb-texte { flex: 1; min-width: 0; }
.tb-plein .tb-t { display: block; font-weight: 500; }
.tb-plein .tb-m { display: block; font-size: 12px; color: var(--gris); margin-top: 2px; }
.tb-plein .tb-ico { width: 32px; height: 32px; border-radius: 10px; display: inline-flex; align-items: center; justify-content: center; flex: none; background: var(--vert-clair); color: var(--vert); overflow: hidden; }
.tb-plein .tb-ico.plein { background: var(--vert); color: #fff; }
.tb-plein .tb-ico.avatar { background: #cfe3d7; color: var(--vert-fonce); font-weight: 600; font-size: 13px; }
.tb-plein .tb-chevron { color: #9aa19c; display: inline-flex; }
.tb-plein .tb-row.rouge { color: #b42318; font-weight: 500; }
.tb-avatar { display: inline-flex; width: 100%; height: 100%; align-items: center; justify-content: center; }
.tb-avatar img { width: 100%; height: 100%; object-fit: cover; }
.tb-sh { display: flex; justify-content: space-between; font-size: 12px; font-weight: 600; color: var(--gris); text-transform: uppercase; letter-spacing: .04em; }
.tb-version { font-size: 12px; color: var(--gris); }
@media (max-width: 760px) {
  .tb-plein.tb-blk { border: 0; border-radius: 14px; }
  .tb-plein .tb-row { padding: 11px 14px; }
}
@media (max-width: 760px) {
  /* Trésorerie */
  .tb-grille.trois { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .tb-bouton { display: flex !important; width: auto; min-height: 46px; border-radius: 12px; border: 0; font-size: 15px; font-weight: 600; gap: 8px; }
  .btn.tb-bouton:not(.btn-principal) { background: #fff; color: var(--vert); }
  .contenu > .tb-bouton { margin-top: 14px; }
  .tb-chiffre-valeur.rouge { color: #a23b2c; }
  .onglets { background: #e9edeb; border-radius: 9px; padding: 2px; }
  .onglet { padding: 7px 4px; font-size: 13px; border-radius: 7px; }
  .onglet.actif { background: #fff; color: var(--texte); font-weight: 600; box-shadow: 0 1px 2px rgba(0,0,0,.06); }
  #corps-onglet { gap: 0; }
  #corps-onglet > * + * { margin-top: 12px; }
  #corps-onglet > .tb-chiffre, #corps-onglet > .tb-grille, #corps-onglet > .tb-h2, #corps-onglet > .tb-note { margin-left: 4px; margin-right: 4px; }
  #corps-onglet > .tb-chiffre { margin-top: 14px; }
  #corps-onglet > .tb-grille { margin-top: 16px; }
  #corps-onglet > .tb-h2 { margin-top: 22px; }
  #corps-onglet .livret-gauche { gap: 0; }
  #corps-onglet .livret-gauche > * + * { margin-top: 12px; }
  .vue-tel .tb-h2 { margin: 10px 4px 8px; }
  .tb-lien-gris { font-size: 12px; color: var(--gris); }
  .tb-gris { font-weight: 400; color: var(--gris); }
  .tb-voir { justify-content: center; color: var(--vert); font-size: 13px; font-weight: 500; }
  .tb-note { font-size: 12px; color: var(--gris); line-height: 1.45; margin: 0; }
  .releve-titre { margin: 10px 4px 8px; }
  .releve-titre .tb-lien-filtres { margin-left: auto; text-decoration: none; font-size: 13px; font-weight: 500; padding: 0; }
  .tb-ligne-releve { border-bottom: 1px solid #eef1ef; cursor: pointer; }
  .tb-ligne-releve:last-child { border-bottom: 0; }
  .tb-ligne-releve .tb-row { border-bottom: 0; }
  .tb-ligne-releve.ligne-pointage, .tb-ligne-releve.ouverte { background: #f3f8f5; }
  .tb-ligne-releve .detail-tel { margin: 0 14px; padding: 8px 0 10px; border-top: 1px dashed var(--bord); }
  .tb-ligne-releve .tb-m .statut { font-size: 11px; padding: 1px 7px; }
  .tb-liste-mois { background: #fff; border-radius: 14px; overflow: hidden; }
  .provisions-deux > .bloc > .panneau { background: transparent; border: 0; }
  .impots-vide { display: none; }
}
@media (max-width: 760px) { .bloc-titre a { text-decoration: none; font-size: 13px; font-weight: 500; } }

/* Sections de formulaire (0.16.0) : invisibles sur ordinateur */
.form-section, .form-section-corps { display: contents; }
.form-section-titre { display: none; }

@media (max-width: 760px) {
  /* Formulaires plein écran en blocs : fond gris, en-tête (fermer à gauche), champs gris centrés, bouton en pied */
  .panneau-form { background: var(--fond); }
  .panneau-entete { background: #fff; flex-direction: row-reverse; justify-content: flex-end; align-items: center; gap: 12px; padding: calc(12px + env(safe-area-inset-top)) 16px 12px; }
  .panneau-entete > div { display: flex; flex-direction: column-reverse; min-width: 0; flex: 1; }
  .panneau-entete .titre { font-size: 17px; font-weight: 700; margin: 0; }
  .panneau-entete .surtitre { font-size: 12px; margin-top: 1px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .btn-fermer { width: 36px; height: 36px; border-radius: 50%; border: 0; background: #eef1ef; font-size: 14px; }
  .panneau-corps { display: block; padding: 4px 16px 24px; }
  .panneau-corps > .champ-form, .panneau-corps > .encart, .panneau-corps > .large:not(.form-section), .panneau-corps > div:not(.form-section) {
    display: block; margin-top: 12px;
  }
  .form-section { display: block; }
  .form-section-titre { display: block; margin: 18px 4px 6px; font-size: 12px; font-weight: 600; color: var(--gris); text-transform: uppercase; letter-spacing: .04em; }
  .form-section-corps, .bloc-cotisations, .bloc-plateforme {
    display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 10px; background: #fff; border-radius: 14px; padding: 14px;
  }
  .form-section:not(:has(.form-section-titre)) .form-section-corps { margin-top: 12px; }
  .bloc-cotisations, .bloc-plateforme { display: block; margin-top: 18px; }
  /* Blocs masqués (ex. vente hors plateforme) : doit l'emporter sur « .panneau-corps > div:not(.form-section) » ci-dessus */
  .panneau-corps > div[hidden]:not(.form-section), .panneau-corps > [hidden].champ-form, .panneau-corps > [hidden].encart,
  .bloc-cotisations[hidden], .bloc-plateforme[hidden] { display: none; }
  .bloc-cotisations .sous-titre-form, .bloc-plateforme .sous-titre-form { border-top: 0; padding-top: 0; margin: 0 0 10px; font-size: 12px; font-weight: 600; color: var(--gris); text-transform: uppercase; letter-spacing: .04em; }
  .bloc-plateforme .grille-form + .sous-titre-form { margin-top: 18px; }
  .form-section-corps > .encart > .encart-titre:first-child { display: none; }
  .form-section-corps > .encart { background: var(--fond); border: 0; }
  .champ-form, .libelle-form { font-size: 12px; color: var(--gris); }
  .champ-form input, .champ-form select, .champ-form textarea, .avec-stylo input {
    min-height: 42px; border: 0; border-radius: 10px; background: #eef1ef; font-size: 16px; color: var(--texte);
  }
  .champ-form input:focus, .champ-form select:focus, .champ-form textarea:focus { outline: 2px solid var(--vert-moyen); }
  .champ-form.calcule input { background: var(--fond); color: var(--gris-titre); }
  .choix { flex-wrap: wrap; }
  .choix button { flex: 0 1 auto; height: 32px; border: 0; border-radius: 999px; background: #eef1ef; padding: 0 12px; font-size: 12.5px; }
  .choix button.actif { background: var(--vert); }
  .case-form input { width: 22px; height: 22px; }
  .panneau-pied { background: #fff; }
  .panneau-pied .btn { min-height: 46px; border-radius: 12px; }
  .panneau-pied .btn-principal { font-size: 15px; }
  .panneau-erreur { margin: 8px 16px; }
}
.seul-tel-inline { display: none; }
.choix[data-choix="statut"] button.avec-logo { display: inline-block; }
@media (max-width: 760px) {
  .seul-ordi-inline { display: none; }
  .seul-tel-inline { display: inline; }
  .choix[data-choix="statut"] { gap: 8px; }
  .choix[data-choix="statut"] button { background: none; padding: 0; height: auto; opacity: .45; border-radius: 999px; }
  .choix[data-choix="statut"] button.actif { background: none; opacity: 1; outline: 2px solid var(--vert); outline-offset: 2px; }
}
@media (max-width: 760px) {
  .choix[data-choix="statut"] button { flex: 0 0 auto; overflow: visible; max-width: 100%; }
  /* Écran Facture : fond gris, blocs blancs */
  .fenetre { background: var(--fond); }
  .facture-cote { gap: 10px; }
  .facture-bloc { background: #fff; border: 0; border-radius: 14px; }
  .facture-boutons { background: #fff; margin: 0 -16px; padding-left: 16px; padding-right: 16px; }
  .facture-boutons .btn { min-height: 46px; border-radius: 12px; }
}
@media (max-width: 760px) {
  /* Écrans d'outils (Plus) : Analyse, Déclarations, Factures, Annonces, Estimation, Exports, Paramètres */
  .tb-espace { margin-top: 14px !important; }
  .tb-note-bas { margin: 14px 4px 0; }
  .contenu > .tb-note { margin-left: 20px; margin-right: 20px; }
  .tb-actions { display: flex !important; gap: 8px; order: 5; width: 100%; }
  .tb-actions .btn { flex: 1; background: #fff; border: 0; border-radius: 12px; min-height: 40px; font-size: 13px; }
  .bloc > .panneau:has(> .liste-tel), .bloc > .panneau:has(> .tableau-ordi) { background: transparent; border: 0; padding: 0; }
  .tb-impot { padding: 14px; }
  .tb-impot .tb-grille { border-top: 0; padding-top: 0; }
  .tb-impot .tb-kv { font-size: 15px; }
  .tb-cases { display: flex; gap: 22px; margin-top: 12px; padding-top: 12px; border-top: 1px solid #eef1ef; }
  .tb-cases .case-tel { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; }
  .liste-tel.tb-blk .tb-row.a-verifier { background: #fff8ee; }
  /* Analyse : via plateforme ou en direct */
  .analyse-bas { gap: 0; }
  .analyse-encadre { border: 0; border-radius: 14px; }
  /* Annonces et Estimation : formulaire en bloc blanc */
  .panneau.outil-claude { background: #fff; border: 0; border-radius: 14px; padding: 14px; }
  .outil-titre { font-size: 12px; font-weight: 600; color: var(--gris); text-transform: uppercase; letter-spacing: .04em; }
  .outil-claude .btn-principal { min-height: 46px; border-radius: 12px; font-size: 15px; }
  /* Exports */
  .exports-tel > .panneau { border: 0; border-radius: 14px; overflow: hidden; }
  .exports-tel .tb-sh { margin: 16px 4px 6px; }
  .exports-tel .tb-sh:first-child { margin-top: 4px; }
  .export-ligne-tel { padding: 12px 14px; }
  /* Paramètres : une rubrique par écran */
  .param-seul > .param-bloc { border: 0; border-radius: 14px; }
}

/* ---------- Avoirs (0.17.0) ---------- */
.onglets-facture { margin-top: 8px; border-bottom: 0; }
.onglets-facture .onglet { padding: 4px 12px 6px; font-size: 13px; }
.facture-cote .champ-form textarea { width: 100%; }
.marque-avoir { font-size: 11px; margin-left: 6px; vertical-align: 1px; }
