@font-face {
  font-family: "Barlow Condensed";
  src: url("fonts/barlow-condensed-500.woff2") format("woff2");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Barlow Condensed";
  src: url("fonts/barlow-condensed-600.woff2") format("woff2");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Source Sans 3";
  src: url("fonts/source-sans-3-400.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Source Sans 3";
  src: url("fonts/source-sans-3-600.woff2") format("woff2");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}

:root {
  --ink: #1c2830;
  --paper: #e7eef2;
  --paper-2: #f7fafb;
  --line: #c5d0d6;
  --line-strong: #a9b8c1;
  --col-w: 196px;
  --hour-h: 52px;
  --shell: #163e5c;
  --shell-ink: #f4f8fa;
  --hydro: #0b7a84;
  --pas_hydro: #b8612d;
  --itv: #3c4c9a;
  --billed: #1e7a46;
  --danger: #7a221c;
  --quiet: #243848;
  --face: "Source Sans 3", sans-serif;
  --display: "Barlow Condensed", sans-serif;
  --ease: cubic-bezier(.16, 1, .3, 1);
  color-scheme: light;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 16px/1.45 var(--face);
}
::selection { background: #c5dde0; color: var(--ink); }
:focus-visible { outline: 2px solid var(--shell); outline-offset: 2px; }
.top :focus-visible { outline-color: var(--shell-ink); }
input, select, button { font: inherit; color: inherit; caret-color: var(--shell); }
button { cursor: pointer; }
.sr {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}
* { scrollbar-color: #6d8494 var(--paper); }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: #6d8494; border-radius: 0; }
::-webkit-scrollbar-track { background: var(--paper); }

/* ============ En-tête ============
   Deux niveaux : la barre d'identité, puis la barre d'outils. Tout empilé sur
   une seule ligne rendait la partie droite illisible. */
.top {
  display: flex;
  flex-direction: column;
  gap: 0;
  padding: 0;
  background: var(--shell);
  color: var(--shell-ink);
  border-bottom: 3px solid var(--shell);
  min-width: 0;
}
body[data-type="hydro"] .top { border-bottom-color: var(--hydro); }
body[data-type="pas_hydro"] .top { border-bottom-color: var(--pas_hydro); }
body[data-type="itv"] .top { border-bottom-color: var(--itv); }

.top-bar {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 9px 20px;
  min-width: 0;
  min-height: 60px;
}
.top-tools {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 20px;
  background: rgba(0, 0, 0, .16);
  border-top: 1px solid rgba(244, 248, 250, .12);
  min-width: 0;
  flex-wrap: wrap;
}

/* Marque : monogramme + nom sur deux lignes serrées. */
.brand {
  display: flex;
  align-items: center;
  gap: 9px;
  flex: none;
  color: var(--shell-ink);
  text-decoration: none;
}
.brand-mark {
  flex: none;
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border-radius: 6px;
  background: rgba(244, 248, 250, .14);
  box-shadow: inset 0 0 0 1px rgba(244, 248, 250, .3);
  font-family: var(--display);
  font-size: 20px;
  font-weight: 600;
  line-height: 1;
}
.brand-text {
  display: flex;
  flex-direction: column;
  font-family: var(--display);
  font-size: 20px;
  font-weight: 600;
  letter-spacing: .08em;
  line-height: 1;
  text-transform: uppercase;
}
.brand-text em {
  font-style: normal;
  font-family: var(--face);
  font-size: 9.5px;
  font-weight: 400;
  letter-spacing: .18em;
  opacity: .68;
  margin-top: 3px;
}

.date { margin: 0; font-size: 26px; font-weight: 600; letter-spacing: .02em; white-space: nowrap; }
.datebar {
  display: flex;
  align-items: center;
  gap: 2px;
  flex: none;
  padding: 2px;
  border-radius: 8px;
  background: rgba(0, 0, 0, .14);
}
.step {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  color: var(--shell-ink);
  text-decoration: none;
  border-radius: 6px;
  opacity: .75;
}
.step:hover { opacity: 1; background: rgba(244, 248, 250, .16); }

/* Onglets de vue : segmented control net. */
.tabs {
  display: flex;
  flex: none;
  gap: 1px;
  padding: 2px;
  border-radius: 8px;
  background: rgba(0, 0, 0, .18);
}
.tabs a {
  color: #cfe0ea;
  text-decoration: none;
  padding: 6px 13px;
  border-radius: 6px;
  font-size: 13.5px;
  line-height: 1.2;
  white-space: nowrap;
}
.tabs a:hover { color: #fff; }
.tabs a.on { background: #fff; color: var(--shell); font-weight: 600; }

/* Pastille d'état : publié / non publié / à remettre à jour. */
.badge {
  margin: 0;
  flex: none;
  display: flex;
  align-items: center;
  gap: 6px;
  border: 0;
  border-radius: 99px;
  padding: 5px 11px 5px 9px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
  background: rgba(244, 248, 250, .13);
  color: #d7e6ef;
}
.badge::before {
  content: "";
  flex: none;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  opacity: .8;
}
.badge.is-on { background: var(--shell-ink); color: #1e6b3f; }
.badge.is-dirty { background: var(--danger); color: #fff; }

.grow { flex: 1; min-width: 8px; }

/* Compte : nom + raccourcis, séparés du reste. */
.account { display: flex; align-items: center; gap: 12px; flex: none; }
.who {
  margin: 0;
  font-size: 13px;
  font-weight: 600;
  color: #dbe9f1;
  max-width: 130px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.account-links { display: flex; align-items: center; gap: 12px; }
.quiet {
  color: #c2d5e1;
  margin: 0;
  text-decoration: none;
  font-size: 12.5px;
  white-space: nowrap;
}
.quiet:hover { color: #fff; }
.quiet.is-out { color: #f0c9c4; }

/* ============ Recherche ============ */
.searchzone { display: flex; align-items: center; gap: 8px; flex: 1 1 320px; min-width: 0; }
.top .search { position: relative; flex: 1 1 auto; min-width: 140px; max-width: 380px; margin: 0; }
.top .search .search-box {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(244, 248, 250, .12);
  border: 1px solid rgba(244, 248, 250, .22);
  border-radius: 7px;
  padding: 0 4px 0 9px;
}
.top .search .search-box:focus-within {
  background: rgba(244, 248, 250, .2);
  border-color: rgba(244, 248, 250, .55);
}
.top .search .search-icon { flex: none; color: #b9cfdd; }
.top .search input {
  flex: 1;
  min-width: 0;
  width: auto;
  background: transparent;
  border: 0;
  outline: none;
  color: var(--shell-ink);
  padding: 7px 0;
  font-size: 13.5px;
}
.top .search input::placeholder { color: #b9cfdd; }
.top .search .search-go {
  flex: none;
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  padding: 0;
  background: transparent;
  color: var(--shell-ink);
  border: 0;
  border-radius: 5px;
  opacity: .6;
}
.top .search .search-go:hover { opacity: 1; background: rgba(244, 248, 250, .18); }
.top .search .search-go svg { display: block; }

/* Pastille « inclure le passé » : alignée sur le champ, lisible, et qui s'allume quand active. */
.past-toggle {
  flex: none;
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 0;
  padding: 6px 11px;
  border-radius: 7px;
  border: 1px solid rgba(244, 248, 250, .22);
  background: rgba(244, 248, 250, .08);
  color: #c2d5e1;
  font-size: 12px;
  white-space: nowrap;
  cursor: pointer;
  user-select: none;
}
.past-toggle:hover { color: #fff; border-color: rgba(244, 248, 250, .45); }
.past-toggle input {
  appearance: none;
  -webkit-appearance: none;
  flex: none;
  width: 13px;
  height: 13px;
  margin: 0;
  border-radius: 3px;
  border: 1.5px solid currentColor;
  background: transparent;
  cursor: pointer;
  position: relative;
}
.past-toggle input:checked { background: var(--shell-ink); border-color: var(--shell-ink); }
.past-toggle input:checked::after {
  content: "";
  position: absolute;
  left: 3px;
  top: 0;
  width: 4px;
  height: 7px;
  border: solid var(--shell);
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}
.past-toggle.is-on {
  color: var(--shell);
  background: var(--shell-ink);
  border-color: var(--shell-ink);
  font-weight: 600;
}
.past-toggle.is-on input { border-color: var(--shell); }

/* Publication : toujours à droite de la barre d'outils. */
.top .publish { flex: none; margin-left: auto; }
.top .pub, .sheet-bar .pub, .gate-main .pub {
  background: var(--shell-ink);
  color: var(--shell);
  border: 0;
  border-radius: 6px;
  padding: 8px 14px;
  font-weight: 600;
  font-size: 13.5px;
}
.top .ghost {
  background: transparent;
  color: var(--shell-ink);
  border: 1px solid rgba(244, 248, 250, .5);
  border-radius: 6px;
  padding: 8px 14px;
  font-weight: 600;
  font-size: 13.5px;
}
.brand, .date, .name, .queue h2, .detail h2, .gate-main h1, .settings-main h1, .settings-main h2, .paper h1, .who-line, .stop h2 {
  font-family: var(--display);
  letter-spacing: .04em;
  text-transform: uppercase;
}
.grow { flex: 1; min-width: 8px; }
.search-panel {
  position: fixed;
  z-index: 40;
  width: min(440px, calc(100vw - 24px));
  max-height: min(70vh, 520px);
  overflow-y: auto;
  overscroll-behavior: contain;
  background: #fff;
  color: var(--ink);
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  box-shadow: 0 14px 36px rgba(22, 62, 92, .26);
  padding: 4px;
}
.search-panel[hidden] { display: none; }
.search-panel .search-count {
  margin: 0;
  padding: 4px 8px 6px;
  font-size: 11px;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--quiet);
  border-bottom: 1px solid var(--line);
}
.search-panel .search-empty {
  margin: 0;
  padding: 10px 8px;
  font-size: 13px;
  color: var(--quiet);
}
.search-row {
  display: flex;
  gap: 8px;
  align-items: baseline;
  padding: 5px 8px;
  border-radius: 5px;
  color: inherit;
  text-decoration: none;
  border-bottom: 1px solid rgba(197, 208, 214, .5);
}
.search-row:last-child { border-bottom: 0; }
.search-row:hover, .search-row.is-active { background: var(--paper-2); }
.search-row.is-active { box-shadow: inset 2px 0 0 var(--shell); }
.search-row .search-main { flex: 1; min-width: 0; display: flex; flex-wrap: wrap; gap: 2px 6px; align-items: baseline; }
.search-row .search-main b { font-size: 13.5px; font-weight: 600; line-height: 1.2; }
.search-row .search-place {
  flex: 1 0 100%;
  min-width: 0;
  font-size: 11.5px;
  color: var(--quiet);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.search-row .search-side {
  flex: none;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 1px;
  font-size: 11px;
  color: var(--quiet);
  font-variant-numeric: tabular-nums;
  text-align: right;
}
.search-row .search-side b { color: var(--ink); font-weight: 600; white-space: nowrap; }
.search-row .search-side em {
  font-style: normal;
  font-size: 10px;
  letter-spacing: .03em;
  text-transform: uppercase;
  color: var(--quiet);
  border: 1px solid currentColor;
  border-radius: 3px;
  padding: 0 4px;
  white-space: nowrap;
}
.search-row .search-side em.is-on { color: var(--billed); }
.search-row .search-meta { font-size: 10.5px; white-space: nowrap; }
.search-row.is-billed { border-left: 2px solid var(--billed); }
.search-row.is-person .search-main b { font-size: 13px; }
.top .pub, .sheet-bar .pub, .gate-main .pub {
  background: var(--shell-ink);
  color: var(--shell);
  border: 0;
  border-radius: 6px;
  padding: 10px 14px;
  font-weight: 600;
}
.top .ghost {
  background: transparent;
  color: var(--shell-ink);
  border: 1px solid rgba(244, 248, 250, .7);
  border-radius: 6px;
  padding: 10px 14px;
  font-weight: 600;
}
.publish { margin: 0; display: flex; gap: 6px; align-items: center; }
.publish-main, .publish-off { margin: 0; display: flex; }

.banner { margin: 0; padding: 10px 24px; }
.banner.ok { background: #e5f2ea; color: #145c34; }
.banner.err { background: #f8e8e6; color: var(--danger); }
.hint { margin: 0; padding: 8px 24px 0; color: var(--quiet); }
.hint a { color: var(--shell); }

.sub {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 48px;
  padding: 8px 24px;
  background: var(--paper-2);
  border-bottom: 1px solid var(--line);
  flex-wrap: wrap;
}
.chip {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 99px;
  padding: 5px 11px;
  color: inherit;
  text-decoration: none;
  font-size: 14px;
}
.chip.on { background: var(--shell); color: var(--shell-ink); border-color: var(--shell); }
.sw { width: 8px; height: 8px; display: inline-block; margin-right: 6px; vertical-align: 1px; }
.sw.hydro { background: var(--hydro); }
.sw.pas_hydro { background: var(--pas_hydro); }
.sw.itv { background: var(--itv); }
.cols-filter summary { cursor: pointer; }
.cols-filter form {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  align-items: center;
  background: #fff;
  border: 1px solid var(--line);
  padding: 10px;
  margin-top: 8px;
}
.cols-filter label { display: flex; flex-direction: row; gap: 6px; align-items: center; margin: 0; font-size: 14px; }

body.day { display: flex; flex-direction: column; height: 100%; min-height: 0; overflow: hidden; }
.main { flex: 1; min-height: 0; min-width: 0; display: flex; overflow: hidden; }
/* Sur téléphone, la page défile normalement : le jour empilé a besoin du scroll vertical. */
@media (max-width: 860px) {
  body.day { height: auto; min-height: 100%; overflow: auto; }
  .main { flex-direction: column; overflow: visible; }
}
.queue {
  width: 320px;
  flex: none;
  overflow: auto;
  background: var(--paper-2);
  border-right: 1px solid var(--line);
  padding: 12px 12px 20px;
}
.queue h2, .detail h2 { font-weight: 600; font-size: 22px; margin: 22px 0 8px; }
.queue > h2:first-child, .detail h2 { margin-top: 0; }
.detail h2 { font-size: 28px; }
.queue-head {
  position: sticky;
  top: -12px;
  z-index: 3;
  margin: -12px -12px 4px;
  padding: 10px 12px 6px;
  background: var(--paper-2);
  border-bottom: 1px solid var(--line);
}
.queue-filter { margin: 0; }
.queue-filter input {
  width: 100%;
  padding: 5px 8px;
  font-size: 13px;
  border-radius: 4px;
}
.queue-noresult { margin: 6px 0; font-size: 13px; color: var(--quiet); }
.queue-head h2 {
  font-family: var(--display);
  font-size: 16px;
  font-weight: 600;
  letter-spacing: .05em;
  text-transform: uppercase;
  color: var(--shell);
  margin: 0 0 2px;
}
.queue-head .queue-note { font-size: 12px; line-height: 1.3; margin: 0 0 8px; }
.card, .detail {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 4px 8px 5px;
  margin-bottom: 3px;
}
.detail { padding: 12px; margin-bottom: 16px; }
.card.is-armed, .card.is-hit, .job.is-hit { outline: 2px solid var(--shell); }
.pick, .job a, .mini { color: inherit; text-decoration: none; }
.pick, .job strong { font-weight: 600; }
.card p, .meta { margin: 2px 0; }
.meta, .empty, .card .meta { color: var(--quiet); font-size: 14px; }
.job a { display: block; padding: 6px 8px 12px; }
.notes { margin: 8px 0 0; }
.billed { color: var(--billed); font-style: normal; font-weight: 600; }
.bad { color: var(--danger); font-style: normal; font-weight: 600; }
.price { font-variant-numeric: tabular-nums; font-weight: 600; }
.products { margin: 8px 0; padding-left: 18px; }
.tel { color: var(--shell); }
.actions a { color: var(--shell); }
button, .detail button, .card button, .settings-main button {
  background: var(--shell);
  color: var(--shell-ink);
  border: 0;
  border-radius: 6px;
  padding: 8px 12px;
  font-weight: 600;
}
button.text, .places button.text {
  background: transparent;
  color: var(--shell);
  padding: 8px 0;
}
button:disabled { background: #8aa0ae; color: #f4f8fa; cursor: not-allowed; }
label { display: flex; flex-direction: column; gap: 4px; font-size: 14px; margin: 8px 0; color: var(--quiet); }
/* Un attribut hidden doit gagner contre le display:flex des labels. */
label[hidden], .role-person[hidden] { display: none !important; }
select, input[type="text"], input[type="email"], input[type="password"], input[type="search"] {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 8px 10px;
  color: var(--ink);
}
summary { cursor: pointer; color: var(--shell); }

.board { flex: 1; min-height: 0; overflow: auto; display: flex; background: var(--paper); }
.hours {
  width: 56px;
  flex: none;
  position: sticky;
  left: 0;
  z-index: 4;
  background: var(--paper);
  display: flex;
  flex-direction: column;
}
.name, .name-spacer {
  height: 36px;
  flex: none;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  padding: 0 8px;
}.name { font-size: 22px; font-weight: 600; margin: 0; }
.name a { color: inherit; text-decoration: none; }
/* Bouton « recaler » d'une colonne : discret, dans l'en-tête du chauffeur. */
.name { display: flex; align-items: center; gap: 6px; }
.name a { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 19px; }
/* Charge de la journée : arrêts posés, heures occupées, trajets tendus. */
.col-load {
  flex: none;
  display: flex;
  align-items: baseline;
  gap: 5px;
  font-family: var(--face);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0;
  text-transform: none;
  color: var(--quiet);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.col-load b { font-size: 12px; color: var(--ink); }
.col-load i { font-style: normal; }
.col-load i.is-tight { color: var(--danger); }
@media (max-width: 1500px) {
  .col-load i:not(.is-tight) { display: none; }
}
.name .respace {
  flex: none;
  background: #fff;
  color: var(--quiet);
  border: 1px solid var(--line);
  border-radius: 3px;
  padding: 1px 5px;
  font-family: var(--face);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0;
  text-transform: none;
  line-height: 1.4;
  cursor: pointer;
}
.name .respace:hover { background: var(--shell); color: var(--shell-ink); border-color: var(--shell); }
.name .respace.is-busy { background: var(--shell); color: var(--shell-ink); border-color: var(--shell); }
.respace-all {
  background: transparent;
  color: var(--shell);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 5px 10px;
  font-family: var(--face);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0;
  text-transform: none;
  cursor: pointer;
  margin-left: auto;
}
.respace-all:hover { background: var(--shell); color: var(--shell-ink); border-color: var(--shell); }
.respace-all:disabled { opacity: .6; cursor: progress; }
.cols { display: flex; align-items: stretch; }
.col { width: var(--col-w); flex: none; display: flex; flex-direction: column; border-right: 1px solid var(--line); position: relative; }
.cols { height: 100%; }
.track {
  position: relative;
  flex: none;
  height: calc(var(--hours, 10) * var(--hour-h, 52px));
  min-height: 0;
}
/* Repères : heure pleine, demi-heure, quart d'heure. Les fins n'apparaissent qu'en zoom. */
.rule { position: absolute; left: 0; right: 0; height: 1px; z-index: 0; pointer-events: none; background: transparent; }
.rule.hour { background: var(--line); }
.rule.half {
  background: color-mix(in srgb, var(--line) 62%, transparent);
  opacity: 0;
}
.rule.quarter {
  background: color-mix(in srgb, var(--line) 44%, transparent);
  opacity: 0;
}
.board[data-grid="30"] .rule.half { opacity: 1; }
.board[data-grid="15"] .rule.half,
.board[data-grid="15"] .rule.quarter { opacity: 1; }
.hours .track b.mark {
  position: absolute;
  right: 6px;
  transform: translateY(-50%);
  font-family: var(--display);
  font-size: 16px;
  font-weight: 500;
  color: var(--quiet);
  font-variant-numeric: tabular-nums;
}
.hours .track b.mark.half,
.hours .track b.mark.quarter { font-size: 12px; opacity: 0; }
.board[data-grid="30"] .hours .track b.mark.half { opacity: .85; }
.board[data-grid="15"] .hours .track b.mark.half { opacity: .85; }
.board[data-grid="15"] .hours .track b.mark.quarter { opacity: .7; }
/* Poignée de largeur, sur le bord droit de chaque colonne. */
.col-grip {
  position: absolute;
  top: 0;
  right: -3px;
  bottom: 0;
  width: 7px;
  z-index: 5;
  cursor: col-resize;
  touch-action: none;
}
.col-grip::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: 3px;
  width: 1px;
  background: transparent;
}
.col-grip:hover::before,
.col-grip:focus-visible::before,
.col.is-resizing .col-grip::before { background: var(--shell); width: 2px; left: 2px; }
.col-grip:focus-visible { outline: none; }
/* Barre de réglage de la hauteur, sous la grille : toujours accessible, même défilée. */
.board-shell { flex: 1; min-width: 0; min-height: 0; display: flex; flex-direction: column; overflow: hidden; }
.board-shell .board { flex: 1; min-height: 0; min-width: 0; }
.grid-resize {
  flex: none;
  height: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  border-top: 1px solid var(--line);
  background: var(--paper);
  cursor: row-resize;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}
.grid-resize-bars { display: flex; flex-direction: column; gap: 2px; }
.grid-resize-bars i {
  display: block;
  width: 26px;
  height: 1px;
  background: var(--line-strong);
}
.grid-resize:hover .grid-resize-bars i,
.grid-resize:focus-visible .grid-resize-bars i,
.board.is-zooming ~ .grid-resize .grid-resize-bars i { background: var(--shell); }
.grid-resize:focus-visible { outline: 2px solid var(--shell); outline-offset: -2px; }
.grid-resize-hint,
.grid-resize-level {
  font-family: var(--face);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .02em;
  color: var(--quiet);
  white-space: nowrap;
}
.grid-resize-level {
  color: var(--shell);
  font-variant-numeric: tabular-nums;
  min-width: 34px;
}
.grid-resize-hint { opacity: 0; transition: opacity .12s; }
.grid-resize:hover .grid-resize-hint,
.grid-resize:focus-visible .grid-resize-hint,
.board.is-zooming ~ .grid-resize .grid-resize-hint { opacity: 1; }
.rule {
  position: absolute;
  left: 0;
  right: 0;
  height: 1px;
  background: transparent;
  z-index: 0;
  pointer-events: none;
}
.hours .track b {
  position: absolute;
  right: 6px;
  transform: translateY(-50%);
  font-family: var(--display);
  font-size: 16px;
  font-weight: 500;
  color: var(--quiet);
}
.hours .track b.mark.half,
.hours .track b.mark.quarter,
.hours .track b.mark.hour {
  font-variant-numeric: tabular-nums;
}
.seg {
  position: absolute;
  left: 8px;
  width: 3px;
  background: repeating-linear-gradient(to bottom, var(--trace, var(--hydro)) 0 5px, transparent 5px 8px);
  transform-origin: top center;
  z-index: 1;
}
.is-published .seg { background: var(--trace, var(--hydro)); }
.seg.is-new { animation: trace-in .42s var(--ease); }
@keyframes trace-in { from { transform: scaleY(.05); } to { transform: scaleY(1); } }
@media (prefers-reduced-motion: reduce) { .seg.is-new { animation: none; } }
.job, .depot, .leave, .stick { position: absolute; z-index: 1; }
.job {
  left: 18px;
  right: 8px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 4px;
  overflow: hidden;
}
.job span, .depot span { display: block; font-size: 12px; color: var(--quiet); }
.job em { display: block; font-size: 12px; }
/* Articles de la commande, dans le bloc : code, quantité, prix de la ligne. */
.job .job-items {
  display: flex;
  flex-direction: column;
  gap: 0;
  margin: 1px 0 0;
  padding: 1px 0 0;
  font-size: 11px;
  line-height: 1.2;
  color: var(--shell);
  overflow: hidden;
}
.job .job-item {
  display: flex;
  gap: 4px;
  align-items: baseline;
  white-space: nowrap;
  overflow: hidden;
  border-top: 1px dotted rgba(197, 208, 214, .8);
}
.job .job-item:first-child { border-top: 0; }
.job .job-item b {
  font-family: var(--display);
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: .02em;
  flex: none;
  max-width: 46%;
  overflow: hidden;
  text-overflow: ellipsis;
}
.job .job-item i {
  font-style: normal;
  flex: none;
  color: var(--quiet);
  font-variant-numeric: tabular-nums;
}
/* Note de la ligne de commande (Odoo) : elle prend la place restante et se coupe proprement. */
.job .job-item-desc {
  flex: 1 1 auto;
  min-width: 0;
  font-style: normal;
  font-size: 10.5px;
  line-height: 1.15;
  color: var(--quiet);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.job .job-item u {
  margin-left: auto;
  text-decoration: none;
  flex: none;
  font-variant-numeric: tabular-nums;
  color: var(--ink);
}
/* Total de la commande, sous les articles du bloc. */
.job .job-total {
  display: block;
  margin: 1px 0 0;
  font-size: 10.5px;
  font-weight: 600;
  text-align: right;
  color: var(--quiet);
  font-variant-numeric: tabular-nums;
}
.job.is-sel { z-index: 3; outline: 2px solid var(--shell); }
.job.is-conflict { border-color: var(--danger); }
.job:hover { border-color: var(--shell); }
.resize {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 10px;
  cursor: ns-resize;
}
.job:hover .resize, .job:focus-within .resize { box-shadow: inset 0 -2px 0 var(--line); }
.depot {
  left: 18px;
  right: 8px;
  background: var(--shell);
  color: var(--shell-ink);
  border-radius: 2px;
  padding: 4px 8px;
  overflow: hidden;
}
.depot strong {
  font-family: var(--display);
  letter-spacing: .06em;
  text-transform: uppercase;
  font-size: 14px;
  font-weight: 600;
}
.depot span { color: #d7e6ef; }
.leave {
  left: 8px;
  right: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px dashed #6d8494;
  color: var(--quiet);
  letter-spacing: .08em;
  text-transform: uppercase;
  font-family: var(--display);
  background: repeating-linear-gradient(135deg, transparent, transparent 6px, rgba(109, 132, 148, .28) 6px, rgba(109, 132, 148, .28) 7px);
}
.note-block {
  position: absolute;
  left: 18px;
  right: 8px;
  z-index: 1;
  background: #fff;
  color: var(--shell);
  border: 1px dashed var(--shell);
  border-radius: 4px;
  padding: 4px 8px;
  overflow: hidden;
  cursor: grab;
}
.note-block strong {
  display: block;
  font-family: var(--display);
  letter-spacing: .04em;
  text-transform: uppercase;
  font-size: 13px;
}
.note-block span {
  display: block;
  font-size: 12px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.paper-note { color: var(--shell); }
.board.is-quiet .col:not(.is-on) .track::after {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(231, 238, 242, .62);
  z-index: 2;
  pointer-events: none;
}
.col.is-hit .name { box-shadow: inset 0 -3px 0 var(--shell); }
/* Colonne d'un chauffeur parti : garde ses blocs passés, en sourdine. */
.col.is-gone { background: repeating-linear-gradient(135deg, transparent, transparent 8px, rgba(109, 132, 148, .08) 8px, rgba(109, 132, 148, .08) 9px); }
.col.is-gone .name { color: var(--quiet); }
.gone-tag {
  margin-left: 5px;
  font-family: var(--face);
  font-size: 9.5px;
  font-weight: 600;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--danger);
  border: 1px solid currentColor;
  border-radius: 3px;
  padding: 0 3px;
  vertical-align: 1px;
}

.week-wrap { overflow: auto; padding: 0 0 32px; }
.week { border-collapse: separate; border-spacing: 0; min-width: 980px; width: 100%; }
.week th, .week td {
  border-bottom: 1px solid var(--line);
  border-right: 1px solid var(--line);
  padding: 8px;
  vertical-align: top;
  text-align: left;
  background: var(--paper);
  font-weight: 400;
}
.week thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  font-family: var(--display);
  text-transform: uppercase;
  letter-spacing: .04em;
  font-size: 16px;
  background: var(--paper-2);
}
.week thead th a { color: inherit; text-decoration: none; display: block; }
.week thead th span { display: block; font-family: var(--face); font-size: 12px; letter-spacing: 0; text-transform: none; color: var(--quiet); }
.week thead th.is-on a { box-shadow: inset 0 -3px 0 var(--shell); }
.week tbody th {
  position: sticky;
  left: 0;
  z-index: 1;
  min-width: 140px;
  font-family: var(--display);
  text-transform: uppercase;
  letter-spacing: .04em;
  background: var(--paper-2);
}
.week tbody th span { display: block; font-family: var(--face); font-size: 12px; letter-spacing: 0; text-transform: none; color: var(--quiet); }
.mini, .mini.depot-mini, .mini.leave-mini, .mini.note-mini {
  display: flex;
  gap: 6px;
  align-items: baseline;
  color: inherit;
  text-decoration: none;
  font-size: 14px;
  margin: 0 0 6px;
}
.mini small { color: var(--quiet); margin-left: auto; }
.depot-mini { color: var(--shell); font-weight: 600; }
.leave-mini { color: var(--quiet); }

.route { max-width: 34rem; margin: 0 auto; padding: 6px 16px 44px; }
.who-line {
  font-family: var(--display);
  font-size: 20px;
  font-weight: 600;
  letter-spacing: .04em;
  text-transform: uppercase;
  margin: 10px 0 8px;
  padding-bottom: 6px;
  border-bottom: 2px solid var(--shell);
  color: var(--shell);
}
.stops { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
/* Un arrêt = un bloc compact : heure, client, adresse, téléphone, produits. */
.stop {
  position: relative;
  padding: 8px 10px 8px 14px;
  border-radius: 4px;
  background: #fff;
  border: 1px solid var(--line);
}
.stop + .stop { margin-top: 4px; }
.stop .trace {
  position: absolute;
  left: 0;
  top: 8px;
  bottom: 8px;
  width: 3px;
  border-radius: 2px;
  background: var(--trace, var(--shell));
}
.stop.hydro { --trace: var(--hydro); }
.stop.pas_hydro { --trace: var(--pas_hydro); }
.stop.itv { --trace: var(--itv); }
.stop h2 { font-size: 20px; margin: 0; line-height: 1.15; }
.stop p { margin: 0; font-size: 14px; line-height: 1.4; }
.stop .when {
  margin: 0 0 1px;
  font-family: var(--display);
  letter-spacing: .04em;
  font-size: 16px;
  color: var(--shell);
  font-variant-numeric: tabular-nums;
}
.stop .tel { color: var(--shell); font-weight: 600; }
.stop .notes {
  margin-top: 3px;
  padding: 3px 6px;
  background: var(--paper-2);
  border-left: 2px solid var(--line);
  border-radius: 0 3px 3px 0;
  font-size: 13px;
}
.stop .billed {
  display: inline-block;
  margin-top: 2px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--billed);
}
/* Articles de la commande côté chauffeur : une ligne par produit, code / quantité / prix. */
.driver-items {
  list-style: none;
  margin: 4px 0 0;
  padding: 4px 6px;
  background: var(--paper-2);
  border-left: 2px solid var(--line);
  border-radius: 0 3px 3px 0;
}
.driver-items li {
  display: flex;
  gap: 6px;
  align-items: baseline;
  font-size: 13px;
  line-height: 1.35;
  padding: 1px 0;
  flex-wrap: wrap;
}
.driver-items li + li { border-top: 1px dotted var(--line); }
.driver-items .item-desc {
  flex: 1 0 100%;
  font-size: 12px;
  line-height: 1.3;
  color: var(--quiet);
  border-left: 2px solid var(--line);
  padding-left: 6px;
  margin-top: 1px;
}
.driver-items .item-code {
  flex: 1;
  min-width: 0;
  font-family: var(--display);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: .02em;
  color: var(--shell);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.driver-items .item-qty {
  flex: none;
  color: var(--quiet);
  font-variant-numeric: tabular-nums;
}
.driver-items .item-price {
  flex: none;
  min-width: 68px;
  text-align: right;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.driver-total {
  margin: 3px 0 0;
  text-align: right;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--quiet);
  font-variant-numeric: tabular-nums;
}
.stop.node,
.stop.leave-stop,
.stop.note-stop { background: var(--paper-2); }
.stop.note-stop { border-style: dashed; }
.empty.big { font-family: var(--display); font-size: 22px; letter-spacing: .04em; text-transform: uppercase; color: var(--quiet); }

/* Téléphone : la tournée du chauffeur reste lisible et les liens cliquables. */
@media (max-width: 560px) {
  .route { padding: 4px 10px 40px; }
  .who-line { font-size: 17px; margin: 8px 0 6px; }
  .stop { padding: 7px 8px 7px 12px; }
  .stop h2 { font-size: 18px; }
  .stop p { font-size: 13.5px; line-height: 1.4; }
  .stop .tel { display: inline-block; padding: 3px 0; font-weight: 600; }
  .sheet-bar { padding: 8px 12px; }
  .paper { padding: 14px 12px; }
  .paper-head { flex-direction: column; align-items: flex-start; gap: 4px; }
  .paper-id { text-align: left; }
  .paper-list h2 { font-size: 16px; }
  .queue { width: auto; }
  .date { font-size: 20px; }
}

.sheet-bar { display: flex; justify-content: space-between; align-items: center; padding: 12px 24px; gap: 12px; }
.sheet-bar a { color: var(--shell); }
.paper {
  max-width: 760px;
  margin: 0 auto 40px;
  background: #fff;
  border: 1px solid var(--line);
  padding: 20px 24px 18px;
}
/* En-tête : société à gauche, date et chauffeur à droite, sur deux lignes serrées. */
.paper-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 20px;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--shell);
}
.paper-agency { margin: 0; }
.paper-agency .agency-name {
  margin: 0;
  font-family: var(--display);
  font-size: 17px;
  font-weight: 600;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--shell);
}
.paper-agency .agency-line { margin: 1px 0 0; font-size: 11.5px; color: var(--quiet); line-height: 1.3; }
.paper-id { text-align: right; }
.paper-kind {
  margin: 0;
  font-family: var(--display);
  font-size: 20px;
  font-weight: 600;
  letter-spacing: .05em;
  text-transform: uppercase;
  line-height: 1.1;
}
.paper-date { margin: 1px 0 0; font-family: var(--display); font-size: 15px; letter-spacing: .03em; color: var(--shell); }
.paper-driver { margin: 2px 0 0; font-size: 13px; font-weight: 600; }
.paper-driver span { font-weight: 400; color: var(--quiet); }
.paper .badge { margin: 4px 0 0; font-size: 10px; }

/* Résumé de la journée : nombre d'arrêts et amplitude horaire. */
.paper-sum {
  margin: 6px 0 0;
  font-size: 11.5px;
  color: var(--quiet);
  font-variant-numeric: tabular-nums;
}

.paper-list { list-style: none; padding: 0; margin: 4px 0 0; }
.paper-list > li {
  position: relative;
  border-bottom: 1px solid var(--line);
  padding: 7px 0 7px 10px;
}
/* Filet de couleur à gauche, comme la trace du planning. */
.paper-list > li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 8px;
  bottom: 8px;
  width: 2px;
  background: var(--trace, transparent);
}
.stop-job.hydro { --trace: var(--hydro); }
.stop-job.pas_hydro { --trace: var(--pas_hydro); }
.stop-job.itv { --trace: var(--itv); }
.stop-depot { --trace: var(--shell); background: #f4f8fa; }
.stop-leave { --trace: #6d8494; }
.stop-job .stop-head {
  display: flex;
  align-items: baseline;
  gap: 8px;
  flex-wrap: wrap;
}
.paper-list .stop-time {
  margin: 0;
  font-family: var(--display);
  font-size: 15px;
  font-weight: 600;
  letter-spacing: .03em;
  color: var(--shell);
  font-variant-numeric: tabular-nums;
}
.paper-list .stop-kind {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 10.5px;
  color: var(--quiet);
}
.paper-list .stop-kind .sw { width: 7px; height: 7px; margin: 0; }
.paper-list .stop-billed {
  font-size: 10.5px;
  font-weight: 600;
  color: var(--billed);
  text-transform: uppercase;
  letter-spacing: .04em;
}
.paper-list h2 {
  font-family: var(--display);
  text-transform: uppercase;
  letter-spacing: .03em;
  line-height: 1.15;
  margin: 1px 0 0;
  font-size: 17px;
}
.paper-list .stop-place { margin: 0; font-size: 12px; line-height: 1.35; }
.paper-list .stop-phone { margin: 0; font-size: 12px; line-height: 1.35; }
.paper-list .stop-phone a { color: var(--shell); text-decoration: none; }
.paper-list .stop-notes {
  margin: 3px 0 0;
  font-size: 11.5px;
  line-height: 1.35;
  padding-left: 6px;
  border-left: 2px solid var(--line);
  color: var(--ink);
}
.paper-list .stop-notes span {
  display: block;
  font-family: var(--face);
  font-size: 9.5px;
  font-weight: 600;
  letter-spacing: .05em;
  text-transform: uppercase;
  color: var(--quiet);
}
.paper-note {
  color: var(--shell);
  padding-top: 3px;
  padding-bottom: 3px;
}
.paper-note .stop-note {
  margin: 0;
  font-size: 11.5px;
  font-style: italic;
}
.paper-note .stop-time { font-size: 11px; font-weight: 500; }
.paper .badge { color: var(--shell); border-color: var(--shell); display: inline-block; }
.paper-foot {
  margin-top: 8px;
  padding-top: 6px;
  border-top: 1px solid var(--line);
  font-size: 10px;
  color: var(--quiet);
}
.paper-foot p { margin: 0; }
.sheet-type { font-weight: 600; color: var(--shell); }
.sheet-products {
  width: 100%;
  border-collapse: collapse;
  margin: 3px 0 0;
  font-size: 11.5px;
}
.sheet-products th,
.sheet-products td {
  text-align: left;
  padding: 1px 6px 1px 0;
  border-bottom: 1px dotted var(--line);
  vertical-align: baseline;
}
.sheet-products tr:last-child td { border-bottom: 0; }
.sheet-products th {
  font-family: var(--face);
  font-size: 9.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--quiet);
}
.sheet-products td:nth-child(2),
.sheet-products td:nth-child(3),
.sheet-products th:nth-child(2),
.sheet-products th:nth-child(3) { text-align: right; font-variant-numeric: tabular-nums; }
.sheet-products .sheet-sum td {
  padding-top: 2px;
  border-bottom: 0;
  font-weight: 600;
}
/* Description d'une ligne de commande, sous son article. */
.sheet-products .sheet-desc td {
  padding: 0 0 2px;
  border-bottom: 1px dotted var(--line);
  font-size: 9.5px;
  line-height: 1.25;
  color: var(--quiet);
  text-align: left;
}
.sheet-total { margin: 2px 0 0; font-weight: 600; }
.sheet-billed { color: var(--billed); font-weight: 600; }

/* ---------- Page de connexion (production) ---------- */
body.gate {
  display: grid;
  place-items: center;
  min-height: 100%;
  padding: 24px 16px;
  /* Fond de plan de réseaux : fines lignes techniques, discrètes. */
  background-color: var(--paper);
  background-image:
    linear-gradient(to right, rgba(22, 62, 92, .045) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(22, 62, 92, .045) 1px, transparent 1px);
  background-size: 28px 28px;
}
.gate-card {
  width: min(392px, 100%);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: 0 18px 44px rgba(22, 62, 92, .13);
  padding: 26px 28px 20px;
}
.gate-brand { text-align: center; margin: 0 0 18px; }
.gate-mark {
  margin: 0 auto 6px;
  width: 52px;
  height: 52px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: var(--shell);
  color: var(--shell-ink);
}
.gate-mark svg { display: block; }
.gate-agency {
  margin: 0;
  font-family: var(--display);
  font-size: 30px;
  font-weight: 600;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--shell);
  line-height: 1;
}
.gate-tagline {
  margin: 3px 0 0;
  font-size: 11px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--quiet);
}
.gate-title {
  margin: 0 0 14px;
  font-family: var(--display);
  font-size: 17px;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--quiet);
  padding-bottom: 7px;
  border-bottom: 1px solid var(--line);
}
.gate-form { display: flex; flex-direction: column; gap: 12px; }
.gate-field { margin: 0; display: flex; flex-direction: column; gap: 5px; font-size: 13px; }
.gate-field > span:first-child {
  font-family: var(--display);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .07em;
  text-transform: uppercase;
  color: var(--quiet);
}
.gate-field input {
  width: 100%;
  padding: 11px 12px;
  font-size: 16px; /* 16 px minimum : évite le zoom automatique sur iPhone */
  border-radius: 6px;
  border: 1px solid var(--line-strong);
}
.gate-field input:focus {
  outline: none;
  border-color: var(--shell);
  box-shadow: 0 0 0 3px rgba(22, 62, 92, .14);
}
.gate-pass { position: relative; display: block; }
.gate-pass input { padding-right: 62px; }
.gate-eye {
  position: absolute;
  right: 4px;
  top: 50%;
  transform: translateY(-50%);
  padding: 5px 9px;
  background: transparent;
  color: var(--shell);
  border: 0;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 600;
}
.gate-eye:hover { background: var(--paper-2); }
.gate-submit {
  margin-top: 4px;
  width: 100%;
  padding: 12px 14px;
  font-family: var(--display);
  font-size: 17px;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
  background: var(--shell);
  color: var(--shell-ink);
  border: 0;
  border-radius: 6px;
}
.gate-submit:hover { background: #10304a; }
.gate-submit:active { transform: translateY(1px); }
.gate-alert {
  margin: 0 0 12px;
  padding: 9px 11px;
  border-radius: 5px;
  background: #f8e8e6;
  border-left: 3px solid var(--danger);
  color: var(--danger);
  font-size: 13px;
  line-height: 1.35;
}
.gate-note {
  margin: 0 0 12px;
  padding: 9px 11px;
  border-radius: 5px;
  background: #e5f2ea;
  border-left: 3px solid var(--billed);
  color: #145c34;
  font-size: 13px;
}
.gate-foot {
  margin: 18px -28px -20px;
  padding: 10px 28px;
  border-top: 1px solid var(--line);
  background: var(--paper-2);
  border-radius: 0 0 10px 10px;
}
.gate-foot p { margin: 0; font-size: 11px; color: var(--quiet); text-align: center; }
@media (max-width: 420px) {
  .gate-card { padding: 22px 18px 18px; border-radius: 0; box-shadow: none; }
  .gate-foot { margin: 16px -18px -18px; padding: 9px 18px; border-radius: 0; }
  body.gate { padding: 0; align-items: start; }
}

.gate-main, .settings-main { max-width: 40rem; margin: 0 auto; padding: 28px 24px 64px; }
.gate-main { max-width: 32rem; }
.gate-main h1, .settings-main h1 { font-size: 48px; font-weight: 600; margin: 0 0 8px; }
.lead { margin-top: 0; }
.stack button, .row-form button { margin-top: 8px; }
.settings-main section { border-top: 1px solid var(--line); padding: 8px 0 18px; }
.settings-main h2 { font-size: 26px; margin: 12px 0 8px; }
/* Comptes : chaque personne se modifie sur sa propre ligne. */
.users .account {
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 8px 10px;
  margin: 0 0 8px;
  background: #fff;
}
.users .account.is-me { border-color: var(--shell); }
.users .account-name { margin: 0; font-weight: 600; }
/* Identifiant de connexion : c'est l'information la plus utile de la ligne. */
.users .account-login {
  margin: 1px 0 0;
  font-size: 12.5px;
  color: var(--ink);
  overflow-wrap: anywhere;
}
.users .account-login b {
  font-family: var(--display);
  font-size: 15px;
  letter-spacing: .02em;
  color: var(--shell);
}
.users .account-login .or { color: var(--quiet); font-size: 11px; }
.users .account header .meta { margin: 0 0 6px; font-size: 13px; }
.users .account-form {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 10px;
  align-items: flex-end;
}
.users .account-form label { margin: 0; font-size: 12px; }
.users .account-form select { padding: 4px 6px; font-size: 13px; }
.users .account-form button { padding: 5px 10px; font-size: 13px; }
.users .account-form.pass { margin-top: 6px; }
.users .account-form.pass input { padding: 4px 6px; font-size: 13px; }
.users .account-del { margin: 4px 0 0; }
.users .account-del button { font-size: 12px; color: var(--danger); background: none; padding: 0; }
.places { list-style: none; padding: 0; margin: 0 0 12px; }
.places li { display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid var(--line); gap: 12px; }
.row-form { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; }
.row-form label { margin: 0; }
/* Personnel de la grille : une ligne par personne, avec son départ à droite. */
.people-list { list-style: none; padding: 0; margin: 0 0 12px; }
.person-row {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 12px;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
  padding: 5px 0;
}
.person-row .person-who { min-width: 0; flex: 1; }
.person-name { margin: 0; font-weight: 600; font-size: 14px; }
.person-row .meta { margin: 0; font-size: 12px; }
.person-row form { margin: 0; }
.person-row button.text { font-size: 12px; color: var(--danger); padding: 4px 0; }
.person-row.is-gone { opacity: .62; }
.person-row.is-gone .person-name { color: var(--quiet); }

@media (max-width: 1280px) {
  .top { flex-wrap: wrap; }
}
@media (max-width: 860px) {
  .top-bar { flex-wrap: wrap; gap: 8px 10px; padding: 8px 12px; }
  .brand-text { font-size: 17px; }
  .brand-mark { width: 28px; height: 28px; font-size: 17px; }
  .date { font-size: 20px; white-space: normal; }
  .datebar { order: 5; flex: 0 0 100%; width: 100%; min-width: 0; display: grid; grid-template-columns: 32px minmax(0, 1fr) 32px; align-items: center; gap: 4px; }
  .datebar .step { width: 32px; height: 32px; }
  .datebar .date { min-width: 0; text-align: center; }
  .top .grow, .account-links { display: none; }
  .account { margin-left: auto; }
  .top-tools { flex-wrap: wrap; padding: 7px 12px; }
  .searchzone { flex: 1 1 100%; }
  .top .search { max-width: none; flex: 1 1 auto; }
  .past-toggle { padding: 6px 9px; font-size: 11.5px; }
  .top .publish { margin-left: 0; width: 100%; }
  .top .publish .publish-main { flex: 1; }
  .top .publish .pub { width: 100%; }
  .tabs a { padding: 6px 10px; font-size: 12.5px; }
  .main { flex-direction: column; overflow: auto; }
  .queue { width: auto; max-height: none; border-right: 0; border-bottom: 1px solid var(--line); }
  .board-shell { min-height: 70vh; }
  .track { min-height: 0; }
}
/* Panneau « à régler » : ce qui cloche dans la journée, repliable, toujours visible. */
.issues {
  margin: 0 24px 8px;
  border: 1px solid var(--line);
  border-left: 3px solid var(--line);
  border-radius: 4px;
  background: #fff;
}
.issues.is-clean {
  display: flex;
  gap: 10px;
  align-items: baseline;
  padding: 4px 10px;
  font-size: 12px;
  border-style: dashed;
}
.issues.has-bad { border-left-color: var(--danger); }
.issues.has-warn { border-left-color: #a8641f; }
.issues > summary.issues-head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 10px;
  cursor: pointer;
  list-style: none;
}
.issues > summary.issues-head::-webkit-details-marker { display: none; }
.issues-title {
  font-family: var(--display);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: .05em;
  text-transform: uppercase;
  color: var(--quiet);
}
.issues-count {
  flex: none;
  min-width: 18px;
  text-align: center;
  padding: 0 5px;
  border-radius: 9px;
  font-size: 11px;
  font-weight: 600;
  color: #fff;
  font-variant-numeric: tabular-nums;
}
.issues-count.is-bad { background: var(--danger); }
.issues-count.is-warn { background: #a8641f; }
.issues-ok { font-size: 12px; color: var(--billed); font-weight: 600; }
.issues-list { list-style: none; margin: 0; padding: 0 10px 8px; }
.issue {
  display: flex;
  flex-wrap: wrap;
  gap: 1px 8px;
  align-items: baseline;
  padding: 3px 0;
  border-top: 1px solid rgba(197, 208, 214, .6);
}
.issue-main {
  display: flex;
  gap: 6px;
  align-items: baseline;
  color: inherit;
  text-decoration: none;
  font-size: 13px;
  font-weight: 600;
  min-width: 0;
}
a.issue-main:hover .issue-text { border-bottom: 1px solid currentColor; }
.issue-dot { flex: none; width: 6px; height: 6px; border-radius: 50%; background: var(--quiet); }
.issue.is-bad .issue-dot { background: var(--danger); }
.issue.is-warn .issue-dot { background: #a8641f; }
.issue.is-info .issue-dot { background: var(--shell); }
.issue.is-bad .issue-text { color: var(--danger); }
.issue-meta { font-size: 11.5px; color: var(--quiet); font-variant-numeric: tabular-nums; }

/* Trajet entre deux arrêts, côté chauffeur : la durée utile sur la route. */
.stops .drive {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 2px 0 2px 6px;
  list-style: none;
}
.drive-line {
  width: 3px;
  align-self: stretch;
  min-height: 12px;
  margin-left: 6px;
  background: repeating-linear-gradient(to bottom, var(--line-strong) 0 4px, transparent 4px 7px);
}
.drive-text { font-size: 12px; color: var(--quiet); font-weight: 600; }
.drive.is-tight .drive-text { color: var(--danger); }
.drive.is-tight .drive-line { background: repeating-linear-gradient(to bottom, var(--danger) 0 4px, transparent 4px 7px); }
/* Boutons d'itinéraire : gros, pour un doigt sur téléphone. */
.driver-nav { display: flex; gap: 6px; margin: 4px 0 0; }
.nav-btn {
  flex: 1;
  text-align: center;
  padding: 7px 10px;
  border-radius: 4px;
  background: var(--shell);
  color: var(--shell-ink);
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
}
.nav-btn.is-alt { background: #fff; color: var(--shell); box-shadow: inset 0 0 0 1px var(--shell); }
.nav-btn:active { opacity: .8; }

/* Page historique. */
.history-main { max-width: 52rem; margin: 0 auto; padding: 20px 24px 64px; }
.history-head h1 {
  font-family: var(--display);
  font-size: 40px;
  font-weight: 600;
  letter-spacing: .03em;
  text-transform: uppercase;
  margin: 0 0 4px;
  color: var(--shell);
}
.history-day { margin: 0 0 18px; }
.history-day h2 {
  font-family: var(--display);
  font-size: 17px;
  font-weight: 600;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--shell);
  margin: 0 0 4px;
  padding-bottom: 3px;
  border-bottom: 1px solid var(--line);
}
.history-list { list-style: none; margin: 0; padding: 0; }
.history-row {
  display: grid;
  grid-template-columns: 46px 150px minmax(0, 1fr);
  gap: 8px;
  align-items: baseline;
  padding: 4px 0;
  border-bottom: 1px solid rgba(197, 208, 214, .5);
  font-size: 13px;
}
.history-time { font-family: var(--display); font-size: 14px; color: var(--shell); font-variant-numeric: tabular-nums; }
.history-who { font-size: 11.5px; color: var(--quiet); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.history-text { min-width: 0; }
.quiet-link { font-size: 12px; color: var(--shell); }
@media (max-width: 700px) {
  .history-row { grid-template-columns: 42px minmax(0, 1fr); }
  .history-who { grid-column: 2; grid-row: 2; }
  .history-text { grid-column: 2; }
}

/* Page « à facturer ». */
.billing-main { max-width: 62rem; margin: 0 auto; padding: 20px 24px 64px; }
.billing-head { margin-bottom: 18px; }
.billing-head h1 {
  font-family: var(--display);
  font-size: 40px;
  font-weight: 600;
  letter-spacing: .03em;
  text-transform: uppercase;
  margin: 0 0 4px;
  color: var(--shell);
}
.billing-filter { display: flex; gap: 10px; align-items: flex-end; margin-top: 10px; }
.billing-filter label { margin: 0; }
.billing-day { margin: 0 0 20px; }
.billing-day h2 {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  font-family: var(--display);
  font-size: 19px;
  font-weight: 600;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--shell);
  margin: 0 0 6px;
  padding-bottom: 3px;
  border-bottom: 1px solid var(--line);
}
.billing-day h2 span { font-family: var(--face); font-size: 12.5px; color: var(--quiet); text-transform: none; letter-spacing: 0; }
.billing-list { list-style: none; margin: 0; padding: 0; }
.billing-row {
  display: grid;
  grid-template-columns: 58px minmax(0, 2fr) 90px 110px 100px minmax(0, 1.4fr);
  gap: 8px;
  align-items: baseline;
  padding: 5px 0;
  border-bottom: 1px solid rgba(197, 208, 214, .6);
  font-size: 13px;
}
.billing-row.is-unplaced { background: rgba(168, 100, 31, .05); }
.billing-time { font-family: var(--display); font-size: 14px; color: var(--shell); font-variant-numeric: tabular-nums; }
.billing-client { min-width: 0; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.billing-who, .billing-status { color: var(--quiet); font-size: 12px; }
.billing-amount { text-align: right; font-weight: 600; font-variant-numeric: tabular-nums; }
.billing-actions { font-size: 11.5px; text-align: right; }
.billing-actions a { color: var(--shell); }
@media (max-width: 860px) {
  .billing-main { padding: 12px 14px 48px; }
  .billing-row { grid-template-columns: 46px minmax(0, 1fr) 84px; row-gap: 2px; }
  .billing-who { grid-column: 2; }
  .billing-status { display: none; }
  .billing-actions { grid-column: 2 / -1; text-align: left; }
}

/* Téléphone : le planning passe en liste verticale, sans grille à faire défiler. */
.mobile-plan { display: none; }
@media (max-width: 860px) {
  .board-shell { display: none; }
  .mobile-plan {
    display: block;
    flex: 1;
    min-width: 0;
    /* La journée passe avant la file : c'est ce qu'on vient voir sur téléphone. */
    order: -1;
    overflow-y: auto;
    padding: 8px 12px 32px;
  }
}
.mperson { margin: 0 0 14px; }
.mperson-name {
  font-family: var(--display);
  font-size: 17px;
  font-weight: 600;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--shell);
  margin: 0 0 4px;
  padding-bottom: 2px;
  border-bottom: 2px solid var(--shell);
}
.mlist { list-style: none; margin: 0; padding: 0; }
.mrow { display: flex; align-items: stretch; border-bottom: 1px solid var(--line); }
.mrow-link, .mrow {
  display: flex;
  gap: 8px;
  align-items: baseline;
  width: 100%;
  padding: 6px 2px;
  color: inherit;
  text-decoration: none;
}
.mrow-link { display: flex; }
.mrow-time {
  flex: none;
  width: 74px;
  font-family: var(--display);
  font-size: 14px;
  font-weight: 600;
  color: var(--shell);
  font-variant-numeric: tabular-nums;
}
.mrow-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.mrow-body b { font-size: 13.5px; font-weight: 600; line-height: 1.2; }
.mrow-body i {
  font-style: normal;
  font-size: 11.5px;
  color: var(--quiet);
  line-height: 1.25;
}
.mrow-body .mrow-items { font-size: 11px; color: var(--shell); }
.mrow-price {
  flex: none;
  font-size: 12px;
  font-weight: 600;
  color: var(--quiet);
  font-variant-numeric: tabular-nums;
}
.mrow.is-node { color: var(--quiet); }
.mrow.is-node .mrow-body b { font-weight: 600; }
.mrow.is-billed { box-shadow: inset 3px 0 0 var(--billed); padding-left: 6px; }

.queue h3.group {
  font-family: var(--display);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--quiet);
  margin: 8px 0 3px;
}
/* Catégorie repliable : la flèche pivote, le compteur reste visible. */
.queue details.group-block { margin: 0 0 2px; }
.queue details.group-block > summary.group {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 8px 0 3px;
  padding: 2px 0;
  cursor: pointer;
  list-style: none;
  color: var(--quiet);
}
.queue details.group-block > summary.group::-webkit-details-marker { display: none; }
.queue details.group-block > summary.group .group-arrow {
  flex: none;
  width: 0;
  height: 0;
  border-left: 5px solid currentColor;
  border-top: 4px solid transparent;
  border-bottom: 4px solid transparent;
  transition: transform .12s ease;
}
.queue details.group-block[open] > summary.group .group-arrow { transform: rotate(90deg); }
.queue details.group-block > summary.group .group-name { flex: 1; }
.queue details.group-block > summary.group .group-count {
  flex: none;
  font-family: var(--face);
  font-size: 12px;
  color: var(--quiet);
  font-variant-numeric: tabular-nums;
}
.queue details.group-block > summary.group:hover { color: var(--shell); }
.queue details.undated, .queue details.manual {
  margin: 10px 0 8px;
  border-top: 1px solid var(--line);
  padding-top: 8px;
}

/* Blocs d'un chauffeur parti : bien visibles, en tête de la file. */
.queue details.parked {
  margin: 8px 0 10px;
  border: 2px solid var(--danger);
  border-radius: 5px;
  background: #fff8f6;
  overflow: hidden;
}
.queue details.parked > summary.parked-summary {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 7px 8px;
  background: var(--danger);
  color: #fff;
  cursor: pointer;
  list-style: none;
}
.queue details.parked > summary.parked-summary::-webkit-details-marker { display: none; }
.parked-arrow {
  flex: none;
  width: 0;
  height: 0;
  border-left: 5px solid currentColor;
  border-top: 4px solid transparent;
  border-bottom: 4px solid transparent;
  transition: transform .12s ease;
}
.queue details.parked[open] > summary.parked-summary .parked-arrow { transform: rotate(90deg); }
.parked-title {
  flex: 1;
  font-family: var(--display);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: .06em;
  text-transform: uppercase;
}
.parked-count {
  flex: none;
  min-width: 20px;
  padding: 0 6px;
  border-radius: 10px;
  background: #fff;
  color: var(--danger);
  font-size: 11.5px;
  font-weight: 600;
  text-align: center;
  font-variant-numeric: tabular-nums;
}
.parked-intro {
  margin: 0;
  padding: 7px 8px 0;
  font-size: 11.5px;
  line-height: 1.35;
  color: var(--quiet);
}
.parked-group { padding: 3px 8px 8px; }
.parked-head { margin: 4px 0 0; }
.parked-head h3 {
  margin: 0;
  font-family: var(--display);
  font-size: 15px;
  font-weight: 600;
  letter-spacing: .03em;
  text-transform: uppercase;
  color: var(--ink);
}
.parked-head h3 span { color: var(--danger); }
/* Réaffecter tout le chauffeur, puis chaque bloc individuellement. */
.parked-all { display: flex; gap: 4px; margin: 3px 0 2px; }
.parked-all select { flex: 1; min-width: 0; padding: 3px 5px; font-size: 12px; border-radius: 4px; }
.parked-btn { flex: none; padding: 4px 8px; font-size: 11.5px; border-radius: 4px; }
.parked-day {
  margin: 6px 0 1px;
  font-family: var(--display);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--danger);
}
.parked-list { list-style: none; margin: 0; padding: 0; }
.parked-row {
  display: flex;
  flex-wrap: wrap;
  gap: 2px 6px;
  align-items: baseline;
  justify-content: space-between;
  padding: 3px 0;
  border-bottom: 1px dashed var(--line);
}
.parked-what { flex: 1 1 150px; min-width: 0; }
.parked-when { margin: 0; font-size: 11.5px; color: var(--quiet); font-variant-numeric: tabular-nums; }
.parked-when b { color: var(--ink); font-weight: 600; }
.parked-place {
  margin: 0;
  font-size: 11px;
  color: var(--quiet);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.parked-form { flex: none; display: flex; gap: 3px; align-items: center; }
.parked-form select { padding: 2px 4px; font-size: 11px; border-radius: 4px; max-width: 108px; }
.mini-btn { padding: 2px 7px; font-size: 11px; border-radius: 4px; background: var(--shell); }
.queue details.undated > summary, .queue details.manual > summary {
  font-family: var(--display);
  font-size: 13px;
  letter-spacing: .05em;
  text-transform: uppercase;
  color: var(--shell);
  margin-bottom: 6px;
}
.queue details.manual form { display: flex; flex-direction: column; }
.queue details.manual button { align-self: flex-start; }
.queue ul.weeks {
  list-style: none;
  margin: 6px 0 0;
  padding: 0;
}
.queue ul.weeks li {
  margin: 0 0 4px;
  font-size: 13px;
}
.queue ul.weeks a {
  color: var(--shell);
  font-weight: 600;
  text-decoration: none;
  border-bottom: 1px solid var(--line);
}
.queue ul.weeks a:hover { border-bottom-color: var(--shell); }
.tag {
  display: inline-block;
  font-family: var(--face);
  font-size: 11px;
  letter-spacing: .04em;
  text-transform: uppercase;
  border: 1px solid var(--quiet);
  color: var(--quiet);
  border-radius: 3px;
  padding: 0 5px;
  vertical-align: 2px;
}

input[type="time"] {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 8px 10px;
  color: var(--ink);
  font: inherit;
}
.toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 20;
  margin: 0;
  max-width: min(420px, calc(100vw - 36px));
  padding: 12px 16px;
  border-radius: 6px;
  background: var(--shell);
  color: var(--shell-ink);
  font-size: 15px;
  box-shadow: 0 6px 18px rgba(22, 62, 92, .22);
  transition: opacity .25s ease;
}
.toast.err { background: var(--danger); }
.toast.is-out { opacity: 0; pointer-events: none; }

/* Voile de chargement : discret, jamais bloquant pour la lecture, mais clairement visible. */
.busy {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: grid;
  place-items: center;
  pointer-events: auto;
  background: transparent;
}
.busy[hidden] { display: none; }
.busy-box {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 18px;
  border-radius: 8px;
  background: var(--shell);
  color: var(--shell-ink);
  font-size: 14px;
  font-weight: 600;
  box-shadow: 0 10px 28px rgba(22, 62, 92, .28);
}
.spinner {
  width: 18px;
  height: 18px;
  flex: none;
  border-radius: 50%;
  border: 2px solid rgba(244, 248, 250, .35);
  border-top-color: var(--shell-ink);
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
body.is-busy { cursor: progress; }
body.is-busy .busy-box { animation: busy-in .16s ease-out; }
@keyframes busy-in { from { transform: translateY(4px); opacity: .6; } to { transform: none; opacity: 1; } }
@media (prefers-reduced-motion: reduce) {
  .spinner { animation-duration: 1.6s; }
  body.is-busy .busy-box { animation: none; }
}
.job.is-dragging { opacity: .42; }
.job[data-pending] { opacity: .7; }

.job-pop {
  position: fixed;
  z-index: 30;
  display: flex;
  flex-direction: column;
  width: min(340px, calc(100vw - 16px));
  /* Jamais plus haut que l'écran : la barre reste en haut, le contenu défile dessous. */
  max-height: calc(100vh - 16px);
  overflow: hidden;
  overscroll-behavior: contain;
  background: #fff;
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 6px;
  box-shadow: 2px 6px 14px rgba(22, 62, 92, .16);
  padding: 0;
  font-size: 12px;
  line-height: 1.3;
}
.job-pop[hidden] { display: none; }
/* Barre du haut : toujours visible, quelle que soit la longueur du contenu. */
.job-pop .pop-bar {
  flex: none;
  display: flex;
  justify-content: flex-end;
  padding: 3px 6px;
  border-bottom: 1px solid var(--line);
  background: #fff;
  border-radius: 6px 6px 0 0;
}
.job-pop .pop-close {
  flex: none;
  background: transparent;
  color: var(--shell);
  font-size: 12px;
  padding: 2px 4px;
}
/* Corps défilant : c'est ici que la molette agit, le bas de la popup reste atteignable. */
.job-pop .pop-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 6px 10px 10px;
  scrollbar-gutter: stable;
  /* Ombre douce en haut et en bas : on voit qu'il reste du contenu à faire défiler. */
  background:
    linear-gradient(#fff 30%, rgba(255, 255, 255, 0)) top / 100% 14px no-repeat local,
    linear-gradient(rgba(255, 255, 255, 0), #fff 70%) bottom / 100% 14px no-repeat local,
    radial-gradient(farthest-side at 50% 0, rgba(22, 62, 92, .16), transparent) top / 100% 7px no-repeat scroll,
    radial-gradient(farthest-side at 50% 100%, rgba(22, 62, 92, .16), transparent) bottom / 100% 7px no-repeat scroll;
}
/* Barre de défilement visible : sans elle, on ne devine pas qu'il faut descendre. */
.job-pop .pop-body::-webkit-scrollbar { width: 9px; }
.job-pop .pop-body::-webkit-scrollbar-track { background: var(--paper-2); }
.job-pop .pop-body::-webkit-scrollbar-thumb {
  background: var(--shell);
  border-radius: 0;
  border: 2px solid var(--paper-2);
}
.job-pop .pop-body { scrollbar-width: thin; scrollbar-color: var(--shell) var(--paper-2); }
.job-pop .pop-body > .detail { padding: 0; margin: 0; }
.job .job-note {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12px;
  color: var(--shell);
}
.addon { margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--line); }
.addon-title { margin: 0 0 2px; font-weight: 600; color: var(--shell); }
.addon textarea {
  width: 100%;
  min-height: 48px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 6px 8px;
  font: inherit;
  color: var(--ink);
  resize: vertical;
}
.addon-btn, .job-pop .addon-btn, .queue .addon-btn {
  background: var(--shell);
  color: var(--shell-ink);
  border: 0;
  border-radius: 6px;
  padding: 8px 12px;
  font-size: 13px;
  font-weight: 600;
}
.depot { cursor: grab; }
.job-pop .detail {
  border: 0;
  margin: 0;
  padding: 0;
  background: transparent;
}
.job-pop .detail h2 {
  font-family: var(--face);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0;
  text-transform: none;
  line-height: 1.25;
  margin: 0 52px 2px 0;
}
.job-pop p,
.job-pop li,
.job-pop .meta,
.job-pop .price,
.job-pop .notes,
.job-pop .billed {
  margin: 0 0 2px;
  font-size: 12px;
}
.job-pop .products { margin: 2px 0; padding-left: 16px; }
.job-pop .products li { margin: 0 0 3px; line-height: 1.3; }
.job-pop .products li b {
  font-family: var(--display);
  font-size: 14px;
  font-weight: 600;
  color: var(--shell);
}
.job-pop .products .line-price {
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  margin-left: 4px;
}
.job-pop .products .line-desc {
  display: block;
  font-size: 11.5px;
  line-height: 1.25;
  color: var(--quiet);
  padding-left: 2px;
  border-left: 2px solid var(--line);
  margin: 1px 0 0 1px;
  padding-left: 6px;
}
.job-pop button,
.job-pop button.text { font-size: 12px; padding: 2px 0; }

.job .leg,
.depot .leg,
.note-block .leg {
  display: block;
  margin: 0 0 2px;
  font-size: 11px;
  font-weight: 600;
  line-height: 1.2;
  color: var(--shell);
}
.depot .leg { color: #f4f8fa; }
.job .leg.is-tight { color: var(--danger); }
.depot .leg.is-tight { color: #ffd37a; }
.advice { margin: 4px 0 0; padding-left: 16px; }
.advice li { margin: 0 0 2px; }
.advice .ok { color: var(--billed); }
.advice .no { color: var(--danger); }

/* Glisser-déposer : la carte est un bloc, jamais un lien. */
.job, .card[draggable] { cursor: grab; user-select: none; -webkit-user-select: none; }
.job {
  padding: 2px 6px 5px;
  overflow: hidden;
  line-height: 1.15;
}
/* Bloc d'une heure ou moins : client, heure, adresse et articles. Le téléphone attend. */
.job.is-compact .job-phone,
.job.is-compact .job-note { display: none; }
/* Bloc très court (30 min) : client, heure et adresse. */
.job.is-tiny .job-items { display: none; }
/* En-tête : client à gauche, heure alignée à droite, sur une seule ligne. */
.job .job-head {
  display: flex;
  gap: 5px;
  align-items: baseline;
  justify-content: space-between;
  margin: 0 0 1px;
  line-height: 1.1;
}
.job .job-head .job-when {
  flex: none;
  font-size: 10.5px;
  font-weight: 600;
  color: var(--shell);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.job strong {
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
  font-size: 12px;
  line-height: 1.1;
  min-width: 0;
}
/* L'heure est la première information : elle reste lisible même sur un bloc de 15 minutes. */
.job .job-when { color: var(--ink); font-weight: 600; font-variant-numeric: tabular-nums; }
.job .job-where, .job .job-phone, .job .job-when {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 11.5px;
}
.queue, .detail, .detail h2, .card .pick { overflow-wrap: anywhere; }
.queue { overflow-x: hidden; }
.job:active, .card[draggable]:active { cursor: grabbing; }.job.is-dragging, .card.is-dragging {
  opacity: .42;
  outline: 1px dashed var(--shell);
  outline-offset: 2px;
}
.card .pick { margin: 0; font-size: 13.5px; display: flex; gap: 6px; align-items: baseline; line-height: 1.2; }
.card .pick .client { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.card .pick .sum {
  flex: none;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--quiet);
  font-variant-numeric: tabular-nums;
}
.card .when {
  display: flex;
  gap: 5px;
  align-items: baseline;
  margin: 0;
  font-size: 11.5px;
  color: var(--quiet);
  font-variant-numeric: tabular-nums;
  line-height: 1.2;
}
.card .when .day { flex: none; font-weight: 600; color: var(--shell); }
.card .when span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* Adresse complète : information essentielle pour choisir la commande. */
.card .where {
  margin: 0;
  font-size: 11.5px;
  line-height: 1.25;
  color: var(--ink);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
/* Le détail et le formulaire restent repliés : la liste redevient une liste. */
.card details.hand { margin: 1px 0 0; }
.card details.hand > summary {
  display: flex;
  gap: 8px;
  align-items: baseline;
  list-style: none;
  cursor: pointer;
  font-size: 10.5px;
  color: var(--quiet);
  line-height: 1.2;
}
.card details.hand > summary::-webkit-details-marker { display: none; }
.card details.hand > summary .codes {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.card details.hand > summary .hand-open {
  flex: none;
  font-weight: 600;
  color: var(--shell);
  border-bottom: 1px solid var(--line);
}
.card details.hand > summary .hand-open::before {
  content: "▶ ";
  font-size: 8px;
  vertical-align: 1px;
}
.card details.hand > summary:hover .hand-open { border-bottom-color: var(--shell); }
.card details.hand[open] > summary .hand-open { color: var(--quiet); }
.card .hand-body { padding: 6px 0 2px; }
.card .hand-body form { display: flex; flex-direction: column; gap: 2px; }
.card .hand-body label { margin: 2px 0; font-size: 12px; }
.card .hand-body button { align-self: flex-start; margin-top: 4px; }
/* Articles d'une commande en attente, quand on déplie « Poser ». */
.card .card-items {
  list-style: none;
  margin: 3px 0 2px;
  padding: 3px 5px;
  background: var(--paper-2);
  border-left: 2px solid var(--line);
  border-radius: 0 3px 3px 0;
}
.card .card-items li {
  display: flex;
  gap: 5px;
  align-items: baseline;
  font-size: 12px;
  line-height: 1.3;
  flex-wrap: wrap;
}
.card .card-item-desc {
  flex: 1 0 100%;
  font-size: 11px;
  line-height: 1.25;
  color: var(--quiet);
  border-left: 2px solid var(--line);
  padding-left: 5px;
}
.card .card-items li b {
  font-family: var(--display);
  font-size: 12.5px;
  font-weight: 600;
  color: var(--shell);
  flex: none;
  max-width: 58%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.card .card-items li i { font-style: normal; color: var(--quiet); flex: none; }
.card .card-items li u {
  margin-left: auto;
  text-decoration: none;
  flex: none;
  font-variant-numeric: tabular-nums;
  color: var(--ink);
}
.card .card-total {
  margin: 2px 0 4px;
  font-size: 11.5px;
  font-weight: 600;
  text-align: right;
  color: var(--quiet);
  font-variant-numeric: tabular-nums;
}

/* Panneau d'une personne : compact, les trois ajouts en volets côte à côte. */
.person-panel { padding: 8px 10px; margin-bottom: 8px; }
.panel-head h2 { font-size: 20px; margin: 0; line-height: 1.1; }
.panel-head .meta { margin: 0 0 1px; font-size: 12px; }
.panel-head .actions { margin: 0 0 6px; font-size: 11.5px; }
.panel-actions { display: flex; flex-wrap: wrap; gap: 4px; }
.panel-form {
  flex: 1 1 auto;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--paper-2);
}
.panel-form[open] { flex-basis: 100%; background: #fff; }
.panel-form > summary {
  font-family: var(--display);
  font-size: 13px;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--shell);
  padding: 3px 8px;
  list-style: none;
  text-align: center;
  white-space: nowrap;
}
.panel-form > summary::-webkit-details-marker { display: none; }
.panel-form > summary::before {
  content: "+";
  display: inline-block;
  margin-right: 4px;
  font-family: var(--face);
  font-weight: 600;
}
.panel-form[open] > summary {
  border-bottom: 1px solid var(--line);
  text-align: left;
}
.panel-form[open] > summary::before { content: "–"; }
.panel-form form { padding: 2px 8px 8px; }
.panel-form label { margin: 4px 0; font-size: 13px; }
.panel-form button { padding: 6px 10px; font-size: 13px; }
.card.is-billed { position: relative; padding-right: 20px; }
.card.is-billed::after {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  width: 0;
  height: 0;
  border-top: 12px solid var(--billed);
  border-left: 12px solid transparent;
}
.track.is-over { box-shadow: inset 0 0 0 1px rgba(22, 62, 92, .25); }
.drop-preview {
  position: absolute;
  left: 18px;
  right: 8px;
  z-index: 4;
  pointer-events: none;
  border: 2px dashed var(--shell);
  border-radius: 4px;
  background: rgba(22, 62, 92, .07);
  color: var(--shell);
  font-family: var(--display);
  font-size: 14px;
  letter-spacing: .04em;
  padding: 4px 8px;
  overflow: hidden;
}

/* Coin facturé : le coin haut-droit prend la couleur quand Odoo dit « entièrement facturé ». */
.job.is-billed { padding-right: 18px; }
.job.is-billed::after {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  width: 0;
  height: 0;
  border-style: solid;
  border-width: 0 20px 20px 0;
  border-color: transparent var(--billed) transparent transparent;
  pointer-events: none;
}
.legend {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: var(--quiet);
  margin-left: 10px;
}
.badge.is-dirty {
  color: #fff;
  background: var(--danger);
  border-color: var(--danger);
  font-weight: 600;
}
.publish .pub.is-dirty {
  background: var(--danger);
  border-color: var(--danger);
}
.publish .pub.is-dirty:hover { background: #61201b; }
.corner-key {
  display: inline-block;
  width: 0;
  height: 0;
  border-style: solid;
  border-width: 0 12px 12px 0;
  border-color: transparent var(--billed) transparent transparent;
}
/* Case « facturé » des commandes hors Odoo, posée sur le bloc lui-même. */
.job.has-bill { padding-bottom: 20px; }
.job .bill-box {
  position: absolute;
  right: 6px;
  bottom: 11px;
  z-index: 3;
  display: inline-flex;
  flex-direction: row;
  align-items: center;
  gap: 3px;
  margin: 0;
  padding: 1px 4px;
  border-radius: 3px;
  background: rgba(255, 255, 255, .94);
  box-shadow: 0 0 0 1px var(--line);
  font-size: 10.5px;
  font-weight: 600;
  line-height: 1;
  color: var(--quiet);
  cursor: pointer;
}
.job .bill-box input {
  width: 12px;
  height: 12px;
  margin: 0;
  accent-color: var(--billed);
}
.job .bill-box span { color: inherit; font-size: 10.5px; line-height: 1; }
.job.is-billed .bill-box { color: var(--billed); box-shadow: 0 0 0 1px var(--billed); }
.bill-toggle {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 6px;
  margin: 4px 0;
  font-size: 12px;
  cursor: pointer;
}
.bill-toggle input { width: 14px; height: 14px; margin: 0; accent-color: var(--billed); }
.mini.is-billed { position: relative; padding-right: 14px; }
.mini.is-billed::after {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  border-style: solid;
  border-width: 0 10px 10px 0;
  border-color: transparent var(--billed) transparent transparent;
}
.billed { color: var(--billed); }

@media print {
  .sheet-bar, .top { display: none; }
  body.sheet { background: #fff; }
  .paper { border: 0; margin: 0; max-width: none; padding: 0; }
  /* Une feuille de route tient sur une page A4, sans couper un arrêt en deux. */
  @page { size: A4 portrait; margin: 12mm 12mm 10mm; }
  .paper-head { border-bottom-width: 1.5px; }
  .paper-list > li { break-inside: avoid; page-break-inside: avoid; }
  .paper-list h2 { font-size: 15px; }
  .paper-list .stop-time { font-size: 13px; }
  .paper-list .stop-place,
  .paper-list .stop-phone { font-size: 10.5px; }
  .paper-list .stop-notes { font-size: 10px; }
  .sheet-products { font-size: 10px; }
  .paper-foot { font-size: 8.5px; }
  .paper-sum { font-size: 10px; }
  /* Les couleurs de repère doivent sortir à l'impression. */
  .paper-list > li::before,
  .stop-billed,
  .paper .badge,
  .paper-agency .agency-name { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}
