/* Craft guidance adapted from unslop by Damir Sokolovsky (@heydamir), CC BY 4.0. */
/* Catalog, orders and payment review retain their original actions and status semantics. */
#content:is(:has(#refreshCatalog),:has(#refreshOrders),:has(#refreshPayments)) .toolbar{align-items:flex-start;gap:16px;margin-bottom:20px}
#content:is(:has(#refreshCatalog),:has(#refreshOrders),:has(#refreshPayments)) .toolbar h2{margin:0 0 4px;color:#20382b;font-size:18px;line-height:24px;font-weight:600}
#content:is(:has(#refreshCatalog),:has(#refreshOrders),:has(#refreshPayments)) .toolbar p{max-width:76ch;color:#58675d;font-size:13px;line-height:20px;overflow-wrap:anywhere}
#content:is(:has(#refreshCatalog),:has(#refreshOrders),:has(#refreshPayments)) .toolbar-actions{align-items:center;gap:8px}
#content:is(:has(#refreshCatalog),:has(#refreshOrders),:has(#refreshPayments)) .toolbar-actions button{min-height:40px;padding:8px 16px;border-radius:8px;font-size:13px;line-height:20px;font-weight:600;box-shadow:none}
#content:is(:has(#refreshCatalog),:has(#refreshOrders),:has(#refreshPayments)) .tablewrap{max-width:100%;border:1px solid #e1e6e1;border-radius:10px;background:#fff;box-shadow:none;overflow-x:auto;scroll-padding:8px}
#content:is(:has(#refreshCatalog),:has(#refreshOrders),:has(#refreshPayments)) table{width:100%;font-size:13px;line-height:20px}
#content:is(:has(#refreshCatalog),:has(#refreshOrders),:has(#refreshPayments)) thead th{padding:12px 16px;border-bottom:1px solid #dfe5df;background:#f4f6f3;color:#53645a;font-size:12px;line-height:20px;font-weight:600;vertical-align:middle}
#content:is(:has(#refreshCatalog),:has(#refreshOrders),:has(#refreshPayments)) tbody td{padding:16px;border-bottom:1px solid #e7ebe7;color:#263c30;font-size:13px;line-height:20px;vertical-align:middle}
#content:is(:has(#refreshCatalog),:has(#refreshOrders),:has(#refreshPayments)) tbody tr:last-child td{border-bottom:0}
#content:is(:has(#refreshCatalog),:has(#refreshOrders),:has(#refreshPayments)) tbody td small{display:block;margin-top:4px;color:#5c6d62;font-size:12px;line-height:18px;overflow-wrap:anywhere;word-break:normal}
#content:is(:has(#refreshCatalog),:has(#refreshOrders),:has(#refreshPayments)) tbody td strong{font-size:13px;line-height:20px;font-weight:600}
#content:is(:has(#refreshCatalog),:has(#refreshOrders),:has(#refreshPayments)) tbody td.money{color:#a82d2b;font-weight:600;font-variant-numeric:tabular-nums;white-space:nowrap}
#content:is(:has(#refreshCatalog),:has(#refreshOrders),:has(#refreshPayments)) .badge{padding:4px 8px;border-radius:8px;font-size:12px;line-height:18px;font-weight:600;white-space:nowrap}
#content:is(:has(#refreshCatalog),:has(#refreshOrders),:has(#refreshPayments)) .badge.warn{border-color:#ead7ae;background:#fbf5e6;color:#76561e}
#content:is(:has(#refreshCatalog),:has(#refreshOrders),:has(#refreshPayments)) .badge.bad{border-color:#e8c7c2;background:#fff1ef;color:#9a3028}
#content:has(#refreshPayments) .badge.warn{border-color:#e8c7c2;background:#fff1ef;color:#9a3028}
#content:is(:has(#refreshCatalog),:has(#refreshOrders)) .actions{align-items:center;gap:8px}
#content:is(:has(#refreshCatalog),:has(#refreshOrders)) .actions button{min-height:40px;padding:8px 12px;border-radius:8px;font-size:13px;line-height:20px;font-weight:500;box-shadow:none}
#content:has(#refreshCatalog) .catalog-table table{min-width:920px}
#content:has(#refreshCatalog) .catalog-table :is(th,td){padding-inline:12px}
#content:has(#refreshCatalog) .catalog-table .product-cell{align-items:center;gap:12px;min-width:200px}
#content:has(#refreshCatalog) .catalog-table .product-cell>div:last-child{min-width:0;overflow-wrap:anywhere}
#content:has(#refreshCatalog) .catalog-table .product-thumb{flex:none;width:48px;height:56px;border-radius:8px;background-color:#edf2ed}
#content:has(#refreshCatalog) .catalog-table td:nth-child(n+2),#content:has(#refreshCatalog) .catalog-table [data-catalog-progress]{white-space:nowrap}
#content:has(#refreshCatalog) .catalog-table [data-catalog-progress] strong{font-size:13px;font-variant-numeric:tabular-nums}
#content:has(#refreshCatalog) .catalog-table .actions{flex-wrap:nowrap}
#content:has(#refreshCatalog) .catalog-table table{min-width:1040px}
#content:has(#refreshCatalog) .catalog-table th:nth-child(1){width:24%}
#content:has(#refreshCatalog) .catalog-table th:nth-child(2){width:12%}
#content:has(#refreshCatalog) .catalog-table th:nth-child(3){width:10%}
#content:has(#refreshCatalog) .catalog-table th:nth-child(4){width:14%}
#content:has(#refreshCatalog) .catalog-table th:nth-child(5){width:18%}
#content:has(#refreshCatalog) .catalog-table th:nth-child(6){width:10%}
#content:has(#refreshCatalog) .catalog-table th:nth-child(7){width:12%}
#content:has(#refreshCatalog) .catalog-table .catalog-unit-price{font-variant-numeric:tabular-nums;white-space:nowrap}
#content:has(#refreshOrders) .admin-order-controls{display:flex;align-items:flex-end;justify-content:space-between;gap:12px 16px;margin:0 0 20px}
#content:has(#refreshOrders) .admin-order-filters{display:flex;align-items:flex-end;flex:1 1 360px;flex-wrap:wrap;gap:8px;min-width:0}
#content:has(#refreshOrders) .admin-order-filters label{display:flex;flex:1 1 160px;flex-direction:column;gap:4px;min-width:0;max-width:260px;margin:0;color:#465c4e;font-size:13px;line-height:20px;font-weight:500}
#content:has(#refreshOrders) .admin-order-filters :is(input,select){width:100%;max-width:none;height:40px;min-height:40px;margin:0;padding:8px 12px;border:1px solid #b9c9bc;border-radius:8px;background:#fff;color:#263c30;font-size:13px;line-height:20px}
#content:has(#refreshOrders) .admin-order-filters button{min-height:40px;height:40px;padding:8px 16px;border-radius:8px;box-shadow:none;font-size:13px;font-weight:600}
#content:has(#refreshOrders) .admin-order-pagination{display:flex;align-items:center;flex-wrap:wrap;gap:8px;margin:0;color:#5c6d62;font-size:12px;line-height:20px;font-variant-numeric:tabular-nums}
#content:has(#refreshOrders) .admin-order-pagination button{min-height:40px;padding:8px 12px;box-shadow:none;font-size:13px;font-weight:500}
#content:has(#refreshOrders) tbody .code,#content:has(#refreshPayments) tbody .code{min-width:0;font-size:12px;line-height:20px;overflow-wrap:anywhere;word-break:normal}
#content:has(#refreshOrders) tbody td:nth-child(1){min-width:180px}
#content:has(#refreshOrders) tbody td:nth-child(2){min-width:120px}
#content:has(#refreshOrders) tbody td:nth-child(4){min-width:150px}
#content:has(#refreshOrders) tbody td:nth-child(5){min-width:200px}
#content:has(#refreshPayments) tbody td:nth-child(1),#content:has(#refreshPayments) tbody td:nth-child(4){min-width:180px}
/* Scope modal refinements to catalog and order editors, leaving other workflows untouched. */
body:has(#refreshCatalog) #editor:has(.product-gallery-editor),body:has(#refreshOrders) #editor{box-shadow:0 8px 24px #0000001a}
body:has(#refreshCatalog) #editor:has(.product-gallery-editor) .dialog-head,body:has(#refreshOrders) #editor .dialog-head{gap:12px;margin-bottom:20px;padding-bottom:12px;border-bottom:1px solid #e5eae5}
body:has(#refreshCatalog) #editor:has(.product-gallery-editor) .dialog-head h2,body:has(#refreshOrders) #editor .dialog-head h2{min-width:0;color:#20382b;font-size:18px;line-height:24px;font-weight:600;overflow-wrap:anywhere}
body:has(#refreshCatalog) #editor:has(.product-gallery-editor) .dialog-head button,body:has(#refreshOrders) #editor .dialog-head button{flex:none;width:44px;height:44px;min-width:44px;min-height:44px;border-radius:8px;box-shadow:none}
body:has(#refreshCatalog) #editor:has(.product-gallery-editor) label,body:has(#refreshOrders) #editor label{min-width:0;color:#354b3d;font-size:13px;line-height:20px;font-weight:500;overflow-wrap:anywhere}
body:has(#refreshCatalog) #editor:has(.product-gallery-editor) :is(input:not([type=checkbox]):not([type=radio]):not([type=file]),select,textarea),body:has(#refreshOrders) #editor :is(input:not([type=checkbox]):not([type=radio]),select,textarea){width:100%;min-width:0;max-width:100%;border:1px solid #b9c9bc;border-radius:8px;background:#fff;color:#263c30;line-height:20px}
body:has(#refreshCatalog) #editor:has(.product-gallery-editor) .product-gallery-editor{margin:0 0 16px;padding:16px;border-color:#e0e6df;border-radius:10px;background:#f7f8f6}
body:has(#refreshCatalog) #editor:has(.product-gallery-editor) .product-gallery-editor>strong{color:#263c30;font-size:14px;line-height:20px;font-weight:600}
body:has(#refreshCatalog) #editor:has(.product-gallery-editor) .product-gallery-list{gap:8px;margin-bottom:12px;grid-template-columns:repeat(auto-fill,minmax(min(100%,140px),1fr))}
body:has(#refreshCatalog) #editor:has(.product-gallery-editor) .product-gallery-item{min-width:0;border-color:#e0e6df;border-radius:8px;background:#fff}
body:has(#refreshCatalog) #editor:has(.product-gallery-editor) .product-gallery-actions{grid-template-columns:repeat(2,minmax(0,1fr));gap:4px;padding:8px}
body:has(#refreshCatalog) #editor:has(.product-gallery-editor) .product-gallery-actions button{min-width:0;min-height:36px;padding:4px;font-size:12px;line-height:16px;font-weight:500;white-space:normal;overflow-wrap:anywhere;box-shadow:none}
body:has(#refreshCatalog) #editor:has(.product-gallery-editor) .product-locales{margin:16px 0;padding:0 12px;border-color:#e0e6df;border-radius:10px;background:#f7f8f6}
body:has(#refreshCatalog) #editor:has(.product-gallery-editor) :is(.product-locales>summary,.product-locale>summary){min-height:44px;color:#2c5c41;font-size:13px;line-height:20px;font-weight:600}
body:has(#refreshOrders) #editor:has(#adminOrderNumberSearch) #editorBody>h3{margin:20px 0 8px;color:#263c30;font-size:14px;line-height:20px;font-weight:600}
body:has(#refreshOrders) #editor:has(#adminOrderNumberSearch) #editorBody>p{margin:0 0 12px;color:#52665a;font-size:13px;line-height:20px;overflow-wrap:anywhere}
body:has(#refreshOrders) #editor:has(#adminOrderNumberSearch) .admin-order-number-pages{gap:8px;margin:12px 0}
body:has(#refreshOrders) #editor:has(#adminOrderNumberSearch) .admin-order-number-pages button{min-height:40px;padding:8px 12px;box-shadow:none}
#content:is(:has(#refreshCatalog),:has(#refreshOrders),:has(#refreshPayments)) :is(button,input,select):focus-visible,body:has(#refreshCatalog) #editor :is(button,input,select,textarea,summary):focus-visible,body:has(#refreshOrders) #editor :is(button,input,select,textarea):focus-visible{outline:2px solid #087448;outline-offset:2px}
@media(max-width:850px){#content:has(#refreshOrders) .admin-order-controls{align-items:stretch;flex-direction:column}#content:has(#refreshOrders) .admin-order-filters{flex-basis:auto}#content:has(#refreshOrders) .admin-order-pagination{align-self:flex-start}}
@media(max-width:650px){
 #content:is(:has(#refreshCatalog),:has(#refreshOrders),:has(#refreshPayments)) .toolbar-actions button,#content:is(:has(#refreshCatalog),:has(#refreshOrders)) .actions button{min-height:44px}
 #content:is(:has(#refreshCatalog),:has(#refreshOrders),:has(#refreshPayments)) :is(th,td){padding:12px}
 #content:has(#refreshOrders) .admin-order-filters label{flex:1 1 100%;max-width:none}
 #content:has(#refreshOrders) .admin-order-filters :is(input,select){height:44px;min-height:44px;font-size:16px}
 #content:has(#refreshOrders) .admin-order-filters button,#content:has(#refreshOrders) .admin-order-pagination button{min-height:44px;height:44px}
 body:has(#refreshCatalog) #editor:has(.product-gallery-editor) .dialog-head button,body:has(#refreshOrders) #editor .dialog-head button{width:44px;height:44px;min-width:44px;min-height:44px}
 body:has(#refreshCatalog) #editor:has(.product-gallery-editor) .product-gallery-actions button{min-height:44px}
}
