:root { --ink:#1b2a33; --mute:#66757f; --line:#dfe5e9; --bg:#f3f5f7; --card:#fff; --brand:#0f6b4f; --brandSoft:#e4f2ec; --warn:#b4530a; --warnSoft:#fdf0e1; --bad:#b3261e; --badSoft:#fbe9e7; --deal:#7a3fb5; --dealSoft:#f1e9fa; }
* { box-sizing:border-box; -webkit-tap-highlight-color:transparent; }
html, body { margin:0; height:100%; background:var(--bg); color:var(--ink); font:16px/1.35 -apple-system, "Segoe UI", Roboto, sans-serif; }
.hidden { display:none !important; }
input, select, textarea, button { font:inherit; color:inherit; }
input, select, textarea { border:1px solid var(--line); border-radius:10px; padding:10px 12px; background:#fff; min-height:44px; width:100%; }
textarea { min-height:84px; resize:vertical; }
label.f { display:block; font-size:13px; color:var(--mute); margin-bottom:10px; }
label.f > * { margin-top:4px; color:var(--ink); font-size:16px; }
.btn { border:1px solid var(--line); background:#fff; border-radius:10px; padding:9px 14px; min-height:44px; cursor:pointer; }
.btn.primary { background:var(--brand); border-color:var(--brand); color:#fff; font-weight:600; }
.btn.big { width:100%; padding:13px; }
.btn.danger { color:var(--bad); }
.btn:disabled { opacity:.5; }
.err { color:var(--bad); min-height:20px; }


#app { height:100%; display:flex; flex-direction:column; }
.spacer { flex:1; }
.stamp { font-size:12px; color:var(--mute); text-align:right; }
main { flex:1; overflow:auto; -webkit-overflow-scrolling:touch; }

.page { padding:14px; max-width:1300px; margin:auto; }
.card { background:var(--card); border:1px solid var(--line); border-radius:12px; padding:14px; margin-bottom:12px; }
.card h3 { margin:0 0 8px; font-size:15px; }
.grid2 { display:grid; grid-template-columns:1fr 1fr; gap:12px; }
.grid3 { display:grid; grid-template-columns:repeat(3,1fr); gap:12px; }
@media (max-width:760px) { .grid2, .grid3 { grid-template-columns:1fr; } }
.kpis { display:grid; grid-template-columns:repeat(auto-fit,minmax(130px,1fr)); gap:10px; margin-bottom:12px; }
.kpi { background:#fff; border:1px solid var(--line); border-radius:12px; padding:10px 12px; }
.kpi b { display:block; font-size:21px; }
.kpi span { font-size:12px; color:var(--mute); }
.tag { display:inline-block; font-size:12px; padding:2px 8px; border-radius:7px; background:#eef1f3; color:var(--mute); margin-right:4px; white-space:nowrap; }
.tag.ok { background:var(--brandSoft); color:var(--brand); }
.tag.warn { background:var(--warnSoft); color:var(--warn); }
.tag.bad { background:var(--badSoft); color:var(--bad); }
.tag.diet { background:#e3eefb; color:#1f5fa8; font-weight:600; }
.tag.short { background:#eceff1; color:#8a959c; text-decoration:line-through; }
.setRow { padding:10px 4px; border-bottom:1px solid #edf0f2; cursor:pointer; }
.checks { display:grid; grid-template-columns:1fr 1fr; gap:4px 12px; margin:6px 0 12px; color:var(--ink); font-size:15px; }
.checks.one { grid-template-columns:1fr; }
.checks label { display:flex; align-items:center; gap:8px; min-height:36px; }
.checks label.sub { padding-left:26px; }
.checks input { width:22px; min-height:22px; margin:0; }
.tag.deal { background:var(--dealSoft); color:var(--deal); font-weight:600; }
.banner { padding:10px 12px; border-radius:10px; margin-bottom:12px; background:var(--warnSoft); color:var(--warn); }
.banner.bad { background:var(--badSoft); color:var(--bad); }
.mute { color:var(--mute); font-size:13px; }
table { width:100%; border-collapse:collapse; font-size:14px; }
th { text-align:left; color:var(--mute); font-weight:500; font-size:12px; padding:5px 6px; border-bottom:1px solid var(--line); }
td { padding:7px 6px; border-bottom:1px solid #edf0f2; vertical-align:top; }
td.n, th.n { text-align:right; white-space:nowrap; }
tr.tap { cursor:pointer; }


.picker { position:relative; }
.pickList { position:absolute; z-index:5; left:0; right:0; top:100%; background:#fff; border:1px solid var(--line); border-radius:10px; max-height:320px; overflow:auto; box-shadow:0 8px 24px rgba(0,0,0,.14); }
.pickList div { padding:11px 12px; border-bottom:1px solid #edf0f2; cursor:pointer; }

.orderWrap { display:grid; grid-template-columns:1fr 340px; height:100%; }
.orderMain { overflow:auto; -webkit-overflow-scrolling:touch; padding:12px; }
.cart { background:#fff; border-left:1px solid var(--line); display:flex; flex-direction:column; min-height:0; }
.cartHead { padding:12px; border-bottom:1px solid var(--line); }
.cartList { flex:1; overflow:auto; min-height:120px; }
.cartRow { padding:9px 12px; border-bottom:1px solid #edf0f2; font-size:14px; }
.cartRow .line { display:flex; gap:6px; align-items:center; margin-top:6px; }
.cartRow input { min-height:38px; padding:6px 8px; width:74px; }
.cartRow .x { margin-left:auto; border:0; background:none; color:var(--bad); font-size:20px; padding:4px 8px; cursor:pointer; }
.cartFoot { padding:12px; border-top:1px solid var(--line); display:grid; gap:8px; }
.total { display:flex; justify-content:space-between; font-weight:700; font-size:18px; }

.toggles { display:flex; gap:8px; flex-wrap:wrap; margin-bottom:10px; align-items:center; }
.chip { border:1px solid var(--line); background:#fff; border-radius:18px; padding:7px 13px; font-size:14px; min-height:38px; cursor:pointer; }
.chip.on { background:var(--brand); color:#fff; border-color:var(--brand); }
.items { display:grid; grid-template-columns:repeat(auto-fill,minmax(300px,1fr)); gap:10px; }
.item { display:flex; gap:10px; background:#fff; border:1px solid var(--line); border-radius:12px; padding:10px; cursor:pointer; }
.thumb { width:76px; height:76px; flex:none; border-radius:10px; background:#eef3f1; color:var(--brand); display:flex; align-items:center; justify-content:center; font-weight:700; font-size:20px; overflow:hidden; text-align:center; }
.thumb img { width:100%; height:100%; object-fit:contain; }
.thumb.lg { width:220px; height:220px; font-size:48px; cursor:zoom-in; }
.itemBody { min-width:0; flex:1; }
.itemName { font-weight:600; font-size:14px; line-height:1.25; display:-webkit-box; -webkit-line-clamp:3; -webkit-box-orient:vertical; overflow:hidden; }
.itemMeta { font-size:12px; color:var(--mute); margin-top:3px; }
.itemFoot { display:flex; align-items:center; justify-content:space-between; gap:6px; margin-top:5px; }
.price { font-weight:700; }
.add { border:0; background:var(--brand); color:#fff; font-size:14px; font-weight:600; min-height:42px; padding:0 12px; border-radius:10px; flex:none; white-space:nowrap; cursor:pointer; }
.inCart { outline:2px solid var(--brand); }

.sheet { position:fixed; inset:0; z-index:20; background:rgba(0,0,0,.4); display:flex; align-items:flex-end; justify-content:center; }
.sheetBox { background:#fff; width:min(900px,100%); max-height:92%; overflow:auto; border-radius:16px 16px 0 0; padding:16px; padding-bottom:max(16px, env(safe-area-inset-bottom)); }
.sheetHead { display:flex; gap:10px; align-items:flex-start; margin-bottom:10px; }
.sheetHead h2 { font-size:18px; margin:0; flex:1; }
.detailTop { display:flex; gap:14px; flex-wrap:wrap; margin-bottom:12px; }
.facts { flex:1; min-width:260px; display:grid; grid-template-columns:auto 1fr; gap:3px 12px; font-size:14px; align-self:start; }
.facts dt { color:var(--mute); }
.facts dd { margin:0; }
.addBox { display:grid; grid-template-columns:repeat(auto-fit,minmax(110px,1fr)); gap:8px; align-items:end; }
.zoom { position:fixed; inset:0; z-index:30; background:rgba(0,0,0,.88); display:flex; align-items:center; justify-content:center; color:#fff; font-size:64px; text-align:center; }
.zoom img { max-width:100%; max-height:100%; }
.toast { position:fixed; z-index:40; left:50%; transform:translateX(-50%); bottom:24px; background:var(--ink); color:#fff; padding:10px 16px; border-radius:10px; max-width:90%; }

/* Color theme */
:root { --brand:#0d7a5a; --blue:#2467c9; --orange:#ea7a14; --purple:#7a3fb5; --pink:#cf3a78; --teal:#0b8a86; --bg:#eef4f2; }
.login { height:100%; display:flex; align-items:center; justify-content:center; padding:20px; background:linear-gradient(135deg, #0d7a5a 0%, #0b8a86 45%, #2467c9 100%); }
.login form { background:#fff; padding:32px 28px; border-radius:22px; width:360px; display:grid; gap:12px; box-shadow:0 18px 50px rgba(5,40,50,.35); text-align:center; }
.login .logoBig { display:block; margin:auto; }
.login img { height:68px; }
.login h1 { font-size:24px; margin:4px 0 0; color:var(--brand); }
.tagline { margin:0 0 6px; color:var(--mute); font-size:14px; }
.login .btn.primary { background:linear-gradient(90deg, #0d7a5a, #0b8a86); border:0; }

header { display:flex; align-items:center; gap:12px; padding:8px 14px; padding-top:max(8px, env(safe-area-inset-top)); background:linear-gradient(90deg, #0d7a5a, #0b8a86 60%, #2467c9); color:#fff; }
header .logo { background:#fff; border-radius:10px; padding:3px 8px; display:flex; flex:none; }
header img { height:32px; }
header .title { font-weight:700; font-size:19px; white-space:nowrap; }
header label { font-size:13px; color:#e4f4f0; display:flex; gap:6px; align-items:center; white-space:nowrap; }
header select { width:190px; border:0; color:var(--ink); }
header .stamp { color:#e4f4f0; }
header .btn { white-space:nowrap; flex:none; border:0; font-weight:600; color:var(--brand); }

.hello { grid-column:1/-1; display:flex; align-items:baseline; justify-content:space-between; gap:12px; flex-wrap:wrap; }
.hello b { font-size:26px; color:var(--brand); }
.hello span { color:var(--mute); }
.menu { max-width:980px; margin:auto; padding:22px 18px; display:grid; grid-template-columns:repeat(6,1fr); gap:16px; }
.tile { grid-column:span 2; border:0; border-radius:20px; padding:22px; min-height:150px; color:#fff; text-align:left; cursor:pointer; display:flex; flex-direction:column; justify-content:space-between; gap:14px; box-shadow:0 6px 16px rgba(10,40,50,.16); }
.tile .ico { width:48px; height:48px; border-radius:14px; background:rgba(255,255,255,.22); display:flex; align-items:center; justify-content:center; }
.tile svg { width:28px; height:28px; fill:none; stroke:#fff; stroke-width:2; stroke-linecap:round; stroke-linejoin:round; }
.tile .txt { display:flex; flex-direction:column; gap:3px; min-width:0; }
.tile b { font-size:22px; }
.tile small { font-size:14px; opacity:.95; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.tile:active { transform:scale(.98); }
.t-order { grid-column:1/-1; flex-direction:row; align-items:center; justify-content:flex-start; min-height:120px; background:linear-gradient(120deg, #0d7a5a, #12a076); }
.t-order b { font-size:28px; }
.t-catalog { background:linear-gradient(135deg, #2467c9, #3f8ae8); }
.t-orders { background:linear-gradient(135deg, #cf620a, #ef8f2e); }
.t-progress { background:linear-gradient(135deg, #6a2fa5, #9559d1); }
.t-admin { background:linear-gradient(135deg, #bb2f69, #df5b92); }
.t-panel { background:linear-gradient(135deg, #0a7471, #16a39f); }
@media (max-width:640px) { .tile, .t-admin, .t-settings { grid-column:1/-1; } }

.btn.primary { background:linear-gradient(90deg, #0d7a5a, #12a076); border:0; }
.add { background:linear-gradient(90deg, #0d7a5a, #12a076); }
.card { border:0; border-radius:16px; box-shadow:0 2px 10px rgba(10,40,50,.07); }
.card h3 { color:var(--brand); font-size:16px; }
.kpi { border:0; border-radius:14px; border-top:4px solid var(--brand); box-shadow:0 2px 10px rgba(10,40,50,.07); }
.kpi:nth-child(5n+2) { border-top-color:var(--blue); }
.kpi:nth-child(5n+3) { border-top-color:var(--orange); }
.kpi:nth-child(5n+4) { border-top-color:var(--purple); }
.kpi:nth-child(5n+5) { border-top-color:var(--pink); }
.item { border:0; border-radius:16px; box-shadow:0 2px 10px rgba(10,40,50,.08); }
.inCart { outline:3px solid #12a076; }
.chip.on { background:var(--blue); border-color:var(--blue); }
.price { color:var(--brand); }
.tag.diet { background:#e2eefc; color:#1f5fa8; }
.tag.ok { background:#dff5ea; }
.cart { border-left:0; box-shadow:-2px 0 12px rgba(10,40,50,.08); }
.cartHead { background:#f1faf6; }
.total span:last-child { color:var(--brand); }

.bars { display:flex; align-items:flex-end; gap:3px; height:140px; }
.bar { flex:1; min-width:0; display:flex; flex-direction:column; justify-content:flex-end; text-align:center; }
.bar span { font-size:10px; font-weight:600; white-space:nowrap; margin-bottom:2px; }
.bar i { display:block; border-radius:4px 4px 0 0; background:linear-gradient(180deg, #12a076, #0b8a86); }
.bar em { font-style:normal; font-size:10px; color:var(--mute); margin-top:3px; }
.totalRow td { font-weight:700; border-top:2px solid var(--line); }
tr.stale td { color:var(--bad); background:var(--badSoft); font-weight:600; }
.filters { display:grid; grid-template-columns:minmax(0,7fr) minmax(0,3fr) minmax(0,3fr); gap:8px; margin-bottom:8px; }
.filters .q { grid-column:1/-1; }
.periods { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:12px; margin-bottom:12px; }
.period { border:0; border-top:4px solid var(--brand); border-radius:16px; background:#fff; padding:14px; text-align:left; display:flex; flex-direction:column; gap:3px; cursor:pointer; box-shadow:0 2px 10px rgba(10,40,50,.07); }
.period:nth-child(2) { border-top-color:var(--blue); }
.period:nth-child(3) { border-top-color:var(--orange); }
.period.on { outline:3px solid var(--blue); }
.pName { font-weight:700; font-size:15px; }
.pTotal { font-size:26px; margin-top:4px; }
.pStats { display:flex; flex-wrap:wrap; gap:4px 12px; margin-top:6px; font-size:13px; color:var(--mute); }
.pStats b { color:var(--ink); font-size:15px; }
.orderTop { position:sticky; top:-12px; z-index:3; background:var(--bg); padding:6px 0; }
.cartBtn { margin-left:auto; white-space:nowrap; background:linear-gradient(90deg, #cf620a, #ef8f2e) !important; }
.cartCard { display:flex; gap:12px; padding:12px 0; border-bottom:1px solid var(--line); }
.cardLine { display:flex; flex-wrap:wrap; align-items:center; gap:8px 12px; margin-top:8px; font-size:14px; }
.cardLine label { display:flex; align-items:center; gap:6px; color:var(--mute); }
.cardLine input { width:90px; min-height:40px; padding:6px 8px; }
.lineSum { margin-left:auto; font-size:16px; }
.sheetBox .total { margin-top:12px; }
@media (max-width:900px) { .orderWrap { grid-template-columns:1fr; } .cart { display:none; } }
.orderForm { display:grid; gap:18px; padding:22px; }
.fld { display:block; min-width:0; }
.lbl { display:block; font-size:13px; font-weight:600; color:var(--brand); margin-bottom:6px; }
.orderForm input, .orderForm select { min-height:50px; font-size:17px; }
.orderForm select:disabled { background:#f1f4f3; color:var(--mute); }
.formRow { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:16px; }
.seg { display:flex; gap:6px; background:#edf1f0; border-radius:12px; padding:4px; min-height:50px; }
.seg button { flex:1; border:0; background:none; border-radius:9px; font-size:15px; color:var(--mute); cursor:pointer; }
.seg button.on { background:var(--brand); color:#fff; font-weight:600; }
@media (max-width:640px) { .formRow { grid-template-columns:1fr; } }
.filters.two { grid-template-columns:minmax(0,7fr) minmax(0,3fr); }
.lineTop { display:flex; gap:12px; margin-bottom:14px; }
.qtyBtns { display:flex; flex-wrap:wrap; gap:8px; margin-bottom:14px; align-items:center; }
.qtyBtns button { min-width:58px; height:54px; border:1px solid var(--line); background:#fff; border-radius:12px; font-size:20px; font-weight:600; cursor:pointer; }
.qtyBtns button.on { background:var(--blue); border-color:var(--blue); color:#fff; }
.qtyBtns button.step { background:#edf1f0; }
.qtyBtns input { width:96px; height:54px; font-size:20px; text-align:center; }
.priceBtn { width:100%; display:flex; align-items:baseline; justify-content:space-between; gap:12px; padding:12px 16px; border:2px solid var(--brand); border-radius:12px; background:#f1faf6; cursor:pointer; margin-bottom:12px; }
.priceBtn b { font-size:24px; color:var(--brand); }
.priceBtn small { color:var(--mute); font-size:13px; }
#pricePanel { background:#f6f8f7; border-radius:12px; padding:12px; margin-bottom:12px; }
.calcShow { background:#fff; border-radius:10px; padding:10px 14px; text-align:right; font-size:26px; font-weight:600; margin-bottom:8px; min-height:52px; }
.calcKeys { display:grid; grid-template-columns:repeat(4,1fr); gap:6px; }
.calcKeys button { height:52px; border:0; border-radius:10px; background:#fff; font-size:20px; cursor:pointer; box-shadow:0 1px 3px rgba(10,40,50,.1); }
.calcKeys .op { background:#e2eefc; color:#1f5fa8; font-weight:700; }
.calcKeys .use { grid-column:span 3; background:var(--brand); color:#fff; font-size:16px; font-weight:600; }
.lowered { color:#c62828 !important; }
.raised { color:#1f5fa8 !important; }
input.lowered { background:#fdecea; border-color:#c62828; font-weight:600; }
input.raised { background:#e2eefc; border-color:#1f5fa8; font-weight:600; }
.lineUom { margin-bottom:14px; max-width:360px; }
.qWrap { position:relative; }
.qWrap input { padding-right:48px; }
.qWrap input::-webkit-search-cancel-button { display:none; }
.clearX { position:absolute; right:6px; top:50%; transform:translateY(-50%); width:34px; height:34px; border:0; border-radius:50%; background:#dfe5e9; color:var(--ink); font-size:20px; line-height:1; cursor:pointer; }
.priceWas { display:block; font-size:13px; color:var(--mute); }
[data-pricebox] .price.lowered, [data-pricebox] .price.raised { display:block; font-size:15px; }
@media (max-width:900px) { header .stamp { display:none; } header select { width:150px; } }
.sendBtn { margin-top:12px; }
.checks.three { grid-template-columns:repeat(3,minmax(0,1fr)); max-height:60vh; overflow:auto; }
@media (max-width:760px) { .checks.three { grid-template-columns:1fr 1fr; } }
.t-completed { background:linear-gradient(135deg, #3341a8, #5c6bd6); }
.doneFacts { margin-bottom:14px; }
.itemFoot { flex-wrap:wrap; }
.addCtl { display:flex; align-items:center; gap:6px; margin-left:auto; }
.addCtl .step { min-width:42px; height:42px; border:1px solid var(--line); background:#fff; border-radius:10px; font-size:20px; font-weight:600; cursor:pointer; }
.addCtl .step.edit { font-size:14px; padding:0 10px; color:var(--blue); }
.item.ordering { flex-wrap:wrap; align-content:flex-start; }
.item.ordering .itemBody { flex:1 1 calc(100% - 86px); }
.orderFoot { flex:1 1 100%; margin-top:auto; }
.footTop { display:flex; align-items:flex-end; justify-content:space-between; gap:8px; min-height:24px; margin-bottom:6px; }
.footPrice { min-width:0; }
.lineAmt { white-space:nowrap; font-size:14px; color:var(--brand); }
.lineCtl { min-height:42px; display:flex; justify-content:flex-end; }
.lineBox { flex:1; min-width:0; cursor:default; }
.lineRow { display:flex; align-items:center; gap:6px; height:42px; }
.ctlBtn { height:42px; border:1px solid var(--line); background:#fff; border-radius:10px; padding:0 10px; font-size:14px; color:var(--ink); white-space:nowrap; cursor:pointer; }
.ctlBtn:disabled { color:var(--mute); cursor:default; opacity:1; }
.priceCtl { font-weight:700; color:var(--brand); }
.noteCtl { width:42px; padding:0; }
.noteCtl.has { background:var(--brandSoft); border-color:var(--brand); }
.noteCtl svg, .stepper svg { width:20px; height:20px; fill:none; stroke:currentColor; stroke-width:2; stroke-linecap:round; stroke-linejoin:round; display:block; margin:auto; }
.stepper { display:flex; margin-left:auto; height:42px; border:1px solid var(--brand); border-radius:10px; overflow:hidden; }
.stepper button { width:40px; border:0; background:var(--brand); color:#fff; font-size:22px; line-height:1; cursor:pointer; }
.stepper input { width:46px; min-height:0; height:100%; border:0; border-radius:0; padding:0; text-align:center; font-size:16px; font-weight:700; -moz-appearance:textfield; }
.stepper input::-webkit-outer-spin-button, .stepper input::-webkit-inner-spin-button { -webkit-appearance:none; margin:0; }
.lineNote { flex:1; min-width:0; min-height:42px; height:42px; font-size:14px; padding:6px 10px; }
.noteDone { flex:none; min-height:42px; }
.notePreview { font-size:12px; color:var(--mute); margin-top:4px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.priceNow { display:flex; align-items:baseline; gap:14px; flex-wrap:wrap; background:var(--brandSoft); border-radius:12px; padding:10px 14px; margin-bottom:14px; }
.priceNow .lbl { margin:0; }
.priceNow b { font-size:26px; color:var(--brand); }
.listBtn { font-size:14px !important; font-weight:500 !important; }
.add, .stepper button { -webkit-touch-callout:none; -webkit-user-select:none; user-select:none; touch-action:manipulation; }
.sheetBox.priceSheet { width:min(680px,100%); padding:14px; }
.priceName { font-weight:700; font-size:15px; margin-bottom:8px; }
.priceSheet .priceNow { padding:6px 12px; margin-bottom:10px; gap:10px; }
.priceSheet .priceNow b { font-size:22px; }
.priceSheet .grid2 { gap:10px; }
.discBtns { display:grid; grid-template-columns:repeat(3,1fr); gap:6px; margin-bottom:10px; }
.discBtns button { height:42px; border:1px solid var(--line); background:#fff; border-radius:10px; font-size:16px; font-weight:600; cursor:pointer; }
.discBtns .listBtn { grid-column:1/-1; font-size:14px; font-weight:500; }
.priceInputs { display:grid; grid-template-columns:1fr 1fr; gap:8px; }
.priceInputs input { min-height:42px; padding:6px 10px; }
.priceInputs .lbl { margin-bottom:3px; }
.priceSheet .calcShow { min-height:38px; padding:4px 10px; font-size:20px; margin-bottom:6px; background:#f6f8f7; }
.priceSheet .calcKeys { gap:4px; }
.priceSheet .calcKeys button { height:38px; font-size:17px; }
.priceDone { margin-top:10px; }
@media (max-width:640px) { .priceSheet .grid2 { grid-template-columns:1fr; } }
.onHand { color:var(--ink); font-size:14px; }
#fDept { order:-2; }
#fBrand { order:-1; }
.filters .q { order:1; }
.deptPick { position:relative; min-width:0; }
.deptBtn { width:100%; min-height:44px; padding:10px 34px 10px 12px; border:1px solid var(--line); border-radius:10px; background:#fff; text-align:left; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; cursor:pointer; position:relative; }
.deptBtn::after { content:''; position:absolute; right:14px; top:50%; margin-top:-3px; border:6px solid transparent; border-top-color:var(--ink); border-bottom:0; }
#fDeptList { z-index:6; }
.deptAll { font-weight:600; }
.deptMain { font-weight:700; color:var(--brand); background:var(--brandSoft); }
.deptSub { padding-left:30px !important; }
#fDeptList span { font-weight:400; color:var(--mute); font-size:13px; }
#fDeptList .on { box-shadow:inset 4px 0 0 var(--blue); }
.oosTag { display:inline-block; margin-left:6px; padding:3px 12px; border-radius:8px; background:var(--bad); color:#fff; font-size:15px; font-weight:800; white-space:nowrap; }

.promo { color:var(--deal) !important; }
input.promo { background:var(--dealSoft); border-color:var(--deal); font-weight:600; }
[data-pricebox] .price.promo { display:block; font-size:15px; }
/* Deal colors: one per promotion type, on the card, its tag and its banner. */
.k-special { --kind:#c4570a; --kindSoft:#fdeedd; }
.k-discount, .k-deal { --kind:#7a3fb5; --kindSoft:#f1e9fa; }
.k-free { --kind:#0f7a4f; --kindSoft:#dff5ea; }
.k-pallet { --kind:#1f5fa8; --kindSoft:#e2eefc; }
.item.k-special, .item.k-discount, .item.k-deal, .item.k-free, .item.k-pallet { background:var(--kindSoft); border-left:6px solid var(--kind); }
.tag.k-special, .tag.k-discount, .tag.k-deal, .tag.k-free, .tag.k-pallet { background:var(--kind); color:#fff; font-weight:600; }
.promoNote { font-size:12px; font-weight:600; color:var(--kind); margin-top:3px; line-height:1.3; }
.promoBanner { grid-column:1/-1; display:flex; flex-wrap:wrap; gap:4px 12px; align-items:baseline; background:var(--kind); color:#fff; border-radius:12px; padding:10px 14px; margin-bottom:2px; font-size:15px; }
.promoBanner b { font-size:16px; }
.sheetBox .promoBanner { margin-bottom:10px; }
.chip.specialChip { border-color:#c4570a; color:#c4570a; font-weight:700; }
.chip.specialChip.on { background:#c4570a; border-color:#c4570a; color:#fff; }
.deptPromo { color:#c4570a; }
.giftBox { background:#dff5ea; color:#0f5f3e; border-radius:10px; padding:8px 10px; margin-bottom:6px; font-size:13px; display:grid; gap:4px; }
.sheetBox .giftBox { margin-top:10px; font-size:15px; }
.giftBox .btn { min-height:40px; }
.stepper button:disabled { background:#b9c4c0; cursor:default; }
.goal { padding:10px 0; border-bottom:1px solid #edf0f2; }
.goal:last-child { border-bottom:0; }
.goalTop { display:flex; gap:8px; align-items:baseline; justify-content:space-between; }
.goalBar { position:relative; height:10px; background:#e6ecea; border-radius:5px; margin:6px 0 4px; }
.goalBar i { display:block; height:100%; border-radius:5px; background:var(--brand); }
.goalBar.behind i { background:#c4570a; }
.goalBar em { position:absolute; top:-3px; width:2px; height:16px; background:var(--ink); }
.linkBtn { display:inline-flex; align-items:center; text-decoration:none; color:inherit; }
.k-clearance { --kind:#b3261e; --kindSoft:#fbe9e7; }
.k-bundle { --kind:#0b7773; --kindSoft:#def5f4; }
.k-spend { --kind:#b02a63; --kindSoft:#fde6ee; }
.k-rebate { --kind:#4b5563; --kindSoft:#e9ecef; }
.item.k-clearance, .item.k-bundle, .item.k-spend, .item.k-rebate { background:var(--kindSoft); border-left:6px solid var(--kind); }
.tag.k-clearance, .tag.k-bundle, .tag.k-spend, .tag.k-rebate { background:var(--kind); color:#fff; font-weight:600; }
.chip.arrivalChip { border-color:#0b8a86; color:#0b7773; font-weight:700; }
.chip.arrivalChip.on { background:#0b8a86; border-color:#0b8a86; color:#fff; }
.tag.arrivalTag { background:#0b8a86; color:#fff; font-weight:600; }
.promoBanner.catBanner { --kind:#0d7a5a; background:linear-gradient(90deg, #0d7a5a, #12a076); }

/* iPhone */
@media (max-width:640px) {
  header { flex-wrap:wrap; gap:6px 8px; padding:6px 10px; padding-top:max(6px, env(safe-area-inset-top)); }
  header .logo { display:none; }
  header .title { font-size:17px; min-width:0; overflow:hidden; text-overflow:ellipsis; }
  header .btn { min-height:38px; padding:6px 10px; font-size:14px; }
  #viewAsWrap { order:10; flex:1 1 100%; }
  #viewAsWrap select { flex:1; width:auto; min-height:38px; padding:6px 10px; }
}
#app { height:100dvh; }
@media (max-width:640px) {
  input, select, textarea, .lineNote, .cartRow input { font-size:16px; }
  .page { padding:10px; }
  .card { padding:12px; border-radius:14px; }
  .hello b { font-size:22px; }
  .menu { padding:12px 10px; gap:10px; }
  .tile, .t-order { grid-column:1/-1; flex-direction:row; align-items:center; justify-content:flex-start; min-height:0; padding:14px 16px; gap:14px; border-radius:16px; }
  .tile b, .t-order b { font-size:19px; }
  .tile small { font-size:13px; }
  .tile .ico { width:42px; height:42px; flex:none; }
  .periods { grid-template-columns:1fr; gap:8px; }
  .period { padding:10px 12px; display:grid; grid-template-columns:1fr auto; gap:0 10px; align-items:baseline; }
  .pTotal { grid-column:2; grid-row:1 / span 2; font-size:22px; margin:0; align-self:center; }
  .pStats { grid-column:1 / -1; margin-top:3px; }
  .orderTop { top:-10px; padding:4px 0; gap:6px; }
  .orderTop .btn { min-height:38px; padding:6px 10px; font-size:14px; }
  .orderMain { padding:10px; }
  #catalogBox .toggles:not(.orderTop), #catalogPage .toggles { flex-wrap:nowrap; overflow-x:auto; -webkit-overflow-scrolling:touch; scrollbar-width:none; padding-bottom:2px; }
  #catalogBox .toggles .chip, #catalogPage .toggles .chip { flex:none; }
  #fCount { flex:none; }
  .items { grid-template-columns:minmax(0,1fr); }
  .sheetBox { padding:12px; max-height:94%; }
  .sheetBox .kpis { grid-template-columns:repeat(3,minmax(0,1fr)); gap:6px; }
  .sheetBox .kpi { padding:8px; }
  .sheetBox .kpi b { font-size:17px; }
  .thumb.lg { width:140px; height:140px; font-size:36px; margin:auto; }
  .detailTop { flex-direction:column; }
  .priceSheet .grid2 { grid-template-columns:1fr; }

  /* Wide tables as stacked rows */
  table.stack, table.stack tbody { display:block; }
  table.stack tr:first-child { display:none; }
  table.stack tr { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:2px 14px; padding:10px 0; border-bottom:1px solid #edf0f2; }
  table.stack td { display:flex; justify-content:space-between; align-items:baseline; gap:8px; min-width:0; padding:1px 0; border:0; background:none !important; text-align:right; white-space:normal; }
  table.stack td::before { content:attr(data-label); color:var(--mute); font-size:12.5px; font-weight:400; text-align:left; }
  table.stack td:first-child { grid-column:1 / -1; display:block; font-weight:600; text-align:left; font-size:15px; padding-bottom:3px; }
  table.stack td:first-child::before, table.stack td[data-label=""]::before { content:none; }
  table.stack td[data-label=""] { grid-column:1 / -1; justify-content:flex-end; gap:8px; padding-top:6px; }
  table.stack tr.stale { background:var(--badSoft); border-radius:10px; padding:10px; margin:4px 0; border:0; }
  table.stack tr.totalRow { border-top:2px solid var(--line); }
  .wideTable { overflow-x:auto; }
}
/* A phone on its side: the order list needs the whole width. */
@media (max-height:500px) { .orderWrap { grid-template-columns:1fr; } .cart { display:none; } }
