/* modal.css — تصميم موحّد لكل النوافذ المنبثقة في الموقع.
   المرجع: نافذة "اضافة رصيد" (بطاقة كحلية داكنة، حقول بحواف دائرية، زر حفظ بنفسجي).
   الألوان مأخوذة من لقطة الشاشة. النافذة داكنة دائماً بغض النظر عن وضع الصفحة (فاتح/ليلي).
   الصنف الأساسي: dialog.nxd  — وبقية الأصناف .nxd-* أدناه. أي نافذة جديدة تستخدمها فقط. */

/* لوحتان: فاتحة (الافتراضي للأدمن) وداكنة. تتبع وضع الموقع:
   الأدمن: html[data-theme=dark]  |  الزبون: افتراضي داكن، و html.sc-light فاتح */
dialog.nxd {
  --nx-card: #ffffff; --nx-line: #dcdcea; --nx-fill: #f4f4fb; --nx-edge: #c6c7da;
  --nx-ring: #cfcdf3; --nx-focus: #6b5ce0; --nx-ink: #313154; --nx-mute: #6b6d8a;
  --nx-sel: #f4f4fb; --nx-sw-off: #cfd0e0; --nx-knob-off: #9a9cb8; --nx-sw-on: #d9d5fb; --nx-knob-on: #6b5ce0;
  --nx-shadow: 0 24px 60px rgba(40, 40, 90, .22);
  --nx-caret: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='8' viewBox='0 0 14 8'%3E%3Cpath d='M0 0h14L7 8z' fill='%23313154'/%3E%3C/svg%3E");
}
html[data-theme=dark] dialog.nxd {
  --nx-card: #1b1e31; --nx-line: #3d3f58; --nx-fill: #2c2e43; --nx-edge: #4f5265;
  --nx-ring: #3f3e80; --nx-focus: #7a70e6; --nx-ink: #e6e7ee; --nx-mute: #9a9cb8;
  --nx-sel: #2d2f44; --nx-sw-off: #3a3a55; --nx-knob-off: #8a8aa6; --nx-sw-on: #414177; --nx-knob-on: #5b58a5;
  --nx-shadow: 0 24px 60px rgba(0, 0, 0, .5);
  --nx-caret: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='8' viewBox='0 0 14 8'%3E%3Cpath d='M0 0h14L7 8z' fill='%23e6e7ee'/%3E%3C/svg%3E");
}
dialog.nxd {
  box-sizing: border-box;
  width: min(92vw, 440px);
  max-height: 90vh;
  overflow: auto;
  margin: auto;
  padding: 26px 24px 20px;
  border: 1px solid var(--nx-line);
  border-radius: 28px;
  background: var(--nx-card);
  color: var(--nx-ink);
  direction: rtl;
  text-align: right;
  font-family: Tajawal, sans-serif;
  box-shadow: var(--nx-shadow);
}
dialog.nxd::backdrop { background: rgba(30, 30, 60, .4); backdrop-filter: blur(2px); }
html[data-theme=dark] dialog.nxd::backdrop { background: rgba(12, 12, 30, .66); }
dialog.nxd *, dialog.nxd *::before, dialog.nxd *::after { box-sizing: border-box; }
dialog.nxd form { margin: 0; }
dialog.nxd [hidden] { display: none !important; }

/* العنوان والنصوص */
.nxd-t { margin: 0 4px 26px; font-size: 26px; font-weight: 700; line-height: 1.3; color: var(--nx-ink); }
.nxd-t + .nxd-p { margin-top: -12px; }
.nxd-p { margin: 0 4px 22px; font-size: 16px; line-height: 1.8; color: var(--nx-mute); }
.nxd-p b { color: var(--nx-ink); }
.nxd-info { margin: 0 4px 28px; font-size: 16px; line-height: 1.6; color: var(--nx-ink); }

/* حقل بحواف دائرية وعنوان عائم على الحد */
.nxd-f { position: relative; display: block; margin: 0 0 24px; }
.nxd-f input, .nxd-f select {
  display: block; width: 100%; height: 56px; padding: 0 24px;
  border: 2px solid var(--nx-ring); border-radius: 28px;
  background: var(--nx-fill); color: var(--nx-ink);
  font: inherit; font-size: 17px; outline: 0; transition: border-color .2s;
}
.nxd-f input:focus, .nxd-f select:focus { border-color: var(--nx-focus); }
.nxd-f > span {
  position: absolute; top: -11px; inset-inline-end: 26px; padding: 0 7px;
  font-size: 13px; line-height: 20px; color: var(--nx-mute);
  background: linear-gradient(to bottom, var(--nx-card) 50%, var(--nx-fill) 50%);
  pointer-events: none; transition: all .18s;
}
.nxd-f:focus-within > span { color: var(--nx-focus); }
/* حقل فارغ وغير مُفعَّل: العنوان داخل الحقل */
.nxd-f input:placeholder-shown:not(:focus) + span {
  top: 17px; font-size: 16px; background: none; color: var(--nx-mute);
}
.nxd-f input[type=date] { text-align: right; }
.nxd-f input[type=number] { -moz-appearance: textfield; }

/* قائمة منسدلة على شكل حبة */
.nxd-f select, .nxd-sel select {
  appearance: none; -webkit-appearance: none; cursor: pointer;
  padding-inline-start: 24px; padding-inline-end: 50px;
  background-image: var(--nx-caret);
  background-repeat: no-repeat; background-position: left 26px center; background-size: 14px 8px;
}
.nxd-sel { display: block; margin: 0 0 24px; }
.nxd-sel select {
  display: block; width: 100%; height: 56px;
  border: 1px solid var(--nx-edge); border-radius: 28px;
  background-color: var(--nx-sel); color: var(--nx-ink); font: inherit; font-size: 17px; outline: 0;
}
.nxd-sel select:focus { border-color: var(--nx-focus); }
.nxd dialog select option, dialog.nxd option { background: var(--nx-card); color: var(--nx-ink); }

/* مفتاح تشغيل/إيقاف */
.nxd-sw { position: relative; display: flex; align-items: center; gap: 14px; margin: 4px 8px 26px; font-size: 20px; color: var(--nx-ink); cursor: pointer; width: max-content; }
.nxd-sw input { position: absolute; opacity: 0; width: 0; height: 0; }
.nxd-sw i { position: relative; flex: none; width: 50px; height: 20px; border-radius: 10px; background: var(--nx-sw-off); transition: background .2s; }
.nxd-sw i::after {
  content: ""; position: absolute; top: -4px; inset-inline-start: -2px;
  width: 28px; height: 28px; border-radius: 50%; background: var(--nx-knob-off);
  box-shadow: 0 2px 4px rgba(0, 0, 0, .3); transition: inset-inline-start .2s, background .2s;
}
.nxd-sw input:checked + i { background: var(--nx-sw-on); }
.nxd-sw input:checked + i::after { inset-inline-start: 24px; background: var(--nx-knob-on); }
.nxd-sw input:focus-visible + i { outline: 2px solid var(--nx-focus); outline-offset: 4px; }

/* منطقة نص كبيرة */
.nxd-ta { display: block; width: 100%; min-height: 190px; margin: 0 0 26px; padding: 16px 24px; border: 1px solid var(--nx-edge); border-radius: 28px; background: var(--nx-fill); color: var(--nx-ink); font: inherit; font-size: 17px; resize: vertical; outline: 0; }
.nxd-ta::placeholder { color: var(--nx-ink); opacity: .9; }
.nxd-ta:focus { border-color: var(--nx-focus); }

/* صف بحقلين */
.nxd-row { display: flex; gap: 12px; }
.nxd-row > * { flex: 1; min-width: 0; }

/* الأزرار */
.nxd-acts { display: flex; flex-direction: column; gap: 8px; margin-top: 6px; }
.nxd-b {
  display: inline-flex; align-items: center; justify-content: center;
  width: 100%; height: 64px; padding: 0 20px; border: 0; border-radius: 32px;
  background: linear-gradient(90deg, #6b16e1, #7d22e1); color: #fff;
  font: inherit; font-size: 20px; font-weight: 500; cursor: pointer;
  transition: filter .15s, transform .05s;
}
.nxd-b:hover { filter: brightness(1.1); }
.nxd-b:active { transform: scale(.99); }
.nxd-b:focus-visible { outline: 2px solid var(--nx-focus); outline-offset: 3px; }
.nxd-b.error { background: linear-gradient(90deg, #c62839, #e04a5a); }
.nxd-b.warning { background: linear-gradient(90deg, #d98a00, #fea500); }
.nxd-b.success { background: linear-gradient(90deg, #3d9a41, #4caf50); }
.nxd-b.flat { height: 46px; background: none; color: var(--nx-mute); font-size: 16px; }
.nxd-b.flat:hover { color: var(--nx-ink); filter: none; }
.nxd-b[disabled] { opacity: .5; cursor: default; pointer-events: none; }

/* ---- حقلا «العدد» و«الاجمالي» في نافذة الشراء: نفس ارتفاع وشكل بقية الحقول (Vuetify dense)، والنص في الوسط، ويظهران بوضوح في الفاتح والداكن ---- */
#buy-root .center-input input{text-align:center;opacity:1;direction:ltr;unicode-bidi:plaintext}
#buy-root .center-input input[type=number]{-moz-appearance:textfield}
html.sc-light #buy-root .center-input input{color:rgba(0,0,0,.87)!important;-webkit-text-fill-color:rgba(0,0,0,.87)}
html.sc-light #buy-root .center-input .v-label{color:rgba(0,0,0,.6)!important}
html:not(.sc-light) #buy-root .center-input input{color:#fff!important;-webkit-text-fill-color:#fff}

/* ---- قائمة الكميات: تفتح فوق الحقل نفسه (مثل الموقع المرجعي)، قابلة للتمرير، وفاتحة في الوضع الفاتح ---- */
#buy-root [data-select-menu]{max-height:300px;overflow-y:auto;border-radius:4px;box-shadow:0 5px 5px -3px rgba(0,0,0,.2),0 8px 10px 1px rgba(0,0,0,.14),0 3px 14px 2px rgba(0,0,0,.12)}
#buy-root [data-select-menu] .v-list-item{min-height:48px}
html.sc-light #buy-root [data-select-menu],html.sc-light #buy-root [data-select-menu] .v-list{background:#e0e0e0!important}
html.sc-light #buy-root [data-select-menu] .v-list-item__title{color:rgba(0,0,0,.87)!important}
html.sc-light #buy-root [data-select-menu] .v-list-item--active{background:rgba(0,0,0,.14)}
html:not(.sc-light) #buy-root [data-select-menu] .v-list-item--active{background:rgba(255,255,255,.16)}
