/* =====================================================================
   OEUF D'OR LIVRAISON — Lomé · Feuille de style
   Thème clair : blanc / doré, couleurs de marque Or + Noir.
   Pensé d'abord pour le téléphone (une main, sur moto), puis ordinateur.
   ===================================================================== */
:root {
  --gold: #C9971C;
  --gold-2: #E8B931;
  --gold-3: #F6D877;
  --gold-soft: #FBF3DC;
  --gold-line: #EFDFAE;
  --ink: #111111;
  --ink-2: #2A2A2A;
  --muted: #6E6A62;
  --line: #ECE7DA;
  --bg: #FFFFFF;
  --bg-2: #FAF7F0;
  --ok: #1F8A4C;
  --danger: #C62828;
  --blue: #1A73E8;
  --radius: 16px;
  --radius-sm: 12px;
  --shadow: 0 1px 2px rgba(17, 17, 17, .06), 0 6px 20px rgba(17, 17, 17, .07);
  --shadow-lg: 0 10px 40px rgba(17, 17, 17, .18);
  --top: 60px;
  --tabs: 68px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
  --f-title: 'Barlow Condensed', 'Arial Narrow', system-ui, sans-serif;
  --f-text: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; background: var(--bg-2); color: var(--ink); font: 400 15px/1.5 var(--f-text); -webkit-font-smoothing: antialiased; }
body { overflow: hidden; overscroll-behavior-y: contain; }
a { color: inherit; }
button, input, select { font: inherit; color: inherit; }
img { max-width: 100%; display: block; }
h1, h2, h3 { font-family: var(--f-title); letter-spacing: .01em; line-height: 1.1; margin: 0 0 .4em; }
h2 { font-size: 28px; font-weight: 700; }
h3 { font-size: 21px; font-weight: 700; }
p { margin: 0 0 .7em; }
svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; }
[hidden] { display: none !important; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.center { text-align: center; }
.gold-t { color: var(--gold); }
:focus-visible { outline: 3px solid var(--gold-2); outline-offset: 2px; }

/* ---------- Structure ---------- */
.app { display: flex; height: 100dvh; height: 100vh; }
@supports (height: 100dvh) { .app { height: 100dvh; } }
.main { flex: 1; display: flex; flex-direction: column; min-width: 0; position: relative; }
.sidebar { display: none; }

.topbar {
  height: calc(var(--top) + var(--safe-t)); padding: var(--safe-t) 8px 0; display: flex; align-items: center; gap: 6px;
  background: var(--ink); color: #fff; flex: none; z-index: 30; position: relative;
  border-bottom: 2px solid var(--gold);
}
.topbar-title { flex: 1; min-width: 0; font: 700 22px/1 var(--f-title); letter-spacing: .02em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding-left: 4px; }
.topbar-actions { display: flex; gap: 4px; }
.logo-title { display: inline-flex; align-items: center; gap: 10px; }
.logo-title img { border-radius: 7px; }
.logo-title b { font-weight: 800; color: var(--gold-2); }
.logo-title small { font: 500 12px var(--f-text); color: #CFC8B6; letter-spacing: .03em; }

.icon-btn {
  width: 46px; height: 46px; border: 0; border-radius: 12px; background: transparent; display: grid; place-items: center; cursor: pointer; color: inherit; transition: background .15s;
}
.icon-btn:hover { background: rgba(255, 255, 255, .08); }
.icon-btn.sm { width: 40px; height: 40px; background: var(--bg-2); color: var(--ink); border: 1px solid var(--line); }
.icon-btn.sm:hover { background: var(--gold-soft); }
.icon-btn.danger { color: var(--danger); }
.back-btn { background: rgba(255, 255, 255, .1); }
.back-btn svg { width: 26px; height: 26px; stroke-width: 2.4; }

.view { flex: 1; min-height: 0; overflow-y: auto; -webkit-overflow-scrolling: touch; position: relative; }
.view-map { overflow: hidden; }
.page { min-height: 100%; overflow-y: auto; height: 100%; }
.page-inner { max-width: 760px; margin: 0 auto; padding: 16px 14px calc(24px + var(--safe-b)); }
.page-inner.narrow { max-width: 420px; padding-top: 40px; }

.tabbar {
  flex: none; display: grid; grid-template-columns: repeat(5, 1fr); height: calc(var(--tabs) + var(--safe-b)); padding-bottom: var(--safe-b);
  background: #fff; border-top: 1px solid var(--line); z-index: 30; box-shadow: 0 -4px 20px rgba(17, 17, 17, .05);
}
.no-tabs .tabbar { display: none; }
.tab { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; text-decoration: none; font-size: 11.5px; font-weight: 600; color: #8A857A; }
.tab svg { width: 24px; height: 24px; }
.tab.on { color: var(--ink); }
.tab.on svg { color: var(--gold); }
.tab-gold svg { width: 46px; height: 46px; padding: 11px; margin-top: -18px; border-radius: 50%; background: var(--ink); color: var(--gold-2) !important; box-shadow: 0 6px 16px rgba(17, 17, 17, .28); border: 3px solid #fff; }

.offline-bar { background: #3A2E0B; color: var(--gold-3); font-size: 13px; padding: 8px 14px; display: flex; gap: 8px; align-items: center; }
.offline-bar svg { width: 18px; height: 18px; }

/* ---------- Boutons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 46px; padding: 10px 16px; border-radius: 12px;
  border: 1px solid var(--line); background: #fff; color: var(--ink); font-weight: 600; text-decoration: none; cursor: pointer; transition: transform .08s, background .15s, box-shadow .15s; white-space: nowrap;
}
.btn:hover { background: var(--bg-2); }
.btn:active { transform: scale(.98); }
.btn svg { width: 20px; height: 20px; }
.btn[disabled] { opacity: .5; cursor: not-allowed; transform: none; }
.btn-sm { min-height: 38px; padding: 6px 12px; font-size: 13.5px; border-radius: 10px; }
.btn-sm svg { width: 17px; height: 17px; }
.btn-lg { min-height: 56px; font-size: 16.5px; border-radius: 14px; padding: 12px 20px; }
.btn-block { width: 100%; margin-top: 10px; }
.btn-gold { background: linear-gradient(180deg, var(--gold-2), var(--gold)); border-color: #B7871A; color: #1A1203; box-shadow: 0 4px 14px rgba(201, 151, 28, .32); }
.btn-gold:hover { background: linear-gradient(180deg, #F0C443, #CF9E22); }
.btn-dark { background: var(--ink); color: #fff; border-color: var(--ink); }
.btn-danger { background: var(--danger); color: #fff; border-color: var(--danger); }
.btn-danger:hover { background: #A61F1F; }
.btn-ghost-danger { color: var(--danger); border-color: #F1D3D3; }
.btn-ghost-danger:hover { background: #FDF1F1; }
.btn-wa { background: #128C4A; color: #fff; border-color: #128C4A; }
.btn-wa:hover { background: #0E743D; }
.btn-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.btn-row .btn { flex: 1 1 auto; }
.loading { position: relative; pointer-events: none; }
.loading > svg { animation: spin 0.9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Cartes / champs ---------- */
.card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow); margin-bottom: 14px; position: relative; }
.card-title { display: flex; align-items: center; gap: 8px; font-size: 20px; }
.card-title svg { color: var(--gold); }
.field { display: block; margin: 10px 0; }
.field-label { display: block; font-size: 12.5px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; margin: 10px 0 6px; }
.field .field-label { margin-top: 0; }
input:not([type=checkbox]):not([type=file]), select {
  width: 100%; height: 50px; padding: 0 14px; border-radius: 12px; border: 1.5px solid var(--line); background: #fff; outline: none; transition: border .15s, box-shadow .15s; font-size: 16px;
}
input:focus, select:focus { border-color: var(--gold); box-shadow: 0 0 0 4px rgba(232, 185, 49, .2); }
.input-unit { display: flex; align-items: center; border: 1.5px solid var(--line); border-radius: 12px; background: #fff; overflow: hidden; }
.input-unit:focus-within { border-color: var(--gold); box-shadow: 0 0 0 4px rgba(232, 185, 49, .2); }
.input-unit input { border: 0 !important; box-shadow: none !important; font-weight: 700; font-size: 18px; }
.input-unit em { font-style: normal; font-size: 12.5px; color: var(--muted); padding-right: 12px; white-space: nowrap; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.grid3 { display: grid; grid-template-columns: 2fr .8fr 1.2fr; gap: 8px; }
.check { display: flex; gap: 10px; align-items: flex-start; margin: 12px 0; font-size: 14.5px; cursor: pointer; }
.check input { width: 22px; height: 22px; accent-color: var(--gold); flex: none; margin-top: 1px; }
.check.big { background: var(--gold-soft); border: 1px solid var(--gold-line); padding: 12px; border-radius: 12px; }
.check a { color: #8A6410; font-weight: 600; }

.segmented { display: flex; gap: 6px; background: var(--bg-2); border: 1px solid var(--line); padding: 4px; border-radius: 14px; margin-bottom: 6px; }
.segmented button { flex: 1; min-height: 46px; border: 0; background: transparent; border-radius: 10px; font-weight: 600; display: flex; align-items: center; justify-content: center; gap: 8px; cursor: pointer; color: var(--muted); }
.segmented button.on { background: var(--ink); color: #fff; box-shadow: 0 2px 8px rgba(17, 17, 17, .2); }
.segmented button.on svg { color: var(--gold-2); }
.segmented.wrap { flex-wrap: wrap; }

.badge { display: inline-flex; align-items: center; gap: 4px; font: 600 11.5px var(--f-text); padding: 3px 8px; border-radius: 99px; background: #F1EEE6; color: var(--ink-2); font-style: normal; letter-spacing: .02em; }
.badge-ok { background: #E3F4EA; color: var(--ok); }
.badge-warn { background: #FFF2D6; color: #8A5A00; }
.badge-gold { background: var(--gold-2); color: #1A1203; }
.garde { color: var(--ok); font-style: normal; font-weight: 700; }
.warn { color: #8A5A00; }

/* ---------- Carte plein écran (accueil) ---------- */
.map-page { position: absolute; inset: 0; }
.map-fill { position: absolute; inset: 0; background: #EDE9DF; }
.map-top { position: absolute; top: 10px; left: 10px; right: 10px; z-index: 500; }
.searchbar { display: flex; align-items: center; gap: 8px; height: 54px; background: #fff; border-radius: 16px; padding: 0 6px 0 14px; box-shadow: var(--shadow-lg); border: 1px solid var(--line); }
.searchbar > svg { color: var(--gold); }
.searchbar input { border: 0 !important; box-shadow: none !important; height: 50px; padding: 0 !important; font-size: 16px; background: transparent !important; }
.chips { display: flex; gap: 8px; overflow-x: auto; padding: 10px 2px 4px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex: none; display: inline-flex; align-items: center; gap: 6px; height: 38px; padding: 0 13px 0 10px; border-radius: 99px; border: 1px solid var(--line); background: #fff; font-weight: 600; font-size: 13.5px; cursor: pointer; box-shadow: 0 2px 8px rgba(17, 17, 17, .1); }
.chip svg { width: 18px; height: 18px; color: var(--c); }
.chip.on { background: var(--c); border-color: var(--c); color: #fff; }
.chip.on svg { color: #fff; }
.chip.loading svg { animation: spin .9s linear infinite; }

.map-fabs { position: absolute; right: 12px; bottom: 214px; z-index: 500; display: flex; flex-direction: column; gap: 10px; }
.fab { width: 54px; height: 54px; border-radius: 16px; border: 1px solid var(--line); background: #fff; display: grid; place-items: center; box-shadow: var(--shadow-lg); cursor: pointer; }
.fab svg { width: 24px; height: 24px; }
.fab-gold { background: var(--ink); color: var(--gold-2); border-color: var(--ink); width: 62px; height: 62px; border-radius: 50%; }
.fab-gold svg { width: 28px; height: 28px; }
.fab.loading svg { animation: spin 1s linear infinite; }

.map-sheet { position: absolute; left: 0; right: 0; bottom: 0; z-index: 500; background: #fff; border-radius: 22px 22px 0 0; padding: 14px 14px 12px; box-shadow: 0 -10px 30px rgba(17, 17, 17, .14); }
.map-sheet::before { content: ''; display: block; width: 44px; height: 5px; border-radius: 9px; background: #DDD6C6; margin: -4px auto 10px; }
.sheet-hello { font: 700 20px var(--f-title); margin-bottom: 10px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sheet-hello span { font: 500 13px var(--f-text); color: var(--muted); }
.sheet-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.big-action { display: flex; align-items: center; gap: 10px; padding: 14px 12px; border-radius: 16px; background: var(--ink); color: #fff; text-decoration: none; min-height: 70px; }
.big-action svg { width: 30px; height: 30px; color: var(--gold-2); }
.big-action b { display: block; font-size: 15px; line-height: 1.2; }
.big-action small { display: block; font-size: 12px; opacity: .75; }
.big-action.gold { background: linear-gradient(160deg, var(--gold-2), var(--gold)); color: #1A1203; }
.big-action.gold svg { color: var(--ink); }
.near { margin-top: 10px; }
.near-hint { display: flex; gap: 8px; align-items: center; font-size: 13px; color: var(--muted); margin: 0; }
.near-hint svg { width: 18px; height: 18px; color: var(--gold); }
.near-title { font-weight: 700; font-size: 13px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin-bottom: 6px; }
.near-list { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
.near-item { flex: none; display: flex; gap: 8px; align-items: center; padding: 8px 12px 8px 8px; border: 1px solid var(--line); border-radius: 14px; text-decoration: none; max-width: 220px; }
.near-item b { display: block; font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 150px; }
.near-item small { color: var(--muted); font-size: 12px; }

.sugg { background: #fff; border: 1px solid var(--line); border-radius: 14px; margin-top: 6px; max-height: 52vh; overflow-y: auto; box-shadow: var(--shadow-lg); position: relative; z-index: 20; }
.sugg-floating { position: absolute; left: 0; right: 0; top: 56px; }
.sugg-item { display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; border: 0; background: none; padding: 10px 12px; cursor: pointer; border-bottom: 1px solid #F3EFE6; }
.sugg-item:hover { background: var(--bg-2); }
.sugg-txt { flex: 1; min-width: 0; }
.sugg-txt b { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sugg-txt small { color: var(--muted); font-size: 12.5px; }
.sugg-d { font-size: 12.5px; color: var(--muted); font-weight: 600; }
.sugg-empty { padding: 14px; color: var(--muted); font-size: 14px; }
.sugg-ic { width: 38px; height: 38px; flex: none; border-radius: 11px; display: grid; place-items: center; background: color-mix(in srgb, var(--c) 13%, #fff); color: var(--c); }
.sugg-ic svg { width: 20px; height: 20px; }
.sugg-ic.lg { width: 56px; height: 56px; border-radius: 16px; }
.sugg-ic.lg svg { width: 28px; height: 28px; }

/* Marqueurs */
.pin-wrap { background: none; border: 0; }
.pin { border-radius: 50%; background: var(--c); color: #fff; display: grid; place-items: center; border: 2.5px solid #fff; box-shadow: 0 3px 10px rgba(0, 0, 0, .3); }
.pin svg { width: 58%; height: 58%; }
.pin-garde { box-shadow: 0 0 0 3px var(--ok), 0 3px 10px rgba(0, 0, 0, .3); }
.pin-letter { width: 38px; height: 46px; position: relative; }
.pin-letter::before { content: ''; position: absolute; left: 3px; top: 0; width: 32px; height: 32px; border-radius: 50% 50% 50% 0; transform: rotate(-45deg); transform-origin: center; background: var(--pc); border: 3px solid #fff; box-shadow: 0 4px 10px rgba(0, 0, 0, .3); top: 2px; }
.pin-letter span { position: absolute; left: 0; right: 0; top: 7px; text-align: center; font: 800 17px var(--f-title); color: var(--tc); }
.pin-gold { --pc: var(--gold-2); --tc: #111; }
.pin-dark { --pc: #111; --tc: var(--gold-2); }
.me-dot { width: 22px; height: 22px; border-radius: 50%; background: rgba(26, 115, 232, .25); display: grid; place-items: center; animation: pulse 2s infinite; }
.me-dot i { width: 14px; height: 14px; border-radius: 50%; background: var(--blue); border: 2.5px solid #fff; box-shadow: 0 1px 4px rgba(0, 0, 0, .3); }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(26, 115, 232, .45); } 70% { box-shadow: 0 0 0 18px rgba(26, 115, 232, 0); } 100% { box-shadow: 0 0 0 0 rgba(26, 115, 232, 0); } }
.rider { width: 44px; height: 44px; border-radius: 50%; background: var(--ink); color: var(--gold-2); display: grid; place-items: center; border: 3px solid var(--gold-2); box-shadow: 0 4px 14px rgba(0, 0, 0, .35); }
.rider svg { width: 24px; height: 24px; }
.q-label-wrap { background: none; border: 0; }
.q-label { display: inline-block; transform: translate(-50%, -50%); white-space: nowrap; font: 700 13px var(--f-title); letter-spacing: .04em; text-transform: uppercase; color: #3A3121; background: rgba(255, 255, 255, .82); padding: 2px 7px; border-radius: 6px; border: 1px solid rgba(201, 151, 28, .35); }
.q-label.small { font-size: 11px; }

.leaflet-container { font-family: var(--f-text); }
.leaflet-popup-content-wrapper { border-radius: 14px; box-shadow: var(--shadow-lg); }
.leaflet-popup-content { margin: 12px 14px; }
.pop-cat { font-size: 11.5px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 600; }
.pop-name { font: 700 19px/1.15 var(--f-title); margin: 2px 0; }
.pop-sub { font-size: 12.5px; color: var(--muted); }
.pop-actions { display: flex; gap: 6px; margin-top: 10px; }
.pop-actions .btn { min-height: 36px; color: #1A1203; }
.leaflet-control-zoom a { width: 40px !important; height: 40px !important; line-height: 38px !important; font-size: 20px !important; }
.leaflet-bottom.leaflet-right { margin-bottom: 0; }
.map-page .leaflet-bottom.leaflet-right { bottom: 205px; }
.map-page .leaflet-control-zoom { display: none; }
.map-fallback { height: 100%; display: grid; place-content: center; gap: 6px; text-align: center; padding: 20px; color: var(--muted); }
.map-fallback b { color: var(--ink); }

/* ---------- Pages avec formulaire + carte ---------- */
.page-split { display: flex; flex-direction: column; }
.split-form { padding: 14px 14px 0; max-width: 760px; width: 100%; margin: 0 auto; }
.split-map { padding: 0 14px calc(20px + var(--safe-b)); max-width: 760px; width: 100%; margin: 0 auto; }
.map-box { height: 330px; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line); box-shadow: var(--shadow); background: #EDE9DF; position: relative; z-index: 1; }
.map-box.small { height: 230px; margin: 10px 0; }
.map-box.tall { height: 400px; }

.picker { position: relative; }
.picker-row { display: flex; align-items: center; gap: 6px; }
.picker-dot { width: 30px; height: 30px; flex: none; border-radius: 50%; background: var(--ink); color: var(--gold-2); display: grid; place-items: center; font: 800 15px var(--f-title); }
.picker-dot:empty { display: none; }
.picker-dot.dot-b { background: var(--gold-2); color: var(--ink); }
.picker-input { flex: 1; }
.picker .sugg { position: absolute; left: 0; right: 0; }
.swap-btn { position: absolute; right: 22px; top: 50%; transform: translateY(-50%); z-index: 3; width: 38px; height: 38px; border-radius: 50%; border: 1px solid var(--line); background: #fff; display: grid; place-items: center; box-shadow: var(--shadow); cursor: pointer; display: none; }
.pick-hint { margin-top: 10px; padding: 10px 12px; border-radius: 12px; background: var(--gold-soft); color: #6B4E0B; font-weight: 600; font-size: 14px; display: flex; gap: 8px; align-items: center; }
.card #pickB { margin-top: 6px; }
.card > #pickA + .swap-btn { display: grid; position: relative; right: auto; top: auto; transform: none; margin: 8px 0 -4px auto; }

/* Résultat du trajet */
.result-card { background: var(--ink); color: #fff; border-radius: 20px; padding: 18px; box-shadow: var(--shadow-lg); margin-bottom: 14px; animation: rise .35s ease; }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
.result-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-weight: 600; margin-bottom: 12px; }
.result-head span:first-child { display: flex; gap: 8px; align-items: center; }
.result-head svg { color: var(--gold-2); }
.result-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.result-grid > div { background: rgba(255, 255, 255, .07); border-radius: 14px; padding: 10px; }
.result-grid small { display: block; font-size: 11.5px; text-transform: uppercase; letter-spacing: .05em; opacity: .7; }
.result-grid b { display: block; font: 800 clamp(19px, 5.6vw, 25px)/1.1 var(--f-title); margin-top: 2px; white-space: nowrap; }
.result-grid .gold { background: linear-gradient(160deg, var(--gold-2), var(--gold)); color: #1A1203; }
.result-grid.small b { font-size: 20px; }
.card .result-grid > div { background: var(--bg-2); }
.card .result-grid .gold { background: var(--gold-soft); color: #6B4E0B; }
.result-line { margin: 12px 0 6px; font-size: 14px; color: var(--gold-3); }
.result-more { display: flex; flex-wrap: wrap; gap: 8px 16px; font-size: 13px; opacity: .85; }
.result-more span { display: inline-flex; gap: 6px; align-items: center; }
.result-more svg { width: 16px; height: 16px; color: var(--gold-2); }
.result-card .btn:not(.btn-wa) { background: rgba(255, 255, 255, .08); color: #fff; border-color: rgba(255, 255, 255, .15); }

/* Listes */
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 14px; }
.stat { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 12px; box-shadow: var(--shadow); }
.stat small { display: block; font-size: 11.5px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; font-weight: 600; }
.stat b { font: 800 clamp(17px, 4.8vw, 22px)/1.2 var(--f-title); white-space: nowrap; display: block; }
.stat.gold { background: var(--ink); color: #fff; }
.stat.gold small { color: #CFC8B6; }
.stat.gold b { color: var(--gold-2); }
.list { display: flex; flex-direction: column; gap: 10px; }
.item { display: flex; gap: 12px; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; box-shadow: var(--shadow); text-decoration: none; }
.item-ic { width: 44px; height: 44px; border-radius: 13px; background: var(--ink); color: var(--gold-2); display: grid; place-items: center; flex: none; }
.item-ic.gold { background: var(--gold-soft); color: var(--gold); }
.item-main { flex: 1; min-width: 0; }
.item-date { font-size: 12px; color: var(--muted); }
.item-title { font-weight: 700; font-size: 15.5px; line-height: 1.3; }
.item-title .arrow { color: var(--gold); }
.item-meta { font-size: 14px; color: var(--ink-2); margin-top: 2px; }
.item-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; align-items: center; }
.empty { text-align: center; padding: 50px 20px; color: var(--muted); }
.empty > svg { width: 56px; height: 56px; color: var(--gold); background: var(--gold-soft); padding: 14px; border-radius: 20px; margin-bottom: 10px; }
.empty h3 { color: var(--ink); }
.section-title { font-size: 20px; margin: 22px 0 10px; }

.status { display: inline-flex; font-weight: 700; font-size: 12px; padding: 4px 10px; border-radius: 99px; text-transform: uppercase; letter-spacing: .04em; background: #F1EEE6; }
.status-recue { background: #FFF2D6; color: #8A5A00; }
.status-acceptee, .status-recuperee { background: #E6EEFB; color: #1D4E89; }
.status-en_route { background: var(--ink); color: var(--gold-2); }
.status-livree { background: #E3F4EA; color: var(--ok); }
.status-annulee { background: #FBE9E9; color: var(--danger); }

/* Livraison */
.hero-card { display: block; position: relative; border-radius: 22px; overflow: hidden; min-height: 300px; text-decoration: none; color: #fff; box-shadow: var(--shadow-lg); background: var(--ink); }
.hero-card img { color: transparent; position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: transform .6s; }
.hero-card:hover img { transform: scale(1.04); }
.hero-overlay { position: relative; padding: 22px; min-height: 300px; display: flex; flex-direction: column; justify-content: flex-end; align-items: flex-start; gap: 6px; background: linear-gradient(180deg, rgba(17, 17, 17, .05) 15%, rgba(17, 17, 17, .9) 75%); }
.hero-overlay h2 { font-size: 34px; color: var(--gold-2); margin: 4px 0 0; }
.hero-overlay p { opacity: .9; max-width: 480px; }
.quick-links { display: grid; gap: 10px; margin-top: 14px; }
.quick, .menu-link { display: flex; align-items: center; gap: 12px; padding: 14px; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); text-decoration: none; box-shadow: var(--shadow); }
.quick > svg:first-child, .menu-link > svg:first-child { width: 42px; height: 42px; padding: 10px; border-radius: 12px; background: var(--ink); color: var(--gold-2); }
.quick span, .menu-link span { flex: 1; min-width: 0; }
.quick b, .menu-link b { display: block; }
.quick small, .menu-link small { color: var(--muted); font-size: 13px; }
.chev { color: #B9B2A2; }
.mode-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.mode-card { background: #fff; border: 1px dashed #D8D1C0; border-radius: var(--radius); padding: 14px; display: flex; flex-direction: column; gap: 6px; }
.mode-card.disabled { filter: grayscale(1); opacity: .62; }
.mode-card small { color: var(--muted); font-size: 12.5px; flex: 1; }
.mode-card .btn { width: 100%; }
.mode-ic { width: 44px; height: 44px; border-radius: 12px; background: #EFEDE8; display: grid; place-items: center; }

.products { display: flex; flex-direction: column; gap: 10px; }
.product { display: flex; align-items: center; gap: 12px; padding: 8px; border: 1px solid var(--line); border-radius: 14px; }
.product img { color: transparent; width: 60px; height: 60px; border-radius: 10px; object-fit: cover; background: var(--gold-soft); }
.product-txt { flex: 1; min-width: 0; }
.product-txt b { display: block; line-height: 1.25; }
.product-txt small { color: var(--gold); font-weight: 700; font-size: 14px; }
.stepper { display: flex; align-items: center; gap: 4px; background: var(--bg-2); border-radius: 12px; padding: 3px; }
.stepper button { width: 42px; height: 42px; border: 0; border-radius: 10px; background: #fff; display: grid; place-items: center; cursor: pointer; box-shadow: 0 1px 3px rgba(0, 0, 0, .08); }
.stepper button[data-d="1"] { background: var(--ink); color: var(--gold-2); }
.stepper output { min-width: 28px; text-align: center; font: 800 20px var(--f-title); }
.addr-chips { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; }
.addr-chips .chip { --c: var(--gold); box-shadow: none; }
.summary .sum-total { display: flex; justify-content: space-between; align-items: baseline; padding: 12px 0 4px; border-top: 2px solid var(--ink); margin-top: 8px; }
.sum-total b { font: 800 30px var(--f-title); color: var(--ink); }
.sum-row { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; border-bottom: 1px dashed var(--line); font-size: 14.5px; }
.sum-row span { color: var(--muted); }
.sum-row b { text-align: right; }
.loading-line { color: var(--muted); padding: 10px 0; }

.track-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; margin-bottom: 10px; }
.track-head small { color: var(--muted); font-size: 12.5px; }
.track-head h3 { margin: 2px 0 0; }
.eta { display: flex; align-items: center; gap: 12px; background: var(--ink); color: #fff; border-radius: 14px; padding: 12px 14px; margin-bottom: 12px; }
.eta small { display: block; font-size: 11.5px; opacity: .7; text-transform: uppercase; letter-spacing: .05em; }
.eta b { font: 800 28px/1 var(--f-title); color: var(--gold-2); }
.progress { flex: 1; height: 8px; background: rgba(255, 255, 255, .15); border-radius: 9px; overflow: hidden; }
.progress i { display: block; height: 100%; background: linear-gradient(90deg, var(--gold), var(--gold-2)); border-radius: 9px; transition: width 1.8s linear; }
.progress.big { background: var(--bg-2); height: 12px; margin: 14px 0 6px; flex: none; }
.banner { display: flex; gap: 8px; align-items: center; padding: 10px 12px; border-radius: 12px; background: var(--gold-soft); color: #6B4E0B; font-weight: 600; font-size: 14px; margin-bottom: 12px; }
.banner-ok { background: #E3F4EA; color: var(--ok); }
.banner-danger { background: #FBE9E9; color: var(--danger); }
.timeline { list-style: none; padding: 0; margin: 6px 0 12px; }
.timeline li { display: flex; gap: 12px; align-items: flex-start; position: relative; padding-bottom: 14px; color: #A49D8D; }
.timeline li:not(:last-child)::after { content: ''; position: absolute; left: 13px; top: 28px; bottom: 0; width: 2px; background: var(--line); }
.timeline li.done::after { background: var(--gold); }
.tl-dot { width: 28px; height: 28px; border-radius: 50%; border: 2px solid var(--line); display: grid; place-items: center; flex: none; background: #fff; }
.tl-dot svg { width: 15px; height: 15px; stroke-width: 3; }
.timeline li.done, .timeline li.now { color: var(--ink); }
.timeline li.done .tl-dot { background: var(--gold); border-color: var(--gold); color: #fff; }
.timeline li.now .tl-dot { background: var(--ink); border-color: var(--ink); color: var(--gold-2); box-shadow: 0 0 0 5px rgba(232, 185, 49, .3); }
.tl-txt b { display: block; font-size: 14.5px; }
.tl-txt small { font-size: 12px; color: var(--muted); }
.rider-card { cursor: pointer; }
.rider-card.sel { border: 2px solid var(--gold); }

/* Menu, profil */
.profile { display: flex; gap: 14px; align-items: center; padding: 16px; background: var(--ink); color: #fff; border-radius: 20px; margin-bottom: 14px; }
.profile b { font: 700 22px var(--f-title); display: block; }
.profile small { color: #CFC8B6; }
.avatar { width: 56px; height: 56px; border-radius: 50%; display: grid; place-items: center; background: linear-gradient(160deg, var(--gold-2), var(--gold)); color: #1A1203; font: 800 26px var(--f-title); }
.menu-group { display: flex; flex-direction: column; gap: 8px; margin-bottom: 14px; }
.menu-link.danger > svg:first-child { background: #FBE9E9; color: var(--danger); }
.menu-link.danger b { color: var(--danger); }
.sign { text-align: center; color: var(--muted); font-size: 13px; margin-top: 18px; }
.place-head { display: flex; gap: 14px; align-items: flex-start; margin-bottom: 10px; }
.place-head small { color: var(--muted); text-transform: uppercase; letter-spacing: .04em; font-size: 12px; font-weight: 600; }
.place-head h2 { margin: 2px 0 4px; }

/* Bienvenue */
.welcome-hero { min-height: 300px; padding: 36px 22px 26px; color: #fff; background-size: cover; background-position: center; display: flex; flex-direction: column; justify-content: flex-end; }
.welcome-logo { border-radius: 18px; margin-bottom: 16px; box-shadow: 0 8px 24px rgba(0, 0, 0, .4); }
.welcome-hero h1 { font-size: 44px; font-weight: 800; color: var(--gold-2); margin: 0; }
.welcome-hero h1 span { color: #fff; font-size: 22px; letter-spacing: .12em; }
.welcome-hero p { font-size: 16px; margin: 8px 0 0; opacity: .92; }
.welcome .page-inner { margin-top: -14px; position: relative; }

/* Pages légales */
.legal h3 { margin-top: 18px; font-size: 19px; }
.legal ul { padding-left: 20px; margin: 0 0 .8em; }
.legal li { margin-bottom: 4px; }
.del-list { background: #FDF5F5; border-radius: 12px; padding: 12px 12px 12px 32px; }
.modal-icon { width: 60px; height: 60px; border-radius: 18px; display: grid; place-items: center; background: var(--gold-soft); color: var(--gold); margin: 0 auto 12px; }
.modal-icon svg { width: 30px; height: 30px; }
.modal-icon.danger { background: #FBE9E9; color: var(--danger); }

/* Fenêtres */
.modal-backdrop { position: fixed; inset: 0; background: rgba(17, 17, 17, .55); z-index: 2000; display: flex; align-items: flex-end; justify-content: center; opacity: 0; transition: opacity .18s; padding: 0; }
.modal-backdrop.show { opacity: 1; }
.modal { background: #fff; width: 100%; max-width: 460px; border-radius: 22px 22px 0 0; padding: 22px 18px calc(18px + var(--safe-b)); transform: translateY(30px); transition: transform .2s; max-height: 92vh; overflow-y: auto; text-align: center; }
.modal-wide { max-width: 620px; text-align: left; }
.modal-backdrop.show .modal { transform: none; }
.modal h3 { font-size: 24px; }
.modal p { color: var(--muted); }
.modal-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 16px; }

.toast { position: fixed; left: 50%; bottom: calc(var(--tabs) + 18px + var(--safe-b)); transform: translate(-50%, 20px); background: var(--ink); color: #fff; padding: 12px 18px; border-radius: 14px; font-weight: 600; font-size: 14.5px; box-shadow: var(--shadow-lg); opacity: 0; pointer-events: none; transition: all .22s; z-index: 3000; max-width: calc(100% - 32px); text-align: center; border-left: 4px solid var(--gold-2); }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.error { border-left-color: #FF6B6B; }

/* Tirer pour actualiser */
.ptr { height: 0; overflow: hidden; display: flex; align-items: center; justify-content: center; gap: 8px; color: var(--muted); font-size: 13px; font-weight: 600; transition: height .2s; }
.ptr svg { width: 18px; height: 18px; color: var(--gold); }
.ptr.ready svg { transform: rotate(180deg); transition: transform .2s; }
.ptr.loading svg { animation: spin .8s linear infinite; }

/* Admin */
.admin-banner { color: #fff; padding: 22px 18px; background-size: cover; background-position: center 35%; }
.admin-banner small { color: var(--gold-3); text-transform: uppercase; letter-spacing: .08em; font-weight: 600; font-size: 12px; }
.admin-banner h2 { color: #fff; font-size: 30px; margin: 2px 0 10px; }
.admin-kpis { display: flex; flex-wrap: wrap; gap: 8px; }
.admin-kpis span { background: rgba(255, 255, 255, .12); border: 1px solid rgba(255, 255, 255, .18); padding: 6px 12px; border-radius: 99px; font-size: 13px; }
.admin-kpis b { color: var(--gold-2); font-size: 15px; }
.tabs { display: flex; gap: 6px; overflow-x: auto; padding: 10px 14px; background: #fff; border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 5; scrollbar-width: none; }
.tabs button { flex: none; display: flex; gap: 6px; align-items: center; height: 42px; padding: 0 14px; border-radius: 12px; border: 1px solid var(--line); background: #fff; font-weight: 600; cursor: pointer; }
.tabs button svg { width: 18px; height: 18px; color: var(--gold); }
.tabs button.on { background: var(--ink); color: #fff; border-color: var(--ink); }
.toolbar { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; align-items: center; }
.search-mini { flex: 1 1 200px; display: flex; align-items: center; gap: 6px; border: 1.5px solid var(--line); border-radius: 12px; padding-left: 12px; background: #fff; }
.search-mini input { border: 0 !important; box-shadow: none !important; height: 44px !important; }
.search-mini svg { color: var(--muted); width: 18px; height: 18px; }
.table { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.row { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-bottom: 1px solid #F3EFE6; }
.row:last-child { border-bottom: 0; }
.row-main { flex: 1; min-width: 0; }
.row-main b { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row-main small { color: var(--muted); font-size: 12.5px; }
.switch { appearance: none; width: 46px; height: 28px; border-radius: 99px; background: #DDD6C6; position: relative; cursor: pointer; flex: none; transition: background .2s; }
.switch::after { content: ''; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .25); transition: left .2s; }
.switch:checked { background: var(--ok); }
.switch:checked::after { left: 21px; }
.grid-cards { display: grid; gap: 14px; }
.grid-cards .card { margin: 0; }
.pin-input { text-align: center; font-size: 28px !important; letter-spacing: .4em; height: 60px !important; margin: 10px 0; }
.file-btn { position: relative; }
.sticky-save { position: sticky; bottom: 10px; z-index: 5; margin-top: 16px; }

/* ---------- Ordinateur ---------- */
@media (min-width: 1024px) {
  .sidebar { display: flex; flex-direction: column; width: 260px; flex: none; background: var(--ink); color: #fff; padding: 20px 14px; border-right: 3px solid var(--gold); }
  .brand { display: flex; gap: 12px; align-items: center; text-decoration: none; padding: 4px 8px 22px; }
  .brand img { border-radius: 10px; }
  .brand b { display: block; font: 800 24px/1 var(--f-title); color: var(--gold-2); }
  .brand small { color: #CFC8B6; font-size: 12.5px; }
  .side-nav { display: flex; flex-direction: column; gap: 4px; }
  .side-link { display: flex; gap: 12px; align-items: center; padding: 12px 14px; border-radius: 12px; text-decoration: none; color: #D9D3C4; font-weight: 600; }
  .side-link:hover { background: rgba(255, 255, 255, .06); }
  .side-link.on { background: linear-gradient(180deg, var(--gold-2), var(--gold)); color: #1A1203; }
  .side-foot { margin-top: auto; font-size: 13px; color: #9E978A; line-height: 1.6; padding: 0 8px; }
  .side-foot span { color: var(--gold-2); font-weight: 700; letter-spacing: .06em; }
  .tabbar { display: none; }
  .topbar { background: #fff; color: var(--ink); border-bottom: 1px solid var(--line); }
  .topbar .icon-btn:hover { background: var(--bg-2); }
  .back-btn { background: var(--bg-2); border: 1px solid var(--line); }
  .topbar-home .logo-title { display: none; }
  .topbar-home .topbar-title::after { content: 'Carte de Lomé'; }
  .logo-title small { color: var(--muted); }
  .toast { bottom: 30px; }
  .no-tabs .sidebar { display: none; }

  .map-top { left: 20px; right: auto; width: 560px; top: 16px; }
  .map-sheet { left: 20px; right: auto; bottom: 20px; width: 420px; border-radius: 22px; }
  .map-sheet::before { display: none; }
  .map-fabs { bottom: 30px; right: 20px; }
  .map-page .leaflet-bottom.leaflet-right { bottom: 150px; }
  .map-page .leaflet-control-zoom { display: block; margin-right: 18px; }

  .page-split { flex-direction: row; height: 100%; }
  .split-form { width: 480px; flex: none; overflow-y: auto; padding: 18px; margin: 0; max-width: none; }
  .split-map { flex: 1; padding: 18px 18px 18px 0; max-width: none; margin: 0; }
  .split-map .map-box { height: 100%; }
  .page-inner { padding: 24px 28px 40px; max-width: 1080px; }
  .page-inner.narrow { max-width: 440px; }
  .list { display: grid; grid-template-columns: 1fr 1fr; }
  .mode-grid { grid-template-columns: repeat(3, 1fr); }
  .quick-links { grid-template-columns: 1fr 1fr; }
  .hero-card, .hero-overlay { min-height: 340px; }
  .grid-cards { grid-template-columns: 1fr 1fr; }
  .modal-backdrop { align-items: center; }
  .modal { border-radius: 22px; }
  .welcome { display: grid; grid-template-columns: 1.1fr 1fr; min-height: 100%; }
  .welcome-hero { min-height: 100%; padding: 60px; }
  .welcome-hero h1 { font-size: 72px; }
  .welcome .page-inner { margin: auto; width: 100%; max-width: 520px; }
  .menu-group { display: grid; grid-template-columns: 1fr 1fr; }
}

@media (max-width: 380px) {
  .result-grid b { font-size: 21px; }
  .sheet-actions { grid-template-columns: 1fr; }
  .big-action { min-height: 58px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

.empty .btn { margin: 4px; }

/* Le calque des itinéraires Leaflet est un SVG : il ne doit pas hériter du style des icônes */
.leaflet-overlay-pane svg { width: auto; height: auto; stroke: none; stroke-width: 0; max-width: none; }
.leaflet-overlay-pane svg path { stroke-linecap: round; stroke-linejoin: round; }
/* Une seule croix d'effacement dans les champs de recherche */
input[type=search]::-webkit-search-cancel-button { -webkit-appearance: none; display: none; }
