/* Compléments propres à l'application (le reste vient de design.css) */
.ui #flash { position: sticky; top: 72px; z-index: 20; padding-top: var(--sp-2); padding-bottom: 0; }
.ui #app:focus { outline: none; }
.ui .legal h1 { margin-bottom: var(--sp-3); }
.ui .legal h2, .ui .legal h3, .ui .legal h4 { margin-top: var(--sp-5); margin-bottom: var(--sp-2); }
.ui .legal p, .ui .legal li { margin-bottom: var(--sp-2); }
.ui .legal table { margin: var(--sp-3) 0; }
.ui .legal mark { background: var(--wait-bg); color: var(--wait); }
.ui details > summary { cursor: pointer; min-height: 32px; }
.ui .sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.ui fieldset { margin: 0; min-width: 0; }
.ui fieldset.card { display: flex; flex-direction: column; gap: var(--sp-4); }
.ui .doclist li form { grid-column: 1 / -1; }
.ui nav[aria-label] a[aria-current] { color: var(--ink); }
@media (max-width: 640px) { .ui .topbar nav .hide-sm { display: none; } .ui .brand .wm small { display: none; } }
.ui label.row > input[type=checkbox] { width: 22px; height: 22px; flex: none; }
.ui label.row { flex-wrap: nowrap; align-items: flex-start; }
/* Espace transporteur : onglets lisibles au doigt, défilement horizontal sur téléphone */
.ui .tabbar { display: flex; gap: var(--sp-2); overflow-x: auto; padding-bottom: 2px; scrollbar-width: none; }
.ui .tabbar a { flex: none; padding: 10px 16px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); font-weight: 600; text-decoration: none; font-size: var(--fs-sm); }
.ui nav.tabbar a[aria-current] { background: var(--ink); border-color: var(--ink); color: var(--surface); }
/* Étapes d'activation du compte */
.ui .steps-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: var(--sp-3); }
.ui .steps-list li { display: flex; align-items: center; gap: var(--sp-3); color: var(--ink-2); }
.ui .steps-list .dot { width: 28px; height: 28px; border-radius: 50%; border: 2px solid var(--line); display: grid; place-items: center; font-weight: 700; flex: none; }
.ui .steps-list li.ok { color: var(--ink); }
.ui .steps-list li.ok .dot { background: var(--ok); border-color: var(--ok); color: #fff; }
.ui .steps-list li.cur { color: var(--ink); font-weight: 700; }
.ui .steps-list li.cur .dot { border-color: var(--ink); }
.ui a.kpi { color: inherit; text-decoration: none; }

/* Facture des frais : page imprimable (enregistrer en PDF depuis le navigateur) */
.invoice { background: #fff; color: #111; border: 1px solid var(--line); border-radius: 12px; padding: 32px; max-width: 820px; margin: 0 auto; font-size: 15px; }
.invoice h1 { font-size: 26px; margin: 0; }
.invoice .inv-head { display: flex; justify-content: space-between; gap: 24px; flex-wrap: wrap; }
.invoice .inv-parties { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; margin: 24px 0; }
.invoice table { width: 100%; border-collapse: collapse; }
.invoice th, .invoice td { border-bottom: 1px solid #ddd; padding: 10px 6px; text-align: left; vertical-align: top; }
.invoice .r { text-align: right; white-space: nowrap; }
.invoice .inv-total td { font-weight: 700; border-bottom: 0; }
.invoice .inv-legal { font-size: 12px; color: #444; margin-top: 24px; }
@media (max-width: 600px) { .invoice { padding: 16px; font-size: 14px; } .invoice .inv-parties { grid-template-columns: 1fr; } .invoice th { white-space: normal; font-size: 12px; } .invoice th, .invoice td { padding: 8px 4px; } .invoice td:first-child { overflow-wrap: anywhere; } .invoice .opt { display: none; } }
@media print {
  #topbar, #footer, .no-print { display: none !important; }
  body, main { background: #fff !important; }
  .invoice { border: 0; padding: 0; max-width: none; }
}

/* Signature du destinataire (preuve de livraison) */
canvas.signature { width: 100%; max-width: 600px; aspect-ratio: 600 / 220; border: 2px dashed var(--line); border-radius: 12px; background: #fff; display: block; }
.pod-sign { max-width: 320px; width: 100%; border: 1px solid var(--line); border-radius: 8px; background: #fff; }

/* Tablette (retour du CEO 31/10) : espaces transporteur, client et admin en pleine largeur, menus jamais coupés */
.ui .page:has(> .tabbar) { max-width: var(--wide); width: 100%; }
@media (min-width: 641px) { .tabbar { flex-wrap: wrap; overflow-x: visible; } }
.ui .topbar nav { min-width: 0; overflow-x: auto; scrollbar-width: none; }
.ui .topbar nav::-webkit-scrollbar, .tabbar::-webkit-scrollbar { display: none; }
.ui .topbar > a:first-child { flex: none; }

/* Cases à cocher bien visibles (déclarations, choix) */
.tick { display: flex; gap: var(--sp-3); align-items: flex-start; padding: var(--sp-3) var(--sp-4); border: 2px solid var(--line); border-radius: 12px; background: var(--surface); cursor: pointer; }
.tick input { width: 26px; height: 26px; flex: none; margin-top: 2px; accent-color: var(--ink); }
.tick:has(input:checked) { border-color: var(--ok, #1e7a46); }
.days { display: flex; flex-wrap: wrap; gap: var(--sp-2); }
.days label { display: flex; align-items: center; gap: 6px; padding: 8px 12px; border: 1px solid var(--line); border-radius: 999px; font-weight: 600; }
.days input { width: 20px; height: 20px; }
/* Messagerie d'une course */
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.chat-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; max-height: 360px; overflow-y: auto; }
.chat-list li { max-width: 85%; padding: 8px 12px; border-radius: 12px; background: var(--surface-2, #eef2f7); border: 1px solid var(--line); display: flex; flex-direction: column; gap: 2px; white-space: pre-wrap; overflow-wrap: anywhere; }
.chat-list li.me { align-self: flex-end; }
.chat-list li.them { align-self: flex-start; }
.chat-list small { font-size: 12px; color: var(--ink-2); }
/* Lot P3 : lien-bouton, tableau « Mon activité » */
.ui button.link { background: none; border: 0; padding: 0; color: var(--action); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; font: inherit; text-align: left; }
.ui table.activity .bar { position: relative; min-width: 120px; height: 22px; display: flex; align-items: center; }
.ui table.activity .bar i { position: absolute; left: 0; top: 3px; bottom: 3px; background: var(--ok-bg); border-radius: 4px; }
.ui table.activity .bar span { position: relative; padding-left: 6px; font-variant-numeric: tabular-nums; }
@media (max-width: 600px) { .ui table.activity .opt { display: none; } .ui table.activity th, .ui table.activity td { padding: 8px 6px; } .ui table.activity .bar { min-width: 90px; } }
.ui .dt-pair { display: grid; grid-template-columns: 1.6fr 1fr; gap: var(--sp-2); }
.ui .card-links { display: flex; flex-wrap: wrap; gap: var(--sp-4); }
.ui .linkish { background: none; border: 0; padding: 4px 0; color: var(--ink-2); text-decoration: underline; cursor: pointer; font: inherit; }
.ui details.group > summary { list-style: none; cursor: pointer; display: flex; align-items: center; justify-content: space-between; }
.ui details.group > summary::-webkit-details-marker { display: none; }
.ui details.group > summary h2 { margin: 0; }
.ui details.group > summary::after { content: '▸'; color: var(--ink-2); }
.ui details.group[open] > summary::after { content: '▾'; }
.ui details.group[open] > summary { margin-bottom: var(--sp-3); }
.ui details.group > section.card { border: 0; padding: 0; box-shadow: none; background: none; margin-top: var(--sp-4); }
.ui .tiles .tile { display: flex; flex-direction: column; gap: 6px; text-decoration: none; color: inherit; }
