body{margin:0;font-family:Arial,sans-serif;background:#f4f6f8;color:#1e252c}
header{display:flex;justify-content:space-between;align-items:center;padding:18px 28px;background:#111820;color:#fff}
header h1{margin:0}header p{margin:4px 0 0;color:#b9c2cb}.head-actions{display:flex;gap:10px;align-items:center;flex-wrap:wrap}
#connectionStatus{background:#18794e;padding:8px 12px;border-radius:20px;font-size:13px}#userEmail{color:#d9e0e6;font-size:13px}
main{max-width:1180px;margin:24px auto;padding:0 16px;display:grid;gap:16px}.card{background:#fff;border:1px solid #d9dee3;border-radius:14px;padding:20px}.focus{border:2px solid #b8cde0}
.section-head{display:flex;justify-content:space-between;gap:12px;align-items:center;margin-bottom:16px}.section-head h2{margin:0}
.search{display:grid;grid-template-columns:1fr auto auto;gap:10px}.grid{display:grid;grid-template-columns:repeat(4,1fr);gap:14px}.wide{grid-column:span 2}
label{display:flex;flex-direction:column;gap:6px;font-size:13px;color:#4e5964}input,select{padding:11px;border:1px solid #d9dee3;border-radius:9px;font-size:15px}
button{border:0;border-radius:9px;padding:11px 15px;background:#1f4e78;color:#fff;font-weight:700;cursor:pointer}button:disabled{opacity:.55;cursor:not-allowed}
.secondary{background:#edf1f4;color:#24313d}.small{padding:8px 11px}
.channels{display:flex;gap:18px;flex-wrap:wrap;margin:10px 0 8px}.channels label{flex-direction:row;align-items:center;font-size:15px}.channels input{width:auto}
.actions{display:flex;gap:10px;margin-top:18px}.stats{display:grid;grid-template-columns:repeat(4,1fr);gap:10px}.stats div{background:#f7f9fb;border-radius:10px;padding:14px}.stats span{display:block;color:#6f7780;font-size:12px}.stats strong{font-size:22px}
#message,#loginMessage{margin-top:12px;font-weight:700}.ok{color:#18794e}.warn{color:#9a6700}.error{color:#b42318}.muted{color:#6f7780}
.historyrow{display:grid;grid-template-columns:110px 90px 1fr 90px 110px;gap:10px;padding:8px 0;border-bottom:1px solid #eef1f3;font-size:13px}
.image-box{margin-top:18px;border:1px solid #d9dee3;border-radius:12px;padding:14px;background:#fafbfc}.image-head{display:flex;justify-content:space-between;gap:16px;align-items:center}.image-head strong,.image-head small{display:block}.image-head small{margin-top:4px;color:#6f7780}
.file-button{display:inline-flex!important;flex-direction:row!important;align-items:center;background:#edf1f4;color:#24313d;padding:10px 14px;border-radius:9px;font-weight:700;cursor:pointer;white-space:nowrap}.file-button input{display:none}
.image-preview{display:flex;gap:10px;flex-wrap:wrap;margin-top:14px;min-height:30px}.image-tile{width:120px}.image-tile img{width:120px;height:120px;object-fit:contain;background:#fff;border:1px solid #d9dee3;border-radius:9px}.image-tile small{display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;margin-top:4px;color:#6f7780}
.modal{position:fixed;inset:0;background:rgba(0,0,0,.55);display:grid;place-items:center}.hidden{display:none!important}.modalbox{position:relative;background:#fff;border-radius:16px;padding:26px;min-width:340px;text-align:center}.close{position:absolute;right:10px;top:6px;background:none;color:#111;font-size:24px}
.login-screen{min-height:100vh;display:grid;place-items:center;background:#111820;padding:20px}.login-card{width:min(420px,100%);background:#fff;border-radius:16px;padding:30px;box-shadow:0 20px 50px rgba(0,0,0,.3)}
.login-card .brand{font-weight:800;color:#1f4e78;margin-bottom:20px}.login-card h1{margin:0 0 6px}.login-card p{margin:0 0 20px;color:#6f7780}.login-card label{margin-bottom:14px}.login-card button{width:100%}
@media(max-width:850px){.grid{grid-template-columns:1fr 1fr}.stats{grid-template-columns:1fr 1fr}.search{grid-template-columns:1fr}.wide{grid-column:span 2}.image-head{align-items:flex-start;flex-direction:column}}
@media(max-width:520px){.grid{grid-template-columns:1fr}.wide{grid-column:span 1}.stats{grid-template-columns:1fr}.section-head{align-items:flex-start;flex-direction:column}}
@media print{body *{visibility:hidden}.modalbox,.modalbox *{visibility:visible}.modalbox{position:absolute;left:0;top:0}}
.input-action{display:grid;grid-template-columns:1fr auto;gap:8px}
.input-action input{min-width:0}
.compact{padding:10px 12px;white-space:nowrap}
.lookup-info{margin-top:16px;padding:12px 14px;border-radius:10px;background:#eef6fb;border:1px solid #cfe3f2;color:#24445d}
.lookup-info strong{display:block;margin-bottom:4px}
.lookup-info .lookup-meta{display:flex;gap:14px;flex-wrap:wrap;font-size:13px;color:#527086}
.lookup-image-badge{font-size:12px;color:#527086;margin-top:4px}

.duplicate-warning{margin-top:12px;padding:12px 14px;border-radius:10px;background:#fff4e5;border:1px solid #f1c27d;color:#7a4a00}
.duplicate-warning strong{display:block;margin-bottom:4px}
.duplicate-warning button{margin-top:8px}

.quick-badge{padding:6px 10px;border-radius:999px;background:#e8f5ee;color:#18794e;font-size:12px;font-weight:700}
.stats-6{grid-template-columns:repeat(6,1fr)}
.label-modal{min-width:420px}
.label-controls{display:grid;grid-template-columns:1fr 1fr;gap:10px;margin:0 30px 16px 0;text-align:left}
.print-label{margin:0 auto 18px;background:#fff;color:#111;border:1px dashed #c7ccd1;display:flex;flex-direction:column;align-items:center;justify-content:center;overflow:hidden;padding:2mm}
.size-50x30{width:50mm;height:30mm}
.size-40x25{width:40mm;height:25mm}
.label-title{font-weight:700;font-size:10pt;line-height:1.05;text-align:center;max-width:100%;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.size-40x25 .label-title{font-size:8pt}
.print-label svg{max-width:95%;height:auto}
.label-meta{width:100%;display:flex;justify-content:space-between;gap:6px;align-items:center;font-size:8pt}
.label-meta strong{font-size:10pt}
.size-40x25 .label-meta{font-size:7pt}.size-40x25 .label-meta strong{font-size:8pt}
@media(max-width:1000px){.stats-6{grid-template-columns:repeat(3,1fr)}}
@media(max-width:520px){.stats-6{grid-template-columns:1fr 1fr}.label-modal{min-width:0;width:96vw}}
@media print{
  @page{margin:0}
  body *{visibility:hidden!important}
  #printLabel,#printLabel *{visibility:visible!important}
  #printLabel{position:absolute;left:0;top:0;border:0;margin:0}
}

.api-status{padding:7px 10px;border-radius:999px;background:#3a4148;color:#dbe2e8;font-size:12px}
.api-status.ok{background:#18794e;color:#fff}
.api-status.warn{background:#9a6700;color:#fff}
.api-status.error{background:#b42318;color:#fff}

.sumup-tx{border:1px solid #d9dee3;border-radius:10px;padding:12px;margin:10px 0;background:#fafbfc}
.sumup-tx-head{display:grid;grid-template-columns:170px 110px 120px 1fr auto;gap:10px;align-items:center}
.sumup-products{margin-top:8px;padding-top:8px;border-top:1px solid #e5e9ed}
.sumup-product-row{display:grid;grid-template-columns:1fr 70px 110px;gap:10px;padding:4px 0;font-size:13px}
.sumup-status-successful{color:#18794e;font-weight:700}
.sumup-status-other{color:#9a6700;font-weight:700}
@media(max-width:850px){
  .sumup-tx-head{grid-template-columns:1fr 1fr}
  .sumup-product-row{grid-template-columns:1fr 60px 90px}
}

.reconcile-summary{display:grid;grid-template-columns:repeat(auto-fit,minmax(130px,1fr));gap:10px;margin:12px 0}
.reconcile-summary div{background:#f7f9fb;border-radius:10px;padding:12px}
.reconcile-summary span{display:block;color:#6f7780;font-size:12px}
.reconcile-summary strong{font-size:20px}
.match-badge{display:inline-block;padding:3px 7px;border-radius:999px;font-size:11px;font-weight:700;margin-left:6px}
.match-ok{background:#e8f5ee;color:#18794e}
.match-warn{background:#fff4e5;color:#9a6700}
.match-no{background:#fdecec;color:#b42318}
.match-ignore{background:#e8eef5;color:#425466}
.match-detail{font-size:12px;color:#5f6872;margin-top:4px}
@media(max-width:850px){.reconcile-summary{grid-template-columns:1fr 1fr}}

.sync-btn{background:#18794e;color:#fff;border:0;border-radius:9px;padding:10px 14px;font-weight:700;cursor:pointer}
.sync-btn:hover{filter:brightness(.95)}
.sync-btn:disabled{opacity:.55;cursor:not-allowed}
.sync-card-actions{display:flex;gap:8px;align-items:center}
.sync-info{border:1px solid #cfe6d8;background:#f1faf5;border-radius:10px;padding:12px;margin:10px 0}
.sync-line{border-top:1px solid #e5e9ed;padding:9px 0}
.sync-line:first-child{border-top:0}
.sync-line-grid{display:grid;grid-template-columns:1fr 80px 100px 150px;gap:10px;align-items:start}
.sync-exact{color:#18794e;font-weight:700}
.sync-already{color:#5f6872;font-weight:700}
.sync-ignored{color:#425466;font-weight:700}
.sync-unsafe{color:#9a6700;font-weight:700}
.sync-stock-negative{color:#b42318;font-weight:700}
@media(max-width:850px){
  .sync-line-grid{grid-template-columns:1fr 65px 85px}
  .sync-line-grid>div:last-child{grid-column:1/-1}
}

.manual-map-box{margin-top:8px;display:flex;gap:8px;align-items:center;flex-wrap:wrap}
.manual-map-box select{min-width:310px;max-width:100%;padding:7px 9px;border:1px solid #cbd3da;border-radius:8px;background:#fff}
.manual-map-box button{padding:7px 10px}
.manual-note{font-size:12px;color:#5f6872;margin-top:5px}
.ignore-actions{margin-top:8px;display:flex;gap:8px;flex-wrap:wrap}

.refund-btn{background:#8a4b08;color:#fff;border:0;border-radius:9px;padding:10px 14px;font-weight:700;cursor:pointer}
.refund-btn:hover{filter:brightness(.95)}
.refund-btn:disabled{opacity:.55;cursor:not-allowed}
.refund-card{border:1px solid #ead7bf;background:#fffaf4;border-radius:10px;padding:12px;margin:10px 0}
.refund-head{display:grid;grid-template-columns:170px 120px 1fr auto;gap:10px;align-items:center}
.refund-full{color:#18794e;font-weight:700}
.refund-partial{color:#9a6700;font-weight:700}
.refund-chargeback{color:#b42318;font-weight:700}
.refund-processed{color:#5f6872;font-weight:700}
.refund-actions{display:flex;gap:8px;flex-wrap:wrap;margin-top:10px}
.refund-restock-btn{background:#18794e;color:#fff;border:0;border-radius:8px;padding:8px 11px;font-weight:700;cursor:pointer}
.refund-no-stock-btn{background:#fff;border:1px solid #9a6700;color:#7a5200;border-radius:8px;padding:8px 11px;font-weight:700;cursor:pointer}
.refund-detail{font-size:12px;color:#5f6872;margin-top:5px}
@media(max-width:850px){
  .refund-head{grid-template-columns:1fr 1fr}
}

.publish-btn{background:#3155a6;color:#fff;border:0;border-radius:9px;padding:10px 14px;font-weight:700;cursor:pointer}
.publish-btn:hover{filter:brightness(.95)}
.publish-btn:disabled{opacity:.55;cursor:not-allowed}
.publish-actions{display:flex;gap:10px;align-items:center;flex-wrap:wrap;margin:12px 0}
.publish-help{margin-top:14px;padding:12px;border-radius:10px;background:#f4f7fb;color:#4c5865;font-size:13px;line-height:1.5}
.publish-row{display:grid;grid-template-columns:105px 1fr 110px 90px 95px;gap:10px;align-items:center;padding:9px 0;border-top:1px solid #e6eaee}
.publish-row:first-child{border-top:0}
.publish-row.bad{background:#fff8f2}
.publish-title{font-weight:600}
.publish-note{font-size:12px;color:#6f7780;margin-top:2px}
.publish-ready{color:#18794e;font-weight:700}
.publish-bad{color:#b42318;font-weight:700}
@media(max-width:850px){
  .publish-row{grid-template-columns:90px 1fr 80px}
  .publish-row>div:nth-child(4),.publish-row>div:nth-child(5){grid-column:auto}
}

.stock-adjustment{
  margin:0 0 16px;
  padding:14px;
  border:1px solid #d6dde4;
  border-radius:12px;
  background:#f8fafb
}
.stock-adjustment>div:first-child small{display:block;margin-top:3px;color:#65707b}
.adjustment-grid{
  display:grid;
  grid-template-columns:130px 230px 1fr;
  gap:12px;
  margin-top:12px
}
.adjustment-grid label{display:flex;flex-direction:column;gap:5px}
.adjustment-grid input,.adjustment-grid select{
  min-height:39px;
  border:1px solid #ccd4dc;
  border-radius:8px;
  padding:7px 9px;
  background:#fff
}
.adjustment-actions{
  display:flex;
  gap:9px;
  align-items:center;
  flex-wrap:wrap;
  margin-top:12px
}
.danger-secondary{
  background:#fff;
  border:1px solid #b42318;
  color:#b42318;
  border-radius:8px;
  padding:9px 13px;
  font-weight:700;
  cursor:pointer
}
.success-secondary{
  background:#fff;
  border:1px solid #18794e;
  color:#18794e;
  border-radius:8px;
  padding:9px 13px;
  font-weight:700;
  cursor:pointer
}
.danger-secondary:hover,.success-secondary:hover{background:#f3f5f6}
.danger-secondary:disabled,.success-secondary:disabled{opacity:.5;cursor:not-allowed}
@media(max-width:850px){
  .adjustment-grid{grid-template-columns:1fr}
}

.platform-price-box{
  margin:16px 0 14px;
  padding:13px;
  border:1px solid #d8dee5;
  border-radius:12px;
  background:#f8fafc
}
.section-head.compact{margin-bottom:10px}
.section-head.compact h3{margin:0}
.platform-price-grid{
  display:grid;
  grid-template-columns:repeat(5,minmax(130px,1fr));
  gap:10px
}
.platform-price-grid label{display:flex;flex-direction:column;gap:5px}
.platform-price-grid input{
  min-height:38px;
  border:1px solid #ccd4dc;
  border-radius:8px;
  padding:7px 9px;
  background:#fff
}
.stock-compare-row{
  display:grid;
  grid-template-columns:110px 1fr 100px 100px 100px;
  gap:10px;
  align-items:center;
  padding:9px 0;
  border-top:1px solid #e6eaee
}
.stock-compare-row:first-child{border-top:0}
.stock-diff-ok{color:#18794e;font-weight:700}
.stock-diff-bad{color:#b42318;font-weight:700}
.stock-diff-warn{color:#9a6700;font-weight:700}
@media(max-width:1000px){
  .platform-price-grid{grid-template-columns:repeat(2,1fr)}
}
@media(max-width:850px){
  .stock-compare-row{grid-template-columns:90px 1fr 80px}
  .stock-compare-row>div:nth-child(4),
  .stock-compare-row>div:nth-child(5){grid-column:auto}
}
