/* Inventory, fulfillment and purchasing use the same compact app surfaces. */
body[data-workspace] :is(#vendor-desk,#stock-sheet-desk) { min-width:0; }
body[data-workspace] :is(#vendor-desk,#stock-sheet-desk) .desk-heading { margin:22px 0 14px; }
body[data-workspace] :is(#vendor-desk,#stock-sheet-desk) :is(input,select,textarea) { font-size:16px; }
.inventory-switch { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:4px; max-width:460px; padding:4px; margin:18px 0; border-radius:12px; background:var(--soft); }
.inventory-switch button { min-height:44px; padding:8px 12px; border-radius:9px; background:transparent; color:var(--muted); font-size:.85rem; font-weight:600; }
.inventory-switch button[aria-pressed="true"] { background:white; color:var(--brand-accent); box-shadow:inset 0 0 0 1px var(--brand-line); }
.inventory-identity { display:flex; gap:13px; align-items:center; min-width:0; flex:1; }
.inventory-identity>div { min-width:0; }
.inventory-identity h3 { font-size:1rem; line-height:1.4; }
.inventory-identity small { font-size:.69rem; letter-spacing:0; }
.inventory-photo { display:grid; place-items:center; width:62px; height:80px; flex:none; background:var(--soft); overflow:hidden; border-radius:9px; color:var(--muted); }
.inventory-photo img { width:100%; height:100%; object-fit:cover; }
.inventory-photo .missing { font-size:10px; text-align:center; padding:7px; }
body[data-workspace] .inventory-product .inventory-identity p { font-size:.74rem; margin:4px 0 0; }
body[data-workspace] .inventory-product .inventory-available { color:var(--ink); font-weight:600; }
body[data-workspace] .inventory-product .desk-card-head { gap:14px; align-items:center; }
body[data-workspace] .inventory-product .desk-actions { flex:none; }
.inventory-product .desk-stock-list { margin-top:14px; }
body[data-workspace] .inventory-product .desk-sku { grid-template-columns:minmax(0,1.2fr) minmax(220px,1.8fr) auto; gap:16px; padding:15px 0; }
.desk-sku-title { display:flex; flex-direction:column; gap:6px; align-items:flex-start; min-width:0; }
.desk-sku-title strong { font-size:.85rem; font-weight:650; }
.sheet-stock-pill { display:inline-flex; align-items:center; min-height:25px; gap:4px; padding:3px 8px; border-radius:99px; background:var(--brand-tint); color:var(--brand-deep); font-size:.72rem; font-weight:650; font-variant-numeric:tabular-nums; white-space:nowrap; }
.sheet-stock-pill.soldout { color:var(--muted); background:var(--soft); }
.desk-sku-ledger { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:8px; margin:0; }
.desk-sku-ledger dt { color:var(--muted); font-size:.68rem; }
.desk-sku-ledger dd { margin:3px 0 0; font-size:.9rem; font-weight:650; font-variant-numeric:tabular-nums; }
body[data-workspace] .desk-fulfillment-area>.desk-heading { margin-top:4px; }
.desk-fulfillment-area>.desk-order-filter,.desk-fulfillment-area>label { margin-top:18px; }
.fulfillment-order h3 { font-size:1rem; }
.fulfillment-items { margin:15px 0; padding:0; list-style:none; }
.fulfillment-items li { display:flex; justify-content:space-between; align-items:center; gap:14px; padding:12px 0; border-block-start:1px solid var(--line); }
.fulfillment-items li strong { font-size:.85rem; font-weight:600; }
.fulfillment-items li :is(small,span) { display:block; margin-top:3px; color:var(--muted); font-size:.73rem; }
.fulfillment-items li>b { white-space:nowrap; font-size:.9rem; font-variant-numeric:tabular-nums; }
.sheet-mobile-start { display:flex; justify-content:space-between; align-items:center; gap:20px; padding:22px; margin:20px 0 12px; border:1px solid var(--brand-line); border-radius:16px; background:var(--brand-tint); }
.sheet-mobile-start span { color:var(--brand-accent); font-size:.65rem; letter-spacing:.06em; font-weight:700; }
.sheet-mobile-start h2 { margin:4px 0 6px; font-size:1.08rem; letter-spacing:-.03em; }
.sheet-mobile-start p { margin:0; color:var(--muted); font-size:.79rem; line-height:1.6; }
.sheet-mobile-start>.btn { flex:none; }
.sheet-excel-options { border:1px solid var(--line); border-radius:14px; background:white; overflow:hidden; }
.sheet-excel-options>summary { display:flex; align-items:center; gap:12px; min-height:60px; padding:14px 18px; cursor:pointer; }
.sheet-excel-options>summary::after { content:'⌄'; font-size:1.2rem; margin-left:auto; }
.sheet-excel-options[open]>summary::after { content:'⌃'; }
.sheet-excel-options>summary>span { font-size:.87rem; font-weight:650; }
.sheet-excel-options>summary>small { color:var(--muted); font-size:.73rem; }
.sheet-excel-options .sheet-steps { gap:0; border-top:1px solid var(--line); }
.sheet-excel-options .sheet-steps .desk-card { border:0; border-radius:0; }
.sheet-excel-options .sheet-steps .desk-card+.desk-card { border-left:1px solid var(--line); }
.sheet-excel-options .sheet-steps h2 { font-size:.98rem; }
.sheet-excel-options .sheet-steps p { font-size:.78rem; }
.sheet-excel-options .sheet-steps .btn { font-size:.79rem; }
body[data-workspace] .sheet-order { padding:18px; }
.sheet-order .desk-card-head h3 { font-size:1rem; line-height:1.45; }
.sheet-order .desk-card-head small { font-size:.67rem; letter-spacing:0; }
.sheet-order-metrics { display:grid; grid-template-columns:1fr 1fr; gap:12px; margin:16px 0 8px; padding:13px 0; border-block:1px solid var(--line); }
.sheet-order-metrics dt { font-size:.7rem; color:var(--muted); }
.sheet-order-metrics dd { margin:4px 0 0; font-size:1.1rem; font-weight:700; letter-spacing:-.025em; font-variant-numeric:tabular-nums; }
.sheet-order-metrics dd small { margin-left:4px; font-size:.65rem; font-weight:500; color:var(--muted); }
.sheet-order-metrics>div:last-child { text-align:right; }
.sheet-order-metrics>div:last-child dd,.sheet-totals>div:last-child dd,.sheet-direct-total strong { color:var(--brand-deep); }
.sheet-review .sheet-totals { border:1px solid var(--brand-line); background:var(--brand-tint); border-radius:12px; }
.sheet-product-number { display:block; margin-bottom:4px; font-size:.67rem; color:var(--plum); }
.sheet-direct-host:not(:empty) { margin-top:24px; }
.sheet-direct { scroll-margin-top:126px; }
body[data-workspace] .sheet-review { scroll-margin-top:calc(80px + env(safe-area-inset-top)); }
@media (min-width:661px) and (max-width:900px) {
  body[data-workspace] .sheet-review { scroll-margin-top:calc(120px + env(safe-area-inset-top)); }
}
@media (max-width:660px) {
  body[data-workspace] .sheet-review { scroll-margin-top:calc(var(--app-header-height,56px) + 12px); }
}
.sheet-direct-tools { display:grid; grid-template-columns:minmax(0,1fr) minmax(140px,.4fr); gap:10px; margin:16px 0 10px; }
.sheet-direct-tools label { display:grid; gap:6px; color:var(--muted); font-size:.74rem; font-weight:600; }
.sheet-direct-tools :is(input,select) { width:100%; min-width:0; min-height:46px; border:1px solid var(--line); background:white; border-radius:10px; padding:9px 12px; }
.sheet-direct-stock-time,.sheet-direct-hint { color:var(--muted); font-size:.7rem; line-height:1.6; margin:10px 0; }
.sheet-direct-lines { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:12px; }
.sheet-direct-line { display:grid; gap:12px; min-width:0; padding:16px; background:white; border:1px solid var(--line); border-radius:14px; }
.sheet-direct-identity small { display:block; color:var(--muted); font-size:.68rem; }
.sheet-direct-identity h3 { margin:4px 0; font-size:.94rem; line-height:1.45; letter-spacing:-.025em; overflow-wrap:anywhere; }
.sheet-direct-identity>span { font-size:.8rem; color:var(--muted); }
.sheet-direct-prices { display:flex; flex-wrap:wrap; gap:5px 12px; font-size:.72rem; color:var(--muted); font-variant-numeric:tabular-nums; }
.sheet-direct-prices b { color:var(--ink); font-weight:650; }
.sheet-direct-quantity { display:flex; justify-content:space-between; align-items:center; gap:12px; padding-top:12px; border-top:1px solid var(--line); }
.sheet-direct-quantity label { display:flex; align-items:center; gap:8px; font-size:.73rem; white-space:nowrap; }
.sheet-direct-quantity input { width:78px; min-height:46px; padding:8px 10px; border:1px solid #a4a9b5; border-radius:10px; text-align:center; background:white; font-size:16px; font-weight:650; font-variant-numeric:tabular-nums; }
.sheet-direct-quantity input:disabled { color:#95959d; background:#f3f3f5; border-color:var(--line); }
.sheet-direct-quantity input:focus { border-color:var(--brand-accent); }
.sheet-direct-line:focus-within { border-color:var(--brand-line); }
.sheet-direct-empty { padding:30px 16px; text-align:center; color:var(--muted); font-size:.85rem; border:1px dashed var(--line); border-radius:14px; }
.sheet-direct-actions { display:flex; align-items:center; justify-content:space-between; gap:16px; padding:17px 0; margin-top:12px; border-top:1px solid var(--line); }
.sheet-direct-total { display:grid; gap:3px; }
.sheet-direct-total>span { font-size:.75rem; }
.sheet-direct-total strong { font-size:1.22rem; letter-spacing:-.035em; font-variant-numeric:tabular-nums; }
.sheet-direct-total small { font-size:.65rem; color:var(--muted); }
.sheet-confirm-actions { padding:14px 0; }
@media(max-width:760px) {
  body[data-workspace] .inventory-product .desk-sku { grid-template-columns:minmax(0,1fr); gap:12px; }
  .desk-sku-title { flex-direction:row; justify-content:space-between; align-items:center; }
  .desk-sku-ledger { padding:10px 12px; border-radius:9px; background:#f7f7f8; }
  body[data-workspace] .inventory-product .desk-sku .btn { justify-self:stretch; width:100%; grid-column:auto; }
  .inventory-product .desk-card-head>.desk-actions { width:100%; display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); }
  .sheet-mobile-start { flex-direction:column; align-items:stretch; gap:14px; padding:18px; }
}
@media(max-width:660px) {
  body[data-workspace] :is(#vendor-desk,#stock-sheet-desk) .desk-stats { gap:0; background:white; border-radius:14px; }
  body[data-workspace] :is(#vendor-desk,#stock-sheet-desk) .desk-stats>div { padding:13px 15px; }
  body[data-workspace] :is(#vendor-desk,#stock-sheet-desk) .desk-stats strong { font-size:1.35rem; }
  .inventory-switch { max-width:none; }
  body[data-workspace] #vendor-desk .desk-tools { gap:10px; }
  body[data-workspace] #vendor-desk .desk-tools>label:first-child { flex-basis:100%; }
  body[data-workspace] #vendor-desk .desk-tools>.btn { min-width:88px; }
  .sheet-excel-options>summary { flex-wrap:wrap; gap:3px 10px; }
  .sheet-excel-options>summary>small { flex:1; font-size:.66rem; }
  .sheet-direct-tools { grid-template-columns:minmax(0,1fr); }
  .sheet-direct-tools>label:last-child { display:flex; align-items:center; justify-content:space-between; }
  .sheet-direct-tools>label:last-child select { width:auto; min-width:170px; max-width:80%; }
  .sheet-direct-lines { grid-template-columns:minmax(0,1fr); gap:10px; }
  .sheet-direct-line { padding:14px; }
  .sheet-direct-actions { position:sticky; bottom:calc(var(--workspace-bottom-height,64px) + env(safe-area-inset-bottom)); z-index:3; flex-direction:column; align-items:stretch; gap:10px; padding:13px 14px; margin-inline:-4px; border:1px solid var(--line); border-radius:14px; background:rgba(255,255,255,.98); box-shadow:0 -3px 15px #19191d05; }
  .sheet-direct-total { grid-template-columns:minmax(0,1fr) auto; gap:2px 12px; align-items:center; }
  .sheet-direct-total small { grid-column:1/-1; }
  .sheet-direct-total strong { font-size:1.1rem; }
  .sheet-direct-actions .desk-actions { display:grid; grid-template-columns:minmax(0,1fr) auto; }
  .sheet-direct-actions .desk-actions>.btn { min-height:46px; }
  .sheet-confirm-actions { display:grid; grid-template-columns:minmax(0,1fr) minmax(0,1fr); gap:8px; }
  .sheet-confirm-actions>[data-sheet-action="confirm"] { grid-column:1/-1; min-height:48px; }
  .sheet-review .desk-note { font-size:.77rem; }
  body[data-workspace] .sheet-lines { border-collapse:separate; border-spacing:0; }
  body[data-workspace] .sheet-lines thead { position:absolute; width:1px; height:1px; overflow:hidden; clip-path:inset(50%); }
  body[data-workspace] .sheet-lines tbody { display:grid; gap:10px; }
  body[data-workspace] .sheet-lines tr { display:block; padding:12px; border:1px solid var(--line); border-radius:10px; background:#fbfbfc; }
  body[data-workspace] .sheet-lines tbody th { display:block; padding:0 0 8px; border:0; font-size:.86rem; }
  body[data-workspace] .sheet-lines tbody td { display:flex; justify-content:space-between; gap:12px; padding:4px 0; border:0; font-size:.8rem; }
  body[data-workspace] .sheet-lines tbody td::before { content:attr(data-label); float:none; color:var(--muted); font-size:.72rem; }
  .sheet-history>.desk-card-head { gap:10px; align-items:center; }
  .sheet-history>.desk-card-head>.btn { font-size:.72rem; padding-inline:10px; }
  .sheet-order-metrics dd { font-size:1rem; }
  .sheet-order-metrics dd small { display:block; margin:2px 0 0; }
  .sheet-order>[data-sheet-action="acknowledge"],.fulfillment-order>.btn { width:100%; min-height:46px; }
  #vendor-desk .desk-dialog { width:calc(100% - 16px); max-height:calc(100dvh - 32px); padding:20px 16px; border-radius:18px; }
  #vendor-desk .desk-dialog .desk-form>.btn,#vendor-desk .desk-dialog>.btn { width:100%; min-height:48px; }
  #vendor-desk .desk-dialog .desk-form { max-width:none; }
}
@media(max-width:600px) {
  .sheet-excel-options .sheet-steps .desk-card+.desk-card { border-left:0; border-top:1px solid var(--line); }
}
