:root {
  --bg: #f4f6f8; --card: #fff; --ink: #101828; --soft: #5d6b7e; --faint: #8a96a6; --line: #e3e8ee; --line2: #cfd7e1;
  --go: #0f6e56; --go-dark: #0b5a46; --go-tint: #e8f4ef; --warn: #b54708; --warn-tint: #fff4e5; --bad: #b42318; --bad-tint: #fdecea;
  --side: #0f1c2b; --side-ink: #c9d3df; --radius: 12px; --shadow: 0 1px 2px rgba(16, 24, 40, .06), 0 1px 3px rgba(16, 24, 40, .05);
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 15px/1.5 "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, "SF Pro Text", Roboto, sans-serif; -webkit-font-smoothing: antialiased; }
main { max-width: 1040px; margin: 0 auto; padding: 72px 16px 108px; }
h1 { font-size: 1.55rem; line-height: 1.25; letter-spacing: -.015em; font-weight: 650; margin: 2px 0 16px; }
h2 { font-size: .78rem; text-transform: uppercase; letter-spacing: .07em; color: var(--soft); font-weight: 650; margin: 28px 0 10px; }
a { color: var(--go); }
svg.i { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; }

/* App frame: top bar + bottom tabs on phones, sidebar on PC */
.topbar { position: fixed; z-index: 6; top: 0; left: 0; right: 0; height: 56px; padding: 0 8px 0 16px; padding-top: env(safe-area-inset-top); display: flex; align-items: center; justify-content: space-between; background: var(--side); color: #fff; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 1.05rem; letter-spacing: -.01em; color: #fff; text-decoration: none; }
.brand .mark { width: 30px; height: 30px; border-radius: 8px; overflow: hidden; display: block; flex: none; }
.brand .mark img { width: 100%; height: 100%; display: block; }
.brand .mark svg { width: 17px; height: 17px; stroke-width: 2.2; }
.topbar .iconbtn { color: var(--side-ink); width: 44px; height: 44px; display: grid; place-items: center; border-radius: 10px; }
nav { position: fixed; z-index: 5; bottom: 0; left: 0; right: 0; display: flex; background: var(--card); border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom); box-shadow: 0 -2px 10px rgba(16, 24, 40, .04); }
nav .brand, nav .foot, nav .sep, nav .desk { display: none; }
nav a { flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 9px 2px 8px; text-decoration: none; color: var(--faint); font-size: .7rem; font-weight: 600; }
nav a span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
nav a.on { color: var(--go); }
nav a .badge { position: absolute; }
@media (min-width: 900px) {
  .topbar { display: none; }
  nav { top: 0; right: auto; width: 236px; flex-direction: column; padding: 18px 12px; background: var(--side); border: 0; box-shadow: none; gap: 2px; }
  nav .brand { display: flex; padding: 4px 10px 22px; }
  nav .sep { display: block; flex: 1; }
  nav a.desk { display: flex; }
  nav .foot { display: block; padding: 12px 10px 2px; margin-top: 8px; border-top: 1px solid rgba(255, 255, 255, .08); color: #8d9aab; font-size: .8rem; }
  nav a { flex: 0 0 auto; flex-direction: row; gap: 12px; padding: 10px 12px; border-radius: 9px; color: var(--side-ink); font-size: .92rem; font-weight: 550; }
  nav a:hover { background: rgba(255, 255, 255, .06); color: #fff; }
  nav a.on { background: rgba(255, 255, 255, .1); color: #fff; box-shadow: inset 3px 0 #3ccf9c; }
  main { margin-left: 236px; max-width: none; padding: 32px 40px 48px; }
  main > * { max-width: 1040px; }
  #toast { left: 236px; }
}

/* Building blocks */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; margin: 0 0 12px; box-shadow: var(--shadow); }
.code { font-family: "Cascadia Mono", ui-monospace, "SF Mono", Consolas, monospace; font-weight: 600; letter-spacing: .01em; font-size: .92em; }
p.code { color: var(--soft); margin: 0 0 2px; }
.soft { color: var(--soft); }
.small { font-size: .86rem; }
.page-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 8px 16px; margin-bottom: 16px; }
.page-head h1 { margin: 0; }
.kpis { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); margin-bottom: 8px; }
.kpi { display: block; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; text-decoration: none; color: inherit; box-shadow: var(--shadow); }
.kpi small { display: block; color: var(--soft); font-size: .78rem; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; }
.kpi b { display: block; font-size: 1.7rem; font-weight: 650; letter-spacing: -.02em; font-variant-numeric: tabular-nums; margin-top: 2px; }
.kpi.accent { border-color: #b7e0cf; background: linear-gradient(180deg, #fff, var(--go-tint)); }
.grid { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
.tile { display: flex; align-items: center; justify-content: space-between; gap: 8px; background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; text-decoration: none; color: inherit; box-shadow: var(--shadow); font-weight: 550; }
.tile b { font-size: 1.15rem; font-variant-numeric: tabular-nums; order: 2; }
.tile:hover, .kpi:hover { border-color: var(--line2); }
.list { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.list > * { display: flex; gap: 12px; align-items: center; justify-content: space-between; padding: 12px 16px; border-top: 1px solid var(--line); text-decoration: none; color: inherit; }
.list > :first-child { border-top: 0; }
.list > a:hover { background: #f9fafb; }
.list .r { text-align: right; flex-shrink: 0; }
button, .btn { font: inherit; font-weight: 600; font-size: .95rem; min-height: 44px; padding: 9px 16px; border-radius: 9px; border: 1px solid var(--line2); background: var(--card); color: var(--ink); cursor: pointer; text-decoration: none; display: inline-flex; align-items: center; justify-content: center; gap: 8px; box-shadow: 0 1px 2px rgba(16, 24, 40, .05); transition: background .12s, border-color .12s; }
button:hover, .btn:hover { background: #f9fafb; }
button.go, .btn.go { background: var(--go); border-color: var(--go); color: #fff; }
button.go:hover, .btn.go:hover { background: var(--go-dark); }
button.big, .btn.big { width: 100%; min-height: 54px; font-size: 1.05rem; }
button:disabled { opacity: .55; cursor: default; }
button.sel { border-color: var(--go); color: var(--go); background: var(--go-tint); }
:focus-visible { outline: 3px solid #7cc8ad; outline-offset: 2px; }
.row { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0; }
.row > button, .row > .btn { flex: 1 1 auto; }
input, select, textarea { font: inherit; width: 100%; min-height: 44px; padding: 9px 12px; border: 1px solid var(--line2); border-radius: 9px; background: #fff; color: var(--ink); box-shadow: 0 1px 2px rgba(16, 24, 40, .04); }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--go); box-shadow: 0 0 0 3px rgba(15, 110, 86, .15); }
input[type=checkbox] { width: 20px; min-height: 20px; }
label { display: block; font-weight: 600; font-size: .85rem; color: #344054; margin-top: 12px; }
label > input, label > select, label > textarea { margin-top: 5px; font-weight: 400; font-size: .95rem; }
form .cols, .cols { display: grid; gap: 0 14px; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); }
form > button, form .row { margin-top: 16px; }
.pill { display: inline-block; padding: 1px 9px; border-radius: 99px; background: #eef1f5; color: #3d4a5c; font-size: .78rem; font-weight: 600; line-height: 1.6; }
.pill.pass { background: #dcf3e8; color: #05603a; }
.pill.fail { background: var(--bad-tint); color: var(--bad); }
.pill.untested { background: var(--warn-tint); color: #93370d; }
.photos { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); }
.photos figure { margin: 0; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.photos img { width: 100%; aspect-ratio: 1; object-fit: cover; display: block; background: #eef1f5; }
.photos .row { margin: 8px; gap: 6px; }
.photos button { min-height: 36px; padding: 4px 8px; font-size: .8rem; }
.sticky { position: sticky; top: 56px; z-index: 4; background: var(--side); color: #fff; margin: -16px -16px 16px; padding: 12px 16px; }
video { width: 100%; max-height: 50vh; border-radius: var(--radius); background: #000; object-fit: cover; }
#toast { position: fixed; z-index: 9; left: 12px; right: 12px; bottom: 86px; max-width: 520px; margin: auto; background: #101828; color: #fff; border-radius: 10px; padding: 13px 16px; box-shadow: 0 10px 30px rgba(16, 24, 40, .25); opacity: 0; transform: translateY(6px); pointer-events: none; transition: opacity .15s, transform .15s; }
#toast.show { opacity: 1; transform: none; }
#toast.bad { background: var(--bad); }
.hint { border: 1px solid #b7e0cf; background: var(--go-tint); color: #064e3b; padding: 10px 14px; border-radius: 10px; }
.hint.warn { border-color: #fedf89; background: var(--warn-tint); color: #7a2e0e; }
.hint.bad { border-color: #f5c2bd; background: var(--bad-tint); color: #7a1610; }
.status { display: flex; align-items: center; gap: 10px; }
.dot { width: 10px; height: 10px; border-radius: 50%; background: #12b76a; box-shadow: 0 0 0 4px #dcf3e8; flex-shrink: 0; }
.dot.warn { background: #f79009; box-shadow: 0 0 0 4px var(--warn-tint); }
.login { max-width: 400px; margin: 6vh auto 0; }
.login .brand { color: var(--ink); justify-content: center; font-size: 1.3rem; margin-bottom: 22px; }
.login h1 { text-align: center; font-size: 1.25rem; }
.drop { display: block; text-align: center; padding: 44px 16px; border: 2px dashed var(--line2); border-radius: var(--radius); background: var(--card); cursor: pointer; font-size: 1.02rem; font-weight: 600; color: #344054; }
.drop.over { border-color: var(--go); background: var(--go-tint); }
.scroll { overflow-x: auto; border: 1px solid var(--line); border-radius: 10px; background: var(--card); }
table { border-collapse: collapse; font-size: .84rem; width: 100%; }
th { background: #f9fafb; color: var(--soft); font-weight: 600; }
th, td { text-align: left; padding: 8px 12px; border-bottom: 1px solid var(--line); min-width: 80px; max-width: 260px; }
tr:last-child td { border-bottom: 0; }

/* labels (print sizes stay exact) */
.labels { display: flex; flex-wrap: wrap; gap: 10px; }
.label { background: #fff; color: #000; display: flex; align-items: center; gap: .06in; overflow: hidden; outline: 1px dashed #aaa; padding: .06in; font-family: Arial, Helvetica, sans-serif; }
.label img { height: 100%; aspect-ratio: 1; flex-shrink: 0; }
.label div { min-width: 0; line-height: 1.15; }
.label b { display: block; font-family: ui-monospace, Consolas, monospace; white-space: nowrap; }
.label span { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; }
.s2x1 .label { width: 2in; height: 1in; font-size: 8pt; } .s2x1 b { font-size: 10pt; } .s2x1 img { height: .72in; }
.s4x2 .label { width: 4in; height: 2in; font-size: 13pt; } .s4x2 b { font-size: 19pt; } .s4x2 img { height: 1.6in; }
.s4x6 .label { width: 4in; height: 6in; font-size: 20pt; flex-direction: column; justify-content: center; text-align: center; } .s4x6 b { font-size: 30pt; } .s4x6 img { height: 3.3in; }
.s5160 .label { width: 2.625in; height: 1in; font-size: 8pt; } .s5160 b { font-size: 11pt; } .s5160 img { height: .84in; }
@media (min-width: 900px) { .sticky { top: 0; margin: -32px -40px 18px; padding: 14px 40px; } #toast { bottom: 24px; } }
@media print {
  body { background: #fff; } nav, .topbar, #toast, .noprint { display: none !important; }
  main { margin: 0; padding: 0; max-width: none; } main > * { max-width: none; } .label { outline: 0; break-inside: avoid; }
  .labels { gap: 0; } .s2x1, .s4x2, .s4x6 { display: block; }
  .s2x1 .label, .s4x2 .label, .s4x6 .label { break-after: page; } .labels .label:last-child { break-after: auto; }
  .s5160 { column-gap: .125in; width: 8.125in; }
}

/* Team page */
.perms { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 4px 16px; margin: 10px 0 4px; }
label.check { display: flex; align-items: center; gap: 8px; font-weight: 400; margin: 0; padding: 6px 0; cursor: pointer; }
label.check input { width: 20px; height: 20px; margin: 0; flex: none; accent-color: var(--go); }
button.danger { color: var(--bad); }
.topbar .row .iconbtn { display: inline-flex; }

/* Photo-first stock lists */
.sec { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 28px 0 10px; }
.sec h2 { margin: 0; }
.count { display: inline-block; min-width: 22px; padding: 0 7px; margin-left: 4px; border-radius: 99px; background: #e6eaf0; color: var(--soft); font-size: .72rem; text-align: center; letter-spacing: 0; }
.seg { display: inline-flex; background: #e9edf2; border-radius: 9px; padding: 3px; gap: 2px; }
.seg button { min-height: 32px; width: 36px; padding: 0; border: 0; background: transparent; box-shadow: none; color: var(--soft); border-radius: 7px; }
.seg button.on { background: var(--card); color: var(--ink); box-shadow: 0 1px 2px rgba(16, 24, 40, .12); }
.seg svg.i { width: 17px; height: 17px; }
a.link { color: var(--go); font-weight: 600; text-decoration: none; }
.empty { color: var(--soft); background: var(--card); border: 1px dashed var(--line2); border-radius: var(--radius); padding: 22px 16px; text-align: center; margin: 0 0 12px; }
.items { display: grid; gap: 12px; }
.items.grid { grid-template-columns: repeat(auto-fill, minmax(158px, 1fr)); }
.it { position: relative; display: flex; flex-direction: column; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; text-decoration: none; color: inherit; box-shadow: var(--shadow); transition: border-color .12s, box-shadow .12s, transform .12s; }
.it:hover { border-color: var(--line2); box-shadow: 0 6px 16px rgba(16, 24, 40, .08); transform: translateY(-1px); }
.it .ph { position: relative; display: block; aspect-ratio: 1; background: #eef1f5; }
.it .ph img { width: 100%; height: 100%; object-fit: cover; display: block; }
.noimg { width: 100%; height: 100%; display: grid; place-items: center; color: #b3bdc9; }
.noimg svg.i { width: 34px; height: 34px; stroke-width: 1.4; }
.it .qty { position: absolute; right: 8px; top: 8px; background: rgba(16, 28, 43, .82); color: #fff; font-size: .75rem; font-weight: 700; padding: 2px 8px; border-radius: 99px; }
.it .tx { display: flex; flex-direction: column; gap: 1px; padding: 10px 12px 4px; min-width: 0; }
.it .nm { font-weight: 600; line-height: 1.3; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; }
.it .code { color: var(--soft); font-size: .78rem; }
.it .loc, p.loc { display: flex; align-items: center; gap: 4px; color: var(--soft); font-size: .8rem; min-width: 0; }
.it .loc { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.loc svg.i { width: 14px; height: 14px; }
p.loc { font-size: .95rem; color: var(--ink); gap: 6px; } p.loc svg.i { width: 17px; height: 17px; color: var(--go); }
.it .meta { padding: 4px 12px 12px; margin-top: auto; }
.items.list { gap: 0; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.items.list .it { flex-direction: row; align-items: center; gap: 12px; border: 0; border-top: 1px solid var(--line); border-radius: 0; box-shadow: none; padding: 10px 14px; transform: none; }
.items.list .it:first-child { border-top: 0; }
.items.list .it:hover { background: #f9fafb; }
.items.list .ph { width: 52px; height: 52px; flex: none; border-radius: 8px; overflow: hidden; }
.items.list .qty { top: auto; bottom: 3px; right: 3px; font-size: .65rem; padding: 0 5px; }
.items.list .noimg svg.i { width: 22px; height: 22px; }
.items.list .tx { flex: 1; padding: 0; }
.items.list .nm { -webkit-line-clamp: 1; }
.items.list .meta { padding: 0; margin: 0; flex: none; }

/* Places as folders */
.folders { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); }
.folder { display: flex; align-items: center; gap: 12px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px; text-decoration: none; color: inherit; box-shadow: var(--shadow); min-width: 0; transition: border-color .12s, box-shadow .12s; }
.folder:hover { border-color: var(--line2); box-shadow: 0 6px 16px rgba(16, 24, 40, .07); }
.fi { width: 42px; height: 42px; flex: none; border-radius: 10px; display: grid; place-items: center; background: var(--go-tint); color: var(--go); }
.fi.shelf { background: #eaf0fb; color: #2f5ea8; } .fi.bin { background: #fdf1e6; color: #b45309; } .fi.pallet { background: #f3ecfb; color: #6d3fb0; } .fi.floor { background: #eef1f5; color: #475467; }
.fi.big { width: 40px; height: 40px; display: inline-grid; vertical-align: middle; margin-right: 12px; }
.ft { display: flex; flex-direction: column; min-width: 0; }
.ft b { font-weight: 650; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ft small { color: var(--soft); font-size: .8rem; }
.crumbs { color: var(--soft); margin: 0 0 10px; }
.crumbs a { color: var(--soft); text-decoration: none; } .crumbs a:hover { color: var(--go); }

/* Item page: photos first */
.hero { display: grid; gap: 16px; margin-bottom: 8px; }
.hero .info { margin: 0; }
.hero .info h1 { margin: 4px 0 10px; }
.gallery .big { width: 100%; aspect-ratio: 4 / 3; object-fit: contain; display: block; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.gallery .big.empty { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; color: #9aa6b4; background: #eef1f5; aspect-ratio: 16 / 9; }
.gallery .big.empty svg.i { width: 40px; height: 40px; stroke-width: 1.3; }
.strip { display: flex; gap: 8px; overflow-x: auto; padding: 10px 0 2px; }
.strip .th { flex: none; width: 64px; height: 64px; min-height: 0; padding: 0; border-radius: 9px; overflow: hidden; border: 2px solid transparent; box-shadow: none; }
.strip .th.on { border-color: var(--go); }
.strip img { width: 100%; height: 100%; object-fit: cover; display: block; }
@media (min-width: 900px) {
  .hero { grid-template-columns: minmax(0, 1.15fr) minmax(300px, 1fr); align-items: start; }
  .items.grid { grid-template-columns: repeat(auto-fill, minmax(176px, 1fr)); }
}
/* Sales */
.pos { color: var(--go); } .neg { color: var(--bad); }
.kpi > span.small { display: block; margin-top: 2px; }
button.link { background: none; border: 0; padding: 0; min-height: 0; color: var(--go); font: inherit; text-decoration: underline; cursor: pointer; box-shadow: none; }
.list.sales > div { align-items: flex-start; }
.list.sales .grow { flex: 1; min-width: 0; }
.list.sales .grow a { color: inherit; text-decoration: none; }
.list.sales .ph.sm { width: 44px; height: 44px; flex: none; border-radius: 8px; overflow: hidden; background: #f2f4f7; display: grid; place-items: center; }
.list.sales .ph.sm img { width: 100%; height: 100%; object-fit: cover; }
.list.sales .ph.sm svg.i { width: 20px; height: 20px; }
.pay { display: inline-block; vertical-align: middle; width: 90px; height: 6px; border-radius: 3px; background: #eaecf0; overflow: hidden; }
.pay i { display: block; height: 100%; background: var(--go); }
p .pay { width: min(100%, 360px); height: 10px; border-radius: 5px; }
label.inline { display: flex; align-items: center; gap: 6px; margin: 0; }
label.inline input { width: auto; }
.feerow { align-items: end; border-top: 1px solid var(--line); padding-top: 10px; margin-top: 10px; }
.feerow > b { align-self: center; }
details > summary { cursor: pointer; font-weight: 600; margin: 10px 0; }
#sellbtn .i { width: 20px; height: 20px; vertical-align: -4px; }
th.r, td.r { text-align: right; white-space: nowrap; }
button.link:hover { background: none; }
