
/* Mise en page : barre d'en-tête de marque, puis l'outil (répartiteur : semaine en couloirs par chauffeur ; chauffeur : écran de cellulaire). */
/* COULEURS OFFICIELLES tirées de la feuille de style de wendake.ca (oct. 2026) : bleu foncé #444f80, bleu plus foncé #3a4260, bleu-gris #bdcad6, bleu-gris pâle #e5eaef, blanc café #eae5e1, brun moyen #8b8179. */
:root {
  --brand: #444f80;
  --brand-2: #bdcad6;
  --on-brand: #ffffff;
  --earth: #8b8179;
  --cream: #eae5e1;
  --bg: #f6f3f0;
  --surface: #ffffff;
  --surface-2: #e5eaef;
  --line: #d9d3cd;
  --fg: #1f2333;
  --muted: #5e5a62;
  --focus: #2655a3;
  --ok: #1d7a4c;  --ok-bg: #dcf1e5;
  --warn: #9a5b00; --warn-bg: #fdeccc;
  --info: #1f5f9e; --info-bg: #dbe9f7;
  --alert: #a3312a; --alert-bg: #f8dedb;
  --c1: #2b6cb0; --c2: #b7612a; --c3: #2f855a; --c4: #7b4fa3; --c0: #8a95a1;
  --shadow: 0 1px 2px rgba(20,35,50,.08), 0 4px 14px rgba(20,35,50,.08);
  --f-display: "Source Serif 4", Georgia, "Times New Roman", serif;
  --f-body: "Atkinson Hyperlegible", "Segoe UI", system-ui, sans-serif;
  --f-mono: "IBM Plex Mono", ui-monospace, "SF Mono", Menlo, monospace;
}
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) {
  --brand: #3a4260; --brand-2: #bdcad6; --on-brand: #f4f1ee; --earth: #b3a9a0; --cream: #2a2e3d;
  --bg: #14161f; --surface: #1d2030; --surface-2: #262a3c; --line: #363b52;
  --fg: #ece8e4; --muted: #a8a3ad; --focus: #9dcff0;
  --ok: #6fd3a0; --ok-bg: #173826; --warn: #f2bd63; --warn-bg: #3b2c12;
  --info: #8ec2f5; --info-bg: #182f47; --alert: #f19a92; --alert-bg: #43201d;
  --c1: #6aa6e8; --c2: #e39a67; --c3: #6cc396; --c4: #b893dc; --c0: #8794a1;
  --shadow: 0 1px 2px rgba(0,0,0,.4), 0 4px 14px rgba(0,0,0,.35);
  color-scheme: dark;
} }
:root[data-theme="dark"] {
  --brand: #3a4260; --brand-2: #bdcad6; --on-brand: #f4f1ee; --earth: #b3a9a0; --cream: #2a2e3d;
  --bg: #14161f; --surface: #1d2030; --surface-2: #262a3c; --line: #363b52;
  --fg: #ece8e4; --muted: #a8a3ad; --focus: #9dcff0;
  --ok: #6fd3a0; --ok-bg: #173826; --warn: #f2bd63; --warn-bg: #3b2c12;
  --info: #8ec2f5; --info-bg: #182f47; --alert: #f19a92; --alert-bg: #43201d;
  --c1: #6aa6e8; --c2: #e39a67; --c3: #6cc396; --c4: #b893dc; --c0: #8794a1;
  --shadow: 0 1px 2px rgba(0,0,0,.4), 0 4px 14px rgba(0,0,0,.35);
  color-scheme: dark;
}
* { box-sizing: border-box; }
body { background: var(--bg); color: var(--fg); font-family: var(--f-body); font-size: 15px; line-height: 1.45; }
body::before { content: ""; position: fixed; inset: 0 0 auto; height: env(safe-area-inset-top, 0px); z-index: 10; background: var(--brand); }
h1, h2, h3 { font-family: var(--f-display); text-wrap: balance; margin: 0; line-height: 1.15; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.mono { font-family: var(--f-mono); font-size: .86em; font-variant-numeric: tabular-nums; }
.num { font-variant-numeric: tabular-nums; }
.wrap { padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); max-width: 1320px; margin: 0 auto; }

/* En-tête */
.top { background: var(--brand); color: var(--on-brand); position: sticky; top: env(safe-area-inset-top, 0px); z-index: 5; }
.top .wrap { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 20px; padding-block: 12px; }
.logo { width: 42px; height: 46px; flex: none; display: block; filter: drop-shadow(0 1px 2px rgba(0,0,0,.25)); }
.brandname { display: flex; flex-direction: column; min-width: 0; }
.brandname h1 { font-size: 19px; font-weight: 700; }
.brandname small { opacity: .8; font-size: 12.5px; }
.top .spacer { flex: 1; }
.switch { display: inline-flex; background: color-mix(in srgb, var(--on-brand) 14%, transparent); border-radius: 999px; padding: 3px; }
.switch button { border: 0; background: transparent; color: var(--on-brand); padding: 7px 14px; border-radius: 999px; cursor: pointer; font-weight: 700; font-size: 14px; }
.switch button[aria-pressed="true"] { background: var(--on-brand); color: var(--brand); }
:root[data-theme="dark"] .switch button[aria-pressed="true"] { color: #3a4260; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .switch button[aria-pressed="true"] { color: #3a4260; } }
.demo-pill { font-size: 12px; background: var(--brand-2); color: #3a4260; padding: 4px 10px; border-radius: 999px; font-weight: 700; }
.band { height: 18px; background: var(--ornament, none) repeat-x center / 35px 10px, var(--cream); border-bottom: 1px solid var(--line); }
.site-foot { margin-top: 32px; padding: 26px 0 calc(28px + env(safe-area-inset-bottom, 0px)); background: var(--cream); border-top: 1px solid var(--line); color: var(--muted); font-size: 13px; }
.site-foot .wrap { display: flex; align-items: center; gap: 16px; }
.site-foot img { width: 56px; height: auto; flex: none; }
.site-foot b { display: block; color: var(--fg); font-family: var(--f-display); font-size: 16px; }

/* Onglets */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-top: 18px; overflow-x: auto; }
.tabs button { border: 0; background: none; padding: 10px 14px; cursor: pointer; font-weight: 700; color: var(--muted); border-bottom: 3px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tabs button[aria-selected="true"] { color: var(--fg); border-color: var(--brand); }
:root[data-theme="dark"] .tabs button[aria-selected="true"] { border-color: var(--brand-2); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .tabs button[aria-selected="true"] { border-color: var(--brand-2); } }

.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; padding-block: 16px 12px; }
.toolbar h2 { font-size: 22px; font-weight: 700; }
.toolbar .spacer { flex: 1; }
.btn { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line); background: var(--surface); padding: 8px 14px; border-radius: 8px; cursor: pointer; font-weight: 700; font-size: 14px; text-decoration: none; color: var(--fg); }
.btn:hover { background: var(--surface-2); }
.btn.primary { background: var(--brand); border-color: var(--brand); color: var(--on-brand); }
.btn.primary:hover { filter: brightness(1.1); }
.btn.big { padding: 12px 16px; font-size: 16px; border-radius: 10px; justify-content: center; }
.btn.icon { padding: 8px 10px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

/* Semaine */
.legend { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 13px; color: var(--muted); padding-bottom: 10px; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.scroller { overflow-x: auto; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.week { display: grid; grid-template-columns: 168px repeat(5, minmax(170px, 1fr)); min-width: 1018px; }
.week .h { padding: 10px 12px; font-weight: 700; border-bottom: 1px solid var(--line); background: var(--surface-2); font-size: 14px; }
.week .h small { display: block; font-weight: 400; color: var(--muted); }
.week .h.today { background: color-mix(in srgb, var(--brand-2) 35%, var(--surface-2)); }
.lane { padding: 10px 12px; border-bottom: 1px solid var(--line); display: flex; gap: 10px; align-items: flex-start; }
.lane .dot { width: 10px; height: 10px; border-radius: 50%; margin-top: 6px; flex: none; }
.lane b { display: block; font-size: 14px; }
.lane small { color: var(--muted); font-size: 12.5px; }
.cell { border-bottom: 1px solid var(--line); border-left: 1px solid var(--line); padding: 6px; display: flex; flex-direction: column; gap: 6px; min-height: 92px; }
.cell.today { background: color-mix(in srgb, var(--brand-2) 10%, transparent); }
.cell.over { background: color-mix(in srgb, var(--focus) 14%, transparent); outline: 2px dashed var(--focus); outline-offset: -4px; }
.row-unassigned .lane, .row-unassigned .cell { background: color-mix(in srgb, var(--warn-bg) 55%, transparent); }
.trip { text-align: left; border: 1px solid var(--line); border-left: 4px solid var(--tc, var(--c0)); background: var(--surface); border-radius: 8px; padding: 7px 9px; cursor: pointer; display: flex; flex-direction: column; gap: 3px; box-shadow: 0 1px 1px rgba(0,0,0,.04); }
.trip:hover { box-shadow: var(--shadow); }
.trip .t1 { display: flex; justify-content: space-between; gap: 6px; font-weight: 700; font-size: 13.5px; }
.trip .t2 { font-size: 13px; }
.trip .t3 { font-size: 12px; color: var(--muted); }
.trip[draggable="true"] { cursor: grab; }

.chip { display: inline-flex; align-items: center; gap: 4px; border-radius: 999px; padding: 1px 8px; font-size: 11.5px; font-weight: 700; white-space: nowrap; }
.s-nonassigne { background: var(--warn-bg); color: var(--warn); }
.s-assigne { background: var(--surface-2); color: var(--muted); }
.s-envoye { background: var(--info-bg); color: var(--info); }
.s-en_route, .s-a_bord { background: var(--alert-bg); color: var(--alert); }
.s-termine { background: var(--ok-bg); color: var(--ok); }
.tag { display: inline-block; border: 1px solid var(--line); border-radius: 6px; padding: 1px 7px; font-size: 12.5px; background: var(--surface-2); }

/* Tiroir */
.scrim { position: fixed; inset: 0; background: rgba(10,20,30,.35); z-index: 20; }
.drawer { position: fixed; top: 0; right: 0; bottom: 0; width: min(440px, 100%); background: var(--surface); z-index: 21; box-shadow: var(--shadow); display: flex; flex-direction: column; padding-top: env(safe-area-inset-top, 0px); padding-bottom: env(safe-area-inset-bottom, 0px); padding-right: env(safe-area-inset-right, 0px); }
.drawer header { display: flex; align-items: center; gap: 10px; padding: 16px 18px; border-bottom: 1px solid var(--line); }
.drawer header h3 { font-size: 19px; flex: 1; }
.drawer .body { padding: 16px 18px 28px; overflow-y: auto; display: flex; flex-direction: column; gap: 16px; }
.kv { display: grid; grid-template-columns: 128px 1fr; gap: 6px 12px; font-size: 14.5px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; min-width: 0; }
.box { border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; display: flex; flex-direction: column; gap: 8px; }
.box h4 { margin: 0; font-size: 13px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.box.private { border-color: color-mix(in srgb, var(--alert) 40%, var(--line)); }
.box.private h4 { color: var(--alert); }
.sms { background: var(--surface-2); border-radius: 14px 14px 14px 4px; padding: 10px 12px; font-size: 14px; white-space: pre-line; }
.form { display: flex; flex-direction: column; gap: 12px; }
.field { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.field label { font-size: 13px; font-weight: 700; color: var(--muted); }
.field input, .field select, .field textarea { border: 1px solid var(--line); background: var(--bg); border-radius: 8px; padding: 9px 10px; width: 100%; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.hint { font-size: 12.5px; color: var(--muted); }
.check { display: flex; align-items: center; gap: 8px; font-size: 14.5px; }

/* Usagers */
.split { display: grid; grid-template-columns: minmax(0, 360px) minmax(0, 1fr); gap: 18px; padding-bottom: 32px; }
@media (max-width: 820px) { .split { grid-template-columns: 1fr; } }
.list { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; display: flex; flex-direction: column; }
.list .search { padding: 10px; border-bottom: 1px solid var(--line); }
.list .search input { width: 100%; border: 1px solid var(--line); border-radius: 8px; padding: 9px 10px; background: var(--bg); }
.list button { text-align: left; border: 0; border-bottom: 1px solid var(--line); background: none; padding: 10px 14px; cursor: pointer; display: flex; justify-content: space-between; gap: 10px; }
.list button[aria-current="true"] { background: color-mix(in srgb, var(--brand-2) 22%, transparent); }
.list button small { color: var(--muted); }
.list .foot { padding: 10px 14px; font-size: 12.5px; color: var(--muted); }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 18px 20px; display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.card h3 { font-size: 22px; }
.tbl-wrap { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; font-size: 14px; }
th, td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
th { font-size: 12.5px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 700; }
td.r, th.r { text-align: right; font-variant-numeric: tabular-nums; }
tfoot td { font-weight: 700; border-bottom: 0; }

/* Rapport */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 12px 16px; }
.stat small { color: var(--muted); font-size: 13px; }
.stat div { font-family: var(--f-display); font-size: 28px; font-weight: 700; font-variant-numeric: tabular-nums; }
.bar { height: 8px; border-radius: 4px; background: var(--surface-2); overflow: hidden; min-width: 80px; }
.bar i { display: block; height: 100%; }

/* Chauffeur */
.phone-stage { display: flex; flex-wrap: wrap; gap: 28px; justify-content: center; align-items: flex-start; padding-block: 22px 40px; }
.phone { width: 380px; max-width: 100%; border: 10px solid #1b232c; border-radius: 38px; background: var(--bg); overflow: hidden; box-shadow: var(--shadow); }
.phone .screen { height: 720px; overflow-y: auto; display: flex; flex-direction: column; }
.ph-top { background: var(--brand); color: var(--on-brand); padding: 14px 16px 12px; display: flex; flex-direction: column; gap: 8px; }
.ph-top .who { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-size: 13.5px; }
.ph-top h3 { font-size: 21px; }
.daynav { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.daynav button { background: color-mix(in srgb, var(--on-brand) 16%, transparent); border: 0; color: var(--on-brand); border-radius: 8px; padding: 6px 12px; cursor: pointer; font-weight: 700; }
.ph-body { padding: 12px; display: flex; flex-direction: column; gap: 12px; }
.ride { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 14px; display: flex; flex-direction: column; gap: 10px; }
.ride .time { display: flex; justify-content: space-between; align-items: center; }
.ride .time b { font-family: var(--f-display); font-size: 24px; font-variant-numeric: tabular-nums; }
.leg { display: grid; grid-template-columns: 18px 1fr; gap: 2px 10px; font-size: 15px; }
.leg .pin { width: 12px; height: 12px; border-radius: 50%; border: 3px solid var(--brand); margin-top: 4px; }
.leg .pin.dest { background: var(--brand); }
:root[data-theme="dark"] .leg .pin { border-color: var(--brand-2); }
:root[data-theme="dark"] .leg .pin.dest { background: var(--brand-2); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .leg .pin { border-color: var(--brand-2); } :root:not([data-theme="light"]) .leg .pin.dest { background: var(--brand-2); } }
.leg small { color: var(--muted); display: block; }
.mob { display: flex; flex-wrap: wrap; gap: 6px; }
.mob .tag { background: var(--warn-bg); border-color: transparent; color: var(--warn); font-weight: 700; }
.nav2 { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.kmrow { display: flex; gap: 8px; align-items: flex-end; }
.kmrow .field { flex: 1; }
.empty { text-align: center; color: var(--muted); padding: 30px 12px; }
.side-note { max-width: 360px; display: flex; flex-direction: column; gap: 14px; }
.side-note h2 { font-size: 22px; }
.side-note p { margin: 0; }
.side-note ul { margin: 0; padding-left: 18px; display: flex; flex-direction: column; gap: 6px; }

.toast { position: fixed; left: 50%; bottom: calc(20px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%); background: var(--fg); color: var(--bg); padding: 10px 16px; border-radius: 10px; z-index: 40; font-weight: 700; max-width: calc(100% - 32px); }
@media (max-width: 560px) { .two { grid-template-columns: 1fr; } .kv { grid-template-columns: 1fr; gap: 2px; } .kv dd { margin-bottom: 6px; } .phone { border-width: 6px; border-radius: 26px; } .phone .screen { height: auto; min-height: 600px; } }
@media (prefers-reduced-motion: no-preference) { .drawer { animation: slide .18s ease-out; } @keyframes slide { from { transform: translateX(24px); opacity: .6; } } }
