/* Stock → Inventory — the violet theme, from the approved "Stock Page Redesign" mockup.
 *
 * SCOPED TO #stockInventory, every rule. style.css dresses this page in the old RMS blue —
 * #2563eb stat cards, blue .stk2-tab, a 680px min-width main table — and all of it is still
 * there for the screens that have not been redone yet. Nothing outside this section changes.
 *
 * Tokens are the house set from vendorPickListViolet.css (28 Oct), not a second palette.
 *
 * THE TABLE FITS. The old one laid down nineteen columns and scrolled sideways on every screen
 * in the building. Thirteen now: Item no, Barcode and Category moved under the product name,
 * the row number went, Reorder folded into Status, and Bins (Picked)/(Packed) were removed
 * outright. Widths below are fixed and add up — change one and check the sum, because a table
 * that overflows is the thing this file exists to stop.
 *
 * FOUR TINTS, AND THEY ARE NOT DECORATION. Local shipments is on the road, Balance goods is
 * standing at the supplier, Containers is at sea, MSD is landed but off site. Four hues far
 * enough apart to tell at a glance — and each pill carries its own icon as well, so the column
 * still reads for anyone who cannot separate the colours.
 */

#stockInventory{
  --s-ground:#F6F5F8; --s-paper:#FFFFFF; --s-sunk:#FAF9FC;
  --s-line:#E9E7EE; --s-line2:#DAD7E2; --s-line3:#F1EFF5;
  --s-ink:#1D1826; --s-mut:#5F5970; --s-faint:#948DA3; --s-ghost:#CFCAD8;
  --s-acc:#5E48B8; --s-acc-deep:#49389A; --s-acc-wash:#EFECFA; --s-acc-line:#CFC7EC;
  --s-ok:#177550; --s-ok-wash:#E9F4EE; --s-ok-line:#BFE0CF;
  --s-warn:#B45309; --s-warn-ink:#8A4A08; --s-warn-wash:#FBF3E4; --s-warn-line:#EED9B2;
  --s-bad:#B42318; --s-bad-wash:#FBEDEA; --s-bad-line:#F0C5BE;
  /* the four off-shelf columns */
  --s-ls:#0F6446;  --s-ls-wash:#E9F4EE;  --s-ls-line:#BFE0CF;  --s-ls-col:#F3F8F5;  --s-ls-head:#EDF5F0;
  --s-bg:#8A4A08;  --s-bg-wash:#FBF3E4;  --s-bg-line:#EED9B2;  --s-bg-col:#FCF8F1;  --s-bg-head:#F9F2E7;
  --s-ct:#0B5675;  --s-ct-wash:#E3EEF5;  --s-ct-line:#BAD4E4;  --s-ct-col:#EFF5F9;  --s-ct-head:#E7F0F7;
  --s-md:#4A379E;  --s-md-wash:#EFECFA;  --s-md-line:#CFC7EC;  --s-md-col:#F7F5FC;  --s-md-head:#F1EEFA;
  --s-display:'Bricolage Grotesque','Instrument Sans',system-ui,sans-serif;
  --s-ui:'Instrument Sans',system-ui,-apple-system,'Segoe UI',sans-serif;
  font-family:var(--s-ui); color:var(--s-ink); background:var(--s-ground);
}
/* No max-width. The 15 columns are percentages, so a wide monitor widens every column
   instead of dumping the slack on one of them — which is what the cap was there to stop
   before the percentages existed. Capped, this tab was the only one not filling .main. */
#stockInventory *{box-sizing:border-box}

/* THE SQUARE. style.css:1 paints the whole app on a blue radial gradient
   (#dbeafe → #eef3f8 → #f8fafc). This tab's ground is a neutral violet-grey, and a ground
   painted on #stockInventory alone is a rectangle: it ends where the section's box ends, so
   the blue carried on around it — above the title, down both sides, below the last explainer
   — and the page read as a card dropped onto somebody else's wallpaper.
   So the ground goes on the page itself, but only while this tab is the one on screen.
   :has() is doing the work a body class would do, without the JS and without a teardown hook
   to forget: showTab() toggles .hidden on every .tab, so the moment you leave, the app's own
   background comes back on its own. The literal is --s-ground, which is declared on
   #stockInventory and so cannot be read from here.
   #stockInventory keeps its own background deliberately. Where :has() resolves the two are
   the same colour and there is no edge to see; where it does not, the page falls back to
   exactly what it looks like today rather than to white text on a gradient. */
body:has(#stockInventory:not(.hidden)){background:#F6F5F8}
#stockInventory :focus-visible{outline:3px solid var(--s-acc-line);outline-offset:2px}

/* ── head ───────────────────────────────────────────────────────────────── */
#stockInventory .stk2-head{display:flex;align-items:flex-end;gap:24px;flex-wrap:wrap;margin-bottom:20px}
#stockInventory .stk2-title{font-family:var(--s-display);font-size:31px;font-weight:600;
  letter-spacing:-.025em;line-height:1.1;color:var(--s-ink)}
#stockInventory .stk2-sub{font-size:13.5px;color:var(--s-mut);margin-top:7px}
/* style.css gives every button a blue fill, a margin and a shadow; these start clean */
#stockInventory .btn-refresh,#stockInventory .stk2-btn-sm,#stockInventory .stk2-tab{margin:0;box-shadow:none}
#stockInventory .btn-refresh{display:inline-flex;align-items:center;gap:7px;height:38px;padding:0 15px;
  border-radius:10px;border:1px solid var(--s-acc);background:var(--s-acc);color:#fff;
  font-size:13px;font-weight:600;cursor:pointer}
#stockInventory .btn-refresh:hover{background:var(--s-acc-deep);border-color:var(--s-acc-deep);transform:none}

/* ── tabs ───────────────────────────────────────────────────────────────── */
#stockInventory .stk2-tabs{display:flex;gap:4px;background:#EFEDF3;border:1px solid var(--s-line);
  border-radius:12px;padding:4px;width:max-content;margin-bottom:16px;max-width:100%;overflow-x:auto}
#stockInventory .stk2-tab{display:inline-flex;align-items:center;gap:8px;height:34px;padding:0 14px;
  border:0;background:none;border-radius:9px;font-size:13px;font-weight:600;color:var(--s-mut);
  cursor:pointer;white-space:nowrap}
#stockInventory .stk2-tab:hover{color:var(--s-ink);background:none}
#stockInventory .stk2-tab.active{background:var(--s-paper);color:var(--s-acc-deep);
  box-shadow:0 1px 2px rgba(29,24,38,.08)}
#stockInventory .stk2-tab-n{font-size:11px;font-weight:700;color:var(--s-faint);background:#EFEDF3;
  border-radius:999px;padding:2px 7px;min-width:18px;text-align:center}
#stockInventory .stk2-tab.active .stk2-tab-n{background:var(--s-acc-wash);color:var(--s-acc)}

/* ── the figures: one strip, not six cards ──────────────────────────────────
   The six cards were two rows tall on a screen whose job is the table. Same six figures,
   a sixth of the height. The ones you can act on are real <button>s and say so — a number
   that opens a queue should not look like a number that just sits there. */
#stockInventory .stk2-stats{display:grid;grid-template-columns:repeat(6,minmax(0,1fr));gap:0;
  background:var(--s-paper);border:1px solid var(--s-line);border-radius:14px;overflow:hidden;margin-bottom:14px}
#stockInventory .stat-card{display:block;background:none;border:0;border-right:1px solid var(--s-line);
  border-radius:0;padding:15px 18px;min-width:0;box-shadow:none;text-align:left;transform:none;
  font:inherit;color:inherit}
#stockInventory .stat-card:last-child{border-right:0}
#stockInventory .stat-card:hover{transform:none;box-shadow:none}
#stockInventory .stat-card.is-act{cursor:pointer}
#stockInventory .stat-card.is-act:hover{background:#FBFAFD}
#stockInventory .stat-card.is-act:hover .stat-go{color:var(--s-acc-deep);text-decoration:underline}
#stockInventory .stat-label{font-size:10.5px;font-weight:700;letter-spacing:.1em;text-transform:uppercase;
  color:var(--s-faint);display:block}
#stockInventory .stat-val{font-family:var(--s-display);font-size:27px;font-weight:600;letter-spacing:-.03em;
  line-height:1;margin-top:9px;font-variant-numeric:tabular-nums;display:block;color:var(--s-ink)}
#stockInventory .stat-go{display:inline-flex;align-items:center;gap:4px;font-size:11.5px;font-weight:700;
  color:var(--s-acc);margin-top:7px}
#stockInventory .stat-d{display:block;font-size:11.5px;color:var(--s-faint);margin-top:7px}
#stockInventory .s-green .stat-val{color:var(--s-ok)}
#stockInventory .s-amber .stat-val{color:var(--s-warn)}
#stockInventory .s-red .stat-val{color:var(--s-bad)}
#stockInventory .s-grey .stat-val{color:var(--s-faint)}
#stockInventory .s-zero .stat-val{color:var(--s-ghost)}
#stockInventory .stat-ic{display:none}      /* the icon was decoration; the label says it */

/* ── EAN alert ──────────────────────────────────────────────────────────── */
#stockInventory #stkMissingEanAlert{background:var(--s-warn-wash)!important;border:1px solid var(--s-warn-line)!important;
  color:#6B3D08!important;border-radius:12px!important;padding:13px 16px!important;font-size:13px!important;line-height:1.5!important}
#stockInventory #stkMissingEanAlert b{color:var(--s-warn-ink)}

/* ── toolbar ────────────────────────────────────────────────────────────── */
#stockInventory .stk2-toolbar,#stockInventory .stk2-log-toolbar{display:flex;gap:9px;align-items:center;
  flex-wrap:wrap;margin-bottom:14px}
#stockInventory .stk2-search,#stockInventory .stk2-sel{height:38px;border:1px solid var(--s-line2);
  border-radius:10px;background:var(--s-paper);font-family:inherit;font-size:13px;color:var(--s-ink);
  padding:0 12px;box-shadow:none}
#stockInventory .stk2-search{flex:1 1 280px;max-width:380px;min-width:0}
#stockInventory .stk2-search::placeholder{color:var(--s-faint)}
#stockInventory .stk2-search:focus,#stockInventory .stk2-sel:focus{border-color:var(--s-acc-line);outline:0}
#stockInventory .stk2-btn-sm{display:inline-flex;align-items:center;gap:7px;height:38px;padding:0 14px;
  border-radius:10px;border:1px solid var(--s-line2);background:var(--s-paper);font-size:13px;
  font-weight:600;color:var(--s-ink);cursor:pointer}
#stockInventory .stk2-btn-sm:hover{border-color:var(--s-acc-line);color:var(--s-acc-deep);
  background:var(--s-paper);transform:none}
#stockInventory #stkResetAllBtn{color:var(--s-bad)}
#stockInventory #stkResetAllBtn:hover{border-color:var(--s-bad-line);color:var(--s-bad)}
#stockInventory .stk2-count{font-size:12px;color:var(--s-faint);white-space:nowrap}

/* ── bulk bar ───────────────────────────────────────────────────────────── */
#stockInventory .stk2-bulk{background:var(--s-acc-wash);border:1px solid var(--s-acc-line);
  border-radius:12px;color:var(--s-acc-deep)}
#stockInventory .stk2-bulk button,#stockInventory .stk2-bulk .stk2-upload{background:var(--s-paper);
  border:1px solid var(--s-acc-line);color:var(--s-acc-deep);border-radius:9px;box-shadow:none;margin:0}

/* ── the table ──────────────────────────────────────────────────────────── */
#stockInventory .stk2-card{background:var(--s-paper);border:1px solid var(--s-line);border-radius:14px;
  overflow:hidden;box-shadow:none}
#stockInventory .stk2-main{flex:1;min-width:0}          /* style.css pins 680px; it must shrink */
#stockInventory .stk2-tables{display:block}
/* The floor moved from 1216px to 1310px when Item no and Barcode came back as columns of
   their own. 1310 is two things at once: what the narrowest cells need at their percentages
   (a 13-digit barcode ~95px → 8.2% gives 107; "Out of stock" ~92 → 7.6% gives 100; Log + ⋮
   ~84 → 6.4% gives 84), and the most a 1440 laptop can actually show once the nav rail and
   the page gutter are taken off it: 1440 − 76 − 48 = 1316. A floor of 1400 cleared the first
   test and failed the second, which costs you the MSD column to a scrollbar you did not know
   was there. Below 1310 the table scrolls rather than squashing the figures. */
#stockInventory .stk2-main .tbl{width:100%;min-width:1310px;table-layout:fixed;border-collapse:collapse}
#stockInventory .stk2-main{overflow-x:auto}
#stockInventory .tbl th{background:var(--s-sunk);color:#827B92;font-size:10px;font-weight:700;
  letter-spacing:.08em;text-transform:uppercase;text-align:left;padding:8px 10px;
  border-bottom:1px solid var(--s-line);vertical-align:bottom;white-space:nowrap}
#stockInventory .tbl td{padding:11px 10px;border-bottom:1px solid var(--s-line3);vertical-align:middle;
  font-size:13px;color:var(--s-ink)}
#stockInventory .tbl tbody tr:hover > td{background:#FBFAFD}
/* style.css:955-957 pins #stockInventory .tbl th and td with !important — background #f8fafc
   and colour #64748b on the head, background #fff on every cell. It predates this sheet and
   still dresses the Activity log and Reconciliations tables, so it stays. Re-asserted here
   for the inventory table only (.stk2-main), because without it every colour below loses
   silently: a declaration that isn't !important cannot beat one that is, whatever the
   specificity, and the whole four-column tint was landing nowhere. */
#stockInventory .stk2-main .tbl th{background:var(--s-sunk)!important;color:#827B92!important;
  padding:8px 10px!important;height:auto!important;border-bottom:1px solid var(--s-line)!important}
#stockInventory .stk2-main .tbl td{background:var(--s-paper)!important;color:var(--s-ink)!important;
  padding:11px 10px!important;border-bottom:1px solid var(--s-line3)!important}
#stockInventory .stk2-main .tbl tbody tr.data-row:hover > td{background:#FBFAFD!important}
#stockInventory .tbl .r-align{text-align:right}
/* a sub-label under the three figure headings: which ledger moves this number */
#stockInventory .th-sub{display:block;font-size:9px;font-weight:600;letter-spacing:.03em;
  text-transform:none;color:#B3ADBF;margin-top:3px;white-space:normal;line-height:1.25}
/* the group header over the four off-shelf columns — the sentence that explains the panel */
#stockInventory .tbl th.stk-grp{text-align:center;font-size:9.5px;letter-spacing:.14em;
  padding:7px 10px!important;background:#F4F2F8!important;color:#6B6479!important;
  border-left:2px solid var(--s-line2)}
#stockInventory .tbl th.stk-grp-pad{background:var(--s-sunk)!important;padding:7px 10px!important}

/* COLUMN WIDTHS. Carried by the <colgroup> in index.html, not by the <th>s —
   table-layout:fixed reads the first row, and the first row here is the group header whose
   cells are colspan 11 and colspan 4, so it declares no per-column width at all.
   They are percentages and they total 100. A single auto column is what went wrong before:
   every fixed column kept its pixels and the one auto column absorbed every spare pixel on a
   wide monitor, so the product name had a thousand of them and the figures had none.
   Changing one means changing another — the sum has to stay at 100. */
#stockInventory .tbl col.check-col{width:2.6%}
#stockInventory .tbl col.photo-col{width:3.2%}
#stockInventory .tbl col.prod-col{width:13.0%}
#stockInventory .tbl col.item-col{width:5.8%}
#stockInventory .tbl col.ean-col{width:7.4%}
#stockInventory .tbl col.sys-col{width:6.4%}
#stockInventory .tbl col.wh-col{width:6.0%}
#stockInventory .tbl col.diff-col{width:5.6%}
#stockInventory .tbl col.amz-col{width:6.0%}
#stockInventory .tbl col.status-col{width:7.2%}
#stockInventory .tbl col.updated-col{width:5.4%}
#stockInventory .tbl col.actions-col{width:6.2%}
#stockInventory .actions-cell{text-align:right;white-space:nowrap}
#stockInventory .actions-cell .log-btn{margin-right:6px}
#stockInventory .expand-icon{color:var(--s-faint);font-size:10px;margin-right:4px}

/* ── the product cell: one column that used to be four ──────────────────── */
#stockInventory .photo,#stockInventory .photo img{width:36px;height:36px;border-radius:8px}
#stockInventory .photo{background:var(--s-line3);border:1px solid var(--s-line);display:flex;
  align-items:center;justify-content:center;overflow:hidden}
#stockInventory .photo img{object-fit:cover}
#stockInventory .photo-ph{color:var(--s-ghost);font-size:15px}
#stockInventory .stk-row-main{display:flex;align-items:flex-start;gap:8px;min-width:0}
#stockInventory .stk-tick-box{flex:none;width:15px;height:15px;min-width:0;margin:2px 0 0;padding:0}
#stockInventory .stk-row-main-text{min-width:0;flex:1}
#stockInventory .product-name{font-weight:600;font-size:13px;line-height:1.3;color:var(--s-ink);
  overflow-wrap:anywhere}
#stockInventory .stk-cat{font-size:11.5px;color:var(--s-faint);margin-top:2px;
  overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
/* Item no and Barcode. Tabular figures so the two columns read down the page as columns of
   digits rather than as ragged text — which is the whole reason they are columns again. */
#stockInventory .tbl .item-col,#stockInventory .tbl .ean-col{font-variant-numeric:tabular-nums;
  letter-spacing:.01em}
#stockInventory .tbl td.item-col,#stockInventory .tbl td.ean-col{color:var(--s-mut);font-size:12px}
#stockInventory .tbl td.item-col .mono,#stockInventory .tbl td.ean-col .mono{
  overflow-wrap:anywhere}
#stockInventory .stk-altean{display:block;font-size:10.5px;color:var(--s-faint);margin-top:2px;
  white-space:nowrap}
#stockInventory .stk-usedin,#stockInventory .stk-suppliers{font-size:11px;color:#8E8899;
  margin-top:3px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;background:none;
  padding:0;border:0}
/* A UK item with no supplier assigned yet (stock.js suppliersLine). */
#stockInventory .stk-src-local{display:inline-block;font-size:10.5px;font-weight:700;letter-spacing:.02em;
  color:#177550;background:#E7F3EC;border-radius:5px;padding:0 6px;line-height:17px}
html[data-theme="dark"] #stockInventory .stk-src-local{color:#5CC596;background:#173127}
/* The China group beside Local, when Supplier Products has both (stock.js suppliersLine). */
#stockInventory .stk-src-china{display:inline-block;font-size:10.5px;font-weight:700;letter-spacing:.02em;
  color:#8A4B12;background:#F7EBDD;border-radius:5px;padding:0 6px;line-height:17px;margin-left:4px}
html[data-theme="dark"] #stockInventory .stk-src-china{color:#E2A66E;background:#36261A}
#stockInventory .stk-local-line{display:flex;flex-wrap:wrap;align-items:center;gap:2px 6px;max-width:300px}
#stockInventory .stk-local-sup{color:#5F5970;font-weight:600;overflow:hidden;text-overflow:ellipsis}
#stockInventory .stk-local-none{color:#948DA3;font-style:italic}
html[data-theme="dark"] #stockInventory .stk-local-sup{color:#B0A9C2}
html[data-theme="dark"] #stockInventory .stk-local-none{color:#827A96}
#stockInventory .stk-packfam{display:inline-flex;align-items:center;height:18px;padding:0 7px;
  border-radius:999px;font-size:10px;font-weight:700;margin-left:6px;background:var(--s-acc-wash);
  color:var(--s-acc-deep);border:1px solid var(--s-acc-line);white-space:nowrap}
#stockInventory .stk-otag{font-size:10.5px;color:var(--s-faint);margin-top:2px;font-weight:400;
  white-space:nowrap;background:none;padding:0;border:0}

/* ── figures ────────────────────────────────────────────────────────────── */
#stockInventory .qty{font-weight:700;font-variant-numeric:tabular-nums;font-size:13.5px;color:var(--s-ink)}
#stockInventory .qty-green{color:var(--s-ok)}
#stockInventory .qty-warn{color:var(--s-warn)}
#stockInventory .qty-danger{color:var(--s-bad)}
#stockInventory .diff-zero{color:var(--s-faint);font-weight:700;font-variant-numeric:tabular-nums}
#stockInventory .diff-pos{color:var(--s-ok);font-weight:700;font-variant-numeric:tabular-nums}
#stockInventory .diff-neg{color:var(--s-bad);font-weight:700;font-variant-numeric:tabular-nums}
#stockInventory .stk-dash{color:var(--s-ghost)}
/* ── Amazon's own stock: a REFERENCE figure, deliberately quieter than ours ──
   It is not our stock and never enters System/Warehouse/Diff, so it must not compete with them
   for the eye. "n/a" and "not reported" are words, not numbers, because an unknown that looks
   like a figure is the one mistake this column can make. */
#stockInventory .amz-qty{color:var(--s-faint);font-weight:600}
#stockInventory .amz-partial{text-decoration:underline dotted;text-underline-offset:3px}
#stockInventory .amz-asof{display:block;font-size:10.5px;color:var(--s-ghost);margin-top:2px;white-space:nowrap}
#stockInventory .amz-na{font-size:11px;color:var(--s-ghost);font-style:italic;white-space:nowrap}
#stockInventory .stk-orders-tag{display:block;font-size:10.5px;color:var(--s-faint);margin-top:2px;
  font-weight:400;white-space:nowrap}

/* ── status + reorder, one cell ─────────────────────────────────────────── */
#stockInventory .st{display:inline-flex;align-items:center;gap:5px;height:22px;padding:0 9px;
  border-radius:999px;font-size:11px;font-weight:700;white-space:nowrap}
#stockInventory .st::before{content:"";width:5px;height:5px;border-radius:50%;background:currentColor}
#stockInventory .st-in{background:var(--s-ok-wash);color:var(--s-ok)}
#stockInventory .st-low{background:var(--s-warn-wash);color:var(--s-warn)}
#stockInventory .st-out{background:var(--s-bad-wash);color:var(--s-bad)}
#stockInventory .st-unknown{background:var(--s-line3);color:#6B6479}
#stockInventory .stk-floor{display:block;font-size:10.5px;color:var(--s-faint);margin-top:3px;white-space:nowrap}
#stockInventory .last-up{font-size:11.5px;color:var(--s-faint);white-space:nowrap}

/* ── row chips ──────────────────────────────────────────────────────────── */
#stockInventory .stk-notinfile,#stockInventory .stk-noean{display:inline-flex;align-items:center;
  height:18px;padding:0 7px;border-radius:999px;font-size:10px;font-weight:700;white-space:nowrap;
  background:var(--s-warn-wash);color:var(--s-warn-ink);border:1px solid var(--s-warn-line)}
#stockInventory .stk-noean{background:var(--s-line3);color:#6B6479;border-color:#E2DEEA}
#stockInventory .log-btn{border:0;background:none;padding:0;font-size:12px;font-weight:600;
  color:var(--s-acc);cursor:pointer;box-shadow:none;margin:0}
#stockInventory .log-btn:hover{color:var(--s-acc-deep);text-decoration:underline;background:none}
#stockInventory .action-btn{border:1px solid transparent;background:none;width:24px;height:24px;
  border-radius:7px;color:var(--s-faint);cursor:pointer;display:inline-flex;align-items:center;
  justify-content:center;box-shadow:none;margin:0;padding:0}
#stockInventory .action-btn:hover{border-color:#E2DEEA;color:var(--s-acc);background:var(--s-paper)}

/* ── the four off-shelf columns ─────────────────────────────────────────── */
#stockInventory .tbl col.col-ls,#stockInventory .tbl col.col-bg,
#stockInventory .tbl col.col-ct,#stockInventory .tbl col.col-md{width:6.3%}
#stockInventory .tbl .col-ls,#stockInventory .tbl .col-bg,
#stockInventory .tbl .col-ct,#stockInventory .tbl .col-md{text-align:center;white-space:nowrap}
#stockInventory .tbl col.col-ls{background:none}
/* (1,3,1): above the cell ground set just now, below the multi-pack and ticked row flags at
   (1,3,3) — a flagged row keeps one unbroken band of colour across all 13 columns. */
#stockInventory .stk2-main .tbl td.col-ls{background:var(--s-ls-col)!important;
  border-left:2px solid var(--s-line2)}
#stockInventory .stk2-main .tbl td.col-bg{background:var(--s-bg-col)!important}
#stockInventory .stk2-main .tbl td.col-ct{background:var(--s-ct-col)!important}
#stockInventory .stk2-main .tbl td.col-md{background:var(--s-md-col)!important}
#stockInventory .stk2-main .tbl th.col-ls{background:var(--s-ls-head)!important;color:var(--s-ls)!important;
  text-align:center;border-left:2px solid var(--s-line2)}
#stockInventory .stk2-main .tbl th.col-bg{background:var(--s-bg-head)!important;color:var(--s-bg)!important;
  text-align:center}
#stockInventory .stk2-main .tbl th.col-ct{background:var(--s-ct-head)!important;color:var(--s-ct)!important;
  text-align:center}
#stockInventory .stk2-main .tbl th.col-md{background:var(--s-md-head)!important;color:var(--s-md)!important;
  text-align:center}
/* (1,4,3), matching the table's own hover above and winning on order. */
#stockInventory .stk2-main .tbl tbody tr:hover > td.col-ls{background:var(--s-ls-head)!important}
#stockInventory .stk2-main .tbl tbody tr:hover > td.col-bg{background:var(--s-bg-head)!important}
#stockInventory .stk2-main .tbl tbody tr:hover > td.col-ct{background:var(--s-ct-head)!important}
#stockInventory .stk2-main .tbl tbody tr:hover > td.col-md{background:var(--s-md-head)!important}
/* (1,5,3), above the four rules just above: a multi-pack or ticked row is a whole-row flag,
   so hovering one has to stay one band of colour. style.css sets these same two colours at
   (1,4,3) — enough to beat the plain tints, not enough to beat the hover tints. */
#stockInventory .stk2-main .tbl tbody tr.data-row.stk-multipack:hover > td{background:#FFEDD5!important}
#stockInventory .stk2-main .tbl tbody tr.data-row.stk-ticked:hover > td{background:#DCFCE7!important}

#stockInventory .stk-pill{display:inline-flex;align-items:center;gap:5px;height:25px;padding:0 5px 0 8px;
  border-radius:999px;border:1px solid;font-size:12px;font-weight:700;font-variant-numeric:tabular-nums;
  text-decoration:none;max-width:100%;overflow:hidden;transition:box-shadow .12s,transform .12s}
#stockInventory .stk-pill.bare{padding-right:8px}
#stockInventory .stk-pill .stk-pill-n{display:inline-flex;align-items:center;justify-content:center;
  min-width:18px;height:17px;padding:0 5px;border-radius:999px;font-size:10px;font-weight:700;color:#fff}
#stockInventory .stk-pill.is-link{cursor:pointer}
#stockInventory .stk-pill.is-link:hover{box-shadow:0 2px 9px rgba(29,24,38,.16);transform:translateY(-1px)}
#stockInventory .stk-pill-ls{background:var(--s-ls-wash);border-color:var(--s-ls-line);color:var(--s-ls)}
#stockInventory .stk-pill-ls .stk-pill-n{background:var(--s-ls)}
#stockInventory .stk-pill-bg{background:var(--s-bg-wash);border-color:var(--s-bg-line);color:var(--s-bg)}
#stockInventory .stk-pill-bg .stk-pill-n{background:var(--s-bg)}
#stockInventory .stk-pill-ct{background:var(--s-ct-wash);border-color:var(--s-ct-line);color:var(--s-ct)}
#stockInventory .stk-pill-ct .stk-pill-n{background:var(--s-ct)}
#stockInventory .stk-pill-md{background:var(--s-md-wash);border-color:var(--s-md-line);color:var(--s-md)}
#stockInventory .stk-pill-md .stk-pill-n{background:var(--s-md)}
#stockInventory .bal-empty{color:var(--s-ghost);font-weight:600}
/* Supplier order behind the balance (Balance Goods → Upload supplier invoice), under the pill. */
#stockInventory .bal-ord{display:block;margin-top:2px;font-size:10.5px;line-height:1.25;color:var(--s-ghost);font-weight:600;white-space:normal;max-width:130px}

/* ── EAN sub-row ────────────────────────────────────────────────────────── */
#stockInventory .ean-subrow > td{background:#FBFAFD;padding-top:7px;padding-bottom:7px;font-size:12px}
#stockInventory .ean-subrow .sub-ean{color:var(--s-mut);font-variant-numeric:tabular-nums;
  padding-left:22px;position:relative;font-size:11.5px}
#stockInventory .ean-subrow td.item-col,#stockInventory .ean-subrow td.ean-col{font-size:11.5px}
#stockInventory .ean-subrow .sub-ean::before{content:"";position:absolute;left:8px;top:6px;width:7px;height:7px;
  border-left:1px solid var(--s-ghost);border-bottom:1px solid var(--s-ghost)}
#stockInventory .ean-tag{display:inline-flex;align-items:center;height:16px;padding:0 6px;border-radius:999px;
  font-size:9.5px;font-weight:700;margin-right:6px}
#stockInventory .ean-tag-p{background:var(--s-acc-wash);color:var(--s-acc-deep)}
#stockInventory .ean-tag-a{background:var(--s-line3);color:#6B6479}
#stockInventory .ean-sup{font-size:11px;font-weight:600;color:var(--s-acc-deep)}
#stockInventory .ean-none{font-size:11px;font-style:italic;color:#6B6479}
/* ── the "no barcode" remainder row ─────────────────────────────────────────
   Stock recorded against the product without saying which barcode. It is shown so the sub-rows
   add up to System, and tinted like a warning rather than an error: the figure is correct, it
   just cannot be placed on a barcode. */
#stockInventory .ean-tag-u{background:var(--s-warn-wash);color:var(--s-warn-ink)}
/* !important IS LOAD-BEARING, and was missing on the first attempt: style.css pins every
   .ean-subrow td background with !important (style.css ~:1021) and stockViolet answers it with
   another !important further down this file. Against two !importants a plain declaration loses no
   matter how specific it is, so the row rendered white. With !important on both sides, specificity
   settles it: this selector is (1,1,2) and `.ean-subrow > td` is (1,1,1), so this one wins.
   Measured in Chrome, not reasoned about — the first version read rgb(255,255,255). */
#stockInventory tr.ean-subrow.stk-unattr > td{background:#FEFBF4!important}
#stockInventory .stk2-empty{text-align:center;color:var(--s-faint);padding:34px 10px;font-size:13px}

/* ── what style.css pins with !important ────────────────────────────────────
   The same fault as the four column tints, in the rest of the screen. style.css
   dresses this tab in the old blue theme and marks the colours !important, so every
   violet equivalent in this sheet lost silently however correct it was:

     :898  .btn-refresh        linear-gradient(#3b82f6,#1d4ed8) + a blue shadow
     :941  .stk2-search        slate border, #1e293b ink, 8px radius
     :942  .stk2-sel           the same, at 11px
     :943  .stk2-btn-sm        slate border, #475569 ink
     :949  .stk2-bulk button   #1d4ed8 on #eff6ff
     :1016 .log-btn            #2563EB
     :1018 .action-btn         #94a3b8
     :1021 .ean-subrow td      #f8fafc

   The honest fix is to delete those declarations, and it is not the safe one: they
   are shared with the Activity log, the Reconciliations table and the Import/Export
   modal, none of which have been repainted. So they stay, and the redesign re-asserts
   itself over them here — property for property, only where style.css actually pins
   something. Nothing new is said in this block; it is the sheet above, said louder. */
#stockInventory .btn-refresh{background:var(--s-acc)!important;color:#fff!important;
  box-shadow:none!important;font-size:13px!important}
#stockInventory .btn-refresh:hover{background:var(--s-acc-deep)!important}
#stockInventory .stk2-search,#stockInventory .stk2-sel{border:1px solid var(--s-line2)!important;
  border-radius:10px!important;background:var(--s-paper)!important;color:var(--s-ink)!important;
  font-size:13px!important;padding:0 12px!important;box-shadow:none!important}
#stockInventory .stk2-search:focus,#stockInventory .stk2-sel:focus{
  border-color:var(--s-acc-line)!important}
#stockInventory .stk2-btn-sm{border:1px solid var(--s-line2)!important;border-radius:10px!important;
  background:var(--s-paper)!important;color:var(--s-ink)!important;font-size:13px!important;
  padding:0 14px!important;box-shadow:none!important}
#stockInventory .stk2-btn-sm:hover{background:var(--s-paper)!important;color:var(--s-acc-deep)!important;
  border-color:var(--s-acc-line)!important}
#stockInventory #stkResetAllBtn{color:var(--s-bad)!important}
#stockInventory #stkResetAllBtn:hover{color:var(--s-bad)!important;border-color:var(--s-bad-line)!important}
#stockInventory .stk2-bulk button,#stockInventory .stk2-bulk .stk2-upload{
  background:var(--s-paper)!important;border:1px solid var(--s-acc-line)!important;
  color:var(--s-acc-deep)!important;border-radius:9px!important;font-size:12.5px!important;
  box-shadow:none!important}
#stockInventory .stk2-bulk button:hover,#stockInventory .stk2-bulk .stk2-upload:hover{
  background:var(--s-acc-wash)!important}
#stockInventory .log-btn{color:var(--s-acc)!important;background:none!important;border:0!important;
  padding:0!important;font-size:12px!important;box-shadow:none!important}
#stockInventory .log-btn:hover{color:var(--s-acc-deep)!important}
#stockInventory .action-btn{color:var(--s-faint)!important;background:none!important;
  border:1px solid transparent!important;padding:0!important;box-shadow:none!important}
#stockInventory .action-btn:hover{color:var(--s-acc)!important;background:var(--s-paper)!important;
  border-color:#E2DEEA!important}
#stockInventory .ean-subrow > td{background:#FBFAFD!important;padding:7px 10px!important;
  border-bottom:1px solid var(--s-line3)!important}

/* ── activity log tab (moved here from the section's inline <style>) ────── */
#stockInventory #stkLog .log-badge{color:#4A4458;background:var(--s-line3)}
/* the mobile card's MSD chip — the card layout is unchanged, only its ink */
#stockInventory .stk-chip-msd{background:var(--s-md-wash);color:var(--s-md);border-color:var(--s-md-line)}

#stockInventory .stk-h2{font-family:var(--s-display);font-size:15px;font-weight:600;margin:26px 0 12px;color:var(--s-ink)}

/* ── the two ledgers, written down ──────────────────────────────────────────
   Nowhere in the old page did it say what moves which number, which is why Diff read as
   noise. It is the one line that makes the column mean something. */
#stockInventory .stk-ledgers{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:14px;margin-top:22px}
#stockInventory .stk-led{padding:14px 16px;border:1px solid var(--s-line);border-radius:12px;background:var(--s-paper)}
#stockInventory .stk-led h4{margin:0 0 4px;font-size:12.5px;font-weight:700;font-family:var(--s-display);color:var(--s-ink)}
#stockInventory .stk-led p{margin:0;font-size:11.5px;line-height:1.5;color:var(--s-mut)}

/* ── the four columns, explained ────────────────────────────────────────── */
#stockInventory .stk2-tip{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:14px;
  margin-top:22px;background:none;border:0;padding:0}
#stockInventory .stk-leg{display:flex;gap:11px;align-items:flex-start;padding:14px 15px;
  border-radius:12px;border:1px solid}
#stockInventory .stk-leg h4{margin:0 0 3px;font-size:12.5px;font-weight:700;font-family:var(--s-display)}
#stockInventory .stk-leg p{margin:0;font-size:11.5px;line-height:1.45;color:var(--s-mut)}
#stockInventory .stk-leg svg{flex:none;margin-top:1px}
#stockInventory .stk-leg-ls{background:var(--s-ls-col);border-color:var(--s-ls-line)}
#stockInventory .stk-leg-ls h4{color:var(--s-ls)}
#stockInventory .stk-leg-bg{background:var(--s-bg-col);border-color:var(--s-bg-line)}
#stockInventory .stk-leg-bg h4{color:var(--s-bg)}
#stockInventory .stk-leg-ct{background:var(--s-ct-col);border-color:var(--s-ct-line)}
#stockInventory .stk-leg-ct h4{color:var(--s-ct)}
#stockInventory .stk-leg-md{background:var(--s-md-col);border-color:var(--s-md-line)}
#stockInventory .stk-leg-md h4{color:var(--s-md)}
#stockInventory .stk-foot-note{font-size:12px;color:var(--s-faint);margin:12px 0 0;max-width:980px;line-height:1.5}

/* ── narrow ─────────────────────────────────────────────────────────────── */
@media (max-width:1180px){
  #stockInventory .stk2-stats{grid-template-columns:repeat(2,minmax(0,1fr))}
  #stockInventory .stat-card{border-bottom:1px solid var(--s-line)}
  #stockInventory .stk-ledgers,#stockInventory .stk2-tip{grid-template-columns:1fr}
}

/* ── "you searched an ASIN" note ─────────────────────────────────────────────
   Sits above the table and answers the question someone arriving from Offer Radar actually has:
   which of our products is this ASIN, and what else lives under the same master product. */
#stockInventory .stk-asin-note{background:var(--s-sunk);border:1px solid var(--s-line3);
  border-radius:10px;padding:10px 14px;margin-bottom:10px;font-size:12.5px;line-height:1.55;color:var(--s-ink)}
#stockInventory .stk-asin-note b{font-weight:700}
#stockInventory .stk-asin-src{color:var(--s-faint);font-size:11.5px}
#stockInventory .stk-asin-miss{background:var(--s-warn-wash);border-color:transparent;color:var(--s-warn)}
#stockInventory .stk-asin-all{margin-left:6px;border:1px solid var(--s-line2);background:var(--s-paper);
  color:var(--s-ink);border-radius:999px;padding:3px 11px;font:600 11.5px/1 inherit;cursor:pointer}
#stockInventory .stk-asin-all:hover{background:var(--s-sunk)}

/* ── WAREHOUSE SITE CARD ──────────────────────────────────────────────────────────────────
   Which building the Warehouse figure is standing in. positionMenu moves this onto <body> so
   nothing clips it, which puts it OUTSIDE #stockInventory and out of reach of the --s-* tokens
   declared there. The values below are those same tokens written out, not a second palette —
   change one here and change it there. (The sibling Containers/Local Shipments popovers do the
   same thing for the same reason.)

   The figure itself gets a dotted underline and a help cursor: without one, a card that only
   appears on hover is a feature nobody finds. */
/* The underline is the only sign the card exists, and 600 permanently underlined figures
   would be noise in a column people mostly read straight down. It appears on the row the
   cursor is already on — which is exactly when it is about to be useful — and darkens on the
   figure itself. The mobile cards show it outright: a touch screen has no hover to reveal it. */
#stockInventory .whs-hot{border-bottom:1px dashed transparent;cursor:help;
  transition:border-color .12s}
#stockInventory tr:hover .whs-hot,#stockInventory .rk-field .whs-hot{border-bottom-color:#CFCAD8}
#stockInventory .whs-hot:hover{border-bottom-color:#5E48B8}
.whs-pop{position:absolute;z-index:200;display:none;min-width:234px;max-width:310px;
  background:#FFFFFF;border:1px solid #E9E7EE;border-radius:14px;padding:13px 14px 11px;
  box-shadow:0 16px 40px rgba(29,24,38,.14);color:#1D1826;
  font-family:'Instrument Sans',system-ui,-apple-system,'Segoe UI',sans-serif}
.whs-pop.open{display:block}
.whs-pop::before{content:'';position:absolute;top:-6px;left:20px;width:10px;height:10px;
  background:#FFFFFF;border-left:1px solid #E9E7EE;border-top:1px solid #E9E7EE;
  transform:rotate(45deg);border-radius:2px 0 0 0}
.whs-pop .whs-eyebrow{margin:0;font-size:9.5px;font-weight:800;letter-spacing:.09em;
  text-transform:uppercase;color:#948DA3}
.whs-pop .whs-title{margin-top:3px;font-size:12.5px;font-weight:700;line-height:1.3;color:#1D1826}
.whs-pop .whs-list{margin-top:10px}
.whs-pop .whs-row{display:grid;grid-template-columns:1fr 48px auto;align-items:center;
  gap:10px;padding:5px 0}
.whs-pop .whs-name{font-size:12px;font-weight:600;color:#1D1826;display:flex;
  align-items:center;gap:6px;min-width:0}
.whs-pop .whs-bar{height:5px;border-radius:99px;background:#F1EFF5;overflow:hidden}
.whs-pop .whs-bar i{display:block;height:100%;border-radius:99px;background:#5E48B8}
.whs-pop .whs-q{font-size:12.5px;font-weight:700;font-variant-numeric:tabular-nums;
  text-align:right;color:#1D1826}
/* A site holding nothing still gets a row — that is the answer to "how many in Juyi" — but it
   recedes, so the eye lands on the building that actually has the stock. */
.whs-pop .whs-row.is-zero .whs-name,.whs-pop .whs-row.is-zero .whs-q{color:#948DA3}
.whs-pop .whs-row.is-zero .whs-bar i{background:#DAD7E2}
.whs-pop .whs-row.is-unknown .whs-bar i{background:#B45309}
.whs-pop .whs-flag{flex:none;font-size:9px;font-weight:800;text-transform:uppercase;
  letter-spacing:.04em;padding:1.5px 5px;border-radius:99px;background:#FBF3E4;color:#8A4A08}
.whs-pop .whs-tot{margin-top:9px;padding-top:9px;border-top:1px solid #E9E7EE;
  display:flex;align-items:baseline;justify-content:space-between}
.whs-pop .whs-tot-l{font-size:11.5px;font-weight:700;color:#5F5970}
.whs-pop .whs-tot-v{font-size:14px;font-weight:800;font-variant-numeric:tabular-nums;color:#49389A}
.whs-pop .whs-unit{font-size:10px;font-weight:700;color:#948DA3;margin-left:4px}


/* ── Edit inventory: counting stock straight onto the barcode rows ──────────────────────
   The System cell becomes a number box. A box that differs from what the row was showing is
   tinted and carries its own +N / -N, so a column of counted barcodes shows at a glance which
   ones moved and by how much. The save bar is fixed to the bottom of the window, clear of the
   phone's home indicator, and only exists while the mode is on. */
#stockInventory .stk-count-wrap{display:inline-flex;flex-direction:column;align-items:flex-end;gap:2px}
#stockInventory .stk-count-in{width:88px;padding:4px 7px;text-align:right;font-family:inherit;
  font-size:12.5px;font-weight:700;font-variant-numeric:tabular-nums;color:#2B2440;
  background:#fff;border:1px solid #D9D5E4;border-radius:6px}
#stockInventory .stk-count-in:focus{outline:2px solid #6D5BD0;outline-offset:-1px;border-color:#6D5BD0}
#stockInventory .stk-count-in.changed{background:#FFFBEB;border-color:#D9A441}
#stockInventory .stk-count-d{font-size:10px;font-weight:700;font-variant-numeric:tabular-nums;line-height:1}
#stockInventory .stk-count-d.up{color:#1F7A52}
#stockInventory .stk-count-d.down{color:#B3322A}
#stockInventory .stk-count-note{display:block;font-size:9.5px;color:#948DA3;line-height:1.3;max-width:132px;text-align:right}
#stockInventory tr.stk-counting > td{background:#FFFBEB !important}
/* style.css:943 declares .stk2-btn-sm's background, border and colour with !important, so a
   variant of it has to answer in kind or it renders as a plain button — which is how the active
   toggle and the Save button first came out looking identical to Cancel. */
#stockInventory .stk2-btn-sm.on{background:#6D5BD0!important;border-color:#6D5BD0!important;color:#fff!important}

.stk-countbar{position:fixed;left:0;right:0;bottom:0;z-index:60;background:#fff;
  border-top:1px solid #E3E0EC;box-shadow:0 -6px 20px rgba(32,24,64,.12);
  padding:11px max(14px,env(safe-area-inset-right,0px)) calc(11px + env(safe-area-inset-bottom,0px)) max(14px,env(safe-area-inset-left,0px))}
.stk-countbar-in{max-width:1600px;margin:0 auto;display:flex;flex-wrap:wrap;gap:9px 14px;align-items:center}
.stk-countbar-sum{flex:1 1 240px;min-width:0;font-size:12.5px;color:#5F5970}
.stk-countbar-sum b{color:#2B2440}
.stk-countbar .stk2-btn-sm.primary{background:#6D5BD0!important;border-color:#6D5BD0!important;color:#fff!important}
.stk-countbar .stk2-btn-sm:disabled{opacity:.45;cursor:not-allowed}
@media (prefers-color-scheme:dark){
  html:not([data-theme="light"]) .stk-countbar{background:#1B1726;border-top-color:#322C45}
  html:not([data-theme="light"]) .stk-countbar-sum{color:#B6AEC9}
  html:not([data-theme="light"]) .stk-countbar-sum b{color:#EDE9F6}
  html:not([data-theme="light"]) #stockInventory .stk-count-in{background:#231E33;border-color:#3A3350;color:#EDE9F6}
  html:not([data-theme="light"]) #stockInventory .stk-count-in.changed{background:#2E2718;border-color:#A07A2B}
  html:not([data-theme="light"]) #stockInventory tr.stk-counting > td{background:#2A2418 !important}
}
html[data-theme="dark"] .stk-countbar{background:#1B1726;border-top-color:#322C45}
html[data-theme="dark"] .stk-countbar-sum{color:#B6AEC9}
html[data-theme="dark"] .stk-countbar-sum b{color:#EDE9F6}
html[data-theme="dark"] #stockInventory .stk-count-in{background:#231E33;border-color:#3A3350;color:#EDE9F6}
html[data-theme="dark"] #stockInventory .stk-count-in.changed{background:#2E2718;border-color:#A07A2B}
html[data-theme="dark"] #stockInventory tr.stk-counting > td{background:#2A2418 !important}
