/* SVDV CARGO — design system (§7–§13, relevé sur les mockups validés). */
:root {
  --blue: #0B72D9;        /* actions, sélection, nav active */
  --blue-deep: #075DBD;   /* gradient bouton principal */
  --navy: #0B2148;        /* titres, chiffres */
  --white: #FFFFFF;
  --soft: #F7FBFF;        /* champs, zones secondaires */
  --border: #DAE5EF;
  --muted: #697E97;
  --green: #14A052;
  --orange: #F28A17;
  --red: #E3292F;
  --violet: #7B3FE4;      /* rechargement dans la timeline (mockup fiche camion) */

  --blue-tint: #EDF5FF;  --blue-line: #C9DEF6;
  --green-tint: #EAF8EF; --green-line: #C4E9D2;
  --orange-tint: #FFF4E3; --orange-line: #F8DDB3;
  --red-tint: #FFEDEE;   --red-line: #F8C9CB;
  --violet-tint: #F2ECFD;
  --gray-tint: #EEF2F6;

  --page: #EDF3F8;
  --radius-card: 16px;
  --radius-field: 12px;
  --shadow-sheet: 0 -4px 24px rgba(11, 33, 72, .07);
  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'Segoe UI', Roboto, Arial, sans-serif;
  color-scheme: light;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; -webkit-tap-highlight-color: transparent; }
body { overscroll-behavior-y: none; }
body { margin: 0; background: var(--page); font-family: var(--font); color: var(--navy); font-size: 16px; line-height: 1.35; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
img { display: block; max-width: 100%; }
:focus-visible { outline: 3px solid rgba(11, 114, 217, .45); outline-offset: 2px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.hidden { display: none !important; }
svg.i { width: 1em; height: 1em; flex: none; vertical-align: middle; }

/* ---------- barre de test (hors produit) ---------- */
.testbar { background: #0B2148; color: #cfe0f5; font-size: 13px; }
.testbar summary { list-style: none; padding: 8px 16px; cursor: pointer; display: flex; gap: 8px; align-items: center; font-weight: 600; }
.testbar summary::-webkit-details-marker { display: none; }
.testbar summary b { color: #fff; }
.testbar .tb-body { display: flex; flex-wrap: wrap; gap: 6px 14px; padding: 0 16px 10px; align-items: center; }
.testbar .tb-group { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.testbar button, .testbar input { border: 1px solid #36507a; background: #13305f; color: #fff; border-radius: 8px; padding: 6px 10px; font-size: 13px; min-height: 32px; }
.testbar button.on { background: var(--blue); border-color: var(--blue); }
.testbar button.go { background: #14A052; border-color: #14A052; font-weight: 700; }
.testbar .tb-label { color: #9fb6d3; }

/* ---------- coque applicative ---------- */
.app { max-width: 480px; margin: 0 auto; background: var(--white); min-height: 100vh; min-height: 100dvh; position: relative; display: flex; flex-direction: column; }
@media (min-width: 520px) { .app.mobile { margin: 20px auto; min-height: calc(100vh - 40px); border-radius: 28px; overflow: hidden; box-shadow: 0 18px 50px rgba(11, 33, 72, .14); border: 1px solid #dfe8f0; } }
.app-main { flex: 1; padding-bottom: 12px; }

/* header : logo officiel + langue / rôle */
.brandbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 16px 6px; padding-top: calc(14px + env(safe-area-inset-top)); padding-left: calc(16px + env(safe-area-inset-left)); padding-right: calc(16px + env(safe-area-inset-right)); }
.brandbar .logo { height: 36px; width: auto; }
.lang { display: inline-flex; background: #F2F6FA; border: 1px solid var(--border); border-radius: 999px; padding: 3px; }
.lang button { border: 0; background: transparent; border-radius: 999px; min-width: 50px; min-height: 38px; font-weight: 700; color: #4A6180; padding: 0 12px; }
.lang button[aria-pressed="true"] { background: var(--blue); color: #fff; }
.lang button:disabled { cursor: default; }
.role-pill { display: inline-flex; align-items: center; gap: 8px; border: 1px solid var(--border); background: #F4F8FC; border-radius: 999px; min-height: 42px; padding: 0 14px; font-weight: 800; position: relative; }
.role-pill .i { font-size: 20px; color: var(--green); }
.role-menu { position: absolute; right: 0; top: calc(100% + 6px); background: #fff; border: 1px solid var(--border); border-radius: 12px; box-shadow: 0 10px 30px rgba(11,33,72,.14); min-width: 200px; z-index: 30; padding: 6px; }
.role-menu button { width: 100%; text-align: left; border: 0; background: none; padding: 12px; border-radius: 8px; font-weight: 600; display: flex; gap: 10px; align-items: center; }
.role-menu button:hover { background: var(--soft); }

/* hero : titre produit + photo entrepôt */
.hero { position: relative; }
.hero-title { text-align: center; padding: 6px 12px 0; position: relative; z-index: 2; }
.hero-title h1 { margin: 0; font-size: 46px; line-height: 1; font-weight: 900; letter-spacing: -1.5px; color: var(--navy); }
.hero-title h1 span { color: var(--blue); }
.hero-title p { margin: 4px 0 0; font-size: 21px; font-weight: 700; color: #16325f; letter-spacing: -.2px; }
.hero-photo { height: 210px; margin-top: -26px; background: url('../assets/entrepot-bandeau.jpg') center 100% / cover no-repeat; position: relative; }
.login-title { font-size: 26px; letter-spacing: -.5px; }
.hero-photo::before { content: ''; position: absolute; inset: 0 0 auto; height: 55%; background: linear-gradient(#fff, rgba(255,255,255,0)); }
.hero.compact .hero-title h1 { font-size: 32px; letter-spacing: -1px; }
.hero.compact .hero-title p { font-size: 15px; }
.hero.compact .hero-photo { height: 112px; margin-top: -14px; }

/* feuille blanche qui chevauche la photo */
.sheet { position: relative; z-index: 3; margin: -26px 10px 0; background: #fff; border-radius: 22px; padding: 18px 14px 16px; box-shadow: var(--shadow-sheet); }
.sheet.flat { margin-top: 0; box-shadow: none; }
.below { padding: 6px 14px 0; }

.h1 { font-size: 30px; font-weight: 800; letter-spacing: -.6px; margin: 2px 4px 14px; line-height: 1.12; }
.h1.center, .center { text-align: center; }
.sub { color: var(--muted); font-size: 16px; margin: -8px 0 14px; }
.h2 { font-size: 24px; font-weight: 800; letter-spacing: -.4px; margin: 20px 4px 12px; display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.link { color: var(--blue); font-weight: 600; font-size: 16px; border: 0; background: none; display: inline-flex; align-items: center; gap: 4px; padding: 6px 0; min-height: 40px; }
.muted { color: var(--muted); }

/* ---------- boutons (§11) ---------- */
.btn { width: 100%; min-height: 54px; border-radius: 13px; border: 0; font-weight: 700; font-size: 18px; display: inline-flex; align-items: center; justify-content: center; gap: 12px; padding: 0 18px; letter-spacing: .1px; }
.btn .i { font-size: 24px; }
.btn-primary { background: linear-gradient(90deg, var(--blue-deep), var(--blue)); color: #fff; box-shadow: 0 6px 14px rgba(11, 114, 217, .22); }
.btn-primary:disabled { opacity: .7; cursor: progress; }
.btn-outline { background: #fff; border: 1.6px solid var(--blue); color: var(--blue); }
.btn-outline .plus { width: 30px; height: 30px; border-radius: 50%; background: var(--blue); color: #fff; display: inline-flex; align-items: center; justify-content: center; }
.btn-ghost { background: #fff; border: 1px solid var(--border); color: #36516f; font-size: 16px; min-height: 48px; }
.btn-danger { background: #fff; border: 1px solid var(--red-line); color: var(--red); font-size: 16px; min-height: 48px; }
.btn.upper { text-transform: uppercase; }
.stack { display: grid; gap: 10px; margin-top: 14px; }

/* ---------- cartes ---------- */
.card { background: #fff; border: 1px solid var(--border); border-radius: var(--radius-card); }
.grid2 { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 10px; }
.grid3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }

/* KPI tintés (dashboard NL / FR) */
.kpi { border-radius: 14px; border: 1px solid var(--blue-line); background: var(--blue-tint); padding: 12px 12px 10px; text-align: left; display: flex; flex-direction: column; gap: 6px; min-height: 128px; position: relative; }
.kpi .ico { font-size: 40px; color: var(--blue); }
.kpi .lbl { font-size: 15px; font-weight: 500; }
.kpi .val { font-size: 38px; font-weight: 800; line-height: 1; }
.kpi .chev { position: absolute; right: 10px; bottom: 12px; width: 30px; height: 30px; border-radius: 50%; background: rgba(11,114,217,.12); color: var(--blue); display: flex; align-items: center; justify-content: center; font-size: 18px; }
.kpi.orange { background: var(--orange-tint); border-color: var(--orange-line); } .kpi.orange .ico, .kpi.orange .chev { color: var(--orange); } .kpi.orange .chev { background: rgba(242,138,23,.14); }
.kpi.green { background: var(--green-tint); border-color: var(--green-line); } .kpi.green .ico, .kpi.green .chev { color: var(--green); } .kpi.green .chev { background: rgba(20,160,82,.14); }
.kpi.red { background: var(--red-tint); border-color: var(--red-line); } .kpi.red .ico, .kpi.red .chev { color: var(--red); } .kpi.red .chev { background: rgba(227,41,47,.12); }
.kpi.violet { background: var(--violet-tint); border-color: #dcd0f7; } .kpi.violet .ico, .kpi.violet .chev { color: var(--violet); }
.grid4 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.grid4 .kpi { min-height: 112px; } .grid4 .kpi .val { font-size: 34px; } .grid4 .kpi .ico { font-size: 32px; }
button.kpi { font: inherit; color: inherit; }

/* KPI admin mobile : icône ronde à gauche */
.akpi { display: flex; align-items: center; gap: 12px; padding: 14px 12px; border: 1px solid var(--border); border-radius: 14px; background: #fff; text-align: left; min-height: 96px; }
.akpi .round { width: 54px; height: 54px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 28px; flex: none; }
.akpi .lbl { font-size: 14px; color: #3e5675; }
.akpi .val { font-size: 34px; font-weight: 800; line-height: 1.05; }
.tone-blue .round { background: var(--blue-tint); color: var(--blue); }
.tone-green .round { background: var(--green-tint); color: var(--green); }
.tone-orange .round { background: var(--orange-tint); color: var(--orange); }
.tone-red .round { background: var(--red-tint); color: var(--red); }
.tone-violet .round { background: var(--violet-tint); color: var(--violet); }

/* ---------- carte camion (liste) ---------- */
.truck-card { width: 100%; text-align: left; padding: 14px 12px 14px 14px; display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; margin-bottom: 10px; background: #fff; }
.truck-card .top .badge, .truck-card .top .chev { flex: none; }
.truck-card .top { display: flex; align-items: center; gap: 14px; }
.truck-card .top .ti { font-size: 46px; color: var(--blue); }
.truck-card .name { font-size: 19px; font-weight: 700; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.truck-card .cols > div { min-width: 0; }
.truck-card .v { overflow: hidden; text-overflow: ellipsis; }
.truck-card .chev { color: #8aa0b8; font-size: 22px; }
.truck-card .cols { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.truck-card .cols > div { padding: 0 10px; border-left: 1px solid var(--border); }
.truck-card .cols > div:first-child { padding-left: 0; border-left: 0; }
.truck-card .k { font-size: 14px; color: var(--muted); }
.truck-card .v { font-size: 18px; font-weight: 500; display: flex; align-items: center; gap: 8px; margin-top: 4px; white-space: nowrap; }
.truck-card .v .i { font-size: 24px; color: #3f5878; }
.truck-card .actions { margin-top: 2px; }

/* badges de statut (§8 : couleur + icône/pastille + texte) */
.badge { display: inline-flex; align-items: center; gap: 7px; border-radius: 999px; padding: 6px 12px; font-size: 14px; font-weight: 600; white-space: nowrap; }
.badge::before { content: ''; width: 9px; height: 9px; border-radius: 50%; background: currentColor; }
.badge.plain::before { display: none; }
.b-blue { background: var(--blue-tint); color: #0a5fb8; }
.b-green { background: var(--green-tint); color: #0f7e40; }
.b-orange { background: var(--orange-tint); color: #b45f00; }
.b-red { background: var(--red-tint); color: #c4161d; }
.b-gray { background: var(--gray-tint); color: #4d6178; }
.gap-txt { font-weight: 700; font-size: 15px; display: inline-flex; align-items: center; gap: 4px; }
.gap-txt.red { color: var(--red); } .gap-txt.green { color: var(--green); }

/* ---------- formulaires ---------- */
.f { position: relative; display: flex; align-items: center; gap: 14px; min-height: 64px; padding: 8px 14px; border: 1px solid var(--border); border-radius: var(--radius-field); background: var(--soft); margin-bottom: 10px; }
.f > .i { font-size: 26px; color: #4C6482; }
.f .in { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.f label { font-size: 14px; color: #4A6180; }
.f input, .f select { border: 0; background: transparent; font-size: 18px; padding: 2px 0 0; min-height: 28px; width: 100%; color: var(--navy); appearance: none; -webkit-appearance: none; outline: none; }
.f .end { font-size: 24px; color: #4C6482; pointer-events: none; }
.f:focus-within { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(11,114,217,.14); }
.f input[type=date]::-webkit-calendar-picker-indicator, .f input[type=time]::-webkit-calendar-picker-indicator { position: absolute; inset: 0; width: auto; height: auto; opacity: 0; cursor: pointer; }
.f.err, .fb.err { border-color: var(--red); background: #fff8f8; }
.err-msg { color: var(--red); font-size: 14px; font-weight: 600; margin: -4px 4px 10px; display: flex; gap: 6px; align-items: center; }
.err-msg::before { content: '!'; width: 18px; height: 18px; border-radius: 50%; background: var(--red); color: #fff; font-size: 12px; font-weight: 800; display: inline-flex; align-items: center; justify-content: center; flex: none; }

/* compteur − 43 + */
.f.stepper .in { flex: 1; }
.stepper .ctl { display: flex; border: 1px solid var(--border); border-radius: 10px; overflow: hidden; background: #fff; }
.stepper .ctl button { width: 52px; min-height: 48px; border: 0; background: #F2F6FA; font-size: 24px; color: #36516f; }
.stepper .ctl input { width: 76px; text-align: center; font-size: 22px; font-weight: 700; border-left: 1px solid var(--border); border-right: 1px solid var(--border); }
.stepper .ctl input::-webkit-inner-spin-button { display: none; }

/* champ FR : libellé au-dessus, astérisque rouge (mockup arrivée) */
.fl { display: block; font-size: 15px; font-weight: 600; margin: 0 2px 6px; }
.fl .req { color: var(--red); }
.fb { display: flex; align-items: center; gap: 12px; min-height: 54px; border: 1px solid var(--border); border-radius: var(--radius-field); background: var(--soft); padding: 0 14px; margin-bottom: 14px; position: relative; }
.fb .i { font-size: 24px; color: #4C6482; }
#a_plate, #a_cmr { text-transform: uppercase; }
.fb input { border: 0; background: transparent; font-size: 18px; width: 100%; min-width: 0; outline: none; color: var(--navy); }
.fb:focus-within { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(11,114,217,.14); }
.fb input[type=time]::-webkit-calendar-picker-indicator { position: absolute; inset: 0; width: auto; height: auto; opacity: 0; cursor: pointer; }
.fgrid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 0 12px; }
.fgrid .err-msg { margin-top: -10px; }

/* tuiles photo */
.photo-tile { border: 1px solid var(--border); border-radius: 14px; padding: 10px; background: #fff; display: flex; flex-direction: column; gap: 8px; }
.photo-tile .t { font-size: 16px; font-weight: 600; padding: 2px 4px 0; }
.photo-tile .t .req { color: var(--red); }
.photo-drop { border: 1.5px dashed #B7CAE0; border-radius: 12px; background: var(--soft); min-height: 112px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; text-align: center; color: #3F5878; font-size: 15px; padding: 10px; width: 100%; }
.photo-drop .i { font-size: 34px; color: var(--blue); }
.photo-drop small { color: var(--muted); font-size: 13px; }
.photo-tile.err { border-color: var(--red); } .photo-tile.err .photo-drop { border-color: var(--red); background: #fff8f8; }
.photo-prev { position: relative; border-radius: 10px; overflow: hidden; height: 112px; background: #e8eef4; }
.photo-prev button.view { position: absolute; inset: 0; border: 0; padding: 0; background: none; }
.photo-prev img { width: 100%; height: 100%; object-fit: cover; }
.photo-prev .x { position: absolute; top: 6px; right: 6px; width: 34px; height: 34px; border-radius: 50%; border: 2px solid #fff; background: rgba(11,33,72,.72); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 18px; }
.photo-ok { display: flex; align-items: center; gap: 6px; font-size: 14px; color: var(--green); font-weight: 600; padding: 0 4px; }
.photo-tile.dashed { border-style: dashed; border-color: #C2D2E4; }

/* choix d'opération (cartes radio) */
.choice { position: relative; display: flex; align-items: center; gap: 12px; padding: 14px 12px; border: 1px solid var(--border); border-radius: 14px; background: #fff; cursor: pointer; min-height: 80px; }
.choice input { position: absolute; opacity: 0; pointer-events: none; }
.choice .ci { font-size: 50px; color: var(--blue); flex: none; }
.choice.return .ci { color: var(--red); }
.choice .ct { font-weight: 700; font-size: 17px; text-transform: uppercase; }
.choice .cs { font-size: 13px; color: var(--muted); }
.choice .dot { position: absolute; top: 12px; right: 12px; width: 22px; height: 22px; border-radius: 50%; border: 2px solid #9DB0C5; background: #fff; }
.choice.left { padding-left: 44px; gap: 8px; }
.choice.left .ct { font-size: 14px; }
.choice .ct, .choice .cs, .kpi .lbl, .akpi .lbl, .tl-row .tx b, .tl-row .tx span, .f label, .res-strip > div, .tile .k { overflow-wrap: anywhere; }
.kpi, .akpi, .tile, .res-strip > div, .trust > div { min-width: 0; }
.choice > span:last-child { min-width: 0; } .choice.left .dot { left: 14px; right: auto; top: 50%; transform: translateY(-50%); }
.choice.left .ci { font-size: 32px; color: #4C6482; }
.choice:has(input:checked) { border-color: var(--blue); background: var(--blue-tint); box-shadow: 0 0 0 1px var(--blue) inset; }
.choice:has(input:checked) .dot { border-color: var(--blue); box-shadow: inset 0 0 0 4px #fff; background: var(--blue); }
.choice:has(input:focus-visible) { outline: 3px solid rgba(11,114,217,.45); outline-offset: 2px; }
.choices.err .choice { border-color: var(--red); }

.section-label { font-size: 18px; font-weight: 700; margin: 16px 2px 10px; }
.warn { display: flex; gap: 12px; align-items: center; border: 1px solid #F3C27E; background: #FFF4E2; border-radius: 12px; padding: 12px 14px; color: #A24F00; font-size: 15px; margin: 14px 0; }
.warn .i { font-size: 34px; color: var(--orange); }
.warn b { color: #9A4400; }

/* bloc « Informations Pays-Bas » (lecture seule) */
.ro { border: 1px solid var(--border); border-radius: 14px; margin-bottom: 14px; }
.ro summary { list-style: none; display: flex; align-items: center; gap: 12px; padding: 12px 14px; font-size: 20px; font-weight: 700; cursor: pointer; }
.ro summary::-webkit-details-marker { display: none; }
.ro summary .i:first-child { font-size: 30px; color: var(--blue); }
.ro summary .chev { margin-left: auto; color: #6b819a; transition: transform .2s; }
.ro[open] summary .chev { transform: rotate(180deg); }
.ro dl { margin: 0 12px 12px; background: var(--soft); border: 1px solid var(--border); border-radius: 12px; padding: 12px 14px; display: grid; grid-template-columns: 1fr 1fr; gap: 6px 10px; font-size: 16px; }
.ro dt { color: #4A6180; } .ro dd { margin: 0; font-weight: 600; }
.ro .thumbs { display: flex; gap: 8px; margin: 0 12px 12px; }
.ro .thumbs button { border: 1px solid var(--border); border-radius: 10px; padding: 0; overflow: hidden; width: 84px; height: 60px; background: #eef2f6; }
.ro .thumbs img { width: 100%; height: 100%; object-fit: cover; }

/* ---------- confirmation ---------- */
.success-ico { width: 104px; height: 104px; border-radius: 50%; background: #E3F6EA; display: flex; align-items: center; justify-content: center; margin: 6px auto 10px; position: relative; }
.success-ico span { width: 76px; height: 76px; border-radius: 50%; background: var(--green); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 42px; }
.success-ico.confetti::before, .success-ico.confetti::after { content: ''; position: absolute; width: 8px; height: 8px; border-radius: 50%; background: #4cc27c; box-shadow: -34px 34px 0 -1px #4cc27c, 128px 10px 0 0 #4cc27c, 118px 46px 0 -2px #9bdcb6, -20px -4px 0 -2px #9bdcb6; top: 18px; left: -26px; }
.success-title { font-size: 30px; font-weight: 800; letter-spacing: -.6px; text-align: center; margin: 0; }
.success-sub { text-align: center; color: var(--muted); font-size: 19px; margin: 6px 0 14px; }
.kv { border-top: 1px solid var(--border); margin-top: 8px; }
.kv .r { display: grid; grid-template-columns: 34px 1fr auto; align-items: center; gap: 14px; padding: 14px 6px; border-bottom: 1px solid var(--border); font-size: 18px; }
.kv .r .i { font-size: 26px; color: #4C6482; }
.kv .r .k { color: #3e5675; }
.kv .r .v { font-weight: 700; }
.state-banner { display: flex; align-items: center; justify-content: center; gap: 18px; background: var(--blue-tint); border: 1px solid var(--blue-line); border-radius: 14px; min-height: 78px; margin: 16px 0 12px; font-size: 28px; font-weight: 800; letter-spacing: .5px; color: var(--blue); }
.state-banner .i { font-size: 48px; }
.state-banner .sep { width: 1px; height: 40px; background: var(--blue-line); }
.state-banner.orange { background: var(--orange-tint); border-color: var(--orange-line); color: #c06a00; }
.state-banner.green { background: var(--green-tint); border-color: var(--green-line); color: var(--green); }
.res-strip { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); border: 1px solid var(--green-line); background: #F1FAF4; border-radius: 12px; margin: 4px 0 12px; }
.res-strip > div { display: flex; align-items: center; gap: 10px; padding: 12px; font-weight: 600; font-size: 15px; }
.res-strip > div + div { border-left: 1px solid var(--green-line); }
.res-strip .ok .i { font-size: 30px; color: var(--green); }
.res-strip .ko { color: var(--red); } .res-strip .ko .i { font-size: 28px; }
.tiles { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 10px; }
.tile { border: 1px solid var(--border); border-radius: 12px; padding: 12px; display: flex; align-items: center; gap: 12px; background: var(--soft); }
.tile .i { font-size: 40px; color: var(--blue); }
.tile.red .i, .tile.red .v { color: var(--red); }
.tile.green .i, .tile.green .v { color: var(--green); }
.tile .k { font-size: 15px; color: #3e5675; }
.tile .v { font-size: 24px; font-weight: 700; }

/* ---------- fiche camion : timeline ---------- */
.detail-head { display: grid; grid-template-columns: 48px 1fr 48px; align-items: center; margin-bottom: 12px; }
.detail-head h2 { margin: 0; text-align: center; font-size: 30px; font-weight: 800; }
.back { width: 48px; height: 48px; border: 1px solid var(--border); border-radius: 12px; background: var(--soft); display: flex; align-items: center; justify-content: center; font-size: 24px; color: var(--navy); }
.tl { position: relative; display: grid; gap: 8px; }
.tl-row { display: grid; grid-template-columns: 56px 20px 50px minmax(0, 1fr) auto; align-items: center; gap: 8px; border: 1px solid var(--border); border-radius: 12px; padding: 10px 10px 10px 8px; min-height: 74px; background: #fff; position: relative; }
.tl-row .tm { font-weight: 700; font-size: 17px; text-align: right; }
.tl-row .pt { width: 14px; height: 14px; border-radius: 50%; justify-self: center; position: relative; z-index: 1; }
.tl-row .pt.ring { background: #fff; border: 3px solid var(--blue); }
.tl::before { content: ''; position: absolute; left: 81px; top: 20px; bottom: 20px; width: 2px; background: var(--border); }
.tl-row .ic { width: 48px; height: 48px; border-radius: 50%; color: #fff; display: flex; align-items: center; justify-content: center; font-size: 24px; }
.tl-row .tx b { display: block; font-size: 17px; }
.tl-row .tx span { color: var(--muted); font-size: 15px; display: block; }
.tl-row .edit { border: 0; background: none; color: var(--blue); font-weight: 600; font-size: 14px; min-height: 40px; padding: 0 4px; }
.bg-blue { background: var(--blue); } .bg-green { background: var(--green); } .bg-orange { background: #F5A31A; } .bg-violet { background: var(--violet); } .bg-red { background: var(--red); } .bg-gray { background: #8b9bb0; }
.photos { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 14px; padding: 10px; background: var(--soft); border-radius: 14px; border: 1px solid var(--border); }
.ph { border: 1px solid var(--border); border-radius: 12px; background: #fff; padding: 0; overflow: hidden; text-align: center; }
.ph img, .ph .none { width: 100%; height: 108px; object-fit: cover; }
.ph .none { display: flex; align-items: center; justify-content: center; flex-direction: column; color: var(--red); font-size: 14px; gap: 4px; background: #fff8f8; }
.ph .none .i { font-size: 26px; }
.ph span { display: block; padding: 8px; color: #3e5675; font-size: 15px; }
.info { display: flex; gap: 10px; align-items: center; padding: 12px 14px; border-radius: 12px; background: var(--soft); border: 1px solid var(--border); color: #3e5675; font-size: 15px; margin-top: 12px; }
.info .i { font-size: 22px; color: var(--blue); }

/* ---------- historique ---------- */
.search { display: flex; align-items: center; gap: 12px; border: 1px solid var(--border); background: var(--soft); border-radius: 12px; min-height: 56px; padding: 0 14px; }
.search .i { font-size: 24px; color: #4C6482; }
.search input { border: 0; background: none; outline: none; flex: 1; font-size: 18px; min-width: 0; }
.search:focus-within { border-color: var(--blue); }
.filters { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin: 12px 0 14px; }
.chip { position: relative; display: flex; align-items: center; gap: 8px; border: 1px solid var(--border); background: var(--soft); border-radius: 12px; min-height: 52px; padding: 0 10px; }
.chip .i { font-size: 22px; color: #4C6482; flex: none; }
.chip select { border: 0; background: transparent; appearance: none; -webkit-appearance: none; font-size: 16px; flex: 1; min-width: 0; outline: none; padding-right: 18px; cursor: pointer; }
.chip .dd { position: absolute; right: 10px; pointer-events: none; font-size: 16px; }
.chip.active { border-color: var(--blue); background: var(--blue-tint); }
.period { display: flex; gap: 8px; align-items: center; margin: -6px 0 12px; font-size: 15px; color: var(--muted); }
.period input { border: 1px solid var(--border); border-radius: 10px; min-height: 44px; padding: 0 8px; background: var(--soft); }
.hcard { width: 100%; display: grid; grid-template-columns: 74px minmax(0, 1fr) auto 20px; gap: 10px; align-items: center; text-align: left; padding: 14px 10px 14px 12px; margin-bottom: 10px; background: #fff; }
.hcard .ti { font-size: 64px; }
.hcard .nm { font-size: 20px; font-weight: 700; }
.hcard .ln { display: flex; align-items: center; gap: 8px; color: #3e5675; font-size: 16px; margin-top: 3px; }
.hcard .ln .i { font-size: 18px; color: #4C6482; }
.hcard .st { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.hcard .chev { color: #8aa0b8; font-size: 22px; }

/* ---------- admin mobile ---------- */
.panel { border: 1px solid var(--border); border-radius: 16px; background: #fff; padding: 16px; margin-top: 12px; }
.panel h3 { margin: 0 0 12px; font-size: 22px; font-weight: 800; display: flex; align-items: center; justify-content: space-between; }
.feed { position: relative; }
.feed .ev { display: grid; grid-template-columns: 56px 22px 1fr; gap: 10px; padding: 10px 0; border-bottom: 1px solid #EDF2F6; position: relative; }
.feed .ev:last-child { border-bottom: 0; }
.feed .ev .tm { color: #4A6180; font-size: 16px; }
.feed .ev .dt { width: 12px; height: 12px; border-radius: 50%; margin-top: 5px; justify-self: center; position: relative; z-index: 1; }
.feed::before { content: ''; position: absolute; left: 76px; top: 16px; bottom: 16px; width: 2px; background: var(--border); }
.feed .ev b { display: block; font-size: 17px; }
.feed .ev span { color: #4A6180; font-size: 15px; }
.alert-row { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; border: 1px solid var(--red-line); background: #FFF3F3; border-radius: 12px; padding: 10px 12px; margin-bottom: 8px; }
.alert-row .round { width: 46px; height: 46px; border-radius: 50%; background: #FFE1E2; color: var(--red); display: flex; align-items: center; justify-content: center; font-size: 26px; flex: none; }
.alert-row.orange { border-color: var(--orange-line); background: #FFF8EC; } .alert-row.orange .round { background: #FFEBCC; color: var(--orange); }
.alert-row b { display: block; font-size: 17px; }
.alert-row span { font-size: 15px; color: var(--red); }
.alert-row.orange span { color: #b45f00; }
.alert-row .chev { margin-left: auto; color: #6b819a; }
.empty { padding: 18px 14px; border: 1px dashed var(--border); border-radius: 14px; color: var(--muted); text-align: center; font-size: 16px; background: #fff; }
.doc-cards { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 10px; }
.doc-cards > div { border: 1px solid var(--border); border-radius: 12px; padding: 12px; }
.doc-cards span { color: var(--muted); font-size: 14px; }
.doc-cards strong { display: block; font-size: 24px; margin-top: 4px; }

/* bandeau de réassurance (écrans d'action, sans nav basse) */
.trust { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); padding: 14px 8px 18px; margin-top: 8px; }
.trust > div { display: flex; align-items: center; gap: 8px; padding: 0 8px; color: #3e5675; font-size: 13px; line-height: 1.2; border-left: 1px solid var(--border); }
.trust > div:first-child { border-left: 0; }
.trust .i { font-size: 30px; color: #3F5878; flex: none; }

/* navigation basse (§42–43) */
.bottom-nav { position: sticky; bottom: 0; z-index: 20; display: grid; grid-template-columns: repeat(4, 1fr); background: #fff; border-top: 1px solid var(--border); padding: 0 4px calc(6px + env(safe-area-inset-bottom)); }
.bottom-nav button { border: 0; background: none; min-height: 64px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; color: #4A6180; font-size: 14px; position: relative; border-left: 1px solid #EEF2F6; }
.bottom-nav button:first-child { border-left: 0; }
.bottom-nav button .i { font-size: 28px; }
.bottom-nav button[aria-current="page"] { color: var(--blue); font-weight: 600; }
.bottom-nav button[aria-current="page"]::before { content: ''; position: absolute; top: 0; left: 22%; right: 22%; height: 3px; border-radius: 0 0 3px 3px; background: var(--blue); }

/* modale photo */
.modal { position: fixed; inset: 0; z-index: 100; background: rgba(6, 18, 40, .82); display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 16px; gap: 12px; }
.modal img { max-height: 72vh; border-radius: 12px; background: #fff; }
.modal .cap { color: #fff; font-weight: 600; text-align: center; }
.modal .cap small { display: block; color: #b7c8de; font-weight: 400; }
.modal .row { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }
.modal .row .btn { width: auto; min-width: 130px; font-size: 16px; min-height: 48px; }
.toast { position: fixed; left: 50%; bottom: 90px; transform: translateX(-50%); background: var(--navy); color: #fff; padding: 12px 18px; border-radius: 12px; font-weight: 600; z-index: 120; max-width: 92vw; box-shadow: 0 8px 24px rgba(0,0,0,.2); }

/* ---------- ADMIN desktop (§13, §70) ---------- */
.app.desk { max-width: 1280px; margin: 20px auto; border-radius: 26px; overflow: hidden; border: 1px solid #dfe8f0; box-shadow: 0 18px 50px rgba(16,38,67,.12); min-height: 0; }
.desk .dhead { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 18px 28px 14px; }
.desk .ident { display: flex; align-items: center; gap: 22px; }
.desk .ident .logo { height: 46px; }
.desk .ident h1 { margin: 0; font-size: 32px; font-weight: 900; letter-spacing: -1px; line-height: 1; }
.desk .ident h1 span { color: var(--blue); }
.desk .ident p { margin: 2px 0 0; font-weight: 700; color: #16325f; }
.desk .dhero { height: 170px; background: url('../assets/entrepot-bandeau.jpg') center 38% / cover no-repeat; position: relative; }
.desk .dhero::after { content: ''; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(255,255,255,.55), rgba(255,255,255,0) 45%); }
.desk .dmenu { display: flex; gap: 4px; padding: 0 22px; border-bottom: 1px solid var(--border); background: #fff; overflow-x: auto; }
.desk .dmenu button { border: 0; background: none; min-height: 54px; padding: 0 16px; font-weight: 600; color: #4A6180; display: flex; align-items: center; gap: 8px; position: relative; white-space: nowrap; }
.desk .dmenu button .i { font-size: 20px; }
.desk .dmenu button[aria-current="page"] { color: var(--blue); }
.desk .dmenu button[aria-current="page"]::after { content: ''; position: absolute; left: 10px; right: 10px; bottom: -1px; height: 3px; background: var(--blue); border-radius: 3px 3px 0 0; }
.desk .dmenu .count { background: var(--red); color: #fff; border-radius: 999px; font-size: 12px; padding: 1px 7px; }
.desk .dmain { padding: 22px 28px 28px; }
.desk .topline { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 16px; }
.desk .topline .h1 { margin: 0; }
.desk .topline .sub { margin: 4px 0 0; }
.dkpis { display: grid; grid-template-columns: repeat(6, 1fr); gap: 12px; }
.dkpi { border: 1px solid var(--border); border-radius: 16px; padding: 14px 16px; background: #fff; text-align: left; display: flex; flex-direction: column; gap: 6px; min-height: 110px; }
.dkpi .top { display: flex; align-items: center; justify-content: space-between; color: #4A6180; font-size: 13px; font-weight: 600; gap: 8px; }
.dkpi .top .i { font-size: 24px; }
.dkpi .val { font-size: 34px; font-weight: 800; line-height: 1; }
.dkpi.tone-blue { background: var(--blue-tint); } .dkpi.tone-blue .i { color: var(--blue); }
.dkpi.tone-orange { background: var(--orange-tint); } .dkpi.tone-orange .i { color: var(--orange); }
.dkpi.tone-green { background: var(--green-tint); } .dkpi.tone-green .i { color: var(--green); }
.dkpi.tone-violet { background: var(--violet-tint); } .dkpi.tone-violet .i { color: var(--violet); }
.dkpi.tone-red { background: var(--red-tint); } .dkpi.tone-red .i { color: var(--red); }
.dfilters { display: flex; gap: 8px; flex-wrap: wrap; margin: 16px 0; align-items: center; }
.dfilters .chip { min-height: 44px; min-width: 160px; }
.dfilters .search { min-height: 44px; flex: 1; min-width: 220px; }
.dfilters .search input { font-size: 15px; }
.dfilters .chip select { font-size: 15px; }
.dgrid { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(300px, .75fr); gap: 16px; align-items: start; }
.desk .panel { margin-top: 0; }
.desk .panel + .panel { margin-top: 16px; }
.desk .panel h3 { font-size: 19px; }
.twrap { overflow-x: auto; }
table.mv { width: 100%; border-collapse: collapse; font-size: 15px; min-width: 640px; }
.mv th { text-align: left; color: #54708e; font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .3px; padding: 10px 10px; border-bottom: 1px solid var(--border); white-space: nowrap; }
.mv td { padding: 13px 10px; border-bottom: 1px solid #EDF2F6; white-space: nowrap; }
.mv tbody tr { cursor: pointer; }
.mv tbody tr:hover { background: var(--soft); }
.mv tbody tr:focus-visible { outline: 2px solid var(--blue); outline-offset: -2px; }
.mv td.num { text-align: right; font-variant-numeric: tabular-nums; } .mv th.num { text-align: right; }
.mv .badge { font-size: 13px; padding: 5px 10px; }
.mv .ops { display: flex; gap: 4px; flex-wrap: wrap; }
.mv td.opscell { white-space: normal; }
.mv td, .mv th { padding-left: 8px; padding-right: 8px; }
.mv .op { display: inline-flex; align-items: center; gap: 5px; font-size: 13px; border: 1px solid var(--border); border-radius: 8px; padding: 3px 8px; background: #fff; }
.mv .op .i { font-size: 15px; }
.desk .feed::before { left: 70px; }
.desk .feed .ev { grid-template-columns: 50px 22px 1fr; }
.desk .feed .ev b, .desk .alert-row b { font-size: 15px; } .desk .feed .ev span, .desk .alert-row span { font-size: 14px; }
.desk .doc-cards strong { font-size: 22px; }
.drawer-bg { position: fixed; inset: 0; background: rgba(6,18,40,.45); z-index: 60; display: flex; justify-content: flex-end; }
.drawer { width: min(480px, 100%); height: 100%; background: #fff; overflow-y: auto; padding: 18px 16px 24px; box-shadow: -10px 0 30px rgba(0,0,0,.15); }
table.users { width: 100%; border-collapse: collapse; font-size: 15px; }
.users th { text-align: left; color: #54708e; font-size: 12px; text-transform: uppercase; padding: 10px; border-bottom: 1px solid var(--border); }
.users td { padding: 12px 10px; border-bottom: 1px solid #EDF2F6; }

/* ---------- responsive (§51) ---------- */
@media (max-width: 1100px) { .dkpis { grid-template-columns: repeat(3, 1fr); } .dgrid { grid-template-columns: 1fr; } }
@media (max-width: 400px) {
  .hero-title h1 { font-size: 40px; } .hero-title p { font-size: 18px; } .hero-photo { height: 180px; }
  .h1 { font-size: 26px; } .kpi .val { font-size: 32px; } .kpi .ico { font-size: 32px; } .kpi .lbl { font-size: 14px; }
  .truck-card .v { font-size: 16px; } .truck-card .cols > div { padding: 0 6px; }
  .choice .ci { font-size: 40px; } .choice .ct { font-size: 15px; }
  .hcard { grid-template-columns: 48px minmax(0, 1fr) auto 14px; gap: 8px; padding: 12px 8px; } .hcard .nm { font-size: 18px; }
  .truck-card .top { gap: 10px; } .truck-card .top .ti { font-size: 38px; } .truck-card .name { font-size: 17px; }
  .badge { font-size: 13px; padding: 5px 9px; gap: 5px; } .hcard .ti { font-size: 48px; } .hcard .ln { font-size: 15px; }
  .tl-row { grid-template-columns: 46px 14px 40px minmax(0, 1fr) auto; gap: 6px; } .tl-row .tm { font-size: 15px; } .tl-row .tx b { font-size: 15px; } .tl-row .ic { width: 40px; height: 40px; font-size: 20px; } .tl::before { left: 68px; }
  .state-banner { font-size: 22px; } .success-title { font-size: 26px; }
  .tile .v { font-size: 20px; } .tile .i { font-size: 32px; }
  .kv .r { font-size: 16px; }
  .trust .i { font-size: 24px; } .trust > div { font-size: 12px; padding: 0 5px; }
}
@media (max-width: 400px) {
  .login-title { font-size: 23px; }
  .choice.left { padding-left: 40px; } .choice.left .ci { display: none; }
  .stepper .ctl button { width: 42px; } .stepper .ctl input { width: 58px; }
  .res-strip > div { font-size: 14px; padding: 10px 8px; }
}
@media (max-width: 350px) {
  .kpi .lbl, .akpi .lbl { font-size: 12px; } .akpi .val { font-size: 26px; }
  .trust .i { display: none; } .trust > div { font-size: 11px; justify-content: center; text-align: center; }
  .tile { padding: 10px 8px; gap: 8px; } .tile .i { font-size: 26px; } .tile .v { font-size: 18px; }
  .f { gap: 10px; padding: 8px 10px; } .f > .i { font-size: 22px; }
  .h1 { font-size: 24px; }
  .hero-title h1 { font-size: 34px; } .brandbar .logo { height: 30px; } .lang button { min-width: 42px; padding: 0 8px; }
  .grid3 { gap: 6px; } .kpi { padding: 10px 8px; } .kpi .val { font-size: 28px; } .kpi .chev { width: 24px; height: 24px; right: 6px; }
  .truck-card .cols { grid-template-columns: 1fr 1fr; row-gap: 8px; } .truck-card .cols > div:nth-child(3) { border-left: 0; padding-left: 0; }
  .fgrid { grid-template-columns: 1fr; }
  .filters { grid-template-columns: 1fr 1fr; }
  .akpi .round { width: 42px; height: 42px; font-size: 22px; } .akpi .val { font-size: 28px; }
  .bottom-nav button { font-size: 12px; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }

/* ---------- web app installée (iPhone / Android) ---------- */
.install { display: grid; gap: 10px; margin-top: 16px; padding: 14px; border: 1px dashed var(--blue-line); border-radius: 14px; background: var(--blue-tint); color: #2b4566; font-size: 15px; line-height: 1.45; }
.install .btn { min-height: 48px; font-size: 16px; }
/* Une fois installée, la barre de test se fait discrète et la nav basse respecte la barre d'accueil iOS. */
/* La barre de test occupe le haut de l'écran : c'est elle qui absorbe l'encoche, pas le header. */
.testbar:not(.hidden) { padding-top: env(safe-area-inset-top); }
.testbar:not(.hidden) + .app .brandbar { padding-top: 14px; }
input, select, textarea { font-size: max(16px, 1em); }   /* évite le zoom automatique d'iOS sur les champs */
.dfilters .search input, .dfilters .chip select { font-size: 16px; }
button, label.choice, .photo-drop { touch-action: manipulation; }
