/* ===== v509 — Commandes (refonte Balisage, lot C) ==========================
   Maquette .impeccable/mocks/balisage/index.html, écran Commandes et fiche
   d'un PC. Jetons de design.css SEULEMENT, rayons --r / --r-s ou ronds,
   survol à la souris seulement, transform/opacity seulement. */
.cmd-ecran { padding-top: 16px; }
.cmd-ecran .balises { margin-bottom: 4px; }
.cmd-panneau { margin-top: 6px; }
.cmd-panneau .ph { gap: 12px; }
.cmd-segs { display: flex; gap: 8px; flex-wrap: wrap; margin-left: auto; }
.cmd-segs .seg button { min-height: 32px; padding: 0 12px; }
.cmd-actifs { padding: 0 20px 10px; color: var(--encre-2); }
.cmd-actifs .linkbtn { border: 0; background: none; color: var(--bleu); font-weight: 600; cursor: pointer; padding: 4px 6px; }

/* le tableau des départs */
table.departs { width: 100%; border-collapse: collapse; }
.departs th { font-size: 12.5px; font-weight: 500; color: var(--encre-2); text-align: left; padding: 8px 12px;
  border-bottom: 1px solid var(--trait-fort); white-space: nowrap; }
.departs th.r, .departs td.r { text-align: right; }
.departs td { padding: 8px 12px; height: 58px; border-bottom: 1px solid var(--trait); font-size: 14.5px; vertical-align: middle; }
.departs tbody tr:last-child td { border-bottom: 0; }
.departs th:first-child, .departs td:first-child { padding-left: 20px; }
.departs th:last-child, .departs td:last-child { padding-right: 20px; }
.departs tbody tr { cursor: pointer; }
.departs tbody tr:focus-visible { outline: 2px solid var(--bleu); outline-offset: -2px; }
.departs .promis { font-size: 18px; font-weight: 700; width: 76px; letter-spacing: -.01em; }
.departs .promis.passe { color: var(--rouge); }
.departs .id { font-weight: 600; }
.departs .sous { display: block; color: var(--encre-2); font-size: 13px; font-weight: 400; }
.departs .etape { font-weight: 600; }
.departs .etape::before { content: "→ "; color: var(--encre-3); font-weight: 400; }
.mt { display: inline-flex; align-items: center; gap: 4px; height: 26px; padding: 0 9px; border-radius: 999px;
  background: var(--actif); font-weight: 600; font-size: 12.5px; white-space: nowrap; color: var(--encre); }
.mt em { font-style: normal; color: var(--orange); }
.mt.non { background: transparent; color: var(--encre-3); border: 1px dashed var(--trait-fort); }
.rq { color: var(--encre-2); font-size: 14px; }
.rq.ret { color: var(--rouge); font-weight: 600; }
.cmd-puces { display: inline-flex; gap: 4px; flex-wrap: wrap; margin-left: 6px; vertical-align: middle; }
.cmd-puces .chip { font-size: 11.5px; padding: 1px 8px; }
.departs .chf { font-weight: 600; white-space: nowrap; }
.departs .chf small { color: var(--encre-3); font-weight: 400; font-size: 12.5px; margin-left: 3px; }

/* kanban : la carte porte « responsable → monteur » et le retard */
.kresp { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 6px; }
.kresp .rq { font-size: 12.5px; }

/* fiche commande : circuit + prochaine étape, responsable */
.mini.grand span { height: 32px; display: flex; align-items: center; padding: 0 14px 0 9px; font-size: 11.5px;
  font-weight: 600; line-height: 1.1; color: var(--encre-3);
  clip-path: polygon(0 0, calc(100% - 10px) 0, 100% 50%, calc(100% - 10px) 100%, 0 100%); }
.mini.grand span.passe { color: var(--encre-2); }
.mini.grand span.ici { color: var(--sur-bleu); }
.od-suite { display: flex; flex-direction: column; gap: 6px; margin-top: 14px; }
.od-suite .lab { font-size: 12.5px; color: var(--encre-2); font-weight: 500; }
.od-suite .quoi { font-size: 20px; font-weight: 700; letter-spacing: -.01em; }
.od-suite .quoi::before { content: "→ "; color: var(--encre-3); font-weight: 400; }
.btn.grand { min-height: 52px; font-size: 16px; width: 100%; margin-top: 4px; }
.od-resp h3 { margin-top: 0; }
.od-resp .t2 { margin: 8px 0 0; color: var(--encre-2); }

/* v523 (MODULES_CONTRAT, Commandes) */
.cmd-phrase { margin: 0 0 12px; color: var(--encre-2); font-size: 15px; }
.cmd-phrase .ret { color: var(--rouge); font-weight: 600; }
.departs .cmd-suite { min-height: 36px; padding: 0 12px; font-weight: 600; white-space: nowrap; }
.departs .cmd-attr { min-height: 32px; font-size: 13.5px; }
.kpied { display: flex; align-items: center; gap: 6px; margin-top: 8px; flex-wrap: wrap; }
.kpied .chip { font-size: 12px; padding: 2px 8px; }
.kics { display: inline-flex; gap: 4px; margin-left: auto; color: var(--encre-2); }
.kic svg.i { width: 15px; height: 15px; }
.kanban-pied { color: var(--encre-2); padding: 8px 4px; }
/* fiche ouverte en panneau (P3) : la liste garde l'essentiel — la remarque reste dans la fiche */
body.avec-panneau .departs th:nth-child(5), body.avec-panneau .departs .c-rq { display: none; }
body.avec-panneau .departs th, body.avec-panneau .departs td { padding-left: 8px; padding-right: 8px; }
body.avec-panneau .departs .promis { font-size: 15px; width: 56px; }
body.avec-panneau .departs .cmd-suite { max-width: 200px; overflow: hidden; text-overflow: ellipsis; padding: 0 10px; font-size: 14px; }
body.avec-panneau .departs .chf small { display: none; }
/* v524 — repris du Flux : carte et colonnes de la vue « Atelier » */
.kcard.kurg { box-shadow: inset 3px 0 0 var(--rouge) !important; }
.kurg-txt { color: var(--rouge); font-weight: 700; }
.kafaire { color: var(--orange); font-style: normal; font-size: 13px; font-weight: 600; }
.kpied .kblk { display: inline-flex; align-items: center; gap: 4px; max-width: 170px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kpied .kblk svg.i { width: 13px; height: 13px; flex: none; }
.kpieces { display: flex; gap: 2px; margin-top: 8px; }
.kpieces i { flex: 1; max-width: 18px; height: 4px; border-radius: 2px; background: var(--trait-fort); }
.kpieces i.ok { background: var(--vert); }
.kcol-m { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 0 12px 8px; font-size: 12.5px; color: var(--encre-2); }
.kwip { flex: 1 1 60px; max-width: 90px; height: 6px; border-radius: 3px; background: var(--trait); overflow: hidden; }
.kwip i { display: block; height: 100%; background: var(--bleu); }
.kwip.plein i { background: var(--rouge); }
.kwip-t { font-variant-numeric: tabular-nums; }
.kcol-meta.rouge { color: var(--rouge); font-weight: 600; }
.kcol.goulot { border-color: var(--rouge); }
.kgoulot { font-size: 11.5px; padding: 1px 8px; margin-left: auto; }
.kcard.krep { width: 100%; text-align: left; cursor: pointer; font: inherit; color: inherit; }
.krep-tout { display: block; margin: 6px auto 2px; min-height: 36px; }
.od-atelier h3 { margin-top: 0; }
.od-at-l { margin: 0 0 10px; }
.od-blocage { padding: 10px 12px; border-radius: var(--r-s); background: var(--rouge-pale); color: var(--rouge); margin-bottom: 10px; }
.od-blocage .t2 { color: var(--encre-2); }
.od-at-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.od-at-actions .btn { min-height: 44px; }
.od-urg { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 12px; border: 1px solid var(--trait); border-radius: var(--r-s); cursor: pointer; font-weight: 600; }
.od-urg input { width: 20px; height: 20px; accent-color: var(--rouge); }
/* v526 — fiche commande en P6 : ordre du contrat, cibles de 44 px, aucune couleur en dur */
.od-tete { gap: 8px; align-items: center; margin-bottom: 4px; }
.od-tete h2 { margin: 0; }
.od-resp-ligne { display: flex; align-items: center; gap: 10px; min-height: 44px; }
.od-resp-ligne .btn { flex: none; min-height: 40px; }
#odRespChamps { margin-top: 10px; }
.od-aide { margin: 6px 0 0; font-size: 13px; color: var(--encre-2); }
.od-n { font-weight: 500; color: var(--encre-2); font-size: 14px; margin-left: 4px; }
.od-comps .comp, .od-check .comp { align-items: center; min-height: 52px; }
.od-coche { flex: none; width: 44px; height: 44px; display: inline-flex; align-items: center; justify-content: center;
  border: 1.5px solid var(--trait-fort); border-radius: var(--r-s); background: var(--surface); color: var(--sur-bleu); cursor: pointer; padding: 0; }
.od-coche.on { background: var(--vert); border-color: var(--vert); }
.od-coche svg.i { width: 22px; height: 22px; }
.od-coche.od-acmd { color: var(--encre-3); }
.od-coche.od-acmd.on { background: var(--orange-pale); border-color: var(--orange); color: var(--orange); }
.od-coche.od-depl { color: var(--encre-2); }
.od-coche.od-depl svg.i { transition: transform 160ms var(--ease-out); }
.od-coche.od-depl[aria-expanded="true"] svg.i { transform: rotate(90deg); }
span.od-coche { cursor: default; }
.od-groupe { background: var(--surface-2); border-radius: var(--r-s); padding-left: 6px; padding-right: 6px; }
.od-kids { padding-left: 12px; border-left: 2px solid var(--trait); margin: 2px 0 6px 8px; }
.od-prov { font-size: 11.5px; padding: 1px 6px; white-space: normal; }
.od-info { flex: none; }
.od-fait { text-decoration: line-through; color: var(--encre-2); }
.od-ajout { gap: 8px; margin-top: 8px; }
.od-ajout input { border: 1px solid var(--trait); background: var(--surface); border-radius: var(--r-s); padding: 10px; min-height: 44px; font: inherit; }
.od-notes h3 { margin: 0 0 6px; font-size: 15px; }
.od-grille { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.od-act { display: flex; flex-direction: column; align-items: flex-start; justify-content: space-between; gap: 8px; min-height: 72px;
  padding: 10px 12px; border: 1px solid var(--trait); border-radius: var(--r-s); background: var(--surface); color: var(--encre);
  font: inherit; font-size: 14px; font-weight: 600; text-align: left; cursor: pointer; }
.od-act svg.i { width: 20px; height: 20px; color: var(--bleu); }
.od-act[aria-pressed="true"] { border-color: var(--bleu); background: var(--bleu-pale); }
.od-act:disabled { opacity: .5; cursor: default; }
.od-live-go { width: 100%; min-height: 52px; flex-direction: row; align-items: center; justify-content: flex-start; margin-top: 8px; }
.od-live { gap: 8px; flex-wrap: wrap; margin-top: 10px; align-items: center; }
.od-live .chip svg.i { width: 14px; height: 14px; margin-right: 4px; vertical-align: -2px; }
.od-bc { margin-top: 10px; }
.od-bc-btns { gap: 8px; margin-top: 8px; }
.od-bc-btns a.btn { text-decoration: none; text-align: center; }
.od-cli { gap: 8px; align-items: center; }
.od-cli h3 { margin: 0; }
.od-cli .lien { font: inherit; font-weight: 700; }
.od-vient { display: flex; align-items: center; gap: 8px; margin-top: 10px; padding: 10px 12px; border-radius: var(--r-s);
  background: var(--rouge-pale); color: var(--rouge); }
.od-lig .btn.icon { flex: none; }
.od-lig > svg.i.dans { flex: none; color: var(--encre-2); }
.od-lig.vide { color: var(--encre-2); }
.od-liv { color: var(--orange); font-weight: 600; }
.od-avance > summary { cursor: pointer; font-weight: 700; min-height: 44px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.od-avance > summary .t2 { font-weight: 400; font-size: 13px; }
.od-avance[open] > summary { margin-bottom: 8px; }
.od-meta { flex-wrap: wrap; margin: 0 0 10px; }
.od-odoo { margin-top: 12px; text-decoration: none; display: inline-flex; align-items: center; gap: 6px; }
@media (max-width: 820px) {
  .od-grille { grid-template-columns: 1fr 1fr; }
  .od-act { min-height: 64px; }
}
@media (prefers-reduced-motion: reduce) { .od-coche.od-depl svg.i { transition: none; } }
.cmd-vue-tel { display: none !important; }
.kcard-suite { display: none; width: 100%; min-height: 44px; margin-top: 8px; font-weight: 600; }

@media (hover: hover) and (pointer: fine) {
  .departs tbody tr:hover { background: var(--surface-2); }
}
@media (max-width: 820px) {
  .cmd-segs { margin-left: 0; width: 100%; }
  .departs, .departs thead, .departs tbody, .departs tr, .departs td { display: block; }
  .departs thead { display: none; }
  /* v523 : 2 étages — « S00202 · client ……… 4 200 » / [étape]  « Promis 04.11 · Sam » */
  .departs tbody tr { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 6px 10px; padding: 10px 16px;
    border-bottom: 1px solid var(--trait); grid-template-areas: "id id chf" "etape promis mt"; align-items: center; }
  .departs .c-rq { display: none !important; }
  .departs .c-id .id, .departs .c-id .sous { display: inline; }
  .departs .c-id .sous::before { content: " · "; }
  .departs .c-id { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
  .departs .cmd-suite { min-height: 40px; max-width: 100%; overflow: hidden; text-overflow: ellipsis; font-size: 14px; }
  .departs .c-etape .etape, .departs .c-etape .rq { font-size: 14px; }
  .departs .c-etape .sous { display: none; }
  /* le circuit : des puces de 44 px qui défilent (le fondu à droite dit qu'il y a la suite) */
  .cmd-ecran .balise { flex: 0 0 auto; min-height: 44px; flex-direction: row; align-items: center; gap: 8px;
    padding: 0 26px 0 12px; clip-path: polygon(0 0, calc(100% - 14px) 0, 100% 50%, calc(100% - 14px) 100%, 0 100%); }
  .cmd-ecran .balise .nb { font-size: 16px; }
  .cmd-ecran .balise .alp { position: static; width: 12px; height: 12px; border-width: 4px 1px; }
  .cmd-ecran .balises { padding-bottom: 10px; }
  /* filtres rapides en puces de 40 px ; Liste / Kanban passe dans ⋯ */
  .cmd-segs .seg { overflow-x: auto; scrollbar-width: none; display: flex; max-width: 100%; }
  .cmd-segs .seg button { min-height: 40px; white-space: nowrap; }
  #cView { display: none; }
  .kcard-suite { display: block; }
  .cmd-vue-tel { display: flex !important; }
  .kanban-aide { display: none; }
  .cmd-ecran .balises { -webkit-mask-image: linear-gradient(90deg, var(--encre) 85%, transparent);
    mask-image: linear-gradient(90deg, var(--encre) 85%, transparent); }
  .departs td { height: auto; border: 0; padding: 0 !important; }
  .departs .c-id { grid-area: id; } .departs .c-chf { grid-area: chf; }
  .departs .c-etape { grid-area: etape; } .departs .c-mt { grid-area: mt; text-align: right; }
  .departs .c-rq { grid-area: rq; } .departs .c-promis { grid-area: promis; font-size: 13px; width: auto; font-weight: 600; color: var(--encre-2); }
  .departs .c-promis::before { content: "Promis "; font-weight: 400; }
  .departs .c-promis.passe { color: var(--rouge); }
  .mini.grand span { font-size: 10px; padding: 0 10px 0 6px; height: 28px; }
}
@media (prefers-reduced-motion: reduce) {
  .departs tbody tr { transition: none; }
}
