
:root{
  --bg:#f5f6f7;--card:#fff;--line:#d9dee3;--text:#343a40;--muted:#6c757d;
  --blue:#0877d8;--blue2:#0667ba;--green:#198754;--red:#b42318;--yellow:#fff3cd;
}
*{box-sizing:border-box}
html,body{margin:0;min-height:100%;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Arial,sans-serif;background:var(--bg);color:var(--text);font-size:14px}
button,input,select,textarea{font:inherit}
a{text-decoration:none;color:inherit}
.hidden{display:none!important}
.container{max-width:1180px;margin:0 auto;padding:0 16px}
.auth-shell{min-height:100vh;display:flex;align-items:center;justify-content:center;padding:24px}
.auth-card{width:min(430px,100%);background:#fff;border:1px solid var(--line);border-radius:8px;padding:30px;box-shadow:0 12px 34px rgba(0,0,0,.06)}
.brand{font-size:20px;font-weight:700;color:var(--blue)}
.brand.big{font-size:30px;margin-bottom:4px}
.auth-tabs{display:flex;border-bottom:1px solid var(--line);margin:22px 0}
.tab,.subtab{border:0;background:transparent;cursor:pointer}
.tab{padding:10px 14px;color:var(--blue)}
.tab.active{color:#333;border:1px solid var(--line);border-bottom-color:#fff;border-radius:4px 4px 0 0;margin-bottom:-1px}
label{display:block;font-weight:600;margin:12px 0 6px}
input,select,textarea{width:100%;padding:9px 10px;border:1px solid #cbd2d8;border-radius:4px;background:#fff;color:var(--text)}
textarea{min-height:115px;resize:vertical}
.btn{border:1px solid #aeb7bf;background:#fff;color:#333;border-radius:4px;padding:8px 12px;cursor:pointer}
.btn:hover{background:#f7f8f9}
.btn.primary{background:var(--blue);border-color:var(--blue);color:#fff}
.btn.primary:hover{background:var(--blue2)}
.btn.danger{color:var(--red);border-color:#e1aaaa}
.btn.success{background:var(--green);border-color:var(--green);color:#fff}
.btn.full{width:100%;margin-top:14px}
.smallbtn{padding:6px 9px;font-size:12px}
.small{font-size:12px}
.muted{color:var(--muted)}
.notice{margin-top:14px;background:#f7fafc;border-left:3px solid #95b6ce;padding:10px 12px;line-height:1.5}
.topbar{background:#fff;border-bottom:1px solid var(--line);position:sticky;top:0;z-index:20}
.topbar-inner{min-height:58px;display:flex;align-items:center;justify-content:space-between;gap:14px}
.nav{display:flex;align-items:center;gap:2px}
.nav a{padding:18px 10px;color:#31506a;font-weight:600;border-bottom:3px solid transparent}
.nav a.active{color:var(--blue);border-bottom-color:var(--blue)}
.account{display:flex;align-items:center;gap:8px}
.badge{display:inline-block;background:#edf2f7;padding:4px 7px;border-radius:99px;font-size:11px;font-weight:700}
main.container{padding-top:22px;padding-bottom:50px}
.page-head{display:flex;justify-content:space-between;gap:16px;align-items:end;margin-bottom:14px}
.page-head h1{margin:0 0 4px;font-size:24px}
.tabs-row{display:flex;gap:4px;border-bottom:1px solid var(--line);margin-bottom:12px}
.subtab{padding:10px 14px;color:var(--blue)}
.subtab.active{color:#333;border:1px solid var(--line);border-bottom-color:#fff;border-radius:4px 4px 0 0;margin-bottom:-1px}
.toolbar{display:flex;gap:8px;align-items:center;margin:12px 0}
.toolbar input{max-width:280px}
.table-card{background:#fff;border:1px solid var(--line);border-radius:5px;overflow:auto}
table{border-collapse:collapse;width:100%;min-width:820px}
th,td{padding:11px 10px;border-bottom:1px solid #e6e8ea;text-align:left;vertical-align:top}
th{background:#fafbfc;font-weight:600;white-space:nowrap}
.num{text-align:right}
.status{display:inline-block;padding:3px 7px;border-radius:3px;font-size:11px;font-weight:700}
.status.pending,.status.to_confirm,.status.reserved{background:#fff3cd;color:#856404}
.status.reported,.status.waiting{background:#d9ecff;color:#0b5d9d}
.status.received,.status.active,.status.paid,.status.claimed,.status.ordered{background:#dff3e8;color:#136d3e}
.status.canceled,.status.cancelled,.status.closed,.status.disabled{background:#eceff1;color:#59636b}
.status.expired{background:#f8d7da;color:#842029}
.row-actions{display:flex;gap:5px;flex-wrap:wrap}
.balance-line{font-size:15px;line-height:1.8;margin:10px 0 14px}
.money-hi{background:#fff3bd;padding:1px 4px}
.panel-head{display:flex;align-items:center;justify-content:space-between;gap:10px;margin:12px 0}
.stat-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:10px;margin:12px 0}
.stat{background:#fff;border:1px solid var(--line);padding:12px;border-radius:4px}
.stat span{display:block;color:var(--muted);font-size:12px}.stat strong{font-size:20px;display:block;margin-top:3px}
.loading{position:fixed;left:50%;top:74px;transform:translateX(-50%);background:#111827;color:#fff;padding:8px 13px;border-radius:99px;z-index:100}
.toast{position:fixed;right:18px;top:76px;z-index:200;background:#111827;color:#fff;padding:10px 13px;border-radius:5px;max-width:360px;box-shadow:0 6px 20px rgba(0,0,0,.18)}
.modal-backdrop{position:fixed;inset:0;background:rgba(0,0,0,.38);z-index:100;display:flex;align-items:center;justify-content:center;padding:18px}
.modal{width:min(680px,100%);max-height:90vh;overflow:auto;background:#fff;border-radius:6px;box-shadow:0 18px 60px rgba(0,0,0,.22)}
.modal-head{display:flex;justify-content:space-between;align-items:center;padding:14px 16px;border-bottom:1px solid var(--line)}
.modal-head h2{font-size:18px;margin:0}.icon-btn{border:0;background:transparent;font-size:24px;color:#68717a;cursor:pointer}
.modal-body,.modal form{padding:16px}
.form-grid{display:grid;grid-template-columns:1fr 1fr;gap:12px}
.modal-actions{display:flex;justify-content:flex-end;gap:7px;margin-top:16px}
.empty{padding:34px;text-align:center;color:var(--muted)}
.payment-method{white-space:pre-wrap;font-family:ui-monospace,SFMono-Regular,Menlo,monospace;font-size:12px;background:#f7f8f9;padding:8px;border-radius:4px;max-width:360px}
@media(max-width:800px){
  .topbar-inner{flex-wrap:wrap;padding-top:8px;padding-bottom:8px}.account-email{display:none}
  .nav{order:3;width:100%;overflow:auto}.nav a{padding:8px 9px}
  .page-head{align-items:flex-start;flex-direction:column}.toolbar{align-items:stretch;flex-direction:column}.toolbar input{max-width:none}
  .form-grid,.stat-grid{grid-template-columns:1fr}
}


/* V1.1 mobile cards */
@media(max-width:700px){
  html,body{font-size:15px}
  .container{padding-left:14px;padding-right:14px}
  main.container{padding-top:18px}
  .topbar-inner{gap:8px}
  .brand{font-size:20px}
  .nav{gap:8px}
  .nav a{font-size:15px;padding:8px 4px}
  .account{margin-left:auto}
  .badge{font-size:10px}
  .page-head h1{font-size:25px}
  .tabs-row{overflow-x:auto;-webkit-overflow-scrolling:touch}
  .subtab{min-width:max-content;font-size:15px}
  .balance-line{font-size:16px;line-height:1.75;background:#fff;border:1px solid var(--line);border-radius:5px;padding:10px 12px}
  .panel-head{flex-direction:column;align-items:stretch}
  .panel-head input{max-width:none!important}
  .panel-head .btn{width:100%;min-height:46px}
  .modal-backdrop{align-items:flex-end;padding:0}
  .modal{width:100%;max-height:92vh;border-radius:14px 14px 0 0}
  .modal-head{position:sticky;top:0;background:#fff;z-index:2}
  .modal-actions{position:sticky;bottom:0;background:#fff;padding-top:10px;padding-bottom:4px}
  .modal-actions .btn{min-height:44px}
  .payment-method{max-width:none;word-break:break-word}

  .table-card{overflow:visible;background:transparent;border:0}
  table.mobile-cards{min-width:0;width:100%;border-collapse:separate;border-spacing:0}
  table.mobile-cards thead{display:none}
  table.mobile-cards tbody{display:block}
  table.mobile-cards tr{
    display:block;background:#fff;border:1px solid var(--line);border-radius:7px;
    margin-bottom:12px;overflow:hidden;box-shadow:0 1px 1px rgba(0,0,0,.02)
  }
  table.mobile-cards td{
    display:grid;grid-template-columns:112px minmax(0,1fr);gap:10px;align-items:start;
    width:100%;padding:9px 11px;border-bottom:1px solid #edf0f2;text-align:left!important;
    overflow-wrap:anywhere
  }
  table.mobile-cards td:last-child{border-bottom:0}
  table.mobile-cards td::before{font-weight:600;color:var(--muted);font-size:12px;line-height:1.55}
  table.mobile-cards .row-actions{justify-content:flex-start}
  table.mobile-cards .btn{min-height:38px}
  table.mobile-cards .num{text-align:left!important}

  .t-offers td:nth-child(1)::before{content:"Offer #"}
  .t-offers td:nth-child(2)::before{content:"Offer"}
  .t-offers td:nth-child(3)::before{content:"Retailer"}
  .t-offers td:nth-child(4)::before{content:"Buy price"}
  .t-offers td:nth-child(5)::before{content:"Payout"}
  .t-offers td:nth-child(6)::before{content:"Available"}
  .t-offers td:nth-child(7)::before{content:"Ship To"}
  .t-offers td:nth-child(8)::before{content:"Deliver By"}
  .t-offers td:nth-child(9)::before{content:"Action"}

  .t-inbound td:nth-child(1)::before{content:"Inbound #"}
  .t-inbound td:nth-child(2)::before{content:"Product"}
  .t-inbound td:nth-child(3)::before{content:"Price"}
  .t-inbound td:nth-child(4)::before{content:"Qty"}
  .t-inbound td:nth-child(5)::before{content:"Ship To"}
  .t-inbound td:nth-child(6)::before{content:"Order / Tracking"}
  .t-inbound td:nth-child(7)::before{content:"Action"}

  .t-payrequests td:nth-child(1)::before{content:"Status"}
  .t-payrequests td:nth-child(2)::before{content:"Request #"}
  .t-payrequests td:nth-child(3)::before{content:"Date"}
  .t-payrequests td:nth-child(4)::before{content:"Payment info"}
  .t-payrequests td:nth-child(5)::before{content:"Amount"}
  .t-payrequests td:nth-child(6)::before{content:"Action"}

  .t-pending td:nth-child(1)::before{content:"Claim #"}
  .t-pending td:nth-child(2)::before{content:"Product"}
  .t-pending td:nth-child(3)::before{content:"Price"}
  .t-pending td:nth-child(4)::before{content:"Qty"}
  .t-pending td:nth-child(5)::before{content:"Claimed"}
  .t-pending td:nth-child(6)::before{content:"Release"}

  .t-history td:nth-child(1)::before{content:"Date"}
  .t-history td:nth-child(2)::before{content:"Transaction"}
  .t-history td:nth-child(3)::before{content:"Amount"}
  .t-history td:nth-child(4)::before{content:"Balance"}

  .t-admin-offers td:nth-child(1)::before{content:"Offer #"}
  .t-admin-offers td:nth-child(2)::before{content:"Offer"}
  .t-admin-offers td:nth-child(3)::before{content:"Retailer"}
  .t-admin-offers td:nth-child(4)::before{content:"Payout"}
  .t-admin-offers td:nth-child(5)::before{content:"Total"}
  .t-admin-offers td:nth-child(6)::before{content:"Available"}
  .t-admin-offers td:nth-child(7)::before{content:"Reserved"}
  .t-admin-offers td:nth-child(8)::before{content:"Ordered"}
  .t-admin-offers td:nth-child(9)::before{content:"Order deadline"}
  .t-admin-offers td:nth-child(10)::before{content:"Deliver By"}
  .t-admin-offers td:nth-child(11)::before{content:"Status"}
  .t-admin-offers td:nth-child(12)::before{content:"Action"}

  .t-admin-inbound-v21 td:nth-child(1)::before{content:"Offer / Inbound"}
  .t-admin-inbound-v21 td:nth-child(2)::before{content:"Buyer"}
  .t-admin-inbound-v21 td:nth-child(3)::before{content:"Product"}
  .t-admin-inbound-v21 td:nth-child(4)::before{content:"Qty"}
  .t-admin-inbound-v21 td:nth-child(5)::before{content:"Order No."}
  .t-admin-inbound-v21 td:nth-child(6)::before{content:"Tracking / Receipt"}
  .t-admin-inbound-v21 td:nth-child(7)::before{content:"Payout"}
  .t-admin-inbound-v21 td:nth-child(8)::before{content:"Status"}
  .t-admin-inbound-v21 td:nth-child(9)::before{content:"Action"}

  .t-admin-payments td:nth-child(1)::before{content:"Request #"}
  .t-admin-payments td:nth-child(2)::before{content:"Buyer"}
  .t-admin-payments td:nth-child(3)::before{content:"Payment info"}
  .t-admin-payments td:nth-child(4)::before{content:"Amount"}
  .t-admin-payments td:nth-child(5)::before{content:"Status"}
  .t-admin-payments td:nth-child(6)::before{content:"Action"}

  .t-buyers td:nth-child(1)::before{content:"Buyer"}
  .t-buyers td:nth-child(2)::before{content:"Name"}
  .t-buyers td:nth-child(3)::before{content:"Joined"}
  .t-buyers td:nth-child(4)::before{content:"Role"}
  .t-buyers td:nth-child(5)::before{content:"Status"}
  .t-buyers td:nth-child(6)::before{content:"Email alerts"}
  .t-buyers td:nth-child(7)::before{content:"Action"}
}

.reservation-rule{margin-top:14px;padding:11px 12px;background:#fff8df;border:1px solid #ead58f;border-radius:5px;line-height:1.5}
.order-block{margin-top:7px;padding:7px 9px;background:#f8fafb;border-left:3px solid #b8c5cf;border-radius:2px}
.reservation-countdown{font-weight:750;color:#9a6700;margin-top:2px;font-variant-numeric:tabular-nums}
.reservation-countdown.urgent{color:#b42318}


/* V1.4 Order No. + Qty */
.status.partially_ordered{background:#e8f0fe;color:#2457a6}
.order-entry{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:5px 0;border-bottom:1px solid #e8ecef}
.order-entry:last-of-type{border-bottom:0}
.order-qty{font-weight:700;white-space:nowrap}
.reservation-remaining{margin-top:8px}
.order-progress-box{display:grid;grid-template-columns:repeat(3,1fr);gap:8px;margin:8px 0 14px}
.order-progress-box>div{padding:8px 9px;border:1px solid var(--line);border-radius:5px;background:#f8fafb}
.order-progress-box span{display:block;font-size:11px;color:var(--muted);margin-bottom:2px}
.order-progress-box b{font-size:17px}
@media(max-width:700px){
  .order-progress-box{grid-template-columns:1fr}
  .order-progress-box>div{display:flex;justify-content:space-between;align-items:center}
  .order-progress-box span{margin:0}
}


/* V1.8 password recovery */
.link-btn{
  border:0;
  background:transparent;
  color:var(--blue);
  padding:12px 4px 4px;
  cursor:pointer;
  font:inherit;
  text-align:center;
}
.link-btn:hover{text-decoration:underline}

.t-admin-offers th.leftcol,.t-admin-offers td.leftcol{text-align:left}
.t-admin-offers th.centercol,.t-admin-offers td.centercol{text-align:center}
.offer-product-cell{display:flex;align-items:center;gap:10px;min-width:220px}
.offer-thumb{width:42px;height:42px;min-width:42px;border-radius:4px;object-fit:contain;background:#fff;border:1px solid var(--line)}
.offer-thumb.placeholder{display:flex;align-items:center;justify-content:center;background:#f4f6f8;font-size:20px}
.retailer-link{color:var(--blue);text-decoration:none;font-weight:600}
.retailer-link:hover{text-decoration:underline}
@media(max-width:700px){.offer-product-cell{min-width:0}.offer-thumb{width:46px;height:46px;min-width:46px}.t-admin-offers td.centercol{text-align:right}}


/* V2.0.2 Offer readability */
.t-admin-offers .retailer-link,
.t-admin-offers td:nth-child(3),
.t-offers .retailer-link,
.t-offers td:nth-child(3){
  white-space:nowrap;
}
.offer-title-clamp{display:block;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;line-height:1.35;max-width:340px}
.t-admin-offers .offer-product-cell{max-width:380px}
@media(max-width:700px){
  .offer-title-clamp{display:block;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;line-height:1.35;max-width:340px}
}


/* V2.0.3 tighter offer list */
.t-admin-offers th:nth-child(3),
.t-admin-offers td:nth-child(3),
.t-offers th:nth-child(3),
.t-offers td:nth-child(3){
  white-space:nowrap !important;
  min-width:92px;
}
.t-admin-offers .offer-product-cell,
.t-offers .offer-product-cell{
  min-width:260px;
  max-width:380px;
}
.offer-title-clamp{
  display:block !important;
  white-space:nowrap !important;
  overflow:hidden !important;
  text-overflow:ellipsis !important;
  max-width:330px;
}
.offer-thumb{
  object-fit:contain !important;
  background:#fff;
}
@media(max-width:700px){
  .offer-title-clamp{max-width:220px}
  .t-admin-offers .offer-product-cell,
  .t-offers .offer-product-cell{min-width:0;max-width:none}
}

.inline-image-row{display:grid;grid-template-columns:1fr auto;gap:8px;align-items:center}
.image-preview-wrap{margin-top:8px}
.image-preview{width:96px;height:96px;object-fit:contain;border:1px solid var(--line);border-radius:6px;background:#fff}


/* V2.0.4 desktop width utilization */
@media(min-width:801px){
  .container{
    width:calc(100% - 32px);
    max-width:none;
    box-sizing:border-box;
    padding-left:0;
    padding-right:0;
  }

  .t-admin-offers{
    width:100%;
    min-width:1180px;
    table-layout:auto;
    font-size:13px;
  }

  .t-admin-offers th,
  .t-admin-offers td{
    padding:10px 8px;
  }

  .t-admin-offers .offer-product-cell{
    min-width:250px;
    max-width:340px;
  }

  .t-admin-offers .offer-title-clamp{
    max-width:285px;
  }

  .t-admin-offers .row-actions{
    flex-wrap:nowrap;
    white-space:nowrap;
  }

  .t-admin-offers th:last-child,
  .t-admin-offers td:last-child{
    min-width:195px;
  }

  .t-admin-offers th:nth-child(1),
  .t-admin-offers td:nth-child(1){width:70px}

  .t-admin-offers th:nth-child(3),
  .t-admin-offers td:nth-child(3){min-width:90px}

  .t-admin-offers th:nth-child(9),
  .t-admin-offers td:nth-child(9){min-width:105px}

  .t-admin-offers th:nth-child(10),
  .t-admin-offers td:nth-child(10){min-width:92px}

  .table-card{
    overflow-x:auto;
  }
}


/* V2.0.5 manual image input */
.offer-image-tools{
  display:grid;
  grid-template-columns:minmax(0,1fr) auto;
  gap:10px;
  align-items:end;
}
.image-tool-buttons{
  display:flex;
  gap:8px;
  flex-wrap:wrap;
}
.sub-label{
  font-size:12px;
  color:var(--muted);
  margin-bottom:5px;
}
.image-paste-zone{
  margin-top:10px;
  min-height:78px;
  border:2px dashed #b9c7d6;
  border-radius:8px;
  background:#f8fafc;
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  gap:5px;
  padding:12px;
  text-align:center;
  cursor:text;
  outline:none;
  color:#34495e;
}
.image-paste-zone:focus{
  border-color:var(--blue);
  background:#f3f8ff;
}
.image-paste-zone span{
  font-size:12px;
  color:var(--muted);
}
.image-preview-wrap{
  margin-top:10px;
  display:flex;
  align-items:center;
  gap:10px;
}
.image-preview-wrap.hidden{display:none}
.image-preview{
  width:112px;
  height:112px;
  object-fit:contain;
  border:1px solid var(--line);
  border-radius:7px;
  background:#fff;
}
@media(max-width:700px){
  .offer-image-tools{grid-template-columns:1fr}
  .image-tool-buttons .btn{flex:1}
  .image-paste-zone{min-height:92px}
}


/* V2.1 Admin Inbound */
.admin-inbound-toolbar input{max-width:540px}
.admin-inbound-stats{grid-template-columns:repeat(3,minmax(0,1fr));max-width:760px}
.t-admin-inbound-v21{min-width:1380px;font-size:13px}
.t-admin-inbound-v21 th,.t-admin-inbound-v21 td{padding:10px 8px}
.t-admin-inbound-v21 th:nth-child(1){min-width:92px}
.t-admin-inbound-v21 th:nth-child(2){min-width:205px}
.t-admin-inbound-v21 th:nth-child(3){min-width:220px}
.t-admin-inbound-v21 th:nth-child(4){min-width:120px}
.t-admin-inbound-v21 th:nth-child(5){min-width:190px}
.t-admin-inbound-v21 th:nth-child(6){min-width:225px}
.t-admin-inbound-v21 th:nth-child(7){min-width:95px}
.t-admin-inbound-v21 th:nth-child(8){min-width:150px}
.t-admin-inbound-v21 th:nth-child(9){min-width:175px}
.admin-product-title{display:block;max-width:280px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.buyer-email{max-width:210px;overflow-wrap:anywhere}
.qty-stack{display:grid;grid-template-columns:1fr;gap:2px;font-size:12px;white-space:nowrap}
.qty-stack span{display:flex;justify-content:space-between;gap:10px}
.admin-detail-line{padding:4px 0;border-bottom:1px solid #edf0f2;display:flex;justify-content:space-between;gap:10px;align-items:flex-start}
.admin-detail-line:last-child{border-bottom:0}
.admin-detail-line b{overflow-wrap:anywhere}
.tracking-line{display:block}
.received-qty{font-weight:700;margin-left:4px}
.admin-inbound-actions{flex-direction:column;align-items:stretch;flex-wrap:nowrap}
.admin-inbound-actions .btn{white-space:nowrap}
.confirm-context{display:grid;gap:4px;background:#f7f9fb;border:1px solid var(--line);border-radius:5px;padding:10px 12px;margin-bottom:10px}
.confirm-context span{font-size:12px;color:var(--muted)}
.status.completed{background:#dff3e8;color:#136d3e}
@media(max-width:700px){
  .admin-inbound-stats{grid-template-columns:1fr;max-width:none}
  .t-admin-inbound-v21{min-width:0;font-size:14px}
  .admin-product-title{max-width:none;white-space:normal}
  .buyer-email{max-width:none}
  .qty-stack{max-width:180px}
  .admin-inbound-actions .btn{width:100%}
}


/* V2.1.1 buyer settings */
.settings-card{
  max-width:980px;
  background:#fff;
  border:1px solid var(--line);
  border-radius:8px;
  padding:24px 28px;
}
.settings-row{
  display:grid;
  grid-template-columns:220px minmax(0,1fr);
  gap:22px;
  align-items:start;
  margin-bottom:22px;
}
.settings-row>label{
  margin:10px 0 0;
  font-size:15px;
  font-weight:600;
}
.settings-control input{
  width:100%;
}
.settings-control input[readonly]{
  background:#f1f3f5;
  color:#4f5963;
  cursor:not-allowed;
}
.settings-control .small{
  margin-top:6px;
}
.settings-actions{
  display:flex;
  gap:10px;
  margin-left:242px;
  padding-top:2px;
}
.field-help{
  margin-top:-5px;
  margin-bottom:12px;
}
@media(max-width:700px){
  .settings-card{padding:18px 16px}
  .settings-row{
    grid-template-columns:1fr;
    gap:6px;
    margin-bottom:18px;
  }
  .settings-row>label{margin:0}
  .settings-actions{
    margin-left:0;
    flex-wrap:wrap;
  }
  .settings-actions .btn{flex:1}
}


/* V2.2.0 Payments */
.payment-balance-grid{grid-template-columns:repeat(4,minmax(0,1fr));margin-bottom:14px}
.payment-balance-grid .stat-card,.admin-payment-stats .stat-card{min-height:104px}
.stat-label{font-size:13px;color:var(--muted);margin-bottom:7px}
.stat-value{font-size:24px;font-weight:750;line-height:1.15;color:#1d2733}
.preline{white-space:pre-line;overflow-wrap:anywhere}
.money-positive{color:#198754}.money-negative{color:#b42318}
.admin-payment-stats{grid-template-columns:repeat(4,minmax(0,1fr));margin-bottom:14px}
.admin-payment-toolbar{display:flex;gap:10px;margin:12px 0}
.admin-payment-toolbar input{max-width:520px}
.due-overdue{color:#b42318;font-weight:700}
.due-today{color:#9a6700;font-weight:700}
.tiny-alert{font-size:10px;margin-top:2px;letter-spacing:.02em}
.attention-text{color:#b42318}
.payment-review-grid{display:grid;grid-template-columns:1fr 1fr;gap:16px;margin-bottom:18px;padding:14px;border:1px solid var(--line);border-radius:8px;background:#f8fafc}
.review-value{font-weight:650;margin-top:4px;overflow-wrap:anywhere}
.review-amount{font-size:25px;font-weight:800;margin-top:2px}
.payment-detail-box{border:1px solid var(--line);border-radius:7px;background:#f8fafc;padding:12px 14px;min-height:46px;margin-bottom:14px}
.payment-status-line{margin-top:4px}
.t-admin-payments th:last-child,.t-admin-payments td:last-child{white-space:nowrap}
@media(max-width:900px){
  .payment-balance-grid,.admin-payment-stats{grid-template-columns:repeat(2,minmax(0,1fr))}
}
@media(max-width:600px){
  .payment-balance-grid,.admin-payment-stats{grid-template-columns:1fr 1fr;gap:8px}
  .payment-balance-grid .stat-card,.admin-payment-stats .stat-card{min-height:90px;padding:12px}
  .stat-value{font-size:20px}
  .admin-payment-toolbar{flex-direction:column}
  .admin-payment-toolbar input{max-width:none}
  .payment-review-grid{grid-template-columns:1fr}
}


/* V2.3.0 Admin Buyers */
.admin-buyer-stats{
  grid-template-columns:repeat(3,minmax(0,1fr));
  margin-bottom:14px;
}
.admin-buyer-toolbar{
  display:flex;
  gap:10px;
  margin:12px 0;
}
.admin-buyer-toolbar input{
  max-width:560px;
}
.buyer-status-tabs .subtab span{
  color:var(--muted);
  font-size:12px;
}
.t-admin-buyers th:last-child,
.t-admin-buyers td:last-child{
  white-space:nowrap;
}
.buyer-actions{
  flex-wrap:nowrap;
}
.buyer-profile-grid{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:18px 24px;
  padding:16px;
  border:1px solid var(--line);
  border-radius:8px;
  background:#f8fafc;
}
.buyer-security-note{
  margin:16px 2px 0;
}
@media(max-width:800px){
  .admin-buyer-stats{
    grid-template-columns:1fr;
  }
  .admin-buyer-toolbar{
    flex-direction:column;
  }
  .admin-buyer-toolbar input{
    max-width:none;
  }
  .buyer-profile-grid{
    grid-template-columns:1fr;
  }
}


/* V2.4.0 Admin Reports */
.reports-page-head{
  align-items:flex-end;
}
.reports-year-control{
  min-width:150px;
}
.reports-year-control label{
  display:block;
  margin-bottom:6px;
  font-size:12px;
  color:var(--muted);
  font-weight:700;
}
.reports-year-control select{
  width:100%;
}
.report-stats{
  grid-template-columns:repeat(5,minmax(0,1fr));
  margin-bottom:14px;
}
.report-note{
  border:1px solid var(--line);
  background:#f8fafc;
  border-radius:8px;
  padding:12px 14px;
  font-size:13px;
  color:#475569;
  line-height:1.6;
  margin-bottom:18px;
}
.report-section-head{
  display:flex;
  justify-content:space-between;
  align-items:flex-end;
  gap:16px;
  margin:8px 0 10px;
}
.report-section-head h2{
  margin:0 0 2px;
  font-size:18px;
}
.t-reports th:first-child,
.t-reports td:first-child{
  width:120px;
}
@media(max-width:1100px){
  .report-stats{
    grid-template-columns:repeat(3,minmax(0,1fr));
  }
}
@media(max-width:800px){
  .reports-page-head,
  .report-section-head{
    align-items:stretch;
    flex-direction:column;
  }
  .reports-year-control{
    width:160px;
  }
  .report-stats{
    grid-template-columns:1fr;
  }
  .report-section-head .row-actions{
    width:100%;
  }
  .report-section-head .row-actions .btn{
    flex:1;
  }
}


/* V2.5.0 Ship To + compact Order/Tracking */
.shipto-cell{display:inline-flex;align-items:flex-start;gap:8px;min-width:0;cursor:help;line-height:1.25}
.shipto-cell .shipto-icon{display:inline-flex;align-items:center;justify-content:center;width:22px;height:22px;border:1px solid #3b82f6;border-radius:6px;color:#1d4ed8;font-size:16px;font-weight:700;flex:0 0 auto}
.shipto-cell b{white-space:nowrap}
.take-shipto{border:1px solid var(--line);border-radius:7px;padding:10px 12px;background:#f8fafc;margin-bottom:12px}
.shipto-selector{display:grid;grid-template-columns:1fr 1fr;gap:9px;margin:6px 0 4px}
.shipto-option{display:flex;gap:9px;align-items:flex-start;border:1px solid var(--line);border-radius:8px;padding:10px 11px;cursor:pointer;background:#fff}
.shipto-option:hover{border-color:#93c5fd;background:#f8fbff}
.shipto-option input{width:auto;margin-top:3px}
.shipto-option span{display:flex;flex-direction:column;gap:2px;min-width:0}
.shipto-option small{font-size:11px;color:var(--muted);line-height:1.35}
.shipto-option.shipto-all{grid-column:1/-1;background:#f4f8ff;border-color:#bfdbfe}
.shipto-help{margin-top:6px}
.admin-offer-shipto{margin-top:5px;font-size:11px}.admin-offer-shipto .shipto-icon{width:18px;height:18px;font-size:13px}.admin-offer-shipto .small{display:none}
.ot-compact{min-width:205px;display:flex;flex-direction:column;gap:6px}
.ot-top{display:flex;align-items:center;gap:7px;flex-wrap:wrap}
.ot-state-detail{font-size:12px;color:#475569;white-space:nowrap}
.compact-countdown{font-size:12px;font-weight:700;color:#b45309;white-space:nowrap;cursor:help}
.compact-countdown.urgent{color:#dc2626}.compact-countdown.expired{color:#6b7280}
.ot-sub{display:flex;align-items:center;gap:6px;flex-wrap:wrap;font-size:12px;color:var(--muted)}
.ot-dot{color:#cbd5e1}.text-btn{border:0;background:transparent;padding:0;color:#0b78e3;font:inherit;font-weight:600;cursor:pointer}.text-btn:hover{text-decoration:underline}
.inbound-detail-modal{display:flex;flex-direction:column;gap:8px}.detail-heading{font-weight:700;margin:4px 0 2px}.tracking-heading{margin-top:14px}.detail-row{display:flex;justify-content:space-between;align-items:center;gap:14px;border:1px solid var(--line);border-radius:7px;padding:9px 11px;background:#f8fafc}.tracking-detail>div{min-width:0}.tracking-detail b{overflow-wrap:anywhere}
@media(max-width:800px){.shipto-selector{grid-template-columns:1fr}.shipto-option.shipto-all{grid-column:auto}.ot-compact{min-width:0}.shipto-cell b{white-space:normal}}


/* V2.5.1 Tracking Qty + linked product names */
.product-title-link{
  color:inherit;
  text-decoration:none;
  font-weight:700;
}
.product-title-link:hover{
  color:var(--blue);
  text-decoration:underline;
}
.inbound-title-clamp{
  max-width:340px;
}
.shipto-cell{
  position:relative;
  padding:7px 9px;
  border:1px solid #bfdbfe;
  border-radius:8px;
  background:#eff6ff;
  color:#1e3a5f;
  transition:background .15s ease,border-color .15s ease;
}
.shipto-cell:hover{
  background:#dbeafe;
  border-color:#60a5fa;
}
.shipto-cell .small.muted{
  color:#55708f;
}
.admin-offer-shipto .shipto-cell{
  padding:4px 6px;
  border-radius:6px;
}
.tracking-entry-labels{
  display:grid;
  grid-template-columns:minmax(0,1fr) 90px 32px;
  gap:8px;
  margin:10px 0 5px;
  font-size:12px;
  color:var(--muted);
  font-weight:700;
}
.tracking-entry-row{
  display:grid;
  grid-template-columns:minmax(0,1fr) 90px 32px;
  gap:8px;
  align-items:center;
  margin-bottom:8px;
}
.tracking-entry-row input{
  margin:0;
}
.tracking-row-remove{
  width:32px;
  height:36px;
  border:1px solid #d6dce2;
  border-radius:5px;
  background:#fff;
  color:#64748b;
  font-size:20px;
  line-height:1;
  cursor:pointer;
}
.tracking-row-remove:hover{
  color:var(--red);
  border-color:#e1aaaa;
}
.tracking-add-row{
  margin:2px 0 8px;
}
.tracking-qty-help{
  padding:9px 10px;
  background:#f8fafc;
  border:1px solid var(--line);
  border-radius:6px;
}
.submitted-qty{
  color:#475569;
}
@media(max-width:800px){
  .inbound-title-clamp{
    max-width:240px;
  }
  .tracking-entry-labels,
  .tracking-entry-row{
    grid-template-columns:minmax(0,1fr) 72px 32px;
  }
}


/* V2.5.2 Admin receipt correction */
.edit-receipt-btn{
  border-color:#93c5fd;
  color:#1d4ed8;
  background:#eff6ff;
}
.edit-receipt-btn:hover{
  border-color:#60a5fa;
  background:#dbeafe;
}
.edit-receipt-help{
  margin-top:6px;
}
.edit-receipt-warning{
  margin-top:14px;
  padding:10px 12px;
  border:1px solid #fde68a;
  background:#fffbeb;
  border-radius:7px;
  color:#92400e;
  font-size:13px;
  line-height:1.45;
}
.edit-receipt-actions{
  align-items:center;
}
.modal-action-spacer{
  flex:1;
}
@media(max-width:650px){
  .edit-receipt-actions{
    flex-wrap:wrap;
  }
  .modal-action-spacer{
    display:none;
  }
}


/* V2.6.0 Payment Lock + Financial Safety */
.status.processing{
  background:#fff3cd;
  color:#8a5a00;
}
.payment-locked-note{
  display:inline-block;
  color:#8a5a00;
  font-weight:700;
  line-height:1.2;
}
.financial-safety-panel{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:16px;
  border:1px solid var(--line);
  border-radius:9px;
  padding:13px 15px;
  margin-bottom:14px;
}
.safety-main{
  display:flex;
  align-items:flex-start;
  gap:11px;
}
.safety-icon{
  display:flex;
  align-items:center;
  justify-content:center;
  width:28px;
  height:28px;
  border-radius:50%;
  font-weight:900;
  flex:0 0 auto;
}
.safety-ok{
  background:#f0fdf4;
  border-color:#86efac;
  color:#166534;
}
.safety-ok .safety-icon{
  background:#dcfce7;
  color:#15803d;
}
.safety-alert{
  background:#fef2f2;
  border-color:#fca5a5;
  color:#991b1b;
}
.safety-alert .safety-icon{
  background:#fee2e2;
  color:#b91c1c;
}
.safety-unknown{
  background:#fffbeb;
  border-color:#fde68a;
  color:#92400e;
}
.safety-issues{
  margin-top:5px;
  font-size:12px;
  line-height:1.5;
}
.processing-stat{
  border-color:#f1cf75;
  background:#fffdf5;
}
.processing-payment-row{
  background:#fffdf5;
}
.processing-time{
  color:#8a5a00;
  margin-top:3px;
}
.payment-processing-lock{
  margin:14px 0;
  padding:12px 13px;
  border:1px solid #f1cf75;
  border-radius:8px;
  background:#fff8df;
  color:#744b00;
  line-height:1.45;
}
.payment-start-note{
  margin:14px 0;
  padding:12px 13px;
  border:1px solid #bfdbfe;
  border-radius:8px;
  background:#eff6ff;
  color:#1e3a8a;
  line-height:1.45;
}
.payment-lock-actions{
  flex-wrap:wrap;
}
.admin-payment-stats{
  grid-template-columns:repeat(5,minmax(0,1fr));
}
@media(max-width:1100px){
  .admin-payment-stats{
    grid-template-columns:repeat(3,minmax(0,1fr));
  }
}
@media(max-width:800px){
  .financial-safety-panel{
    align-items:stretch;
    flex-direction:column;
  }
  .financial-safety-panel .btn{
    width:100%;
  }
  .admin-payment-stats{
    grid-template-columns:1fr;
  }
}


/* V2.6.1 System-managed Offer inventory */
.offer-qty-grid{
  align-items:end;
}
.auto-available-box{
  border:1px solid #bfdbfe;
  background:#eff6ff;
  border-radius:7px;
  padding:9px 11px;
  min-height:62px;
}
.auto-available-box label{
  margin-bottom:3px;
}
.auto-available-value{
  font-size:18px;
  font-weight:800;
  color:#1e3a8a;
  line-height:1.2;
}


/* V2.6.2 Admin MFA */
.mfa-auth-card{
  max-width:520px;
}
.mfa-lock-icon{
  font-size:34px;
  margin:6px 0 8px;
}
.mfa-info-box{
  margin:16px 0;
  padding:12px 14px;
  border:1px solid #bfdbfe;
  border-radius:8px;
  background:#eff6ff;
  color:#1e3a8a;
  font-size:13px;
  line-height:1.5;
}
.wide-btn{
  width:100%;
  justify-content:center;
}
.mfa-signout-btn{
  margin-top:10px;
}
.mfa-setup-steps{
  margin-top:14px;
}
.mfa-step{
  margin:12px 0 8px;
  line-height:1.45;
}
.mfa-qr-wrap{
  display:flex;
  justify-content:center;
  margin:12px auto;
  padding:14px;
  border:1px solid var(--line);
  border-radius:10px;
  background:white;
  max-width:280px;
}
.mfa-qr-wrap img{
  width:240px;
  height:240px;
  max-width:100%;
}
.mfa-secret-block{
  margin:12px 0 16px;
}
.mfa-secret-row{
  display:flex;
  gap:8px;
  align-items:center;
  margin-top:6px;
}
.mfa-secret-row code{
  flex:1;
  overflow-wrap:anywhere;
  padding:9px 10px;
  border:1px solid var(--line);
  border-radius:6px;
  background:#f8fafc;
  font-size:13px;
}
.mfa-code-input{
  text-align:center;
  letter-spacing:.28em;
  font-size:24px;
  font-weight:700;
  font-variant-numeric:tabular-nums;
}
#mfaFactorPickerWrap{
  margin-bottom:10px;
}
.security-overview-grid{
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:14px;
  margin-bottom:16px;
}
.security-card{
  border:1px solid var(--line);
  border-radius:9px;
  padding:16px;
  background:white;
}
.security-card-head{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:12px;
}
.security-status-good{
  margin-top:3px;
  font-size:22px;
  font-weight:800;
  color:#166534;
}
.aal-badge{
  padding:5px 9px;
  border-radius:999px;
  background:#dcfce7;
  color:#166534;
  font-size:12px;
  font-weight:800;
}
.security-factor-count{
  margin-top:3px;
  font-size:28px;
  font-weight:800;
}
.security-factor-card{
  padding:0;
  overflow:hidden;
}
.security-section-head{
  display:flex;
  align-items:flex-end;
  justify-content:space-between;
  gap:16px;
  padding:15px 16px;
  border-bottom:1px solid var(--line);
}
.security-section-head h2{
  margin:0 0 3px;
  font-size:18px;
}
.security-warning-box{
  margin-top:15px;
  padding:12px 14px;
  border:1px solid #fde68a;
  border-radius:8px;
  background:#fffbeb;
  color:#854d0e;
  font-size:13px;
  line-height:1.5;
}
@media(max-width:800px){
  .security-overview-grid{
    grid-template-columns:1fr;
  }
  .security-section-head{
    align-items:stretch;
    flex-direction:column;
  }
  .security-section-head .btn{
    width:100%;
  }
  .mfa-secret-row{
    align-items:stretch;
    flex-direction:column;
  }
}
