/* بوابة مسوقي راز: هوية راز (الأخضر #004339 والذهبي #C9A86D وخط IBM Plex Sans Arabic).
   خارج حزم أودو، والخصائص منطقية (inline-start/end) فتعمل الصفحة بالاتجاهين دون rtlcss. */
@font-face { font-family: "RazPlex"; font-weight: 400; font-display: swap; src: url(../../fonts/ibm-plex-sans-arabic-400.woff2) format("woff2"); }
@font-face { font-family: "RazPlex"; font-weight: 500; font-display: swap; src: url(../../fonts/ibm-plex-sans-arabic-500.woff2) format("woff2"); }
@font-face { font-family: "RazPlex"; font-weight: 600; font-display: swap; src: url(../../fonts/ibm-plex-sans-arabic-600.woff2) format("woff2"); }
@font-face { font-family: "RazPlex"; font-weight: 700; font-display: swap; src: url(../../fonts/ibm-plex-sans-arabic-700.woff2) format("woff2"); }
@font-face { font-family: "RazPlex"; font-weight: 400; font-display: swap; src: url(../../fonts/ibm-plex-sans-arabic-400-latin.woff2) format("woff2"); unicode-range: U+0000-00FF, U+2000-206F; }
@font-face { font-family: "RazPlex"; font-weight: 500; font-display: swap; src: url(../../fonts/ibm-plex-sans-arabic-500-latin.woff2) format("woff2"); unicode-range: U+0000-00FF, U+2000-206F; }
@font-face { font-family: "RazPlex"; font-weight: 600; font-display: swap; src: url(../../fonts/ibm-plex-sans-arabic-600-latin.woff2) format("woff2"); unicode-range: U+0000-00FF, U+2000-206F; }
@font-face { font-family: "RazPlex"; font-weight: 700; font-display: swap; src: url(../../fonts/ibm-plex-sans-arabic-700-latin.woff2) format("woff2"); unicode-range: U+0000-00FF, U+2000-206F; }

:root {
  --mp-green: #00433A; --mp-deep: #0D4F43; --mp-deep3: #08352E;
  --mp-emerald: #0F6B5A; --mp-emerald-50: #EEF6F3;
  --mp-gold: #C9A66B; --mp-gold-text: #8A6A33; --mp-gold-light: #D4B886;
  --mp-champ-100: #F3EAD8; --mp-champ-200: #E8D8B8;
  --mp-ivory: #FBFAF7; --mp-ink: #0A3F36; --mp-muted: #5B6F6A; --mp-line: #E8E2D6; --mp-line-soft: #F1ECE2;
  --mp-warn: #A15C07; --mp-warn-50: #FDF4E7; --mp-danger: #A93226; --mp-danger-50: #FDF0EE;
  --mp-ok: #1E6B45; --mp-ok-50: #E8F5EE;
  --mp-shadow: 0 10px 30px rgba(4, 31, 26, .08), 0 2px 6px rgba(4, 31, 26, .05);
  --mp-radius: 18px;
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body.mp-body { margin: 0; background: var(--mp-ivory); color: var(--mp-ink); font-family: "RazPlex", Tahoma, Arial, sans-serif; font-size: 15px; line-height: 1.6; }
.mp-body h1, .mp-body h2, .mp-body h3, .mp-body p { margin: 0; }
.mp-body a { color: var(--mp-emerald); text-decoration: none; }
.mp-body a:hover { text-decoration: underline; }
.mp-body button { font: inherit; }
.mp-body [hidden] { display: none !important; }
.mp-body :focus-visible { outline: 3px solid var(--mp-gold); outline-offset: 2px; }
.mp-num { font-variant-numeric: tabular-nums; direction: ltr; unicode-bidi: isolate; }
.mp-muted { color: var(--mp-muted); }
.mp-small { font-size: 13px; }
.mp-row { display: flex; align-items: center; gap: 10px; }
.mp-row--between { justify-content: space-between; }
.mp-row--wrap { flex-wrap: wrap; }
.mp-stack { display: grid; gap: 10px; margin-top: 18px; }
.mp-stack--narrow { max-width: 420px; }

/* ---------- الأزرار والحقول ---------- */
.mp-btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 44px; padding: 10px 18px; border-radius: 999px; border: 1px solid transparent; font-weight: 600; font-size: 14px; cursor: pointer; white-space: nowrap; text-decoration: none !important; transition: filter .15s, background .15s; }
.mp-btn:hover { filter: brightness(.96); }
.mp-btn:disabled { opacity: .55; cursor: default; }
.mp-btn--green { background: var(--mp-emerald); color: #fff !important; }
.mp-btn--gold { background: var(--mp-gold); color: var(--mp-deep3) !important; }
.mp-btn--ghost { background: #fff; border-color: var(--mp-line); color: var(--mp-ink) !important; }
.mp-btn--ghost-w { background: rgba(255,255,255,.08); border-color: rgba(255,255,255,.28); color: #fff !important; }
.mp-btn--danger { color: var(--mp-danger) !important; }
.mp-btn--sm { min-height: 36px; padding: 6px 14px; font-size: 13px; }
.mp-btn--icon { padding: 6px; width: 38px; }
.mp-btn--block { width: 100%; }
.mp-link { background: none; border: 0; padding: 6px 0; color: var(--mp-emerald); font-weight: 600; cursor: pointer; }
.mp-link:disabled { color: var(--mp-muted); cursor: default; font-weight: 500; }
.mp-label { display: block; font-size: 13px; font-weight: 600; color: var(--mp-gold-text); margin-bottom: 6px; }
.mp-input { width: 100%; min-height: 48px; border: 1px solid var(--mp-champ-200); background: var(--mp-ivory); border-radius: 12px; padding: 10px 14px; font: inherit; font-size: 16px; color: var(--mp-ink); }
.mp-input:focus { border-color: var(--mp-emerald); outline: none; box-shadow: 0 0 0 3px rgba(15,107,90,.15); }
.mp-input--ltr { direction: ltr; text-align: left; }
.mp-input--code { direction: ltr; text-align: center; letter-spacing: .5em; font-size: 24px; font-weight: 700; }
.mp-field { display: grid; gap: 4px; }
.mp-fields { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); margin: 14px 0; }
.mp-alert { border-radius: 12px; padding: 10px 14px; background: var(--mp-danger-50); color: var(--mp-danger); font-size: 14px; margin-bottom: 14px; }
.mp-note { display: flex; align-items: flex-start; gap: 8px; flex-wrap: wrap; border-radius: 14px; padding: 10px 14px; background: var(--mp-emerald-50); color: var(--mp-emerald); font-size: 13.5px; margin: 12px 0; }
.mp-note svg { flex: none; margin-top: 3px; }
.mp-note > span { flex: 1 1 200px; }
.mp-note--warn { background: var(--mp-warn-50); color: var(--mp-warn); align-items: center; justify-content: space-between; }
.mp-note--ok { background: var(--mp-ok-50); color: var(--mp-ok); }
.mp-chip { display: inline-flex; align-items: center; gap: 5px; border-radius: 999px; padding: 3px 11px; font-size: 12px; font-weight: 600; white-space: nowrap; background: #F1F1EF; color: #6B6B66; }
.mp-chip--new { background: var(--mp-emerald-50); color: var(--mp-emerald); }
.mp-chip--wait { background: var(--mp-warn-50); color: var(--mp-warn); }
.mp-chip--done { background: var(--mp-ok-50); color: var(--mp-ok); }
.mp-chip--gold { background: var(--mp-champ-100); color: var(--mp-gold-text); }
.mp-chip--bad { background: var(--mp-danger-50); color: var(--mp-danger); }
.mp-lang { display: inline-flex; align-items: center; gap: 6px; color: #fff !important; font-size: 13px; font-weight: 600; padding: 6px 12px; border-radius: 999px; border: 1px solid rgba(255,255,255,.28); background: rgba(255,255,255,.06); }

/* ---------- البطاقات والقوائم ---------- */
.mp-card { background: #fff; border: 1px solid var(--mp-line); border-radius: var(--mp-radius); box-shadow: var(--mp-shadow); padding: 18px 20px; min-width: 0; }
.mp-card__title { display: flex; align-items: center; justify-content: space-between; gap: 10px; font-size: 16px; font-weight: 700; color: var(--mp-green); margin-bottom: 12px; }
.mp-card__title a { font-weight: 500; }
.mp-sub { font-size: 14px; font-weight: 700; color: var(--mp-green); margin: 16px 0 4px; }
.mp-empty { color: var(--mp-muted); padding: 8px 0; }
.mp-list { display: grid; }
.mp-item { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--mp-line-soft); min-width: 0; }
.mp-item:last-child { border-bottom: 0; }
.mp-item__main { flex: 1; min-width: 0; }
.mp-item__main b { display: block; overflow-wrap: anywhere; }
.mp-item__end { display: grid; justify-items: end; gap: 4px; }
.mp-amount { color: var(--mp-gold-text); white-space: nowrap; }
.mp-amount small { font-size: 11px; color: var(--mp-muted); }
.mp-dot { width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; flex: none; background: var(--mp-emerald-50); color: var(--mp-emerald); font-weight: 700; }
.mp-dot--gold { background: var(--mp-champ-100); color: var(--mp-gold-text); }
.mp-grid { display: grid; gap: 16px; margin-bottom: 16px; }
.mp-stats { display: grid; grid-template-columns: repeat(3, 1fr); text-align: center; gap: 8px; margin-top: 16px; }
.mp-stats b { display: block; font-size: 24px; color: var(--mp-green); }
.mp-stats span { font-size: 12.5px; color: var(--mp-muted); line-height: 1.4; display: block; }
.mp-linkbox { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; background: var(--mp-emerald-50); border: 1px solid var(--mp-emerald-50); border-radius: 14px; padding: 10px 12px; }
.mp-linkbox__url { flex: 1 1 160px; font-weight: 600; text-align: start; overflow-wrap: anywhere; color: var(--mp-ink); }
.mp-meter { padding: 10px 0; border-bottom: 1px solid var(--mp-line-soft); }
.mp-meter__bar { height: 8px; border-radius: 99px; background: var(--mp-emerald-50); overflow: hidden; margin-top: 8px; }
.mp-meter__bar i { display: block; height: 100%; min-width: 4px; border-radius: 99px; background: linear-gradient(90deg, var(--mp-emerald), #227F6C); }
.mp-kpis { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); margin-bottom: 16px; }
.mp-kpi { display: grid; gap: 2px; }
.mp-kpi span { color: var(--mp-muted); font-size: 13px; }
.mp-kpi b { font-size: 28px; color: var(--mp-green); }
.mp-kpi small { color: var(--mp-muted); font-size: 12px; }
.mp-kpi--money b { color: var(--mp-gold-text); }
.mp-seg { display: inline-flex; background: #fff; border: 1px solid var(--mp-line); border-radius: 999px; padding: 4px; margin-bottom: 14px; }
.mp-seg__item { padding: 8px 20px; border-radius: 999px; color: var(--mp-muted) !important; font-weight: 600; text-decoration: none !important; }
.mp-seg__item.is-on { background: var(--mp-emerald); color: #fff !important; }
.mp-search { display: flex; gap: 8px; margin-bottom: 14px; }
.mp-search .mp-btn { flex: none; width: 48px; padding: 0; }
.mp-qr { text-align: center; align-self: start; }
.mp-pageurl { margin: 10px 0 0; }
.mp-list--compact .mp-item { padding: 8px 0; }
.mp-qr img { width: 240px; height: 240px; max-width: 100%; border-radius: 12px; border: 1px solid var(--mp-line); padding: 8px; background: #fff; }
.mp-dl { margin: 0 0 12px; display: grid; }
.mp-dl div { display: flex; justify-content: space-between; gap: 16px; padding: 11px 0; border-bottom: 1px solid var(--mp-line-soft); }
.mp-dl dt { color: var(--mp-muted); }
.mp-dl dd { margin: 0; font-weight: 600; text-align: end; }

/* ---------- الإطار بعد الدخول (الجوال أولاً) ---------- */
.mp-shell { min-height: 100vh; }
.mp-side { display: none; }
.mp-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 16px; padding-top: max(14px, env(safe-area-inset-top)); background: linear-gradient(135deg, var(--mp-deep3), var(--mp-green)); }
.mp-bar__brand img { height: 30px; display: block; }
.mp-banner { display: flex; align-items: center; gap: 8px; margin: 12px 16px 0; padding: 10px 14px; border-radius: 14px; background: var(--mp-warn-50); color: var(--mp-warn); font-size: 14px; }
.mp-banner svg { flex: none; }
.mp-content { padding: 16px 16px calc(96px + env(safe-area-inset-bottom)); max-width: 1180px; }
.mp-tabs { position: fixed; inset-inline: 0; bottom: 0; z-index: 10; display: grid; grid-template-columns: repeat(5, 1fr); background: #fff; border-top: 1px solid var(--mp-line); padding: 6px 4px calc(6px + env(safe-area-inset-bottom)); }
.mp-tabs__item { display: grid; justify-items: center; gap: 2px; padding: 6px 2px; font-size: 11.5px; color: var(--mp-muted) !important; text-decoration: none !important; }
.mp-tabs__item.is-on { color: var(--mp-emerald) !important; font-weight: 700; }
.mp-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.mp-head h1 { font-size: 22px; font-weight: 700; color: var(--mp-green); }
.mp-me { display: none; align-items: center; gap: 10px; background: #fff; border: 1px solid var(--mp-line); border-radius: 999px; padding: 5px 14px 5px 6px; }
[dir="rtl"] .mp-me { padding: 5px 6px 5px 14px; }
.mp-me__text { display: grid; line-height: 1.3; }
.mp-me__text small { color: var(--mp-muted); font-size: 12px; }
.mp-me__av { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; background: var(--mp-champ-100); color: var(--mp-gold-text); font-weight: 700; order: -1; }
[dir="rtl"] .mp-me__av { order: 1; }

/* «اليوم» على الجوال: الترحيب على الأخضر وبطاقة الأرباح تتداخل معه */
.mp-hello { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: -16px -16px 0; padding: 4px 16px 64px; background: linear-gradient(135deg, var(--mp-deep3), var(--mp-green)); color: #fff; border-radius: 0 0 26px 26px; }
.mp-hello h1 { font-size: 21px; font-weight: 700; }
.mp-hello__sub { color: var(--mp-gold-light); font-size: 13.5px; }
.mp-hero { position: relative; overflow: hidden; color: #fff; border: 0; background: linear-gradient(135deg, var(--mp-deep3) 0%, var(--mp-green) 60%, var(--mp-deep) 100%); margin-top: -50px; }
.mp-hero::after { content: ""; position: absolute; inset-inline-start: -40px; bottom: -70px; width: 220px; height: 220px; border-radius: 50%; border: 30px solid rgba(201,166,107,.16); pointer-events: none; }
.mp-hero .mp-card__title { color: #fff; }
.mp-hero__grid { position: relative; z-index: 1; display: grid; grid-template-columns: 1fr 1fr; gap: 14px 12px; margin-bottom: 14px; }
.mp-hero__main { grid-column: 1 / -1; }
.mp-hero__label { color: rgba(255,255,255,.75); font-size: 12.5px; }
.mp-hero__value { font-size: 34px; font-weight: 700; color: var(--mp-gold-light); line-height: 1.25; }
.mp-hero__value small { font-size: 14px; }
.mp-hero__value--sm { font-size: 22px; color: #fff; }
.mp-hero__note { position: relative; z-index: 1; font-size: 12.5px; color: rgba(255,255,255,.85); margin-bottom: 12px; }
.mp-hero .mp-btn { position: relative; z-index: 1; }

/* ---------- الدخول ---------- */
.mp-login { min-height: 100vh; }
.mp-login__top { background: linear-gradient(135deg, var(--mp-deep3), var(--mp-green)); color: #fff; text-align: center; padding: 18px 18px 96px; padding-top: max(18px, env(safe-area-inset-top)); border-radius: 0 0 28px 28px; }
.mp-login__bar { display: flex; align-items: center; justify-content: space-between; max-width: 460px; margin: 0 auto 26px; }
.mp-login__logo img { height: 40px; display: block; }
.mp-login__top h1 { font-size: 22px; font-weight: 700; }
.mp-login__top p { color: var(--mp-gold-light); font-size: 14px; max-width: 420px; margin: 6px auto 0; }
.mp-login__body { max-width: 460px; margin: -66px auto 0; padding: 0 16px 40px; }
.mp-login__card { padding: 24px 22px; }
.mp-step { display: grid; gap: 12px; }
.mp-login__join { text-align: center; color: var(--mp-muted); font-size: 14px; margin-top: 18px; }
.mp-login__join a { font-weight: 600; }

/* ---------- الشاشة الواسعة: شريط جانبي ---------- */
@media (min-width: 960px) {
  .mp-shell { display: grid; grid-template-columns: 260px minmax(0, 1fr); }
  .mp-side { display: flex; flex-direction: column; gap: 6px; position: sticky; top: 0; height: 100vh; padding: 22px 16px; color: #fff; background: linear-gradient(180deg, var(--mp-deep3) 0%, var(--mp-green) 100%); }
  .mp-brand { display: flex; align-items: center; gap: 12px; padding: 4px 8px 18px; margin-bottom: 10px; border-bottom: 1px solid rgba(255,255,255,.12); color: #fff !important; text-decoration: none !important; }
  .mp-brand__logo { height: 34px; }
  .mp-brand__text { display: grid; line-height: 1.35; }
  .mp-brand__text small { color: var(--mp-gold-light); font-size: 11.5px; }
  .mp-nav { display: grid; gap: 4px; }
  .mp-nav__item { display: flex; align-items: center; gap: 12px; padding: 11px 14px; border-radius: 12px; color: rgba(255,255,255,.82) !important; font-weight: 500; text-decoration: none !important; }
  .mp-nav__item:hover { background: rgba(255,255,255,.06); }
  .mp-nav__item.is-on { background: rgba(255,255,255,.1); color: #fff !important; box-shadow: inset 3px 0 0 var(--mp-gold); }
  [dir="rtl"] .mp-nav__item.is-on { box-shadow: inset -3px 0 0 var(--mp-gold); }
  .mp-side__foot { margin-top: auto; padding: 14px; border-radius: 14px; background: rgba(255,255,255,.06); font-size: 13px; }
  .mp-side__muted { color: rgba(255,255,255,.72); margin-top: 4px; }
  .mp-bar { background: transparent; justify-content: flex-end; padding: 18px 32px 0; }
  .mp-bar__brand { display: none; }
  .mp-lang { color: var(--mp-ink) !important; border-color: var(--mp-line); background: #fff; }
  .mp-banner { margin: 12px 32px 0; }
  .mp-content { padding: 16px 32px 40px; }
  .mp-tabs { display: none; }
  .mp-me { display: inline-flex; }
  .mp-hello { margin: 0 0 18px; padding: 0; background: none; color: var(--mp-green); border-radius: 0; }
  .mp-hello h1 { font-size: 26px; }
  .mp-hello__sub { color: var(--mp-muted); }
  .mp-hero { margin-top: 0; }
  .mp-hero__grid { grid-template-columns: 1.3fr 1fr 1fr; }
  .mp-hero__main { grid-column: auto; }
  .mp-grid--top { grid-template-columns: 1.35fr 1fr; }
  .mp-grid--bottom { grid-template-columns: 1.35fr 1fr; }
}
@media (max-width: 380px) {
  .mp-hero__value { font-size: 28px; }
  .mp-stats b { font-size: 20px; }
}
@media print {
  .mp-side, .mp-tabs, .mp-bar { display: none !important; }
}
