/* SafeCraft 1.4.0 — style de TrackR : fond lavande avec halo, grandes cartes blanches, accent violet en dégradé.
   Thème clair ou sombre sur <html data-theme> (assets/js/theme.js). Les noms historiques restent : --gold = accent. */

:root {
  --bg: #f5f7fd;
  --surface: #ffffff;
  --surface-2: #f1f4fc;
  --surface-3: #e9edf9;
  --field: #ffffff;
  --hover: #f2effe;
  --line: #e4e9f4;
  --line-2: #d8dfee;
  --ink: #18213b;
  --ink-2: #3e4a66;
  --muted: #66748f;
  --faint: #8b97aa;
  --gold: #8156ea;
  --gold-strong: #6d45d9;
  --gold-ink: #5b3cc4;
  --gold-soft: #ebe4fd;
  --gold-tint: #f6f3ff;
  --grad: linear-gradient(100deg, #925df3, #627bf8);
  --grad-shadow: 0 8px 21px rgba(116, 70, 222, .26);
  --black: #18213b;
  --danger: #c9445a;
  --danger-soft: #fdecef;
  --ok: #189761;
  --ok-soft: #e1f5ea;
  --warn: #a8601c;
  --warn-soft: #fdf0e2;
  --info: #346cf6;
  --info-soft: #e7eefe;
  --violet: #7854ed;
  --violet-soft: #efe9fd;
  --vip: #7a5a08;
  --vip-soft: #f6ecd0;
  --now: #e5484d;
  --nav-bg: #ffffff;
  --glass: rgba(255, 255, 255, .86);
  --glow: radial-gradient(circle at 92% -8%, rgba(118, 90, 217, .11), transparent 34%);
  --toast: #18213b;
  --toast-accent: #c4b5fd;
  --backdrop: rgba(16, 20, 40, .32);
  --focus: rgba(129, 86, 234, .2);
  --cal-half: #f0f3fa;
  --today-bg: #f8f6ff;
  --night: rgba(233, 237, 249, .5);
  --tl: #cbbdfb;
  --r-lg: 22px;
  --r: 16px;
  --r-sm: 13px;
  --sh-1: 0 1px 2px rgba(24, 33, 59, .04), 0 8px 30px rgba(8, 12, 35, .045);
  --sh-2: 0 14px 40px rgba(8, 12, 35, .1);
  --sh-3: 0 28px 80px rgba(20, 24, 60, .24);
  --font: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --hour: 56px;
  --sidebar: 248px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  color-scheme: light;
}
:root[data-theme=dark] {
  --bg: #0a1020;
  --surface: #151d32;
  --surface-2: #1b2440;
  --surface-3: #232f4b;
  --field: #1b2440;
  --hover: #222c4a;
  --line: #2a3552;
  --line-2: #384967;
  --ink: #f8f9ff;
  --ink-2: #d3d9ea;
  --muted: #a5b1ca;
  --faint: #7785a3;
  --gold: #a78bfa;
  --gold-strong: #b69cff;
  --gold-ink: #cdbdff;
  --gold-soft: rgba(135, 89, 245, .26);
  --gold-tint: rgba(135, 89, 245, .12);
  --grad: linear-gradient(100deg, #9759f9, #6d6bff);
  --grad-shadow: 0 8px 22px rgba(108, 70, 230, .4);
  --black: #f8f9ff;
  --danger: #ff8a99;
  --danger-soft: rgba(255, 138, 153, .14);
  --ok: #4fd8a0;
  --ok-soft: rgba(41, 217, 145, .13);
  --warn: #ffb07a;
  --warn-soft: rgba(255, 175, 120, .14);
  --info: #69b9ff;
  --info-soft: rgba(105, 185, 255, .14);
  --violet: #b6a0ff;
  --violet-soft: rgba(182, 160, 255, .14);
  --vip: #f0d48a;
  --vip-soft: rgba(230, 196, 111, .16);
  --now: #ff6b6b;
  --nav-bg: #0c1324;
  --glass: rgba(16, 23, 42, .86);
  --glow: radial-gradient(circle at 92% -8%, rgba(118, 90, 217, .2), transparent 36%);
  --toast: #263450;
  --backdrop: rgba(2, 5, 14, .62);
  --focus: rgba(167, 139, 250, .3);
  --cal-half: #19223c;
  --today-bg: rgba(135, 89, 245, .07);
  --night: rgba(4, 8, 18, .32);
  --tl: #4c3f93;
  --sh-1: 0 1px 2px rgba(0, 0, 0, .25), 0 10px 30px rgba(3, 8, 18, .28);
  --sh-2: 0 16px 44px rgba(3, 8, 18, .5);
  --sh-3: 0 30px 90px rgba(0, 0, 0, .62);
  color-scheme: dark;
}

/* Couleurs des chauffeurs : --c (vif), --c-bg (fond doux), --c-ink (texte) */
.c-gold { --c: #c9a13d; --c-bg: #f6ecd0; --c-ink: #5f4708; }
.c-blue { --c: #3a72b5; --c-bg: #e2ecf8; --c-ink: #1d426e; }
.c-green { --c: #3b8a58; --c-bg: #dff0e5; --c-ink: #1d5232; }
.c-plum { --c: #8957b6; --c-bg: #eee5f8; --c-ink: #523075; }
.c-rose { --c: #c2557d; --c-bg: #f8e2ea; --c-ink: #7a2a48; }
.c-teal { --c: #278c8c; --c-bg: #dcf0ef; --c-ink: #135454; }
.c-orange { --c: #cf772a; --c-bg: #fae8d8; --c-ink: #7a4112; }
.c-slate { --c: #5b6a79; --c-bg: #e7ebf0; --c-ink: #2e3944; }
.c-none { --c: #a19d91; --c-bg: #f1efe8; --c-ink: #5c594f; }
/* Sombre : fond teinté de la couleur, texte éclairci (même repère visuel, contraste suffisant). */
:root[data-theme=dark] :is(.c-gold, .c-blue, .c-green, .c-plum, .c-rose, .c-teal, .c-orange, .c-slate, .c-none) { --c-bg: color-mix(in srgb, var(--c) 26%, #151d32); --c-ink: color-mix(in srgb, var(--c) 42%, #fff); }

/* --- Base ---------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body { margin: 0; min-height: 100dvh; background: var(--glow) fixed, var(--bg); color: var(--ink); font: 15px/1.45 var(--font); letter-spacing: -.012em; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; -webkit-tap-highlight-color: transparent; }
body.is-driver { font-size: 16px; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; text-align: inherit; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, p { margin: 0; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.i { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.num { font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.eyebrow { font-size: 11px; font-weight: 750; letter-spacing: .16em; text-transform: uppercase; color: var(--faint); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Écran de démarrage */
.boot { min-height: 100dvh; display: grid; place-items: center; }
.boot .logo { width: 62px; height: 56px; animation: pulse 1.4s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .45; transform: scale(.96); } }
.fatal { max-width: 420px; margin: 18vh auto 0; padding: 0 20px; text-align: center; display: flex; flex-direction: column; gap: 12px; align-items: center; }

/* --- Boutons --------------------------------------------------------------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 38px; padding: 0 15px; border-radius: var(--r-sm); border: 1px solid var(--line-2); background: var(--surface); color: var(--ink); font-size: 14px; font-weight: 600; white-space: nowrap; user-select: none; transition: background .15s, border-color .15s, box-shadow .15s, transform .06s; }
.btn:hover { background: var(--hover); }
.btn:active { transform: translateY(1px); }
.btn:disabled, .btn.is-busy { opacity: .55; cursor: default; pointer-events: none; }
.btn .i { width: 17px; height: 17px; }
.btn-primary, .btn-gold { background: var(--grad); border-color: transparent; color: #fff; box-shadow: var(--grad-shadow); }
.btn-primary:hover, .btn-gold:hover { background: var(--grad); filter: brightness(1.06); }
.btn-ghost { border-color: transparent; background: transparent; }
.btn-ghost:hover { background: var(--hover); }
.btn-danger { color: var(--danger); border-color: color-mix(in srgb, var(--danger) 35%, transparent); }
.btn-danger:hover { background: var(--danger-soft); }
.btn-danger-solid { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn-danger-solid:hover { background: var(--danger); filter: brightness(.92); }
.btn-ok { background: var(--ok); border-color: var(--ok); color: #fff; }
.btn-ok:hover { background: var(--ok); filter: brightness(.92); }
.btn-sm { height: 32px; padding: 0 12px; font-size: 13px; border-radius: 10px; }
.btn-lg { height: 46px; padding: 0 20px; font-size: 15.5px; border-radius: var(--r); }
.btn-block { width: 100%; }
.btn-icon { display: inline-grid; place-items: center; width: 38px; height: 38px; border-radius: var(--r-sm); color: var(--ink-2); flex: none; transition: background .15s, color .15s; }
.btn-icon:hover { background: var(--hover); color: var(--ink); }
.btn-icon.is-bordered { border: 1px solid var(--line-2); background: var(--surface); }
.btn-icon.is-bordered:hover { background: var(--hover); }
.btn-icon.sm { width: 32px; height: 32px; border-radius: 9px; }
.btn-icon.danger { color: var(--danger); }
.btn-icon.danger:hover { background: var(--danger-soft); }

/* --- Champs ---------------------------------------------------------------- */
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field > span:first-child, .lbl { font-size: 12.5px; font-weight: 650; color: var(--ink-2); }
.field input:not([type=checkbox]):not([type=radio]), .field select, .field textarea, .input {
  width: 100%; height: 42px; padding: 0 12px; border: 1px solid var(--line-2); border-radius: var(--r-sm); background: var(--field); font-size: 15px; transition: border-color .15s, box-shadow .15s; -webkit-appearance: none; appearance: none; }
.field textarea { height: auto; min-height: 76px; padding: 10px 12px; resize: vertical; line-height: 1.45; }
.field select { padding-right: 34px; background: var(--field) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%236c695f' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m4 6 4 4 4-4'/%3E%3C/svg%3E") no-repeat right 11px center; }
.field input[type=date], .field input[type=time] { min-width: 0; }
.field input::placeholder, .field textarea::placeholder { color: var(--faint); }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--gold) !important; box-shadow: 0 0 0 3px var(--focus); }
.field.has-error input, .field.has-error select, .field.has-error textarea, .field.has-error .stepper { border-color: var(--danger); box-shadow: 0 0 0 3px color-mix(in srgb, var(--danger) 16%, transparent); }
.field .err { font-size: 12.5px; color: var(--danger); font-weight: 600; }
.field .hint { font-size: 12px; color: var(--muted); }
.check { display: flex; align-items: center; gap: 10px; font-size: 14px; color: var(--ink-2); cursor: pointer; }
.check input { width: 18px; height: 18px; accent-color: var(--gold); margin: 0; }
.pw { position: relative; display: block; }
.pw input { padding-right: 46px !important; }
.pw .btn-icon { position: absolute; right: 5px; top: 5px; }
.form-error { padding: 10px 12px; border-radius: var(--r-sm); background: var(--danger-soft); color: var(--danger); font-size: 13.5px; font-weight: 600; }
.ac { position: relative; }

.stepper { display: flex; align-items: center; height: 42px; border: 1px solid var(--line-2); border-radius: var(--r-sm); background: var(--field); overflow: hidden; }
.stepper button { width: 40px; height: 100%; display: grid; place-items: center; color: var(--ink-2); font-size: 20px; line-height: 1; flex: none; }
.stepper button:hover { background: var(--hover); }
.field .stepper input:not([type=checkbox]):not([type=radio]) { flex: 1; min-width: 0; height: 100%; padding: 0; border: 0; border-radius: 0; box-shadow: none !important; text-align: center; font-weight: 700; -moz-appearance: textfield; }
.stepper input::-webkit-inner-spin-button, .stepper input::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }

.switch-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface-2); cursor: pointer; }
.switch-row b { display: block; font-size: 14px; }
.switch-row small { display: block; font-size: 12.5px; color: var(--muted); }
.switch { position: relative; width: 44px; height: 26px; flex: none; }
.switch input { position: absolute; inset: 0; margin: 0; opacity: 0; cursor: pointer; z-index: 1; }
.switch span { position: absolute; inset: 0; border-radius: 999px; background: var(--line-2); transition: background .2s; }
.switch span::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .2); transition: transform .2s; }
.switch input:checked + span { background: var(--grad); }
.switch input:checked + span::after { transform: translateX(18px); }
.switch input:focus-visible + span { outline: 2px solid var(--gold); outline-offset: 2px; }

.radios { display: flex; flex-wrap: wrap; gap: 6px; }
.radio-chip { position: relative; display: inline-flex; align-items: center; gap: 8px; height: 38px; padding: 0 13px 0 6px; border: 1px solid var(--line-2); border-radius: 999px; background: var(--surface); font-size: 13.5px; font-weight: 600; cursor: pointer; transition: border-color .15s, background .15s; }
.radio-chip.no-av { padding-left: 13px; }
.radio-chip input { position: absolute; opacity: 0; pointer-events: none; }
.radio-chip:hover { background: var(--hover); }
.radio-chip:has(input:checked) { border-color: var(--gold); box-shadow: inset 0 0 0 1px var(--gold); background: var(--gold-tint); color: var(--gold-ink); }
.radio-chip:has(input:focus-visible) { outline: 2px solid var(--gold); outline-offset: 2px; }

.swatches { display: flex; gap: 8px; flex-wrap: wrap; }
.swatch { position: relative; width: 32px; height: 32px; border-radius: 50%; background: var(--c); cursor: pointer; box-shadow: inset 0 0 0 2px rgba(255, 255, 255, .6); }
.swatch input { position: absolute; opacity: 0; pointer-events: none; }
.swatch:has(input:checked) { box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--black); }
.swatch:has(input:focus-visible) { outline: 2px solid var(--gold); outline-offset: 4px; }

.suggest { position: absolute; left: 0; right: 0; top: calc(100% + 4px); z-index: 30; padding: 4px; background: var(--surface); border: 1px solid var(--line-2); border-radius: var(--r); box-shadow: var(--sh-2); max-height: 264px; overflow-y: auto; }
.suggest button { display: flex; flex-direction: column; align-items: flex-start; gap: 1px; width: 100%; padding: 8px 10px; border-radius: 8px; }
.suggest button:hover, .suggest button[aria-selected=true] { background: var(--surface-3); }
.suggest b { font-size: 14px; font-weight: 650; }
.suggest small { font-size: 12px; color: var(--muted); }
.suggest .tag { color: var(--gold-strong); font-weight: 650; }

/* --- Petits éléments ------------------------------------------------------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--sh-1); }
.badge { display: inline-flex; align-items: center; gap: 5px; height: 22px; padding: 0 8px; border-radius: 999px; background: var(--surface-3); color: var(--ink-2); font-size: 12px; font-weight: 650; white-space: nowrap; }
.badge .i { width: 13px; height: 13px; }
.badge.gold { background: var(--gold-soft); color: var(--gold-ink); }
.badge.warn { background: var(--warn-soft); color: var(--warn); }
.badge.info { background: var(--info-soft); color: var(--info); }
.badge.violet { background: var(--violet-soft); color: var(--violet); }
.badge.ok { background: var(--ok-soft); color: var(--ok); }
.badge.danger { background: var(--danger-soft); color: var(--danger); }
.av { display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: var(--c-bg); color: var(--c-ink); font-size: 11.5px; font-weight: 750; letter-spacing: .02em; line-height: 1; flex: none; }
.av.sm { width: 22px; height: 22px; font-size: 9.5px; }
.av.lg { width: 56px; height: 56px; font-size: 19px; }
.av.xl { width: 72px; height: 72px; font-size: 24px; }
.seg { display: inline-flex; gap: 2px; padding: 4px; border-radius: 14px; background: var(--surface-2); border: 1px solid var(--line); }
.seg button { height: 32px; padding: 0 14px; border-radius: 10px; font-size: 13.5px; font-weight: 650; color: var(--muted); white-space: nowrap; transition: color .15s, background .15s; }
.seg button:hover { color: var(--ink); }
.seg button[aria-pressed=true] { background: var(--surface); color: var(--gold-ink); box-shadow: 0 1px 2px rgba(8, 12, 35, .08), 0 4px 12px rgba(8, 12, 35, .05); }
.seg.wide { display: flex; }
.seg.wide button { flex: 1; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip { display: inline-flex; align-items: center; gap: 7px; height: 32px; padding: 0 12px 0 10px; border-radius: 999px; border: 1px solid var(--line-2); background: var(--surface); font-size: 13px; font-weight: 650; color: var(--ink-2); white-space: nowrap; transition: background .15s, border-color .15s; }
.chip:hover { background: var(--hover); }
.chip .dot { width: 9px; height: 9px; border-radius: 50%; background: var(--c, var(--faint)); }
.chip .count { font-size: 12px; font-weight: 650; color: var(--muted); }
.chip[aria-pressed=true] { background: var(--grad); border-color: transparent; color: #fff; box-shadow: var(--grad-shadow); }
.chip[aria-pressed=true] .count { color: rgba(255, 255, 255, .72); }
.chip.is-none .dot { background: transparent; box-shadow: inset 0 0 0 1.5px var(--faint); }
.chip .warn-t, .cal-dh .warn-t { font-size: 11px; }
.chip[aria-pressed=true] .warn-t { color: #ffd08a; }
.empty { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 44px 20px; text-align: center; color: var(--muted); }
.empty > .i { width: 34px; height: 34px; color: var(--gold); stroke-width: 1.5; }
.empty b { color: var(--ink); font-size: 16px; }
.empty .btn { margin-top: 8px; }
.skel { border-radius: var(--r); background: linear-gradient(90deg, var(--surface-3) 0, var(--surface-2) 50%, var(--surface-3) 100%); background-size: 200% 100%; animation: shimmer 1.3s linear infinite; }
@keyframes shimmer { to { background-position: -200% 0; } }
.skel-list { display: flex; flex-direction: column; gap: 10px; }
.skel-list .skel { height: 74px; }
.section-t { margin: 20px 0 8px; font-size: 11px; font-weight: 750; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; margin: 0; font-size: 13.5px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; font-weight: 600; min-width: 0; overflow-wrap: anywhere; }

/* --- Structure ------------------------------------------------------------- */
.shell { min-height: 100dvh; display: grid; grid-template-columns: var(--sidebar) minmax(0, 1fr); padding-left: env(safe-area-inset-left, 0px); padding-right: env(safe-area-inset-right, 0px); }
.side { position: sticky; top: 0; height: 100dvh; display: flex; flex-direction: column; gap: 6px; padding: 26px 15px 14px; border-right: 1px solid var(--line); background: var(--nav-bg); }
.brand { display: flex; align-items: center; gap: 12px; padding: 2px 8px 22px; }
.logo { width: 40px; height: 36px; flex: none; color: var(--ink); } /* emblème SafeCraft, en noir */
.brand-word { display: block; width: 116px; height: 13px; color: var(--ink); }
.brand-txt small { display: block; margin-top: 5px; font-size: 11.5px; color: var(--muted); }
.nav { display: flex; flex-direction: column; gap: 3px; }
.nav a { display: flex; align-items: center; gap: 12px; height: 42px; padding: 0 12px; border-radius: var(--r-sm); color: var(--muted); font-size: 14.5px; font-weight: 600; transition: background .18s, color .18s; }
.nav a:hover { background: var(--surface-2); color: var(--ink); }
.nav a[aria-current=page] { background: linear-gradient(98deg, color-mix(in srgb, var(--gold) 15%, transparent), color-mix(in srgb, var(--gold) 6%, transparent)); color: var(--gold-ink); }
.nav a[aria-current=page] .i { color: var(--gold); }
.nav a[aria-current=page]:not(:has(.nav-badge:not([hidden])))::after { content: ""; width: 6px; height: 6px; margin-left: auto; border-radius: 50%; background: var(--gold); }
.nav-badge { margin-left: auto; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; background: var(--grad); color: #fff; font: 750 11.5px/20px var(--font); text-align: center; font-style: normal; }
.side-foot { margin-top: auto; display: flex; align-items: center; gap: 4px; padding-top: 10px; border-top: 1px solid var(--line); }
.me { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0; padding: 6px; border-radius: var(--r-sm); }
.me:hover, .me[aria-current=page] { background: var(--surface-2); }
.me-txt { min-width: 0; }
.me-txt b { display: block; font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.me-txt small { display: block; font-size: 12px; color: var(--muted); }
.main { min-width: 0; }
.utility-bar { position: relative; z-index: 35; display: flex; align-items: center; justify-content: flex-end; gap: 10px; padding: 16px 30px 0; }
.crumb { margin-right: auto; display: flex; align-items: center; gap: 8px; min-width: 0; font-size: 11px; font-weight: 750; letter-spacing: .16em; text-transform: uppercase; color: var(--faint); white-space: nowrap; }
.crumb b { font-weight: 750; }
.crumb i { font-style: normal; opacity: .6; }
.theme-pill { display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 14px; border: 1px solid var(--line-2); border-radius: 999px; background: var(--surface); color: var(--ink); font-size: 13.5px; font-weight: 650; transition: border-color .15s, box-shadow .15s; }
.theme-pill .i { width: 17px; height: 17px; color: var(--gold); }
.theme-pill:hover { border-color: var(--gold); box-shadow: 0 0 0 4px var(--gold-tint); }
.top-date { color: var(--muted); font-size: 13.5px; white-space: nowrap; }
.global-search { position: relative; display: flex; align-items: center; width: min(360px, 100%); height: 40px; padding: 0 10px 0 13px; border: 1px solid var(--line-2); border-radius: 14px; background: var(--surface); transition: border-color .15s, box-shadow .15s, background .15s; }
.global-search:focus-within { border-color: var(--gold); background: var(--surface); box-shadow: 0 0 0 3px var(--focus); }
.global-search > .i { width: 18px; height: 18px; margin-right: 8px; color: var(--muted); }
.global-search input { flex: 1; min-width: 0; height: 100%; padding: 0; border: 0; outline: 0; background: transparent; font-size: 14px; }
.global-search input::-webkit-search-cancel-button { display: none; }
.search-clear { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 9px; color: var(--muted); }
.search-clear:hover { background: var(--hover); color: var(--ink); }
.search-clear .i { width: 16px; height: 16px; }
.utility-btn { position: relative; display: grid; place-items: center; width: 40px; height: 40px; border: 1px solid var(--line-2); border-radius: 50%; background: var(--surface); color: var(--ink-2); }
.utility-btn:hover, .utility-btn[aria-expanded=true] { background: var(--gold-tint); color: var(--gold-strong); border-color: var(--gold-soft); }
.utility-btn em { position: absolute; top: -5px; right: -5px; min-width: 19px; height: 19px; padding: 0 5px; border: 2px solid var(--bg); border-radius: 999px; background: var(--danger); color: #fff; font: 800 10px/15px var(--font); text-align: center; font-style: normal; }
.notif-wrap { position: relative; }
.search-pop, .notif-pop { position: absolute; top: calc(100% + 8px); z-index: 60; overflow: hidden; border: 1px solid var(--line); border-radius: 18px; background: var(--surface); box-shadow: var(--sh-3); }
.search-pop { left: 0; right: 0; max-height: min(520px, 68dvh); overflow-y: auto; }
.notif-pop { right: 0; width: min(390px, calc(100vw - 28px)); }
.search-result { display: grid; grid-template-columns: 68px minmax(0, 1fr); gap: 12px; width: 100%; padding: 12px 14px; border-bottom: 1px solid var(--line); text-align: left; }
.search-result:last-child { border-bottom: 0; }
.search-result:hover, .notif-item:hover { background: var(--surface-2); }
.search-result > span { min-width: 0; }
.search-result b, .search-result small { display: block; }
.search-result small { margin-top: 2px; color: var(--muted); font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.search-date b { font-size: 16px; font-variant-numeric: tabular-nums; }
.search-date small { font-size: 11.5px; white-space: normal; overflow: visible; text-overflow: clip; }
.pop-loading, .pop-empty { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 26px 18px; color: var(--muted); text-align: center; font-size: 13px; }
.pop-empty b { color: var(--ink); font-size: 14px; }
.pop-empty .i { width: 26px; height: 26px; margin-bottom: 4px; color: var(--ok); }
.pop-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.pop-head b, .pop-head small { display: block; }
.pop-head small { margin-top: 1px; color: var(--muted); font-size: 12px; }
.pop-head button { color: var(--gold-strong); font-size: 12px; font-weight: 750; }
.notif-list { max-height: min(470px, 62dvh); overflow-y: auto; }
.notif-item { display: grid; grid-template-columns: 8px minmax(0, 1fr) 18px; align-items: center; gap: 10px; width: 100%; padding: 13px 14px; border-bottom: 1px solid var(--line); text-align: left; }
.notif-item:last-child { border-bottom: 0; }
.notif-item .notif-dot { width: 7px; height: 7px; border-radius: 50%; background: transparent; }
.notif-item.is-unread .notif-dot { background: var(--gold); box-shadow: 0 0 0 4px var(--gold-soft); }
.notif-item b, .notif-item small { display: block; }
.notif-item small { margin-top: 2px; color: var(--muted); font-size: 12.5px; }
.notif-item > .i { width: 16px; height: 16px; color: var(--faint); }
.view { padding: 22px 30px 30px; outline: none; }
.tabbar { display: none; }
.offline { position: fixed; top: 0; left: 0; right: 0; z-index: 60; padding: 7px 12px; background: var(--warn-soft); color: var(--warn); font-size: 13px; font-weight: 650; text-align: center; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 14px; flex-wrap: wrap; margin-bottom: 18px; }
.page-head h1 { font-size: 30px; line-height: 1.1; letter-spacing: -.045em; font-weight: 800; }
.page-head .eyebrow { margin-bottom: 4px; }
.page-head p { margin-top: 4px; color: var(--muted); }

/* --- Agenda (gérant) ------------------------------------------------------- */
.agenda { display: flex; flex-direction: column; gap: 12px; height: calc(100dvh - 106px); min-height: 580px; }
.ag-bar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.ag-nav { display: flex; align-items: center; gap: 6px; }
.ag-title { margin: 0 6px; white-space: nowrap; }
.ag-title .ag-kicker { display: block; margin-bottom: 2px; color: var(--faint); font-size: 11px; font-weight: 750; letter-spacing: .12em; text-transform: uppercase; }
.ag-title b { display: block; font-size: 24px; font-weight: 800; letter-spacing: -.045em; }
.ag-filter-toggle { display: inline-flex; align-items: center; gap: 7px; height: 34px; padding: 0 12px; border: 1px solid var(--line-2); border-radius: 999px; color: var(--ink-2); font-size: 13px; font-weight: 700; }
.ag-spacer { flex: 1; }
.ag-sub { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.ag-stats { display: flex; gap: 14px; flex-wrap: wrap; font-size: 13px; color: var(--muted); }
.ag-stats b { color: var(--ink); font-weight: 750; }
.ag-stats .warn b { color: var(--warn); }
.ag-body { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.ag-body.is-scroll { overflow-y: auto; }
.ag-body.is-loading { opacity: .6; transition: opacity .2s; }

.cal { flex: 1; min-height: 0; display: flex; flex-direction: column; overflow: hidden; }
.cal-head { display: grid; grid-template-columns: 58px repeat(var(--cols), minmax(0, 1fr)); border-bottom: 1px solid var(--line); background: var(--surface-2); border-radius: var(--r-lg) var(--r-lg) 0 0; }
.cal-dh { display: flex; align-items: center; justify-content: center; gap: 7px; height: 52px; padding: 0 6px; border-left: 1px solid var(--line); font-size: 13px; font-weight: 650; color: var(--muted); min-width: 0; }
.cal-dh.is-link { cursor: pointer; }
.cal-dh.is-link:hover { background: var(--hover); }
.cal-dh b { color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cal-dh .dnum { display: inline-grid; place-items: center; min-width: 30px; height: 30px; padding: 0 5px; border-radius: 999px; color: var(--ink); font-size: 16px; font-weight: 750; }
.cal-dh.is-today .dnum { background: var(--grad); color: #fff; box-shadow: var(--grad-shadow); }
.cal-dh.is-today .dow { color: var(--ink); }
.cal-dh .dcount { min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; background: var(--surface-3); font-size: 11.5px; line-height: 20px; text-align: center; color: var(--muted); }
.cal-scroll { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; }
.cal-grid { position: relative; display: grid; grid-template-columns: 58px repeat(var(--cols), minmax(0, 1fr)); }
.cal-hours { position: relative; height: calc(var(--hour) * 24); }
.cal-hours span { position: absolute; right: 9px; transform: translateY(-50%); font-size: 11.5px; color: var(--faint); font-variant-numeric: tabular-nums; }
.cal-col { position: relative; height: calc(var(--hour) * 24); border-left: 1px solid var(--line); cursor: cell;
  background-image: repeating-linear-gradient(to bottom, var(--line) 0, var(--line) 1px, transparent 1px, transparent var(--hour)),
    repeating-linear-gradient(to bottom, transparent 0, transparent calc(var(--hour) / 2), var(--cal-half) calc(var(--hour) / 2), var(--cal-half) calc(var(--hour) / 2 + 1px), transparent calc(var(--hour) / 2 + 1px), transparent var(--hour)); }
.cal-col.is-today { background-color: var(--today-bg); }
.cal-col.is-night::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: calc(var(--hour) * 5); background: var(--night); pointer-events: none; }
.ghost { position: absolute; left: 3px; right: 3px; top: var(--top); height: calc(var(--hour) / 2); border-radius: 8px; border: 1.5px dashed var(--gold); background: var(--gold-tint); color: var(--gold-ink); font-size: 11.5px; font-weight: 700; padding: 2px 7px; pointer-events: none; z-index: 0; }
.now { position: absolute; left: -1px; right: 0; top: var(--top); height: 2px; background: var(--now); z-index: 5; pointer-events: none; }
.now::before { content: ""; position: absolute; left: -5px; top: -4px; width: 10px; height: 10px; border-radius: 50%; background: var(--now); }

.ev { position: absolute; z-index: 1; top: var(--top); height: var(--h); left: calc(3px + var(--i) * (100% - 6px) / var(--n)); width: calc((100% - 6px) / var(--n) - 3px);
  display: flex; flex-direction: column; gap: 1px; padding: 5px 24px 5px 8px; border-radius: 10px; background: var(--c-bg); color: var(--c-ink); overflow: hidden; text-align: left;
  box-shadow: 0 0 0 1px var(--surface), 0 1px 2px rgba(8, 12, 35, .06); transition: box-shadow .15s, transform .15s; cursor: pointer; }
.ev:hover { z-index: 4; box-shadow: 0 0 0 1px var(--surface), 0 8px 18px rgba(8, 12, 35, .18); }
.ev-time { font-size: 11.5px; font-weight: 700; font-variant-numeric: tabular-nums; opacity: .85; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* Colonne étroite (semaine sur tablette, courses simultanées) : l'heure prend toute la largeur. */
.ev { container-type: inline-size; }
@container (max-width: 80px) { /* largeur utile, hors marges : bloc de 112 px ou moins */
  .ev .ev-av, .ev .ev-end { display: none; }
  .ev:not(.is-short) > :is(.ev-time, .ev-title, .ev-route), .ev.is-short > .ev-title { margin-right: -16px; }
}
@container (max-width: 24px) { /* bloc de 56 px ou moins : l'heure garde ses 5 caractères */
  .ev:not(.is-short) > :is(.ev-time, .ev-title, .ev-route) { margin-left: -6px; margin-right: -22px; }
  .ev .ev-time { font-size: 10px; }
}
.ev-title { font-size: 13px; font-weight: 750; line-height: 1.2; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ev-route { font-size: 12px; line-height: 1.25; opacity: .9; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.ev-av { position: absolute; top: 5px; right: 5px; display: grid; place-items: center; width: 18px; height: 18px; border-radius: 50%; background: var(--c); color: #fff; font-size: 8.5px; font-weight: 800; }
.ev-new { position: absolute; right: 9px; bottom: 7px; width: 7px; height: 7px; border-radius: 50%; background: var(--gold); box-shadow: 0 0 0 2px var(--surface); }
.ev.is-short { flex-direction: row; align-items: center; gap: 6px; padding-top: 0; padding-bottom: 0; }
.ev.is-short .ev-av { top: 50%; transform: translateY(-50%); }
.ev.st-pending { outline: 1.5px dashed var(--c); outline-offset: -1.5px; }
.ev.st-done { opacity: .62; }
.ev.st-cancelled { opacity: .45; }
.ev.st-cancelled .ev-title { text-decoration: line-through; }
.ev.c-none { background: var(--surface); outline: 1.5px dashed var(--line-2); outline-offset: -1.5px; }

.month { flex: 1; min-height: 0; display: grid; grid-template-rows: auto repeat(6, minmax(0, 1fr)); overflow: hidden; }
.m-dow { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); border-bottom: 1px solid var(--line); background: var(--surface-2); border-radius: var(--r-lg) var(--r-lg) 0 0; }
.m-dow span { padding: 10px 12px; font-size: 11.5px; font-weight: 750; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.m-row { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); border-bottom: 1px solid var(--line); min-height: 0; }
.m-row:last-child { border-bottom: 0; }
.m-cell { min-width: 0; min-height: 0; display: flex; flex-direction: column; gap: 3px; padding: 6px 6px 4px; border-left: 1px solid var(--line); overflow: hidden; cursor: pointer; text-align: left; }
.m-cell:first-child { border-left: 0; }
.m-cell:hover { background: var(--surface-2); }
.m-cell.is-other { background: var(--surface-2); }
.m-cell.is-other .m-num { color: var(--faint); }
.m-num { align-self: flex-start; display: inline-grid; place-items: center; min-width: 26px; height: 26px; padding: 0 4px; border-radius: 999px; font-size: 13px; font-weight: 750; }
.m-cell.is-today .m-num { background: var(--grad); color: #fff; }
.m-evs { display: flex; flex-direction: column; gap: 3px; min-height: 0; }
.m-ev { display: flex; flex: none; align-items: center; gap: 6px; height: 22px; padding: 0 7px; border-radius: 6px; background: var(--c-bg); color: var(--c-ink); font-size: 12px; font-weight: 600; white-space: nowrap; overflow: hidden; }
.m-ev b { font-variant-numeric: tabular-nums; font-weight: 750; }
.m-ev span { overflow: hidden; text-overflow: ellipsis; color: var(--ink); }
.m-ev.st-cancelled { opacity: .45; text-decoration: line-through; }
.m-ev.st-pending { outline: 1.5px dashed var(--c); outline-offset: -1.5px; }
.m-more { padding: 0 7px; font-size: 12px; font-weight: 650; color: var(--muted); }
/* Mois sur ordinateur : une semaine chargée garde ses pastilles entières (3 + « autres ») ; la page défile si besoin. */
@media (min-width: 761px) {
  .agenda:has(.month-wrap) { height: auto; min-height: calc(100dvh - 106px); }
  .month { grid-template-rows: auto repeat(6, minmax(min-content, 1fr)); }
}

.list { display: flex; flex-direction: column; gap: 22px; padding-bottom: 12px; }
.l-day h3 { display: flex; align-items: baseline; gap: 8px; margin: 0 0 9px; font-size: 15.5px; font-weight: 750; }
.l-day h3 small { font-size: 13px; font-weight: 600; color: var(--muted); }
.l-day.is-today h3 { color: var(--gold-ink); }
.l-items { display: flex; flex-direction: column; gap: 8px; }
.trow { display: grid; grid-template-columns: 66px minmax(0, 1fr) auto; align-items: center; gap: 14px; width: 100%; padding: 13px 16px; border: 1px solid var(--line); border-radius: 18px; background: var(--surface); box-shadow: var(--sh-1); text-align: left; transition: border-color .15s, box-shadow .15s; }
.trow:hover { border-color: var(--line-2); box-shadow: var(--sh-2); }
.trow.st-cancelled { opacity: .55; }
.trow.st-cancelled .trow-main b { text-decoration: line-through; }
.trow.st-done { opacity: .72; }
/* 1.5.1 : courses terminées (heure de fin passée) estompées, comme dans Google Agenda. */
:is(.trow, .wk-trip, .ev, .m-ev).is-past { opacity: .5; }
:is(.trow, .wk-trip, .ev, .m-ev).is-past:hover { opacity: .8; }
@keyframes tl-now {
  0% { box-shadow: 0 0 0 2px var(--gold), 0 0 0 2px color-mix(in srgb, var(--gold) 45%, transparent); }
  70%, 100% { box-shadow: 0 0 0 2px var(--gold), 0 0 0 11px color-mix(in srgb, var(--gold) 0%, transparent); }
}
@media (prefers-reduced-motion: reduce) { .trow.is-now::after { animation: none; } }
.trow-time b { display: block; font-size: 19px; font-weight: 750; letter-spacing: -.01em; font-variant-numeric: tabular-nums; }
.trow-time small { display: block; font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.trow-main { min-width: 0; }
.trow-main > b { display: block; font-size: 15px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.trow-side { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
.route { display: flex; align-items: center; gap: 6px; min-width: 0; color: var(--ink-2); font-size: 13.5px; }
.route span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.route .i { width: 14px; height: 14px; color: var(--faint); }
.meta { display: flex; flex-wrap: wrap; gap: 3px 12px; margin-top: 4px; color: var(--muted); font-size: 12.5px; }
.meta span { display: inline-flex; align-items: center; gap: 4px; }
.meta .i { width: 14px; height: 14px; }
.drv { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 650; color: var(--ink-2); white-space: nowrap; }
.drv.is-none { color: var(--muted); }

.wstrip { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
.wday { display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 7px 0 8px; border-radius: var(--r); font-size: 11.5px; font-weight: 650; color: var(--muted); }
.wday b { font-size: 17px; font-weight: 750; color: var(--ink); line-height: 1.1; }
.wday .dots { display: flex; gap: 2px; height: 5px; }
.wday .dots i { width: 5px; height: 5px; border-radius: 50%; background: var(--c); }
.wday.is-today b { color: var(--gold-strong); }
.wday[aria-pressed=true] { background: var(--grad); color: rgba(255, 255, 255, .78); box-shadow: var(--grad-shadow); }
.wday[aria-pressed=true] b { color: #fff; }

/* Semaine sur téléphone (agenda.js mobileWeek) : 7 jours empilés, une ligne par course aux couleurs du chauffeur. */
.wk { display: flex; flex-direction: column; gap: 10px; }
.wk-day { display: flex; flex-direction: column; gap: 6px; padding: 8px; border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface); box-shadow: var(--sh-1); }
.wk-day.is-today { border-color: color-mix(in srgb, var(--gold) 45%, transparent); box-shadow: 0 0 0 3px var(--gold-tint), var(--sh-1); }
.wk-head { display: flex; align-items: baseline; gap: 8px; width: 100%; padding: 4px 6px 2px; text-align: left; }
.wk-head b { font-size: 15px; font-weight: 800; letter-spacing: -.02em; }
.wk-day.is-today .wk-head b { color: var(--gold-ink); }
.wk-head small { color: var(--muted); font-size: 12.5px; }
.wk-head .i { width: 15px; height: 15px; margin-left: auto; align-self: center; color: var(--faint); }
.wk-trip { display: grid; grid-template-columns: 48px minmax(0, 1fr) auto; align-items: center; gap: 10px; width: 100%; padding: 9px 10px; border-radius: 14px; background: var(--c-bg); color: var(--c-ink); text-align: left; }
.wk-time { font-size: 14px; font-weight: 800; font-variant-numeric: tabular-nums; }
.wk-main { min-width: 0; }
.wk-main strong, .wk-main small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wk-main strong { color: var(--ink); font-size: 14px; font-weight: 750; }
.wk-main small { font-size: 12px; opacity: .9; }
.wk-trip .av { background: var(--c); color: #fff; }
.wk-trip.c-none { background: var(--surface-2); outline: 1.5px dashed var(--line-2); outline-offset: -1.5px; }
.wk-trip.st-pending { outline: 1.5px dashed var(--c); outline-offset: -1.5px; }
.wk-trip.st-done { opacity: .62; }
.wk-trip.st-cancelled { opacity: .45; }
.wk-trip.st-cancelled strong { text-decoration: line-through; }

/* --- Panneaux (dialog) ----------------------------------------------------- */
dialog { color: var(--ink); background: var(--surface); }
dialog.sheet { position: fixed; inset: 12px 12px 12px auto; margin: 0; width: min(540px, calc(100vw - 24px)); height: calc(100dvh - 24px); max-width: none; max-height: none; padding: 0; border: 1px solid var(--line); border-radius: 24px; background: var(--surface); box-shadow: var(--sh-3); display: flex; flex-direction: column; overflow: hidden; }
dialog.sheet:not([open]) { display: none; }
dialog.sheet[open] { animation: sheet-in .24s cubic-bezier(.2, .8, .2, 1); }
dialog::backdrop { background: var(--backdrop); }
@keyframes sheet-in { from { transform: translateX(28px); opacity: 0; } }
.sheet-head { display: flex; align-items: flex-start; gap: 12px; padding: 16px 14px 14px 22px; border-bottom: 1px solid var(--line); }
.sheet-title { flex: 1; min-width: 0; padding-top: 5px; }
.sheet-title h2 { font-size: 19px; font-weight: 800; letter-spacing: -.03em; }
.sheet-title p { margin-top: 2px; font-size: 13px; color: var(--muted); }
.sheet-body { flex: 1; overflow-y: auto; padding: 18px 22px 24px; overscroll-behavior: contain; }
.sheet-body:has(+ .sheet-foot[hidden]) { padding-bottom: calc(24px + var(--safe-b)); }
.sheet-foot { display: flex; align-items: center; gap: 8px; padding: 12px 16px calc(12px + var(--safe-b)); border-top: 1px solid var(--line); background: var(--surface-2); }
.sheet-foot .grow { flex: 1; }
dialog.dlg { width: min(430px, calc(100vw - 32px)); padding: 0; border: 1px solid var(--line); border-radius: 22px; box-shadow: var(--sh-3); }
dialog.dlg[open] { animation: dlg-in .18s ease-out; }
@keyframes dlg-in { from { transform: scale(.97); opacity: 0; } }
.dlg-body { padding: 22px 22px 8px; }
.dlg-body h2 { font-size: 18px; font-weight: 750; margin-bottom: 6px; }
.dlg-body p, .dlg-body ul { color: var(--ink-2); font-size: 14.5px; }
.dlg-body ul { margin: 8px 0 0; padding-left: 18px; }
.dlg-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 16px 18px 18px; }

.toasts { position: fixed; inset: auto 0 24px 0; margin: 0 auto; width: max-content; max-width: calc(100vw - 24px); padding: 0; border: 0; background: transparent; overflow: visible; display: flex; flex-direction: column; align-items: center; gap: 8px; z-index: 100; }
.toast { display: flex; align-items: center; gap: 10px; padding: 11px 14px; border-radius: var(--r); background: var(--toast); color: #fff; font-size: 14px; font-weight: 550; box-shadow: var(--sh-3); animation: toast-in .2s ease-out; }
.toast .i { color: var(--toast-accent); }
.toast.is-error { background: #9b2c3c; }
.toast.is-error .i { color: #fff; }
.toast button { margin-left: 6px; color: var(--toast-accent); font-weight: 750; }
.toast.is-out { opacity: 0; transform: translateY(6px); transition: .2s; }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } }

/* --- Détail d'une course --------------------------------------------------- */
.d-hero { display: flex; flex-direction: column; gap: 4px; }
.d-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.d-time { font-size: 34px; font-weight: 800; letter-spacing: -.04em; font-variant-numeric: tabular-nums; line-height: 1.1; }
.d-time small { font-size: 16px; font-weight: 600; color: var(--muted); letter-spacing: 0; }
.d-client { margin-top: 6px; font-size: 21px; font-weight: 750; letter-spacing: -.01em; }
.d-contact { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.itin { position: relative; display: flex; flex-direction: column; gap: 16px; margin: 18px 0 6px; padding: 14px 14px 14px 40px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface-2); }
.itin::before { content: ""; position: absolute; left: 19px; top: 26px; bottom: 30px; border-left: 2px dotted var(--line-2); }
.stop { position: relative; min-width: 0; }
.stop::before { content: ""; position: absolute; left: -27px; top: 3px; width: 12px; height: 12px; border-radius: 50%; border: 3px solid var(--gold); background: var(--surface); }
.stop.to::before { border-color: var(--black); background: var(--black); }
.stop small { display: block; font-size: 12px; font-weight: 650; color: var(--muted); }
.stop b { display: block; font-size: 15px; font-weight: 650; overflow-wrap: anywhere; }
.stop-act { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.meeting { margin-top: 10px; padding: 10px 12px; border-radius: var(--r-sm); background: var(--gold-tint); border: 1px solid var(--gold-soft); font-size: 13.5px; color: var(--ink-2); }
.meeting b { display: inline; font-size: 13.5px; color: var(--gold-ink); }
.facts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-top: 14px; }
.fact { min-width: 0; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--r); }
.fact small { display: flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 650; color: var(--muted); }
.fact small .i { width: 14px; height: 14px; }
.fact b { display: block; margin-top: 2px; font-size: 15px; font-weight: 750; overflow-wrap: anywhere; }
.fact a { color: var(--info); font-size: 12.5px; font-weight: 650; }
.who { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--r); }
.who b { display: block; font-size: 15px; }
.who small { display: block; font-size: 12.5px; color: var(--muted); }
.who .seen { color: var(--ok); }
.who .unseen { color: var(--warn); }
.note { padding: 12px 14px; border-radius: var(--r); background: var(--surface-2); border: 1px solid var(--line); font-size: 14px; white-space: pre-wrap; overflow-wrap: anywhere; }
.note.internal { background: var(--gold-tint); border-color: var(--gold-soft); }
.linked { display: flex; align-items: center; gap: 12px; width: 100%; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--r); text-align: left; }
.linked:hover { background: var(--hover); }
.linked > .i:last-child { margin-left: auto; color: var(--faint); }
.linked b { display: block; font-size: 14px; }
.linked small { display: block; font-size: 12.5px; color: var(--muted); }
.statuses { display: flex; flex-wrap: wrap; gap: 6px; }
.statuses button { height: 32px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--line-2); font-size: 13px; font-weight: 650; color: var(--ink-2); }
.statuses button:hover { background: var(--hover); }
.statuses button[aria-pressed=true] { background: var(--grad); border-color: transparent; color: #fff; box-shadow: var(--grad-shadow); }
.hist { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; font-size: 13px; }
.hist li { display: grid; grid-template-columns: 92px 1fr; gap: 10px; }
.hist time { color: var(--muted); font-variant-numeric: tabular-nums; }
.hist em { font-style: normal; color: var(--muted); }
.drv-act { display: flex; flex-direction: column; gap: 8px; width: 100%; }
.drv-act .row { display: flex; gap: 8px; }
.drv-act .row > * { flex: 1; }

.notice { display: flex; align-items: flex-start; gap: 10px; margin-bottom: 16px; padding: 11px 13px; border-radius: var(--r); font-size: 14px; }
.notice .i { margin-top: 1px; }
.notice.gold { background: var(--gold-tint); border: 1px solid var(--gold-soft); color: var(--gold-ink); }
.notice.warn { background: var(--warn-soft); color: var(--warn); }
.notice.danger { background: var(--danger-soft); color: var(--danger); }
.mt { margin-top: 12px; }
.trow-time, .trow-main { display: block; }
.d-tags-inline { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 4px; }
.d-tags-inline:empty { display: none; }
.dcard-top, .dcard-client { display: flex; }
.dcard .meta, .trow .meta { display: flex; }
.skel.member { height: 210px; border: 0; }

/* --- Formulaire de course -------------------------------------------------- */
/* Sélecteur d'heure (ui.js) : champ « hh:mm » et fenêtre heures / minutes. */
.tp { position: relative; display: block; }
.tp .tp-in { padding-right: 38px !important; font-variant-numeric: tabular-nums; font-weight: 650; cursor: pointer; }
.tp-ic { position: absolute; right: 12px; top: 12px; width: 18px; height: 18px; color: var(--gold); pointer-events: none; }
/* 1.5.1 : cadran façon Android. --d : taille du cadran ; --a et --rr (angle, rayon en fraction de --d) posés par ui.js. */
dialog.tp-dlg { width: min(328px, calc(100vw - 24px)); max-height: calc(100dvh - 24px); padding: 0; border: 1px solid var(--line); border-radius: 28px; background: var(--surface); color: var(--ink); box-shadow: var(--sh-3); overflow: auto; }
dialog.tp-dlg[open] { animation: dlg-in .16s ease-out; }
.tp-card { padding: 20px 22px 16px; }
.tp-title { margin: 0 0 14px; font-size: 12.5px; font-weight: 650; color: var(--muted); }
.tp-head { display: flex; align-items: center; justify-content: center; gap: 4px; }
.tp-box { display: grid; place-items: center; width: 100px; height: 76px; border-radius: 14px; background: var(--surface-2); color: var(--ink); font-size: 52px; font-weight: 450; line-height: 1; letter-spacing: -.02em; font-variant-numeric: tabular-nums; transition: background .15s, color .15s; }
.tp-box[aria-pressed=true] { background: var(--gold-tint); color: var(--gold-ink); box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--gold) 35%, transparent); }
.tp-colon { width: 22px; text-align: center; font-size: 50px; font-weight: 450; line-height: 1; color: var(--ink); }
.tp-dial { --d: 256px; --a: 0deg; --rr: .406; position: relative; width: var(--d); height: var(--d); margin: 22px auto 6px; border-radius: 50%; background: var(--surface-2); touch-action: none; user-select: none; -webkit-user-select: none; cursor: pointer; outline: none; }
.tp-dial:focus-visible { box-shadow: 0 0 0 3px var(--focus); }
.tp-face { position: absolute; inset: 0; }
.tp-face:not([hidden]) { animation: tp-face .2s ease-out; }
@keyframes tp-face { from { opacity: 0; transform: scale(.94); } }
.tp-n { position: absolute; left: 50%; top: 50%; display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; font-size: 15.5px; font-weight: 550; font-variant-numeric: tabular-nums; color: var(--ink); pointer-events: none; transform: translate(-50%, -50%) rotate(var(--a)) translateY(calc(var(--d) * -.406)) rotate(calc(-1 * var(--a))); }
.tp-n.is-in { width: 34px; height: 34px; font-size: 13px; color: var(--ink-2); transform: translate(-50%, -50%) rotate(var(--a)) translateY(calc(var(--d) * -.266)) rotate(calc(-1 * var(--a))); }
.tp-n.is-on { color: #fff; }
.tp-hand, .tp-sel, .tp-hub { position: absolute; pointer-events: none; }
.tp-dial:not(.has-v) :is(.tp-hand, .tp-sel) { display: none; }
.tp-hand { left: calc(50% - 1px); bottom: 50%; width: 2px; height: calc(var(--d) * var(--rr)); border-radius: 1px; background: var(--gold); transform-origin: 50% 100%; transform: rotate(var(--a)); }
.tp-sel { left: 50%; top: 50%; width: 40px; height: 40px; border-radius: 50%; background: var(--gold); box-shadow: 0 4px 14px color-mix(in srgb, var(--gold) 40%, transparent); transform: translate(-50%, -50%) rotate(var(--a)) translateY(calc(var(--d) * var(--rr) * -1)) rotate(calc(-1 * var(--a))); }
.tp-dial.is-in .tp-sel { width: 34px; height: 34px; }
.tp-dial.is-dot .tp-sel::after { content: ""; position: absolute; inset: 0; width: 6px; height: 6px; margin: auto; border-radius: 50%; background: #fff; }
.tp-hub { left: calc(50% - 4px); top: calc(50% - 4px); width: 8px; height: 8px; border-radius: 50%; background: var(--gold); }
.tp-foot { display: flex; align-items: center; justify-content: flex-end; gap: 8px; margin-top: 16px; }
.tp-foot .btn { min-width: 84px; border-radius: 999px; }
.tp-foot .tp-clear { min-width: 0; margin-right: auto; color: var(--muted); }
@media (max-width: 340px) {
  .tp-card { padding: 18px 14px 14px; }
  .tp-dial { --d: 232px; }
  .tp-box { width: 88px; height: 68px; font-size: 46px; }
}
.fsec { padding: 18px 0; border-top: 1px solid var(--line); }
.fsec:first-child { padding-top: 0; border-top: 0; }
.fsec-h { display: flex; align-items: center; gap: 8px; margin: 0 0 12px; font-size: 14.5px; font-weight: 750; }
.fsec-h .i { color: var(--gold-strong); }
.fsec-h small { margin-left: auto; font-size: 12px; font-weight: 600; color: var(--muted); }
.fgrid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.fgrid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.fgrid .full { grid-column: 1 / -1; }
.places { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px 8px; align-items: end; }
.places .field { grid-column: 1; }
.places .swap { grid-column: 2; grid-row: 1 / span 2; align-self: center; }
.ret-box { display: flex; flex-direction: column; gap: 12px; margin-top: 12px; padding: 14px; border-radius: var(--r); border: 1px solid var(--gold-soft); background: var(--gold-tint); }
.ret-route { display: flex; align-items: center; gap: 8px; font-size: 13.5px; color: var(--ink-2); }
.ret-route .i { width: 15px; height: 15px; color: var(--gold-strong); }

/* --- Mes courses (chauffeur) ----------------------------------------------- */
.drv-page { max-width: 760px; }
.hello { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.hello h1 { font-size: 30px; font-weight: 800; letter-spacing: -.045em; }
.hello p.sum { margin-top: 4px; color: var(--ink-2); }
.dgroup { margin-top: 22px; }
.dgroup h2 { display: flex; align-items: baseline; gap: 8px; margin: 0 0 10px; font-size: 16px; font-weight: 750; }
.dgroup h2 small { font-size: 13.5px; font-weight: 600; color: var(--muted); }
.dgroup.is-today h2 { color: var(--gold-ink); }
.dcards { display: flex; flex-direction: column; gap: 10px; }
.dcard { display: block; width: 100%; padding: 17px; border: 1px solid var(--line); border-radius: 22px; background: var(--surface); box-shadow: var(--sh-1); text-align: left; transition: box-shadow .15s, border-color .15s; }
.dcard:hover { border-color: var(--line-2); box-shadow: var(--sh-2); }
.dcard.is-new { border-color: color-mix(in srgb, var(--gold) 45%, transparent); box-shadow: 0 0 0 3px var(--gold-tint), var(--sh-1); }
.dcard.st-cancelled { opacity: .55; }
.dcard.st-cancelled.is-new { opacity: 1; } /* annulation pas encore vue : bien visible jusqu'à l'ouverture */
.dcard.st-cancelled .dcard-client { text-decoration: line-through; }
.dcard-top { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.dcard-time { margin-right: auto; font-size: 28px; font-weight: 800; letter-spacing: -.04em; font-variant-numeric: tabular-nums; line-height: 1.1; }
.dcard-time small { font-size: 14px; font-weight: 600; color: var(--muted); letter-spacing: 0; }
.dcard-client { margin: 6px 0 10px; font-size: 18px; font-weight: 750; }
.vroute { position: relative; display: flex; flex-direction: column; gap: 8px; padding-left: 22px; font-size: 15px; color: var(--ink-2); }
.vroute::before { content: ""; position: absolute; left: 5px; top: 13px; bottom: 13px; border-left: 2px dotted var(--line-2); }
.vroute span { position: relative; overflow-wrap: anywhere; }
.vroute span::before { content: ""; position: absolute; left: -22px; top: 5px; width: 12px; height: 12px; border-radius: 50%; border: 3px solid var(--gold); background: var(--surface); box-sizing: border-box; }
.vroute span.to::before { border-color: var(--black); background: var(--black); }
.dcard .meta { margin-top: 12px; font-size: 13.5px; }

/* --- Équipe, profil -------------------------------------------------------- */
.team { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); gap: 12px; }
.member { display: flex; flex-direction: column; gap: 14px; padding: 16px; }
.member.is-off { opacity: .62; }
.member-top { display: flex; align-items: center; gap: 12px; min-width: 0; }
.member-top > div { flex: 1; min-width: 0; }
.member-top b { display: block; font-size: 16px; }
.member-top small { display: block; color: var(--muted); font-size: 13px; }
.member-top .badge { margin-left: auto; }
.member-act { display: flex; flex-wrap: wrap; gap: 6px; margin-top: auto; }
.member-act .btn { flex: 1 1 150px; min-width: 0; padding-inline: 10px; }
.cred { display: flex; flex-direction: column; gap: 10px; padding: 14px; border-radius: var(--r); background: var(--gold-tint); border: 1px solid var(--gold-soft); }
.cred pre { margin: 0; font: 600 14px/1.5 ui-monospace, SFMono-Regular, Menlo, monospace; white-space: pre-wrap; overflow-wrap: anywhere; }
.cred .row { display: flex; gap: 8px; flex-wrap: wrap; }
.pw-gen { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; }
.profile { max-width: 640px; display: flex; flex-direction: column; gap: 12px; }
.settings-page .page-head { margin-bottom: 2px; }
.preferences-card { gap: 10px; }
.prefs-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-bottom: 2px; }
.p-id { display: flex; align-items: center; gap: 16px; padding: 20px; flex-wrap: wrap; }
.p-id-txt { flex: 1; min-width: 180px; }
.p-id h1 { font-size: 22px; font-weight: 800; letter-spacing: -.035em; }
.p-id p { color: var(--muted); }
.p-sec { padding: 18px 20px; display: flex; flex-direction: column; gap: 12px; }
.p-sec h2 { font-size: 16px; font-weight: 750; }
.p-sec > p { color: var(--muted); font-size: 14px; margin-top: -8px; }
.p-sec form { display: flex; flex-direction: column; gap: 12px; }
.p-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.mail-state { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-radius: var(--r-sm); font-size: 13.5px; }
.mail-state.is-ok { background: var(--ok-soft); color: var(--ok); }
.mail-state.is-off { background: var(--surface-2); color: var(--muted); }
.mail-state b { font-weight: 750; }
.mail-server { grid-template-columns: minmax(0, 1fr) 96px; }
.version { text-align: center; font-size: 12.5px; color: var(--faint); padding: 6px; }

/* --- Connexion ------------------------------------------------------------- */
.login { min-height: 100dvh; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.login-main { display: flex; align-items: center; justify-content: center; padding: 32px 20px; }
.login-card { width: min(390px, 100%); }
.login-card h1 { margin: 34px 0 6px; font-size: 34px; font-weight: 800; letter-spacing: -.05em; }
.login-form { display: flex; flex-direction: column; gap: 16px; margin-top: 26px; }
.login-form .field input:not([type=checkbox]):not([type=radio]) { height: 48px; font-size: 16px; }
.login-help { margin-top: 18px; font-size: 13.5px; color: var(--muted); }
.login-aside { position: relative; margin: 14px; padding: 48px; border-radius: 28px; overflow: hidden; display: flex; flex-direction: column; justify-content: flex-end; gap: 22px;
  background: radial-gradient(90% 70% at 90% 0%, color-mix(in srgb, var(--gold) 22%, transparent) 0%, transparent 70%), linear-gradient(130deg, #dcd9ff, #e7ecff); border: 1px solid var(--line); }
:root[data-theme=dark] .login-aside { background: radial-gradient(90% 70% at 90% 0%, rgba(135, 89, 245, .3) 0%, transparent 70%), linear-gradient(130deg, #1b1f45, #111a33); }
.login-aside h2 { max-width: 460px; font-size: 34px; line-height: 1.08; font-weight: 800; letter-spacing: -.05em; }
.login-aside ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; color: var(--ink-2); font-size: 15px; }
.login-aside li { display: flex; align-items: center; gap: 10px; }
.login-aside li .i { color: var(--gold-strong); }
.la-cards { position: absolute; top: 48px; right: 48px; left: 48px; display: flex; flex-direction: column; gap: 10px; align-items: flex-end; }
.la-card { width: min(330px, 100%); display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 18px; background: var(--glass); border: 1px solid var(--line); box-shadow: var(--sh-2); }
.la-card:nth-child(2) { margin-right: 36px; }
.la-card b { font-size: 18px; font-weight: 750; font-variant-numeric: tabular-nums; }
.la-card > span:not(.av) { flex: 1; min-width: 0; font-size: 13.5px; color: var(--ink-2); }
.la-card > span:not(.av) strong { display: block; color: var(--ink); font-size: 14px; }

/* --- Installation ---------------------------------------------------------- */
.install-page { display: grid; place-items: center; min-height: 100vh; padding: 20px; }
.install-card { width: min(520px, 100%); padding: 28px; border-radius: 20px; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--sh-2); }
.install-card h1 { margin: 18px 0 6px; font-size: 24px; }
.install-card > p { color: var(--ink-2); margin-bottom: 18px; }
.install-card .brand { padding: 0; }
.install-card .brand-name { font-weight: 750; font-size: 16px; }
.brand-mark { width: 36px; height: 36px; background: url(../img/icon.svg) center / contain no-repeat; }
.install-form fieldset { display: flex; flex-direction: column; gap: 10px; margin: 0 0 14px; padding: 14px; border: 1px solid var(--line); border-radius: var(--r); }
.install-form legend { padding: 0 6px; font-size: 13px; font-weight: 750; }
.install-form label { display: flex; flex-direction: column; gap: 5px; font-size: 13px; font-weight: 650; }
.install-form input { height: 42px; padding: 0 12px; border: 1px solid var(--line-2); border-radius: var(--r-sm); font-size: 15px; }

/* --- 1.2.0 : menu groupé, recherche, éléments communs ---------------------- */
.nav-label { margin: 16px 12px 6px; font-size: 10.5px; font-weight: 750; letter-spacing: .14em; text-transform: uppercase; color: var(--faint); }
.nav-label:first-child { margin-top: 0; }
.nav-badge.is-warn { background: #f29d38; }
.pop-label { padding: 10px 14px 4px; font-size: 11px; font-weight: 750; letter-spacing: .08em; text-transform: uppercase; color: var(--faint); }
.search-result.is-client { grid-template-columns: 28px minmax(0, 1fr); align-items: center; }
.search-result.is-client .av { width: 28px; height: 28px; font-size: 11px; }
.search-result.is-cancelled b { text-decoration: line-through; color: var(--muted); }
.page-act { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.sec-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; margin: 28px 0 12px; }
.sec-head h2 { font-size: 20px; font-weight: 800; letter-spacing: -.035em; }
.sec-head p { margin-top: 2px; color: var(--muted); font-size: 13.5px; }
.small { font-size: 12.5px; }
.warn-t { color: var(--warn); font-weight: 650; }
.danger-t { color: var(--danger); }
.badge.vip { background: var(--vip-soft); color: var(--vip); }
.hint .i { width: 13px; height: 13px; vertical-align: -2px; margin-right: 3px; }
.hint[data-client-hint] { color: var(--ok); font-weight: 600; }
.notice.ok { background: var(--ok-soft); color: var(--ok); }
.notice.plain { background: var(--surface-2); color: var(--ink-2); }
/* 1.5.1 : action dans un bandeau (« Annuler l'envoi », « Remettre à envoyer ») */
.notice > span { flex: 1; min-width: 0; }
.notice-act { display: inline-flex; align-items: center; gap: 5px; flex: none; margin: -3px -4px -3px 0; padding: 4px 9px; border-radius: 999px; color: inherit; font-size: 12.5px; font-weight: 700; white-space: nowrap; }
.notice-act .i { width: 14px; height: 14px; margin: 0; }
.notice-act:hover { background: color-mix(in srgb, currentColor 12%, transparent); }
.link-btn { padding: 0; color: var(--gold-strong); font: inherit; font-weight: 700; text-decoration: underline; text-underline-offset: 2px; }
.conf-skip { margin-top: 2px; }
.conf-danger { display: flex; justify-content: flex-end; margin-top: 16px; }
.seg .count { margin-left: 6px; font-size: 12px; font-weight: 650; color: var(--faint); }
.seg button[aria-pressed=true] .count { color: var(--gold-strong); }
.bar { display: block; height: 6px; margin-top: 6px; border-radius: 999px; background: var(--surface-3); overflow: hidden; }
.bar > i { display: block; width: var(--w, 0); height: 100%; border-radius: 999px; background: var(--c, var(--gold)); }
/* Menu du téléphone (1.5.1) : carte du compte, rubriques à pastille, thème, déconnexion. */
dialog.sheet.is-menu { height: auto; max-height: calc(100dvh - 40px); }
.is-menu .sheet-head { position: relative; padding: 18px 12px 4px 20px; border-bottom: 0; }
.is-menu .sheet-head::before { content: ""; position: absolute; left: 50%; top: 7px; width: 36px; height: 4px; margin-left: -18px; border-radius: 2px; background: var(--line-2); }
.is-menu .sheet-title h2 { font-size: 22px; }
.is-menu .sheet-body { padding: 10px 16px calc(16px + var(--safe-b, 0px)); }
.mn { display: flex; flex-direction: column; gap: 12px; }
.mn-me { display: flex; align-items: center; gap: 14px; padding: 16px 16px 16px 14px; border-radius: 22px; background: var(--grad); color: #fff; box-shadow: var(--grad-shadow); }
.mn-me .av { background: rgba(255, 255, 255, .2); color: #fff; box-shadow: inset 0 0 0 2px rgba(255, 255, 255, .35); }
.mn-me-txt { flex: 1; min-width: 0; }
.mn-me-txt b { display: block; font-size: 18px; font-weight: 800; letter-spacing: -.02em; }
.mn-me-txt small { display: block; margin-top: 2px; font-size: 13px; opacity: .85; }
.mn-me > .i { opacity: .8; }
.mn-list { display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: 20px; background: var(--surface); box-shadow: var(--sh-1); overflow: hidden; }
.mn-list a { display: flex; align-items: center; gap: 14px; min-height: 68px; padding: 12px 14px; transition: background .15s; }
.mn-list a + a { border-top: 1px solid var(--line); }
.mn-list a:hover, .mn-list a:active { background: var(--hover); }
.mn-list a[aria-current=page] .mn-txt b { color: var(--gold-strong); }
.mn-ic { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 14px; background: var(--tone-soft); color: var(--tone); flex: none; }
.mn-ic .i { width: 21px; height: 21px; }
.mn-txt { flex: 1; min-width: 0; }
.mn-txt b { display: block; font-size: 16px; font-weight: 700; }
.mn-txt small { display: block; margin-top: 2px; font-size: 12.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mn-list .nav-badge { margin-left: 0; }
.mn-go { color: var(--faint); }
.mn-theme { display: flex; flex-direction: column; gap: 9px; padding: 14px; border: 1px solid var(--line); border-radius: 20px; background: var(--surface); box-shadow: var(--sh-1); }
.mn-theme > b { font-size: 12px; font-weight: 750; letter-spacing: .1em; text-transform: uppercase; color: var(--faint); }
.mn-seg { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 4px; padding: 4px; border-radius: 14px; background: var(--surface-2); }
.mn-seg button { display: flex; align-items: center; justify-content: center; gap: 6px; height: 40px; border-radius: 11px; color: var(--ink-2); font-size: 14px; font-weight: 650; transition: background .15s, color .15s; }
.mn-seg button .i { width: 17px; height: 17px; }
.mn-seg button[aria-pressed=true] { background: var(--grad); color: #fff; box-shadow: var(--grad-shadow); }
.mn-theme small { font-size: 12px; color: var(--muted); }
.mn-logout { display: flex; align-items: center; justify-content: center; gap: 10px; height: 52px; border-radius: 16px; background: var(--danger-soft); color: var(--danger); font-size: 15.5px; font-weight: 700; }
.mn-ver { margin-top: -2px; text-align: center; font-size: 11.5px; color: var(--faint); }

/* --- Listes (clients, confirmations) ------------------------------------------ */
.toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 10px; margin-bottom: 12px; }
.tb-search { display: flex; align-items: center; gap: 8px; flex: 1 1 260px; height: 40px; padding: 0 13px; border: 1px solid var(--line-2); border-radius: var(--r-sm); background: var(--field); }
.tb-search:focus-within { border-color: var(--gold); box-shadow: 0 0 0 3px var(--focus); }
.tb-search .i { width: 17px; height: 17px; color: var(--muted); }
.tb-search input { flex: 1; min-width: 0; height: 100%; border: 0; outline: 0; background: transparent; font-size: 14px; }
.tb-search input::-webkit-search-cancel-button { display: none; }
.clist { overflow: hidden; }
.clist .skel-list { padding: 12px; }
.clist-head, .crow { display: grid; grid-template-columns: minmax(180px, 1.4fr) minmax(150px, 1.1fr) minmax(120px, 1fr) 84px 150px 60px 18px; align-items: center; gap: 14px; padding: 0 18px; }
.clist-head.is-confirm, .crow.is-confirm { grid-template-columns: minmax(180px, 1.2fr) minmax(200px, 1.6fr) 130px minmax(110px, .9fr) 100px 18px; }
.clist-head { height: 44px; border-bottom: 1px solid var(--line); background: var(--surface-2); font-size: 11px; font-weight: 750; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.crow { width: 100%; min-height: 66px; padding-block: 10px; border-bottom: 1px solid var(--line); text-align: left; font-size: 13.5px; }
.crow:hover { background: var(--surface-2); }
.crow > span { min-width: 0; }
.crow b, .crow small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.crow b { font-weight: 700; }
.crow small { margin-top: 1px; color: var(--muted); font-size: 12.5px; }
.crow small.next { color: var(--gold-strong); font-weight: 600; }
.crow-id { display: flex; align-items: center; gap: 11px; }
.crow-id .av { width: 36px; height: 36px; font-size: 12.5px; }
.crow-id > span:last-child { min-width: 0; }
.crow-contact span, .crow-addr, .crow-last span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.crow-addr { color: var(--ink-2); }
.crow-count b { font-size: 16px; font-variant-numeric: tabular-nums; }
.crow-count small { display: inline; }
.crow-send { display: flex; flex-wrap: wrap; gap: 4px; }
.crow-go { width: 16px; height: 16px; color: var(--faint); }
.clist-foot { display: flex; justify-content: space-between; gap: 10px; padding: 12px 18px; color: var(--muted); font-size: 12.5px; }
.clist > .empty { padding-block: 56px; }

/* Fiche client */
.c-hero { display: flex; align-items: center; gap: 16px; }
.c-hero .d-tags { margin-bottom: 0; }
.c-hero .d-contact { margin-top: 8px; }
.card-kv { padding: 14px 16px; border: 1px solid var(--line); border-radius: var(--r); }
.l-items.is-compact .trow { grid-template-columns: 76px minmax(0, 1fr) auto; }
.l-items.is-compact .trow-time b { font-size: 16px; }

/* Détail d'une course : raccourcis du gérant */
.d-links { display: flex; flex-direction: column; gap: 8px; margin-top: 14px; }
.d-links .linked > .badge { margin-left: auto; }
.d-links .linked > .badge + .i { margin-left: 6px; }
.fact.wide { grid-column: 1 / -1; }
.fact.wide span { display: block; margin-top: 1px; }

/* --- Équipe & flotte ------------------------------------------------------- */
.fleet-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); gap: 10px; }
.vehicle { display: grid; grid-template-columns: 42px minmax(0, 1fr) auto; grid-template-rows: auto auto; align-items: center; gap: 4px 12px; width: 100%; padding: 14px 16px; text-align: left; }
.vehicle:hover { border-color: var(--line-2); box-shadow: var(--sh-2); }
.vehicle-ic { grid-row: 1 / 3; display: grid; place-items: center; width: 42px; height: 42px; border-radius: 13px; background: var(--gold-soft); color: var(--gold); }
.vehicle-main { min-width: 0; }
.vehicle-main b { display: block; font-size: 15px; }
.vehicle-main small { display: block; color: var(--muted); font-size: 13px; }
.vehicle-drv { grid-column: 2 / 4; display: flex; align-items: center; gap: 7px; font-size: 13px; font-weight: 650; color: var(--ink-2); }
.fleet > .fleet-list > .empty { grid-column: 1 / -1; }
/* Partenaires (1.5.0) : même carte que la flotte, avec leurs contacts. */
.vehicle.partner { grid-template-columns: 42px minmax(0, 1fr) auto; grid-template-rows: auto; }
.vehicle.partner > .av { grid-row: auto; width: 42px; height: 42px; font-size: 13px; background: var(--c); color: #fff; }
.partner-act { display: flex; gap: 6px; }
.fleet .sec-head { align-items: center; }
.drv-tag { margin-left: 4px; font-size: 11px; font-weight: 650; color: var(--muted); }
.radio-chip.is-partner .muted { font-size: 11.5px; font-weight: 600; }
.radio-chip .av.c-slate, .drv .av.c-slate { background: var(--c); color: #fff; }

/* --- Agenda : résumé du mois ---------------------------------------------------- */
.month-wrap { flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(0, 1fr) 290px; gap: 12px; }
.month-wrap .month { min-height: 0; }
.m-side { display: flex; flex-direction: column; gap: 10px; min-height: 0; overflow-y: auto; }
.m-metrics { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.metric { position: relative; padding: 14px 15px; border: 1px solid var(--line); border-radius: 18px; background: var(--surface); box-shadow: var(--sh-1); }
/* Pastille d'icône des cartes chiffrées, comme TrackR. */
.metric-ic { position: absolute; top: 11px; right: 11px; display: grid; place-items: center; width: 30px; height: 30px; border-radius: 10px; background: var(--tone-soft); color: var(--tone); }
.metric-ic .i { width: 16px; height: 16px; }
.t-violet { --tone: var(--violet); --tone-soft: var(--violet-soft); }
.t-ok { --tone: var(--ok); --tone-soft: var(--ok-soft); }
.t-info { --tone: var(--info); --tone-soft: var(--info-soft); }
.t-warn { --tone: var(--warn); --tone-soft: var(--warn-soft); }
.t-slate { --tone: var(--ink-2); --tone-soft: var(--surface-2); }
.metric small { display: block; padding-right: 34px; font-size: 12px; font-weight: 650; color: var(--muted); }
.metric b { display: block; margin-top: 4px; font-size: 25px; font-weight: 800; letter-spacing: -.045em; font-variant-numeric: tabular-nums; }
.metric span { display: block; margin-top: 2px; font-size: 12px; color: var(--ok); }
.metric span.warn-t { color: var(--warn); }
.m-drivers { padding: 14px; }
.m-drivers-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin-bottom: 6px; }
.m-drivers-head small { color: var(--muted); font-size: 12px; }
.m-drv { display: grid; grid-template-columns: 22px minmax(0, 1fr) 42px; align-items: center; gap: 10px; width: 100%; padding: 9px 4px; border-top: 1px solid var(--line); text-align: left; }
.m-drv:first-of-type { border-top: 0; }
.m-drv:hover { background: var(--surface-2); }
.m-drv-main b { display: block; font-size: 13.5px; }
.m-drv-main small { display: block; font-size: 12px; color: var(--muted); }
.m-drv-pct { text-align: right; font-size: 13px; font-weight: 750; font-variant-numeric: tabular-nums; }

/* --- Confirmation client ---------------------------------------------------- */
.sub-head { justify-content: flex-start; align-items: center; }
.sub-head > div { min-width: 0; }
.conf-layout { display: grid; grid-template-columns: minmax(320px, 400px) minmax(0, 1fr); gap: 16px; align-items: start; }
.conf-side { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.conf-side .notice { margin: 0; }
.conf-steps { display: flex; flex-direction: column; gap: 8px; }
.conf-step { border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); }
.conf-step header { display: flex; align-items: center; gap: 10px; padding: 10px 12px 0; }
.conf-step header b { font-size: 14.5px; }
.conf-step header .btn { margin-left: auto; }
.conf-num { display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: var(--warn-soft); color: var(--warn); font-size: 12.5px; font-weight: 800; flex: none; }
.conf-step.is-ok .conf-num { background: var(--ok-soft); color: var(--ok); }
.conf-step.is-off header > .av { width: 24px; height: 24px; flex: none; } /* trajet annulé : pastille neutre */
.conf-step.is-off header > .av .i { width: 13px; height: 13px; }
.conf-step.is-off .conf-step-body { color: var(--muted); }
.conf-num .i { width: 14px; height: 14px; stroke-width: 2.6; }
.conf-step-body { padding: 8px 12px 12px 46px; }
.kv.tight { gap: 3px 12px; font-size: 13px; }
.conf-opts { display: flex; flex-direction: column; gap: 10px; padding: 14px; }
.conf-actions { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.conf-actions .btn { padding-inline: 8px; }
.conf-preview { position: sticky; top: 16px; overflow: hidden; }
.conf-preview-head { display: flex; align-items: center; justify-content: space-between; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.conf-paper { padding: 22px; background: var(--surface-3); max-height: calc(100dvh - 150px); overflow-y: auto; }

/* Le document envoyé au client (aussi utilisé pour l'impression / PDF) : fond blanc, noir et or de SafeCraft
   (palette de safecraft-transfers.com : or #E6C46F, noir #141414 ; le vert du site est volontairement écarté). */
.doc { container: doc / inline-size; --g: #e6c46f; --gd: #8a6a1f; --ln: #ece6da; --tint: #fbf8f1; --mu: #6b6b6b; max-width: 680px; margin: 0 auto; overflow: hidden; border-radius: 14px; background: #fff; box-shadow: 0 10px 40px rgba(20, 20, 20, .1); color: #141414; font-size: 13.5px; line-height: 1.45; }
:where(.doc) dl, :where(.doc) dd { margin: 0; } /* marges du navigateur (dd décalé de 40 px) */
.doc-head { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: start; gap: 20px; padding: 24px 28px 18px; border-bottom: 3px solid var(--g); }
.doc-logo { display: flex; align-items: center; gap: 12px; color: #141414; }
.doc-mark { width: 44px; height: 40px; color: #c9a54e; flex: none; }
.doc-word { width: 158px; height: 18px; }
.doc-co p { margin-top: 10px; font-size: 11.5px; line-height: 1.55; color: var(--mu); }
.doc-ref { min-width: 220px; border: 1px solid var(--ln); border-radius: 10px; overflow: hidden; }
.doc-ref h2 { padding: 7px 12px; background: var(--g); font-size: 11.5px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; text-align: center; color: #141414; }
.doc-ref dl { display: flex; }
.doc-ref dl > div { flex: 1; padding: 8px 12px; text-align: center; }
.doc-ref dl > div + div { border-left: 1px solid var(--ln); }
.doc-ref dt { font-size: 10.5px; color: var(--mu); }
.doc-ref dd { margin-top: 1px; font-weight: 750; white-space: nowrap; font-variant-numeric: tabular-nums; }
.doc-body { padding: 18px 28px 6px; }
.doc-client { display: flex; flex-direction: column; gap: 1px; float: right; max-width: 46%; margin: 0 0 10px 16px; padding: 9px 13px; border: 1px solid var(--ln); border-radius: 10px; text-align: right; }
.doc-client span { font-size: 10.5px; color: var(--mu); }
.doc-client small { font-size: 12px; color: var(--mu); overflow-wrap: anywhere; }
.doc-hello { font-size: 17px; font-weight: 750; }
.doc-intro { margin-top: 4px; color: #3d3d3d; }
.doc-after { clear: both; margin-top: 14px; }
.doc-msg { clear: both; margin-top: 12px; padding: 10px 13px; border: 1px solid var(--ln); border-radius: 10px; background: var(--tint); white-space: pre-wrap; }
.doc-h { clear: both; display: flex; align-items: center; gap: 10px; margin: 20px 0 8px; font-size: 11.5px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: var(--gd); }
.doc-h::after { content: ''; flex: 1; height: 1px; background: var(--ln); }
.doc-mission { border: 1px solid var(--ln); border-radius: 12px; overflow: hidden; }
.doc-mission + .doc-mission { margin-top: 10px; }
.doc-mission > header { display: flex; align-items: center; gap: 10px; padding: 8px 14px; background: var(--tint); border-bottom: 1px solid var(--ln); }
.doc-mission > header em { margin-left: auto; font-style: normal; font-size: 12px; color: var(--mu); font-variant-numeric: tabular-nums; }
.doc-tag { padding: 1px 9px; border-radius: 999px; background: var(--g); font-size: 10.5px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; }
.doc-mission.is-off .doc-tag { background: #f3d9d3; color: #8f2f1f; }
.doc-mission.is-off { color: var(--mu); }
.doc-mgrid { display: grid; grid-template-columns: 118px minmax(0, 1fr); }
.doc-mgrid > div { padding: 10px 14px; }
.doc-mgrid > div + div { border-left: 1px solid var(--ln); }
.doc-mgrid span, .doc-facts span { display: block; font-size: 10.5px; color: var(--mu); }
.doc-time b { display: block; margin-top: 2px; font-size: 24px; font-weight: 750; letter-spacing: -.01em; font-variant-numeric: tabular-nums; }
.doc-route ol { margin-top: 3px; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 6px; }
.doc-route li { position: relative; padding-left: 18px; }
.doc-route li::before { content: ''; position: absolute; left: 2px; top: 6px; width: 8px; height: 8px; border-radius: 50%; border: 2px solid var(--g); background: #fff; }
.doc-route li + li::before { border-color: #141414; background: #141414; border-radius: 2px; }
.doc-route li:first-child::after { content: ''; position: absolute; left: 7px; top: 17px; bottom: -8px; width: 2px; background: var(--ln); }
.doc-route a { color: #141414; font-weight: 650; text-decoration: none; overflow-wrap: anywhere; }
.doc-route small { display: block; font-size: 12px; color: var(--mu); }
.doc-facts { display: flex; flex-wrap: wrap; border-top: 1px solid var(--ln); }
.doc-facts > div { flex: 1 1 96px; min-width: 0; padding: 8px 14px; }
.doc-facts > div + div { border-left: 1px solid var(--ln); }
.doc-facts > .is-wide { flex: 3 1 240px; }
.doc-facts b { display: block; font-weight: 650; overflow-wrap: anywhere; }
.doc-table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.doc-table th { padding: 7px 10px; background: var(--tint); border-bottom: 1px solid var(--ln); font-size: 10.5px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--mu); text-align: left; }
.doc-table td { padding: 8px 10px; border-bottom: 1px solid var(--ln); vertical-align: top; }
.doc-table td small { display: block; color: var(--mu); }
.doc-table .num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.doc-totals { width: min(270px, 100%); margin: 8px 0 0 auto; }
.doc-totals > div { display: flex; justify-content: space-between; gap: 16px; padding: 3px 10px; font-variant-numeric: tabular-nums; }
.doc-totals dt { color: var(--mu); }
.doc-totals .is-total { margin-top: 4px; padding-top: 7px; border-top: 2px solid var(--g); font-size: 15px; font-weight: 800; }
.doc-totals .is-total dt { color: #141414; }
.doc-lines { display: flex; flex-direction: column; gap: 6px; }
.doc-lines > div { display: grid; grid-template-columns: 170px minmax(0, 1fr); gap: 12px; }
.doc-lines span { color: #3d3d3d; }
.doc-foot { clear: both; display: flex; justify-content: space-between; gap: 16px; margin-top: 20px; padding: 13px 28px; border-top: 1px solid var(--ln); font-size: 11.5px; color: var(--mu); }
.doc-foot p + p { text-align: right; white-space: nowrap; }
/* Document étroit (téléphone, aperçu de l'écran Confirmations) : une colonne, chauffeur sur sa ligne. */
@container doc (max-width: 600px) {
  .doc-head { grid-template-columns: minmax(0, 1fr); gap: 14px; padding: 18px 16px 14px; }
  .doc-ref { min-width: 0; }
  .doc-body { padding: 14px 16px 4px; }
  .doc-client { float: none; max-width: none; margin: 0 0 12px; text-align: left; }
  .doc-mgrid { grid-template-columns: 92px minmax(0, 1fr); }
  .doc-mgrid > div, .doc-facts > div { padding-inline: 11px; }
  .doc-facts > .is-wide { flex-basis: 100%; border-left: 0; border-top: 1px solid var(--ln); }
  .doc-time b { font-size: 20px; }
  .doc-hc { display: none; }
  .doc-lines > div { grid-template-columns: 1fr; gap: 0; }
  .doc-foot { flex-direction: column; gap: 4px; padding: 12px 16px; }
  .doc-foot p + p { text-align: left; white-space: normal; }
}

@media (max-width: 1240px) and (min-width: 761px) {
  /* Tablette : la colonne client / contact passe avant les dates et l'envoi (noms et téléphones entiers dès 761 px). */
  .clist-head, .crow { grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr) 72px 142px 64px 18px; gap: 10px; padding-inline: 14px; }
  .clist-head:not(.is-confirm) > :nth-child(3), .crow-addr { display: none; }
  .clist-head.is-confirm, .crow.is-confirm { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 144px 80px 18px; }
  .clist-head.is-confirm > :nth-child(5), .crow.is-confirm .crow-status { display: none; }
  .clist-foot { padding-inline: 14px; }
  .crow { font-size: 13px; }
  .crow small { font-size: 12px; }
  .crow-id { gap: 9px; }
  .crow-id .av { width: 32px; height: 32px; font-size: 11.5px; }
  .crow.is-confirm .crow-date small { white-space: normal; } /* une date de retour plus longue passe à la ligne au lieu d'être coupée */
  .crow-send .badge { max-width: 100%; height: auto; min-height: 22px; padding-block: 2px; line-height: 1.25; white-space: normal; } /* « Annulation à envoyer » */
  .agenda:has(.month-wrap) { height: auto; }
  .month-wrap { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto auto; }
  .month { grid-template-rows: auto repeat(6, minmax(94px, 1fr)); } /* semaines égales, 600 px au moins */
  .m-side { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); overflow: visible; }
  .conf-layout { grid-template-columns: minmax(0, 1fr); }
  .conf-preview { position: static; }
  .conf-paper { max-height: none; }
}
.show-md { display: none; }
@media (max-width: 1099px) and (min-width: 761px) {
  .nav-label { display: none; }
  .hide-md { display: none; }
  .show-md { display: inline; }
}
@media print {
  @page { margin: 10mm; }
  body { background: #fff !important; }
  body * { visibility: hidden !important; }
  .doc, .doc * { visibility: visible !important; }
  .doc { position: absolute; left: 0; top: 0; width: 100%; max-width: none; box-shadow: none; border-radius: 0; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .toasts, .tabbar, .utility-bar, .side, .sub-head, .conf-side, .conf-preview-head { display: none !important; } /* invisibles, mais ils allongeaient la page */
  .conf-preview { position: static; }
  /* Une page A4 pour un aller-retour, même avec chauffeur, tarif détaillé, message et rendez-vous :
     corps à 12 px, espacements resserrés, aucun bloc coupé entre deux pages. */
  .doc { font-size: 12px; line-height: 1.35; }
  .doc-head { padding: 4px 4px 12px; }
  .doc-body { padding: 12px 4px 2px; }
  .doc-hello { font-size: 15px; }
  .doc-h { margin: 12px 0 6px; font-size: 10.5px; break-after: avoid; }
  .doc-mgrid > div, .doc-facts > div { padding-block: 6px; }
  .doc-time b { font-size: 20px; }
  .doc-route ol { gap: 3px; }
  .doc-mission + .doc-mission { margin-top: 8px; }
  .doc-msg { margin-top: 8px; padding: 7px 11px; }
  .doc-totals { margin-top: 4px; }
  .doc-totals > div { padding-block: 2px; }
  .doc-totals .is-total { font-size: 14px; }
  .doc-table td, .doc-table th { padding-block: 5px; }
  .doc-mission, .doc-table, .doc-totals, .doc-lines > div, .doc-foot, .doc-client { break-inside: avoid; }
  .doc-foot { margin-top: 12px; padding: 8px 4px 0; }
}

/* --- Tablette : barre latérale réduite ------------------------------------- */
@media (max-width: 1099px) and (min-width: 761px) {
  .shell { grid-template-columns: 76px minmax(0, 1fr); }
  .side { padding: 16px 10px 12px; align-items: center; }
  .side .brand { padding: 2px 0 16px; }
  .side .brand-txt, .nav a span, .me-txt { display: none; } /* barre réduite seulement : la page de connexion garde le nom */
  .nav a { width: 48px; justify-content: center; padding: 0; position: relative; }
  .nav a[aria-current=page]::after { display: none; }
  .top-date { display: none; }
  .nav-badge { position: absolute; top: 2px; right: 0; min-width: 18px; height: 18px; line-height: 18px; font-size: 10.5px; padding: 0 5px; }
  .side-foot { flex-direction: column; gap: 6px; }
  .me { flex: none; padding: 4px; }
  .view { padding: 20px 20px 24px; }
  .login { grid-template-columns: 1fr; }
  .login-aside { display: none; }
}
/* Téléphone à l'horizontale : barre latérale défilable, agenda sans double défilement, panneaux pleine hauteur. */
@media (min-width: 761px) and (max-height: 500px) {
  .side { overflow-y: auto; }
  .utility-bar { padding-top: 8px; }
  .view { padding-top: 10px; padding-bottom: 10px; }
  .agenda { height: calc(100dvh - 72px); min-height: 0; gap: 8px; }
  .ag-title b { font-size: 19px; }
  .ag-stats { display: none; }
  .ag-bar [data-new] { width: 38px; padding: 0; gap: 0; font-size: 0; } /* icône seule : la barre tient sur une ligne */
  dialog.sheet { inset: 0 0 0 auto; height: 100dvh; border-radius: 0; padding-right: env(safe-area-inset-right, 0px); }
  .drv-act { flex-direction: row; }
}

/* --- Téléphone ------------------------------------------------------------- */
@media (max-width: 760px) {
  body { font-size: 15px; }
  body.is-driver { font-size: 16px; }
  .shell { grid-template-columns: minmax(0, 1fr); }
  .side { display: none; }
  .utility-bar { position: sticky; top: 0; z-index: 38; justify-content: stretch; gap: 8px; padding: 10px 18px 6px; background: var(--glass); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); }
  .crumb, .top-date { display: none; }
  .theme-pill { width: 38px; height: 38px; padding: 0; justify-content: center; flex: none; }
  .theme-pill span { display: none; }
  .utility-btn { width: 38px; height: 38px; }
  .global-search { flex: 1; width: auto; height: 38px; }
  .notif-pop { position: fixed; top: 58px; right: 14px; left: 14px; width: auto; }
  .view { padding: 18px 18px calc(144px + var(--safe-b)); scroll-padding-bottom: calc(110px + var(--safe-b)); }
  .tabbar { position: fixed; left: 50%; bottom: calc(10px + var(--safe-b)); z-index: 40; display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); align-items: stretch; width: calc(100% - 28px); max-width: 430px; height: 62px; padding: 6px 8px; transform: translateX(-50%); background: var(--glass); -webkit-backdrop-filter: saturate(1.35) blur(20px); backdrop-filter: saturate(1.35) blur(20px); border: 1px solid var(--line); border-radius: 26px; box-shadow: var(--sh-2); }
  .tabbar.is-mgr { grid-template-columns: 1fr 1fr 58px 1fr 1fr; grid-auto-flow: row; }
  .tabbar a, .tab-more { position: relative; min-width: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; padding: 3px 1px 2px; border-radius: 14px; font-size: 10px; line-height: 1.1; font-weight: 700; color: var(--muted); }
  .tabbar a .i, .tab-more .i { width: 20px; height: 20px; }
  .tabbar a[aria-current=page], .tab-more.is-current { color: var(--gold-ink); background: var(--gold-soft); }
  .tab-add { align-self: center; justify-self: center; display: grid; place-items: center; width: 50px; height: 50px; border-radius: 50%; background: var(--grad); color: #fff; box-shadow: var(--grad-shadow); }
  .tab-add .i { width: 21px; height: 21px; stroke-width: 2.2; }
  .tab-add:active { transform: scale(.96); }
  .tabbar .nav-badge { position: absolute; top: 1px; left: calc(50% + 5px); margin: 0; min-width: 18px; height: 18px; padding: 0 5px; font-size: 10.5px; line-height: 18px; }
  .field input:not([type=checkbox]):not([type=radio]), .field select, .field textarea, .global-search input, .tb-search input { font-size: 16px; }
  /* Cibles tactiles : au moins 36 px, 42 px pour l'itinéraire et les contacts (téléphone dans la voiture). */
  .search-clear { width: 36px; height: 36px; }
  .stop-act .btn, .d-contact .btn { height: 42px; padding-inline: 14px; }
  .statuses button, .seg.wide button, .toolbar .seg button { height: 38px; }
  .ag-filter-toggle { height: 36px; }
  .pop-head button, .fact a { display: inline-block; padding-block: 10px; margin-block: -10px; }
  .page-head h1 { font-size: 27px; }

  .agenda { height: auto; min-height: 0; gap: 16px; }
  .ag-bar { position: relative; align-items: flex-end; gap: 8px; padding-top: 2px; }
  .ag-title { order: -1; flex-basis: calc(100% - 96px); min-width: 0; margin: 0; white-space: normal; }
  .ag-title .ag-kicker { margin-bottom: 2px; font-size: 13px; font-weight: 550; text-transform: none; letter-spacing: 0; }
  .ag-title b { font-size: clamp(27px, 8.2vw, 38px); line-height: 1.05; font-weight: 800; letter-spacing: -.045em; overflow-wrap: anywhere; }
  .ag-nav { position: absolute; top: 4px; right: 0; }
  .ag-nav .btn { display: none; }
  .ag-nav .btn-icon { border: 0; background: var(--surface-2); }
  .ag-bar .ag-spacer { display: none; }
  .ag-bar .seg { flex-basis: 100%; width: max-content; margin: 10px 0 0; padding: 2px; border: 0; background: var(--surface-2); }
  .ag-bar .seg button { height: 36px; padding: 0 13px; font-size: 13px; }
  .ag-bar [data-new] { display: none; }
  .ag-sub { display: flex; align-items: center; overflow: visible; flex-wrap: wrap; margin: -2px 0 0; padding: 0; }
  .ag-sub .chips { display: none; width: calc(100% + 36px); flex-wrap: nowrap; overflow-x: auto; margin: 2px -18px 0; padding: 8px 18px 2px; scrollbar-width: none; }
  .agenda.is-filter-open .ag-sub .chips { display: flex; }
  .ag-sub .chips::-webkit-scrollbar { display: none; }
  .ag-filter-toggle { background: var(--surface-2); border-color: transparent; }
  .ag-filter-toggle[aria-expanded=true] { background: var(--gold-soft); color: var(--gold-ink); }
  .ag-stats { display: none; }
  .ag-body { min-height: 0; }
  .month { min-height: 420px; }
  .m-dow span { padding: 8px 0; text-align: center; font-size: 10.5px; }
  .m-cell { align-items: center; gap: 4px; padding: 5px 2px; min-height: 58px; }
  .m-num { align-self: center; font-size: 13px; }
  .m-evs { flex-direction: row; flex-wrap: wrap; justify-content: center; gap: 3px; }
  .m-ev { width: 7px; height: 7px; padding: 0; border-radius: 50%; background: var(--c); }
  .m-ev > * { display: none; }
  .m-more { display: none; }
  .wstrip { gap: 1px; margin: 0 -4px; padding: 4px 0 14px; border-bottom: 1px solid var(--line); }
  .wday { gap: 5px; min-height: 66px; padding: 6px 0; border-radius: 16px; font-size: 12px; }
  .wday b { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 12px; font-size: 16px; }
  .wday[aria-pressed=true] { background: transparent; color: var(--gold-strong); box-shadow: none; }
  .wday[aria-pressed=true] b { background: var(--grad); color: #fff; box-shadow: var(--grad-shadow); }
  .wday[aria-pressed=true] .dots { opacity: 0; }
  .wday.is-today:not([aria-pressed=true]) b { color: var(--gold-strong); }
  .l-day > h3 { margin: 2px 0 18px; color: var(--ink); font-size: 18px; font-weight: 780; letter-spacing: -.02em; }
  .l-day > h3 small { display: block; margin-top: 2px; font-size: 12px; font-weight: 550; color: var(--muted); }
  .l-items { position: relative; gap: 12px; }
  .l-items { --tl-x: 55px; } /* axe de la frise : la ligne et les ronds y sont centrés */
  .l-items::before { content: ""; position: absolute; left: calc(var(--tl-x) - 1px); top: 28px; bottom: 28px; width: 2px; border-radius: 2px; background: var(--tl); }
  .trow { position: relative; isolation: isolate; grid-template-columns: 62px minmax(0, 1fr); gap: 14px 28px; min-height: 116px; padding: 16px 15px 16px 0; border: 0; border-radius: 22px; background: transparent; box-shadow: none; overflow: visible; }
  .trow::before { content: ""; position: absolute; z-index: -1; inset: 0 0 0 76px; border: 1px solid var(--line); border-radius: 22px; background: var(--surface); box-shadow: var(--sh-1); }
  .trow::after { content: ""; position: absolute; left: calc(var(--tl-x) - 6px); top: 29px; width: 12px; height: 12px; border: 3px solid var(--bg); border-radius: 50%; background: var(--gold); box-shadow: 0 0 0 2px var(--tl); }
  /* 1.5.1 : la course en cours (ou la prochaine d'aujourd'hui) a un rond plus grand qui pulse doucement. */
  .trow.is-now::after { left: calc(var(--tl-x) - 9px); top: 26px; width: 18px; height: 18px; box-shadow: 0 0 0 2px var(--gold); animation: tl-now 2.4s ease-out infinite; }
  .trow.is-now .trow-time b { color: var(--gold-strong); }
  .trow:hover { border-color: transparent; box-shadow: none; }
  .trow-time { align-self: start; padding-top: 6px; text-align: left; }
  .trow-time b { font-size: 14px; font-weight: 800; color: var(--ink); }
  .trow-time small { margin-top: 2px; font-size: 10px; }
  .trow-main, .trow-side { position: relative; z-index: 1; }
  .trow-main > b { font-size: 17px; line-height: 1.25; }
  .trow .route { margin-top: 3px; font-size: 12.5px; }
  .trow .meta { margin-top: 7px; font-size: 11.5px; }
  .trow-side { grid-column: 2; flex-direction: row; align-items: center; justify-content: space-between; gap: 8px; margin-top: 7px; }
  .l-items:not(.is-compact) .trow.is-priority::before { border-color: transparent; background: var(--grad); box-shadow: var(--grad-shadow); }
  .l-items:not(.is-compact) .trow.is-priority :is(.trow-main > b, .route, .meta, .drv) { color: #fff; }
  .l-items:not(.is-compact) .trow.is-priority :is(.route .i, .meta .i) { color: rgba(255,255,255,.8); }
  .l-items:not(.is-compact) .trow.is-priority :is(.badge, .av) { background: rgba(255,255,255,.18); color: #fff; }

  dialog.sheet { inset: auto 0 0 0; width: 100%; height: calc(100dvh - 8px); border-radius: 24px 24px 0 0; border-width: 1px 0 0; }
  dialog.sheet[open] { animation: sheet-up .26s cubic-bezier(.2, .8, .2, 1); }
  .sheet-head { padding: 12px 10px 12px 18px; }
  .sheet-body { padding: 16px 16px 24px; }
  .facts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .fgrid.three { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .fgrid.three .full-sm { grid-column: 1 / -1; }
  .hide-sm { display: none !important; }
  .toasts { inset: auto 0 calc(86px + var(--safe-b)) 0; }
  body:has(.conf-actions) .toasts { bottom: calc(150px + var(--safe-b)); } /* au-dessus de la barre PDF / E-mail / WhatsApp */

  .login { grid-template-columns: 1fr; }
  .login-aside { display: none; }
  .login-main { align-items: flex-start; padding: 40px 22px; }
  .login-card h1 { margin-top: 44px; font-size: 38px; letter-spacing: -.055em; }
  .hello h1 { font-size: 25px; }
  .team { grid-template-columns: 1fr; }
  .member-act .btn { flex-basis: 100%; }
  .prefs-grid { grid-template-columns: 1fr; }
}
@media screen and (max-width: 760px) {
  .page-head { align-items: stretch; }
  .page-act { width: 100%; }
  .page-act .btn { flex: 1; }
  .page-act .btn:only-child { flex: none; }
  .toolbar { padding: 8px; gap: 8px; }
  .toolbar .seg { width: 100%; overflow-x: auto; scrollbar-width: none; }
  .toolbar .seg button { flex: 1; padding: 0 8px; }
  .clist-head { display: none; }
  .crow { grid-template-columns: minmax(0, 1fr) auto 16px; grid-template-areas: "id status go" "contact count go"; gap: 4px 10px; padding: 12px 14px; }
  .crow-id { grid-area: id; }
  .crow-contact { grid-area: contact; padding-left: 47px; }
  .crow-contact small { display: none; }
  .crow-addr, .crow-last { display: none; }
  .crow-status { grid-area: status; justify-self: end; }
  .crow-count { grid-area: count; justify-self: end; color: var(--muted); }
  .crow-count b { display: inline; font-size: 13.5px; color: var(--ink); }
  .crow-go { grid-area: go; }
  .crow.is-confirm { grid-template-columns: minmax(0, 1fr) auto 16px; grid-template-areas: "id status go" "route route go" "date send go"; }
  .crow.is-confirm .crow-route { grid-area: route; padding-left: 47px; }
  .crow.is-confirm .crow-date { grid-area: date; padding-left: 47px; }
  .crow.is-confirm .crow-date b, .crow.is-confirm .crow-date small { display: inline; white-space: normal; }
  .crow.is-confirm .crow-date small::before { content: " · "; }
  .crow.is-confirm .crow-send { grid-area: send; justify-content: flex-end; }
  .clist-foot { padding: 10px 14px; }
  .c-hero { align-items: flex-start; }
  .c-hero .av.xl { width: 56px; height: 56px; font-size: 19px; }
  .l-items.is-compact::before, .l-items.is-compact .trow::after { display: none; }
  .l-items.is-compact .trow { grid-template-columns: 62px minmax(0, 1fr); gap: 14px; min-height: 0; padding: 12px 14px; }
  .l-items.is-compact .trow::before { inset: 0; }
  .fact.wide { grid-column: 1 / -1; }
  .sec-head { margin-top: 24px; }
  .vehicle { padding: 12px 14px; }
  .month-wrap { display: flex; flex-direction: column; gap: 12px; }
  .m-side { overflow: visible; }
  .metric b { font-size: 20px; }
  .sub-head { flex-wrap: nowrap; align-items: flex-start; }
  .sub-head h1 { font-size: 22px; }
  .conf-layout { grid-template-columns: minmax(0, 1fr); gap: 14px; }
  .conf-preview { position: static; margin: 0 -18px; border-radius: 0; border-inline: 0; }
  .conf-paper { padding: 12px; max-height: none; }
  .confirm-doc { padding-bottom: 64px; }
  .conf-actions { position: fixed; left: 14px; right: 14px; bottom: calc(80px + var(--safe-b)); z-index: 36; padding: 8px; border: 1px solid var(--line); border-radius: 18px; background: var(--glass); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); box-shadow: var(--sh-2); }
  .conf-actions .btn { height: 42px; flex-direction: column; gap: 1px; font-size: 12px; }
  .doc { border-radius: 12px; font-size: 13px; }
}
@keyframes sheet-up { from { transform: translateY(40px); opacity: 0; } }
@media (min-width: 761px) { .show-sm { display: none !important; } }

@media (min-width: 761px) {
  body.is-compact .view { padding-top: 14px; }
  body.is-compact .agenda { gap: 8px; }
  body.is-compact .team { gap: 8px; }
  body.is-compact .member, body.is-compact .p-sec { padding: 13px; }
}

@media (pointer: coarse) {
  .field input:not([type=checkbox]):not([type=radio]), .field select, .field textarea, .global-search input, .tb-search input { font-size: 16px; }
  /* Téléphone à l'horizontale dans le support de la voiture : mêmes cibles que sur téléphone. */
  .stop-act .btn, .d-contact .btn { height: 42px; padding-inline: 14px; }
}

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