:root {
  --primary: #16a34a;
  --primary-dark: #15803d;
  --accent: #f59e0b;
  --bg: #f3f4f6;
  --card-bg: #ffffff;
  --text: #1f2937;
  --mode: light;
  --radius: 16px;
  --radius-sm: 12px;
  --shadow: 0 2px 8px rgba(0,0,0,.06), 0 1px 2px rgba(0,0,0,.04);
  --shadow-lg: 0 10px 30px rgba(0,0,0,.10), 0 4px 10px rgba(0,0,0,.06);
  --shadow-glow: 0 6px 24px rgba(22,163,74,.22);
  --transition: .2s cubic-bezier(.4,0,.2,1);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: 'Inter', 'Segoe UI', system-ui, -apple-system, Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
  line-height: 1.5;
}

a { color: var(--primary); text-decoration: none; transition: var(--transition); }
a:hover { text-decoration: underline; opacity: .9; }

.app-wrap { max-width: 480px; margin: 0 auto; min-height: 100vh; position: relative; background: var(--bg); overflow-x: hidden; }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 13px 22px; border: none; border-radius: 12px; font-size: 15px; font-weight: 600; cursor: pointer; transition: var(--transition); text-decoration: none; width: 100%; }
.btn:hover { opacity: .92; text-decoration: none; transform: translateY(-1px); box-shadow: var(--shadow-lg); }
.btn:active { transform: translateY(0); }
.btn-primary { background: linear-gradient(135deg, var(--primary), var(--primary-dark)); color: #fff; }
.btn-dark { background: var(--primary-dark); color: #fff; }
.btn-light { background: #fff; color: var(--text); border: 1px solid #e5e7eb; box-shadow: var(--shadow); }
.btn-accent { background: linear-gradient(135deg, var(--accent), #d97706); color: #fff; }
.btn-danger { background: linear-gradient(135deg, #ef4444, #dc2626); color: #fff; }
.btn-outline { background: transparent; border: 2px solid var(--primary); color: var(--primary); }
.btn-sm { padding: 8px 16px; font-size: 13px; width: auto; }

/* Cards */
.card { background: var(--card-bg); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px; margin-bottom: 16px; transition: var(--transition); }
.card:hover { box-shadow: var(--shadow-lg); }
.card-flat { background: var(--card-bg); border-radius: var(--radius-sm); padding: 16px; margin-bottom: 12px; border: 1px solid #f0f0f0; }

/* Landing */
.landing { min-height: 100vh; background: linear-gradient(160deg, var(--primary) 0%, var(--primary-dark) 60%, #052e16 100%); color: #fff; display: flex; flex-direction: column; align-items: center; padding: 48px 24px 32px; max-width: 480px; margin: 0 auto; position: relative; overflow: hidden; }
.landing::before { content: ""; position: absolute; top: -80px; right: -80px; width: 240px; height: 240px; background: rgba(255,255,255,.06); border-radius: 50%; }
.landing::after { content: ""; position: absolute; bottom: -100px; left: -60px; width: 200px; height: 200px; background: rgba(255,255,255,.04); border-radius: 50%; }
.landing .logo-icon { width: 72px; height: 72px; background: rgba(255,255,255,.15); border-radius: 20px; display: flex; align-items: center; justify-content: center; font-size: 34px; margin-bottom: 18px; backdrop-filter: blur(8px); border: 1px solid rgba(255,255,255,.2); z-index: 1; }
.landing .landing-logo-img { width: 84px; height: 84px; border-radius: 20px; object-fit: cover; background: rgba(255,255,255,.15); margin-bottom: 18px; border: 3px solid rgba(255,255,255,.3); box-shadow: 0 8px 24px rgba(0,0,0,.2); z-index: 1; }
.landing h1 { font-size: 30px; margin-bottom: 6px; text-align: center; font-weight: 800; z-index: 1; }
.landing .tagline { opacity: .9; margin-bottom: 36px; text-align: center; font-size: 15px; z-index: 1; }
.feature-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; width: 100%; margin-bottom: 32px; z-index: 1; }
.feature-tile { background: rgba(255,255,255,.12); border-radius: var(--radius); padding: 24px 12px; text-align: center; backdrop-filter: blur(8px); border: 1px solid rgba(255,255,255,.15); transition: var(--transition); }
.feature-tile:hover { background: rgba(255,255,255,.18); transform: translateY(-3px); }
.feature-tile .ico { font-size: 30px; margin-bottom: 8px; }
.feature-tile .lbl { font-size: 14px; font-weight: 600; }
.landing-actions { width: 100%; display: flex; flex-direction: column; gap: 12px; z-index: 1; }
.landing-actions .btn-light { background: #fff; color: var(--text); }

/* Auth */
.auth-page { min-height: 100vh; background: linear-gradient(180deg, var(--bg) 0%, #e5e7eb 100%); display: flex; flex-direction: column; align-items: center; padding: 40px 24px; max-width: 480px; margin: 0 auto; }
.auth-logo { width: 76px; height: 76px; border-radius: 22px; background: linear-gradient(135deg, var(--primary), var(--accent)); display: flex; align-items: center; justify-content: center; font-size: 36px; color: #fff; margin-bottom: 16px; box-shadow: 0 8px 28px rgba(22,163,74,.3); }
.auth-card { width: 100%; background: var(--card-bg); border-radius: 20px; box-shadow: var(--shadow-lg); padding: 28px 24px; }
.auth-card h2 { font-size: 24px; margin-bottom: 4px; font-weight: 800; }
.auth-card .sub { color: #6b7280; font-size: 14px; margin-bottom: 24px; }
.form-group { margin-bottom: 16px; }
.form-group label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 6px; color: #374151; }
.form-group input, .form-group select, .form-group textarea {
  width: 100%; padding: 12px 16px; border: 1.5px solid #d1d5db; border-radius: 12px; font-size: 15px; background: #fff; color: var(--text); transition: var(--transition);
}
.form-group input:focus, .form-group select:focus, .form-group textarea:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 4px rgba(22,163,74,.12); }
.auth-foot { text-align: center; margin-top: 18px; font-size: 14px; color: #6b7280; }

/* Dashboard */
.topbar { background: linear-gradient(135deg, var(--primary), var(--primary-dark)); color: #fff; padding: 18px 20px; position: sticky; top: 0; z-index: 50; }
.topbar .brand { font-size: 20px; font-weight: 700; }
.topbar .tag { font-size: 12px; opacity: .85; }
.page-body { padding: 18px 16px 90px; }
.balance-hero { background: linear-gradient(135deg, var(--primary), var(--primary-dark)); color: #fff; border-radius: 20px; padding: 26px; margin-bottom: 16px; box-shadow: var(--shadow-glow); position: relative; overflow: hidden; }
.balance-hero::after { content: ""; position: absolute; top: -40px; right: -40px; width: 140px; height: 140px; background: rgba(255,255,255,.08); border-radius: 50%; }
.balance-hero .lbl { font-size: 13px; opacity: .85; text-transform: uppercase; letter-spacing: .5px; font-weight: 600; }
.balance-hero .amt { font-size: 34px; font-weight: 800; margin: 6px 0 16px; }
.salary-banner { background: linear-gradient(135deg, #ec4899, #f97316); color: #fff; border-radius: 16px; padding: 18px; margin-bottom: 16px; display: flex; align-items: center; justify-content: space-between; box-shadow: 0 4px 16px rgba(236,72,153,.2); }
.salary-banner .badge { background: rgba(255,255,255,.25); padding: 3px 10px; border-radius: 20px; font-size: 11px; font-weight: 700; }
.stat-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 16px; }
.stat-box { background: var(--card-bg); border-radius: 14px; padding: 16px; box-shadow: var(--shadow); transition: var(--transition); border: 1px solid #f0f0f0; }
.stat-box:hover { box-shadow: var(--shadow-lg); transform: translateY(-2px); }
.stat-box .ico { font-size: 22px; }
.stat-box .name { font-size: 12px; color: #6b7280; margin: 4px 0; font-weight: 500; }
.stat-box .val { font-size: 18px; font-weight: 700; }

/* WhatsApp / Telegram cards */
.channel-card { border-radius: 16px; padding: 18px; margin-bottom: 14px; color: #fff; transition: var(--transition); }
.channel-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.channel-wa { background: linear-gradient(135deg, #25d366, #128c7e); }
.channel-tg { background: linear-gradient(135deg, #2aabee, #229ed9); }
.channel-card .row { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.channel-card .ico { width: 42px; height: 42px; background: rgba(255,255,255,.2); border-radius: 12px; display: flex; align-items: center; justify-content: center; font-size: 20px; }
.channel-card h3 { font-size: 16px; }
.channel-card p { font-size: 12px; opacity: .9; margin-top: 2px; }
.channel-card .actions { display: flex; gap: 8px; }
.channel-card .actions .btn { padding: 9px 14px; font-size: 13px; background: rgba(255,255,255,.2); color: #fff; border: 1px solid rgba(255,255,255,.3); width: auto; }
.reward-badge { background: #fff; color: var(--primary); padding: 4px 10px; border-radius: 20px; font-size: 12px; font-weight: 700; }

/* Bottom nav */
.bottom-nav { position: fixed; bottom: 0; left: 50%; transform: translateX(-50%); width: 100%; max-width: 480px; background: var(--card-bg); border-top: 1px solid #e5e7eb; display: flex; justify-content: space-around; padding: 8px 0; z-index: 100; box-shadow: 0 -2px 16px rgba(0,0,0,.06); }
.bottom-nav a { display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: 11px; color: #9ca3af; text-decoration: none; padding: 4px; flex: 1; transition: var(--transition); }
.bottom-nav a .nav-ico { font-size: 22px; }
.bottom-nav a.active { color: var(--primary); }
.bottom-nav a:hover { text-decoration: none; color: var(--primary); }

/* Back header */
.back-header { display: flex; align-items: center; gap: 12px; padding: 16px 18px; background: var(--card-bg); border-bottom: 1px solid #f0f0f0; position: sticky; top: 0; z-index: 40; box-shadow: 0 1px 3px rgba(0,0,0,.04); }
.back-header a { color: var(--text); font-size: 22px; transition: var(--transition); }
.back-header a:hover { color: var(--primary); }
.back-header .title { font-size: 20px; font-weight: 700; }

/* Packages */
.pkg-card { background: var(--card-bg); border-radius: 18px; overflow: hidden; margin-bottom: 16px; box-shadow: var(--shadow-lg); transition: var(--transition); }
.pkg-card:hover { transform: translateY(-3px); box-shadow: 0 14px 40px rgba(0,0,0,.12); }
.pkg-head { background: linear-gradient(135deg, #f97316, #ea580c); color: #fff; padding: 18px; }
.pkg-head .name { font-size: 18px; font-weight: 700; }
.pkg-head .meta { font-size: 13px; opacity: .9; }
.pkg-stats { display: flex; padding: 16px; gap: 8px; }
.pkg-stat { flex: 1; text-align: center; }
.pkg-stat .v { font-size: 18px; font-weight: 700; color: var(--primary); }
.pkg-stat .l { font-size: 11px; color: #6b7280; text-transform: uppercase; }
.pkg-features { padding: 0 16px 8px; }
.pkg-features li { list-style: none; padding: 7px 0; font-size: 14px; display: flex; align-items: center; gap: 8px; }
.pkg-features li::before { content: "✓"; color: var(--primary); font-weight: 700; }
.pkg-actions { padding: 0 16px 16px; }

/* Invite */
.ref-code-box { background: linear-gradient(135deg, var(--primary), var(--primary-dark)); color: #fff; border-radius: 16px; padding: 18px; text-align: center; margin-bottom: 16px; box-shadow: var(--shadow-glow); }
.ref-code-box .code { font-size: 26px; font-weight: 800; letter-spacing: 2px; margin: 6px 0; }
.level-row { display: flex; align-items: center; justify-content: space-between; padding: 12px 0; border-bottom: 1px solid #f3f4f6; }
.level-row .lvl { display: flex; align-items: center; gap: 10px; }
.level-badge { width: 34px; height: 34px; border-radius: 10px; background: var(--primary); color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 14px; }
.level-locked { background: #d1d5db; }
.level-reward { background: #fee2e2; color: #dc2626; padding: 4px 12px; border-radius: 8px; font-weight: 700; font-size: 13px; }

/* History table */
.hist-item { background: var(--card-bg); border-radius: 14px; padding: 14px 16px; margin-bottom: 10px; display: flex; justify-content: space-between; align-items: center; box-shadow: var(--shadow); transition: var(--transition); border: 1px solid #f0f0f0; }
.hist-item:hover { box-shadow: var(--shadow-lg); }
.hist-item .left .desc { font-size: 14px; font-weight: 600; }
.hist-item .left .date { font-size: 12px; color: #9ca3af; }
.hist-item .right .amt { font-weight: 700; }
.amt-pos { color: var(--primary); }
.amt-neg { color: #ef4444; }

/* Status badges */
.badge-status { padding: 4px 12px; border-radius: 20px; font-size: 12px; font-weight: 600; }
.badge-pending { background: #fef3c7; color: #b45309; }
.badge-approved { background: #d1fae5; color: #065f46; }
.badge-rejected { background: #fee2e2; color: #991b1b; }

/* Toast / flash */
.toast-wrap { position: fixed; top: 16px; left: 50%; transform: translateX(-50%); z-index: 9999; width: 92%; max-width: 440px; }
.toast { padding: 14px 18px; border-radius: 12px; margin-bottom: 8px; color: #fff; font-size: 14px; font-weight: 500; box-shadow: 0 8px 24px rgba(0,0,0,.25); animation: slideIn .3s; }
.toast-success { background: linear-gradient(135deg, #16a34a, #15803d); }
.toast-danger { background: linear-gradient(135deg, #ef4444, #dc2626); }
.toast-warning { background: linear-gradient(135deg, #f59e0b, #d97706); }
.toast-info { background: linear-gradient(135deg, #3b82f6, #2563eb); }
@keyframes slideIn { from { opacity: 0; transform: translateY(-12px); } to { opacity: 1; transform: translateY(0); } }

/* Modal */
.modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,.55); z-index: 200; display: flex; align-items: center; justify-content: center; padding: 20px; backdrop-filter: blur(4px); }
.modal { background: var(--card-bg); border-radius: 20px; max-width: 420px; width: 100%; max-height: 85vh; overflow-y: auto; padding: 24px; box-shadow: var(--shadow-lg); position: relative; }
.modal h3 { font-size: 20px; margin-bottom: 12px; }

/* Empty state */
.empty { text-align: center; padding: 48px 20px; color: #9ca3af; }
.empty .ico { font-size: 44px; margin-bottom: 12px; }

/* Profile */
.profile-header { background: linear-gradient(135deg, var(--primary), var(--primary-dark)); color: #fff; padding: 32px 20px; text-align: center; border-radius: 0 0 24px 24px; position: relative; overflow: hidden; }
.profile-header::after { content: ""; position: absolute; top: -30px; right: -30px; width: 120px; height: 120px; background: rgba(255,255,255,.08); border-radius: 50%; }
.profile-avatar { width: 76px; height: 76px; border-radius: 50%; background: rgba(255,255,255,.25); display: flex; align-items: center; justify-content: center; font-size: 34px; margin: 0 auto 10px; border: 3px solid rgba(255,255,255,.3); }
.menu-item { display: flex; align-items: center; gap: 12px; padding: 16px; background: var(--card-bg); border-bottom: 1px solid #f3f4f6; cursor: pointer; transition: var(--transition); }
.menu-item:hover { background: #f9fafb; padding-left: 20px; }
.menu-item .ico { font-size: 20px; color: var(--primary); width: 28px; text-align: center; }
.menu-item .label { flex: 1; font-size: 15px; font-weight: 500; }
.menu-item .arrow { color: #d1d5db; }
.menu-item.danger .label, .menu-item.danger .ico { color: #ef4444; }
.menu-section-title { font-size: 12px; font-weight: 700; text-transform: uppercase; color: #9ca3af; padding: 14px 18px 6px; }

/* Salary */
.salary-hero { background: linear-gradient(135deg, #1e40af, #2563eb); color: #fff; border-radius: 20px; padding: 26px; text-align: center; margin-bottom: 16px; box-shadow: 0 6px 24px rgba(37,99,235,.25); }
.salary-level-row { background: var(--card-bg); border-radius: 14px; padding: 14px 16px; margin-bottom: 10px; display: flex; align-items: center; justify-content: space-between; box-shadow: var(--shadow); transition: var(--transition); }
.salary-level-row:hover { box-shadow: var(--shadow-lg); }

/* Welcome modal banner (Urdu-style rewards) */
.welcome-modal { text-align: center; }
.welcome-modal .reward-table { width: 100%; margin: 16px 0; }
.welcome-modal .reward-table td { padding: 8px; font-size: 14px; }

/* Modal close (X) button */
.modal-close { position: absolute; top: 14px; right: 16px; width: 32px; height: 32px; border-radius: 50%; background: rgba(0,0,0,.08); color: #555; display: flex; align-items: center; justify-content: center; font-size: 18px; cursor: pointer; border: none; transition: var(--transition); }
.modal-close:hover { background: rgba(0,0,0,.15); transform: rotate(90deg); }

/* === App Header (logo + name + title + bell icon) === */
.app-header { background: linear-gradient(135deg, var(--primary), var(--primary-dark)); color: #fff; padding: 12px 16px; position: sticky; top: 0; z-index: 90; display: flex; align-items: center; justify-content: space-between; gap: 12px; max-width: 480px; margin: 0 auto; width: 100%; box-shadow: 0 2px 12px rgba(0,0,0,.1); }
.app-header-left { display: flex; align-items: center; gap: 10px; min-width: 0; }
.app-header-logo { width: 38px; height: 38px; border-radius: 10px; object-fit: cover; background: rgba(255,255,255,.2); flex-shrink: 0; border: 1px solid rgba(255,255,255,.2); }
.app-header-logo-placeholder { width: 38px; height: 38px; border-radius: 10px; background: rgba(255,255,255,.2); display: flex; align-items: center; justify-content: center; font-size: 20px; flex-shrink: 0; }
.app-header-text { min-width: 0; overflow: hidden; }
.app-header-name { font-size: 16px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.app-header-title { font-size: 11px; opacity: .85; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.app-header-right { position: relative; flex-shrink: 0; }
.bell-btn { background: rgba(255,255,255,.18); border: 1px solid rgba(255,255,255,.15); width: 40px; height: 40px; border-radius: 50%; cursor: pointer; position: relative; display: flex; align-items: center; justify-content: center; transition: var(--transition); }
.bell-btn:hover { background: rgba(255,255,255,.3); transform: scale(1.05); }
.bell-ico { font-size: 18px; }
.bell-dot { position: absolute; top: 4px; right: 4px; width: 8px; height: 8px; background: #ef4444; border-radius: 50%; border: 2px solid var(--primary); }

/* Notification dropdown */
.notif-dropdown { position: absolute; top: 48px; right: 0; width: 320px; max-width: calc(100vw - 32px); background: var(--card-bg); border-radius: 16px; box-shadow: var(--shadow-lg); z-index: 200; display: none; overflow: hidden; max-height: 420px; }
.notif-dropdown.open { display: block; animation: slideIn .2s; }
.notif-header { display: flex; justify-content: space-between; align-items: center; padding: 14px 16px; border-bottom: 1px solid #f0f0f0; font-weight: 700; color: var(--text); }
.notif-close { cursor: pointer; font-size: 16px; color: #999; }
.notif-body { max-height: 340px; overflow-y: auto; }
.notif-item { display: flex; gap: 10px; padding: 12px 16px; border-bottom: 1px solid #f5f5f5; transition: var(--transition); }
.notif-item:hover { background: #f9fafb; }
.notif-ico { width: 38px; height: 38px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 16px; color: #fff; flex-shrink: 0; }
.notif-content { min-width: 0; flex: 1; }
.notif-title { font-size: 13px; font-weight: 600; color: var(--text); }
.notif-body-txt { font-size: 12px; color: #6b7280; margin-top: 2px; }
.notif-time { font-size: 11px; color: #9ca3af; margin-top: 3px; }
.notif-empty, .notif-loading { text-align: center; padding: 28px 16px; color: #9ca3af; font-size: 14px; }

/* Notification numeric unread count badge */
.bell-count { position: absolute; top: -4px; right: -4px; min-width: 18px; height: 18px; padding: 0 4px; background: #ef4444; color: #fff; border-radius: 9px; border: 2px solid var(--primary); font-size: 11px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; line-height: 1; }
.notif-markread { cursor: pointer; font-size: 12px; color: var(--primary, #16a34a); font-weight: 600; margin-left: auto; margin-right: 10px; }
.notif-markread:hover { text-decoration: underline; }
.notif-item-read { opacity: .6; }
.notif-item-read .notif-title { font-weight: 500; }

/* Withdraw eligibility rows */
.elig-row { display: flex; justify-content: space-between; align-items: center; background: #fff; border-radius: 10px; padding: 10px 12px; border: 1px solid #f1f5f9; }
.elig-label { font-size: 13px; color: #334155; font-weight: 500; }
.elig-value { font-size: 13px; font-weight: 700; }
.elig-met { color: #15803d; }
.elig-unmet { color: #b45309; }

/* Completed reward card */
.reward-card-completed { border: 2px solid #fcd34d; background: #fffbeb; }

/* === Claim Rewards page === */
.reward-card { margin-bottom: 14px; }
.reward-card-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; }
.reward-pkg-name { font-size: 17px; font-weight: 700; color: var(--text); }
.reward-days-badge { background: rgba(22,163,74,.12); color: #16a34a; padding: 4px 12px; border-radius: 20px; font-size: 12px; font-weight: 600; }
.reward-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 14px; }
.reward-stat { background: #f9fafb; border-radius: 12px; padding: 10px 12px; }
.reward-stat-lbl { font-size: 11px; color: #9ca3af; text-transform: uppercase; letter-spacing: .3px; }
.reward-stat-val { font-size: 15px; font-weight: 700; margin-top: 3px; color: var(--text); }
.reward-progress-wrap { background: #e5e7eb; border-radius: 10px; height: 8px; overflow: hidden; }
.reward-progress-bar { background: linear-gradient(90deg, var(--primary), var(--accent)); height: 100%; border-radius: 10px; transition: width .3s; }
.reward-claim-area { margin-top: 14px; }
.reward-claim-btn { width: 100%; font-size: 16px; font-weight: 700; padding: 14px; }

/* ============================================================ */
/* === Payment / Deposit Page === */
/* ============================================================ */
.pay-method-grid { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 10px; }
.pay-method-btn { background: var(--card-bg); border: 2px solid #e5e7eb; border-radius: 14px; padding: 16px 8px; cursor: pointer; text-align: center; transition: var(--transition); position: relative; display: flex; flex-direction: column; align-items: center; gap: 6px; }
.pay-method-btn:hover { border-color: var(--primary); transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.pay-method-btn.selected { border-color: var(--primary); background: linear-gradient(135deg, rgba(22,163,74,.06), rgba(22,163,74,.02)); box-shadow: 0 4px 16px rgba(22,163,74,.18); }
.pay-method-icon { display: flex; align-items: center; justify-content: center; }
.pay-method-name { font-size: 13px; font-weight: 700; color: var(--text); }
.pay-method-sub { font-size: 10px; color: #9ca3af; }
.pay-method-check { position: absolute; top: 8px; right: 8px; width: 22px; height: 22px; border-radius: 50%; background: var(--primary); color: #fff; font-size: 12px; display: none; align-items: center; justify-content: center; }
.pay-method-btn.selected .pay-method-check { display: flex; }

/* Account details box */
.pay-details-card { animation: fadeIn .3s; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
.pay-account-box { background: #f9fafb; border-radius: 12px; padding: 14px; border: 1px solid #e5e7eb; }
.pay-account-row { display: flex; justify-content: space-between; align-items: center; padding: 8px 0; border-bottom: 1px solid #f0f0f0; }
.pay-account-row:last-child { border-bottom: none; }
.pay-account-lbl { font-size: 13px; color: #6b7280; font-weight: 500; }
.pay-account-val { font-size: 14px; font-weight: 700; color: var(--text); text-align: right; }
.pay-account-val.mono { font-family: monospace; letter-spacing: .5px; }
.pay-copy-inline { background: none; border: none; cursor: pointer; font-size: 14px; padding: 2px 4px; vertical-align: middle; }

.pay-no-account { background: #fef3c7; border: 1px solid #fde68a; border-radius: 12px; padding: 14px; text-align: center; font-size: 13px; color: #b45309; }

.pay-amount-box { margin-top: 14px; background: linear-gradient(135deg, var(--primary), var(--primary-dark)); border-radius: 16px; padding: 18px; text-align: center; color: #fff; box-shadow: var(--shadow-glow); }
.pay-amount-label { font-size: 12px; opacity: .9; text-transform: uppercase; letter-spacing: .5px; }
.pay-amount-value { font-size: 30px; font-weight: 800; margin: 6px 0 10px; }
.pay-copy-btn { background: rgba(255,255,255,.2); border: 1px solid rgba(255,255,255,.2); color: #fff; padding: 6px 16px; border-radius: 8px; font-size: 13px; cursor: pointer; transition: var(--transition); }
.pay-copy-btn:hover { background: rgba(255,255,255,.35); }

/* QR Code + Till ID + Save QR section */
.pay-qr-box { margin-top: 14px; background: var(--card-bg); border: 1px solid #e5e7eb; border-radius: 16px; padding: 18px; text-align: center; animation: fadeIn .3s; box-shadow: var(--shadow); }
.pay-qr-label { font-size: 13px; font-weight: 700; color: var(--text); margin-bottom: 12px; text-transform: uppercase; letter-spacing: .5px; }
.pay-qr-img-wrap { display: flex; justify-content: center; align-items: center; margin-bottom: 14px; }
.pay-qr-img { width: 220px; height: 220px; object-fit: contain; border-radius: 12px; border: 1px solid #e5e7eb; background: #fff; padding: 8px; }
.pay-till-row { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 12px; background: #f9fafb; border-radius: 12px; border: 1px solid #e5e7eb; margin-bottom: 12px; }
.pay-till-lbl { font-size: 11px; color: #6b7280; font-weight: 600; text-transform: uppercase; letter-spacing: .5px; }
.pay-till-val { font-size: 16px; font-weight: 800; color: var(--text); display: flex; align-items: center; gap: 6px; }
.pay-till-val.mono { font-family: monospace; letter-spacing: 1px; }
.pay-copy-inline { background: none; border: 1px solid #e5e7eb; border-radius: 8px; cursor: pointer; font-size: 16px; padding: 4px 8px; vertical-align: middle; transition: var(--transition); color: var(--primary); }
.pay-copy-inline:hover { background: var(--primary); color: #fff; border-color: var(--primary); }
.pay-copy-inline.copied { background: var(--primary); color: #fff; border-color: var(--primary); }
.pay-save-qr-btn { display: inline-flex; align-items: center; gap: 6px; background: var(--primary); color: #fff; border: none; border-radius: 10px; padding: 10px 20px; font-size: 14px; font-weight: 700; cursor: pointer; transition: var(--transition); box-shadow: 0 4px 12px rgba(22,163,74,.25); }
.pay-save-qr-btn:hover { background: var(--primary-dark); transform: translateY(-1px); box-shadow: 0 6px 18px rgba(22,163,74,.35); }
.pay-save-qr-btn:active { transform: translateY(0); }
.pay-qr-hint { font-size: 12px; color: #9ca3af; margin-top: 8px; }

/* How to Pay button (Round 3) */
.pay-howto-box { margin-top: 14px; text-align: center; animation: fadeIn .3s; }
.pay-howto-btn { display: inline-flex; align-items: center; gap: 8px; background: linear-gradient(135deg, #ff0000, #cc0000); color: #fff; border: none; border-radius: 12px; padding: 14px 28px; font-size: 15px; font-weight: 800; cursor: pointer; transition: var(--transition); box-shadow: 0 4px 14px rgba(255,0,0,.30); text-decoration: none; }
.pay-howto-btn:hover { transform: translateY(-2px); box-shadow: 0 6px 20px rgba(255,0,0,.40); }
.pay-howto-btn:active { transform: translateY(0); }
.pay-howto-ico { font-size: 18px; line-height: 1; }
.pay-instructions-box { margin-top: 12px; background: #eff6ff; border: 1px solid #bfdbfe; border-radius: 12px; padding: 12px 14px; text-align: left; font-size: 12px; color: #1e40af; line-height: 1.6; }
.pay-instructions-box strong { display: block; margin-bottom: 4px; }

/* Payment proof upload */
.pay-divider { text-align: center; margin: 18px 0; position: relative; }
.pay-divider span { background: var(--card-bg); padding: 0 12px; font-size: 13px; color: #9ca3af; position: relative; z-index: 1; }
.pay-divider::before { content: ""; position: absolute; top: 50%; left: 0; right: 0; height: 1px; background: #e5e7eb; }

.pay-upload-area { border: 2px dashed #d1d5db; border-radius: 14px; padding: 24px 16px; text-align: center; cursor: pointer; transition: var(--transition); background: #fafafa; }
.pay-upload-area:hover { border-color: var(--primary); background: #f0fdf4; }

.pay-submit-btn { width: 100%; margin-top: 16px; font-size: 16px; font-weight: 700; padding: 16px; }
.pay-submit-btn:disabled { opacity: .5; cursor: not-allowed; }

/* ============================================================ */
/* === Thank You Page === */
/* ============================================================ */
.thankyou-wrap { text-align: center; padding: 30px 20px; }
.thankyou-icon-circle { width: 96px; height: 96px; border-radius: 50%; background: linear-gradient(135deg, var(--primary), var(--primary-dark)); margin: 0 auto 20px; display: flex; align-items: center; justify-content: center; box-shadow: 0 8px 28px rgba(22,163,74,.35); animation: popIn .4s; }
@keyframes popIn { from { transform: scale(0); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.thankyou-checkmark { font-size: 50px; color: #fff; line-height: 1; }
.thankyou-title { font-size: 28px; font-weight: 800; color: var(--text); margin-bottom: 6px; }
.thankyou-subtitle { font-size: 15px; color: #6b7280; margin-bottom: 24px; }

.thankyou-receipt { background: var(--card-bg); border-radius: 16px; padding: 20px; box-shadow: var(--shadow); margin-bottom: 20px; text-align: left; }
.thankyou-receipt-row { display: flex; justify-content: space-between; align-items: center; padding: 10px 0; border-bottom: 1px solid #f3f4f6; font-size: 14px; }
.thankyou-receipt-row:last-child { border-bottom: none; }
.thankyou-receipt-row span:first-child { color: #6b7280; }
.thankyou-receipt-row span:last-child { font-weight: 600; color: var(--text); }
.thankyou-receipt-row .mono { font-family: monospace; }
.thankyou-amount { color: var(--primary) !important; font-size: 16px !important; font-weight: 800 !important; }
.thankyou-status-pending { color: #f59e0b !important; }
.thankyou-screenshot-link { color: var(--primary); text-decoration: underline; font-size: 13px; }

.thankyou-info-box { background: #eff6ff; border: 1px solid #bfdbfe; border-radius: 12px; padding: 16px; margin-bottom: 24px; text-align: left; font-size: 13px; color: #1e40af; line-height: 1.6; }

.thankyou-actions { display: flex; flex-direction: column; gap: 10px; }
.thankyou-btn { width: 100%; padding: 14px; font-size: 15px; font-weight: 600; }

/* ============================================================ */
/* === Admin Logo Preview === */
/* ============================================================ */
.logo-preview-box { display: flex; flex-direction: column; align-items: center; gap: 8px; margin-bottom: 20px; }
.logo-preview-img { width: 80px; height: 80px; border-radius: 12px; object-fit: cover; border: 2px solid #e2e8f0; background: #f8fafc; }
.logo-preview-placeholder { width: 80px; height: 80px; border-radius: 12px; background: #f1f5f9; display: flex; align-items: center; justify-content: center; font-size: 36px; border: 2px dashed #cbd5e1; }
.logo-preview-label { font-size: 12px; color: #94a3b8; font-weight: 600; }
.admin-file-input { padding: 10px; border: 2px dashed #cbd5e1; border-radius: 8px; background: #f8fafc; }
.admin-proof-link { color: var(--primary); font-size: 13px; text-decoration: none; font-weight: 600; }
.admin-proof-link:hover { text-decoration: underline; }

/* Responsive payment grid */
@media (max-width: 380px) {
  .pay-method-grid { grid-template-columns: 1fr 1fr; }
}

/* ============================================================ */
/* === COMPREHENSIVE MOBILE RESPONSIVE === */
/* ============================================================ */

/* Small phones (360px and below) */
@media (max-width: 360px) {
  .app-wrap { max-width: 100%; }
  .page-body { padding: 14px 12px 90px; }
  .balance-hero { padding: 20px 16px; }
  .balance-hero .amt { font-size: 28px; }
  .stat-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .stat-box { padding: 14px 12px; }
  .stat-box .val { font-size: 16px; }
  .card { padding: 16px 14px; }
  .btn { padding: 11px 16px; font-size: 14px; }
  .landing { padding: 36px 18px 28px; }
  .landing h1 { font-size: 24px; }
  .landing .landing-logo-img { width: 70px; height: 70px; }
  .landing .logo-icon { width: 56px; height: 56px; font-size: 26px; }
  .feature-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .feature-tile { padding: 18px 8px; }
  .feature-tile .ico { font-size: 24px; }
  .feature-tile .lbl { font-size: 12px; }
  .auth-page { padding: 30px 18px; }
  .auth-card { padding: 22px 18px; }
  .auth-card h2 { font-size: 20px; }
  .app-header { padding: 10px 12px; gap: 8px; }
  .app-header-logo, .app-header-logo-placeholder { width: 32px; height: 32px; }
  .app-header-name { font-size: 14px; }
  .app-header-title { font-size: 10px; }
  .bell-btn { width: 34px; height: 34px; }
  .bell-ico { font-size: 16px; }
  .pkg-head { padding: 14px; }
  .pkg-head .name { font-size: 16px; }
  .pkg-stats { padding: 12px; gap: 4px; }
  .pkg-stat .v { font-size: 15px; }
  .pkg-stat .l { font-size: 10px; }
  .pkg-features li { font-size: 13px; }
  .ref-code-box { padding: 16px; }
  .ref-code-box .code { font-size: 20px; letter-spacing: 1.5px; }
  .notif-dropdown { width: 280px; max-width: calc(100vw - 24px); }
  .notif-item { padding: 10px 12px; }
  .notif-ico { width: 32px; height: 32px; font-size: 14px; }
  .notif-title { font-size: 12px; }
  .notif-body-txt { font-size: 11px; }
  .bottom-nav a { font-size: 10px; }
  .bottom-nav a .nav-ico { font-size: 18px; }
  .back-header { padding: 14px 14px; }
  .back-header .title { font-size: 18px; }
  .modal { padding: 20px 16px; max-width: 380px; }
  .modal h3 { font-size: 18px; }
  .form-group input, .form-group select, .form-group textarea { padding: 10px 12px; font-size: 14px; }
  .salary-banner { padding: 16px; }
  .salary-banner .badge { font-size: 10px; }
  .profile-header { padding: 24px 16px; }
  .profile-avatar { width: 60px; height: 60px; font-size: 28px; }
  .menu-item { padding: 14px 16px; gap: 10px; }
  .menu-item .ico { font-size: 18px; }
  .menu-item .label { font-size: 14px; }
  .pay-method-grid { grid-template-columns: 1fr 1fr; gap: 8px; }
  .pay-method-btn { padding: 14px 6px; }
  .pay-method-name { font-size: 12px; }
  .pay-amount-value { font-size: 24px; }
  .thankyou-title { font-size: 24px; }
  .thankyou-icon-circle { width: 76px; height: 76px; }
  .thankyou-checkmark { font-size: 40px; }
  .reward-stats { grid-template-columns: 1fr 1fr; gap: 8px; }
  .reward-stat { padding: 8px 10px; }
  .reward-stat-val { font-size: 14px; }
}

/* Very small phones (320px and below) */
@media (max-width: 320px) {
  .page-body { padding: 12px 10px 86px; }
  .balance-hero { padding: 18px 14px; }
  .balance-hero .amt { font-size: 24px; }
  .stat-grid { gap: 8px; }
  .stat-box { padding: 12px 10px; }
  .stat-box .val { font-size: 15px; }
  .stat-box .name { font-size: 11px; }
  .card { padding: 14px 12px; }
  .btn { padding: 10px 14px; font-size: 13px; }
  .landing h1 { font-size: 22px; }
  .feature-grid { gap: 8px; }
  .feature-tile { padding: 14px 6px; }
  .feature-tile .lbl { font-size: 11px; }
  .app-header { padding: 8px 10px; gap: 6px; }
  .app-header-logo, .app-header-logo-placeholder { width: 28px; height: 28px; }
  .app-header-name { font-size: 13px; }
  .app-header-title { font-size: 9px; }
  .bell-btn { width: 32px; height: 32px; }
  .bottom-nav a { font-size: 9px; }
  .bottom-nav a .nav-ico { font-size: 16px; }
  .pay-method-grid { grid-template-columns: 1fr 1fr; }
  .pay-method-name { font-size: 11px; }
  .pay-amount-value { font-size: 22px; }
  .thankyou-title { font-size: 22px; }
  .notif-dropdown { width: 260px; max-width: calc(100vw - 20px); }
}

/* Landscape orientation on phones */
@media (max-height: 500px) and (orientation: landscape) {
  .page-body { padding-bottom: 70px; }
  .bottom-nav { padding: 6px 0; }
  .bottom-nav a { font-size: 10px; }
  .bottom-nav a .nav-ico { font-size: 16px; }
  .landing { padding: 20px 18px 24px; }
  .auth-page { padding: 20px 18px; }
  .balance-hero { padding: 16px; margin-bottom: 12px; }
  .balance-hero .amt { font-size: 26px; }
}

/* Tablet and up (481px+) - widen the app container */
@media (min-width: 481px) {
  .app-wrap { max-width: 480px; box-shadow: 0 0 40px rgba(0,0,0,.06); }
}

/* Desktop (768px+) - center the mobile-style app in a nice frame */
@media (min-width: 768px) {
  body { background: #e5e7eb; }
  .app-wrap { box-shadow: 0 0 60px rgba(0,0,0,.12); border-radius: 0; }
  .bottom-nav { box-shadow: 0 -2px 20px rgba(0,0,0,.06); }
}

/* Large desktop (1024px+) */
@media (min-width: 1024px) {
  .app-wrap { max-width: 520px; }
}

/* High-DPI screens - sharper fonts */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
  body { -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }
}

/* Touch-friendly: increase tap targets on touch devices */
@media (hover: none) and (pointer: coarse) {
  .btn { padding: 13px 20px; }
  .menu-item { padding: 16px 18px; }
  .bell-btn { width: 40px; height: 40px; }
  .notif-markread { padding: 4px 8px; }
  .back-header a { font-size: 24px; padding: 4px; }
  .pay-method-btn { padding: 18px 8px; }
  .bottom-nav a { padding: 6px 4px; }
}

/* Dark mode preference (for site_unavailable and developer pages) */
@media (prefers-color-scheme: dark) {
  .site-unavailable-body, .developer-body { color-scheme: dark; }
}

/* Scrollbar styling */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: #f1f5f9; }
::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: #94a3b8; }

/* Selection color */
::selection { background: rgba(22,163,74,.2); color: var(--text); }

/* ============================================================ */
/* === DARK MODE (user-selectable) === */
/* Override all colors when html[data-theme="dark"] is set.   */
/* ============================================================ */
html[data-theme="dark"] {
  --bg: #0f172a;
  --card-bg: #1e293b;
  --text: #e2e8f0;
  --primary: #22c55e;
  --primary-dark: #16a34a;
  --accent: #f59e0b;
}
html[data-theme="dark"] body { background: var(--bg); color: var(--text); }
html[data-theme="dark"] .page-body { background: var(--bg); }
html[data-theme="dark"] .card { background: var(--card-bg); border-color: #334155; box-shadow: 0 2px 12px rgba(0,0,0,.4); }
html[data-theme="dark"] .btn-primary { background: linear-gradient(135deg, var(--primary), var(--primary-dark)); }
html[data-theme="dark"] .btn-secondary { background: #334155; color: var(--text); border-color: #475569; }
html[data-theme="dark"] .form-group input,
html[data-theme="dark"] .form-group select,
html[data-theme="dark"] .form-group textarea {
  background: #0f172a; border-color: #334155; color: var(--text);
}
html[data-theme="dark"] .form-group input::placeholder { color: #64748b; }
html[data-theme="dark"] .form-group input:focus,
html[data-theme="dark"] .form-group select:focus,
html[data-theme="dark"] .form-group textarea:focus { border-color: var(--primary); }
html[data-theme="dark"] .menu-item { background: var(--card-bg); border-bottom-color: #334155; }
html[data-theme="dark"] .menu-item:hover { background: #283548; }
html[data-theme="dark"] .menu-section-title { color: #64748b; }
html[data-theme="dark"] .balance-hero { background: linear-gradient(135deg, var(--primary), var(--primary-dark)); }
html[data-theme="dark"] .stat-box { background: var(--card-bg); box-shadow: 0 2px 10px rgba(0,0,0,.3); }
html[data-theme="dark"] .stat-box .name { color: #94a3b8; }
html[data-theme="dark"] .app-header { background: var(--card-bg); border-bottom-color: #334155; box-shadow: 0 2px 12px rgba(0,0,0,.3); }
html[data-theme="dark"] .app-header-title { color: #94a3b8; }
html[data-theme="dark"] .bottom-nav { background: var(--card-bg); border-top-color: #334155; box-shadow: 0 -2px 16px rgba(0,0,0,.4); }
html[data-theme="dark"] .bottom-nav a { color: #64748b; }
html[data-theme="dark"] .bottom-nav a.active { color: var(--primary); }
html[data-theme="dark"] .bottom-nav a.active .nav-ico { background: rgba(34,197,94,.15); }
html[data-theme="dark"] .back-header { background: var(--card-bg); border-bottom-color: #334155; }
html[data-theme="dark"] .back-header .title { color: var(--text); }
html[data-theme="dark"] .notif-dropdown { background: var(--card-bg); border-color: #334155; box-shadow: 0 8px 30px rgba(0,0,0,.5); }
html[data-theme="dark"] .notif-item { border-bottom-color: #334155; }
html[data-theme="dark"] .notif-item.unread { background: rgba(34,197,94,.08); }
html[data-theme="dark"] .auth-card { background: var(--card-bg); box-shadow: 0 10px 40px rgba(0,0,0,.5); }
html[data-theme="dark"] .auth-card .form-group input { background: #0f172a; }
html[data-theme="dark"] .pkg-card { background: var(--card-bg); box-shadow: 0 4px 20px rgba(0,0,0,.4); }
html[data-theme="dark"] .pkg-card.active { border-color: var(--primary); }
html[data-theme="dark"] .pkg-features li { color: var(--text); }
html[data-theme="dark"] .pkg-features li::before { color: var(--primary); }
html[data-theme="dark"] .pay-account-box,
html[data-theme="dark"] .pay-till-row { background: #0f172a; border-color: #334155; }
html[data-theme="dark"] .pay-account-lbl { color: #94a3b8; }
html[data-theme="dark"] .pay-qr-box { background: var(--card-bg); border-color: #334155; }
html[data-theme="dark"] .pay-qr-img { background: #fff; }
html[data-theme="dark"] .pay-instructions-box { background: rgba(59,130,246,.15); border-color: #1e40af; color: #93c5fd; }
html[data-theme="dark"] .pay-upload-area { background: #0f172a; border-color: #334155; }
html[data-theme="dark"] .pay-upload-area:hover { border-color: var(--primary); background: rgba(34,197,94,.08); }
html[data-theme="dark"] .pay-divider span { background: var(--card-bg); color: #64748b; }
html[data-theme="dark"] .pay-divider::before { background: #334155; }
html[data-theme="dark"] .pay-no-account { background: rgba(245,158,11,.12); border-color: #b45309; color: #fbbf24; }
html[data-theme="dark"] .pay-method-btn { background: var(--card-bg); border-color: #334155; }
html[data-theme="dark"] .pay-method-sub { color: #64748b; }
html[data-theme="dark"] .toast { background: var(--card-bg); color: var(--text); border: 1px solid #334155; box-shadow: 0 4px 16px rgba(0,0,0,.4); }
html[data-theme="dark"] .modal { background: var(--card-bg); color: var(--text); box-shadow: 0 20px 60px rgba(0,0,0,.6); }
html[data-theme="dark"] .thankyou-receipt { background: var(--card-bg); box-shadow: 0 4px 20px rgba(0,0,0,.4); }
html[data-theme="dark"] .thankyou-receipt-row { border-bottom-color: #334155; }
html[data-theme="dark"] .thankyou-info-box { background: rgba(59,130,246,.12); border-color: #1e40af; color: #93c5fd; }
html[data-theme="dark"] .salary-banner { background: linear-gradient(135deg, #1e293b, #0f172a); border-color: #334155; }
html[data-theme="dark"] .feature-tile { background: var(--card-bg); }
html[data-theme="dark"] .channel-card { background: var(--card-bg); }
html[data-theme="dark"] .ref-code-box { background: var(--card-bg); }
html[data-theme="dark"] .empty { color: #64748b; }
html[data-theme="dark"] .landing { background: linear-gradient(160deg, #0f172a, #1e293b); color: var(--text); }
html[data-theme="dark"] .landing .logo-icon { background: linear-gradient(135deg, var(--primary), var(--primary-dark)); }
html[data-theme="dark"] ::-webkit-scrollbar-track { background: #1e293b; }
html[data-theme="dark"] ::-webkit-scrollbar-thumb { background: #475569; }
html[data-theme="dark"] ::-webkit-scrollbar-thumb:hover { background: #64748b; }
html[data-theme="dark"] .toast-success { border-color: var(--primary); }
html[data-theme="dark"] .toast-danger { border-color: #ef4444; }
html[data-theme="dark"] .toast-warning { border-color: #f59e0b; }

/* ============================================================ */
/* === RTL SUPPORT (Arabic / Urdu) === */
/* ============================================================ */
html[dir="rtl"] body { direction: rtl; }
html[dir="rtl"] .menu-item { flex-direction: row-reverse; text-align: right; }
html[dir="rtl"] .menu-item .arrow { transform: scaleX(-1); }
html[dir="rtl"] .bottom-nav { direction: rtl; }
html[dir="rtl"] .app-header { direction: rtl; }
html[dir="rtl"] .pay-account-row { flex-direction: row-reverse; }
html[dir="rtl"] .pay-account-val { text-align: left; }
html[dir="rtl"] .form-group input,
html[dir="rtl"] .form-group textarea { text-align: right; }
html[dir="rtl"] .back-header { direction: rtl; }
html[dir="rtl"] .stat-grid { direction: rtl; }
html[dir="rtl"] .modal { direction: rtl; text-align: right; }
html[dir="rtl"] .auth-card { direction: rtl; text-align: right; }
html[dir="rtl"] .toast-wrap { direction: rtl; }
html[dir="rtl"] .lang-accordion-trigger { text-align: right; flex-direction: row-reverse; }
html[dir="rtl"] .lang-trigger-info { align-items: flex-end; }
html[dir="rtl"] .lang-list-option { flex-direction: row-reverse; }
html[dir="rtl"] .pay-howto-btn { direction: rtl; }

/* ============================================================ */
/* === PROFILE: Theme + Language preference UI === */
/* ============================================================ */
.pref-section { background: var(--card-bg); border-radius: 14px; padding: 16px; margin-bottom: 12px; box-shadow: var(--shadow); }
.pref-section-title { font-size: 13px; font-weight: 700; color: var(--text); margin-bottom: 4px; display: flex; align-items: center; gap: 8px; }
.pref-section-desc { font-size: 12px; color: #9ca3af; margin-bottom: 14px; }
/* Theme toggle (light/dark) */
.theme-toggle-wrap { display: flex; gap: 10px; }
.theme-option { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 14px 8px; border-radius: 12px; border: 2px solid #e5e7eb; background: var(--bg); cursor: pointer; transition: var(--transition); position: relative; }
.theme-option:hover { border-color: var(--primary); transform: translateY(-1px); }
.theme-option.active { border-color: var(--primary); background: linear-gradient(135deg, rgba(34,197,94,.08), rgba(34,197,94,.02)); box-shadow: 0 4px 12px rgba(34,197,94,.15); }
.theme-option-ico { font-size: 26px; }
.theme-option-lbl { font-size: 13px; font-weight: 600; color: var(--text); }
.theme-option.active::after { content: "✓"; position: absolute; top: 6px; right: 8px; width: 18px; height: 18px; border-radius: 50%; background: var(--primary); color: #fff; font-size: 11px; display: flex; align-items: center; justify-content: center; }
/* Language selector grid */
.lang-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.lang-option { display: flex; align-items: center; gap: 10px; padding: 12px; border-radius: 12px; border: 2px solid #e5e7eb; background: var(--bg); cursor: pointer; transition: var(--transition); position: relative; }
.lang-option:hover { border-color: var(--primary); transform: translateY(-1px); }
.lang-option.active { border-color: var(--primary); background: linear-gradient(135deg, rgba(34,197,94,.08), rgba(34,197,94,.02)); box-shadow: 0 4px 12px rgba(34,197,94,.15); }
.lang-flag { font-size: 24px; }
.lang-name { font-size: 13px; font-weight: 600; color: var(--text); }
.lang-native { font-size: 11px; color: #9ca3af; }
.lang-option.active::after { content: "✓"; position: absolute; top: 6px; right: 8px; width: 18px; height: 18px; border-radius: 50%; background: var(--primary); color: #fff; font-size: 11px; display: flex; align-items: center; justify-content: center; }
/* === Language accordion (Round 3 — dropdown submenu pattern) === */
.lang-accordion { margin-top: 10px; }
.lang-accordion-trigger { width: 100%; display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-radius: 12px; border: 2px solid #e5e7eb; background: var(--bg); cursor: pointer; transition: var(--transition); text-align: left; }
.lang-accordion-trigger:hover { border-color: var(--primary); }
.lang-accordion-trigger[aria-expanded="true"] { border-color: var(--primary); box-shadow: 0 4px 12px rgba(34,197,94,.12); }
.lang-trigger-flag { font-size: 26px; flex-shrink: 0; }
.lang-trigger-info { flex: 1; display: flex; flex-direction: column; }
.lang-trigger-name { font-size: 14px; font-weight: 700; color: var(--text); }
.lang-trigger-sub { font-size: 12px; color: #9ca3af; }
.lang-trigger-chev { font-size: 22px; color: var(--primary); transition: transform .2s ease; flex-shrink: 0; line-height: 1; }
.lang-trigger-chev.rotated { transform: rotate(180deg); }
.lang-accordion-panel { margin-top: 8px; border-radius: 12px; overflow: hidden; border: 1px solid #e5e7eb; background: var(--card-bg); animation: langSlide .18s ease; }
@keyframes langSlide { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: translateY(0); } }
.lang-list { display: flex; flex-direction: column; }
.lang-list-option { width: 100%; display: flex; align-items: center; gap: 12px; padding: 14px 16px; border: none; background: transparent; cursor: pointer; transition: background .15s; text-align: left; border-bottom: 1px solid #f1f5f9; }
.lang-list-option:last-child { border-bottom: none; }
.lang-list-option:hover { background: rgba(34,197,94,.06); }
.lang-list-option.active { background: linear-gradient(135deg, rgba(34,197,94,.10), rgba(34,197,94,.03)); }
.lang-list-info { flex: 1; display: flex; flex-direction: column; }
.lang-check { color: var(--primary); font-size: 18px; font-weight: 700; flex-shrink: 0; }
/* Support / contact cards */
.support-card { display: flex; align-items: center; gap: 12px; padding: 14px; border-radius: 12px; background: var(--card-bg); border: 1px solid #e5e7eb; margin-bottom: 10px; text-decoration: none; transition: var(--transition); }
.support-card:hover { border-color: var(--primary); transform: translateY(-1px); box-shadow: var(--shadow); }
.support-ico { width: 44px; height: 44px; border-radius: 12px; display: flex; align-items: center; justify-content: center; font-size: 22px; flex-shrink: 0; }
.support-ico.wa { background: rgba(37,211,102,.12); }
.support-ico.tg { background: rgba(56,169,237,.12); }
.support-info { flex: 1; }
.support-name { font-size: 14px; font-weight: 700; color: var(--text); }
.support-desc { font-size: 12px; color: #9ca3af; }
@media (max-width: 360px) {
  .lang-grid { grid-template-columns: 1fr; }
}

/* === REWARDS PAGE (Redesigned — rw-* classes) === */
/* ============================================================ */
.rw-overview-banner { background: linear-gradient(135deg, var(--primary-dark), #052e16); border-radius: 16px; padding: 20px 18px; margin-bottom: 14px; box-shadow: var(--shadow-lg); color: #fff; }
.rw-overview-title { font-size: 14px; font-weight: 700; opacity: .9; margin-bottom: 14px; letter-spacing: .3px; }
.rw-overview-stats { display: flex; align-items: center; }
.rw-overview-stat { flex: 1; text-align: center; min-width: 0; }
.rw-overview-stat-val { font-size: 18px; font-weight: 800; line-height: 1.2; }
.rw-overview-stat-lbl { font-size: 10px; opacity: .75; margin-top: 4px; text-transform: uppercase; letter-spacing: .4px; }
.rw-overview-divider { width: 1px; height: 36px; background: rgba(255,255,255,.15); flex-shrink: 0; }
.rw-overview-meta { display: flex; gap: 18px; margin-top: 14px; padding-top: 14px; border-top: 1px solid rgba(255,255,255,.12); }
.rw-overview-meta-item { display: flex; align-items: center; gap: 6px; font-size: 12px; opacity: .9; }
.rw-overview-meta-item strong { font-weight: 800; }
.rw-meta-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.rw-meta-dot-active { background: #4ade80; box-shadow: 0 0 8px rgba(74,222,128,.6); }
.rw-meta-dot-done { background: #fbbf24; }

/* Reset time card */
.rw-reset-card { display: flex; align-items: center; justify-content: space-between; background: var(--card-bg); border-radius: 14px; padding: 14px 16px; margin-bottom: 12px; box-shadow: var(--shadow); border: 1px solid #eef2f7; }
.rw-reset-left { display: flex; align-items: center; gap: 12px; flex: 1; min-width: 0; }
.rw-reset-icon { font-size: 26px; flex-shrink: 0; }
.rw-reset-label { font-size: 11px; color: #9ca3af; text-transform: uppercase; letter-spacing: .3px; }
.rw-reset-value { font-size: 16px; font-weight: 800; color: var(--text); margin-top: 2px; }
.rw-reset-tz { font-size: 11px; color: #9ca3af; margin-top: 2px; }
.rw-reset-right { text-align: center; padding-left: 14px; border-left: 1px solid #e5e7eb; flex-shrink: 0; }
.rw-reset-count { font-size: 24px; font-weight: 800; color: var(--primary); line-height: 1; }
.rw-reset-count-lbl { font-size: 10px; color: #9ca3af; margin-top: 4px; text-transform: uppercase; letter-spacing: .3px; }

.rw-hint { font-size: 12px; color: #6b7280; text-align: center; margin-bottom: 14px; padding: 0 12px; line-height: 1.5; }

/* Package card */
.rw-pkg-card { background: var(--card-bg); border-radius: 16px; padding: 18px; margin-bottom: 14px; box-shadow: var(--shadow); border: 1px solid #eef2f7; transition: var(--transition); }
.rw-pkg-card:hover { box-shadow: var(--shadow-lg); }
.rw-pkg-completed { border-color: #fcd34d; background: linear-gradient(135deg, #fffbeb, #fffdf5); }
.rw-pkg-header { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 14px; }
.rw-pkg-header-left { flex: 1; min-width: 0; }
.rw-pkg-header-right { flex-shrink: 0; }
.rw-pkg-name { font-size: 17px; font-weight: 800; color: var(--text); line-height: 1.3; }
.rw-pkg-status { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
.rw-status-badge { padding: 3px 10px; border-radius: 20px; font-size: 11px; font-weight: 700; }
.rw-status-active { background: rgba(22,163,74,.12); color: #16a34a; }
.rw-status-done { background: rgba(245,158,11,.12); color: #b45309; }
.rw-pkg-days { font-size: 11px; color: #9ca3af; }
.rw-pkg-daily-badge { text-align: center; background: linear-gradient(135deg, rgba(34,197,94,.1), rgba(34,197,94,.03)); border-radius: 12px; padding: 8px 12px; border: 1px solid rgba(34,197,94,.15); }
.rw-pkg-daily-val { font-size: 16px; font-weight: 800; color: var(--primary); line-height: 1.2; }
.rw-pkg-daily-lbl { font-size: 9px; color: #16a34a; text-transform: uppercase; letter-spacing: .3px; margin-top: 2px; }

.rw-completed-banner { background: rgba(245,158,11,.1); border: 1px solid rgba(245,158,11,.25); border-radius: 10px; padding: 10px 12px; margin-bottom: 14px; font-size: 12px; color: #b45309; text-align: center; }
.rw-completed-banner strong { font-weight: 800; }

/* Date row */
.rw-date-row { display: flex; gap: 8px; margin-bottom: 14px; flex-wrap: wrap; }
.rw-date-item { flex: 1; min-width: 0; display: flex; align-items: flex-start; gap: 8px; background: var(--bg); border-radius: 12px; padding: 10px 12px; border: 1px solid #eef2f7; }
.rw-date-remaining { background: rgba(34,197,94,.06); border-color: rgba(34,197,94,.15); }
.rw-date-ico { font-size: 18px; flex-shrink: 0; line-height: 1.4; }
.rw-date-lbl { font-size: 10px; color: #9ca3af; text-transform: uppercase; letter-spacing: .3px; }
.rw-date-val { font-size: 13px; font-weight: 700; color: var(--text); margin-top: 2px; }
.rw-date-remaining .rw-date-val { color: var(--primary); }

/* Stats grid */
.rw-stats-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 14px; }
.rw-stat-cell { background: var(--bg); border-radius: 12px; padding: 10px 12px; border: 1px solid #eef2f7; }
.rw-stat-cell-lbl { font-size: 10px; color: #9ca3af; text-transform: uppercase; letter-spacing: .3px; }
.rw-stat-cell-val { font-size: 15px; font-weight: 800; color: var(--text); margin-top: 3px; }

/* Progress section */
.rw-progress-section { margin-bottom: 14px; }
.rw-progress-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.rw-progress-label { font-size: 12px; font-weight: 600; color: var(--text); }
.rw-progress-pct { font-size: 12px; font-weight: 700; color: var(--primary); }
.rw-progress-wrap { background: #e5e7eb; border-radius: 10px; height: 10px; overflow: hidden; }
.rw-progress-bar { background: linear-gradient(90deg, var(--primary), var(--accent)); height: 100%; border-radius: 10px; transition: width .4s ease; }
.rw-progress-done { background: linear-gradient(90deg, #f59e0b, #d97706); }
.rw-progress-remaining { margin-top: 8px; font-size: 12px; color: var(--accent); font-weight: 600; text-align: center; }

/* Claim area */
.rw-claim-area { margin-top: 4px; }
.rw-claim-btn { width: 100%; font-size: 16px; font-weight: 700; padding: 14px; }
.rw-claim-ready { box-shadow: var(--shadow-glow); animation: rwPulse 1.8s ease-in-out infinite; }
@keyframes rwPulse { 0%, 100% { box-shadow: 0 6px 24px rgba(22,163,74,.22); } 50% { box-shadow: 0 6px 28px rgba(22,163,74,.4); } }

/* ============================================================ */
/* === PACKAGE BLOCKED STATE === */
/* ============================================================ */
.pkg-card-blocked { opacity: .85; border: 2px solid #fcd34d !important; background: linear-gradient(135deg, #fffdf5, #fffef8) !important; position: relative; }
.pkg-card-blocked::before { content: ""; position: absolute; top: 0; left: 0; right: 0; height: 4px; background: linear-gradient(90deg, #f59e0b, #fbbf24, #f59e0b); border-radius: 16px 16px 0 0; }
.pkg-card-blocked .pkg-head { opacity: .7; }

/* ============================================================ */
/* === RESPONSIVE — new classes === */
/* ============================================================ */
@media (max-width: 380px) {
  .rw-overview-stats { flex-direction: column; gap: 12px; }
  .rw-overview-divider { width: 80%; height: 1px; }
  .rw-stats-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 360px) {
  .rw-pkg-header { flex-direction: column; }
  .rw-pkg-header-right { align-self: flex-end; }
  .rw-date-row { flex-direction: column; }
}
@media (max-width: 320px) {
  .rw-stats-grid { grid-template-columns: 1fr; }
}

/* ============================================================ */
/* === DARK THEME — new classes === */
/* ============================================================ */

html[data-theme="dark"] .rw-overview-banner { background: linear-gradient(135deg, #1e293b, #0f172a); border: 1px solid #334155; }
html[data-theme="dark"] .rw-reset-card { background: var(--card-bg); border-color: #334155; }
html[data-theme="dark"] .rw-reset-value { color: var(--text); }
html[data-theme="dark"] .rw-reset-tz { color: #64748b; }
html[data-theme="dark"] .rw-reset-right { border-left-color: #334155; }
html[data-theme="dark"] .rw-hint { color: #94a3b8; }
html[data-theme="dark"] .rw-pkg-card { background: var(--card-bg); border-color: #334155; }
html[data-theme="dark"] .rw-pkg-completed { border-color: #b45309; background: linear-gradient(135deg, rgba(245,158,11,.08), var(--card-bg)); }
html[data-theme="dark"] .rw-pkg-name { color: var(--text); }
html[data-theme="dark"] .rw-status-active { background: rgba(34,197,94,.15); color: #4ade80; }
html[data-theme="dark"] .rw-status-done { background: rgba(245,158,11,.15); color: #fbbf24; }
html[data-theme="dark"] .rw-pkg-days { color: #64748b; }
html[data-theme="dark"] .rw-pkg-daily-badge { background: rgba(34,197,94,.1); border-color: rgba(34,197,94,.2); }
html[data-theme="dark"] .rw-pkg-daily-lbl { color: #4ade80; }
html[data-theme="dark"] .rw-completed-banner { background: rgba(245,158,11,.12); border-color: rgba(245,158,11,.25); color: #fbbf24; }
html[data-theme="dark"] .rw-date-item { background: #0f172a; border-color: #334155; }
html[data-theme="dark"] .rw-date-remaining { background: rgba(34,197,94,.1); border-color: rgba(34,197,94,.2); }
html[data-theme="dark"] .rw-date-lbl { color: #64748b; }
html[data-theme="dark"] .rw-date-val { color: var(--text); }
html[data-theme="dark"] .rw-date-remaining .rw-date-val { color: var(--primary); }
html[data-theme="dark"] .rw-stat-cell { background: #0f172a; border-color: #334155; }
html[data-theme="dark"] .rw-stat-cell-lbl { color: #64748b; }
html[data-theme="dark"] .rw-stat-cell-val { color: var(--text); }
html[data-theme="dark"] .rw-progress-wrap { background: #334155; }
html[data-theme="dark"] .rw-progress-label { color: var(--text); }

html[data-theme="dark"] .pkg-card-blocked { background: linear-gradient(135deg, rgba(245,158,11,.08), var(--card-bg)) !important; border-color: #b45309 !important; }

/* ============================================================ */
/* === RTL — new classes === */
/* ============================================================ */
html[dir="rtl"] .rw-overview-stats { direction: rtl; }
html[dir="rtl"] .rw-overview-meta { direction: rtl; }
html[dir="rtl"] .rw-reset-card { direction: rtl; }
html[dir="rtl"] .rw-reset-right { border-left: none; border-right: 1px solid #e5e7eb; padding-right: 14px; padding-left: 0; }
html[dir="rtl"] .rw-pkg-header { direction: rtl; }
html[dir="rtl"] .rw-pkg-status { direction: rtl; }
html[dir="rtl"] .rw-date-row { direction: rtl; }
html[dir="rtl"] .rw-date-item { direction: rtl; }
html[dir="rtl"] .rw-stats-grid { direction: rtl; }
html[dir="rtl"] .rw-progress-header { direction: rtl; }
