:root {
  --navy: #0e1a2b;
  --navy-2: #16263d;
  --navy-3: #22364f;
  --bg: #f2f4f7;
  --surface: #ffffff;
  --ink: #0f1a2a;
  --ink-2: #334155;
  --muted: #64748b;
  --line: #e3e8ef;
  --line-2: #cfd7e2;
  --primary: #1f4fd1;
  --primary-ink: #ffffff;
  --amber: #f59e0b;
  --amber-ink: #3b2400;
  --go: #16a34a;
  --pause: #d97706;
  --done: #0e7490;
  --off: #94a3b8;
  --warn: #dc2626;
  --ice: #e8f1fb;
  --r: 12px;
  --r-sm: 8px;
  --shadow: 0 1px 2px rgba(15, 26, 42, .06), 0 4px 16px rgba(15, 26, 42, .06);
  --font: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --display: 'Barlow Condensed', 'Inter', sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { font: 14px/1.45 var(--font); color: var(--ink); background: var(--bg); -webkit-font-smoothing: antialiased; }
svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; flex: none; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: inherit; }
h1, h2, h3 { margin: 0; }
code { background: var(--ice); padding: 1px 6px; border-radius: 5px; font-size: 12.5px; }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.warn-t { color: var(--warn); font-weight: 600; }
.boot { display: grid; place-items: center; height: 100vh; color: var(--muted); }
[hidden] { display: none !important; }

/* ---------- Boutons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; border: 1px solid var(--line-2); background: var(--surface); color: var(--ink); padding: 8px 14px; border-radius: var(--r-sm); font-weight: 600; cursor: pointer; text-decoration: none; white-space: nowrap; transition: background .15s, border-color .15s, transform .05s; }
.btn:hover { border-color: #a9b6c8; background: #f8fafc; }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .55; cursor: default; }
.btn.primary { background: var(--primary); border-color: var(--primary); color: var(--primary-ink); }
.btn.primary:hover { background: #1a43b5; }
.btn.amber { background: var(--amber); border-color: var(--amber); color: var(--amber-ink); }
.btn.amber:hover { background: #e48f06; }
.btn.danger { background: var(--warn); border-color: var(--warn); color: #fff; }
.btn.ghost { background: transparent; }
.btn.ghost-light { background: rgba(255, 255, 255, .1); border-color: rgba(255, 255, 255, .25); color: #fff; }
.btn.ghost-light:hover { background: rgba(255, 255, 255, .18); }
.btn.sm { padding: 5px 10px; font-size: 12.5px; }
.btn.sm svg { width: 15px; height: 15px; }
.btn.lg { padding: 12px 16px; font-size: 15px; }
.btn.xl { padding: 16px 18px; font-size: 18px; width: 100%; border-radius: var(--r); }
.link { background: none; border: 0; padding: 6px 0; color: var(--primary); font-weight: 600; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; }
.link.danger { color: var(--warn); }
.link.center { display: flex; margin: 6px auto 0; }
.icon-btn { background: transparent; border: 1px solid var(--line-2); border-radius: var(--r-sm); width: 44px; height: 44px; display: grid; place-items: center; cursor: pointer; }

/* ---------- Champs ---------- */
.field { display: flex; flex-direction: column; gap: 5px; font-weight: 600; font-size: 13px; color: var(--ink-2); }
.field input, .field select, .field textarea, select, input[type=search], .row input { border: 1px solid var(--line-2); border-radius: var(--r-sm); padding: 9px 11px; background: #fff; font-weight: 400; font-size: 14px; color: var(--ink); min-width: 0; }
select { padding: 7px 30px 7px 10px; appearance: none; background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") no-repeat right 8px center / 16px; cursor: pointer; }
input:focus, select:focus, textarea:focus { outline: 2px solid rgba(31, 79, 209, .35); outline-offset: 0; border-color: var(--primary); }
.label { font-weight: 600; font-size: 13px; color: var(--ink-2); margin: 4px 0 6px; }
.form { display: flex; flex-direction: column; gap: 12px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.grid3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 12px; }
.row { display: flex; gap: 8px; } .row input { flex: 1; }

/* ---------- Puces ---------- */
.avatar { --c: #64748b; width: 34px; height: 34px; border-radius: 50%; background: var(--c); color: #fff; display: inline-grid; place-items: center; font-weight: 700; font-size: 12.5px; flex: none; letter-spacing: .02em; }
.avatar.sm { width: 24px; height: 24px; font-size: 10px; }
.pill { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; padding: 2px 9px 2px 7px; border-radius: 99px; background: #eef2f6; color: var(--ink-2); white-space: nowrap; }
.pill i { width: 7px; height: 7px; border-radius: 50%; background: var(--off); }
.pill.go { background: #e7f6ec; color: #116a33; } .pill.go i { background: var(--go); box-shadow: 0 0 0 3px rgba(22, 163, 74, .18); }
.pill.pause { background: #fdf3e2; color: #8a4b04; } .pill.pause i { background: var(--pause); }
.pill.done { background: #e2f3f6; color: #0b5566; } .pill.done i { background: var(--done); }
.pill.warn { background: #fdecec; color: #9b1c1c; } .pill.warn i { background: var(--warn); }
.vchip { display: inline-flex; align-items: center; gap: 7px; border: 1px solid var(--line); border-radius: 7px; padding: 2px 9px 2px 3px; background: #fff; font-size: 12.5px; white-space: nowrap; max-width: 100%; overflow: hidden; }
.vchip b { background: var(--navy); color: #fff; font-family: var(--display); font-size: 14px; letter-spacing: .04em; padding: 1px 7px; border-radius: 5px; }
.vchip span { color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; }
.vchip.none { color: var(--muted); padding: 3px 9px; border-style: dashed; }
.tag { font-size: 11.5px; font-weight: 600; padding: 2px 8px; border-radius: 6px; white-space: nowrap; background: #eef2f6; color: var(--ink-2); }
.tag.free { background: #e7f6ec; color: #116a33; }
.tag.busy { background: #e8eefc; color: #1e3fa8; }
.tag.cur { background: var(--navy); color: #fff; }
.tag.gar { background: #fdecec; color: #9b1c1c; }
.tag.com { background: #f3e8ff; color: #6b21a8; }
.tag.res { background: #eef2f6; color: var(--ink-2); }
.bar { height: 8px; border-radius: 99px; background: rgba(15, 26, 42, .08); overflow: hidden; }
.bar i { display: block; height: 100%; background: var(--rc, var(--go)); border-radius: inherit; transition: width .6s ease; }
.bar.thin { height: 5px; }
.note { display: flex; gap: 7px; align-items: flex-start; background: #fff7e6; border: 1px solid #f6d79a; color: #6b3d00; border-radius: var(--r-sm); padding: 6px 9px; font-size: 12.5px; margin-top: 6px; }
.note svg { width: 15px; height: 15px; margin-top: 1px; color: var(--pause); }
.note.big { font-size: 15px; padding: 10px 12px; }
.note.big svg { width: 18px; height: 18px; }
.beacon { width: 12px; height: 12px; border-radius: 50%; background: var(--amber); box-shadow: 0 0 0 0 rgba(245, 158, 11, .7); animation: beacon 1.6s infinite; flex: none; }
.beacon.off { background: var(--off); animation: none; }
@keyframes beacon { 0% { box-shadow: 0 0 0 0 rgba(245, 158, 11, .7); } 70% { box-shadow: 0 0 0 12px rgba(245, 158, 11, 0); } 100% { box-shadow: 0 0 0 0 rgba(245, 158, 11, 0); } }
.conn { width: 8px; height: 8px; border-radius: 50%; margin-left: auto; }
.conn.on { background: #22c55e; box-shadow: 0 0 0 3px rgba(34, 197, 94, .2); }
.conn.off { background: var(--warn); }

/* ---------- Connexion ---------- */
.login-wrap { min-height: 100vh; display: grid; grid-template-columns: 1.1fr 1fr; }
.login-side { background: radial-gradient(1200px 500px at 0% 0%, #1d3557 0%, transparent 60%), var(--navy); color: #fff; padding: 56px; display: flex; flex-direction: column; gap: 28px; position: relative; overflow: hidden; }
.login-side::after { content: ''; position: absolute; inset: auto -10% -40px -10%; height: 120px; background: var(--ice); border-radius: 50% 50% 0 0 / 100% 100% 0 0; opacity: .08; }
.login-side h1 { font-family: var(--display); font-size: 46px; line-height: 1.05; max-width: 15ch; letter-spacing: .005em; }
.sell { list-style: none; padding: 0; margin: 0; display: grid; gap: 14px; font-size: 15.5px; color: #cdd8e6; }
.sell li { display: flex; align-items: center; gap: 12px; }
.sell svg { color: var(--amber); width: 22px; height: 22px; }
.login-side .muted { color: #8ea0b8; margin-top: auto; }
.brand { display: flex; align-items: center; gap: 10px; font-family: var(--display); font-weight: 700; font-size: 24px; letter-spacing: .03em; }
.brand .logo { width: 32px; height: 32px; color: var(--navy-3); stroke: none; }
.brand.big { font-size: 30px; } .brand.big .logo { width: 42px; height: 42px; color: #1d3557; }
.login-forms { padding: 56px; display: flex; flex-direction: column; justify-content: center; max-width: 520px; width: 100%; margin: 0 auto; gap: 18px; }
.tabs { display: inline-flex; background: #e6eaf0; border-radius: 10px; padding: 4px; align-self: flex-start; }
.tab { border: 0; background: none; padding: 8px 18px; border-radius: 7px; font-weight: 600; cursor: pointer; color: var(--muted); }
.tab.on { background: #fff; color: var(--ink); box-shadow: 0 1px 3px rgba(0, 0, 0, .08); }
.lform { display: flex; flex-direction: column; gap: 16px; }
.who { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 10px; }
.who-item { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 14px 8px; border: 1.5px solid var(--line); border-radius: var(--r); background: #fff; cursor: pointer; font-weight: 600; text-align: center; transition: border-color .15s; }
.who-item input { position: absolute; opacity: 0; pointer-events: none; }
.who-item .avatar { width: 44px; height: 44px; font-size: 15px; }
.who-item:has(input:checked) { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(31, 79, 209, .15); }
.hint { font-size: 12.5px; color: var(--muted); }

/* ---------- Coquille patron ---------- */
.shell { display: grid; grid-template-columns: 232px 1fr; height: 100vh; }
.side { background: var(--navy); color: #c6d2e1; display: flex; flex-direction: column; padding: 18px 12px; gap: 22px; }
.side .brand { color: #fff; padding: 0 8px; }
.side nav { display: flex; flex-direction: column; gap: 2px; }
.side nav a { display: flex; align-items: center; gap: 11px; padding: 9px 10px; border-radius: 8px; text-decoration: none; font-weight: 500; color: #b3c1d3; }
.side nav a:hover { background: var(--navy-2); color: #fff; }
.side nav a.on { background: var(--navy-3); color: #fff; box-shadow: inset 3px 0 0 var(--amber); }
.side-foot { margin-top: auto; display: flex; flex-direction: column; gap: 10px; padding: 0 8px; font-size: 13px; }
.side-foot .link { color: #b3c1d3; }
.company { color: #7f93ad; font-size: 12px; }
.switch { display: flex; align-items: center; gap: 9px; cursor: pointer; }
.switch input { display: none; }
.switch span { width: 32px; height: 18px; border-radius: 99px; background: #3a4d66; position: relative; transition: background .2s; }
.switch span::after { content: ''; position: absolute; left: 2px; top: 2px; width: 14px; height: 14px; border-radius: 50%; background: #fff; transition: transform .2s; }
.switch input:checked + span { background: var(--amber); }
.switch input:checked + span::after { transform: translateX(14px); }
.main { display: flex; flex-direction: column; min-width: 0; min-height: 0; }

.stormbar { display: flex; align-items: center; gap: 20px; padding: 12px 22px; background: var(--surface); border-bottom: 1px solid var(--line); min-height: 64px; }
.stormbar.active { background: linear-gradient(90deg, #13233a, #1b2f4b); color: #fff; border-bottom: 0; }
.sb-left { display: flex; align-items: center; gap: 14px; }
.sb-title { font-family: var(--display); font-weight: 700; font-size: 20px; letter-spacing: .03em; text-transform: uppercase; line-height: 1.1; }
.sb-sub { font-size: 12.5px; opacity: .75; }
.stormbar:not(.active) .sb-title { font-size: 17px; text-transform: none; letter-spacing: .01em; }
.cm { display: inline-flex; align-items: center; gap: 6px; background: rgba(255, 255, 255, .1); border: 1px solid rgba(255, 255, 255, .2); color: #fff; border-radius: 8px; padding: 5px 10px; cursor: pointer; }
.cm b { font-family: var(--display); font-size: 20px; }
.cm svg { color: #9cc7f0; }
.sb-prog { flex: 1; max-width: 420px; margin-left: auto; display: flex; flex-direction: column; gap: 6px; }
.sb-num { font-size: 13px; } .sb-num b { font-size: 16px; }
.stormbar.active .bar { background: rgba(255, 255, 255, .15); }
.stormbar.active .bar i { background: linear-gradient(90deg, #34d399, #22c55e); }
.stormbar.active .warn-t { color: #fca5a5; }
.stormbar:not(.active) .btn { margin-left: auto; }

.page { flex: 1; overflow: auto; padding: 22px; min-height: 0; }
.page.page-carte { padding: 0; overflow: hidden; }
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; margin-bottom: 18px; flex-wrap: wrap; }
.page-head h1 { font-family: var(--display); font-size: 30px; letter-spacing: .01em; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow); }
.card-t { font-size: 14px; padding: 14px 16px 6px; }
.sec { font-size: 11.5px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin: 22px 0 10px; }

/* ---------- Carte en direct ---------- */
.live { display: grid; grid-template-columns: 1fr 380px; height: 100%; }
.map-wrap { position: relative; min-height: 300px; }
#map { position: absolute; inset: 0; background: #e5e9ee; }
.nomap { display: grid; place-items: center; height: 100%; color: var(--muted); padding: 20px; text-align: center; }
.map-legend { position: absolute; left: 12px; bottom: 22px; z-index: 500; background: rgba(255, 255, 255, .95); border-radius: 9px; padding: 7px 11px; display: flex; gap: 12px; font-size: 12px; box-shadow: var(--shadow); }
.map-legend span { display: flex; align-items: center; gap: 5px; }
.dot { width: 10px; height: 10px; border-radius: 50%; border: 2px solid #fff; box-shadow: 0 0 0 1px rgba(0, 0, 0, .2); }
.dot.todo, .cpin.todo { background: #94a3b8; } .dot.done, .cpin.done { background: var(--go); } .dot.issue, .cpin.issue { background: var(--warn); }
.live-side { border-left: 1px solid var(--line); background: var(--bg); overflow: auto; padding: 16px; }
.live-side .sec:first-of-type { margin-top: 18px; }
.kpis { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.kpi { background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 10px 11px; display: flex; flex-direction: column; gap: 2px; }
.kpi span { font-size: 11.5px; color: var(--muted); font-weight: 600; }
.kpi b { font-family: var(--display); font-size: 28px; line-height: 1; }
.kpi b small:first-child { margin-left: 2px; }
.kpi small { font-family: var(--font); font-size: 11.5px; color: var(--muted); font-weight: 500; margin-left: 2px; }
.kpi em { font-style: normal; font-size: 11px; color: var(--muted); }
.oplist { display: flex; flex-direction: column; gap: 8px; }
.opcard { background: #fff; border: 1px solid var(--line); border-radius: 11px; padding: 11px 12px; display: flex; flex-direction: column; gap: 9px; transition: border-color .15s; }
.opcard.is-off { opacity: .6; }
.opcard.is-follow { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(31, 79, 209, .12); }
.op-top { display: flex; gap: 10px; align-items: center; cursor: pointer; }
.op-id { min-width: 0; } .op-id b { display: block; }
.op-meta { display: flex; align-items: center; gap: 8px; margin-top: 2px; flex-wrap: wrap; }
.op-veh { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.op-route { display: flex; justify-content: space-between; font-size: 12.5px; color: var(--ink-2); }
.feed { display: flex; flex-direction: column; }
.feed-i { display: grid; grid-template-columns: 54px 1fr; gap: 8px; padding: 6px 0; border-bottom: 1px dashed var(--line); font-size: 12.5px; }
.feed.big .feed-i { grid-template-columns: 130px 1fr; padding: 8px 16px; }
.feed-i time { color: var(--muted); font-variant-numeric: tabular-nums; }
.feed-i.k-alerte span { color: #9b1c1c; font-weight: 600; }
.feed-i.k-vehicule span::before { content: '⇄ '; color: var(--primary); }
.feed-i.k-tempete span { font-weight: 600; }

/* Marqueurs */
.cpin { width: 14px; height: 14px; border-radius: 50%; border: 2.5px solid #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .35); }
.cpin.com { border-radius: 3px; }
.vpin { --c: #1f4fd1; display: flex; flex-direction: column; align-items: center; transition: transform .3s; }
.vp-b { background: var(--navy); color: #fff; font-family: var(--display); font-weight: 700; font-size: 15px; letter-spacing: .04em; padding: 3px 9px; border-radius: 8px; border: 2.5px solid var(--c); box-shadow: 0 3px 10px rgba(0, 0, 0, .3); position: relative; }
.vpin.st-en_route .vp-b::before { content: ''; position: absolute; top: -5px; right: -5px; width: 10px; height: 10px; border-radius: 50%; background: var(--amber); border: 2px solid #fff; animation: beacon 1.6s infinite; }
.vpin.st-pause .vp-b { background: #7a4a07; }
.vpin.st-termine .vp-b { background: var(--done); }
.vp-n { margin-top: 3px; background: #fff; color: var(--ink); font-size: 11px; font-weight: 700; padding: 0 6px; border-radius: 5px; box-shadow: 0 1px 3px rgba(0, 0, 0, .2); white-space: nowrap; }
.garage { width: 30px; height: 30px; border-radius: 8px; background: var(--amber); color: var(--amber-ink); display: grid; place-items: center; box-shadow: 0 2px 6px rgba(0, 0, 0, .3); }
.leaflet-popup-content-wrapper { border-radius: 12px; }
.leaflet-popup-content { margin: 12px 14px; font: 13px/1.45 var(--font); }
.pop { display: flex; flex-direction: column; gap: 6px; min-width: 210px; }
.pop-h { display: flex; gap: 9px; align-items: center; }
.pop-row { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.pop-act { display: flex; gap: 6px; margin-top: 4px; }
.pop .note { margin: 0; }
.proof { width: 100%; border-radius: 8px; max-height: 160px; object-fit: cover; }

/* ---------- Modale & toast ---------- */
.modal-bg { position: fixed; inset: 0; background: rgba(10, 20, 35, .5); z-index: 2000; display: grid; place-items: center; padding: 16px; animation: fade .15s; }
.modal { background: #fff; border-radius: 16px; width: min(560px, 100%); max-height: calc(100vh - 32px); overflow: auto; padding: 20px 22px; box-shadow: 0 20px 60px rgba(0, 0, 0, .3); display: flex; flex-direction: column; gap: 12px; animation: pop .18s ease-out; }
.m-head { display: flex; justify-content: space-between; align-items: center; }
.m-head h2 { font-family: var(--display); font-size: 24px; }
.x { border: 0; background: #eef2f6; width: 32px; height: 32px; border-radius: 50%; font-size: 20px; cursor: pointer; line-height: 1; }
.m-foot { display: flex; justify-content: flex-end; gap: 8px; margin-top: 6px; }
@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { transform: translateY(8px) scale(.98); opacity: 0; } }
.vlist { display: flex; flex-direction: column; gap: 7px; }
.vrow { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border: 1.5px solid var(--line); border-radius: 11px; background: #fff; cursor: pointer; text-align: left; width: 100%; transition: border-color .15s, background .15s; }
.vrow:hover:not(:disabled) { border-color: var(--primary); background: #f6f9ff; }
.vrow:disabled, .vrow.is-dis { opacity: .5; cursor: default; }
.vrow.is-cur { border-color: var(--navy); opacity: 1; }
.vrow-code { font-family: var(--display); font-weight: 700; font-size: 18px; background: var(--navy); color: #fff; border-radius: 7px; padding: 3px 9px; min-width: 52px; text-align: center; letter-spacing: .03em; }
.vrow-n { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.vrow-n small { color: var(--muted); }
.vrow.radio input { position: absolute; opacity: 0; pointer-events: none; }
.vrow.radio:has(input:checked) { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(31, 79, 209, .15); background: #f6f9ff; }
.pickmap { height: 240px; border-radius: 10px; border: 1px solid var(--line); overflow: hidden; }
.reasons { display: flex; flex-direction: column; gap: 7px; }
.reasons .btn { justify-content: flex-start; white-space: normal; text-align: left; }
#toast { position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 30px); background: var(--navy); color: #fff; padding: 11px 18px; border-radius: 10px; font-weight: 600; opacity: 0; pointer-events: none; transition: all .25s; z-index: 3000; max-width: calc(100% - 32px); box-shadow: 0 8px 24px rgba(0, 0, 0, .25); }
#toast.show { opacity: 1; transform: translate(-50%, 0); }
#toast.err { background: var(--warn); }

/* ---------- Tableaux ---------- */
.tbl { width: 100%; border-collapse: collapse; }
.tbl th { text-align: left; font-size: 11.5px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 700; padding: 11px 14px; border-bottom: 1px solid var(--line); background: #fafbfc; }
.tbl td { padding: 11px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl .r { text-align: right; }
.tbl .live-row td { background: #fff8eb; }
.card > .tbl th:first-child { border-top-left-radius: var(--r); }
.cell-id { display: flex; align-items: center; gap: 10px; }
.tbl-tools { padding: 12px 14px; border-bottom: 1px solid var(--line); }
.tbl-tools input { width: min(360px, 100%); }

/* Flotte */
.fleet { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; }
.vcard { background: #fff; border: 1px solid var(--line); border-radius: var(--r); padding: 14px; display: flex; flex-direction: column; gap: 4px; box-shadow: var(--shadow); }
.vcard.is-gar { background: #fdf7f7; }
.vc-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
.vc-code { font-family: var(--display); font-weight: 700; font-size: 24px; letter-spacing: .03em; }
.vc-driver { display: flex; align-items: center; gap: 8px; margin: 10px 0; min-height: 26px; font-weight: 500; }
.vc-act { display: flex; flex-direction: column; gap: 6px; }
.vc-act select { width: 100%; }

/* Routes */
.routes { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 14px; align-items: start; }
.rcard { padding: 16px; display: flex; flex-direction: column; gap: 12px; border-top: 4px solid var(--rc); }
.rc-head { display: flex; align-items: center; gap: 10px; }
.rc-head h2 { font-size: 17px; flex: 1; }
.rc-dot { width: 12px; height: 12px; border-radius: 50%; background: var(--rc); }
.rc-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.rc-row label { display: flex; align-items: center; gap: 8px; font-weight: 600; font-size: 13px; }
.rc-prog { display: flex; flex-direction: column; gap: 5px; font-size: 12.5px; color: var(--ink-2); }
.rc-prog .bar i { background: var(--rc); }
.stops { list-style: none; padding: 0; margin: 0; max-height: 340px; overflow: auto; border: 1px solid var(--line); border-radius: 10px; counter-reset: s; }
.stops li { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-bottom: 1px solid var(--line); counter-increment: s; }
.stops li:last-child { border-bottom: 0; }
.st-i { width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; background: #eef2f6; font-size: 11px; font-weight: 700; color: var(--muted); flex: none; }
.stops li:not(.done):not(.issue) .st-i::before { content: counter(s); }
.stops li.done .st-i { background: var(--go); color: #fff; } .stops li.issue .st-i { background: var(--warn); color: #fff; }
.st-i svg { width: 14px; height: 14px; stroke-width: 2.6; }
.st-n { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.st-n small { color: var(--muted); }
.stops li.done .st-n b { color: var(--muted); }
.st-t { font-size: 12px; color: var(--muted); text-align: right; max-width: 120px; }

/* Clients */
.money { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-bottom: 16px; }
.money > div { background: #fff; border: 1px solid var(--line); border-radius: var(--r); padding: 12px 14px; display: flex; flex-direction: column; gap: 3px; }
.money span { font-size: 12px; color: var(--muted); font-weight: 600; }
.money b { font-family: var(--display); font-size: 24px; }
.money .tot { background: var(--navy); border-color: var(--navy); color: #fff; }
.money .tot span { color: #9fb2c9; }

/* Historique */
.hist { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; align-items: start; }
.span2 { grid-column: span 2; }
.span2 .link { margin: 8px 16px 14px; }
.vlog { padding: 4px 0 8px; }
.vlog-i { display: grid; grid-template-columns: 120px 1fr auto; grid-template-rows: auto auto; gap: 2px 10px; align-items: center; padding: 8px 16px; border-bottom: 1px dashed var(--line); font-size: 13px; }
.vlog-i time { color: var(--muted); font-size: 12px; grid-row: span 2; }
.vlog-i > span:nth-child(2) { display: flex; align-items: center; gap: 6px; }
.vl-ch { font-family: var(--display); font-size: 16px; } .vl-ch i { color: var(--muted); font-style: normal; }
.vlog-i .small { grid-column: 2 / 4; }

/* =========== OPÉRATEUR (cellulaire) =========== */
.op { max-width: 560px; margin: 0 auto; min-height: 100vh; display: flex; flex-direction: column; background: var(--bg); }
.op-head { background: var(--navy); color: #fff; padding: 14px 16px; padding-top: max(14px, env(safe-area-inset-top)); display: flex; align-items: center; justify-content: space-between; gap: 10px; position: sticky; top: 0; z-index: 10; }
.op-who { display: flex; align-items: center; gap: 10px; }
.op-who > div { display: flex; flex-direction: column; gap: 3px; align-items: flex-start; }
.op-who b { font-size: 16px; }
.op-who .muted { color: #9fb2c9; }
.op-head .icon-btn { border-color: rgba(255, 255, 255, .25); color: #fff; }
.op-veh-btn { display: flex; align-items: center; gap: 8px; background: rgba(255, 255, 255, .1); border: 1px solid rgba(255, 255, 255, .22); color: #fff; border-radius: 10px; padding: 8px 10px; cursor: pointer; min-width: 0; font-size: 13px; }
.op-veh-btn span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 150px; }
.op-veh-btn b { font-family: var(--display); font-size: 17px; letter-spacing: .03em; }
.op-veh-btn svg:last-child { width: 15px; height: 15px; opacity: .7; }
.op-storm { display: flex; align-items: center; gap: 10px; padding: 10px 16px; background: #e7ebf0; font-size: 13.5px; color: var(--ink-2); }
.op-storm.on { background: #1b2f4b; color: #fff; }
.op-prog { background: #fff; padding: 12px 16px; border-bottom: 1px solid var(--line); display: flex; flex-direction: column; gap: 7px; }
.op-prog > div:first-child { display: flex; justify-content: space-between; font-size: 13.5px; }
.op-main { flex: 1; padding: 16px; display: flex; flex-direction: column; }
.op-main .sec { margin: 22px 0 8px; }
.next { background: #fff; border-radius: 16px; padding: 18px; box-shadow: var(--shadow); border: 1px solid var(--line); display: flex; flex-direction: column; gap: 10px; }
.next-k { font-size: 12px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: var(--primary); }
.next h1 { font-family: var(--display); font-size: 32px; line-height: 1.05; }
.next-a { display: flex; align-items: center; gap: 7px; font-size: 16px; color: var(--ink-2); }
.next-a svg { color: var(--muted); }
.next-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 4px; }
.done-btn { background: var(--go); border-color: var(--go); color: #fff; font-size: 20px; padding: 18px; }
.done-btn:hover { background: #128a3e; }
.done-btn svg { width: 24px; height: 24px; stroke-width: 2.6; }
.up { list-style: none; margin: 0; padding: 0; background: #fff; border: 1px solid var(--line); border-radius: 12px; }
.up li { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 11px 12px; border-bottom: 1px solid var(--line); }
.up li:last-child { border-bottom: 0; }
.up li > span { display: flex; flex-direction: column; min-width: 0; }
.up small { color: var(--muted); }
.up.done b { color: var(--muted); }
.sec.toggle { background: none; border: 0; cursor: pointer; text-align: left; padding: 0; }
.empty { text-align: center; padding: 48px 20px; color: var(--muted); display: flex; flex-direction: column; align-items: center; gap: 8px; }
.empty svg { width: 46px; height: 46px; color: var(--line-2); }
.empty h2 { color: var(--ink); font-family: var(--display); font-size: 26px; }
.empty.ok svg { color: var(--go); }
.gps-line { text-align: center; font-size: 12px; color: var(--muted); margin: 18px 0 4px; }
.op-foot { position: sticky; bottom: 0; background: #fff; border-top: 1px solid var(--line); padding: 10px 16px; padding-bottom: max(10px, env(safe-area-inset-bottom)); display: grid; grid-template-columns: 1fr 1fr auto; gap: 8px; }
.op-main.start { gap: 12px; }
.op-main.start h2 { font-size: 15px; margin-top: 8px; }
.checks { display: flex; flex-direction: column; gap: 6px; }
.chk { display: flex; align-items: center; gap: 12px; background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 12px; cursor: pointer; font-weight: 500; }
.chk input { position: absolute; opacity: 0; pointer-events: none; }
.chk .box { width: 24px; height: 24px; border-radius: 7px; border: 2px solid var(--line-2); display: grid; place-items: center; flex: none; color: transparent; transition: all .15s; }
.chk .box svg { width: 16px; height: 16px; stroke-width: 3; }
.chk:has(input:checked) { border-color: #9ad7ad; background: #f3fbf5; }
.chk:has(input:checked) .box { background: var(--go); border-color: var(--go); color: #fff; }

/* ---------- Responsive ---------- */
@media (max-width: 1100px) {
  .live { grid-template-columns: 1fr 320px; }
  .money { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 860px) {
  .login-wrap { grid-template-columns: 1fr; }
  .login-side { padding: 28px 20px; gap: 18px; }
  .login-side h1 { font-size: 32px; }
  .login-forms { padding: 24px 16px 40px; }
  .shell { grid-template-columns: 1fr; grid-template-rows: auto 1fr; height: auto; min-height: 100vh; }
  .side { flex-direction: row; align-items: center; padding: 10px 12px; gap: 10px; overflow-x: auto; position: sticky; top: 0; z-index: 900; }
  .side .brand span { display: none; }
  .side nav { flex-direction: row; }
  .side nav a span { display: none; }
  .side nav a.on { box-shadow: inset 0 -3px 0 var(--amber); }
  .side-foot { flex-direction: row; margin-left: auto; align-items: center; margin-top: 0; white-space: nowrap; }
  .company, .side-foot .link span { display: none; }
  .stormbar { flex-wrap: wrap; gap: 10px; padding: 10px 16px; }
  .sb-prog { max-width: none; flex-basis: 100%; order: 3; }
  .page { padding: 16px; overflow: visible; }
  .page.page-carte { overflow: visible; }
  .live { grid-template-columns: 1fr; height: auto; }
  .map-wrap { height: 55vh; }
  .live-side { border-left: 0; }
  .tbl { display: block; overflow-x: auto; white-space: nowrap; }
  .hist { grid-template-columns: 1fr; } .span2 { grid-column: auto; }
  .grid2, .grid3 { grid-template-columns: 1fr; }
  .routes { grid-template-columns: 1fr; }
}
@media (max-width: 420px) {
  .op-veh-btn span { max-width: 96px; }
  .kpis { grid-template-columns: 1fr 1fr 1fr; }
  .kpi b { font-size: 22px; }
}

/* ---------- Version 2 : multi-entreprises ---------- */
#toast.warn { background: #b45309; }
.company { display: flex; flex-direction: column; gap: 1px; }
.company b { color: #c6d2e1; font-weight: 600; }
.banner { display: flex; align-items: center; gap: 10px; padding: 9px 22px; font-size: 13px; }
.banner span { flex: 1; }
.banner.dev { background: #4c1d95; color: #ede9fe; }
.banner.trial { background: #fff7e6; color: #7c4a03; border-bottom: 1px solid #f6d79a; }
.sb-meteo { display: flex; align-items: center; gap: 8px; margin-left: auto; font-size: 13px; color: var(--ink-2); background: #f1f6fd; border: 1px solid #d8e6f8; padding: 6px 10px; border-radius: 9px; }
.sb-meteo small { color: var(--muted); font-size: 10.5px; }
.sb-meteo svg { color: #2563eb; }
.stormbar.forecast { background: linear-gradient(90deg, #fff, #fff8eb); }
.cpin.skip { background: #e2e8f0; border-color: #fff; opacity: .7; }
.stops li.skip { opacity: .5; } .stops li.skip .st-t::after { content: 'sous le seuil'; font-size: 11px; color: var(--muted); }
.icon-mini { margin-left: auto; border: 0; background: transparent; color: var(--muted); cursor: pointer; padding: 4px; border-radius: 6px; display: inline-grid; place-items: center; }
.icon-mini:hover { background: #eef2f6; color: var(--ink); }
.rc-head .icon-mini { margin-left: 8px; }
.vc-top .icon-mini { margin-left: 6px; }
.co-line { display: flex; justify-content: space-between; align-items: center; background: #eef3fb; border-radius: 10px; padding: 10px 12px; }
.chk-line { display: flex; gap: 8px; align-items: center; font-size: 13.5px; }
.ctabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin: -4px 0 4px; }
.ctabs button { border: 0; background: none; padding: 8px 12px; font-weight: 600; color: var(--muted); cursor: pointer; border-bottom: 2px solid transparent; }
.ctabs button.on { color: var(--ink); border-bottom-color: var(--primary); }
.modal:has(.ctabs) { width: min(680px, 100%); }
.grow { flex: 1; }
.btn.danger-t { color: var(--warn); border-color: #f3c4c4; }
.btn.danger-t:hover { background: #fdecec; }
.m-foot { flex-wrap: wrap; }
.pays { display: flex; flex-direction: column; gap: 8px; }
.pays .chk { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 1.5px solid var(--line); border-radius: 10px; cursor: pointer; font-weight: 500; }
.pays .chk input { display: none; }
.plist { display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: 10px; max-height: 220px; overflow: auto; }
.plist > div { display: flex; justify-content: space-between; gap: 10px; padding: 8px 12px; border-bottom: 1px solid var(--line); font-size: 13px; }
.plist > div:last-child { border-bottom: 0; }
.box-line { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 0; }
.secret { display: flex; flex-direction: column; gap: 8px; }
.secret > div { display: flex; justify-content: space-between; align-items: center; gap: 12px; background: #f6f8fb; border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; }
.secret code { font-size: 17px; font-weight: 700; background: #fff; padding: 4px 10px; user-select: all; }
.money.mini { grid-template-columns: repeat(3, 1fr); margin: 0; }
.money.mini b { font-size: 20px; }
.settings { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.card.pad { padding: 16px 18px; display: flex; flex-direction: column; gap: 10px; }
.card.pad .card-t { padding: 0; margin: 0; }
.codebox { display: flex; align-items: center; gap: 14px; }
.codebox b { font-family: var(--display); font-size: 34px; letter-spacing: .08em; background: var(--navy); color: #fff; padding: 2px 14px; border-radius: 10px; }
.kv { display: flex; justify-content: space-between; border-bottom: 1px dashed var(--line); padding: 6px 0; }
.kv span { color: var(--muted); }
.tbl tr.click { cursor: pointer; } .tbl tr.click:hover td { background: #f8fafc; }
.tbl tr.click td:last-child svg { color: var(--muted); }
.tbl tr.is-off td { opacity: .55; }
.tbl-tools { display: flex; gap: 8px; } .tbl-tools input { flex: 1; }
.qbadge { margin: 8px 16px 0; background: #fff4e0; color: #7c4a03; border: 1px solid #f6d79a; border-radius: 10px; padding: 8px 12px; font-weight: 600; font-size: 13px; text-align: center; }
.next-links { display: flex; justify-content: space-between; gap: 8px; margin-top: 6px; flex-wrap: wrap; }
.vlog-i.dmg { grid-template-columns: 120px 1fr auto auto; }
.vlog-i.dmg.is-res { opacity: .5; }
.row .field.grow input { width: 100%; }
@media (max-width: 860px) {
  .settings { grid-template-columns: 1fr; }
  .banner { padding: 9px 16px; flex-wrap: wrap; }
  .sb-meteo { margin-left: 0; order: 2; }
  .money.mini { grid-template-columns: 1fr; }
  .tbl-tools { flex-direction: column; }
}
.main, .settings > *, .page { min-width: 0; }
.row input { min-width: 0; }
.codebox { flex-wrap: wrap; }
@media (max-width: 860px) {
  .card.pad .tbl, .card .tbl { max-width: 100%; }
  .row { flex-wrap: wrap; }
  .row input { flex-basis: 100%; }
}
.gps-line.good { color: var(--go); font-weight: 600; }
.gps-line.ok { color: var(--ink-2); }
.gps-line.warn { color: #b45309; font-weight: 600; }
.gps-line.bad { color: var(--warn); font-weight: 600; }
.gps-tip { text-align: center; font-size: 11.5px; color: var(--muted); margin: -4px 16px 12px; }

.install { display: flex; gap: 18px; align-items: center; }
.install-txt { flex: 1; display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.install-txt p { margin: 0; }
.qr-box { flex: none; padding: 8px; border: 1px solid var(--line); border-radius: 12px; background: #fff; min-width: 168px; min-height: 168px; display: grid; place-items: center; }
.secret code { word-break: break-all; font-size: 14px; }
@media (max-width: 860px) { .install { flex-direction: column; align-items: stretch; } .qr-box { align-self: center; } }
.vc-driver .link { margin-left: auto; padding: 0; }

.brand-logo { height: 34px; max-width: 120px; object-fit: contain; background: #fff; border-radius: 7px; padding: 3px; flex: none; }
.brand-co { font-family: var(--font); font-size: 15px; font-weight: 700; letter-spacing: 0; line-height: 1.2; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.logo-edit { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.logo-prev { width: 140px; height: 70px; border: 1px dashed var(--line-2); border-radius: 10px; display: grid; place-items: center; background: #fafbfc; overflow: hidden; }
.logo-prev img { max-width: 130px; max-height: 60px; object-fit: contain; }
.op-brand { display: flex; align-items: center; gap: 10px; padding: 8px 16px; background: #fff; border-bottom: 1px solid var(--line); font-weight: 700; font-size: 14px; }
.op-brand img { height: 30px; max-width: 110px; object-fit: contain; }
.co-line-logo { height: 30px; max-width: 100px; object-fit: contain; vertical-align: middle; margin-right: 10px; background: #fff; border-radius: 6px; padding: 2px; }
@media (max-width: 860px) { .brand-co { display: none; } }

/* ---------- Gestion ---------- */
.gest-top { display: grid; grid-template-columns: 1.3fr 1fr; gap: 16px; margin-bottom: 16px; }
.card-t .count { background: var(--navy); color: #fff; border-radius: 99px; padding: 1px 9px; font-size: 12px; margin-left: 6px; }
.card-t svg { vertical-align: -3px; }
.modes { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.mode { border: 1.5px solid var(--line); border-radius: 10px; padding: 10px 12px; cursor: pointer; display: flex; flex-direction: column; gap: 3px; }
.mode input { display: none; }
.mode span { font-size: 12.5px; color: var(--muted); }
.mode.on, .mode:has(input:checked) { border-color: var(--primary); background: #f4f7ff; box-shadow: 0 0 0 3px rgba(31,79,209,.12); }
.gtools { flex-wrap: wrap; } .gtools select { min-width: 170px; }
.selbar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 10px 14px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); background: #fafbfc; min-height: 52px; }
.selbar.on { background: #eef3ff; }
.gtbl .ck { width: 38px; text-align: center; }
.gtbl input[type=checkbox], #gall { width: 17px; height: 17px; cursor: pointer; }
.gtbl tr.sel td { background: #f4f7ff; }
.lnk { cursor: pointer; } .lnk:hover { color: var(--primary); text-decoration: underline; }
.georesults { display: flex; flex-direction: column; gap: 4px; }
.geo-r { display: flex; align-items: flex-start; gap: 8px; text-align: left; border: 1px solid var(--line); background: #fff; border-radius: 8px; padding: 7px 10px; cursor: pointer; font-size: 13px; }
.geo-r:hover { border-color: var(--primary); background: #f4f7ff; }
.good-t { color: var(--go); font-weight: 600; }
.modal.wide { width: min(860px, 100%); }
.mapgrid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.impprev { max-height: 200px; overflow: auto; border: 1px solid var(--line); border-radius: 10px; }
#imptxt { width: 100%; border: 1px solid var(--line-2); border-radius: 8px; padding: 9px 11px; font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 12.5px; }
.notify-hint { text-align: center; font-size: 12.5px; color: var(--muted); margin: -2px 0 2px; display: flex; gap: 6px; justify-content: center; align-items: center; }
.notify-bar { margin: 8px 16px 0; display: flex; align-items: center; justify-content: space-between; gap: 8px; background: #eef5ff; border: 1px solid #cfe0fb; color: #1e3a8a; border-radius: 10px; padding: 8px 12px; font-weight: 600; font-size: 13.5px; }
.notify-bar span { display: flex; gap: 6px; align-items: center; }
@media (max-width: 1100px) { .mapgrid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 860px) { .gest-top, .modes { grid-template-columns: 1fr; } .mapgrid { grid-template-columns: 1fr 1fr; } }

.navbadge { margin-left: auto; background: #f59e0b; color: #2a1700; font-size: 11px; font-weight: 700; border-radius: 99px; padding: 1px 7px; }

.paybox { margin-top: 12px; padding: 12px 14px; border-radius: 12px; background: #f1f6ff; border: 1px solid #d6e3fb; }
.codebox-in { font-family: ui-monospace, Consolas, monospace; letter-spacing: .08em; background: #fff; padding: 2px 8px; border-radius: 6px; border: 1px solid #d6e3fb; }
.paynote { margin: 12px 0 0; padding: 12px 14px; border-radius: 10px; background: #fff7e6; border: 1px solid #f6d79a; color: #6b3f00; font-size: 14px; line-height: 1.45; }
