:root {
    --bg-base: #0A1B2E;
    --bg-surface: #10253B;
    --bg-elevated: #17334E;
    --primary: #00A0E9;
    --accent: #7FE0FF;
    --text-main: #F5FAFF;
    --text-muted: #A9BED0;
    --border: rgba(36, 66, 93, 0.5);
    --success: #22C55E;
    --danger: #FF7F96;
    --warning: #F59E0B;
}

* { margin: 0; padding: 0; box-sizing: border-box; font-family: 'Cairo', sans-serif; -webkit-tap-highlight-color: transparent; }
body { background: var(--bg-base); color: var(--text-main); height: 100vh; display: flex; flex-direction: column; overflow: hidden; }

/* شاشة التحميل */
#splash { position: fixed; inset: 0; background: var(--bg-base); display: flex; flex-direction: column; align-items: center; justify-content: center; z-index: 9999; }
.loader { width: 40px; height: 40px; border: 4px solid var(--border); border-top-color: var(--primary); border-radius: 50%; animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* المحتوى */
#app { flex: 1; overflow-y: auto; padding: 20px; padding-bottom: 90px; }
.page { display: none; animation: fadeIn 0.3s; }
.page.active { display: block; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

/* الشريط السفلي */
.bottom-nav { position: fixed; bottom: 0; left: 0; right: 0; background: rgba(16, 37, 59, 0.95); backdrop-filter: blur(10px); border-top: 1px solid var(--border); display: flex; justify-content: space-around; padding: 12px 0 calc(12px + env(safe-area-inset-bottom)); z-index: 100; }
.nav-item { display: flex; flex-direction: column; align-items: center; gap: 4px; color: var(--text-muted); font-size: 11px; font-weight: 600; cursor: pointer; transition: 0.2s; }
.nav-item.active { color: var(--primary); }
.nav-item svg { width: 22px; height: 22px; }

/* البطاقات */
.card { background: var(--bg-surface); border: 1px solid var(--border); border-radius: 20px; padding: 20px; margin-bottom: 16px; }
.balance-card { background: linear-gradient(135deg, var(--primary), var(--bg-surface)); position: relative; overflow: hidden; text-align: center; padding: 24px 20px; box-shadow: 0 10px 30px rgba(0,160,233,0.15); }
.balance-card::before { content: ''; position: absolute; top: -50%; left: -50%; width: 200%; height: 200%; background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 60%); pointer-events: none; }
.balance-label { font-size: 14px; color: rgba(255,255,255,0.8); margin-bottom: 5px; display: flex; justify-content: center; align-items: center; gap: 10px; }
.balance-value { font-size: 36px; font-weight: 700; color: white; font-family: monospace; }
.balance-id { font-size: 12px; color: rgba(255,255,255,0.6); margin-top: 10px; font-family: monospace; }

/* الأقسام */
.section-title { font-size: 18px; font-weight: 700; margin-bottom: 16px; display: flex; justify-content: space-between; align-items: center; }

/* شبكة الخدمات */
.services-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.service-btn { background: var(--bg-surface); border: 1px solid var(--border); border-radius: 16px; padding: 16px; display: flex; flex-direction: column; align-items: center; gap: 10px; color: var(--text-main); font-weight: 600; font-size: 13px; transition: 0.2s; cursor: pointer; }
.service-btn:active { transform: scale(0.95); }
.service-btn svg { color: var(--primary); width: 28px; height: 28px; }

/* هياكل التحميل (Skeleton) */
.skeleton { background: linear-gradient(90deg, var(--bg-elevated) 25%, var(--border) 50%, var(--bg-elevated) 75%); background-size: 200% 100%; animation: shimmer 1.5s infinite; border-radius: 8px; }
@keyframes shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }
.sk-title { height: 20px; width: 40%; margin-bottom: 15px; }
.sk-card { height: 120px; width: 100%; margin-bottom: 16px; }

/* التنبيهات (Toast) */
#toast { position: fixed; bottom: 90px; left: 50%; transform: translateX(-50%) translateY(100px); padding: 12px 24px; border-radius: 12px; font-weight: bold; color: white; transition: 0.3s; z-index: 10000; opacity: 0; font-size: 14px; text-align: center; width: 80%; }
#toast.show { transform: translateX(-50%) translateY(0); opacity: 1; }

/* شبكة المنتجات */
.products-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.product-card { background: var(--bg-surface); border: 1px solid var(--border); border-radius: 16px; padding: 12px; display: flex; flex-direction: column; gap: 8px; }
.product-img { width: 100%; height: 100px; background: var(--bg-base); border-radius: 12px; object-fit: cover; }
.product-name { font-size: 14px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.product-price { font-size: 16px; font-weight: 700; color: var(--accent); }

/* الحقول والنماذج */
.info-label { font-size: 12px; color: var(--text-muted); display: block; margin-bottom: 5px; }
.input { width: 100%; padding: 12px; background: var(--bg-base); border: 1px solid var(--border); border-radius: 12px; color: var(--text-main); font-family: inherit; }
.input:focus { outline: none; border-color: var(--primary); }
select.input { appearance: none; -webkit-appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23A9BED0' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: left 12px center; }

/* أنماط القوائم */
.list-item { background: var(--bg-surface); border: 1px solid var(--border); border-radius: 16px; padding: 16px; margin-bottom: 12px; display: flex; justify-content: space-between; align-items: center; cursor: pointer; transition: 0.2s; }
.list-item:active { transform: scale(0.98); }
.list-info p:first-child { font-size: 14px; font-weight: 700; margin-bottom: 4px; }
.list-info p:last-child { font-size: 12px; color: var(--text-muted); }

/* أنماط قسم حسابي */
.profile-pic { width: 80px; height: 80px; border-radius: 50%; border: 3px solid var(--primary); object-fit: cover; margin: 0 auto 15px; box-shadow: 0 0 20px rgba(0, 160, 233, 0.3); }
.verified-badge { display: inline-flex; align-items: center; justify-content: center; width: 20px; height: 20px; background: var(--primary); border-radius: 50%; margin-right: 5px; vertical-align: middle; }
.verified-badge svg { width: 12px; height: 12px; color: white; }
.section-card { background: var(--bg-surface); border: 1px solid var(--border); border-radius: 16px; padding: 20px; margin-bottom: 16px; }
.section-card h3 { font-size: 16px; font-weight: 700; margin-bottom: 15px; display: flex; align-items: center; gap: 8px; color: var(--accent); border-bottom: 1px solid var(--border); padding-bottom: 10px; }
.menu-link { display: flex; justify-content: space-between; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--border); font-size: 14px; font-weight: 600; cursor: pointer; }
.menu-link:last-child { border-bottom: none; }
.menu-link:active { opacity: 0.7; }
.copy-btn { background: rgba(0,160,233,0.15); border: 1px solid var(--border); padding: 4px 8px; border-radius: 6px; font-size: 11px; color: var(--accent); cursor: pointer; }
.copy-btn:active { background: var(--primary); color: white; }

/* أنماط المحادثة */
.chat-container { display: flex; flex-direction: column; height: calc(100vh - 150px); background: var(--bg-surface); border-radius: 16px; overflow: hidden; border: 1px solid var(--border); }
.chat-messages { flex: 1; padding: 15px; overflow-y: auto; display: flex; flex-direction: column; gap: 10px; background: var(--bg-base); }
.msg { max-width: 80%; padding: 10px 14px; border-radius: 14px; font-size: 14px; line-height: 1.5; }
.msg.user { align-self: flex-start; background: var(--bg-elevated); border-bottom-right-radius: 4px; }
.msg.admin { align-self: flex-end; background: var(--primary); color: white; border-bottom-left-radius: 4px; }
.chat-input { padding: 10px; display: flex; gap: 8px; background: var(--bg-surface); border-top: 1px solid var(--border); }
.chat-input input { flex: 1; margin: 0; }

/* أنماط رفع الملفات */
.file-upload-box { border: 1px dashed var(--border); padding: 15px; text-align: center; border-radius: 12px; margin-bottom: 10px; cursor: pointer; background: rgba(0,160,233,0.05); }
.file-upload-box input { display: none; }
.file-upload-box span { font-size: 13px; color: var(--text-muted); }

/* ================= قسم حسابي المطور ================= */
.profile-header-card { text-align: center; padding: 30px 20px 20px; background: linear-gradient(180deg, rgba(0,160,233,0.1) 0%, var(--bg-surface) 100%); border-radius: 24px; border: 1px solid var(--border); margin-bottom: 20px; position: relative; }
.profile-img { width: 90px; height: 90px; border-radius: 50%; object-fit: cover; border: 3px solid var(--primary); box-shadow: 0 8px 24px rgba(0,160,233,0.3); margin-bottom: 15px; }
.profile-name { font-size: 22px; font-weight: 700; display: flex; justify-content: center; align-items: center; gap: 8px; margin-bottom: 5px; }
.verify-badge-svg { width: 22px; height: 22px; fill: var(--primary); }
.id-box { background: var(--bg-base); padding: 10px 15px; border-radius: 12px; display: inline-flex; align-items: center; gap: 10px; border: 1px solid var(--border); margin-top: 10px; }
.id-text { font-family: monospace; font-size: 15px; color: var(--accent); letter-spacing: 1px; }
.copy-icon-btn { background: transparent; border: none; color: var(--text-muted); cursor: pointer; display: flex; align-items: center; justify-content: center; padding: 5px; transition: 0.2s; }
.copy-icon-btn:active { transform: scale(0.9); color: var(--primary); }
.copy-icon-btn.success { color: var(--success); }
.tg-id-text { font-size: 12px; color: var(--text-muted); margin-top: 8px; font-family: monospace; }

/* القوائم والبطاقات */
.menu-card { background: var(--bg-surface); border: 1px solid var(--border); border-radius: 20px; margin-bottom: 16px; overflow: hidden; }
.menu-card-header { padding: 15px 20px; background: rgba(255,255,255,0.02); border-bottom: 1px solid var(--border); font-weight: 700; font-size: 15px; color: var(--accent); display: flex; align-items: center; gap: 10px; }
.menu-row { display: flex; justify-content: space-between; align-items: center; padding: 16px 20px; border-bottom: 1px solid var(--border); cursor: pointer; transition: 0.2s; }
.menu-row:last-child { border-bottom: none; }
.menu-row:active { background: rgba(255,255,255,0.05); }
.menu-row-title { font-weight: 600; font-size: 14px; display: flex; align-items: center; gap: 12px; }
.menu-row-title svg { color: var(--primary); width: 20px; }

/* ================= شاشة KYC ================= */
.kyc-header { text-align: center; margin-bottom: 25px; }
.kyc-icon-bg { width: 70px; height: 70px; background: rgba(0,160,233,0.1); border-radius: 50%; display: flex; align-items: center; justify-content: center; margin: 0 auto 15px; border: 2px dashed var(--primary); }
.kyc-step-indicator { display: flex; justify-content: center; align-items: center; gap: 10px; margin-top: 15px; }
.kyc-step { width: 30px; height: 4px; background: var(--border); border-radius: 2px; }
.kyc-step.active { background: var(--primary); width: 50px; }

.input-group { margin-bottom: 16px; position: relative; }
.input-label { font-size: 13px; font-weight: 600; color: var(--text-muted); margin-bottom: 8px; display: block; }
.input-with-icon { position: relative; }
.input-with-icon svg { position: absolute; right: 15px; top: 14px; color: var(--text-muted); width: 18px; }
.input-with-icon input { padding-right: 45px; }
.custom-select-trigger { background: var(--bg-base); border: 1px solid var(--border); border-radius: 12px; padding: 12px 15px 12px 45px; font-size: 14px; color: var(--text-main); cursor: pointer; display: flex; justify-content: space-between; align-items: center; position: relative; }
.custom-select-trigger svg.arrow { position: absolute; left: 15px; color: var(--text-muted); width: 16px; }

/* النافذة السفلية للمحافظات */
.bottom-sheet-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.7); backdrop-filter: blur(5px); z-index: 10000; display: none; align-items: flex-end; justify-content: center; }
.bottom-sheet-overlay.active { display: flex; }
.bottom-sheet { background: var(--bg-surface); width: 100%; max-height: 80vh; border-radius: 24px 24px 0 0; padding: 20px; display: flex; flex-direction: column; animation: slideUp 0.3s ease; border-top: 1px solid var(--border); }
@keyframes slideUp { from { transform: translateY(100%); } to { transform: translateY(0); } }
.bottom-sheet-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 15px; padding-bottom: 15px; border-bottom: 1px solid var(--border); }
.bottom-sheet-header h3 { font-size: 18px; margin: 0; }
.gov-search { margin-bottom: 15px; }
.gov-list { overflow-y: auto; flex: 1; }
.gov-item { padding: 14px 15px; border-bottom: 1px solid var(--border); font-size: 15px; font-weight: 500; cursor: pointer; display: flex; justify-content: space-between; }
.gov-item:active { background: rgba(255,255,255,0.05); }
.gov-item.selected { color: var(--primary); font-weight: 700; background: rgba(0,160,233,0.05); }

/* ================= المحادثة ================= */
.chat-header { background: var(--bg-surface); padding: 15px; border-bottom: 1px solid var(--border); display: flex; align-items: center; gap: 15px; border-radius: 20px 20px 0 0; }
.chat-avatar { width: 40px; height: 40px; background: var(--primary); border-radius: 50%; display: flex; align-items: center; justify-content: center; color: white; }
.chat-body { flex: 1; display: flex; flex-direction: column; background: var(--bg-base); overflow: hidden; }
.chat-messages { flex: 1; padding: 20px 15px; overflow-y: auto; display: flex; flex-direction: column; gap: 15px; }
.msg-bubble { max-width: 80%; padding: 12px 16px; border-radius: 18px; font-size: 14px; line-height: 1.5; position: relative; }
.msg-user { align-self: flex-start; background: var(--bg-surface); border: 1px solid var(--border); border-bottom-right-radius: 4px; }
.msg-admin { align-self: flex-end; background: linear-gradient(135deg, var(--primary), #0088C8); color: white; border-bottom-left-radius: 4px; }
.msg-time { font-size: 10px; opacity: 0.6; margin-top: 5px; text-align: left; display: block; }
.chat-input-area { padding: 15px; background: var(--bg-surface); border-top: 1px solid var(--border); display: flex; gap: 10px; align-items: flex-end; border-radius: 0 0 20px 20px; }
.chat-textarea { flex: 1; background: var(--bg-base); border: 1px solid var(--border); border-radius: 20px; padding: 12px 15px; color: var(--text-main); font-family: inherit; font-size: 14px; resize: none; height: 44px; max-height: 100px; overflow-y: auto; }
.chat-textarea:focus { outline: none; border-color: var(--primary); }
.btn-send { width: 44px; height: 44px; border-radius: 50%; background: var(--primary); border: none; color: white; display: flex; align-items: center; justify-content: center; cursor: pointer; flex-shrink: 0; }

/* رفع الملفات */
.file-upload-card { border: 1px dashed var(--border); border-radius: 16px; padding: 20px; text-align: center; background: rgba(0,160,233,0.02); cursor: pointer; transition: 0.2s; position: relative; }
.file-upload-card:active { background: rgba(0,160,233,0.1); }
.file-upload-card input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.file-upload-card svg { color: var(--primary); width: 32px; height: 32px; margin-bottom: 10px; }
.file-upload-card p { font-size: 13px; font-weight: 600; color: var(--text-main); margin-bottom: 4px; }
.file-upload-card span { font-size: 11px; color: var(--text-muted); }

/* ================= النوافذ السفلية (Bottom Sheets) ================= */
.sheet-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.8); backdrop-filter: blur(5px); z-index: 20000; display: none; align-items: flex-end; justify-content: center; }
.sheet-overlay.active { display: flex; }
.sheet-content { background: var(--bg-surface); width: 100%; max-height: 90vh; border-radius: 24px 24px 0 0; padding: 20px; overflow-y: auto; animation: slideUp 0.3s ease; border-top: 1px solid var(--border); position: relative; }
@keyframes slideUp { from { transform: translateY(100%); } to { transform: translateY(0); } }
.sheet-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; border-bottom: 1px solid var(--border); padding-bottom: 15px; }
.sheet-header h3 { margin: 0; font-size: 18px; }
.close-sheet { background: transparent; border: none; color: var(--text-muted); cursor: pointer; font-size: 24px; line-height: 1; }

/* ================= بطاقات التفاصيل ================= */
.detail-row { display: flex; justify-content: space-between; padding: 12px 0; border-bottom: 1px dashed var(--border); font-size: 14px; }
.detail-row:last-child { border-bottom: none; }
.detail-label { color: var(--text-muted); }
.detail-value { font-weight: 600; color: var(--text-main); }
.status-badge { padding: 4px 12px; border-radius: 20px; font-size: 12px; font-weight: 700; }
.badge-pending { background: rgba(245,158,11,0.15); color: #F59E0B; }
.badge-success { background: rgba(34,197,94,0.15); color: #22C55E; }
.badge-danger { background: rgba(255,127,150,0.15); color: #FF7F96; }

/* ================= الإيصال (Receipt) ================= */
.receipt-paper {
    background: #FFFFFF;
    color: #0A1B2E;
    border-radius: 16px;
    padding: 25px;
    position: relative;
    overflow: hidden;
    font-family: 'Cairo', sans-serif;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    width: 100%;
}
.receipt-watermark {
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%) rotate(-35deg);
    font-size: 80px;
    font-weight: 900;
    color: rgba(10, 27, 46, 0.04);
    white-space: nowrap;
    pointer-events: none;
    z-index: 0;
}
.receipt-header { text-align: center; border-bottom: 2px dashed #00A0E9; padding-bottom: 15px; margin-bottom: 20px; position: relative; z-index: 1; }
.receipt-logo { font-size: 22px; font-weight: 800; color: #00A0E9; margin-bottom: 5px; }
.receipt-title { font-size: 14px; color: #666; }
.receipt-status { display: inline-block; margin-top: 10px; padding: 5px 15px; border-radius: 20px; font-size: 12px; font-weight: 700; }
.receipt-body { position: relative; z-index: 1; }
.receipt-row { display: flex; justify-content: space-between; margin-bottom: 12px; font-size: 13px; }
.receipt-row .label { color: #666; }
.receipt-row .value { font-weight: 700; color: #0A1B2E; }
.receipt-footer { margin-top: 25px; text-align: center; font-size: 11px; color: #999; border-top: 1px solid #eee; padding-top: 15px; position: relative; z-index: 1; }
.receipt-actions { display: flex; gap: 10px; margin-top: 20px; flex-wrap: wrap; }

/* ================= عارض الصور (Image Viewer) ================= */
.image-viewer { position: fixed; inset: 0; background: rgba(0,0,0,0.95); z-index: 30000; display: none; align-items: center; justify-content: center; flex-direction: column; }
.image-viewer.active { display: flex; }
.image-viewer img { max-width: 95%; max-height: 85vh; object-fit: contain; border-radius: 8px; }
.image-viewer-close { position: absolute; top: 20px; right: 20px; color: white; background: rgba(255,255,255,0.2); border: none; width: 40px; height: 40px; border-radius: 50%; font-size: 20px; cursor: pointer; display: flex; align-items: center; justify-content: center; }

/* ================= السجل الزمني (Timeline) ================= */
.timeline { position: relative; padding-right: 20px; margin-top: 15px; }
.timeline::before { content: ''; position: absolute; right: 6px; top: 5px; bottom: 5px; width: 2px; background: var(--border); }
.timeline-item { position: relative; margin-bottom: 15px; }
.timeline-dot { position: absolute; right: -20px; top: 4px; width: 14px; height: 14px; border-radius: 50%; background: var(--bg-surface); border: 2px solid var(--primary); }
.timeline-content { font-size: 13px; }

/* ================= قسم شحن الرصيد المطور ================= */
.payment-list { display: flex; flex-direction: column; gap: 12px; margin-top: 20px; }
.payment-card { 
    display: flex; align-items: center; justify-content: space-between; 
    background: var(--bg-surface); border: 1px solid var(--border); 
    border-radius: 16px; padding: 16px; cursor: pointer; transition: 0.2s; 
}
.payment-card:active { background: var(--bg-elevated); transform: scale(0.98); }
.payment-card-left { display: flex; align-items: center; gap: 15px; }
.payment-icon-box { 
    width: 48px; height: 48px; border-radius: 12px; background: rgba(0, 160, 233, 0.1); 
    display: flex; align-items: center; justify-content: center; border: 1px solid rgba(0, 160, 233, 0.2); 
}
.payment-icon-box svg { width: 24px; height: 24px; color: var(--primary); }
.payment-info h4 { font-size: 15px; font-weight: 700; margin-bottom: 4px; color: var(--text-main); }
.payment-info p { font-size: 12px; color: var(--text-muted); }
.payment-card-right { display: flex; align-items: center; gap: 10px; }
.payment-status { font-size: 11px; font-weight: 700; color: var(--success); background: rgba(34,197,94,0.1); padding: 4px 8px; border-radius: 8px; }
.payment-card-right svg { color: var(--text-muted); width: 20px; }

/* شاشة تفاصيل طريقة الدفع */
.payment-form-header { display: flex; align-items: center; gap: 15px; margin-bottom: 25px; }
.payment-form-header h2 { font-size: 18px; margin: 0; }
.back-btn { background: transparent; border: none; color: var(--primary); cursor: pointer; padding: 5px; }

.instruction-box { background: rgba(0, 160, 233, 0.05); border: 1px dashed var(--primary); border-radius: 12px; padding: 15px; margin-bottom: 20px; }
.instruction-box p { font-size: 13px; color: var(--accent); line-height: 1.5; }
.instruction-box strong { color: white; display: block; margin-bottom: 5px; font-size: 14px;}

/* ================= تصميم شاشة تفاصيل الدفع ================= */
.payment-detail-header { text-align: center; padding: 20px 0 30px; }
.payment-detail-icon-wrap { width: 80px; height: 80px; margin: 0 auto 15px; background: linear-gradient(135deg, rgba(0,160,233,0.2), rgba(127,224,255,0.1)); border-radius: 24px; display: flex; align-items: center; justify-content: center; border: 1px solid rgba(0,160,233,0.3); box-shadow: 0 10px 30px rgba(0,160,233,0.1); }
.payment-detail-icon-wrap i { width: 40px; height: 40px; color: var(--primary); }
.payment-detail-title { font-size: 22px; font-weight: 700; margin-bottom: 5px; }
.payment-detail-subtitle { font-size: 13px; color: var(--text-muted); }

/* صندوق الحساب (يشبه التذكرة) */
.account-ticket { position: relative; background: var(--bg-surface); border: 1px solid var(--border); border-radius: 16px; padding: 20px; margin-bottom: 25px; overflow: hidden; text-align: center; }
.account-ticket::before, .account-ticket::after { content: ''; position: absolute; top: 50%; width: 20px; height: 20px; background: var(--bg-base); border-radius: 50%; border: 1px solid var(--border); transform: translateY(-50%); }
.account-ticket::before { right: -10px; }
.account-ticket::after { left: -10px; }
.account-label { font-size: 12px; color: var(--text-muted); margin-bottom: 8px; }
.account-number { font-family: 'IBM Plex Mono', monospace; font-size: 22px; font-weight: 700; color: var(--accent); letter-spacing: 2px; word-break: break-all; margin-bottom: 15px; }
.btn-copy-account { background: rgba(0,160,233,0.1); color: var(--primary); border: 1px solid rgba(0,160,233,0.3); padding: 8px 20px; border-radius: 20px; font-size: 13px; font-weight: 600; cursor: pointer; display: inline-flex; align-items: center; gap: 8px; transition: 0.2s; }
.btn-copy-account:active { background: var(--primary); color: white; }

/* خطوات الدفع */
.steps-container { margin-bottom: 25px; }
.step-row { display: flex; gap: 15px; margin-bottom: 15px; position: relative; }
.step-row::before { content: ''; position: absolute; right: 14px; top: 30px; bottom: -15px; width: 2px; background: var(--border); }
.step-row:last-child::before { display: none; }
.step-num { width: 30px; height: 30px; border-radius: 50%; background: var(--bg-surface); border: 2px solid var(--primary); display: flex; align-items: center; justify-content: center; font-size: 14px; font-weight: 700; color: var(--primary); flex-shrink: 0; z-index: 1; }
.step-text { font-size: 13px; color: var(--text-main); line-height: 1.5; padding-top: 5px; }

/* زر الإرسال الثابت */
.sticky-submit { position: sticky; bottom: 20px; margin-top: 20px; z-index: 10; }
.spin { animation: spin 1s linear infinite; }

/* ================= تحسينات جديدة لشاشة الدفع ================= */
.payment-list { display: flex; flex-direction: column; gap: 14px; margin-top: 20px; }
.payment-card { 
    display: flex; align-items: center; justify-content: space-between; 
    background: linear-gradient(145deg, var(--bg-surface) 0%, rgba(16,37,59,0.7) 100%);
    border: 1px solid var(--border); 
    border-radius: 20px; padding: 16px; cursor: pointer; transition: 0.3s ease; 
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}
.payment-card:active { transform: scale(0.97); border-color: rgba(0,160,233,0.5); }
.payment-card-left { display: flex; align-items: center; gap: 16px; }
.payment-icon-box { 
    width: 54px; height: 54px; border-radius: 16px; overflow: hidden;
    background: #ffffff; /* خلفية بيضاء للشعارات لتظهر بوضوح */
    display: flex; align-items: center; justify-content: center; 
    border: 1px solid rgba(0,0,0,0.05);
}
.payment-icon-box img { width: 100%; height: 100%; object-fit: contain; padding: 4px; }
.payment-icon-box svg { width: 28px; height: 28px; }
.payment-info h4 { font-size: 16px; font-weight: 700; margin-bottom: 4px; color: var(--text-main); }
.payment-info p { font-size: 12px; color: var(--text-muted); }
.payment-card-right svg { color: var(--text-muted); width: 22px; }

/* تحسين شاشة التفاصيل */
.detail-header { display: flex; align-items: center; gap: 10px; margin-bottom: 20px; padding-bottom: 15px; border-bottom: 1px solid var(--border); }
.detail-logo-large { width: 60px; height: 60px; background: white; border-radius: 16px; padding: 5px; box-shadow: 0 5px 15px rgba(0,0,0,0.2); margin: 0 auto 15px; display: flex; align-items: center; justify-content: center; }
.detail-logo-large img { width: 100%; height: 100%; object-fit: contain; }

.account-ticket { 
    background: var(--bg-base); border: 2px dashed var(--border); 
    border-radius: 16px; padding: 25px 20px; text-align: center; margin-bottom: 25px; 
    position: relative; overflow: hidden;
}
.account-number { font-family: 'IBM Plex Mono', monospace; font-size: 18px; font-weight: 700; color: var(--accent); word-break: break-all; margin-bottom: 15px; line-height: 1.6; }

/* إصلاح زر الإرسال */
.submit-container { padding-bottom: 100px; /* مساحة للشريط السفلي */ }
.btn-submit-deposit { width: 100%; padding: 16px; font-size: 16px; font-weight: 700; border-radius: 16px; display: flex; justify-content: center; align-items: center; gap: 10px; background: linear-gradient(135deg, var(--primary), #0284C7); box-shadow: 0 8px 25px rgba(0,160,233,0.4); }

/* حقول الإدخال */
.form-card { background: var(--bg-surface); padding: 20px; border-radius: 20px; border: 1px solid var(--border); margin-bottom: 20px; }
.input-group { margin-bottom: 16px; }
.input-label { font-size: 13px; font-weight: 600; color: var(--text-main); margin-bottom: 8px; display: block; }
.input-wrapper { position: relative; }
.input-wrapper svg { position: absolute; right: 15px; top: 15px; color: var(--text-muted); width: 18px; }
.input-wrapper input { width: 100%; background: var(--bg-base); border: 1px solid var(--border); border-radius: 12px; padding: 14px 45px 14px 15px; color: white; font-family: inherit; font-size: 14px; transition: 0.2s; }
.input-wrapper input:focus { outline: none; border-color: var(--primary); background: rgba(0,160,233,0.05); }
.file-drop-area { border: 2px dashed var(--border); border-radius: 16px; padding: 25px 15px; text-align: center; cursor: pointer; transition: 0.2s; background: rgba(255,255,255,0.02); }
.file-drop-area:active { border-color: var(--primary); background: rgba(0,160,233,0.05); }
.file-drop-area svg { color: var(--primary); width: 36px; height: 36px; margin-bottom: 10px; }
.file-drop-area p { font-size: 13px; font-weight: 600; color: var(--text-main); }
.file-drop-area span { font-size: 11px; color: var(--text-muted); display: block; margin-top: 5px; }

/* ================= تحسينات شاشة الدفع ================= */
.account-info-box { background: var(--bg-surface); padding: 15px; border-radius: 16px; border: 1px solid var(--border); margin-bottom: 20px; }
.info-row { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.info-row:last-child { margin-bottom: 0; }
.info-row-label { font-size: 13px; color: var(--text-muted); }
.info-row-value { font-size: 14px; font-weight: 700; color: var(--white); font-family: monospace; }
.copy-btn-small { background: rgba(0,160,233,0.1); border: 1px solid var(--primary); color: var(--primary); width: 30px; height: 30px; border-radius: 8px; display: flex; align-items: center; justify-content: center; cursor: pointer; transition: 0.2s; }
.copy-btn-small:active { background: var(--primary); color: white; }
.copy-btn-small svg { width: 14px; height: 14px; }

.limits-row { display: flex; justify-content: space-between; font-size: 12px; font-weight: 700; margin-top: 15px; padding-top: 15px; border-top: 1px dashed var(--border); }
.limit-min { color: var(--danger); }
.limit-max { color: var(--success); }

/* صندوق العمولة */
.fee-box { background: rgba(0,160,233,0.05); border: 1px solid rgba(0,160,233,0.2); border-radius: 12px; padding: 12px 15px; margin-bottom: 15px; display: flex; justify-content: space-between; align-items: center; font-size: 13px; }
.fee-label { color: var(--text-muted); }
.fee-value { color: var(--primary); font-weight: 700; font-family: monospace; }

/* ملخص الحساب */
.calc-summary { background: var(--bg-base); border-radius: 12px; padding: 15px; margin-top: 15px; border: 1px solid var(--border); display: none; }
.calc-summary.active { display: block; }
.calc-row { display: flex; justify-content: space-between; font-size: 13px; color: var(--text-muted); margin-bottom: 8px; }
.calc-row.total { margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--border); font-size: 16px; font-weight: 700; color: var(--accent); }

/* ================= تحديث حقل رفع الصورة ================= */
.file-upload-wrapper {
    margin-top: 15px;
    margin-bottom: 25px;
}
.file-upload-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    padding: 16px;
    background: rgba(0, 160, 233, 0.05);
    border: 2px dashed rgba(0, 160, 233, 0.4);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    color: var(--text-main);
    font-family: inherit;
    font-size: 14px;
    font-weight: 600;
}
.file-upload-btn:active {
    background: rgba(0, 160, 233, 0.15);
    border-color: var(--primary);
}
.file-upload-btn svg {
    width: 20px;
    height: 20px;
    color: var(--primary);
}
.file-name-display {
    display: block;
    text-align: center;
    font-size: 12px;
    color: var(--success);
    margin-top: 8px;
    word-break: break-all;
}

/* إصلاح حجم رقم الحساب */
.info-row { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; gap: 10px; }
.info-row-value { 
    font-family: monospace; 
    font-size: 12px; /* تصغير الحجم */
    word-break: break-all; /* السماح بالنزول لسطر جديد */
    text-align: left; 
    max-width: 65%; /* ترك مساحة لزر النسخ */
    color: var(--white);
}
.copy-btn-small { flex-shrink: 0; /* منع زر النسخ من الانضغاط */ }

/* صندوق الباركود */
.barcode-box {
    background: #FFFFFF;
    border-radius: 16px;
    padding: 15px;
    text-align: center;
    margin: 20px 0;
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}
.barcode-box p { color: #333; font-size: 12px; font-weight: 700; margin-bottom: 10px; font-family: 'Cairo', sans-serif; }
.barcode-box img { 
    max-width: 100%; 
    max-height: 180px; 
    object-fit: contain; 
    border-radius: 8px;
}

/* إصلاح جذري وشامل لحقل رفع الصورة */
.file-upload-wrapper {
    margin-top: 15px;
    margin-bottom: 25px;
    width: 100%;
}
.file-upload-btn {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 10px !important;
    width: 100% !important;
    padding: 16px !important;
    background: rgba(0, 160, 233, 0.05) !important;
    border: 2px dashed rgba(0, 160, 233, 0.4) !important;
    border-radius: 12px !important;
    cursor: pointer !important;
    transition: all 0.2s ease !important;
    color: var(--text-main) !important;
    font-family: inherit !important;
    font-size: 14px !important;
    font-weight: 600 !important;
    box-sizing: border-box !important;
}
.file-upload-btn:active {
    background: rgba(0, 160, 233, 0.15) !important;
    border-color: var(--primary) !important;
}
.file-upload-btn svg {
    width: 24px !important;
    height: 24px !important;
    color: var(--primary) !important;
    flex-shrink: 0 !important;
    margin: 0 !important;
}
.file-upload-btn span {
    display: inline-block !important;
    font-size: 14px !important;
    color: var(--text-main) !important;
    margin: 0 !important;
}
.file-name-display {
    display: block;
    text-align: center;
    font-size: 12px;
    color: var(--success);
    margin-top: 8px;
    word-break: break-all;
}

/* تصغير رقم الحساب ومنع خروج زر النسخ */
.info-row-value { 
    font-family: monospace; 
    font-size: 12px; 
    word-break: break-all; 
    text-align: left; 
    max-width: 60%; 
    color: var(--white);
}

/* تعديل حواف بطاقة الرصيد لتصبح دائرية */
.balance-card {
    border-radius: 24px !important;
    padding: 25px 20px !important;
}

/* ================= تصميم نافذة الشراء (Bottom Sheet) ================= */
.modal-overlay {
    position: fixed; inset: 0; background: rgba(10, 27, 46, 0.8); 
    backdrop-filter: blur(5px); z-index: 10000; display: flex; 
    align-items: flex-end; justify-content: center;
    animation: fadeIn 0.2s ease-out;
}
.purchase-sheet {
    background: var(--bg-base); width: 100%; max-width: 600px; 
    max-height: 92vh; border-radius: 24px 24px 0 0; 
    display: flex; flex-direction: column;
    border: 1px solid var(--border-soft); border-bottom: none;
    animation: slideUp 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 -10px 40px rgba(0,0,0,0.5);
}
@keyframes slideUp { from { transform: translateY(100%); } to { transform: translateY(0); } }

.sheet-header { padding: 20px; border-bottom: 1px solid var(--border-soft); display: flex; justify-content: space-between; align-items: center; }
.sheet-header h3 { margin: 0; font-size: 18px; font-weight: 700; color: var(--text-main); }
.sheet-close { background: var(--bg-surface); border: none; color: var(--text-muted); width: 32px; height: 32px; border-radius: 50%; display: flex; align-items: center; justify-content: center; cursor: pointer; }

.sheet-body { padding: 20px; overflow-y: auto; flex: 1; display: flex; flex-direction: column; gap: 20px; }

/* بطاقة المنتج */
.product-hero { text-align: center; }
.product-hero img { width: 120px; height: 120px; object-fit: contain; margin-bottom: 15px; border-radius: 20px; background: var(--bg-surface); padding: 10px; border: 1px solid var(--border-soft); }
.product-hero h2 { font-size: 22px; margin-bottom: 5px; color: var(--white); }
.product-hero p { font-size: 13px; color: var(--text-muted); line-height: 1.5; }

/* قسم الخيارات (الباقات) */
.options-title { font-size: 14px; font-weight: 700; color: var(--text-main); margin-bottom: 10px; }
.options-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.option-card {
    border: 1px solid var(--border-soft); background: var(--bg-surface); 
    border-radius: 12px; padding: 15px 10px; text-align: center; 
    cursor: pointer; transition: all 0.2s; position: relative;
}
.option-card:active { transform: scale(0.97); }
.option-card.active { border-color: var(--primary); background: rgba(0,160,233,0.1); box-shadow: 0 0 15px rgba(0,160,233,0.2); }
.option-name { font-size: 14px; font-weight: 700; color: var(--text-main); margin-bottom: 4px; }
.option-price { font-size: 16px; font-weight: 800; color: var(--accent); }

/* حقول الإدخال */
.input-field { background: var(--bg-surface); border: 1px solid var(--border-soft); border-radius: 12px; padding: 15px; display: flex; align-items: center; gap: 10px; }
.input-field input { background: transparent; border: none; outline: none; color: var(--white); width: 100%; font-family: inherit; font-size: 15px; }
.input-field svg { color: var(--text-muted); }
.input-field.error { border-color: var(--danger); }

/* ملخص الطلب */
.summary-card { background: var(--bg-surface); border: 1px solid var(--border-soft); border-radius: 16px; padding: 15px; }
.summary-row { display: flex; justify-content: space-between; margin-bottom: 10px; font-size: 14px; color: var(--text-muted); }
.summary-row.total { margin-top: 15px; padding-top: 15px; border-top: 1px dashed var(--border-soft); font-size: 18px; font-weight: 800; color: var(--white); margin-bottom: 0; }
.summary-row.total span:last-child { color: var(--primary); }

/* الرصيد */
.balance-alert { display: flex; justify-content: space-between; align-items: center; font-size: 13px; font-weight: 700; padding: 10px 15px; border-radius: 10px; margin-top: 10px; }
.balance-ok { background: rgba(34,197,94,0.1); color: var(--success); border: 1px solid rgba(34,197,94,0.3); }
.balance-low { background: rgba(255,127,150,0.1); color: var(--danger); border: 1px solid rgba(255,127,150,0.3); }

/* الفوتر وزر الشراء */
.sheet-footer { padding: 20px; border-top: 1px solid var(--border-soft); background: var(--bg-base); }
.btn-confirm { width: 100%; padding: 18px; font-size: 18px; font-weight: 800; border-radius: 16px; border: none; color: white; background: var(--primary); transition: 0.3s; display: flex; justify-content: center; align-items: center; gap: 10px; }
.btn-confirm:disabled { opacity: 0.5; cursor: not-allowed; background: var(--border-soft); color: var(--text-muted); }
.btn-confirm.loading { background: var(--primary-dark); }

/* تنسيق بطاقة الإيداع */
.deposit-card {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 16px;
    margin-bottom: 12px;
    cursor: pointer;
    transition: 0.2s;
}
.deposit-card:active {
    transform: scale(0.98);
    background: var(--bg-elevated);
}

/* تنسيق أزرار الفلترة */
.filter-btn {
    padding: 8px 16px; border-radius: 12px; font-size: 13px; font-weight: 700;
    border: 1px solid var(--border); background: var(--bg-surface); color: var(--text-muted);
    cursor: pointer; transition: 0.2s; white-space: nowrap;
}
.filter-btn.active {
    background: var(--primary-500); color: white; border-color: var(--primary-500);
    box-shadow: 0 4px 10px rgba(0,160,233,0.3);
}

/* تنسيق بطاقة الطلب */
.order-card {
    background: var(--bg-surface); border: 1px solid var(--border);
    border-radius: 16px; padding: 16px; margin-bottom: 12px;
    cursor: pointer; transition: 0.2s;
}
.order-card:active { transform: scale(0.98); background: var(--bg-elevated); }

/* شاشة الصيانة */
.maintenance-screen {
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    height: 100vh; text-align: center; padding: 20px; background: var(--bg-base);
}
.maintenance-icon {
    width: 100px; height: 100px; background: rgba(245,158,11,0.1); border-radius: 50%;
    display: flex; align-items: center; justify-content: center; margin-bottom: 20px;
    border: 2px dashed var(--warning); animation: spin 10s linear infinite;
}
.maintenance-icon svg { width: 50px; height: 50px; color: var(--warning); }
.maintenance-screen h1 { font-size: 24px; font-weight: 800; color: white; margin-bottom: 10px; }
.maintenance-screen p { font-size: 15px; color: var(--text-muted); line-height: 1.6; max-width: 300px; }

/* شاشة الحظر */
.banned-screen {
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    height: 100vh; text-align: center; padding: 20px; background: var(--bg-base);
}
.banned-icon {
    width: 100px; height: 100px; background: rgba(255,127,150,0.1); border-radius: 50%;
    display: flex; align-items: center; justify-content: center; margin-bottom: 20px;
    border: 2px solid var(--danger);
}
.banned-icon svg { width: 50px; height: 50px; color: var(--danger); }
.banned-screen h1 { font-size: 24px; font-weight: 800; color: var(--danger); margin-bottom: 10px; }
.banned-screen p { font-size: 15px; color: var(--text-muted); line-height: 1.6; max-width: 300px; }

/* #6 تثبيت رأس المودال */
.sheet-header {
    position: sticky;
    top: 0;
    background: var(--bg-base);
    z-index: 10;
    border-bottom: 1px solid var(--border-soft);
}

/* #7 الزر التفاعلي */
.btn-confirm:disabled { background: var(--bg-surface); color: var(--text-muted); cursor: not-allowed; box-shadow: none; }
.btn-confirm.insufficient { background: var(--error); color: white; }
.btn-confirm.ready { background: linear-gradient(135deg, var(--primary), #0284C7); color: white; box-shadow: 0 4px 15px rgba(0,160,233,0.4); }
