:root {
  --ink: #111111;
  --ink-2: #3d3d3d;
  --muted: #6b6b6b;
  --line: #e6e4df;
  --bg: #ffffff;
  --soft: #f6f5f2;
  --accent: #f89820;
  --accent-ink: #9a4f00;
  --ok: #0f7b4a;
  --ok-bg: #e5f5ec;
  --warn: #8a5300;
  --warn-bg: #fff2dc;
  --err: #b42318;
  --err-bg: #fdecea;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(0,0,0,.05), 0 8px 24px rgba(0,0,0,.06);
  --font: "Figtree", system-ui, -apple-system, "Segoe UI", sans-serif;
  --display: "Outfit", var(--font);
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.5 var(--font); min-height: 100vh; display: flex; flex-direction: column; }
main { flex: 1; }
a { color: inherit; }
img { max-width: 100%; }
h1, h2, h3 { font-family: var(--display); line-height: 1.15; margin: 0 0 .5em; letter-spacing: -.01em; }
h1 { font-size: clamp(1.7rem, 4vw, 2.6rem); }
h2 { font-size: 1.35rem; }
h3 { font-size: 1.1rem; }
p { margin: 0 0 1em; }
.container { width: 100%; max-width: 1080px; margin: 0 auto; padding: 24px 16px 48px; }
.narrow { max-width: 480px; margin-left: auto; margin-right: auto; }
.muted { color: var(--muted); }
.small { font-size: .875rem; }
.center { text-align: center; }
.inline { display: inline; margin: 0; }
.mt { margin-top: 1rem; }
.stack > * + * { margin-top: 12px; }
.row { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.grid2 { display: grid; gap: 12px; grid-template-columns: 1fr 1fr; }
@media (max-width: 560px) { .grid2 { grid-template-columns: 1fr; } }

/* Barre du haut */
.topbar { position: sticky; top: 0; z-index: 1000; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 16px; background: var(--ink); color: #fff; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; font-family: var(--display); font-weight: 700; font-size: 1.15rem; }
.nav { display: flex; align-items: center; gap: 18px; }
.nav a, .linklike { color: #e9e9e9; text-decoration: none; font-weight: 500; font-size: .95rem; background: none; border: 0; padding: 0; cursor: pointer; font-family: inherit; }
.nav a:hover, .linklike:hover, .nav a[aria-current] { color: #fff; text-decoration: underline; text-underline-offset: 4px; }
.nav .btn { color: var(--ink); text-decoration: none; }
.burger { display: none; background: none; border: 0; padding: 8px; cursor: pointer; }
.burger span { display: block; width: 22px; height: 2px; background: #fff; margin: 4px 0; }
@media (max-width: 760px) {
  .burger { display: block; }
  .nav { display: none; position: absolute; top: 100%; left: 0; right: 0; flex-direction: column; align-items: stretch; gap: 0; background: var(--ink); padding: 8px 16px 16px; }
  .nav.open { display: flex; }
  .nav a, .nav .linklike { padding: 12px 0; border-bottom: 1px solid #2a2a2a; text-align: left; width: 100%; }
  .nav .btn { margin-top: 10px; text-align: center; border: 0; }
}

/* Boutons & formulaires */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; background: var(--ink); color: #fff; border: 2px solid var(--ink); border-radius: 999px; padding: 12px 22px; font: 600 1rem var(--font); text-decoration: none; cursor: pointer; transition: transform .08s, background .15s; }
.btn:hover { background: #2b2b2b; }
.btn:active { transform: scale(.98); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn-accent { background: var(--accent); border-color: var(--accent); color: var(--ink); }
.btn-accent:hover { background: #ffad42; }
.btn-ghost { background: transparent; color: var(--ink); }
.btn-ghost:hover { background: var(--soft); }
.btn-danger { background: #fff; color: var(--err); border-color: var(--err); }
.btn-danger:hover { background: var(--err-bg); }
.btn-sm { padding: 7px 14px; font-size: .9rem; background: var(--accent); border-color: var(--accent); color: var(--ink); }
.btn-block { width: 100%; }
label { display: block; font-weight: 600; font-size: .92rem; margin-bottom: 6px; }
.field { margin-bottom: 14px; }
input, select, textarea { width: 100%; font: 1rem var(--font); color: var(--ink); background: #fff; border: 1.5px solid var(--line); border-radius: 10px; padding: 11px 12px; }
input:focus, select:focus, textarea:focus, button:focus-visible, a:focus-visible { outline: 3px solid rgba(248,152,32,.45); outline-offset: 1px; border-color: var(--accent); }
.check { display: flex; gap: 10px; align-items: flex-start; font-weight: 400; }
.check input { width: auto; margin-top: 4px; }
.hint { color: var(--muted); font-size: .85rem; margin-top: 4px; }

.card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow); }
.flash { max-width: 1080px; margin: 0 auto 14px; padding: 12px 16px; border-radius: 10px; font-weight: 500; }
.flash-ok { background: var(--ok-bg); color: var(--ok); }
.flash-error { background: var(--err-bg); color: var(--err); }
.flash-info { background: var(--warn-bg); color: var(--warn); }
.badge { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: .8rem; font-weight: 600; white-space: nowrap; }
.badge-ok { background: var(--ok-bg); color: var(--ok); }
.badge-warn { background: var(--warn-bg); color: var(--warn); }
.badge-done { background: var(--ink); color: #fff; }
.badge-muted { background: var(--soft); color: var(--muted); }
.notice { background: var(--warn-bg); color: var(--warn); border-radius: 10px; padding: 12px 14px; font-size: .92rem; }

/* Accueil : commande */
.book { display: grid; grid-template-columns: 420px 1fr; min-height: calc(100vh - 54px); }
.book-panel { padding: 28px 24px; overflow-y: auto; max-height: calc(100vh - 54px); }
.book-panel h1 { font-size: 2rem; }
.book-map { position: sticky; top: 54px; height: calc(100vh - 54px); background: #e9eef0; }
@media (max-width: 860px) {
  .book { grid-template-columns: 1fr; }
  .book-map { position: relative; top: 0; height: 40vh; min-height: 260px; order: -1; }
  .book-panel { max-height: none; padding: 20px 16px 32px; }
  .book-panel h1 { font-size: 1.6rem; }
}
.places { position: relative; border: 1.5px solid var(--line); border-radius: var(--radius); background: #fff; }
.place { position: relative; display: flex; align-items: center; gap: 10px; padding: 4px 8px 4px 14px; }
.place + .place { border-top: 1px solid var(--line); }
.place input { border: 0; padding: 12px 4px; }
.place input:focus { outline: none; }
.places:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(248,152,32,.25); }
.dot { width: 10px; height: 10px; border-radius: 50%; background: var(--ink); flex: none; }
.dot.sq { border-radius: 2px; background: var(--accent); }
.locate { background: none; border: 0; cursor: pointer; padding: 8px; border-radius: 8px; color: var(--ink-2); font-size: .85rem; font-weight: 600; white-space: nowrap; }
.locate:hover { background: var(--soft); }
.suggest { position: absolute; left: -1px; right: -1px; top: 100%; z-index: 500; background: #fff; border: 1.5px solid var(--line); border-radius: 0 0 var(--radius) var(--radius); box-shadow: var(--shadow); list-style: none; margin: 0; padding: 4px 0; max-height: 300px; overflow-y: auto; }
.suggest li { padding: 10px 14px; cursor: pointer; }
.suggest li[aria-selected="true"], .suggest li:hover { background: var(--soft); }
.suggest small { display: block; color: var(--muted); }
.when-label { margin: 14px 0 6px; font-weight: 600; font-size: .9rem; color: var(--ink-2); }
.when { display: flex; gap: 0; margin: 0 0 14px; padding: 4px; background: var(--soft); border-radius: 12px; }
.chip { flex: 1; border: 0; background: transparent; border-radius: 9px; padding: 8px 12px; font: 600 .92rem var(--font); color: var(--muted); cursor: pointer; }
.chip[aria-pressed="true"] { background: #fff; color: var(--ink); box-shadow: 0 1px 3px rgba(0,0,0,.12); }
.vehicles { display: grid; gap: 10px; margin: 14px 0; }
.vehicle { display: flex; align-items: center; gap: 14px; border: 1.5px solid var(--line); border-radius: var(--radius); padding: 12px 14px; cursor: pointer; background: #fff; text-align: left; font: inherit; width: 100%; }
.vehicle[aria-pressed="true"] { border-color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); }
.vehicle .vimg { width: 58px; flex: none; }
.vehicle .vinfo { flex: 1; }
.vehicle strong { font-size: 1.02rem; }
.vehicle .vprice { font-family: var(--display); font-weight: 700; font-size: 1.25rem; }
.trip-meta { color: var(--muted); font-size: .9rem; margin: 6px 0 0; }
.breakdown { font-size: .88rem; color: var(--ink-2); margin: 6px 0 0; padding: 10px 12px; background: var(--soft); border-radius: 10px; }
.breakdown div { display: flex; justify-content: space-between; gap: 12px; padding: 2px 0; }
details summary { cursor: pointer; font-size: .9rem; font-weight: 600; color: var(--ink-2); }
.perks { list-style: none; padding: 0; margin: 22px 0 0; display: grid; gap: 10px; font-size: .93rem; color: var(--ink-2); }
.perks li { display: flex; gap: 10px; }
.perks li::before { content: ""; flex: none; width: 18px; height: 18px; margin-top: 2px; border-radius: 50%; background: var(--accent) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23111' stroke-width='3.5'%3E%3Cpath d='M5 12l5 5 9-10'/%3E%3C/svg%3E") center/12px no-repeat; }

/* Marqueurs carte */
.pin { width: 18px; height: 18px; border-radius: 50%; background: var(--ink); border: 4px solid #fff; box-shadow: 0 1px 6px rgba(0,0,0,.35); }
.pin.to { background: var(--accent); border-radius: 4px; }

/* Listes de courses */
.rides { display: grid; gap: 12px; }
.ride { display: grid; grid-template-columns: 1fr auto; gap: 6px 16px; align-items: start; padding: 16px 18px; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; text-decoration: none; }
a.ride:hover { border-color: var(--ink); }
.ride .route { font-weight: 600; }
.ride .route span { color: var(--muted); font-weight: 400; }
.ride .price { font-family: var(--display); font-weight: 700; font-size: 1.2rem; text-align: right; }
.ride .meta { color: var(--muted); font-size: .88rem; }
.ride .actions { grid-column: 1 / -1; display: flex; gap: 8px; flex-wrap: wrap; margin-top: 6px; }
.timeline { list-style: none; padding: 0; margin: 16px 0; }
.timeline li { position: relative; padding: 0 0 14px 26px; color: var(--muted); }
.timeline li::before { content: ""; position: absolute; left: 4px; top: 6px; width: 10px; height: 10px; border-radius: 50%; background: var(--line); }
.timeline li.done { color: var(--ink); }
.timeline li.done::before { background: var(--ink); }
.timeline li.now { color: var(--ink); font-weight: 700; }
.timeline li.now::before { background: var(--accent); box-shadow: 0 0 0 4px rgba(248,152,32,.3); }
.ride-map { height: 260px; border-radius: var(--radius); overflow: hidden; margin-bottom: 16px; }
.driver-card { display: flex; gap: 14px; align-items: center; padding: 14px; background: var(--soft); border-radius: var(--radius); }
.avatar { width: 46px; height: 46px; border-radius: 50%; background: var(--ink); color: #fff; display: grid; place-items: center; font-weight: 700; flex: none; }
.kv { display: grid; grid-template-columns: 140px 1fr; gap: 6px 12px; font-size: .95rem; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; }

/* Admin */
.tabs { display: flex; gap: 6px; flex-wrap: wrap; margin: 0 0 18px; border-bottom: 1px solid var(--line); }
.tabs a { padding: 10px 14px; text-decoration: none; font-weight: 600; color: var(--muted); border-bottom: 3px solid transparent; margin-bottom: -1px; }
.tabs a[aria-current] { color: var(--ink); border-color: var(--accent); }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; margin-bottom: 20px; }
.stat { padding: 16px; border: 1px solid var(--line); border-radius: var(--radius); }
.stat b { display: block; font-family: var(--display); font-size: 1.7rem; }
.stat span { color: var(--muted); font-size: .88rem; }
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); }
table { width: 100%; border-collapse: collapse; font-size: .92rem; }
th, td { padding: 10px 12px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: top; }
th { background: var(--soft); font-weight: 600; white-space: nowrap; }
tr:last-child td { border-bottom: 0; }
td form { display: inline; }
td .btn { padding: 5px 12px; font-size: .85rem; }
.settings-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 0 16px; }
fieldset { border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px 6px; margin: 0 0 18px; }
legend { font-weight: 700; padding: 0 6px; }

.footer { background: var(--soft); border-top: 1px solid var(--line); font-size: .9rem; color: var(--ink-2); }
.footer-in { display: flex; justify-content: space-between; gap: 24px; flex-wrap: wrap; padding-bottom: 24px; }
.footer-links { display: flex; flex-direction: column; gap: 6px; }
.prose { max-width: 760px; }
.prose h2 { margin-top: 1.6em; }

@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }
@media (max-width: 480px) { .kv { grid-template-columns: 96px 1fr; } }
