:root {
  --bg: #f6f3ee; --card: #ffffff; --ink: #2b241c; --muted: #7a6f63; --line: #e6dfd4;
  --wood: #c8a978; --wood-d: #8a6a3d; --accent: #2f6f5e; --accent-l: #e3f0ec;
  --warn: #a8580c; --warn-l: #fbecd9; --err: #b3261e; --part: #f3e6cc;
  --shopify: #5e8e3e; --qonto: #3d4fb8; --etsy: #d5541b;
  --r: 10px;
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #1b1814; --card: #25211c; --ink: #eee6da; --muted: #a59a8b; --line: #3a342c;
    --accent: #6cc0a6; --accent-l: #1f3a33; --warn: #f0a75a; --warn-l: #3d2b17; --part: #3a3122; --err: #ff8a80; }
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 15px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
a { color: var(--accent); }
.muted { color: var(--muted); }
.small, small { font-size: 12.5px; }
.err { color: var(--err); }
.warn { color: var(--warn); }
.pad { padding: 24px 4px; }

.top { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 10px 20px; background: var(--card); border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; font-size: 18px; letter-spacing: .2px; }
.brand b { font-weight: 600; color: var(--wood-d); }
.dots { width: 22px; height: 22px; border-radius: 5px; background: var(--wood);
  background-image: radial-gradient(circle, #3b2f22 2px, transparent 2.5px); background-size: 11px 11px; background-position: 0 0; }
.top-right { display: flex; align-items: center; gap: 12px; font-size: 13px; }
.me { padding: 3px 9px; border-radius: 99px; background: var(--accent-l); color: var(--accent); font-weight: 600; }

main { max-width: 1100px; margin: 0 auto; padding: 18px 20px 60px; }

.btn { border: 1px solid var(--accent); background: var(--accent); color: #fff; border-radius: 8px; padding: 7px 14px; font: inherit; font-weight: 600; cursor: pointer; }
.btn.ghost { background: transparent; color: var(--accent); }
.btn.small { padding: 3px 10px; font-size: 13px; }
.btn:disabled { opacity: .5; cursor: default; }
.link.small { color: var(--muted); font-size: 12px; text-decoration: none; }
.link.small:hover { color: var(--accent); text-decoration: underline; }
.link { background: none; border: 0; padding: 0; color: var(--accent); cursor: pointer; font: inherit; text-decoration: underline; }

.toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 14px; }
.tabs { display: flex; background: var(--card); border: 1px solid var(--line); border-radius: 9px; padding: 3px; }
.tab { border: 0; background: none; padding: 6px 14px; border-radius: 6px; font: inherit; cursor: pointer; color: var(--muted); }
.tab.on { background: var(--ink); color: var(--bg); }
select, input[type=search], input:not([type]), .dlg select, .dlg input { font: inherit; color: var(--ink); background: var(--card); border: 1px solid var(--line); border-radius: 8px; padding: 7px 10px; }
#f-q { flex: 1; min-width: 200px; }

.list { display: flex; flex-direction: column; gap: 8px; }
.row { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 12px 16px; background: var(--card);
  border: 1px solid var(--line); border-radius: var(--r); color: var(--ink); text-decoration: none; }
.row:hover { border-color: var(--wood); }
.r-title { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.r-sub { font-size: 13px; margin-top: 2px; }
.late { color: var(--warn); font-weight: 600; }
.r-prog { display: flex; flex-direction: column; gap: 4px; align-items: flex-end; }
.prog { display: flex; gap: 5px; align-items: center; font-size: 12.5px; }
.prog-l { color: var(--muted); margin-right: 3px; }
.pg { padding: 1px 7px; border-radius: 99px; background: var(--bg); border: 1px solid var(--line); white-space: nowrap; }
.pg.part { background: var(--part); border-color: transparent; }
.pg.full { background: var(--accent-l); color: var(--accent); border-color: transparent; font-weight: 600; }

.src { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .4px; padding: 2px 7px; border-radius: 5px; color: #fff; vertical-align: 2px; }
.src.shopify { background: var(--shopify); }
.src.qonto { background: var(--qonto); }
.src.etsy { background: var(--etsy); }
.badge { font-size: 12px; padding: 2px 8px; border-radius: 99px; background: var(--line); }
.badge.warn { background: var(--warn-l); color: var(--warn); font-weight: 600; }

.back { display: inline-block; margin-bottom: 10px; text-decoration: none; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 16px 18px; margin-bottom: 14px; }
.head { display: flex; justify-content: space-between; gap: 16px; align-items: flex-start; }
.head h1 { margin: 0 0 4px; font-size: 22px; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.h-cust { font-weight: 400; }
.head p { margin: 2px 0; }
.head-actions { display: flex; gap: 8px; flex-shrink: 0; }
.note { background: var(--warn-l); border-radius: 8px; padding: 6px 10px; white-space: pre-wrap; }
h2 { font-size: 16px; margin: 0 0 10px; display: flex; align-items: center; gap: 8px; }
.count { font-size: 12px; background: var(--bg); border: 1px solid var(--line); border-radius: 99px; padding: 0 8px; font-weight: 600; }

.line { display: grid; grid-template-columns: 54px 1fr auto; gap: 14px; align-items: start; padding: 12px 0; border-top: 1px solid var(--line); }
.line.peg { grid-template-columns: 130px 1fr auto; }
.line.gone { opacity: .5; }
.qty { font-weight: 700; font-size: 17px; text-align: right; padding-top: 2px; }
.thumb { width: 130px; height: 100px; display: flex; align-items: center; justify-content: center; background: var(--bg); border-radius: 8px; overflow: hidden; }
.thumb svg { max-width: 120px; max-height: 92px; width: auto; height: auto; }
.l-title { font-weight: 500; }
.plan { display: flex; align-items: center; gap: 8px; margin: 6px 0; flex-wrap: wrap; }
.plan code { background: var(--bg); padding: 2px 6px; border-radius: 5px; font-size: 12.5px; }
.plan-msg { color: var(--muted); }
.props { display: grid; grid-template-columns: auto 1fr; gap: 1px 10px; margin: 6px 0; font-size: 13px; }
.props dt { color: var(--muted); }
.props dd { margin: 0; word-break: break-word; }

.steps { display: flex; gap: 6px; }
.step { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; min-width: 88px; padding: 7px 8px; border: 1px solid var(--line);
  border-radius: 9px; cursor: pointer; text-align: center; user-select: none; }
.step input { width: 18px; height: 18px; accent-color: var(--accent); cursor: pointer; margin: 0; }
.step span { font-size: 13px; font-weight: 600; }
.step small { color: var(--muted); font-size: 11px; line-height: 1.2; max-width: 110px; word-break: break-all; }
.step.on { background: var(--accent-l); border-color: transparent; }
.step.on span { color: var(--accent); }

.hist { list-style: none; padding: 0; margin: 0; font-size: 13.5px; }
.hist li { padding: 4px 0; border-top: 1px dashed var(--line); }

#toast { position: fixed; bottom: 18px; left: 50%; transform: translateX(-50%); background: var(--ink); color: var(--bg); padding: 10px 16px; border-radius: 9px; max-width: 90vw; z-index: 20; }
#toast.err { background: var(--err); color: #fff; }

.dlg { border: 0; border-radius: 12px; padding: 0; width: min(560px, 94vw); background: var(--card); color: var(--ink); }
.dlg::backdrop { background: rgba(20, 15, 10, .45); }
.ship-form { padding: 18px 20px; display: flex; flex-direction: column; gap: 12px; }
.ship-form h2 { margin: 0; }
fieldset { border: 1px solid var(--line); border-radius: 9px; padding: 8px 12px; margin: 0; display: flex; flex-direction: column; gap: 5px; }
legend { font-size: 13px; color: var(--muted); padding: 0 4px; }
.chk { display: flex; gap: 8px; align-items: flex-start; }
.chk input { margin-top: 3px; accent-color: var(--accent); }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.grid2 label { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--muted); }
.dlg-actions { display: flex; justify-content: flex-end; gap: 8px; }

@media (max-width: 760px) {
  .top { padding: 10px 14px; }
  #sync-info { display: none; }
  main { padding: 14px 12px 60px; }
  .row { flex-direction: column; align-items: stretch; }
  .r-prog { align-items: flex-start; }
  .head { flex-direction: column; }
  .line, .line.peg { grid-template-columns: 1fr; }
  .thumb { width: 100%; height: 140px; }
  .thumb svg { max-width: 92%; max-height: 130px; }
  .qty { text-align: left; }
  .steps { justify-content: stretch; }
  .step { flex: 1; min-width: 0; }
  .grid2 { grid-template-columns: 1fr; }
}

.shp { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line); flex-wrap: wrap; }
.shp:first-of-type { border-top: 0; }
.shp-mail { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.mail-ok { color: var(--accent); background: var(--accent-l); border-radius: 99px; padding: 2px 10px; font-size: 13px; font-weight: 600; }
.mail-no { color: var(--warn); font-size: 13px; font-weight: 600; }
.badge.mail { background: var(--warn-l); color: var(--warn); font-weight: 600; }

/* menu */
.nav { display: flex; gap: 4px; margin-right: auto; margin-left: 24px; }
.nav a { padding: 6px 12px; border-radius: 7px; color: var(--muted); text-decoration: none; font-weight: 600; font-size: 14px; }
.nav a:hover { color: var(--ink); background: var(--bg); }
.nav a.on { color: var(--ink); background: var(--bg); box-shadow: inset 0 -2px 0 var(--wood); }
.badge.acc { background: #e7ecf7; color: #3d4fb8; font-weight: 600; font-size: 11.5px; }
@media (prefers-color-scheme: dark) { .badge.acc { background: #262c47; color: #9fb0ff; } }

/* vues de production */
.page-h { font-size: 20px; margin: 0 12px 0 0; }
.lot { border-top: 1px solid var(--line); padding: 10px 0 4px; }
.lot:first-of-type { border-top: 0; }
.lot-h { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 6px; flex-wrap: wrap; }
.lot-actions { display: flex; gap: 6px; }
.qty-big { font-size: 16px; }
.lot-row { display: grid; grid-template-columns: minmax(150px, 1.2fr) auto 1.5fr auto; gap: 10px; align-items: center; padding: 5px 0 5px 12px; border-left: 3px solid var(--wood); margin: 4px 0; }
.lot-row.done { opacity: .6; border-left-color: var(--accent); }
.lot-plan { display: flex; align-items: center; gap: 6px; min-width: 0; }
.lot-plan code { background: var(--bg); padding: 1px 6px; border-radius: 5px; font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chip { font-size: 13px; padding: 2px 9px; border-radius: 99px; background: var(--bg); border: 1px solid var(--line); text-decoration: none; color: var(--ink); white-space: nowrap; }
.chip:hover { border-color: var(--wood); }
.mini-step { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; padding: 4px 10px; border: 1px solid var(--line); border-radius: 8px; cursor: pointer; white-space: nowrap; }
.mini-step input { accent-color: var(--accent); width: 16px; height: 16px; margin: 0; }
.mini-step.on { background: var(--accent-l); color: var(--accent); border-color: transparent; }
@media (max-width: 760px) {
  .top { flex-wrap: wrap; }
  .nav { order: 3; width: 100%; margin: 6px 0 0; }
  .lot-row { grid-template-columns: 1fr auto; }
  .lot-plan { grid-column: 1 / -1; }
}

/* connexion et comptes */
.login-page { display: flex; min-height: 100vh; align-items: center; justify-content: center; padding: 16px; }
.login-box { width: min(400px, 100%); background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 26px 24px; }
.login-box .brand { margin-bottom: 18px; }
.auth-form { display: flex; flex-direction: column; gap: 12px; }
.auth-form h1 { font-size: 20px; margin: 0; }
.auth-form label { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--muted); }
.auth-form input, .user-form input, .user-form select { font: inherit; font-size: 15px; color: var(--ink); background: var(--card); border: 1px solid var(--line); border-radius: 8px; padding: 9px 11px; }
.auth-form input:focus, .user-form input:focus { outline: 2px solid var(--wood); outline-offset: 1px; }
.auth-form.inline { flex-direction: row; align-items: center; flex-wrap: wrap; }
.auth-form.inline input { width: 160px; letter-spacing: 2px; }
.card.narrow { max-width: 560px; }
.steps-list { padding-left: 20px; display: flex; flex-direction: column; gap: 10px; }
.qr { width: 190px; height: 190px; background: #fff; padding: 6px; border-radius: 8px; margin: 8px 0; }
.qr svg { width: 100%; height: 100%; display: block; }
.secret { background: var(--bg); padding: 2px 6px; border-radius: 5px; word-break: break-all; }
.temp-pw code { font-size: 20px; letter-spacing: 1px; background: var(--bg); padding: 6px 12px; border-radius: 8px; display: inline-block; user-select: all; }
.user-form { display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; }
.user-form label { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--muted); }
.user-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line); flex-wrap: wrap; }
.user-row.gone { opacity: .55; }
.user-actions { display: flex; gap: 6px; flex-wrap: wrap; }
a.me { text-decoration: none; }

[hidden] { display: none !important; }

.admin-mail { display: block; text-align: center; margin-top: 4px; padding-top: 12px; border-top: 1px solid var(--line); font-size: 14px; font-weight: 600; text-decoration: none; }

/* notes */
.nav-badge { display: inline-block; min-width: 18px; padding: 0 5px; margin-left: 4px; border-radius: 99px; background: var(--warn); color: #fff; font-size: 11px; line-height: 18px; text-align: center; }
.note-form { display: flex; flex-direction: column; gap: 10px; max-width: 640px; }
.note-form label { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--muted); }
.note-form select, .note-form textarea { font: inherit; font-size: 15px; color: var(--ink); background: var(--card); border: 1px solid var(--line); border-radius: 8px; padding: 9px 11px; }
.note-form select { max-width: 320px; }
.note-form textarea { resize: vertical; min-height: 80px; }
.note-row { display: flex; gap: 12px; align-items: flex-start; padding: 10px 0; border-top: 1px solid var(--line); }
.note-row.done { opacity: .6; }
.note-main { flex: 1; min-width: 0; }
.note-meta { font-size: 13px; display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.note-body { white-space: pre-wrap; word-break: break-word; margin-top: 3px; }
.note-form-row { display: flex; gap: 12px; flex-wrap: wrap; }
.note-form-row label { flex: 1; min-width: 200px; }
.note-form-row select { max-width: none; width: 100%; }
.notes-card .note-add { margin-top: 10px; }
.notes-card .note-add summary { cursor: pointer; color: var(--accent); font-weight: 600; font-size: 14px; margin-bottom: 8px; }
.badge.note { background: #fff4c2; color: #7a5b00; font-weight: 600; }
@media (prefers-color-scheme: dark) { .badge.note { background: #3d3415; color: #f3d675; } }

a.btn { text-decoration: none; display: inline-block; }
.nav a { white-space: nowrap; }
@media (max-width: 760px) { .nav { overflow-x: auto; scrollbar-width: none; } .nav::-webkit-scrollbar { display: none; } }

/* Expédition au niveau de la commande */
.step.ship-todo { border-style: dashed; }
.step.ship-todo span { color: var(--muted); font-weight: 500; }
#trk, .trk-list { display: flex; flex-direction: column; gap: 8px; }
#trk > label, .trk-row label { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--muted); flex: 1; }
.trk-row { display: flex; align-items: flex-end; gap: 8px; }
.trk-row .link { padding-bottom: 8px; }
#trk-add { align-self: flex-start; }
.ship-lines { margin: 4px 0 8px; padding-left: 18px; }
#ship-pick { display: flex; flex-direction: column; gap: 6px; margin-top: 6px; }
.shp-n { font-size: 12px; font-weight: 700; color: var(--accent); background: var(--accent-l); border-radius: 6px; padding: 1px 6px; }

/* Bibliothèque */
.lib-chip { display: inline-block; margin: 4px 0; font-size: 12.5px; padding: 3px 9px; border-radius: 8px; background: var(--accent-l); color: var(--ink); text-decoration: none; line-height: 1.35; }
.lib-chip:hover { outline: 1px solid var(--accent); }
.lib-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; }
.lib-card { display: flex; flex-direction: column; gap: 4px; background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 10px; text-decoration: none; color: var(--ink); }
.lib-card:hover { border-color: var(--wood); }
.lib-img { aspect-ratio: 4 / 3; border-radius: 8px; background: var(--bg); display: flex; align-items: center; justify-content: center; overflow: hidden; }
.lib-img img { width: 100%; height: 100%; object-fit: cover; }
.lib-t { font-weight: 600; font-size: 14px; line-height: 1.3; }
.lib-ok { color: var(--accent); }
.lib-head { display: flex; gap: 16px; align-items: center; }
.lib-head h1 { font-size: 20px; margin: 0 0 4px; }
.lib-head-img img { width: 84px; height: 84px; object-fit: cover; border-radius: 8px; display: block; }
.lib-split { display: grid; grid-template-columns: 280px 1fr; gap: 14px; align-items: start; }
.lib-vars { position: sticky; top: 70px; max-height: calc(100vh - 90px); overflow: auto; display: flex; flex-direction: column; gap: 6px; }
.lib-vars input { width: 100%; }
#var-list { display: flex; flex-direction: column; gap: 2px; }
.var-row { display: flex; justify-content: space-between; align-items: center; gap: 8px; text-align: left; background: none; border: 0; border-radius: 8px; padding: 7px 9px; font: inherit; color: var(--ink); cursor: pointer; }
.var-row:hover { background: var(--bg); }
.var-row.on { background: var(--accent-l); }
.var-row .dot { color: var(--accent); font-size: 11px; }
.fiche-grid { display: grid; grid-template-columns: minmax(180px, 300px) 1fr; gap: 18px; }
.fiche-photo img { width: 100%; border-radius: 8px; display: block; background: var(--bg); }
.fiche-photo .no-img { aspect-ratio: 1; display: flex; align-items: center; justify-content: center; background: var(--bg); border-radius: 8px; }
.fiche-photo p { margin: 4px 0 8px; }
.file-btn { cursor: pointer; display: inline-block; }
.fiche-fields { display: flex; flex-direction: column; gap: 12px; }
.ff { display: flex; flex-direction: column; gap: 4px; font-size: 13px; }
.ff > span { font-weight: 600; }
.ff input, .ff textarea { font: inherit; }
.ff-msg { min-height: 14px; color: var(--muted); }
.ff-msg.ok { color: var(--accent); }
.tag-inh, .tag-own { font-weight: 500; font-size: 11px; border-radius: 6px; padding: 0 6px; }
.tag-inh { background: var(--bg); color: var(--muted); border: 1px solid var(--line); }
.tag-own { background: var(--accent-l); color: var(--accent); }
.table-wrap { overflow-x: auto; }
table.ov { border-collapse: collapse; width: 100%; font-size: 13px; }
table.ov th, table.ov td { text-align: left; padding: 6px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
table.ov th { font-weight: 600; white-space: nowrap; }
table.ov tbody tr { cursor: pointer; }
table.ov tbody tr:hover, table.ov tbody tr.on { background: var(--accent-l); }
table.ov td.inh { color: var(--muted); font-style: italic; }
.field-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; padding: 6px 0; border-bottom: 1px solid var(--line); }
.field-row .f-label, #nf-label { flex: 1; min-width: 160px; }
.field-row .f-unit, #nf-unit { width: 90px; }
@media (max-width: 760px) {
  .lib-split, .fiche-grid { grid-template-columns: 1fr; }
  .lib-vars { position: static; max-height: 260px; }
  .lib-grid { grid-template-columns: repeat(2, 1fr); }
}
.var-h { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); padding: 10px 9px 2px; }
.opt-vars { line-height: 1.8; }
.tabs-perm { display: flex; flex-wrap: wrap; gap: 4px 14px; align-items: center; margin-top: 6px; }
.tabs-perm .chk { align-items: center; }
.tabs-perm .chk input { margin-top: 0; }
.sent-h { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.sent-h h2 { margin-bottom: 0; }

/* Mémos */
.memo-new textarea, .memo-edit { width: 100%; font: inherit; }
.memo-new-actions { display: flex; justify-content: space-between; align-items: center; margin-top: 8px; gap: 10px; }
.memo { display: flex; gap: 12px; align-items: flex-start; padding: 10px 0; border-top: 1px solid var(--line); }
.memo:first-child { border-top: 0; }
.memo.pinned { background: linear-gradient(90deg, var(--accent-l), transparent 60%); border-radius: 8px; padding-left: 6px; }
.memo.done .memo-body { color: var(--muted); text-decoration: line-through; }
.memo-main { flex: 1; min-width: 0; }
.memo-body { white-space: pre-wrap; overflow-wrap: anywhere; }
.memo-meta { margin-top: 4px; }
#memo-q { max-width: 260px; }

/* Compléments (stylo) */
.pen { display: inline-flex; align-items: center; gap: 4px; vertical-align: middle; background: none; border: 1px solid transparent; border-radius: 6px; padding: 2px 5px; color: var(--muted); cursor: pointer; font: inherit; font-size: 12px; }
.pen:hover { border-color: var(--line); color: var(--ink); }
.pen.has { color: var(--accent); background: var(--accent-l); }
.det-quote { margin: 0; padding: 8px 12px; border-left: 3px solid var(--wood); background: var(--bg); border-radius: 0 8px 8px 0; white-space: pre-wrap; overflow-wrap: anywhere; font-size: 14px; }
.det-text { white-space: pre-wrap; overflow-wrap: anywhere; max-height: 50vh; overflow: auto; }
.det-ta { width: 100%; font: inherit; color: var(--ink); background: var(--card); border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; resize: vertical; }

/* Pièces jointes */
.att-list { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 6px; }
.att-img { padding: 0; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; width: 64px; height: 64px; background: var(--bg); cursor: zoom-in; }
.att-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.att-file { display: inline-flex; align-items: center; gap: 2px; font-size: 13px; border: 1px solid var(--line); border-radius: 8px; padding: 3px 4px 3px 8px; background: var(--card); }
.att-file a { text-decoration: none; }
.att-x { border: 0; background: none; color: var(--muted); cursor: pointer; font-size: 16px; line-height: 1; padding: 0 4px; }
.att-x:hover { color: var(--err); }
.att-add { display: inline-flex; align-items: center; gap: 4px; font-size: 13px; color: var(--accent); cursor: pointer; border: 1px dashed var(--line); border-radius: 8px; padding: 4px 9px; white-space: nowrap; }
.att-add:hover { border-color: var(--accent); }
.note-form-foot { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.note-form-foot .btn { margin-left: auto; }
.memo-new-actions .att-add { margin-left: auto; }
.dlg-img { width: min(980px, 96vw); }
.dlg-img img { max-width: 100%; max-height: 72vh; object-fit: contain; display: block; margin: 0 auto; border-radius: 8px; background: var(--bg); }
.dlg-img .dlg-actions { flex-wrap: wrap; }

/* Miniatures produit (picking), casiers, stock permanent */
.pthumb { flex: 0 0 auto; width: 64px; height: 64px; padding: 0; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; background: var(--bg); cursor: zoom-in; }
.pthumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pthumb.sm { width: 40px; height: 40px; }
.pthumb.fill { width: 100%; height: 100%; border: 0; border-radius: 0; }
.lot-hl { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.pre { white-space: pre-line; }
.kind-sw { display: inline-flex; gap: 10px; flex-wrap: wrap; }
.badge.cas { background: #e8e0f5; color: #5a3d8a; }
.cas-head { display: flex; gap: 12px; align-items: flex-start; }
.cas-title { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.cas-steps { display: flex; gap: 6px; flex-wrap: wrap; }
.cas-desc { margin-top: 10px; padding: 8px 12px; background: var(--bg); border-radius: 8px; }
.cas-card.done { opacity: .75; }
.stock-h { margin: 22px 0 8px; font-size: 15px; color: var(--wood-d); border-top: 2px dashed var(--line); padding-top: 14px; }
.acc-group.stock { border-style: dashed; }
.stock-set { display: inline-flex; align-items: center; gap: 6px; margin: 4px 0; }
@media (prefers-color-scheme: dark) { .badge.cas { background: #2f2640; color: #c9b5ee; } }
@media (min-width: 761px) { .line { grid-template-columns: 68px 1fr auto; } .line.peg { grid-template-columns: 130px 1fr auto; } }
.qty { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
@media (max-width: 760px) { .qty { flex-direction: row; align-items: center; justify-content: flex-start; } }
.badge.m3d { background: #dff1f7; color: #1d6177; }
.badge.mbois { background: #f3e6cc; color: #7a5520; }
.mat-line { margin: 4px 0; }
@media (prefers-color-scheme: dark) { .badge.m3d { background: #183a45; color: #9fd6e8; } .badge.mbois { background: #3a3122; color: #e6c48c; } }
.tag-shop { font-weight: 500; font-size: 11px; border-radius: 6px; padding: 0 6px; background: #e6f0e0; color: #3f6b2a; white-space: nowrap; }
.tag-shop.off { background: var(--bg); color: var(--muted); border: 1px solid var(--line); }
.ff select { font: inherit; }
@media (prefers-color-scheme: dark) { .tag-shop { background: #22331b; color: #a8d58f; } }

/* Colis */
.pkg-btn { flex: none; white-space: nowrap; }
.pkg-row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 6px 0; }
.pkg-row input { width: 4.2em; }
.pkg-row input.pkg-c { flex: 1 1 14em; width: auto; }
.pkg-n { font-weight: 600; min-width: 2em; }

/* Champ à choix multiples (Bibliothèque) */
.multi { display: flex; flex-wrap: wrap; gap: 4px 14px; align-items: center; padding: 4px 0; }
.multi .chk { display: inline-flex; gap: 6px; align-items: center; font-weight: normal; }
