/* ثيم alkabos — pages/money.css
   صفحات: إضافة رصيد (‎add-balance.php‎)، التسويق بالعمولة (‎affiliates.php‎)،
   اللوحة الفرعية (‎child-panel.php‎).

   هنا فقط ما لا تعرّفه ورقة القالب. كل محدِّد مسنود إلى جذر صفحته وحدها —
   ‎.addfunds-page‎ (‎$os_main_class‎) أو ‎.content.affiliates‎ أو
   ‎.content.childpanel-create‎ — لأن الأوراق السبع تُحمَّل على كل صفحة، وقاعدة
   طليقة من مجموعة تعيد تنسيق صفحات مجموعة أخرى.
   كل لون من متغيّرات الورقة نفسها فيتبع الفاتح والداكن بلا نسخة ثانية. */

/* ===================================================================
   ١) إضافة رصيد — .addfunds-page
   =================================================================== */

/* ‎.page-content .content>div‎ في الورقة صندوق مرن بـ‎align-items:center‎،
   فابن الشِلّ ينكمش إلى عرض محتواه ما لم يُطلب منه العرض الكامل. */
.addfunds-page > .addfunds { width: 100%; }
.addfunds-page > .addfunds > * { width: 100%; }

/* أيقونة الطريقة: الورقة تنسّق ‎.method-icon img‎ وحدها، وأغلب طرقنا رمز خطّي */
.addfunds-page .methods .method-icon i {
  font-size: 22px;
  line-height: 1;
  color: var(--main-color);
}
.addfunds-page .methods .method-icon img {
  width: 100%;
  height: auto;
  max-height: 34px;
  object-fit: contain;
}

/* السطر الثاني في بطاقة الطريقة: شارات العملات والبونص والحدّان */
.addfunds-page .methods .method-title .pm-label { display: block; }
.addfunds-page .methods .pm-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 4px;
  font-size: 11px;
  font-weight: 600;
  opacity: .85;
}
.addfunds-page .methods .pm-coins { display: inline-flex; gap: 3px; }
.addfunds-page .methods .cn {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 800;
  color: #fff;
  line-height: 1;
}
.addfunds-page .methods .pm-bonus { color: var(--main-color); font-weight: 900; }

/* صندوق التعليمات: الورقة لا تعرّفه إطلاقًا (كان في كتلة ‎<style>‎ الصفحة
   بألوان مخبوزة ‎#ff4b16 / #0b111d‎ — هنا بمتغيّرات الورقة). */
.addfunds-page .payment-instructions-box { margin-top: 16px; }
.addfunds-page .payment-instructions {
  width: 100%;
  padding: 16px;
  border: 1px solid var(--border-color);
  border-radius: 14px;
  background: var(--bg-color);
  color: var(--text-main);
  font-size: 14px;
  line-height: 1.9;
  overflow-wrap: anywhere;
}
.addfunds-page .payment-instructions:empty { display: none; }
.addfunds-page .payment-instructions img { max-width: 100%; height: auto; }
.addfunds-page .payment-instructions input,
.addfunds-page .payment-instructions select,
.addfunds-page .payment-instructions textarea {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  margin-top: 8px;
  padding: 11px 12px;
  border-radius: 12px;
  border: 1px solid var(--border-color);
  background: var(--secondary-color);
  color: var(--text-main);
}
.addfunds-page .payment-instructions .btn,
.addfunds-page .payment-instructions button,
.addfunds-page .payment-instructions a.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 10px 18px;
  border: 0;
  border-radius: 12px;
  background: var(--main-color);
  color: #fff;
  text-decoration: none;
  cursor: pointer;
}

/* سعر الصرف: يُقال مرّة واحدة وبشكل شارة، لا سطرًا في متن التعليمات */
.addfunds-page .af-rate {
  align-self: flex-start;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 10px;
  padding: 8px 14px;
  border-radius: 999px;
  background: var(--main-color);
  color: #fff;
  font-size: 13px;
  font-weight: 900;
}

/* ‎.calc_bonus‎ في الورقة تنسّق أبناءها فقط، لا الحاوية */
.addfunds-page .calc_bonus { display: flex; flex-direction: column; gap: 6px; }

/* حقل هاتف لاتينيّ داخل صفحة عربية — بلا سمة ‎dir‎ مكتوبة في الترميز */
.addfunds-page .af-ltr { direction: ltr; text-align: start; }

/* حالة الفراغ (لا طرق دفع / لا مدفوعات) */
.addfunds-page .af-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 40px 20px;
  text-align: center;
  font-size: 14px;
  color: var(--text-main);
  opacity: .75;
}
.addfunds-page .af-empty i { font-size: 34px; color: var(--main-color); opacity: .8; }

/* سجل المدفوعات: الورقة تعرّف ‎.lists .invoice a‎ و‎.lists .amount‎ فقط */
.addfunds-page .lists .amount { display: inline-flex; align-items: center; gap: 2px; }
.addfunds-page .lists .amount.is-minus { color: #ef4444; }
.addfunds-page .lists .af-date { white-space: nowrap; font-size: 12.5px; }
.addfunds-page .lists .invoice a { display: inline-flex; align-items: center; gap: 6px; }
.addfunds-page .lists .status-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 900;
  white-space: nowrap;
  border: 1px solid var(--border-color);
  background: var(--secondary-color);
  color: var(--text-main);
}
.addfunds-page .lists .status-badge.st-ok   { background: rgba(34,197,94,.14);  color: #86efac; border-color: rgba(34,197,94,.35); }
.addfunds-page .lists .status-badge.st-pend { background: rgba(245,158,11,.14); color: #fcd34d; border-color: rgba(245,158,11,.35); }
.addfunds-page .lists .status-badge.st-no   { background: rgba(239,68,68,.14);  color: #fca5a5; border-color: rgba(239,68,68,.35); }

/* ‎.alert-info‎ غير معرَّفة في الورقة إطلاقًا، و‎.alert.alert-success/-danger‎
   معرَّفتان — فهذه وحدها الناقصة. */
.addfunds-page .alert.alert-info {
  position: relative;
  background: linear-gradient(135deg, #0ea5e9, #38bdf8);
  color: #fff;
  border: none;
}

/* ===================================================================
   ٢) التسويق بالعمولة — .content.affiliates
   =================================================================== */

/* الورقة تستعمل ‎var(--text-light)‎ في ‎.affiliates .header p‎ وفي كل خانة من
   ‎.affiliates .table tbody td‎ ولا تعرّفه في أي مكان — متغيّر غير معرَّف يجعل
   الخاصّية باطلة فيرث النصّ لون أبيه. نعطيه قيمة الورقة المقصودة، وهنا وحدها. */
.content.affiliates { --text-light: var(--place-color); }
.content.affiliates > .container { width: 100%; }
.content.affiliates .alert { margin-bottom: 18px; }
.content.affiliates .card .alert { margin: 16px 0 0; }
.content.affiliates .alert.alert-warning {
  position: relative;
  background: linear-gradient(135deg, #f59e0b, #fbbf24);
  color: #fff;
  border: none;
  border-radius: 16px;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  font-size: 13px;
}

/* شريط التقدّم: التصميم الأصلي حلقة ثابتة على 100% لا تقابل أي رقم؛ هذا مربوط
   بـ‎$pct‎ — نسبة المتاح إلى الحدّ الأدنى للسحب. */
.content.affiliates .aff-progress { margin-top: 18px; }
.content.affiliates .aff-progress-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
  font-size: 13px;
  font-weight: 700;
  color: var(--text-main);
}
.content.affiliates .aff-progress-pct { color: var(--main-color); font-weight: 900; }
.content.affiliates .aff-progress-track {
  height: 10px;
  border-radius: 999px;
  overflow: hidden;
  background: var(--bg-color);
  border: 1px solid var(--border-color);
}
.content.affiliates .aff-progress-fill {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: var(--main-color);
  transition: width .35s ease;
}

/* نموذج طلب السحب — لا نموذج في هذه الورقة خارج الجداول */
.content.affiliates .aff-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 18px;
}
.content.affiliates .aff-field { display: flex; flex-direction: column; gap: 8px; }
.content.affiliates .aff-field label {
  font-size: 13px;
  font-weight: 900;
  color: var(--text-main);
  opacity: .95;
}
.content.affiliates .aff-field input {
  width: 100%;
  height: 50px;
  box-sizing: border-box;
  padding: 0 14px;
  border-radius: 16px;
  border: 1px solid var(--border-color);
  background: var(--bg-color);
  color: var(--text-main);
  outline: 0;
  transition: .25s ease;
}
.content.affiliates .aff-field input:focus { border-color: var(--main-color); }
.content.affiliates .aff-submit {
  align-self: flex-start;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 22px;
  border: none;
  border-radius: 14px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 900;
  background: var(--main-color);
  color: #fff;
  box-shadow: 0 10px 22px var(--main-opacity);
  transition: .25s ease;
}
.content.affiliates .aff-submit:hover { transform: translateY(-2px); }
.content.affiliates .aff-note {
  margin: 10px 0 0;
  font-size: 13px;
  line-height: 1.9;
  color: var(--place-color);
}
.content.affiliates .table .status-badge { white-space: nowrap; }
.content.affiliates .table .money .os-price { color: inherit; font: inherit; }

@media (max-width: 576px) {
  .content.affiliates .aff-submit { align-self: stretch; justify-content: center; }
}

/* ===================================================================
   ٣) اللوحة الفرعية — .content.childpanel-create
   =================================================================== */

/* الورقة تبني شريط التبويبات على عمودين (‎grid-template-columns:1fr 1fr‎)
   والصفحة عندها ثلاثة: الطلب، وحالة المتجر، والمعلومات. */
.content.childpanel-create .tabs-header { grid-template-columns: repeat(3, 1fr); }

/* ‎.childpanel-create .welcome-box‎ في الورقة أرضيّتها ‎--main-color‎ بـ
   ‎!important‎، و‎--text-main‎ أسودُ في الوضع المضيء فيختفي النصّ على الأحمر. */
.content.childpanel-create .welcome-box,
.content.childpanel-create .welcome-box h2,
.content.childpanel-create .welcome-box p { color: #fff; }

/* تسمية حقل النموذج: محدِّد الورقة مكتوب ‎.childpanel-createi .store-field label‎
   بحرف زائد فلا يطابق شيئًا خارج استعلام الجوال. */
.content.childpanel-create .store-field label {
  font-size: 13px;
  font-weight: 900;
  color: var(--text-main);
  opacity: .95;
}
.content.childpanel-create .store-field .cp-hint {
  margin: 2px 0 0;
  font-size: 12px;
  line-height: 1.7;
  font-weight: 400;
  color: var(--place-color);
}

/* حقلان لاتينيّان داخل صفحة عربية — بلا سمة ‎dir‎ مكتوبة في الترميز */
.content.childpanel-create .cp-ltr { direction: ltr; text-align: start; }

/* السعر عرضٌ لا حقل: الورقة تلوّن ‎.price-value‎ ولا تعطيه صندوق الحقل، وهو في
   القالب ‎<input readonly>‎ — وعندنا ‎.os-price‎ لتتبع تبديل العملة. */
.content.childpanel-create .store-field .price-value {
  display: flex;
  align-items: center;
  height: 50px;
  padding: 0 14px;
  border-radius: 16px;
  border: 1px solid var(--border-color);
  background: var(--bg-color);
}

/* حالة الفراغ في تبويب «حالة المتجر» */
.content.childpanel-create .cp-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 34px 15px;
  text-align: center;
  font-size: 14px;
  color: var(--text-main);
  opacity: .75;
}
.content.childpanel-create .cp-empty i { font-size: 34px; color: var(--main-color); opacity: .8; }

/* شارات الحالة: الورقة تعرّف ‎.childpanels-table .status-badge‎ محايدة بلا ألوان */
.content.childpanel-create .childpanels-table .status-badge { gap: 6px; white-space: nowrap; }
.content.childpanel-create .childpanels-table .status-badge.cp-st-ok   { background: rgba(34,197,94,.14);  color: #86efac; border-color: rgba(34,197,94,.35); }
.content.childpanel-create .childpanels-table .status-badge.cp-st-wait { background: rgba(245,158,11,.14); color: #fcd34d; border-color: rgba(245,158,11,.35); }
.content.childpanel-create .childpanels-table .status-badge.cp-st-bad  { background: rgba(239,68,68,.14);  color: #fca5a5; border-color: rgba(239,68,68,.35); }
.content.childpanel-create .childpanels-table .status-badge.cp-st-mid  { background: rgba(59,130,246,.14); color: #93c5fd; border-color: rgba(59,130,246,.35); }

/* عمود الإجراء: الورقة تثبّته على 120px، وزرّ التجديد يحمل السعر معه */
.content.childpanel-create .childpanels-table .actions { width: auto; white-space: nowrap; }
.content.childpanel-create .cp-renew { margin: 0; }
.content.childpanel-create .cp-renew .btn-sm { display: inline-flex; align-items: center; gap: 6px; }
.content.childpanel-create .cp-static { display: inline-flex; cursor: default; }
.content.childpanel-create .cp-id { cursor: pointer; }

/* نصوص الأكورديون: الورقة تعطي ‎ul‎ هامشًا بلا نقاط ولا ترقيم، ولا تعرّف ‎h4‎ */
.content.childpanel-create .accordion-body ul.cp-list { list-style: disc; }
.content.childpanel-create .accordion-body ul.cp-list.num { list-style: decimal; }
.content.childpanel-create .accordion-body ul.cp-list li {
  margin: 8px 0;
  font-size: 14px;
  line-height: 1.9;
  color: var(--text-main);
}
.content.childpanel-create .accordion-body h4 {
  margin: 14px 0 4px;
  font-size: 14px;
  font-weight: 900;
  color: var(--text-main);
}
.content.childpanel-create .accordion-body h4:first-child { margin-top: 0; }
.content.childpanel-create .accordion-body p + h4 { margin-top: 16px; }
.content.childpanel-create .accordion-header .icon { flex: 0 0 auto; }
.content.childpanel-create .alert { margin-bottom: 18px; }

@media (max-width: 768px) {
  /* استعلام الورقة يردّ الشريط إلى عمود واحد؛ قاعدتنا أعلاه بلا استعلام
     فكانت ستغلبه — نكرّرها هنا بالحدّ نفسه. */
  .content.childpanel-create .tabs-header { grid-template-columns: 1fr; }
}
