/* ============ Tableau de bord / pertes / inventaire ============ */
.kpi-row.kpi-5 { grid-template-columns: repeat(5, 1fr); }
.kpi-val.accent { color: var(--accent); }

/* graphe annuel */
.chart-block { margin-bottom: 18px; }
.annual-chart { padding: 14px 18px 16px; }
.chart-empty { padding: 40px; text-align: center; color: var(--text-muted); }
.chart-legend { display: flex; gap: 20px; justify-content: center; margin-top: 8px; font-size: 12px; color: var(--text-muted); }
.chart-legend span { display: inline-flex; align-items: center; gap: 7px; }
.lg-sw { width: 12px; height: 12px; border-radius: 3px; display: inline-block; }
.lg-line { width: 16px; height: 0; border-top: 2.5px solid var(--bordeaux); display: inline-block; }

/* layout dashboard */
.dash-grid { display: grid; grid-template-columns: 1fr 320px; gap: 16px; align-items: start; margin-bottom: 18px; }
.dash-side { display: flex; flex-direction: column; gap: 14px; }

/* tabord */
.tabord-card { overflow: hidden; }
.tabord-scroll { overflow-x: auto; }
table.tabord { width: 100%; border-collapse: collapse; min-width: 560px; }
table.tabord th, table.tabord td { padding: 8px 12px; font-size: 13px; text-align: right; white-space: nowrap; }
table.tabord thead th { font-size: 11px; font-weight: 700; letter-spacing: 0.03em; text-transform: uppercase; color: var(--text-faint); border-bottom: 1px solid var(--border); background: var(--surface-2); position: sticky; top: 0; }
table.tabord th.tabord-poste, table.tabord td.tabord-poste { text-align: left; font-weight: 600; position: sticky; left: 0; background: var(--surface); z-index: 1; }
table.tabord thead th.tabord-poste { background: var(--surface-2); }
table.tabord th.on, table.tabord td.on { background: var(--accent-soft); }
table.tabord tbody tr { border-bottom: 1px solid var(--border); }
table.tabord .row-strong td { font-weight: 700; }
table.tabord .row-soft td { color: var(--text-muted); font-size: 12px; }
table.tabord .row-accent td { color: var(--accent); font-weight: 700; background: color-mix(in srgb, var(--accent-soft) 50%, transparent); }
table.tabord .row-accent td.tabord-poste { background: color-mix(in srgb, var(--accent-soft) 70%, var(--surface)); }

/* saisie du mois */
.saisie-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 11px; }
.saisie-field { display: flex; flex-direction: column; gap: 6px; }
.saisie-field > span { font-size: 12px; font-weight: 600; color: var(--text-muted); }
.saisie-note { display: flex; align-items: flex-start; gap: 7px; font-size: 11.5px; color: var(--text-muted); margin-top: 11px; line-height: 1.45; }
.saisie-note svg { width: 14px; height: 14px; flex-shrink: 0; margin-top: 1px; color: var(--text-faint); }

/* stats achats */
.stat-block { margin-bottom: 16px; }
.stat-rows { display: flex; flex-direction: column; gap: 9px; }
.stat-row { display: grid; grid-template-columns: 180px 1fr 44px 90px; align-items: center; gap: 12px; }
.stat-name { font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stat-bar { height: 8px; border-radius: 4px; background: var(--surface-3); overflow: hidden; }
.stat-bar i { display: block; height: 100%; background: var(--accent); border-radius: 4px; }
.stat-pct { font-size: 12px; color: var(--text-muted); text-align: right; }
.stat-val { font-size: 13px; font-weight: 700; text-align: right; }

/* ---- Carnet de perte ---- */
.perte-modal { max-width: 600px; }
.perte-field { display: flex; flex-direction: column; gap: 7px; margin-bottom: 16px; }
.perte-field > span { font-size: 12.5px; font-weight: 600; color: var(--text-muted); }
.perte-grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.qte-unit-row { display: flex; align-items: center; gap: 10px; }
.big-input { flex: 1; min-height: 52px; border-radius: 12px; border: 1.5px solid var(--border-strong); background: var(--surface-2); padding: 0 15px; font-size: 22px; font-weight: 700; font-variant-numeric: tabular-nums; }
.big-input:focus { outline: none; border-color: var(--accent); background: var(--surface); }
.perte-valeur { display: flex; flex-direction: column; gap: 3px; justify-content: center; background: var(--bordeaux-soft); border-radius: 13px; padding: 12px 16px; }
.perte-valeur > span { font-size: 12px; color: var(--bordeaux); font-weight: 600; }
.perte-valeur b { font-size: 24px; font-weight: 750; color: var(--bordeaux); font-variant-numeric: tabular-nums; }
.perte-valeur em { font-style: normal; font-size: 11px; color: var(--bordeaux); opacity: 0.8; }
.motif-grid { display: flex; flex-wrap: wrap; gap: 8px; }
.motif-chip { min-height: 44px; padding: 0 14px; border-radius: 12px; border: 1.5px solid var(--border-strong); background: var(--surface); font-size: 13px; font-weight: 600; color: var(--text-muted); }
.motif-chip.on { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); }
.op-row { display: flex; flex-wrap: wrap; gap: 8px; }
.op-chip { min-height: 44px; padding: 0 14px; border-radius: 12px; border: 1.5px solid var(--border-strong); background: var(--surface); font-size: 13px; font-weight: 600; color: var(--text); }
.op-chip.on { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); }
.motif-bar-row { margin-bottom: 11px; }
.motif-bar-top { display: flex; justify-content: space-between; font-size: 12.5px; margin-bottom: 5px; }
.motif-bar-top b { font-variant-numeric: tabular-nums; }
.motif-bar { height: 8px; border-radius: 4px; background: var(--surface-3); overflow: hidden; }
.motif-bar i { display: block; height: 100%; background: var(--amber); border-radius: 4px; }

/* ---- Inventaire mensuel — saisie guidée (inv2) ---- */
.inv2 { padding-bottom: 30px; }

/* parcours guidé */
.inv2-guide { border: 1px solid var(--border); border-radius: 14px; background: var(--surface); margin-bottom: 16px; overflow: hidden; }
.inv2-guide-head { width: 100%; display: flex; align-items: center; justify-content: space-between; padding: 13px 16px; background: var(--surface-2); }
.inv2-guide-head:hover { background: var(--surface-3); }
.inv2-guide-title { display: flex; align-items: center; gap: 9px; font-size: 14px; font-weight: 650; }
.inv2-guide-title > svg { color: var(--accent); }
.inv2-guide-prog { font-size: 11.5px; font-weight: 600; color: var(--text-muted); background: var(--surface); border: 1px solid var(--border); padding: 1px 9px; border-radius: 20px; font-variant-numeric: tabular-nums; }
.inv2-guide-chev { width: 18px; height: 18px; color: var(--text-muted); transition: transform .18s; }
.inv2-guide-chev.up { transform: rotate(180deg); }
.inv2-guide-steps { display: grid; grid-template-columns: repeat(5, 1fr); gap: 0; border-top: 1px solid var(--border); }
.inv2-step { display: flex; gap: 10px; padding: 15px 14px; border-right: 1px solid var(--border); }
.inv2-step:last-child { border-right: none; }
.inv2-step-num { width: 24px; height: 24px; flex-shrink: 0; border-radius: 50%; display: grid; place-items: center; font-size: 12px; font-weight: 700; background: var(--surface-3); color: var(--text-muted); border: 1px solid var(--border-strong); }
.inv2-step-num svg { width: 14px; height: 14px; }
.inv2-step.done .inv2-step-num { background: var(--green); color: #fff; border-color: var(--green); }
.inv2-step.warn .inv2-step-num { background: var(--amber-soft); color: var(--amber); border-color: var(--amber); }
.inv2-step-label { font-size: 12.5px; font-weight: 650; letter-spacing: -0.01em; }
.inv2-step-sub { font-size: 11px; color: var(--text-muted); margin-top: 3px; line-height: 1.4; }
.inv2-step-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 9px; }
.inv2-step-actions .btn-sm { padding: 5px 9px; font-size: 11px; }

/* bandeau infos comptage */
.inv2-meta { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; padding: 15px 18px; margin-bottom: 16px; }
.inv2-meta-field { display: flex; flex-direction: column; gap: 6px; }
.inv2-meta-field label { display: flex; align-items: center; gap: 6px; font-size: 11.5px; font-weight: 600; color: var(--text-muted); }
.inv2-meta-field label svg { color: var(--text-faint); }

/* barre d'outils */
.inv2-toolbar { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.inv2-search { position: relative; flex: 1; min-width: 0; }
.inv2-fam-filter { display: flex; gap: 4px; background: var(--surface-2); border: 1px solid var(--border-strong); border-radius: 10px; padding: 3px; }
.inv2-fchip { padding: 6px 12px; border-radius: 8px; font-size: 12px; font-weight: 600; color: var(--text-muted); white-space: nowrap; }
.inv2-fchip:hover { color: var(--text); }
.inv2-fchip.on { background: var(--surface); color: var(--accent); box-shadow: var(--shadow-sm); }

/* sections */
.inv2-section { margin-bottom: 16px; overflow: hidden; }
.inv2-sec-head { display: flex; align-items: center; gap: 13px; padding: 15px 18px; border-bottom: 1px solid var(--border); }
.inv2-sec-ico { width: 40px; height: 40px; border-radius: 11px; flex-shrink: 0; display: grid; place-items: center; background: var(--surface-3); color: var(--text-muted); }
.inv2-section:first-of-type .inv2-sec-ico { background: var(--bordeaux-soft); color: var(--bordeaux); }
.inv2-section:nth-of-type(2) .inv2-sec-ico { background: rgba(120,90,160,0.13); color: #7d5aa0; }
[data-theme="dark"] .inv2-section:nth-of-type(2) .inv2-sec-ico { background: rgba(176,148,208,0.16); color: #b094d0; }
.inv2-sec-ico svg { width: 20px; height: 20px; }
.inv2-sec-t { flex: 1; min-width: 0; }
.inv2-sec-t h3 { font-size: 15px; font-weight: 650; letter-spacing: -0.01em; }
.inv2-sec-count { font-size: 12px; font-weight: 500; color: var(--text-muted); margin-left: 6px; }
.inv2-sec-sub { font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.inv2-sec-total { text-align: right; flex-shrink: 0; }
.inv2-sec-total-val { font-size: 18px; font-weight: 750; letter-spacing: -0.02em; }
.inv2-sec-total-pct { font-size: 11px; color: var(--text-faint); margin-top: 1px; }

/* grille de lignes */
.inv2-grid-cols { grid-template-columns: minmax(160px, 1fr) 150px 132px 124px 104px 40px; }
.inv2-rows-head { display: grid; grid-template-columns: minmax(160px, 1fr) 150px 132px 124px 104px 40px; gap: 12px; padding: 9px 18px; font-size: 10.5px; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; color: var(--text-faint); border-bottom: 1px solid var(--border); }
.inv2-rows-head .r { text-align: right; }
.inv2-rows { display: flex; flex-direction: column; }
.inv2-row { display: grid; grid-template-columns: minmax(160px, 1fr) 150px 132px 124px 104px 40px; gap: 12px; align-items: center; padding: 9px 18px; border-bottom: 1px solid var(--border); transition: background .12s; }
.inv2-row:last-child { border-bottom: none; }
.inv2-row:hover { background: var(--surface-2); }
.inv2-row.counted { background: var(--green-soft); }
.inv2-row.counted:hover { background: color-mix(in oklab, var(--green-soft), var(--text) 4%); }
.inv2-row.warn { box-shadow: inset 3px 0 0 var(--amber); }
.inv2-cell { min-width: 0; }
.inv2-mlabel { display: none; }
.inv2-input { width: 100%; background: var(--surface-2); border: 1px solid var(--border-strong); border-radius: 8px; padding: 7px 9px; font-size: 13px; }
.inv2-input:focus { outline: none; border-color: var(--accent-line); background: var(--surface); }
.inv2-input.desig { font-weight: 600; background: transparent; border-color: transparent; padding-left: 0; }
.inv2-input.desig:hover { border-color: var(--border-strong); background: var(--surface-2); padding-left: 9px; }
.inv2-input.desig:focus { padding-left: 9px; }
.inv2-input.num { text-align: right; }
.inv2-input.achat { border-color: var(--accent-line); background: var(--accent-soft); color: var(--accent); }
.inv2-tags { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 4px; }
.inv2-tag { display: inline-flex; align-items: center; gap: 3px; font-size: 10px; font-weight: 600; padding: 1px 7px; border-radius: 20px; background: var(--surface-3); color: var(--text-muted); }
.inv2-tag.fiche { background: rgba(120,90,160,0.13); color: #7d5aa0; }
[data-theme="dark"] .inv2-tag.fiche { background: rgba(176,148,208,0.16); color: #b094d0; }
.inv2-tag.libre { background: var(--bordeaux-soft); color: var(--bordeaux); }
.inv2-tag.achat { background: var(--accent-soft); color: var(--accent); }
.inv2-prix-wrap { position: relative; }
.inv2-unit { position: absolute; right: 9px; top: 50%; transform: translateY(-50%); font-size: 10.5px; color: var(--text-faint); pointer-events: none; font-weight: 600; }
.inv2-prix .inv2-input { padding-right: 38px; }
.inv2-qty { width: 100%; text-align: right; background: var(--surface); border: 1.5px solid var(--border-strong); border-radius: 9px; padding: 9px 11px; font-size: 16px; font-weight: 700; color: var(--text-faint); }
.inv2-qty::placeholder { color: var(--text-faint); opacity: 0.5; font-weight: 600; }
.inv2-qty:focus { outline: none; border-color: var(--accent); background: var(--surface); color: var(--text); }
.inv2-qty.is-counted { color: var(--green); border-color: var(--green); background: var(--surface); }
.inv2-val { text-align: right; }
.inv2-val-num { font-size: 14px; font-weight: 700; font-variant-numeric: tabular-nums; }
.inv2-val-num.muted { color: var(--text-faint); font-weight: 500; }
.inv2-act { display: flex; align-items: center; justify-content: flex-end; gap: 4px; }
.inv2-warn-dot { color: var(--amber); display: grid; place-items: center; }
.inv2-add-line { width: 100%; display: flex; align-items: center; justify-content: center; gap: 6px; padding: 11px; font-size: 12.5px; font-weight: 600; color: var(--text-muted); border-top: 1px dashed var(--border-strong); background: var(--surface-2); }
.inv2-add-line:hover { color: var(--accent); background: var(--accent-soft); }

/* total collant (mobile) */
.inv2-sticky-total { display: none; }

/* libre + clôture modales */
.libre-modal, .cloture-modal { max-width: 480px; }
.libre-body { padding: 20px; display: flex; flex-direction: column; gap: 14px; }
.libre-fam { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.libre-fam-btn { display: flex; flex-direction: column; align-items: flex-start; gap: 3px; padding: 12px; border-radius: 11px; border: 1.5px solid var(--border-strong); background: var(--surface-2); font-size: 13px; font-weight: 650; transition: all .12s; }
.libre-fam-btn svg { color: var(--text-muted); }
.libre-fam-btn em { font-style: normal; font-size: 10.5px; font-weight: 500; color: var(--text-faint); }
.libre-fam-btn.on { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); }
.libre-fam-btn.on svg { color: var(--accent); }
.libre-grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.cloture-body { padding: 20px; }
.cloture-hero { background: var(--accent); color: #fff; border-radius: 14px; padding: 16px 18px; display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 14px; }
.cloture-hero .lbl { font-size: 12.5px; font-weight: 600; opacity: 0.9; max-width: 180px; line-height: 1.3; }
.cloture-hero .val { font-size: 26px; font-weight: 750; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; white-space: nowrap; }
.cloture-rows { display: flex; flex-direction: column; gap: 1px; }
.cl-row { display: flex; align-items: center; justify-content: space-between; padding: 9px 2px; border-bottom: 1px solid var(--border); font-size: 13px; }
.cl-row span { color: var(--text-muted); }
.cl-row:last-child { border-bottom: none; }

/* responsive */
@media (max-width: 1080px) {
  .kpi-row.kpi-5 { grid-template-columns: 1fr 1fr; }
  .dash-grid { grid-template-columns: 1fr; }
  .perte-grid2 { grid-template-columns: 1fr; }
}
@media (max-width: 900px) {
  .inv2 .kpi-row { grid-template-columns: 1fr 1fr !important; }
  .inv2-guide-steps { grid-template-columns: 1fr 1fr; }
  .inv2-step:nth-child(odd) { border-right: 1px solid var(--border); }
  .inv2-step { border-bottom: 1px solid var(--border); }
}
@media (max-width: 820px) {
  .inv2-rows-head { display: none; }
  .inv2-row { grid-template-columns: 1fr 1fr; gap: 10px 14px; padding: 14px 16px; }
  .inv2-row.counted { box-shadow: inset 3px 0 0 var(--green); }
  .inv2-mlabel { display: block; font-size: 10px; font-weight: 700; letter-spacing: 0.03em; text-transform: uppercase; color: var(--text-faint); margin-bottom: 4px; }
  .inv2-desig { grid-column: 1 / -1; }
  .inv2-input.desig { font-size: 15px; border-color: var(--border-strong); background: var(--surface-2); padding-left: 9px; }
  .inv2-qte-cell, .inv2-val { grid-column: auto; }
  .inv2-qty { font-size: 19px; padding: 12px; }
  .inv2-act { grid-column: 1 / -1; justify-content: flex-start; }
  .inv2-toolbar { flex-wrap: wrap; }
  .inv2-fam-filter { order: 3; }
}
@media (max-width: 640px) {
  .kpi-row.kpi-5 { grid-template-columns: 1fr; }
  .stat-row { grid-template-columns: 110px 1fr 60px; }
  .stat-row .stat-val { display: none; }
  .inv2-meta { grid-template-columns: 1fr; gap: 12px; }
  .inv2 .kpi-row { grid-template-columns: 1fr 1fr !important; }
  .inv2-sticky-total { display: flex; position: sticky; bottom: 0; align-items: center; justify-content: space-between; gap: 14px; padding: 12px 16px; margin: 8px -16px -30px; background: var(--surface); border-top: 1px solid var(--border-strong); box-shadow: 0 -4px 16px rgba(0,0,0,0.08); z-index: 20; }
  .inv2-sticky-total .lbl { font-size: 11px; color: var(--text-muted); display: block; }
  .inv2-sticky-total b { font-size: 20px; font-weight: 750; letter-spacing: -0.02em; }
  .libre-fam { grid-template-columns: 1fr; }
}

/* ============ Facture / BL (upload + saisie) ============ */
.invoice-modal { max-width: 880px; }
.pj-tag { display: inline-grid; place-items: center; color: var(--accent); }
.pj-tag svg { width: 14px; height: 14px; }
.pj-btn { border: none; background: none; cursor: pointer; padding: 2px; border-radius: 5px; }
.pj-btn:hover { background: var(--accent-soft); }

/* étape Document */
.inv-doc { display: flex; flex-direction: column; gap: 14px; }
.dropzone { border: 2px dashed var(--border-strong); border-radius: 16px; min-height: 240px; display: grid; place-items: center; padding: 18px; transition: border-color .14s, background .14s; background: var(--surface-2); }
.dropzone.over { border-color: var(--accent); background: var(--accent-soft); }
.dropzone.has { border-style: solid; border-color: var(--border); padding: 12px; }
.dz-empty { text-align: center; }
.dz-ico { width: 56px; height: 56px; border-radius: 16px; background: var(--surface-3); color: var(--text-muted); display: grid; place-items: center; margin: 0 auto 14px; }
.dz-ico svg { width: 28px; height: 28px; }
.dz-title { font-size: 16px; font-weight: 650; }
.dz-sub { font-size: 12.5px; color: var(--text-muted); margin-top: 4px; }
.dz-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.dz-cam { display: none; }
.ocr-hint { display: flex; align-items: center; gap: 12px; padding: 13px 15px; border-radius: 13px; background: color-mix(in srgb, var(--bordeaux-soft) 60%, transparent); }
.ocr-hint > svg { width: 22px; height: 22px; color: var(--bordeaux); flex-shrink: 0; }
.ocr-hint b { font-size: 13px; display: block; }
.ocr-hint span { font-size: 12px; color: var(--text-muted); }
.ocr-hint > div { flex: 1; }
.ocr-hint .btn { flex-shrink: 0; }
.ocr-na { font-size: 12.5px; color: var(--text-muted); text-align: center; padding: 4px; }

/* aperçu document */
.doc-preview { width: 100%; height: 100%; display: grid; place-items: center; overflow: hidden; border-radius: 10px; }
.doc-preview img, .doc-canvas { max-width: 100%; max-height: 340px; border-radius: 8px; box-shadow: var(--shadow-sm); object-fit: contain; }
.doc-preview.empty { color: var(--text-faint); flex-direction: column; gap: 8px; min-height: 200px; background: var(--surface-2); border-radius: 12px; }
.doc-preview.empty svg { width: 36px; height: 36px; }
.doc-preview.empty span { font-size: 12.5px; }
.doc-preview.vignette { flex-direction: column; gap: 10px; }
.doc-vignette { width: 60px; height: 60px; border-radius: 14px; background: var(--bordeaux-soft); color: var(--bordeaux); display: grid; place-items: center; }
.doc-vignette svg { width: 30px; height: 30px; }
.doc-fname { font-size: 13px; font-weight: 600; word-break: break-all; text-align: center; max-width: 220px; }
.doc-sub { font-size: 11.5px; color: var(--text-muted); }

/* étape Vérifier */
.inv-verify { display: grid; grid-template-columns: 1fr 280px; gap: 18px; align-items: start; }
.inv-head-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 12px; margin-bottom: 16px; }
.inv-lines-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 9px; font-size: 12.5px; font-weight: 600; color: var(--text-muted); }
.inv-lines { display: flex; flex-direction: column; gap: 10px; }
.inv-line { border: 1px solid var(--border); border-radius: 12px; padding: 10px 11px; background: var(--surface-2); }
.inv-line-main { display: flex; gap: 8px; align-items: center; }
.il-article { flex: 1; min-width: 0; }
.il-unite { width: 88px; flex-shrink: 0; }
.il-num { width: 70px; flex-shrink: 0; text-align: right; }
.il-montant { position: relative; width: 120px; flex-shrink: 0; }
.il-montant input { width: 100%; text-align: right; padding-right: 24px; }
.il-montant span { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); font-size: 12px; color: var(--text-muted); pointer-events: none; }
.inv-del { flex-shrink: 0; opacity: 0.6; }
.inv-del:hover { opacity: 1; }
.inv-line-lot { display: flex; align-items: center; gap: 12px; margin-top: 8px; }
.il-lot { flex: 1; font-size: 12.5px; }
.maj-lot { display: flex; align-items: center; gap: 7px; font-size: 12px; font-weight: 500; color: var(--text); white-space: nowrap; cursor: pointer; }
.maj-lot input { width: 17px; height: 17px; accent-color: var(--accent); }
.maj-lot-na { font-size: 11.5px; color: var(--text-faint); font-style: italic; }
.inv-foot-grid { display: grid; grid-template-columns: 1fr 1fr 1.4fr; gap: 12px; margin-top: 16px; }
.inv-total { display: flex; align-items: center; justify-content: space-between; margin-top: 16px; padding: 14px 16px; border-radius: 13px; background: var(--accent-soft); }
.inv-total span { font-size: 13px; font-weight: 600; color: var(--accent); }
.inv-total b { font-size: 22px; font-weight: 750; color: var(--accent); font-variant-numeric: tabular-nums; }
.inv-doc-side { position: sticky; top: 0; }
.inv-doc-side-label { font-size: 11px; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase; color: var(--text-faint); margin-bottom: 8px; }
.inv-doc-side .doc-preview { border: 1px solid var(--border); background: var(--surface-2); padding: 8px; }
.wiz-input.ocr { border-color: var(--bordeaux); box-shadow: 0 0 0 2px var(--bordeaux-soft); }
.ocr-legend { display: flex; align-items: center; gap: 7px; font-size: 11.5px; color: var(--text-muted); margin-top: 8px; }
.ocr-chip { width: 12px; height: 12px; border-radius: 3px; border: 1.5px solid var(--bordeaux); background: var(--bordeaux-soft); }

/* étape Valider */
.inv-recap { display: grid; grid-template-columns: 1fr 280px; gap: 18px; align-items: start; }
.inv-recap-card { background: var(--surface-2); border: 1px solid var(--border); border-radius: 14px; padding: 16px 18px; }

@media (max-width: 760px) {
  .inv-verify, .inv-recap { grid-template-columns: 1fr; }
  .inv-doc-side { position: static; order: -1; }
  .inv-head-grid, .inv-foot-grid { grid-template-columns: 1fr; }
  .dz-cam { display: inline-flex; }
}

/* ---- Paramètres : périmètre d'inventaire ---- */
.perim-card { grid-column: 1 / -1; }
.perim-count { font-size: 12px; font-weight: 500; color: var(--text-muted); margin-left: 8px; }
.perim-intro { font-size: 12.5px; color: var(--text-muted); line-height: 1.5; margin: 6px 0 14px; max-width: 640px; }
.perim-list { display: flex; flex-direction: column; gap: 6px; }
.perim-row { display: grid; grid-template-columns: 26px 1fr auto; gap: 12px; align-items: center; padding: 9px 12px; border: 1px solid var(--border); border-radius: 11px; background: var(--surface-2); transition: border-color .12s, background .12s; }
.perim-row.on { border-color: var(--accent-line); background: var(--accent-soft); }
.perim-check { width: 22px; height: 22px; border-radius: 6px; border: 1.5px solid var(--border-strong); background: var(--surface); display: grid; place-items: center; color: #fff; }
.perim-check.on { background: var(--accent); border-color: var(--accent); }
.perim-check svg { width: 14px; height: 14px; }
.perim-name { font-size: 13px; font-weight: 600; min-width: 0; }
.perim-cat { font-size: 11px; font-weight: 500; color: var(--text-faint); margin-left: 8px; }
.perim-fam { display: flex; gap: 3px; background: var(--surface); border: 1px solid var(--border-strong); border-radius: 9px; padding: 3px; }
.perim-fchip { padding: 5px 11px; border-radius: 7px; font-size: 11.5px; font-weight: 600; color: var(--text-muted); white-space: nowrap; }
.perim-fchip:disabled { opacity: 0.4; cursor: not-allowed; }
.perim-fchip.on:not(:disabled) { background: var(--accent-soft); color: var(--accent); }
@media (max-width: 640px) {
  .perim-row { grid-template-columns: 26px 1fr; }
  .perim-fam { grid-column: 2; justify-self: start; }
}

/* ---- Inventaire : lignes issues du référentiel (lecture seule, sauf qté/prix) ---- */
.inv2-desig-name { font-size: 13.5px; font-weight: 650; line-height: 1.3; display: block; }
.inv2-fourn-name { font-size: 12.5px; color: var(--text-muted); }
.inv2-ref-note { margin: 4px 0 14px; }
.inv2-hv-toggle { display: inline-flex; align-items: center; gap: 8px; padding: 7px 12px; border-radius: 9px; border: 1px solid var(--border-strong); background: var(--surface); font-size: 12px; font-weight: 600; color: var(--text-muted); white-space: nowrap; }
.inv2-hv-toggle .dlc-switch { width: 30px; height: 17px; }
.inv2-hv-toggle.on { border-color: var(--accent-line); background: var(--accent-soft); color: var(--accent); }
.inv2-tag.hv { background: var(--surface-3); color: var(--text-faint); text-decoration: line-through; }
@media (max-width: 820px) {
  .inv2-desig-name { font-size: 15px; }
}

/* ---- Facture : saisie minimale (montant + date) + détail repliable ---- */
.inv-primary-grid { display: grid; grid-template-columns: 1.3fr 1fr; gap: 12px; margin-bottom: 12px; }
.inv-opt-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 12px; margin-bottom: 14px; }
.wiz-field .req { font-style: normal; font-size: 10px; font-weight: 700; letter-spacing: 0.03em; text-transform: uppercase; color: var(--accent); margin-left: 6px; }
.wiz-field em { font-style: normal; font-size: 11px; font-weight: 500; color: var(--text-faint); margin-left: 6px; }
.inv-montant-big input { font-size: 22px; font-weight: 750; padding: 12px 28px 12px 12px; height: auto; font-variant-numeric: tabular-nums; }
.inv-montant-big span { right: 12px; font-size: 15px; font-weight: 600; }
.inv-montant-field { position: relative; }
.inv-detail { border: 1px solid var(--border); border-radius: 13px; background: var(--surface-2); overflow: hidden; margin-bottom: 14px; }
.inv-detail.open { background: var(--surface); }
.inv-detail-toggle { width: 100%; display: flex; align-items: center; gap: 9px; padding: 13px 15px; font-size: 13px; font-weight: 650; text-align: left; background: transparent; }
.inv-detail-toggle:hover { background: var(--surface-2); }
.inv-detail-chev { width: 16px; height: 16px; color: var(--text-muted); transition: transform .16s; flex-shrink: 0; }
.inv-detail-chev.up { transform: rotate(180deg); }
.inv-detail-hint { margin-left: auto; font-size: 11px; font-weight: 500; color: var(--text-faint); }
.inv-detail-body { padding: 0 15px 15px; }
.inv-detail-note { display: flex; align-items: flex-start; gap: 9px; padding: 11px 13px; border-radius: 11px; background: color-mix(in srgb, var(--bordeaux-soft) 50%, transparent); font-size: 12px; color: var(--text-muted); line-height: 1.45; margin-bottom: 14px; }
.inv-detail-note svg { color: var(--bordeaux); flex-shrink: 0; margin-top: 1px; }
.inv-report { margin-top: 12px; }
@media (max-width: 760px) {
  .inv-primary-grid, .inv-opt-grid { grid-template-columns: 1fr; }
}
