/* Stage 5: warehouse read views only. */
.warehouse-tabs{grid-template-columns:repeat(3,minmax(0,1fr))}
.warehouse-explanation{color:var(--muted);font-size:.82rem;line-height:1.9}
.warehouse-view-toolbar{display:flex;gap:12px;margin-block:16px;align-items:center}
.warehouse-view-toolbar input{flex:1;min-width:0}
.warehouse-view-toolbar select{width:auto;max-width:40%}
.warehouse-quantities{display:grid;gap:4px;min-width:180px}
.warehouse-quantity{font-variant-numeric:tabular-nums;font-size:.8rem;white-space:nowrap}
.warehouse-state{display:inline-flex;align-items:center;padding:6px 10px;border:1px solid currentColor;border-radius:8px;font-size:.78rem;line-height:1.7}
.warehouse-ready{color:#18713d;background:#18713d12}
.warehouse-transit{color:#2964ac;background:#2964ac12}
.warehouse-committed{color:#9a520a;background:#9a520a12}
.warehouse-overdue{color:#b42940;background:#b4294012}
.warehouse-archived{color:var(--muted);background:var(--surface)}
.warehouse-progress{display:grid;gap:8px;min-width:130px}
.warehouse-progress progress{width:100%;accent-color:var(--accent)}
.warehouse-progress small{color:var(--muted)}
.warehouse-lot-family{padding-block:12px;border-bottom:1px solid var(--line);overflow:auto}
.warehouse-lot-family p{font-size:.8rem;line-height:1.9}
[data-theme="dark"] .warehouse-ready{color:#84dfa5}
[data-theme="dark"] .warehouse-transit{color:#91bfff}
[data-theme="dark"] .warehouse-committed{color:#ffca82}
[data-theme="dark"] .warehouse-overdue{color:#ffa1af}
@media(max-width:599px){.warehouse-tabs{grid-template-columns:repeat(2,minmax(0,1fr))}.warehouse-view-toolbar{flex-wrap:wrap}.warehouse-view-toolbar input{flex-basis:100%}.warehouse-view-toolbar select{max-width:100%;width:100%}.stock-overview{grid-template-columns:repeat(2,minmax(0,1fr))}.stock-overview-card{min-width:0}.warehouse-quantities{min-width:0}.warehouse-summary{overflow-wrap:anywhere}}

/* Logical spacing keeps the existing RTL layout and mobile table styles. */
.stock-overview{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:12px}
.stock-overview-card{min-width:0;text-align:start;white-space:normal}
.stock-overview-card small{display:block;line-height:1.8;overflow-wrap:anywhere}
.warehouse-smart-views{display:flex;flex-wrap:wrap;gap:8px;margin-block:16px}
.warehouse-smart-views button{white-space:normal;line-height:1.8}
.warehouse-smart-views button.active{background:var(--accent);color:#fff;border-color:var(--accent)}
.warehouse-product,.warehouse-row-state{display:flex;flex-direction:column;align-items:flex-start;gap:6px}
.warehouse-product small{color:var(--muted)}
.warehouse-partner{color:#7650a2;background:#7650a212;white-space:normal;overflow-wrap:anywhere}
.warehouse-owner-name{color:#7650a2}
.warehouse-sellable{color:#18713d;font-size:1rem;white-space:nowrap;font-variant-numeric:tabular-nums}
.warehouse-committed-count{color:#9a520a;font-size:.8rem;white-space:nowrap;font-variant-numeric:tabular-nums}
.model-product-row .warehouse-partner{margin-block:4px}
[data-theme="dark"] .warehouse-partner,[data-theme="dark"] .warehouse-owner-name{color:#d2b0ff}
[data-theme="dark"] .warehouse-sellable{color:#84dfa5}
[data-theme="dark"] .warehouse-committed-count{color:#ffca82}
@media(max-width:1399px){.stock-overview{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(max-width:599px){.warehouse-smart-views{display:grid;grid-template-columns:repeat(2,minmax(0,1fr))}.warehouse-smart-views button{min-width:0}.warehouse-sellable,.warehouse-committed-count{white-space:normal}}

.location-breakdown,.ownership-breakdown{display:flex;flex-wrap:wrap;gap:6px;align-items:flex-start}
.warehouse-route{color:#a95c0b;background:#a95c0b12}
.warehouse-capital-owner{display:inline-block;border:1px solid var(--line);padding:5px 8px;border-radius:8px;font-size:.8rem;background:var(--surface)}
.warehouse-filtered-qty{display:block;font-size:1.1rem;color:#7650a2;line-height:1.8;overflow-wrap:anywhere}
.warehouse-total-qty{display:block;color:var(--muted);font-size:.8rem;margin-block-start:4px}
.product-location-breakdown,.product-capital-breakdown{display:grid;gap:6px;margin-block:10px;min-width:0}
.product-location-breakdown>small,.product-capital-breakdown>small{color:var(--muted)}
.product-filtered-stock{display:grid;gap:6px}
.warehouse-filtered-actions{display:grid;gap:10px}
.warehouse-filtered-actions small{display:block;color:var(--muted)}
#productRecipientFilter,.warehouse-smart-views select{width:auto;max-width:100%;min-height:44px}
[data-theme="dark"] .warehouse-route{color:#ffca82}
[data-theme="dark"] .warehouse-filtered-qty{color:#d2b0ff}
@media(max-width:599px){#productRecipientFilter,.warehouse-smart-views select{width:100%}.warehouse-smart-views select{grid-column:1/-1}}

.stock-overview{grid-template-columns:repeat(3,minmax(0,1fr))}
@media(max-width:599px){.stock-overview{gap:.4rem}.stock-overview-card small{display:none}}

/* One inventory list. Detail and operations only live in the drawer. */
.simple-inventory { font-size:14px; }
.simple-inventory :is(p,span,small,button,select,input) { font-size:14px; }
.inventory-summary { display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px;margin:18px 0; }
.inventory-summary-card { display:flex;align-items:center;justify-content:space-between;gap:12px;padding:18px;border:1px solid var(--line);border-radius:12px;background:var(--surface);text-align:start;min-width:0; }
.inventory-summary-card strong { font-size:26px; }
.inventory-summary-card[aria-pressed=true] { outline:2px solid currentColor;outline-offset:-2px; }
.inventory-ready { color:#247449; }
.inventory-waiting { color:#a05b0c; }
.inventory-transit { color:#2468b6; }
[data-theme=dark] .inventory-ready { color:#82d6a3; }
[data-theme=dark] .inventory-waiting { color:#efb86c; }
[data-theme=dark] .inventory-transit { color:#8cbeef; }
.inventory-toolbar { display:flex;gap:10px;align-items:start;margin:18px 0; }
.inventory-toolbar > input { flex:1;min-width:120px; }
.inventory-toolbar > select { width:180px;min-width:0; }
.inventory-toolbar input,.inventory-toolbar select { min-height:44px; }
.inventory-more { position:relative;flex:none; }
.inventory-more summary { cursor:pointer;padding:10px;min-height:44px; }
.inventory-extra-filters { display:grid;gap:10px;min-width:180px;padding:12px;border:1px solid var(--line);border-radius:10px; }
.inventory-extra-filters select { width:100%; }
.inventory-list-head,.inventory-model-row { display:grid;grid-template-columns:minmax(180px,1fr) repeat(3,minmax(90px,120px)) 24px;column-gap:16px;align-items:center; }
.inventory-list-head { padding:12px 18px;color:var(--muted);border-bottom:1px solid var(--line); }
.inventory-model-row { width:100%;padding:18px;margin:0;text-align:start;border:0;border-bottom:1px solid var(--line);border-radius:0;background:transparent;color:var(--ink);white-space:normal; }
.inventory-model-row:hover { background:var(--subtle); }
.inventory-model-row:focus-visible { outline:2px solid var(--accent);outline-offset:-2px; }
.inventory-model-row > .inventory-three { display:contents; }
.inventory-model-name { display:grid;gap:5px;min-width:0;overflow-wrap:anywhere; }
.inventory-model-name strong { font-size:16px; }
.inventory-model-name > span { color:var(--muted);direction:ltr;text-align:right; }
.inventory-count { display:grid;gap:4px;min-width:0; }
.inventory-count strong { font-size:22px; }
.inventory-model-row .inventory-count > span { display:none; }
.inventory-places { grid-column:1/-1;margin:12px 0 0;color:var(--muted);white-space:nowrap;overflow:hidden;text-overflow:ellipsis; }
.inventory-row-arrow { color:var(--muted); }
.inventory-three { display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px; }
.inventory-account h4 { font-size:16px;margin:16px 0 8px; }
.inventory-place-detail { padding:12px 0;border-bottom:1px solid var(--line); }
.inventory-place-detail > p { margin:0 0 12px;overflow-wrap:anywhere; }
.inventory-account-detail,.inventory-account-detail :is(p,span,button,summary) { font-size:14px; }
.inventory-account-detail .inventory-count > span { font-size:13px; }
.inventory-account-detail .inventory-count strong { font-size:20px; }
.inventory-count-warning { padding:12px;border:1px solid var(--line);border-radius:10px;color:var(--ink);background:var(--subtle); }
.inventory-drawer-actions,.inventory-place-actions { display:flex;flex-wrap:wrap;gap:8px;margin-top:16px; }
.inventory-advanced { margin-top:20px;padding-top:14px;border-top:1px solid var(--line); }
.inventory-advanced summary { cursor:pointer;margin-bottom:12px; }
.record-drawer:has(.inventory-account-detail) { width:min(560px,100vw); }
.record-drawer:has(.inventory-account-detail) > footer { display:none; }
.record-drawer:has(.inventory-account-detail) .drawer-body { overflow-x:hidden;min-width:0; }
.inventory-dispatch-row { width:100%;display:grid;grid-template-columns:minmax(110px,.6fr) minmax(130px,.8fr) minmax(180px,1.6fr);gap:14px;padding:18px;text-align:start;white-space:normal;background:transparent;border:0;border-bottom:1px solid var(--line);border-radius:0; }
.inventory-dispatch-row span { overflow-wrap:anywhere; }
#adminProductsSection .product-row,#adminProductsSection .product-table-head { grid-template-columns:minmax(0,1.7fr) minmax(160px,1fr) minmax(100px,.6fr) minmax(70px,.4fr); }
#adminProductsSection :is(small,.cell-label,.status-text,.product-main small,.product-sale-price small) { font-size:13px; }
#adminProductsSection #inventoryPurchaseExport[hidden] { display:none; }
@media(max-width:1023px) {
 .inventory-list-head,.inventory-model-row { grid-template-columns:minmax(130px,1fr) repeat(3,minmax(65px,90px)) 18px;column-gap:10px; }
 .inventory-toolbar { flex-wrap:wrap; }.inventory-toolbar > input { flex-basis:100%; }
}
@media(max-width:599px) {
 .inventory-summary { gap:8px; }.inventory-summary-card { display:grid;gap:8px;padding:12px; }.inventory-summary-card strong { font-size:24px; }
 .simple-inventory :is(p,span,small,button,select,input) { font-size:13px; }
 .inventory-toolbar { display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px; }
 .inventory-toolbar > input { grid-column:1/-1;width:100%;min-width:0; }
 .inventory-toolbar > select { width:100%; }.inventory-more { grid-column:1/-1; }
 .inventory-extra-filters { grid-template-columns:1fr;min-width:0; }
 .inventory-list-head { display:none; }
 .inventory-model-row { grid-template-columns:repeat(3,minmax(0,1fr));padding:16px;border:1px solid var(--line);border-radius:12px;margin:12px 0;gap:14px 8px; }
 .inventory-model-name { grid-column:1/-1; }.inventory-model-name strong { font-size:16px; }
 .inventory-model-row .inventory-count > span { display:block;font-size:13px; }
 .inventory-row-arrow { display:none; }.inventory-places { margin:0;grid-column:1/-1; }
 .record-drawer:has(.inventory-account-detail) { inset:auto 0 0;max-height:87dvh;width:100%;border-radius:20px 20px 0 0;padding-bottom:env(safe-area-inset-bottom); }
 .record-drawer:has(.inventory-account-detail) > header { flex-shrink:0;padding:18px; }
 .record-drawer:has(.inventory-account-detail) .drawer-body { min-height:0;padding:16px; }
 .inventory-dispatch-row { grid-template-columns:1fr;gap:8px;padding:16px;border:1px solid var(--line);border-radius:12px;margin:12px 0; }
 #adminProductsSection .product-row { grid-template-columns:repeat(2,minmax(0,1fr)); }
 #adminProductsSection .product-main { grid-column:1/-1; }#adminProductsSection .product-price-cell { grid-column:1/-1; }
 #adminProductsSection .product-table-head { display:none; }
}
.simple-inventory > .operation-page-heading { flex-wrap:nowrap;margin-bottom:14px; }
.simple-inventory > .operation-page-heading h2 { margin:0; }
.simple-inventory > .operation-page-heading p:empty { display:none; }
.simple-inventory > .operation-page-heading .row-actions { width:auto;display:flex; }
.simple-inventory > .warehouse-tabs { grid-template-columns:repeat(2,minmax(0,1fr)); }
.inventory-dispatch-row { grid-template-columns:minmax(110px,.6fr) minmax(130px,.8fr) minmax(180px,1.6fr) minmax(180px,1fr);align-items:center; }
.dispatch-number { padding:0;border:0;background:transparent;text-align:start;font-weight:700;color:var(--ink); }
.dispatch-quick-actions { display:flex;gap:8px;flex-wrap:wrap; }
.dispatch-quick-actions button { min-height:40px;font-size:13px;white-space:nowrap; }
.inventory-dispatch-row[aria-busy=true] { opacity:.65; }
@media(max-width:1023px){.inventory-dispatch-row { grid-template-columns:110px 1fr; }.dispatch-quick-actions { justify-content:flex-start; }}
@media(max-width:599px){.inventory-dispatch-row { grid-template-columns:1fr; }.dispatch-quick-actions { display:grid;grid-template-columns:repeat(2,minmax(0,1fr)); }}

/* Shared model status and prices, matching the approved 2.57.1 prototype. */
.model-status-line { display:block;width:100%;min-width:0;min-height:44px;margin:0;padding:6px 0;border:0;border-radius:0;background:transparent;color:var(--ink);text-align:start;white-space:normal;line-height:2;overflow-wrap:anywhere; }
button.model-status-line { cursor:pointer;box-shadow:none; }
button.model-status-line:hover { background:transparent;text-decoration:underline;text-underline-offset:5px; }
button.model-status-line:focus-visible { outline:2px solid var(--accent);outline-offset:2px; }
.model-status-line span,.simple-inventory .model-status-line span { font-size:13px; }
.model-status-separator,.model-status-empty { color:var(--muted); }
.model-prices { display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:16px;min-width:0; }
.model-price { display:grid;align-content:center;gap:4px;min-width:0;overflow-wrap:anywhere; }
.model-price small { color:var(--muted);font-size:12px; }
.model-price strong { color:var(--ink);font-size:14px;font-weight:600; }
.simple-inventory .inventory-list-head,.simple-inventory .inventory-model-row { grid-template-columns:minmax(220px,1.65fr) minmax(120px,1fr) minmax(150px,1fr) 100px;gap:18px; }
.inventory-model-row > .model-prices { display:contents; }
.inventory-model-row > .inventory-model-detail { font-size:12px;color:var(--accent); }
.inventory-account-detail > .model-prices { padding-bottom:20px;margin-bottom:16px;border-bottom:1px solid var(--line); }
.inventory-account-detail > .model-edit-price { margin-bottom:20px; }
.inventory-account-detail .model-account-heading { margin:20px 0 12px; }
.inventory-account-detail .model-arrival { color:var(--muted);font-size:12px;line-height:2; }
.inventory-account-detail .inventory-place-detail { padding-inline-start:13px;border-inline-start:2px solid var(--line);margin:12px 2px; }
.record-drawer:has(.inventory-account-detail) > header > .model-status-line { padding:0;min-height:0; }
#adminProductsSection .product-main > .model-status-line { margin-top:0; }
#adminProductsSection .product-sale-price strong { color:var(--ink); }
@media(min-width:600px) and (max-width:1399px) {
 .simple-inventory .inventory-list-head,.simple-inventory .inventory-model-row { grid-template-columns:minmax(180px,1.4fr) minmax(95px,1fr) minmax(120px,1fr);gap:14px; }
 .simple-inventory .inventory-list-head > :last-child { display:none; }
 .inventory-model-row > .inventory-model-detail, .inventory-model-row > .inventory-model-actions { grid-column:1/-1;justify-self:end; }
}
@media(max-width:599px) {
 .simple-inventory .inventory-model-row { grid-template-columns:repeat(2,minmax(0,1fr));gap:12px;padding:18px 0;margin:0;border:0;border-bottom:1px solid var(--line);border-radius:0; }
 .inventory-model-row > .inventory-model-name { grid-column:1/-1; }
 .inventory-model-row > .inventory-model-detail, .inventory-model-row > .inventory-model-actions { grid-column:1/-1;width:100%; }
 .inventory-model-name strong { font-size:15px; }
 .simple-inventory .model-price small { font-size:11px; }
 .simple-inventory .model-price strong { font-size:13px; }
 .record-drawer:has(.inventory-account-detail) { max-height:90dvh; }
 .model-prices { gap:12px; }
 #adminProductsSection .product-row,#adminProductsSection .product-main { min-width:0; }
}


/* ---- v2.59.0 UX: smooth, no mobile zoom, light loading ---- */
/* iOS Safari zooms into any field whose text is under 16px. The old inventory rules set 13-14px
   and won over the mobile rules, so every search box zoomed. This block is loaded last and wins. */
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
@media (max-width:1023px), (pointer: coarse) {
  input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="color"]),
  select, textarea,
  .simple-inventory input, .simple-inventory select, .simple-inventory textarea { font-size: 16px !important; }
}

/* Soft page entrance: only opacity/transform, so it stays on the GPU and never blocks typing. */
@keyframes page-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.workspace-page:not(.hidden) { animation: page-in .18s ease-out both; }
#operationsContent > *, #adminProducts > .product-row { animation: page-in .16s ease-out both; }
.inventory-model-row, .product-row { content-visibility: auto; contain-intrinsic-size: auto 96px; }
.inventory-model-row, .product-row, button, .inventory-summary-card { transition: opacity .15s ease; }
.inventory-model-row { animation: none; }

/* Loading placeholders */
.skeleton-list { display: grid; gap: 10px; padding: 6px 0; }
.skeleton-row { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 14px; align-items: center; padding: 18px; border: 1px solid var(--line); border-radius: 12px; }
.skeleton-row > i { display: block; height: 14px; border-radius: 7px; background: linear-gradient(90deg, var(--subtle) 25%, var(--line) 37%, var(--subtle) 63%); background-size: 400% 100%; animation: skeleton-shimmer 1.3s ease infinite; }
.skeleton-row > i:first-child { height: 18px; }
@keyframes skeleton-shimmer { 0% { background-position: 100% 50%; } 100% { background-position: 0 50%; } }

/* Customer intro copy buttons */
.inventory-model-actions { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; }
.inventory-model-actions > button { font-size: 12px; white-space: nowrap; }
.inventory-model-copy, .row-copy-intro { color: var(--accent); }
.row-copy-intro { padding: 6px 10px; font-size: 12px; white-space: nowrap; }
.clipboard-proxy { position: fixed; top: 0; inset-inline-start: 0; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
@media (max-width:599px) {
  .inventory-model-actions > button { flex: 1 1 0; min-height: 40px; }
  .row-copy-intro { min-height: 36px; }
}
@media (prefers-reduced-motion: reduce) {
  .workspace-page, #operationsContent > *, #adminProducts > .product-row, .skeleton-row > i { animation: none !important; }
}

/* 2.62.1: free stock and the two kinds of sold commitments stay separate. */
.inventory-summary,.inventory-three{grid-template-columns:repeat(4,minmax(0,1fr))}
.inventory-summary-card{flex-wrap:wrap;line-height:1.8}
.inventory-waitingArrival{color:var(--accent)}
.inventory-places{white-space:normal;overflow:visible;line-height:1.9}
.inventory-places>span{display:block}
.inventory-owner-details>summary,.order-technical-shipping>summary{cursor:pointer;min-height:44px;padding-block:10px}
.inventory-account-detail .inventory-count>span{white-space:normal;overflow-wrap:anywhere}
@media(max-width:599px){.inventory-summary,.inventory-three{grid-template-columns:repeat(2,minmax(0,1fr))}.inventory-summary-card{padding:12px;gap:6px}.inventory-summary-card>span{width:100%}}

/* 2.63.0: unified goods, inline details and separate dispatch/places routes. */
.simple-inventory.warehouse-products .warehouse-goods-grid{display:grid;grid-template-columns:minmax(180px,2.5fr) repeat(3,minmax(66px,.8fr)) repeat(2,minmax(100px,1.2fr)) minmax(90px,1fr);gap:12px;align-items:center}
.warehouse-products .warehouse-goods-head{padding:8px 16px;color:var(--muted);font-size:.8rem}
.warehouse-sort-button{border:0;background:transparent;color:inherit;text-align:start;padding:8px 0;min-height:44px;font:inherit}
.simple-inventory.warehouse-products .inventory-model-row{padding:16px;border:1px solid var(--line);border-radius:12px;margin-block:8px;background:var(--surface);cursor:pointer;min-width:0}
.warehouse-products .inventory-model-row:hover{border-color:var(--accent)}
.warehouse-products .inventory-model-row.inactive{opacity:.65}
.warehouse-products .inventory-model-name{min-width:0;white-space:normal;overflow-wrap:anywhere}
.warehouse-products .inventory-model-name small{display:block;color:var(--muted);font-size:.75rem}
.warehouse-products .model-price{min-width:0;overflow-wrap:anywhere}
.warehouse-number strong{font-size:1.1rem;font-variant-numeric:tabular-nums}
.warehouse-number small{display:none}
.warehouse-goods-status{display:flex;flex-wrap:wrap;gap:8px;align-items:center}
.warehouse-goods-status .secondary{padding:5px 8px;font-size:.75rem}
.warehouse-searchbar{display:flex;gap:10px;align-items:center;margin-block:16px}
.warehouse-searchbar input{flex:1;min-width:0}
.warehouse-searchbar:has(>select[aria-label="ترتیب صف ارسال"]){display:grid;grid-template-columns:minmax(0,1fr) 190px}
.warehouse-searchbar:has(>select[aria-label="ترتیب صف ارسال"])>input{width:100%;min-width:0;height:50px;box-sizing:border-box}
.warehouse-searchbar:has(>select[aria-label="ترتیب صف ارسال"])>select{width:100%;max-width:none;min-width:0;height:50px;box-sizing:border-box}
@media(max-width:599px){.warehouse-searchbar:has(>select[aria-label="ترتیب صف ارسال"]){grid-template-columns:minmax(0,1fr)}}
.warehouse-filter-panel{display:grid;grid-template-columns:repeat(2,minmax(0,1fr)) auto;gap:12px;align-items:end;padding:14px;border:1px solid var(--line);border-radius:12px;background:var(--surface)}
.warehouse-filter-panel[hidden]{display:none}
.warehouse-filter-panel label,.warehouse-inline-form label{display:grid;gap:5px;color:var(--muted)}
.warehouse-filter-panel select{width:100%;min-width:0}
.warehouse-chip-row,.warehouse-active-filters,.warehouse-segment{display:flex;gap:8px;flex-wrap:wrap;align-items:center;margin-block:12px}
.warehouse-chip-row button,.warehouse-active-filters button{white-space:nowrap}
.warehouse-active-filters .filter-chip{border-color:var(--accent);color:var(--accent)}
.warehouse-chip-row [aria-pressed=true],.warehouse-segment [aria-pressed=true]{background:var(--accent);color:var(--surface);border-color:var(--accent)}
.warehouse-mobile-sort{display:none}
.warehouse-drawer-tabs{display:flex;gap:6px;overflow-x:auto;border-bottom:1px solid var(--line);margin-block-end:16px;padding-block-end:8px}
.warehouse-drawer-tabs button{white-space:nowrap;border:0;border-radius:0;background:transparent;color:var(--muted);padding:8px;font-size:.8rem}
.warehouse-drawer-tabs [aria-selected=true]{color:var(--accent);box-shadow:inset 0 -2px var(--accent)}
.warehouse-drawer-actions{display:flex;gap:8px;flex-wrap:wrap;margin-block:16px}
.warehouse-inline-form{display:grid;gap:12px}
.warehouse-inline-form input,.warehouse-inline-form textarea,.warehouse-inline-form select{width:100%;min-width:0}
.warehouse-transfer-summary,.warehouse-one-place{padding:12px;border:1px solid var(--accent);border-radius:10px;background:var(--surface)}
.warehouse-transfer-summary[hidden]{display:none}
.warehouse-transfer-summary p{margin-block:4px}
.warehouse-danger{border-top:1px dashed var(--line);padding-block:16px;display:flex;flex-wrap:wrap;gap:10px}
.warehouse-danger h4{flex-basis:100%;margin:0}
.warehouse-quantity-input{display:flex;align-items:end;gap:8px}
.warehouse-quantity-input[hidden]{display:none}
.warehouse-quantity-input label{flex:1}
.warehouse-arrival-row{display:grid;grid-template-columns:minmax(0,1.5fr) minmax(0,1.2fr) 128px 156px;gap:12px;align-items:center;padding:16px;margin-block:10px;border:1px solid var(--line);border-radius:12px}
.warehouse-arrival-row>div:first-child{min-width:0;overflow-wrap:anywhere}
.warehouse-arrival-row>span:not(.shipping-stage){min-width:0;line-height:1.9;overflow-wrap:anywhere}
.warehouse-arrival-row>.shipping-stage{box-sizing:border-box;width:112px;max-width:100%;min-height:42px;margin:0;justify-self:center;justify-content:center;text-align:center;white-space:normal}
.warehouse-arrival-row>.shipping-stage::before{flex-shrink:0}
.warehouse-arrival-row>.row-actions{min-width:0;justify-self:end;justify-content:flex-end;flex-wrap:nowrap;gap:6px}
.warehouse-arrival-row small{display:block;color:var(--muted)}
@media(max-width:1100px){
 .warehouse-arrival-row{grid-template-columns:minmax(0,1fr) auto;gap:12px 16px}
 .warehouse-arrival-row>div:first-child{grid-column:1/-1}
 .warehouse-arrival-row>span:not(.shipping-stage){grid-column:1/-1}
 .warehouse-arrival-row>.shipping-stage{grid-column:1;justify-self:start}
 .warehouse-arrival-row>.row-actions{grid-column:2}
}
@media(max-width:359px){
 .warehouse-arrival-row>.row-actions{grid-column:1/-1;justify-self:stretch;justify-content:flex-start;flex-wrap:wrap}
}
.warehouse-definition-grid{display:grid;grid-template-columns:minmax(0,1.4fr) minmax(0,1fr);gap:16px;align-items:start}
.warehouse-place-group{border:1px solid var(--line);border-radius:12px;padding:12px;margin-block:12px}
.warehouse-place-row{display:flex;gap:10px;justify-content:space-between;align-items:center;padding-block:10px;border-bottom:1px solid var(--line)}
.warehouse-place-row:last-child{border-bottom:0}
.warehouse-place-row small{display:block;color:var(--muted);font-size:.8rem}
.inventory-dispatch-row{display:flex;flex-wrap:wrap;gap:8px 16px;align-items:center}
.inventory-dispatch-row .dispatch-heading,.inventory-dispatch-row .dispatch-product-line{flex-basis:100%}
.dispatch-heading{display:flex;gap:12px;align-items:center}
.dispatch-product-line{color:var(--muted);white-space:normal}
.warehouse-goods-grid:focus-visible{outline:2px solid var(--accent);outline-offset:2px}
.inventory-ready,.inventory-transit,.inventory-waitingArrival{color:var(--accent)}
.inventory-waiting{color:var(--ink)}
@media(max-width:1100px) and (min-width:761px){.simple-inventory.warehouse-products .warehouse-goods-grid{grid-template-columns:minmax(140px,2fr) repeat(3,minmax(50px,.7fr)) repeat(2,minmax(76px,1fr)) minmax(70px,.8fr);gap:6px}.warehouse-products .model-price strong{font-size:.8rem}}
@media(max-width:760px){
 .simple-inventory.warehouse-products .warehouse-goods-head{display:none}
 .warehouse-mobile-sort{display:flex;gap:10px;align-items:end;margin-block:12px}
 .warehouse-mobile-sort label{display:grid;gap:4px;flex:1;min-width:0}
 .warehouse-mobile-sort select{width:100%}
 .simple-inventory.warehouse-products .inventory-model-row{grid-template-columns:repeat(3,minmax(0,1fr));gap:14px 8px}
 .warehouse-products .inventory-model-name{grid-column:1/-1}
 .warehouse-number small{display:block;color:var(--muted);font-size:.75rem}
 .warehouse-products .inventory-model-row .model-price,.warehouse-products .inventory-model-row .warehouse-goods-status{grid-column:auto}
 .warehouse-products .inventory-model-row .model-price strong{font-size:.8rem}
 .warehouse-filter-panel{grid-template-columns:repeat(2,minmax(0,1fr))}
 .warehouse-filter-panel>button{grid-column:1/-1}
 .warehouse-chip-row{flex-wrap:nowrap;overflow-x:auto;padding-block:4px}
 .warehouse-definition-grid{grid-template-columns:minmax(0,1fr)}
 .warehouse-summary{grid-template-columns:repeat(2,minmax(0,1fr))}
 .warehouse-searchbar select{max-width:48%}
}
@media(prefers-reduced-motion:reduce){.simple-inventory.warehouse-products .inventory-model-row{transition:none;animation:none}}

@media(min-width:761px){.simple-inventory.warehouse-products .inventory-model-row>.inventory-model-name{grid-column:auto}}

.warehouse-inline-form [hidden]{display:none}

/* A six-column ledger cannot fit the product drawer; use full-width events. */
.warehouse-history-list{list-style:none;margin:0 0 16px;padding:0;display:grid;gap:12px;min-width:0}
.warehouse-history-list>li{min-width:0}
.warehouse-history-list .warehouse-history-event{display:grid;gap:10px;width:100%;min-width:0;padding:14px;text-align:start;font:inherit;line-height:1.9;color:var(--ink);background:var(--surface);border:1px solid var(--line);border-radius:12px;white-space:normal}
.warehouse-history-heading{display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:8px 16px}
.warehouse-history-heading time{white-space:nowrap;color:var(--muted);font-size:.8rem;font-variant-numeric:tabular-nums}
.warehouse-history-change{display:block;white-space:pre-line;overflow-wrap:anywhere;min-width:0}
.warehouse-history-meta{display:flex;flex-wrap:wrap;gap:4px 16px;color:var(--muted);font-size:.8rem;overflow-wrap:anywhere}
.warehouse-history-event:hover{border-color:var(--accent)}
.warehouse-history-event:focus-visible{outline:2px solid var(--accent);outline-offset:2px}

.simple-inventory.warehouse-products>.operation-page-heading{flex-wrap:wrap}
@media(max-width:760px){.simple-inventory.warehouse-products>.operation-page-heading .row-actions{display:flex;flex-wrap:wrap;width:100%;gap:8px}.simple-inventory.warehouse-products>.operation-page-heading .row-actions>*{flex:1 1 auto;min-width:0}}

.inventory-account-detail .inventory-three{grid-template-columns:repeat(3,minmax(0,1fr))}

/* Compact inventory history; no shared table or transit styles are changed. */
.warehouse-history-filters{display:flex;align-items:center;flex-wrap:wrap;gap:8px 12px;margin-block:12px 16px}
.warehouse-history-filters>label{flex:1 1 280px;min-width:0;font-size:0}
.warehouse-history-filters>label>input{width:100%;font-size:.85rem}
.warehouse-history-filters>.warehouse-chip-row{display:flex;gap:6px;flex-wrap:wrap;margin:0;overflow:visible}
.warehouse-history-filters .filter-chip{border:1px solid var(--line);border-radius:99px;padding:5px 11px;font-size:.75rem;min-height:32px;background:var(--surface);color:var(--ink)}
.warehouse-history-filters .filter-chip[aria-pressed=true]{background:var(--accent);color:var(--surface);border-color:var(--accent)}
.warehouse-history-advanced{flex-basis:100%;font-size:.8rem;color:var(--muted)}
.warehouse-history-advanced>summary{cursor:pointer;width:fit-content;padding:4px}
.warehouse-history-advanced>div{display:flex;align-items:end;flex-wrap:wrap;gap:10px;padding-block:10px}
.warehouse-history-advanced label{flex:1 1 160px;min-width:0;display:grid;gap:4px}
.warehouse-history-advanced input{width:100%}
.warehouse-history-table{width:100%;min-width:0}
.warehouse-history-grid{width:100%;border-collapse:collapse;table-layout:fixed;font-size:.8rem;line-height:1.8}
.warehouse-history-grid th{padding:8px 6px;text-align:start;font-size:.72rem;font-weight:400;color:var(--muted);border-bottom:1px solid var(--line)}
.warehouse-history-grid td{padding:10px 6px;border-bottom:1px solid var(--line);vertical-align:middle;overflow-wrap:anywhere}
.warehouse-history-grid :is(th,td):nth-child(1){width:10%;white-space:nowrap}
.warehouse-history-grid :is(th,td):nth-child(2){width:19%}
.warehouse-history-grid :is(th,td):nth-child(3){width:13%}
.warehouse-history-grid :is(th,td):nth-child(4){width:27%}
.warehouse-history-grid :is(th,td):nth-child(5){width:8%;text-align:center}
.warehouse-history-grid :is(th,td):nth-child(6){width:11%}
.warehouse-history-grid :is(th,td):nth-child(7){width:12%}
.warehouse-history-grid tbody tr{cursor:pointer}
.warehouse-history-grid tbody tr:hover{background:var(--accent-soft)}
.warehouse-history-grid tbody tr:focus-visible{outline:2px solid var(--accent);outline-offset:-2px}
.warehouse-history-summary{display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;line-height:1.85}
.warehouse-history-kind{display:inline-block;padding:2px 9px;border-radius:99px;font-size:.7rem;color:var(--accent);background:var(--accent-soft)}
.warehouse-history-kind-purchase{color:#17714a;background:#17714a15}
.warehouse-history-kind-return{color:#966000;background:#96600015}
.warehouse-history-kind-adjustment,.warehouse-history-kind-cancellation{color:var(--muted);background:var(--line)}
[data-theme=dark] .warehouse-history-kind-purchase{color:#82d6a3;background:#82d6a315}
[data-theme=dark] .warehouse-history-kind-return{color:#efb86c;background:#efb86c15}
@media(max-width:1100px){
 .warehouse-history-grid,.warehouse-history-grid tbody{display:block}
 .warehouse-history-grid thead{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%)}
 .warehouse-history-grid tbody{display:grid;gap:10px}
 .warehouse-history-grid tbody tr{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:6px 12px;padding:12px;border:1px solid var(--line);border-radius:12px}
 .warehouse-history-grid tbody td{display:block;width:auto!important;border:0;padding:0;text-align:start!important;min-width:0}
 .warehouse-history-grid td:nth-child(2){grid-column:1/-1;grid-row:1;font-weight:600}
 .warehouse-history-grid td:nth-child(1){grid-column:2;grid-row:2;color:var(--muted);font-size:.72rem}
 .warehouse-history-grid td:nth-child(3){grid-column:1;grid-row:2}
 .warehouse-history-grid td:nth-child(4){grid-column:1/-1;grid-row:3}
 .warehouse-history-grid td:nth-child(5){grid-column:1;grid-row:4}
 .warehouse-history-grid td:nth-child(6){grid-column:2;grid-row:4}
 .warehouse-history-grid td:nth-child(7){grid-column:1/-1;grid-row:5;color:var(--muted)}
 .warehouse-history-grid td:nth-child(n+5)::before{content:attr(data-label) ': ';color:var(--muted);font-size:.72rem}
 .warehouse-history-filters>label{flex-basis:100%}
}
