:root {
  --primary: #5b5bd6;
  --secondary: #8b5cf6;
  --page-bg: #f6f7fb;
  --card-bg: #fff;
  --text: #1b1d2a;
  --muted: #7c8296;
  --nav-bg: #fff;
  --line: #e6e8f0;
  --success: #12b76a;
  --danger: #ef4444;
  --warning: #f59e0b;
  --shadow: 0 18px 50px rgba(25, 28, 54, .08);
  --card-ratio: 1/1;
  --card-columns: 3;
  --card-gap: 12px;
  --card-radius: 18px;
  --slider-ratio: 16/7;
  --slider-radius: 22px
}
* { box-sizing: border-box }
html { scroll-behavior: smooth }
body { margin: 0; background: var(--page-bg); color: var(--text); font-family: "Segoe UI", Tahoma, Arial, sans-serif; direction: rtl; padding-bottom: 108px; min-height: 100vh; -webkit-tap-highlight-color: transparent }
button, input, select, textarea { font: inherit }
a { color: inherit }
.app-shell { width: min(100%, 920px); margin: 0 auto; padding: 14px 14px 34px }
.top-card { position: relative; overflow: hidden; background: linear-gradient(135deg, var(--primary), var(--secondary)); color: #fff; padding: 20px; border-radius: 28px; box-shadow: 0 20px 45px color-mix(in srgb, var(--primary) 28%, transparent); min-height: 154px }
.top-card:before, .top-card:after { content: ""; position: absolute; border-radius: 999px; background: rgba(255, 255, 255, .12) }
.top-card:before { width: 170px; height: 170px; left: -65px; top: -80px }
.top-card:after { width: 110px; height: 110px; right: -45px; bottom: -40px }
.top-row { position: relative; z-index: 1; display: flex; justify-content: space-between; gap: 16px; align-items: flex-start }
.user-chip { display: flex; gap: 11px; align-items: center; min-width: 0 }
.avatar { width: 52px; height: 52px; border-radius: 16px; background: rgba(255, 255, 255, .18); display: grid; place-items: center; overflow: hidden; border: 1px solid rgba(255, 255, 255, .22); flex: none }
.avatar img { width: 100%; height: 100%; object-fit: cover }
.hello { min-width: 0 }
.hello small { display: block; opacity: .82; font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis }
.hello strong { display: block; margin-top: 3px; font-size: 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis }
.telegram-id { font-size: 11px; opacity: .76; margin-top: 4px; direction: ltr; text-align: right }
.membership-chip { display: inline-flex; align-items: center; gap: 5px; margin-top: 6px; padding: 4px 8px; border-radius: 999px; background: rgba(255, 255, 255, .16); font-size: 10px; font-weight: 800 }
.membership-chip img { width: 17px; height: 17px; border-radius: 50%; object-fit: cover }
.balance-area { position: relative; z-index: 1; margin-top: 20px; display: flex; align-items: flex-end; justify-content: space-between; gap: 12px }
.balance-label { font-size: 12px; opacity: .82 }
.balance-value { font-size: 29px; font-weight: 900; letter-spacing: .2px; margin-top: 4px }
.quick-charge { border: 0; background: #fff; color: var(--primary); padding: 11px 15px; border-radius: 15px; text-decoration: none; font-weight: 800; display: flex; align-items: center; gap: 8px; box-shadow: 0 8px 20px rgba(0, 0, 0, .12); white-space: nowrap }
.slider { margin-top: 16px; overflow: hidden; border-radius: var(--slider-radius); background: var(--card-bg); box-shadow: var(--shadow); position: relative }
.slider-track { display: flex; direction: ltr; transition: transform .55s cubic-bezier(.22, .61, .36, 1) }
.slide { min-width: 100%; aspect-ratio: var(--slider-ratio); display: block; background: #e9ebf4 }
.slide img { width: 100%; height: 100%; display: block; object-fit: cover }
.slider-dots { position: absolute; bottom: 10px; left: 0; right: 0; display: flex; gap: 6px; justify-content: center }
.slider-dot { width: 7px; height: 7px; border-radius: 50%; border: 0; background: rgba(255, 255, 255, .55); padding: 0 }
.slider-dot.active { width: 20px; border-radius: 8px; background: #fff }
.announcement { margin-top: 14px; background: var(--card-bg); border: 1px solid var(--line); border-radius: 17px; padding: 11px 13px; display: flex; align-items: center; gap: 10px; overflow: hidden }
.announcement .bolt { width: 32px; height: 32px; border-radius: 11px; background: color-mix(in srgb, var(--warning) 16%, transparent); color: var(--warning); display: grid; place-items: center; flex: none }
.ticker { overflow: hidden; white-space: nowrap; flex: 1 }
.ticker-text { display: inline-block; padding-right: 100%; animation: ticker-rtl 16s linear infinite; font-size: 13px; font-weight: 700; color: var(--muted) }
@keyframes ticker-rtl { from { transform: translateX(0) } to { transform: translateX(100%) } }

/* تنسيق شريط البحث الجديد */
.custom-search-wrap { position: relative; margin-top: 15px; margin-bottom: 20px; width: 100%; }
.custom-search-wrap .search-box { background-color: #F1F1F1 !important; color: #333333 !important; border: none !important; padding: 15px 25px !important; font-size: 1rem; font-weight: 600; border-radius: 50px !important; outline: none !important; width: 100%; box-shadow: none !important; -webkit-appearance: none; transition: 0.3s ease; box-sizing: border-box; text-align: right; }
[data-theme="dark"] .custom-search-wrap .search-box, body.dark .custom-search-wrap .search-box { background-color: #111827 !important; color: #f8fafc !important; }
.search-wrap { margin-top: 16px; position: relative }
.search-wrap i { position: absolute; right: 16px; top: 50%; transform: translateY(-50%); color: var(--muted) }
.search-box { width: 100%; border: 1px solid var(--line); background: var(--card-bg); border-radius: 18px; padding: 15px 45px 15px 15px; outline: none; color: var(--text); box-shadow: 0 8px 25px rgba(25, 28, 54, .04) }
.search-box:focus { border-color: color-mix(in srgb, var(--primary) 60%, #fff); box-shadow: 0 0 0 4px color-mix(in srgb, var(--primary) 10%, transparent) }

.section-head { display: flex; justify-content: space-between; align-items: center; margin: 22px 2px 13px }
.section-head h2 { font-size: 17px; margin: 0 }
.section-head span, .section-head a { font-size: 12px; color: var(--muted); text-decoration: none }
.grid, .service-grid, .method-grid { display: grid; grid-template-columns: repeat(var(--card-columns), minmax(0, 1fr)); gap: var(--card-gap) }

/* توحيد تنسيق الأقسام والمنتجات ليظهروا بجانب بعض بشكل مثالي */
.category-card, .service-card, .method-card { display: flex !important; flex-direction: column !important; align-items: center !important; width: 100%; text-decoration: none; background: transparent; border: 0; border-radius: 0; overflow: visible; box-shadow: none; transition: .2s; min-width: 0; cursor: pointer; color: var(--text); padding: 0 !important; }
.category-card:active, .service-card:active, .method-card:active { transform: scale(.98) }
.category-image, .service-image, .method-image { width: 100%; aspect-ratio: var(--card-ratio); overflow: hidden; background: #eef0f6; border-radius: var(--card-radius); box-shadow: 0 8px 24px rgba(25, 28, 54, .07); position: relative; border: 1px solid color-mix(in srgb, var(--line) 82%, transparent) }
.category-image img, .service-image img, .method-image img { width: 100%; height: 100%; object-fit: cover; display: block }

/* توحيد النصوص أسفل الصورة */
.category-info, .service-info, .method-info { text-align: center !important; width: 100% !important; display: flex !important; flex-direction: column !important; align-items: center !important; justify-content: center !important; padding: 10px 5px 12px 5px !important; background: transparent }
.service-info h3, .category-info strong, .method-info strong { min-height: auto !important; margin: 0 0 4px 0 !important; line-height: 1.3 !important; font-size: 12px; display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; width: 100%; }
.price-row { display: flex; align-items: center; justify-content: center !important; width: 100% !important; margin: 0 !important; gap: 7px }
.price { font-size: 12px; font-weight: 900; color: var(--primary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis }

.service-badge { position: absolute; top: 8px; right: 8px; background: rgba(23, 25, 38, .72); color: #fff; border-radius: 9px; padding: 5px 7px; font-size: 9px }
.buy-mini { width: 30px; height: 30px; border-radius: 10px; border: 0; background: color-mix(in srgb, var(--primary) 11%, transparent); color: var(--primary); display: grid; place-items: center; flex: none }
.method-card.active .method-image { border-color: var(--primary); box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 13%, transparent), 0 8px 24px rgba(25, 28, 54, .07) }

.empty { background: var(--card-bg); border: 1px dashed var(--line); border-radius: 22px; padding: 42px 20px; text-align: center; color: var(--muted) }
.empty i { font-size: 34px; margin-bottom: 12px; color: var(--primary) }
.page-header { display: flex; align-items: center; gap: 12px; margin: 4px 0 18px }
.back-btn { width: 42px; height: 42px; border: 1px solid var(--line); border-radius: 14px; background: var(--card-bg); display: grid; place-items: center; text-decoration: none }
.page-header h1 { font-size: 20px; margin: 0 }
.page-header p { font-size: 12px; color: var(--muted); margin: 3px 0 0 }
.panel { background: var(--card-bg); border: 1px solid var(--line); border-radius: 22px; padding: 16px; box-shadow: 0 10px 30px rgba(25, 28, 54, .04) }
.form-group { margin-bottom: 15px }
.form-group label { display: block; font-weight: 800; font-size: 13px; margin-bottom: 8px }
.input, .select, .textarea { width: 100%; border: 1px solid var(--line); background: var(--page-bg); color: var(--text); border-radius: 15px; padding: 13px 14px; outline: none }
.textarea { min-height: 100px; resize: vertical }
.input:focus, .select:focus, .textarea:focus { border-color: var(--primary); box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 10%, transparent) }
.btn { border: 0; border-radius: 15px; padding: 13px 18px; font-weight: 900; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 8px; text-decoration: none }
.btn-primary { background: linear-gradient(135deg, var(--primary), var(--secondary)); color: #fff }
.btn-block { width: 100% }
.instructions { background: color-mix(in srgb, var(--primary) 7%, var(--card-bg)); border: 1px solid color-mix(in srgb, var(--primary) 17%, var(--line)); border-radius: 16px; padding: 13px; font-size: 13px; line-height: 1.8; margin-bottom: 15px }
.currency-selector { display: grid; grid-template-columns: 1fr auto; gap: 8px; align-items: end }
.vip-card { background: linear-gradient(135deg, color-mix(in srgb, var(--primary) 11%, var(--card-bg)), var(--card-bg)); border: 1px solid color-mix(in srgb, var(--primary) 20%, var(--line)); border-radius: 22px; padding: 16px; display: flex; gap: 13px; align-items: center }
.vip-badge { width: 58px; height: 58px; border-radius: 18px; background: color-mix(in srgb, var(--primary) 12%, transparent); display: grid; place-items: center; overflow: hidden; color: var(--primary); font-size: 24px; flex: none }
.vip-badge img { width: 100%; height: 100%; object-fit: cover }
.vip-card h3 { margin: 0; font-size: 16px }
.vip-card p { margin: 5px 0 0; font-size: 11px; color: var(--muted); line-height: 1.7 }
.order-card { background: var(--card-bg); border: 1px solid var(--line); border-radius: 20px; padding: 14px; margin-bottom: 12px }
.order-top { display: flex; justify-content: space-between; gap: 12px }
.order-top strong { font-size: 13px }
.order-meta { font-size: 11px; color: var(--muted); margin-top: 4px }
.status { display: inline-flex; align-items: center; padding: 6px 9px; border-radius: 999px; font-size: 10px; font-weight: 900 }
.status-pending { background: #fff7e5; color: #a56500 }
.status-processing { background: #eaf2ff; color: #2563eb }
.status-completed, .status-approved { background: #eafbf2; color: #0f8b52 }
.status-rejected, .status-cancelled { background: #ffeded; color: #d63a3a }
.order-bottom { display: flex; justify-content: space-between; align-items: center; margin-top: 13px; padding-top: 12px; border-top: 1px solid var(--line) }
.order-bottom span { font-size: 11px; color: var(--muted) }
.order-bottom strong { color: var(--primary) }
.bottom-nav { position: fixed; z-index: 1000; bottom: 10px; left: 50%; transform: translateX(-50%); width: min(calc(100% - 22px), 700px); height: 76px; background: color-mix(in srgb, var(--nav-bg) 94%, transparent); border: 1px solid color-mix(in srgb, var(--line) 92%, transparent); border-radius: 25px; box-shadow: 0 20px 50px rgba(31, 34, 62, .17); backdrop-filter: blur(16px); display: grid; grid-template-columns: repeat(5, 1fr); align-items: center; padding: 7px 9px }
.nav-item { height: 60px; text-decoration: none; color: #9a9fb0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 5px; font-size: 10px; font-weight: 800; border-radius: 17px; min-width: 0 }
.nav-item i { font-size: 19px }
.nav-item.active { color: var(--primary); background: color-mix(in srgb, var(--primary) 9%, transparent) }
.nav-charge { position: static; width: auto; height: 60px; border-radius: 17px; background: linear-gradient(135deg, color-mix(in srgb, var(--primary) 11%, transparent), color-mix(in srgb, var(--secondary) 8%, transparent)); color: var(--primary); box-shadow: none; border: 0 }
.nav-charge i { font-size: 20px }
.nav-charge.active { background: linear-gradient(135deg, var(--primary), var(--secondary)); color: #fff }
.modal-backdrop { position: fixed; inset: 0; background: rgba(15, 17, 30, .55); z-index: 2000; display: none; align-items: flex-end; justify-content: center; padding: 0 }
.modal-backdrop.open { display: flex }
.sheet { width: min(100%, 700px); max-height: 92vh; overflow: auto; background: var(--card-bg); border-radius: 28px 28px 0 0; padding: 18px 16px 28px; animation: sheetUp .25s ease }
.sheet-handle { width: 50px; height: 5px; border-radius: 999px; background: #d8dae3; margin: 0 auto 15px }
.sheet-head { display: flex; gap: 12px; align-items: center; margin-bottom: 15px }
.sheet-head img { width: 64px; height: 64px; border-radius: 18px; object-fit: cover; background: #eef0f6 }
.sheet-head h3 { margin: 0; font-size: 16px }
.sheet-head p { margin: 5px 0 0; color: var(--muted); font-size: 12px }
.close-sheet { margin-right: auto; width: 38px; height: 38px; border: 0; border-radius: 13px; background: var(--page-bg); color: var(--muted) }
@keyframes sheetUp { from { transform: translateY(30px); opacity: 0 } to { transform: none; opacity: 1 } }
.toast { position: fixed; z-index: 5000; top: 18px; left: 50%; transform: translate(-50%, -20px); opacity: 0; pointer-events: none; background: #171926; color: #fff; border-radius: 14px; padding: 12px 16px; box-shadow: 0 12px 30px rgba(0, 0, 0, .2); font-size: 13px; transition: .25s; max-width: calc(100% - 28px) }
.toast.show { opacity: 1; transform: translate(-50%, 0) }
.toast.error { background: #b42318 }
.toast.success { background: #087443 }
.loading-line { height: 3px; background: linear-gradient(90deg, transparent, var(--primary), transparent); background-size: 200% 100%; animation: loading 1s infinite }
@keyframes loading { to { background-position: -200% 0 } }
@media(max-width:560px) {
  .app-shell { padding: 10px 10px 28px }
  .top-card { padding: 17px; border-radius: 24px }
  .balance-value { font-size: 24px }
  .quick-charge { padding: 10px 12px; font-size: 12px }
  .category-info strong, .method-info strong, .service-info h3, .price { font-size: 10px }
  .service-info h3 { min-height: auto }
  .category-info, .service-info, .method-info { padding-top: 6px }
  .bottom-nav { grid-template-columns: repeat(5, 1fr); padding: 7px 5px }
  .nav-item span { font-size: 9px }
  .nav-item { gap: 4px }
  .grid, .service-grid, .method-grid { gap: max(5px, var(--card-gap)) }
}
@media(min-width:760px) {
  .app-shell { padding-top: 24px }
  .category-info strong, .method-info strong { font-size: 13px }
  .service-info h3, .price { font-size: 13px }
}
.code-redeem-banner { display: flex; align-items: center; gap: 12px; margin: 14px auto; padding: 14px 16px; max-width: 760px; background: linear-gradient(135deg, var(--primary, #5b5bd6), var(--secondary, #8b5cf6)); color: #fff; border-radius: 16px; text-decoration: none }
.code-redeem-banner>div { flex: 1 }
.code-redeem-banner strong, .code-redeem-banner span { display: block }
.code-redeem-banner span { font-size: 12px; opacity: .9 }