/* ============================================================ thème */
:root {
  --bg: #f5f6fa;
  --surface: #ffffff;
  --surface-2: #f8f9fc;
  --text: #1a1f2e;
  --text-2: #5b6478;
  --text-3: #8a93a6;
  --line: #e6e8ef;
  --line-2: #d5d9e3;
  --accent: #3b5bdb;
  --accent-hover: #3049b8;
  --accent-soft: #edf1fe;
  --accent-text: #2f4ac0;
  --ok: #148a52;
  --ok-soft: #e5f6ed;
  --warn: #b25e00;
  --warn-soft: #fff3e0;
  --danger: #d0353a;
  --danger-soft: #fdecec;
  --shadow-sm: 0 1px 2px rgba(20, 28, 50, .05);
  --shadow: 0 1px 2px rgba(20, 28, 50, .04), 0 4px 16px rgba(20, 28, 50, .06);
  --shadow-lg: 0 10px 40px rgba(20, 28, 50, .18);
  --radius: 14px;
  --radius-sm: 9px;
  --side-w: 248px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #10131b;
    --surface: #181c26;
    --surface-2: #1e2330;
    --text: #e8ebf2;
    --text-2: #a4acbe;
    --text-3: #747d92;
    --line: #272d3b;
    --line-2: #343b4c;
    --accent: #5c7cfa;
    --accent-hover: #748ffc;
    --accent-soft: #1f2849;
    --accent-text: #9fb3ff;
    --ok: #3ccf8e;
    --ok-soft: #12301f;
    --warn: #ffb547;
    --warn-soft: #36270f;
    --danger: #ff6b6b;
    --danger-soft: #3a1a1c;
    --shadow-sm: none;
    --shadow: 0 1px 0 rgba(255, 255, 255, .02);
    --shadow-lg: 0 10px 40px rgba(0, 0, 0, .5);
    color-scheme: dark;
  }
}

/* ============================================================ base */
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 14.5px/1.5 -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  -webkit-font-smoothing: antialiased;
}
[hidden] { display: none !important; }
a { color: var(--accent-text); }
svg.i { width: 18px; height: 18px; flex-shrink: 0; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; vertical-align: middle; }
.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.muted { color: var(--text-2); }
.faint { color: var(--text-3); }
.small { font-size: 13px; }
.grow { flex: 1; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }

/* ============================================================ layout */
#app { display: flex; min-height: 100vh; }
#side {
  width: var(--side-w); flex-shrink: 0; background: var(--surface); border-right: 1px solid var(--line);
  position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; padding: 18px 14px;
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 16px; padding: 6px 8px; margin-bottom: 16px; letter-spacing: -.01em;
  width: 100%; border: 0; background: transparent; color: var(--text); text-align: left; border-radius: 12px; cursor: pointer; font-family: inherit; }
.brand:hover { background: var(--surface-2); }
.brand-chev { color: var(--text-3); display: grid; } .brand-chev svg { width: 14px; height: 14px; }
.appli-frame { width: 100%; height: calc(100vh - 150px); border: 1px solid var(--line); border-radius: 14px; background: #fff; }
@media (max-width: 900px) { .appli-frame { height: calc(100vh - 190px); } }
.brand .logo { width: 34px; height: 34px; border-radius: 10px; background: var(--accent); color: #fff; display: grid; place-items: center; }
.brand .logo svg { width: 20px; height: 20px; }
#brand { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.side-nav { flex: 1; overflow-y: auto; }
.side-nav a {
  display: flex; align-items: center; gap: 12px; padding: 9px 12px; margin-bottom: 2px; border-radius: 10px;
  color: var(--text-2); text-decoration: none; font-weight: 500;
}
.side-nav a:hover { background: var(--surface-2); color: var(--text); }
.side-nav a.active { background: var(--accent-soft); color: var(--accent-text); }
.side-label { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--text-3); font-weight: 600; padding: 18px 12px 6px; }
.side-foot { display: flex; align-items: center; gap: 8px; border-top: 1px solid var(--line); padding: 14px 6px 0; }
.who { flex: 1; display: flex; align-items: center; gap: 10px; min-width: 0; font-weight: 500; }
.who span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.avatar { width: 30px; height: 30px; border-radius: 50%; background: var(--accent-soft); color: var(--accent-text); display: grid; place-items: center; font-weight: 700; font-size: 13px; text-transform: uppercase; flex-shrink: 0; }

main { flex: 1; min-width: 0; padding: 28px 36px 60px; max-width: 1280px; }
#tabbar { display: none; }

/* ============================================================ en-tête de page */
.page-head { display: flex; align-items: center; gap: 14px; margin-bottom: 22px; flex-wrap: wrap; }
.page-head h1 { font-size: 24px; letter-spacing: -.02em; margin: 0; line-height: 1.2; }
.page-head .sub { color: var(--text-2); margin-top: 3px; }
.page-head .titles { flex: 1; min-width: 200px; }
.page-head .back { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; border: 1px solid var(--line); background: var(--surface); color: var(--text); text-decoration: none; }
.page-head .back:hover { background: var(--surface-2); }

/* ============================================================ boutons */
button, .btn {
  font: inherit; font-weight: 500; display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  padding: 8px 15px; border-radius: var(--radius-sm); border: 1px solid var(--line-2); background: var(--surface);
  color: var(--text); cursor: pointer; text-decoration: none; white-space: nowrap; transition: background .12s, border-color .12s, transform .05s;
  -webkit-tap-highlight-color: transparent;
}
button:hover, .btn:hover { background: var(--surface-2); }
button:active, .btn:active { transform: translateY(1px); }
button:disabled { opacity: .5; cursor: default; transform: none; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; box-shadow: 0 1px 2px rgba(59, 91, 219, .3); }
.btn-primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.btn-danger { color: var(--danger); border-color: transparent; background: transparent; }
.btn-danger:hover { background: var(--danger-soft); }
.btn-danger-solid { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn-danger-solid:hover { background: var(--danger); filter: brightness(1.08); }
.btn-ghost { border-color: transparent; background: transparent; color: var(--text-2); }
.btn-ghost:hover { color: var(--text); }
.btn-sm { padding: 5px 10px; font-size: 13px; border-radius: 8px; }
.btn-sm svg.i { width: 15px; height: 15px; }
.btn-lg { padding: 11px 20px; font-size: 15px; }
.icon-btn { width: 36px; height: 36px; padding: 0; border-radius: 50%; border-color: transparent; background: transparent; color: var(--text-2); }
.icon-btn:hover { color: var(--text); }

/* ============================================================ cartes */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px 22px; margin-bottom: 18px; }
.card-title { font-size: 15px; font-weight: 650; margin: 0 0 14px; display: flex; align-items: center; gap: 10px; }
.card-title .grow + * { font-weight: 500; }
.card.flush { padding: 0; overflow: hidden; }
.card.flush .card-title { padding: 16px 20px 0; }

/* ============================================================ formulaires */
.field label, .lbl { display: block; font-size: 12.5px; font-weight: 600; color: var(--text-2); margin-bottom: 6px; }
input, select, textarea {
  font: inherit; width: 100%; padding: 9px 12px; border-radius: var(--radius-sm); border: 1px solid var(--line-2);
  background: var(--surface); color: var(--text); transition: border-color .12s, box-shadow .12s;
}
input::placeholder, textarea::placeholder { color: var(--text-3); }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
input:disabled, textarea:disabled { background: var(--surface-2); color: var(--text-2); }
input[type=checkbox] { width: 18px; height: 18px; accent-color: var(--accent); margin: 0; vertical-align: middle; }
textarea { min-height: 80px; resize: vertical; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 16px 18px; }
.form-grid .wide { grid-column: 1 / -1; }
.check { display: flex; align-items: center; gap: 10px; font-weight: 500; cursor: pointer; }
.hint { font-size: 12.5px; color: var(--text-3); margin-top: 6px; }
.search { position: relative; }
.search svg.i { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--text-3); pointer-events: none; }
.search input { padding-left: 38px; }
.filters { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 16px; }
.filters .search { flex: 1; min-width: 220px; }
.filters select, .filters input[type=month] { width: auto; min-width: 150px; }

/* contrôle segmenté */
.seg { display: inline-flex; background: var(--surface-2); border: 1px solid var(--line); border-radius: 10px; padding: 3px; gap: 2px; }
.seg button { border: none; background: transparent; padding: 6px 12px; border-radius: 7px; color: var(--text-2); font-size: 13.5px; }
.seg button.on { background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm), 0 0 0 1px var(--line); }

/* ============================================================ autocomplétion */
.ac-wrap { position: relative; }
.ac-box {
  position: absolute; left: 0; right: 0; top: calc(100% + 4px); z-index: 30; background: var(--surface);
  border: 1px solid var(--line-2); border-radius: 12px; box-shadow: var(--shadow-lg); max-height: 300px; overflow-y: auto;
  display: none; padding: 4px; min-width: min(360px, 86vw);
}
.ac-box.open { display: block; }
.ac-item { padding: 8px 10px; border-radius: 8px; cursor: pointer; display: flex; justify-content: space-between; gap: 12px; align-items: baseline; }
.ac-item.on { background: var(--accent-soft); }
.ac-item small { color: var(--text-3); white-space: nowrap; font-variant-numeric: tabular-nums; }
.ac-item b { font-weight: 600; }
.ac-empty { padding: 10px; color: var(--text-3); font-size: 13px; }

/* ============================================================ tableaux (cartes sur mobile) */
.tbl { width: 100%; border-collapse: collapse; }
.tbl th { text-align: left; font-size: 12px; font-weight: 600; color: var(--text-3); text-transform: uppercase; letter-spacing: .04em; padding: 10px 16px; border-bottom: 1px solid var(--line); background: var(--surface-2); white-space: nowrap; }
.tbl td { padding: 12px 16px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.tbl tr:last-child td { border-bottom: none; }
.tbl tr.click { cursor: pointer; }
.tbl tr.click:hover td { background: var(--surface-2); }
.tbl tr.selrow td { background: var(--accent-soft); }
.tbl .strong { font-weight: 600; }
.tbl-foot { padding: 12px 16px; border-top: 1px solid var(--line); color: var(--text-2); font-size: 13px; display: flex; justify-content: space-between; gap: 10px; background: var(--surface-2); }

.m-only { display: none; }

.card.flush { overflow-x: auto; }
.badge { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 600; padding: 3px 9px; border-radius: 20px; white-space: nowrap; }
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge.ok { background: var(--ok-soft); color: var(--ok); }
.badge.warn { background: var(--warn-soft); color: var(--warn); }
.badge.danger { background: var(--danger-soft); color: var(--danger); }
.badge.neutral { background: var(--surface-2); color: var(--text-2); }

/* ============================================================ tableau de bord */
.hello h1 { font-size: 26px; }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 16px; margin-bottom: 18px; }
.kpi { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 4px; text-decoration: none; color: inherit; transition: border-color .15s, transform .15s; }
a.kpi:hover { border-color: var(--line-2); transform: translateY(-1px); }
.kpi .k-top { display: flex; align-items: center; justify-content: space-between; color: var(--text-2); font-weight: 500; font-size: 13.5px; }
.kpi .k-ico { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent-text); }
.kpi .k-ico.ok { background: var(--ok-soft); color: var(--ok); }
.kpi .k-ico.warn { background: var(--warn-soft); color: var(--warn); }
.kpi .k-ico.danger { background: var(--danger-soft); color: var(--danger); }
.kpi .k-val { font-size: 25px; font-weight: 700; letter-spacing: -.02em; font-variant-numeric: tabular-nums; margin-top: 6px; }
.kpi .k-sub { font-size: 13px; color: var(--text-3); }
.dash-grid { display: grid; grid-template-columns: 1.6fr 1fr; gap: 18px; }
.dash-grid .card { margin-bottom: 0; }
.chart { display: flex; align-items: flex-end; gap: 8px; height: 190px; padding-top: 10px; }
.chart .col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; height: 100%; justify-content: flex-end; min-width: 0; }
.chart .bar { width: 100%; max-width: 38px; background: var(--accent); opacity: .3; border-radius: 6px 6px 3px 3px; min-height: 3px; transition: opacity .15s; position: relative; }
.chart .col.cur .bar { opacity: 1; }
.chart .col:hover .bar { opacity: .85; }
.chart .m { font-size: 11.5px; color: var(--text-3); text-transform: capitalize; }
.chart .col .tip { position: absolute; bottom: calc(100% + 6px); left: 50%; transform: translateX(-50%); background: var(--text); color: var(--surface); font-size: 12px; padding: 3px 8px; border-radius: 6px; white-space: nowrap; opacity: 0; pointer-events: none; transition: opacity .12s; z-index: 2; }
.chart .col:hover .tip { opacity: 1; }
.list-item { display: flex; align-items: center; gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--line); text-decoration: none; color: inherit; }
.list-item:last-child { border-bottom: none; }
.list-item .li-main { flex: 1; min-width: 0; }
.list-item .li-main div:first-child { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.list-item .li-main div:last-child { font-size: 13px; color: var(--text-3); }
.callout { display: flex; align-items: center; gap: 16px; padding: 16px 20px; border-radius: var(--radius); background: var(--accent-soft); color: var(--accent-text); margin-bottom: 18px; flex-wrap: wrap; }
.callout.warn { background: var(--warn-soft); color: var(--warn); }
.callout .grow { min-width: 200px; }
.callout b { display: block; font-size: 15px; }
.steps { display: grid; gap: 10px; }
.step { display: flex; align-items: center; gap: 14px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; text-decoration: none; color: inherit; }
.step:hover { background: var(--surface-2); }
.step .n { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; font-size: 13px; background: var(--surface-2); color: var(--text-2); border: 1px solid var(--line-2); flex-shrink: 0; }
.step.done .n { background: var(--ok); border-color: var(--ok); color: #fff; }
.step.done .s-t { text-decoration: line-through; color: var(--text-3); }

/* ============================================================ éditeur de bon */
.client-card { display: flex; gap: 14px; align-items: flex-start; padding: 12px 14px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--line); margin-top: 10px; }
.client-card .avatar { width: 38px; height: 38px; font-size: 14px; }
.client-card .cc-name { font-weight: 650; }
.lines-head, .line { display: grid; grid-template-columns: minmax(150px, 1.6fr) minmax(160px, 2.6fr) 84px 70px 100px 74px 74px 108px 34px; gap: 8px; align-items: center; }
.avec-lot .lines-head, .avec-lot .line { grid-template-columns: minmax(130px, 1.4fr) minmax(150px, 2.4fr) 96px 78px 64px 92px 66px 62px 100px 34px; }
.lines-head { font-size: 12px; font-weight: 600; color: var(--text-3); text-transform: uppercase; letter-spacing: .04em; padding: 0 2px 8px; border-bottom: 1px solid var(--line); margin-bottom: 8px; }
.line { padding: 4px 2px; }
.line input { padding: 8px 10px; }
.line .tot { text-align: right; font-weight: 600; font-variant-numeric: tabular-nums; padding-right: 4px; }
.line .m { display: none; }
.line.special .pu { border-color: var(--ok); background: var(--ok-soft); }
.line .del { width: 32px; height: 32px; padding: 0; border: none; background: transparent; color: var(--text-3); border-radius: 8px; }
.line .del:hover { color: var(--danger); background: var(--danger-soft); }
.add-line { margin-top: 10px; color: var(--accent-text); border-style: dashed; width: 100%; justify-content: center; padding: 10px; background: transparent; }
.add-line:hover { background: var(--accent-soft); }
.totals-box { margin-left: auto; width: 300px; max-width: 100%; margin-top: 18px; }
.totals-box div { display: flex; justify-content: space-between; padding: 5px 0; color: var(--text-2); font-variant-numeric: tabular-nums; }
.totals-box .ttc { border-top: 1px solid var(--line); margin-top: 6px; padding-top: 10px; color: var(--text); font-size: 18px; font-weight: 700; }
.sticky-bar {
  position: sticky; bottom: 0; z-index: 5; background: color-mix(in srgb, var(--bg) 85%, transparent); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  padding: 14px 0; margin-top: 8px; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; border-top: 1px solid var(--line);
}
.sticky-bar .sb-total { margin-right: auto; font-size: 13px; color: var(--text-2); }
.sticky-bar .sb-total b { display: block; font-size: 19px; color: var(--text); font-variant-numeric: tabular-nums; }
.kbd { font-size: 11px; border: 1px solid var(--line-2); border-radius: 5px; padding: 1px 5px; color: var(--text-3); margin-left: 4px; font-family: inherit; }
.notice { display: flex; gap: 12px; align-items: center; padding: 12px 16px; border-radius: 12px; background: var(--warn-soft); color: var(--warn); margin-bottom: 18px; font-weight: 500; }
.notice.info { background: var(--accent-soft); color: var(--accent-text); }
.notice.ok { background: var(--ok-soft); color: var(--ok); }

/* ============================================================ facturation */
.period { display: flex; align-items: center; gap: 10px; }
.period .month { font-size: 20px; font-weight: 700; text-transform: capitalize; min-width: 190px; text-align: center; letter-spacing: -.01em; }
.fact-client { display: grid; grid-template-columns: 32px 1fr auto; gap: 14px; align-items: center; padding: 14px 20px; border-bottom: 1px solid var(--line); }
.fact-client:last-child { border-bottom: none; }
.fact-client .fc-name { font-weight: 600; }
.fact-client .fc-bons { font-size: 13px; color: var(--text-3); margin-top: 2px; }
.fact-client .fc-bons a { color: var(--text-2); }
.fact-client .fc-amt { text-align: right; font-variant-numeric: tabular-nums; }
.fact-client .fc-amt b { display: block; font-size: 16px; }
.fact-client .fc-amt span { font-size: 12.5px; color: var(--text-3); }

/* ============================================================ onglets */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 20px; overflow-x: auto; }
.tabs button { border: none; background: none; border-radius: 0; padding: 10px 14px; color: var(--text-2); border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tabs button.on { color: var(--accent-text); border-bottom-color: var(--accent); }
.tabs button:hover { background: none; color: var(--text); }

/* ============================================================ modale & toast */
#modal { position: fixed; inset: 0; background: rgba(12, 16, 28, .5); display: flex; align-items: flex-start; justify-content: center; padding: 7vh 16px 16px; z-index: 50; animation: fade .15s; backdrop-filter: blur(2px); }
#modal.hidden { display: none; }
.modal-box { background: var(--surface); border-radius: 18px; padding: 24px; width: min(720px, 100%); max-height: 86vh; overflow: auto; box-shadow: var(--shadow-lg); animation: pop .18s ease-out; }
.modal-box.sm { width: min(440px, 100%); }
.modal-box.lg { width: min(980px, 100%); }
.modal-box h2 { margin: 0 0 6px; font-size: 19px; letter-spacing: -.01em; }
.modal-box .m-sub { color: var(--text-2); margin-bottom: 18px; }
.modal-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 22px; flex-wrap: wrap; }
.modal-actions .left { margin-right: auto; }
@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { opacity: 0; transform: translateY(8px) scale(.98); } }
#toast {
  position: fixed; left: 50%; bottom: 28px; transform: translate(-50%, 20px); background: var(--text); color: var(--surface);
  padding: 11px 18px; border-radius: 12px; opacity: 0; transition: opacity .2s, transform .2s; pointer-events: none; z-index: 60;
  display: flex; gap: 10px; align-items: center; font-weight: 500; box-shadow: var(--shadow-lg); max-width: calc(100vw - 32px);
}
#toast.show { opacity: 1; transform: translate(-50%, 0); }
#toast.err { background: var(--danger); color: #fff; }

.empty { text-align: center; padding: 50px 20px; color: var(--text-2); }
.empty .e-ico { width: 56px; height: 56px; border-radius: 16px; background: var(--surface-2); display: grid; place-items: center; margin: 0 auto 14px; color: var(--text-3); }
.empty .e-ico svg { width: 26px; height: 26px; }
.empty h3 { margin: 0 0 6px; color: var(--text); font-size: 16px; }
.empty p { margin: 0 0 16px; }
.skeleton { height: 120px; border-radius: var(--radius); background: linear-gradient(90deg, var(--surface) 0%, var(--surface-2) 50%, var(--surface) 100%); background-size: 200% 100%; animation: sk 1.2s infinite; border: 1px solid var(--line); }
@keyframes sk { to { background-position: -200% 0; } }

/* ============================================================ écran de connexion */
#auth { min-height: 100vh; display: grid; place-items: center; padding: 20px; background: radial-gradient(1200px 600px at 20% -10%, var(--accent-soft), transparent), var(--bg); }
.auth-box { width: min(400px, 100%); background: var(--surface); border: 1px solid var(--line); border-radius: 20px; padding: 32px 30px; box-shadow: var(--shadow-lg); }
.auth-box .logo { width: 48px; height: 48px; border-radius: 14px; background: var(--accent); color: #fff; display: grid; place-items: center; margin-bottom: 18px; }
.auth-box .logo svg { width: 26px; height: 26px; }
.auth-box h1 { font-size: 22px; margin: 0 0 6px; letter-spacing: -.02em; }
.auth-box p { color: var(--text-2); margin: 0 0 22px; }
.auth-box .field { margin-bottom: 14px; }
.auth-box button { width: 100%; margin-top: 8px; }
.auth-err { color: var(--danger); font-size: 13.5px; min-height: 20px; margin-top: 10px; text-align: center; }
.auth-links { text-align: center; margin-top: 8px; font-size: 13.5px; } .auth-links a { color: var(--accent-text); }

/* ============================================================ mobile */
@media (max-width: 900px) {
  #side { display: none; }
  main { padding: 18px 16px calc(96px + env(safe-area-inset-bottom)); }
  #tabbar {
    display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; background: color-mix(in srgb, var(--surface) 92%, transparent);
    backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border-top: 1px solid var(--line);
    padding: 6px 6px calc(6px + env(safe-area-inset-bottom)); justify-content: space-around; align-items: center;
  }
  #tabbar a { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: 11px; font-weight: 500; color: var(--text-3); text-decoration: none; padding: 4px 0; -webkit-tap-highlight-color: transparent; }
  #tabbar a svg.i { width: 23px; height: 23px; }
  #tabbar a.active { color: var(--accent-text); }
  #tabbar .tab-new { flex: 0 0 auto; width: 52px; height: 52px; border-radius: 50%; background: var(--accent); color: #fff; justify-content: center; margin-top: -22px; box-shadow: 0 6px 18px rgba(59, 91, 219, .45); }
  #tabbar .tab-new svg.i { width: 26px; height: 26px; stroke-width: 2.2; }
  .page-head h1 { font-size: 21px; }
  .page-head .actions-desktop { display: none; }
  .card { padding: 16px; border-radius: 12px; }
  .dash-grid { grid-template-columns: 1fr; }
  .kpis { grid-template-columns: 1fr 1fr; gap: 10px; }
  .kpi { padding: 14px; }
  .kpi .k-val { font-size: 19px; }
  .kpi .k-ico { display: none; }
  .filters .search { flex-basis: 100%; }
  .filters select, .filters input[type=month] { flex: 1; min-width: 0; }
  .filters .seg { width: 100%; } .filters .seg button { flex: 1; }
  .chart { gap: 4px; height: 150px; }
  .chart .m { font-size: 10px; }

  /* tableaux → cartes */
  .tbl, .tbl tbody, .tbl tr, .tbl td { display: block; width: 100%; }
  .tbl thead { display: none; }
  .tbl tr { padding: 12px 16px; border-bottom: 1px solid var(--line); display: grid; grid-template-columns: 1fr auto; gap: 2px 12px; }
  .tbl tr:last-child { border-bottom: none; }
  .tbl td { padding: 0; border: none; text-align: left; }
  .tbl td.m-hide { display: none; }
  .m-only { display: inline; }

  .tbl td.m-title { font-weight: 600; font-size: 15px; grid-column: 1; }
  .tbl td.m-right { grid-column: 2; text-align: right; grid-row: 1; }
  .tbl td.m-right2 { grid-column: 2; text-align: right; grid-row: 2; }
  .tbl td.m-sub { grid-column: 1; color: var(--text-3); font-size: 13px; }
  .tbl td.m-actions { grid-column: 1 / -1; margin-top: 8px; display: flex; gap: 8px; }

  input, select, textarea { font-size: 16px; }
  .totals-box { width: 100%; }
  .sticky-bar { bottom: calc(68px + env(safe-area-inset-bottom)); margin: 8px -16px 0; padding: 12px 16px; }
  .sticky-bar .hide-m { display: none; }
  .kbd { display: none; }
  .modal-box { border-radius: 18px 18px 0 0; max-height: 92vh; padding: 20px 18px calc(20px + env(safe-area-inset-bottom)); }
  #modal { align-items: flex-end; padding: 0; }
  .fact-client { grid-template-columns: 28px 1fr; padding: 14px 16px; }
  .fact-client .fc-amt { grid-column: 2; text-align: left; }
  .period .month { min-width: 0; font-size: 18px; flex: 1; }
  #toast { bottom: calc(90px + env(safe-area-inset-bottom)); }
}

/* lignes de bon → cartes quand la place manque */
.lines-card { container-type: inline-size; }
@container (max-width: 880px) {
  .lines-head { display: none; }
  .line {
    grid-template-columns: 1fr 1fr 1fr; grid-template-areas: "art art del" "des des des" "qte uni pu" "rem tva tot";
    background: var(--surface-2); border: 1px solid var(--line); border-radius: 12px; padding: 12px; margin-bottom: 10px; gap: 10px;
  }
  .line > div:nth-child(1) { grid-area: art; } .line > div:nth-child(2) { grid-area: des; }
  .line > div:nth-child(3) { grid-area: qte; } .line > div:nth-child(4) { grid-area: uni; }
  .line > div:nth-child(5) { grid-area: pu; } .line > div:nth-child(6) { grid-area: rem; }
  .line > div:nth-child(7) { grid-area: tva; } .line > div:nth-child(8) { grid-area: tot; align-self: end; padding-bottom: 8px; font-size: 16px; }
  .line > div:nth-child(9) { grid-area: del; justify-self: end; }
  .avec-lot .line { grid-template-columns: 1fr 1fr 1fr; grid-template-areas: "art art del" "des des des" "lot qte uni" "pu rem tva" "tot tot tot"; }
  .avec-lot .line > div:nth-child(3) { grid-area: lot; } .avec-lot .line > div:nth-child(4) { grid-area: qte; }
  .avec-lot .line > div:nth-child(5) { grid-area: uni; } .avec-lot .line > div:nth-child(6) { grid-area: pu; }
  .avec-lot .line > div:nth-child(7) { grid-area: rem; } .avec-lot .line > div:nth-child(8) { grid-area: tva; }
  .avec-lot .line > div:nth-child(9) { grid-area: tot; justify-self: end; } .avec-lot .line > div:nth-child(10) { grid-area: del; justify-self: end; }
  .line .m { display: block; font-size: 11.5px; color: var(--text-3); font-weight: 600; margin-bottom: 4px; }
}
@media (max-width: 900px) { .line input { font-size: 16px; } }

/* statistiques */
.up { color: var(--ok); font-weight: 600; }
.down { color: var(--danger); font-weight: 600; }

.hbar { height: 5px; border-radius: 3px; background: var(--surface-2); margin-top: 6px; overflow: hidden; }
.hbar span { display: block; height: 100%; background: var(--accent); border-radius: 3px; }

/* menu « Plus » mobile */
.more-list a { display: flex; align-items: center; gap: 14px; padding: 14px 6px; border-bottom: 1px solid var(--line); color: var(--text); text-decoration: none; font-weight: 500; font-size: 16px; }
.more-list a:last-child { border-bottom: none; }
.more-list a svg.i { color: var(--text-2); }

/* ============================================================ éditeur de mise en page */
.ed-wrap { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 18px; align-items: start; }
.ed-left { background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; overflow: auto; }
.ed-page { position: relative; margin: 0 auto; background: #fff; color: #111; box-shadow: 0 2px 14px rgba(0, 0, 0, .15); font-family: Helvetica, Arial, sans-serif; line-height: 1.22; user-select: none; touch-action: none; }
.ed-right { position: sticky; top: 16px; max-height: calc(100vh - 32px); overflow: auto; }
.ed-right .card { padding: 14px 16px; margin-bottom: 12px; }
.ed-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.ed-add { display: flex; flex-wrap: wrap; gap: 6px; }
.ed-bloc { position: absolute; cursor: move; outline: 1px dashed transparent; }
.ed-bloc:hover { outline-color: rgba(59, 91, 219, .5); }
.ed-bloc.sel { outline: 2px solid var(--accent); z-index: 5; }
.ed-tag { position: absolute; left: 0; top: -16px; font: 600 10px/14px -apple-system, sans-serif; background: var(--accent); color: #fff; padding: 0 5px; border-radius: 3px; display: none; white-space: nowrap; }
.ed-bloc.sel .ed-tag, .ed-bloc:hover .ed-tag { display: block; }
.ed-handle { position: absolute; right: -6px; bottom: -6px; width: 12px; height: 12px; background: #fff; border: 2px solid var(--accent); border-radius: 3px; cursor: nwse-resize; }
.ed-txt { width: 100%; height: 100%; overflow: hidden; white-space: nowrap; position: relative; }
.ed-txt.corners { background:
  linear-gradient(#222, #222) 0 0 / 11px 1.2px no-repeat, linear-gradient(#222, #222) 0 0 / 1.2px 11px no-repeat,
  linear-gradient(#222, #222) 100% 0 / 11px 1.2px no-repeat, linear-gradient(#222, #222) 100% 0 / 1.2px 11px no-repeat,
  linear-gradient(#222, #222) 0 100% / 11px 1.2px no-repeat, linear-gradient(#222, #222) 0 100% / 1.2px 11px no-repeat,
  linear-gradient(#222, #222) 100% 100% / 11px 1.2px no-repeat, linear-gradient(#222, #222) 100% 100% / 1.2px 11px no-repeat; padding: 6px !important; }
.ed-champ { width: 100%; height: 100%; border: 1px solid #333; display: flex; flex-direction: column; overflow: hidden; font-weight: 700; text-align: center; }
.ed-champ div:first-child { background: #efefef; border-bottom: 1px solid #333; padding: 1px 2px; white-space: nowrap; }
.ed-champ div:last-child { flex: 1; display: flex; align-items: center; justify-content: center; white-space: nowrap; }
.ed-ph { width: 100%; height: 100%; border: 1px dashed #aaa; display: flex; flex-direction: column; align-items: center; justify-content: center; color: #888; font-size: 12px; text-align: center; }
.ed-table { position: relative; width: 100%; height: 100%; border: 1px solid #333; overflow: hidden; }
.ed-table .ed-th { display: flex; background: #efefef; border-bottom: 1px solid #333; font-weight: 700; padding: 3px 0; }
.ed-table .ed-tr { display: flex; align-items: center; }
.ed-table .ed-th div, .ed-table .ed-tr div { padding: 0 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; flex-shrink: 0; }
.ed-vl { position: absolute; top: 0; bottom: 0; width: 1px; background: #555; }
.ed-mini { width: 100%; height: 100%; border: 1px solid #333; border-radius: 4px; overflow: hidden; }
.ed-mini .ed-th, .ed-mini .ed-tr { display: flex; border-bottom: 1px solid #999; }
.ed-mini .ed-th { background: #efefef; font-weight: 700; }
.ed-mini div div { flex: 1; text-align: center; padding: 1px 2px; white-space: nowrap; overflow: hidden; }
.ed-tot { width: 100%; height: 100%; border: 1px solid #333; border-radius: 4px; overflow: hidden; display: flex; flex-direction: column; background: linear-gradient(90deg, #efefef 55%, #fff 55%); }
.ed-tot div { flex: 1; display: flex; justify-content: space-between; align-items: center; padding: 0 5px; white-space: nowrap; }
.ed-grid4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin-bottom: 10px; }
.ed-grid4 input { padding: 6px 7px; }
.ed-form { grid-template-columns: 1fr 1fr; gap: 10px; }
.ed-form input, .ed-form select, .ed-form textarea { padding: 6px 8px; font-size: 13px; }
.ed-form textarea { min-height: 70px; font-family: ui-monospace, Menlo, monospace; font-size: 12px; }
.ed-form #pp-var { margin-top: 6px; }
.ed-row { display: flex; gap: 6px; align-items: center; margin-bottom: 6px; }
.ed-row input, .ed-row select { min-width: 0; }
.ed-col { border: 1px solid var(--line); border-radius: 10px; padding: 8px; margin-bottom: 8px; background: var(--surface-2); }
.pulse { box-shadow: 0 0 0 0 rgba(59, 91, 219, .6); animation: pulse 1.6s infinite; }
@keyframes pulse { 70% { box-shadow: 0 0 0 8px rgba(59, 91, 219, 0); } 100% { box-shadow: 0 0 0 0 rgba(59, 91, 219, 0); } }
@media (max-width: 1100px) { .ed-wrap { grid-template-columns: 1fr; } .ed-right { position: static; max-height: none; } }

/* sélection dans les listes */
#selbar { position: sticky; bottom: 12px; z-index: 6; }
.selbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; padding: 12px 16px; margin-top: 12px;
  background: var(--text); color: var(--surface); border-radius: 14px; box-shadow: var(--shadow-lg); }
.selbar .grow { font-weight: 600; }
.selbar button { background: rgba(255, 255, 255, .12); color: inherit; border-color: transparent; }
.selbar button:hover { background: rgba(255, 255, 255, .22); }
.selbar .btn-primary { background: var(--accent); }
@media (max-width: 900px) { #selbar { bottom: calc(76px + env(safe-area-inset-bottom)); } }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 6px 4px 12px; border-radius: 20px; background: var(--accent-soft); color: var(--accent-text); font-weight: 600; font-size: 13px; }
.chip button { border: none; background: none; padding: 0 4px; color: inherit; font-size: 15px; line-height: 1; }

.doc-acts { display: inline-flex; gap: 2px; align-items: center; }
.doc-acts .btn-sm { padding: 5px 7px; }
@media (max-width: 900px) { .doc-acts { flex-wrap: wrap; } }
@media (max-width: 1250px) and (min-width: 901px) { .tbl .w-hide { display: none; } }

/* tri des colonnes et période */
.tbl th.sortable { cursor: pointer; user-select: none; }
.tbl th.sortable:hover { color: var(--text); }
.tbl th.sortable.on { color: var(--accent-text); }
.tbl th.num.sortable { text-align: right; }
.sort-ic { margin-left: 5px; font-size: 10px; opacity: .45; }
.tbl th.sortable.on .sort-ic { opacity: 1; }
.periode { display: flex; align-items: center; gap: 8px; }
.periode input { width: auto; }
@media (max-width: 900px) { .periode { flex: 1 1 100%; } .periode input { flex: 1; min-width: 0; } #f-raccourcis { width: 100%; overflow-x: auto; } #f-raccourcis button { flex: 1; white-space: nowrap; } #f-tri { flex: 1 1 100%; } }

/* choix des colonnes */
.cols-wrap { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.cols-list { border: 1px solid var(--line); border-radius: 10px; max-height: 380px; overflow: auto; padding: 4px; }
.cols-item { display: flex; align-items: center; gap: 6px; padding: 5px 8px; border-radius: 7px; font-size: 13.5px; }
.cols-item:hover { background: var(--surface-2); }
.cols-item .btn-sm { padding: 2px 6px; }
.cols-grp { font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: var(--text-3); font-weight: 600; padding: 10px 8px 4px; }
.tbl-scroll { overflow-x: auto; }
.tbl-scroll .tbl td, .tbl-scroll .tbl th { white-space: nowrap; max-width: 320px; overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 900px) { .cols-wrap { grid-template-columns: 1fr; } .tbl-scroll .tbl td { white-space: normal; max-width: none; } }
td.danger { color: var(--danger); font-weight: 600; }

/* aperçu du document (PDF) dans la fiche facture */
.apercu-doc { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 20px; align-items: start; }
.apercu-pdf { display: flex; flex-direction: column; gap: 6px; }
.apercu-pdf iframe { width: 100%; height: min(72vh, 760px); border: 1px solid var(--line); border-radius: 10px; background: #fff; }
.apercu-pdf a { align-self: flex-end; display: inline-flex; gap: 4px; align-items: center; }
@media (max-width: 900px) { .apercu-doc { grid-template-columns: 1fr; } .apercu-pdf iframe { height: 55vh; } }

/* menu de gauche : groupes dépliables, sous-onglets, mode réduit (icônes seules) */
.side-nav a .lib, .grp-tete .lib { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.grp-tete { display: flex; align-items: center; gap: 12px; width: 100%; padding: 9px 12px; margin-bottom: 2px; border: 0; border-radius: 10px;
  background: transparent; color: var(--text-2); font: inherit; font-weight: 500; text-align: left; cursor: pointer; }
.grp-tete:hover { background: var(--surface-2); color: var(--text); }
.grp-chev { margin-left: auto; display: grid; color: var(--text-3); transition: transform .15s; } .grp-chev svg { width: 13px; height: 13px; }
.side-grp.ouvert .grp-chev { transform: rotate(90deg); }
.grp-corps { display: none; padding-left: 14px; }
.side-grp.ouvert .grp-corps { display: block; }
.side-grp:not(.ouvert):has(.active) > .grp-tete { color: var(--accent-text); }
.side-vide { padding-top: 10px; }
.tabs.sous-rub a { padding: 10px 14px; color: var(--text-2); text-decoration: none; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; display: inline-flex; align-items: center; gap: 6px; }
.tabs.sous-rub a svg { width: 15px; height: 15px; }
.tabs.sous-rub a.on { color: var(--accent-text); border-bottom-color: var(--accent); }
.tabs.sous-rub a:hover { color: var(--text); }
#app.side-mini { --side-w: 72px; }
#app.side-mini #side { padding: 18px 10px; }
#app.side-mini .side-nav a .lib, #app.side-mini .grp-tete, #app.side-mini .side-label, #app.side-mini #brand, #app.side-mini .brand-chev,
#app.side-mini #username { display: none; }
#app.side-mini .side-nav a { justify-content: center; padding: 10px 0; }
#app.side-mini .grp-corps { display: block; padding-left: 0; border-top: 1px solid var(--line); margin-top: 6px; padding-top: 6px; }
#app.side-mini .brand { justify-content: center; padding: 6px 0; }
#app.side-mini .side-foot { flex-direction: column; }
#app.side-mini #side-mini svg { transform: rotate(180deg); }

/* statistiques : évolution sur 5 ans — année en cours bleu, N-1 orange, N-2 vert d'eau (validés clair/sombre, daltonisme),
   N-3 / N-4 gris en tirets / pointillés (repère secondaire : le motif, pas la couleur) */
.evo-wrap { position: relative; }
.evo { width: 100%; height: auto; display: block; }
.evo, .evo-legs, .evo-tip { --c0: #2a78d6; --c1: #eb6834; --c2: #1baf7a; --c3: #8a93a6; --c4: #b4bac6; }
@media (prefers-color-scheme: dark) { .evo, .evo-legs, .evo-tip { --c0: #3987e5; --c1: #d95926; --c2: #199e70; --c3: #8a93a6; --c4: #5d6577; } }
.evo-grid { stroke: var(--line); stroke-width: 1; }
.evo-ax { fill: var(--text-3); font-size: 11px; }
.evo-hors { fill: var(--text-2); font-size: 11px; }
.evo-lab { fill: var(--text); font-size: 12px; font-weight: 600; paint-order: stroke; stroke: var(--surface); stroke-width: 4px; stroke-linejoin: round; }
.evo-l { fill: none; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.evo-l.c0 { stroke: var(--c0); stroke-width: 3.5; } .evo-l.c1 { stroke: var(--c1); stroke-width: 2.5; } .evo-l.c2 { stroke: var(--c2); }
.evo-l.c3 { stroke: var(--c3); stroke-dasharray: 7 5; } .evo-l.c4 { stroke: var(--c4); stroke-dasharray: 2 4; }
.evo-pt { fill: var(--c0); stroke: var(--surface); stroke-width: 2; }
.evo-x { stroke: var(--text-3); stroke-width: 1; stroke-dasharray: 3 3; }
.evo-hit { fill: transparent; cursor: crosshair; }
.evo-sep { stroke: var(--line-2); stroke-width: 1; stroke-dasharray: 2 4; }
.evo-pdb { font-style: italic; }
.evo-legs { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-bottom: 4px; font-size: 13px; color: var(--text-2); }
.evo-leg { display: inline-flex; align-items: center; gap: 7px; padding: 4px 10px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); color: var(--text); font: inherit; font-size: 13px; cursor: pointer; }
.evo-leg.off { opacity: .45; text-decoration: line-through; }
.evo-legs i, .evo-tip i { display: inline-block; width: 18px; height: 0; border-top: 3px solid; }
i.c0 { border-color: var(--c0); } i.c1 { border-color: var(--c1); } i.c2 { border-color: var(--c2); }
i.c3 { border-top-style: dashed; border-color: var(--c3); } i.c4 { border-top-style: dotted; border-color: var(--c4); }
.evo-tip { position: absolute; top: 8px; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow); padding: 8px 10px; font-size: 12.5px; color: var(--text); pointer-events: none; min-width: 170px; }
.evo-tip div { display: flex; align-items: center; gap: 6px; margin-top: 2px; } .evo-tip span { margin-left: auto; padding-left: 12px; font-variant-numeric: tabular-nums; }
.nav-mois input[type=month] { width: 150px; }
.evo-titre { display: inline-flex; align-items: center; gap: 8px; border: 0; background: transparent; padding: 2px 4px 2px 0; font: inherit; font-weight: inherit; color: inherit; cursor: pointer; }
.evo-titre:hover { color: var(--accent-text); }
.evo-chev { display: inline-block; font-size: 15px; color: var(--text-3); transition: transform .15s; }
.evo-titre.ouvert .evo-chev { transform: rotate(90deg); }

/* commandes de la semaine */
.cs-entete { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.cs-sem { display: flex; flex-direction: column; min-width: 190px; } .cs-sem b { font-size: 18px; }
.cs-infos { display: flex; gap: 10px; flex-wrap: wrap; }
.cs-infos .field { margin: 0; } .cs-infos .field span { display: block; font-size: 12px; color: var(--text-3); margin-bottom: 3px; }
.cs-plus { border: 1px solid var(--line); background: var(--surface); color: var(--text-2); border-radius: 8px; width: 28px; height: 28px; display: grid; place-items: center; cursor: pointer; flex-shrink: 0; }
.cs-plus:hover { color: var(--accent-text); border-color: var(--accent); } .cs-plus svg { width: 14px; height: 14px; }
.cs-n { text-align: right; padding: 4px 8px; min-height: 0; height: 32px; }
.cs-n.saved { border-color: var(--ok); }
.cs-lier { border: 0; background: var(--warn-soft); color: var(--warn); border-radius: 6px; padding: 1px 6px; font-size: 12px; cursor: pointer; }
.cs-chip { display: inline-flex; align-items: center; gap: 2px; border: 1px solid var(--line); border-radius: 999px; padding: 1px 4px 1px 8px; margin: 2px 4px 2px 0; }
.cs-x { border: 0; background: none; color: var(--text-3); cursor: pointer; font-size: 14px; padding: 0 4px; }
.cs-drag { cursor: grab; } .cs-poignee { color: var(--text-3); letter-spacing: -2px; margin-right: 4px; }
.cs-tire { opacity: .4; } .cs-cible td { box-shadow: inset 0 2px 0 var(--accent); }
.cs-fl { display: inline-flex; gap: 2px; margin-left: 6px; } .cs-fl .btn-sm { padding: 2px 6px; }
@media print { .cs-fl, .cs-poignee { display: none; } }
.cs-sync { font-size: 12.5px; color: var(--ok); margin-left: 12px; } .cs-sync.attente { color: var(--warn); font-weight: 600; }
.cs-relier { border: 0; cursor: pointer; font: inherit; font-size: 11.5px; }

/* appli autonome (ex. Commandes de la semaine à son adresse) : pas de menu de la gestion */
#app.autonome #side, #app.autonome #tabbar { display: none !important; }
#app.autonome main { padding-bottom: 24px; }

/* ============================================================ suivi des températures */
.tp-cartes { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; margin-bottom: 18px; }
.tp-carte { text-align: left; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; box-shadow: var(--shadow); display: flex; flex-direction: column; align-items: stretch; gap: 4px; cursor: pointer; color: inherit; font: inherit; border-left: 4px solid var(--line-2); white-space: normal; min-width: 0; }
.tp-carte > div { text-align: left; }
.tp-carte.ok { border-left-color: var(--ok); } .tp-carte.danger { border-left-color: var(--danger); } .tp-carte.warn { border-left-color: var(--warn); }
.tp-carte.on { box-shadow: 0 0 0 2px var(--accent), var(--shadow); }
.tp-tete { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.tp-tete b { font-weight: 650; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tp-val { font-size: 30px; font-weight: 700; font-variant-numeric: tabular-nums; letter-spacing: -.5px; }
.tp-carte.danger .tp-val { color: var(--danger); } .tp-carte.warn .tp-val { color: var(--warn); }
.tp-svg { width: 100%; height: auto; display: block; touch-action: pan-y; }
.tp-g { stroke: var(--line); stroke-width: 1; }
.tp-ax { fill: var(--text-3); font-size: 11px; }
.tp-plage { fill: var(--ok-soft); }
.tp-env { fill: var(--accent-soft); }
.tp-ligne { fill: none; stroke: var(--accent); stroke-width: 2; stroke-linejoin: round; }
.tp-hors { fill: var(--danger); }
.tp-curseur { stroke: var(--text-3); stroke-dasharray: 3 3; }
.tp-point { fill: var(--surface); stroke: var(--accent); stroke-width: 2; }
.tp-info { min-height: 18px; padding: 4px 4px 0; }
.tp-rouge { color: var(--danger); font-weight: 650; }
.tp-reg { border-collapse: collapse; width: 100%; font-size: 13px; }
.tp-reg th, .tp-reg td { text-align: center; white-space: nowrap; padding: 7px 9px; border-bottom: 1px solid var(--line); border-left: 1px solid var(--line); }
.tp-reg th { font-size: 11.5px; font-weight: 600; color: var(--text-2); background: var(--surface-2); }
.tp-reg td:first-child, .tp-reg th:first-child { border-left: none; text-align: left; position: sticky; left: 0; background: var(--surface); }
.tp-reg th:first-child { background: var(--surface-2); }
.tp-c.saved { border-color: var(--ok); }
.tp-sondes td:nth-child(2) { text-align: left; } .tp-sondes input:not([type=checkbox]) { padding: 6px 8px; }
.tp-jnav { display: flex; gap: 6px; align-items: center; flex: 1 1 260px; max-width: 360px; }
.tp-jnav input { flex: 1; min-width: 0; }
.tp-gh { stroke-dasharray: 2 4; opacity: .7; }
.tp-h { fill: var(--surface); stroke: var(--accent); stroke-width: 1.6; }
.tp-hh { display: grid; grid-template-columns: repeat(auto-fill, minmax(54px, 1fr)); gap: 6px; margin-top: 12px; }
.tp-hh div { background: var(--surface-2); border: 1px solid var(--line); border-radius: 8px; padding: 5px 4px; text-align: center; display: flex; flex-direction: column; font-variant-numeric: tabular-nums; }
.tp-hh span { font-size: 11px; color: var(--text-3); } .tp-hh b { font-size: 13.5px; }
@media (max-width: 700px) { .tp-impair { display: none; } }
#tp-jnavc { flex: 0 1 280px; }
.tp-jnav[hidden] { display: none; }
.tp-ct { flex-wrap: wrap; } .tp-ct #tp-titre { flex: 1 1 220px; }
.tp-tete { flex-wrap: wrap; }
.callout.danger { background: var(--danger-soft); color: var(--danger); }
.tp-evs { border-top: 1px solid var(--line); }
.tp-ev { padding: 10px 16px; border-bottom: 1px solid var(--line); display: flex; flex-direction: column; gap: 5px; }
.tp-ev:last-child { border-bottom: none; }

.tp-ev-l { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.tp-travaux { white-space: pre-line; color: var(--text-2); background: var(--surface-2); border-radius: 8px; padding: 6px 8px; }
.tp-iv { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin: 2px 0; }
.tp-iv a { display: inline-flex; align-items: center; gap: 4px; }
.tp-iv svg { width: 14px; height: 14px; }
.tp-direct { color: var(--ok); min-height: 16px; display: flex; align-items: center; gap: 6px; }
.tp-live { width: 7px; height: 7px; border-radius: 50%; background: var(--ok); animation: tp-pouls 2s infinite; }
@keyframes tp-pouls { 0%, 100% { opacity: 1; } 50% { opacity: .25; } }
.tp-pli-tete { cursor: pointer; user-select: none; margin-bottom: 0; }
.tp-pli:not(.ouvert) .tp-pli-corps { display: none; }
.tp-pli.ouvert .tp-pli-tete { margin-bottom: 10px; }
.tp-chev { display: inline-flex; color: var(--text-3); transition: transform .15s; }
.tp-pli.ouvert .tp-chev { transform: rotate(90deg); }

/* ============================================================ analyses laboratoire */
.an-l { display: grid; grid-template-columns: 110px 1fr auto; gap: 6px 14px; padding: 11px 16px; border-bottom: 1px solid var(--line); cursor: pointer; align-items: start; }
.an-l:last-child { border-bottom: none; }
.an-l:hover { background: var(--surface-2); }
.an-l.an-ko { border-left: 4px solid var(--danger); background: color-mix(in srgb, var(--danger-soft) 60%, transparent); }
.an-l.an-av { border-left: 4px solid var(--warn); }
.an-d { display: flex; flex-direction: column; }
.an-s { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.an-s svg { width: 13px; height: 13px; vertical-align: -2px; }
.an-res { display: flex; flex-wrap: wrap; gap: 4px 12px; margin-top: 4px; font-size: 12.5px; color: var(--text-2); }
.an-res i { font-style: normal; color: var(--text-3); }
.an-fiche { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 18px; }
.an-pdf iframe { width: 100%; height: 70vh; border: 1px solid var(--line); border-radius: 10px; background: #fff; }
.an-pdf a { display: inline-flex; gap: 4px; align-items: center; margin-top: 6px; }
@media (max-width: 900px) { .an-fiche { grid-template-columns: 1fr; } .an-pdf iframe { height: 60vh; } .an-l { grid-template-columns: 1fr auto; } .an-d { grid-column: 1 / -1; flex-direction: row; gap: 8px; } }
.an-synth td.num, .an-synth th { text-align: center; }
.an-synth tfoot td { font-weight: 650; border-top: 2px solid var(--line-2); background: var(--surface-2); }

.an-n { display: inline-block; min-width: 24px; padding: 1px 7px; border-radius: 20px; font-weight: 650; }
.an-n.ok { background: var(--ok-soft); color: var(--ok); } .an-n.warn { background: var(--warn-soft); color: var(--warn); } .an-n.danger { background: var(--danger-soft); color: var(--danger); }
.an-synth + * { margin-top: 0; }
.an-synth-scroll { max-height: 70vh; overflow: auto; }
.an-synth { font-size: 12.5px; }
.an-synth th { position: sticky; top: 0; z-index: 1; white-space: normal; min-width: 70px; vertical-align: bottom; }
.an-synth td { white-space: nowrap; text-align: left; cursor: pointer; }
.an-synth td.an-long { white-space: normal; min-width: 170px; max-width: 240px; }
.an-clamp { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.an-synth tbody tr:hover td { background: var(--accent-soft); }
.an-synth tr.an-tko td { background: var(--danger-soft); } .an-synth tr.an-tav td { background: var(--warn-soft); }
#an-synth-carte .card-title { gap: 10px; }

/* commandes de la semaine : feuille comme le tableau Excel */
.cs-feuille-scroll { overflow-x: auto; margin-bottom: 70px; border: 1px solid var(--line-2); border-radius: 10px; background: var(--surface); }
.cs-feuille { border-collapse: collapse; width: 100%; min-width: 360px; table-layout: fixed; font-size: 13.5px; }
.cs-feuille col.cf-cl { width: 190px; } .cs-feuille col.cf-ta { width: 52px; } .cs-feuille col.cf-ty { width: 112px; } .cs-feuille col.cf-nb { width: 68px; } .cs-feuille col.cf-to { width: 76px; }
.cs-feuille th { position: sticky; top: 0; z-index: 2; background: var(--surface-2); font-size: 11.5px; font-weight: 650; text-transform: uppercase; letter-spacing: .03em; color: var(--text-2); padding: 7px 6px; border: 1px solid var(--line-2); }
.cs-feuille td { border: 1px solid var(--line); padding: 0; height: 34px; vertical-align: middle; }
.cs-feuille tr.cf-deb td { border-top: 2px solid var(--text-3); }
.cs-feuille td.cf-client { padding: 5px 8px; vertical-align: top; background: var(--surface); }
.cf-nom { font-weight: 700; line-height: 1.2; }
.cf-tete { display: flex; align-items: flex-start; gap: 6px; } .cf-tete .cf-nom { flex: 1; min-width: 0; }
.cs-feuille td.cf-client .cs-plus { width: 22px; height: 22px; display: inline-grid; flex-shrink: 0; opacity: .55; }
.cs-feuille tr:hover td.cf-client .cs-plus, .cs-feuille td.cf-client .cs-plus:focus { opacity: 1; }
.cs-feuille td.cf-client .badge, .cs-feuille td.cf-client .cs-relier { margin-top: 3px; font-size: 11px; }
.cs-feuille td.cf-tare { text-align: center; color: var(--text-2); font-variant-numeric: tabular-nums; vertical-align: top; padding-top: 8px; }
.cs-feuille td.cf-ty { padding: 0 6px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cs-feuille td.cf-alier { background: var(--warn-soft); }
.cf-lier { border: 0; background: none; color: var(--warn); font: inherit; font-weight: 600; cursor: pointer; padding: 0; text-decoration: underline dotted; }
.cs-feuille td.cf-tot { background: var(--surface-2); }
.cs-feuille .cs-n { width: 100%; height: 33px; border: 0; border-radius: 0; background: transparent; text-align: right; padding: 0 7px; font-size: 14px; font-variant-numeric: tabular-nums; box-shadow: none; }
.cs-feuille .cs-n:focus { outline: 2px solid var(--accent); outline-offset: -2px; background: var(--surface); }
.cs-feuille .cs-n.saved { background: var(--ok-soft); }
.cs-feuille tr.a-commande td.cf-client { box-shadow: inset 3px 0 0 var(--accent); }
.cs-feuille tr.a-bl td.cf-client { box-shadow: inset 3px 0 0 var(--ok, #16a34a); background: var(--ok-soft, #ecfdf3); }
.cs-bl-fait { display: inline-flex; align-items: center; gap: 4px; margin-top: 4px; font-weight: 600; }
.cs-bl-fait .i { width: 13px; height: 13px; }
.cs-bl-compte { color: var(--ok, #16a34a); }
.cs-feuille tr.cf-section td { background: var(--accent-soft); font-weight: 700; text-transform: uppercase; letter-spacing: .05em; font-size: 12px; padding: 8px 10px; border-top: 2px solid var(--text, #222); }
.cs-feuille tr.cf-divers td.cf-client { padding: 0; }
.cs-feuille .cs-d { width: 100%; height: 33px; border: 0; border-radius: 0; background: transparent; padding: 0 8px; font-size: 14px; box-shadow: none; }
.cs-feuille .cs-d[data-k="client"] { font-weight: 600; }
.cs-feuille .cs-d:focus { outline: 2px solid var(--accent); outline-offset: -2px; background: var(--surface); } .cs-feuille .cs-d.saved { background: var(--ok-soft); }
.cs-feuille .cs-j { width: 100%; height: 33px; border: 0; border-radius: 0; background: transparent; text-align: right; padding: 0 7px; font-size: 14px; font-variant-numeric: tabular-nums; box-shadow: none; }
.cs-feuille .cs-j:focus { outline: 2px solid var(--accent); outline-offset: -2px; background: var(--surface); } .cs-feuille .cs-j.saved { background: var(--ok-soft); }
.cs-feuille td.cf-jours-c { padding: 0; } .cf-jours4 { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); }
.cf-j4 { border-left: 1px solid var(--line); } .cf-j4:first-child { border-left: 0; }
.cf-j4t { text-align: center; font-size: 12.5px; padding: 6px 4px; border-bottom: 1px solid var(--line); background: var(--accent-soft); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cf-j4t span { display: block; font-size: 11.5px; opacity: .75; } .cf-j4 .cs-j { text-align: center; font-weight: 600; }
.cf-j4a { border-top: 1px solid var(--line); padding: 4px 6px 6px; font-size: 12px; line-height: 1.45; }
.cf-j4l { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; } .cf-j4l b { display: inline-block; min-width: 18px; text-align: right; margin-right: 4px; font-variant-numeric: tabular-nums; }
.cf-j4r { color: var(--warn); font-size: 11px; white-space: normal; }
.cf-j4x { font-style: italic; opacity: .8; } .cf-j4a:empty { display: none; }
.cs-feuille tr.cf-section .i { width: 14px; height: 14px; vertical-align: -2px; margin-right: 6px; }
.cs-blc { flex-shrink: 0; margin: 3px 0 0; width: 16px; height: 16px; cursor: pointer; } .cs-blc:disabled, .cs-blc-non { cursor: not-allowed; opacity: .4; }
.cs-blc-poids { opacity: 1; accent-color: #D0353A; outline: 2px solid #D0353A; outline-offset: 1px; border-radius: 3px; }
.cs-n.cs-sans-poids, .cs-v.cs-sans-poids { background: #FDECEC; box-shadow: inset 0 0 0 2px #D0353A; }
.cs-v { width: 100%; height: 33px; border: 0; border-radius: 0; background: transparent; box-shadow: none; padding: 0; min-height: 0;
  font-size: 18px; font-weight: 700; color: #1F8A4C; cursor: pointer; display: block; }
.cs-v:hover { background: rgba(31, 138, 76, .08); }
.cs-v.on { background: #E8F5EC; }
@media (max-width: 640px) {
  .cs-feuille { font-size: 12.5px; min-width: 0; }
  .cs-feuille col.cf-cl { width: 104px; } .cs-feuille col.cf-ta { width: 34px; } .cs-feuille col.cf-ty { width: 84px; } .cs-feuille col.cf-nb { width: 56px; } .cs-feuille col.cf-to { width: 62px; }
  .cs-feuille th { font-size: 10px; padding: 6px 3px; letter-spacing: 0; }
  .cs-feuille td.cf-client { padding: 4px 5px; } .cf-tete { flex-direction: column; gap: 2px; }
  .cs-feuille td.cf-ty { padding: 0 4px; } .cs-feuille .cs-n { padding: 0 5px; font-size: 14px; }
}
.cf-btn { border: 0; background: none; font: inherit; color: inherit; padding: 0; cursor: pointer; text-align: left; font-weight: inherit; }
.cf-btn:hover { color: var(--accent-text); text-decoration: underline dotted; }
.cs-feuille td.cf-ty .cf-btn { width: 100%; height: 33px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cs-feuille td.cf-clic { cursor: pointer; } .cs-feuille td.cf-clic:hover { background: var(--accent-soft); }
.cf-nom.cf-btn { font-weight: 700; }
.cs-feuille .cf-btn { display: block; width: 100%; text-align: left; justify-content: flex-start; border-radius: 0; box-shadow: none; min-height: 0; line-height: 1.25; }
.cs-feuille td.cf-ty .cf-btn { line-height: 33px; }
.cs-prep tr.cs-cat td { background: var(--surface-2); font-size: 14px; padding-top: 12px; border-top: 2px solid var(--line-2); text-transform: none; }
@media (max-width: 900px) { .cs-prep tr.cs-cat { display: block; background: var(--surface-2); padding: 10px 16px; } .cs-prep tr.cs-cat td { display: block; padding: 0; border: 0; } }
/* rubriques dans la feuille : colonne dédiée et séparation */
.cs-feuille col.cf-ru { width: 90px; }
.cs-feuille tr.cf-debcat td:not(.cf-client):not(.cf-tare) { border-top: 2px dashed var(--line-2); }
.cs-feuille td.cf-rub { font-size: 11.5px; font-weight: 650; vertical-align: top; padding: 8px 6px; color: var(--text-2); border-left: 3px solid var(--line-2); }
.cf-rc { display: none; }
.cs-feuille td.cf-r-poissons { background: #e8f1fb; border-left-color: #4a7fc1; color: #2d5a8f; }
.cs-feuille td.cf-r-charcuteries { background: #fbecec; border-left-color: #c0565a; color: #8f3337; }
.cs-feuille td.cf-r-foiegras { background: #fbf3e2; border-left-color: #c49433; color: #7d5c14; }
.cs-feuille td.cf-r-traiteur { background: #eaf6ee; border-left-color: #4f9a68; color: #2f6b44; }
.cs-feuille td.cf-r-fournitures { background: #f1eefa; border-left-color: #7d68b8; color: #54448a; }
@media (prefers-color-scheme: dark) {
  .cs-feuille td.cf-r-poissons { background: #1b2a3d; color: #9cc1ee; } .cs-feuille td.cf-r-charcuteries { background: #3a2223; color: #eba7a9; }
  .cs-feuille td.cf-r-foiegras { background: #382d18; color: #e2c27e; } .cs-feuille td.cf-r-traiteur { background: #1c3324; color: #9fd3b0; }
  .cs-feuille td.cf-r-fournitures { background: #2a2540; color: #bfb1ec; }
}
@media (max-width: 640px) { .cs-feuille col.cf-ru { width: 46px; } .cf-rl { display: none; } .cf-rc { display: inline; } .cs-feuille td.cf-rub { font-size: 10px; padding: 6px 3px; } }
@media (max-width: 640px) {
  .cs-feuille col.cf-cl { width: 82px; } .cs-feuille col.cf-ta { width: 32px; } .cs-feuille col.cf-ru { width: 40px; }
  .cs-feuille col.cf-ty { width: 76px; } .cs-feuille col.cf-nb { width: 52px; } .cs-feuille col.cf-to { width: 58px; }
}
.cf-act { display: inline-flex; gap: 2px; align-items: center; flex-shrink: 0; opacity: .55; }
.cs-feuille tr:hover .cf-act, .cf-act:focus-within { opacity: 1; }

.cs-feuille td.cf-client .cf-act .cs-plus { opacity: 1; }
@media (max-width: 640px) { .cf-act { opacity: 1; } }
.cs-feuille tr.cf-total td { background: var(--surface-2); font-weight: 700; }
.cs-feuille tr.cf-total td.cf-ty { color: var(--text); }
.cs-feuille td.cf-num { text-align: right; padding: 0 7px; font-variant-numeric: tabular-nums; }
.cs-feuille tr.cf-total td.cf-client { border-left: 3px solid var(--text-3); }
/* clients d'un groupe (LCDH) : produits côte à côte, Type | Nombre */
.cs-feuille td.cf-compact { padding: 0; }
.cf-grille { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); }
.cf-paire { display: grid; grid-template-columns: minmax(0, 1fr) 52px; align-items: center; border-right: 1px solid var(--line); border-left: 3px solid var(--line-2); min-height: 34px; }
.cf-paire.cf-paire-v { grid-template-columns: minmax(0, 1fr) 52px 30px; }
.cf-paire .cs-v { border-left: 1px solid var(--line); }
.cf-paire .cf-pt { padding: 0 6px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cf-paire .cf-pt .cf-btn { line-height: 33px; }
.cf-paire .cs-n { width: 100%; height: 33px; border: 0; border-left: 1px solid var(--line); border-radius: 0; background: transparent; text-align: right; padding: 0 7px; font-size: 14px; }
.cf-paire .cs-n:focus { outline: 2px solid var(--accent); outline-offset: -2px; background: var(--surface); }
.cf-paire .cs-n.saved { background: var(--ok-soft); }
.cf-paire .cf-pn { text-align: right; padding: 0 7px; font-weight: 700; font-variant-numeric: tabular-nums; }
.cf-c-poissons { border-left-color: #4a7fc1; } .cf-c-charcuteries { border-left-color: #c0565a; } .cf-c-foiegras { border-left-color: #c49433; }
.cf-c-traiteur { border-left-color: #4f9a68; } .cf-c-fournitures { border-left-color: #7d68b8; }
.cs-feuille td.cf-rub-vide { border-left: 3px solid transparent; background: var(--surface); }
@media (max-width: 640px) { .cf-grille { grid-template-columns: repeat(2, minmax(0, 1fr)); } .cf-paire { grid-template-columns: minmax(0, 1fr) 44px; } .cf-paire .cf-pt { padding: 0 4px; font-size: 12px; } }
/* sorties de plage : une ligne compacte par épisode */
.tp-evc-t { padding: 10px 14px 4px; font-size: 13.5px; margin: 0; }
.tp-evcs { font-size: 12px; padding-bottom: 4px; }
.tp-evc { display: grid; grid-template-columns: 8px minmax(70px, 130px) 172px 62px 92px minmax(0, 1fr) 22px; gap: 8px; align-items: center; padding: 3px 14px; border-top: 1px solid var(--line); line-height: 1.3; }
.tp-evc-ko { background: color-mix(in srgb, var(--danger-soft) 55%, transparent); }
.tp-evc-p { width: 8px; height: 8px; border-radius: 50%; background: var(--text-3); }
.tp-evc-p.danger { background: var(--danger); } .tp-evc-p.warn { background: var(--warn); }
.tp-evc-s, .tp-evc-c { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tp-evc-s { font-weight: 600; } .tp-evc-d { color: var(--text-2); white-space: nowrap; font-variant-numeric: tabular-nums; } .tp-evc-x { white-space: nowrap; font-variant-numeric: tabular-nums; }
.tp-evc-i { display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; } .tp-evc-i a { display: inline-flex; align-items: center; gap: 3px; }
.tp-evc svg { width: 12px; height: 12px; }
.tp-evc-b { border: 0; background: none; padding: 2px; cursor: pointer; color: var(--text-3); border-radius: 5px; display: inline-grid; place-items: center; }
.tp-evc-b:hover { color: var(--accent-text); background: var(--accent-soft); }
.tp-evcs:not(.tout) .tp-cache { display: none; }
.tp-evc-plus { border: 0; background: none; color: var(--accent-text); font-size: 12px; padding: 5px 14px; cursor: pointer; }
@media (max-width: 700px) { .tp-evc { grid-template-columns: 8px minmax(0, 1fr) auto 22px; row-gap: 1px; } .tp-evc-d { grid-column: 2; } .tp-evc-x { grid-column: 3; grid-row: 1; } .tp-evc-i { grid-column: 3; } .tp-evc-c { grid-column: 2 / 4; } .tp-evc > .tp-evc-b:last-child { grid-column: 4; grid-row: 1; } }
/* commandes de la semaine sur téléphone : barre d'actions en bas de la feuille (pas fixe), en icônes */
@media (max-width: 700px) {
  .sticky-bar.cs-barre { position: static; box-shadow: none; margin: 10px 0 90px; padding: 8px 0; background: none; border: 0; flex-wrap: nowrap; gap: 8px; }
  .cs-barre .cs-lib { display: none; }
  .cs-barre button { width: 44px; height: 40px; padding: 0; justify-content: center; flex-shrink: 0; }
  .sticky-bar.cs-barre { flex-wrap: wrap; row-gap: 6px; }
  .cs-barre > .small, .cs-barre .cs-sync { flex: 1 1 100%; margin: 0; font-size: 11.5px; }
  .cs-barre .grow { display: none; }
  .cs-barre button:first-of-type { margin-left: auto; }
  .cs-feuille-scroll { margin-bottom: 0; }
}
.cs-feuille .cf-nom.cf-btn, .cs-feuille .cf-nom { white-space: normal; overflow-wrap: anywhere; }
/* téléphone : codes articles lisibles en entier (Tare sous le nom, Rubrique en bande de couleur) */
.cf-tare-m { display: none; }
@media (max-width: 640px) {
  .cs-feuille col.cf-cl { width: 84px; } .cs-feuille col.cf-ta { width: 0; } .cs-feuille col.cf-ru { width: 10px; }
  .cs-feuille col.cf-ty { width: 126px; } .cs-feuille col.cf-nb { width: 50px; } .cs-feuille col.cf-to { width: 58px; }
  .cs-feuille td.cf-tare, .cs-feuille th:nth-child(2) { padding: 0; border: 0; font-size: 0; overflow: hidden; }
  .cs-feuille th:nth-child(3) { font-size: 0; padding: 0; }
  .cs-feuille td.cf-rub { padding: 0; font-size: 0; border-left-width: 4px; }
  .cs-feuille td.cf-rub .cf-rl, .cs-feuille td.cf-rub .cf-rc { display: none; }
  .cf-tare-m { display: block; font-size: 10.5px; color: var(--text-3); font-weight: 400; }
  .cs-feuille td.cf-ty { white-space: normal; overflow-wrap: anywhere; line-height: 1.15; font-size: 12.5px; padding: 3px 5px; }
  .cs-feuille td.cf-ty .cf-btn { white-space: normal; overflow-wrap: anywhere; line-height: 1.15; height: auto; min-height: 33px; display: flex; align-items: center; }
  .cf-paire .cf-pt { white-space: normal; overflow-wrap: anywhere; line-height: 1.15; font-size: 12px; padding: 3px 4px; }
  .cf-paire .cf-pt .cf-btn { line-height: 1.15; white-space: normal; overflow-wrap: anywhere; }
}
@media (max-width: 640px) { .cf-paire { grid-template-columns: minmax(0, 1fr) 36px; } .cf-paire .cs-n { padding: 0 4px; } .cf-paire .cf-pt { font-size: 11.5px; padding: 3px 3px; letter-spacing: -.2px; } }
.cs-n.erreur { outline: 2px solid var(--danger) !important; background: var(--danger-soft) !important; }

/* ---------- étiquettes boutique */
.etq-imp { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 18px; align-items: start; }
.etq-apercu-card { position: sticky; top: 14px; }
.etq-apercu { min-height: 120px; padding: 14px 0; background: repeating-conic-gradient(var(--bg) 0 25%, transparent 0 50%) 0 0 / 16px 16px; border-radius: 8px; }
.etq-outils { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin: 12px 0 8px; }
.etq-outils .check { margin-left: auto; }
.etq-liste { border-top: 1px solid var(--line); max-height: calc(100vh - 330px); overflow: auto; }
.etq-ligne { display: flex; gap: 12px; align-items: center; padding: 9px 4px; border-bottom: 1px solid var(--line); cursor: pointer; }
.etq-ligne.on { background: var(--accent-soft); }
.etq-ligne .num { min-width: 86px; text-align: right; }
.etq-ligne .ei-q { width: 56px; text-align: center; }
.etq-grille { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 14px; }
.etq-carte { display: flex; flex-direction: column; gap: 6px; color: inherit; text-decoration: none; }
a.etq-carte:hover { border-color: var(--accent); }
.etq-carte.a-relier { border-color: #f0b429; }
.etq-mini, .etq-vis { height: 170px; display: flex; align-items: center; justify-content: center; background: var(--bg); border-radius: 8px; overflow: hidden; margin-bottom: 4px; }
.etq-mini > div { box-shadow: 0 1px 6px rgba(0, 0, 0, .18); }
.etq-vis img { max-width: 100%; max-height: 100%; object-fit: contain; }
.etq-drop { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; padding: 22px; border: 2px dashed var(--line); border-radius: 10px; }
.etq-drop > div { flex: 1; min-width: 220px; }
.etq-drop.over { border-color: var(--accent); background: rgba(59, 91, 219, .05); }
.etq-ex { display: flex; gap: 10px; align-items: center; margin-bottom: 10px; }
.etq-ex select { flex: 1; min-width: 0; }
.etq-zone { padding: 20px; background: repeating-conic-gradient(var(--bg) 0 25%, transparent 0 50%) 0 0 / 16px 16px; border-radius: 10px; min-height: 260px; display: flex; justify-content: center; align-items: flex-start; }
.etq-page { position: relative; box-shadow: 0 2px 14px rgba(0, 0, 0, .2); user-select: none; touch-action: none; }
.etq-echelle { transform-origin: 0 0; width: max-content; }
.etq-page .ed-bloc { outline-width: calc(1px / var(--k, 1)); }
.etq-page .ed-bloc.sel { outline-width: calc(2px / var(--k, 1)); }
.etq-page .etq-b .ed-handle { right: 0; bottom: 0; transform-origin: 100% 100%; }
.etq-coul { display: flex; gap: 10px; align-items: center; }
.etq-coul input[type=color] { width: 46px; height: 32px; padding: 2px; }
@media (max-width: 1000px) { .etq-imp { grid-template-columns: 1fr; } .etq-apercu-card { position: static; } .etq-liste { max-height: none; } }

.etq-ligne .ei-mod { flex: none; }
.etq-mini-ed { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(220px, 1fr); gap: 18px; align-items: start; }
.etq-el { display: flex; align-items: center; gap: 8px; padding: 5px 8px; border-radius: 8px; cursor: pointer; font-size: 13px; }
.etq-el:hover { background: var(--bg); } .etq-el.on { background: var(--accent-soft); color: var(--accent-text); font-weight: 600; }
.etq-el .grow { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } .etq-el input[type=color] { width: 44px; padding: 2px; height: 30px; }
.etq-infos { display: flex; gap: 6px 14px; flex-wrap: wrap; align-items: center; margin: 4px 0 10px; }
.etq-places { display: flex; gap: 6px; flex-wrap: wrap; margin: 8px 0 10px; }
.etq-repere { position: absolute; background: #e6399b; z-index: 5; pointer-events: none; }
.etq-mini-ed .etq-zone { min-height: 200px; padding: 14px; }
@media (max-width: 800px) { .etq-mini-ed { grid-template-columns: 1fr; } }
.etq-carte-act { margin-top: 6px; gap: 6px; }

/* accueil : meilleurs clients N et N-1 côte à côte */
.top-n1 { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
@media (max-width: 700px) { .top-n1 { grid-template-columns: 1fr; } }

/* commandes de Noël : colonne date de livraison, choix du jour */
.cs-feuille col.cf-li { width: 128px; }
.cs-feuille td.cf-liv { vertical-align: top; padding: 5px 4px; }
.cs-feuille input.cs-liv { width: 100%; min-width: 0; padding: 4px 3px; font-size: 12.5px; }
.cs-feuille input.cs-liv.saved { outline: 2px solid var(--ok, #2e7d32); }
.cs-sans { color: var(--danger, #c62828); }
.cs-jours { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 12px; }
.cs-jour { border-radius: 20px; padding: 6px 12px; font-size: 13px; text-transform: none; }
.cs-jour::first-letter { text-transform: uppercase; }
.cs-jour.on { background: var(--accent-soft); color: var(--accent-text); border-color: var(--accent); font-weight: 600; }
@media (max-width: 640px) { .cs-feuille col.cf-li { width: 100px; } .cs-feuille input.cs-liv { font-size: 11px; }
  .cs-feuille.cs-noel th:nth-child(3) { font-size: 10px; padding: 4px 2px; } .cs-feuille.cs-noel th:nth-child(4) { font-size: 0; padding: 0; } }

/* agenda : vue du mois (Google Agenda + livraisons de Noël) */
.ag-carte { padding: 12px; }
.ag-barre { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.ag-mois { font-size: 17px; min-width: 150px; text-align: center; } .ag-mois::first-letter { text-transform: uppercase; }
.ag-grille { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); border-top: 1px solid var(--line); border-left: 1px solid var(--line); }
.ag-tete { font-size: 11px; text-transform: uppercase; color: var(--text-2); text-align: center; padding: 6px 0; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); background: var(--surface-2); }
.ag-jour { min-height: 104px; padding: 4px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); cursor: pointer; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.ag-jour:hover { background: var(--surface-2); }
.ag-hors { background: var(--surface-2); } .ag-hors .ag-num { opacity: .45; }
.ag-num { font-size: 12px; font-weight: 600; width: 22px; height: 22px; line-height: 22px; text-align: center; border-radius: 50%; }
.ag-auj .ag-num { background: var(--accent); color: #fff; }
.ag-sel { box-shadow: inset 0 0 0 2px var(--accent); }
.ag-ev { all: unset; box-sizing: border-box; display: block; width: 100%; font-size: 11.5px; line-height: 1.35; padding: 1px 5px; border-radius: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; cursor: pointer; border-left: 3px solid var(--c); background: color-mix(in srgb, var(--c) 10%, transparent); }
.ag-ev-j { background: var(--c); color: var(--t, #fff); border-left-color: transparent; }
.ag-ev:hover { filter: brightness(.95); }
.ag-h { font-variant-numeric: tabular-nums; color: var(--text-2); margin-right: 4px; } .ag-ev-j .ag-h { color: inherit; }
.ag-noel { all: unset; box-sizing: border-box; display: flex; align-items: center; gap: 4px; width: 100%; font-size: 11.5px; font-weight: 600; padding: 1px 5px; border-radius: 4px; background: #c62828; color: #fff; cursor: pointer; }
.ag-noel .i { width: 13px; height: 13px; }
.ag-plus { font-size: 11px; color: var(--text-2); padding-left: 5px; }
.ag-points { display: none; gap: 3px; flex-wrap: wrap; justify-content: center; } .ag-points i { width: 6px; height: 6px; border-radius: 50%; background: var(--c); }
.ag-ligne { all: unset; box-sizing: border-box; display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 6px; border-top: 1px solid var(--line); cursor: pointer; }
.ag-ligne:hover { background: var(--surface-2); }
.ag-pastille { width: 10px; height: 10px; border-radius: 50%; background: var(--c); flex: none; }
.ag-quand { font-size: 12.5px; font-variant-numeric: tabular-nums; color: var(--text-2); min-width: 92px; }
.ag-ligne-noel { color: #c62828; } .ag-ligne-noel .muted { color: var(--text-2); }
#ag-detail .card-title::first-letter { text-transform: uppercase; }
@media (max-width: 700px) {
  .ag-carte { padding: 8px; }
  .ag-jour { min-height: 54px; align-items: center; padding: 3px 1px; }
  .ag-ev, .ag-noel, .ag-plus { display: none; }
  .ag-points { display: flex; }
}

.ag-agendas { display: flex; flex-wrap: wrap; gap: 6px; padding: 0 0 10px; }
.ag-agenda { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; font-size: 12px; background: var(--surface-2, transparent); }
.ag-agenda i { width: 10px; height: 10px; border-radius: 50%; background: var(--c); }
.ag-agenda.ag-masque { opacity: .45; text-decoration: line-through; }
.ag-agenda.ag-masque i { background: transparent; border: 2px solid var(--c); }
.ag-encours { opacity: .55; }
#main.chargement { cursor: progress; }
#main.chargement > * { opacity: .6; transition: opacity .2s .15s; }

/* planning de Noël */
.np-barre { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: 4px 0 12px; }
.np-carte { padding-bottom: 12px; }
.np-scroll { overflow-x: auto; border: 1px solid var(--line-2); border-radius: 8px; }
.np-grille { border-collapse: collapse; font-size: 12.5px; }
.np-grille th, .np-grille td { border: 1px solid var(--line); padding: 0; text-align: center; height: 30px; min-width: 78px; }
.np-grille thead th { background: var(--surface-2); font-size: 11px; color: var(--text-2); font-weight: 600; padding: 3px 2px; position: sticky; top: 0; }
.np-grille tr.np-sem th { font-size: 10.5px; letter-spacing: .04em; }
.np-grille th.np-j span { display: block; font-size: 10px; color: var(--text-3); } .np-grille th.np-j b { font-size: 13px; color: var(--text); }
.np-grille .np-lib { position: sticky; left: 0; z-index: 1; background: var(--surface); text-align: left; padding: 0 10px; min-width: 170px; max-width: 200px; font-weight: 600; font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.np-grille thead .np-lib { z-index: 3; background: var(--surface-2); }
.np-grille .np-tot { min-width: 60px; font-weight: 650; background: var(--surface-2); font-variant-numeric: tabular-nums; }
.np-grille .np-we { background: color-mix(in srgb, var(--text) 4%, transparent); }
.np-grille th.np-auj, .np-grille td.np-auj { box-shadow: inset 0 0 0 2px var(--accent); }
.np-grille thead th.np-liv b { color: #c62828; }
.np-c { all: unset; box-sizing: border-box; width: 100%; height: 30px; padding: 0 4px; text-align: center; font-size: 12.5px; }
.np-c:focus { background: var(--accent-soft); outline: 2px solid var(--accent); outline-offset: -2px; }
.np-c.np-ok { background: var(--ok-soft); transition: background .2s; }
.np-grille tr.np-auto td, .np-grille tr.np-auto th { color: var(--text-2); font-size: 12px; background: color-mix(in srgb, var(--accent) 4%, var(--surface)); }
.np-grille tr.np-calc td, .np-grille tr.np-calc th { font-weight: 650; background: var(--surface-2); }
.np-livb { all: unset; cursor: pointer; background: #c62828; color: #fff; border-radius: 999px; padding: 1px 9px; font-size: 11.5px; font-weight: 650; }

/* planning de Noël : lecture, choix des personnes */
.np-grille td.np-lundi, .np-grille th.np-lundi { border-left: 2px solid var(--line-2); }
.np-grille tr.np-bloc th, .np-grille tr.np-bloc td { background: var(--surface-2); height: 22px; font-size: 10.5px; text-transform: uppercase; letter-spacing: .05em; color: var(--text-3); font-weight: 650; }
.np-grille tr.np-bloc td { border-left: 0; border-right: 0; }
.np-c.np-ev { height: 38px; resize: none; font-size: 11px; line-height: 1.25; padding: 3px 4px; white-space: normal; overflow: hidden; display: block; }
.np-grille td.np-rempli { background: color-mix(in srgb, var(--pc) 16%, var(--surface)); }
.np-grille td.np-rempli .np-p { color: color-mix(in srgb, var(--pc) 70%, #000); font-weight: 650; }
.np-grille td.np-double { box-shadow: inset 0 0 0 2px var(--danger); }
.np-grille td.np-estompe { opacity: .28; }
.np-grille td.np-focus { box-shadow: inset 0 0 0 2px var(--pc); }
.np-grille td.np-bon { color: var(--ok); font-weight: 650; } .np-grille td.np-mal { color: var(--danger); font-weight: 650; }
.np-personnes { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 10px; align-items: center; }
.np-pers { all: unset; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px; font-size: 12.5px; font-weight: 600; border: 1px solid var(--line-2); background: var(--surface); }
.np-pers i { width: 10px; height: 10px; border-radius: 50%; background: var(--pc); }
.np-pers span { font-weight: 500; color: var(--text-3); font-size: 11.5px; }
.np-pers.on { border-color: var(--pc); background: color-mix(in srgb, var(--pc) 14%, var(--surface)); }
.np-aide { margin: 8px 2px 0; }
.np-choix { position: absolute; z-index: 60; display: flex; flex-wrap: wrap; gap: 5px; max-width: 320px; padding: 8px; background: var(--surface); border: 1px solid var(--line-2); border-radius: 10px; box-shadow: var(--shadow-lg); }
.np-choix button { all: unset; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; padding: 6px 11px; border-radius: 8px; font-size: 13px; font-weight: 600; background: color-mix(in srgb, var(--pc) 14%, var(--surface)); color: color-mix(in srgb, var(--pc) 70%, #000); }
.np-choix button i { width: 9px; height: 9px; border-radius: 50%; background: var(--pc); }
.np-choix button:hover { background: color-mix(in srgb, var(--pc) 26%, var(--surface)); }
.np-choix .np-effacer { background: var(--surface-2); color: var(--text-2); }
.np-h3 { font-size: 13.5px; margin: 14px 0 8px; }
.np-coul { width: 38px; height: 34px; padding: 2px; border-radius: 8px; }

/* planning de Noël : couleurs de case (légende) et poignée de recopie */
.np-grille td.np-marque { background: color-mix(in srgb, var(--mc) 32%, var(--surface)) !important; box-shadow: inset 3px 0 0 var(--mc); }
.np-grille td { position: relative; }
.np-legende { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 0 0 10px; }
.np-leg { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 600; }
.np-leg i { width: 14px; height: 14px; border-radius: 4px; background: color-mix(in srgb, var(--mc) 45%, var(--surface)); box-shadow: inset 3px 0 0 var(--mc); }
.np-choix-coul { display: flex; flex-wrap: wrap; gap: 5px; width: 100%; padding-top: 6px; margin-top: 2px; border-top: 1px solid var(--line); }
.np-choix .np-choix-coul button { background: var(--surface-2); color: var(--text-2); font-size: 12px; padding: 5px 9px; }
.np-choix .np-choix-coul button i { width: 12px; height: 12px; border-radius: 3px; background: var(--mc); }
.np-choix .np-choix-coul button.on { box-shadow: inset 0 0 0 2px var(--text-2); }
.np-poignee { position: absolute; right: -4px; bottom: -4px; width: 9px; height: 9px; background: var(--accent); border: 2px solid var(--surface); border-radius: 2px; cursor: crosshair; z-index: 4; touch-action: none; }
@media (pointer: coarse) { .np-poignee { width: 16px; height: 16px; right: -7px; bottom: -7px; } }
.np-grille td.np-tire { box-shadow: inset 0 0 0 2px var(--accent); background: var(--accent-soft) !important; }

.np-grille tr.np-lieu th, .np-grille tr.np-lieu td { background: color-mix(in srgb, var(--accent) 7%, var(--surface)); color: var(--accent-text); font-size: 11px; font-weight: 700; height: 24px; text-transform: none; letter-spacing: 0; }
.np-grille tr.np-lieu th span { font-weight: 500; color: var(--text-3); margin-left: 4px; }
.np-grille tr.np-lieu td { border-left: 1px solid var(--line); border-right: 0; }
.np-grille tr.np-vide th, .np-grille tr.np-vide td { height: 28px; }

.np-grille td.np-sel { background: var(--accent-soft) !important; box-shadow: inset 0 0 0 1px var(--accent); }
.np-options { position: absolute; top: calc(100% + 2px); right: 0; z-index: 5; display: flex; gap: 2px; padding: 3px; background: var(--surface); border: 1px solid var(--line-2); border-radius: 8px; box-shadow: var(--shadow); white-space: nowrap; }
.np-options button { all: unset; cursor: pointer; font-size: 11.5px; font-weight: 600; padding: 4px 8px; border-radius: 6px; color: var(--text-2); }
.np-options button.on { background: var(--accent); color: #fff; }

.np-grille th.np-lib-modif { cursor: pointer; }
.np-grille th.np-lib-modif:hover { color: var(--accent-text); text-decoration: underline dotted; text-underline-offset: 3px; }
.np-fumb { display: inline-block; padding: 1px 7px; border-radius: 999px; font-size: 11px; font-weight: 650; white-space: nowrap; background: var(--surface-2); color: var(--text-2); }
.np-fumj2 { display: inline-block; margin-left: 3px; padding: 0 5px; border-radius: 999px; font-size: 10px; font-weight: 700; color: #fff; background: #c62828; }
.np-grille tr.np-fum td { padding: 3px 2px; white-space: nowrap; }
.np-fumrec { all: unset; cursor: pointer; display: block; width: 100%; padding: 2px 0; font-size: 11px; line-height: 1.3; text-align: center; color: var(--text-2); border-radius: 4px; }
.np-fumrec:hover { background: var(--accent-soft); }
.np-fumrec.np-impose { color: var(--text); font-weight: 650; box-shadow: inset 0 0 0 1.5px var(--accent); }
.np-choix-fum { flex-direction: column; align-items: stretch; }
.np-choix-fum .np-rouge { color: #c62828; }
.np-choix-fum button { --pc: #868e96; justify-content: center; }
.np-choix-fum button.on { box-shadow: inset 0 0 0 2px var(--accent); }

/* formules du planning des approvisionnements */
.np-grille td.np-fx { background: var(--surface-2); }
.np-grille td.np-fx .np-c::placeholder { color: inherit; opacity: 1; }
.np-grille td.np-fxc { background: var(--warn-soft); }
.np-lfx { gap: 6px; margin: -2px 0 2px 14px; flex-wrap: nowrap; align-items: center; }
.np-lfx input[data-f] { font-family: ui-monospace, Menlo, monospace; font-size: 12px; height: 28px; }
.np-lfx-eg { color: var(--text-3); font-family: ui-monospace, Menlo, monospace; }
.np-lfx-err { color: var(--danger); margin: 0 0 8px 28px; min-height: 0; }

/* planning de Noël : dates toujours visibles (le tableau défile dans son cadre), plannings repliables */
.np-scroll { max-height: calc(100vh - 150px); overflow: auto; }
.np-grille thead { position: sticky; top: 0; z-index: 4; }
.np-grille thead th { position: static; }
.np-grille thead th.np-lib { position: sticky; left: 0; }
.np-replier { cursor: pointer; user-select: none; }
.np-chev { display: inline-block; width: 14px; color: var(--text-3); transition: transform .15s; }
.np-carte.np-ferme .np-chev { transform: rotate(-90deg); }
.np-carte.np-ferme > :not(.card-title) { display: none; }
.np-carte.np-ferme { padding-bottom: 0; }
@media print { .np-scroll { max-height: none; overflow: visible; } .np-carte.np-ferme > :not(.card-title) { display: block; } }

/* planning de Noël : rendez-vous de l'agenda Google dans la ligne Événements */
.np-gcal { display: flex; flex-direction: column; gap: 2px; padding: 0 3px 3px; }
.np-gcal button { all: unset; cursor: pointer; display: block; font-size: 10.5px; line-height: 1.25; text-align: left; padding: 1px 4px 1px 3px; border-radius: 4px; background: color-mix(in srgb, var(--c) 16%, transparent); border-left: 3px solid var(--c); white-space: normal; overflow-wrap: anywhere; }
.np-gcal button:hover { background: color-mix(in srgb, var(--c) 28%, transparent); }
.np-gcal button i { display: none; }

/* import des bons de commande */
.bc-avoir { background: var(--warn-soft) !important; }
span.bc-avoir { padding: 0 4px; border-radius: 4px; }
.bc-doc { margin-bottom: 12px; }
.bc-lignes td { vertical-align: middle; }
.bc-hist { display: flex; flex-direction: column; gap: 4px; max-height: 220px; overflow: auto; }

/* bouton « Synchroniser » */
#synchro-btn.tourne svg { animation: synchro-tourne 1s linear infinite; }
@keyframes synchro-tourne { to { transform: rotate(360deg); } }
.synchro-l { display: flex; align-items: center; gap: 8px; padding: 8px 0; border-bottom: 1px solid var(--line, #eee); }
.synchro-l svg { width: 16px; height: 16px; flex: none; }
.synchro-ok svg { color: #1F8A4C; }
.synchro-erreur svg, .synchro-erreur .small { color: #D0353A; }
.synchro-en_cours svg { animation: synchro-tourne 1s linear infinite; }
.synchro-attente, .synchro-ignore { opacity: .6; }

/* gestion de production */
/* ---------- gestion de production */
.pr-aide { position: relative; display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; padding: 16px 48px 16px 18px; margin-bottom: 18px; border-radius: var(--radius); background: var(--accent-soft); color: var(--text); }
.pr-etape { display: flex; gap: 10px; align-items: flex-start; font-size: 13px; color: var(--text-2); line-height: 1.4; }
.pr-etape b { display: block; color: var(--text); font-size: 14px; margin-bottom: 2px; }
.pr-etape > span { flex-shrink: 0; width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; background: var(--accent); color: #fff; font-weight: 700; font-size: 13px; }
.pr-aide-x { position: absolute; top: 8px; right: 8px; }
.pr-sec { padding: 0; overflow: hidden; }
.pr-sec-tete { display: flex; align-items: center; gap: 12px; padding: 16px 18px 10px; flex-wrap: wrap; }
.pr-sec-tete h3 { margin: 0; font-size: 17px; }
.pr-poids { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--text-2); }
.pr-nav { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 14px; }
.pr-nav a { padding: 6px 12px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); color: var(--text); font-size: 13px; font-weight: 600; text-decoration: none; }
.pr-nav a:hover { border-color: var(--accent); }
.pr-sec { scroll-margin-top: 70px; }
.pr-poids input { width: 64px; text-align: right; padding: 5px 8px; }
.pr-sec-resume { padding: 0 18px 14px; display: grid; gap: 6px; border-bottom: 1px solid var(--line); }
.pr-liste { display: flex; flex-direction: column; }
.pr-ligne { display: grid; grid-template-columns: minmax(170px, 1.1fr) minmax(200px, 1.6fr) 112px 112px 92px; gap: 18px; align-items: center; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.pr-ligne:last-child { border-bottom: 0; }
.pr-ligne:hover { background: var(--surface-2); }
.pr-ligne.fini { background: color-mix(in srgb, var(--ok-soft) 55%, transparent); }
.pr-lib { background: none; border: 0; padding: 0; min-height: 0; box-shadow: none; text-align: left; cursor: pointer; color: var(--text); font: inherit; font-weight: 700; font-size: 15px; display: inline-flex; align-items: center; gap: 6px; }
.pr-lib svg { width: 13px; height: 13px; opacity: 0; color: var(--text-3); transition: opacity .15s; }
.pr-ligne:hover .pr-lib svg { opacity: 1; }
.pr-badges { display: flex; gap: 5px; flex-wrap: wrap; margin-top: 5px; }
.pr-st-en { background: var(--accent-soft); color: var(--accent-text); }
.pr-det { margin-top: 4px; line-height: 1.35; }
.pr-barres { display: grid; gap: 7px; min-width: 0; }
.pr-b-lib { display: flex; align-items: baseline; gap: 6px; font-size: 12px; color: var(--text-2); margin-bottom: 3px; }
.pr-b-lib span:first-child { width: 72px; }
.pr-b-lib b { color: var(--text); font-variant-numeric: tabular-nums; }
.pr-b-piste { position: relative; height: 8px; border-radius: 4px; background: var(--line); overflow: hidden; }
.pr-b-piste.big { height: 10px; }
.pr-b-piste span { display: block; height: 100%; border-radius: 4px; background: var(--ok); transition: width .3s; }
.pr-b.cmd .pr-b-piste span { background: var(--accent); opacity: .75; }
.pr-b-piste i { position: absolute; right: 0; top: 0; bottom: 0; width: 6px; background: repeating-linear-gradient(45deg, var(--warn) 0 2px, transparent 2px 4px); }
.pr-cdet { line-height: 1.3; }
.pr-case { display: flex; flex-direction: column; gap: 3px; font-size: 12px; color: var(--text-2); margin: 0; }
.pr-case span { font-weight: 600; }
.pr-case small { color: var(--text-3); font-size: 11px; white-space: nowrap; }
.pr-case small .pr-suit { display: block; color: var(--accent-text); font-weight: 600; }
.pr-case small .pr-src { display: block; }
.pr-case small .pr-tape { color: var(--text-2); font-weight: 600; }
.pr-case input.pr-in { width: 100%; text-align: right; padding: 7px 9px; font-size: 15px; font-weight: 600; font-variant-numeric: tabular-nums; }
.pr-in-prod { border-color: color-mix(in srgb, var(--ok) 45%, var(--line-2)); }
.pr-reste { text-align: right; display: flex; flex-direction: column; align-items: flex-end; }
.pr-reste b { font-size: 22px; letter-spacing: -.02em; font-variant-numeric: tabular-nums; line-height: 1.1; }
.pr-reste small { font-size: 11.5px; color: var(--text-3); }
.pr-ligne.fini .pr-reste b { color: var(--ok); }
.pr-reste svg { width: 24px; height: 24px; }
@media (max-width: 900px) {
  .pr-aide { grid-template-columns: 1fr; }
  .pr-ligne { grid-template-columns: 1fr 1fr; gap: 12px; }
  .pr-art, .pr-barres { grid-column: 1 / -1; }
  .pr-reste { grid-column: 1 / -1; flex-direction: row; justify-content: flex-end; align-items: baseline; gap: 6px; }
}

/* Ajouter un produit : base des articles par famille */
.ap-base { max-height: 340px; overflow: auto; border: 1px solid var(--line); border-radius: 8px; margin-bottom: 6px; }
.ap-fam { position: sticky; top: 0; background: var(--surface); padding: 5px 10px; font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .03em; border-bottom: 1px solid var(--line); z-index: 1; }
.ap-art { display: grid; grid-template-columns: 120px minmax(0, 1fr) auto; gap: 8px; align-items: baseline; width: 100%; text-align: left; border: 0; border-bottom: 1px solid var(--line); border-radius: 0; background: transparent; padding: 7px 10px; font: inherit; cursor: pointer; min-height: 0; box-shadow: none; }
.ap-art span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; opacity: .75; }
.ap-art:hover { background: rgba(31, 138, 76, .06); }
.ap-art.on { background: #E8F5EC; box-shadow: inset 3px 0 0 #1F8A4C; }
.ap-art.deja { opacity: .45; }

/* feuille des commandes : cliquer-glisser des clients */
.cf-poignee { cursor: grab; touch-action: none; user-select: none; -webkit-user-select: none; color: var(--text-2); font-size: 16px; line-height: 20px; padding: 0 2px; flex-shrink: 0; opacity: .6; }
.cf-poignee:hover { opacity: 1; color: var(--accent-text); }
tr.cf-glisse > td { opacity: .45; }
tr.cf-drop-avant > td { box-shadow: inset 0 3px 0 var(--accent); }
tr.cf-drop-apres > td { box-shadow: inset 0 -3px 0 var(--accent); }
body:has(.cf-glisse) { cursor: grabbing; user-select: none; -webkit-user-select: none; }

/* ---------- bons de commande CSE */
.bdc-grille { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 4px 16px; }
.bdc-logo { width: 120px; height: 56px; border: 1px dashed var(--line-2); border-radius: 8px; display: grid; place-items: center; overflow: hidden; background: #fff; }
.bdc-logo img { max-width: 100%; max-height: 100%; object-fit: contain; }
.bdc-logo .faint { padding: 4px 6px; text-align: center; font-size: 11px; line-height: 1.2; }
.bdc-mini { height: 20px; max-width: 48px; object-fit: contain; vertical-align: middle; margin-right: 6px; background: #fff; border-radius: 3px; }
.bdc-tarifs { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.bdc-tarifs label { display: flex; flex-direction: column; gap: 1px; padding: 9px 12px; border: 1px solid var(--line-2); border-radius: 10px; cursor: pointer; font-size: 13px; }
.bdc-tarifs label span { color: var(--text-3); font-size: 12px; }
.bdc-tarifs label input { display: none; }
.bdc-tarifs label.on, .bdc-tarifs label:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); box-shadow: inset 0 0 0 1px var(--accent); }
.bdc-entete { margin: 10px 0 4px; border: 1px solid var(--line); border-radius: 10px; padding: 10px 14px; }
.bdc-entete summary { cursor: pointer; font-weight: 600; font-size: 14px; }
.bdc-entete[open] summary { margin-bottom: 8px; }
.bdc-art-tete { display: flex; align-items: center; gap: 10px; margin: 16px 0 8px; flex-wrap: wrap; }
.bdc-art-tete h3 { margin: 0; font-size: 16px; }
.bdc-articles { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 8px; }
.bdc-art { display: grid; grid-template-columns: 64px 1fr; gap: 10px; align-items: start; padding: 8px; border: 1px solid var(--line); border-radius: 10px; opacity: .55; transition: opacity .15s, border-color .15s; }
.bdc-art.on { opacity: 1; border-color: var(--accent); background: var(--accent-soft); }
.bdc-art img { width: 64px; height: 48px; object-fit: cover; border-radius: 6px; background: var(--surface-2); }
.bdc-art-txt { display: flex; flex-direction: column; gap: 2px; min-width: 0; font-size: 13px; }
.bdc-art-txt > b { font-size: 13.5px; }
.bdc-formats { display: flex; flex-wrap: wrap; gap: 4px 12px; margin-top: 4px; }
.bdc-formats label { display: inline-flex; align-items: center; gap: 5px; font-size: 12.5px; cursor: pointer; white-space: nowrap; }
.bdc-formats label.na { color: var(--text-3); cursor: not-allowed; }
.bdc-cat summary { cursor: pointer; padding: 14px 16px; list-style: revert; }
.bdc-cat { padding: 0; overflow: hidden; }

.cl-logo { height: 40px; max-width: 120px; object-fit: contain; vertical-align: middle; margin-right: 12px; background: #fff; border-radius: 6px; padding: 3px; border: 1px solid var(--line); }
/* ---------- catalogue PDF : choix des lignes */
.cc-liste { max-height: 56vh; overflow: auto; border: 1px solid var(--line); border-radius: 10px; }
.cc-grp { border-bottom: 1px solid var(--line); }
.cc-grp:last-child { border-bottom: 0; }
.cc-titre { position: sticky; top: 0; z-index: 1; display: flex; align-items: center; gap: 8px; padding: 8px 12px; background: var(--surface-2); font-size: 13px; cursor: pointer; }
.cc-ligne { display: grid; grid-template-columns: auto minmax(0, 1fr) auto 80px; gap: 10px; align-items: center; padding: 6px 12px 6px 32px; font-size: 13px; cursor: pointer; border-top: 1px solid var(--line); }
.cc-ligne:hover { background: var(--surface-2); }
.cc-ligne:has(input:not(:checked)) .cc-des { color: var(--text-3); text-decoration: line-through; }
.cc-ref { font-size: 11.5px; }
.cc-px { text-align: right; font-variant-numeric: tabular-nums; }
@media (max-width: 600px) { .cc-ligne { grid-template-columns: auto minmax(0, 1fr) 70px; } .cc-ref { display: none; } }

/* ============================================================ vente directe (salons) */
.vd-sync { font-size: 12.5px; color: var(--ok); } .vd-sync.attente { color: var(--warn); font-weight: 600; }
.filters input[type=date] { width: auto; }
.vd-actions { white-space: nowrap; }
.vd-barre { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 14px; }
.vd-barre select { width: auto; max-width: 340px; font-weight: 600; }
.vd-barre input { width: 140px; }
.vd-jour { font-size: 13px; color: var(--text-2); } .vd-jour b { color: var(--text); }
.vd-grille { display: grid; grid-template-columns: 190px minmax(0, 1fr) minmax(320px, 360px); gap: 16px; align-items: start; }
/* rayons */
.vd-rayons { display: flex; flex-direction: column; gap: 6px; position: sticky; top: 14px; }
.vd-rayons button { display: flex; align-items: center; gap: 10px; text-align: left; padding: 10px 12px; border-radius: 12px; background: var(--surface);
  border: 1px solid var(--line); box-shadow: var(--shadow-sm); font-weight: 600; font-size: 14px; color: var(--text); white-space: nowrap; }
.vd-rayons button:hover { border-color: var(--c); }
.vd-rayons button.on { background: var(--c); border-color: var(--c); color: #fff; box-shadow: 0 4px 14px color-mix(in srgb, var(--c) 35%, transparent); }
.vd-r-ico { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; font-size: 17px; background: color-mix(in srgb, var(--c) 14%, transparent); flex-shrink: 0; }
.vd-rayons button.on .vd-r-ico { background: rgba(255, 255, 255, .22); }
.vd-r-nom { flex: 1; overflow: hidden; text-overflow: ellipsis; }
.vd-r-n { font-size: 12px; font-weight: 600; color: var(--text-3); } .vd-rayons button.on .vd-r-n { color: rgba(255, 255, 255, .8); }
/* recherche + produits */
.vd-articles { min-width: 0; }
.vd-scan { display: flex; align-items: center; gap: 8px; border: 1px solid var(--line-2); border-radius: 12px; padding: 0 12px; background: var(--surface); box-shadow: var(--shadow-sm); }
.vd-scan:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.vd-scan input { border: none; box-shadow: none !important; padding: 12px 0; font-size: 16px; background: transparent; }
.vd-scan svg.i { color: var(--text-3); flex-shrink: 0; }
.vd-scan-x { border: none; background: none; padding: 4px; color: var(--text-3); }
.vd-titre-rayon { font-size: 18px; font-weight: 700; margin: 16px 2px 10px; letter-spacing: -.01em; }
.vd-produits { display: grid; grid-template-columns: repeat(auto-fill, minmax(165px, 1fr)); gap: 12px; }
.vd-prod { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow-sm); overflow: hidden; display: flex; flex-direction: column; }
.vd-img { position: relative; display: grid; place-items: center; aspect-ratio: 16 / 10; border: none; border-radius: 0; padding: 0; width: 100%;
  background: linear-gradient(145deg, color-mix(in srgb, var(--c) 16%, var(--surface)), color-mix(in srgb, var(--c) 5%, var(--surface))); }
.vd-img img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; }
.vd-emoji { font-size: 46px; filter: saturate(.9); }
.vd-type { position: absolute; top: 8px; left: 8px; background: var(--c); color: #fff; font-size: 11px; font-weight: 700; padding: 3px 8px; border-radius: 999px; letter-spacing: .02em; }
.vd-nom { font-weight: 650; font-size: 14px; line-height: 1.25; padding: 10px 12px 8px; min-height: 2.5em; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.vd-formats { display: flex; flex-wrap: wrap; gap: 6px; padding: 0 10px 12px; margin-top: auto; }
.vd-formats button { flex: 1 0 calc(50% - 3px); display: flex; flex-direction: column; align-items: center; gap: 1px; padding: 7px 4px; border-radius: 10px;
  border: 1.5px solid color-mix(in srgb, var(--c) 40%, var(--line)); background: color-mix(in srgb, var(--c) 6%, var(--surface)); white-space: nowrap; }
.vd-formats button:only-child { flex-basis: 100%; }
.vd-formats button b { font-size: 14px; color: var(--text); }
.vd-formats button span { font-size: 12.5px; color: var(--c); font-weight: 650; font-variant-numeric: tabular-nums; }
.vd-formats button:hover { background: color-mix(in srgb, var(--c) 14%, var(--surface)); border-color: var(--c); }
.vd-formats button:active, .vd-formats button.vd-ok { animation: vd-pop .35s ease; }
@keyframes vd-pop { 0% { transform: scale(1); } 40% { transform: scale(.92); background: var(--c); } 100% { transform: scale(1); } }
/* vente en cours */
.vd-panier { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 14px; display: flex; flex-direction: column; position: sticky; top: 14px; min-width: 0; }
.vd-p-tete { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.vd-p-n { font-size: 12.5px; color: var(--text-3); }
.vd-lignes { display: flex; flex-direction: column; max-height: calc(100vh - 330px); min-height: 140px; overflow-y: auto; }
.vd-vide { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; color: var(--text-3); padding: 34px 0; font-size: 14px; }
.vd-vide span { font-size: 34px; opacity: .7; }
.vd-ligne { display: grid; grid-template-columns: 38px minmax(0, 1fr) auto auto; align-items: center; gap: 8px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.vd-l-img { width: 38px; height: 38px; border-radius: 9px; overflow: hidden; display: grid; place-items: center; font-size: 19px; background: color-mix(in srgb, var(--c) 14%, var(--surface)); }
.vd-l-img img { width: 100%; height: 100%; object-fit: cover; }
.vd-l-des { display: flex; flex-direction: column; gap: 1px; text-align: left; border: none; background: none; padding: 0; font-size: 13.5px; line-height: 1.25; white-space: normal; min-width: 0; }
.vd-qte { display: inline-flex; align-items: center; border: 1px solid var(--line-2); border-radius: 999px; overflow: hidden; }
.vd-qte button { border: none; border-radius: 0; background: var(--surface-2); width: 30px; height: 30px; padding: 0; font-size: 17px; font-weight: 600; }
.vd-qte b { min-width: 26px; text-align: center; font-variant-numeric: tabular-nums; }
.vd-l-tot { font-variant-numeric: tabular-nums; white-space: nowrap; min-width: 62px; text-align: right; }
.vd-total { display: flex; justify-content: space-between; align-items: baseline; padding: 14px 2px 12px; margin-top: 6px; border-top: 2px solid var(--text); }
.vd-total span { font-weight: 600; color: var(--text-2); }
.vd-total b { font-size: 34px; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.vd-payer { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.vd-payer button { padding: 15px 6px; font-size: 15px; border-radius: 12px; display: flex; gap: 6px; justify-content: center; align-items: center; }
.vd-payer button[data-pay="especes"] { background: var(--ok); border-color: var(--ok); }
.vd-payer button[data-pay="cheque"] { background: #495057; border-color: #495057; }
.vd-payer button:disabled { opacity: .4; box-shadow: none; }
.vd-billets { display: flex; gap: 6px; margin-bottom: 10px; } .vd-billets button { flex: 1; padding: 10px 0; font-weight: 600; }
.vd-rendu { font-size: 21px; padding: 8px 0 4px; } .vd-rendu b { color: var(--ok); }
/* réglages : produits */
.vr-rayon { padding: 4px 20px 14px; } .vr-r-titre { font-weight: 700; margin: 10px 0 6px; color: var(--c); }
.vr-prod { display: grid; grid-template-columns: 56px minmax(0, 1fr) auto auto; align-items: center; gap: 12px; padding: 8px 0; border-top: 1px solid var(--line); }
.vr-prod.masque { opacity: .45; }
.vr-img { width: 56px; height: 56px; border-radius: 11px; overflow: hidden; padding: 0; display: grid; place-items: center; border: 1px dashed var(--line-2);
  background: color-mix(in srgb, var(--c) 10%, var(--surface)); }
.vr-img img { width: 100%; height: 100%; object-fit: cover; } .vr-img .vd-emoji { font-size: 24px; }
.vr-etoile { border: none; background: none; font-size: 22px; color: var(--line-2); padding: 4px 8px; } .vr-etoile.on { color: #f59f00; }
.vr-prop { white-space: nowrap; display: flex; align-items: center; gap: 6px; }
.vr-apercu { width: 200px; height: 200px; margin: 6px auto 4px; border-radius: 16px; overflow: hidden; display: grid; place-items: center; background: var(--surface-2); }
.vr-apercu img { width: 100%; height: 100%; object-fit: cover; } .vr-apercu .vd-emoji { font-size: 70px; }
@media (max-width: 1180px) { .vd-grille { grid-template-columns: 165px minmax(0, 1fr) 310px; } .vd-produits { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); } }
@media (max-width: 980px) {
  .vd-grille { grid-template-columns: minmax(0, 1fr); }
  .vd-rayons { flex-direction: row; overflow-x: auto; position: static; padding-bottom: 4px; scrollbar-width: none; }
  .vd-rayons button { flex-shrink: 0; padding: 8px 12px 8px 8px; }
  .vd-r-n { display: none; }
  .vd-panier { position: sticky; bottom: 0; top: auto; order: 3; z-index: 5; box-shadow: 0 -6px 24px rgba(20, 28, 50, .12); }
  .vd-lignes { max-height: 26vh; min-height: 0; }
  .vd-vide { padding: 8px 0; flex-direction: row; }
  .vd-total { padding: 8px 2px; } .vd-total b { font-size: 26px; }
  .vd-produits { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
}
@media (max-width: 520px) { .vd-barre input { width: 110px; } .vd-barre select { max-width: 200px; } .vd-payer button { padding: 12px 4px; font-size: 14px; } .vd-emoji { font-size: 36px; } }
.vd-p-replier { display: flex; align-items: baseline; gap: 8px; border: none; background: none; padding: 0; color: var(--text); font-size: 14.5px; }
.vd-p-chev { display: none; color: var(--text-3); }
@media (max-width: 980px) {
  #main:has(#vd-corps) .page-head .sub { display: none; }
  .vd-p-chev { display: inline; transition: transform .2s; } .vd-panier.ouvert .vd-p-chev { transform: rotate(180deg); }
  .vd-panier:not(.ouvert) .vd-lignes { display: none; }
  .vd-panier { padding: 10px 12px; border-radius: 16px 16px 0 0; margin: 0 -4px; }
  .vd-total { border-top-width: 1px; margin-top: 2px; }
}
.vd-tarif { font-size: 13px; padding: 6px 12px; border-radius: 999px; background: var(--accent-soft); color: var(--accent-text); white-space: nowrap; }
.vd-tarif b { color: var(--danger); }
.vd-formats button s { color: var(--text-3); font-weight: 400; font-size: 11px; }
.vd-formats button { min-width: 0; }
.vd-formats button s { display: block; line-height: 1.1; }
.vd-l-code { font-size: 11px; color: var(--text-3); font-variant-numeric: tabular-nums; letter-spacing: .04em; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.vd-sync.refus { color: var(--danger); font-weight: 700; }
/* vente directe : vendeurs et suivi en direct */
#vd-vendeur-sel { width: auto; font-weight: 600; border-left: 6px solid var(--c); }
#vd-vendeur-sel.vd-vendeur-vide { border-color: var(--warn); color: var(--warn); }
.vd-pastille { display: inline-block; width: 12px; height: 12px; border-radius: 50%; background: var(--c); flex-shrink: 0; }
.vd-suivi { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.vd-col { background: var(--surface); border: 1px solid var(--line); border-top: 4px solid var(--c); border-radius: var(--radius); box-shadow: var(--shadow); padding: 12px 14px; display: flex; flex-direction: column; min-height: 220px; }
.vd-col-tete { display: flex; align-items: center; gap: 8px; font-size: 15px; }
.vd-col-jour { font-size: 13px; color: var(--text-2); margin: 6px 0 8px; } .vd-col-jour b { color: var(--text); }
.vd-col-panier { flex: 1; border-top: 1px solid var(--line); }
.vd-col-l { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 8px; font-size: 13px; padding: 6px 0; border-bottom: 1px solid var(--line); }
.vd-col-l span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vd-col-total { display: flex; justify-content: space-between; align-items: baseline; padding-top: 8px; color: var(--text-2); font-size: 13px; }
.vd-col-total b { font-size: 22px; color: var(--text); font-variant-numeric: tabular-nums; }
/* vente directe : les autres vendeurs, sous la vente en cours */
.vd-autres { margin-top: 14px; border-top: 1px solid var(--line); padding-top: 10px; }
.vd-autres-titre { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--text-3); margin-bottom: 6px; }
.vd-autre { border-left: 4px solid var(--c); border-radius: 8px; background: var(--surface-2); margin-bottom: 6px; }
.vd-autre-tete { display: flex; align-items: center; gap: 8px; width: 100%; border: none; background: none; padding: 8px 10px; font-size: 13.5px; text-align: left; }
.vd-autre-chev { color: var(--text-3); }
.vd-autre-lignes { padding: 0 10px 10px; font-size: 12.5px; }
.vd-autre-lignes > div { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 8px; padding: 4px 0; border-bottom: 1px solid var(--line); }
.vd-autre-lignes > div span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vd-autre-lignes .btn-sm { margin-top: 8px; }
@media (max-width: 980px) { .vd-panier:not(.ouvert) .vd-autres { display: none; } }
/* vente directe : fond teinté de la couleur du vendeur de l'appareil */
body.vd-teinte { background: color-mix(in srgb, var(--vd-teinte) 13%, var(--bg)); box-shadow: inset 0 6px 0 var(--vd-teinte); }
body.vd-teinte #side { background: color-mix(in srgb, var(--vd-teinte) 6%, var(--surface)); }
/* sélection en glissant sur les cases des listes */
.tbl td:first-child:has(> input.sel) { touch-action: none; cursor: pointer; }
body.sel-glisse, body.sel-glisse * { user-select: none !important; -webkit-user-select: none !important; cursor: ns-resize !important; }

.vd-lot { color: var(--accent-text); font-weight: 650; }

/* vente directe : ranger les produits d'un rayon à la main */
.vd-titre-rayon { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.vd-titre-rayon #vd-org { margin-left: auto; }
.vd-org-aide { margin-left: auto; font-size: 13px; font-weight: 500; color: var(--text-3); }
.vd-org-aide + #vd-org { margin-left: 0; }
.vd-organiser .vd-prod { cursor: grab; touch-action: none; user-select: none; -webkit-user-select: none; animation: vd-tremble .9s ease-in-out infinite; }
.vd-organiser .vd-prod * { pointer-events: none; }
.vd-organiser .vd-prod.vd-tenu { cursor: grabbing; animation: none; opacity: .75; outline: 3px solid var(--c); transform: scale(1.04); z-index: 2; position: relative; }
@keyframes vd-tremble { 0%, 100% { transform: rotate(-.6deg); } 50% { transform: rotate(.6deg); } }

/* vente directe : statistiques */
.vs-grille { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.vs-grille > .card { margin-bottom: 0; }
.vs-grille + .card { margin-top: 16px; }
@media (max-width: 820px) { .vs-grille { grid-template-columns: minmax(0, 1fr); } }
.vs-barre { height: 10px; background: var(--line); border-radius: 999px; overflow: hidden; }
.vs-barre span { display: block; height: 100%; background: var(--accent); border-radius: 999px; }

/* commandes de Noël : annexes (détail par client des commandes groupées) ; case rouge → verte quand la commande est remise */
.na-art { cursor: pointer; } .na-fo { font-weight: 650; white-space: nowrap; }
.na-feuille { overflow-x: auto; }
.na-doc { width: 100%; border-collapse: collapse; font-size: 14px; }
.na-doc th { text-align: left; font-size: 11.5px; text-transform: uppercase; letter-spacing: .03em; color: var(--text-2); background: var(--surface-2); padding: 8px 10px; }
.na-doc td { border: 1px solid var(--line-2); padding: 8px 10px; }
.na-doc tbody { border-top: 3px solid var(--text-2); }
.na-doc tbody.na-b:nth-of-type(even) td { background: var(--surface-2); }
.na-doc tbody.na-b.remis td { background: var(--ok-soft, #ecfdf3); }
.na-doc .na-n { text-align: center; color: var(--text-3); } .na-doc td.na-co { font-weight: 650; font-size: 13px; }
.na-doc .na-qt { text-align: center; font-weight: 650; } .na-doc .na-qt.plus { font-size: 17px; color: var(--danger); }
.na-doc .na-to { text-align: right; } .na-doc .na-to small, .na-doc .na-ca small { display: block; color: var(--text-3); font-size: 11.5px; } .na-eur { white-space: nowrap; }
.na-doc .na-ca { text-align: center; width: 74px; } .na-doc .na-fin td { background: var(--surface-2); font-weight: 650; }
.na-doc button.na-case { width: 36px; height: 36px; padding: 0; border: 3px solid #d0353a; border-radius: 8px; background: #fdecec; color: #fff; font-size: 20px; font-weight: 800; line-height: 1; cursor: pointer; }
.na-doc button.na-case.remis { border-color: #148a52; background: #148a52; }
@media (max-width: 640px) { .na-doc .na-n, .na-doc .na-co { display: none; } .na-doc td, .na-doc th { padding: 7px 5px; } .na-doc .na-ca { width: 50px; } }

/* adresses e-mail d'un client (fiche) et choix du destinataire (envoi) */
.cor-liste { display: flex; flex-direction: column; gap: 8px; margin-bottom: 8px; }
.cor-ligne { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr) auto auto; gap: 8px; align-items: center; }
.cor-ligne .check { white-space: nowrap; }
.em-choix { display: flex; align-items: center; gap: 8px; padding: 3px 0; }
.em-choix span { min-width: 0; overflow-wrap: anywhere; }
.em-choix + .em-autre { margin-top: 6px; }
@media (max-width: 640px) {
  .cor-ligne { grid-template-columns: 1fr auto; border-bottom: 1px solid var(--line); padding-bottom: 8px; }
  .cor-ligne .cor-nom, .cor-ligne .cor-mail { grid-column: 1 / -1; }
}

/* ============================================================ photothèque */
.ph-grille { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 14px; }
.ph-c { position: relative; margin: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm); overflow: hidden; cursor: pointer; }
.ph-c.on { outline: 3px solid var(--accent); } .ph-c img { display: block; width: 100%; aspect-ratio: 1; object-fit: cover; background: var(--surface-2); }
.ph-c figcaption { padding: 7px 9px; font-size: 12px; overflow-wrap: anywhere; } .ph-c figcaption span { display: block; }
.ph-coche { position: absolute; top: 4px; left: 4px; padding: 8px; z-index: 1; } .ph-coche input { width: 18px; height: 18px; margin: 0; }
.ph-pr { position: absolute; top: 8px; right: 8px; }
.ph-barre { position: sticky; top: 8px; z-index: 5; display: flex; gap: 8px; flex-wrap: wrap; align-items: center; padding: 10px 14px; margin-bottom: 14px; } .ph-barre select { width: auto; }
.modal-box.ph-large { width: min(1180px, 100%); }
.ph-fiche { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(300px, 1fr); gap: 22px; }
.ph-vue img { display: block; width: 100%; max-height: 70vh; object-fit: contain; background: #0c0c0e; border-radius: var(--radius-sm); }
.ph-nav { display: flex; justify-content: center; align-items: center; gap: 14px; margin-top: 8px; }
.ph-infos { margin: 10px 0; overflow-wrap: anywhere; } .ph-liens, .ph-dl { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 10px; }
.ph-arts { max-height: 44vh; overflow: auto; display: grid; gap: 4px; }
@media (max-width: 800px) { .ph-fiche { grid-template-columns: 1fr; } .ph-vue img { max-height: 46vh; } .ph-grille { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; } }

/* vente directe · check-list salon */
.vd-ck-compte { font-size: 15px; margin-right: 6px; }
.vd-ck-prog { height: 6px; background: var(--line, #e6e8ef); border-radius: 3px; overflow: hidden; margin: 6px 0 14px; }
.vd-ck-prog span { display: block; height: 100%; background: var(--ok, #148a52); transition: width .3s; }
.vd-ck-grille { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 12px; align-items: start; }
.vd-ck-rub { border: 1.5px solid var(--c); border-radius: 10px; overflow: hidden; background: var(--card, #fff); }
.vd-ck-tete { background: var(--c); color: #fff; font-weight: 700; padding: 8px 12px; display: flex; justify-content: space-between; align-items: center; }
.vd-ck-l { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-top: 1px dashed var(--line, #e6e8ef); cursor: pointer; font-size: 15px; min-height: 44px; }
.vd-ck-l input { width: 22px; height: 22px; accent-color: var(--c); flex: none; }
.vd-ck-l.on span.grow { color: var(--muted, #6b7280); text-decoration: line-through; }
.vd-ck-depart { margin: 16px 0 8px; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.vd-ck-depart .btn-primary { font-size: 16px; padding: 12px 20px; }
.vd-ck-depart.on { background: color-mix(in srgb, var(--ok, #148a52) 12%, transparent); border: 1.5px solid var(--ok, #148a52); border-radius: 10px; padding: 12px 16px; color: var(--ok, #148a52); }
.vd-ck-aide { margin: -4px 0 12px; }
.vd-ck-ok { color: var(--ok, #148a52); display: inline-flex; align-items: center; gap: 4px; } .vd-ck-ok svg { width: 14px; height: 14px; }
.vd-ck-rub.edit .vd-ck-tete { gap: 6px; padding: 6px 8px; }
.vd-ck-emoji { border: 0; background: rgba(255,255,255,.18); color: #fff; width: 34px; height: 34px; border-radius: 8px; font-size: 18px; cursor: pointer; flex: none; }
.vd-ck-emoji:hover { background: rgba(255,255,255,.32); }
.vd-ck-titre { flex: 1; min-width: 0; background: transparent; border: 1px solid transparent; color: #fff; font: inherit; font-weight: 700; padding: 6px 8px; border-radius: 7px; }
.vd-ck-titre:hover { border-color: rgba(255,255,255,.4); } .vd-ck-titre:focus { outline: none; background: rgba(255,255,255,.15); border-color: rgba(255,255,255,.7); }
.vd-ck-x-rub { border: 0; background: transparent; color: rgba(255,255,255,.75); width: 32px; height: 32px; border-radius: 8px; cursor: pointer; display: grid; place-items: center; flex: none; }
.vd-ck-x-rub:hover { background: rgba(0,0,0,.2); color: #fff; } .vd-ck-x-rub svg { width: 16px; height: 16px; }
.vd-ck-e { display: flex; align-items: center; gap: 4px; padding: 4px 6px 4px 4px; border-top: 1px dashed var(--line, #e6e8ef); background: var(--card, #fff); transition: opacity .15s, transform .15s; }
.vd-ck-e.part { opacity: 0; transform: translateX(24px); }
.vd-ck-e.drag { box-shadow: 0 8px 24px rgba(0,0,0,.18); border: 1.5px solid var(--c); border-radius: 8px; opacity: .95; }
.vd-ck-poignee { cursor: grab; touch-action: none; user-select: none; color: var(--text-3, #9aa0ab); font-size: 16px; letter-spacing: -2px; padding: 8px 6px; line-height: 1; }
.vd-ck-poignee:hover { color: var(--c); }
.vd-ck-txt { flex: 1; min-width: 0; border: 1px solid transparent; background: transparent; font: inherit; font-size: 15px; padding: 7px 8px; border-radius: 7px; color: inherit; }
.vd-ck-txt:hover { border-color: var(--line, #e6e8ef); } .vd-ck-txt:focus { outline: none; border-color: var(--c); background: var(--bg, #f5f6fa); }
.vd-ck-suppr { border: 0; background: transparent; color: var(--text-3, #9aa0ab); width: 34px; height: 34px; border-radius: 8px; cursor: pointer; font-size: 15px; flex: none; }
.vd-ck-suppr:hover { color: #d0353a; background: #fdecec; }
.vd-ck-ajout { padding: 8px 10px 10px; border-top: 1px dashed var(--line, #e6e8ef); }
.vd-ck-ajout input { width: 100%; border: 1.5px dashed color-mix(in srgb, var(--c) 45%, transparent); border-radius: 8px; padding: 9px 10px; background: transparent; font: inherit; font-size: 15px; }
.vd-ck-ajout input:focus { outline: none; border-style: solid; border-color: var(--c); background: color-mix(in srgb, var(--c) 6%, transparent); }
.vd-ck-place { margin: 4px 8px; border: 2px dashed var(--c); border-radius: 8px; background: color-mix(in srgb, var(--c) 8%, transparent); }
.vd-ck-nouv { min-height: 140px; border: 2px dashed var(--line, #d6d9e2); border-radius: 10px; background: transparent; color: var(--text-2, #5f6b7a); font: inherit; font-weight: 600; cursor: pointer; display: grid; place-content: center; gap: 4px; }
.vd-ck-nouv span { font-size: 28px; line-height: 1; } .vd-ck-nouv:hover { border-color: var(--accent, #3b5bdb); color: var(--accent, #3b5bdb); }
.vd-ck-pop { position: fixed; z-index: 2000; background: var(--card, #fff); border: 1px solid var(--line, #e6e8ef); border-radius: 12px; box-shadow: 0 10px 30px rgba(0,0,0,.15); padding: 8px; display: grid; grid-template-columns: repeat(5, 40px); gap: 4px; }
.vd-ck-pop button { border: 0; background: transparent; font-size: 20px; height: 40px; border-radius: 8px; cursor: pointer; } .vd-ck-pop button:hover { background: var(--bg, #f5f6fa); }

/* appel d'offre (Vente → CSE) */
.ao-onglets { display: flex; gap: 8px; flex-wrap: wrap; margin: 4px 0 14px; }
.ao-onglets a { display: flex; flex-direction: column; padding: 8px 14px; border: 1px solid var(--line); border-radius: 10px; text-decoration: none; color: var(--text-2); background: var(--surface, #fff); }
.ao-onglets a b { font-size: 16px; color: var(--text); } .ao-onglets a span { font-size: 12px; }
.ao-onglets a.on { border-color: var(--accent); background: var(--accent-soft); color: var(--accent-text); }
.ao-barre { display: flex; align-items: flex-end; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; }
.ao-barre .field { margin: 0; min-width: 220px; } .ao-ok { color: var(--ok, #148a52); display: inline-flex; gap: 4px; align-items: center; } .ao-ok svg { width: 14px; height: 14px; }
.ao-tete { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; } .ao-tete .field { margin: 0; }
.ao-table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 12px; background: var(--surface, #fff); }
.ao-table { width: 100%; border-collapse: collapse; min-width: 1000px; font-size: 13.5px; }
.ao-table th { background: #b87333; color: #fff; font-weight: 600; padding: 9px 8px; text-align: left; position: sticky; top: 0; z-index: 1; }
.ao-table th.num, .ao-table td.num { text-align: right; }
.ao-table td { padding: 5px 6px; border-top: 1px solid var(--line); vertical-align: middle; }
.ao-table tr.ao-premier td { border-top: 2px solid #d9b08c; }
.ao-table input, .ao-table textarea { width: 100%; border: 1px solid transparent; background: transparent; font: inherit; padding: 6px 7px; border-radius: 7px; color: inherit; }
.ao-table input:hover, .ao-table textarea:hover { border-color: var(--line); } .ao-table input:focus, .ao-table textarea:focus { outline: none; border-color: #b87333; background: var(--bg); }
.ao-table td.num input { text-align: right; }
.ao-nom { font-weight: 600; } .ao-des { min-width: 210px; } .ao-des textarea { resize: vertical; font-size: 13px; color: var(--text-2); }
.ao-cond { min-width: 90px; max-width: 130px; } .ao-prix { min-width: 72px; max-width: 100px; margin-left: auto; display: block; } .ao-tva { min-width: 48px; max-width: 60px; margin-left: auto; display: block; } .ao-dlc { min-width: 84px; }
.ao-calc { color: var(--text-2); white-space: nowrap; }
.ao-photo { width: 100px; } .ao-photo button { border: 0; padding: 0; background: var(--bg); border-radius: 8px; width: 92px; height: 62px; overflow: hidden; cursor: pointer; display: grid; place-items: center; color: var(--text-3); font-size: 12px; }
.ao-photo img { width: 100%; height: 100%; object-fit: cover; display: block; } .ao-photo button:hover { outline: 2px solid #b87333; }
.ao-lien { border: 0; background: none; color: #b87333; font: inherit; font-size: 13px; cursor: pointer; padding: 2px 7px; }
.ao-act { white-space: nowrap; width: 70px; text-align: right; }
.ao-x { border: 0; background: transparent; color: var(--text-3); width: 30px; height: 30px; border-radius: 7px; cursor: pointer; } .ao-x:hover { color: #d0353a; background: #fdecec; } .ao-x svg { width: 15px; height: 15px; }
.ao-ordre { display: inline-flex; gap: 2px; align-items: center; } .ao-ordre button:not(.ao-x) { border: 0; background: transparent; color: var(--text-3); cursor: pointer; width: 24px; height: 26px; border-radius: 6px; font-size: 11px; }
.ao-ordre button:not(.ao-x):hover:not(:disabled) { background: var(--bg); color: var(--text); } .ao-ordre button:disabled { opacity: .3; cursor: default; }
.ao-ajout { margin-top: 12px; width: 100%; padding: 14px; border: 2px dashed var(--line); border-radius: 12px; background: transparent; color: var(--text-2); font: inherit; font-weight: 600; cursor: pointer; }
.ao-ajout:hover { border-color: #b87333; color: #b87333; }
.ao-envoi { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; margin-right: 8px; }
.ao-galerie { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 8px; margin-top: 14px; max-height: 55vh; overflow: auto; }
.ao-galerie button { border: 2px solid transparent; border-radius: 8px; padding: 0; overflow: hidden; cursor: pointer; aspect-ratio: 3 / 2; background: var(--bg); }
.ao-galerie button.on, .ao-galerie button:hover { border-color: #b87333; } .ao-galerie img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* Communication → PLV & supports */
.badge.info { background: var(--accent-soft); color: var(--accent-text); }
.plv-filtres { display: flex; gap: 6px; flex-wrap: wrap; margin: 0 0 14px; }
.plv-filtre { border: 1px solid var(--line); background: var(--surface, #fff); color: var(--text-2); border-radius: 20px; padding: 6px 12px; font: inherit; font-size: 13px; cursor: pointer; }
.plv-filtre.on { background: var(--accent-soft); border-color: var(--accent); color: var(--accent-text); font-weight: 600; }
.plv-grille { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 14px; }
.plv-carte { display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: 14px; overflow: hidden; background: var(--surface, #fff); text-decoration: none; color: inherit; transition: box-shadow .15s, transform .15s; }
.plv-carte:hover { box-shadow: 0 8px 24px rgba(0,0,0,.08); transform: translateY(-2px); } .plv-carte.archive { opacity: .6; }
.plv-vignette { aspect-ratio: 4 / 3; background: var(--bg); display: grid; place-items: center; overflow: hidden; color: var(--text-3); }
.plv-vignette img { width: 100%; height: 100%; object-fit: contain; background: #1a1a1a; } .plv-vignette svg { width: 34px; height: 34px; }
.plv-infos { padding: 10px 12px 12px; display: grid; gap: 5px; } .plv-titre { font-weight: 600; line-height: 1.3; }
.plv-meta { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.plv-fiche { display: grid; grid-template-columns: minmax(220px, 320px) 1fr; gap: 14px; align-items: start; }
@media (max-width: 760px) { .plv-fiche { grid-template-columns: 1fr; } }
.plv-gauche { display: grid; gap: 10px; justify-items: center; }
.plv-grand { width: 100%; aspect-ratio: 3 / 4; background: #1a1a1a; border-radius: 10px; overflow: hidden; display: grid; place-items: center; color: #999; text-align: center; font-size: 13px; }
.plv-grand img { width: 100%; height: 100%; object-fit: contain; } .plv-grand svg { width: 40px; height: 40px; }
.plv-ap { cursor: pointer; display: inline-flex; gap: 6px; align-items: center; }
.plv-champs .field { margin: 0; }
.plv-depot { border: 2px dashed var(--line); border-radius: 10px; padding: 16px; text-align: center; color: var(--text-3); font-size: 13px; margin-bottom: 10px; }
.plv-depot.on { border-color: var(--accent); background: var(--accent-soft); color: var(--accent-text); }
.plv-ext span { display: inline-block; min-width: 42px; text-align: center; font-size: 11px; font-weight: 700; text-transform: uppercase; padding: 3px 6px; border-radius: 6px; background: var(--bg); color: var(--text-2); }
.plv-barre-envoi { display: grid; gap: 4px; margin-bottom: 10px; font-size: 13px; }
.plv-prog { height: 6px; background: var(--line); border-radius: 3px; overflow: hidden; } .plv-prog span { display: block; height: 100%; background: var(--accent); transition: width .2s; }
.plv-ok { color: var(--ok, #148a52); display: inline-flex; gap: 4px; align-items: center; } .plv-ok svg { width: 14px; height: 14px; }
.plv-types { display: flex; flex-wrap: wrap; gap: 6px; } .plv-type input { display: none; }
.plv-type span { display: inline-block; border: 1px solid var(--line); border-radius: 18px; padding: 6px 11px; font-size: 13px; cursor: pointer; }
.plv-type input:checked + span { background: var(--accent-soft); border-color: var(--accent); color: var(--accent-text); font-weight: 600; }

/* Vente → Événements (modèle caisse L'Écrin) */
.ev-annees { display: flex; gap: 6px; margin: 0 0 12px; } .ev-annees button { border: 1px solid var(--line); background: var(--surface, #fff); border-radius: 20px; padding: 6px 14px; font: inherit; cursor: pointer; }
.ev-annees button.on { background: var(--accent-soft); border-color: var(--accent); color: var(--accent-text); font-weight: 600; }
.ev-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; margin-bottom: 14px; } .ev-kpis.petit { grid-template-columns: 1fr 1fr; }
.ev-kpi { margin: 0; display: grid; gap: 4px; } .ev-gros { font-size: 24px; font-weight: 700; font-variant-numeric: tabular-nums; }
.ev-hausse { color: var(--ok, #148a52); font-weight: 600; } .ev-baisse { color: #d0353a; font-weight: 600; }
.ev-liste tbody tr { cursor: pointer; } .ev-liste tbody tr:hover { background: var(--bg); }
.ev-fiche { display: grid; grid-template-columns: minmax(330px, 390px) minmax(0, 1fr); gap: 14px; align-items: start; } .ev-fiche .card.flush { overflow-x: auto; } .ev-table { min-width: 720px; }
@media (max-width: 900px) { .ev-fiche { grid-template-columns: 1fr; } .ev-kpis.petit { grid-template-columns: 1fr; } }
.ev-saisie { margin: 0; } .ev-jours { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 14px; }
.ev-jours button { border: 1px solid var(--line); background: var(--surface, #fff); border-radius: 10px; padding: 8px 12px; font: inherit; font-size: 14px; cursor: pointer; text-transform: capitalize; }
.ev-jours button.fait { border-color: var(--ok, #148a52); color: var(--ok, #148a52); } .ev-jours button.on { background: var(--accent); border-color: var(--accent); color: #fff; }
.ev-ligne { display: grid; grid-template-columns: 110px 1fr 16px; align-items: center; gap: 8px; padding: 6px 0; border-bottom: 1px solid var(--line); }
.ev-ligne span { font-weight: 600; } .ev-ligne input { text-align: right; font-size: 18px; padding: 9px 10px; font-variant-numeric: tabular-nums; } .ev-ligne b { color: var(--text-3); }
.ev-frais span { color: var(--text-2); font-weight: 500; } .ev-rem { grid-template-columns: 110px 1fr; } .ev-rem input { text-align: left; font-size: 14px; }
.ev-total { display: flex; justify-content: space-between; align-items: baseline; margin: 14px 0 10px; padding: 12px 14px; background: var(--accent-soft); border-radius: 10px; }
.ev-total span { font-weight: 600; color: var(--accent-text); } .ev-total b { font-size: 28px; color: var(--accent-text); font-variant-numeric: tabular-nums; }
.ev-vd { display: flex; gap: 10px; align-items: center; padding: 10px 12px; border: 1px dashed var(--line); border-radius: 10px; margin-bottom: 10px; font-size: 14px; }
.ev-vd > svg { width: 20px; height: 20px; color: var(--text-3); flex: none; } .ev-vd > div { flex: 1; }
.ev-actions { display: flex; align-items: center; gap: 8px; } .ev-actions .btn-primary { font-size: 16px; padding: 10px 18px; }
.ev-table tr.sel td { background: var(--accent-soft); } .ev-table tbody tr { cursor: pointer; }

.vd-derniere { margin-top: 14px; font-size: 14px; display: flex; gap: 8px; align-items: center; justify-content: center; flex-wrap: wrap; color: var(--text-2); }

/* bon de commande en ligne (événement) + QR dans la vente directe */
.ev-bdc .ev-bdc-corps { display: flex; gap: 14px; align-items: flex-start; flex-wrap: wrap; }
.ev-qr { width: 132px; height: 132px; background: #fff; border-radius: 10px; padding: 4px; border: 1px solid var(--line); flex: none; }
.ev-bdc-infos { flex: 1; min-width: 220px; display: grid; gap: 5px; } .ev-bdc-infos a.strong { word-break: break-all; }
.ev-bdc-cmd { font-size: 15px; margin-top: 2px; } .ev-bdc-act { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 6px; }
.vd-qr { text-align: center; } .vd-qr h2 { margin-bottom: 4px; }
.vd-qr-img { background: #fff; border-radius: 14px; padding: 10px; margin: 12px auto; width: min(78vw, 340px); } .vd-qr-img svg { width: 100%; height: auto; display: block; }

.vd-qr-onglet { text-align: center; padding: 10px 0 30px; } .vd-qr-onglet h2 { margin: 6px 0 2px; font-size: 26px; }
.vd-qr-img.grand { width: min(88vw, 62vh, 520px); }

/* vente directe : espèces puis reste à payer par CB ou chèque */
.vd-reste { margin: 6px 0 4px; } .vd-reste-modes { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 6px; }
.vd-reste-modes button { padding: 14px 6px; font-size: 16px; } .vd-reste-modes [data-reste="cheque"] { background: #495057; border-color: #495057; }

/* vente directe : comptage de caisse */
.vd-caisse-ligne { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 10px 14px; margin-bottom: 10px; border: 1.5px dashed var(--line); border-radius: 10px; background: var(--surface-2); }
.vd-caisse-ligne b.neg { color: var(--danger); }

/* vente directe : récapitulatif des événements (ventes enregistrées) */
.vd-recap { padding: 12px 14px; margin-bottom: 14px; }
.vd-recap-tete { display: flex; align-items: center; gap: 10px; }
.vd-recap.plie .vd-recap-corps { display: none; } .vd-recap.plie #vd-recap-plier { transform: rotate(-90deg); }
.vd-recap-corps { display: grid; gap: 10px; margin-top: 10px; }
.vd-recap-ev { display: grid; grid-template-columns: minmax(170px, 1.1fr) 3fr auto; gap: 12px; align-items: center; padding: 10px; border: 1px solid var(--line); border-radius: 10px; }
.vd-recap-ev.on { border-color: var(--accent); background: var(--surface-2); }
.vd-recap-nom { text-align: left; background: none !important; border: 0 !important; box-shadow: none !important; padding: 0 !important; cursor: pointer; display: grid !important; justify-items: start; justify-content: start; gap: 2px; color: var(--text); font: inherit; white-space: normal !important; height: auto !important; min-width: 0; width: 100%; overflow: hidden; }
.vd-recap-nom > * { max-width: 100%; overflow-wrap: anywhere; }
.vd-recap-jours { display: flex; flex-wrap: wrap; gap: 6px; }
.vd-recap-j { display: grid; gap: 1px; text-align: left; padding: 6px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); cursor: pointer; font: inherit; color: var(--text); min-width: 112px; }
.vd-recap-j span:first-child { font-size: 12px; color: var(--text-2); } .vd-recap-j .jt { text-transform: capitalize; }
.vd-recap-j { justify-items: start; white-space: normal; height: auto; }
#vd-recap-plier { font-size: 16px; line-height: 1; padding: 4px 10px; transition: transform .15s; }
.vd-recap-j.on { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent) inset; }
.vd-recap-j.ecart { cursor: default; border-style: dashed; }
.vd-recap-total { display: grid; justify-items: end; gap: 1px; } .vd-recap-total b { font-size: 18px; }
@media (max-width: 700px) { .vd-recap-ev { grid-template-columns: 1fr auto; } .vd-recap-jours { grid-column: 1 / -1; grid-row: 2; } }

/* envois en arrière-plan (e-mails des documents) : pastilles en bas à droite, notification à la fin */
#taches-fond { position: fixed; right: 16px; bottom: 20px; z-index: 61; display: flex; flex-direction: column; gap: 8px; align-items: flex-end; max-width: calc(100vw - 32px); pointer-events: none; }
.tache-fond { pointer-events: auto; display: flex; align-items: center; gap: 10px; background: var(--surface); color: var(--text); border: 1px solid var(--line);
  border-radius: 12px; padding: 10px 12px; box-shadow: var(--shadow-lg); min-width: 260px; max-width: 420px; font-size: 14px; }
.tache-fond .grow { display: grid; gap: 2px; }
.tache-fond.fini { border-color: var(--ok, #16a34a); border-width: 2px; }
.tache-fond.fini > svg { color: var(--ok, #16a34a); flex: none; }
.tache-fond.erreur { border-color: var(--danger); }
.tache-fond.erreur > svg { color: var(--danger); }
.tache-fond.fini.pale { border-width: 1px; border-color: var(--line); }  /* reste lisible, seulement moins voyante */
.tache-roue { width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--line); border-top-color: var(--accent); animation: tache-tourne .8s linear infinite; flex: none; }
@keyframes tache-tourne { to { transform: rotate(360deg); } }
@media (max-width: 900px) { #taches-fond { bottom: calc(84px + env(safe-area-inset-bottom)); } }  /* au-dessus de la barre du bas */
@media (max-width: 700px) { #taches-fond { left: 16px; right: 16px; align-items: stretch; } .tache-fond { max-width: none; min-width: 0; } }
.tache-barre { display: block; height: 6px; border-radius: 3px; background: var(--line); overflow: hidden; margin-top: 4px; }
.tache-barre i { display: block; height: 100%; background: var(--accent); border-radius: 3px; transition: width .4s ease; }

/* gestion de production : articles commandés sans ligne d'objectif */
.pr-autres { padding: 12px 14px; }
.pr-autres summary { cursor: pointer; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.pr-autres-liste { margin-top: 8px; }
.pr-autres-cat { font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; color: var(--muted, #6b7280); margin: 12px 0 2px; }
.pr-autre { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 12px; align-items: center; padding: 7px 0; border-top: 1px solid var(--line); }
.pr-autre-art { display: grid; gap: 1px; min-width: 0; }
.pr-autre-art span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pr-autre-n { display: grid; justify-items: end; min-width: 44px; }

/* ============================================================ fiches de paie */
.fp-res { margin-top: -6px; }
.fp-grille { display: grid; grid-template-columns: 46px repeat(12, minmax(0, 1fr)); gap: 4px; margin-top: 14px; }
.fp-an { font-weight: 650; font-size: 13px; color: var(--text-2); display: flex; align-items: center; }
.fp-m { position: relative; display: flex; align-items: center; justify-content: center; height: 30px; min-width: 0; padding: 0;
  border-radius: 7px; border: 1px solid transparent; font-size: 12px; white-space: nowrap; overflow: hidden; box-shadow: none; }
button.fp-m.ok { background: var(--ok-soft); color: var(--ok); font-weight: 650; cursor: pointer; }
button.fp-m.ok:hover { border-color: var(--ok); background: var(--ok-soft); }
.fp-m.manque { background: var(--danger-soft); color: var(--danger); }
.fp-m.vide { background: var(--surface-2); }
.fp-m i { position: absolute; top: 4px; right: 4px; width: 6px; height: 6px; border-radius: 50%; background: var(--warn); }
.fp-rouge { color: var(--danger); }
.fp-anciens > summary { cursor: pointer; font-weight: 650; color: var(--text-2); margin: 6px 0 14px; }
.fp-versions { margin-top: 12px; font-size: 13.5px; }
.fp-versions div { margin-top: 4px; }
@media (max-width: 700px) {
  .fp-grille { grid-template-columns: 36px repeat(6, minmax(0, 1fr)); }
  .fp-an { grid-row: span 2; }
}
/* Noël : plusieurs dates de livraison pour un client (« + autre date » → une ligne de plus sous lui) */
.cs-feuille .cs-liv-plus { display: flex; align-items: center; justify-content: center; gap: 3px; width: 100%; margin-top: 5px; padding: 2px 4px; font-size: 11px; font-weight: 500;
  border: 1px dashed var(--line-2); background: transparent; color: var(--text-3); border-radius: 6px; cursor: pointer; min-height: 0; }
.cs-feuille .cs-liv-plus svg { width: 11px; height: 11px; }
.cs-feuille .cs-liv-plus:hover { color: var(--accent-text); border-color: var(--accent); }
.cs-feuille tr.cf-suite.cf-deb td { border-top: 2px dashed var(--text-3); }
.cs-feuille tr.cf-suite td.cf-client .cf-nom::before { content: "↳ "; color: var(--text-3); font-weight: 400; }

/* ================================================================ pop-up « À faire » du jour (rappels.js) */
.rp-cloche { position: relative; }
.rp-nb { position: absolute; top: 1px; right: 0; min-width: 17px; height: 17px; padding: 0 4px; border-radius: 9px; background: var(--danger); color: #fff; font-size: 10.5px; font-weight: 700; line-height: 17px; text-align: center; }
.modal-box.rp-box { width: min(1100px, 100%); }
.rp-tete { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.rp-tete h2 { display: flex; align-items: center; gap: 8px; margin: 0; }
.rp-tete .m-sub { margin: 0; }
.rp-jours { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; align-items: start; }
.rp-jour { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 12px 14px; background: var(--surface); min-width: 0; }
.rp-jour h3 { margin: 0 0 10px; display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; font-size: 17px; }
.rp-jour:not(.rp-demain) { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent-soft); }
.rp-date { font-weight: 500; color: var(--text-2); font-size: 14px; }
.rp-sous { font-size: 12px; font-weight: 600; color: var(--warn); background: var(--warn-soft); padding: 2px 8px; border-radius: 10px; }
.rp-bloc { margin-top: 10px; }
.rp-bloc:first-of-type { margin-top: 0; }
.rp-tit { display: flex; align-items: center; gap: 7px; font-size: 14px; padding-bottom: 5px; border-bottom: 1px solid var(--line); }
.rp-tit .i { width: 17px; height: 17px; color: var(--text-2); }
.rp-n { font-size: 12px; font-weight: 700; background: var(--surface-2); border: 1px solid var(--line); border-radius: 10px; padding: 0 7px; }
.rp-lien { display: inline-flex; align-items: center; gap: 2px; font-size: 12.5px; }
.rp-lien .i { width: 14px; height: 14px; }
.rp-lieu { font-size: 11.5px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--text-3); margin: 8px 0 2px; }
.rp-l { padding: 6px 0; border-bottom: 1px dashed var(--line); }
.rp-l:last-child { border-bottom: 0; }
.rp-l1 { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.rp-l1 .badge { font-size: 11px; padding: 1px 7px; }
.rp-mt { font-weight: 600; white-space: nowrap; }
.rp-rq { color: var(--accent-text); margin-top: 2px; }
.rp-ag { display: flex; gap: 10px; }
.rp-h { min-width: 52px; color: var(--text-2); font-variant-numeric: tabular-nums; font-size: 13px; }
.rp-rien { display: flex; align-items: center; gap: 8px; color: var(--text-3); padding: 8px 0; }
.rp-rien .i { color: var(--ok); }
.rp-afaire { margin-top: 16px; }
.rp-afaire h3 { margin: 0 0 8px; font-size: 16px; }
.rp-tache { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: var(--radius-sm); margin-bottom: 6px; color: var(--text); text-decoration: none; border: 1px solid var(--line); }
.rp-tache:hover { background: var(--surface-2); }
.rp-tache .grow { display: flex; flex-direction: column; min-width: 0; }
.rp-tache.rp-danger > .i:first-child { color: var(--danger); }
.rp-tache.rp-warn > .i:first-child { color: var(--warn); }
@media (max-width: 800px) { .rp-jours { grid-template-columns: 1fr; } }
