.oem-stocktake{--stocktake-gap:16px;min-width:0}
.oem-stocktake form{display:flex;flex-direction:column;gap:var(--stocktake-gap)}
.oem-stocktake-context{display:flex;justify-content:space-between;gap:12px;flex-wrap:wrap;padding:12px 16px;background:#eff6fb;border:1px solid #d9e7f0;border-radius:9px;color:#49667a}
.oem-stocktake-toolbar{display:grid;grid-template-columns:220px minmax(0,1fr);gap:20px;align-items:center}
.oem-stocktake label{display:flex;flex-direction:column;gap:6px;font-size:13px;color:var(--muted)}
.oem-stocktake input{width:100%;min-width:0}
.oem-stocktake-toolbar p{margin:0;font-size:13px;line-height:1.7;color:var(--muted)}
.oem-stocktake-complete{display:flex!important;flex-direction:row!important;align-items:center;gap:8px!important}
.oem-stocktake-complete input{width:17px;height:17px;min-height:17px;margin:0;flex:0 0 auto}
.oem-stocktake-search{display:flex;align-items:flex-end;justify-content:space-between;gap:12px}
.oem-stocktake-search label{flex:1;max-width:390px}
.oem-stocktake-search>span{font-size:12px;color:var(--muted);padding-bottom:9px}
.oem-stocktake .table-scroll{border:1px solid var(--line);border-radius:9px;margin:0!important;max-height:44vh;overflow:auto;scrollbar-gutter:stable}
.oem-stocktake table{width:100%;min-width:540px;table-layout:fixed}
.oem-stocktake th,.oem-stocktake td{padding:9px 12px!important;vertical-align:middle;font-size:13px}
.oem-stocktake th{position:sticky;top:0;background:#f1f5f6;z-index:1}
.oem-stocktake th:first-child{width:42%}
.oem-stocktake td small{display:block;color:var(--muted);font-size:11px;line-height:1.5}
.oem-stocktake .oem-stocktake-quantity{display:flex;flex-direction:row;align-items:center;gap:7px}
.oem-stocktake-quantity input{width:120px;text-align:right;font-variant-numeric:tabular-nums}
.oem-stocktake-quantity span{font-size:12px;white-space:nowrap}
.oem-stocktake-reason input{max-width:100%}
.oem-stocktake-preview-title{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:10px}
.oem-stocktake-preview-title h3{margin:0;font-size:16px}
.oem-stocktake-preview-title span{font-size:12px;color:var(--muted)}
.oem-stocktake-warning{padding:10px 13px;border:1px solid #e9dfc7;background:#fffaf0;border-radius:8px;color:#7e652c;font-size:12px;line-height:1.7}
.oem-stocktake-footer{display:flex;justify-content:flex-end;gap:10px;position:sticky;bottom:-20px;padding:14px 0 6px;background:white;border-top:1px solid var(--line);z-index:2;box-shadow:0 -8px 0 6px white}
.oem-stocktake .form-error:empty{display:none}
.oem-stocktake-history{margin-top:24px;border-top:1px solid var(--line);padding-top:18px}
.oem-stocktake-history h3{font-size:16px;margin:0 0 8px}
.oem-stocktake-history>.muted{font-size:12px;margin:0 0 13px}
.oem-stocktake-document{border:1px solid var(--line);border-radius:9px;padding:0 14px;margin:10px 0}
.oem-stocktake-document>summary{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:12px 0;cursor:pointer;list-style:none}
.oem-stocktake-document>summary:before{content:'▸';font-size:12px;color:var(--muted)}
.oem-stocktake-document[open]>summary:before{content:'▾'}
.oem-stocktake-document>summary>span:first-child{flex:1}
.oem-stocktake-document small{display:block;font-size:12px;color:var(--muted);line-height:1.6}
.oem-stocktake-document>p{margin:0 0 8px;font-size:13px;overflow-wrap:anywhere}
.oem-stocktake-document .table-scroll{margin:12px 0!important}
.oem-stocktake-document table{font-size:12px;min-width:500px}
.oem-stocktake-document th,.oem-stocktake-document td{padding:8px 10px!important}
.oem-stocktake-document>.text-button{margin:0 0 14px}
.oem-stocktake-calibration{background:#f6f8ef;font-variant-numeric:tabular-nums}
.oem-stocktake-anchor{font-size:11px!important;line-height:1.5!important;color:#667654!important}
dialog:has(.oem-stocktake){max-height:92vh;overflow:auto}
dialog:has(.oem-stocktake) .modal-header{position:sticky;top:0;background:#fff;z-index:4}
dialog:has(.oem-stocktake) #modal-content{padding:18px 22px}
@media(max-width:700px){
 .oem-stocktake{--stocktake-gap:12px}
 dialog:has(.oem-stocktake){width:calc(100vw - 16px);max-width:none;max-height:94vh;margin:3vh auto}
 dialog:has(.oem-stocktake) #modal-content{padding:14px}
 .oem-stocktake-toolbar{grid-template-columns:1fr;gap:8px}
 .oem-stocktake-toolbar label{max-width:230px}
 .oem-stocktake-search{align-items:stretch;flex-direction:column;gap:5px}
 .oem-stocktake-search label{max-width:none}
 .oem-stocktake-search>span{padding:0}
 .oem-stocktake-preview-title{align-items:flex-start;flex-direction:column;gap:5px}
 .oem-stocktake-footer{flex-wrap:wrap;gap:8px;bottom:-14px;padding-top:11px}
 .oem-stocktake-footer .button{padding:9px 12px;font-size:13px}
 .oem-stocktake-entry{max-height:38vh!important}
 .oem-stocktake-document{padding:0 10px}
}
