/* Repris de la maquette validee (phase 0) */
:root { --fond: #f7f8fa; --carte: #fff; --texte: #1d2733; --doux: #5b6878; --bord: #e3e7ec;
        --bleu: #1f6feb; --bleu-clair: #e8f0fe; --bleu-fonce: #1a4fa0; --vert-clair: #e3f6e8; --vert: #1c6b35;
        --orange-clair: #fff4e0; --orange: #8a5300; --rouge-clair: #fde8e8; --rouge: #a11d1d; --gris: #eef1f4; }
* { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body { font-family: system-ui, 'Segoe UI', Roboto, Arial, sans-serif; background: var(--fond); color: var(--texte);
       font-size: 14px; padding-bottom: calc(66px + env(safe-area-inset-bottom)); }
button, input, select { font: inherit; color: inherit; }
.entete { position: sticky; top: 0; z-index: 5; background: var(--carte); padding: 12px 16px 10px;
          border-bottom: 1px solid var(--bord); display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.entete h1 { font-size: 20px; }
.sous { font-size: 12px; color: var(--doux); margin-top: 2px; }
.actions-entete { display: flex; gap: 6px; }
.contenu { padding: 10px 12px 20px; max-width: 640px; margin: 0 auto; }
.nav { position: fixed; bottom: 0; left: 0; right: 0; background: var(--carte); border-top: 1px solid var(--bord);
       display: flex; padding-bottom: env(safe-area-inset-bottom); z-index: 5; }
.nav a { flex: 1; text-align: center; font-size: 10.5px; color: #7a8796; padding: 8px 0 9px; text-decoration: none; }
.nav a i { display: block; font-style: normal; font-size: 19px; margin-bottom: 2px; }
.nav a.actif { color: var(--bleu); font-weight: 600; }
.bandeau { border-radius: 10px; padding: 8px 10px; font-size: 12.5px; margin-bottom: 8px; }
.b-info { background: var(--bleu-clair); color: var(--bleu-fonce); }
.b-orange { background: var(--orange-clair); color: var(--orange); margin: 6px 0 0; }
.b-rouge { background: var(--rouge-clair); color: var(--rouge); }
.jour { font-size: 12px; font-weight: 700; color: var(--doux); text-transform: uppercase; margin: 14px 2px 6px; letter-spacing: .3px; }
.carte { background: var(--carte); border-radius: 12px; padding: 10px 12px; margin-bottom: 8px; box-shadow: 0 1px 2px rgba(0,0,0,.06); }
.carte.valide { opacity: .7; }
.ligne { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.motif { font-weight: 600; font-size: 14px; }
.trajet { color: var(--doux); font-size: 12.5px; margin-top: 2px; }
.km { display: flex; align-items: baseline; gap: 3px; font-weight: 700; font-size: 16px; white-space: nowrap; }
.km input { width: 3.4em !important; text-align: right; font-weight: 700; font-size: 16px; border: 1px solid transparent;
            border-radius: 6px; background: var(--gris) !important; padding: 3px 5px !important; }
.km input:focus { border-color: var(--bleu); background: #fff; outline: none; }
.km-fixe { font-weight: 700; font-size: 15px; white-space: nowrap; }
.puces { display: flex; gap: 5px; margin-top: 7px; flex-wrap: wrap; align-items: center; }
.puce { font-size: 11.5px; border-radius: 20px; padding: 4px 9px; background: var(--gris); color: #3c4857; border: none; }
button.puce, select.puce { cursor: pointer; min-height: 28px; }
.p-bleu { background: var(--bleu-clair); color: var(--bleu-fonce); } .p-vert { background: var(--vert-clair); color: var(--vert); }
.p-gris { background: var(--gris); color: #5b6878; } .p-orange { background: var(--orange-clair); color: var(--orange); }
.p-rouge { background: var(--rouge-clair); color: var(--rouge); }
.boutons { display: flex; gap: 6px; margin-top: 9px; align-items: center; }
.btn { flex: 1; text-align: center; border-radius: 9px; padding: 10px 0; font-size: 13.5px; font-weight: 600; border: none; cursor: pointer; }
.btn.petit { flex: none; padding: 8px 11px; font-size: 12.5px; }
.b-ok { background: var(--bleu); color: #fff; } .b-non { background: var(--gris); color: #3c4857; }
.b-lien { background: none; color: var(--bleu); flex: none; padding: 2px 0; font-size: 12.5px; }
.btn.htmx-request, button[disabled] { opacity: .5; }
.neg { color: var(--rouge); }
.vide { text-align: center; color: var(--doux); padding: 40px 10px; }
.titre-s { font-size: 13.5px; font-weight: 700; margin: 14px 2px 6px; }
.champ { margin-bottom: 9px; }
.champ label, dialog label { display: block; font-size: 12px; color: var(--doux); margin-bottom: 3px; }
input:not([type=checkbox]), select { width: 100%; background: #fff; border: 1px solid #d5dbe2; border-radius: 8px; padding: 9px 10px; font-size: 15px; }
.boutons input { flex: 1; }
select.puce { width: auto; padding: 4px 9px; font-size: 11.5px; border: none; }
details summary { cursor: pointer; margin: 8px 2px; }
dialog { border: none; border-radius: 14px; padding: 16px; width: min(92vw, 420px); margin: auto; }
dialog::backdrop { background: rgba(29,39,51,.45); }
dialog h2 { font-size: 17px; margin-bottom: 10px; }
dialog label { margin-bottom: 9px; }
dialog input, dialog select { margin-top: 3px; }

/* Jury phase 2 : cibles de 44 px, contraste, champ km sur la ligne, message pres du pouce */
.btn { min-height: 44px; }
.btn.petit { min-height: 40px; }
button.puce, select.puce { min-height: 36px; padding: 6px 11px; }
.nav a { color: #4f5b69; font-size: 11px; min-height: 52px; }
.km input { background: transparent !important; border: 1px dashed transparent; }
.km input:hover { border-color: #c4ccd5; }
.b-lien { flex: 0 0 auto; padding: 10px 12px; color: #5b6878; }
input.pleine { margin-top: 8px; }
.toast { position: fixed; left: 12px; right: 12px; bottom: calc(74px + env(safe-area-inset-bottom)); z-index: 10;
         border-radius: 12px; padding: 12px 14px; font-size: 13.5px; box-shadow: 0 4px 14px rgba(0,0,0,.18);
         max-width: 616px; margin: 0 auto; animation: disparait 6s forwards; }
.toast.b-rouge { animation: none; }
@keyframes disparait { 0%, 85% { opacity: 1; } 100% { opacity: 0; visibility: hidden; } }
details.ignores summary { list-style: none; }
textarea { width: 100%; background: #fff; border: 1px solid #d5dbe2; border-radius: 8px; padding: 9px 10px; font: inherit; font-size: 15px; }
.jour.ligne { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.jour .btn.petit { text-transform: none; letter-spacing: 0; font-size: 12px; }

/* Lot C : vue jour par jour, calendrier (demande de Leo du 03/11) */
:root { --rouge-j: #d93025; --orange-j: #e37400; --vert-j: #188038; --bleu-j: #1a73e8; --violet: #6b3fa0; --violet-clair: #f1eafa; }
.calendrier { background: var(--carte); border-radius: 12px; padding: 10px; margin-bottom: 12px; box-shadow: 0 1px 2px rgba(0,0,0,.06); }
.cal-entete { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
.cal-titre { font-weight: 700; font-size: 15px; }
.cal-nav { width: 44px; height: 36px; border: none; background: var(--gris); border-radius: 8px; font-size: 20px; cursor: pointer; }
span.cal-nav { background: none; }
.cal-grille { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; text-align: center; }
.cal-jsem { font-size: 11px; color: var(--doux); font-weight: 600; }
.cal-jour { display: flex; align-items: center; justify-content: center; height: 38px; border-radius: 8px; text-decoration: none;
            color: var(--texte); font-weight: 600; font-size: 14px; background: var(--gris); }
.cal-jour.c-aucune { background: transparent; color: #9aa5b1; font-weight: 400; }
.cal-jour.c-rouge { background: var(--rouge-j); color: #fff; } .cal-jour.c-orange { background: var(--orange-j); color: #fff; }
.cal-jour.c-vert { background: var(--vert-j); color: #fff; } .cal-jour.c-bleu { background: var(--bleu-j); color: #fff; }
.cal-auj { outline: 2px solid var(--texte); outline-offset: 1px; }
.cal-legende { display: flex; flex-wrap: wrap; gap: 4px 10px; margin-top: 8px; font-size: 11px; color: var(--doux); }
.cal-legende span::before { content: ""; display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 4px; vertical-align: -1px; }
.cal-legende .c-rouge::before { background: var(--rouge-j); } .cal-legende .c-orange::before { background: var(--orange-j); }
.cal-legende .c-vert::before { background: var(--vert-j); } .cal-legende .c-bleu::before { background: var(--bleu-j); }
details.mois { margin-bottom: 10px; }
details.mois > summary { list-style: none; cursor: pointer; display: flex; justify-content: space-between; align-items: center;
           background: var(--texte); color: #fff; border-radius: 10px; padding: 12px 14px; min-height: 48px; }
details.mois > summary::-webkit-details-marker { display: none; }
details.mois > summary::before { content: "▸"; margin-right: 8px; }
details.mois[open] > summary::before { content: "▾"; }
.mois-titre { font-weight: 700; font-size: 16px; flex: 1; }
.mois-compte { font-size: 12px; opacity: .85; }
.jour-bloc { margin: 16px 0 6px; padding-left: 10px; border-left: 5px solid #c4ccd5; scroll-margin-top: 80px; }
.jour-bloc.j-rouge { border-left-color: var(--rouge-j); } .jour-bloc.j-orange { border-left-color: var(--orange-j); }
.jour-bloc.j-vert { border-left-color: var(--vert-j); } .jour-bloc.j-bleu { border-left-color: var(--bleu-j); }
.jour-entete { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin: 0 0 8px; }
.jour-date { font-size: 17px; font-weight: 800; color: var(--texte); }
.etiquette { display: inline-block; font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .4px;
             border-radius: 5px; padding: 2px 7px; margin-bottom: 4px; }
.e-valider { background: var(--bleu-clair); color: var(--bleu-fonce); } .e-valide { background: var(--vert-clair); color: var(--vert); }
.e-adresse { background: var(--orange-clair); color: var(--orange); } .e-properso { background: var(--violet-clair); color: var(--violet); }
.e-ignore { background: var(--gris); color: #6b7684; margin: 0 6px 0 0; }
.c-adresse { border-left: 3px solid var(--orange-j); } .c-properso { border-left: 3px solid var(--violet); }
.ignoree { display: flex; align-items: center; gap: 4px; padding: 2px 6px; margin-bottom: 4px; font-size: 12.5px; color: #6b7684; }
.ignoree-texte { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.btn[disabled] { opacity: .45; cursor: not-allowed; }
.mois-km { font-weight: 700; font-size: 14px; margin-right: 10px; white-space: nowrap; }
.mois-km small { font-weight: 400; opacity: .8; }
details.mois > summary { flex-wrap: wrap; row-gap: 2px; }
.jour-km { display: inline-block; margin-left: 6px; font-size: 13px; font-weight: 700; color: var(--vert); background: var(--vert-clair); border-radius: 6px; padding: 1px 7px; vertical-align: 2px; }
dialog label.case { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--texte); min-height: 44px; }
dialog label.case input { width: 22px; height: 22px; margin: 0; }

/* Carte A/R, jours replies, Aujourd'hui, retour en haut (decisions de Leo du 03/11) */
.troncon { border-top: 1px solid var(--bord); margin-top: 8px; padding-top: 6px; }
.troncon-texte { font-size: 12.5px; color: var(--doux); }
.troncon-sens { display: inline-block; min-width: 54px; font-weight: 700; color: var(--texte); }
.t-ignore { opacity: .55; }
.t-ignore .troncon-texte { text-decoration: line-through; }
.puce.p-lien { background: none; color: #6b7684; text-decoration: underline; }
details.jour-replie > summary { list-style: none; cursor: pointer; min-height: 44px; }
details.jour-replie > summary::-webkit-details-marker { display: none; }
details.jour-replie > summary .trajet::after { content: " ▸"; }
details.jour-replie[open] > summary .trajet::after { content: " ▾"; }
.bloque { margin: -4px 0 8px; color: var(--orange); }
.cal-aujourdhui { font-size: 12.5px; font-weight: 600; color: var(--bleu); text-decoration: none; padding: 8px 6px; }
.haut { position: fixed; right: 14px; bottom: calc(80px + env(safe-area-inset-bottom)); z-index: 9; width: 48px; height: 48px;
        border-radius: 50%; border: none; background: var(--texte); color: #fff; font-size: 22px; box-shadow: 0 3px 10px rgba(0,0,0,.25);
        opacity: 0; pointer-events: none; transition: opacity .2s; cursor: pointer; }
.haut.visible { opacity: .9; pointer-events: auto; }
.bascule { display: flex; justify-content: flex-end; margin: 0 0 8px; }
/* phase 3 : releves compteur */
table.releves { width: 100%; border-collapse: collapse; font-size: 12px; margin-top: 2px; }
table.releves th { text-align: left; color: var(--doux); font-weight: 600; padding: 3px 2px; border-bottom: 1px solid #e3e8ee; }
table.releves td { padding: 4px 2px; border-bottom: 1px solid #f0f2f5; }
table.releves form { margin: 0; }
.compteur { font-size: 11.5px; margin-left: 6px; margin-right: 32px; font-weight: 600; white-space: nowrap; }
.compteur.gris { color: var(--doux); font-weight: 400; }
/* phase 4 : synthese et virements */
.titre-annee { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin: 2px 2px 8px; }
.titre-annee h2 { font-size: 18px; }
.titre-annee select { width: auto; padding: 6px 8px; }
.carte.avirer { border-left: 5px solid var(--vert); }
.gros { font-size: 24px; font-weight: 800; margin: 4px 0 2px; }
.carte.cloture .gros { font-size: 18px; }
.avirer details > summary { list-style: none; display: block; margin-top: 10px; padding: 12px 0; }
.avirer details > summary::-webkit-details-marker { display: none; }
.avirer details form { margin-top: 10px; }
table.synthese { width: 100%; border-collapse: collapse; background: var(--carte); border-radius: 12px; overflow: hidden;
                 font-size: 11.5px; margin-bottom: 10px; font-variant-numeric: tabular-nums; }
table.synthese th { background: var(--texte); color: #fff; font-weight: 600; padding: 6px 3px; text-align: right; }
table.synthese td { padding: 6px 3px; border-bottom: 1px solid #eef1f4; text-align: right; white-space: nowrap; }
table.synthese th:first-child, table.synthese td:first-child { text-align: left; padding-left: 8px; }
table.synthese td small { display: block; color: var(--doux); font-size: 10px; }
table.synthese tr.gris td { color: var(--doux); }
table.synthese tr.note td { text-align: left; white-space: normal; color: var(--doux); padding-left: 8px; border-bottom: 1px solid #eef1f4; }
table.synthese tr.tot td { font-weight: 800; background: #eef1f4; }
table.synthese form { margin: 6px 0; }
table.synthese th:last-child, table.synthese td:last-child { padding-right: 8px; }
.boutons.export { margin: 0 0 10px; }
.boutons.export .btn { display: block; text-decoration: none; color: inherit; }
/* phase 6a : connexion */
.contenu.connexion { max-width: 380px; padding-top: 18vh; }
.contenu.connexion h1 { font-size: 34px; margin-bottom: 2px; }
.contenu.connexion form { margin-top: 18px; }
form.deconnexion { margin-top: 26px; }
/* jury 6a : identifiant invisible pour le trousseau (pas display:none, ignore par les gestionnaires) */
.masque { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; overflow: hidden; }
