:root {
  --bg: #f6f5f2; --panel: #fff; --ink: #1d1d1b; --muted: #77746d; --line: #e4e1da;
  --acc: #b3261e; --acc-soft: #fbe9e7; --ok: #2e7d32; --ok-soft: #e8f5e9; --warn: #a15c00; --warn-soft: #fff3e0;
  --sel: #1565c0; --sel-soft: #e3f0fd;
}
* { box-sizing: border-box; }
body { margin: 0; font: 14px/1.4 -apple-system, "Segoe UI", Roboto, sans-serif; color: var(--ink); background: var(--bg); }
header { position: sticky; top: 0; z-index: 10; display: flex; align-items: center; gap: 18px; padding: 8px 16px;
  background: var(--panel); border-bottom: 1px solid var(--line); }
.brand { font-weight: 700; }
nav a { margin-right: 12px; color: var(--muted); text-decoration: none; }
nav a.on { color: var(--ink); font-weight: 600; border-bottom: 2px solid var(--acc); }
.progress { display: flex; align-items: center; gap: 8px; flex: 1; min-width: 200px; }
.progress .bar { flex: 1; max-width: 320px; height: 8px; background: var(--line); border-radius: 4px; overflow: hidden; }
.progress .bar i { display: block; height: 100%; width: 0; background: var(--ok); }
.who input { font: inherit; padding: 3px 6px; border: 1px solid var(--line); border-radius: 4px; }
button { font: inherit; padding: 4px 10px; border: 1px solid var(--line); background: #fff; border-radius: 4px; cursor: pointer; }
button:hover { border-color: #bbb; }
button.ghost { background: transparent; }
button.sp { color: var(--warn); }
.layout { display: grid; grid-template-columns: 280px 1fr; height: calc(100vh - 47px); }
aside { overflow-y: auto; border-right: 1px solid var(--line); background: var(--panel); }
.aside-tools { position: sticky; top: 0; background: var(--panel); padding: 8px; border-bottom: 1px solid var(--line);
  display: flex; gap: 8px; align-items: center; justify-content: space-between; font-size: 12px; }
.g { display: flex; gap: 8px; padding: 6px 8px; border-bottom: 1px solid var(--line); cursor: pointer; align-items: center; }
.g:hover { background: var(--bg); }
.g.on { background: var(--sel-soft); }
.g .strip { display: flex; gap: 2px; }
.g .strip img { width: 18px; height: 44px; object-fit: contain; background: #eee; }
.g .meta { font-size: 12px; flex: 1; }
.g .meta b { font-size: 13px; }
.g .gp { height: 4px; background: var(--line); border-radius: 2px; margin-top: 3px; }
.g .gp i { display: block; height: 100%; background: var(--ok); border-radius: 2px; }
main { overflow-y: auto; padding: 12px 16px 80px; }
#groupHead { display: flex; align-items: baseline; gap: 12px; margin-bottom: 8px; }
#groupHead h2 { margin: 0; font-size: 18px; }
.muted { color: var(--muted); }
.bulk { position: sticky; top: -12px; z-index: 5; display: flex; gap: 8px; align-items: center; padding: 8px;
  background: var(--sel-soft); border: 1px solid #bcd6f5; border-radius: 6px; margin-bottom: 8px; }
.hidden { display: none !important; }
.row { display: grid; grid-template-columns: 24px 1fr 330px; gap: 10px; padding: 8px; margin-bottom: 6px;
  background: var(--panel); border: 1px solid var(--line); border-radius: 6px; }
.row.focus { outline: 2px solid var(--sel); }
.row.done { background: #fbfdfb; border-color: #cfe6d1; }
.row.done .thumbs { opacity: .75; }
.row .chk { padding-top: 4px; }
.thumbs { display: flex; gap: 3px; flex-wrap: nowrap; overflow: hidden; cursor: zoom-in; align-items: flex-end; }
.thumbs img { height: 120px; width: auto; max-width: 60px; object-fit: contain; background: #eee; border-radius: 2px; }
.rinfo { font-size: 12px; color: var(--muted); margin-top: 4px; }
.side { display: flex; flex-direction: column; gap: 6px; }
.chips { display: flex; flex-direction: column; gap: 4px; }
.chip { display: flex; align-items: center; gap: 6px; padding: 3px 6px; border: 1px solid var(--line); border-radius: 4px;
  cursor: pointer; background: #fff; font-size: 12px; text-align: left; }
.chip:hover { border-color: var(--sel); background: var(--sel-soft); }
.chip img { width: 22px; height: 40px; object-fit: contain; background: #f2f2f2; }
.chip .k { font-weight: 700; color: var(--muted); width: 12px; }
.chip .src { margin-left: auto; color: var(--muted); font-size: 11px; white-space: nowrap; }
.lab { padding: 4px 8px; border-radius: 4px; background: var(--ok-soft); color: var(--ok); font-weight: 600; font-size: 13px;
  display: flex; align-items: center; gap: 6px; }
.lab.sp { background: var(--warn-soft); color: var(--warn); }
.lab button { margin-left: auto; padding: 0 6px; font-size: 12px; }
.acts { display: flex; gap: 4px; flex-wrap: wrap; }
.acts button { font-size: 12px; padding: 2px 8px; }
.skubox { position: relative; }
.skubox input { width: 100%; font: inherit; padding: 4px 6px; border: 1px solid var(--line); border-radius: 4px; }
.skulist { position: absolute; z-index: 30; left: 0; right: 0; max-height: 320px; overflow-y: auto; background: #fff;
  border: 1px solid #bbb; border-radius: 4px; box-shadow: 0 6px 18px rgba(0,0,0,.15); }
.skulist div { display: flex; gap: 6px; align-items: center; padding: 4px 6px; cursor: pointer; font-size: 13px; }
.skulist div.on, .skulist div:hover { background: var(--sel-soft); }
.skulist img { width: 18px; height: 34px; object-fit: contain; }
.skulist .new { color: var(--sel); font-weight: 600; }
.skuslot { min-width: 260px; }
.modal { position: fixed; inset: 0; z-index: 40; background: rgba(0,0,0,.4); display: flex; align-items: center; justify-content: center; }
.modal-box { background: #fff; width: 94vw; height: 90vh; border-radius: 8px; display: flex; flex-direction: column; }
.modal-box.small { width: 520px; height: auto; padding: 16px 20px; }
.modal-head { display: flex; gap: 10px; align-items: center; padding: 10px 14px; border-bottom: 1px solid var(--line); }
.grow { flex: 1; }
.modal-body { overflow-y: auto; padding: 10px 14px; }
.cgrid { display: flex; flex-wrap: wrap; gap: 4px; }
.cgrid .c { position: relative; border: 2px solid transparent; border-radius: 3px; cursor: pointer; }
.cgrid .c img { height: 140px; width: auto; max-width: 70px; object-fit: contain; display: block; background: #eee; }
.cgrid .c.sel { border-color: var(--sel); }
.cgrid .c .t { position: absolute; left: 0; right: 0; bottom: 0; font-size: 10px; background: rgba(46,125,50,.85); color: #fff;
  overflow: hidden; white-space: nowrap; text-overflow: ellipsis; padding: 0 2px; }
kbd { border: 1px solid #ccc; border-bottom-width: 2px; border-radius: 3px; padding: 0 4px; font-size: 12px; background: #fafafa; }
table.cat { border-collapse: collapse; width: 100%; background: #fff; }
table.cat td, table.cat th { border-bottom: 1px solid var(--line); padding: 4px 8px; text-align: left; font-size: 13px; }
table.cat img { height: 48px; }
.toast { position: fixed; bottom: 16px; left: 50%; transform: translateX(-50%); background: #333; color: #fff; padding: 6px 14px;
  border-radius: 4px; z-index: 60; font-size: 13px; }
.row > div { min-width: 0; }
.chip.weak { opacity: .5; }
@media (max-width: 1100px) {
  .layout { grid-template-columns: 200px 1fr; }
  .row { grid-template-columns: 24px 1fr; }
  .row .side { grid-column: 2; }
  header { flex-wrap: wrap; gap: 8px; }
}

.zoom { position: fixed; z-index: 70; background: #fff; border: 1px solid #999; border-radius: 6px; padding: 8px;
  box-shadow: 0 10px 30px rgba(0,0,0,.3); pointer-events: none; max-width: 820px; }
.zoom .zimgs { display: flex; gap: 8px; align-items: flex-start; }
.zoom .zc { height: 520px; width: auto; max-width: 260px; object-fit: contain; background: #eee; }
.zoom .zx { height: 420px; width: auto; max-width: 540px; object-fit: contain; background: #eee; }
.sect { margin-bottom: 14px; border: 1px solid var(--line); border-radius: 6px; }
.sect-head { display: flex; gap: 8px; align-items: center; padding: 6px 8px; background: var(--bg); border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.sect-head b { font-size: 15px; }
.sect .cgrid { padding: 6px; }
.splitbtns button { padding: 2px 8px; }
.rinfo .mix { color: var(--warn); font-weight: 600; }

.modal-head.two { padding-top: 6px; padding-bottom: 6px; background: var(--bg); }
.modal-head.two .skuslot { min-width: 280px; }
.rinfo .warn { color: var(--warn); font-weight: 600; }

img.catref { cursor: zoom-in; }
.lab img.labimg { height: 28px; width: auto; }
.lightbox { position: fixed; inset: 0; z-index: 90; background: rgba(0,0,0,.6); display: flex; align-items: center; justify-content: center; cursor: zoom-out; }
.lightbox .lb-box { background: #fff; border-radius: 8px; padding: 14px; text-align: center; max-width: 90vw; }
.lightbox img { max-height: 78vh; max-width: 80vw; object-fit: contain; background: #f3f3f3; display: block; margin: 0 auto 8px; }
.lightbox .lb-cap { font-weight: 700; font-size: 16px; margin-bottom: 4px; }
nav a { white-space: nowrap; }
.badge { display: inline-block; min-width: 18px; padding: 0 5px; border-radius: 9px; background: var(--line); color: var(--ink);
  font-size: 11px; font-weight: 700; text-align: center; margin-left: 2px; }
nav a.on .badge { background: var(--acc); color: #fff; }
/* вкладки проверки */
.rv-layout { display: grid; grid-template-columns: 300px 1fr; height: calc(100vh - 47px); }
.sku-item { display: flex; gap: 8px; align-items: center; padding: 6px 8px; border-bottom: 1px solid var(--line); cursor: pointer; }
.sku-item:hover { background: var(--bg); } .sku-item.on { background: var(--sel-soft); }
.sku-item img { width: 26px; height: 56px; object-fit: contain; background: #f3f3f3; }
.sku-item .meta { font-size: 12px; flex: 1; } .sku-item .meta b { font-size: 13px; }
.rv-head { display: flex; gap: 16px; align-items: flex-start; padding: 10px; background: #fff; border: 1px solid var(--line); border-radius: 6px; margin-bottom: 10px; }
.rv-head .ref img { height: 220px; width: auto; max-width: 140px; object-fit: contain; background: #f3f3f3; border-radius: 4px; }
.rv-head .ref .noimg { width: 110px; height: 220px; display: flex; align-items: center; justify-content: center; background: #f3f3f3;
  color: var(--muted); font-size: 12px; text-align: center; border-radius: 4px; }
.rv-head h2 { margin: 0 0 4px; font-size: 19px; }
.rv-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-top: 10px; }
.rv-actions .primary { background: var(--ok); color: #fff; border-color: var(--ok); font-weight: 600; }
.cards { display: flex; flex-wrap: wrap; gap: 8px; }
.card { background: #fff; border: 2px solid var(--line); border-radius: 6px; padding: 4px; cursor: pointer; position: relative; }
.card:hover { border-color: #aaa; }
.card.rej { border-color: var(--acc); background: var(--acc-soft); }
.card.rej::after { content: "не согласен"; position: absolute; top: 4px; left: 4px; background: var(--acc); color: #fff; font-size: 11px;
  padding: 1px 5px; border-radius: 3px; font-weight: 700; }
.card.ok { border-color: var(--ok); }
.card .ct { display: flex; gap: 2px; }
.card .ct img { height: 130px; width: auto; max-width: 54px; object-fit: contain; background: #eee; }
.card .cap { font-size: 11px; color: var(--muted); padding: 2px 2px 0; display: flex; justify-content: space-between; gap: 6px; }
.card .cap a { color: var(--sel); }
.hint { color: var(--muted); font-size: 13px; }
