/* Inventory only: roomy work surfaces and compact supporting detail. */
.inventory-workspace { --iw-radius:18px; max-width:1480px; margin:0 auto; }
.inventory-workspace [hidden],.inventory-dialog [hidden] { display:none !important; }
.inventory-workspace h2,.inventory-dialog h2 { font-size:clamp(24px,3vw,32px); letter-spacing:-.035em; line-height:1.15; font-weight:700; }
.inventory-workspace h3,.inventory-dialog h3 { font-size:17px; line-height:1.3; font-weight:650; letter-spacing:-.02em; }
.inventory-workspace h4,.inventory-dialog h4 { font-size:15px; font-weight:650; }
.iw-heading,.iw-section-heading { display:flex; align-items:center; justify-content:space-between; gap:20px; flex-wrap:wrap; }
.iw-heading { margin:0 0 24px; }
.iw-heading p:not(.iw-eyebrow),.iw-section-heading p,.iw-count-start p,.iw-import p,.iw-drawer-section p { font-size:13px; line-height:1.6; color:var(--muted); margin-top:7px; }
.iw-eyebrow { color:var(--accent-text); font-size:10px; font-weight:700; letter-spacing:.1em; text-transform:uppercase; margin-bottom:8px; }
.iw-metrics { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:12px; margin-bottom:22px; }
.iw-metrics>.card { min-width:0; padding:18px 20px; border-radius:var(--iw-radius); }
.iw-metric-label { color:var(--muted); font-size:11px; margin-bottom:10px; }
.iw-metric-value { color:var(--text); font-size:26px; font-weight:700; letter-spacing:-.03em; font-variant-numeric:tabular-nums; }
.iw-metric-detail { color:var(--muted); font-size:11px; line-height:1.6; margin-top:5px; }
.iw-metric-value.is-warning { color:var(--warn); }
.iw-tabs { display:flex; gap:6px; border-bottom:1px solid var(--border); margin-bottom:24px; overflow-x:auto; padding:0 0 8px; }
.iw-tabs button { background:transparent; color:var(--muted); border:0; border-radius:9px; padding:12px 17px; white-space:nowrap; font:inherit; font-size:13px; font-weight:600; cursor:pointer; }
.iw-tabs button[aria-selected="true"] { color:var(--accent-text); background:var(--accent-soft); }
.inventory-workspace :is(button,input,select),.inventory-dialog :is(button,input,select) { touch-action:manipulation; }
.inventory-workspace :is(button,a,summary,input,select):focus-visible,.inventory-dialog :is(button,a,summary,input,select):focus-visible { outline:2px solid var(--accent-text); outline-offset:3px; }
.inventory-workspace button:active,.inventory-dialog button:active { transform:translateY(1px); }
.inventory-workspace .btn,.inventory-dialog .btn { min-height:44px; }
.iw-stock,.iw-next { padding:22px; margin-bottom:20px; border-radius:var(--iw-radius); }
.iw-next { border-color:var(--accent-border); background:linear-gradient(110deg,var(--surface),#f4fbff); }
.iw-next .iw-section-heading { margin-bottom:14px; }
.iw-next>p { color:var(--muted); line-height:1.6; font-size:13px; }
.iw-next>p+.btn { margin-top:14px; }
.iw-next-row,.iw-next-footer { display:flex; align-items:center; justify-content:space-between; gap:18px; padding:14px 0; border-top:1px solid var(--border); font-size:12px; }
.iw-next-row b,.iw-next-row span { display:block; }
.iw-next-row b { font-size:13px; color:var(--text); margin-bottom:5px; }
.iw-next-row span,.iw-next-footer { color:var(--muted); line-height:1.5; }
.iw-next-row .btn { flex-shrink:0; }
.iw-next-footer { padding-bottom:0; }
.iw-text-button { background:none; border:0; color:var(--accent-text); font:inherit; font-size:12px; font-weight:600; cursor:pointer; min-height:44px; text-align:left; }
.iw-stock-tools { display:flex; align-items:end; flex-wrap:wrap; gap:14px; margin:20px 0 10px; }
.iw-search { flex:1; min-width:220px; }
.iw-search input,.iw-filter select { width:100%; min-height:44px; border:1px solid var(--border-strong); border-radius:10px; background:var(--surface); color:var(--text); padding:10px 13px; font:inherit; font-size:13px; }
.iw-filter { display:flex; align-items:center; gap:10px; color:var(--muted); font-size:12px; }
.iw-stock-desktop { overflow-x:auto; }
.iw-stock-table { width:100%; }
.iw-stock-table td,.iw-stock-table th { padding:15px 10px; vertical-align:middle; }
.iw-stock-table td { border-bottom:1px solid var(--border); font-size:12px; color:var(--text-2); }
.iw-stock-table td small { display:block; color:var(--muted); margin-top:5px; }
.iw-product-link { border:0; padding:5px 0; min-height:44px; background:none; cursor:pointer; text-align:left; color:var(--text); font:inherit; max-width:360px; }
.iw-product-link b { display:block; font-size:13px; line-height:1.4; font-weight:600; overflow-wrap:anywhere; }
.iw-product-link span { display:block; font-size:11px; margin-top:5px; color:var(--muted); overflow-wrap:anywhere; }
.iw-total { font-weight:700; font-variant-numeric:tabular-nums; }
.iw-status { display:inline-flex; border-radius:6px; padding:5px 8px; background:var(--surface-3); color:var(--muted); font-size:10px; line-height:1.35; font-weight:600; }
.iw-status-critical { color:var(--bad); background:#fff0f0; }
.iw-status-low { color:var(--warn); background:#fff7e8; }
.iw-status-healthy { color:var(--good); background:#ecfdf5; }
.iw-muted { color:var(--muted); font-size:12px; line-height:1.5; }
.iw-empty { padding:28px 12px; color:var(--muted); font-size:13px; line-height:1.7; }
.iw-stock-mobile { display:none; }
.iw-action-choices { display:grid; grid-template-columns:1fr 1fr; gap:16px; margin:20px 0; }
.iw-action-choice { display:flex; align-items:center; gap:15px; text-align:left; font:inherit; color:var(--text); border:1px solid var(--border); cursor:pointer; padding:24px; }
.iw-action-choice>svg { color:var(--accent-text); flex-shrink:0; }
.iw-action-choice>span:last-child { color:var(--accent-text); margin-left:auto; }
.iw-action-choice b,.iw-action-choice small { display:block; }
.iw-action-choice b { font-size:14px; margin-bottom:6px; }
.iw-action-choice small { font-size:12px; color:var(--muted); line-height:1.5; }
.iw-form-host { margin:20px 0; }
.iw-transfer-form { padding:24px; }
.iw-transfer-fields { display:grid; grid-template-columns:1fr 1fr; gap:18px; margin:20px 0; }
.iw-transfer-fields label,.inventory-dialog form label { display:flex; flex-direction:column; gap:7px; color:var(--text-2); font-size:12px; font-weight:600; }
.iw-transfer-fields input,.iw-transfer-fields select,.inventory-dialog input,.inventory-dialog select { width:100%; min-height:44px; padding:10px 12px; color:var(--text); background:var(--surface); border:1px solid var(--border-strong); border-radius:9px; font:inherit; font-size:14px; }
.iw-span-full { grid-column:1 / -1; }
.iw-transfer-review { padding:20px; border:1px solid var(--accent-border); background:var(--accent-soft); border-radius:12px; margin-top:20px; }
.iw-transfer-review p { font-size:13px; line-height:1.6; color:var(--text-2); margin:8px 0; }
.iw-transfer-review .btn { margin-top:8px; }
.iw-form-feedback { color:var(--warn); font-size:13px; line-height:1.5; margin:10px 0; }
.iw-count-start { display:flex; align-items:center; justify-content:space-between; gap:20px; margin:20px 0; padding:24px; }
.iw-count-start .btn { flex-shrink:0; }
.iw-import { padding:18px 22px; margin:20px 0; }
.iw-import summary,.iw-delivered>summary,.iw-sources>summary { color:var(--text-2); font-size:13px; font-weight:600; cursor:pointer; min-height:24px; }
.iw-file { display:inline-flex; align-items:center; position:relative; overflow:hidden; margin-top:15px; }
.iw-file input { position:absolute; inset:0; opacity:0; width:100%; cursor:pointer; }
.iw-file:focus-within { outline:2px solid var(--accent-text); outline-offset:3px; }
.iw-count-work { padding:24px; }
.iw-count-steps { display:grid; grid-template-columns:repeat(3,1fr); gap:10px; margin:20px 0; padding:0; list-style:none; counter-reset:step; }
.iw-count-steps li { counter-increment:step; color:var(--muted); font-size:12px; padding:12px; border-radius:9px; background:var(--surface-2); line-height:1.5; }
.iw-count-steps li>span { display:inline-grid; place-items:center; width:22px; height:22px; border-radius:50%; color:var(--accent-text); background:var(--accent-soft); font-weight:700; margin-right:7px; }
.iw-count-copy { color:var(--muted); font-size:13px; line-height:1.7; margin:14px 0; }
.iw-count-copy small { display:block; margin-top:5px; }
.iw-count-search { display:block; margin:18px 0 12px; }
.iw-count-search input { width:100%; min-height:44px; font-size:14px; padding:10px 12px; border:1px solid var(--border-strong); border-radius:9px; }
.iw-count-table { max-height:52vh; overflow:auto; border:1px solid var(--border); border-radius:10px; }
.iw-count-table table { width:100%; }
.iw-count-table th { position:sticky; top:0; background:var(--surface-2); z-index:1; }
.iw-count-table td { padding:12px 10px; border-bottom:1px solid var(--border); font-size:12px; }
.iw-count-table .iw-count-product b,.iw-count-table .iw-count-product span { display:block; overflow-wrap:anywhere; }
.iw-count-table .iw-count-product span { color:var(--muted); margin-top:4px; font-size:11px; }
.iw-count-table input { width:88px; min-height:44px; border:1px solid var(--border-strong); border-radius:8px; text-align:right; padding:9px; color:var(--text); background:var(--surface); }
.inventory-workspace .inv-count-actions { padding:18px 0 0; gap:14px; align-items:end; }
.inventory-workspace .inv-count-actions input { min-height:44px; }
.inventory-workspace .inv-preview { margin-top:20px; padding:20px; }
.inventory-workspace .inv-preview-table { display:block; overflow-x:auto; margin:16px 0; }
.iw-sources { margin-top:28px; padding:16px 0; border-top:1px solid var(--border); }
.iw-sources[open]>summary { margin-bottom:16px; }
.iw-delivered { margin-top:24px; padding:20px; }
.iw-delivered[open]>summary { margin-bottom:18px; }
.inventory-dialog { position:fixed; inset:0 0 0 auto; margin:0; border:0; border-left:1px solid var(--border); width:min(520px,100%); max-width:100%; height:100vh; height:100dvh; max-height:none; background:var(--surface); color:var(--text); padding:0; box-shadow:var(--shadow-lg); overscroll-behavior:contain; }
.inventory-dialog::backdrop { background:rgba(15,27,45,.3); }
.iw-drawer-head { display:flex; align-items:flex-start; justify-content:space-between; gap:18px; padding:26px; border-bottom:1px solid var(--border); position:sticky; top:0; background:var(--surface); z-index:1; }
.iw-drawer-head h2 { font-size:23px; overflow-wrap:anywhere; }
.iw-drawer-head p:not(.iw-eyebrow) { margin-top:8px; font-size:12px; color:var(--muted); overflow-wrap:anywhere; }
.iw-drawer-head>.btn { flex-shrink:0; }
.iw-drawer-body { padding:26px 26px calc(26px + env(safe-area-inset-bottom,0px)); }
.iw-product-balances { display:grid; grid-template-columns:repeat(3,1fr); gap:12px; margin:22px 0; }
.iw-product-balances dt { font-size:11px; color:var(--muted); }
.iw-product-balances dd { font-size:26px; font-weight:700; margin-top:7px; font-variant-numeric:tabular-nums; }
.iw-drawer-section { border-top:1px solid var(--border); padding:22px 0; }
.iw-drawer-section summary { font-size:14px; font-weight:600; cursor:pointer; min-height:30px; }
.iw-drawer-section form { display:grid; gap:14px; margin-top:18px; }
.iw-facts { margin-top:16px; font-size:12px; }
.iw-facts>div { display:flex; justify-content:space-between; gap:16px; padding:9px 0; }
.iw-facts dt { color:var(--muted); }
.iw-facts dd { font-weight:600; }
.iw-callout { padding:14px; background:var(--surface-2); border:1px solid var(--border); border-radius:10px; margin-top:14px; font-size:12px; line-height:1.6; }
.iw-callout .btn { margin-top:12px; }
.iw-movement-list { list-style:none; margin-top:14px; }
.iw-movement-list li { padding:12px 0; font-size:12px; }
.iw-movement-list b,.iw-movement-list span { display:block; }
.iw-movement-list span { color:var(--muted); margin-top:5px; line-height:1.5; }
@media (hover:hover) and (pointer:fine) { .iw-product-link:hover b,.iw-text-button:hover { color:var(--accent-text); text-decoration:underline; } .iw-action-choice:hover { border-color:var(--accent-border); background:var(--accent-soft); } .iw-tabs button:hover { color:var(--accent-text); } }
@media (max-width:1000px) { .iw-metrics { grid-template-columns:repeat(2,minmax(0,1fr)); } }
@media (max-width:700px) {
  .iw-heading { align-items:center; flex-wrap:nowrap; margin-bottom:18px; gap:12px; }
  .iw-heading>div { min-width:0; }
  .iw-heading h2 { font-size:23px; }
  .iw-heading p { display:none; }
  .iw-heading>button { padding:8px 12px; }
  .iw-metrics { display:flex; overflow-x:auto; gap:9px; padding:2px 2px 8px; margin-bottom:16px; scroll-snap-type:x proximity; }
  .iw-metrics>.card { flex:0 0 158px; padding:14px; scroll-snap-align:start; }
  .iw-metric-value { font-size:23px; }
  .iw-tabs { gap:2px; margin-bottom:20px; }
  .iw-tabs button { padding:12px; font-size:12px; }
  .iw-stock,.iw-next,.iw-count-work,.iw-transfer-form { padding:17px; }
  .iw-stock-tools { gap:10px; }
  .iw-search,.iw-filter { min-width:0; width:100%; }
  .iw-filter select { flex:1; }
  .iw-stock-desktop { display:none; }
  .iw-stock-mobile { display:block; }
  .iw-stock-item { padding:18px 0; border-top:1px solid var(--border); }
  .iw-stock-item-head { display:flex; gap:12px; justify-content:space-between; align-items:flex-start; }
  .iw-stock-item-head .iw-status { flex-shrink:0; margin-top:5px; max-width:110px; }
  .iw-stock-item dl { display:grid; grid-template-columns:repeat(3,1fr); gap:10px; margin:14px 0; }
  .iw-stock-item dt { font-size:10px; color:var(--muted); }
  .iw-stock-item dd { font-size:19px; font-weight:650; margin-top:5px; }
  .iw-stock-item>p { font-size:11px; color:var(--muted); }
  .iw-next-row,.iw-next-footer { align-items:flex-start; flex-direction:column; gap:10px; }
  .iw-action-choices { grid-template-columns:1fr; gap:10px; }
  .iw-action-choice { padding:20px; }
  .iw-transfer-fields { grid-template-columns:1fr; gap:16px; }
  .iw-count-start { flex-direction:column; align-items:flex-start; padding:20px; }
  .iw-count-steps { gap:5px; }
  .iw-count-steps li { padding:9px; font-size:10px; }
  .iw-count-steps li>span { display:grid; margin:0 0 7px; }
  .iw-count-table td,.iw-count-table th { padding:10px 7px; }
  .iw-count-table .iw-count-product { max-width:130px; }
  .iw-count-table input { width:70px; }
  .inventory-workspace .inv-count-actions { flex-direction:column; align-items:stretch; }
  .inventory-workspace .inv-count-actions label { width:100%; }
  .iw-drawer-head,.iw-drawer-body { padding:20px; }
  .iw-drawer-body { padding-bottom:calc(24px + env(safe-area-inset-bottom,0px)); }
  .inventory-workspace :is(input,select,textarea),.inventory-dialog :is(input,select,textarea) { font-size:16px !important; }
}
@media (prefers-reduced-motion:reduce) { .inventory-workspace *,.inventory-dialog * { scroll-behavior:auto; transition:none !important; } }
