/* VIRAGE — back-office de démo (Démesure). Thème nuit, comme un tableau des départs. */

:root {
  --ink: #0d0e11;
  --ink-2: #15171c;
  --ink-3: #1f2229;
  --ink-4: #2a2e37;
  --chalk: #f3f1ec;
  --mute: #9a9ea8;
  --line: rgba(243, 241, 236, .1);
  --amber: #ffb000;
  --amber-2: #ffd27a;
  --red: #ff5a4a;
  --green: #5fd18b;
  --blue: #7aa2ff;
  --ghost: #3a3f4a;
  --good: #5fd18b;
  --bad: #ff7a6b;
  --display: "Archivo", system-ui, sans-serif;
  --font: "Inter Tight", system-ui, -apple-system, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, monospace;
  --r: 18px;
  --top: 64px;
  --ease: cubic-bezier(.16, 1, .3, 1);
  --spring: cubic-bezier(.34, 1.4, .64, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; overflow-x: clip; /* garde-fou iPhone : jamais de défilement horizontal */ }
body { margin: 0; min-height: 100vh; background: var(--ink); color: var(--chalk); font-family: var(--font); font-size: 15px; line-height: 1.45; -webkit-font-smoothing: antialiased; overflow-x: clip; }
h1, h2, h3, p { margin: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }
a { color: inherit; }
button, input, select { font: inherit; color: inherit; }
button { background: none; border: 0; padding: 0; cursor: pointer; }
img { display: block; max-width: 100%; }
svg { width: 1em; height: 1em; }
svg { fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.chart-svg { stroke: none; }
:focus-visible { outline: 2px solid var(--amber); outline-offset: 2px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.kicker { font-family: var(--mono); font-size: 11.5px; letter-spacing: .12em; text-transform: uppercase; color: var(--amber); }
.link { color: var(--amber); font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }
.plate { display: inline-block; font-family: var(--mono); font-size: 11.5px; padding: 1px 6px; border-radius: 5px; background: var(--chalk); color: var(--ink); letter-spacing: .02em; white-space: nowrap; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 46px; padding: 0 20px; border-radius: 999px; background: var(--chalk); color: var(--ink); font-weight: 700; font-size: 14.5px; white-space: nowrap; text-decoration: none; transition: transform .25s var(--spring), box-shadow .25s, background-color .2s; }
.btn:hover { transform: translateY(-2px); }
.btn--amber { background: var(--amber); }
.btn--amber:hover { box-shadow: 0 10px 30px -10px rgba(255, 176, 0, .7); }
.btn--ghost { background: transparent; color: var(--chalk); box-shadow: inset 0 0 0 1.5px var(--line); }
.btn--ghost:hover { box-shadow: inset 0 0 0 1.5px var(--chalk); }
.btn--sm { height: 36px; padding: 0 14px; font-size: 13.5px; }
.btn svg { font-size: 16px; }
.btn:disabled { background: var(--ink-3); color: var(--mute); cursor: not-allowed; transform: none; box-shadow: none; }
.x { width: 40px; height: 40px; display: grid; place-items: center; border-radius: 50%; font-size: 24px; line-height: 1; box-shadow: inset 0 0 0 1.5px var(--line); transition: box-shadow .2s, transform .3s var(--spring); flex: none; }
.x:hover { box-shadow: inset 0 0 0 1.5px var(--chalk); transform: rotate(90deg); }

/* Bandeau démo */
.demo-bar { display: flex; justify-content: space-between; gap: 6px 16px; flex-wrap: wrap; padding: 8px 20px; background: #000; color: rgba(243, 241, 236, .65); font-size: 12.5px; }
.demo-bar a { color: var(--amber); text-decoration: underline; text-underline-offset: 3px; }
.demo-bar__links { display: flex; flex-wrap: wrap; gap: 4px 18px; }

/* Barre du haut */
.top { position: sticky; top: 0; z-index: 40; display: flex; align-items: center; gap: 18px; height: var(--top); padding: 0 20px; background: rgba(13, 14, 17, .88); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); border-bottom: 1px solid var(--line); }
.logo { display: inline-flex; align-items: baseline; gap: 10px; font-family: var(--display); font-weight: 800; font-stretch: 125%; font-size: 21px; letter-spacing: .06em; text-decoration: none; }
.logo small { font-family: var(--mono); font-size: 10.5px; font-weight: 400; letter-spacing: .1em; text-transform: uppercase; padding: 3px 7px; border-radius: 6px; background: var(--amber); color: var(--ink); transform: translateY(-3px); }
.seg { display: inline-flex; padding: 3px; border-radius: 999px; box-shadow: inset 0 0 0 1px var(--line); flex: none; }
.seg button { height: 32px; min-width: 38px; padding: 0 12px; border-radius: 999px; font-weight: 600; font-size: 13.5px; color: var(--mute); white-space: nowrap; transition: background-color .2s, color .2s; }
.seg button:hover { color: var(--chalk); }
.seg button[aria-pressed="true"] { background: var(--chalk); color: var(--ink); }
.seg--agency { margin-left: 10px; }
.agency-select { display: none; }
.agency-select select { height: 36px; max-width: 160px; padding: 0 30px 0 12px; border: 0; border-radius: 999px; background: var(--ink-3) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%23f3f1ec' stroke-width='2'/%3E%3C/svg%3E") no-repeat right 12px center; font-weight: 600; font-size: 13.5px; appearance: none; }
.top__right { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.clock { font-family: var(--mono); font-size: 13.5px; color: var(--mute); white-space: nowrap; }
.icon-btn { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 50%; box-shadow: inset 0 0 0 1px var(--line); font-size: 18px; }
.icon-btn[aria-pressed="false"] { color: var(--mute); opacity: .6; }
.icon-btn[aria-pressed="true"] { color: var(--amber); }

/* Structure */
.shell { display: grid; grid-template-columns: 200px minmax(0, 1fr); min-height: calc(100vh - var(--top)); }
.side { position: sticky; top: var(--top); align-self: start; height: calc(100vh - var(--top)); display: flex; flex-direction: column; gap: 4px; padding: 16px 12px; border-right: 1px solid var(--line); }
.side a { position: relative; display: flex; align-items: center; gap: 12px; height: 44px; padding: 0 12px; border-radius: 12px; font-weight: 600; font-size: 15px; text-decoration: none; color: rgba(243, 241, 236, .75); transition: background-color .2s, color .2s; }
.side a svg { font-size: 20px; }
.side a:hover { background: var(--ink-2); color: var(--chalk); }
.side a[aria-current="page"] { background: var(--ink-3); color: var(--chalk); }
.side a[aria-current="page"]::before { content: ""; position: absolute; left: -12px; top: 10px; bottom: 10px; width: 3px; border-radius: 0 3px 3px 0; background: var(--amber); }
.badge { margin-left: auto; min-width: 22px; height: 22px; padding: 0 6px; display: inline-grid; place-items: center; border-radius: 999px; background: var(--amber); color: var(--ink); font-size: 12px; font-weight: 700; }
.badge--warn { background: var(--red); color: #fff; }
.badge[hidden] { display: none; }
.side__foot { margin-top: 26px; padding: 14px 6px 0; border-top: 1px dashed var(--line); font-size: 12.5px; color: var(--mute); }
.side__foot button { margin-top: 6px; font-weight: 600; font-size: 13px; color: var(--chalk); text-decoration: underline; text-underline-offset: 3px; }
main { padding: 26px clamp(16px, 2.4vw, 32px) 60px; min-width: 0; }

.view[hidden] { display: none; }
.view { animation: view-in .4s var(--ease); }
@keyframes view-in { from { opacity: 0; transform: translateY(8px); } }
.view__head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 18px; }
.view__head h1 { margin-top: 6px; font-family: var(--display); font-weight: 800; font-stretch: 125%; font-size: clamp(32px, 4vw, 52px); line-height: .95; letter-spacing: -.02em; text-transform: uppercase; }
.view__tools { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.hint { margin-top: 14px; font-size: 14px; color: var(--mute); }

.panel { background: var(--ink-2); border-radius: var(--r); box-shadow: inset 0 0 0 1px var(--line); padding: 18px 20px; min-width: 0; }
.panel--flush { padding: 0; overflow: hidden; }
.panel__head { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px 20px; flex-wrap: wrap; margin-bottom: 14px; }
.panel h2 { font-size: 18px; font-weight: 700; letter-spacing: -.01em; display: flex; align-items: center; gap: 10px; }
.panel__sub { margin: 18px 0 6px; font-size: 13px; font-weight: 600; color: var(--mute); }
.sub { font-size: 13px; color: var(--mute); margin-top: 3px; }
.count { display: inline-grid; place-items: center; min-width: 24px; height: 24px; padding: 0 7px; border-radius: 999px; background: var(--amber); color: var(--ink); font-size: 13px; }

/* Pastilles d'état */
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px; font-size: 12.5px; font-weight: 600; white-space: nowrap; }
.pill::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.pill--pending { color: var(--amber); background: rgba(255, 176, 0, .12); }
.pill--confirmed { color: var(--blue); background: rgba(122, 162, 255, .12); }
.pill--ongoing { color: var(--green); background: rgba(95, 209, 139, .12); }
.pill--late { color: var(--red); background: rgba(255, 90, 74, .14); }
.pill--returned, .pill--cancelled { color: var(--mute); background: rgba(243, 241, 236, .06); }
.pill--block { color: var(--mute); background: rgba(243, 241, 236, .06); }
.pill--free { color: var(--chalk); background: rgba(243, 241, 236, .08); }

/* ---------- PLANNING ---------- */
.pulse { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; margin-bottom: 14px; }
.pulse div { display: flex; flex-direction: column; padding: 12px 14px; border-radius: 14px; background: var(--ink-2); box-shadow: inset 0 0 0 1px var(--line); }
.pulse span { font-size: 12.5px; color: var(--mute); }
.pulse b { font-family: var(--display); font-stretch: 110%; font-size: 28px; font-weight: 800; line-height: 1.1; }
.pulse small { font-size: 15px; color: var(--mute); font-weight: 600; }
.pulse .is-bad b { color: var(--red); }
.pulse .is-hot { box-shadow: inset 0 0 0 1.5px var(--amber); animation: hot 1.6s ease-in-out infinite; }
.pulse .is-hot b { color: var(--amber); }
@keyframes hot { 50% { box-shadow: inset 0 0 0 1.5px rgba(255, 176, 0, .3); } }
.legend { display: flex; flex-wrap: wrap; gap: 6px 18px; margin-bottom: 12px; font-size: 13px; color: var(--mute); }
.legend span { display: inline-flex; align-items: center; gap: 7px; }
.lg { display: inline-block; width: 22px; height: 10px; border-radius: 4px; }
.lg--pending { box-shadow: inset 0 0 0 1.5px var(--amber); background: rgba(255, 176, 0, .12); }
.lg--confirmed { background: #34405c; }
.lg--ongoing { background: var(--amber); }
.lg--late { background: repeating-linear-gradient(45deg, var(--red) 0 4px, #b8392c 4px 8px); }
.lg--returned { background: var(--ink-4); }
.lg--block { background: repeating-linear-gradient(45deg, #3b3f48 0 3px, #24272e 3px 6px); }

.gantt { border-radius: var(--r); box-shadow: inset 0 0 0 1px var(--line); background: var(--ink-2); overflow: hidden; }
.g-scroll { overflow-x: auto; overscroll-behavior-x: contain; }
.g { min-width: 1080px; --uw: 220px; }
.g-head { position: sticky; top: 0; z-index: 3; display: grid; grid-template-columns: var(--uw) 1fr; background: var(--ink-2); border-bottom: 1px solid var(--line); }
.g-corner { display: flex; align-items: center; padding: 0 16px; font-family: var(--mono); font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--mute); border-right: 1px solid var(--line); }
.g-days { display: grid; grid-template-columns: repeat(14, minmax(0, 1fr)); }
.g-day { display: flex; flex-direction: column; align-items: center; justify-content: center; height: 54px; font-family: var(--display); font-stretch: 110%; font-weight: 800; font-size: 18px; line-height: 1; border-left: 1px solid var(--line); }
.g-day small { font-family: var(--mono); font-weight: 400; font-size: 10.5px; text-transform: uppercase; letter-spacing: .06em; color: var(--mute); margin-bottom: 4px; }
.g-day.is-we { background: rgba(243, 241, 236, .025); }
.g-day.is-today { color: var(--amber); background: rgba(255, 176, 0, .08); }
.g-body { position: relative; }
.g-cols { position: absolute; top: 0; bottom: 0; left: var(--uw); right: 0; display: grid; grid-template-columns: repeat(14, minmax(0, 1fr)); pointer-events: none; }
.g-col { border-left: 1px solid var(--line); }
.g-col.is-we { background: rgba(243, 241, 236, .025); }
.g-col.is-today { background: rgba(255, 176, 0, .05); }
.g-now { position: absolute; top: 0; bottom: 0; width: 2px; margin-left: -1px; background: var(--amber); box-shadow: 0 0 12px rgba(255, 176, 0, .6); z-index: 2; }
.g-now span { position: absolute; top: -1px; left: 50%; transform: translateX(-50%); padding: 2px 6px; border-radius: 0 0 6px 6px; background: var(--amber); color: var(--ink); font-family: var(--mono); font-size: 10.5px; white-space: nowrap; }
.g-row { position: relative; display: grid; grid-template-columns: var(--uw) 1fr; min-height: 52px; border-bottom: 1px solid var(--line); }
.g-row:last-child { border-bottom: 0; }
.g-row:hover { background: rgba(243, 241, 236, .02); }
.g-unit { position: sticky; left: 0; z-index: 2; display: flex; align-items: center; gap: 10px; padding: 6px 12px; background: var(--ink-2); border-right: 1px solid var(--line); }
.g-unit img { width: 56px; height: 35px; object-fit: cover; border-radius: 6px; }
.g-unit span { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.g-unit b { font-size: 13.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.g-unit small { font-family: var(--mono); font-size: 11px; color: var(--mute); }
.g-track { position: relative; z-index: 1; }
.bar { position: absolute; top: 8px; bottom: 8px; display: flex; align-items: center; gap: 6px; min-width: 6px; padding: 0 8px; border-radius: 8px; overflow: hidden; font-size: 12.5px; font-weight: 600; white-space: nowrap; text-align: left; transition: transform .2s var(--spring), filter .2s; }
.bar small { font-family: var(--mono); font-size: 10.5px; font-weight: 400; opacity: .7; }
button.bar:hover { transform: translateY(-1px); filter: brightness(1.15); z-index: 2; }
.bar--confirmed { background: #34405c; color: #dfe6ff; }
.bar--ongoing { background: var(--amber); color: var(--ink); }
.bar--late { background: repeating-linear-gradient(45deg, var(--red) 0 8px, #c9402f 8px 16px); color: #fff; }
.bar--returned { background: var(--ink-4); color: var(--mute); }
.bar--pending { background: rgba(255, 176, 0, .12); color: var(--amber); box-shadow: inset 0 0 0 1.5px var(--amber); animation: hot 1.6s ease-in-out infinite; }
.bar--block { background: repeating-linear-gradient(45deg, #3b3f48 0 5px, #24272e 5px 10px); color: var(--mute); font-weight: 500; }
.bar--block svg { font-size: 14px; flex: none; }
.bar.is-site:not(.bar--pending)::after { content: "site"; margin-left: auto; padding: 1px 5px; border-radius: 4px; background: rgba(0, 0, 0, .25); font-family: var(--mono); font-size: 9.5px; font-weight: 400; }

/* ---------- AUJOURD'HUI ---------- */
.pending { margin-bottom: 16px; }
.pending:empty { display: none; }
.panel--hot { box-shadow: inset 0 0 0 1.5px var(--amber); background: linear-gradient(180deg, rgba(255, 176, 0, .06), var(--ink-2) 60%); }
.days { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.moves { display: flex; flex-direction: column; }
.move { display: grid; grid-template-columns: 76px 64px minmax(0, 1fr) auto auto; align-items: center; gap: 12px; padding: 12px 6px; border-top: 1px solid var(--line); cursor: pointer; border-radius: 10px; transition: background-color .2s; }
.move:hover { background: rgba(243, 241, 236, .03); }
.move.is-pending { grid-template-columns: 82px minmax(0, 1fr) auto; }
.move.is-late { background: rgba(255, 90, 74, .06); }
.move__time { display: flex; flex-direction: column; font-family: var(--display); font-stretch: 105%; font-weight: 800; font-size: 16px; line-height: 1.1; white-space: nowrap; }
.move__time small { font-family: var(--font); font-weight: 500; font-size: 11.5px; color: var(--mute); font-stretch: 100%; }
.move__img { width: 64px; height: 40px; object-fit: cover; border-radius: 7px; }
.move__who { display: flex; flex-direction: column; min-width: 0; }
.move__who b { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.move__who small { font-size: 12.5px; color: var(--mute); }
.move__act { display: flex; gap: 6px; justify-content: flex-end; }
.moves .empty { padding: 20px 6px; color: var(--mute); border-top: 1px solid var(--line); }

/* ---------- Tiroir ---------- */
.drawer { position: fixed; inset: 0; z-index: 60; visibility: hidden; overflow: hidden; /* le panneau caché à droite ne doit pas élargir la page sur iPhone */ }
.drawer.is-open { visibility: visible; }
.drawer__backdrop { position: absolute; inset: 0; background: rgba(0, 0, 0, .55); opacity: 0; transition: opacity .35s; }
.drawer.is-open .drawer__backdrop { opacity: 1; }
.drawer__panel { position: absolute; top: 0; right: 0; bottom: 0; width: min(520px, 100%); background: var(--ink-2); box-shadow: -1px 0 0 var(--line); transform: translateX(100%); transition: transform .5s var(--ease); overflow-y: auto; }
.drawer.is-open .drawer__panel { transform: none; }
.drawer__x { position: absolute; top: 12px; right: 12px; z-index: 2; background: rgba(13, 14, 17, .6); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); }
.d-img { aspect-ratio: 16 / 8; overflow: hidden; background: #1b1d22; }
.d-img img { width: 100%; height: 100%; object-fit: cover; }
.d { display: flex; flex-direction: column; gap: 14px; padding: 20px 22px 30px; }
.d-title { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.d-title h2 { font-family: var(--display); font-stretch: 112%; font-weight: 800; font-size: 26px; text-transform: uppercase; line-height: 1; }
.d-phone { display: flex; align-items: center; gap: 12px; font-family: var(--mono); font-size: 13.5px; color: var(--mute); }
.d-wa { display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px; border-radius: 999px; background: rgba(95, 209, 139, .12); color: var(--green); font-family: var(--font); font-weight: 600; font-size: 13px; }
.d-wa svg { font-size: 15px; }
.d-alert { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 12px; background: rgba(255, 90, 74, .12); color: var(--red); font-weight: 600; font-size: 14px; }
.d-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1px; margin: 0; border-radius: 14px; overflow: hidden; background: var(--line); }
.d-grid div { padding: 10px 12px; background: var(--ink-2); }
.d-grid dt { font-size: 12px; color: var(--mute); }
.d-grid dd { margin: 2px 0 0; font-weight: 600; display: flex; flex-direction: column; }
.d-grid dd small { font-weight: 400; font-size: 12.5px; color: var(--mute); }
.d-opts { display: flex; flex-wrap: wrap; gap: 6px; }
.d-opts span { padding: 4px 10px; border-radius: 999px; background: var(--ink-3); font-size: 12.5px; }
.d-edl { display: flex; flex-direction: column; gap: 2px; padding: 10px 12px; border-radius: 12px; background: var(--ink); font-size: 13px; }
.d-edl span { color: var(--mute); }
.d-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 6px; }
.d-actions:empty { display: none; }

/* ---------- État des lieux (tablette) ---------- */
.edl { position: fixed; inset: 0; z-index: 70; display: grid; place-items: center; padding: 16px; background: rgba(0, 0, 0, .7); }
.edl[hidden] { display: none; }
.edl-open { overflow: hidden; }
.edl__panel { width: min(1080px, 100%); max-height: calc(100vh - 32px); display: flex; flex-direction: column; border-radius: 26px; background: var(--ink-2); box-shadow: inset 0 0 0 1px var(--line), 0 40px 100px -20px #000; overflow: hidden; animation: edl-in .45s var(--spring); }
@keyframes edl-in { from { opacity: 0; transform: translateY(20px) scale(.98); } }
.edl__head { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.edl__head h2 { margin-top: 4px; font-size: 19px; font-weight: 700; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.edl__head h2 small { font-family: var(--mono); font-size: 12px; font-weight: 400; padding: 2px 7px; border-radius: 5px; background: var(--chalk); color: var(--ink); }
.edl__body { display: grid; grid-template-columns: 340px minmax(0, 1fr); gap: 24px; padding: 18px 20px; overflow-y: auto; }
.edl__car { display: flex; flex-direction: column; gap: 10px; }
.edl__hint { font-size: 13px; color: var(--mute); }
.carmap { position: relative; width: 100%; max-width: 280px; margin: 0 auto; aspect-ratio: 220 / 420; cursor: crosshair; }
.topcar { width: 100%; height: 100%; display: block; }
.tc-body { fill: #2a2e37; stroke: #4a505c; stroke-width: 2; }
.tc-glass { fill: #12141a; stroke: #4a505c; stroke-width: 1.5; }
.tc-roof { fill: #323743; stroke: #4a505c; stroke-width: 1.5; }
.tc-line { stroke: #4a505c; stroke-width: 1.5; fill: none; }
.tc-wheel { fill: #0d0e11; stroke: #3a3f4a; stroke-width: 2; }
.tc-mirror { fill: #323743; stroke: #4a505c; stroke-width: 1.5; }
.tc-lamp { fill: var(--amber-2); opacity: .85; }
.tc-tail { fill: var(--red); opacity: .8; }
.mk { position: absolute; width: 26px; height: 26px; margin: -13px 0 0 -13px; display: grid; place-items: center; border-radius: 50%; font-size: 11.5px; font-weight: 800; box-shadow: 0 0 0 3px var(--ink-2); animation: mk-in .4s var(--spring); }
@keyframes mk-in { from { transform: scale(0); } }
.mk--old { background: var(--mute); color: var(--ink); }
.mk--out { background: var(--amber); color: var(--ink); }
.mk--in { background: var(--red); color: #fff; }
.mk-pick { position: absolute; z-index: 5; transform: translate(-50%, 12px); display: flex; flex-direction: column; gap: 4px; min-width: 170px; padding: 10px; border-radius: 14px; background: var(--chalk); color: var(--ink); box-shadow: 0 20px 40px -10px #000; animation: mk-in .3s var(--spring); }
.mk-pick b { font-size: 12.5px; padding: 2px 4px 6px; }
.mk-pick button { height: 34px; padding: 0 10px; border-radius: 9px; text-align: left; font-weight: 600; font-size: 13.5px; }
.mk-pick button:hover { background: rgba(13, 14, 17, .08); }
.mk-pick .mk-pick__x { color: #6b6f78; font-weight: 500; }
.marks { display: flex; flex-direction: column; gap: 4px; }
.marks li { display: grid; grid-template-columns: 24px 1fr auto auto; align-items: center; gap: 8px; padding: 6px 8px; border-radius: 10px; background: var(--ink); font-size: 13px; }
.marks li b { display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: var(--mute); color: var(--ink); font-size: 11px; }
.marks li.is-new b { background: var(--red); color: #fff; }
.marks li small { color: var(--mute); font-size: 11.5px; }
.marks li button { width: 24px; height: 24px; border-radius: 50%; font-size: 16px; color: var(--mute); }
.edl__form { display: flex; flex-direction: column; gap: 16px; }
.f-row { display: grid; grid-template-columns: 1fr 1.3fr; gap: 16px; }
.f { display: flex; flex-direction: column; gap: 8px; font-size: 13px; color: var(--mute); }
.f > span:first-child { font-weight: 600; }
.f input[type="number"] { height: 48px; padding: 0 14px; border: 0; border-radius: 12px; background: var(--ink-3); color: var(--chalk); font-family: var(--display); font-stretch: 110%; font-weight: 800; font-size: 22px; }
.f small { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; }
.fuel { display: grid; grid-template-columns: repeat(8, 1fr); gap: 4px; height: 48px; }
.fuel button { border-radius: 6px; background: var(--ink-3); transition: background-color .2s; }
.fuel button.is-on { background: var(--amber); }
.fuel button:nth-child(-n+2).is-on { background: var(--red); }
.checks { display: flex; flex-wrap: wrap; gap: 8px; }
.checks button { display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 14px; border-radius: 999px; background: var(--ink-3); color: var(--mute); font-weight: 600; font-size: 13.5px; }
.checks button svg { font-size: 16px; opacity: .3; }
.checks button[aria-pressed="true"] { background: rgba(95, 209, 139, .12); color: var(--green); }
.checks button[aria-pressed="true"] svg { opacity: 1; }
.photos { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.ph { position: relative; aspect-ratio: 4 / 3; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; border-radius: 12px; background: var(--ink-3) center / cover no-repeat; color: var(--mute); font-size: 12.5px; cursor: pointer; box-shadow: inset 0 0 0 1.5px var(--line); }
.ph input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.ph svg { font-size: 22px; }
.ph.is-on { color: transparent; box-shadow: inset 0 0 0 2px var(--green); }
.ph.is-on svg { display: none; }
.ph:focus-within { outline: 2px solid var(--amber); }
.calc { padding: 14px; border-radius: 14px; background: var(--ink); gap: 6px; }
.calc p { display: flex; justify-content: space-between; gap: 14px; color: rgba(243, 241, 236, .82); font-size: 13.5px; }
.calc p b { color: var(--chalk); white-space: nowrap; }
.calc__ok { color: var(--green) !important; }
.calc__total { margin-top: 6px; padding-top: 10px; border-top: 1px solid var(--line); }
.calc__total b { font-family: var(--display); font-stretch: 110%; font-weight: 800; font-size: 20px; color: var(--green) !important; }
.sign { position: relative; border-radius: 14px; background: var(--ink); box-shadow: inset 0 0 0 1.5px var(--line); }
.sign canvas { display: block; width: 100%; height: 130px; touch-action: none; cursor: crosshair; }
.sign .link { position: absolute; right: 12px; bottom: 10px; font-size: 12.5px; }
.sign em { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); font-style: normal; color: rgba(243, 241, 236, .3); pointer-events: none; font-size: 15px; }
.sign em[hidden] { display: none; }
.edl__foot { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; padding: 14px 20px; border-top: 1px solid var(--line); background: var(--ink-2); }
.edl__foot p { font-size: 13.5px; color: var(--mute); }

/* ---------- FLOTTE ---------- */
.alerts:empty { display: none; }
.alerts { margin-bottom: 16px; }
.panel--alert { box-shadow: inset 0 0 0 1.5px rgba(255, 90, 74, .55); background: linear-gradient(180deg, rgba(255, 90, 74, .07), var(--ink-2)); }
.panel--alert h2 { color: var(--red); margin-bottom: 10px; }
.panel--alert ul { display: grid; gap: 6px; }
.panel--alert li { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; font-size: 14px; }
.panel--alert li span { color: var(--mute); }
.panel--alert li .link { margin-left: auto; }
.units { display: grid; grid-template-columns: repeat(auto-fill, minmax(310px, 1fr)); gap: 14px; }
.unit { display: flex; flex-direction: column; border-radius: var(--r); background: var(--ink-2); box-shadow: inset 0 0 0 1px var(--line); overflow: hidden; }
.unit__img { aspect-ratio: 16 / 7; overflow: hidden; background: #1b1d22; }
.unit__img img { width: 100%; height: 100%; object-fit: cover; }
.unit__body { display: flex; flex-direction: column; gap: 10px; padding: 14px 16px 16px; flex: 1; }
.unit__top { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.unit__top > div { display: flex; flex-direction: column; gap: 4px; align-items: flex-start; }
.unit__top b { font-weight: 700; }
.unit__meta { font-size: 12.5px; color: var(--mute); }
.dues { display: grid; gap: 4px; }
.due { display: flex; justify-content: space-between; gap: 10px; padding: 6px 10px; border-radius: 9px; background: var(--ink); font-size: 12.5px; }
.due span { color: var(--mute); }
.due--warn { box-shadow: inset 3px 0 0 var(--amber); }
.due--warn b { color: var(--amber); }
.due--bad { box-shadow: inset 3px 0 0 var(--red); background: rgba(255, 90, 74, .08); }
.due--bad b { color: var(--red); }
.unit__stats { display: flex; justify-content: space-between; gap: 10px; font-size: 12.5px; color: var(--mute); }
.unit__stats b { color: var(--chalk); margin-left: 4px; }
.unit__act { margin-top: auto; }
.unit__act:empty { display: none; }

/* ---------- CHIFFRES ---------- */
.insights { margin-bottom: 16px; }
.insights h2 { font-family: var(--mono); font-size: 12px; font-weight: 400; letter-spacing: .1em; text-transform: uppercase; color: var(--amber); margin-bottom: 12px; }
.insights ul { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 26px; }
.ins { display: flex; gap: 12px; align-items: flex-start; font-size: 14.5px; line-height: 1.45; color: rgba(243, 241, 236, .85); }
.ins svg { width: 22px; height: 22px; flex: none; margin-top: 1px; stroke: var(--amber); }
.ins--alert svg { stroke: var(--red); }
.ins b { color: var(--chalk); }
.ins a { color: var(--amber); text-underline-offset: 3px; }
.kpis { display: grid; grid-template-columns: 1.3fr repeat(3, minmax(0, 1fr)); gap: 12px; margin-bottom: 16px; }
.kpi { display: flex; flex-direction: column; gap: 4px; padding: 16px 18px; border-radius: var(--r); background: var(--ink-2); box-shadow: inset 0 0 0 1px var(--line); min-width: 0; }
.kpi__label { font-size: 13px; color: var(--mute); }
.kpi__value { font-family: var(--display); font-stretch: 110%; font-weight: 800; font-size: 30px; line-height: 1.1; white-space: nowrap; }
.kpi--hero { background: var(--amber); color: var(--ink); box-shadow: none; }
.kpi--hero .kpi__label { color: rgba(13, 14, 17, .7); }
.kpi--hero .kpi__value { font-size: clamp(28px, 2.7vw, 40px); }
.kpi--hero .delta--good { color: #165c2c; }
.kpi--hero .delta--bad { color: #7c1d12; }
.kpi--hero small { color: rgba(13, 14, 17, .65); }
.kpi__foot { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 8px; font-size: 13px; }
.kpi__foot small { font-size: 12px; color: var(--mute); }
.delta { font-weight: 700; font-size: 13px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.delta--good { color: var(--good); }
.delta--bad { color: var(--bad); }
.grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.panel--wide { grid-column: 1 / -1; }
.chart { position: relative; width: 100%; min-height: 200px; }
.chart-svg { display: block; overflow: visible; }
.chart-svg .gridline { stroke: var(--line); stroke-width: 1; }
.chart-svg .axis { stroke: rgba(243, 241, 236, .35); stroke-width: 1; }
.chart-svg .tick { fill: var(--mute); font-family: var(--mono); font-size: 10.5px; font-variant-numeric: tabular-nums; }
.col__bar { fill: var(--chalk); transition: fill .15s; }
.col__ghost { fill: var(--ghost); }
.col--accent .col__bar { fill: var(--amber); }
.col.is-hover .col__bar { fill: var(--amber-2); }
.col__mark { fill: var(--chalk); font-family: var(--font); font-weight: 700; font-size: 12px; }
.hit { fill: transparent; cursor: crosshair; outline: none; }
.sw { display: inline-block; width: 12px; height: 12px; border-radius: 3px; }
.sw--bar { background: var(--chalk); }
.sw--ghost { background: var(--ghost); }
.tip { position: fixed; left: 0; top: 0; z-index: 90; max-width: 260px; padding: 9px 12px; border-radius: 10px; background: var(--chalk); color: var(--ink); font-size: 13px; line-height: 1.4; pointer-events: none; box-shadow: 0 10px 30px -10px #000; }
.tip b { color: var(--ink); }
.tip .muted { color: #5c5f66; }
.tip[hidden] { display: none; }
.meter { display: block; height: 8px; border-radius: 4px; background: var(--ink-3); overflow: hidden; }
.meter i { display: block; height: 100%; border-radius: 4px; background: var(--chalk); transition: width .6s var(--ease); }
.rank__row { display: grid; grid-template-columns: 20px 56px minmax(0, 1fr) 96px; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.rank__row:last-child { border-bottom: 0; }
.rank__row img { width: 56px; height: 35px; object-fit: cover; border-radius: 6px; }
.rank__n { font-family: var(--mono); color: var(--mute); }
.rank__body { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.rank__name { font-weight: 600; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rank__row:first-child .meter i { background: var(--amber); }
.rank__num { display: flex; flex-direction: column; align-items: flex-end; line-height: 1.15; }
.rank__num b { font-size: 15px; }
.rank__num small { font-size: 11.5px; color: var(--mute); }
.bars li { display: grid; grid-template-columns: 120px minmax(0, 1fr) 46px 40px; align-items: center; gap: 12px; padding: 7px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.bars li:last-child { border-bottom: 0; }
.bars__label { font-weight: 600; }
.bars b { text-align: right; font-variant-numeric: tabular-nums; }
.bars li > span:last-child { text-align: right; color: var(--mute); font-size: 12.5px; }
.bars li:first-child .meter i { background: var(--amber); }

/* ---------- TARIFS ---------- */
.pr { display: grid; grid-template-columns: 92px minmax(0, 1.4fr) 170px minmax(0, 1fr) auto; align-items: center; gap: 18px; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.pr:last-child { border-bottom: 0; }
.pr img { width: 92px; height: 58px; object-fit: cover; border-radius: 8px; }
.pr__name { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.pr__name b { font-size: 16px; }
.pr__name small { font-size: 12.5px; color: var(--mute); }
.pr__name span { font-size: 12.5px; color: var(--mute); }
.pr__name .tip-up { color: var(--green); }
.pr__name .tip-down { color: var(--amber); }
.pr__in { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--mute); }
.money-in { position: relative; display: block; }
.money-in input { width: 100%; height: 46px; padding: 0 44px 0 14px; border: 0; border-radius: 12px; background: var(--ink-3); color: var(--chalk); font-family: var(--display); font-stretch: 110%; font-weight: 800; font-size: 20px; }
.money-in input:focus { outline: 0; box-shadow: inset 0 0 0 1.5px var(--amber); }
.money-in em { position: absolute; right: 14px; top: 50%; transform: translateY(-50%); font-style: normal; color: var(--mute); font-weight: 600; }
.pr__deg { display: flex; flex-direction: column; gap: 2px; font-size: 12.5px; color: var(--mute); }
.pr__deg b { color: var(--chalk); margin-left: 4px; }

/* ---------- Notifications, accueil ---------- */
.toasts { position: fixed; right: 18px; bottom: 18px; z-index: 80; display: flex; flex-direction: column; align-items: flex-end; gap: 10px; pointer-events: none; }
.note-toast { pointer-events: auto; display: flex; flex-direction: column; max-width: 380px; padding: 12px 16px; border-radius: 14px; background: var(--chalk); color: var(--ink); box-shadow: 0 20px 50px -15px #000; font-size: 14px; animation: toast-in .5s var(--spring); transition: opacity .4s, transform .4s var(--ease); }
.note-toast span { font-size: 13px; color: #4d5058; }
.note-toast--hot { background: var(--amber); cursor: pointer; }
.note-toast--hot span { color: rgba(13, 14, 17, .75); }
.note-toast--ok { box-shadow: inset 4px 0 0 var(--green), 0 20px 50px -15px #000; }
.note-toast--warn { box-shadow: inset 4px 0 0 var(--red), 0 20px 50px -15px #000; }
.note-toast.is-out { opacity: 0; transform: translateX(30px); }
@keyframes toast-in { from { transform: translateY(30px); opacity: 0; } }
.welcome { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 16px; background: rgba(0, 0, 0, .7); opacity: 0; transition: opacity .35s; }
.welcome.is-on { opacity: 1; }
.welcome[hidden] { display: none; }
.welcome__card { width: min(580px, 100%); max-height: calc(100vh - 32px); overflow-y: auto; padding: 30px; border-radius: 26px; background: var(--ink-2); box-shadow: inset 0 0 0 1px var(--line), 0 40px 100px -20px #000; transform: translateY(16px); transition: transform .5s var(--spring); }
.welcome.is-on .welcome__card { transform: none; }
.welcome h2 { margin: 10px 0 14px; font-family: var(--display); font-weight: 800; font-stretch: 125%; font-size: clamp(30px, 4.4vw, 44px); line-height: .95; text-transform: uppercase; }
.welcome p { color: rgba(243, 241, 236, .82); }
.welcome ol { counter-reset: s; display: grid; gap: 10px; margin: 16px 0 24px; }
.welcome li { counter-increment: s; display: grid; grid-template-columns: 30px 1fr; gap: 10px; align-items: start; font-size: 15px; color: rgba(243, 241, 236, .85); }
.welcome li::before { content: counter(s); display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: var(--amber); color: var(--ink); font-weight: 800; }
.welcome li b { color: var(--chalk); }
.welcome__ctas { display: flex; flex-wrap: wrap; gap: 10px; }

/* ---------- Responsive ---------- */
@media (max-width: 1200px) {
  .seg--agency { display: none; }
  .agency-select { display: block; }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .insights ul { grid-template-columns: 1fr; }
  .pr { grid-template-columns: 80px minmax(0, 1fr) 150px; }
  .pr img { width: 80px; height: 50px; }
  .pr__deg { grid-column: 2; }
  .pr > :last-child { grid-column: 3; justify-self: start; }
}
@media (max-width: 1000px) {
  .clock { display: none; }
  .days, .grid { grid-template-columns: 1fr; }
  .pulse { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .edl__body { grid-template-columns: 1fr; }
}
@media (max-width: 860px) {
  :root { --top: 58px; }
  .top { gap: 10px; padding: 0 12px; }
  .logo small { display: none; }
  .top .btn { display: none; }
  .shell { display: block; }
  .side { position: fixed; top: auto; left: 0; right: 0; bottom: 0; z-index: 50; height: auto; flex-direction: row; gap: 2px; padding: 6px 6px calc(6px + env(safe-area-inset-bottom)); border-right: 0; border-top: 1px solid var(--line); background: rgba(13, 14, 17, .95); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); }
  .side a { flex: 1; flex-direction: column; justify-content: center; gap: 2px; height: 54px; padding: 0 2px; font-size: 11px; }
  .side a[aria-current="page"]::before { left: 30%; right: 30%; top: -6px; bottom: auto; width: auto; height: 3px; border-radius: 0 0 3px 3px; }
  .side .badge { position: absolute; top: 2px; right: calc(50% - 24px); min-width: 18px; height: 18px; font-size: 10.5px; padding: 0 5px; margin: 0; }
  .side__foot { display: none; }
  main { padding: 18px 14px calc(96px + env(safe-area-inset-bottom)); }
  .pulse { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .pulse b { font-size: 22px; }
  .g { --uw: 150px; min-width: 860px; }
  .g-unit img { display: none; }
  .move { grid-template-columns: 54px minmax(0, 1fr) auto; }
  .move__img { display: none; }
  .move__time small { display: none; }
  .kpi--hero { grid-column: 1 / -1; }
  .kpi--hero .kpi__value { font-size: 32px; }
  .move__st { grid-column: 2; }
  .move__act { grid-column: 3; grid-row: 1 / 3; }
  .move.is-pending { grid-template-columns: 70px minmax(0, 1fr); }
  .move.is-pending .move__act { grid-column: 1 / -1; grid-row: auto; justify-content: flex-start; }
  .drawer__panel { width: 100%; }
  .edl { padding: 0; }
  .edl__panel { max-height: 100vh; height: 100%; border-radius: 0; }
  .f-row { grid-template-columns: 1fr; }
  .photos { grid-template-columns: repeat(2, 1fr); }
  .kpi__value { font-size: 24px; }
  .bars li { grid-template-columns: 96px minmax(0, 1fr) 40px; }
  .bars li > span:last-child { display: none; }
  .pr { grid-template-columns: 64px minmax(0, 1fr); gap: 10px 12px; }
  .pr img { width: 64px; height: 42px; }
  .pr__in, .pr__deg, .pr > :last-child { grid-column: 2; }
  .toasts { left: 12px; right: 12px; bottom: calc(80px + env(safe-area-inset-bottom)); align-items: stretch; }
  .note-toast { max-width: none; }
  .demo-bar { padding: 8px 14px; font-size: 12px; }
}
@media (max-width: 480px) {
  .top { gap: 8px; }
  .logo { font-size: 18px; }
  .agency-select select { max-width: 124px; font-size: 13px; padding-left: 10px; }
  .top .seg button { min-width: 32px; padding: 0 9px; }
  .icon-btn { width: 34px; height: 34px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
