/* Outil de gestion TOTAL IMPROVEMENT — couleurs du logo : vert foncé, orange, rose, vert, jaune */
:root {
  --encre: #10231A; --fond: #F5F4EF; --carte: #FFFFFF; --trait: #E3E0D6; --trait-doux: #EFECE4;
  --gris: #5B6B61; --nav: #0F2A1E; --orange: #E8692A; --orange-texte: #B9501A; --orange-pale: #FDF1E8;
  --vert: #17804A; --vert-pale: #E8F5EC; --rose: #D63A5E; --rose-texte: #B42347; --rose-pale: #FCEEF1;
  --jaune: #F2CF3B; --jaune-pale: #FBF6DE; --jaune-texte: #8A6A00; --rouge-texte: #C2410C;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { font-family: 'Plus Jakarta Sans', system-ui, sans-serif; color: var(--encre); background: var(--fond); font-size: 14.5px; line-height: 1.45; }
a { color: var(--vert); text-decoration: none; }
a:hover { color: #0F5E36; }
h1, h2, h3 { margin: 0; letter-spacing: -0.3px; }
h1 { font-size: 28px; font-weight: 800; }
h2 { font-size: 18px; font-weight: 800; }
h3 { font-size: 15px; font-weight: 700; }
p { margin: 0; }
small, .gris { color: var(--gris); }

/* ---------------------------------------------------------------- mise en page */
.app { min-height: 100vh; display: flex; }
.nav { width: 256px; flex-shrink: 0; background: var(--nav); color: #E9EFEA; padding: 24px 16px; display: flex; flex-direction: column; gap: 22px; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.marque { display: flex; align-items: center; gap: 12px; color: #fff; padding: 0 4px; }
.marque b { display: block; font-size: 14.5px; letter-spacing: .5px; color: #F39A5E; font-weight: 800; }
.marque small { display: block; font-size: 11px; color: #8FD3A8; letter-spacing: 1.5px; }
.marque:hover { color: #fff; }
.nav-liens { display: flex; flex-direction: column; gap: 2px; }
.nav-liens a, .menu-contenu a { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 10px; color: #C9D6CD; font-weight: 500; min-height: 42px; }
.nav-liens a i, .menu-contenu a i { width: 8px; height: 8px; border-radius: 4px; border: 1.5px solid #6E8C79; flex-shrink: 0; }
.nav-liens a.sous, .menu-contenu a.sous { padding-left: 32px; font-size: 13.5px; min-height: 36px; }
.nav-liens a:hover, .menu-contenu a:hover { background: rgba(255,255,255,.05); color: #fff; }
.nav-liens a.actif, .menu-contenu a.actif { background: rgba(255,255,255,.1); color: #fff; font-weight: 700; }
.nav-liens a.actif i, .menu-contenu a.actif i { background: var(--jaune); border-color: var(--jaune); }
.pastille { margin-left: auto; font-style: normal; background: var(--orange); color: #fff; font-size: 11.5px; font-weight: 800; min-width: 22px; height: 22px; border-radius: 11px; display: inline-flex; align-items: center; justify-content: center; padding: 0 6px; }
.titre-nav { font-size: 11px; letter-spacing: 1.8px; color: #8AA595; font-weight: 700; padding: 18px 12px 4px; }
.bientot { font-size: 12px; color: #7F9A8A; padding: 10px 12px; line-height: 1.5; }
.nav-bas { margin-top: auto; display: flex; flex-direction: column; gap: 8px; }
.moi { display: flex; align-items: center; gap: 10px; color: #fff; padding: 8px; border-radius: 12px; }
.moi:hover { background: rgba(255,255,255,.05); color: #fff; }
.moi b { display: block; font-size: 13.5px; } .moi small { color: #A9C4B2; font-size: 12px; }
.avatar { width: 36px; height: 36px; border-radius: 18px; background: #22A05A; color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 12.5px; flex-shrink: 0; }
.sortir { color: #A9C4B2; font-size: 13px; padding: 0 8px; }
.devise { font-size: 12px; color: #8FD3A8; font-style: italic; padding: 10px 8px 0; border-top: 1px solid rgba(255,255,255,.08); }
.menu-mobile { display: none; }
.contenu { flex: 1; min-width: 0; padding: 28px 36px 64px; display: flex; flex-direction: column; gap: 22px; max-width: 1400px; }

/* ---------------------------------------------------------------- éléments */
.entete { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 14px; }
.entete .sur { font-size: 13px; color: var(--gris); font-weight: 600; display: block; margin-bottom: 4px; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 44px; padding: 0 18px; border-radius: 12px; border: 0; font: inherit; font-weight: 700; font-size: 14px; cursor: pointer; background: var(--encre); color: #fff; white-space: nowrap; }
.btn:hover { color: #fff; filter: brightness(1.12); }
.btn.orange { background: var(--orange); } .btn.vert { background: var(--vert); } .btn.rose { background: var(--rose); }
.btn.clair { background: #fff; color: var(--encre); border: 1px solid #CFCBBE; }
.btn.clair:hover { color: var(--encre); background: #FAF9F5; }
.btn.petit { height: 36px; padding: 0 12px; font-size: 13px; border-radius: 10px; }
.carte { background: var(--carte); border: 1px solid var(--trait); border-radius: 18px; padding: 20px 22px; display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.carte.sombre { background: var(--encre); border-color: var(--encre); color: #fff; }
.carte.sombre small, .carte.sombre .gris { color: #A9C4B2; }
.titre-carte { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.titre-carte a { font-size: 13.5px; font-weight: 700; }
.grille { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.ligne { display: flex; flex-wrap: wrap; gap: 16px; align-items: flex-start; }
.ligne > .large { flex: 2 1 520px; } .ligne > .etroit { flex: 1 1 300px; }
.kpi .val { font-size: 27px; font-weight: 800; letter-spacing: -.5px; line-height: 1.15; }
.kpi .lib { font-size: 13px; color: var(--gris); font-weight: 600; }
.carte.sombre .kpi .lib, .carte.sombre .lib { color: #A9C4B2; }
.vert-t { color: var(--vert); } .rouge-t { color: var(--rouge-texte); } .orange-t { color: var(--orange-texte); }
.tag { display: inline-block; font-size: 12px; font-weight: 700; padding: 3px 10px; border-radius: 20px; white-space: nowrap; }
.tag.validee, .tag.ok, .tag.valide { color: var(--vert); background: var(--vert-pale); }
.tag.a_valider, .tag.en_attente, .tag.brouillon { color: var(--orange-texte); background: var(--orange-pale); }
.tag.rejetee, .tag.annulee, .tag.annule { color: var(--rose-texte); background: var(--rose-pale); }
.tag.renvoyee { color: var(--jaune-texte); background: var(--jaune-pale); }
.tag.neutre { color: var(--gris); background: #F1EEE6; }
.pastille-div { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: middle; }
.flashs { display: flex; flex-direction: column; gap: 8px; }
.flash { padding: 12px 16px; border-radius: 12px; font-weight: 600; font-size: 14px; }
.flash.ok { background: var(--vert-pale); color: #0F5E36; }
.flash.erreur { background: var(--rose-pale); color: var(--rose-texte); }
.flash.info { background: var(--jaune-pale); color: var(--jaune-texte); }
.vide { padding: 22px; text-align: center; color: var(--gris); background: #FAF9F5; border-radius: 12px; }

/* tableaux */
.tableau-boite { overflow-x: auto; }
table.t { width: 100%; border-collapse: collapse; font-size: 13.5px; }
table.t th { text-align: left; color: var(--gris); font-weight: 600; padding: 10px 8px; border-bottom: 1px solid var(--trait); white-space: nowrap; }
table.t td { padding: 11px 8px; border-bottom: 1px solid var(--trait-doux); vertical-align: middle; }
table.t tr:last-child td { border-bottom: 0; }
table.t .num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
table.t tr.clic { cursor: pointer; } table.t tr.clic:hover td { background: #FAF9F5; }
table.t tr.barre td { color: #9AA39D; text-decoration: line-through; }
.montant { font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.montant.recette { color: var(--vert); } .montant.depense { color: var(--rouge-texte); }

/* formulaires */
form.f { display: flex; flex-direction: column; gap: 14px; }
.champs { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
label.c { display: flex; flex-direction: column; gap: 6px; font-size: 12.5px; font-weight: 700; color: #3E4E44; }
.c input, .c select, .c textarea, .filtres select, .filtres input { height: 44px; border: 1px solid #DAD6CA; border-radius: 10px; padding: 0 12px; font: inherit; font-size: 14.5px; font-weight: 500; color: var(--encre); background: #fff; width: 100%; }
.c textarea { height: auto; padding: 10px 12px; line-height: 1.5; resize: vertical; }
.c input:focus, .c select:focus, .c textarea:focus { outline: 2px solid #9FD3B2; border-color: var(--vert); }
.c .aide { font-weight: 500; color: var(--gris); font-size: 12px; }
.c input.gros { height: 54px; font-size: 22px; font-weight: 800; }
.bascule { display: grid; grid-template-columns: 1fr 1fr; background: #F1EEE6; border-radius: 12px; padding: 4px; }
.bascule input { position: absolute; opacity: 0; pointer-events: none; }
.bascule label { text-align: center; padding: 11px; border-radius: 9px; font-weight: 700; color: var(--gris); cursor: pointer; }
.bascule input:checked + label.rec { background: #fff; color: var(--vert); box-shadow: 0 1px 2px rgba(0,0,0,.06); }
.bascule input:checked + label.dep { background: #fff; color: var(--rouge-texte); box-shadow: 0 1px 2px rgba(0,0,0,.06); }
.bascule input:focus-visible + label { outline: 2px solid var(--vert); }
.depot { border: 1.5px dashed #CFCBBE; border-radius: 12px; padding: 16px; display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: var(--gris); }
.depot input { font: inherit; font-size: 13px; }
.alerte-seuil { background: var(--orange-pale); color: #8A3A10; border-radius: 12px; padding: 12px 14px; font-size: 13.5px; font-weight: 600; display: none; }
.alerte-seuil.visible { display: block; }
.filtres { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.filtres select, .filtres input { width: auto; height: 40px; font-size: 13.5px; }
.filtres input[type=search] { min-width: 220px; }
.pied-tableau { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; padding-top: 10px; border-top: 1px solid var(--trait); font-size: 13.5px; }

/* tableau de bord */
.barres { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 14px; height: 200px; align-items: end; border-bottom: 1px solid var(--trait); padding-bottom: 2px; }
.barres > div { display: flex; gap: 5px; align-items: end; justify-content: center; height: 100%; }
.barres span { width: 38%; max-width: 26px; border-radius: 6px 6px 0 0; min-height: 2px; }
.barres .r { background: var(--vert); } .barres .d { background: #F39A5E; }
.axe { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 14px; font-size: 12.5px; color: var(--gris); text-align: center; }
.legende { display: flex; gap: 16px; font-size: 12.5px; color: var(--gris); }
.legende i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.jauge { height: 8px; border-radius: 4px; background: #F1EEE6; display: flex; overflow: hidden; }
.jauge span { background: var(--orange); }
.a-traiter { display: flex; gap: 12px; align-items: flex-start; padding: 12px; border-radius: 12px; background: var(--orange-pale); color: var(--encre); }
.a-traiter:hover { color: var(--encre); filter: brightness(.98); }
.a-traiter .n { min-width: 28px; height: 28px; border-radius: 8px; background: var(--orange); color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 13px; }
.a-traiter.vert { background: var(--vert-pale); } .a-traiter.vert .n { background: var(--vert); }
.div-ligne { display: flex; justify-content: space-between; font-size: 13px; color: var(--gris); }
.div-ligne b { color: var(--encre); }

/* connexion */
.page-connexion { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px; background: var(--nav); }
.boite-connexion { width: 100%; max-width: 400px; background: #fff; border-radius: 22px; padding: 32px 28px; display: flex; flex-direction: column; gap: 20px; }
.boite-connexion .marque b { color: var(--orange-texte); }
.boite-connexion .marque small { color: var(--vert); }

.detail-grille { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 14px 24px; }
.detail-grille div small { display: block; font-size: 12px; font-weight: 600; margin-bottom: 2px; }
.detail-grille div b { font-weight: 600; }
.piece { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 10px; background: var(--fond); font-size: 13.5px; }
.piece img { width: 56px; height: 56px; object-fit: cover; border-radius: 8px; }
.histo { font-size: 13px; color: var(--gris); display: flex; flex-direction: column; gap: 6px; }
.roles-grille { display: flex; flex-direction: column; gap: 10px; }
.role-ligne { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; padding: 12px; border: 1px solid var(--trait); border-radius: 12px; }
.role-ligne label { display: flex; align-items: center; gap: 10px; font-weight: 700; flex: 1 1 220px; }
.role-ligne input[type=checkbox] { width: 20px; height: 20px; accent-color: var(--vert); }
.role-ligne select { height: 40px; border: 1px solid #DAD6CA; border-radius: 10px; padding: 0 10px; font: inherit; }
.mdp-provisoire { font-family: ui-monospace, monospace; font-size: 22px; font-weight: 700; letter-spacing: 1px; background: var(--jaune-pale); padding: 14px 18px; border-radius: 12px; user-select: all; }

/* ---------------------------------------------------------------- téléphone */
@media (max-width: 900px) {
  .app { flex-direction: column; }
  .nav { width: 100%; height: auto; position: sticky; top: 0; z-index: 10; padding: 12px 16px; gap: 0; }
  .nav-haut { display: flex; justify-content: space-between; align-items: center; }
  .nav-liens, .nav-bas { display: none; }
  .menu-mobile { display: block; }
  .menu-mobile summary { list-style: none; width: 44px; height: 44px; border-radius: 12px; background: rgba(255,255,255,.08); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; cursor: pointer; }
  .menu-mobile summary::-webkit-details-marker { display: none; }
  .menu-mobile summary span { width: 18px; height: 2px; background: #fff; border-radius: 1px; }
  .menu-contenu { position: absolute; left: 0; right: 0; top: 68px; background: var(--nav); padding: 8px 16px 16px; display: flex; flex-direction: column; gap: 2px; max-height: calc(100vh - 68px); overflow-y: auto; box-shadow: 0 12px 24px rgba(0,0,0,.25); }
  .contenu { padding: 18px 16px 48px; gap: 16px; }
  h1 { font-size: 23px; }
  .kpi .val { font-size: 23px; }
  .carte { padding: 16px; }
  .entete .actions { width: 100%; }
  .entete .actions .btn { flex: 1; }
}
