#tab-buyer-deals.buyer-reference-page{
  direction:rtl;
  background:linear-gradient(180deg,#f3f0fb 0%,#f7f8fc 45%,#f8f8fb 100%);
}

@media(max-width:860px){

  #tab-buyer-deals.active{
    display:block !important;
    width:100% !important;
    padding:0 9px 88px !important;
    margin:0 !important;
    overflow-x:hidden;
  }

  .br-dashboard-header{
    width:calc(100% + 18px);
    margin:0 -9px 7px;
    padding:12px 15px 18px;
    min-height:86px;
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:10px;
    color:#fff;
    border-radius:0 0 22px 22px;
    background:linear-gradient(135deg,#5523b8 0%,#6c2fd2 48%,#39229a 100%);
    box-shadow:0 8px 25px rgba(72,37,151,.18);
  }

  .br-dashboard-title{
    display:flex;
    align-items:center;
    gap:9px;
  }

  .br-logo{
    width:43px;
    height:43px;
    display:grid;
    place-items:center;
    border-radius:12px;
    background:linear-gradient(145deg,#9d54ff,#6d20e4);
  }

  .br-logo span{
    font-size:13px;
    letter-spacing:1px;
    transform:rotate(-90deg);
  }

  .br-dashboard-title h1{
    margin:0;
    font-size:18px;
    font-weight:900;
  }

  .br-dashboard-title p{
    margin:3px 0 0;
    color:rgba(255,255,255,.75);
    font-size:8.5px;
  }

  .br-admin-box{
    display:flex;
    align-items:center;
    gap:6px;
  }

  .br-admin-avatar{
    width:36px;
    height:36px;
    display:grid;
    place-items:center;
    border:1px solid rgba(255,255,255,.5);
    border-radius:50%;
    background:rgba(255,255,255,.08);
    font-size:17px;
  }

  .br-admin-box strong{
    display:block;
    font-size:10px;
  }

  .br-admin-box span{
    display:block;
    margin-top:1px;
    color:rgba(255,255,255,.7);
    font-size:7px;
  }

  .br-menu-button{
    width:34px !important;
    height:34px !important;
    min-height:34px !important;
    padding:0 !important;
    border:0 !important;
    border-radius:10px !important;
    background:rgba(255,255,255,.08) !important;
    color:#fff !important;
    font-size:20px !important;
  }

  .br-top-nav{
    display:grid;
    grid-template-columns:repeat(6,minmax(0,1fr));
    gap:4px;
    margin:0 0 8px;
    padding:6px;
    border:1px solid #eeeaf5;
    border-radius:14px;
    background:rgba(255,255,255,.95);
    box-shadow:0 4px 18px rgba(46,35,71,.06);
    overflow-x:auto;
  }

  .br-top-nav button{
    min-width:54px !important;
    min-height:53px !important;
    padding:4px 2px !important;
    display:flex !important;
    flex-direction:column;
    align-items:center;
    justify-content:center;
    gap:3px;
    border:0 !important;
    border-radius:10px !important;
    background:#f5f3fa !important;
    color:#675d79 !important;
    font-size:7px !important;
    font-family:inherit;
  }

  .br-top-nav button span{
    font-size:15px;
  }

  .br-top-nav button.active{
    background:linear-gradient(135deg,#8d35f0,#6425d4) !important;
    color:#fff !important;
    box-shadow:0 5px 15px rgba(109,42,218,.25);
  }

  .br-stats{
    display:grid;
    grid-template-columns:repeat(4,minmax(0,1fr));
    gap:5px;
    margin-bottom:8px;
  }

  .br-stat-card{
    position:relative;
    min-width:0;
    padding:9px 7px 8px;
    border:1px solid #ece8f2;
    border-radius:13px;
    background:#fff;
    box-shadow:0 5px 18px rgba(60,42,84,.05);
    overflow:hidden;
  }

  .br-stat-card > span{
    display:block;
    margin-bottom:4px;
    color:#6e6578;
    font-size:7px;
  }

  .br-stat-card strong{
    display:block;
    direction:ltr;
    text-align:right;
    font-size:12px;
    font-weight:900;
  }

  .br-stat-card small{
    display:block;
    margin-top:3px;
    color:#8a8194;
    font-size:6px;
  }

  .br-stat-icon{
    position:absolute;
    left:6px;
    top:6px;
    width:25px;
    height:25px;
    display:grid;
    place-items:center;
    border-radius:8px;
    font-size:11px;
  }

  .br-stat-card.green strong{color:#088a6a;}
  .br-stat-card.green .br-stat-icon{background:#daf7eb;}

  .br-stat-card.blue strong{color:#1974cf;}
  .br-stat-card.blue .br-stat-icon{background:#e1f1ff;}

  .br-stat-card.purple strong{color:#6d31ca;}
  .br-stat-card.purple .br-stat-icon{background:#eee2ff;}

  .br-stat-card.orange strong{color:#d87823;}
  .br-stat-card.orange .br-stat-icon{background:#fff0df;}

  .br-card{
    margin-bottom:8px;
    padding:10px;
    border:1px solid #ebe7f0;
    border-radius:15px;
    background:rgba(255,255,255,.97);
    box-shadow:0 5px 18px rgba(56,42,80,.055);
  }

  .br-card-head{
    display:flex;
    align-items:center;
    gap:8px;
    margin-bottom:9px;
  }

  .br-card-head-icon{
    width:39px;
    height:39px;
    display:grid;
    place-items:center;
    flex:0 0 39px;
    border-radius:11px;
    color:#fff;
    background:linear-gradient(145deg,#9542f0,#6f28d9);
    box-shadow:0 5px 13px rgba(114,42,219,.2);
    font-size:17px;
  }

  .br-card-head h2{
    margin:0;
    color:#21192b;
    font-size:14px;
    font-weight:900;
  }

  .br-card-head p{
    margin:3px 0 0;
    color:#8a8193;
    font-size:7.5px;
  }

  .br-form-grid{
    display:grid;
    grid-template-columns:repeat(2,minmax(0,1fr));
    gap:7px;
  }

  .br-field{
    display:block;
    margin:0 !important;
    color:#342a40;
    font-size:9px !important;
  }

  .br-field.br-full{
    grid-column:1/-1;
  }

  .br-field > span{
    display:block;
    margin:0 3px 4px;
    font-weight:700;
  }

  .br-input-shell{
    position:relative;
  }

  .br-input-shell input,
  .br-input-shell textarea{
    width:100% !important;
    min-height:42px !important;
    margin:0 !important;
    padding:7px 38px 7px 9px !important;
    border:1px solid #ddd9e5 !important;
    border-radius:10px !important;
    background:#fff !important;
    color:#28202f !important;
    font-size:10px !important;
    font-family:inherit;
  }

  .br-input-shell textarea{
    min-height:47px !important;
    resize:none;
  }

  .br-input-icon{
    position:absolute;
    right:6px;
    top:50%;
    transform:translateY(-50%);
    width:27px;
    height:27px;
    display:grid;
    place-items:center;
    border-radius:7px;
    background:#f0eaf8;
    color:#6f55a0;
    font-size:12px;
    pointer-events:none;
  }

  .br-add-purchase{
    width:100% !important;
    min-height:43px !important;
    margin:9px 0 !important;
    border:0 !important;
    border-radius:10px !important;
    color:#fff !important;
    background:linear-gradient(90deg,#8c29f4,#5222bd) !important;
    font-family:inherit;
    font-size:11px !important;
    font-weight:800;
  }

  .br-add-purchase span{
    font-size:20px;
    vertical-align:-2px;
    margin-left:5px;
  }

  #buyerPurchaseRows{
    display:grid;
    gap:7px;
  }

  #buyerPurchaseRows .buyer-purchase-row{
    padding:9px !important;
    border:1px solid #e3d8ee !important;
    border-radius:12px !important;
    background:linear-gradient(180deg,#fcfaff,#f8f4fd) !important;
  }

  #buyerPurchaseRows .purchase-row-head{
    display:flex;
    align-items:center;
    justify-content:space-between;
    margin-bottom:7px;
  }

  #buyerPurchaseRows .purchase-title{
    padding:4px 9px;
    border-radius:7px;
    background:#eadbff;
    color:#742bd0;
    font-size:9px;
  }

  #buyerPurchaseRows .remove-purchase{
    min-height:27px !important;
    padding:3px 8px !important;
    border-radius:7px !important;
    font-size:7px !important;
  }

  #buyerPurchaseRows .purchase-input-grid{
    display:grid !important;
    grid-template-columns:repeat(2,minmax(0,1fr)) !important;
    gap:6px !important;
  }

  #buyerPurchaseRows label{
    margin:0 !important;
    font-size:7.5px !important;
  }

  #buyerPurchaseRows input,
  #buyerPurchaseRows select{
    min-height:34px !important;
    margin-top:3px !important;
    padding:5px 7px !important;
    border:1px solid #dfd9e6 !important;
    border-radius:8px !important;
    background:#fff !important;
    font-size:9px !important;
  }

  #buyerPurchaseRows .purchase-calcs{
    display:grid !important;
    grid-template-columns:repeat(3,minmax(0,1fr)) !important;
    gap:5px !important;
    margin-top:7px !important;
  }

  #buyerPurchaseRows .purchase-calcs > div{
    padding:6px !important;
    border-radius:8px !important;
    background:#fff !important;
    border:1px solid #eee8f3;
  }

  #buyerPurchaseRows .purchase-calcs span{
    display:block;
    color:#8d8297;
    font-size:6px !important;
  }

  #buyerPurchaseRows .purchase-calcs strong{
    display:block;
    margin-top:2px;
    color:#6030bb;
    font-size:10px !important;
  }

  .br-buyer-summary{
    display:grid !important;
    grid-template-columns:repeat(2,minmax(0,1fr)) !important;
    gap:5px !important;
    margin-top:8px !important;
  }

  .br-buyer-summary > div{
    padding:7px !important;
    border:1px solid #ece4f4 !important;
    border-radius:9px !important;
    background:#faf7fd !important;
  }

  .br-buyer-summary span{
    display:block;
    color:#877c91;
    font-size:6.5px !important;
  }

  .br-buyer-summary strong{
    display:block;
    margin-top:2px;
    color:#6b2ac9;
    font-size:11px !important;
  }

  .br-buyer-summary .buyer-final{
    background:linear-gradient(135deg,#e8fff6,#f3fffb) !important;
  }

  .br-buyer-summary .buyer-final strong{
    color:#008867 !important;
  }

  .br-form-actions{
    display:grid !important;
    grid-template-columns:repeat(2,minmax(0,1fr)) !important;
    gap:6px !important;
    margin-top:8px !important;
  }

  .br-form-actions button{
    min-height:38px !important;
    border-radius:9px !important;
    font-size:9px !important;
  }

  .br-list-header{
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:8px;
    margin-bottom:8px;
  }

  .br-list-header .br-card-head{
    margin:0;
  }

  .br-refresh{
    min-width:70px !important;
    min-height:34px !important;
    padding:5px 8px !important;
    border:1px solid #e6dcf2 !important;
    border-radius:9px !important;
    background:#f8f3fd !important;
    color:#7132c9 !important;
    font-size:8px !important;
  }

  .br-deals-list{
    display:grid;
    gap:8px;
  }

  .br-deals-list .buyer-deal-card{
    padding:9px !important;
    border:1px solid #e4dfeb !important;
    border-radius:12px !important;
    background:#fff !important;
  }

  .br-deals-list .buyer-deal-head{
    display:flex !important;
    align-items:center !important;
    justify-content:space-between !important;
    gap:7px !important;
    margin-bottom:7px !important;
  }

  .br-deals-list .buyer-deal-head strong{
    font-size:11px !important;
  }

  .br-deals-list .buyer-deal-date{
    color:#857a91 !important;
    font-size:7px !important;
  }

  .br-deals-list .purchase-badge{
    padding:4px 8px !important;
    border-radius:7px !important;
    background:#ddf8ed !important;
    color:#078969 !important;
    font-size:8px !important;
  }

  .br-deals-list .buyer-deal-summary{
    margin-top:7px !important;
    padding:7px !important;
    border-radius:9px !important;
    background:linear-gradient(135deg,#e7fff7,#f1fffb) !important;
    border:1px solid #cef0e4 !important;
  }

  .br-back-home{
    display:none !important;
  }
}


/* ==========================================================
   BUYER REFERENCE - EXACT MOBILE TUNING
   ========================================================== */

@media(max-width:860px){

  /* الصفحة */
  #tab-buyer-deals.active{
    padding:
      0 8px 72px !important;
  }


  /* الهيدر العلوي أصغر */
  .br-dashboard-header{
    min-height:
      78px !important;

    padding:
      10px 13px 14px !important;

    margin-bottom:
      6px !important;

    border-radius:
      0 0 20px 20px !important;
  }

  .br-dashboard-title h1{
    font-size:
      17px !important;
  }

  .br-dashboard-title p{
    font-size:
      7.5px !important;
  }

  .br-logo{
    width:
      38px !important;

    height:
      38px !important;
  }

  .br-admin-avatar{
    width:
      32px !important;

    height:
      32px !important;
  }

  .br-menu-button{
    width:
      31px !important;

    height:
      31px !important;

    min-height:
      31px !important;
  }


  /* القائمة العلوية */
  .br-top-nav{
    gap:
      3px !important;

    padding:
      5px !important;

    margin-bottom:
      6px !important;

    border-radius:
      12px !important;
  }

  .br-top-nav button{
    min-height:
      48px !important;

    min-width:
      50px !important;

    border-radius:
      9px !important;

    font-size:
      6.5px !important;
  }

  .br-top-nav button span{
    font-size:
      14px !important;
  }


  /* الإحصائيات */
  .br-stats{
    gap:
      4px !important;

    margin-bottom:
      7px !important;
  }

  .br-stat-card{
    min-height:
      73px !important;

    padding:
      8px 6px 6px !important;

    border-radius:
      11px !important;
  }

  .br-stat-card > span{
    font-size:
      6px !important;
  }

  .br-stat-card strong{
    font-size:
      11px !important;
  }

  .br-stat-card small{
    font-size:
      5.5px !important;
  }

  .br-stat-icon{
    width:
      22px !important;

    height:
      22px !important;

    font-size:
      9px !important;
  }


  /* البطاقة الرئيسية */
  .br-main-card{
    padding:
      9px !important;

    border-radius:
      14px !important;
  }

  .br-card-head{
    margin-bottom:
      7px !important;
  }

  .br-card-head-icon{
    width:
      36px !important;

    height:
      36px !important;

    flex-basis:
      36px !important;

    border-radius:
      10px !important;

    font-size:
      15px !important;
  }

  .br-card-head h2{
    font-size:
      13px !important;
  }

  .br-card-head p{
    font-size:
      7px !important;
  }


  /* الحقول */
  .br-form-grid{
    gap:
      5px !important;
  }

  .br-field > span{
    margin-bottom:
      3px !important;

    font-size:
      8px !important;
  }

  .br-input-shell input{
    min-height:
      37px !important;

    height:
      37px !important;

    padding:
      5px 34px 5px 8px !important;

    font-size:
      9px !important;

    border-radius:
      9px !important;
  }

  .br-input-shell textarea{
    min-height:
      39px !important;

    height:
      39px !important;

    padding:
      6px 34px 5px 8px !important;

    font-size:
      9px !important;

    border-radius:
      9px !important;
  }

  .br-input-icon{
    width:
      24px !important;

    height:
      24px !important;

    right:
      5px !important;

    border-radius:
      6px !important;

    font-size:
      10px !important;
  }


  /* زر إضافة شروة - بعرض كامل مثل المرجع */
  .br-add-purchase{
    display:flex !important;

    align-items:center !important;

    justify-content:center !important;

    width:
      100% !important;

    min-height:
      39px !important;

    margin:
      7px 0 !important;

    padding:
      0 12px !important;

    border-radius:
      9px !important;

    font-size:
      10px !important;
  }

  .br-add-purchase span{
    font-size:
      18px !important;

    margin-left:
      5px !important;
  }


  /* الشروات */
  #buyerPurchaseRows{
    gap:
      6px !important;
  }

  #buyerPurchaseRows
  .buyer-purchase-row{
    padding:
      8px !important;

    border-radius:
      10px !important;
  }

  #buyerPurchaseRows
  .purchase-row-head{
    margin-bottom:
      5px !important;
  }

  #buyerPurchaseRows
  .purchase-title{
    padding:
      4px 8px !important;

    border-radius:
      6px !important;

    font-size:
      8.5px !important;
  }

  #buyerPurchaseRows
  .remove-purchase{
    min-height:
      25px !important;

    padding:
      2px 7px !important;

    font-size:
      6.5px !important;
  }

  #buyerPurchaseRows
  .purchase-input-grid{
    gap:
      5px !important;
  }

  #buyerPurchaseRows label{
    font-size:
      7px !important;
  }

  #buyerPurchaseRows input,
  #buyerPurchaseRows select{
    min-height:
      31px !important;

    height:
      31px !important;

    padding:
      4px 6px !important;

    margin-top:
      2px !important;

    border-radius:
      7px !important;

    font-size:
      8px !important;
  }


  /* حسابات كل شروة */
  #buyerPurchaseRows
  .purchase-calcs{
    gap:
      4px !important;

    margin-top:
      5px !important;
  }

  #buyerPurchaseRows
  .purchase-calcs > div{
    padding:
      5px !important;

    border-radius:
      7px !important;
  }

  #buyerPurchaseRows
  .purchase-calcs span{
    font-size:
      5.7px !important;
  }

  #buyerPurchaseRows
  .purchase-calcs strong{
    font-size:
      9px !important;
  }


  /* الملخص */
  .br-buyer-summary{
    gap:
      4px !important;

    margin-top:
      6px !important;
  }

  .br-buyer-summary > div{
    padding:
      6px !important;

    border-radius:
      8px !important;
  }

  .br-buyer-summary span{
    font-size:
      6px !important;
  }

  .br-buyer-summary strong{
    font-size:
      10px !important;
  }


  /* أزرار الحفظ */
  .br-form-actions{
    gap:
      5px !important;

    margin-top:
      6px !important;
  }

  .br-form-actions button{
    min-height:
      35px !important;

    font-size:
      8.5px !important;

    border-radius:
      8px !important;
  }


  /* قسم مبيعات العملاء */
  .br-sales-card{
    padding:
      9px !important;
  }

  .br-list-header{
    margin-bottom:
      6px !important;
  }

  .br-refresh{
    min-width:
      61px !important;

    min-height:
      30px !important;

    font-size:
      7px !important;
  }


  /* بطاقات الصفقات المحفوظة */
  .br-deals-list{
    gap:
      6px !important;
  }

  .br-deals-list
  .buyer-deal-card{
    padding:
      7px !important;

    border-radius:
      10px !important;
  }

  .br-deals-list
  .buyer-deal-head{
    margin-bottom:
      5px !important;
  }

  .br-deals-list
  .buyer-deal-head strong{
    font-size:
      10px !important;
  }

  .br-deals-list
  .buyer-deal-date{
    font-size:
      6px !important;
  }

  .br-deals-list
  .purchase-badge{
    padding:
      3px 7px !important;

    font-size:
      7px !important;
  }

}


/* ==========================================================
   BUYER PAGE - FINAL MATCH OVERRIDES
   ========================================================== */

@media(max-width:860px){

  /* البطاقة الرئيسية */
  #tab-buyer-deals .br-main-card{
    padding:9px !important;
  }


  /* البحث */
  #tab-buyer-deals #multiBuyerName{
    height:40px !important;
    min-height:40px !important;
  }


  /* التاريخ */
  #tab-buyer-deals #multiBuyerDate{
    height:40px !important;
    min-height:40px !important;
  }


  /* الملاحظات - أصغر بكثير */
  #tab-buyer-deals #multiBuyerNotes{
    height:42px !important;
    min-height:42px !important;
    max-height:42px !important;

    resize:none !important;

    padding-top:9px !important;
    padding-bottom:6px !important;
  }


  /* =================================
     زر إضافة شروة بعرض كامل
     ================================= */

  #tab-buyer-deals #addBuyerPurchase{
    display:flex !important;

    width:100% !important;
    max-width:none !important;

    height:42px !important;
    min-height:42px !important;

    margin:
      8px 0 !important;

    padding:
      0 12px !important;

    align-items:center !important;
    justify-content:center !important;

    position:static !important;

    float:none !important;

    transform:none !important;

    border-radius:
      10px !important;

    background:
      linear-gradient(
        90deg,
        #8d29f5,
        #5621c3
      ) !important;

    color:#fff !important;

    font-size:
      10px !important;

    font-weight:
      800 !important;

    text-align:center !important;
  }


  #tab-buyer-deals
  #addBuyerPurchase span{
    margin:
      0 0 0 6px !important;

    font-size:
      20px !important;

    line-height:
      1 !important;
  }


  /* =================================
     بطاقة الشروة
     ================================= */

  #tab-buyer-deals
  #buyerPurchaseRows{
    margin-top:
      5px !important;

    gap:
      6px !important;
  }


  #tab-buyer-deals
  #buyerPurchaseRows
  .buyer-purchase-row{
    padding:
      8px !important;

    margin:
      0 !important;

    border-radius:
      11px !important;

    min-height:
      0 !important;
  }


  /* رأس الشروة */
  #tab-buyer-deals
  #buyerPurchaseRows
  .purchase-row-head{
    min-height:
      30px !important;

    margin-bottom:
      5px !important;

    align-items:center !important;
  }


  #tab-buyer-deals
  #buyerPurchaseRows
  .purchase-title{
    padding:
      4px 8px !important;

    font-size:
      8px !important;

    border-radius:
      6px !important;
  }


  #tab-buyer-deals
  #buyerPurchaseRows
  .remove-purchase{
    width:auto !important;

    height:28px !important;
    min-height:28px !important;

    padding:
      3px 8px !important;

    font-size:
      7px !important;

    border-radius:
      7px !important;
  }


  /* حقول الشروة صفين مضغوطين */
  #tab-buyer-deals
  #buyerPurchaseRows
  .purchase-input-grid{
    display:grid !important;

    grid-template-columns:
      repeat(2,minmax(0,1fr))
      !important;

    gap:
      5px 6px !important;
  }


  #tab-buyer-deals
  #buyerPurchaseRows label{
    font-size:
      7px !important;

    line-height:
      1.2 !important;
  }


  #tab-buyer-deals
  #buyerPurchaseRows input,

  #tab-buyer-deals
  #buyerPurchaseRows select{
    height:
      32px !important;

    min-height:
      32px !important;

    margin-top:
      2px !important;

    padding:
      3px 6px !important;

    border-radius:
      7px !important;

    font-size:
      8.5px !important;
  }


  /* حسابات الشروة */
  #tab-buyer-deals
  #buyerPurchaseRows
  .purchase-calcs{
    display:grid !important;

    grid-template-columns:
      repeat(3,minmax(0,1fr))
      !important;

    gap:
      4px !important;

    margin-top:
      5px !important;
  }


  #tab-buyer-deals
  #buyerPurchaseRows
  .purchase-calcs > div{
    min-height:
      39px !important;

    padding:
      5px !important;

    border-radius:
      7px !important;
  }


  #tab-buyer-deals
  #buyerPurchaseRows
  .purchase-calcs span{
    font-size:
      5.8px !important;
  }


  #tab-buyer-deals
  #buyerPurchaseRows
  .purchase-calcs strong{
    margin-top:
      1px !important;

    font-size:
      9px !important;
  }


  /* ملخص الصفقة */
  #tab-buyer-deals
  .br-buyer-summary{
    margin-top:
      6px !important;

    gap:
      4px !important;
  }


  #tab-buyer-deals
  .br-buyer-summary > div{
    min-height:
      42px !important;

    padding:
      5px !important;
  }


  /* أزرار الحفظ */
  #tab-buyer-deals
  .br-form-actions{
    margin-top:
      6px !important;
  }


  #tab-buyer-deals
  .br-form-actions button{
    height:
      37px !important;

    min-height:
      37px !important;
  }

}


/* ==========================================================
   BUYER PAGE - POLISH PASS
   ========================================================== */

@media(max-width:860px){

  /* إصلاح الملاحظات */
  #tab-buyer-deals #multiBuyerNotes{
    border-left:
      1px solid #ddd9e5 !important;

    border-right:
      1px solid #ddd9e5 !important;

    border-top:
      1px solid #ddd9e5 !important;

    border-bottom:
      1px solid #ddd9e5 !important;

    outline:none !important;

    box-shadow:none !important;

    appearance:none !important;
    -webkit-appearance:none !important;

    overflow:hidden !important;

    resize:none !important;
  }


  /* إزالة أي زخرفة أو شريط جانبي */
  #tab-buyer-deals
  .br-input-shell textarea::-webkit-resizer{
    display:none !important;
  }


  /* زر حذف الشروة */
  #tab-buyer-deals
  #buyerPurchaseRows
  .remove-purchase{
    width:
      44px !important;

    min-width:
      44px !important;

    height:
      27px !important;

    min-height:
      27px !important;

    padding:
      0 6px !important;

    display:flex !important;

    align-items:center !important;

    justify-content:center !important;

    gap:
      3px !important;

    border:
      1px solid #efd0d0 !important;

    border-radius:
      7px !important;

    background:
      #fff4f4 !important;

    color:
      #b84646 !important;

    font-size:
      6.5px !important;

    box-shadow:none !important;
  }


  /* اسم العميل داخل الشروة */
  #tab-buyer-deals
  #buyerPurchaseRows
  select{
    font-weight:
      700 !important;

    color:
      #26202d !important;
  }


  /* حقول العدد والسعر */
  #tab-buyer-deals
  #buyerPurchaseRows
  .purchase-input-grid{
    margin-top:
      2px !important;
  }


  #tab-buyer-deals
  #buyerPurchaseRows
  input{
    text-align:
      right !important;

    font-weight:
      700 !important;
  }


  /* مربعات حساب الشروة */
  #tab-buyer-deals
  #buyerPurchaseRows
  .purchase-calcs{
    grid-template-columns:
      repeat(3,minmax(0,1fr))
      !important;

    gap:
      4px !important;
  }


  #tab-buyer-deals
  #buyerPurchaseRows
  .purchase-calcs > div{
    min-height:
      44px !important;

    padding:
      5px 4px !important;

    display:flex !important;

    flex-direction:column !important;

    align-items:center !important;

    justify-content:center !important;

    text-align:center !important;

    border:
      1px solid #e7efe9 !important;

    border-radius:
      8px !important;

    background:
      linear-gradient(
        180deg,
        #f8fffc,
        #f1fbf7
      ) !important;
  }


  #tab-buyer-deals
  #buyerPurchaseRows
  .purchase-calcs span{
    color:
      #648676 !important;

    font-size:
      5.7px !important;

    line-height:
      1.15 !important;
  }


  #tab-buyer-deals
  #buyerPurchaseRows
  .purchase-calcs strong{
    margin-top:
      2px !important;

    color:
      #13896b !important;

    font-size:
      9.5px !important;

    font-weight:
      900 !important;
  }


  /* ملخص الصفقة الرئيسي */
  #tab-buyer-deals
  .br-buyer-summary{
    grid-template-columns:
      repeat(2,minmax(0,1fr))
      !important;
  }


  #tab-buyer-deals
  .br-buyer-summary > div{
    min-height:
      44px !important;

    display:flex !important;

    flex-direction:column !important;

    align-items:center !important;

    justify-content:center !important;

    text-align:center !important;
  }


  #tab-buyer-deals
  .br-buyer-summary span{
    font-size:
      6px !important;

    line-height:
      1.15 !important;
  }


  #tab-buyer-deals
  .br-buyer-summary strong{
    margin-top:
      2px !important;

    font-size:
      10px !important;

    font-weight:
      900 !important;
  }

}


/* ==========================================================
   BUYER SAVED RESULTS - REFERENCE DESIGN
   ========================================================== */

@media(max-width:860px){

  .buyer-result-card{
    overflow:hidden;

    margin-bottom:10px;

    border:
      1px solid #e4e7ec;

    border-radius:
      14px;

    background:
      #fff;

    box-shadow:
      0 4px 16px
      rgba(45,56,70,.05);
  }


  .buyer-result-head{
    min-height:56px;

    display:grid;

    grid-template-columns:
      32px
      auto
      minmax(0,1fr);

    align-items:center;

    gap:8px;

    padding:
      8px 10px;

    border-bottom:
      1px solid #edf0f3;

    background:#fff;
  }


  .buyer-result-toggle{
    width:
      28px !important;

    height:
      28px !important;

    min-height:
      28px !important;

    padding:
      0 !important;

    border:
      0 !important;

    border-radius:
      8px !important;

    background:
      #f5f2fb !important;

    color:
      #372851 !important;

    font-size:
      17px !important;

    line-height:
      1 !important;
  }


  .buyer-result-count{
    min-width:78px;

    padding:
      7px 12px;

    border-radius:
      999px;

    background:
      linear-gradient(
        135deg,
        #0aa18a,
        #078f79
      );

    color:#fff;

    font-size:
      10px;

    font-weight:
      900;

    text-align:center;
  }


  .buyer-result-person{
    display:flex;

    align-items:center;

    justify-content:
      flex-start;

    gap:8px;

    min-width:0;
  }


  .buyer-result-avatar{
    width:38px;
    height:38px;

    display:grid;

    place-items:center;

    flex:
      0 0 38px;

    border-radius:
      11px;

    background:
      #efe2ff;

    color:
      #782ce0;

    font-size:
      18px;
  }


  .buyer-result-person h3{
    margin:0;

    color:#241b31;

    font-size:
      13px;

    font-weight:
      900;
  }


  .buyer-result-date{
    margin-top:
      3px;

    color:
      #68758a;

    font-size:
      7.5px;
  }


  .buyer-result-body{
    padding:
      8px;
  }


  .buyer-result-card.collapsed
  .buyer-result-body{
    display:none;
  }


  /* =========================
     كل شروة
     ========================= */

  .buyer-result-purchase{
    margin-bottom:
      7px;

    padding:
      7px;

    border:
      1px solid #e4ebee;

    border-radius:
      11px;

    background:
      linear-gradient(
        180deg,
        #fbfefd,
        #f7fbfa
      );
  }


  .buyer-result-purchase-title{
    display:flex;

    align-items:center;

    justify-content:
      flex-start;

    gap:5px;

    margin-bottom:
      6px;

    color:
      #038977;

    font-size:
      10px;

    font-weight:
      900;
  }


  .buyer-result-purchase-title span{
    width:
      24px;

    height:
      24px;

    display:grid;

    place-items:center;

    border-radius:
      7px;

    background:
      #dff8f1;

    font-size:
      11px;
  }


  /* 3 أعمدة × صفين */
  .buyer-result-grid{
    display:grid;

    grid-template-columns:
      repeat(3,minmax(0,1fr));

    gap:
      5px;
  }


  .buyer-result-cell{
    min-width:0;

    min-height:
      51px;

    display:flex;

    align-items:center;

    gap:
      6px;

    padding:
      6px;

    border:
      1px solid #e8ecef;

    border-radius:
      9px;

    background:
      #fff;
  }


  .buyer-result-cell-icon{
    width:
      25px;

    height:
      25px;

    display:grid;

    place-items:center;

    flex:
      0 0 25px;

    border-radius:
      7px;

    background:
      #f1edf8;

    color:
      #58677f;

    font-size:
      11px;

    font-weight:
      900;
  }


  .buyer-result-cell-icon.green{
    background:
      #e0f8f2;

    color:
      #07977e;
  }


  .buyer-result-cell small{
    display:block;

    color:
      #778294;

    font-size:
      6.3px;

    line-height:
      1.15;
  }


  .buyer-result-cell strong{
    display:block;

    margin-top:
      2px;

    color:
      #15213a;

    font-size:
      9.5px;

    line-height:
      1.15;

    font-weight:
      900;

    word-break:
      break-word;
  }


  .buyer-result-cell
  .green-value{
    color:
      #058a71;
  }


  /* =========================
     ملخص الصفقة
     ========================= */

  .buyer-result-summary-row{
    display:grid;

    grid-template-columns:
      repeat(3,minmax(0,1fr));

    gap:
      5px;

    margin-top:
      6px;
  }


  .buyer-result-summary-box{
    min-height:
      52px;

    display:flex;

    align-items:center;

    gap:
      6px;

    padding:
      6px;

    border:
      1px solid #e9e7ef;

    border-radius:
      9px;

    background:
      #fff;
  }


  .buyer-result-summary-icon{
    width:
      26px;

    height:
      26px;

    display:grid;

    place-items:center;

    flex:
      0 0 26px;

    border-radius:
      7px;

    background:
      #eee3fb;

    color:
      #7732d8;

    font-size:
      11px;

    font-weight:
      900;
  }


  .buyer-result-summary-box small{
    display:block;

    color:
      #7b7189;

    font-size:
      6.3px;

    line-height:
      1.15;
  }


  .buyer-result-summary-box strong{
    display:block;

    margin-top:
      2px;

    color:
      #1b2337;

    font-size:
      9.5px;

    line-height:
      1.15;

    font-weight:
      900;
  }


  .buyer-result-summary-box
  .purple-value{
    color:
      #6e2ed0;
  }


  /* =========================
     المبلغ النهائي
     ========================= */

  .buyer-result-final{
    min-height:
      54px;

    display:grid;

    grid-template-columns:
      29px
      minmax(0,1fr)
      auto;

    align-items:center;

    gap:
      7px;

    margin-top:
      6px;

    padding:
      8px 10px;

    border:
      1px solid #8ce3cf;

    border-radius:
      10px;

    background:
      linear-gradient(
        135deg,
        #e9fff8,
        #dff9f1
      );
  }


  .buyer-result-final-icon{
    width:
      27px;

    height:
      27px;

    display:grid;

    place-items:center;

    border-radius:
      8px;

    background:
      #c9f3e7;

    color:
      #087f6b;

    font-size:
      12px;

    font-weight:
      900;
  }


  .buyer-result-final span{
    color:
      #096e5f;

    font-size:
      10px;

    font-weight:
      900;
  }


  .buyer-result-final strong{
    direction:ltr;

    color:
      #075e50;

    font-size:
      17px;

    font-weight:
      900;

    white-space:
      nowrap;
  }

}
