:root{font-family:Tahoma,Arial,sans-serif;color:#1f2937;background:#f5f7fb}*{box-sizing:border-box}body{margin:0}.hidden{display:none!important}.center-card{min-height:100vh;display:grid;place-items:center;padding:20px}.login-card{width:min(420px,100%)}main{max-width:1280px;margin:auto;padding:20px}header{display:flex;justify-content:space-between;align-items:center;margin-bottom:15px}header h1{margin:0;color:#0f172a}.card{background:#fff;border:1px solid #e5e7eb;border-radius:16px;padding:20px;box-shadow:0 5px 18px #0f172a0c}.grid2{display:grid;grid-template-columns:1fr 1.2fr;gap:18px}nav{display:flex;gap:8px;flex-wrap:wrap;margin-bottom:16px}button,.buttonlink{border:0;border-radius:10px;padding:11px 16px;background:#e2e8f0;color:#0f172a;cursor:pointer;font-weight:700;text-decoration:none}button:hover,.buttonlink:hover{filter:brightness(.97)}button.primary,nav button.active{background:#0f766e;color:#fff}.secondary{background:#fff;border:1px solid #cbd5e1}label{display:block;margin:10px 0;font-weight:700}input,select,textarea{width:100%;margin-top:6px;border:1px solid #cbd5e1;border-radius:10px;padding:11px;background:#fff;font:inherit}select[size]{height:170px}.row,.filters{display:flex;gap:10px;align-items:end}.row>*{flex:1}.calc{display:grid;grid-template-columns:repeat(5,1fr);gap:10px;margin:16px 0}.calc>div{background:#f0fdfa;border:1px solid #ccfbf1;border-radius:12px;padding:12px}.calc span{display:block;font-size:12px;color:#64748b}.calc strong{font-size:22px;color:#0f766e}.tab{display:none}.tab.active{display:block}.tab.grid2.active{display:grid}.tablewrap{overflow:auto;margin-top:15px}table{width:100%;border-collapse:collapse;white-space:nowrap}th,td{padding:10px;border-bottom:1px solid #e5e7eb;text-align:right}th{background:#f8fafc}.reportgrid{display:grid;grid-template-columns:repeat(3,1fr);gap:12px}.reportcard{border:1px solid #e2e8f0;border-radius:14px;padding:15px}.reportcard h3{margin-top:0}.reportcard b{font-size:20px;color:#0f766e}.settingrow{display:grid;grid-template-columns:1fr 160px 100px;gap:10px;align-items:end;margin:10px 0;padding:10px;background:#f8fafc;border-radius:12px}.muted{color:#64748b}#toast{position:fixed;left:20px;bottom:20px;z-index:20;background:#0f172a;color:white;padding:12px 16px;border-radius:10px;display:none;max-width:360px}@media(max-width:800px){.grid2,.tab.grid2.active,.reportgrid{grid-template-columns:1fr}.filters,.row{flex-direction:column;align-items:stretch}.settingrow{grid-template-columns:1fr}.calc{grid-template-columns:1fr 1fr}.calc>div:last-child{grid-column:1/-1}}


/* DEAL CARDS UI */

.deal-page-head{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:15px;
  margin-bottom:18px;
}

.deal-page-head h2{
  margin:0 0 5px;
}

.deal-page-head p{
  margin:0;
}

.deal-toolbar{
  display:grid;
  grid-template-columns:
    minmax(150px,1fr)
    minmax(210px,1.5fr)
    minmax(160px,1fr)
    minmax(130px,.7fr);
  gap:10px;
  padding:12px;
  margin-bottom:18px;
  border-radius:14px;
  background:#f8fafc;
}

.deal-toolbar label{
  margin:0;
}

.deal-grid{
  display:grid;
  grid-template-columns:
    repeat(auto-fit,minmax(290px,1fr));
  gap:15px;
}

.deal-data-card{
  overflow:hidden;
  background:#fff;
  border:1px solid #e2e8f0;
  border-radius:17px;
  box-shadow:0 7px 22px rgba(15,23,42,.06);
}

.deal-data-row{
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:15px;
  min-height:62px;
  padding:13px 16px;
  border-bottom:1px solid #edf2f7;
}

.deal-data-row:last-child{
  border-bottom:0;
}

.deal-data-row span{
  color:#64748b;
  font-size:12px;
  font-weight:700;
}

.deal-data-row strong{
  color:#0f172a;
  font-size:16px;
  text-align:left;
}

.deal-total-row{
  background:#f0fdfa;
}

.deal-total{
  color:#0f766e!important;
  font-size:22px!important;
}

.deal-empty{
  padding:40px 15px;
  margin-top:10px;
  text-align:center;
  color:#64748b;
  background:#f8fafc;
  border:1px dashed #cbd5e1;
  border-radius:14px;
}

@media(max-width:800px){

  .deal-page-head{
    flex-direction:column;
  }

  .deal-toolbar{
    grid-template-columns:1fr;
  }

  .deal-grid{
    grid-template-columns:1fr;
  }
}



/* MULTI BUYER DEALS */

.buyer-deal-layout{
  align-items:start;
}

.multi-title-row{
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:10px;
  margin-top:20px;
}

.buyer-purchase-row{
  margin:14px 0;
  padding:15px;
  background:#f8fafc;
  border:1px solid #dbe4ec;
  border-radius:15px;
}

.purchase-row-head{
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:10px;
}

.purchase-title{
  font-size:17px;
  color:#0f172a;
}

.purchase-input-grid{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:10px;
}

.purchase-calcs{
  display:grid;
  grid-template-columns:
    repeat(3,1fr);
  gap:8px;
  margin-top:12px;
}

.purchase-calcs>div{
  padding:10px;
  border-radius:10px;
  background:#fff;
  border:1px solid #e2e8f0;
}

.purchase-calcs span,
.buyer-summary span,
.buyer-item-grid span,
.buyer-deal-summary span{
  display:block;
  font-size:11px;
  color:#64748b;
  margin-bottom:4px;
}

.purchase-calcs strong{
  color:#0f766e;
}

.buyer-summary{
  display:grid;
  grid-template-columns:
    repeat(2,1fr);
  gap:10px;
  margin:16px 0;
}

.buyer-summary>div{
  padding:12px;
  background:#f0fdfa;
  border:1px solid #ccfbf1;
  border-radius:12px;
}

.buyer-summary strong{
  font-size:20px;
  color:#0f766e;
}

.buyer-summary .buyer-final{
  grid-column:1/-1;
}

.buyer-deals-list{
  display:grid;
  gap:16px;
}

.buyer-deal-card{
  border:1px solid #dbe4ec;
  border-radius:17px;
  overflow:hidden;
  background:#fff;
}

.buyer-deal-head{
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:15px;
  padding:15px;
  background:#f8fafc;
}

.buyer-deal-head h3{
  margin:3px 0 0;
}

.purchase-badge{
  background:#0f766e;
  color:#fff;
  border-radius:999px;
  padding:7px 12px;
  font-weight:700;
}

.buyer-deal-date{
  padding:8px 15px;
  font-size:12px;
  color:#64748b;
  border-bottom:1px solid #e2e8f0;
}

.buyer-items{
  padding:12px;
}

.buyer-item{
  margin-bottom:10px;
  padding:12px;
  background:#f8fafc;
  border-radius:12px;
}

.buyer-item:last-child{
  margin-bottom:0;
}

.buyer-item-title{
  font-weight:800;
  color:#0f766e;
  margin-bottom:9px;
}

.buyer-item-grid{
  display:grid;
  grid-template-columns:
    repeat(3,1fr);
  gap:8px;
}

.buyer-item-grid>div{
  background:#fff;
  padding:9px;
  border-radius:9px;
  border:1px solid #e8edf2;
}

.buyer-deal-summary{
  display:grid;
  grid-template-columns:
    repeat(2,1fr);
  gap:8px;
  padding:12px;
  border-top:1px solid #e2e8f0;
  background:#f8fafc;
}

.buyer-deal-summary>div{
  padding:10px;
  background:#fff;
  border-radius:10px;
}

.buyer-final-box{
  grid-column:1/-1;
  background:#f0fdfa!important;
  border:1px solid #99f6e4;
}

.buyer-final-box strong{
  font-size:22px;
  color:#0f766e;
}

@media(max-width:800px){

  .purchase-input-grid,
  .purchase-calcs,
  .buyer-item-grid{
    grid-template-columns:1fr;
  }

  .buyer-summary,
  .buyer-deal-summary{
    grid-template-columns:1fr;
  }

  .buyer-summary .buyer-final,
  .buyer-final-box{
    grid-column:auto;
  }
}



/* SINGLE SALE ACCOUNTING */

.auto-accounting-box{
  display:flex;
  flex-direction:column;
  gap:4px;
  margin:10px 0 14px;
  padding:13px 15px;
  background:#f0fdfa;
  border:1px solid #99f6e4;
  border-radius:12px;
}

.auto-accounting-box strong{
  color:#0f766e;
  font-size:15px;
}

.auto-accounting-box span{
  color:#64748b;
  font-size:12px;
}

/*
  لدينا الآن:
  عمولة الرعوي
  قيمتها
  صافي الرعوي
  عمولة المشتري
  النهائي على المشتري
  إجمالي عمولة المحرج
*/
.calc{
  grid-template-columns:
    repeat(3,1fr)!important;
}

@media(max-width:800px){
  .calc{
    grid-template-columns:
      repeat(2,1fr)!important;
  }

  .calc>div:last-child{
    grid-column:auto!important;
  }
}



/* SELLER MULTI DEALS */

.seller-deal-layout{
  align-items:start;
}

.seller-purchase-box{
  margin:15px 0;
  padding:15px;
  border:1px solid #cbd5e1;
  border-radius:16px;
  background:#f8fafc;
}

.seller-item-totals,
.seller-buyer-calcs{
  display:grid;
  grid-template-columns:
    repeat(3,1fr);
  gap:8px;
  margin:10px 0;
}

.seller-item-totals>div,
.seller-buyer-calcs>div{
  padding:10px;
  background:white;
  border:1px solid #e2e8f0;
  border-radius:10px;
}

.seller-item-totals span,
.seller-buyer-calcs span,
.seller-main-summary span,
.seller-view-calcs span,
.seller-deal-summary-view span{
  display:block;
  color:#64748b;
  font-size:11px;
  margin-bottom:4px;
}

.seller-buyers-header{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  margin:16px 0 8px;
}

.seller-buyer-row{
  margin:8px 0;
  padding:12px;
  border:1px solid #dbe4ec;
  border-radius:12px;
  background:white;
}

.seller-buyer-row-head{
  display:flex;
  justify-content:space-between;
  align-items:center;
  margin-bottom:6px;
}

.seller-allocation-status{
  padding:10px;
  background:#f0fdfa;
  border-radius:10px;
  margin-top:10px;
}

.allocation-error{
  color:#dc2626!important;
}

.seller-main-summary{
  display:grid;
  grid-template-columns:
    repeat(2,1fr);
  gap:9px;
  margin:15px 0;
}

.seller-main-summary>div{
  padding:11px;
  background:#f0fdfa;
  border:1px solid #ccfbf1;
  border-radius:11px;
}

.seller-main-summary strong{
  color:#0f766e;
  font-size:19px;
}

.seller-auction-total{
  grid-column:1/-1;
}

.seller-deals-list{
  display:grid;
  gap:16px;
}

.seller-deal-card{
  overflow:hidden;
  border:1px solid #dbe4ec;
  border-radius:17px;
  background:white;
}

.seller-deal-head{
  display:flex;
  justify-content:space-between;
  gap:12px;
  align-items:center;
  padding:14px;
  background:#f8fafc;
}

.seller-deal-head h3{
  margin:3px 0;
}

.seller-deal-badges{
  display:flex;
  gap:6px;
  flex-wrap:wrap;
}

.seller-deal-badges span{
  padding:6px 10px;
  border-radius:999px;
  background:#0f766e;
  color:white;
  font-weight:700;
}

.seller-purchases-view{
  padding:12px;
}

.seller-purchase-view{
  padding:12px;
  margin-bottom:10px;
  border-radius:13px;
  background:#f8fafc;
}

.seller-purchase-view-head{
  display:flex;
  justify-content:space-between;
  gap:10px;
  margin-bottom:9px;
}

.seller-view-calcs{
  display:grid;
  grid-template-columns:
    repeat(3,1fr);
  gap:7px;
}

.seller-view-calcs>div{
  padding:8px;
  background:#fff;
  border-radius:9px;
}

.seller-buyers-view{
  margin-top:10px;
}

.seller-buyer-view{
  display:flex;
  flex-wrap:wrap;
  gap:8px 14px;
  align-items:center;
  margin-top:7px;
  padding:9px;
  background:white;
  border:1px solid #e2e8f0;
  border-radius:9px;
}

.seller-buyer-final{
  color:#0f766e;
  font-weight:800;
}

.seller-deal-summary-view{
  display:grid;
  grid-template-columns:
    repeat(2,1fr);
  gap:8px;
  padding:12px;
  border-top:1px solid #e2e8f0;
  background:#f8fafc;
}

.seller-deal-summary-view>div{
  padding:9px;
  background:#fff;
  border-radius:9px;
}

.seller-total-highlight{
  grid-column:1/-1;
  background:#f0fdfa!important;
}

.seller-total-highlight strong{
  color:#0f766e;
  font-size:21px;
}

@media(max-width:800px){

  .seller-item-totals,
  .seller-buyer-calcs,
  .seller-view-calcs,
  .seller-main-summary,
  .seller-deal-summary-view{
    grid-template-columns:1fr;
  }

  .seller-auction-total,
  .seller-total-highlight{
    grid-column:auto;
  }

  .seller-deal-head,
  .seller-purchase-view-head{
    align-items:flex-start;
    flex-direction:column;
  }
}

