/* Facturation › Kilomètres (kilometres.js, owner 2026-11-27 : design 1 + calendrier du design 3). */
/* 4 sortes de trajets, lisibles en clair comme en sombre : or, bronze (or + texte), gris, couleur du texte */
.km, .km-d { --km-course: var(--gold); --km-appr: color-mix(in srgb, var(--gold) 55%, var(--text)); --km-ret: var(--muted); --km-pro: var(--text); }
.km-c-course { background: var(--km-course); } .km-c-appr { background: var(--km-appr); } .km-c-ret { background: var(--km-ret); } .km-c-pro { background: var(--km-pro); }
.km-c-perso { background: repeating-linear-gradient(135deg, var(--muted) 0 2px, transparent 2px 6px); opacity: .7; }

/* Quatre onglets : ils défilent sur téléphone au lieu de passer à la ligne */
@media (max-width: 640px) { .di-tabs { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; } .di-tabs::-webkit-scrollbar { display: none; } .di-tabs button { flex: none; padding: 0 13px; } }

.km { max-width: 640px; }

/* En-tête « icône + Kilomètres » (owner, 2026-12-02) : dans la carte offre Pro ; sur téléphone il remplace aussi le titre
   de la page (« Vue d'ensemble » retiré : la page Kilomètres a sa propre icône dans la barre du bas). */
.km-paid { display: block; max-width: 640px; }
.km-paid-h { display: flex; align-items: center; gap: 14px; margin: 0 0 14px; }
.km-paid-h .fl-paid-ic { width: 44px; height: 44px; border-radius: 12px; flex: none; }
.km-paid-h .fl-paid-ic svg { width: 20px; height: 20px; }
.km-paid-h h2 { margin: 0; font-size: 26px; font-weight: 800; line-height: 1.15; color: var(--text); }
.km-ph-h { display: none; }
@media (max-width: 999px) {
  .di-pg-km > h1, .di-pg-km > .ph-vt, .di-pg-km > .di-tabs { display: none !important; }
  /* Facturation (vue d'ensemble) aussi : plus de titre « Vue d'ensemble », la page commence par le solde (owner, 2026-12-02) */
  .di-pg-over > h1, .di-pg-over > .ph-vt { display: none !important; }
  /* 50 px sous le logo : réglé pour toutes les pages dans app.css (« 50 px vides sous le logo ») ; ici, pas de marge en plus */
  .di-pg-km .km-ph-h, .di-pg-km .km-paid { margin-top: 0; }
  .km-ph-h { display: flex; }
}
.km-nav { display: grid; grid-template-columns: 40px 1fr 40px; align-items: center; gap: 8px; margin-top: 6px; }
.km-nav > div { text-align: center; }
.km-nav b { display: block; font-size: 17px; }
.km-nav small { color: var(--muted); font-size: 12.5px; }
.km-nav small.ok { color: var(--green); font-weight: 600; }
.km-arw { width: 40px; height: 40px; border-radius: 50%; border: 0; display: grid; place-items: center; background: var(--panel-2); color: var(--text); cursor: pointer; transition: background-color .3s, color .3s; }
.km-arw svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.km-arw[disabled] { opacity: .35; cursor: default; }
.km-big { margin-top: 26px; display: flex; align-items: baseline; flex-wrap: wrap; gap: 8px; }
.km-big b { font-size: 40px; font-weight: 800; letter-spacing: -.02em; line-height: 1; font-variant-numeric: tabular-nums; }
.km-big span { color: var(--muted); }
.km-stack { display: flex; gap: 2px; height: 12px; border-radius: 6px; overflow: hidden; margin-top: 16px; }
.km-stack i, .km-mini i { display: block; height: 100%; min-width: 3px; }
.km-legend { margin-top: 12px; }
.km-lg { display: grid; grid-template-columns: 10px 1fr auto; gap: 10px; align-items: center; padding: 6px 0; font-size: 14px; }
.km-lg i { width: 10px; height: 10px; border-radius: 3px; }
.km-lg small { color: var(--muted); font-size: 12.5px; margin-inline-start: 6px; }
.km-lg b { font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.km-money { margin-top: 20px; padding: 14px 16px; border-radius: 14px; background: var(--gold-soft); display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.km-money span { font-weight: 700; }
.km-money small { display: block; color: var(--muted); font-size: 12px; margin-top: 2px; }
.km-money b { font-size: 20px; font-weight: 800; white-space: nowrap; font-variant-numeric: tabular-nums; }
.km-odo { display: grid; grid-template-columns: 38px 1fr auto; gap: 12px; align-items: center; margin-top: 24px; }
.km-odo b { display: block; font-size: 14.5px; }
.km-odo small { display: block; color: var(--muted); font-size: 12.5px; }
.km-odo .btn svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; margin-inline-end: 4px; vertical-align: -3px; }
.km-ic { width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; background: var(--panel-2); color: var(--text); }
.km-ic svg, .km-eic svg, .km-uic svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.km-sent { margin: 8px 0 0; }
.km-warn { margin-top: 20px; padding: 12px 14px; border-radius: 12px; background: var(--panel-2); display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 12px; font-size: 13.5px; }
.km-warn span { flex: 1 1 220px; }
.km-h { font-size: 18px; font-weight: 700; margin: 32px 0 4px; padding-bottom: 8px; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.km-h small { font-size: 12.5px; color: var(--muted); font-weight: 600; }
.km-set { display: block; margin: 28px auto 0; background: none; border: 0; color: var(--muted); font: inherit; font-size: 13.5px; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; transition: color .3s; }

/* Calendrier (design 3) */
.km-cal { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; margin-top: 12px; }
.km-wd { text-align: center; font-size: 11.5px; color: var(--muted); font-weight: 600; padding-bottom: 4px; text-transform: capitalize; }
.km-cal > button, .km-cal > span:not(.km-wd) { aspect-ratio: 1 / 1.08; border-radius: 10px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; font: inherit; font-size: 13px; font-weight: 700; }
.km-cal > button { border: 0; cursor: pointer; color: var(--text); background: color-mix(in srgb, var(--gold) calc(var(--k) * 78%), var(--panel-2)); transition: background-color .3s, color .3s, box-shadow .3s; }
.km-cal > button small { font-size: 9.5px; font-weight: 600; opacity: .85; }
html:not([data-theme="light"]) .km-cal > button.hi { color: #fff; }
.km-cal .off { color: var(--muted); font-weight: 600; }
.km-cal .fut { color: var(--muted); opacity: .45; }
.km-cal .today { box-shadow: inset 0 0 0 2px var(--gold); }
.km-cal > button.sel { background: var(--green); color: #fff; box-shadow: none; }
@media (min-width: 1000px) { .km-cal > button, .km-cal > span:not(.km-wd) { aspect-ratio: auto; height: 54px; } }

/* Liste des jours */
.km-day { width: calc(100% + 16px); margin: 0 -8px; display: grid; grid-template-columns: 42px 1fr auto; gap: 12px; align-items: center; padding: 9px 8px; border: 0; border-radius: 12px; background: none; color: var(--text); font: inherit; text-align: start; cursor: pointer; transition: background-color .3s; }
.km-dt { text-align: center; line-height: 1.1; }
.km-dt small { display: block; font-size: 11.5px; color: var(--muted); font-weight: 600; text-transform: capitalize; }
.km-dt b { font-size: 18px; }
.km-mid small { display: block; font-size: 12.5px; color: var(--muted); margin-bottom: 5px; }
.km-mini { display: flex; gap: 2px; height: 7px; border-radius: 4px; overflow: hidden; }
.km-k { font-weight: 700; white-space: nowrap; font-variant-numeric: tabular-nums; }

/* Page vide */
.km-empty { text-align: center; padding: 28px 8px 8px; max-width: 430px; margin: 0; }   /* sous les onglets, pas au milieu de la page de 940 px (owner, 2026-11-28) */
@media (max-width: 640px) { .km-empty { margin: 0 auto; } }
.km-eic { width: 56px; height: 56px; border-radius: 16px; margin: 0 auto; display: grid; place-items: center; background: var(--gold-soft); color: var(--gold); }
.km-eic svg { width: 28px; height: 28px; }
.km-empty h2 { margin: 18px 0 6px; font-size: 19px; text-wrap: balance; }
.km-empty p { margin: 0 auto 22px; color: var(--muted); font-size: 14px; max-width: 34ch; }

/* Fenêtres */
.km-d { max-width: 460px; }
.km-d h2 .icon-btn svg { stroke: currentColor; }
.km-steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin: 4px 0 6px; }
.km-steps i { height: 4px; border-radius: 2px; background: var(--line); transition: background-color .4s; }
.km-steps i.on { background: var(--gold); }
.km-rows { margin-top: 8px; }
.km-row { display: grid; grid-template-columns: 1fr auto; gap: 14px; align-items: center; padding: 12px 0; cursor: pointer; }
.km-row b { display: block; font-weight: 600; font-size: 14.5px; }
.km-row small { display: block; color: var(--muted); font-size: 12.5px; margin-top: 2px; }
.km-suf { position: relative; }
.km-suf input { padding-inline-end: 40px; }
.km-suf em { position: absolute; inset-inline-end: 14px; bottom: 12px; font-style: normal; color: var(--muted); }
.km-btns { display: flex; justify-content: flex-end; margin-top: 24px; }
.km-btns.two { display: grid; grid-template-columns: auto 1fr; gap: 10px; }
.km-btns .btn { min-height: 46px; }
.km-btns:not(.two) .btn { width: 100%; }
.km-wide { display: block; width: 100%; margin-top: 16px; }
.km-note { margin: 16px 0 0; padding: 12px 14px; border-radius: 12px; background: var(--gold-soft); font-size: 13.5px; }
.km-lbl { font-size: 12.5px; color: var(--muted); margin: 20px 0 8px; font-weight: 600; }
.km-freq { margin: 10px 2px 6px; }
.km-chips { display: flex; gap: 6px; flex-wrap: wrap; }
.km-chip { padding: 7px 12px; border-radius: 99px; border: 0; background: var(--panel-2); color: var(--text); font: inherit; font-size: 13.5px; cursor: pointer; transition: background-color .3s, color .3s; }
.km-chip.on { background: var(--gold); color: #fff; }
.km-sugg { margin-top: 6px; border-radius: 12px; background: var(--panel-2); padding: 4px; }
.km-sugg button { width: 100%; display: grid; grid-template-columns: 20px 1fr; gap: 10px; align-items: center; padding: 9px 10px; border: 0; border-radius: 9px; background: none; color: var(--text); font: inherit; font-size: 14px; text-align: start; cursor: pointer; transition: background-color .3s, color .3s; }
.km-sugg svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; opacity: .7; }
.km-sugg small { display: block; color: var(--muted); font-size: 12px; transition: color .3s; }
.km-kmline { margin: 18px 0 0; padding: 12px 14px; border-radius: 12px; background: var(--panel-2); font-size: 14px; }
.km-kmline b { font-weight: 800; }
.km-up { margin-top: 20px; display: grid; grid-template-columns: 44px 1fr; gap: 12px; align-items: center; padding: 14px; border: 1.5px dashed var(--line); border-radius: 14px; cursor: pointer; transition: border-color .3s, background-color .3s; }
.km-uic { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; color: var(--gold); background: var(--gold-soft); }
.km-up b { display: block; font-size: 14.5px; }
.km-up small { display: block; color: var(--muted); font-size: 12.5px; }
.km-up.done { border-style: solid; border-color: var(--gold); }
.km-up.done .km-uic { background: var(--gold); color: #fff; }

/* Trajets d'une journée */
.km-chain { list-style: none; margin: 14px 0 0; padding: 0; }
.km-stop, .km-leg { display: grid; grid-template-columns: 44px 16px 1fr auto; gap: 8px; }
.km-stop > span:last-child { grid-column: 3 / 5; }
.km-stop time { font-size: 12.5px; color: var(--muted); text-align: end; padding-top: 1px; font-weight: 600; font-variant-numeric: tabular-nums; }
.km-dot { width: 12px; height: 12px; border-radius: 50%; border: 2.5px solid var(--gold); background: var(--panel); margin: 4px auto 0; }
.km-dot.h { background: var(--gold); }
.km-stop b { font-weight: 700; font-size: 14.5px; }
.km-stop small { display: block; color: var(--muted); font-size: 12.5px; }
.km-ln { width: 3px; justify-self: center; border-radius: 2px; margin: 2px 0; }
.km-lc { width: calc(100% + 10px); margin: 4px 0 4px -10px; display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 9px 10px; border: 0; border-radius: 12px; background: none; color: var(--text); font: inherit; text-align: start; }
button.km-lc { cursor: pointer; transition: background-color .3s; }
.km-lc b { display: block; font-size: 13.5px; font-weight: 600; }
.km-lc small { display: block; color: var(--muted); font-size: 12px; }
.km-lk { font-weight: 700; white-space: nowrap; font-size: 14px; font-variant-numeric: tabular-nums; }
.km-leg.perso .km-ln { background: repeating-linear-gradient(180deg, var(--muted) 0 4px, transparent 4px 8px); }
.km-leg.perso .km-lk { color: var(--muted); text-decoration: line-through; }
.km-del { align-self: center; }
.km-del svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.km-dhint { margin: 14px 0 0; }

@media (hover: hover) {
  .km-arw:not([disabled]):hover { background: var(--text); color: var(--bg); }
  .km-cal > button:not(.sel):hover { background: var(--text); color: var(--bg); }
  .km-day:hover, button.km-lc:hover { background: var(--panel-2); }
  .km-chip:not(.on):hover { background: var(--text); color: var(--bg); }
  .km-sugg button:hover { background: var(--text); color: var(--bg); }
  .km-sugg button:hover small { color: var(--bg); }
  .km-up:hover { border-color: var(--gold); background: var(--gold-soft); }
  .km-set:hover { color: var(--text); }
}
