/* ==========================================================================
   TENON — gestion de l'atelier
   Barre latérale noyer, plan de travail lin. Les panneaux sont dessinés à l'échelle,
   les chiffres en mono. Sur téléphone (et dans la page « en direct »), une seule colonne.
   ========================================================================== */

html { overflow-x: clip; }
body.ad { background: var(--linen); }

/* ---------- Coquille ---------- */
.shell { display: grid; grid-template-columns: 240px minmax(0, 1fr); min-height: calc(100vh - 34px); background: linear-gradient(90deg, var(--walnut-bg) 240px, transparent 240px); }
.side { position: sticky; top: 0; align-self: start; height: calc(100vh - 34px); height: calc(100dvh - 34px); overflow-y: auto; display: flex; flex-direction: column; gap: 26px; padding: 22px 14px; background: var(--walnut-bg); color: rgba(243, 238, 230, .78); }
.side__brand { display: flex; align-items: center; gap: 11px; padding: 0 8px; text-decoration: none; color: #fff; }
.side__brand svg { width: 34px; height: 34px; flex: none; }
.side__brand b { display: block; font-family: var(--serif); font-weight: 400; font-size: 23px; letter-spacing: .18em; line-height: 1; }
.side__brand small { display: block; margin-top: 4px; font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: rgba(243, 238, 230, .55); }
.nav { display: grid; gap: 2px; }
.nav a { display: flex; align-items: center; gap: 11px; min-height: 44px; padding: 0 12px; border-radius: 12px; color: inherit; text-decoration: none; font-size: 14.5px; font-weight: 500; transition: background-color .2s, color .2s; }
.nav a:hover { background: rgba(243, 238, 230, .06); color: #fff; }
.nav a[aria-current="page"] { background: rgba(176, 135, 58, .18); color: #fff; box-shadow: inset 3px 0 0 var(--brass); }
.nav .ico { width: 19px; height: 19px; }
.side__foot { margin-top: auto; display: grid; gap: 12px; padding: 0 4px; }
.side__live { display: flex; align-items: flex-start; gap: 9px; margin: 0; font-size: 12.5px; line-height: 1.4; color: rgba(243, 238, 230, .6); }
.live-dot { position: relative; flex: none; width: 8px; height: 8px; margin-top: 5px; border-radius: 50%; background: #6fbf7e; }
.live-dot::after { content: ""; position: absolute; inset: -4px; border-radius: 50%; border: 2px solid #6fbf7e; animation: live 1.8s ease-out infinite; }
@keyframes live { 0% { opacity: .8; transform: scale(.4); } 100% { opacity: 0; transform: scale(1.5); } }
.side__reset { justify-content: flex-start; color: rgba(243, 238, 230, .7); box-shadow: inset 0 0 0 1px rgba(243, 238, 230, .14); }
.side__reset:hover { color: #fff; }
.side__reset .ico { width: 17px; height: 17px; }

.main { min-width: 0; padding: 22px clamp(16px, 2.6vw, 36px) 40px; outline: none; }
.topbar { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 20px; }
.topbar__brand { display: none; }
.topbar__date { margin: 0 0 4px; font-size: 12px; letter-spacing: .04em; color: var(--muted); }
.topbar h1 { margin: 0; font-family: var(--serif); font-weight: 400; font-size: clamp(30px, 3vw, 42px); line-height: 1; letter-spacing: -.01em; font-variant-numeric: lining-nums; }
.topbar__r { display: flex; align-items: center; gap: 12px; }
.topbar__live { display: none; align-items: center; gap: 8px; font: 500 11px/1 var(--mono); letter-spacing: .08em; text-transform: uppercase; color: rgba(243, 238, 230, .7); }
.topbar__live .live-dot { margin-top: 0; }
.mfoot { display: none; }

/* ---------- Plan de débit ---------- */
.db__bar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 16px; }
.db__src { flex: 1 1 280px; max-width: 520px; min-width: 0; }
.db__grid { display: grid; grid-template-columns: minmax(300px, 400px) minmax(0, 1fr); gap: 18px; align-items: start; }
.db__l, .db__r { display: grid; gap: 14px; min-width: 0; }

/* La carte du projet qui arrive */
.inc { position: relative; padding: 16px 16px 14px; border-radius: var(--r-lg); background: var(--paper); box-shadow: var(--shadow); overflow: hidden; }
.inc::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--sand-2); }
.inc--draft::before { background: var(--brass); }
.inc--order::before { background: var(--ok); }
.inc__top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.inc__st { display: inline-flex; align-items: center; gap: 8px; min-height: 28px; padding: 0 11px; border-radius: 999px; background: var(--sand); font-size: 12.5px; font-weight: 600; color: var(--ink-2); white-space: nowrap; }
.inc__st i { position: relative; width: 7px; height: 7px; border-radius: 50%; background: var(--muted); }
.inc__st.is-draft { background: var(--brass-soft); color: var(--brass-ink); }
.inc__st.is-draft i { background: var(--brass); }
.inc__st.is-draft i::after { content: ""; position: absolute; inset: -4px; border-radius: 50%; border: 2px solid var(--brass); animation: live 1.6s ease-out infinite; }
.inc__st.is-ok { background: rgba(79, 122, 87, .14); color: #345a3c; }
.inc__st .ico { width: 15px; height: 15px; stroke-width: 2.2; }
.inc__side { font-size: 11px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.inc__body { display: grid; grid-template-columns: minmax(0, 1fr) 96px; gap: 12px; align-items: center; margin-top: 12px; }
.inc__who { margin: 0; font-family: var(--serif); font-size: 25px; line-height: 1.05; letter-spacing: -.005em; }
.inc__where { margin: 3px 0 0; font-size: 13px; color: var(--muted); }
.inc__lbl { margin: 10px 0 0; font-size: 12px; line-height: 1.45; color: var(--ink-2); }
.inc__amt { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 10px; margin: 8px 0 0; }
.inc__amt b { font-family: var(--mono); font-weight: 400; font-size: 19px; letter-spacing: -.02em; white-space: nowrap; }
.inc__amt span { font-size: 12.5px; color: var(--muted); }
.inc__fig { align-self: stretch; display: grid; place-items: center; padding: 6px; border-radius: 12px; background: var(--linen); }
.inc__fig svg { width: 100%; height: auto; max-height: 120px; }
.inc--batch::before, .inc--group::before { background: var(--brass); }
.inc__st.is-batch { background: var(--brass-soft); color: var(--brass-ink); }
.inc__lot { margin-top: 12px; }
.lotl { list-style: none; margin: 10px 0 0; padding: 0; display: grid; gap: 6px; }
.lotl li { display: grid; grid-template-columns: 26px minmax(0, 1fr) auto; gap: 8px; align-items: center; min-height: 34px; padding: 4px 10px 4px 4px; border-radius: 10px; background: var(--linen); font-size: 13px; }
.lotl li b { display: grid; place-items: center; width: 26px; height: 26px; border-radius: 8px; background: var(--paper); font-size: 12px; font-weight: 600; color: var(--brass-ink); }
.lotl li span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink-2); }
.lotl li em { font-style: normal; font-size: 11px; color: var(--muted); white-space: nowrap; }
.inc__gain { margin: 12px 0 0; padding: 10px 12px; border-radius: 12px; background: rgba(79, 122, 87, .1); color: #2f5136; font-size: 13px; line-height: 1.45; }
.inc__gain:empty { display: none; }
.db__belv { gap: 7px; }
.db__belv[hidden] { display: none; }
.db__belv small { font-weight: 500; opacity: .7; }
.db__belv[aria-pressed="true"] { background: var(--ink); color: var(--paper); box-shadow: none; }
.db__belv[aria-pressed="true"] small { opacity: .75; }
.inc__foot:empty { display: none; }
.inc__foot { margin-top: 12px; }
.inc__next, .inc__done { display: flex; align-items: flex-start; gap: 9px; margin: 0; padding: 10px 12px; border-radius: 12px; background: var(--linen); font-size: 13px; line-height: 1.4; color: var(--ink-2); }
.inc__next .ico, .inc__done .ico { width: 17px; height: 17px; margin-top: 1px; color: var(--brass-ink); }
.inc__next.is-quiet { color: var(--muted); }
.inc__done { background: rgba(79, 122, 87, .1); color: #2f5136; }
.inc__done .ico { color: var(--ok); stroke-width: 2.2; }
.btn--wide { width: 100%; }
.inc__go { min-height: 56px; padding: 8px 18px; border-radius: 18px; justify-content: flex-start; gap: 12px; white-space: normal; text-align: left; }
.inc__go .ico { width: 20px; height: 20px; }
.inc__go span { display: grid; gap: 1px; min-width: 0; }
.inc__go b { font-size: 14.5px; font-weight: 650; line-height: 1.2; }
.inc__go small { font-size: 12.5px; font-weight: 500; opacity: .78; line-height: 1.2; }

/* Compteurs */
.kpis { position: relative; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.kpi { display: flex; flex-direction: column; gap: 3px; min-width: 0; padding: 12px 12px 11px; border-radius: 16px; background: var(--paper); box-shadow: var(--shadow); }
.kpi small { font: 500 10.5px/1.2 var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.kpi b { display: inline-block; font-family: var(--mono); font-weight: 400; font-size: 26px; line-height: 1.1; letter-spacing: -.03em; font-variant-numeric: tabular-nums; white-space: nowrap; transform-origin: left center; transition: color .5s; }
.kpi b.is-bump { color: var(--brass-ink); animation: bump .55s var(--ease); }
@keyframes bump { 0% { transform: scale(1); } 35% { transform: scale(1.12); } 100% { transform: scale(1); } }
.kpi span { font-size: 11.5px; line-height: 1.3; color: var(--muted); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kpi span.is-cmp { color: var(--brass-ink); }
.kpis.is-saved::after { content: attr(data-saved); grid-column: 1 / -1; justify-self: start; padding: 4px 10px; border-radius: 999px; background: rgba(79, 122, 87, .14); color: #345a3c; font-size: 12px; font-weight: 600; }

/* Règles appliquées */
.rulesx { display: grid; gap: 8px; }
.rulesx:empty { display: none; }
.rx { display: flex; align-items: flex-start; gap: 10px; margin: 0; padding: 10px 12px; border-radius: 14px; background: var(--brass-soft); color: var(--ink-2); font-size: 13.5px; line-height: 1.42; }
.rx .ico { width: 18px; height: 18px; margin-top: 1px; color: var(--brass-ink); }
.rx b { color: var(--brass-ink); font-weight: 600; }
.rx--red { background: rgba(180, 68, 47, .1); }
.rx--red b, .rx--red .ico { color: var(--red); }
.rx--info { background: var(--sand); }
.rx.is-new { animation: rx-in .6s var(--ease); }
@keyframes rx-in { from { opacity: 0; transform: translateY(-8px); } }

/* Panneaux */
.bds { padding: 14px 14px 12px; border-radius: var(--r-lg); background: var(--paper); box-shadow: var(--shadow); }
.bds__head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 12px; margin-bottom: 10px; }
.bds__head h2 { margin: 0; font-family: var(--serif); font-weight: 400; font-size: 24px; line-height: 1.1; }
.boards { --cols: 3; display: grid; gap: 16px; }
.bg__t { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 2px 10px; margin: 0 0 8px; font-size: 13px; }
.bg__t b { font-weight: 600; }
.bg__t span { font-size: 11.5px; color: var(--muted); }
.bg__boards { display: grid; grid-template-columns: repeat(var(--cols), minmax(0, 1fr)); gap: 10px; }
.bd { margin: 0; min-width: 0; }
.bd.is-big { grid-column: 1 / -1; }
.bd__btn { display: block; width: 100%; padding: 0; border-radius: 6px; cursor: zoom-in; }
.bd.is-big .bd__btn { cursor: zoom-out; }
.bd svg { width: 100%; height: auto; overflow: visible; }
.bd svg g.pc { transform-box: view-box; }
.bd figcaption { margin-top: 4px; font-size: 10.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bd figcaption b { font-weight: 400; color: var(--ink); }
.bds__legend { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; margin: 12px 0 0; font-size: 11.5px; color: var(--muted); }
.lg { display: inline-block; width: 16px; height: 9px; margin-right: -6px; vertical-align: middle; }
.lg--b2 { height: 0; border-top: 3px solid var(--brass); }
.lg--b1 { height: 0; border-top: 1.5px solid var(--ink); }
.lg--off { border: 1px dashed var(--ink); background: #f6f1e8; }
.lg--w { background: repeating-linear-gradient(45deg, rgba(35, 28, 22, .35) 0 1px, #f6f1e8 1px 4px); }

/* Pièces */
.pieces { border-radius: var(--r-lg); background: var(--paper); box-shadow: var(--shadow); }
.pieces summary { display: flex; align-items: center; gap: 10px; min-height: 52px; padding: 0 16px; cursor: pointer; list-style: none; font-weight: 600; font-size: 14.5px; }
.pieces summary::-webkit-details-marker { display: none; }
.pieces summary b { margin-left: auto; font-weight: 400; color: var(--muted); }
.pieces summary .ico { width: 18px; height: 18px; transition: transform .25s; }
.pieces[open] summary .ico { transform: rotate(180deg); }
.tbl { overflow-x: auto; padding: 0 6px 10px; }
.tbl table { width: 100%; min-width: 560px; border-collapse: collapse; font-size: 13px; }
.tbl th { padding: 8px 10px; text-align: left; font: 500 10.5px/1.2 var(--mono); letter-spacing: .06em; text-transform: uppercase; color: var(--muted); border-bottom: 1px solid var(--rule); }
.tbl td { padding: 7px 10px; border-bottom: 1px solid var(--rule); vertical-align: middle; }
.tbl .r { text-align: right; white-space: nowrap; }
.tbl .mut { color: var(--muted); }
.em-cell { white-space: nowrap; }
.em { display: inline-block; width: 12px; height: 12px; margin-right: 3px; border-radius: 2px; box-shadow: inset 0 0 0 1px var(--rule-2); vertical-align: middle; }
.em--1 { box-shadow: inset 0 -2px 0 var(--ink), inset 0 0 0 1px var(--rule-2); }
.em--2 { box-shadow: inset 0 -3px 0 var(--brass), inset 0 0 0 1px var(--rule-2); }

/* Quincaillerie, validés */
.db__hw, .db__others { padding: 14px 16px; border-radius: var(--r-lg); background: var(--paper); box-shadow: var(--shadow); }
.db__others:empty { display: none; }
.db__hw h3, .db__others h3, .wk__head h3 { margin: 0 0 8px; font-size: 13px; font-weight: 600; }
.hwl, .oth { margin: 0; padding: 0; list-style: none; }
.hwl li { display: flex; justify-content: space-between; gap: 12px; padding: 6px 0; border-top: 1px solid var(--rule); font-size: 13px; }
.hwl li:first-child { border-top: 0; }
.hwl b { font-weight: 400; }
.oth a { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 10px; align-items: center; min-height: 44px; border-top: 1px solid var(--rule); text-decoration: none; font-size: 13px; }
.oth li:first-child a { border-top: 0; }
.oth span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); }
.oth em { font-style: normal; font-family: var(--mono); font-size: 12px; white-space: nowrap; }

/* Bande de planning */
.wk { padding: 14px 14px 12px; border-radius: var(--r-lg); background: var(--paper); box-shadow: var(--shadow); }
.wk[hidden] { display: none; }
.wk__head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.wk__head span { font-size: 11px; color: var(--muted); }
.wk__grid { display: grid; grid-template-columns: 62px repeat(5, minmax(0, 1fr)); gap: 3px; margin-top: 4px; }
.wk__d { padding: 2px 0 4px; text-align: center; font-size: 10px; color: var(--muted); }
.wk__d b { display: block; font-weight: 400; font-size: 13px; color: var(--ink); }
.wk__d.is-me b { color: var(--brass-ink); }
.wk__st { align-self: center; font-size: 11.5px; font-weight: 600; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wk__c { display: flex; flex-direction: column; justify-content: space-between; gap: 3px; min-width: 0; min-height: 40px; padding: 4px 3px 3px; border-radius: 7px; background: var(--linen); }
.wk__c.is-me { background: var(--brass-soft); }
.wk__jobs { display: flex; flex-wrap: wrap; gap: 2px; }
.wk__job { padding: 1px 3px; border-radius: 4px; background: var(--sand); font: 400 9.5px/1.3 var(--mono); color: var(--ink-2); }
.wk__job.is-me { background: var(--brass); color: var(--ink); }
.wk__job.is-in { animation: job-in .7s var(--ease) both; animation-delay: calc(var(--i) * .12s + .15s); }
@keyframes job-in { 0% { opacity: 0; transform: translateY(-14px) scale(.6); } 100% { opacity: 1; transform: none; } }
.wk__load { display: block; height: 3px; border-radius: 2px; background: rgba(35, 28, 22, .08); overflow: hidden; }
.wk__load i { display: block; height: 100%; background: var(--ok); opacity: .7; }
.wk__load.is-over i { background: var(--red); opacity: 1; }
.wk__line { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; margin: 10px 0 0; padding-top: 10px; border-top: 1px solid var(--rule); }
.wk__line span { display: grid; gap: 1px; min-width: 0; }
.wk__line small { font: 500 9.5px/1.2 var(--mono); letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.wk__line b { font-size: 12.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wk__line .is-pose b { color: var(--brass-ink); }

/* ---------- Pièces imprimées : la fiche atelier ---------- */
@media print {
  @page { size: A4 landscape; margin: 10mm; }
  .demo-bar, .side, .topbar__r, .mfoot, .db__bar, .bds__head .seg, .db__others, .toasts, .inc__foot { display: none !important; }
  .shell { display: block; background: none; }
  .main { padding: 0; }
  body.ad { background: #fff; }
  .db__grid { display: block; }
  .inc, .kpis, .bds, .pieces, .db__hw, .wk { box-shadow: none; border: 1px solid #ccc; break-inside: avoid; margin-bottom: 8px; }
  .bg__boards { grid-template-columns: minmax(0, 1fr); }
  .bd { break-inside: avoid; page-break-after: always; }
  .bd svg { max-height: 165mm; }
  .tbl table { min-width: 0; }
}

/* ---------- Tablette ---------- */
@media (max-width: 1260px) { .boards { --cols: 2; } }
@media (max-width: 1100px) {
  .db__grid { grid-template-columns: minmax(0, 1fr); }
  .db__l, .db__r { display: contents; }
  .db__grid { display: flex; flex-direction: column; align-items: stretch; gap: 14px; }
  .inc { order: 1; } .wk { order: 2; } .kpis { order: 3; } .rulesx { order: 4; } .bds { order: 5; } .db__hw { order: 6; } .pieces { order: 7; } .db__others { order: 8; }
}

/* ---------- Téléphone et petite tablette : barre d'onglets en bas, en-tête noyer collé en haut ---------- */
@media (max-width: 860px) {
  .shell { display: block; min-height: 0; background: none; }
  .side { position: fixed; z-index: 70; left: 0; right: 0; bottom: 0; top: auto; height: auto; flex-direction: row; gap: 0; padding: 6px 6px calc(6px + env(safe-area-inset-bottom, 0px)); overflow: hidden; background: rgba(42, 32, 25, .97); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); box-shadow: 0 -12px 30px -18px rgba(0, 0, 0, .55); }
  .side__brand, .side__foot { display: none; }
  .nav { flex: 1; display: flex; flex-direction: row; gap: 2px; min-width: 0; }
  .nav a:not([data-prim]) { display: none; }
  .nav a, .nav__more { position: relative; flex: 1 1 0; min-width: 0; flex-direction: column; justify-content: center; gap: 3px; height: 56px; min-height: 0; padding: 0 2px; border-radius: 14px; font-size: 11px; font-weight: 600; text-align: center; }
  .side .nav__more { display: flex; align-items: center; color: inherit; }
  .nav a > span, .nav__more > span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .side .nav__long { display: none; }
  .side .nav__short { display: inline; }
  .nav a[aria-current="page"], .nav__more[aria-current="page"] { background: rgba(176, 135, 58, .2); color: #fff; box-shadow: none; }
  .nav a[aria-current="page"] .ico, .nav__more[aria-current="page"] .ico { color: var(--brass-2); }
  .nav .ico, .nav__more .ico { width: 21px; height: 21px; }
  .nav__badge { position: absolute; top: 4px; left: calc(50% + 6px); margin: 0; }
  .main { padding: 0 16px calc(96px + env(safe-area-inset-bottom, 0px)); }
  .topbar { position: sticky; top: 0; z-index: 30; align-items: center; margin: 0 -16px 14px; padding: 10px 16px; background: var(--walnut-bg); color: #fff; }
  .topbar__brand { display: block; flex: none; width: 34px; height: 34px; }
  .topbar__brand svg { width: 100%; height: 100%; }
  .topbar__l { flex: 1; min-width: 0; }
  .topbar__date { color: rgba(243, 238, 230, .55); font-size: 10.5px; margin-bottom: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .topbar h1 { font-size: 24px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .topbar__btn, .topbar__live { display: none; }
  .topbar__cur { background: rgba(243, 238, 230, .1); }
  .topbar__cur button { color: rgba(243, 238, 230, .7); }
  .topbar__cur [aria-pressed="true"] { background: var(--paper); color: var(--ink); }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .mfoot { display: grid; gap: 12px; justify-items: center; margin-top: 30px; }
  .pmode--flow { position: static; transform: none; background: var(--p-ink); }
  .toasts { top: 66px; }
  .db__bar .btn { display: none; }
  .db__src { flex-basis: 100%; max-width: none; }
  input.input, select.select, .search input { font-size: 16px; }
}
@media (max-width: 520px) {
  .boards { --cols: 2; }
  .kpis { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
  .kpi { padding: 10px 8px 9px; border-radius: 13px; }
  .kpi b { font-size: 19px; }
  .kpi small { font-size: 9px; letter-spacing: .05em; }
  .kpi span { font-size: 10px; white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
  .inc__who { font-size: 23px; }
  .bds { padding: 12px 10px 10px; }
  .bds__head h2 { font-size: 21px; }
}

/* ---------- Dans la page « en direct » (iframe) : l'écran de l'atelier, sans la démo autour ---------- */
.is-embed .shell { display: block; min-height: 100vh; background: none; }
.is-embed .side, .is-embed .mfoot, .is-embed .db__bar, .is-embed .topbar__btn { display: none !important; }
.is-embed .main { padding: 0 12px 24px; }
.is-embed .topbar { position: sticky; top: 0; z-index: 30; align-items: center; margin: 0 -12px 12px; padding: 10px 14px; background: var(--walnut-bg); color: #fff; }
.is-embed .topbar__brand { display: block; flex: none; width: 32px; height: 32px; }
.is-embed .topbar__brand svg { width: 100%; height: 100%; }
.is-embed .topbar__l { flex: 1; min-width: 0; }
.is-embed .topbar__date { color: rgba(243, 238, 230, .55); font-size: 10.5px; margin-bottom: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.is-embed .topbar h1 { font-size: 23px; }
.is-embed .topbar__live { display: inline-flex; }
.is-embed .toasts { top: 64px; }
.is-embed .topbar__cur { display: none !important; }

/* ==========================================================================
   Vues de la gestion (Aujourd'hui, Projets, Atelier, Pose, Stock, Paiements, Clients)
   ========================================================================== */

/* ---------- Navigation : libellés, pastilles, « Plus » ---------- */
.nav a { position: relative; }
.nav__short { display: none; }
.nav__more { display: none; }
.nav__badge { margin-left: auto; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; display: inline-grid; place-items: center; background: var(--brass); color: var(--ink); font: 600 11px/1 var(--mono); font-style: normal; }
.nav__badge[hidden] { display: none; }
.nav__badge--red { background: #d0573f; color: #fff; }
.nav__badge--warn { background: var(--warn); color: var(--ink); }
.nav__badge--brass { background: var(--brass-2); color: var(--ink); }
.nav__dot { position: absolute; top: 8px; left: calc(50% + 8px); width: 8px; height: 8px; border-radius: 50%; background: #d0573f; box-shadow: 0 0 0 2px var(--walnut-bg); }
.nav__dot[hidden] { display: none; }
.topbar__cur { flex: none; }
html:has(.drawer.is-open) .pmode--side { opacity: 1; pointer-events: auto; }
html:has(.drawer.is-open) .pmode--flow { opacity: 1; }

/* ---------- Panneaux génériques ---------- */
.panel { min-width: 0; padding: 18px 18px 16px; border-radius: var(--r-lg); background: var(--paper); box-shadow: var(--shadow); }
.panel__h { display: flex; align-items: baseline; justify-content: space-between; gap: 6px 14px; flex-wrap: wrap; margin-bottom: 10px; }
.panel__h h2 { margin: 0; font-family: var(--serif); font-weight: 400; font-size: 25px; line-height: 1.1; letter-spacing: -.005em; font-variant-numeric: lining-nums; }
.panel__n { font-size: 12px; color: var(--muted); }
.panel__a { font-size: 13px; font-weight: 600; color: var(--brass-ink); text-decoration: none; min-height: 44px; display: inline-flex; align-items: center; margin: -12px 0; }
.panel__lead { margin: -2px 0 12px; font-size: 13px; line-height: 1.45; color: var(--muted); }
.nw { white-space: nowrap; }
.empty { padding: 14px 4px; font-size: 13.5px; color: var(--muted); list-style: none; }
.live-chip { display: inline-flex; align-items: center; gap: 8px; font: 500 11px/1 var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--ok); }
.live-chip .live-dot { margin-top: 0; }
.is-new { animation: flash 2.4s var(--ease); }
@keyframes flash { 0% { background-color: rgba(176, 135, 58, .32); } 100% { background-color: transparent; } }

/* ---------- Tuiles de chiffres ---------- */
.kpis2 { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 12px; }
.kpi2 { position: relative; display: flex; flex-direction: column; gap: 4px; min-width: 0; padding: 16px 16px 14px; border-radius: var(--r-lg); background: var(--paper); box-shadow: var(--shadow); text-decoration: none; color: inherit; transition: transform .25s var(--ease), box-shadow .25s; }
a.kpi2:hover { transform: translateY(-2px); }
.kpi2 small { font: 500 10.5px/1.2 var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.kpi2 b { font-family: var(--mono); font-weight: 400; font-size: 32px; line-height: 1.1; letter-spacing: -.04em; white-space: nowrap; }
.kpi2__sub { font-size: 12.5px; line-height: 1.35; color: var(--muted); }
.kpi2__spark { position: absolute; top: 14px; right: 14px; }
.kpi2--brass { background: var(--walnut-bg); color: #fff; }
.kpi2--brass small, .kpi2--brass .kpi2__sub { color: rgba(243, 238, 230, .62); }
.kpi2--brass b { color: var(--brass-2); }
.kpi2--alert b { color: var(--red); }
.spark path { fill: none; stroke: var(--brass); stroke-width: 1.8; stroke-linejoin: round; stroke-linecap: round; }
.spark circle { fill: var(--brass); }
.chips2 { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 12px; }
.chips2:empty { display: none; }
.chip2 { display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 6px 14px; text-align: left; line-height: 1.3; border-radius: 999px; background: var(--brass-soft); color: var(--brass-ink); font-size: 13px; font-weight: 600; text-decoration: none; }
.chip2 .ico { width: 17px; height: 17px; }
.chip2--red { background: rgba(180, 68, 47, .12); color: var(--red); }

/* ---------- Aujourd'hui ---------- */
.home__grid { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 12px; align-items: start; margin-bottom: 12px; }
.home__grid--b { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.home__side { display: grid; gap: 12px; min-width: 0; }
.feed, .todo, .agenda, .pl, .prows, .crows, .rows, .jos, .pps, .flines, .frules, .bfs, .sk__rows { margin: 0; padding: 0; list-style: none; }
.fi { border-top: 1px solid var(--rule); border-radius: 12px; }
.fi:first-child { border-top: 0; }
.fi__a { display: grid; grid-template-columns: 30px minmax(0, 1fr) auto; gap: 12px; align-items: start; width: 100%; padding: 11px 4px; text-align: left; text-decoration: none; color: inherit; }
.fi__m { font-size: 14px; line-height: 1.4; color: var(--ink-2); }
.fi__m b { font-weight: 600; color: var(--ink); }
.fi__m small { display: block; margin-top: 2px; font-size: 12.5px; color: var(--muted); }
.fi time { font-size: 11.5px; color: var(--muted); white-space: nowrap; padding-top: 2px; }
.fi__ic { position: relative; width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: var(--sand); color: var(--ink-2); }
.fi__ic .ico { width: 16px; height: 16px; stroke-width: 2; }
.fi__ic--ok { background: rgba(79, 122, 87, .14); color: var(--ok); }
.fi__ic--brass { background: var(--brass-soft); color: var(--brass-ink); }
.fi__ic--draft::after, .fi__ic--anon::after { content: ""; position: absolute; inset: 11px; border-radius: 50%; background: var(--brass); }
.fi__ic--anon { background: var(--linen); }
.fi__ic--anon::after { background: var(--sand-2); }
.fi__ic--draft::before { content: ""; position: absolute; inset: 5px; border-radius: 50%; border: 2px solid var(--brass); animation: live 1.6s ease-out infinite; }
.fi--anon .fi__m { color: var(--muted); }
.td { display: flex; align-items: center; gap: 10px; padding: 10px 0 10px 12px; border-top: 1px solid var(--rule); position: relative; }
.td:first-child { border-top: 0; }
.td::before { content: ""; position: absolute; left: 0; top: 12px; bottom: 12px; width: 3px; border-radius: 2px; background: var(--sand-2); }
.td--red::before { background: var(--red); }
.td--warn::before { background: var(--warn); }
.td--brass::before { background: var(--brass); }
.td--info::before { background: #6b8796; }
.td__m { flex: 1; min-width: 0; text-align: left; text-decoration: none; color: inherit; padding: 2px 0; }
.td__m b { display: block; font-size: 14px; font-weight: 600; line-height: 1.3; }
.td__m small { display: block; margin-top: 2px; font-size: 12.5px; line-height: 1.4; color: var(--muted); }
.td__b { display: flex; gap: 6px; flex: none; }
.td .btn { flex: none; }
.insights { display: grid; gap: 10px; }
.insights--row { grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr)); margin-bottom: 12px; }
.insights:empty { display: none; }
.ins { display: flex; align-items: flex-start; gap: 12px; padding: 14px 16px; border-radius: var(--r); background: var(--brass-soft); }
.ins .ico { width: 20px; height: 20px; margin-top: 1px; color: var(--brass-ink); }
.ins p { flex: 1; margin: 0; font-size: 14px; line-height: 1.45; color: var(--ink-2); }
.ins b { color: var(--ink); font-weight: 600; }
.ins .btn { flex: none; align-self: center; }
.ins--red { background: rgba(180, 68, 47, .1); }
.ins--red .ico { color: var(--red); }
.ins--ok { background: rgba(79, 122, 87, .11); }
.ins--ok .ico { color: var(--ok); }
.ag { border-top: 1px solid var(--rule); border-radius: 10px; }
.ag:first-child { border-top: 0; }
.ag, .ag__a { display: flex; align-items: center; gap: 12px; }
.ag { padding: 0; }
.ag > .ag__d, .ag > .ag__m { padding: 10px 0; }
.ag__a { flex: 1; min-width: 0; padding: 10px 2px; text-align: left; color: inherit; }
.ag__d { flex: none; width: 92px; display: grid; font-size: 12px; color: var(--muted); }
.ag__d b { font-family: var(--sans); font-size: 13px; font-weight: 600; color: var(--ink); }
.ag__m { flex: 1; min-width: 0; }
.ag__m b { display: block; font-size: 14px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ag__m small { display: block; font-size: 12.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ag__sw { flex: none; width: 10px; height: 34px; border-radius: 3px; background: var(--c); }
.ag--sum { padding: 12px 2px 2px; font-size: 13.5px; color: var(--ink-2); }

/* ---------- Avatars, pastilles de finition ---------- */
.av { flex: none; width: 38px; height: 38px; border-radius: 50%; display: inline-grid; place-items: center; background: var(--sand); color: var(--walnut); font: 600 13px/1 var(--sans); letter-spacing: .02em; }
.av--lg { width: 46px; height: 46px; font-size: 15px; margin-right: 12px; vertical-align: middle; }
.sw { display: inline-block; width: 12px; height: 12px; margin-right: 5px; border-radius: 3px; background: var(--c); box-shadow: inset 0 0 0 1px rgba(35, 28, 22, .2); vertical-align: -1px; }
.sw[data-wood] { background-image: repeating-linear-gradient(90deg, transparent 0 3px, rgba(35, 28, 22, .14) 3px 4px); }

/* ---------- Projets & devis ---------- */
.pipe { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 8px; margin-bottom: 12px; }
.pipe__c { display: grid; gap: 2px; min-width: 0; padding: 12px 12px 11px; border-radius: 16px; background: var(--paper); box-shadow: var(--shadow); text-align: left; transition: box-shadow .2s, background-color .2s; }
.pipe__c small { font: 500 10px/1.6 var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pipe__c b { font-family: var(--mono); font-weight: 400; font-size: 24px; line-height: 1.1; letter-spacing: -.03em; }
.pipe__c span { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pipe__c[aria-pressed="true"] { background: var(--ink); color: var(--paper); box-shadow: none; }
.pipe__c[aria-pressed="true"] small, .pipe__c[aria-pressed="true"] span { color: rgba(251, 248, 243, .62); }
.toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 16px; margin-bottom: 10px; }
.toolbar__n { margin: 0; font-size: 12.5px; color: var(--muted); }
.search { position: relative; flex: 1 1 280px; max-width: 460px; min-width: 0; }
.search .ico { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); width: 18px; height: 18px; color: var(--muted); pointer-events: none; }
.search .input { padding-left: 42px; font-size: 15px; }
.plist { border-radius: var(--r-lg); background: var(--paper); box-shadow: var(--shadow); padding: 4px 10px; }
.plist__more { margin: 10px auto 12px; display: flex; }
.prows li + li .prow { border-top: 1px solid var(--rule); }
.prow { display: grid; grid-template-columns: 64px minmax(0, 1.3fr) minmax(0, 1.4fr) minmax(0, 1fr) minmax(0, 1fr); gap: 14px; align-items: center; width: 100%; padding: 10px 6px; text-align: left; color: inherit; border-radius: 12px; }
.prow:hover { background: var(--linen); }
.prow__th { display: grid; place-items: center; width: 64px; height: 56px; border-radius: 10px; background: var(--linen); overflow: hidden; }
.prow__th svg { width: 56px; height: 50px; }
.prow b { display: block; font-size: 14.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.prow small { display: block; margin-top: 2px; font-size: 12.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.prow em { font-style: normal; color: var(--ok); font-weight: 600; }
.prow__st { display: grid; justify-items: start; gap: 3px; min-width: 0; }
.prow__amt { display: grid; justify-items: end; gap: 4px; min-width: 0; }
.prow__amt b { font-family: var(--mono); font-weight: 400; font-size: 15px; }
.prow--live { box-shadow: inset 3px 0 0 var(--ok); }

/* ---------- Planning atelier ---------- */
.at__bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.at__lg { display: flex; flex-wrap: wrap; gap: 4px 14px; margin: 0; font-size: 12px; color: var(--muted); }
.at__lg span { display: inline-flex; align-items: center; gap: 6px; }
.lgb { width: 18px; height: 10px; border-radius: 3px; background: var(--brass); }
.lgb--prov { background: transparent; box-shadow: inset 0 0 0 1.5px var(--brass); background-image: repeating-linear-gradient(135deg, transparent 0 3px, rgba(176, 135, 58, .35) 3px 5px); }
.lgl { width: 18px; height: 4px; border-radius: 2px; background: var(--ok); }
.at__plan { margin-bottom: 12px; }
.at__grid { display: grid; grid-template-columns: 150px repeat(5, minmax(0, 1fr)) minmax(0, .55fr); gap: 4px; }
.at__d { display: grid; justify-items: center; padding: 4px 0 6px; font-size: 11px; color: var(--muted); }
.at__d small { text-transform: capitalize; }
.at__d b { font-family: var(--mono); font-weight: 400; font-size: 17px; color: var(--ink); }
.at__d.is-today b { color: #fff; background: var(--ink); border-radius: 999px; min-width: 30px; padding: 1px 6px; text-align: center; }
.at__d--sat { opacity: .55; }
.at__st { display: grid; align-content: center; gap: 1px; padding-right: 6px; min-width: 0; }
.at__st b { font-size: 13px; font-weight: 600; line-height: 1.2; }
.at__st small { font-size: 11px; color: var(--muted); }
.at__c { position: relative; display: flex; flex-direction: column; justify-content: space-between; gap: 4px; min-width: 0; min-height: 72px; padding: 6px 6px 5px; border-radius: 10px; background: var(--linen); }
.at__c.is-today { background: #efe6d6; box-shadow: inset 0 0 0 1.5px rgba(176, 135, 58, .45); }
.at__c.is-past { opacity: .62; }
.at__c.is-over { background: rgba(180, 68, 47, .09); box-shadow: inset 0 0 0 1.5px rgba(180, 68, 47, .5); }
.at__c--sat { justify-content: center; align-items: center; background: repeating-linear-gradient(135deg, transparent 0 6px, rgba(35, 28, 22, .04) 6px 12px); font-size: 10.5px; color: var(--muted); text-align: center; }
.at__jobs { display: flex; flex-wrap: wrap; gap: 3px; }
.job { display: inline-flex; align-items: baseline; gap: 3px; min-height: 26px; padding: 3px 7px; border-radius: 6px; background: var(--c); color: #fff; font: 500 11.5px/1.2 var(--mono); box-shadow: inset 0 -1px 0 rgba(0, 0, 0, .18); }
.job small { font-size: 10px; opacity: .85; }
.job.is-done { opacity: .55; }
.job.is-now { box-shadow: 0 0 0 2px var(--paper), 0 0 0 3.5px var(--c); }
.job--prov { background: transparent; color: var(--ink); box-shadow: inset 0 0 0 1.5px var(--c); background-image: repeating-linear-gradient(135deg, transparent 0 4px, rgba(176, 135, 58, .22) 4px 7px); }
.job.is-new { animation: job-in .7s var(--ease) both; }
.at__load { display: block; height: 4px; border-radius: 2px; background: rgba(35, 28, 22, .08); overflow: hidden; }
.at__load i { display: block; height: 100%; background: var(--ok); opacity: .75; }
.at__c.is-over .at__load i { background: var(--red); opacity: 1; }
.at__c > small { position: absolute; right: 6px; bottom: 8px; font-size: 10px; color: var(--muted); }
.at__c.is-over > small { color: var(--red); font-weight: 600; }
.at__c .at__load { margin-right: 34px; }
.dayseg { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 4px; margin-bottom: 10px; }
.dayseg button { position: relative; display: grid; justify-items: center; gap: 1px; min-height: 52px; padding: 6px 0; border-radius: 12px; background: var(--linen); color: var(--muted); font-size: 11px; }
.dayseg button b { font: 400 17px/1.1 var(--mono); color: var(--ink); }
.dayseg button[aria-selected="true"] { background: var(--ink); color: rgba(251, 248, 243, .7); }
.dayseg button[aria-selected="true"] b { color: #fff; }
.dayseg .is-today:not([aria-selected="true"]) { box-shadow: inset 0 0 0 1.5px var(--brass); }
.dot-red { position: absolute; top: 6px; right: 8px; width: 7px; height: 7px; border-radius: 50%; background: var(--red); }
.at__list { display: grid; gap: 6px; }
.at__row { display: grid; grid-template-columns: 112px minmax(0, 1fr); gap: 8px; align-items: stretch; }
.at__row .at__c { min-height: 56px; }
.rules { display: grid; gap: 0; margin: 0; }
.rules div { display: grid; grid-template-columns: 130px minmax(0, 1fr); gap: 12px; padding: 8px 0; border-top: 1px solid var(--rule); }
.rules div:first-child { border-top: 0; }
.rules dt { font-size: 12.5px; font-weight: 600; }
.rules dd { margin: 0; font-size: 12.5px; line-height: 1.45; color: var(--ink-2); font-variant-numeric: tabular-nums; }

/* ---------- Pose & livraison ---------- */
.po__lanes { display: grid; grid-template-columns: 70px minmax(0, 1fr) minmax(0, 1fr); gap: 10px; margin-bottom: 6px; }
.po__lane { display: grid; padding: 0 4px; }
.po__lane b { font-size: 13px; }
.po__lane small { font-size: 11.5px; color: var(--muted); }
.po__wt { margin: 14px 0 6px; font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--brass-ink); }
.po__wk:first-child .po__wt { margin-top: 2px; }
.po__d { display: grid; grid-template-columns: 70px minmax(0, 1fr) minmax(0, 1fr); gap: 10px; padding: 8px 0; border-top: 1px solid var(--rule); }
.po__d.is-past { opacity: .6; }
.po__dl { display: grid; align-content: start; justify-items: start; }
.po__dl small { font-size: 11px; color: var(--muted); text-transform: capitalize; }
.po__dl b { font: 400 22px/1.1 var(--mono); }
.po__d.is-today .po__dl b { color: var(--brass-ink); }
.po__c { display: grid; gap: 8px; align-content: start; min-width: 0; }
.po__free { display: grid; place-items: center; min-height: 44px; border-radius: 12px; border: 1px dashed var(--rule-2); font-size: 12px; color: var(--muted); }
.ps { position: relative; min-width: 0; border-radius: 14px; background: var(--linen); box-shadow: inset 3px 0 0 var(--c); overflow: hidden; }
.ps.is-done { opacity: .6; }
.ps__h { display: grid; gap: 2px; width: 100%; padding: 10px 12px 6px 14px; text-align: left; color: inherit; }
.ps__t { font-size: 11.5px; color: var(--brass-ink); }
.ps__h b { font-size: 14.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ps__h small { font-size: 12.5px; color: var(--muted); line-height: 1.35; }
.ps__acc { display: flex; align-items: center; gap: 6px; }
.ps__acc .ico { width: 14px; height: 14px; }
.ps__f { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; padding: 2px 10px 10px 14px; }
.ps__due { margin-right: auto; font-size: 12.5px; color: var(--muted); }
.ps__due b { font-family: var(--mono); font-weight: 400; color: var(--ink); }
.ps__f .tag { margin-right: auto; }
.ps__f .tag + .tag, .ps__f .ps__due + .tag { margin-right: 0; }
.po__note { display: flex; align-items: flex-start; gap: 10px; margin: 12px 4px 0; font-size: 13px; color: var(--muted); }
.po__note .ico { width: 18px; height: 18px; }

/* ---------- Stock ---------- */
.sk__grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px; align-items: start; }
.sk__off { grid-column: 1 / -1; }
.skr { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(60px, 1fr) auto auto; gap: 12px; align-items: center; padding: 9px 0; border-top: 1px solid var(--rule); }
.skr:first-child { border-top: 0; }
.skr__m { min-width: 0; }
.skr__m b { font-size: 13.5px; font-weight: 600; }
.skr__m small { display: block; font: 400 11px/1.3 var(--mono); color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.skr__bar { position: relative; height: 8px; border-radius: 4px; background: rgba(35, 28, 22, .07); }
.skr__have { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 4px; background: var(--ok); opacity: .7; }
.skr--red .skr__have { background: var(--red); }
.skr--warn .skr__have { background: var(--warn); }
.skr__need { position: absolute; top: -3px; bottom: -3px; width: 2px; margin-left: -1px; background: var(--ink); }
.skr__n { font-size: 12.5px; color: var(--muted); white-space: nowrap; }
.skr__n b { font-weight: 500; color: var(--ink); }
.skr__t { justify-self: end; }
.offs { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.off { margin: 0; padding: 10px; border-radius: 12px; background: var(--linen); }
.off svg { display: block; margin-bottom: 6px; }
.off figcaption { display: grid; gap: 1px; font-size: 12px; }
.off figcaption small { color: var(--muted); }
.off figcaption .tag { justify-self: start; margin-top: 4px; }
.off.is-used { box-shadow: inset 0 0 0 1.5px var(--brass); }

/* ---------- Paiements ---------- */
.chart { min-height: 230px; }
.chart-svg { display: block; overflow: visible; }
.gridline { stroke: var(--rule); stroke-width: 1; }
.axis { stroke: var(--rule-2); stroke-width: 1; }
.tick { font-family: var(--mono); font-size: 11px; fill: var(--muted); font-variant-numeric: tabular-nums; }
.col__bar { fill: var(--oak); transition: fill .2s; }
.col--accent .col__bar { fill: var(--brass); }
.col.is-hover .col__bar { fill: var(--walnut); }
.col__ghost { fill: rgba(35, 28, 22, .07); }
.col__mark { font: 500 10.5px/1 var(--mono); fill: var(--brass-ink); }
.hit { fill: transparent; cursor: crosshair; outline: none; }
.tip { position: fixed; left: 0; top: 0; z-index: 95; max-width: 260px; padding: 8px 11px; border-radius: 10px; background: var(--ink); color: var(--paper); font-size: 12.5px; line-height: 1.4; pointer-events: none; box-shadow: var(--shadow-lg); }
.tip[hidden] { display: none; }
.tip span { color: rgba(251, 248, 243, .62); }
.lgc { display: inline-block; width: 10px; height: 10px; margin: 0 4px 0 10px; border-radius: 2px; background: var(--brass); vertical-align: -1px; }
.lgc--g { background: rgba(35, 28, 22, .12); }
.pa__mode { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin: 12px 0; font-size: 13px; color: var(--muted); }
.pa .panel { margin-bottom: 0; }
.pa > .panel { margin-bottom: 12px; }
.pr { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-top: 1px solid var(--rule); border-radius: 10px; }
.pr:first-child { border-top: 0; }
.pr__m { flex: 1; min-width: 0; text-align: left; color: inherit; padding: 2px 0; }
.pr__m b { display: block; font-size: 14px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pr__m small { display: block; font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pr__r { display: grid; justify-items: end; gap: 2px; flex: none; }
.pr__r b { font-family: var(--mono); font-weight: 400; font-size: 14px; white-space: nowrap; }
.pr__r small { font-size: 11.5px; color: var(--muted); white-space: nowrap; }
.x3 { display: flex; gap: 4px; }
.x3 i { width: 22px; height: 7px; border-radius: 4px; background: rgba(35, 28, 22, .12); }
.x3 i.is-paid { background: var(--ok); }
.bfs--mini li { display: grid; grid-template-columns: 22px minmax(0, 1fr) 120px; gap: 10px; align-items: center; padding: 5px 0; font-size: 12px; }
.bfs--mini small { color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bfs__bar { display: grid; grid-template-columns: 3fr 7fr; gap: 2px; height: 8px; }
.bfs__bar i { border-radius: 3px; background: rgba(35, 28, 22, .08); }
.bfs__bar i.is-30 { background: var(--oak); }
.bfs__bar i.is-70 { background: var(--ok); }

/* ---------- Clients ---------- */
.belv { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 420px); gap: 24px; align-items: center; margin-bottom: 12px; }
.belv__t { margin: 6px 0 6px; font-family: var(--serif); font-weight: 400; font-size: 34px; line-height: 1.05; }
.belv__p { margin: 0 0 12px; font-size: 14px; line-height: 1.5; color: var(--ink-2); max-width: 52ch; }
.belv__a { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; margin: 14px 0 0; }
.belv__g { display: grid; gap: 8px; padding: 14px; border-radius: 16px; background: var(--linen); text-align: left; }
.bgrid { display: grid; gap: 4px; }
.bgrid__f { display: grid; grid-template-columns: 18px repeat(6, minmax(0, 1fr)); gap: 4px; align-items: center; }
.bgrid__f > span { font-size: 10.5px; color: var(--muted); text-align: right; padding-right: 4px; }
.bl { display: block; height: 18px; border-radius: 3px; background: var(--sand-2); }
.bl--pose { background: var(--ok); }
.bl--fab { background: var(--brass); background-image: repeating-linear-gradient(135deg, transparent 0 4px, rgba(255, 255, 255, .25) 4px 7px); }
.bl--avenir { background: transparent; box-shadow: inset 0 0 0 1.2px var(--rule-2); }
.bgrid--big .bl { height: 30px; display: grid; place-items: center; }
.bgrid--big .bl small { font: 500 10px/1 var(--mono); color: rgba(255, 255, 255, .9); }
.bgrid--big .bl--avenir small { color: var(--muted); }
.bleg { display: flex; flex-wrap: wrap; gap: 4px 14px; margin: 8px 0 0; font-size: 11.5px; color: var(--muted); }
.bleg span { display: inline-flex; align-items: center; gap: 6px; }
.bleg .bl { width: 14px; height: 10px; }
.crows { border-radius: var(--r-lg); background: var(--paper); box-shadow: var(--shadow); padding: 4px 10px; }
.crows li + li .crow { border-top: 1px solid var(--rule); }
.crow { display: grid; grid-template-columns: 38px minmax(0, 1.4fr) minmax(0, 1fr) auto; gap: 14px; align-items: center; width: 100%; padding: 10px 6px; text-align: left; color: inherit; border-radius: 12px; }
.crow:hover { background: var(--linen); }
.crow__m b { display: block; font-size: 14.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.crow__m b .tag { margin-left: 6px; vertical-align: 1px; }
.crow__m small, .crow__p small { display: block; font-size: 12.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.crow__p { min-width: 0; }
.crow__a { display: grid; justify-items: end; }
.crow__a b { font-family: var(--mono); font-weight: 400; font-size: 14px; white-space: nowrap; }
.crow__a small { font-size: 11.5px; color: var(--muted); }
.crows__more { display: flex; justify-content: center; padding: 10px 0; }
.toolbar .seg button { gap: 5px; }
.toolbar .seg span { font-weight: 400; opacity: .7; }

/* ---------- Fiche latérale ---------- */
.drawer { position: fixed; inset: 0; z-index: 80; visibility: hidden; overflow: hidden; pointer-events: none; }
.drawer.is-open { visibility: visible; pointer-events: auto; }
.drawer__scrim { position: absolute; inset: 0; background: rgba(35, 28, 22, .36); opacity: 0; transition: opacity .3s; }
.drawer.is-open .drawer__scrim { opacity: 1; }
.drawer__panel { position: absolute; top: 0; right: 0; bottom: 0; width: min(560px, 100%); display: flex; flex-direction: column; padding-top: 62px; background: var(--paper); box-shadow: -20px 0 50px -20px rgba(0, 0, 0, .35); transform: translateX(104%); transition: transform .45s var(--ease); outline: none; }
.drawer.is-open .drawer__panel { transform: none; }
.drawer__close { position: absolute; top: 10px; right: 14px; z-index: 3; width: 44px; height: 44px; display: grid; place-items: center; border-radius: 50%; background: var(--paper); box-shadow: inset 0 0 0 1px var(--rule-2), 0 6px 16px -8px rgba(35, 28, 22, .4); }
.drawer__close .ico { width: 18px; height: 18px; }
.drawer__body { flex: 1; overflow-y: auto; overscroll-behavior: contain; padding: 0 26px calc(40px + env(safe-area-inset-bottom, 0px)); border-top: 1px solid transparent; display: flex; flex-direction: column; gap: 12px; }
.drawer .kicker { padding-right: 0; }
.fh { margin: 0; font-family: var(--serif); font-weight: 400; font-size: 34px; line-height: 1.05; letter-spacing: -.01em; display: flex; align-items: center; }
.fsub { margin: -6px 0 0; font-size: 13.5px; color: var(--muted); }
.ftags { display: flex; flex-wrap: wrap; gap: 6px; }
.ffig { margin: 0; padding: 12px; border-radius: 16px; background: var(--linen); }
.ffig svg { width: 100%; height: auto; max-height: 360px; }
.ffig figcaption { margin-top: 6px; font-size: 11.5px; color: var(--muted); text-align: center; }
.fsteps { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 2px; margin: 0; padding: 0; list-style: none; }
.fsteps li { position: relative; display: grid; justify-items: center; gap: 2px; text-align: center; padding-top: 14px; }
.fsteps li::before { content: ""; position: absolute; top: 4px; left: 0; right: 0; height: 2px; background: var(--sand-2); }
.fsteps li.is-done::before, .fsteps li.is-now::before { background: var(--ok); }
.fsteps i { position: absolute; top: 0; width: 10px; height: 10px; border-radius: 50%; background: var(--paper); box-shadow: inset 0 0 0 2px var(--sand-2); }
.fsteps .is-done i { background: var(--ok); box-shadow: none; }
.fsteps .is-now i { background: var(--brass); box-shadow: 0 0 0 4px var(--brass-soft); }
.fsteps b { font-size: 10.5px; font-weight: 600; line-height: 1.2; }
.fsteps small { font-size: 10px; color: var(--muted); }
.acts { display: grid; gap: 8px; }
.act { justify-content: flex-start; gap: 12px; min-height: 58px; padding: 8px 18px; border-radius: 18px; white-space: normal; text-align: left; }
.act .ico { width: 20px; height: 20px; }
.act span { display: grid; gap: 1px; min-width: 0; }
.act b { font-size: 14.5px; font-weight: 650; line-height: 1.2; }
.act small { font-size: 12.5px; font-weight: 500; opacity: .78; line-height: 1.25; }
.act[disabled] { opacity: .55; }
.act__ok { display: flex; align-items: flex-start; gap: 9px; margin: 0; padding: 11px 13px; border-radius: 14px; background: rgba(79, 122, 87, .1); color: #2f5136; font-size: 13.5px; line-height: 1.4; }
.act__ok .ico { width: 18px; height: 18px; color: var(--ok); stroke-width: 2.2; }
.fs { padding-top: 12px; border-top: 1px solid var(--rule); display: grid; gap: 10px; }
.fs__t { margin: 0; font: 500 11px/1.2 var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.fs__lead { margin: 0; font-size: 13.5px; line-height: 1.5; color: var(--ink-2); }
.fs__note { margin: 0; font-size: 12px; color: var(--muted); }
.fs .btn { justify-self: start; }
.flines li { display: flex; justify-content: space-between; align-items: baseline; gap: 14px; padding: 6px 0; border-top: 1px solid var(--rule); font-size: 13.5px; }
.flines li:first-child { border-top: 0; }
.flines li small { color: var(--muted); }
.flines li b { font-family: var(--mono); font-weight: 400; white-space: nowrap; }
.flines .is-total { border-top: 1.5px solid var(--ink); font-weight: 600; }
.flines .is-total b { font-size: 16px; color: var(--brass-ink); }
.frules li { display: flex; align-items: flex-start; gap: 8px; padding: 6px 0; font-size: 13.5px; line-height: 1.45; }
.frules .ico { width: 17px; height: 17px; margin-top: 1px; color: var(--brass-ink); }
.frules--red .ico { color: var(--red); }
.frules--quiet { color: var(--muted); }
.pps li { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 10px; align-items: center; padding: 8px 0; border-top: 1px solid var(--rule); border-radius: 8px; }
.pps li:first-child { border-top: 0; }
.pps span b { display: block; font-size: 13.5px; font-weight: 600; }
.pps span small { font-size: 11.5px; color: var(--muted); }
.pps > li > b { font-family: var(--mono); font-weight: 400; font-size: 14px; white-space: nowrap; }
.pp__sum { display: flex; justify-content: space-between; gap: 10px; font-size: 13px; color: var(--muted); }
.pp__sum b { font-family: var(--mono); font-weight: 400; color: var(--ink); }
.pp__mode { display: grid; gap: 6px; }
.pp__mode small { font-size: 12px; color: var(--muted); }
.seg--modes { display: flex; flex-wrap: wrap; border-radius: 16px; }
.seg--modes button { flex: 1 1 auto; }
.cots { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.cot { position: relative; }
.cot .input { padding-right: 34px; }
.cot em { position: absolute; right: 12px; bottom: 15px; font-style: normal; font-size: 12px; color: var(--muted); }
.fdeb { display: grid; grid-template-columns: repeat(auto-fit, minmax(90px, 1fr)); gap: 8px; }
.fdeb span { display: grid; gap: 1px; padding: 10px 12px; border-radius: 12px; background: var(--linen); min-width: 0; }
.fdeb b { font-family: var(--mono); font-weight: 400; font-size: clamp(15px, 4.2vw, 19px); letter-spacing: -.03em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fdeb small { font-size: 11.5px; color: var(--muted); }
.ffoot { margin: 6px 0 0; font-size: 13px; color: var(--muted); }
.ffoot .link { font-weight: 600; min-height: 44px; display: inline-flex; align-items: center; }
.rows--mini .row { display: grid; grid-template-columns: 54px minmax(0, 1fr) auto; gap: 10px; align-items: center; width: 100%; padding: 8px 0; text-align: left; color: inherit; border-top: 1px solid var(--rule); }
.rows--mini li:first-child .row { border-top: 0; }
.row__th { display: grid; place-items: center; width: 54px; height: 48px; border-radius: 8px; background: var(--linen); }
.row__th svg { width: 46px; height: 42px; }
.row__m b { display: block; font-size: 13.5px; font-weight: 600; }
.row__m small { display: block; font-size: 11.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row__r { display: grid; justify-items: end; gap: 3px; }
.row__r b { font-family: var(--mono); font-weight: 400; font-size: 13px; }
.wa { margin: 0; padding: 12px; border-radius: 16px; background: #e9e3d6; }
.wa__to { display: flex; align-items: center; gap: 6px; margin-bottom: 8px; font-size: 12px; font-weight: 600; color: var(--ink-2); }
.wa__to .ico { width: 16px; height: 16px; }
.wa__b { margin: 0; padding: 10px 12px; border-radius: 4px 14px 14px 14px; background: var(--paper); font-size: 13.5px; line-height: 1.5; color: var(--ink); box-shadow: 0 1px 1px rgba(35, 28, 22, .08); }
.wa__n { display: block; margin-top: 6px; font-size: 11px; color: var(--muted); }
.jos li { display: grid; grid-template-columns: 6px minmax(0, 1fr) auto auto; gap: 10px; align-items: center; padding: 9px 0; border-top: 1px solid var(--rule); }
.jos li:first-child { border-top: 0; }
.jos i { align-self: stretch; border-radius: 3px; background: var(--c); }
.jo--done i { opacity: .4; }
.jos b { display: block; font-size: 13.5px; font-weight: 600; }
.jos small { font-size: 12px; color: var(--muted); }
.jos .mono { font-size: 12px; color: var(--muted); }
.bleg--d { margin-top: -4px; }
.bf { display: grid; grid-template-columns: 26px minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 8px 0; border-top: 1px solid var(--rule); }
.bf:first-child { border-top: 0; }
.bf__n { font-size: 15px; color: var(--muted); }
.bf__m b { display: block; font-size: 13.5px; font-weight: 600; }
.bf__m b .link { font: inherit; font-family: var(--mono); font-size: 12.5px; min-height: 0; }
.bf__m small, .bf__r small { display: block; font-size: 11.5px; color: var(--muted); }
.bf__r { display: grid; justify-items: end; }
.bf__r b { font-family: var(--mono); font-weight: 400; font-size: 13.5px; white-space: nowrap; }

/* ---------- « Plus » (téléphone) ---------- */
.msheet { position: fixed; inset: 0; z-index: 78; visibility: hidden; overflow: hidden; pointer-events: none; }
.msheet.is-open { visibility: visible; pointer-events: auto; }
.msheet__scrim { position: absolute; inset: 0; background: rgba(35, 28, 22, .36); opacity: 0; transition: opacity .3s; }
.msheet.is-open .msheet__scrim { opacity: 1; }
.msheet__panel { position: absolute; left: 0; right: 0; bottom: 0; padding: 8px 12px calc(84px + env(safe-area-inset-bottom, 0px)); border-radius: 22px 22px 0 0; background: var(--paper); box-shadow: var(--shadow-lg); transform: translateY(104%); transition: transform .4s var(--ease); }
.msheet.is-open .msheet__panel { transform: none; }
.msheet__grip { width: 40px; height: 4px; margin: 4px auto 10px; border-radius: 4px; background: var(--sand-2); }
.msheet__list { display: grid; gap: 4px; }
.msheet__list a { position: relative; display: flex; align-items: center; gap: 14px; min-height: 60px; padding: 8px 12px; border-radius: 16px; text-decoration: none; color: inherit; }
.msheet__list a[aria-current="page"] { background: var(--brass-soft); }
.msheet__list .ico { width: 22px; height: 22px; color: var(--brass-ink); }
.msheet__list span { display: grid; }
.msheet__list b { font-size: 15.5px; font-weight: 600; }
.msheet__list small { font-size: 12.5px; color: var(--muted); }
.msheet__list .nav__badge { position: static; margin-left: auto; }
html.has-more .side { z-index: 79; }

/* ---------- Mise en page intermédiaire ---------- */
@media (max-width: 1260px) {
  .pipe { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .prow { grid-template-columns: 64px minmax(0, 1.3fr) minmax(0, 1.4fr) minmax(0, 1fr); }
  .prow__st { display: none; }
  .at__grid { grid-template-columns: 120px repeat(5, minmax(0, 1fr)) minmax(0, .45fr); }
}
@media (max-width: 1100px) {
  .kpis2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .home__grid, .home__grid--b, .sk__grid { grid-template-columns: minmax(0, 1fr); }
  .belv { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 860px) {
  .kpis2 { gap: 10px; }
  .panel { padding: 16px 14px 14px; }
  .drawer__body { padding: 0 16px calc(36px + env(safe-area-inset-bottom, 0px)); }
  .toasts { z-index: 90; }
}
@media (max-width: 760px) {
  .pipe { display: flex; overflow-x: auto; scrollbar-width: none; margin: 0 -16px 12px; padding: 2px 16px 6px; scroll-snap-type: x proximity; }
  .pipe::-webkit-scrollbar { display: none; }
  .pipe__c { flex: 0 0 132px; scroll-snap-align: start; }
  .prow { grid-template-columns: 56px minmax(0, 1fr) auto; gap: 10px; padding: 10px 2px; }
  .prow__th { width: 56px; height: 52px; }
  .prow__what { grid-column: 2; grid-row: 2; }
  .prow__who { grid-column: 2; grid-row: 1; }
  .prow__th { grid-row: 1 / span 2; }
  .prow__amt { grid-column: 3; grid-row: 1 / span 2; }
  .plist { padding: 2px 8px; }
  .at__row { grid-template-columns: 96px minmax(0, 1fr); }
  .po__lanes { display: none; }
  .po__d { grid-template-columns: 44px minmax(0, 1fr); }
  .po__c { grid-column: 2; }
  .po__c .po__free { display: none; }
  .po__c:has(.po__free) { display: none; }
  .po__d:not(:has(.ps)) { grid-template-columns: 44px minmax(0, 1fr); }
  .po__d:not(:has(.ps))::after { content: "aucune pose"; align-self: center; font-size: 12px; color: var(--muted); }
  .po__c[data-team="B"] .ps::after { content: "Équipe B"; position: absolute; top: 9px; right: 10px; font: 500 10px/1 var(--mono); letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
  .skr { grid-template-columns: minmax(0, 1fr) auto; gap: 4px 10px; }
  .skr__bar { grid-column: 1 / -1; grid-row: 2; }
  .skr__n { grid-column: 1; grid-row: 3; }
  .skr__t { grid-column: 2; grid-row: 1; }
  .crow { grid-template-columns: 38px minmax(0, 1fr) auto; gap: 10px; }
  .crow__p { grid-column: 2; grid-row: 2; }
  .crow__a { grid-column: 3; grid-row: 1 / span 2; }
  .crow .av { grid-row: 1 / span 2; }
  .td { flex-wrap: wrap; }
  .td__b, .td > .btn { margin-left: auto; }
  .ins { flex-wrap: wrap; }
  .ins p { flex: 1 1 calc(100% - 40px); }
  .ins .btn { margin-left: 32px; }
  .rules div { grid-template-columns: minmax(0, 1fr); gap: 2px; }
  .fh { font-size: 29px; }
  .ffig svg { max-height: 300px; }
  .fsteps b { font-size: 9.5px; }
  .fsteps small { font-size: 9px; }
}
@media (max-width: 520px) {
  .kpis2 { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .kpi2 { padding: 13px 12px 12px; border-radius: 18px; }
  .kpi2 b { font-size: 23px; }
  .kpi2 small { font-size: 9.5px; letter-spacing: .06em; }
  .kpi2__sub { font-size: 11.5px; }
  .kpi2__spark { display: none; }
  .panel__h h2 { font-size: 22px; }
  .fi__a { grid-template-columns: 28px minmax(0, 1fr); }
  .fi time { grid-column: 2; grid-row: 2; padding-top: 0; }
  .ag__d { width: 78px; }
  .at__d b { font-size: 15px; }
  .cots { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
  .cot em { display: none; }
  .cot .input { padding: 0 8px; text-align: center; }
  .pps li { grid-template-columns: minmax(0, 1fr) auto; }
  .pps li > .tag, .pps li > .btn { grid-column: 1 / -1; justify-self: start; }
  .belv__t { font-size: 29px; }
  .bfs--mini li { grid-template-columns: 22px minmax(0, 1fr) 96px; }
}
@media print {
  .drawer, .msheet, .tip { display: none !important; }
}
/* Toasts : en bas à droite sur grand écran, à gauche de la fiche ouverte ; au-dessus de la barre d'onglets sur téléphone */
@media (min-width: 861px) {
  body.ad .toasts { top: auto; bottom: 20px; left: auto; right: 24px; transform: none; width: min(400px, calc(100vw - 48px)); }
  html.has-drawer body.ad .toasts { right: calc(min(560px, 100%) + 20px); }
}
@media (max-width: 860px) {
  body.ad .toasts { top: auto; bottom: calc(80px + env(safe-area-inset-bottom, 0px)); }
  html.has-drawer body.ad .toasts { bottom: calc(14px + env(safe-area-inset-bottom, 0px)); }
}
.is-embed body.ad .toasts { top: 64px; bottom: auto; }

/* iOS : jamais de champ sous 16 px sur téléphone (sinon la page zoome) — en dernier, pour passer devant .search .input */
@media (max-width: 860px) {
  .search .input, input.input, select.select, textarea, .cot .input { font-size: 16px; }
}
.job { position: relative; }
.job::after { content: ""; position: absolute; inset: -9px -2px; }
@media (max-width: 520px) {
  .fdeb { gap: 6px; }
  .fdeb span { padding: 10px 9px; }
  .fdeb b { font-size: 15px; letter-spacing: -.05em; }
}
/* Téléphone : cibles tactiles d'au moins 44 × 44 px (le dessin reste compact, la zone touchable déborde) */
@media (max-width: 860px) {
  .topbar__cur.seg--sm button[data-cur] { min-width: 44px; }
  .topbar__cur.seg--sm button::after { inset: -6px 0; }
  .job { min-width: 44px; justify-content: center; }
  .job::after { inset: -9px -1px; }
}
