/* V176: product codes inside Purchases; shared ERP controls retain their base styles. */
#erpCodesPanel { width:100%;max-width:100%;min-width:0;margin:0;align-self:start; }
body.sx-premium #crmView #erpCodesPanel { border:1px solid #dce5f1!important;border-radius:10px!important;background:#fff!important;box-shadow:none!important; }
#erpCodesPanel>.panel-head { display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:12px;min-width:0;padding:14px 18px; }
body.sx-premium #crmView #erpCodesPanel>.panel-head { padding:14px 18px;border-radius:9px 9px 0 0!important;background:#f9fbfe!important; }
#erpCodesPanel>.panel-head>div:first-child { flex:1 1 240px;min-width:0; }
#erpCodesPanel>.panel-head h3 { margin:2px 0 0;font-size:15px;line-height:1.4; }
#erpCodesPanel>.panel-head .hint { margin:4px 0 0;max-width:780px;color:#60748e; }
#erpCodesPanel #erpCodesBack { flex:none;margin:0;white-space:normal; }
#erpCodesPanel>.erp-content { width:100%;min-width:0;padding:16px 18px; }
#erpCodesPanel .erp-codes-toolbar { display:grid;grid-template-columns:minmax(0,1fr) auto;align-items:end;gap:12px 16px;margin-bottom:14px; }
#erpCodesPanel .erp-codes-toolbar>label { display:grid;gap:6px;min-width:0;margin:0;font-size:11px;color:#60748e; }
#erpCodesPanel #erpCodesSearch { width:100%;min-width:0; }
#erpCodesPanel #erpCodesNew { margin:0;min-height:38px; }
#erpCodesPanel #erpCodesNotice { margin:0 0 14px;padding:10px 12px;border:1px solid #dce5f1;border-radius:6px;background:#f5f8fd;color:#365477;font-size:12px;line-height:1.6;overflow-wrap:anywhere; }
#erpCodesPanel #erpCodesNotice:empty { display:none; }
#erpCodesPanel #erpCodesNotice:is(.error,.pos-cash-error,[data-state="error"]) { border-color:#edcbc7;background:#fff4f2;color:#a0372c; }
#erpCodesPanel .erp-product-create-box { min-width:0;max-width:100%;margin:14px 0;padding:14px; }
body.sx-premium #crmView #erpCodesPanel .erp-product-create-box { border:1px solid #d8e5f3!important;border-radius:8px!important;background:#f8fbff!important;box-shadow:none!important; }
#erpCodesPanel .erp-product-create-head { gap:12px;min-width:0;padding-bottom:12px;margin-bottom:10px; }
#erpCodesPanel .erp-product-create-head>div { min-width:0;flex:1; }
#erpCodesPanel .erp-product-create-head h4 { margin:2px 0 4px;font-size:14px;line-height:1.4; }
#erpCodesPanel .erp-product-create-head .hint { color:#60748e;font-size:11px;line-height:1.6; }
#erpCodesPanel .erp-product-create-head .icon-action { flex:none; }
#erpCodesPanel .erp-form { width:100%;max-width:100%;min-width:0; }
#erpCodesPanel .erp-form-row { display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px 18px;min-width:0; }
#erpCodesPanel .erp-form-row>div { min-width:0; }
#erpCodesPanel .erp-form :is(input,select,textarea) { max-width:100%; }
body.sx-premium #crmView #erpCodesPanel .erp-form input[readonly] { background:#f0f5fc!important;color:#526985; }
#erpCodesPanel #erpCodePricingMode { max-width:440px; }
#erpCodesPanel :is(#erpCodeSupplierPricing,#erpCodeManualPricing) { min-width:0;margin:10px 0 0;padding:4px 0 4px 12px;border-left:2px solid #b9cdea; }
#erpCodesPanel #erpCodePricingSummary { margin:10px 0 0;padding:10px 12px;border:1px solid #d7e4f5;border-radius:6px;background:#edf3ff;color:#365477;font-size:11px;line-height:1.6;overflow-wrap:anywhere; }
#erpCodesPanel #erpCodePricingSummary:empty { display:none; }
#erpCodesPanel .erp-product-create-foot { flex-wrap:wrap;gap:12px;margin-top:16px;padding-top:12px;border-top:1px solid #dce5f1; }
#erpCodesPanel .erp-product-create-foot .hint { flex:1;min-width:0;margin:0;font-size:11px;line-height:1.6; }
#erpCodesPanel .erp-product-create-foot .btn { flex:none;margin:0;white-space:normal; }
#erpCodesPanel #erpCodesResults { width:100%;max-width:100%;min-width:0;margin-top:14px;overflow-x:auto;overscroll-behavior-x:contain; }
#erpCodesPanel #erpCodesResults .erp-table { min-width:620px; }
#erpCodesPanel #erpCodesResults .erp-table :is(th,td) { padding:10px;line-height:1.45; }
#erpCodesPanel #erpCodesResults .erp-table th { text-align:left;background:#f5f8fd; }
#erpCodesPanel #erpCodesResults .erp-table td:first-child { min-width:200px;overflow-wrap:anywhere; }
#erpCodesPanel #erpCodesResults .btn { margin:0;white-space:nowrap; }
body.sx-premium #crmView #erpCodesPanel #erpCodesResults .empty-list { margin:0;padding:22px 16px!important;border-radius:7px!important;font-size:12px; }

/* Native and class-based visibility take precedence over every layout above. */
#erpCodesPanel.hidden,#erpCodesPanel[hidden],#erpCodesPanel .hidden,#erpCodesPanel [hidden] { display:none!important; }

@media(max-width:680px) {
  #erpCodesPanel>.panel-head,body.sx-premium #crmView #erpCodesPanel>.panel-head { padding:12px 13px;gap:10px; }
  #erpCodesPanel>.erp-content { padding:13px; }
  #erpCodesPanel .erp-codes-toolbar,#erpCodesPanel .erp-form-row { grid-template-columns:minmax(0,1fr); }
  #erpCodesPanel .erp-form-row { gap:0; }
  #erpCodesPanel #erpCodesNew,#erpCodesPanel #erpCodesBack { width:100%; }
  #erpCodesPanel .erp-product-create-box { padding:11px; }
  #erpCodesPanel #erpCodePricingMode { max-width:100%; }
  #erpCodesPanel :is(#erpCodeSupplierPricing,#erpCodeManualPricing) { padding-left:9px; }
  #erpCodesPanel .erp-product-create-foot { flex-direction:column;align-items:stretch; }
  #erpCodesPanel .erp-product-create-foot .btn { width:100%; }
}

/* V208: edit directly in Catalog without leaving the current search. */
.n208-product-actions{display:flex;flex-wrap:wrap;gap:8px;min-width:168px}
.n208-product-dialog{width:min(820px,94vw);max-height:92vh;box-sizing:border-box;overflow:auto;border:1px solid #dce5f1;border-radius:14px;padding:0;color:#183452;background:#fff;box-shadow:0 24px 70px #16315f35}
.n208-product-dialog::backdrop{background:#142c5366}
.n208-product-dialog>header{display:flex;align-items:center;justify-content:space-between;gap:14px;padding:18px 22px;background:#f3f7ff;border-bottom:1px solid #dce5f1}
.n208-product-dialog>header h2{font-size:20px;margin:0}
#n208ProductStatus{margin:16px 22px;padding:10px 12px;background:#f3f7ff;border-radius:6px;font-size:13px;line-height:1.5;overflow-wrap:anywhere}
#n208ProductStatus:empty{display:none}#n208ProductStatus.pos-cash-error{color:#a0372c;background:#fff4f2}
#n208ProductBody{padding:0 22px 22px}
#n208ProductDialog .erp-product-create-box{margin:0;padding:0;border:0;background:transparent}
#n208ProductDialog .erp-product-create-head{display:flex;margin:0 0 14px}#n208ProductDialog .erp-product-create-head h4{font-size:15px;margin:4px 0}
#n208ProductDialog #erpCodeEditClose{display:none}
#n208ProductDialog .erp-form-row{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:16px}
#n208ProductDialog .erp-form-row>div{min-width:0}
#n208ProductDialog label{display:block;font-size:12px;color:#526782;margin:14px 0 6px}
#n208ProductDialog :is(input,select,textarea){box-sizing:border-box;width:100%;max-width:100%;border:1px solid #c9d8eb;border-radius:6px;padding:10px 12px;color:#183452;font:inherit;background:white}
#n208ProductDialog input[readonly]{background:#f1f5fa}
#n208ProductDialog .hint{font-size:12px;line-height:1.6;color:#60748e}
#n208ProductDialog .erp-readonly-value{padding:10px 12px;background:#f1f5fa;border-radius:6px;font-weight:600}
#n208ProductDialog .erp-product-create-foot{display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:12px;border-top:1px solid #dce5f1;padding-top:16px;margin-top:16px}
#n208ProductDialog .hidden{display:none!important}
@media(max-width:680px){#n208ProductDialog .erp-form-row{grid-template-columns:minmax(0,1fr);gap:0}.n208-product-dialog>header{padding:14px 16px}#n208ProductBody{padding:0 16px 16px}#n208ProductStatus{margin:12px 16px}#n208ProductDialog .erp-product-create-foot{align-items:stretch;flex-direction:column}}
@media(max-width:820px){body:has(#route-erp.active-route) .topbar{flex-wrap:wrap;gap:10px}body:has(#route-erp.active-route) .topbar>div:first-child{min-width:0;max-width:100%;flex:1 1 210px}body:has(#route-erp.active-route) .topbar h1{min-width:0;overflow-wrap:anywhere}body:has(#route-erp.active-route) .topbar-actions{max-width:100%;flex-wrap:wrap;gap:6px}}
