:root { --vert: #1f5e3a; --fond: #f4f6f3; --carte: #fff; --texte: #1c2620; --doux: #66736b; --bord: #dde3dd; }
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--fond); color: var(--texte);
  font: 16px/1.35 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; -webkit-tap-highlight-color: transparent; }
button { font: inherit; cursor: pointer; }
.barre { position: sticky; top: 0; z-index: 1000; display: flex; align-items: center; gap: 8px;
  background: var(--vert); color: #fff; padding: calc(8px + env(safe-area-inset-top)) 10px 8px; }
.barre .titre { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.barre .titre span { font-size: 12px; opacity: .85; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.btn-icone { background: none; border: 0; color: #fff; font-size: 26px; line-height: 1; padding: 4px 8px; text-decoration: none; }
#choix-tc { max-width: 40%; font-size: 14px; border-radius: 6px; border: 0; padding: 4px; }
#carte { height: 46vh; min-height: 260px; }
.legende { display: flex; gap: 14px; flex-wrap: wrap; font-size: 13px; color: var(--doux); padding: 6px 12px; }
.pt { display: inline-block; width: 11px; height: 11px; border-radius: 50%; margin-right: 5px; vertical-align: -1px; border: 1px solid #0b3d1f; }
.pt.actif { background: #1f6b3a; } .pt.inactif { background: #9fd8a8; }
.themes { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; padding: 6px 12px 24px; }
.theme { text-align: left; background: var(--carte); border: 1px solid var(--bord); border-radius: 12px; padding: 12px;
  display: flex; flex-direction: column; gap: 4px; min-height: 86px; }
.theme:last-child:nth-child(odd) { grid-column: span 2; }
.theme b { font-size: 15px; } .theme span { font-size: 12px; color: var(--doux); }
.jauge { display: block; height: 5px; background: #e5ebe5; border-radius: 3px; margin-top: auto; overflow: hidden; }
.jauge i { display: block; height: 100%; background: #2e9e4f; }
.outils { position: sticky; top: 52px; z-index: 900; background: var(--fond); padding: 10px 12px 4px; }
#recherche { width: 100%; padding: 10px 12px; border: 1px solid var(--bord); border-radius: 10px; font-size: 16px; }
.filtres { display: flex; gap: 6px; overflow-x: auto; padding: 8px 0 4px; }
.filtres button { flex: none; border: 1px solid var(--bord); background: #fff; border-radius: 16px; padding: 5px 11px; font-size: 13px; }
.filtres button.on { background: var(--vert); color: #fff; border-color: var(--vert); }
.filtres small { opacity: .7; }
.compteurs { font-size: 12px; color: var(--doux); padding: 2px 14px 6px; }
.liste { list-style: none; margin: 0; padding: 0 0 40px; }
.liste li { display: flex; align-items: center; gap: 12px; background: var(--carte); border-bottom: 1px solid var(--bord); padding: 11px 14px; }
.liste li:active { background: #eef3ee; }
.liste li.vide { color: var(--doux); justify-content: center; }
.pastille { flex: none; width: 18px; height: 18px; border-radius: 50%; border: 2px solid #bbb; }
.l-txt { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.l-txt b { font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.l-txt span { font-size: 12px; color: var(--doux); }
.l-n1 { text-align: right; font-weight: 600; font-size: 14px; white-space: nowrap; display: flex; flex-direction: column; }
.l-n1 small { font-weight: 400; font-size: 11px; color: var(--doux); }
.voile { position: fixed; inset: 0; background: rgba(0,0,0,.35); z-index: 2000; }
.feuille { position: fixed; left: 0; right: 0; bottom: 0; z-index: 2001; background: #fff; border-radius: 16px 16px 0 0;
  padding: 8px 16px calc(16px + env(safe-area-inset-bottom)); box-shadow: 0 -4px 20px rgba(0,0,0,.2); max-width: 640px; margin: 0 auto; }
.poignee { width: 40px; height: 4px; background: #ccc; border-radius: 2px; margin: 0 auto 10px; }
.feuille h2 { margin: 0; font-size: 18px; }
.f-info, .f-theme, .f-histo { margin: 4px 0; font-size: 13px; color: var(--doux); }
.f-theme { color: var(--texte); font-weight: 600; }
.choix { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 12px 0; }
.choix button { border: 2px solid transparent; border-radius: 12px; padding: 16px 4px; font-weight: 700; color: #fff; font-size: 15px; }
.c-vente { background: #2e9e4f; } .c-attente { background: #f0a020; } .c-refus { background: #d9363e; }
.choix button.on { border-color: #111; box-shadow: 0 0 0 2px #fff inset; }
#f-com { width: 100%; border: 1px solid var(--bord); border-radius: 10px; padding: 8px; font: inherit; font-size: 15px; }
.f-bas { display: flex; justify-content: space-between; margin-top: 6px; }
.lien { background: none; border: 0; color: var(--vert); padding: 8px 0; font-weight: 600; }
#f-effacer { color: #a33; }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: #1c2620; color: #fff;
  padding: 10px 16px; border-radius: 20px; z-index: 3000; font-size: 14px; max-width: 90vw; }
.toast.err { background: #b3261e; }
.minis .mini { display: inline-block; width: 12px; height: 12px; border-radius: 50%; margin-right: 3px; }
/* connexion */
.page-connexion { display: flex; min-height: 100vh; align-items: center; justify-content: center; padding: 16px; }
.carte-connexion { background: #fff; border-radius: 16px; padding: 28px 22px; width: 100%; max-width: 380px; box-shadow: 0 4px 24px rgba(0,0,0,.08); text-align: center; }
.carte-connexion .logo { font-size: 40px; } .carte-connexion h1 { margin: 4px 0 0; color: var(--vert); }
.sous { color: var(--doux); margin: 4px 0 18px; }
.carte-connexion form { display: flex; flex-direction: column; gap: 12px; text-align: left; }
.carte-connexion label { font-size: 13px; color: var(--doux); display: flex; flex-direction: column; gap: 4px; }
.carte-connexion input { font-size: 16px; padding: 11px; border: 1px solid var(--bord); border-radius: 10px; }
.carte-connexion button { background: var(--vert); color: #fff; border: 0; border-radius: 10px; padding: 13px; font-weight: 700; margin-top: 6px; }
.err { color: #b3261e; font-size: 14px; margin: 0; }
/* back-office */
.bo { padding: 12px; max-width: 1200px; margin: 0 auto; }
.bo h2 { font-size: 17px; margin: 18px 0 8px; }
.bo .actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.bo select, .bo .bouton { font: inherit; font-size: 14px; padding: 8px 10px; border-radius: 8px; border: 1px solid var(--bord); background: #fff; color: var(--texte); text-decoration: none; }
.bo .bouton.p { background: var(--vert); color: #fff; border-color: var(--vert); font-weight: 600; }
.defile { overflow-x: auto; background: #fff; border: 1px solid var(--bord); border-radius: 10px; }
table.t { border-collapse: collapse; width: 100%; font-size: 13px; }
table.t th, table.t td { padding: 6px 8px; border-bottom: 1px solid var(--bord); text-align: right; white-space: nowrap; }
table.t th { background: #eef3ee; position: sticky; top: 0; }
table.t td:first-child, table.t th:first-child { text-align: left; position: sticky; left: 0; background: #fff; }
table.t th:first-child { background: #eef3ee; }
table.t tr.total td { font-weight: 700; background: #f6f8f5; }
.cel { display: inline-flex; gap: 3px; align-items: center; }
.cel i { display: inline-block; min-width: 20px; padding: 1px 4px; border-radius: 4px; color: #fff; font-style: normal; text-align: center; font-size: 12px; }
.cel .v { background: #2e9e4f; } .cel .a { background: #f0a020; } .cel .r { background: #d9363e; }
.cel .pc { color: var(--doux); font-size: 11px; min-width: 32px; }
.note { font-size: 12px; color: var(--doux); }
