/* =====================================================================
   ParcControl — thème turquoise / blanc
   Variables en tête : modifiez-les pour ajuster la charte.
   ===================================================================== */
:root {
  --turquoise: #00A9B5;
  --turquoise-vif: #00C6D2;
  --turquoise-clair: #E6F7F8;
  --nuit: #0B3C5D;
  --nuit-2: #134B70;
  --texte: #14232F;
  --texte-2: #4F6272;
  --muted: #5F707D;
  --fond: #F4F9FA;
  --carte: #fff;
  --ligne: #DCE8EC;
  --piste: #E8F0F2;
  --ok: #18B679;
  --ok-clair: #E3F7EE;
  --ko: #E5484D;
  --ko-clair: #FDECEC;
  --attention: #F2A541;
  --attention-clair: #FEF4E4;
  --na: #A8B6C1;
  --rayon: 16px;
  --rayon-s: 10px;
  --ombre: 0 1px 2px rgba(11, 60, 93, .06), 0 8px 24px -8px rgba(11, 60, 93, .14);
  --ombre-forte: 0 24px 60px -16px rgba(11, 60, 93, .32);
  --degrade: linear-gradient(135deg, #00C6D2 0%, #00A9B5 45%, #0B6E8C 100%);
  --police: 'Segoe UI Variable Text', 'Segoe UI', system-ui, -apple-system, 'Helvetica Neue', Roboto, Arial, sans-serif;
  /* titres et chiffres : polices « signalétique » présentes sur les systèmes (Windows : Bahnschrift, Apple : DIN Alternate) */
  --police-titre: Bahnschrift, 'DIN Alternate', 'Segoe UI Variable Display', 'Segoe UI', system-ui, -apple-system, Roboto, sans-serif;
  --turq-encre: #007C85;
  --degrade-btn: linear-gradient(135deg, #00929D 0%, #007C85 55%, #0B6E8C 100%);
  --ombre-douce: 0 1px 2px rgba(11, 60, 93, .05), 0 4px 14px -6px rgba(11, 60, 93, .12);
  --ressort: cubic-bezier(.2, .9, .25, 1.15);
  --doux: cubic-bezier(.22, .61, .36, 1);
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { font-family: var(--police); color: var(--texte); background: var(--fond); font-size: 15px; line-height: 1.45; -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3, h4 { margin: 0; letter-spacing: -.01em; color: var(--nuit); }
h1, h2 { font-family: var(--police-titre); font-weight: 700; }
a { color: var(--turq-encre); }
.ic { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.muted { color: var(--muted); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- Fond animé ---------- */
.aurore { position: fixed; inset: 0; z-index: -1; overflow: hidden; background: radial-gradient(1200px 600px at 100% -10%, #D5F3F5 0%, transparent 60%), radial-gradient(900px 500px at -10% 110%, #E3F1FA 0%, transparent 60%), var(--fond); }
.aurore::before, .aurore::after { content: ''; position: absolute; width: 46vmax; height: 46vmax; border-radius: 50%; filter: blur(70px); opacity: .22; animation: derive 26s ease-in-out infinite alternate; }
.aurore::before { background: #7FE3EA; top: -18vmax; right: -10vmax; }
.aurore::after { background: #BFE3F5; bottom: -22vmax; left: -12vmax; animation-delay: -13s; }
@keyframes derive { to { transform: translate(-8vmax, 6vmax) scale(1.12); } }
.grille-deco { position: fixed; inset: 0; z-index: -1; background-image: linear-gradient(rgba(0, 169, 181, .05) 1px, transparent 1px), linear-gradient(90deg, rgba(0, 169, 181, .05) 1px, transparent 1px); background-size: 44px 44px; mask-image: radial-gradient(ellipse at 70% 0%, #000 0%, transparent 65%); pointer-events: none; }

/* ---------- Structure ---------- */
.app { display: grid; grid-template-columns: 264px 1fr; min-height: 100vh; }
.lateral { position: sticky; top: 0; height: 100vh; padding: 20px 14px; display: flex; flex-direction: column; gap: 6px; background: linear-gradient(180deg, var(--nuit) 0%, #0A324E 100%); color: #CFE6EE; overflow-y: auto; }
.marque { display: flex; align-items: center; gap: 12px; padding: 6px 10px 22px; }
.logo { width: 40px; height: 40px; border-radius: 12px; background: var(--degrade); display: grid; place-items: center; box-shadow: 0 0 0 1px rgba(255, 255, 255, .15) inset, 0 8px 22px -6px rgba(0, 198, 210, .7); position: relative; overflow: hidden; }
.logo::after { content: ''; position: absolute; inset: -40%; background: conic-gradient(from 0deg, transparent 0 70%, rgba(255, 255, 255, .55) 80%, transparent 90%); animation: balayage 4.5s linear infinite; }
@keyframes balayage { to { transform: rotate(1turn); } }
.logo .ic { color: #fff; width: 22px; height: 22px; position: relative; z-index: 1; }
.marque b { display: block; color: #fff; font-size: 18px; letter-spacing: .01em; font-family: var(--police-titre); }
.marque small { color: #8FB7C7; font-size: 11.5px; }
.nav-titre { font-size: 12px; font-weight: 600; color: #7FA9BB; padding: 16px 12px 6px; }
.nav-lien { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 10px; color: #CFE6EE; text-decoration: none; cursor: pointer; border: 0; background: none; width: 100%; text-align: left; position: relative; transition: background .25s, color .25s, transform .25s var(--doux); }
.nav-lien:hover { background: rgba(255, 255, 255, .06); color: #fff; transform: translateX(2px); }
.nav-lien.actif { background: linear-gradient(90deg, rgba(0, 198, 210, .24), rgba(0, 198, 210, .04)); color: #fff; }
.nav-lien.actif::before { content: ''; position: absolute; left: -14px; top: 8px; bottom: 8px; width: 4px; border-radius: 0 4px 4px 0; background: var(--turquoise-vif); box-shadow: 0 0 12px var(--turquoise-vif); }
.lateral .pied { margin-top: auto; padding-top: 16px; border-top: 1px solid rgba(255, 255, 255, .08); }
.profil { display: flex; align-items: center; gap: 10px; padding: 8px 10px; }
.avatar { width: 36px; height: 36px; border-radius: 50%; background: var(--degrade-btn); color: #fff; display: grid; place-items: center; font-weight: 700; font-size: 13px; flex: none; }
.profil b { color: #fff; font-size: 13.5px; display: block; }
.profil small { color: #8FB7C7; font-size: 11.5px; }
.badge-mode { display: inline-block; font-size: 10.5px; padding: 2px 8px; border-radius: 99px; background: rgba(242, 165, 65, .2); color: #FFD08A; margin: 6px 10px; }

.principal { min-width: 0; padding: 26px 34px 60px; }
.entete-page { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
.entete-page h1 { font-size: 30px; font-weight: 700; line-height: 1.15; }
.entete-page .fil { font-size: 13px; color: var(--muted); margin-bottom: 4px; font-weight: 500; }
.entete-page .fil:first-letter { text-transform: uppercase; }
.actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.barre-mobile { display: none; }

/* ---------- Animations d'entrée ---------- */
.vue { animation: entree .42s var(--doux) both; }
@keyframes entree { from { opacity: 0; transform: translateY(10px); } }
.cascade > * { animation: entree .55s var(--doux) both; animation-delay: calc(var(--i, 0) * 45ms); }
tbody tr { animation: entree .4s var(--doux) both; animation-delay: calc(min(var(--i, 0), 20) * 18ms); }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; } }

/* ---------- Cartes ---------- */
.carte { background: var(--carte); border: 1px solid rgba(208, 225, 231, .75); border-radius: var(--rayon); box-shadow: var(--ombre-douce); padding: 20px; position: relative; }
.carte > h3 { font-size: 15px; margin-bottom: 14px; display: flex; align-items: center; gap: 8px; }
.carte > h3 .muted { font-weight: 400; font-size: 13px; margin-left: auto; }
.grille { display: grid; gap: 18px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.g-23 { grid-template-columns: 2fr 1fr; }
.span2 { grid-column: span 2; }

.kpi { padding: 18px 20px; overflow: hidden; transition: transform .35s var(--ressort), box-shadow .35s; }
@media (hover: hover) { .kpi:hover { transform: translateY(-2px); box-shadow: var(--ombre); } }
.kpi .lib { font-size: 12.5px; color: var(--texte-2); display: flex; align-items: center; gap: 8px; }
.kpi .lib .ic { color: var(--turq-encre); width: 18px; height: 18px; }
.kpi .val { font-family: var(--police-titre); font-size: 32px; font-weight: 700; color: var(--nuit); margin-top: 6px; font-variant-numeric: tabular-nums; letter-spacing: -.01em; line-height: 1.15; }
.kpi .sous { font-size: 12px; color: var(--muted); }
.kpi.ko .val { color: var(--ko); }
.kpi.ok .val { color: var(--ok); }

/* ---------- Boutons ---------- */
.btn { text-decoration: none; display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 1px solid transparent; border-radius: 11px; padding: 9px 16px; font-weight: 600; font-size: 14px; cursor: pointer; background: var(--degrade-btn); color: #fff; box-shadow: 0 6px 16px -6px rgba(0, 124, 133, .65); transition: transform .2s var(--ressort), box-shadow .2s, filter .2s; position: relative; overflow: hidden; white-space: nowrap; }
.btn::after { content: ''; position: absolute; inset: 0; background: linear-gradient(110deg, transparent 30%, rgba(255, 255, 255, .35) 50%, transparent 70%); transform: translateX(-120%); transition: transform .6s; }
@media (hover: hover) { .btn:hover { transform: translateY(-1px); box-shadow: 0 10px 22px -8px rgba(0, 124, 133, .75); } .btn:hover::after { transform: translateX(120%); } }
.btn:active { transform: scale(.97); }
.btn:disabled { opacity: .55; cursor: not-allowed; transform: none; }
.btn .ic { width: 18px; height: 18px; }
.btn-ghost { background: #fff; color: var(--nuit); border-color: var(--ligne); box-shadow: none; }
.btn-ghost:hover { border-color: var(--turquoise); box-shadow: 0 4px 14px -6px rgba(0, 169, 181, .4); }
.btn-danger { background: linear-gradient(135deg, #D93D42, #B4282D); box-shadow: 0 6px 16px -6px rgba(229, 72, 77, .6); }
.btn-sm { padding: 6px 11px; font-size: 13px; border-radius: 9px; }
.btn-icone { width: 34px; height: 34px; display: inline-grid; place-items: center; border-radius: 9px; border: 1px solid var(--ligne); background: #fff; cursor: pointer; color: var(--texte-2); transition: all .2s; }
.btn-icone:hover { color: var(--turq-encre); border-color: var(--turquoise); }
.btn-icone.danger:hover { color: var(--ko); border-color: var(--ko); }
.btn-icone .ic { width: 17px; height: 17px; }

/* ---------- Formulaires ---------- */
.champ { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.champ > span { font-size: 12.5px; font-weight: 600; color: var(--texte-2); }
.champ small { color: var(--muted); font-size: 12px; }
input[type=text], input[type=email], input[type=number], input[type=date], input[type=search], select, textarea { width: 100%; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--ligne); background: #fff; transition: border-color .2s, box-shadow .2s; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--turquoise); box-shadow: 0 0 0 4px rgba(0, 169, 181, .15); }
textarea { min-height: 80px; resize: vertical; }
.form-ligne { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 0 14px; }
.case { display: flex; gap: 10px; align-items: center; cursor: pointer; margin-bottom: 10px; }
.case input { width: 18px; height: 18px; accent-color: var(--turquoise); }
:focus-visible { outline: 3px solid rgba(0, 169, 181, .5); outline-offset: 2px; }

.puces { display: flex; flex-wrap: wrap; gap: 6px; }
.puce { --c: var(--turquoise); display: inline-flex; align-items: center; gap: 6px; padding: 5px 11px; border-radius: 99px; border: 1px solid var(--ligne); background: #fff; font-size: 13px; cursor: pointer; transition: all .2s var(--doux); user-select: none; }
.puce input { display: none; }
.puce.on { background: color-mix(in srgb, var(--c) 14%, #fff); border-color: var(--c); color: var(--nuit); font-weight: 600; }
.puce:hover { border-color: var(--c); }
.puce-info { font-size: 12px; color: var(--muted); align-self: center; margin-right: 4px; }

/* ---------- Tableaux ---------- */
.table-outils { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.champ-recherche { display: flex; align-items: center; gap: 8px; background: #fff; border: 1px solid var(--ligne); border-radius: 10px; padding: 0 10px; flex: 0 1 340px; }
.champ-recherche input { border: 0; padding: 9px 0; box-shadow: none !important; }
.champ-recherche .ic { color: var(--muted); width: 17px; }
.table-scroll { overflow-x: auto; border-radius: 12px; border: 1px solid var(--ligne); background: #fff; }
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th { text-align: left; font-size: 12.5px; font-weight: 600; color: var(--texte-2); background: #F7FBFC; padding: 11px 14px; border-bottom: 1px solid var(--ligne); white-space: nowrap; position: sticky; top: 0; }
.table th.triable { cursor: pointer; }
.table th.triable:hover { color: var(--turquoise); }
.table td { padding: 11px 14px; border-bottom: 1px solid #EEF4F6; vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr { transition: background .2s; }
.table tbody tr:hover { background: #F3FBFC; }
.table tr.cliquable { cursor: pointer; }
.table .vide { text-align: center; color: var(--muted); padding: 30px; }
.table .num { text-align: right; font-variant-numeric: tabular-nums; }
.table .act { text-align: right; white-space: nowrap; }
.table .act .btn-icone { margin-left: 4px; }
.pagination { display: flex; justify-content: center; align-items: center; gap: 14px; margin-top: 12px; font-size: 13px; }

.etiquette { display: inline-flex; align-items: center; gap: 5px; padding: 2px 9px; border-radius: 99px; font-size: 12px; font-weight: 600; background: var(--piste); color: var(--texte-2); white-space: nowrap; }
.etiquette.ok { background: var(--ok-clair); color: #0E7F54; }
.etiquette.ko { background: var(--ko-clair); color: #B4282D; }
.etiquette.attention { background: var(--attention-clair); color: #A0620D; }
.etiquette.turq { background: var(--turquoise-clair); color: #007C85; }
.etiquette.nuit { background: #E4ECF3; color: var(--nuit); }
.pastille { width: 9px; height: 9px; border-radius: 50%; display: inline-block; background: var(--na); }
.pastille.ok { background: var(--ok); box-shadow: 0 0 0 4px var(--ok-clair); }
.pastille.attention { background: var(--attention); box-shadow: 0 0 0 4px var(--attention-clair); }
.pastille.critique { background: var(--ko); box-shadow: 0 0 0 4px var(--ko-clair); animation: pulse 1.6s infinite; }
@keyframes pulse { 50% { box-shadow: 0 0 0 7px rgba(229, 72, 77, .08); } }

/* ---------- Onglets ---------- */
.onglets { display: inline-flex; gap: 4px; padding: 4px; background: #fff; border: 1px solid var(--ligne); border-radius: 12px; margin-bottom: 18px; flex-wrap: wrap; }
.onglet { border: 0; background: none; padding: 8px 14px; border-radius: 9px; cursor: pointer; font-weight: 600; font-size: 13.5px; color: var(--texte-2); transition: all .25s var(--doux); }
.onglet:hover { color: var(--nuit); }
.onglet.actif { background: var(--degrade-btn); color: #fff; box-shadow: 0 4px 14px -4px rgba(0, 169, 181, .6); }

/* ---------- Modales & toasts ---------- */
.modale-fond { position: fixed; inset: 0; background: rgba(8, 30, 46, .44); backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px); display: grid; place-items: center; padding: 20px; z-index: 50; opacity: 0; transition: opacity .24s ease; }
.modale-fond.ouvert { opacity: 1; }
.modale { background: #fff; border-radius: 18px; width: min(560px, 100%); max-height: 90vh; display: flex; flex-direction: column; box-shadow: var(--ombre-forte); transform: translateY(14px) scale(.98); transition: transform .32s var(--doux); }
.modale.large { width: min(900px, 100%); }
.modale-fond.ouvert .modale { transform: none; }
.modale header { display: flex; justify-content: space-between; align-items: center; padding: 18px 22px; border-bottom: 1px solid var(--ligne); }
.modale header h2 { font-size: 18px; }
.modale-corps { padding: 20px 22px; overflow-y: auto; }
.modale footer { display: flex; justify-content: flex-end; gap: 10px; padding: 14px 22px; border-top: 1px solid var(--ligne); }
#toasts { position: fixed; right: 20px; bottom: 20px; display: flex; flex-direction: column; gap: 10px; z-index: 60; }
.toast { display: flex; align-items: center; gap: 10px; background: var(--nuit); color: #fff; padding: 12px 16px; border-radius: 12px; box-shadow: var(--ombre-forte); animation: toastIn .4s var(--ressort); max-width: 380px; }
.toast .ic { color: var(--turquoise-vif); }
.toast-ok .ic { color: #6EE7B7; }
.toast-erreur { background: #8E1F23; }
.toast-erreur .ic { color: #FFB4B6; }
.toast.sortie { opacity: 0; transform: translateX(30px); transition: all .35s; }
@keyframes toastIn { from { opacity: 0; transform: translateY(14px) scale(.96); } }

/* ---------- Graphiques ---------- */
.graph { width: 100%; height: auto; display: block; overflow: visible; }
.graph .grille { stroke: #E6EEF1; stroke-width: 1; }
.graph .axe { fill: var(--muted); font-size: 11px; }
.graph .trace { fill: none; stroke-width: 2.6; stroke-linejoin: round; stroke-linecap: round; stroke-dasharray: 1; stroke-dashoffset: 1; animation: tracer 1.3s var(--doux) forwards; filter: drop-shadow(0 4px 6px rgba(0, 169, 181, .25)); }
@keyframes tracer { to { stroke-dashoffset: 0; } }
.graph .aire { opacity: 0; animation: apparition .8s .5s forwards; }
.graph .point { opacity: 0; animation: apparition .3s forwards; animation-delay: calc(.6s + var(--d)); stroke: #fff; stroke-width: 1.5; transition: r .2s; }
.graph .point:hover { r: 6; }
.graph .barre { transform-box: fill-box; transform-origin: bottom; transform: scaleY(0); animation: monter .7s var(--ressort) forwards; animation-delay: var(--d); }
@keyframes monter { to { transform: scaleY(1); } }
@keyframes apparition { to { opacity: 1; } }
.graph-vide { padding: 40px; text-align: center; color: var(--muted); font-size: 13px; }
.legende { display: flex; flex-wrap: wrap; gap: 14px; font-size: 12.5px; color: var(--texte-2); margin-top: 8px; }
.legende i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.barres-h { display: flex; flex-direction: column; gap: 9px; }
.bh-ligne { display: grid; grid-template-columns: minmax(110px, 38%) 1fr 62px 52px; gap: 10px; align-items: center; font-size: 13px; animation: entree .45s var(--doux) both; animation-delay: calc(var(--i) * 40ms); border-radius: 8px; padding: 2px 4px; }
.bh-ligne.cliquable { cursor: pointer; }
.bh-ligne.cliquable:hover { background: var(--turquoise-clair); }
.bh-lib { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bh-piste { height: 10px; background: var(--piste); border-radius: 99px; overflow: hidden; }
.bh-barre { display: block; height: 100%; width: var(--w); border-radius: 99px; background: var(--degrade); animation: largeur 1s var(--doux) both; animation-delay: calc(var(--i) * 40ms + .1s); }
.bh-barre.moyen { background: linear-gradient(90deg, #F6C26B, var(--attention)); }
.bh-barre.faible { background: linear-gradient(90deg, #F48A8D, var(--ko)); }
@keyframes largeur { from { width: 0; } }
.bh-val { text-align: right; font-weight: 600; font-variant-numeric: tabular-nums; }
.bh-nc { font-size: 11.5px; color: var(--ko); }
.anneau { display: flex; align-items: center; gap: 22px; flex-wrap: wrap; justify-content: center; }
.anneau .arc { stroke-linecap: butt; opacity: 0; animation: apparition .6s forwards; animation-delay: var(--d); }
.anneau-val { font-size: 22px; font-weight: 700; fill: var(--nuit); }
.anneau-lib { font-size: 11px; fill: var(--muted); }
.anneau-legende { list-style: none; padding: 0; margin: 0; font-size: 13px; display: flex; flex-direction: column; gap: 8px; }
.anneau-legende i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 8px; }
.anneau-legende b { margin-left: 12px; font-variant-numeric: tabular-nums; }

/* ---------- Filtres statistiques ---------- */
.filtres { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; align-items: end; }
.filtres .champ { margin: 0; }
.periodes-rapides { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 12px; }

/* ---------- Plan de COB ---------- */
.plan { position: relative; background: repeating-linear-gradient(90deg, transparent 0 calc(100% / var(--cols) - 1px), #EAF2F4 calc(100% / var(--cols) - 1px) calc(100% / var(--cols))), linear-gradient(#F7FBFC, #F7FBFC); border: 1px dashed #C9DDE3; border-radius: 14px; aspect-ratio: var(--cols) / var(--rows); min-height: 260px; overflow: hidden; }
.place { position: absolute; border-radius: 6px; background: #fff; border: 1.5px solid #CFE0E6; display: flex; flex-direction: column; align-items: center; justify-content: center; font-size: 10.5px; color: var(--muted); transition: transform .25s var(--ressort), box-shadow .25s, border-color .2s; cursor: pointer; overflow: hidden; text-align: center; line-height: 1.1; }
.place:hover { transform: scale(1.06); z-index: 2; box-shadow: var(--ombre); border-color: var(--turquoise); }
.place.occupee { background: linear-gradient(180deg, #fff, var(--turquoise-clair)); border-color: var(--turquoise); color: var(--nuit); font-weight: 700; }
.place.recharge::after { content: '⚡'; position: absolute; top: 2px; right: 3px; font-size: 9px; }
.place.etat-critique { border-color: var(--ko); background: linear-gradient(180deg, #fff, var(--ko-clair)); }
.place.etat-attention { border-color: var(--attention); background: linear-gradient(180deg, #fff, var(--attention-clair)); }
.place.selection { outline: 3px solid var(--turquoise-vif); }
.place small { font-weight: 400; font-size: 9px; color: var(--muted); }

/* ---------- Opérateur : cartes véhicules ---------- */
.vehicules { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.carte-vehicule { cursor: pointer; transition: transform .35s var(--ressort), box-shadow .35s; overflow: hidden; padding: 18px; border: 1px solid #fff; }
@media (hover: hover) { .carte-vehicule:hover { transform: translateY(-3px); box-shadow: var(--ombre); } }
.carte-vehicule:active { transform: scale(.985); }
.carte-vehicule .haut { display: flex; justify-content: space-between; align-items: flex-start; }
.carte-vehicule .num { font-family: var(--police-titre); font-size: 30px; font-weight: 800; color: var(--nuit); letter-spacing: -.02em; }
.carte-vehicule .modele { font-size: 13px; color: var(--texte-2); }
.carte-vehicule .bas { display: flex; justify-content: space-between; align-items: center; margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--ligne); font-size: 13px; }
.carte-vehicule::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 5px; background: var(--na); }
.carte-vehicule.ok::before { background: var(--ok); }
.carte-vehicule.attention::before { background: var(--attention); }
.carte-vehicule.critique::before { background: var(--ko); }
.icone-energie { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; padding: 3px 9px; border-radius: 99px; background: var(--turquoise-clair); color: #007C85; font-weight: 600; }

/* ---------- Contrôle guidé ---------- */
.controle { max-width: 760px; margin: 0 auto; }
.ctl-entete { display: flex; align-items: center; gap: 14px; margin-bottom: 16px; }
.ctl-entete .num { font-size: 22px; font-weight: 800; color: var(--nuit); }
.progression { height: 10px; background: var(--piste); border-radius: 99px; overflow: hidden; margin: 6px 0 22px; position: relative; }
.progression span { display: block; height: 100%; background: var(--degrade); border-radius: 99px; transition: width .5s var(--doux); position: relative; }
.progression span::after { content: ''; position: absolute; inset: 0; background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .55), transparent); animation: brillance 1.8s infinite; }
@keyframes brillance { from { transform: translateX(-100%); } to { transform: translateX(100%); } }
.etape { padding: 28px; animation: etapeIn .45s var(--doux) both; }
.etape.retour { animation-name: etapeRetour; }
@keyframes etapeIn { from { opacity: 0; transform: translateX(40px); } }
@keyframes etapeRetour { from { opacity: 0; transform: translateX(-40px); } }
.etape .rubrique { font-size: 12px; text-transform: uppercase; letter-spacing: .12em; color: var(--turquoise); font-weight: 700; }
.etape h2 { font-size: 26px; margin: 8px 0 10px; line-height: 1.2; }
.etape .consigne { color: var(--texte-2); font-size: 16px; background: var(--turquoise-clair); border-radius: 12px; padding: 12px 14px; margin: 14px 0; }
.choix-etat { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 20px; }
.choix-etat .na { grid-column: span 2; }
.btn-etat { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 22px 12px; border-radius: 16px; border: 2px solid var(--ligne); background: #fff; font-size: 18px; font-weight: 700; cursor: pointer; transition: all .25s var(--ressort); min-height: 110px; justify-content: center; }
.btn-etat .ic { width: 36px; height: 36px; stroke-width: 2.4; }
.btn-etat.c { color: #0E7F54; }
.btn-etat.nc { color: #B4282D; }
.btn-etat.na { color: var(--texte-2); min-height: 56px; flex-direction: row; font-size: 15px; padding: 12px; }
.btn-etat.na .ic { width: 22px; height: 22px; }
.btn-etat:hover { transform: translateY(-3px); }
.btn-etat.c:hover, .btn-etat.c.choisi { border-color: var(--ok); background: var(--ok-clair); box-shadow: 0 10px 26px -10px rgba(24, 182, 121, .6); }
.btn-etat.nc:hover, .btn-etat.nc.choisi { border-color: var(--ko); background: var(--ko-clair); box-shadow: 0 10px 26px -10px rgba(229, 72, 77, .6); }
.btn-etat.na.choisi { border-color: var(--na); background: var(--piste); }
.nav-etapes { display: flex; justify-content: space-between; margin-top: 22px; gap: 10px; }
.saisie-km::-webkit-outer-spin-button, .saisie-km::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.saisie-km { -moz-appearance: textfield; font-size: 34px !important; font-weight: 800; text-align: center; letter-spacing: .04em; padding: 16px !important; }
.recap-points { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 16px; }
.recap-points button { width: 30px; height: 30px; border-radius: 8px; border: 1px solid var(--ligne); background: #fff; font-size: 11px; cursor: pointer; font-weight: 600; color: var(--muted); transition: transform .2s; }
.recap-points button:hover { transform: scale(1.12); }
.recap-points .C { background: var(--ok-clair); border-color: var(--ok); color: #0E7F54; }
.recap-points .NC { background: var(--ko-clair); border-color: var(--ko); color: #B4282D; }
.recap-points .NA { background: var(--piste); }
.recap-points .courant { outline: 2px solid var(--turquoise); outline-offset: 1px; }
.succes { text-align: center; padding: 40px 20px; }
.succes .cercle { width: 96px; height: 96px; border-radius: 50%; background: var(--degrade); display: grid; place-items: center; margin: 0 auto 18px; animation: pop .6s var(--ressort); box-shadow: 0 16px 40px -12px rgba(0, 169, 181, .8); }
.succes .cercle .ic { width: 48px; height: 48px; color: #fff; stroke-width: 2.6; stroke-dasharray: 30; stroke-dashoffset: 30; animation: tracer2 .6s .35s forwards; }
@keyframes tracer2 { to { stroke-dashoffset: 0; } }
@keyframes pop { from { transform: scale(.3); opacity: 0; } }

/* ---------- Connexion ---------- */
.connexion { min-height: 100vh; display: grid; place-items: center; padding: 20px; }
.connexion .boite { width: min(460px, 100%); text-align: center; padding: 38px 34px; }
.connexion .logo { width: 64px; height: 64px; border-radius: 18px; margin: 0 auto 16px; }
.connexion .logo .ic { width: 34px; height: 34px; }
.connexion h1 { font-size: 26px; }
.btn-microsoft { width: 100%; padding: 13px; margin-top: 22px; font-size: 15px; background: #fff; color: var(--texte); border: 1px solid var(--ligne); box-shadow: var(--ombre); }
.btn-microsoft:hover { border-color: var(--turquoise); }
.ms-logo { display: grid; grid-template-columns: 9px 9px; gap: 2px; }
.ms-logo i { width: 9px; height: 9px; display: block; }
.profils-demo { display: flex; flex-direction: column; gap: 8px; margin-top: 18px; text-align: left; }
.profil-demo { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--ligne); background: #fff; cursor: pointer; transition: all .25s var(--ressort); }
.profil-demo:hover { border-color: var(--turquoise); transform: translateX(4px); box-shadow: var(--ombre); }
.profil-demo .avatar { width: 34px; height: 34px; flex: none; }
.profil-demo span:not(.avatar) { flex: 1; text-align: left; }
.profil-demo small { display: block; color: var(--muted); }

.chargement { display: grid; place-items: center; min-height: 60vh; }
.anneau-chargement { width: 46px; height: 46px; border-radius: 50%; border: 4px solid var(--piste); border-top-color: var(--turquoise); animation: tourne .8s linear infinite; }
@keyframes tourne { to { transform: rotate(1turn); } }
.vide-etat { text-align: center; padding: 50px 20px; color: var(--muted); }
.vide-etat .ic { width: 44px; height: 44px; color: var(--turquoise); margin-bottom: 10px; }
.alerte-bandeau { display: flex; gap: 12px; align-items: flex-start; padding: 12px 16px; border-radius: 12px; background: var(--attention-clair); color: #7A4A06; border: 1px solid #F8D9A6; margin-bottom: 16px; font-size: 14px; }
.alerte-bandeau.info { background: var(--turquoise-clair); color: #075E66; border-color: #B5E8EC; }
.liste-nc { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 8px; }
.liste-nc li { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border-radius: 10px; background: var(--ko-clair); font-size: 14px; }
.liste-nc li.critique { border-left: 4px solid var(--ko); }
.liste-nc li .ic { color: var(--ko); }
.arbre-cat { display: flex; flex-direction: column; gap: 4px; }
.arbre-cat .sous { margin-left: 22px; }
.code { font-family: ui-monospace, Consolas, monospace; font-size: 12.5px; background: var(--piste); padding: 1px 6px; border-radius: 5px; }

/* ---------- Responsive ---------- */
@media (max-width: 1100px) { .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .g3, .g-23 { grid-template-columns: 1fr; } .span2 { grid-column: auto; } }
@media (max-width: 860px) {
  .app { grid-template-columns: 1fr; }
  .lateral { position: fixed; z-index: 40; left: 0; width: 280px; transform: translateX(-100%); transition: transform .35s var(--doux); }
  .app.menu-ouvert .lateral { transform: none; box-shadow: var(--ombre-forte); }
  .barre-mobile { display: flex; align-items: center; justify-content: space-between; padding: 12px 16px; background: var(--nuit); color: #fff; position: sticky; top: 0; z-index: 30; }
  .barre-mobile b { font-size: 16px; }
  .barre-mobile button { background: none; border: 0; color: #fff; cursor: pointer; }
  .principal { padding: 18px 14px 80px; }
  .g2 { grid-template-columns: 1fr; }
  .entete-page h1 { font-size: 23px; }
  .etape { padding: 20px; }
  .etape h2 { font-size: 22px; }
}
@media (max-width: 520px) { .g4 { grid-template-columns: 1fr 1fr; } .kpi .val { font-size: 24px; } }

/* ---------- Relevé kilométrique de fin de mois ---------- */
.rk-bandeau { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; padding: 16px 20px; margin-bottom: 18px; }
.rk-nav { display: flex; gap: 6px; }
.rk-nav .btn[disabled] { opacity: .35; pointer-events: none; }
.rk-mois { font-family: var(--police-titre); font-size: 22px; font-weight: 700; color: var(--nuit); text-transform: capitalize; letter-spacing: -.01em; }
.rk-echeance { margin-left: auto; }
.rk-outils { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; padding: 14px 18px; border-bottom: 1px solid var(--ligne); }
.rk-outils .onglets { margin: 0; }
.rk-outils .champ-recherche { margin-left: auto; }
.rk-prog-bloc { display: flex; align-items: center; gap: 10px; min-width: 190px; }
.rk-prog { flex: 1; height: 9px; border-radius: 99px; background: var(--piste); overflow: hidden; }
.rk-prog > i { display: block; height: 100%; width: 0; border-radius: 99px; background: var(--degrade); transition: width .5s var(--doux); }
.rk-prog.complet > i { background: var(--ok); }
.rk-prog-bloc span { font-weight: 700; font-size: 13px; font-variant-numeric: tabular-nums; }
.rk-scroll { overflow-x: auto; }
.rk-table { width: 100%; border-collapse: separate; border-spacing: 0; }
.rk-table th { font-size: 12.5px; font-weight: 600; color: var(--texte-2); text-align: left; padding: 11px 16px; background: #F7FBFC; border-bottom: 1px solid var(--ligne); white-space: nowrap; }
.rk-table td { padding: 12px 16px; border-bottom: 1px solid var(--ligne); vertical-align: middle; }
.rk-table tbody tr:last-child td { border-bottom: 0; }
.rk-table tbody tr:hover td { background: #F6FCFC; }
.rk-table tr.fait td { background: #F5FBF8; }
.rk-num b { font-size: 16px; color: var(--nuit); font-variant-numeric: tabular-nums; }
.rk-immat { font-weight: 600; letter-spacing: .02em; }
.rk-sm { font-size: 12px; }
.rk-prec { font-variant-numeric: tabular-nums; white-space: nowrap; }
.rk-champ { display: flex; align-items: center; gap: 6px; background: #fff; border: 1.5px solid var(--ligne); border-radius: 11px; padding: 0 12px; width: 190px; transition: border-color .2s, box-shadow .2s; }
.rk-champ:focus-within { border-color: var(--turquoise); box-shadow: 0 0 0 4px rgba(0, 169, 181, .15); }
.rk-champ.err { border-color: var(--ko); box-shadow: 0 0 0 4px rgba(229, 72, 77, .12); }
.rk-champ input { border: 0 !important; box-shadow: none !important; outline: 0; background: transparent !important; padding: 10px 0 !important; font-size: 16px; font-weight: 600; width: 100%; font-variant-numeric: tabular-nums; }
.rk-champ span { color: var(--muted); font-size: 13px; }
.rk-erreur { color: var(--ko); font-size: 12px; margin-top: 4px; min-height: 0; }
.rk-val { font-size: 17px; color: var(--nuit); font-variant-numeric: tabular-nums; }
.rk-delta { font-weight: 600; color: var(--texte-2); font-variant-numeric: tabular-nums; white-space: nowrap; }
.rk-act { white-space: nowrap; text-align: right; }
.rk-cpt { margin-left: 7px; font-size: 11.5px; padding: 1px 8px; border-radius: 99px; background: var(--piste); color: var(--texte-2); font-variant-numeric: tabular-nums; }
.rk-cpt.ok { background: var(--ok-clair); color: #0E7F54; }
.onglet.actif .rk-cpt { background: rgba(255, 255, 255, .25); color: #fff; }
.rk-mini { display: flex; align-items: center; gap: 8px; }
.rk-mini .rk-prog { flex: none; width: 56px; }
.rk-histo th, .rk-histo td { padding-left: 12px; padding-right: 12px; }
.rk-histo td:first-child { white-space: nowrap; }
.rk-mini span { font-size: 13px; font-variant-numeric: tabular-nums; color: var(--texte-2); white-space: nowrap; }
.rk-clic { cursor: pointer; }
@media (max-width: 760px) {
  .rk-prec, .rk-ecart { display: none; }
  .rk-champ { width: 150px; }
  .rk-outils .champ-recherche { margin-left: 0; width: 100%; }
  .rk-echeance { margin-left: 0; }
}

/* ---------- Page d'identification ---------- */
input[type=password] { width: 100%; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--ligne); background: #fff; font: inherit; color: var(--texte); transition: border-color .2s, box-shadow .2s; }
.connexion[hidden], #racine[hidden] { display: none; }
.cx-boite { padding-bottom: 28px; }
.cx-form { text-align: left; margin-top: 24px; }
.cx-form .champ input { font-size: 16px; padding: 12px 14px; }   /* 16 px : pas de zoom automatique sur iPhone */
.cx-mdp { position: relative; display: block; }
.cx-mdp input { padding-right: 84px !important; }
.cx-voir { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); border: 0; background: none; color: var(--turq-encre); font-weight: 600; font-size: 13px; padding: 8px 10px; cursor: pointer; border-radius: 8px; }
.cx-voir:hover { background: var(--turquoise-clair); }
.cx-valider { width: 100%; padding: 13px; font-size: 15px; justify-content: center; margin-top: 4px; }
.cx-valider + .cx-valider { margin-top: 10px; }
.cx-erreur { background: #FDECEC; color: #A61B1F; border: 1px solid #F6C9CA; border-radius: 10px; padding: 10px 12px; font-size: 13.5px; margin-bottom: 12px; text-align: left; }
.cx-erreur[hidden], .champ[hidden], [data-bloc-mdp][hidden] { display: none; }
.cx-sep { display: flex; align-items: center; gap: 12px; margin: 22px 0 0; color: var(--muted); font-size: 12.5px; }
.cx-sep::before, .cx-sep::after { content: ''; flex: 1; height: 1px; background: var(--ligne); }
.cx-boite .btn-microsoft { margin-top: 14px; justify-content: center; }
.cx-aide { list-style: none; padding: 0; margin: 20px 0 0; text-align: left; font-size: 12.5px; color: var(--muted); display: grid; gap: 6px; }
.cx-aide li { padding-left: 14px; position: relative; }
.cx-aide li::before { content: ''; position: absolute; left: 0; top: 7px; width: 5px; height: 5px; border-radius: 50%; background: var(--turquoise); }
.cx-demo { margin-top: 22px; text-align: left; }
.cx-demo .profils-demo { max-height: 340px; overflow-y: auto; }
@media (max-width: 520px) { .connexion .boite.cx-boite { padding: 28px 20px; } }

/* =====================================================================
   v1.0.0 — écran de chargement, compteurs, bienvenue, tutoriel,
   administration des droits, système, connexion
   ===================================================================== */
.colonne { min-width: 0; display: flex; flex-direction: column; }
.versions { font-size: 11px; color: rgba(255, 255, 255, .5); padding: 10px 12px 0; }
.lateral nav { display: flex; flex-direction: column; gap: 2px; overflow-y: auto; }

/* Écran de chargement : fond « nuit », la barre de progression est une ligne de bus
   dont les arrêts s'allument à mesure que les données arrivent. */
.ecran-chargement { position: fixed; inset: 0; z-index: 200; display: grid; place-content: center; justify-items: center; gap: 16px; padding: 24px; color: #fff; text-align: center;
  background: radial-gradient(90% 60% at 50% 0%, #165A82 0%, transparent 70%), linear-gradient(180deg, #0B3C5D 0%, #082C45 100%); transition: opacity .45s ease, visibility .45s, transform .45s var(--doux); }
.ecran-chargement::before { content: ''; position: absolute; inset: 0; pointer-events: none; opacity: .5;
  background-image: linear-gradient(rgba(0, 198, 210, .07) 1px, transparent 1px), linear-gradient(90deg, rgba(0, 198, 210, .07) 1px, transparent 1px); background-size: 44px 44px;
  -webkit-mask-image: radial-gradient(ellipse at 50% 40%, #000 0%, transparent 60%); mask-image: radial-gradient(ellipse at 50% 40%, #000 0%, transparent 60%); }
.ecran-chargement.fini { opacity: 0; visibility: hidden; transform: scale(1.015); }
.ecran-chargement > * { position: relative; }
.ec-logo img { display: block; width: 72px; height: 72px; border-radius: 20px; box-shadow: 0 0 0 1px rgba(255, 255, 255, .14), 0 18px 44px -12px rgba(0, 198, 210, .65); animation: ecFlotte 2.4s ease-in-out infinite; }
@keyframes ecFlotte { 50% { transform: translateY(-3px); } }
.ec-titre { font-family: var(--police-titre); font-size: 28px; font-weight: 700; color: #fff; letter-spacing: .005em; margin-top: 4px; }
.ec-etape { color: #9CC3D3; font-size: 14px; min-height: 20px; order: 4; }
.ec-barre { order: 3; position: relative; width: min(300px, 74vw); height: 4px; margin: 14px 0 6px; border-radius: 99px; background: rgba(255, 255, 255, .14); }
/* arrêts de la ligne (décor) */
.ec-barre::after { content: ''; position: absolute; left: 0; right: 0; top: 50%; height: 10px; transform: translateY(-50%); pointer-events: none;
  background: radial-gradient(circle, #0B3C5D 0 2.5px, rgba(255, 255, 255, .55) 2.6px 4.4px, transparent 4.6px) 0 0 / 25% 100% repeat-x; z-index: 2; }
.ec-barre i { display: block; position: relative; height: 100%; width: 5%; border-radius: 99px; background: linear-gradient(90deg, #00A9B5, #00C6D2); box-shadow: 0 0 14px rgba(0, 198, 210, .55); transition: width .5s var(--doux); }
/* le « bus » en tête de ligne */
.ec-barre i::after { content: ''; position: absolute; right: -8px; top: 50%; width: 16px; height: 16px; margin-top: -8px; border-radius: 50%; background: #fff; box-shadow: 0 0 0 4px rgba(0, 198, 210, .35), 0 0 18px rgba(0, 198, 210, .8); z-index: 3; }

/* Squelettes pendant le chargement d'un écran : reprennent la forme de la page
   (en-tête, rangée d'indicateurs, deux blocs) et n'apparaissent qu'après un court délai
   pour éviter un clignotement quand l'écran est prêt tout de suite. */
.squelette { display: grid; gap: 18px; padding-top: 4px; animation: sqApparait .3s ease .12s both; }
@keyframes sqApparait { from { opacity: 0; } }
.squelette i, .sq-carte::before, .sq-carte::after { display: block; border-radius: 8px; background: linear-gradient(100deg, #E3EDF0 30%, #F3F8F9 50%, #E3EDF0 70%) fixed; background-size: 200vw 100%; animation: sqBrille 1.4s linear infinite; }
.sq-entete { display: grid; gap: 10px; margin-bottom: 4px; }
.squelette i.sq-fil { height: 12px; width: 140px; }
.squelette i.sq-titre { height: 30px; width: min(340px, 70%); border-radius: 10px; }
.sq-ligne { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 18px; }
.squelette .sq-carte { position: relative; height: 112px; border-radius: var(--rayon); background: #fff; border: 1px solid rgba(208, 225, 231, .75); box-shadow: var(--ombre-douce); animation: none; }
.sq-carte::before, .sq-carte::after { content: ''; position: absolute; left: 20px; }
.sq-carte::before { top: 20px; height: 11px; width: 52%; }
.sq-carte::after { top: 48px; height: 28px; width: 34%; }
.sq-duo { display: grid; grid-template-columns: 2fr 1fr; gap: 18px; }
.squelette .sq-bloc { height: 280px; border-radius: var(--rayon); background: #fff; border: 1px solid rgba(208, 225, 231, .75); box-shadow: var(--ombre-douce); animation: none; position: relative; overflow: hidden; }
.sq-bloc::before { content: ''; position: absolute; left: 20px; right: 20px; bottom: 24px; height: 55%; border-radius: 8px;
  background: linear-gradient(100deg, rgba(227, 237, 240, .8) 30%, rgba(243, 248, 249, .8) 50%, rgba(227, 237, 240, .8) 70%) fixed; background-size: 200vw 100%; animation: sqBrille 1.4s linear infinite;
  -webkit-mask-image: linear-gradient(0deg, #000 60%, transparent); mask-image: linear-gradient(0deg, #000 60%, transparent); }
@keyframes sqBrille { from { background-position: 200vw 0; } to { background-position: 0 0; } }

/* Bandeau de compteurs : une seule réglette, segments séparés par un filet */
.compteurs { display: flex; margin: 20px 34px 0; background: #fff; border: 1px solid rgba(208, 225, 231, .75); border-radius: 14px; box-shadow: var(--ombre-douce); overflow-x: auto; scrollbar-width: none; animation: entree .45s var(--doux) both; }
.compteurs::-webkit-scrollbar { display: none; }
.compteurs[hidden] { display: none; }
.cpt { flex: 1 1 auto; min-width: 0; display: flex; gap: 11px; align-items: center; padding: 12px 16px; border-left: 1px solid var(--ligne); }
.cpt:first-child { border-left: 0; }
.cpt-ic { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: var(--turquoise-clair); color: var(--turq-encre); flex: none; }
.cpt-ic .ic { width: 18px; height: 18px; }
.cpt > div { min-width: 0; }
.cpt-val { font-family: var(--police-titre); font-size: 21px; font-weight: 700; color: var(--nuit); font-variant-numeric: tabular-nums; line-height: 1.1; }
.cpt-val small { font-size: 13px; color: var(--muted); font-weight: 600; }
.cpt-lib { font-size: 12.5px; color: var(--texte-2); line-height: 1.3; }
.cpt-lib span { color: var(--muted); }
.cpt.ok .cpt-ic { background: var(--ok-clair); color: #0E7F54; }
.cpt.attention .cpt-ic { background: var(--attention-clair); color: #8A5A06; }
.cpt.attention .cpt-lib span { color: #8A5A06; font-weight: 600; }
.cpt.ko .cpt-ic { background: #FDECEC; color: #A61B1F; }
.cpt.ko .cpt-val { color: #B4282D; }

/* Transition entre écrans : la vue sortante s'efface, la nouvelle monte doucement */
.principal.chargement-vue { min-height: 60vh; }
.principal > .vue { animation: entree .38s var(--doux) both; }
.principal > .vue.vue-sortie { opacity: 0; transform: translateY(-6px); transition: opacity .14s ease, transform .14s ease; animation: none; }
.app { animation: appApparait .5s ease both; }
@keyframes appApparait { from { opacity: 0; } }

/* Menu mobile : voile derrière le panneau (un toucher sur le voile referme le menu) */
.app::after { content: ''; position: fixed; inset: 0; z-index: 35; background: rgba(8, 30, 46, .45); opacity: 0; pointer-events: none; transition: opacity .3s ease; }
@media (min-width: 861px) { .app::after { display: none; } }
.app.menu-ouvert::after { opacity: 1; pointer-events: auto; }

/* Bouton de fermeture (tutoriel) */
.modale-fermer { width: 36px; height: 36px; flex: none; display: grid; place-items: center; border-radius: 50%; border: 1px solid var(--ligne); background: #fff; color: var(--texte-2); font-size: 22px; line-height: 1; cursor: pointer; transition: color .2s, border-color .2s, background .2s; }
.modale-fermer:hover { color: var(--nuit); border-color: var(--turquoise); background: var(--turquoise-clair); }

/* Bienvenue et tutoriel */
.bv-fond { position: fixed; inset: 0; z-index: 150; display: grid; place-items: center; padding: 16px; background: rgba(8, 30, 46, .42); backdrop-filter: blur(6px); opacity: 0; transition: opacity .26s ease; }
.bv-fond.ouvert { opacity: 1; }
.bv-fond.sortie { opacity: 0; }
.bv-carte { position: relative; width: min(520px, 100%); max-height: 92vh; overflow-y: auto; background: #fff; border-radius: 22px; padding: 30px 26px 24px; box-shadow: 0 40px 80px -30px rgba(8, 30, 46, .5); transform: translateY(14px) scale(.98); transition: transform .34s var(--doux); }
/* filet « ligne de bus » en tête de carte */
.bv-carte::before { content: ''; position: absolute; left: 26px; right: 26px; top: 14px; height: 8px; pointer-events: none;
  background: radial-gradient(circle, #fff 0 1.6px, var(--turquoise) 1.8px 3.6px, transparent 3.8px) 0 0 / 20% 100% repeat-x, linear-gradient(var(--turquoise-clair), var(--turquoise-clair)) 0 50% / 100% 2px no-repeat; }
.bv-fond.ouvert .bv-carte { transform: none; }
.bv-fond.sortie .bv-carte { transform: translateY(8px) scale(.985); }
.bv-entete { display: flex; gap: 14px; align-items: center; margin-top: 8px; }
.bv-avatar { width: 52px; height: 52px; font-size: 18px; }
.bv-entete h2 { margin: 0; font-size: 25px; }
.bv-entete p { margin: 2px 0 0; color: var(--muted); font-size: 13.5px; }
.bv-texte { margin: 18px 0 8px; color: var(--texte-2); text-wrap: pretty; }
.bv-liste { list-style: none; padding: 0; margin: 0 0 20px; display: grid; gap: 0; border-top: 1px solid var(--ligne); }
.bv-liste li { display: flex; gap: 12px; align-items: center; padding: 9px 2px; border-bottom: 1px solid var(--ligne); animation: entree .35s var(--doux) both; animation-delay: calc(var(--i) * 40ms); }
.bv-liste li .ic { color: var(--turq-encre); width: 30px; height: 30px; padding: 6px; border-radius: 9px; background: var(--turquoise-clair); }
.bv-liste li.muted { padding-left: 44px; font-size: 13.5px; }
.bv-liste em { margin-left: auto; font-style: normal; font-size: 11px; font-weight: 700; color: #fff; background: var(--turq-encre); padding: 2px 8px; border-radius: 99px; }
.bv-actions { display: flex; justify-content: flex-end; gap: 10px; flex-wrap: wrap; }
.tuto-carte { text-align: center; }
.tuto-haut { display: flex; justify-content: space-between; align-items: center; font-size: 13px; }
.tuto-corps { padding: 18px 6px 8px; animation: etapeIn .35s var(--doux) both; }
.tuto-corps[style*="--sens:-1"] { animation-name: etapeRetour; }
.tuto-carte::before { display: none; }
.tuto-ic { width: 76px; height: 76px; margin: 0 auto 14px; border-radius: 22px; display: grid; place-items: center; background: var(--degrade-btn); color: #fff; box-shadow: 0 16px 32px -14px rgba(0, 169, 181, .7); }
.tuto-ic .ic { width: 36px; height: 36px; }
.tuto-ic.petit { width: 46px; height: 46px; border-radius: 14px; margin: 0 0 10px; }
.tuto-ic.petit .ic { width: 22px; height: 22px; }
.tuto-corps h2 { font-size: 21px; margin: 0 0 8px; }
.tuto-corps p { color: var(--texte-2); margin: 0 0 14px; }
/* progression du tutoriel : arrêts d'une ligne, ceux déjà vus sont remplis */
.tuto-points { display: flex; justify-content: center; align-items: center; gap: 9px; margin: 14px auto 20px; max-width: 100%; overflow: hidden; padding: 4px 0; }
.tuto-points i { position: relative; flex: none; width: 9px; height: 9px; border-radius: 50%; background: #fff; border: 2px solid #C9DCE2; transition: background .25s, border-color .25s, transform .25s var(--doux); }
.tuto-points i:not(:last-child)::after { content: ''; position: absolute; left: 100%; top: 50%; width: 9px; height: 2px; margin: -1px 0 0 2px; background: #C9DCE2; }
.tuto-points i:has(~ i.actif) { background: var(--turquoise); border-color: var(--turquoise); }
.tuto-points i:has(~ i.actif)::after { background: var(--turquoise); }
.tuto-points i.actif { width: 15px; height: 15px; background: #fff; border-color: var(--turq-encre); border-width: 4px; box-shadow: 0 0 0 4px rgba(0, 169, 181, .16); }
.tuto-haut .muted { font-weight: 600; }
.aide-carte h3 { margin: 0 0 6px; }

/* Formulaires d'administration */
.form-section { padding: 4px 0 8px; border-bottom: 1px solid var(--ligne); margin-bottom: 14px; }
.form-section:last-child { border-bottom: 0; }
.form-section[hidden] { display: none; }
.form-section h4 { display: flex; align-items: center; gap: 8px; margin: 6px 0 12px; font-size: 14px; color: var(--nuit); }
.form-section h4 .ic { color: var(--turquoise); width: 17px; height: 17px; }
.droits-table { display: grid; gap: 6px; }
.droits-module { font-size: 13px; font-weight: 700; color: var(--nuit); margin-top: 10px; }
.droit-ligne { display: grid; grid-template-columns: 1fr auto auto; gap: 12px; align-items: center; padding: 10px 12px; border: 1px solid var(--ligne); border-radius: 12px; transition: background .2s, border-color .2s; }
.droit-ligne.actif { background: #F3FBFB; border-color: #BFE9EC; }
.droit-ligne small { display: block; color: var(--muted); font-size: 12px; font-weight: 400; margin-top: 2px; }
.droit-ligne.case-ligne { grid-template-columns: auto 1fr; cursor: pointer; }
.segment { display: inline-flex; border: 1px solid var(--ligne); border-radius: 10px; overflow: hidden; }
.segment label { cursor: pointer; }
.segment input { position: absolute; opacity: 0; pointer-events: none; }
.segment span { display: block; padding: 6px 10px; font-size: 12.5px; font-weight: 600; color: var(--texte-2); white-space: nowrap; }
.segment input:checked + span { background: var(--turq-encre); color: #fff; }
.segment input:focus-visible + span { outline: 2px solid var(--turquoise); outline-offset: -2px; }
.matrice-droits th span { display: inline-block; writing-mode: vertical-rl; transform: rotate(180deg); white-space: nowrap; font-size: 12px; max-height: 170px; }
.matrice-droits tbody tr { cursor: pointer; }
.identifiants { padding: 14px 18px; margin: 12px 0; font-size: 15px; display: grid; gap: 6px; }
.groupe-carte .puces-lecture { display: flex; flex-wrap: wrap; gap: 6px; }

/* Système */
.titre-section { display: flex; align-items: center; gap: 8px; font-size: 18px; margin: 26px 0 12px; color: var(--nuit); }
.titre-section .ic { color: var(--turquoise); }
.jauge .lib { display: flex; gap: 8px; align-items: center; color: var(--texte-2); font-weight: 600; font-size: 13px; }
.jauge-val { font-family: var(--police-titre); font-size: 26px; font-weight: 800; color: var(--nuit); margin: 6px 0 8px; font-variant-numeric: tabular-nums; }
.jauge-val small { font-size: 13px; color: var(--muted); font-weight: 600; }
.jauge-barre { height: 8px; border-radius: 99px; background: var(--piste); overflow: hidden; }
.jauge-barre i { display: block; height: 100%; border-radius: 99px; background: var(--ok); animation: largeur .8s var(--doux) both; }
.jauge.attention .jauge-barre i { background: var(--attention); }
.jauge.ko .jauge-barre i { background: var(--ko); }
.jauge-pct { font-size: 12px; color: var(--muted); margin-top: 6px; }
.usage-grille { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; margin-bottom: 14px; }
.usage-grille div { padding: 10px 12px; border-radius: 12px; background: #F6FAFB; }
.usage-grille b { display: block; font-size: 20px; color: var(--nuit); font-variant-numeric: tabular-nums; }
.usage-grille span { font-size: 12.5px; color: var(--muted); }

/* Photos */
.zone-photo { display: grid; gap: 10px; margin: 4px 0 12px; }
.zone-photo img { max-width: 100%; max-height: 220px; border-radius: 12px; object-fit: cover; }
.zone-photo.envoi { opacity: .6; pointer-events: none; }
a.miniature { display: inline-block; margin-left: 8px; vertical-align: middle; }
a.miniature img { width: 54px; height: 54px; object-fit: cover; border-radius: 8px; }

/* Connexion */
.cx-boite { transition: transform .26s ease, opacity .26s ease; }
.cx-boite.sortie { opacity: 0; transform: translateY(-10px) scale(.98); }
.cx-boite.secousse { animation: secousse .45s; }
@keyframes secousse { 20%, 60% { transform: translateX(-8px); } 40%, 80% { transform: translateX(8px); } }
.cx-force { height: 5px; border-radius: 99px; background: var(--piste); overflow: hidden; margin: -6px 0 12px; }
.cx-force i { display: block; height: 100%; width: 0; background: var(--ko); transition: width .3s, background .3s; }
.cx-force[data-niveau="2"] i { background: var(--attention); }
.cx-force[data-niveau="3"] i, .cx-force[data-niveau="4"] i { background: var(--ok); }
.cx-valider.en-cours { opacity: .8; }
.cx-ios { font-size: 12.5px; margin-top: 12px; }
.cx-version { font-size: 11.5px; color: var(--muted); margin: 14px 0 0; }
.cx-form[hidden] { display: none; }

.cx-version { text-align: center; }
.cx-installer { display: flex; margin: 14px auto 0; }

/* Page de connexion : panneau « ligne » (gauche) + formulaire (droite) */
.cx-page { display: grid; grid-template-columns: minmax(400px, 46%) 1fr; place-items: stretch; min-height: 100vh; min-height: 100dvh; padding: 0; }
.cx-intro { position: relative; overflow: hidden; display: flex; flex-direction: column; padding: 40px clamp(32px, 5vw, 76px) 48px; color: #CFE6EE;
  background: radial-gradient(70% 50% at 0% 100%, rgba(0, 198, 210, .18), transparent 70%), linear-gradient(170deg, #0F4A70 0%, #0B3C5D 45%, #082C45 100%); }
.cx-intro::before { content: ''; position: absolute; inset: 0; pointer-events: none; background-image: linear-gradient(rgba(0, 198, 210, .06) 1px, transparent 1px), linear-gradient(90deg, rgba(0, 198, 210, .06) 1px, transparent 1px); background-size: 44px 44px;
  -webkit-mask-image: linear-gradient(160deg, #000 10%, transparent 75%); mask-image: linear-gradient(160deg, #000 10%, transparent 75%); }
.cx-intro > * { position: relative; }
.cx-marque { display: flex; align-items: center; gap: 12px; font-family: var(--police-titre); font-size: 21px; font-weight: 700; color: #fff; letter-spacing: .01em; }
.cx-marque img { width: 40px; height: 40px; border-radius: 12px; box-shadow: 0 0 0 1px rgba(255, 255, 255, .15), 0 10px 24px -10px rgba(0, 198, 210, .8); }
.cx-intro-corps { margin: auto 0; padding: 40px 0 8px; display: grid; gap: 18px; }
.cx-accroche { color: #fff; font-size: clamp(34px, 3.5vw, 48px); line-height: 1.06; letter-spacing: -.015em; max-width: 13ch; text-wrap: balance; }
.cx-sous { margin: 0; color: #9CC3D3; font-size: 16.5px; line-height: 1.55; max-width: 40ch; }
.cx-ligne { list-style: none; margin: 14px 0 0; padding: 0; counter-reset: arret; }
.cx-ligne li { position: relative; padding: 0 0 20px 44px; counter-increment: arret; }
.cx-ligne li::before { content: counter(arret); position: absolute; left: 0; top: -2px; width: 28px; height: 28px; box-sizing: border-box; border-radius: 50%; background: #0B3C5D; border: 2.5px solid var(--turquoise-vif); color: #fff;
  font: 700 12.5px/23px var(--police-titre); text-align: center; z-index: 1; animation: cxArret .5s var(--ressort) both; animation-delay: calc(.25s + var(--n, 0) * .14s); }
.cx-ligne li::after { content: ''; position: absolute; left: 13px; top: 26px; bottom: 0; width: 2px; background: linear-gradient(var(--turquoise-vif), rgba(0, 198, 210, .3)); transform-origin: top; animation: cxTrait .4s ease both; animation-delay: calc(.4s + var(--n, 0) * .14s); }
.cx-ligne li:last-child { padding-bottom: 0; }
.cx-ligne li:last-child::after { display: none; }
.cx-ligne li:nth-child(2) { --n: 1; } .cx-ligne li:nth-child(3) { --n: 2; } .cx-ligne li:nth-child(4) { --n: 3; }
.cx-ligne b { display: block; color: #fff; font-size: 15.5px; font-weight: 600; }
.cx-ligne span { display: block; color: #8FB7C7; font-size: 13.5px; margin-top: 1px; }
@keyframes cxArret { from { transform: scale(.4); opacity: 0; } }
@keyframes cxTrait { from { transform: scaleY(0); } }
.cx-zone { display: grid; place-items: center; padding: 40px 24px; min-width: 0; }
.cx-page .cx-boite { width: min(420px, 100%); text-align: left; padding: 34px 32px 24px; box-shadow: 0 1px 2px rgba(11, 60, 93, .05), 0 24px 60px -24px rgba(11, 60, 93, .28); }
.cx-page .cx-boite h1 { font-size: 30px; }
.cx-consigne { margin: 6px 0 0; font-size: 14px; }
.cx-page .cx-form { margin-top: 22px; }
.cx-page .cx-aide { margin-top: 18px; gap: 8px; }
.cx-page .cx-aide li { display: flex; gap: 8px; align-items: flex-start; padding-left: 0; }
.cx-page .cx-aide li::before { display: none; }
.cx-page .cx-aide .ic { width: 16px; height: 16px; margin-top: 1px; color: var(--turq-encre); }

/* Feuilles du bas sur téléphone : modales, bienvenue et tutoriel glissent depuis le bas */
@media (max-width: 600px) {
  .modale-fond, .bv-fond { place-items: end center; padding: 0; }
  .modale, .modale.large, .bv-carte { width: 100%; max-height: 92vh; max-height: 92dvh; border-radius: 22px 22px 0 0; transform: translateY(48px); padding-bottom: env(safe-area-inset-bottom); }
  .bv-carte { padding: 28px 20px calc(20px + env(safe-area-inset-bottom)); }
  .bv-carte::before { left: 20px; right: 20px; }
  .modale footer { padding-bottom: calc(14px + env(safe-area-inset-bottom)); }
  .modale-fond:not(.ouvert) .modale { transform: translateY(48px); }
  .bv-fond.sortie .bv-carte { transform: translateY(48px); }
  .bv-actions { flex-wrap: nowrap; }
  .bv-actions .btn { flex: 1; padding-left: 10px; padding-right: 10px; }
  .bv-entete h2 { font-size: 22px; }
  .bv-liste li { padding: 7px 2px; }
}

@media (max-width: 900px) {
  .droit-ligne { grid-template-columns: 1fr; }
}
@media (max-width: 860px) {
  /* bandeau de compteurs : une réglette compacte qui défile horizontalement */
  .compteurs { margin: 0; border-radius: 0; border-width: 0 0 1px; box-shadow: none; scroll-snap-type: x proximity; padding: 0 6px;
    -webkit-mask-image: linear-gradient(90deg, #000 calc(100% - 28px), transparent); mask-image: linear-gradient(90deg, #000 calc(100% - 28px), transparent); }
  .cpt { flex: 0 0 auto; min-width: 136px; max-width: 220px; padding: 9px 12px; gap: 9px; scroll-snap-align: start; }
  .cpt:last-child { margin-right: 22px; }
  .cpt-ic { width: 28px; height: 28px; border-radius: 8px; }
  .cpt-ic .ic { width: 16px; height: 16px; }
  .cpt-val { font-size: 18px; }
  .cpt-lib { font-size: 12px; white-space: nowrap; }
  .lateral { padding-top: calc(20px + env(safe-area-inset-top)); }
  .barre-mobile { padding-top: calc(12px + env(safe-area-inset-top)); }
  .barre-mobile button { width: 40px; height: 40px; margin: -8px; display: grid; place-items: center; border-radius: 10px; }
  .barre-mobile b { font-family: var(--police-titre); font-size: 18px; }
  .squelette .sq-ligne { grid-template-columns: 1fr 1fr; gap: 12px; }
  .squelette .sq-carte { height: 96px; }
  .sq-duo { grid-template-columns: 1fr; }
  .sq-duo .sq-bloc:last-child { display: none; }
  .entete-page { margin-bottom: 18px; }
  .entete-page h1 { font-size: 25px; }

  /* connexion : bandeau « nuit » compact en haut, formulaire qui le chevauche */
  .cx-page { display: block; }
  .cx-intro { padding: calc(22px + env(safe-area-inset-top)) 20px 70px; }
  .cx-marque { font-size: 19px; }
  .cx-marque img { width: 34px; height: 34px; border-radius: 10px; }
  .cx-intro-corps { padding: 18px 0 0; gap: 0; }
  .cx-accroche { font-size: 25px; max-width: 18ch; }
  .cx-sous, .cx-ligne { display: none; }
  .cx-zone { margin-top: -48px; padding: 0 14px 28px; place-items: start center; }
  .cx-page .cx-boite { padding: 26px 20px 22px; }
  .cx-page .cx-boite h1 { font-size: 26px; }
}
@media (max-width: 860px) and (prefers-reduced-motion: no-preference) {
  .app.menu-ouvert .lateral nav { animation: entree .35s var(--doux) .05s both; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-delay: 0s !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
  .ec-barre i::after { box-shadow: none; }
}
