*{box-sizing:border-box}body{margin:0;background:#f3f5f8;color:#202833;font:14px Arial,sans-serif}header{background:#fff;border-bottom:1px solid #dce2e8;padding:14px max(20px,calc((100% - 1180px)/2));display:flex;justify-content:space-between;align-items:center}.brand{display:flex;gap:12px;align-items:center}.brand small{display:block;color:#697586;margin-top:4px}.logo{width:42px;height:42px;border-radius:50%;background:#173e68;color:white;display:grid;place-items:center;font-weight:bold}.tag{font-size:11px;background:#fff2cc;padding:7px 10px;border-radius:20px}main{max-width:1180px;margin:28px auto;padding:0 18px}h1{font-size:26px;margin-bottom:5px}h2{font-size:17px;margin:0 0 16px}.muted{color:#697586}.stats{display:grid;grid-template-columns:repeat(3,1fr);gap:14px}.stats div,.panel{background:#fff;border:1px solid #e0e5eb;border-radius:10px;padding:18px}.stats b{font-size:26px;display:block}.stats span{color:#697586}.panel{margin:18px 0}.btn{display:inline-block;background:#174b78;color:white;border:0;border-radius:6px;padding:11px 16px;text-decoration:none;cursor:pointer}.btn.secondary{background:#e8eef4;color:#1c4569}.rowhead{display:flex;justify-content:space-between;align-items:center}.tablewrap{overflow-x:auto}table{border-collapse:collapse;width:100%}th,td{padding:9px;border:1px solid #d9e0e7;text-align:left}th{background:#f0f4f8}label{display:block;font-weight:600;margin:10px 0 6px}input,textarea{font:inherit;padding:9px;border:1px solid #cbd4de;border-radius:5px;width:100%;background:white}textarea{resize:vertical}.two,.three{display:grid;grid-template-columns:repeat(2,1fr);gap:14px}.three{grid-template-columns:repeat(3,1fr)}.suggestions{position:relative;z-index:5}.suggestion{display:block;text-align:left;width:100%;background:#fff;border:1px solid #d8e0e8;padding:10px;cursor:pointer}.suggestion:hover{background:#edf5fc}.suggestion small{display:block;color:#687586;margin-top:4px}.summary{max-width:440px;margin-left:auto}.summary>div{display:flex;justify-content:space-between;padding:8px;border-bottom:1px solid #e3e8ee}.summary label{display:flex;align-items:center;justify-content:space-between;gap:15px}.summary label input{max-width:180px}.grand{font-size:18px;font-weight:bold}.warning{background:#fff4d6;padding:10px;color:#775500;border-radius:5px}.success{color:#16733b}.error{color:#b42318}@media(max-width:700px){.two,.three,.stats{grid-template-columns:1fr}.rowhead{gap:10px;align-items:flex-start;flex-direction:column}}
/* Superadmin additions */
.admin-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:18px}
.narrow{max-width:480px;margin:50px auto}
.panel form input[type=file]{display:block;margin:8px 0 16px;width:100%}
.suggestions{position:relative;z-index:20;max-height:260px;overflow:auto;background:#fff}
.suggestion{display:block;width:100%;text-align:left;background:#fff;border:1px solid #d8e0ea;padding:10px 12px;cursor:pointer;color:#172b4d}
.suggestion:hover{background:#eef5fc}
.productResults{position:absolute;left:0;right:0;box-shadow:0 5px 16px rgba(0,0,0,.12)}
#items td:first-child{position:relative;min-width:300px}
#items td{vertical-align:top}
@media(max-width:760px){.admin-grid{grid-template-columns:1fr}}

.inline-reset{display:flex;gap:6px;align-items:center;min-width:260px}
.inline-reset input{min-width:150px;margin:0}
.btn.small{padding:8px 12px;font-size:13px}

.admin-login-link{margin:14px 0 0;text-align:center}.admin-login-link a{color:#174b78;font-weight:600;text-decoration:none}.admin-login-link a:hover{text-decoration:underline}

.hidden{display:none!important}

.productResults{position:absolute;left:0;right:0;top:calc(100% + 3px);z-index:1000;max-height:300px;overflow:auto;background:#fff;border:1px solid #b9c8d8;border-radius:7px;box-shadow:0 8px 22px rgba(0,0,0,.16);padding:6px}
.productResultsTitle{font-weight:700;padding:7px 9px;color:#25384d;border-bottom:1px solid #e3e9ef}
.productSuggestion{display:block;width:100%;border:0;border-bottom:1px solid #edf0f4;background:#fff;text-align:left;padding:9px 10px;cursor:pointer;color:#172b4d}
.productSuggestion:hover{background:#eef5fc}
.productSuggestion b{display:block;font-size:13px;font-weight:600}
.productSuggestion small{display:block;color:#687586;margin-top:3px;font-size:11px}
.productEmpty{padding:12px;color:#687586}
#items td:first-child{position:relative;overflow:visible}
#items{overflow:visible}
.tablewrap{overflow:visible}
@media(max-width:700px){.tablewrap{overflow-x:auto}#items td:first-child{min-width:250px}}

/* v18: compact product suggestions anchored to the search field */
.productResults{
 position:fixed!important;z-index:10000!important;
 max-height:136px;overflow-y:auto;overflow-x:hidden;
 width:min(520px,calc(100vw - 16px));
 background:#fff;border:1px solid #aebdce;border-radius:5px;
 box-shadow:0 5px 15px rgba(0,0,0,.18);padding:3px;
}
.productResultsTitle{font-size:12px;padding:4px 7px;color:#25384d;border-bottom:1px solid #e3e9ef}
.productSuggestion{display:flex;align-items:center;justify-content:space-between;gap:10px;
 width:100%;padding:5px 8px;border:0;border-bottom:1px solid #edf0f4;
 background:#fff;text-align:left;cursor:pointer;color:#172b4d}
.productSuggestion:hover{background:#eef5fc}
.productSuggestion b{display:block;flex:1;min-width:0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;font-size:12px}
.productSuggestion small{flex:0 0 auto;color:#687586;font-size:10px}
.productEmpty{padding:8px;font-size:12px;color:#687586}

/* v20: reliably anchor product suggestions to the active SKU/name field */
.productResults{
 position:fixed!important; z-index:2147483000!important;
 display:block; box-sizing:border-box; overflow-y:auto; overflow-x:hidden;
 background:#fff; border:1px solid #aebdce; border-radius:6px;
 box-shadow:0 8px 22px rgba(0,0,0,.20); padding:4px;
}
.productResultsTitle{position:sticky;top:0;background:#fff;font-size:12px;padding:5px 8px}
.productSuggestion{display:flex;align-items:center;justify-content:space-between;gap:10px;width:100%;box-sizing:border-box;padding:7px 9px}
