/* NextEst warehouse workspace. One palette for panels, forms and dialogs. */
body[data-nextest-role="warehouse"] {
  --wh-canvas:#031535;--wh-panel:linear-gradient(145deg,#0b3d7f,#062756 48%,#041c43);
  --wh-surface:#062756;--wh-raised:#0c3871;--wh-line:#2a8bd3;--wh-ink:#f4f9ff;--wh-sub:#bcd8f2;
  --wh-accent:#3fdcff;--wh-focus:#ffca62;--wh-amber:#ffd489;--wh-green:#75e4b0;
  --wh-button:linear-gradient(180deg,#0866c3,#06419f);
  --wh-edge:var(--wh-line);--wh-muted:var(--wh-sub);
  --wh-shadow:inset 0 0 14px #359af233,0 5px 15px #00132e55;
  background:radial-gradient(ellipse at 22% 0%,#124679,transparent 60%),var(--wh-canvas)!important;
  color:var(--wh-ink);color-scheme:dark;
}
html[data-color-mode="light"] body[data-nextest-role="warehouse"] {
  --wh-canvas:#eaf4ff;--wh-panel:linear-gradient(145deg,#e2f0ff,#f7fbff 50%,#edf6ff);
  --wh-surface:#f7fbff;--wh-raised:#daeaff;--wh-line:#82b3de;--wh-ink:#122f53;--wh-sub:#38597c;
  --wh-accent:#1163a6;--wh-focus:#0a65ac;--wh-amber:#884605;--wh-green:#08714e;
  --wh-shadow:inset 0 1px #fff,0 5px 15px #133c651a;
  background:var(--wh-canvas)!important;color-scheme:light;
}
body[data-nextest-role="warehouse"] #roleContent > .warehouse-workspace {
  min-width:0;max-width:1580px;margin-inline:auto;display:grid;gap:12px;
  font-family:Cairo,system-ui,Tahoma,sans-serif;line-height:1.55;color:var(--wh-ink);
  --text:var(--wh-ink);--muted:var(--wh-sub);--gold:var(--wh-amber);--accent-green:var(--wh-green);
}
body[data-nextest-role="warehouse"] #mgrCommandBar,
body[data-nextest-role="warehouse"] #sideDrawer {
  background:linear-gradient(155deg,#041733,#082955)!important;color:#eff7ff!important;
  border-color:#1e67a7!important;color-scheme:dark;
}
body[data-nextest-role="warehouse"] :is(#mgrCommandBar,#sideDrawer) :is(#tenantName,#whoAmI,.name,.role,.sub) {color:#e1efff!important}
body[data-nextest-role="warehouse"] #drawerNav .drawer-nav-item {min-height:44px;color:#e3f2ff!important}
body[data-nextest-role="warehouse"] #drawerNav .drawer-nav-item.active {
  background:var(--wh-button)!important;border-color:#59c5ff!important;color:#fff!important;
}
body[data-nextest-role="warehouse"] .wh-workspace-head {
  position:relative;isolation:isolate;display:flex;align-items:center;gap:clamp(12px,4vw,46px);
  min-height:clamp(158px,16vw,230px);padding:16px clamp(12px,2.2vw,28px);overflow:hidden;
  background:#041e49;border:1px solid #268fda;border-radius:16px;box-shadow:0 5px 18px #00152e65;
}
body[data-nextest-role="warehouse"] .wh-workspace-head::before {
  content:"";position:absolute;inset:0;z-index:-1;pointer-events:none;
  background:url('/assets/warehouse-yard-r31.webp') left center / clamp(540px,88%,1050px) auto no-repeat;
  mask-image:linear-gradient(90deg,#000 36%,#000c 49%,transparent 73%);
}
html[dir="ltr"] body[data-nextest-role="warehouse"] .wh-workspace-head::before {transform:scaleX(-1)}
body[data-nextest-role="warehouse"] .wh-workspace-title {display:flex;align-items:center;gap:12px;min-width:0}
body[data-nextest-role="warehouse"] .wh-workspace-title h1 {margin:0;color:#fff!important;font-size:clamp(26px,3.4vw,47px);font-weight:800;line-height:1.2}
body[data-nextest-role="warehouse"] .wh-workspace-mark {width:clamp(30px,4vw,48px);flex:none;color:#ffc05d}
body[data-nextest-role="warehouse"] .wh-workspace-mark svg {display:block;width:100%}
body[data-nextest-role="warehouse"] .wh-workspace-clock {display:block;color:#d9edff;font-size:clamp(11px,1.05vw,13px);margin-top:4px}
body[data-nextest-role="warehouse"] #roleContent .wh-quick-receive {
  display:inline-flex;align-items:center;gap:8px;padding:10px 14px;min-height:44px;flex:none;
  color:#fff!important;background:linear-gradient(#a95b08,#803e02)!important;border:1px solid #faca77;border-radius:11px;
  font-weight:800;text-decoration:none;box-shadow:0 0 14px #da96094a;
}
body[data-nextest-role="warehouse"] .wh-quick-receive svg {width:23px;height:23px}
body[data-nextest-role="warehouse"] #whStockMetrics {display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:10px}
body[data-nextest-role="warehouse"] #whStockMetrics .wh-metric {
  --tone:#54e6cf;--top:#087b6c;--bottom:#063c42;
  position:relative;display:grid;grid-template-columns:1fr auto;align-items:start;gap:6px;min-width:0;min-height:111px;
  margin:0;padding:10px 9px;text-align:start;line-height:1.45;color:#fff!important;
  background:linear-gradient(155deg,var(--top),var(--bottom) 64%)!important;
  border:1px solid var(--tone)!important;border-radius:13px;box-shadow:inset 0 0 13px color-mix(in srgb,var(--tone) 38%,transparent);
}
body[data-nextest-role="warehouse"] #whStockMetrics .wh-metric:nth-child(2) {--tone:#57c9ff;--top:#075cb3;--bottom:#082c65}
body[data-nextest-role="warehouse"] #whStockMetrics .wh-metric:nth-child(3) {--tone:#ffc45d;--top:#975607;--bottom:#53300a}
body[data-nextest-role="warehouse"] #whStockMetrics .wh-metric:nth-child(4) {--tone:#73e7a0;--top:#0b764a;--bottom:#063d35}
body[data-nextest-role="warehouse"] #whStockMetrics .wh-metric:nth-child(5) {--tone:#d694ff;--top:#752cac;--bottom:#3d1c62}
body[data-nextest-role="warehouse"] .wh-metric-copy {display:grid;gap:4px;min-width:0}
body[data-nextest-role="warehouse"] .wh-metric-label {font-weight:800;font-size:clamp(11px,1.13vw,15px);overflow-wrap:anywhere}
body[data-nextest-role="warehouse"] .wh-metric-copy strong {color:white!important;font-size:clamp(20px,2.4vw,33px);font-variant-numeric:tabular-nums;line-height:1.2}
body[data-nextest-role="warehouse"] .wh-metric-unit {color:#ebf5ff;font-size:11px}
body[data-nextest-role="warehouse"] .wh-metric-icon {display:grid;place-items:center;color:var(--tone)!important}
body[data-nextest-role="warehouse"] .wh-metric-icon svg {width:25px;height:25px;filter:drop-shadow(0 0 4px color-mix(in srgb,var(--tone) 60%,transparent))}
body[data-nextest-role="warehouse"] .wh-metric-arrow {display:none}
body[data-nextest-role="warehouse"] #whTabBody {display:grid!important;grid-template-columns:repeat(12,minmax(0,1fr));gap:12px;align-items:start;min-width:0}
body[data-nextest-role="warehouse"] #whTabBody>.wh-section {grid-column:span 6;min-width:0;padding:11px;scroll-margin-block-start:20px}
body[data-nextest-role="warehouse"] #whTabBody>.wh-section[hidden] {display:none!important}
body[data-nextest-role="warehouse"] #whTabBody>.wh-sec-load {grid-column:span 5}
body[data-nextest-role="warehouse"] #whTabBody>.wh-sec-stock {grid-column:span 7}
body[data-nextest-role="warehouse"] #whTabBody>.wh-sec-receive {grid-column:span 7}
body[data-nextest-role="warehouse"] #whTabBody>.wh-sec-held {grid-column:span 5}
body[data-nextest-role="warehouse"] #whTabBody>.wh-sec-inspect_returns {grid-column:1/-1}
body[data-nextest-role="warehouse"] #whTabBody>.wh-sec-stocktake,
body[data-nextest-role="warehouse"] #whTabBody>.wh-sec-requests_log,
body[data-nextest-role="warehouse"] #whTabBody>.wh-sec-my_moves {grid-column:span 4}
body[data-nextest-role="warehouse"] :is(#whTabBody,#whDetailOverlay,#stocktakeModalOverlay,#whReturnReceiptOverlay) :is(.wh-section,.card,details,.wh-detail-dialog,.wh-detail-report,.wh-detail-header,.wh-detail-field) {
  border-color:var(--wh-line)!important;background:var(--wh-panel)!important;color:var(--wh-ink)!important;
}
body[data-nextest-role="warehouse"] #whTabBody>.wh-section {border:1px solid var(--wh-line);border-radius:14px;box-shadow:var(--wh-shadow)}
body[data-nextest-role="warehouse"] #whTabBody .wh-sec-head {display:flex;align-items:center;gap:8px;flex-wrap:wrap;padding-block-end:8px;margin-block-end:9px;border-bottom:1px solid var(--wh-line)}
body[data-nextest-role="warehouse"] #whTabBody .wh-sec-num {width:30px;height:30px;flex:none;color:var(--wh-accent);display:grid;place-items:center}
body[data-nextest-role="warehouse"] #whTabBody :is(.wh-sec-load,.wh-sec-receive,.wh-sec-held,.wh-sec-return_variances,.wh-sec-my_moves) .wh-sec-num {color:var(--wh-amber)}
body[data-nextest-role="warehouse"] #whTabBody .wh-sec-num svg {width:24px;height:24px}
body[data-nextest-role="warehouse"] #whTabBody .wh-section-title {margin:0;font-size:clamp(15px,1.4vw,20px);font-weight:800;line-height:1.4}
body[data-nextest-role="warehouse"] #whTabBody .wh-sec-body {min-width:0;overflow-wrap:anywhere}
body[data-nextest-role="warehouse"] #whTabBody #whSecBody_load {background:url('/assets/warehouse-yard-r31.webp') left bottom / 75% auto no-repeat;background-blend-mode:soft-light;background-color:var(--wh-surface);border-radius:10px;padding:7px}
body[data-nextest-role="warehouse"] #whTabBody .wh-stock-search {display:flex;align-items:center;gap:8px;flex-wrap:wrap;margin-block-end:8px}
body[data-nextest-role="warehouse"] #whTabBody .wh-stock-search>* {margin:0!important}
body[data-nextest-role="warehouse"] #whTabBody #stockList {grid-template-columns:repeat(auto-fit,minmax(min(100%,180px),1fr));gap:7px}
body[data-nextest-role="warehouse"] #whTabBody .wh-stock-product-card {min-width:0;padding:9px;margin:0;cursor:pointer}
body[data-nextest-role="warehouse"] :is(#whTabBody,#whDetailOverlay,#stocktakeModalOverlay,#whReturnReceiptOverlay) :is(h2,h3,h4,.name,label,td) {color:var(--wh-ink)!important}
body[data-nextest-role="warehouse"] :is(#whTabBody,#whDetailOverlay,#stocktakeModalOverlay,#whReturnReceiptOverlay) :is(.meta,.sub,.empty,.wh-loading,.wh-detail-note,.wh-detail-trail) {color:var(--wh-sub)!important}
body[data-nextest-role="warehouse"] :is(#whTabBody,#whDetailOverlay,#stocktakeModalOverlay,#whReturnReceiptOverlay) button:not(.danger) {
  min-height:38px;background:var(--wh-button)!important;color:#fff!important;border:1px solid #3b92df!important;border-radius:9px;font-weight:750;
}
body[data-nextest-role="warehouse"] #whTabBody #newStocktakeBtn {background:linear-gradient(#087852,#075337)!important;border-color:#6dd6a3!important}
body[data-nextest-role="warehouse"] :is(#whTabBody,#whDetailOverlay,#stocktakeModalOverlay,#whReturnReceiptOverlay) :is(input:not([type="checkbox"]):not([type="radio"]),textarea,select) {
  color:var(--wh-ink)!important;background:var(--wh-surface)!important;border:1px solid var(--wh-line)!important;border-radius:8px;min-height:40px;
}
body[data-nextest-role="warehouse"] :is(#whTabBody,#whDetailOverlay) :is(input,textarea)::placeholder {color:var(--wh-sub)!important}
body[data-nextest-role="warehouse"] :is(#whTabBody,#whDetailOverlay,#stocktakeModalOverlay,#whReturnReceiptOverlay) summary {background:transparent;color:var(--wh-ink);cursor:pointer}
body[data-nextest-role="warehouse"] :is(#whTabBody,#whDetailOverlay) details[open]>summary {border-block-end:1px solid var(--wh-line)}
body[data-nextest-role="warehouse"] :is(#whTabBody,#whDetailOverlay,#stocktakeModalOverlay,#whReturnReceiptOverlay) table {width:100%;font-size:13px;font-variant-numeric:tabular-nums}
body[data-nextest-role="warehouse"] :is(#whTabBody,#whDetailOverlay) :is(th,td) {padding:7px;text-align:start;border-color:var(--wh-line)!important}
body[data-nextest-role="warehouse"] :is(#whTabBody,#whDetailOverlay) th {background:var(--wh-raised)!important;color:var(--wh-ink)!important}
body[data-nextest-role="warehouse"] :is(#whTabBody,#whDetailOverlay) tbody tr:nth-child(even) {background:color-mix(in srgb,var(--wh-line) 10%,transparent)}
body[data-nextest-role="warehouse"] #whTabBody :is(.stk-tbl-wrap,.wh-variance-list,.wh-section-detail) {max-width:100%;min-width:0;overflow:auto}
body[data-nextest-role="warehouse"] #whTabBody :is(.wh-variance-toolbar,.wh-variance-heading,.wh-variance-actions) {display:flex;flex-wrap:wrap;align-items:center;gap:8px;justify-content:space-between}
body[data-nextest-role="warehouse"] #whTabBody .wh-variance-fields {display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,104px),1fr));gap:6px}
body[data-nextest-role="warehouse"] #whTabBody .wh-variance-state[data-state="sent"] {color:var(--wh-green)!important}
body[data-nextest-role="warehouse"] #whTabBody .wh-variance-state[data-state="pending"] {color:var(--wh-amber)!important}
body[data-nextest-role="warehouse"] :is(#roleContent,#whDetailOverlay,#stocktakeModalOverlay,#whReturnReceiptOverlay,#sideDrawer) :focus-visible {outline:2px solid var(--wh-focus)!important;outline-offset:2px}
body[data-nextest-role="warehouse"] #roleContent > .warehouse-workspace::after {
  content:"";height:42px;background:url('/assets/representative-orbits.svg') center / 100% 100% no-repeat;pointer-events:none;
}
@media(max-width:999px) {
  body[data-nextest-role="warehouse"] #whTabBody>.wh-section {grid-column:span 6}
  body[data-nextest-role="warehouse"] #whTabBody>.wh-sec-inspect_returns {grid-column:1/-1}
}
@media(max-width:700px) {
  body[data-nextest-role="warehouse"] #whTabBody>.wh-section {grid-column:1/-1}
  body[data-nextest-role="warehouse"] #whStockMetrics {grid-template-columns:repeat(2,minmax(0,1fr))}
  body[data-nextest-role="warehouse"] #whStockMetrics>.wh-metric:last-child {grid-column:1/-1}
  body[data-nextest-role="warehouse"] .wh-workspace-head {min-height:193px;align-items:flex-end;flex-wrap:wrap;gap:8px}
  body[data-nextest-role="warehouse"] .wh-workspace-head::before {background-size:auto 100%;mask-image:linear-gradient(#000,#000a 60%,transparent)}
  body[data-nextest-role="warehouse"] #whTabBody :is(input,select,textarea) {font-size:16px}
}
@media print {body[data-nextest-role="warehouse"] #roleContent > .warehouse-workspace::after {display:none}}
body[data-nextest-role="warehouse"] #roleContent {min-width:0}
body[data-nextest-role="warehouse"] #topbarMonthWrap {display:none!important}
body[data-nextest-role="warehouse"] #drawerUser {background:#051d42!important;color:#fff!important}
body[data-nextest-role="warehouse"] #sideDrawer .drawer-brand {background:#061c40;color:#fff}
body[data-nextest-role="warehouse"] #whTabBody .wh-variance-fields :is(dt,dd) {margin:0}
body[data-nextest-role="warehouse"] #whDetailOverlay .wh-detail-report {overscroll-behavior:contain}
body[data-nextest-role="warehouse"] #whTabBody .wh-loading {padding:11px 8px}
body[data-nextest-role="warehouse"] #whTabBody .wh-stock-search #stockSearch {flex:1 1 140px;min-width:0}
body[data-nextest-role="warehouse"] #whTabBody .wh-stock-search #whStockScan {width:auto;flex:none}
body[data-nextest-role="warehouse"] #whTabBody :is(#whSecBody_receive,#whSecBody_stock) img {image-rendering:auto}
body[data-nextest-role="warehouse"] #whTabBody :is(#whSecBody_receive,#whSecBody_stock) .cards-grid {min-width:0}
@media(min-width:900px){
  body[data-nextest-role="warehouse"] > .wrap {margin:0!important;margin-inline-start:176px!important;max-width:none;padding:8px 12px}
  body[data-nextest-role="warehouse"] #sideDrawer {width:176px!important;max-width:none!important}
}
html[dir="ltr"] body[data-nextest-role="warehouse"] #sideDrawer {left:0;right:auto}
@media(max-width:899px){
  html[dir="ltr"] body[data-nextest-role="warehouse"] #sideDrawer:not(.open) {transform:translateX(-100%)}
}
@media(min-width:1000px){
  body[data-nextest-role="warehouse"] #whTabBody #stockList {grid-template-columns:minmax(0,1fr)}
  body[data-nextest-role="warehouse"] #whTabBody .wh-stock-product-card {display:grid;grid-template-columns:minmax(110px,1fr) minmax(135px,1.25fr);gap:6px}
  body[data-nextest-role="warehouse"] #whTabBody .wh-stock-product-card>div:nth-child(2) {margin:0!important}
  body[data-nextest-role="warehouse"] #whTabBody .wh-stock-product-card>div:last-child {grid-column:1/-1;margin:0!important}
  body[data-nextest-role="warehouse"] #whTabBody .wh-stock-product-card>div:last-child:empty {display:none}
}

/* Keep the content aligned with the compact drawer in tablet RTL and LTR. */
@media(min-width:900px) {
  html[dir="ltr"] body[data-nextest-role="warehouse"] > .wrap {margin-left:176px!important;margin-right:0!important}
}
@media(max-width:899px) {
  body[data-nextest-role="warehouse"] #sideDrawer:not(.open) {visibility:hidden}
  body[data-nextest-role="warehouse"] #sideDrawer.open {visibility:visible}
}
@media(max-height:560px) and (orientation:landscape) {
  body[data-nextest-role="warehouse"] .wh-workspace-head {min-height:150px}
}

/* Preserve disclosure behavior after removing the old warehouse skin. */
body[data-nextest-role="warehouse"] #whTabBody .wh-section.wh-collapsed>.wh-sec-body {display:none!important}
body[data-nextest-role="warehouse"] #whTabBody .wh-section.wh-collapsed>.wh-sec-head {margin-block-end:0}
body[data-nextest-role="warehouse"] #whTabBody .wh-collapsible>.wh-sec-head {cursor:pointer}
body[data-nextest-role="warehouse"] #whTabBody .wh-section-title {flex:1 1 112px;min-width:0}
body[data-nextest-role="warehouse"] #whTabBody .wh-section-detail {
  width:auto!important;min-width:0;max-width:100%;flex:0 0 auto;margin:0;
  padding:5px 10px;font-size:12px;white-space:normal;
}
body[data-nextest-role="warehouse"] #whTabBody #saveAllStockBtn:disabled {pointer-events:none;cursor:not-allowed;opacity:.55}
