/* Buying + Customers & suppliers. Tokens only so dark mode follows. Everything prefixed bx- */
.bx-bar{display:flex;gap:8px;flex-wrap:wrap;align-items:center}
.bx-bar .grow{flex:1;min-width:160px}
.bx-warn{display:flex;gap:12px;align-items:center;flex-wrap:wrap;margin-bottom:14px}
.bx-warn > div{flex:1;min-width:200px}
.bx-warn.stop{border-color:var(--stop-line);background:var(--stop-bg)}
.bx-in{height:40px;width:92px;text-align:right;font-variant-numeric:tabular-nums}
.bx-in.cost{width:100px}
.bx-check{width:22px;height:22px;accent-color:var(--bolt-600);flex:none;cursor:pointer}
.bx-sel td{opacity:1} .bx-off td{opacity:.5}
.bx-dd{position:relative}
.bx-dd .list{position:absolute;left:0;right:0;top:calc(100% + 4px);z-index:30;background:var(--card);border:1px solid var(--line2);border-radius:var(--r);box-shadow:var(--sh-2);max-height:360px;overflow:auto}
.bx-dd .list:empty{display:none}
.bx-dd .row{cursor:pointer}
.bx-kv{display:grid;grid-template-columns:minmax(110px,auto) 1fr;gap:6px 14px;font-size:14px}
.bx-kv > :nth-child(odd){color:var(--muted)}
.bx-kv > :nth-child(even){overflow-wrap:anywhere}
.bx-pocard{display:flex;gap:14px;align-items:center;text-decoration:none;color:inherit;min-height:76px}
.bx-pocard:hover{box-shadow:var(--sh-2)}
.bx-pocard .grow{flex:1;min-width:0}
.bx-line{border:1.5px solid var(--line);border-radius:var(--r-l);padding:14px;margin-bottom:12px;background:var(--card)}
.bx-line.hit{border-color:var(--bolt);box-shadow:0 0 0 3px var(--bolt-100)}
.bx-line.done{border-color:var(--ok-line);background:var(--ok-bg)}
.bx-line .top{display:flex;gap:12px;align-items:center}
.bx-line .top .grow{flex:1;min-width:0}
.bx-entry{display:grid;grid-template-columns:150px 1fr 1fr 1fr auto;gap:10px;align-items:end;margin-top:12px}
.bx-entry .field{margin:0}
.bx-entry .input{height:48px;font-size:16px}
.bx-step{display:flex;align-items:center;border:1.5px solid var(--line2);border-radius:12px;overflow:hidden;height:48px}
.bx-step button{width:44px;height:100%;border:0;background:var(--surface);font-size:22px;cursor:pointer;color:var(--ink)}
.bx-step input{flex:1;min-width:0;width:40px;border:0;background:var(--card);text-align:center;font-weight:700;font-size:18px;height:100%;outline:none}
.bx-req{color:var(--stop);font-weight:700}
.bx-done{text-align:center;padding:30px 18px}
.bx-done .bigtick{width:96px;height:96px}
.bx-form .grid{gap:0 14px}
.bx-more{display:flex;justify-content:center;margin-top:14px}
.bx-ontime{display:flex;align-items:center;gap:10px;font-size:13px;margin-top:10px}
.bx-ontime .b{flex:1;height:8px;background:var(--sunk);border-radius:99px;overflow:hidden}
.bx-ontime .b span{display:block;height:100%;background:var(--ok)}
.bx-ontime .b span.low{background:var(--stop)}
.bx-mini{font-size:12.5px;color:var(--muted)}
a.card.pad{text-decoration:none;color:inherit;display:block}
a.card.pad:hover{box-shadow:var(--sh-2)}
@media (max-width:1180px){
  .bx-entry{grid-template-columns:150px 1fr 1fr;}
}
@media (max-width:720px){
  .bx-sticky{position:sticky;bottom:calc(var(--tab) + env(safe-area-inset-bottom) + 10px);z-index:25;background:var(--card);padding:10px;border:1px solid var(--line);border-radius:var(--r-l);box-shadow:var(--sh-2);margin-top:14px}
  .bx-sticky .btn{flex:1}
  .bx-entry{grid-template-columns:minmax(0,1fr) minmax(0,1fr)}
  .bx-entry .bx-qtyf{grid-column:1 / -1}
  .bx-in,.bx-in.cost{width:100%;max-width:130px;height:44px}
  .bx-kv{grid-template-columns:minmax(0,auto) minmax(0,1fr)}
  .tbl.cards td .bx-in{margin-left:auto}
  .bx-hide-phone{display:none!important}
}

/* QA pass 13 Nov: touch targets on phone and tablet. Every button, chip and toggle on these screens (and the drawers and
   pop-ups they open) is at least 44px tall. Scoped to this module's screens through the .bx-scr wrapper. */
@media (max-width:1180px){
  body:has(.bx-scr) :is(.p-main,#modal,#drawer) :is(.chip,.seg>button,.tabs a,.tabs button){min-height:44px;height:auto}
  body:has(.bx-scr) :is(.p-main,#modal,#drawer) :is(.input,.select){min-height:44px}
  body:has(.bx-scr) :is(.p-main,#modal,#drawer) .seg{min-height:44px}
  body:has(.bx-scr) .p-main .tabs a{display:inline-flex;align-items:center}
}
/* Phone: every tab visible (wrap) instead of hidden off the right edge of a scroll strip */
@media (max-width:720px){ body:has(.bx-scr) .p-main .tabs{flex-wrap:wrap;overflow-x:visible} }
@media (max-width:1180px){ body:has(.bx-scr) .bx-check{width:28px;height:28px} body:has(.bx-scr) label.hstack:has(.bx-check){min-height:44px} }
.bx-need{outline:3px solid var(--bolt);outline-offset:4px;border-radius:12px}
.bx-lacts{display:inline-flex;gap:6px;flex-wrap:wrap;justify-content:flex-end}

/* Supplier logos (P.supLogo, Dylan 16 Nov): the monogram stays underneath until the picture has loaded, and comes back
   if it fails. Logos sit on white like product photos (.th img), so dark marks stay readable in dark mode. */
.sl.img{position:relative;overflow:hidden}
.sl.img img{position:absolute;inset:0;width:100%;height:100%;object-fit:contain;background:#fff;padding:calc(var(--s) * .08);border-radius:inherit;opacity:0;transition:opacity .15s}
.sl.img.ld{background:#fff;color:transparent;box-shadow:inset 0 0 0 1px var(--line)}
.sl.img.ld img{opacity:1}
.bx-logo{display:flex;gap:14px;align-items:center;flex-wrap:wrap}
.bx-logo .grow{flex:1;min-width:150px}
.bx-addcost{display:grid;grid-template-columns:1fr 1fr;gap:0 14px}
.bx-added td{background:color-mix(in srgb,var(--bolt) 6%,transparent)}
@media (max-width:720px){ .bx-addcost{grid-template-columns:1fr} }
.tbl td .bx-lacts{flex-wrap:nowrap}

/* 16 Nov (Dylan): PO actions sit in one row at the top of the PO page, under the header; they wrap on a phone */
.bx-topacts{margin-bottom:14px;padding:12px 14px}
@media (max-width:720px){ .bx-topacts .btn{flex:1 1 auto;min-height:44px} }

/* 16 Nov (Dylan): PO header band = PO number + supplier | Notifications card (.ncard in app.css) */
.bx-pohead{display:grid;gap:16px;grid-template-columns:minmax(0,1fr) minmax(0,1.3fr);align-items:start;margin-bottom:14px}
.bx-pohead.nonotes{grid-template-columns:minmax(0,1fr)}
.bx-poinfo{min-width:0}
.bx-poinfo .ph{margin-bottom:0}
.bx-ponotes .pill{flex:none}
@media (max-width:1000px){ .bx-pohead{grid-template-columns:minmax(0,1fr)} }

/* 17 Nov (Dylan): invoices / packing lists on a PO. PHIL reads them and fills in Receive (modules/po_docs.py) */
.bx-docbtns{display:flex;gap:8px;flex-wrap:wrap}
.bx-file{cursor:pointer;position:relative}
.bx-docbusy{display:flex;gap:12px;align-items:center;padding:6px 0}
.bx-docrow{align-items:flex-start;flex-wrap:wrap}
.bx-docrow .grow{min-width:180px}
.bx-docic{flex:none;min-width:44px;height:44px;padding:0 6px;border-radius:10px;background:var(--sunk);color:var(--muted);font-size:11px;font-weight:700;display:grid;place-items:center}
.bx-docrx{display:flex;gap:14px;align-items:center;flex-wrap:wrap;margin-bottom:14px}
.bx-docrx .grow{flex:1;min-width:220px}
.bx-msec{margin-top:12px}
.bx-mhd{display:flex;gap:6px;align-items:center;font-weight:700;font-size:14px;margin-bottom:6px}
.bx-mhd.ok{color:var(--ok)} .bx-mhd.wait{color:var(--wait)} .bx-mhd.stop{color:var(--stop)}
.bx-mrow{display:flex;gap:10px;align-items:flex-start;padding:8px 0;border-top:1px solid var(--line)}
.bx-mrow .grow{flex:1;min-width:0;overflow-wrap:anywhere}
.bx-mrow .pill{flex:none}
.bx-mwarn{display:flex;gap:6px;align-items:flex-start;color:var(--wait);margin-top:4px}
.bx-mwarn .ic{flex:none;margin-top:2px}
.bx-entry.fromdoc .input{border-color:var(--bolt)}
@media (max-width:720px){
  .bx-docbtns .btn{flex:1 1 100%;min-height:48px;justify-content:center}
  .bx-docrx{flex-direction:column;align-items:stretch}
  .bx-docrow .bx-lacts{width:100%;justify-content:flex-start}
  .bx-docrow .bx-lacts .btn{min-height:44px}
  .bx-mrow{flex-wrap:wrap}
}

/* 18 Nov (Dylan): Receive. Photo / PDF buttons towered to the right of "Scan each item"; "To receive | All" line filter;
   PC "Take a photo" = QR modal for a phone; ?photo=1 = the phone's big camera button. */
.bx-rxtop{display:grid;grid-template-columns:minmax(0,1fr) 240px;gap:14px;align-items:stretch;margin-bottom:14px}
.bx-rxtop>.card{margin:0}
.bx-doctower{display:flex;flex-direction:column;gap:8px;justify-content:center}
.bx-doctower .btn{width:100%;justify-content:center;min-height:48px}
.bx-doctower .bx-docbusy{flex-direction:column;text-align:center}
.bx-towerhd{text-transform:uppercase;letter-spacing:.04em;font-weight:700}
.bx-towerold{color:var(--muted);overflow-wrap:anywhere}
.bx-lfilter{display:flex;gap:12px;align-items:center;flex-wrap:wrap;margin:0 0 12px}
.bx-lfilter .seg button{min-height:44px;padding:8px 18px;white-space:nowrap}
.bx-line.bx-hid{display:none}
.bx-qr{display:flex;flex-direction:column;align-items:center;gap:10px}
.bx-qr img{width:220px;height:220px;background:var(--label-paper,var(--white));border-radius:12px;padding:6px}
.bx-qr ol{margin:0;padding-left:20px;align-self:stretch}
.bx-qr ol li{margin:2px 0}
.bx-qrst{display:flex;gap:10px;align-items:center;align-self:stretch;padding:10px 12px;border-radius:10px;background:var(--sunk)}
.bx-photo{text-align:center;max-width:560px;margin:0 auto}
.bx-photo h2{margin:8px 0}
.bx-photoic{color:var(--muted)}
.bx-photobtns{display:flex;flex-direction:column;gap:10px;margin-top:14px}
.bx-photobtns .btn{justify-content:center;min-height:56px}
.bx-photobtns .btn.xl{min-height:72px;font-size:20px}
@media (max-width:720px){
  .bx-rxtop{grid-template-columns:minmax(0,1fr)}
  .bx-doctower{flex-direction:row;flex-wrap:wrap}
  .bx-doctower .bx-towerhd,.bx-doctower .bx-towerold{flex:1 1 100%}
  .bx-doctower .btn{flex:1 1 120px;width:auto;padding-left:10px;padding-right:10px}
  .bx-lfilter .seg{flex:1 1 auto} .bx-lfilter .seg button{flex:1}
}
/* To order: one row per supplier (23 Nov 2026) */
.bx-sup{min-height:68px}
.bx-sup:hover{background:var(--surface)}
.bx-supn{display:grid;grid-template-columns:100px 90px 140px 130px;gap:14px;align-items:center;text-align:right;font-variant-numeric:tabular-nums;font-size:14px}
.bx-urg{color:var(--stop)}
.bx-go{font-size:24px;color:var(--faint);line-height:1}
.bx-sgrow .bx-in{flex:none}
@media (max-width:1000px){ .bx-sup{flex-wrap:wrap} .bx-sup .grow{flex:1 1 60%} .bx-sup .bx-go{order:2} .bx-supn{order:3;flex-basis:100%;grid-template-columns:repeat(2,minmax(0,1fr));gap:4px 14px;text-align:left} }
@media (min-width:721px){ #bxsp .bx-sticky{position:sticky;bottom:0;background:var(--card);z-index:5;border-top:1px solid var(--line)} }
@media (min-width:721px){ #bxpo .tbl .bx-lacts{flex-direction:column;align-items:flex-end;gap:4px} }
/* Why PHIL suggests it + the stock triangle (23 Nov 2026) */
.bx-stk{display:inline-flex;align-items:center;gap:7px;justify-content:flex-end}
.bx-tri{display:inline-flex;line-height:0;vertical-align:-3px}
.bx-why{display:block;margin:4px 0 0 auto;border:0;background:none;padding:2px 0;font:inherit;font-size:12px;color:var(--muted);cursor:pointer;white-space:nowrap}
.bx-why:hover{color:var(--ink);text-decoration:underline} .bx-why[aria-expanded="true"] svg{transform:rotate(180deg)}
.bx-whyr td{background:var(--surface);padding-top:10px!important;padding-bottom:12px!important}
.bx-whyb{display:grid;grid-template-columns:max-content minmax(0,1fr);gap:3px 14px;font-size:13px;max-width:820px;margin-left:54px;text-align:left}
.bx-whyb .k{color:var(--muted);font-weight:600}
.bx-whyd{margin-top:4px;font-size:12px} .bx-whyd summary{cursor:pointer;color:var(--muted)} .bx-whyd .bx-whyb{margin:6px 0 0;font-size:12.5px}
@media (max-width:720px){ .bx-why{min-height:40px} .bx-whyb{margin-left:0} .tbl.cards tr.bx-whyr{margin-top:-8px} .tbl.cards tr.bx-whyr td::before{content:none} }
