/* ==========================================================================
   1000 عشبة — هيدر كل الصفحات بنفس شكل بانر لوحة التحكم
   لوجو (يمين) • العنوان « » في النص + تاريخ النهارده + «مباشر» • الأزرار (شمال)
   ========================================================================== */
.page-head.ph2{
  display:grid!important; grid-template-columns:minmax(120px,1fr) auto minmax(120px,1fr); align-items:center; gap:20px!important;
  min-height:92px; margin:6px 0 18px!important; padding:12px 22px!important; border:0!important; border-radius:20px!important;
  position:relative; overflow:hidden; isolation:isolate; color:#fff;
  background:
    radial-gradient(380px 160px at 50% -30%,rgba(217,189,140,.22),transparent 70%),
    linear-gradient(120deg,#093623 0%,#072a1b 55%,#041b11 100%)!important;
  box-shadow:0 16px 34px -24px rgba(7,42,27,.8)!important;
}
.page-head.ph2::before{content:''!important; position:absolute; inset:0!important; width:auto!important; height:auto!important; border-radius:0!important; z-index:-1;
  background:repeating-linear-gradient(90deg,transparent 0 40px,rgba(217,189,140,.035) 40px 41px)!important; opacity:.5}
.page-head.ph2::after{content:''!important; display:block!important; position:absolute; inset:6px; border:1px solid rgba(217,189,140,.13); border-radius:15px; pointer-events:none}

.ph2 .ph2-logo{height:52px; width:auto; max-width:160px; object-fit:contain; justify-self:start; display:block; filter:drop-shadow(0 6px 14px rgba(0,0,0,.35))}
.page-head.ph2 .ph-ico{display:none!important}
.ph2 .ph-main{text-align:center; min-width:0}
.ph2 .ph-crumb{display:none!important}
.page-head.ph2 h1{margin:0!important; font:600 23px/1.3 'Readex Pro',var(--font)!important; color:#fff!important; display:inline-flex; align-items:center; gap:12px; max-width:100%}
.page-head.ph2 h1 > span{min-width:0; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; display:inline-flex; align-items:center; gap:8px}
.page-head.ph2 h1 > i{font-style:normal; color:#b8925a; font-size:17px; flex:none}
.page-head.ph2 h1::before,.page-head.ph2 h1::after{content:''; flex:none; width:clamp(16px,6vw,100px); height:1px; background:linear-gradient(90deg,transparent,rgba(217,189,140,.55))}
.page-head.ph2 h1::after{transform:scaleX(-1)}
.ph2 .ph2-meta{display:flex; align-items:center; justify-content:center; gap:10px; flex-wrap:wrap; margin-top:3px}
.ph2 .ph2-day{font-size:12px; color:rgba(247,241,232,.6)}

/* مؤشر «مباشر» (نفس اللي في لوحة التحكم) */
.ph2 .db-live{display:inline-flex; align-items:center; gap:6px; height:20px; padding:0 8px; border-radius:999px; font-size:10.5px; font-weight:700;
  color:#bfe8d3; background:rgba(41,164,111,.16); border:1px solid rgba(41,164,111,.35)}
.ph2 .db-live i{width:6px; height:6px; border-radius:50%; background:#3ecf8e; animation:dbPulse 1.8s infinite}
.ph2 .db-live.off{color:#e8d6bf; background:rgba(217,189,140,.12); border-color:rgba(217,189,140,.3)}
.ph2 .db-live.off i{background:#d9bd8c; animation:none}
@keyframes dbPulse{0%{box-shadow:0 0 0 0 rgba(62,207,142,.6)}70%{box-shadow:0 0 0 6px rgba(62,207,142,0)}100%{box-shadow:0 0 0 0 rgba(62,207,142,0)}}

/* الأزرار: نفس أزرار البانر */
.page-head.ph2 .actions{justify-self:end; margin:0!important; display:flex; flex-wrap:wrap; justify-content:flex-end; gap:8px}
.page-head.ph2 .actions .btn{height:38px!important; padding:0 13px!important; border-radius:11px!important; font-size:13px; font-weight:600; gap:7px}
.page-head.ph2 .actions .btn svg.i{width:17px; height:17px}
.page-head.ph2 .actions .btn.primary,.page-head.ph2 .actions .btn.success{background:linear-gradient(180deg,#d2b07a,#a8814a)!important; color:#072a1b!important; border:0!important;
  box-shadow:0 8px 18px -10px rgba(184,146,90,.9)!important}
.page-head.ph2 .actions .btn.primary svg.i,.page-head.ph2 .actions .btn.success svg.i{color:#072a1b}
.page-head.ph2 .actions .btn.primary:hover,.page-head.ph2 .actions .btn.success:hover{filter:brightness(1.07)}
.page-head.ph2 .actions .btn:not(.primary):not(.success):not(.danger){background:rgba(255,255,255,.06)!important; border:1px solid rgba(217,189,140,.28)!important; color:#f7f1e8!important}
.page-head.ph2 .actions .btn:not(.primary):not(.success):not(.danger):hover{background:rgba(255,255,255,.12)!important; border-color:rgba(217,189,140,.5)!important}
.page-head.ph2 .actions .inp{height:38px; border-radius:11px; background:rgba(255,255,255,.07); border:1px solid rgba(217,189,140,.28); color:#fff}
.ph2 .ph2-sp{min-width:1px}

/* لابتوب صغير: الأزرار كتير → تنزل سطر لوحدها */
@media (max-width:1180px) and (min-width:861px){
  .page-head.ph2{grid-template-columns:auto 1fr; row-gap:10px!important}
  .page-head.ph2 .ph-main{text-align:start}
  .page-head.ph2 .ph2-meta{justify-content:flex-start}
  .page-head.ph2 h1::before,.page-head.ph2 h1::after{display:none}
  .page-head.ph2 .actions{grid-column:1 / -1; justify-self:stretch; justify-content:flex-start}
  .page-head.ph2 .ph2-sp{display:none}
}

/* موبايل: سطر واحد مضغوط زي لوحة التحكم، والأزرار تحت */
@media (max-width:860px){
  .page-head.ph2{grid-template-columns:auto 1fr; gap:12px!important; row-gap:12px!important; min-height:0; margin:4px 0 14px!important; padding:12px!important; border-radius:18px!important}
  .page-head.ph2::after{inset:5px; border-radius:13px}
  .ph2 .ph2-logo{display:none}
  .page-head.ph2 .ph-ico{display:grid!important; place-items:center; width:44px!important; height:44px!important; border-radius:13px!important;
    background:rgba(217,189,140,.14)!important; color:#d9bd8c!important; border:1px solid rgba(217,189,140,.22); box-shadow:none!important}
  .page-head.ph2 .ph-ico svg.i{width:21px; height:21px}
  .ph2 .ph-main{text-align:start}
  .page-head.ph2 h1{font-size:18px!important; gap:6px}
  .page-head.ph2 h1 > i,.page-head.ph2 h1::before,.page-head.ph2 h1::after{display:none}
  .ph2 .ph2-meta{justify-content:flex-start; gap:6px; margin-top:2px; flex-wrap:nowrap}
  .ph2 .ph2-day{font-size:11.5px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; min-width:0}
  .ph2 .db-live{height:18px; font-size:10px; padding:0 6px; flex:none}
  .page-head.ph2 .actions{grid-column:1 / -1; justify-self:stretch; position:relative; z-index:1}
  .page-head.ph2 .actions .btn{height:42px!important; justify-content:center}
  .ph2 .ph2-sp{display:none}
}
@media print{ .page-head.ph2{background:none!important; color:#000; box-shadow:none!important; min-height:0} .page-head.ph2 h1{color:#000!important} .ph2 .ph2-meta,.page-head.ph2::after,.page-head.ph2::before{display:none!important} }
@media (prefers-reduced-motion:reduce){ .ph2 .db-live i{animation:none} }


/* ==========================================================================
   بانر موحّد: لوحة التحكم + هيدر كل الصفحات — نفس الشكل بالظبط + رسمة أوراق أعشاب خفيفة ورا
   ========================================================================== */
.db-banner,.page-head.ph2{
  min-height:96px; padding:14px 24px!important; border-radius:20px!important;
  background:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1200 140' preserveAspectRatio='xMidYMid slice'%3E%3Cg stroke='%23d9bd8c' stroke-width='2' stroke-linecap='round' stroke-linejoin='round' opacity='.24'%3E%3Cg transform='translate(300 128) rotate(-18) scale(1)'%3E%3Cpath d='M0 0 C 2 -30 -2 -60 0 -82' fill='none'/%3E%3Cpath d='M0 -18 q 10 -6 16 -16 q -10 0 -16 16z' fill='none'/%3E%3Cpath d='M0 -30 q -10 -6 -16 -16 q 10 0 16 16z' fill='none'/%3E%3Cpath d='M0 -42 q 10 -6 16 -16 q -10 0 -16 16z' fill='none'/%3E%3Cpath d='M0 -54 q -10 -6 -16 -16 q 10 0 16 16z' fill='none'/%3E%3Cpath d='M0 -66 q 10 -6 16 -16 q -10 0 -16 16z' fill='none'/%3E%3Cpath d='M0 -82 q 6 -8 0 -16 q -6 8 0 16z' fill='none'/%3E%3C/g%3E%3Cg transform='translate(352 132) rotate(14) scale(0.85)'%3E%3Cpath d='M0 0 C 2 -30 -2 -60 0 -82' fill='none'/%3E%3Cpath d='M0 -18 q 10 -6 16 -16 q -10 0 -16 16z' fill='none'/%3E%3Cpath d='M0 -30 q -10 -6 -16 -16 q 10 0 16 16z' fill='none'/%3E%3Cpath d='M0 -42 q 10 -6 16 -16 q -10 0 -16 16z' fill='none'/%3E%3Cpath d='M0 -54 q -10 -6 -16 -16 q 10 0 16 16z' fill='none'/%3E%3Cpath d='M0 -66 q 10 -6 16 -16 q -10 0 -16 16z' fill='none'/%3E%3Cpath d='M0 -82 q 6 -8 0 -16 q -6 8 0 16z' fill='none'/%3E%3C/g%3E%3Cg transform='translate(860 128) rotate(18) scale(1)'%3E%3Cpath d='M0 0 C 2 -30 -2 -60 0 -82' fill='none'/%3E%3Cpath d='M0 -18 q 10 -6 16 -16 q -10 0 -16 16z' fill='none'/%3E%3Cpath d='M0 -30 q -10 -6 -16 -16 q 10 0 16 16z' fill='none'/%3E%3Cpath d='M0 -42 q 10 -6 16 -16 q -10 0 -16 16z' fill='none'/%3E%3Cpath d='M0 -54 q -10 -6 -16 -16 q 10 0 16 16z' fill='none'/%3E%3Cpath d='M0 -66 q 10 -6 16 -16 q -10 0 -16 16z' fill='none'/%3E%3Cpath d='M0 -82 q 6 -8 0 -16 q -6 8 0 16z' fill='none'/%3E%3C/g%3E%3Cg transform='translate(912 132) rotate(-12) scale(0.85)'%3E%3Cpath d='M0 0 C 2 -30 -2 -60 0 -82' fill='none'/%3E%3Cpath d='M0 -18 q 10 -6 16 -16 q -10 0 -16 16z' fill='none'/%3E%3Cpath d='M0 -30 q -10 -6 -16 -16 q 10 0 16 16z' fill='none'/%3E%3Cpath d='M0 -42 q 10 -6 16 -16 q -10 0 -16 16z' fill='none'/%3E%3Cpath d='M0 -54 q -10 -6 -16 -16 q 10 0 16 16z' fill='none'/%3E%3Cpath d='M0 -66 q 10 -6 16 -16 q -10 0 -16 16z' fill='none'/%3E%3Cpath d='M0 -82 q 6 -8 0 -16 q -6 8 0 16z' fill='none'/%3E%3C/g%3E%3Cg transform='translate(120 120) rotate(-8) scale(0.7)'%3E%3Cpath d='M0 0 C 2 -30 -2 -60 0 -82' fill='none'/%3E%3Cpath d='M0 -18 q 10 -6 16 -16 q -10 0 -16 16z' fill='none'/%3E%3Cpath d='M0 -30 q -10 -6 -16 -16 q 10 0 16 16z' fill='none'/%3E%3Cpath d='M0 -42 q 10 -6 16 -16 q -10 0 -16 16z' fill='none'/%3E%3Cpath d='M0 -54 q -10 -6 -16 -16 q 10 0 16 16z' fill='none'/%3E%3Cpath d='M0 -66 q 10 -6 16 -16 q -10 0 -16 16z' fill='none'/%3E%3Cpath d='M0 -82 q 6 -8 0 -16 q -6 8 0 16z' fill='none'/%3E%3C/g%3E%3Cg transform='translate(1080 120) rotate(8) scale(0.7)'%3E%3Cpath d='M0 0 C 2 -30 -2 -60 0 -82' fill='none'/%3E%3Cpath d='M0 -18 q 10 -6 16 -16 q -10 0 -16 16z' fill='none'/%3E%3Cpath d='M0 -30 q -10 -6 -16 -16 q 10 0 16 16z' fill='none'/%3E%3Cpath d='M0 -42 q 10 -6 16 -16 q -10 0 -16 16z' fill='none'/%3E%3Cpath d='M0 -54 q -10 -6 -16 -16 q 10 0 16 16z' fill='none'/%3E%3Cpath d='M0 -66 q 10 -6 16 -16 q -10 0 -16 16z' fill='none'/%3E%3Cpath d='M0 -82 q 6 -8 0 -16 q -6 8 0 16z' fill='none'/%3E%3C/g%3E%3Cg transform='translate(560 30) rotate(160) scale(0.45)'%3E%3Cpath d='M0 0 C 2 -30 -2 -60 0 -82' fill='none'/%3E%3Cpath d='M0 -18 q 10 -6 16 -16 q -10 0 -16 16z' fill='none'/%3E%3Cpath d='M0 -30 q -10 -6 -16 -16 q 10 0 16 16z' fill='none'/%3E%3Cpath d='M0 -42 q 10 -6 16 -16 q -10 0 -16 16z' fill='none'/%3E%3Cpath d='M0 -54 q -10 -6 -16 -16 q 10 0 16 16z' fill='none'/%3E%3Cpath d='M0 -66 q 10 -6 16 -16 q -10 0 -16 16z' fill='none'/%3E%3Cpath d='M0 -82 q 6 -8 0 -16 q -6 8 0 16z' fill='none'/%3E%3C/g%3E%3Cg transform='translate(640 30) rotate(-160) scale(0.45)'%3E%3Cpath d='M0 0 C 2 -30 -2 -60 0 -82' fill='none'/%3E%3Cpath d='M0 -18 q 10 -6 16 -16 q -10 0 -16 16z' fill='none'/%3E%3Cpath d='M0 -30 q -10 -6 -16 -16 q 10 0 16 16z' fill='none'/%3E%3Cpath d='M0 -42 q 10 -6 16 -16 q -10 0 -16 16z' fill='none'/%3E%3Cpath d='M0 -54 q -10 -6 -16 -16 q 10 0 16 16z' fill='none'/%3E%3Cpath d='M0 -66 q 10 -6 16 -16 q -10 0 -16 16z' fill='none'/%3E%3Cpath d='M0 -82 q 6 -8 0 -16 q -6 8 0 16z' fill='none'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E") center / cover no-repeat,
    radial-gradient(380px 160px at 50% -30%,rgba(217,189,140,.22),transparent 70%),
    radial-gradient(260px 160px at 100% 120%,rgba(184,146,90,.14),transparent 70%),
    linear-gradient(120deg,#093623 0%,#072a1b 55%,#041b11 100%)!important;
  box-shadow:0 16px 34px -24px rgba(7,42,27,.8)!important;
}
.db-banner::before,.page-head.ph2::before{display:none!important}
.db-banner::after,.page-head.ph2::after{content:''!important; display:block!important; position:absolute; inset:6px; border:1px solid rgba(217,189,140,.14); border-radius:15px; pointer-events:none; z-index:0}
.db-banner > *,.page-head.ph2 > *{position:relative; z-index:1}
/* نفس المقاسات في الاتنين */
.page-head.ph2{grid-template-columns:minmax(140px,1fr) auto minmax(140px,1fr)!important; margin:6px 0 18px!important}
.db-b-logo,.ph2 .ph2-logo{height:54px}
.db-b-mid h1,.page-head.ph2 h1{font-size:23px!important}
.db-b-mid p,.ph2 .ph2-meta{margin-top:4px!important}
.db-b-mid p .num,.ph2 .ph2-day{font-size:12.5px; color:rgba(247,241,232,.64); font-variant-numeric:tabular-nums}
.page-head.ph2 .actions{justify-self:end}
.db-b-act{justify-self:end}
@media (max-width:1180px) and (min-width:861px){ .page-head.ph2{grid-template-columns:auto 1fr!important} }
@media (max-width:860px){
  .db-banner,.page-head.ph2{min-height:0; padding:12px!important; border-radius:18px!important;
    background-size:auto 150%, auto, auto, auto!important; background-position:left -40px center, 0 0, 0 0, 0 0!important}
  .db-banner::after,.page-head.ph2::after{inset:5px; border-radius:13px}
  .page-head.ph2{grid-template-columns:auto 1fr!important}
  .db-b-mid h1,.page-head.ph2 h1{font-size:18px!important}
}

/* الإطار الدهبي الداخلي لازم يغطي البانر كله (قاعدة قديمة في ui.css كانت مدياه مقاس ثابت 180px فبيطلع مربع حوالين اللوجو) */
.page-head.ph2::after{width:auto!important; height:auto!important; left:6px!important; right:6px!important; top:6px!important; bottom:6px!important; inset:6px!important; border-radius:15px!important; border-width:1px!important}
@media (max-width:860px){ .page-head.ph2::after{inset:5px!important; left:5px!important; right:5px!important; top:5px!important; bottom:5px!important; border-radius:13px!important} }

/* ==========================================================================
   موبايل — هيدر مضغوط وبروفيشنال: سطر للعنوان، وسطر واحد للأزرار (لحد 3 جنب بعض)
   ========================================================================== */
@media (max-width:860px){
  .page-head.ph2{gap:10px!important; row-gap:10px!important; padding:11px 12px 12px!important; margin:2px 0 12px!important;
    background-size:820px auto, auto, auto, auto!important; background-position:center 40%, 0 0, 0 0, 0 0!important}
  .page-head.ph2 .ph-ico{width:40px!important; height:40px!important; border-radius:12px!important}
  .page-head.ph2 .ph-ico svg.i{width:19px; height:19px}
  .page-head.ph2 h1{font-size:16.5px!important; line-height:1.35!important}
  .ph2 .ph2-meta{margin-top:1px!important}
  .ph2 .ph2-day{font-size:11px!important}

  /* الأزرار: Flex بدل الشبكة القديمة — 1 = عرض كامل، 2 = نص ونص، 3 أو أكتر = تلات في السطر */
  .page-head.ph2 .actions{display:flex!important; flex-wrap:wrap; gap:6px!important; grid-template-columns:none!important; margin:0!important;
    padding-top:10px; border-top:1px solid rgba(217,189,140,.14)}
  .page-head.ph2 .actions > *{grid-column:auto!important; flex:1 1 calc(33.333% - 6px); min-width:0; width:auto!important; order:0}
  .page-head.ph2 .actions > .btn.primary,.page-head.ph2 .actions > .btn.success{order:-1}
  .page-head.ph2 .actions .btn{height:38px!important; padding:0 8px!important; border-radius:11px!important; font-size:12.5px!important; gap:5px!important;
    justify-content:center; white-space:nowrap; overflow:hidden; text-overflow:ellipsis}
  .page-head.ph2 .actions .btn.primary,.page-head.ph2 .actions .btn.success{height:38px!important; font-size:13px!important}
  .page-head.ph2 .actions .btn svg.i{width:15px!important; height:15px!important; flex:none}
  .page-head.ph2 .actions select.inp,.page-head.ph2 .actions .date-chip{flex:1 1 100%; height:38px}
}

/* أزرار صف الجدول: زرار الحذف بالأحمر + العميل الموقوف باهت */
table.t .act-btn.danger,.mcard-act .act-btn.danger{background:#fff!important; color:#c0473a!important; border:1px solid rgba(192,71,58,.35)!important}
table.t .act-btn.danger:hover,.mcard-act .act-btn.danger:hover{background:#c0473a!important; color:#fff!important; border-color:#c0473a!important}
table.t tr.row-off td{opacity:.55}
table.t tr.row-off td:first-child b::after{content:' • موقوف'; font-size:11px; font-weight:600; color:#c0473a}

/* ==========================================================================
   أزرار الإجراءات في الجداول والكروت — كل نوع بلونه وأيقونته واضحة
   ========================================================================== */
/* الشكل الأصلي (غامق) — مع لمسة أنضف: أيقونة دهبي بتنوّر، والحذف أحمر */
table.t [data-act].act-btn,.mcard-act [data-act].act-btn{
  width:34px; height:34px; padding:0!important; display:inline-flex; align-items:center; justify-content:center; gap:4px;
  border-radius:10px!important; border:0!important; color:#fff!important;
  background:linear-gradient(180deg,#145236,#0c2219)!important;
  box-shadow:0 1px 0 rgba(255,255,255,.08) inset,0 5px 12px -7px rgba(0,0,0,.75)!important;
  transition:background .15s,transform .12s,box-shadow .15s;
}
table.t [data-act].act-btn svg.i,.mcard-act [data-act].act-btn svg.i{width:16px!important; height:16px!important; color:#fff!important; stroke-width:1.9}
table.t [data-act].act-btn:hover,.mcard-act [data-act].act-btn:hover{background:linear-gradient(180deg,#c9a15e,#9c7540)!important; transform:translateY(-1px); box-shadow:0 8px 16px -8px rgba(36,145,98,.8)!important}
table.t [data-act="del"].act-btn,.mcard-act [data-act="del"].act-btn,table.t .act-btn.danger,.mcard-act .act-btn.danger{
  background:linear-gradient(180deg,#d9524a,#a9292f)!important; box-shadow:0 1px 0 rgba(255,255,255,.14) inset,0 5px 12px -7px rgba(169,41,47,.8)!important}
table.t [data-act="del"].act-btn:hover,.mcard-act [data-act="del"].act-btn:hover,table.t .act-btn.danger:hover,.mcard-act .act-btn.danger:hover{
  background:linear-gradient(180deg,#e5635a,#b8323a)!important; box-shadow:0 8px 16px -8px rgba(169,41,47,.9)!important}
.act-btn .ab-l{display:none}
table.t .row-actions{display:flex; gap:6px; justify-content:flex-end}

/* ---------- كروت الموبايل ---------- */
@media (max-width:860px){
  .mcards{gap:10px!important}
  .mcard{padding:14px 14px 12px!important; border-radius:18px!important; border-color:#ece3d6!important; box-shadow:0 1px 2px rgba(7,42,27,.04),0 10px 24px -22px rgba(7,42,27,.45)!important}
  .mcard-top{gap:12px; margin-bottom:10px; align-items:center}
  .mcard-top .t1 .cell-name b{font-size:15px}
  .mcard-sub{margin-top:6px}
  .mcard-top .t2{display:flex; flex-direction:column; align-items:flex-end; gap:2px; padding:7px 11px; border-radius:12px; background:#faf6f0; border:1px solid #f0e7da; font-size:15.5px!important}
  .mcard-top .t2 small{font-size:10.5px; font-weight:600; color:var(--text-3)}
  .mcard-grid{grid-template-columns:repeat(3,minmax(0,1fr))!important; gap:8px!important; padding-top:10px!important; border-top:1px dashed #ece3d6!important}
  .mcard-grid > div{background:#fbf8f3; border-radius:10px; padding:7px 9px}
  .mcard-grid label{font-size:10.5px!important; margin-bottom:2px}
  .mcard-grid span.v{font-size:12.5px; font-weight:600}
  /* شريط الأزرار: كل زرار بأيقونة واسمه، متساويين في العرض */
  .mcard-act{display:flex!important; flex-wrap:nowrap!important; gap:6px!important; margin-top:12px!important; padding-top:12px!important; border-top:1px solid #f1eae0!important; justify-content:stretch}
  .mcard-act [data-act].act-btn{flex:1 1 0; min-width:0; width:auto!important; height:48px!important; flex-direction:column; gap:3px!important; border-radius:12px!important}
  .mcard-act [data-act].act-btn svg.i{width:17px!important; height:17px!important}
  .mcard-act .act-btn .ab-l{display:block; font-size:10.5px; font-weight:700; line-height:1; white-space:nowrap}
}


/* ==========================================================================
   نافذة التأكيد (حذف / خروج / أي تأكيد)
   ========================================================================== */
.cfm-ov{position:fixed; inset:0; z-index:100050; display:grid; place-items:center; padding:20px; background:rgba(4,24,15,0); backdrop-filter:blur(0); -webkit-backdrop-filter:blur(0); transition:background .18s,backdrop-filter .18s}
.cfm-ov.show{background:rgba(4,24,15,.5); backdrop-filter:blur(3px); -webkit-backdrop-filter:blur(3px)}
.cfm{--c:#c0473a; --ct:#fdecea; --cg:rgba(192,71,58,.35);
  position:relative; width:100%; max-width:420px; padding:28px 24px 20px; border-radius:24px; background:#fff; text-align:center; color:#072a1b;
  box-shadow:0 40px 90px -30px rgba(0,0,0,.55),0 0 0 1px rgba(7,42,27,.05); opacity:0; transform:translateY(10px) scale(.97); transition:opacity .18s,transform .2s cubic-bezier(.2,.8,.2,1)}
.cfm.is-ok{--c:#17734b; --ct:#f6eedf; --cg:rgba(184,146,90,.4)}
.cfm-ov.show .cfm{opacity:1; transform:none}
.cfm-ov.hide .cfm{opacity:0; transform:translateY(6px) scale(.98)}
.cfm::before{content:''; position:absolute; inset:0 0 auto 0; height:110px; border-radius:24px 24px 0 0; background:radial-gradient(240px 110px at 50% 0%,var(--ct),transparent 75%); pointer-events:none}
.cfm-grab{display:none}
.cfm-ic{position:relative; width:76px; height:76px; margin:0 auto 16px; border-radius:50%; display:grid; place-items:center; background:var(--ct)}
.cfm-ic::after{content:''; position:absolute; inset:-7px; border-radius:50%; border:1.5px dashed var(--cg)}
.cfm-ic span{width:52px; height:52px; border-radius:50%; display:grid; place-items:center; color:#fff; background:var(--c); box-shadow:0 12px 24px -12px var(--c)}
.cfm-ic svg.i{width:24px; height:24px; stroke-width:2}
.cfm h3{position:relative; margin:0 0 8px; font:600 19px/1.4 'Readex Pro',var(--font); color:#072a1b}
.cfm p{position:relative; margin:0 auto; max-width:330px; font-size:14px; line-height:1.85; color:#357a5c}
.cfm p b{color:#072a1b}
.cfm-warn{display:flex; align-items:center; gap:8px; margin:16px 0 0; padding:9px 12px; border-radius:12px; background:#faf6f0; border:1px solid #f0e7da; font-size:12px; color:#8a7764; text-align:start}
.cfm-warn svg.i{width:15px; height:15px; flex:none; color:#b8925a}
.cfm-act{display:grid; grid-template-columns:1fr 1fr; gap:10px; margin-top:22px}
.cfm-b{height:48px; border-radius:14px; display:inline-flex; align-items:center; justify-content:center; gap:8px; cursor:pointer; font:600 14.5px var(--font); transition:filter .15s,background .15s,transform .12s}
.cfm-b svg.i{width:17px; height:17px}
.cfm-b.ok{border:0; color:#fff; background:var(--c); background:linear-gradient(180deg,color-mix(in srgb,var(--c) 85%,#fff),var(--c)); box-shadow:0 12px 22px -14px var(--c)}
.cfm.is-ok .cfm-b.ok{background:linear-gradient(180deg,#115437,#083220)}
.cfm-b.ok:hover{filter:brightness(1.08)}
.cfm-b.no{border:1px solid #e6dccd; background:#fff; color:#20563f}
.cfm-b.no:hover{background:#f7f1e8}
.cfm-b:active{transform:translateY(1px)}
.cfm-b:focus-visible{outline:0; box-shadow:0 0 0 4px rgba(184,146,90,.35)}
@media (max-width:560px){
  .cfm-ov{place-items:end center; padding:0}
  .cfm{max-width:none; border-radius:26px 26px 0 0; padding:12px 18px calc(18px + env(safe-area-inset-bottom)); transform:translateY(100%)}
  .cfm::before{border-radius:26px 26px 0 0}
  .cfm-ov.show .cfm{transform:none} .cfm-ov.hide .cfm{transform:translateY(100%)}
  .cfm-grab{display:block; width:44px; height:5px; border-radius:5px; background:#e6dccd; margin:0 auto 16px; position:relative}
  .cfm-ic{width:68px; height:68px; margin-bottom:12px} .cfm-ic span{width:46px; height:46px}
  .cfm-act{grid-template-columns:1fr; gap:8px} .cfm-b{height:50px}
}
@media (prefers-reduced-motion:reduce){ .cfm,.cfm-ov{transition:none} }

/* سلة المحذوفات */
.tr-note{display:flex; align-items:flex-start; gap:10px; margin:0 0 14px; padding:12px 14px; border-radius:14px; background:#fbf6ee; border:1px solid #efe2cd; font-size:13px; line-height:1.8; color:#357a5c}
.tr-note svg.i{width:18px; height:18px; flex:none; margin-top:2px; color:#b8925a}
.tr-note b{color:#0b462c}
.tr-note.sm{margin:14px 0 0; font-size:12.5px}
.tr-av{background:linear-gradient(145deg,#f3e9da,#e6d5bc)!important; color:#156743!important}
.tr-av svg.i{width:18px; height:18px}
.tr-fields{display:grid; grid-template-columns:repeat(auto-fill,minmax(160px,1fr)); gap:10px}
.tr-fields div{padding:10px 12px; border-radius:12px; background:#faf6f0; border:1px solid #f0e7da; min-width:0}
.tr-fields label{display:block; font-size:11px; color:var(--text-3); margin-bottom:3px}
.tr-fields b{display:block; font-size:13.5px; color:#072a1b; word-break:break-word}
.tr-kids{display:flex; flex-wrap:wrap; gap:8px; margin-top:12px}
.tr-kids span{display:inline-flex; align-items:center; gap:6px; padding:6px 10px; border-radius:999px; background:#f3ece2; font-size:12px; color:#156743}
.tr-kids svg.i{width:14px; height:14px}
table.t [data-act="restore"].act-btn,.mcard-act [data-act="restore"].act-btn{background:linear-gradient(180deg,#29a46f,#1f7a53)!important; width:34px!important; padding:0!important}
table.t [data-act="restore"].act-btn:hover,.mcard-act [data-act="restore"].act-btn:hover{background:linear-gradient(180deg,#38b57a,#238a5d)!important}


/* التلميح العائم */
[data-tip]::after{display:none!important; content:none!important}
.ftip{position:fixed; z-index:100100; pointer-events:none; max-width:240px; padding:7px 11px; border-radius:10px; background:#082317; color:#fff;
  font:600 12px/1.4 var(--font); white-space:nowrap; box-shadow:0 10px 24px -10px rgba(0,0,0,.6),0 0 0 1px rgba(217,189,140,.18);
  opacity:0; transform:translateY(3px); transition:opacity .12s,transform .12s}
.ftip.below{transform:translateY(-3px)}
.ftip.on{opacity:1; transform:none}
.ftip::after{content:''; position:absolute; left:var(--ax,50%); top:100%; width:10px; height:10px; margin-left:-5px; margin-top:-5px; background:#082317; transform:rotate(45deg); border-radius:2px}
.ftip.below::after{top:auto; bottom:100%; margin-top:0; margin-bottom:-5px}
/* صف بيتحذف: يبهت فوراً بعد التأكيد، ويختفي أول ما السيرفر يرد */
tr.is-busy,.mcard.is-busy{opacity:.45; pointer-events:none; transition:opacity .15s}
tr.is-busy td:first-child b::after,.mcard.is-busy .t1 b::after{content:' • جاري الحذف…'; font-size:11px; font-weight:600; color:#c0473a}
tr.is-gone,.mcard.is-gone{opacity:0!important; transition:opacity .2s}

/* ==========================================================================
   الخرايط: الخريطة تفضل جوه الكارت بتاعها (مكتبة الخرايط بتستخدم طبقات z-index عالية
   كانت بتطلع فوق الشريط اللي تحت والقوائم) + مقاس مظبوط على الموبايل
   ========================================================================== */
.map-card{position:relative; isolation:isolate; z-index:0; border-radius:18px!important; overflow:hidden!important}
.leaflet-container{position:relative; z-index:0; isolation:isolate}
.map-card .leaflet-control-container{position:relative; z-index:2}
@media (max-width:860px){
  .map-card{margin-bottom:calc(var(--bottom-h) + 18px + env(safe-area-inset-bottom))}
  .map-card.big #bmap,.map-card #fmap{height:max(320px, calc(100dvh - var(--top-h) - var(--bottom-h) - 250px - env(safe-area-inset-bottom)))!important; min-height:0!important}
  .map-card .leaflet-bottom{margin-bottom:4px}
}


/* ==========================================================================
   فورم المنتج — كروت مرتبة + ملخص مباشر على الجنب
   ========================================================================== */
.modal.pm.pf-modal{max-width:1180px}
.pf{display:grid; grid-template-columns:minmax(0,1fr) 300px; gap:18px; align-items:start}
.pf-main{display:flex; flex-direction:column; gap:14px; min-width:0}
.pf-steps{position:sticky; top:-1px; z-index:3; display:flex; gap:6px; padding:8px; margin:-4px 0 0; border-radius:16px; background:rgba(247,245,242,.92); backdrop-filter:blur(8px); border:1px solid #ece4d8; overflow-x:auto; scrollbar-width:none}
.pf-steps::-webkit-scrollbar{display:none}
.pf-steps button{flex:1 0 auto; display:inline-flex; align-items:center; justify-content:center; gap:6px; height:36px; padding:0 12px; border-radius:11px; border:0; background:transparent; color:#357a5c; font:600 12.5px var(--font); cursor:pointer; white-space:nowrap}
.pf-steps button svg.i{width:16px; height:16px}
.pf-steps button.on{background:#0b462c; color:#fff; box-shadow:0 6px 14px -8px rgba(7,42,27,.8)}
.pf-steps button.on svg.i{color:#d9bd8c}
.pf-card{scroll-margin-top:70px; padding:16px 18px 6px; border-radius:18px; background:#fff; border:1px solid #ece4d8; box-shadow:0 1px 2px rgba(7,42,27,.04)}
.pf-card > header{display:flex; align-items:center; gap:12px; padding-bottom:12px; margin-bottom:12px; border-bottom:1px dashed #ece4d8}
.pf-ci{width:38px; height:38px; flex:none; border-radius:11px; display:grid; place-items:center; background:linear-gradient(145deg,#f7efe3,#ecdcc4); color:#17734b}
.pf-ci svg.i{width:19px; height:19px}
.pf-card h4{margin:0; font:600 15px 'Readex Pro',var(--font); color:#072a1b}
.pf-card header small{display:block; font-size:12px; color:#9a8a78}
.pf-card .form-grid{margin:0}
.pf-card .inp{height:46px; border-radius:12px; border-color:#e6dccd; background:#fdfbf8}
.pf-card .inp:focus{background:#fff; border-color:#b8925a!important; box-shadow:0 0 0 4px rgba(184,146,90,.14)!important}
.pf-card label{font-weight:600; color:#2a6e51}
.pf-margins{display:grid; grid-template-columns:repeat(3,1fr); gap:8px; margin:2px 0 12px}
.pf-mg{padding:10px 12px; border-radius:12px; background:#faf6f0; border:1px solid #efe5d6; display:flex; flex-direction:column; gap:1px}
.pf-mg span{font-size:11.5px; color:#8a7764} .pf-mg b{font:600 18px 'Readex Pro',var(--font); color:#0b462c} .pf-mg small{font-size:11px; color:#9a8a78}
.pf-mg.good{background:#eef7f2; border-color:#cfe7da} .pf-mg.good b{color:#27855c}
.pf-mg.mid{background:#fdf6e7; border-color:#f0dfb4} .pf-mg.mid b{color:#a8741a}
.pf-mg.bad{background:#fdeeec; border-color:#f3d1cc} .pf-mg.bad b{color:#c0473a}
.pf-hint{grid-column:1/-1; padding:10px 12px; border-radius:12px; background:#faf6f0; border:1px dashed #e6dccd; font-size:12.5px; color:#8a7764}
#rec{padding-bottom:12px}
.pf-side{position:sticky; top:0}
.pf-prev{border-radius:20px; overflow:hidden; color:#f7f1e8; background:radial-gradient(260px 140px at 80% -20%,rgba(217,189,140,.2),transparent 70%),linear-gradient(160deg,#093623,#051f14); box-shadow:0 20px 40px -26px rgba(4,24,15,.9)}
.pp-head{display:flex; align-items:center; gap:12px; padding:16px}
.pp-ic{width:46px; height:46px; flex:none; border-radius:14px; display:grid; place-items:center; color:#072a1b; background:linear-gradient(180deg,#e2c493,#b38a50)}
.pp-head > div{flex:1; min-width:0}
.pp-head b{display:block; font:600 15px 'Readex Pro',var(--font); white-space:nowrap; overflow:hidden; text-overflow:ellipsis} .pp-head b i{font-style:normal; color:rgba(247,241,232,.4)}
.pp-head small{display:block; font-size:11.5px; color:#d9bd8c; white-space:nowrap; overflow:hidden; text-overflow:ellipsis}
.pp-st{flex:none; font-size:10.5px; font-weight:700; padding:3px 9px; border-radius:999px; background:rgba(217,82,74,.2); color:#ffb2a9}
.pp-st.on{background:rgba(41,164,111,.2); color:#9fe3c2}
.pp-chips{display:flex; flex-wrap:wrap; gap:6px; padding:0 16px 14px}
.pp-chips span{font-size:11px; padding:4px 9px; border-radius:999px; background:rgba(255,255,255,.07); border:1px solid rgba(217,189,140,.18)} .pp-chips .muted{color:rgba(247,241,232,.45)!important}
.pp-sec{padding:12px 16px; border-top:1px solid rgba(217,189,140,.12)}
.pp-sec h5{margin:0 0 8px; font-size:11.5px; font-weight:700; color:#d9bd8c}
.pp-row{display:flex; align-items:center; gap:8px; padding:5px 0; font-size:12.5px}
.pp-row span{flex:1; color:rgba(247,241,232,.7)} .pp-row b{color:#fff} .pp-row b small{color:rgba(247,241,232,.45); font-weight:500}
.pp-row em{font-style:normal; font-size:11px; font-weight:700; padding:2px 7px; border-radius:999px; background:rgba(255,255,255,.08)}
.pp-row em.good{color:#9fe3c2; background:rgba(41,164,111,.2)} .pp-row em.mid{color:#f3d58f; background:rgba(212,162,76,.2)} .pp-row em.bad{color:#ffb2a9; background:rgba(217,82,74,.2)}
.pp-row.tot{margin-top:4px; padding-top:9px; border-top:1px dashed rgba(217,189,140,.2)} .pp-row.tot span{color:#d9bd8c; font-weight:700} .pp-row.tot b{font-size:15px}
.pp-note{display:block; margin-top:6px; font-size:11px; color:rgba(247,241,232,.45)}
@media (max-width:980px){
  .pf{grid-template-columns:1fr}
  .pf-side{position:static; order:-1}
  .pp-sec{display:none}
  .pf-margins{grid-template-columns:repeat(3,minmax(0,1fr))}
}
@media (max-width:560px){
  .pf-card{padding:14px 14px 4px; border-radius:16px}
  .pf-steps button span{display:none} .pf-steps button{flex:1; padding:0}
  .pf-mg b{font-size:15px}
}

/* ===== الشاشات الكبيرة: المحتوى ياخد عرض الشاشة كله بدل ما يلزق يمين ويسيب فراغ شمال ===== */
@media screen and (min-width:861px){
  .content{max-width:none; margin-inline:0; padding-inline:clamp(16px,1.6vw,40px)}
}
/* شاشات عريضة جداً (2K / 4K / Ultra-wide): عرض أقصى مريح للعين والمحتوى في النص */
@media screen and (min-width:2400px){
  .content{max-width:2300px; margin-inline:auto}
}

/* v218 — تعويض العميل عن المرتجع (.rcm) */
.rcm-seg{display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:8px}
.rcm-seg button{display:flex; flex-direction:column; align-items:flex-start; gap:3px; padding:10px; border:1.5px solid var(--border); border-radius:14px; background:#fff; text-align:right; cursor:pointer}
.rcm-seg button svg.i{width:18px; height:18px; color:#17734b}
.rcm-seg button b{font-size:13.5px} .rcm-seg button small{font-size:11px; color:var(--text-3); line-height:1.4}
.rcm-seg button.on{border-color:#b8925a; background:#fbf6ee; box-shadow:0 0 0 3px rgba(184,146,90,.15)}
.rcm-h{margin:14px 0 8px; font-weight:700} .rcm-h small{display:block; font-weight:500; color:var(--text-3); font-size:12px}
.rcm-rows{display:flex; flex-direction:column; gap:8px; margin-bottom:8px}
.rcm-r{display:grid; grid-template-columns:minmax(0,2fr) minmax(0,1fr) minmax(0,1fr) 36px; gap:6px; align-items:center}
.rcm-sum{margin-top:10px; font-size:13px; color:var(--text-2)}
.rcm-view{margin:12px 0 0; padding:10px 12px; border:1px dashed var(--border); border-radius:12px; background:#fbf8f3}
.rcm-vl{display:flex; flex-wrap:wrap; gap:6px 14px; margin-top:6px; font-size:13px}
@media (max-width:520px){ .rcm-seg{grid-template-columns:1fr} .rcm-r{grid-template-columns:minmax(0,1fr) 70px 70px 34px} }

/* ==========================================================================
   v219 — ActionBar (.ab): صف واحد أزرار متساوية — ذهبي للأساسي، كريمي للثانوي، ومن غير أخضر.
   الموبايل: الأيقونة فوق الاسم • الشاشات الأوسع: جنب بعض • الكمبيوتر جوه الجدول: أيقونات صغيرة بتلميح
   ========================================================================== */
.ab{display:grid; grid-template-columns:repeat(var(--n,4),minmax(0,1fr)); gap:8px; width:100%}
.ab-b{display:flex; align-items:center; justify-content:center; gap:7px; min-width:0; height:44px; padding:0 10px; border-radius:12px; border:1px solid #ead9c2;
  background:#f6efe6; color:#1b7b51; font:600 13px/1.1 inherit; text-decoration:none; cursor:pointer; white-space:nowrap; overflow:hidden; transition:transform .12s, background .15s, box-shadow .15s; -webkit-tap-highlight-color:transparent}
.ab-b svg.i{width:18px; height:18px; flex:none; color:#17734b}
.ab-b span{overflow:hidden; text-overflow:ellipsis}
.ab-b:hover{background:#efe3d3} .ab-b:active{transform:scale(.98); background:#e8d8c3}
.ab-b.ab-p{background:linear-gradient(135deg,#c9a15e,#9c7540); color:#fffaf2; border-color:transparent; box-shadow:0 8px 18px -10px rgba(36,145,98,.75)}
.ab-b.ab-p svg.i{color:#fffaf2} .ab-b.ab-p:hover{filter:brightness(1.05)}
.ab-b.ab-off{opacity:.4; cursor:not-allowed}
@media (max-width:480px){
  .ab-b{flex-direction:column; gap:3px; height:50px; padding:0 4px; font-size:12px}
  .ab-b svg.i{width:18px; height:18px}
}
/* كارت الفاتورة: خط رفيع وبعده الصف */
.mcard-act:has(.ab){display:block!important; border-top:1px solid #f1eae0!important; margin-top:12px!important; padding-top:12px!important}
.mcard-act .ab .ab-b{width:auto!important}
/* الكمبيوتر: جوه عمود الأزرار في الجدول — أيقونات صغيرة بنفس الألوان */
table.t .row-actions .ab{display:flex; gap:6px; width:auto; justify-content:flex-end}
table.t .row-actions .ab-b{width:34px; height:34px; padding:0; border-radius:10px}
table.t .row-actions .ab-b span{display:none}
table.t .row-actions .ab-b svg.i{width:16px; height:16px}
/* تفاصيل الفاتورة: شريط ثابت تحت (فوق شريط التطبيق) */
.ab-dock{position:sticky; bottom:0; z-index:4; margin:16px -2px 0; padding:10px 12px calc(10px + env(safe-area-inset-bottom)); background:linear-gradient(180deg,rgba(255,250,242,.94),#fffaf2); border-top:1px solid #efe3d3; box-shadow:0 -10px 24px -18px rgba(11,64,41,.45); border-radius:16px 16px 0 0}
@media (max-width:860px){ .ab-dock{bottom:calc(var(--bottom-h,64px) + env(safe-area-inset-bottom)); padding-bottom:10px} }
.modal .modal-foot.ab-foot, .modal.pm .modal-foot.ab-foot{display:block!important; padding:10px 12px calc(10px + env(safe-area-inset-bottom))!important; background:#fffaf2!important; border-top:1px solid #efe3d3!important; box-shadow:0 -10px 24px -18px rgba(11,64,41,.45)!important}
.modal-foot.ab-foot .ab-dock{position:static; margin:0; padding:0; background:none; border:0; box-shadow:none}
.modal-foot.ab-foot .ab-b{min-width:0!important}
@media (min-width:1024px){ .ab-dock .ab{display:flex; justify-content:flex-start} .ab-dock .ab-b{flex:0 0 auto; min-width:120px; padding:0 18px} }   /* RTL: الصف يبدأ من اليمين */

/* شيت «المزيد» (.msx): مقبض + عنوان + صفوف (أيقونة / اسم / سهم) — الحذف في الآخر بالأحمر */
.sheet.ms-sheet{padding-top:6px}
.msx{display:flex; flex-direction:column; gap:10px}
.msx .ms-grip{display:block; width:42px; height:5px; border-radius:3px; background:#e2d6c6; margin:2px auto 4px}
.msx h3{margin:0; font-size:16px; text-align:center}
.ms-g{border:1px solid #efe3d3; border-radius:16px; overflow:hidden; background:#fff}
.ms-g.ms-gd{margin-top:6px}
.ms-r{display:flex; align-items:center; gap:12px; width:100%; min-height:52px; padding:10px 14px; background:#fff; border:0; border-bottom:1px solid #f3ebdf; text-align:right; font:500 14.5px inherit; color:#15412e; cursor:pointer}
.ms-g .ms-r:last-child{border-bottom:0}
.ms-r svg.i{width:20px; height:20px; color:#17734b; flex:none}
.ms-r .ms-l{flex:1; min-width:0; display:flex; flex-direction:column; gap:2px} .ms-r .ms-l small{font-size:11.5px; color:var(--text-3); font-weight:400}
.ms-r .ms-chev svg.i{width:16px; height:16px; color:#c9b69c}
.ms-r:active{background:#faf4ec}
.ms-r.ms-dng{color:#c0473a; justify-content:center; font-weight:700} .ms-r.ms-dng svg.i{color:#c0473a}
.ms-r.ms-off{opacity:.45}
/* خيارات الطباعة: 2×2 كروت متساوية + صف أزرار */
.prx-p{display:grid!important; grid-template-columns:repeat(2,minmax(0,1fr))!important; gap:10px}
.prx-o{position:relative; display:flex; flex-direction:column; align-items:flex-start; gap:3px; padding:14px; min-height:74px; border:1.5px solid #ead9c2; border-radius:14px; background:#fff; text-align:right; cursor:pointer}
.prx-o b{font-size:15px} .prx-o small{font-size:12px; color:var(--text-3)}
.prx-o .prx-ck{position:absolute; top:10px; left:10px; width:22px; height:22px; border-radius:50%; background:#c9a15e; display:none; align-items:center; justify-content:center}
.prx-o .prx-ck svg.i{width:14px; height:14px; color:#fff}
.prx-o.on{border-color:#b8925a; background:#fbf6ee; box-shadow:0 0 0 3px rgba(184,146,90,.15)} .prx-o.on .prx-ck{display:flex}
.prx-bt{border:1px solid #efe3d3; border-radius:14px}
.prx-h{margin:0; font-size:11.5px; color:var(--text-3); line-height:1.6; text-align:center}
/* طلب التعديل */
.erq-l{font-weight:700; font-size:13px} .erq textarea{width:100%; resize:vertical}
.erq-ph{display:flex; align-items:center; gap:8px; padding:12px 14px; border:1px dashed #d9c6ab; border-radius:14px; color:#1b7b51; cursor:pointer} .erq-ph svg.i{width:20px; height:20px}
.erq-bn{display:flex; gap:12px; align-items:flex-start; margin:0 0 14px; padding:12px 14px; border:1px solid #ecd9b9; background:#fdf6ea; border-radius:14px}
.erq-bn > svg.i{width:22px; height:22px; color:#17734b; flex:none; margin-top:2px}
.erq-bn > div:nth-child(2){flex:1; min-width:0; display:flex; flex-direction:column; gap:3px} .erq-bn small{color:var(--text-3)}
.erq-ac{display:flex; gap:8px; flex-wrap:wrap}
.erq-list{display:flex; flex-direction:column; gap:10px}
.erq-c{padding:14px} .erq-c p{margin:8px 0} .erq-c .erq-h{display:flex; justify-content:space-between; gap:10px; align-items:center}
.erq-c .ab{margin-top:10px}
.rej-b{display:inline-flex; align-items:center; gap:4px; padding:2px 8px; border-radius:999px; background:#fbeceb; color:#a33a2f; font-size:12px; font-weight:700}
/* قفل تعديل العملاء */
.lock-bn{display:flex; align-items:center; gap:10px; margin:0 0 12px; padding:10px 14px; border-radius:14px; background:#f6efe6; border:1px solid #ead9c2; color:#1b7b51; font-size:13px; font-weight:600}
.lock-bn.warn{background:#fdf3e2; border-color:#efd3a1} .lock-bn svg.i{width:18px; height:18px; flex:none}
/* صورة المحل */
.cf-ph{display:flex; align-items:center; gap:12px; padding:10px 14px; border:1px dashed #d9c6ab; border-radius:14px; cursor:pointer; color:#1b7b51}
.cf-ph img{width:64px; height:64px; object-fit:cover; border-radius:10px} .cf-ph svg.i{width:22px; height:22px}
/* مرتجع من فاتورة */
.rti-bar{display:flex; align-items:center; gap:10px; flex-wrap:wrap; margin-bottom:10px}
.rcm-ap{display:flex; flex-direction:column; gap:6px; margin-top:12px; padding:10px 12px; border:1px solid #efe3d3; border-radius:12px; background:#fffaf2; font-size:13px}
.modal-foot.ab-foot .ab-fbtns{display:block; width:100%} .modal-foot.ab-foot .mf-sum:empty{display:none}

/* ==========================================================================
   v219b — الأزرار غامقة زي الأول (أيقونة دهبي)، و«تحصيل» دهبي — وشيت المزيد / الطباعة / طلب التعديل بشكل «إضافة سريعة»
   ========================================================================== */
.ab-b{background:linear-gradient(180deg,#145236,#0c2219)!important; color:#fff!important; border:0!important;
  box-shadow:0 1px 0 rgba(255,255,255,.08) inset,0 6px 14px -8px rgba(0,0,0,.75)!important}
.ab-b svg.i{color:#e3c38b!important}
.ab-b:hover{background:linear-gradient(180deg,#1f523c,#0c2c1e)!important}
.ab-b:active{transform:scale(.98)}
.ab-b.ab-p{background:linear-gradient(135deg,#d2b07a,#9c7540)!important; color:#fff!important; box-shadow:0 8px 18px -10px rgba(184,146,90,.95)!important}
.ab-b.ab-p svg.i{color:#fff!important}
.ab-dock{background:linear-gradient(180deg,rgba(247,245,242,.92),#f7f5f2)}
/* الشيت: كارت في النص بعرض مناسب (مش عريض) — الهيدر الغامق فوق وزرار القفل جواه */
.sheet.ms-sheet{max-width:420px!important; padding:0!important; overflow:hidden auto}
.sheet.ms-sheet .sheet-x{position:absolute; top:14px; left:14px; float:none; margin:0; background:rgba(255,255,255,.1); z-index:3}
.ms-list{display:flex; flex-direction:column; gap:8px}
.ms-list .qs-item{width:100%; text-align:right; cursor:pointer; font:inherit}
.ms-list .ms-chev{margin-inline-start:auto; display:grid; place-items:center} .ms-list .ms-chev svg.i{width:16px; height:16px; color:#c9b69c}
.ms-list.ms-gd{padding-top:4px}
.ms-list .ms-dng{justify-content:center; border-color:rgba(192,71,58,.35)} .ms-list .ms-dng .qs-tx{flex:0 1 auto} .ms-list .ms-dng b{color:#c0473a}
.ms-list .ms-off{opacity:.5}
.prx.qs-sec{display:flex; flex-direction:column; gap:12px; padding-bottom:16px}
.erq.qs-sec{display:flex; flex-direction:column; gap:10px; padding-bottom:16px}
.prx .prx-bt{width:100%; text-align:right; cursor:pointer; font:inherit}

/* v221 — شريط الفاتورة جوه النافذة على الموبايل: الـ wrapper بتاع الفوتر (.mf-btns) كان flex فالشريط بيصغر على قد الزراير
   → دلوقتي بياخد العرض كله والأزرار متساوية (4 في الصف) بنفس الارتفاع */
.modal .modal-foot.ab-foot .mf-btns, .modal.pm .modal-foot.ab-foot .mf-btns{display:block!important; width:100%!important; flex:1 1 100%!important}
.modal-foot.ab-foot .ab-dock{width:100%!important}
@media (max-width:1023px){ .modal-foot.ab-foot .ab, .ab-dock .ab{display:grid!important; grid-template-columns:repeat(var(--n,4),minmax(0,1fr))!important; gap:8px!important}
  .modal-foot.ab-foot .ab-b, .ab-dock .ab-b{width:100%!important; min-width:0!important; height:52px!important} }
@media (hover:none){ .ab-b:hover{background:linear-gradient(180deg,#145236,#0c2219)!important} .ab-b.ab-p:hover{background:linear-gradient(135deg,#d2b07a,#9c7540)!important} }   /* الموبايل: اللون مايفضلش متغيّر بعد الضغط */

/* v223 — «ملخص الفاتورة»: الإجمالي في كارت فوق، الصفوف مرتبة، والدفع خانة + «كامل المبلغ» جنبها */
.sum-card .sm-hero{display:flex; flex-direction:column; gap:2px; padding:14px 16px; margin-bottom:10px; border-radius:16px; background:linear-gradient(135deg,rgba(210,176,122,.16),rgba(210,176,122,.04)); border:1px solid rgba(210,176,122,.28)}
.sum-card .sm-hero small{color:#c9b9a6; font-size:12px; font-weight:500}
.sum-card .sm-tot{display:flex; align-items:baseline; gap:8px}
.sum-card .sm-tot b{font-size:34px; line-height:1.1; color:#fff; font-family:'Readex Pro',var(--font); letter-spacing:-.5px; font-weight:700}
.sum-card .sm-tot em{font-style:normal; color:#d2b07a; font-weight:600; font-size:14px}
.sum-card .sm-rows{display:flex; flex-direction:column}
.sum-card .sm-rows .stat-row{padding:11px 2px!important}
.sum-card .sm-rows .stat-row:last-child{border-bottom:0!important}
.sum-card .sm-rem b{color:#e3c38b!important; font-size:16px!important}
.sum-pay{grid-template-columns:minmax(0,1fr) auto!important; align-items:end}
.sum-pay .sp-t{grid-column:1 / -1}
.sum-pay .f:has(#acc){grid-column:1 / -1}
.sum-pay .sm-payall{height:42px!important; padding:0 14px!important; border-radius:12px!important; border:0!important; background:linear-gradient(135deg,#d2b07a,#9c7540)!important; color:#fff!important; font-weight:700; white-space:nowrap; display:inline-flex; align-items:center; gap:6px}
.sum-pay .sm-payall svg.i{width:15px; height:15px; color:#fff}

/* v224 — مرتجع نفس الزيارة بيتخصم من الفاتورة */
.sum-card .sm-ret b{color:#f0a59b!important}

/* v225 — صفحة الهالك + جرد الهالك */
.dmg-bar{display:flex; align-items:center; gap:10px; flex-wrap:wrap; margin-bottom:14px}
.dmg-seg{display:flex; flex-wrap:wrap; gap:6px; margin:4px 0 12px}
.dmc{display:flex; flex-direction:column; gap:8px}
.dmc-r{display:grid; grid-template-columns:minmax(0,1fr) 110px 64px; gap:10px; align-items:center; padding:10px 12px; border:1px solid var(--border); border-radius:12px; background:#fff}
.dmc-r small{display:block; color:var(--text-3); font-size:12px}
.dmc-d{font-weight:700; text-align:center} .dmc-d.up{color:#b07a16} .dmc-d.dn{color:#c0473a}
.dmc-add{display:grid; grid-template-columns:auto minmax(0,1fr) 110px; gap:8px; align-items:center; margin-top:6px; padding:10px 12px; border:1px dashed var(--border); border-radius:12px}
@media (max-width:520px){ .dmc-add{grid-template-columns:1fr 100px} .dmc-add label{grid-column:1 / -1} }

/* v227: زرار التحصيل في جدول الفواتير — دهبي عشان يبان إن الفاتورة عليها فلوس */
table.t [data-act].act-btn.ab-gold{background:linear-gradient(180deg,#c9a15e,#9c7540)!important}
table.t [data-act].act-btn.ab-gold:hover{background:linear-gradient(180deg,#d8b273,#29a36e)!important}
/* v228: زراير الفاتورة — التحصيل الباهت لما الفاتورة مسددة + الحذف أحمر في شريط الموبايل */
table.t [data-act].act-btn[disabled]{opacity:.35!important; cursor:not-allowed; transform:none!important}
.ab.iv-ab5{gap:6px}
.ab.iv-ab5 .ab-b{padding:0 2px}
/* v229: الحذف أحمر مليان زي كروت العملاء */
.ab.iv-ab5 .ab-b[data-act="del"]{background:linear-gradient(180deg,#d9524a,#a9292f)!important; color:#fff!important; border:0!important; box-shadow:0 1px 0 rgba(255,255,255,.14) inset,0 5px 12px -7px rgba(169,41,47,.8)!important}
.ab.iv-ab5 .ab-b[data-act="del"] svg.i{color:#fff!important}
.ab.iv-ab5 .ab-b[data-act="del"]:hover{background:linear-gradient(180deg,#e5635a,#b8323a)!important}

/* ==========================================================================
   v230: فاتورة البيع — عداد الكمية جنب الأصناف + المرتجع بكروت وبوب أب + الدفع (آجل / كامل / جزء)
   ========================================================================== */
/* عداد − / + (أصناف الفاتورة والمرتجع) */
.pqs{display:inline-flex; align-items:center; gap:2px; padding:3px; border-radius:12px; background:#f6efe6; border:1px solid #ead9c2; flex:none}
.pqs button{width:30px; height:30px; border:0; border-radius:9px; display:grid; place-items:center; cursor:pointer; font:700 18px/1 inherit;
  background:linear-gradient(180deg,#145236,#0c2219); color:#fff; box-shadow:0 4px 10px -6px rgba(0,0,0,.7); transition:transform .1s}
.pqs button:active{transform:scale(.92)}
.pqs button svg.i{width:15px; height:15px; color:#e3c38b}
.pqs b{min-width:30px; text-align:center; font-size:15px; font-weight:800; color:#113425}
.pi .pqs{margin-inline-start:auto}

/* المرتجع: كارت لكل صنف */
.rtk{display:grid; grid-template-columns:40px minmax(0,1fr) auto auto 78px 34px; gap:10px; align-items:center; padding:10px 12px; border:1px solid #f1d9d6; border-radius:16px; background:#fffdfc}
.rtk-tx{min-width:0; display:flex; flex-direction:column; gap:2px}
.rtk-tx b{font-size:13.5px; font-weight:700; white-space:nowrap; overflow:hidden; text-overflow:ellipsis}
.rtk-tx small{font-size:11.5px; color:var(--text-3)} .rtk-tx small .num{color:#17734b; font-weight:700}
.rtk .rt-cond button{height:32px; padding:0 10px; font-size:12px}
.rtk .rt-v{color:#c8323a; font-size:14px}
.rtk .rt-x{color:#c0473a} .rtk .rt-x:hover{background:#fdecec}
.rtk-empty{display:flex; align-items:center; justify-content:center; gap:8px; width:100%; min-height:64px; border:1.5px dashed #e6cfc9; border-radius:16px; background:#fffaf8;
  color:#a9292f; font:600 13.5px inherit; cursor:pointer}
.rtk-empty svg.i{width:18px; height:18px}
#rt-box .rtk-add{margin-top:10px; height:40px; border-radius:12px; border:1.5px dashed #c9a15e; background:#fffaf2; color:#17734b; font-weight:700}
@media (max-width:640px){
  .rtk{grid-template-columns:40px minmax(0,1fr) 34px; grid-template-areas:"i n x" "c c c" "q q v"; row-gap:8px}
  .rtk > .pi-ic{grid-area:i} .rtk-tx{grid-area:n} .rtk .rt-x{grid-area:x} .rtk .rt-cond{grid-area:c} .rtk .pqs{grid-area:q; justify-self:start} .rtk .rt-v{grid-area:v; align-self:center; text-align:end}
  .rtk .rt-cond button{flex:1; justify-content:center}
  .pi{flex-wrap:wrap} .pi .pqs{order:5}
}
/* بوب أب أصناف المرتجع: نفس أيقونات الفاتورة بس أطول */
.rtp .pt-grid{max-height:min(60vh,520px)}
.rtp .pt.in{border-color:#c0473a; box-shadow:0 0 0 3px rgba(192,71,58,.12)}

/* الدفع في ملخص الفاتورة */
.sum-pay.spx{grid-template-columns:1fr!important; gap:12px}
.spx-seg{display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:6px; padding:4px; border-radius:14px; background:rgba(0,0,0,.25); border:1px solid rgba(255,255,255,.08)}
.spx-seg button{height:40px; display:flex; align-items:center; justify-content:center; gap:6px; border:0; border-radius:11px; background:transparent; color:#cbbfb3; font:600 13px inherit; cursor:pointer; transition:background .15s,color .15s}
.spx-seg button svg.i{width:15px; height:15px; color:#7a9b8a}
.spx-seg button.on{background:linear-gradient(135deg,#d2b07a,#9c7540); color:#fff; box-shadow:0 6px 14px -8px rgba(184,146,90,.9)}
.spx-seg button.on svg.i{color:#fff}
.sum-pay.spx .f{position:relative; grid-column:1 / -1!important}
.sum-pay.spx .f #paid{height:52px!important; font-size:22px!important; font-weight:800!important; padding-inline-end:52px!important}
.sum-pay.spx .spx-cur{position:absolute; inset-inline-end:14px; bottom:16px; font-style:normal; color:#d2b07a; font-size:13px; font-weight:700; pointer-events:none}
.sum-pay.spx .f label{display:flex; align-items:center; gap:6px}
.sum-pay.spx .f label svg.i{width:14px; height:14px; color:#d2b07a}
.sum-pay.spx .f.spx-off{opacity:.45}
.sum-pay.spx[data-k="due"] #paid{color:#7a9b8a!important}

/* ==========================================================================
   v231: بوب أب أصناف المرتجع (كروت بصورة) + نافذة كمية المرتجع + ملخص الفاتورة بمربعات
   ========================================================================== */
.rtg{display:flex; flex-direction:column; gap:12px}
.rtg-s{display:flex; align-items:center; gap:8px; padding:0 14px; height:46px; border-radius:14px; background:#fff; border:1px solid #ead9c2; position:sticky; top:0; z-index:1}
.rtg-s svg.i{width:18px; height:18px; color:#a08670; flex:none}
.rtg-s .inp{border:0!important; box-shadow:none!important; height:44px!important; padding:0!important; background:transparent!important; font-size:14px}
/* نافذة الكمية */
.rtq{display:flex; flex-direction:column; align-items:center}
.rtq .iq-step{margin:0 auto}
.rtq-l{margin-top:14px}
.rtq-cond{display:grid; grid-template-columns:1fr 1fr; gap:8px; width:100%; max-width:300px}
.rtq-cond button{height:44px; display:flex; align-items:center; justify-content:center; gap:7px; border-radius:13px; border:1px solid var(--border); background:#fff; font:600 13.5px inherit; color:var(--text-2); cursor:pointer}
.rtq-cond button svg.i{width:16px; height:16px}
.rtq-cond button.on{background:#fdecec; border-color:#f0b5b8; color:#c8323a; box-shadow:0 0 0 3px rgba(200,50,58,.08)}
/* ملخص الفاتورة بمربعات */
.sm-rows.smx{gap:10px}
.smx-g{display:grid; grid-template-columns:1fr 1fr; gap:8px}
.smx-t{display:flex; flex-direction:column; gap:6px; padding:12px; border-radius:14px; background:rgba(255,255,255,.05); border:1px solid rgba(255,255,255,.08); min-width:0}
.smx-t small{display:flex; align-items:center; gap:6px; color:#b9ada1; font-size:11.5px; font-weight:500; white-space:nowrap; overflow:hidden; text-overflow:ellipsis}
.smx-t small svg.i{width:14px; height:14px; color:#d2b07a; flex:none}
.smx-t b{color:#fff; font-size:18px; font-weight:800; line-height:1.1}
.smx-t.smx-rem b{color:#e3c38b}
.smx-t.smx-bal b{color:#fff}
.sm-rows.smx .stat-row{padding:10px 12px!important; border-radius:14px; background:rgba(255,255,255,.03); border:1px solid rgba(255,255,255,.06)!important}
.sm-rows.smx .stat-row > span{display:flex; align-items:center; gap:6px}
.sm-rows.smx .stat-row > span svg.i{width:14px; height:14px; color:#d2b07a}
.sm-rows.smx .smx-ret{background:rgba(217,82,74,.10); border-color:rgba(217,82,74,.25)!important}
.sm-rows.smx .smx-ret b, .sm-rows.smx .smx-ret svg.i{color:#f0a19a!important}

/* v233: بوب أب المرتجع بنفس أيقونات الفاتورة (من غير صور) — الكروت بتاعة v231/v232 مابقتش مستخدمة */
.rtg-hint{display:flex; align-items:center; gap:8px; padding:10px 12px; border-radius:12px; background:#fff7ea; border:1px dashed #e3c38b; color:#17734b; font-size:13px; font-weight:600}
.rtg-hint svg.i{width:16px; height:16px; flex:none}
.rtg .rtg-pt .pt-grid{max-height:none!important; padding:0!important; overflow:visible}

/* Round 3 §1 — شريط أزرار الفاتورة: نفس الشكل الغامق القديم — «حذف» أحمر */
.ab-dock.ab-inv .ab .ab-b.ab-d{background:linear-gradient(180deg,#d9524a,#a9292f)!important; color:#fff!important; border:0!important}
.ab-dock.ab-inv .ab .ab-b.ab-d svg.i{color:#fff!important}
.ab-dock.ab-inv .ab .ab-b.ab-d:hover{background:linear-gradient(180deg,#e5635a,#b8323a)!important}

/* شريط الفلاتر (fb-) v238 — صف واحد Dropdowns: الاختيار بيظهر جوه الزرار نفسه */
.fb{display:flex; flex-direction:column; gap:8px; width:100%; min-width:0}
.fb-line{display:flex; align-items:center; gap:10px; min-width:0}
.fb-row{display:flex; align-items:center; gap:8px; flex-wrap:nowrap; min-width:0}
.fb-tg{display:none; align-items:center; gap:6px; height:42px; padding:0 14px; border-radius:12px; border:1px solid #e6d8c6; background:#fff; color:#16422f; font:inherit; font-size:13px; font-weight:600; cursor:pointer; flex:none}
.fb-tg svg.i{width:16px; height:16px; color:#9c7540}
.fb-tg em{font-style:normal; background:#9c7540; color:#fff; border-radius:999px; min-width:18px; height:18px; display:inline-grid; place-items:center; font-size:11px; padding:0 5px}
.fb-tg.on{border-color:#c9a15e; background:#fbf3e6}
.fb-b{position:relative; display:inline-flex; align-items:center; gap:8px; height:42px; padding:0 10px 0 12px; border-radius:12px; border:1px solid #e3d5c2; background:#fff; color:#16422f; font:inherit; cursor:pointer; white-space:nowrap; max-width:220px; flex:none; box-shadow:0 1px 2px rgba(11,64,41,.05); transition:border-color .15s, background .15s, box-shadow .15s}
.fb-b > svg.i:first-child{width:16px; height:16px; color:#9c7540; flex:none}
.fb-b > svg.i:last-child{width:14px; height:14px; color:#b59a7a; flex:none; transition:transform .15s}
.fb-b.open > svg.i:last-child{transform:rotate(180deg)}
.fb-t{display:flex; flex-direction:column; align-items:flex-start; min-width:0; line-height:1.15}
.fb-t small{font-size:10.5px; color:#9a7d5e; font-weight:500}
.fb-t b{font-size:13px; font-weight:600; overflow:hidden; text-overflow:ellipsis; max-width:150px}
.fb-b:hover{border-color:#d2b48a; background:#fffaf3}
.fb-b.open{border-color:#c9a15e; box-shadow:0 0 0 3px rgba(201,161,94,.18)}
.fb-b.on{border-color:#c9a15e; background:#fbf3e6}
.fb-b.on .fb-t b{color:#146441}
.fb-x{display:grid; place-items:center; width:20px; height:20px; border-radius:50%; background:#ead9c2; flex:none}
.fb-x svg.i{width:12px!important; height:12px!important; color:#146441!important}
.fb-x:hover{background:#c0473a} .fb-x:hover svg.i{color:#fff!important}
.fb-clr{display:inline-flex; align-items:center; gap:5px; height:42px; padding:0 10px; border:0; background:none; color:#c0473a; font:inherit; font-size:12.5px; font-weight:600; cursor:pointer; flex:none; border-radius:12px}
.fb-clr svg.i{width:14px; height:14px} .fb-clr:hover{background:#fdf0ee}
.fb-cnt{flex:none; font-size:12.5px; color:#409470; white-space:nowrap; padding:0 4px}
.fb-cnt b{color:#16422f; font-size:14px}
.fb-chips{display:none}
/* القايمة */
.fb-pop{position:absolute; z-index:1200; background:#fff; border:1px solid #ead9c2; border-radius:16px; box-shadow:0 22px 48px -18px rgba(11,64,41,.5); padding:8px; display:flex; flex-direction:column; max-height:min(420px,72vh); animation:fbIn .14s ease-out}
@keyframes fbIn{from{opacity:0; transform:translateY(-4px)} to{opacity:1; transform:none}}
.fb-ph{display:flex; align-items:center; gap:8px; padding:6px 8px 10px; border-bottom:1px solid #f3eadc; margin-bottom:6px}
.fb-ph svg.i{width:16px; height:16px; color:#9c7540}
.fb-ph b{font-size:14px; color:#16422f}
.fb-ph small{margin-inline-start:auto; font-size:11px; color:#9a7d5e}
.fb-ps{display:flex; align-items:center; gap:6px; padding:0 10px; height:38px; border:1px solid #efe3d3; border-radius:10px; margin-bottom:6px; background:#fcfaf7}
.fb-ps input{border:0; outline:0; flex:1; font:inherit; background:none; min-width:0}
.fb-ps svg.i{width:16px; height:16px; color:#9c7540}
.fb-ol{overflow:auto; display:flex; flex-direction:column; gap:2px}
.fb-o{display:flex; align-items:center; gap:10px; min-height:40px; padding:0 10px; border:0; background:none; border-radius:10px; font:inherit; font-size:13.5px; text-align:right; cursor:pointer; color:#16422f}
.fb-o:hover{background:#faf3e8}
.fb-o.on{background:#fbf3e6; font-weight:700; color:#146441}
.fb-o span{flex:1; overflow:hidden; text-overflow:ellipsis; white-space:nowrap}
.fb-o em{font-style:normal; font-size:11.5px; color:#409470; background:#f3ece3; border-radius:999px; padding:1px 8px; font-weight:600}
.fb-o.on em{background:#ead9c2; color:#146441}
.fb-tick{display:grid; place-items:center} .fb-tick svg.i{width:16px; height:16px; color:#9c7540}
.fb-ck{width:20px; height:20px; border-radius:6px; border:1.5px solid #c9b69c; display:grid; place-items:center; flex:none; background:#fff}
.fb-o.on .fb-ck{background:#9c7540; border-color:#9c7540} .fb-ck svg.i{width:13px; height:13px; color:#fff}
.fb-pf{display:flex; gap:8px; justify-content:flex-end; padding:10px 4px 2px; border-top:1px solid #f3eadc; margin-top:8px}
.fb-pf .btn svg.i{width:14px; height:14px}
.fb-none{padding:14px; text-align:center; color:#409470; font-size:13px}
/* قايمة الفترة */
.fb-pop-dt{padding:10px}
.fb-qr{display:grid; grid-template-columns:1fr 1fr; gap:8px}
.fb-qr button{display:flex; align-items:center; justify-content:center; gap:6px; height:40px; border-radius:11px; border:1px solid #e6d8c6; background:#fff; font:inherit; font-size:13px; font-weight:600; cursor:pointer; color:#16422f}
.fb-qr button svg.i{width:14px; height:14px}
.fb-qr button:hover{background:#faf3e8; border-color:#d2b48a}
.fb-qr button.on{background:#16422f; border-color:#16422f; color:#fff} .fb-qr button.on svg.i{color:#e3c38b}
.fb-sep{display:flex; align-items:center; gap:8px; margin:12px 2px 8px; color:#9a7d5e; font-size:11.5px}
.fb-sep::before,.fb-sep::after{content:''; flex:1; height:1px; background:#efe3d3}
.fb-dr{display:flex; flex-direction:column; gap:8px}
.fb-dl{display:grid; grid-template-columns:34px 1fr; align-items:center; gap:8px}
.fb-dl label{font-size:12.5px; color:#409470; font-weight:600}
.fb-dl .dp, .fb-dl .inp{width:100%}
/* التولبار: صف واحد (البحث يكبر على قد المساحة) */
.toolbar:has(.fb){flex-wrap:nowrap; align-items:center}
.toolbar:has(.fb) .search{flex:1 1 200px; min-width:160px; max-width:300px}
.toolbar:has(.fb) .search input{width:100%!important; height:42px}
.toolbar:has(.fb) .tb-extra{flex:0 1 auto; min-width:0; width:auto; overflow:visible}
.toolbar:has(.fb) .grow{flex:1 1 0; min-width:0}
.toolbar:has(.fb) .tb-btns .btn span{display:none}
.toolbar:has(.fb) .tb-btns .btn{width:42px; height:42px; padding:0; justify-content:center}
@media (max-width:1240px){ .fb-b{max-width:170px} .fb-t b{max-width:100px} .toolbar:has(.fb) .search{max-width:220px} }
@media (max-width:860px){
  .toolbar:has(.fb){flex-wrap:wrap}
  .toolbar:has(.fb) .search{order:1; flex:1 1 0; max-width:none}
  .toolbar:has(.fb) .tb-btns{order:2}
  .toolbar:has(.fb) .tb-extra{order:3; flex:1 1 100%; width:100%}
  .fb-tg{display:inline-flex}
  .fb-line{justify-content:space-between; flex-wrap:wrap}
  .fb-row{display:none} .fb-row.open{display:grid; grid-template-columns:1fr 1fr; gap:8px; order:3; flex:1 1 100%}
  .fb-row.open .fb-b{width:100%; max-width:none} .fb-row.open .fb-t b{max-width:none}
  .fb-row.open .fb-clr{grid-column:1 / -1; justify-content:center}
}

/* Round 3 — جداول احترافية (t-pro): هيدر ثابت، فواصل رفيعة، hover، أرقام على نفس الحافة، صف واحد */
.table-wrap:has(> table.t-pro){max-height:calc(100vh - 210px); overflow:auto}
table.t.t-pro tbody tr{transition:background .12s}
table.t.t-pro tbody td{padding:10px 14px; border-bottom:1px solid #f3eadc; vertical-align:middle}
table.t.t-pro tbody tr:nth-child(even) td{background:#fffcf7}
table.t.t-pro tbody tr:hover td{background:#fbf3e6}
table.t.t-pro td.n, table.t.t-pro th.n{text-align:left; font-variant-numeric:tabular-nums; white-space:nowrap}
table.t.t-pro tfoot td{position:sticky; bottom:0; background:#f6ecdd; font-weight:700; border-top:1px solid #ead9c2; white-space:nowrap}
table.t.t-1l td{white-space:nowrap}
table.t.t-1l td .ell{display:block; max-width:220px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap}
/* أزرار صغيرة متساوية في الجدول (ia-) */
.ia{display:flex; gap:6px; justify-content:flex-end}
.ia-b{width:32px; height:32px; border-radius:9px; border:1px solid #ead9c2; background:#fffaf2; display:grid; place-items:center; cursor:pointer; padding:0; color:#17734b; flex:none}
.ia-b svg.i{width:16px; height:16px}
.ia-b:hover{background:#f6ecdd; border-color:#d8bf9a}
.ia-b.ia-d{border-color:#e9b8b1; color:#c0473a; background:#fff}
.ia-b.ia-d:hover{background:#fdf0ee}
.ia-b.ia-p{background:linear-gradient(135deg,#d2b07a,#9c7540); color:#fff; border-color:transparent}
.mcard-act .ia{display:grid; grid-template-columns:repeat(var(--n,3),minmax(0,1fr)); gap:6px; width:100%}
.mcard-act .ia .ia-b{width:100%; height:40px; display:flex; gap:6px; font:inherit; font-size:12.5px; font-weight:600}
.mcard-act .ia .ia-b .ia-l{display:inline}
.ia-b .ia-l{display:none}

/* Round 3 §5 — منتقي التاريخ (dp-): dd/mm/yyyy بأرقام إنجليزي + نتيجة عربي */
.dp{position:relative; display:inline-flex; align-items:center; width:100%; min-width:0}
.dp > .dp-in{width:100%; padding-inline-end:38px!important; text-align:left; letter-spacing:.3px}
.dp > .dp-in.dp-bad{border-color:#e2a59d!important; box-shadow:0 0 0 3px rgba(192,71,58,.12)!important}
.dp > .dp-b{position:absolute; inset-inline-end:4px; top:50%; transform:translateY(-50%); width:30px; height:30px; border:0; background:none; border-radius:8px; display:grid; place-items:center; cursor:pointer; padding:0}
.dp > .dp-b svg.i{width:16px; height:16px; color:#9c7540}
.dp > .dp-b:hover{background:#f6ecdd}
.date-chip .dp{width:auto} .date-chip .dp > .dp-in{width:128px!important}
.date-chip > svg.i:first-child{display:none}
.dp-pop{position:absolute; z-index:1300; width:288px; background:#fff; border:1px solid #ead9c2; border-radius:16px; box-shadow:0 20px 44px -18px rgba(11,64,41,.5); padding:10px; direction:rtl}
.dp-h{display:flex; align-items:center; justify-content:space-between; margin-bottom:8px}
.dp-h b{font-size:15px; color:#16422f}
.dp-h button{width:34px; height:34px; border-radius:10px; border:1px solid #efe3d3; background:#fffaf2; display:grid; place-items:center; cursor:pointer; padding:0}
.dp-h button svg.i{width:16px; height:16px; color:#17734b}
.dp-w, .dp-g{display:grid; grid-template-columns:repeat(7,1fr); gap:3px; text-align:center}
.dp-w span{font-size:11px; color:#409470; padding:4px 0}
.dp-g i{display:block}
.dp-d{height:34px; border:0; background:none; border-radius:9px; font:inherit; font-size:13.5px; cursor:pointer; color:#16422f}
.dp-d:hover{background:#f6ecdd} .dp-d.td{box-shadow:inset 0 0 0 1.5px #c9a15e; font-weight:700}
.dp-d.on{background:linear-gradient(135deg,#d2b07a,#9c7540); color:#fff; font-weight:700}
.dp-d:disabled{opacity:.3; cursor:not-allowed}
.dp-f{display:flex; justify-content:space-between; gap:6px; margin-top:8px; padding-top:8px; border-top:1px solid #f3eadc}
.dp-f button{border:0; background:#f6ecdd; color:#146441; border-radius:9px; height:32px; padding:0 14px; font:inherit; font-weight:600; cursor:pointer}
.dp-f [data-clr]{background:none; color:#c0473a}

/* Round 3 §3 — جدول الفواتير + كروت الموبايل (iv2-) */
.iv2-seg{display:flex; gap:6px; flex-wrap:wrap}
.iv2-dates{display:flex; flex-wrap:wrap; align-items:center; gap:8px}
.iv2-qr{display:flex; gap:6px; flex-wrap:wrap}
.iv2-qr button{height:34px; padding:0 12px; border-radius:999px; border:1px solid #e6d8c6; background:#fff; color:#146441; font:inherit; font-size:12.5px; cursor:pointer}
.iv2-qr button.on{background:#16422f; color:#fff; border-color:#16422f}
.iv2-fb{flex:1 1 100%}
.iv2-t .iv2-pn{max-width:190px}
.iv2-no{display:inline-flex; align-items:center; gap:5px; white-space:nowrap}
.iv2-ret{display:inline-grid; place-items:center; width:20px; height:20px; border-radius:6px; background:#fdecea}
.iv2-ret svg.i{width:13px; height:13px; color:#c0473a}
.iv2-no .pnd-b{margin:0; padding:0 5px}
.iv2-ok{color:#197c51} .iv2-due{color:#c0473a}
.iv2-st{position:relative; display:inline-flex; align-items:center; height:24px; padding:0 10px; border-radius:999px; font-size:12px; font-weight:700; white-space:nowrap; overflow:hidden}
.iv2-st.s-paid{background:#e7f6ee; color:#197c51} .iv2-st.s-part{background:#fff3dc; color:#9a6400} .iv2-st.s-due{background:#f4eee7; color:#33785a} .iv2-st.s-ret{background:#fdecea; color:#c0473a}
.iv2-st i{position:absolute; inset-inline-start:0; bottom:0; height:2px; width:var(--p); background:#d39b2a}
.iv2-c{display:flex; flex-direction:column; gap:10px}
.iv2-ch{display:flex; align-items:flex-start; justify-content:space-between; gap:10px}
.iv2-cw{min-width:0} .iv2-cw b{display:block; font-size:15px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap}
.iv2-cw small{display:block; color:#409470; font-size:12px; margin-top:2px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis}
.iv2-pill{flex:none; height:28px; padding:0 12px; border-radius:999px; display:inline-flex; align-items:center; font-weight:700; font-size:13px; white-space:nowrap}
.iv2-pill.is-due{background:#fdecea; color:#c0473a} .iv2-pill.is-ok{background:#f6ecdd; color:#9c7540} .iv2-pill.is-ret{background:#fdecea; color:#c0473a}
.iv2-cs{display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:6px}
.iv2-cs > div{background:#fbf6ef; border-radius:12px; padding:8px 10px; min-width:0}
.iv2-cs label{display:block; font-size:11px; color:#409470} .iv2-cs b{display:block; font-size:14px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis}
.iv2-rep{display:inline-flex; align-items:center; gap:5px; align-self:flex-start; height:24px; padding:0 10px; border-radius:999px; background:#f3ece3; color:#146441; font-size:12px}
.iv2-rep svg.i{width:13px; height:13px; color:#9c7540}
.mcard:has(> .iv2-c){border-radius:16px; box-shadow:0 6px 18px -12px rgba(11,64,41,.35); padding:14px}
.mcard:has(> .iv2-c.is-ret){border-inline-start:3px solid #e0796d}

/* Round 3 §2 — جدول العملاء (cu2-) */
.cu2-who{min-width:0; display:flex; flex-direction:column; gap:2px}
.cu2-who b{font-size:14px} .cu2-t .cu2-who b.ell{max-width:240px}
.cu2-sub{color:#409470; font-size:12px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; max-width:260px}
.cu2-bal{white-space:nowrap} .cu2-bal.is-due{color:#c0473a} .cu2-bal.is-cr{color:#197c51}
.cu2-over{display:inline-block; margin-inline-start:6px; height:20px; line-height:20px; padding:0 8px; border-radius:999px; background:#fdecea; color:#c0473a; font-size:11px; font-weight:700; vertical-align:middle}
.cu2-c{display:flex; flex-direction:column; gap:10px}
.cu2-ch{display:flex; justify-content:space-between; align-items:flex-start; gap:8px}
.cu2-cg{display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:6px}
.cu2-cg > div{background:#fbf6ef; border-radius:12px; padding:8px 10px; min-width:0}
.cu2-cg label{display:block; font-size:11px; color:#409470} .cu2-cg span{display:block; font-weight:700; white-space:nowrap; overflow:hidden; text-overflow:ellipsis}
.cu2-cg .cu2-over{display:none}
.mcard:has(> .cu2-c){border-radius:16px; box-shadow:0 6px 18px -12px rgba(11,64,41,.35); padding:14px}

/* Round 3 §6 — أوامر الإنتاج */
.pr2-acts{display:flex; align-items:center; gap:6px; justify-content:flex-end}
.pr2-lock{display:flex; gap:8px; align-items:flex-start; padding:10px 12px; border-radius:12px; background:#fff6e5; border:1px solid #f1d9a6; color:#7a5200; margin:6px 0 10px; font-size:13px}
.pr2-lock svg.i{width:18px; height:18px; flex:none; color:#b7791f}

/* Round 3 §7 — «تقرير النهارده» لغير الأدمن */
.rp-today{display:flex; align-items:center; flex-wrap:wrap; gap:8px; padding:10px 14px; border-radius:14px; background:#fbf3e6; border:1px solid #ead9c2; color:#146441; margin-bottom:12px}
.rp-today svg.i{width:18px; height:18px; color:#9c7540}
.rp-today b{font-size:14px} .rp-today small{color:#409470; margin-inline-start:auto}

/* Round 3 §8 — ملخص الفاتورة + المرتجع + شبكة الأصناف */
.sum-card .sm-hero .sm-hsub{display:block; margin-top:2px; font-size:12px; opacity:.85}
.bal-b{opacity:.65; font-size:.9em} .bal-ar{margin:0 6px; opacity:.6}
.bal-over{display:block; font-style:normal; margin-top:4px; font-size:11px; font-weight:700; color:#ffb4ad}
.sum-card:not(.dark) .bal-over, .card:not(.sum-card) .bal-over{color:#c0473a}
.rt-card{border-inline-start:4px solid #e0796d!important}
.rt-card .card-head h3{color:#b23a30}
.rt-card .rt-sum{border-top:1px dashed #f0c2bc; padding-top:8px}
.rtq-cond.rtq-3{grid-template-columns:repeat(3,minmax(0,1fr)); max-width:360px}
.rtq-note{width:100%; max-width:360px; margin-top:8px}
.pt{min-height:150px}
.pt small{white-space:nowrap; overflow:hidden; text-overflow:ellipsis; max-width:100%}
@media (max-width:380px){ .pt-grid{grid-template-columns:repeat(auto-fill,minmax(96px,1fr)); gap:6px; padding:8px} .pt{padding:10px 4px 8px} .pt-ic{width:42px; height:42px; font-size:22px} }

/* v238: خانة التاريخ — الأيقونة على الشمال والرقم مايدخلش فيها */
.dp > .dp-in{padding-left:38px!important; padding-right:12px!important; text-align:left; direction:ltr}
.dp > .dp-b{left:4px!important; right:auto!important; inset-inline-end:auto}

/* v239: الموبايل عمود لوحده في الفواتير والعملاء */
.iv2-ph, .cu2-ph{font-size:13px; color:#146441; letter-spacing:.3px; white-space:nowrap}

/* v240 — صفحة الفاتورة (iv3-): كروت مرتبة، والأصناف كلها ظاهرة من غير سحب يمين وشمال */
#doc .doc-body:has(> .iv3){padding:0!important}
.iv3{display:flex; flex-direction:column; gap:14px; padding:22px; color:#0a3321}
.iv3-hd{display:flex; justify-content:space-between; align-items:flex-start; gap:16px; padding-bottom:16px; border-bottom:1px solid #efe3d3}
.iv3-brand{display:flex; flex-direction:column; gap:6px; min-width:0}
.iv3-brand img{height:64px; width:auto; object-fit:contain; align-self:flex-start}
.iv3-co{font-size:18px}
.iv3-brand small{font-size:12px; color:#409470}
.iv3-ttl{display:flex; flex-direction:column; align-items:flex-end; gap:4px; text-align:left; flex:none}
.iv3-kind{display:inline-flex; align-items:center; gap:6px; height:28px; padding:0 12px; border-radius:999px; background:#16422f; color:#fff; font-size:13px; font-weight:700}
.iv3-kind svg.i{width:14px; height:14px; color:#e3c38b}
.iv3-kind.ret{background:#b23a30} .iv3-kind.ret svg.i{color:#fff}
.iv3-ttl > b{font-size:20px; letter-spacing:.5px}
.iv3-ttl small{font-size:12.5px; color:#409470}
.iv3-sum{display:flex; align-items:center; flex-wrap:wrap; gap:12px 18px; padding:14px 16px; border-radius:16px; background:linear-gradient(135deg,#113727,#0a2217); color:#fff}
.iv3-net{display:flex; flex-direction:column; margin-inline-end:auto}
.iv3-net small{font-size:12px; color:#d9c5a8}
.iv3-net b{font-size:26px; line-height:1.15} .iv3-net em{font-style:normal; font-size:13px; color:#e3c38b; font-weight:600}
.iv3-st{display:inline-flex; align-items:center; gap:5px; height:30px; padding:0 14px; border-radius:999px; font-size:13px; font-weight:700}
.iv3-st svg.i{width:14px; height:14px}
.iv3-st.s-ok{background:rgba(52,199,120,.18); color:#7ee3ad} .iv3-st.s-part{background:rgba(230,170,40,.2); color:#ffd27a} .iv3-st.s-due{background:rgba(255,255,255,.12); color:#eadfd2} .iv3-st.s-ret{background:rgba(224,121,109,.22); color:#ffb4ad}
.iv3-mini{display:flex; gap:18px}
.iv3-mini div{display:flex; flex-direction:column} .iv3-mini small{font-size:11.5px; color:#d9c5a8} .iv3-mini b{font-size:15px} .iv3-mini b.due{color:#ffb4ad}
.iv3-info{display:grid; grid-template-columns:repeat(auto-fit,minmax(180px,1fr)); gap:10px}
.iv3-info > div{display:flex; align-items:flex-start; gap:10px; padding:12px; border:1px solid #efe3d3; border-radius:14px; background:#fffcf8; min-width:0}
.iv3-ic{width:36px; height:36px; border-radius:11px; background:#f6ecdd; display:grid; place-items:center; flex:none}
.iv3-ic svg.i{width:17px; height:17px; color:#9c7540}
.iv3-info label{display:block; font-size:11.5px; color:#9a7d5e}
.iv3-info b{display:block; font-size:14.5px; overflow-wrap:anywhere}
.iv3-tel{display:inline-block; margin-top:2px; font-size:13px; color:#17734b; text-decoration:none; font-weight:600}
.iv3-sec{display:flex; align-items:center; justify-content:space-between; gap:10px; margin-top:4px}
.iv3-sec b{display:inline-flex; align-items:center; gap:7px; font-size:15px} .iv3-sec b svg.i{width:17px; height:17px; color:#9c7540}
.iv3-sec > span{font-size:12.5px; color:#409470}
.iv3-sec.sm b{font-size:14px}
.iv3-items{border:1px solid #efe3d3; border-radius:16px; overflow:hidden; background:#fff}
.iv3-ih, .iv3-it{display:grid; grid-template-columns:34px minmax(0,1fr) auto 110px; align-items:center; gap:12px; padding:12px 16px}
.iv3-ih{background:#0a3321; color:#eadfd2; font-size:12px; font-weight:600; padding-block:10px}
.iv3-ih span:nth-child(3), .iv3-ih span:nth-child(4){text-align:left}
.iv3-it + .iv3-it{border-top:1px solid #f3eadc}
.iv3-it:nth-child(odd){background:#fffcf7}
.iv3-n{width:26px; height:26px; border-radius:8px; background:#f6ecdd; color:#17734b; display:grid; place-items:center; font-size:12px; font-weight:700}
.iv3-nm{min-width:0; display:flex; flex-direction:column; gap:3px}
.iv3-nm b{font-size:14.5px; overflow-wrap:anywhere}
.iv3-nm small{font-size:11.5px; color:#9a7d5e}
.iv3-q{font-size:13.5px; color:#146441; white-space:nowrap; text-align:left}
.iv3-q small{color:#9a7d5e; font-size:12px}
.iv3-dc{display:block; color:#b7791f!important}
.iv3-t{font-size:15px; text-align:left; white-space:nowrap}
.iv3-bot{display:grid; grid-template-columns:minmax(0,1fr) minmax(260px,340px); gap:16px; align-items:start}
.iv3-pays{display:flex; flex-direction:column; gap:8px; min-width:0}
.iv3-p{display:flex; justify-content:space-between; align-items:center; gap:10px; padding:10px 12px; border:1px solid #efe3d3; border-radius:12px; background:#fffcf8}
.iv3-p > div{min-width:0} .iv3-p small{display:block; font-size:11.5px; color:#9a7d5e}
.iv3-note{padding:10px 12px; border-radius:12px; background:#faf5ee; font-size:13px} .iv3-note small{display:block; color:#9a7d5e; font-size:11.5px}
.iv3-tot{border:1px solid #efe3d3; border-radius:16px; padding:6px 14px; background:#fff}
.iv3-tot > div{display:flex; justify-content:space-between; align-items:center; gap:10px; padding:8px 0; font-size:13.5px}
.iv3-tot > div + div{border-top:1px dashed #efe3d3}
.iv3-tot > div.g{border-top:2px solid #0a3321; border-bottom:2px solid #0a3321; margin:4px 0; padding:10px 0}
.iv3-tot > div.g span{font-weight:700; font-size:15px} .iv3-tot > div.g b{font-size:20px} .iv3-tot em{font-style:normal; font-size:12px; color:#9c7540}
.iv3-tot > div.due b{color:#c0473a}
.iv3-tot > div.bal{color:#409470}
.iv3-ft{text-align:center; font-size:12.5px; color:#409470; border-top:1px dashed #efe3d3; padding-top:12px}
@media (max-width:860px){
  .iv3{padding:14px; gap:12px}
  .iv3-brand img{height:50px}
  .iv3-ttl > b{font-size:17px}
  .iv3-net b{font-size:22px}
  .iv3-info{grid-template-columns:1fr}
  .iv3-ih{display:none}
  .iv3-it{grid-template-columns:28px minmax(0,1fr) auto; grid-template-areas:"n nm t" "n q q"; gap:4px 10px; padding:12px}
  .iv3-it .iv3-n{grid-area:n; align-self:start} .iv3-it .iv3-nm{grid-area:nm} .iv3-it .iv3-t{grid-area:t; align-self:start} .iv3-it .iv3-q{grid-area:q; text-align:right; white-space:normal}
  .iv3-bot{grid-template-columns:1fr}
  .iv3-bot .iv3-tot{order:-1}
}

/* v245: أسماء الفلاتر كانت باينة مقصوصة/باهتة — الخط العربي كان بيتقص من فوق وتحت (line-height صغير + overflow) */
.fb-t{line-height:1.5}
.fb-t b{font-size:13.5px; font-weight:700; color:#0a3321; line-height:1.6; padding-block:1px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap}
.fb-t small{line-height:1.3; color:#409470}
.fb-b{height:44px; color:#0a3321; border-color:#d9c6ab; background:#fff}
.fb-b > svg.i:first-child{color:#17734b; width:17px; height:17px}
.fb-b > svg.i:last-child{color:#409470}
.fb-b.on{background:#f8eddc}
.fb-cnt{font-size:13px; color:#146441}

/* v246 — شارة الاتصال في الهيدر */
.tb-net{display:inline-flex; align-items:center; gap:5px; height:30px; padding:0 10px; border-radius:999px; background:#fdecea; color:#b23a30; font-size:12px; font-weight:700; white-space:nowrap}
.tb-net[hidden]{display:none!important}
.tb-net svg.i{width:14px; height:14px}
.tb-net.weak{background:#fff3dc; color:#9a6400}
@media (max-width:520px){ .tb-net span{display:none} .tb-net{padding:0 8px} }

/* v249 — المرتجع جوه الفاتورة + سؤال الطباعة */
.iv2-rt{display:inline-flex; align-items:center; gap:3px; height:20px; padding:0 7px; border-radius:999px; background:#fdecea; color:#b23a30; font-size:11px; font-weight:700}
.iv2-rt svg.i{width:11px; height:11px}
.iv3-tot > div.rt{color:#b23a30} .iv3-tot > div.rt svg.i{width:13px; height:13px; vertical-align:-2px}
.ap-q{display:flex; flex-direction:column; align-items:center; gap:6px; padding:10px 0; text-align:center}
.ap-q svg.i{width:40px; height:40px; color:#9c7540}
.ap-q b{font-size:17px} .ap-q small{color:#409470}

/* v250 — علامة «مستنية التسوية» على فواتير المندوب في القايمة */
.iv2-pend{display:inline-flex; align-items:center; gap:3px; height:20px; padding:0 7px; border-radius:999px; background:#fff3dc; color:#9a6400; font-size:11px; font-weight:700; white-space:nowrap}
.iv2-pend svg.i{width:11px; height:11px}
