/* This overlay owns its layout; no shared screen or form selectors. */
#stockInventoryDialog{position:fixed;inset:0;margin:auto;padding:0;width:min(1040px,calc(100vw - 32px));max-width:calc(100vw - 32px);max-height:calc(100dvh - 32px);height:auto;border:1px solid var(--line);border-radius:18px;color:var(--text);background:var(--surface-solid);box-shadow:0 24px 80px #0005;font-size:15px;line-height:1.4;overflow:hidden;transform:none;zoom:1}
#stockInventoryDialog::backdrop{background:rgb(10 20 30 / 55%)}
/* Legacy dark dialogs are transparent wrappers; this dialog is the solid panel. */
html #stockInventoryDialog{background:var(--surface-solid)!important}
#stockInventoryDialog .stock-inventory-panel{display:flex;flex-direction:column;max-height:calc(100dvh - 34px);min-width:0}
#stockInventoryDialog header{display:flex;align-items:flex-start;justify-content:space-between;gap:16px;padding:20px 22px 12px}
#stockInventoryDialog h2{margin:0;font-size:22px;line-height:1.25;color:var(--text)}
#stockInventoryDialog header p{margin:5px 0 0;font-size:13px;color:var(--muted)}
#stockInventoryDialog button{min-height:42px;font:inherit;cursor:pointer;flex-shrink:0}
#stockInventoryDialog .stock-inventory-close{width:42px;height:42px;padding:0;border:1px solid var(--line);border-radius:10px;background:var(--surface-solid);color:var(--text);font-size:25px;line-height:1}
#stockInventoryDialog .stock-inventory-filters{display:grid;grid-template-columns:minmax(0,1.3fr) minmax(0,1fr) minmax(0,1fr) auto;align-items:end;gap:12px;padding:8px 22px}
#stockInventoryDialog label{display:grid;gap:5px;min-width:0;font-size:13px;color:var(--muted)}
#stockInventoryDialog input,#stockInventoryDialog select{box-sizing:border-box;min-width:0;width:100%;height:44px;font-size:16px;color:var(--text);background:var(--surface-solid);border:1px solid var(--line);border-radius:9px;padding:8px 10px}
#stockInventoryDialog :focus-visible{outline:2px solid var(--tone-blue-text);outline-offset:2px}
#stockInventoryDialog .stock-inventory-status{padding:4px 22px 10px;margin:0;color:var(--muted);font-size:13px;overflow-wrap:anywhere}
#stockInventoryDialog .stock-inventory-status.is-error{color:var(--text);padding:18px 22px}
#stockInventoryDialog .stock-inventory-results{min-height:80px;min-width:0;overflow:auto;overscroll-behavior:contain;touch-action:pan-y;padding:0 22px 12px}
#stockInventoryDialog table{border-collapse:collapse;width:100%;table-layout:fixed;font-size:14px}
#stockInventoryDialog th,#stockInventoryDialog td{text-align:left;padding:12px 10px;border-bottom:1px solid var(--line);vertical-align:top;overflow-wrap:anywhere}
#stockInventoryDialog th{position:sticky;top:0;background:var(--surface-solid);font-size:13px;color:var(--muted);font-weight:600}
#stockInventoryDialog th:first-child{width:32%}
#stockInventoryDialog th:nth-child(2){width:30%}
#stockInventoryDialog strong{font-weight:600}
#stockInventoryDialog small{display:block;margin-top:3px;font-size:12px;color:var(--muted)}
#stockInventoryDialog footer{padding:12px 22px;border-top:1px solid var(--line);font-size:12px;color:var(--muted)}
#stockInventoryDialog .stock-inventory-empty{margin:20px 0;color:var(--muted)}
#stockInventoryDialog .stock-inventory-shortage{color:var(--tone-red-text,var(--text));font-weight:600}
#stockInventoryDialog details{margin-top:6px;font-size:13px}
#stockInventoryDialog summary{cursor:pointer;min-height:32px;padding:5px 0}
@media(max-width:600px){
 #stockInventoryDialog{width:calc(100vw - 20px);max-width:calc(100vw - 20px);max-height:calc(100dvh - 20px);border-radius:14px}
 #stockInventoryDialog .stock-inventory-panel{max-height:calc(100dvh - 22px)}
 #stockInventoryDialog header{padding:16px 14px 8px}
 #stockInventoryDialog h2{font-size:20px}
 #stockInventoryDialog .stock-inventory-filters{grid-template-columns:minmax(0,1fr) auto;padding:8px 14px;gap:10px}
 #stockInventoryDialog .stock-inventory-filters label:first-child{grid-column:1/-1}
 #stockInventoryDialog .stock-inventory-status{padding:5px 14px 10px}
 #stockInventoryDialog .stock-inventory-results{padding:0 14px 12px}
 #stockInventoryDialog table,#stockInventoryDialog tbody{display:block}
 #stockInventoryDialog thead{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%)}
 #stockInventoryDialog tr{display:grid;grid-template-columns:1fr 1fr;border:1px solid var(--line);border-radius:10px;padding:10px;margin-bottom:10px;gap:9px}
 #stockInventoryDialog td{display:block;padding:0;border:0;min-width:0}
 #stockInventoryDialog td:first-child,#stockInventoryDialog td:nth-child(2){grid-column:1/-1}
 #stockInventoryDialog td:nth-child(n+3)::before{content:attr(data-label);display:block;font-size:12px;color:var(--muted);margin-bottom:3px}
 #stockInventoryDialog footer{padding:10px 14px;font-size:12px}
}
