:root {
  --vert: #1a8f4c; --vert-clair: #e5f5ec;
  --orange: #e8890c; --orange-clair: #fdf1e0;
  --rouge: #d23c3c; --rouge-clair: #fbe7e7;
  --bleu: #1f4e79; --bleu-clair: #e6eef6;
  --gris: #6b7280; --fond: #f4f5f7; --ligne: #e3e5e8; --texte: #1c1f23;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; padding: 0; background: var(--fond); color: var(--texte);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif; font-size: 16px; }
body { padding-bottom: 90px; }
a { color: var(--bleu); }
.haut { background: var(--bleu); color: #fff; padding: 14px 16px; display: flex; align-items: center; justify-content: space-between; }
.entete { position: sticky; top: 0; z-index: 10; box-shadow: 0 2px 6px rgba(0,0,0,.08); }
.haut h1 { font-size: 19px; margin: 0; }
.haut small { opacity: .8; display: block; font-size: 13px; }
.page { padding: 14px; max-width: 720px; margin: 0 auto; }
.carte { background: #fff; border-radius: 14px; padding: 14px; margin-bottom: 12px; box-shadow: 0 1px 2px rgba(0,0,0,.05); }
h2 { font-size: 18px; margin: 6px 0 12px; }
h3 { font-size: 16px; margin: 4px 0 8px; }
label { display: block; font-weight: 600; font-size: 14px; margin: 12px 0 5px; }
input, select, textarea { width: 100%; padding: 13px 12px; border: 1px solid #cfd3d8; border-radius: 10px; font-size: 16px; background: #fff; color: var(--texte); }
textarea { min-height: 80px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--bleu); border-color: transparent; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: 0; border-radius: 12px; padding: 14px 16px; font-size: 16px; font-weight: 700; cursor: pointer; background: var(--bleu); color: #fff; text-decoration: none; width: 100%; margin-top: 12px; }
.btn.vert { background: var(--vert); } .btn.rouge { background: var(--rouge); } .btn.orange { background: var(--orange); }
.btn.clair { background: var(--bleu-clair); color: var(--bleu); }
.btn.petit { padding: 10px 12px; font-size: 14px; width: auto; margin-top: 0; }
.btn:disabled { opacity: .5; }
.rangee { display: flex; gap: 8px; flex-wrap: wrap; }
.rangee > * { flex: 1; }
.grille4 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-bottom: 12px; }
@media (min-width: 560px) { .grille4 { grid-template-columns: repeat(4, 1fr); } }
.tuile { border-radius: 14px; padding: 14px; color: #fff; cursor: pointer; }
.tuile b { display: block; font-size: 28px; }
.tuile span { font-size: 14px; }
.t-attente { background: var(--bleu); } .t-route { background: var(--orange); } .t-livre { background: var(--vert); } .t-echec { background: var(--rouge); }
.colis { background: #fff; border-radius: 14px; padding: 12px 14px; margin-bottom: 10px; border-left: 5px solid var(--bleu); cursor: pointer; }
.colis.st-en_route { border-color: var(--orange); } .colis.st-livre { border-color: var(--vert); }
.colis.st-echec { border-color: var(--rouge); } .colis.st-annule, .colis.st-retourne { border-color: var(--gris); opacity: .8; }
.colis .l1 { display: flex; justify-content: space-between; gap: 8px; font-weight: 700; }
.colis .l2 { color: var(--gris); font-size: 14px; margin-top: 4px; }
.badge { display: inline-block; padding: 3px 9px; border-radius: 99px; font-size: 12px; font-weight: 700; white-space: nowrap; }
.b-cree, .b-confirme, .b-confie { background: var(--bleu-clair); color: var(--bleu); }
.b-en_route { background: var(--orange-clair); color: var(--orange); }
.b-livre { background: var(--vert-clair); color: var(--vert); }
.b-echec { background: var(--rouge-clair); color: var(--rouge); }
.b-annule, .b-retourne { background: #eee; color: var(--gris); }
.alerte { background: var(--rouge-clair); color: #8a1f1f; border-radius: 12px; padding: 12px 14px; margin-bottom: 12px; font-size: 15px; }
.alerte.orange { background: var(--orange-clair); color: #7a4600; }
.alerte.verte { background: var(--vert-clair); color: #0e5a2f; }
.nav { background: #fff; border-bottom: 1px solid var(--ligne); display: flex; }
.nav button { flex: 1; border: 0; background: none; padding: 9px 2px 10px; font-size: 12px; color: var(--gris); cursor: pointer; }
.nav button .ic { display: block; font-size: 22px; line-height: 1.1; }
.nav button.actif { color: var(--bleu); font-weight: 700; }
.nav button.plus .ic { background: var(--vert); color: #fff; border-radius: 50%; width: 30px; height: 30px; line-height: 30px; margin: 0 auto 2px; font-size: 24px; }
.chips { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 6px; margin-bottom: 8px; }
.chip { border: 1px solid var(--ligne); background: #fff; border-radius: 99px; padding: 8px 13px; font-size: 14px; white-space: nowrap; cursor: pointer; }
.chip.actif { background: var(--bleu); color: #fff; border-color: var(--bleu); }
.gros { font-size: 34px; font-weight: 800; }
.vert-t { color: var(--vert); } .rouge-t { color: var(--rouge); } .gris-t { color: var(--gris); }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
td, th { padding: 9px 6px; border-bottom: 1px solid var(--ligne); text-align: left; }
th { color: var(--gris); font-weight: 600; }
td.n, th.n { text-align: right; }
.voile { position: fixed; inset: 0; background: rgba(0,0,0,.45); z-index: 20; display: flex; align-items: flex-end; justify-content: center; }
.feuille { background: #fff; width: 100%; max-width: 720px; max-height: 92vh; overflow-y: auto; border-radius: 18px 18px 0 0; padding: 16px 16px 90px; }
.feuille .fermer { float: right; border: 0; background: #eee; border-radius: 50%; width: 36px; height: 36px; font-size: 18px; cursor: pointer; }
.motifs button { display: block; width: 100%; text-align: left; margin-top: 8px; padding: 15px; border-radius: 12px; border: 1px solid var(--ligne); background: #fff; font-size: 16px; cursor: pointer; }
.motifs button.choisi { border-color: var(--rouge); background: var(--rouge-clair); font-weight: 700; }
.code-saisie { font-size: 34px; letter-spacing: 14px; text-align: center; font-weight: 800; }
.toast { position: fixed; left: 50%; transform: translateX(-50%); top: 120px; background: #222; color: #fff; padding: 12px 18px; border-radius: 12px; z-index: 40; max-width: 90%; font-size: 15px; }
.toast.err { background: var(--rouge); }
.vide { text-align: center; color: var(--gris); padding: 30px 10px; }
.histo { list-style: none; padding: 0; margin: 0; font-size: 14px; }
.histo li { padding: 7px 0; border-bottom: 1px dashed var(--ligne); }
.histo li small { color: var(--gris); display: block; }
.logo-acc { text-align: center; margin: 30px 0 10px; }
.logo-acc .rond { width: 74px; height: 74px; border-radius: 20px; background: var(--bleu); color: #fff; font-size: 38px; display: inline-flex; align-items: center; justify-content: center; font-weight: 800; }
.logo-acc h1 { margin: 10px 0 2px; font-size: 26px; }
.logo-acc p { margin: 0; color: var(--gris); }
.hors-ligne { background: var(--orange); color: #fff; text-align: center; font-size: 14px; padding: 6px; }
.photo-mini { width: 54px; height: 54px; border-radius: 50%; object-fit: cover; background: #ddd; }
.ligne-livreur { display: flex; align-items: center; gap: 12px; }
.etapes { display: flex; justify-content: space-between; margin: 10px 0 4px; }
.etapes div { flex: 1; text-align: center; font-size: 11px; color: var(--gris); position: relative; }
.etapes div::before { content: ""; display: block; width: 16px; height: 16px; border-radius: 50%; background: #d5d8dc; margin: 0 auto 4px; }
.etapes div.ok { color: var(--vert); font-weight: 700; } .etapes div.ok::before { background: var(--vert); }
.code-client { font-size: 46px; font-weight: 800; letter-spacing: 12px; text-align: center; color: var(--bleu); margin: 6px 0; }
