/* Espace Livraisons — reprend la charte de l'intranet (/style.css), pensé d'abord pour le téléphone. */

/* ---------- connexion ---------- */
.lv-auth { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px 16px; background: var(--marine) linear-gradient(160deg, var(--marine) 0 60%, var(--marine-fonce) 60%); }
.lv-auth-carte { width: 100%; max-width: 420px; background: var(--surface); border-radius: 16px; border-top: 6px solid var(--jaune); padding: 28px 24px; display: flex; flex-direction: column; gap: 16px; }
.lv-auth-logo { width: 180px; height: auto; align-self: center; -webkit-tap-highlight-color: transparent; user-select: none; -webkit-user-select: none; }
.lv-auth-titre { margin: -10px 0 0; text-align: center; font-family: var(--f-titre); font-weight: 900; text-transform: uppercase; letter-spacing: .2em; color: var(--marine); font-size: 14px; }
.lv-auth-carte form { display: flex; flex-direction: column; gap: 14px; }
.lv-auth-carte h1 { font-size: 26px; font-weight: 900; }
.installer-auth { display: flex; flex-direction: column; gap: 14px; }
#p-message { gap: 12px; }
#p-message .btn { align-self: flex-start; }

/* ---------- en-tête ---------- */
.lv-entete { position: sticky; top: 0; z-index: 10; background: var(--marine); padding-top: env(safe-area-inset-top, 0px); border-bottom: 4px solid var(--jaune); }
.lv-entete-in { max-width: 1120px; margin: 0 auto; padding: 8px 16px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.lv-marque { display: flex; align-items: center; gap: 12px; text-decoration: none; margin-right: auto; }
.lv-marque img { width: 84px; height: auto; display: block; background: #fff; border-radius: 6px; padding: 3px 6px; }
.lv-marque span { font-family: var(--f-titre); font-weight: 900; font-size: 20px; color: #fff; }
.lv-profil { display: flex; align-items: center; gap: 8px; }
.lv-profil b { color: #fff; font-family: var(--f-titre); font-weight: 800; margin-right: 4px; }
@media (max-width: 640px) { .lv-profil b { display: none; } .lv-marque img { width: 70px; } .lv-profil .btn.petit { padding: 4px 10px; font-size: 12px; } }

.lv-main { max-width: 1120px; margin: 0 auto; padding: 16px 16px 110px; display: flex; flex-direction: column; gap: 16px; }

/* ---------- choix du départ ---------- */
.lv-depart { background: var(--surface); border: 1px solid var(--trait); border-radius: var(--rayon); padding: 14px 16px; display: grid; grid-template-columns: minmax(170px, 220px) minmax(0, 1fr) auto; gap: 12px 16px; align-items: end; }
.lv-depart .champ select, .lv-depart .champ input { width: 100%; background: var(--surface); border: 1.5px solid var(--trait); border-radius: 8px; padding: 8px 10px; }
.lv-raccourcis { display: flex; gap: 6px; flex-wrap: wrap; }
.lv-raccourcis .filtre { padding: 7px 14px; font-size: 14px; display: inline-flex; align-items: center; gap: 6px; }
.lv-autre { display: flex; gap: 8px; }
@media (max-width: 860px) { .lv-depart { grid-template-columns: minmax(0, 1fr); } .lv-autre .champ { flex: 1; } }
.lv-vide { background: var(--surface); border: 1px solid var(--trait); border-radius: var(--rayon); }

.lv-titre-depart { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.lv-titre-depart h1 { font-size: clamp(22px, 4vw, 30px); font-weight: 900; }

/* ---------- onglets des étapes ---------- */
.lv-onglets { display: flex; gap: 6px; flex-wrap: wrap; border-bottom: 2px solid var(--trait); padding-bottom: 8px; }
.lv-onglets button { border: 1.5px solid var(--trait); background: var(--surface); font-family: var(--f-titre); font-weight: 800; font-size: 15px; color: var(--marine); padding: 8px 16px; border-radius: 999px; cursor: pointer; display: inline-flex; align-items: center; gap: 8px; }
.lv-onglets button[aria-current="page"] { background: var(--marine); border-color: var(--marine); color: #fff; }
.lv-onglets button[data-onglet="liste"] { margin-left: auto; }
@media (max-width: 640px) { .lv-onglets button { flex: 1 1 auto; justify-content: center; font-size: 14px; padding: 8px 10px; } .lv-onglets button[data-onglet="liste"] { margin-left: 0; } }
.lv-onglet { display: flex; flex-direction: column; gap: 12px; }

/* ---------- garages à cocher ---------- */
.lv-recherche { display: flex; flex-direction: column; gap: 10px; }
.lv-recherche input[type=search], .lv-recherche-liste input { width: 100%; background: var(--surface); border: 1.5px solid var(--trait); border-radius: 8px; padding: 11px 12px; font-size: 16px; }
.lv-garage { display: flex; align-items: center; gap: 14px; padding: 12px 16px; border-top: 1px solid var(--trait); cursor: pointer; min-height: 60px; }
.lv-garage:first-child { border-top: 0; }
.lv-garage:hover { background: var(--fond); }
.lv-garage input { width: 26px; height: 26px; flex: none; accent-color: var(--marine); cursor: pointer; }
.lv-garage.coche { background: var(--jaune-pale); }
.lv-garage-texte { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.lv-garage-texte b { font-weight: 700; font-size: 16px; overflow-wrap: anywhere; }

/* ---------- tournées ---------- */
.lv-livreurs .cases { gap: 10px; }
.lv-choix-livreur { border: 1.5px solid var(--trait); border-radius: 999px; padding: 7px 14px; background: var(--surface); }
.lv-choix-livreur:has(input:checked) { border-color: var(--marine); background: var(--info-pale); }
.lv-validee { border-color: var(--ok); background: var(--ok-pale); }
.lv-tournees { display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: 14px; align-items: start; }
@media (max-width: 640px) { .lv-tournees { grid-template-columns: minmax(0, 1fr); } }
.lv-tournee { background: var(--surface); border: 1px solid var(--trait); border-top: 6px solid var(--c); border-radius: var(--rayon); overflow: hidden; }
.lv-tournee.moi { box-shadow: 0 0 0 3px var(--jaune); }
.lv-tournee.a-attribuer { border-style: dashed; border-top-style: solid; }
.lv-tournee-tete { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 12px 16px; border-bottom: 1px solid var(--trait); }
.lv-tournee-tete h2 { font-size: 18px; font-weight: 900; color: var(--c); }
.lv-compte { font-weight: 700; font-size: 14px; color: var(--gris); }
.lv-arrets { list-style: none; margin: 0; padding: 0; }
.lv-arret { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 4px 12px; padding: 10px 16px; border-top: 1px solid var(--trait); }
.lv-arret:first-child { border-top: 0; }
.lv-num { grid-row: span 2; width: 28px; height: 28px; border-radius: 50%; background: var(--c); color: #fff; display: flex; align-items: center; justify-content: center; font-family: var(--f-titre); font-weight: 900; font-size: 13px; margin-top: 2px; }
.lv-arret-texte { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.lv-arret-texte b { overflow-wrap: anywhere; }
.lv-note { display: block; width: 100%; color: var(--attention); font-weight: 600; }
.lv-arret-actions { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.lv-deplacer { border: 1.5px solid var(--trait); border-radius: 8px; padding: 4px 8px; font-size: 13px; background: var(--surface); max-width: 210px; }
.lv-vide-tournee { padding: 14px 16px; }
.lv-actions-tournees { justify-content: flex-start; }

/* ---------- liste des garages ---------- */
.sous-titre { margin-top: 0; }
.petit-gris { display: block; font-size: 12px; color: var(--gris); }

/* ---------- barre du bas (téléphone) ---------- */
.lv-barre-bas { position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; background: var(--marine-fonce); color: #fff; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 16px calc(12px + env(safe-area-inset-bottom, 0px)); font-family: var(--f-titre); font-weight: 800; }
@media (min-width: 861px) { .lv-barre-bas { left: 50%; right: auto; transform: translateX(-50%); bottom: 16px; border-radius: 999px; padding: 8px 8px 8px 22px; min-width: 380px; box-shadow: 0 6px 20px rgba(0,0,0,.25); } }

/* ---------- feuilles de route imprimées ---------- */
@page route { size: A4 portrait; margin: 12mm; }
.lv-imp-page { page: route; font-family: Arial, Helvetica, sans-serif; color: #000; font-size: 12px; break-after: page; display: flex; flex-direction: column; gap: 10px; }
.lv-imp-page:last-child { break-after: auto; }
.lv-imp-tete { display: flex; align-items: center; gap: 20px; border-bottom: 2px solid #000; padding-bottom: 8px; }
.lv-imp-tete img { width: 120px; }
.lv-imp-tete h1 { font-size: 20px; margin: 0; font-family: Arial, sans-serif; }
.lv-imp-tete p { margin: 2px 0 0; font-size: 14px; }
.lv-imp-table { width: 100%; border-collapse: collapse; }
.lv-imp-table th, .lv-imp-table td { border: 1px solid #000; padding: 6px; text-align: left; vertical-align: top; }
.lv-imp-table th { background: #eee; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
.lv-imp-table td:first-child { width: 8mm; text-align: center; font-weight: 700; }
.lv-imp-case { width: 14mm; }
.lv-imp-table td:last-child { width: 45mm; }
.lv-imp-note { font-style: italic; font-size: 11px; }
.lv-imp-pied { font-size: 10px; color: #555; margin: 0; text-align: right; }
.lv-profil .btn[aria-pressed="true"] { background: var(--jaune); border-color: var(--jaune); color: var(--marine-fonce); }
#p-appli, #f-garage { scroll-margin-top: 130px; }

/* ---------- 3. carte ---------- */
.lv-carte-bloc { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 14px; align-items: start; }
@media (max-width: 900px) { .lv-carte-bloc { grid-template-columns: minmax(0, 1fr); } }
.carte { position: relative; height: 560px; overflow: hidden; border-radius: var(--rayon); border: 1px solid var(--trait); background: #E5E3DF; touch-action: none; cursor: grab; user-select: none; -webkit-user-select: none; }
.carte.glisse { cursor: grabbing; }
@media (max-width: 640px) { .carte { height: 420px; } }
.carte-fond, .carte-reperes { position: absolute; inset: 0; }
.carte-reperes { pointer-events: none; }
.tuile { position: absolute; top: 0; left: 0; width: 256px; height: 256px; max-width: none; user-select: none; -webkit-user-drag: none; }
.carte-traces { position: absolute; top: 0; left: 0; pointer-events: none; }
.carte-zoom { position: absolute; top: 10px; right: 10px; display: flex; flex-direction: column; gap: 6px; align-items: flex-end; }
.carte-zoom .btn { box-shadow: 0 1px 4px rgba(0,0,0,.2); min-width: 34px; }
.carte-credit { position: absolute; right: 0; bottom: 0; background: rgba(255,255,255,.85); font-size: 11px; padding: 1px 6px; border-top-left-radius: 6px; }
.carte-credit a { color: var(--marine); }
.repere { position: absolute; left: 0; top: 0; }
.rp-garage { display: flex; align-items: center; justify-content: center; width: 26px; height: 26px; margin: -13px 0 0 -13px; border-radius: 50%; background: var(--c); color: #fff; border: 2px solid #fff; font: 900 12px var(--f-titre); box-shadow: 0 1px 4px rgba(0,0,0,.35); pointer-events: auto; cursor: help; }
.rp-garage.pale { opacity: .35; }
.rp-garage.incertain { border-style: dashed; }
.rp-garage.attente { --c: #8E97B8; }
.rp-depot { display: flex; align-items: center; justify-content: center; width: 30px; height: 30px; margin: -15px 0 0 -15px; border-radius: 6px; background: var(--jaune); color: var(--marine-fonce); border: 2px solid var(--marine); font: 900 14px var(--f-titre); box-shadow: 0 1px 4px rgba(0,0,0,.35); pointer-events: auto; }
.rp-vehicule { display: flex; align-items: center; gap: 4px; margin: -17px 0 0 -17px; pointer-events: auto; }
.rp-camion { width: 34px; height: 34px; border-radius: 50%; background: #fff; border: 3px solid var(--c); display: flex; align-items: center; justify-content: center; font-size: 17px; box-shadow: 0 2px 6px rgba(0,0,0,.35); }
.rp-vehicule.roule .rp-camion { box-shadow: 0 0 0 4px rgba(29,127,82,.35), 0 2px 6px rgba(0,0,0,.35); }
.rp-vehicule.autre .rp-camion { opacity: .75; }
.rp-nom { background: #fff; border-radius: 6px; padding: 2px 8px; font-size: 12px; font-weight: 700; white-space: nowrap; box-shadow: 0 1px 4px rgba(0,0,0,.25); color: var(--noir); }
.lv-carte-cote { display: flex; flex-direction: column; gap: 10px; }
.lv-carte-cote > div { display: flex; flex-direction: column; gap: 8px; }
.lv-carte-tournee { background: var(--surface); border: 1px solid var(--trait); border-left: 5px solid var(--c); border-radius: 8px; padding: 10px 12px; display: flex; flex-direction: column; gap: 3px; }
.lv-carte-tournee.choisie { box-shadow: 0 0 0 3px var(--jaune); }
.lv-ct-titre { display: flex; align-items: center; gap: 8px; background: none; border: 0; padding: 0; cursor: pointer; font-size: 15px; color: var(--noir); text-align: left; }
.pastille-couleur { width: 12px; height: 12px; border-radius: 50%; background: var(--c); flex: none; }
.lv-ct-sous { font-size: 13px; text-transform: uppercase; letter-spacing: .06em; color: var(--gris); margin-top: 6px; }
.lv-ct-vehicule { text-align: left; background: var(--surface); border: 1px solid var(--trait); border-radius: 8px; padding: 8px 10px; font-size: 13px; cursor: pointer; }
.lv-gps { display: flex; flex-wrap: wrap; gap: 6px; padding: 10px 16px; border-bottom: 1px solid var(--trait); background: var(--fond); }

/* ---------- horaires, prévisions et IA ---------- */
.lv-horaires { display: flex; flex-wrap: wrap; gap: 4px 8px; align-items: center; font-size: 13px; color: var(--gris); margin-top: 2px; }
.lv-eta { font-weight: 800; color: var(--marine); }
.lv-resume { padding: 8px 16px; font-size: 13px; color: var(--texte); background: var(--fond); border-bottom: 1px solid var(--trait); }
.lv-retard { color: var(--critique); }
.lv-explication { margin: 0; padding: 8px 16px; font-size: 13px; background: var(--info-pale); color: var(--marine); border-bottom: 1px solid var(--trait); }
.lv-ia { margin: 0; }
#t-infos { display: flex; flex-direction: column; gap: 8px; }
#t-infos:empty { display: none; }
.lv-col-horaires { font-size: 13px; min-width: 170px; }
.fg-grille { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.fg-grille label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; font-weight: 700; color: var(--gris); }
.fg-grille input { border: 1.5px solid var(--trait); border-radius: 8px; padding: 8px 10px; background: var(--surface); }
@media (max-width: 760px) { .fg-grille { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.fg-horaires { gap: 8px; }
.lv-mini { border: 1.5px solid var(--trait); border-radius: 8px; padding: 5px 8px; width: 100%; min-width: 120px; }
.lv-mini.cp { min-width: 70px; max-width: 90px; }
#rg-regles { font-family: var(--f-texte); }

/* Menu du compte sur fond bleu */
.lv-profil .moi-btn { color: #fff; }
.lv-profil .moi-btn:hover, .lv-profil .moi-btn[aria-expanded="true"] { background: rgba(255,255,255,.1); border-color: rgba(255,255,255,.25); }
.lv-profil .moi-initiales { background: var(--jaune); color: var(--marine-fonce); }
.lv-profil .moi-fleche { color: #C9D1F0; }
.lv-profil .profil-texte b { color: #fff; margin: 0; }
.lv-profil .cloche-btn { border-color: transparent; }
@media (max-width: 640px) { .lv-profil .profil-texte, .lv-profil .moi-fleche { display: none; } .lv-profil .moi-btn { padding: 3px; } }
.txt-court { display: none; }
@media (max-width: 640px) { .txt-long { display: none; } .txt-court { display: inline; } .lv-profil { gap: 6px; } .lv-entete-in { gap: 8px; padding-inline: 12px; } .lv-marque span { font-size: 17px; } }
.lv-erp { border-top: 1px solid var(--trait); padding-top: 10px; }
.lv-erp p { margin: 4px 0 0; }
#rg-erp-etat { display: block; margin-bottom: 6px; }
.lv-erp-ligne { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 10px 0 6px; }
.lv-erp-ligne label { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--gris); }
.lv-erp-ligne input[type=time] { border: 1.5px solid var(--trait); border-radius: 8px; padding: 7px 10px; font: inherit; }
.lv-erp-lib { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--gris); }
