/* ==========================================================================
   تِم — ألوان الهوية (تركواز الخليج) فوق ثيم Vuexy
   التركوازي #0E7C7B  ·  الذهبي الرملي #E9B949  ·  التركوازي الداكن #073B3A  (أسماء المتغيرات mw-blue/mw-lime باقية للتوافق)
   ========================================================================== */

:root,
[data-bs-theme=light],
[data-bs-theme=dark] {
  --mw-blue: #0E7C7B;
  --mw-blue-dark: #0A5C5B;
  --mw-lime: #E9B949;
  --mw-navy: #073B3A;
  --mw-gradient: linear-gradient(135deg, #0E7C7B 0%, #0A5C5B 100%);

  --bs-primary: #0E7C7B;
  --bs-primary-rgb: 14, 124, 123;
  --bs-primary-bg-subtle: color-mix(in sRGB, var(--bs-paper-bg) 84%, #0E7C7B);
  --bs-primary-border-subtle: rgba(14, 124, 123, 0.39);
  --bs-primary-contrast: #fff;

  --bs-font-sans-serif: "IBM Plex Sans Arabic", "Public Sans", -apple-system, "Segoe UI", sans-serif;
}

body { font-feature-settings: "ss01"; }

/* القائمة الجانبية: العنصر النشط بتدرج اللوجو */
.menu-item.active > .menu-link:not(.menu-toggle),
:dir(rtl) .menu-item.active > .menu-link:not(.menu-toggle) {
  background: var(--mw-gradient);
  box-shadow: 0 0.25rem 0.75rem 0 rgba(14, 124, 123, 0.3);
}
.menu-item.active > .menu-link:not(.menu-toggle) .menu-icon { color: var(--mw-lime); }
/* اللوجو في القائمة */
.app-brand-logo.mw-logo img { width: 34px; height: 34px; border-radius: 9px; object-fit: contain; }
.app-brand-text.mw-brand-text { font-size: 1.4rem; font-weight: 700; letter-spacing: 0; color: var(--bs-heading-color); }

/* أزرار بالتدرج */
.btn-gradient {
  background: var(--mw-gradient);
  color: #fff;
  border: 0;
  box-shadow: 0 0.25rem 0.75rem rgba(14, 124, 123, 0.3);
}
.btn-gradient:hover, .btn-gradient:focus { color: #fff; filter: brightness(0.95); }

.text-brand { color: var(--mw-blue) !important; }
.bg-brand-lime { background: var(--mw-lime) !important; color: var(--mw-navy) !important; }

/* صفحة الدخول */
.mw-auth-cover {
  background: var(--mw-gradient);
  position: relative;
  overflow: hidden;
}
.mw-auth-cover::before,
.mw-auth-cover::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  border: 26px solid rgba(233, 185, 73, 0.22);
}
.mw-auth-cover::before { width: 520px; height: 520px; inset-inline-start: -140px; top: -160px; }
.mw-auth-cover::after { width: 380px; height: 380px; inset-inline-end: -100px; bottom: -120px; }

/* صفحة الإعدادات */
.mw-settings-nav { position: sticky; top: 6rem; }
.mw-settings-nav .nav-link { display: flex; align-items: center; gap: .5rem; border-radius: .5rem; }
.mw-settings-nav .nav-link.active { background: var(--mw-gradient); color: #fff; }
.mw-settings-nav .nav-link.active .icon-base { color: var(--mw-lime); }
.mw-section { scroll-margin-top: 6rem; }
.mw-switch-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; padding: .85rem 0; border-bottom: 1px dashed var(--bs-border-color); }
.mw-switch-row:last-child { border-bottom: 0; }
.mw-switch-row .form-switch { margin: 0; padding: 0; min-height: auto; }
.mw-switch-row .form-switch .form-check-input { margin: 0; float: none; width: 2.6em; height: 1.4em; }
.mw-gateway { border: 1px solid var(--bs-border-color); border-radius: .75rem; transition: border-color .2s, box-shadow .2s; }
.mw-gateway.is-active { border-color: var(--mw-blue); box-shadow: 0 0 0 3px rgba(14, 124, 123, .12); }
.mw-logo-preview { width: 96px; height: 96px; object-fit: contain; border-radius: 1rem; border: 1px dashed var(--bs-border-color); padding: .5rem; background: var(--bs-body-bg); }
.mw-save-bar {
  position: sticky; bottom: 0; z-index: 10;
  background: color-mix(in sRGB, var(--bs-paper-bg) 92%, transparent);
  backdrop-filter: blur(6px);
  border-top: 1px solid var(--bs-border-color);
}
.mw-var { font-family: ui-monospace, monospace; font-size: .8rem; cursor: pointer; }

/* إحصائيات لوحة التحكم */
.mw-stat-icon { width: 46px; height: 46px; border-radius: .75rem; display: inline-flex; align-items: center; justify-content: center; }

/* صفحة الدخول: ملء الشاشة */
.authentication-cover .authentication-inner { min-height: 100vh; }
.authentication-cover .authentication-inner > [class*="col-"] { min-height: 100vh; }
.mw-unread { background: rgba(var(--bs-primary-rgb), .06); }

/* اختيار بوابة الدفع */
.mw-gateway-picker { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: .75rem; }
.mw-gateway-tab { display: flex; flex-direction: column; align-items: center; gap: .4rem; padding: .85rem .75rem; border: 1px solid var(--bs-border-color); border-radius: .75rem; background: var(--bs-paper-bg); color: var(--bs-heading-color); transition: border-color .15s, box-shadow .15s; }
.mw-gateway-tab:hover { border-color: rgba(14, 124, 123, .5); }
.mw-gateway-tab.is-open { border-color: var(--mw-blue); box-shadow: 0 0 0 3px rgba(14, 124, 123, .12); }
.mw-gateway-tab .badge { font-size: .7rem; }

/* خانة الهاتف: كود الدولة + الرقم */
.mw-phone .mw-phone-code { flex: 0 0 auto; width: 120px; min-width: 108px; max-width: 130px; padding-inline-end: 2rem; }
/* Select2 جوه الـ input-group (الخانة دايماً LTR: الكود شمال والرقم يمين) */
.mw-phone { flex-wrap: nowrap; }
.mw-phone > .select2-container { flex: 0 0 auto; width: 122px !important; }
.mw-phone > .select2-container .select2-selection { height: 100%; min-height: calc(1.625em + .9rem + 2px); display: flex; align-items: center; border-start-end-radius: 0 !important; border-end-end-radius: 0 !important; }
.mw-phone > .select2-container .select2-selection__rendered { padding-inline-start: .75rem !important; line-height: 1.5 !important; }
.mw-phone > .select2-container + .form-control { border-start-start-radius: 0; border-end-start-radius: 0; margin-inline-start: -1px; }
.mw-phone > .select2-container--focus .select2-selection, .mw-phone > .select2-container--open .select2-selection { border-color: var(--bs-primary) !important; }
.mw-phone .mw-phone-code.is-invalid + .select2-container .select2-selection { border-color: var(--bs-form-invalid-border-color, #ff4c51) !important; }
.mw-phone-opt { display: inline-flex; align-items: center; gap: .45rem; white-space: nowrap; }
.mw-phone-flag { font-size: 1.15em; line-height: 1; }
.mw-phone-dial { font-weight: 500; }
.mw-phone-name { color: var(--bs-secondary-color); font-size: .9em; }
.select2-dropdown.mw-phone-dropdown { width: 270px !important; max-width: calc(100vw - 24px); }
.mw-phone-dropdown .mw-phone-name { margin-left: auto; padding-left: .75rem; }
.mw-phone-dropdown .mw-phone-opt { display: flex; width: 100%; }
.mw-phone-dropdown .select2-results__options { max-height: 280px; }
