/* Parc automobile — feuille de styles. Couleurs de la collectivité : vert (principal) et bleu (secondaire). */
:root{
  --fond:#F3F6F4;--surface:#FFFFFF;--surface-2:#EDF2EE;--encre:#14211A;--encre-2:#3B4C42;--discret:#647569;
  --bord:#D9E3DC;--bord-fort:#BFD0C5;--accent:#08852B;--accent-fonce:#06601F;--accent-doux:#DDF0E2;--bleu:#2129A1;--bleu-doux:#E3E5F7;
  --rouge:#B42318;--rouge-doux:#FDE7E4;--orange:#B54708;--orange-doux:#FEF0DC;--gris:#5B6670;--gris-doux:#ECEFF1;--vert:#0B7A34;--vert-doux:#DFF3E5;
  --ombre:0 1px 2px rgba(20,33,26,.06),0 8px 24px -14px rgba(20,33,26,.25);--ombre-forte:0 24px 60px -24px rgba(20,33,26,.45);
  --rayon:12px;--police:system-ui,-apple-system,"Segoe UI",Roboto,"Helvetica Neue",Arial,sans-serif;
  --mono:ui-monospace,"Cascadia Mono","Segoe UI Mono",Consolas,monospace;
  color-scheme:light;
}
:root[data-theme="dark"]{
  --fond:#0D1611;--surface:#14211A;--surface-2:#101B15;--encre:#E6F0E9;--encre-2:#BFD0C5;--discret:#8EA195;
  --bord:#24352B;--bord-fort:#33493C;--accent:#3FBF66;--accent-fonce:#7AD796;--accent-doux:#15301F;--bleu:#9AA2F0;--bleu-doux:#1C1F3D;
  --rouge:#F5998F;--rouge-doux:#3A1A17;--orange:#F3B562;--orange-doux:#3A2A12;--gris:#AAB4BB;--gris-doux:#1E272C;--vert:#6CD38D;--vert-doux:#133120;
  --ombre:0 1px 2px rgba(0,0,0,.4),0 10px 30px -16px rgba(0,0,0,.7);--ombre-forte:0 30px 70px -28px rgba(0,0,0,.8);
  color-scheme:dark;
}
*{box-sizing:border-box}
html{-webkit-text-size-adjust:100%}
body{margin:0;background:var(--fond);color:var(--encre);font-family:var(--police);font-size:15px;line-height:1.5;-webkit-font-smoothing:antialiased}
h1,h2,h3{margin:0;line-height:1.2;letter-spacing:-.01em}
h1{font-size:24px;font-weight:750}h2{font-size:18px;font-weight:700}h3{font-size:15px;font-weight:700}
a{color:var(--accent-fonce)}
.hidden{display:none!important}
.mono{font-family:var(--mono);font-size:.94em}
.discret{color:var(--discret)}
.droite{text-align:right}
.nowrap{white-space:nowrap}
:focus-visible{outline:3px solid var(--accent);outline-offset:2px;border-radius:6px}

/* ---------- boutons ---------- */
.btn{display:inline-flex;align-items:center;justify-content:center;gap:.45em;font:inherit;font-weight:600;font-size:14px;padding:.55em 1em;border-radius:9px;border:1.5px solid transparent;cursor:pointer;text-decoration:none;white-space:nowrap;transition:filter .12s,border-color .12s}
.btn:active{transform:translateY(1px)}
.btn[disabled]{opacity:.55;cursor:not-allowed}
.btn-principal{background:var(--accent);color:#fff}
:root[data-theme="dark"] .btn-principal{color:#08150D}
.btn-principal:hover{filter:brightness(1.07)}
.btn-fantome{background:transparent;border-color:var(--bord-fort);color:var(--encre)}
.btn-fantome:hover{border-color:var(--accent);color:var(--accent-fonce)}
.btn-danger{background:var(--rouge-doux);color:var(--rouge)}
.btn-petit{padding:.32em .7em;font-size:13px;border-radius:7px}
.btn-bloc{width:100%}
.btn-icone{display:inline-grid;place-items:center;width:36px;height:36px;border-radius:9px;border:1.5px solid var(--bord);background:var(--surface);color:var(--encre-2);cursor:pointer;font-size:15px}
.btn-icone svg{width:18px;height:18px}
.btn-icone:hover{border-color:var(--accent)}
.lien{background:none;border:0;padding:0;font:inherit;color:var(--accent-fonce);cursor:pointer;text-decoration:underline}

/* ---------- connexion ---------- */
.connexion{min-height:100vh;display:grid;place-items:center;padding:20px;background:linear-gradient(150deg,#08852B 0%,#06601F 45%,#2129A1 130%)}
.carte-connexion{background:var(--surface);border-radius:18px;box-shadow:var(--ombre-forte);width:100%;max-width:400px;padding:30px 26px}
.carte-connexion h1{font-size:22px;margin:18px 0 4px}
.aide{color:var(--discret);font-size:14px;margin:0 0 18px}
.marque{display:flex;align-items:center;gap:11px;color:inherit;text-decoration:none;min-width:0}
.marque .logo{width:44px;height:44px;object-fit:contain;flex:0 0 auto}
.marque b{display:block;font-size:15.5px;line-height:1.15}
.marque small{display:block;color:var(--discret);font-size:12px}

/* ---------- champs ---------- */
.champ{display:flex;flex-direction:column;gap:5px;margin-bottom:13px;min-width:0}
.champ>span{font-size:13px;font-weight:600;color:var(--encre-2)}
.champ>span .oblig{color:var(--rouge)}
.champ input,.champ select,.champ textarea,.filtres input,.filtres select{font:inherit;font-size:15px;padding:.55em .7em;border-radius:9px;border:1.5px solid var(--bord-fort);background:var(--surface);color:var(--encre);width:100%;min-width:0}
.champ textarea{min-height:76px;resize:vertical}
.champ input:focus,.champ select:focus,.champ textarea:focus{outline:none;border-color:var(--accent);box-shadow:0 0 0 3px var(--accent-doux)}
.champ.en-erreur input,.champ.en-erreur select,.champ.en-erreur textarea{border-color:var(--rouge)}
.champ .msg{font-size:12.5px;color:var(--rouge)}
.champ .indice{font-size:12px;color:var(--discret)}
.erreur{background:var(--rouge-doux);color:var(--rouge);border-radius:9px;padding:10px 12px;font-size:14px;margin-bottom:14px}
.grille-form{display:grid;grid-template-columns:repeat(auto-fit,minmax(210px,1fr));gap:0 16px}
.grille-form .large{grid-column:1/-1}
fieldset.bloc{border:1px solid var(--bord);border-radius:10px;padding:12px 14px 2px;margin:0 0 14px}
fieldset.bloc legend{font-weight:700;font-size:13px;padding:0 6px;color:var(--accent-fonce)}
.actions-form{display:flex;gap:10px;justify-content:flex-end;flex-wrap:wrap;margin-top:6px;position:sticky;bottom:-18px;background:var(--surface);padding:12px 0 2px}

/* ---------- entête ---------- */
.entete{position:sticky;top:0;z-index:20;display:flex;align-items:center;gap:18px;padding:10px 20px;background:var(--surface);border-bottom:1px solid var(--bord);box-shadow:0 1px 0 rgba(0,0,0,.02)}
.entete .marque .logo{width:38px;height:38px}
.onglets{display:flex;gap:4px;flex:1;overflow-x:auto;scrollbar-width:none}
.onglets::-webkit-scrollbar{display:none}
.onglets a{padding:8px 12px;border-radius:8px;text-decoration:none;color:var(--encre-2);font-weight:600;font-size:14px;white-space:nowrap}
.onglets a:hover{background:var(--surface-2)}
.onglets a.actif{background:var(--accent-doux);color:var(--accent-fonce)}
.entete-droite{display:flex;align-items:center;gap:10px}
.utilisateur{display:flex;align-items:center;gap:8px;text-decoration:none;color:inherit}
.avatar{width:34px;height:34px;border-radius:50%;background:var(--bleu);color:#fff;display:grid;place-items:center;font-weight:700;font-size:13px}
.u-texte{display:flex;flex-direction:column;line-height:1.15;font-size:13.5px;font-weight:600}
.u-texte small{color:var(--discret);font-weight:500;font-size:11.5px}
.contenu{max-width:1500px;margin:0 auto;padding:22px 20px 60px;outline:none}

/* ---------- mise en page ---------- */
.titre-page{display:flex;align-items:flex-end;justify-content:space-between;gap:14px;flex-wrap:wrap;margin-bottom:18px}
.titre-page p{margin:4px 0 0;color:var(--discret)}
.barre-actions{display:flex;gap:8px;flex-wrap:wrap;align-items:center}
.carte{background:var(--surface);border:1px solid var(--bord);border-radius:var(--rayon);box-shadow:var(--ombre);padding:16px 18px;margin-bottom:18px;min-width:0}
.carte>h2,.carte-tete h2{font-size:16px}
.carte-tete{display:flex;align-items:center;justify-content:space-between;gap:10px;flex-wrap:wrap;margin-bottom:12px}
.deux-col{display:grid;grid-template-columns:minmax(0,1.35fr) minmax(0,1fr);gap:18px}
.deux-col>.carte{margin-bottom:0}
.pile{display:flex;flex-direction:column;gap:18px}

/* ---------- indicateurs ---------- */
.indicateurs{display:grid;grid-template-columns:repeat(auto-fit,minmax(150px,1fr));gap:12px;margin-bottom:18px}
.indic{background:var(--surface);border:1px solid var(--bord);border-radius:var(--rayon);padding:14px 16px;box-shadow:var(--ombre);border-left:4px solid var(--bord-fort)}
.indic .val{font-size:28px;font-weight:800;line-height:1.1;font-variant-numeric:tabular-nums}
.indic .lib{font-size:12.5px;color:var(--discret);font-weight:600;text-transform:uppercase;letter-spacing:.03em}
.indic.vert{border-left-color:var(--vert)}.indic.rouge{border-left-color:var(--rouge)}.indic.orange{border-left-color:var(--orange)}.indic.gris{border-left-color:var(--gris)}.indic.bleu{border-left-color:var(--bleu)}
.indic.rouge .val{color:var(--rouge)}.indic.orange .val{color:var(--orange)}

/* ---------- badges ---------- */
.badge{display:inline-flex;align-items:center;gap:5px;padding:2px 9px;border-radius:999px;font-size:12px;font-weight:700;white-space:nowrap;background:var(--gris-doux);color:var(--gris)}
.badge::before{content:"";width:7px;height:7px;border-radius:50%;background:currentColor}
.badge.expire,.badge.interdit,.badge.mauvais{background:var(--rouge-doux);color:var(--rouge)}
.badge.a_prevoir,.badge.apte_defauts,.badge.moyen,.badge.immobilise,.badge.sinistre{background:var(--orange-doux);color:var(--orange)}
.badge.ok,.badge.apte,.badge.bon,.badge.en_service{background:var(--vert-doux);color:var(--vert)}
.badge.a_renseigner{background:var(--bleu-doux);color:var(--bleu)}
.badge.archive,.badge.reforme{background:var(--gris-doux);color:var(--gris)}

/* ---------- tableaux ---------- */
.tableau-defile{overflow-x:auto;-webkit-overflow-scrolling:touch;margin:0 -4px}
table.tab{width:100%;border-collapse:collapse;font-size:14px}
.tab th{text-align:left;font-size:12px;text-transform:uppercase;letter-spacing:.03em;color:var(--discret);font-weight:700;padding:8px 10px;border-bottom:1.5px solid var(--bord-fort);white-space:nowrap;background:var(--surface)}
.tab td{padding:9px 10px;border-bottom:1px solid var(--bord);vertical-align:top}
.tab tr.cliquable{cursor:pointer}
.tab tr.cliquable:hover td{background:var(--surface-2)}
.tab td.num,.tab th.num{text-align:right;font-variant-numeric:tabular-nums;white-space:nowrap}
.tab tfoot td{font-weight:800;border-top:1.5px solid var(--bord-fort);border-bottom:0}
.vide{padding:26px;text-align:center;color:var(--discret)}

/* ---------- filtres ---------- */
.filtres{display:flex;flex-wrap:wrap;gap:8px;align-items:center;margin-bottom:14px}
.filtres input[type="search"]{flex:1 1 220px;width:auto}
.filtres select{width:auto;flex:0 1 auto}
.filtres label.case{display:flex;align-items:center;gap:6px;font-size:14px;color:var(--encre-2)}

/* ---------- répartition ---------- */
.barres{display:flex;flex-direction:column;gap:10px}
.barre .ligne{display:flex;justify-content:space-between;gap:10px;font-size:13.5px;margin-bottom:4px}
.barre .piste{height:9px;border-radius:999px;background:var(--surface-2);overflow:hidden}
.barre .plein{height:100%;border-radius:999px;background:var(--accent)}

/* ---------- alertes ---------- */
.liste-alertes{display:flex;flex-direction:column}
.alerte{display:grid;grid-template-columns:auto 1fr auto;gap:4px 12px;align-items:center;padding:10px 4px;border-bottom:1px solid var(--bord);cursor:pointer;text-decoration:none;color:inherit}
.alerte:hover{background:var(--surface-2)}
.alerte:last-child{border-bottom:0}
.alerte .quoi{font-weight:700}
.alerte .quand{font-size:13px;color:var(--discret)}

/* ---------- fiche ---------- */
.fiche-tete{display:flex;justify-content:space-between;gap:16px;flex-wrap:wrap;align-items:flex-start;margin-bottom:16px}
.fiche-tete .immat{font-family:var(--mono);font-size:26px;font-weight:800;letter-spacing:.02em;background:var(--surface);border:2px solid var(--encre);border-radius:8px;padding:2px 12px;display:inline-block}
.fiche-tete .sous{margin-top:8px;color:var(--encre-2);display:flex;gap:8px;flex-wrap:wrap;align-items:center}
.retour{display:inline-block;margin-bottom:10px;font-size:14px;text-decoration:none}
dl.infos{display:grid;grid-template-columns:repeat(auto-fit,minmax(200px,1fr));gap:12px 18px;margin:0}
dl.infos div{min-width:0}
dl.infos dt{font-size:12px;color:var(--discret);font-weight:700;text-transform:uppercase;letter-spacing:.03em}
dl.infos dd{margin:2px 0 0;font-weight:600;overflow-wrap:anywhere;white-space:pre-line}
dl.infos dd.vide-val{color:var(--discret);font-weight:400}
.sections-fiche{display:grid;grid-template-columns:repeat(auto-fit,minmax(520px,1fr));gap:18px;margin-bottom:18px}
.sections-fiche .carte{margin-bottom:0}
.pieces{display:flex;flex-direction:column}
.piece{display:flex;justify-content:space-between;gap:10px;align-items:center;padding:9px 2px;border-bottom:1px solid var(--bord);flex-wrap:wrap}
.piece:last-child{border-bottom:0}
.piece a{font-weight:600;overflow-wrap:anywhere}
.chrono{list-style:none;margin:0;padding:0;max-height:420px;overflow:auto}
.chrono li{padding:9px 0 9px 16px;border-left:2px solid var(--bord-fort);position:relative;font-size:13.5px}
.chrono li::before{content:"";position:absolute;left:-6px;top:14px;width:10px;height:10px;border-radius:50%;background:var(--accent)}
.chrono .qui{font-weight:700}
.chrono .chg{color:var(--encre-2);margin-top:2px;overflow-wrap:anywhere}
.chrono del{color:var(--rouge);text-decoration:line-through}
.chrono ins{color:var(--vert);text-decoration:none;font-weight:600}

/* ---------- fenêtre modale ---------- */
.fenetre{position:fixed;inset:0;z-index:50;background:rgba(10,20,14,.5);display:grid;place-items:center;padding:16px}
.fenetre-boite{background:var(--surface);border-radius:16px;box-shadow:var(--ombre-forte);width:100%;max-width:820px;max-height:calc(100vh - 32px);display:flex;flex-direction:column}
.fenetre-tete{display:flex;justify-content:space-between;align-items:center;gap:12px;padding:16px 18px;border-bottom:1px solid var(--bord)}
.fenetre-corps{padding:18px;overflow:auto}
.secret{font-family:var(--mono);font-size:18px;background:var(--surface-2);padding:10px 14px;border-radius:9px;user-select:all;overflow-wrap:anywhere}

.toast{position:fixed;bottom:20px;left:50%;transform:translateX(-50%);z-index:60;background:var(--encre);color:var(--surface);padding:10px 16px;border-radius:10px;box-shadow:var(--ombre-forte);font-weight:600;font-size:14px;max-width:calc(100vw - 32px)}
.toast.erreur-toast{background:var(--rouge)}

/* ---------- administration ---------- */
.sous-onglets{display:flex;gap:6px;flex-wrap:wrap;margin-bottom:16px}
.sous-onglets a{padding:7px 12px;border-radius:8px;border:1.5px solid var(--bord-fort);text-decoration:none;color:var(--encre-2);font-weight:600;font-size:14px}
.sous-onglets a.actif{background:var(--accent);border-color:var(--accent);color:#fff}
.listes-param{display:grid;grid-template-columns:repeat(auto-fit,minmax(300px,1fr));gap:16px}
.param{display:flex;align-items:center;gap:6px;padding:6px 0;border-bottom:1px solid var(--bord)}
.param .nom{flex:1;min-width:0}
.param.inactif .nom{color:var(--discret);text-decoration:line-through}
.code{font-family:var(--mono);font-size:11px;color:var(--discret);background:var(--surface-2);border-radius:5px;padding:1px 5px}

/* ---------- impression ---------- */
@media print{
  .entete,.barre-actions,.btn,.filtres,.retour{display:none!important}
  body{background:#fff}.carte,.indic{box-shadow:none}
}

/* ---------- téléphone ---------- */
@media (max-width:820px){
  .entete{flex-wrap:wrap;gap:8px;padding:8px 12px}
  .entete .marque small,.u-texte,#btnDeconnexion{display:none}
  .onglets{order:3;flex-basis:100%}
  .entete-droite{margin-left:auto}
  .contenu{padding:14px 12px 50px}
  .deux-col{grid-template-columns:1fr}
  .sections-fiche{grid-template-columns:1fr}
  h1{font-size:21px}
  .fiche-tete .immat{font-size:22px}
  .fenetre{padding:0;place-items:end stretch}
  .fenetre-boite{max-height:94vh;border-radius:16px 16px 0 0}
  .indic .val{font-size:24px}
  .tab .masquer-mobile{display:none}
}
