/* =====================================================================
   STOCK MARKET (SM) — Premium Trading Platform Design System
   Fintech Aesthetic: Deep Navy, Charcoal Glass, Cyan & Electric Blue
   OPTIMIZED FOR MOBILE PHONE SCREENS (Over 90% mobile user base)
   ===================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700&family=JetBrains+Mono:wght@400;500;600&display=swap');

:root {
    --bg-base: #060911;
    --bg-surface: #0b1120;
    --bg-card: rgba(14, 22, 40, 0.82);
    --bg-card-hover: rgba(19, 31, 56, 0.90);
    --bg-input: rgba(8, 14, 26, 0.92);

    --border-subtle: rgba(56, 189, 248, 0.14);
    --border-focus: #00f0ff;
    --border-glow: rgba(0, 240, 255, 0.35);

    --accent-cyan: #00f0ff;
    --accent-blue: #3b82f6;
    --accent-emerald: #10b981;
    --accent-rose: #f43f5e;
    --accent-amber: #f59e0b;

    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    --text-accent: #38bdf8;

    --font-main: 'Outfit', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-mono: 'JetBrains Mono', monospace;

    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 22px;

    --shadow-card: 0 16px 36px -10px rgba(0, 0, 0, 0.75), 0 0 1px 1px rgba(56, 189, 248, 0.16);
    --shadow-btn: 0 4px 16px rgba(0, 240, 255, 0.35);

    --transition-fast: 0.18s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-smooth: 0.28s cubic-bezier(0.16, 1, 0.3, 1);

    /* Mobile Ergonomic Sizing (Over 90% Mobile Users) */
    --touch-min-height: 54px;
}

*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    -webkit-tap-highlight-color: transparent;
}

html, body {
    width: 100%;
    min-height: 100%;
    background-color: var(--bg-base);
    color: var(--text-primary);
    font-family: var(--font-main);
    font-size: 15px;
    line-height: 1.55;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

/* Background Canvas */
#trading-bg-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 0;
    pointer-events: none;
    opacity: 0.65;
}

/* Background Vignette Overlay */
.bg-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 1;
    pointer-events: none;
    background: radial-gradient(circle at 50% 25%, rgba(14, 28, 54, 0.35) 0%, rgba(6, 9, 17, 0.88) 75%, var(--bg-base) 100%);
}

/* Navigation Bar */
.top-nav {
    position: relative;
    z-index: 10;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.5rem;
    max-width: 1400px;
    margin: 0 auto;
    border-bottom: 1px solid var(--border-subtle);
}

.brand-logo {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    text-decoration: none;
    color: var(--text-primary);
}

.brand-icon {
    width: 38px;
    height: 38px;
    background: transparent;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: transform 0.2s ease;
}

.brand-icon:hover {
    transform: scale(1.05);
}

.brand-icon.sm-logo-badge {
    box-shadow: 0 0 16px rgba(0, 240, 255, 0.35);
    border-radius: 10px;
}

.brand-icon svg {
    width: 100%;
    height: 100%;
}

.brand-text {
    font-size: 1.18rem;
    font-weight: 800;
    letter-spacing: 0.02em;
    background: linear-gradient(135deg, #ffffff 40%, var(--accent-cyan) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    white-space: nowrap;
}

.brand-tag {
    font-size: 0.65rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #10b981;
    background: rgba(16, 185, 129, 0.15);
    border: 1px solid rgba(16, 185, 129, 0.4);
    padding: 2px 6px;
    border-radius: 4px;
    margin-left: 2px;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.nav-link {
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.92rem;
    padding: 0.5rem 0.75rem;
    border-radius: var(--radius-sm);
    transition: var(--transition-fast);
}

.nav-link:hover, .nav-link:active {
    color: var(--accent-cyan);
}

/* Two-column Layout for Desktop */
.page-container {
    position: relative;
    z-index: 5;
    max-width: 1240px;
    margin: 0 auto;
    padding: 2.25rem 1.25rem;
    min-height: calc(100vh - 80px);
    display: flex;
    align-items: center;
}

.auth-layout {
    display: grid;
    grid-template-columns: 1.1fr 0.9fr;
    gap: 3.5rem;
    align-items: center;
    width: 100%;
}

/* Left Column: Platform Hero & Trading Visuals */
.platform-hero {
    display: flex;
    flex-direction: column;
    gap: 1.35rem;
}

.hero-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(0, 240, 255, 0.08);
    border: 1px solid rgba(0, 240, 255, 0.25);
    padding: 0.4rem 0.95rem;
    border-radius: 50px;
    width: fit-content;
    font-size: 0.82rem;
    color: var(--accent-cyan);
    font-weight: 500;
}

.pulse-dot {
    width: 8px;
    height: 8px;
    background-color: var(--accent-emerald);
    border-radius: 50%;
    box-shadow: 0 0 10px var(--accent-emerald);
    animation: livePulse 2s infinite ease-in-out;
}

.hero-title {
    font-size: 2.75rem;
    font-weight: 700;
    line-height: 1.15;
    letter-spacing: -0.75px;
}

.hero-title span {
    background: linear-gradient(135deg, var(--accent-cyan) 0%, var(--accent-blue) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero-description {
    color: var(--text-secondary);
    font-size: 1.02rem;
    max-width: 520px;
    line-height: 1.6;
}

/* Trading Ticker Cards */
.ticker-cards-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.85rem;
    margin-top: 0.35rem;
}

.mini-ticker-card {
    background: rgba(14, 22, 40, 0.65);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 0.85rem;
    backdrop-filter: blur(12px);
    transition: var(--transition-fast);
}

.mini-ticker-card:hover {
    border-color: rgba(56, 189, 248, 0.35);
    transform: translateY(-2px);
}

.ticker-symbol {
    font-size: 0.78rem;
    color: var(--text-muted);
    font-weight: 600;
    text-transform: uppercase;
}

.ticker-price {
    font-family: var(--font-mono);
    font-size: 1.15rem;
    font-weight: 700;
    margin: 0.2rem 0;
}

.ticker-change {
    font-size: 0.78rem;
    font-weight: 600;
}

.ticker-change.up { color: var(--accent-emerald); }
.ticker-change.down { color: var(--accent-rose); }

/* Feature Badges */
.feature-list {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-top: 0.5rem;
}

.feature-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.86rem;
    color: var(--text-secondary);
}

.feature-item svg {
    width: 16px;
    height: 16px;
    color: var(--accent-cyan);
    flex-shrink: 0;
}

/* Right Column: Auth Card (Glassmorphism) */
.auth-card {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-xl);
    padding: 2.25rem 2rem;
    box-shadow: var(--shadow-card);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    position: relative;
    overflow: hidden;
    transition: var(--transition-smooth);
}

.auth-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, transparent, var(--accent-cyan), var(--accent-blue), transparent);
}

.auth-header {
    margin-bottom: 1.5rem;
}

.auth-header h1, .auth-header h2 {
    font-size: 1.65rem;
    font-weight: 700;
    letter-spacing: -0.5px;
    margin-bottom: 0.35rem;
}

.auth-header p {
    color: var(--text-secondary);
    font-size: 0.92rem;
}

/* Subtle Invitation Banner (Referral) */
.referral-invitation-banner {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background: rgba(0, 240, 255, 0.08);
    border: 1px solid rgba(0, 240, 255, 0.25);
    border-radius: var(--radius-md);
    padding: 0.8rem 1rem;
    margin-bottom: 1.25rem;
    font-size: 0.88rem;
    color: var(--text-accent);
}

.referral-invitation-banner svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

/* Step Progress Indicator (for Register) */
.step-indicator {
    display: flex;
    justify-content: space-between;
    margin-bottom: 1.75rem;
    position: relative;
}

.step-indicator::before {
    content: '';
    position: absolute;
    top: 15px;
    left: 20px;
    right: 20px;
    height: 2px;
    background: rgba(255, 255, 255, 0.08);
    z-index: 1;
}

.step-item {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.35rem;
}

.step-number {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--bg-surface);
    border: 2px solid var(--text-muted);
    color: var(--text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    font-weight: 600;
    transition: var(--transition-fast);
}

.step-item.active .step-number {
    background: var(--accent-cyan);
    border-color: var(--accent-cyan);
    color: #060911;
    box-shadow: 0 0 15px rgba(0, 240, 255, 0.4);
}

.step-item.completed .step-number {
    background: var(--accent-emerald);
    border-color: var(--accent-emerald);
    color: #060911;
}

.step-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 500;
}

.step-item.active .step-label {
    color: var(--text-primary);
    font-weight: 600;
}

/* Forms and Inputs */
.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
    margin-bottom: 1.25rem;
    text-align: left;
}

.form-label {
    font-size: 0.88rem;
    font-weight: 500;
    color: var(--text-secondary);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.form-label-help {
    font-size: 0.82rem;
    color: var(--accent-cyan);
    text-decoration: none;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
}

.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.input-icon {
    position: absolute;
    left: 14px;
    color: var(--text-muted);
    pointer-events: none;
    width: 18px;
    height: 18px;
}

/* Generous touch-height input for mobile fingers (prevents zoom on iOS) */
.form-input {
    width: 100%;
    min-height: 50px;
    background: var(--bg-input);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 0.75rem 1rem 0.75rem 2.6rem;
    font-family: var(--font-main);
    font-size: 16px; /* 16px prevents iOS Safari auto-zoom */
    color: var(--text-primary);
    outline: none;
    transition: var(--transition-fast);
}

.form-input.no-icon {
    padding-left: 1rem;
}

.form-input:focus {
    border-color: var(--border-focus);
    box-shadow: 0 0 0 3px rgba(0, 240, 255, 0.18);
}

.form-input:read-only {
    background: rgba(14, 22, 40, 0.45);
    color: var(--text-secondary);
    cursor: not-allowed;
    border-color: rgba(255, 255, 255, 0.08);
}

/* Phone input with country code group */
.phone-group-wrapper {
    display: grid;
    grid-template-columns: 105px 1fr;
    gap: 0.6rem;
}

.country-select {
    min-height: 50px;
    background: var(--bg-input);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    padding: 0.75rem 0.6rem;
    font-family: var(--font-main);
    font-size: 15px;
    outline: none;
    cursor: pointer;
    transition: var(--transition-fast);
}

.country-select:focus {
    border-color: var(--border-focus);
}

/* Password Toggle Eye with 44px tap target */
.btn-toggle-password {
    position: absolute;
    right: 6px;
    width: 44px;
    height: 44px;
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    transition: var(--transition-fast);
}

.btn-toggle-password:hover, .btn-toggle-password:active {
    color: var(--accent-cyan);
}

.field-note {
    font-size: 0.8rem;
    color: var(--text-muted);
    line-height: 1.4;
    margin-top: 0.25rem;
}

/* Checkbox & Terms with comfortable tap area */
.checkbox-group {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    margin-bottom: 1.35rem;
    font-size: 0.86rem;
    color: var(--text-secondary);
}

.checkbox-group input[type="checkbox"] {
    margin-top: 2px;
    accent-color: var(--accent-cyan);
    width: 20px;
    height: 20px;
    min-width: 20px;
    cursor: pointer;
}

.checkbox-group label {
    cursor: pointer;
    line-height: 1.45;
}

.checkbox-group a {
    color: var(--accent-cyan);
    text-decoration: underline;
    text-underline-offset: 2px;
}

/* =====================================================================
   6-Digit OTP Box Grid — MOBILE RESPONSIVE
   ===================================================================== */
.otp-container {
    display: flex;
    justify-content: space-between;
    gap: 6px;
    margin: 1.35rem 0;
    width: 100%;
}

.otp-box {
    flex: 1;
    width: calc((100% - 30px) / 6);
    max-width: 50px;
    height: 56px;
    background: var(--bg-input);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    text-align: center;
    font-size: 1.6rem;
    font-weight: 700;
    font-family: var(--font-mono);
    color: var(--accent-cyan);
    outline: none;
    transition: var(--transition-fast);
    -webkit-appearance: none;
}

.otp-box:focus {
    border-color: var(--border-focus);
    box-shadow: 0 0 0 3px rgba(0, 240, 255, 0.22);
    transform: translateY(-2px);
}

.otp-resend-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.88rem;
    color: var(--text-muted);
    margin-top: 1rem;
    min-height: 44px; /* Touch target */
}

.btn-link {
    background: none;
    border: none;
    color: var(--accent-cyan);
    font-family: var(--font-main);
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    padding: 0 0.25rem;
    transition: var(--transition-fast);
}

.btn-link:hover:not(:disabled) {
    text-decoration: underline;
}

.btn-link:disabled {
    color: var(--text-muted);
    cursor: not-allowed;
    text-decoration: none;
}

/* Existing Account Detection Banner / Alert Box */
.existing-account-box {
    background: rgba(245, 158, 11, 0.12);
    border: 1px solid rgba(245, 158, 11, 0.4);
    border-radius: var(--radius-md);
    padding: 1.35rem 1.15rem;
    margin: 1.25rem 0;
    text-align: center;
}

.existing-account-msg {
    font-size: 1.05rem;
    font-weight: 600;
    color: #fef08a;
    margin-bottom: 1.15rem;
    line-height: 1.45;
}

.existing-account-actions {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

/* =====================================================================
   PRIMARY & SECONDARY BUTTONS — MOBILE-FIRST TOUCH ERGONOMICS
   ===================================================================== */
.btn-primary {
    width: 100%;
    min-height: var(--touch-min-height);
    background: linear-gradient(135deg, var(--accent-cyan), var(--accent-blue));
    color: #060911;
    border: none;
    border-radius: var(--radius-md);
    padding: 0.95rem 1.5rem;
    font-family: var(--font-main);
    font-size: 1.02rem;
    font-weight: 600;
    cursor: pointer;
    box-shadow: var(--shadow-btn);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
    text-decoration: none;
    transition: var(--transition-fast);
    position: relative;
    overflow: hidden;
}

.btn-primary:active:not(:disabled) {
    transform: scale(0.98);
}

.btn-primary:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 22px rgba(0, 240, 255, 0.45);
}

.btn-primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none !important;
}

.btn-secondary {
    width: 100%;
    min-height: var(--touch-min-height);
    background: rgba(255, 255, 255, 0.06);
    color: var(--text-primary);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 0.85rem 1.25rem;
    font-family: var(--font-main);
    font-size: 0.98rem;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    text-decoration: none;
    transition: var(--transition-fast);
}

.btn-secondary:active:not(:disabled) {
    transform: scale(0.98);
}

.btn-secondary:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(56, 189, 248, 0.35);
}

.auth-footer {
    margin-top: 1.5rem;
    text-align: center;
    font-size: 0.92rem;
    color: var(--text-secondary);
}

.auth-footer a {
    color: var(--accent-cyan);
    text-decoration: none;
    font-weight: 600;
    padding: 0.25rem;
    display: inline-block;
}

.auth-footer a:hover {
    text-decoration: underline;
}

/* Spinner for Loading State */
.spinner {
    width: 20px;
    height: 20px;
    border: 2px solid rgba(6, 9, 17, 0.25);
    border-top-color: #060911;
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

@keyframes livePulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.4; transform: scale(0.9); }
}

/* Toast Notification System */
#toast-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-width: 380px;
    pointer-events: none;
}

.toast {
    pointer-events: auto;
    background: rgba(14, 22, 40, 0.96);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 0.95rem 1.15rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.65);
    backdrop-filter: blur(12px);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.92rem;
    color: var(--text-primary);
    animation: toastSlideIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    transition: opacity 0.3s, transform 0.3s;
}

.toast.success { border-color: rgba(16, 185, 129, 0.4); }
.toast.success .toast-icon { color: var(--accent-emerald); }

.toast.error { border-color: rgba(244, 63, 94, 0.4); }
.toast.error .toast-icon { color: var(--accent-rose); }

.toast.info { border-color: rgba(56, 189, 248, 0.4); }
.toast.info .toast-icon { color: var(--accent-cyan); }

@keyframes toastSlideIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Dashboard Specific Styles */
.dashboard-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 1.75rem;
    width: 100%;
    margin-top: 1.5rem;
}

.dash-card {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: 1.75rem;
    backdrop-filter: blur(16px);
}

.dash-header-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.badge-verified {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    background: rgba(16, 185, 129, 0.12);
    border: 1px solid rgba(16, 185, 129, 0.3);
    color: var(--accent-emerald);
    padding: 0.3rem 0.75rem;
    border-radius: 50px;
    font-size: 0.8rem;
    font-weight: 600;
}

.badge-active {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    background: rgba(0, 240, 255, 0.12);
    border: 1px solid rgba(0, 240, 255, 0.3);
    color: var(--accent-cyan);
    padding: 0.3rem 0.75rem;
    border-radius: 50px;
    font-size: 0.8rem;
    font-weight: 600;
}

.referral-box {
    background: rgba(8, 14, 26, 0.85);
    border: 1px dashed rgba(56, 189, 248, 0.35);
    border-radius: var(--radius-md);
    padding: 1.15rem;
    margin-top: 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.referral-code-display {
    font-family: var(--font-mono);
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--accent-cyan);
    letter-spacing: 1px;
}

/* Modal Dialog */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(6, 9, 17, 0.85);
    backdrop-filter: blur(8px);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
}

.modal-overlay.open {
    opacity: 1;
    pointer-events: auto;
}

.modal-card {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: 2rem;
    max-width: 460px;
    width: 100%;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.8);
    transform: scale(0.95);
    transition: transform 0.25s ease;
}

.modal-overlay.open .modal-card {
    transform: scale(1);
}

/* =====================================================================
   DEDICATED PHONE / MOBILE SCREEN ADAPTATIONS (< 768px)
   ===================================================================== */
@media (max-width: 768px) {
    .top-nav {
        padding: 0.85rem 1rem;
    }

    .page-container {
        padding: 1.25rem 0.95rem;
        padding-bottom: calc(1.5rem + env(safe-area-inset-bottom, 0px));
        min-height: auto;
        display: block;
    }

    .auth-layout {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    /* On phones, condense the hero to keep form directly reachable */
    .platform-hero {
        text-align: center;
        align-items: center;
        gap: 0.85rem;
    }

    .hero-title {
        font-size: 1.95rem;
        line-height: 1.2;
    }

    .hero-description {
        font-size: 0.92rem;
        max-width: 100%;
    }

    .ticker-cards-row {
        grid-template-columns: repeat(3, 1fr);
        gap: 0.5rem;
        width: 100%;
    }

    .mini-ticker-card {
        padding: 0.65rem 0.5rem;
    }

    .ticker-symbol {
        font-size: 0.7rem;
    }

    .ticker-price {
        font-size: 0.95rem;
    }

    .feature-list {
        display: none; /* Hide secondary decorative tags on mobile to bring CTA up */
    }

    /* Mobile Auth Card: edge-to-edge comfort */
    .auth-card {
        padding: 1.5rem 1.15rem;
        border-radius: var(--radius-lg);
        box-shadow: 0 10px 25px rgba(0, 0, 0, 0.6);
    }

    .auth-header h1, .auth-header h2 {
        font-size: 1.45rem;
    }

    .phone-group-wrapper {
        grid-template-columns: 95px 1fr;
    }

    /* Full-width thumb-friendly buttons on phone (90%+ mobile audience) */
    .btn-primary {
        min-height: 54px;
        font-size: 1.05rem;
        font-weight: 700;
        border-radius: var(--radius-md);
        box-shadow: 0 4px 18px rgba(0, 240, 255, 0.45);
        letter-spacing: 0.2px;
        width: 100%;
    }

    .btn-primary:active {
        transform: scale(0.97);
        box-shadow: 0 2px 10px rgba(0, 240, 255, 0.3);
    }

    .btn-secondary {
        min-height: 52px;
        font-size: 1rem;
        font-weight: 600;
        border-radius: var(--radius-md);
        width: 100%;
    }

    .btn-secondary:active {
        transform: scale(0.97);
    }

    .dashboard-grid {
        grid-template-columns: 1fr;
        gap: 1.25rem;
    }

    .dash-card {
        padding: 1.25rem;
    }

    .referral-box {
        flex-direction: column;
        align-items: stretch;
        text-align: center;
        gap: 0.75rem;
    }

    .referral-box button {
        width: 100% !important;
        min-height: 46px;
    }

    #toast-container {
        left: 12px;
        right: 12px;
        bottom: 16px;
        max-width: none;
    }
}

/* =====================================================================
   STOCK MARKET (SM) HOMEPAGE — DESK, BALANCE, 4 ACTIONS, & BOTTOM DOCK
   ===================================================================== */

/* Body bottom spacing so nothing gets covered by the fixed dock */
body {
    padding-bottom: calc(84px + env(safe-area-inset-bottom, 16px));
}

.home-page-container {
    width: 100%;
    max-width: 680px;
    margin: 0 auto;
    padding: 0.75rem 1rem 1.5rem;
    position: relative;
    z-index: 5;
}

@media (min-width: 1024px) {
    .home-page-container {
        max-width: 840px;
    }
}

/* Header Action Row */
.header-actions-row {
    display: flex;
    align-items: center;
    gap: 0.65rem;
}

.icon-circle-btn {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-md);
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    color: var(--text-primary);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    position: relative;
    transition: all var(--transition-fast);
}

.icon-circle-btn:hover {
    background: var(--bg-card-hover);
    border-color: var(--accent-cyan);
    transform: translateY(-1px);
}

.btn-badge-dot {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 7px;
    height: 7px;
    background: var(--accent-cyan);
    border-radius: 50%;
    box-shadow: 0 0 8px var(--accent-cyan);
}

/* Language Selector Dropdown */
.lang-dropdown-wrapper {
    position: relative;
}

.btn-lang {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.4rem 0.8rem;
    height: 40px;
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 0.88rem;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.btn-lang:hover, .btn-lang.active {
    border-color: var(--accent-cyan);
    background: var(--bg-card-hover);
}

.lang-dropdown-menu {
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    min-width: 145px;
    background: rgba(11, 17, 32, 0.96);
    backdrop-filter: blur(20px);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    box-shadow: 0 14px 32px rgba(0, 0, 0, 0.7);
    padding: 0.35rem;
    display: none;
    flex-direction: column;
    gap: 0.2rem;
    z-index: 150;
    animation: fadeInMenu 0.18s ease-out;
}

.lang-dropdown-menu.active {
    display: flex;
}

@keyframes fadeInMenu {
    from { opacity: 0; transform: translateY(-5px); }
    to { opacity: 1; transform: translateY(0); }
}

.lang-option-btn {
    width: 100%;
    text-align: left;
    padding: 0.55rem 0.8rem;
    border-radius: var(--radius-sm);
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 0.88rem;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: all var(--transition-fast);
}

.lang-option-btn:hover {
    background: rgba(56, 189, 248, 0.12);
    color: var(--text-primary);
}

.lang-option-btn.active {
    color: var(--accent-cyan);
    background: rgba(0, 240, 255, 0.08);
    font-weight: 600;
}

/* =====================================================================
   MAIN BALANCE CARD (Sketch Reference: 22 USDT BALANCE)
   ===================================================================== */
.home-balance-card {
    background: linear-gradient(135deg, rgba(16, 27, 52, 0.88) 0%, rgba(10, 16, 32, 0.84) 100%);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(0, 240, 255, 0.24);
    border-radius: var(--radius-xl);
    padding: 1.6rem 1.45rem;
    margin-bottom: 1.25rem;
    box-shadow: 0 20px 45px -12px rgba(0, 0, 0, 0.8), 0 0 28px rgba(0, 240, 255, 0.08);
    position: relative;
    overflow: hidden;
}

.home-balance-card::before {
    content: '';
    position: absolute;
    top: -40px;
    right: -40px;
    width: 130px;
    height: 130px;
    background: radial-gradient(circle, rgba(0, 240, 255, 0.22) 0%, transparent 70%);
    border-radius: 50%;
    pointer-events: none;
}

.balance-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
}

.balance-label-group {
    display: flex;
    align-items: center;
    gap: 0.45rem;
}

.balance-title-label {
    font-size: 0.88rem;
    font-weight: 500;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.8px;
}

.balance-eye-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    padding: 3px;
    border-radius: 4px;
    transition: color var(--transition-fast);
}

.balance-eye-btn:hover {
    color: var(--accent-cyan);
}

.balance-badge-mode {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.72rem;
    font-weight: 600;
    padding: 0.22rem 0.65rem;
    border-radius: 20px;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.balance-badge-mode.demo {
    background: rgba(245, 158, 11, 0.15);
    border: 1px solid rgba(245, 158, 11, 0.35);
    color: #fbbf24;
}

.balance-badge-mode.live {
    background: rgba(16, 185, 129, 0.15);
    border: 1px solid rgba(16, 185, 129, 0.35);
    color: #34d399;
}

.balance-amount-row {
    display: flex;
    align-items: baseline;
    gap: 0.65rem;
    margin-bottom: 0.85rem;
    flex-wrap: wrap;
}

.balance-big-number {
    font-family: var(--font-mono);
    font-size: 2.6rem;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.1;
    letter-spacing: -0.5px;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
    direction: ltr;
    unicode-bidi: isolate;
}

.balance-currency-pill {
    font-family: var(--font-main);
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--accent-cyan);
    letter-spacing: 0.5px;
}

.balance-footer-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 0.75rem;
    border-top: 1px solid rgba(56, 189, 248, 0.12);
    font-size: 0.8rem;
    color: var(--text-muted);
}

.meta-item-tag {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    color: var(--text-secondary);
    font-weight: 500;
}

/* =====================================================================
   FOUR MAIN ACTION CARDS (2x2 Grid from Hand-Drawn Sketch)
   ===================================================================== */
.home-action-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.9rem;
    margin-bottom: 1.4rem;
}

@media (max-width: 360px) {
    .home-action-grid {
        grid-template-columns: 1fr;
    }
}

.action-card {
    background: var(--bg-card);
    backdrop-filter: blur(16px);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: 1.15rem 1.05rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    cursor: pointer;
    color: var(--text-primary);
    position: relative;
    overflow: hidden;
    transition: transform var(--transition-fast), border-color var(--transition-fast), box-shadow var(--transition-fast), background-color var(--transition-fast);
    min-height: 120px;
    text-align: left;
    outline: none;
}

.action-card:hover, .action-card:focus-visible {
    background: var(--bg-card-hover);
    border-color: var(--accent-cyan);
    transform: translateY(-3px);
    box-shadow: 0 12px 28px -6px rgba(0, 0, 0, 0.65), 0 0 18px rgba(0, 240, 255, 0.15);
}

.action-card:active {
    transform: scale(0.97);
}

.action-card.recharge { border-left: 3px solid var(--accent-cyan); }
.action-card.withdrawal { border-left: 3px solid #60a5fa; }
.action-card.invest { border-left: 3px solid var(--accent-emerald); }
.action-card.task { border-left: 3px solid var(--accent-amber); }

.action-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.75rem;
}

.action-icon-circle {
    width: 44px;
    height: 44px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform var(--transition-fast);
}

.action-card.recharge .action-icon-circle { background: rgba(0, 240, 255, 0.12); color: var(--accent-cyan); }
.action-card.withdrawal .action-icon-circle { background: rgba(59, 130, 246, 0.14); color: #60a5fa; }
.action-card.invest .action-icon-circle { background: rgba(16, 185, 129, 0.14); color: var(--accent-emerald); }
.action-card.task .action-icon-circle { background: rgba(245, 158, 11, 0.14); color: #fbbf24; }

.action-card:hover .action-icon-circle { transform: scale(1.08); }

.action-arrow-icon {
    color: var(--text-muted);
    transition: transform var(--transition-fast), color var(--transition-fast);
}

.action-card:hover .action-arrow-icon {
    color: var(--accent-cyan);
    transform: translate(2px, -2px);
}

.action-card-body .action-title {
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.2rem;
    letter-spacing: 0.2px;
}

.action-card-body .action-desc {
    font-size: 0.78rem;
    color: var(--text-secondary);
    line-height: 1.35;
}

/* =====================================================================
   LIVE MARKET FEED & TICKERS
   ===================================================================== */
.market-feed-card {
    background: var(--bg-card);
    backdrop-filter: blur(16px);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: 1.25rem;
    margin-bottom: 1.5rem;
    box-shadow: var(--shadow-card);
}

.market-feed-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.9rem;
    padding-bottom: 0.65rem;
    border-bottom: 1px solid var(--border-subtle);
}

.market-feed-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.02rem;
    font-weight: 600;
    color: var(--text-primary);
}

.timeframe-tabs {
    display: flex;
    gap: 0.25rem;
    background: rgba(8, 14, 26, 0.8);
    padding: 2px;
    border-radius: var(--radius-sm);
}

.timeframe-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.25rem 0.55rem;
    border-radius: 4px;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.timeframe-btn.active, .timeframe-btn:hover {
    color: var(--accent-cyan);
    background: rgba(56, 189, 248, 0.12);
}

.ticker-cards-row-home {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.65rem;
    margin-bottom: 1rem;
}

@media (max-width: 580px) {
    .ticker-cards-row-home {
        grid-template-columns: 1fr;
    }
}

.sparkline-svg {
    width: 100%;
    height: 24px;
    margin-top: 0.4rem;
}

.live-orders-container {
    background: rgba(8, 14, 26, 0.6);
    border: 1px solid rgba(56, 189, 248, 0.08);
    border-radius: var(--radius-md);
    padding: 0.75rem 0.85rem;
}

.live-order-row {
    display: grid;
    grid-template-columns: 1fr 60px 1fr 1fr;
    align-items: center;
    padding: 0.35rem 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    font-size: 0.82rem;
}

.live-order-row:last-child {
    border-bottom: none;
}

.order-type-tag {
    font-size: 0.72rem;
    font-weight: 700;
    padding: 0.15rem 0.45rem;
    border-radius: 4px;
    text-align: center;
}

.order-type-tag.buy { background: rgba(16, 185, 129, 0.15); color: var(--accent-emerald); }
.order-type-tag.sell { background: rgba(244, 63, 94, 0.15); color: var(--accent-rose); }

/* =====================================================================
   PREMIUM BOTTOM NAVIGATION DOCK (Modular: rendered by bottom-nav.js)
   4 Items: HOME | PLAN | TEAM | ME
   ===================================================================== */
.btm-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 9000;
    display: flex;
    justify-content: space-around;
    align-items: stretch;
    height: 64px;
    padding-bottom: env(safe-area-inset-bottom, 0px);
    background: linear-gradient(180deg, rgba(10, 16, 30, 0.97) 0%, rgba(6, 10, 22, 0.99) 100%);
    border-top: 1px solid rgba(56, 189, 248, 0.12);
    backdrop-filter: blur(28px) saturate(1.4);
    -webkit-backdrop-filter: blur(28px) saturate(1.4);
    box-shadow:
        0 -4px 24px rgba(0, 0, 0, 0.55),
        0 -1px 0 rgba(56, 189, 248, 0.08);
}

.btm-nav__item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    flex: 1;
    min-width: 0;
    padding: 6px 0;
    color: rgba(148, 163, 184, 0.7);
    text-decoration: none;
    cursor: pointer;
    position: relative;
    transition: color 0.2s ease, transform 0.15s ease;
    -webkit-tap-highlight-color: transparent;
    user-select: none;
}

.btm-nav__item:hover {
    color: rgba(226, 232, 240, 0.9);
}

.btm-nav__item--pressed {
    transform: scale(0.92);
}

/* Active state */
.btm-nav__item--active {
    color: var(--accent-cyan, #00f0ff);
}

.btm-nav__item--active::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 32px;
    height: 3px;
    background: var(--accent-cyan, #00f0ff);
    border-radius: 0 0 4px 4px;
    box-shadow: 0 2px 12px rgba(0, 240, 255, 0.45);
    animation: btmNavIndicatorIn 0.3s ease-out;
}

/* Icon wrapper */
.btm-nav__icon {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 10px;
    transition: background 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.btm-nav__icon svg {
    width: 22px;
    height: 22px;
    transition: transform 0.2s ease;
}

.btm-nav__item--active .btm-nav__icon {
    background: rgba(0, 240, 255, 0.1);
    box-shadow: 0 0 16px rgba(0, 240, 255, 0.15);
    transform: translateY(-1px);
}

.btm-nav__item--active .btm-nav__icon svg {
    stroke-width: 2.2;
    filter: drop-shadow(0 0 4px rgba(0, 240, 255, 0.35));
}

/* Active indicator dot */
.btm-nav__dot {
    position: absolute;
    bottom: -2px;
    left: 50%;
    transform: translateX(-50%);
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: var(--accent-cyan, #00f0ff);
    box-shadow: 0 0 6px var(--accent-cyan, #00f0ff);
    animation: btmNavDotPulse 2s ease-in-out infinite;
}

/* Label */
.btm-nav__label {
    font-size: 0.65rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    line-height: 1;
    white-space: nowrap;
    opacity: 0.85;
    transition: opacity 0.2s ease;
}

.btm-nav__item--active .btm-nav__label {
    opacity: 1;
    font-weight: 700;
}

/* Animations */
@keyframes btmNavIndicatorIn {
    from { width: 0; opacity: 0; }
    to   { width: 32px; opacity: 1; }
}

@keyframes btmNavDotPulse {
    0%, 100% { opacity: 1; transform: translateX(-50%) scale(1); }
    50%      { opacity: 0.5; transform: translateX(-50%) scale(0.7); }
}

/* Spacer to prevent content from hiding behind fixed dock */
.btm-nav-spacer {
    height: calc(64px + env(safe-area-inset-bottom, 0px));
}

/* Legacy classes — kept for backward compat, remove after migration */
.bottom-nav-dock { display: none !important; }


/* =====================================================================
   APP MODALS & DIALOGS
   ===================================================================== */
.app-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(4, 7, 14, 0.88);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    z-index: 99999;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.app-modal-overlay.open {
    display: flex;
    opacity: 1;
}

body.modal-active .btm-nav,
body.modal-open .btm-nav {
    display: none !important;
}

.app-modal-dialog {
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-xl);
    width: 100%;
    max-width: 480px;
    max-height: 90vh;
    max-height: calc(100dvh - 2rem);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 1.5rem 1.5rem 2.5rem;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.95), 0 0 30px rgba(0, 240, 255, 0.15);
    position: relative;
    transform: scale(0.95);
    transition: transform 0.22s cubic-bezier(0.16, 1, 0.3, 1);
}

.app-modal-overlay.open .app-modal-dialog {
    transform: scale(1);
}

.modal-header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.25rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--border-subtle);
}

.modal-title-text {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.15rem;
    font-weight: 600;
    color: var(--text-primary);
}

.modal-close-btn {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.modal-close-btn:hover {
    color: var(--text-primary);
    border-color: var(--accent-cyan);
}

.qr-container {
    width: 170px;
    height: 170px;
    margin: 0.75rem auto;
    background: #ffffff;
    padding: 10px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
}

.address-copy-box {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--bg-input);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 0.5rem 0.75rem;
    margin-top: 0.35rem;
}

.address-text-mono {
    font-family: var(--font-mono);
    font-size: 0.82rem;
    color: var(--accent-cyan);
    word-break: break-all;
    flex: 1;
    direction: ltr;
    unicode-bidi: isolate;
}

/* =====================================================================
   RTL RULES FOR URDU
   ===================================================================== */
[dir="rtl"], .rtl-layout {
    text-align: right;
}

[dir="rtl"] .action-card,
.rtl-layout .action-card {
    text-align: right;
    border-left: none;
}

[dir="rtl"] .action-card.recharge, .rtl-layout .action-card.recharge { border-right: 3px solid var(--accent-cyan); }
[dir="rtl"] .action-card.withdrawal, .rtl-layout .action-card.withdrawal { border-right: 3px solid #60a5fa; }
[dir="rtl"] .action-card.invest, .rtl-layout .action-card.invest { border-right: 3px solid var(--accent-emerald); }
[dir="rtl"] .action-card.task, .rtl-layout .action-card.task { border-right: 3px solid var(--accent-amber); }

[dir="rtl"] .action-arrow-icon,
.rtl-layout .action-arrow-icon {
    transform: rotate(180deg);
}

[dir="rtl"] .lang-dropdown-menu,
.rtl-layout .lang-dropdown-menu {
    right: auto;
    left: 0;
}

[dir="rtl"] .lang-option-btn,
.rtl-layout .lang-option-btn {
    text-align: right;
}

[dir="rtl"] .balance-big-number,
.rtl-layout .balance-big-number,
[dir="rtl"] .mono-num,
.rtl-layout .mono-num,
[dir="rtl"] .address-text-mono,
.rtl-layout .address-text-mono {
    direction: ltr !important;
    unicode-bidi: isolate !important;
}

/* =====================================================================
   HOMEPAGE PREMIUM FINANCIAL DASHBOARD (Sketch Reference Implementation)
   ===================================================================== */

/* Page layout specific to home */
.home-page-container {
    position: relative;
    z-index: 5;
    max-width: 960px;
    margin: 0 auto;
    padding: 1.25rem 1rem 6.5rem 1rem;
    min-height: 100vh;
}

/* Language Dropdown Selector in Header */
.lang-dropdown-wrapper {
    position: relative;
    display: inline-block;
}

.btn-lang {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    background: rgba(14, 22, 40, 0.75);
    border: 1px solid var(--border-subtle);
    color: var(--text-primary);
    padding: 0.45rem 0.85rem;
    border-radius: var(--radius-md);
    font-size: 0.86rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition-fast);
    backdrop-filter: blur(10px);
}

.btn-lang:hover, .btn-lang:focus-visible {
    border-color: var(--accent-cyan);
    box-shadow: 0 0 12px rgba(0, 240, 255, 0.25);
    color: var(--accent-cyan);
}

.lang-dropdown-menu {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    z-index: 100;
    background: rgba(11, 17, 32, 0.95);
    border: 1px solid rgba(56, 189, 248, 0.25);
    border-radius: var(--radius-md);
    box-shadow: 0 16px 36px rgba(0, 0, 0, 0.85), 0 0 1px 1px rgba(0, 240, 255, 0.2);
    min-width: 140px;
    padding: 0.4rem;
    display: none;
    flex-direction: column;
    gap: 0.2rem;
    backdrop-filter: blur(16px);
    animation: fadeInDropdown 0.18s cubic-bezier(0.16, 1, 0.3, 1);
}

.lang-dropdown-menu.show {
    display: flex;
}

@keyframes fadeInDropdown {
    from { opacity: 0; transform: translateY(-6px); }
    to { opacity: 1; transform: translateY(0); }
}

.lang-option-btn {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    padding: 0.55rem 0.75rem;
    border-radius: var(--radius-sm);
    font-size: 0.88rem;
    font-family: inherit;
    cursor: pointer;
    transition: var(--transition-fast);
    text-align: left;
}

.lang-option-btn:hover {
    background: rgba(0, 240, 255, 0.1);
    color: var(--text-primary);
}

.lang-option-btn.active {
    background: rgba(0, 240, 255, 0.18);
    color: var(--accent-cyan);
    font-weight: 600;
}

/* Notification & Profile Header Shortcuts */
.header-actions-row {
    display: flex;
    align-items: center;
    gap: 0.65rem;
}

.icon-circle-btn {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: rgba(14, 22, 40, 0.75);
    border: 1px solid var(--border-subtle);
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition-fast);
    position: relative;
}

.icon-circle-btn:hover, .icon-circle-btn:active {
    border-color: var(--accent-cyan);
    color: var(--accent-cyan);
    box-shadow: 0 0 10px rgba(0, 240, 255, 0.25);
}

.btn-badge-dot {
    position: absolute;
    top: 7px;
    right: 7px;
    width: 7px;
    height: 7px;
    background-color: var(--accent-cyan);
    border-radius: 50%;
    box-shadow: 0 0 6px var(--accent-cyan);
}

/* ---------------------------------------------------------------------
   MAIN BALANCE CARD (Matching sketch: 22 USDT BALANCE)
   --------------------------------------------------------------------- */
.home-balance-card {
    position: relative;
    background: linear-gradient(135deg, rgba(14, 24, 46, 0.88) 0%, rgba(9, 15, 29, 0.94) 100%);
    border: 1px solid rgba(56, 189, 248, 0.22);
    border-radius: var(--radius-xl);
    padding: 1.6rem 1.4rem;
    box-shadow: 0 18px 40px -10px rgba(0, 0, 0, 0.75), 0 0 24px -6px rgba(0, 240, 255, 0.18);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    overflow: hidden;
    margin-top: 0.5rem;
}

.home-balance-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 20%;
    right: 20%;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--accent-cyan), transparent);
    opacity: 0.8;
}

.home-balance-card::after {
    content: '';
    position: absolute;
    bottom: -60px;
    right: -60px;
    width: 140px;
    height: 140px;
    background: radial-gradient(circle, rgba(0, 240, 255, 0.12) 0%, transparent 70%);
    pointer-events: none;
}

.balance-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
}

.balance-label-group {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.balance-title-label {
    font-size: 0.88rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.75px;
    color: var(--text-secondary);
}

.balance-eye-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    padding: 3px;
    border-radius: 4px;
    transition: var(--transition-fast);
}

.balance-eye-btn:hover {
    color: var(--accent-cyan);
}

.balance-badge-mode {
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 3px 8px;
    border-radius: 50px;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

.balance-badge-mode.demo {
    background: rgba(245, 158, 11, 0.14);
    border: 1px solid rgba(245, 158, 11, 0.35);
    color: var(--accent-amber);
}

.balance-badge-mode.live {
    background: rgba(16, 185, 129, 0.14);
    border: 1px solid rgba(16, 185, 129, 0.35);
    color: var(--accent-emerald);
}

.balance-amount-row {
    display: flex;
    align-items: baseline;
    gap: 0.65rem;
    margin: 0.4rem 0 0.85rem 0;
}

.balance-big-number {
    font-size: 2.85rem;
    font-weight: 700;
    font-family: var(--font-mono);
    letter-spacing: -1px;
    line-height: 1.1;
    background: linear-gradient(135deg, #ffffff 45%, var(--accent-cyan) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    direction: ltr !important;
    unicode-bidi: isolate;
}

.balance-currency-pill {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--accent-cyan);
    background: rgba(0, 240, 255, 0.1);
    border: 1px solid rgba(0, 240, 255, 0.25);
    padding: 2px 10px;
    border-radius: 6px;
    letter-spacing: 0.5px;
}

.balance-footer-meta {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 0.65rem;
    padding-top: 0.75rem;
    border-top: 1px solid rgba(56, 189, 248, 0.12);
    font-size: 0.82rem;
    color: var(--text-muted);
}

.meta-item-tag {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    color: var(--text-secondary);
}

/* ---------------------------------------------------------------------
   FOUR MAIN ACTION CARDS (RECHARGE, WITHDRAWAL, MY INVEST, TASK)
   Matching the sketch 2x2 grid hierarchy
   --------------------------------------------------------------------- */
.home-action-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.95rem;
    margin-top: 1.15rem;
}

.action-card {
    background: linear-gradient(145deg, rgba(14, 22, 40, 0.85) 0%, rgba(9, 14, 26, 0.92) 100%);
    border: 1px solid rgba(56, 189, 248, 0.18);
    border-radius: var(--radius-lg);
    padding: 1.15rem 1rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 110px;
    cursor: pointer;
    text-align: left;
    transition: all 0.22s cubic-bezier(0.16, 1, 0.3, 1);
    position: relative;
    overflow: hidden;
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.4);
}

.action-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle at 10% 20%, rgba(255, 255, 255, 0.04), transparent 60%);
    pointer-events: none;
}

.action-card:hover {
    transform: translateY(-3px);
    border-color: var(--accent-cyan);
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.6), 0 0 18px rgba(0, 240, 255, 0.2);
}

.action-card:active {
    transform: scale(0.97);
}

.action-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.action-icon-circle {
    width: 44px;
    height: 44px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: var(--transition-fast);
}

/* Icon Palette Variants */
.action-card.recharge .action-icon-circle {
    background: rgba(0, 240, 255, 0.12);
    border: 1px solid rgba(0, 240, 255, 0.35);
    color: var(--accent-cyan);
}

.action-card.withdrawal .action-icon-circle {
    background: rgba(16, 185, 129, 0.12);
    border: 1px solid rgba(16, 185, 129, 0.35);
    color: var(--accent-emerald);
}

.action-card.invest .action-icon-circle {
    background: rgba(59, 130, 246, 0.14);
    border: 1px solid rgba(59, 130, 246, 0.35);
    color: #60a5fa;
}

.action-card.task .action-icon-circle {
    background: rgba(245, 158, 11, 0.14);
    border: 1px solid rgba(245, 158, 11, 0.35);
    color: var(--accent-amber);
}

.action-card:hover .action-icon-circle {
    transform: scale(1.08);
}

.action-arrow-icon {
    color: var(--text-muted);
    transition: var(--transition-fast);
}

.action-card:hover .action-arrow-icon {
    color: var(--accent-cyan);
    transform: translateX(3px);
}

.action-card-body {
    margin-top: 0.75rem;
}

.action-title {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.2px;
}

.action-desc {
    font-size: 0.76rem;
    color: var(--text-secondary);
    margin-top: 0.25rem;
    line-height: 1.35;
}

/* ---------------------------------------------------------------------
   MARKET VISUALIZATION & LIVE EXECUTION STREAM
   --------------------------------------------------------------------- */
.market-feed-card {
    background: rgba(14, 22, 40, 0.75);
    border: 1px solid rgba(56, 189, 248, 0.14);
    border-radius: var(--radius-lg);
    padding: 1.25rem 1.15rem;
    margin-top: 1.25rem;
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
}

.market-feed-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.85rem;
}

.market-feed-title {
    font-size: 0.95rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.timeframe-tabs {
    display: flex;
    gap: 0.35rem;
    background: rgba(8, 14, 26, 0.8);
    padding: 2px;
    border-radius: 6px;
    border: 1px solid rgba(56, 189, 248, 0.12);
}

.timeframe-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 0.74rem;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 4px;
    cursor: pointer;
    transition: var(--transition-fast);
}

.timeframe-btn.active, .timeframe-btn:hover {
    color: var(--accent-cyan);
    background: rgba(0, 240, 255, 0.12);
}

/* Mini sparklines in ticker row */
.ticker-cards-row-home {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.75rem;
}

.sparkline-svg {
    width: 100%;
    height: 28px;
    margin-top: 4px;
}

/* Live Order Stream List */
.live-orders-container {
    margin-top: 1rem;
    padding-top: 0.85rem;
    border-top: 1px solid rgba(56, 189, 248, 0.1);
}

.live-order-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.78rem;
    padding: 0.3rem 0;
    color: var(--text-secondary);
    font-family: var(--font-mono);
    animation: fadeInOrder 0.3s ease-out;
}

@keyframes fadeInOrder {
    from { opacity: 0; transform: translateY(-4px); }
    to { opacity: 1; transform: translateY(0); }
}

.order-type-tag {
    padding: 1px 6px;
    border-radius: 3px;
    font-weight: 700;
    font-size: 0.72rem;
}

.order-type-tag.buy {
    background: rgba(16, 185, 129, 0.15);
    color: var(--accent-emerald);
}

.order-type-tag.sell {
    background: rgba(244, 63, 94, 0.15);
    color: var(--accent-rose);
}

/* Bottom nav styles consolidated above — see .btm-nav block */

/* ---------------------------------------------------------------------
   INTERACTIVE MODALS & BOTTOM SHEETS
   --------------------------------------------------------------------- */
.app-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 2000;
    background: rgba(3, 6, 12, 0.78);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.22s ease-out;
}

.app-modal-overlay.open {
    opacity: 1;
    pointer-events: auto;
}

.app-modal-dialog {
    background: linear-gradient(160deg, rgba(14, 22, 40, 0.98) 0%, rgba(9, 14, 26, 0.98) 100%);
    border: 1px solid rgba(56, 189, 248, 0.25);
    border-radius: var(--radius-xl);
    width: 100%;
    max-width: 520px;
    max-height: 90vh;
    overflow-y: auto;
    padding: 1.6rem 1.4rem;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.85), 0 0 30px rgba(0, 240, 255, 0.16);
    transform: translateY(20px) scale(0.96);
    transition: transform 0.24s cubic-bezier(0.16, 1, 0.3, 1);
    position: relative;
}

.app-modal-overlay.open .app-modal-dialog {
    transform: translateY(0) scale(1);
}

.modal-header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.25rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid rgba(56, 189, 248, 0.12);
}

.modal-title-text {
    font-size: 1.25rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 0.55rem;
}

.modal-close-btn {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: var(--text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition-fast);
}

.modal-close-btn:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.12);
    border-color: var(--accent-cyan);
}

/* Modal Content Modules */
.qr-container {
    background: #ffffff;
    border-radius: var(--radius-md);
    padding: 1rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin: 0.85rem auto;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}

.address-copy-box {
    display: flex;
    align-items: center;
    background: rgba(8, 14, 26, 0.9);
    border: 1px solid rgba(56, 189, 248, 0.2);
    border-radius: var(--radius-md);
    padding: 0.65rem 0.85rem;
    margin: 0.85rem 0;
    gap: 0.5rem;
}

.address-text-mono {
    font-family: var(--font-mono);
    font-size: 0.82rem;
    color: var(--accent-cyan);
    word-break: break-all;
    flex: 1;
    direction: ltr !important;
    unicode-bidi: isolate;
}

/* Mobile Responsive Drawer Adjustments */
@media (max-width: 640px) {
    .app-modal-overlay {
        align-items: flex-end;
        padding: 0;
        z-index: 99999;
    }

    .app-modal-dialog {
        border-bottom-left-radius: 0;
        border-bottom-right-radius: 0;
        max-height: 90vh;
        max-height: calc(100dvh - 2rem);
        padding: 1.5rem 1.25rem calc(max(3rem, env(safe-area-inset-bottom, 20px)) + 2.5rem);
        transform: translateY(100%);
    }

    .app-modal-overlay.open .app-modal-dialog {
        transform: translateY(0);
    }
}

/* ---------------------------------------------------------------------
   URDU & RIGHT-TO-LEFT (RTL) SUPPORT
   --------------------------------------------------------------------- */
[dir="rtl"] {
    text-align: right;
    font-family: 'Outfit', 'Noto Sans Arabic', 'Segoe UI', Tahoma, Arial, sans-serif;
}

[dir="rtl"] .top-nav,
[dir="rtl"] .balance-card-header,
[dir="rtl"] .balance-footer-meta,
[dir="rtl"] .action-card-header,
[dir="rtl"] .market-feed-header,
[dir="rtl"] .live-order-row,
[dir="rtl"] .modal-header-row {
    flex-direction: row-reverse;
}

[dir="rtl"] .brand-tag {
    margin-left: 0;
    margin-right: 4px;
}

[dir="rtl"] .lang-dropdown-menu {
    right: auto;
    left: 0;
    text-align: right;
}

[dir="rtl"] .lang-option-btn {
    text-align: right;
    flex-direction: row-reverse;
}

[dir="rtl"] .action-card {
    text-align: right;
}

[dir="rtl"] .action-arrow-icon {
    transform: rotate(180deg);
}

[dir="rtl"] .action-card:hover .action-arrow-icon {
    transform: rotate(180deg) translateX(3px);
}

/* Crucial: Preserve LTR direction on financial numbers and crypto addresses */
[dir="rtl"] .balance-amount-row,
[dir="rtl"] .balance-big-number,
[dir="rtl"] .address-text-mono,
[dir="rtl"] .ticker-price,
[dir="rtl"] .ticker-change,
[dir="rtl"] .timeframe-tabs,
[dir="rtl"] .mono-num,
[dir="rtl"] .phone-number-field {
    direction: ltr !important;
    unicode-bidi: isolate;
    text-align: left;
}

[dir="rtl"] .balance-amount-row {
    justify-content: flex-end;
}


/* =====================================================================
   STOCK MARKET (SM) PREMIUM HOMEPAGE — DESK, BALANCE, 4 ACTIONS, & BOTTOM NAV
   ===================================================================== */

/* Body spacing to ensure content clears fixed bottom nav */
body.has-bottom-nav {
    padding-bottom: calc(78px + env(safe-area-inset-bottom, 16px));
}

.homepage-container {
    width: 100%;
    max-width: 680px;
    margin: 0 auto;
    padding: 0.75rem 1rem 2rem;
    position: relative;
    z-index: 5;
}

@media (min-width: 1024px) {
    .homepage-container {
        max-width: 860px;
    }
}

/* Header Enhancements */
.header-actions {
    display: flex;
    align-items: center;
    gap: 0.65rem;
}

.btn-icon-nav {
    width: 42px;
    height: 42px;
    border-radius: var(--radius-md);
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    color: var(--text-primary);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    position: relative;
    transition: all var(--transition-fast);
}

.btn-icon-nav:hover {
    background: var(--bg-card-hover);
    border-color: var(--accent-cyan);
    transform: translateY(-1px);
}

.notif-badge-dot {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 8px;
    height: 8px;
    background: var(--accent-cyan);
    border-radius: 50%;
    box-shadow: 0 0 8px var(--accent-cyan);
}

/* Language Selector Dropdown */
.lang-selector-wrapper {
    position: relative;
}

.btn-lang-trigger {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.45rem 0.85rem;
    height: 42px;
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 0.88rem;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.btn-lang-trigger:hover {
    border-color: var(--accent-cyan);
    background: var(--bg-card-hover);
}

.lang-dropdown-menu {
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    min-width: 150px;
    background: rgba(11, 17, 32, 0.96);
    backdrop-filter: blur(20px);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    box-shadow: 0 14px 32px rgba(0, 0, 0, 0.7);
    padding: 0.4rem;
    display: none;
    flex-direction: column;
    gap: 0.25rem;
    z-index: 100;
    animation: fadeInDropdown 0.2s ease-out;
}

.lang-dropdown-menu.active {
    display: flex;
}

@keyframes fadeInDropdown {
    from { opacity: 0; transform: translateY(-6px); }
    to { opacity: 1; transform: translateY(0); }
}

.lang-item-btn {
    width: 100%;
    text-align: left;
    padding: 0.6rem 0.85rem;
    border-radius: var(--radius-sm);
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: all var(--transition-fast);
}

.lang-item-btn:hover {
    background: rgba(56, 189, 248, 0.12);
    color: var(--text-primary);
}

.lang-item-btn.selected {
    color: var(--accent-cyan);
    background: rgba(0, 240, 255, 0.08);
    font-weight: 600;
}

/* =====================================================================
   MAIN BALANCE CARD (As per hand-drawn reference: 22 USDT BALANCE)
   ===================================================================== */
.desk-balance-card {
    background: linear-gradient(135deg, rgba(16, 27, 52, 0.88) 0%, rgba(10, 16, 32, 0.84) 100%);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(0, 240, 255, 0.22);
    border-radius: var(--radius-xl);
    padding: 1.65rem 1.5rem;
    margin-bottom: 1.25rem;
    box-shadow: 0 20px 45px -12px rgba(0, 0, 0, 0.8), 0 0 30px rgba(0, 240, 255, 0.07);
    position: relative;
    overflow: hidden;
    transition: transform var(--transition-smooth), border-color var(--transition-smooth);
}

.desk-balance-card::before {
    content: '';
    position: absolute;
    top: -50px;
    right: -50px;
    width: 140px;
    height: 140px;
    background: radial-gradient(circle, rgba(0, 240, 255, 0.2) 0%, transparent 70%);
    border-radius: 50%;
    pointer-events: none;
}

.balance-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.85rem;
}

.balance-header-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.balance-label {
    font-size: 0.88rem;
    font-weight: 500;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.8px;
}

.btn-toggle-balance {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    padding: 4px;
    border-radius: 4px;
    transition: color var(--transition-fast);
}

.btn-toggle-balance:hover {
    color: var(--accent-cyan);
}

.balance-mode-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.72rem;
    font-weight: 600;
    padding: 0.25rem 0.65rem;
    border-radius: 20px;
    letter-spacing: 0.6px;
    text-transform: uppercase;
}

.badge-demo {
    background: rgba(245, 158, 11, 0.15);
    border: 1px solid rgba(245, 158, 11, 0.35);
    color: #fbbf24;
}

.badge-live {
    background: rgba(16, 185, 129, 0.15);
    border: 1px solid rgba(16, 185, 129, 0.35);
    color: #34d399;
}

.badge-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: currentColor;
    box-shadow: 0 0 6px currentColor;
}

/* Primary Balance Number Typography */
.balance-value-row {
    display: flex;
    align-items: baseline;
    gap: 0.65rem;
    margin-bottom: 0.65rem;
    flex-wrap: wrap;
}

.balance-amount {
    font-family: var(--font-mono);
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.1;
    letter-spacing: -0.5px;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
    direction: ltr;
    unicode-bidi: isolate;
}

.balance-currency {
    font-family: var(--font-main);
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--accent-cyan);
    letter-spacing: 0.5px;
}

.balance-footer-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 0.75rem;
    border-top: 1px solid rgba(56, 189, 248, 0.12);
    font-size: 0.8rem;
    color: var(--text-muted);
}

.network-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.pnl-indicator {
    color: var(--accent-emerald);
    font-family: var(--font-mono);
    font-weight: 600;
    direction: ltr;
    unicode-bidi: isolate;
}

/* =====================================================================
   FOUR MAIN ACTION CARDS (2x2 Grid based on sketch)
   Recharge | Withdrawal
   My Invest | Task
   ===================================================================== */
.desk-actions-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.9rem;
    margin-bottom: 1.4rem;
}

@media (max-width: 360px) {
    .desk-actions-grid {
        grid-template-columns: 1fr;
    }
}

.action-card {
    background: var(--bg-card);
    backdrop-filter: blur(16px);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: 1.2rem 1.1rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    cursor: pointer;
    text-decoration: none;
    color: var(--text-primary);
    position: relative;
    overflow: hidden;
    transition: transform var(--transition-fast), border-color var(--transition-fast), box-shadow var(--transition-fast), background-color var(--transition-fast);
    min-height: 120px;
    text-align: left;
}

.action-card:hover {
    background: var(--bg-card-hover);
    border-color: var(--accent-cyan);
    transform: translateY(-3px);
    box-shadow: 0 12px 28px -6px rgba(0, 0, 0, 0.65), 0 0 18px rgba(0, 240, 255, 0.15);
}

.action-card:active {
    transform: scale(0.97);
}

/* Specific Card Accent Variants */
.action-card.card-recharge {
    border-left: 3px solid var(--accent-cyan);
}
.action-card.card-withdrawal {
    border-left: 3px solid var(--accent-blue);
}
.action-card.card-invest {
    border-left: 3px solid var(--accent-emerald);
}
.action-card.card-task {
    border-left: 3px solid var(--accent-amber);
}

.action-card-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.75rem;
}

.action-icon-box {
    width: 44px;
    height: 44px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform var(--transition-fast);
}

.card-recharge .action-icon-box {
    background: rgba(0, 240, 255, 0.12);
    color: var(--accent-cyan);
}
.card-withdrawal .action-icon-box {
    background: rgba(59, 130, 246, 0.14);
    color: #60a5fa;
}
.card-invest .action-icon-box {
    background: rgba(16, 185, 129, 0.14);
    color: var(--accent-emerald);
}
.card-task .action-icon-box {
    background: rgba(245, 158, 11, 0.14);
    color: #fbbf24;
}

.action-card:hover .action-icon-box {
    transform: scale(1.1);
}

.action-arrow-icon {
    color: var(--text-muted);
    transition: transform var(--transition-fast), color var(--transition-fast);
}

.action-card:hover .action-arrow-icon {
    color: var(--accent-cyan);
    transform: translateX(3px);
}

.action-card-body h3 {
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
    letter-spacing: 0.2px;
}

.action-card-body p {
    font-size: 0.78rem;
    color: var(--text-secondary);
    line-height: 1.35;
    margin: 0;
}

/* =====================================================================
   LIVE MARKET STRIP & INSTITUTIONAL QUOTES
   ===================================================================== */
.market-section-card {
    background: var(--bg-card);
    backdrop-filter: blur(16px);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: 1.25rem;
    margin-bottom: 1.5rem;
    box-shadow: var(--shadow-card);
}

.market-section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.9rem;
    padding-bottom: 0.65rem;
    border-bottom: 1px solid var(--border-subtle);
}

.market-title-group h2 {
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--text-primary);
}

.market-title-group p {
    font-size: 0.78rem;
    color: var(--text-muted);
}

.market-live-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.72rem;
    font-weight: 600;
    padding: 0.2rem 0.55rem;
    background: rgba(16, 185, 129, 0.12);
    border: 1px solid rgba(16, 185, 129, 0.3);
    color: var(--accent-emerald);
    border-radius: 20px;
}

.tickers-table {
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
}

.ticker-row-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 0.85rem;
    background: rgba(8, 14, 26, 0.6);
    border: 1px solid rgba(56, 189, 248, 0.08);
    border-radius: var(--radius-md);
    transition: background var(--transition-fast), border-color var(--transition-fast);
}

.ticker-row-card:hover {
    background: rgba(14, 22, 40, 0.9);
    border-color: rgba(56, 189, 248, 0.25);
}

.ticker-left-info {
    display: flex;
    align-items: center;
    gap: 0.65rem;
}

.crypto-coin-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.8rem;
}

.avatar-btc { background: rgba(247, 147, 26, 0.18); color: #f7931a; }
.avatar-eth { background: rgba(98, 126, 234, 0.18); color: #627eea; }
.avatar-sol { background: rgba(20, 241, 149, 0.18); color: #14f195; }
.avatar-bnb { background: rgba(243, 186, 47, 0.18); color: #f3ba2f; }

.ticker-name-pair {
    display: flex;
    flex-direction: column;
}

.symbol-main {
    font-size: 0.92rem;
    font-weight: 600;
    color: var(--text-primary);
    direction: ltr;
    unicode-bidi: isolate;
}

.symbol-sub {
    font-size: 0.72rem;
    color: var(--text-muted);
}

.ticker-right-stats {
    display: flex;
    align-items: center;
    gap: 1.1rem;
    text-align: right;
}

.price-main {
    font-family: var(--font-mono);
    font-size: 0.96rem;
    font-weight: 600;
    color: var(--text-primary);
    direction: ltr;
    unicode-bidi: isolate;
}

.change-tag {
    font-family: var(--font-mono);
    font-size: 0.8rem;
    font-weight: 600;
    padding: 0.25rem 0.55rem;
    border-radius: var(--radius-sm);
    min-width: 66px;
    text-align: center;
    direction: ltr;
    unicode-bidi: isolate;
}

.change-tag.up {
    background: rgba(16, 185, 129, 0.14);
    color: var(--accent-emerald);
}

.change-tag.down {
    background: rgba(244, 63, 94, 0.14);
    color: var(--accent-rose);
}

/* =====================================================================
   BOTTOM NAVIGATION BAR (Matching hand-drawn sketch: HOME | TEAM | ME)
   ===================================================================== */
.desk-bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 90;
    background: rgba(8, 14, 26, 0.92);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border-top: 1px solid var(--border-subtle);
    padding: 0.45rem 1rem calc(0.45rem + env(safe-area-inset-bottom, 10px));
    box-shadow: 0 -10px 25px rgba(0, 0, 0, 0.6);
}

.bottom-nav-inner {
    max-width: 680px;
    margin: 0 auto;
    display: flex;
    justify-content: space-around;
    align-items: center;
}

@media (min-width: 1024px) {
    .bottom-nav-inner {
        max-width: 860px;
    }
}

.bottom-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.25rem;
    padding: 0.45rem 1.25rem;
    min-height: 52px;
    color: var(--text-muted);
    text-decoration: none;
    background: none;
    border: none;
    cursor: pointer;
    border-radius: var(--radius-md);
    position: relative;
    transition: all var(--transition-fast);
    flex: 1;
    max-width: 150px;
}

.bottom-nav-item:hover {
    color: var(--text-secondary);
}

.bottom-nav-item.active {
    color: var(--accent-cyan);
}

.bottom-nav-item.active::before {
    content: '';
    position: absolute;
    top: -1px;
    left: 25%;
    right: 25%;
    height: 3px;
    background: var(--accent-cyan);
    border-radius: 2px;
    box-shadow: 0 0 10px var(--accent-cyan);
}

.nav-item-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform var(--transition-fast);
}

.bottom-nav-item.active .nav-item-icon {
    transform: translateY(-2px);
}

.nav-item-label {
    font-size: 0.78rem;
    font-weight: 500;
    letter-spacing: 0.3px;
}

/* =====================================================================
   MODAL SYSTEM & INTERACTIVE DRAWERS
   ===================================================================== */
.babeen-modal-backdrop,
.sm-modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(4, 7, 14, 0.82);
    backdrop-filter: blur(8px);
    z-index: 200;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.babeen-modal-backdrop.active,
.sm-modal-backdrop.active {
    display: flex;
    opacity: 1;
}

.babeen-modal-window,
.sm-modal-window {
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-xl);
    width: 100%;
    max-width: 480px;
    max-height: 90vh;
    overflow-y: auto;
    padding: 1.5rem;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.85), 0 0 25px rgba(0, 240, 255, 0.12);
    position: relative;
    transform: scale(0.95);
    transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.babeen-modal-backdrop.active .babeen-modal-window,
.sm-modal-backdrop.active .sm-modal-window {
    transform: scale(1);
}

.modal-header-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.25rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--border-subtle);
}

.modal-header-bar h3 {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--text-primary);
}

.btn-close-modal {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    width: 34px;
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.btn-close-modal:hover {
    color: var(--text-primary);
    border-color: var(--accent-cyan);
}

/* Deposit QR Box */
.deposit-qr-card {
    text-align: center;
    padding: 1.25rem;
    background: rgba(8, 14, 26, 0.8);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    margin: 1rem 0;
}

.qr-code-svg-wrap {
    width: 160px;
    height: 160px;
    margin: 0 auto 1rem;
    background: #ffffff;
    padding: 10px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
}

.deposit-address-box {
    background: var(--bg-surface);
    border: 1px dashed var(--border-focus);
    border-radius: var(--radius-md);
    padding: 0.75rem;
    font-family: var(--font-mono);
    font-size: 0.82rem;
    word-break: break-all;
    color: var(--accent-cyan);
    margin: 0.75rem 0;
    user-select: all;
    direction: ltr;
    unicode-bidi: isolate;
}

/* Staking Yield List */
.yield-plans-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin: 1rem 0;
}

.yield-plan-card {
    padding: 1rem;
    background: rgba(8, 14, 26, 0.75);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: border-color var(--transition-fast);
}

.yield-plan-card:hover {
    border-color: var(--accent-emerald);
}

.plan-info h4 {
    font-size: 0.95rem;
    color: var(--text-primary);
    margin-bottom: 0.2rem;
}

.plan-info p {
    font-size: 0.78rem;
    color: var(--text-muted);
}

.plan-apy {
    font-family: var(--font-mono);
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--accent-emerald);
    direction: ltr;
    unicode-bidi: isolate;
}

/* Tasks List */
.task-items-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin: 1rem 0;
}

.task-item-card {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.9rem;
    background: rgba(8, 14, 26, 0.75);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
}

.task-details h4 {
    font-size: 0.92rem;
    color: var(--text-primary);
}

.task-reward {
    font-family: var(--font-mono);
    font-size: 0.82rem;
    color: var(--accent-cyan);
    font-weight: 600;
    direction: ltr;
    unicode-bidi: isolate;
}

/* Tab View Switcher (Home / Team / Me) */
.tab-view {
    display: none;
    animation: fadeInView 0.25s ease-out;
}

.tab-view.active-tab {
    display: block;
}

@keyframes fadeInView {
    from { opacity: 0; transform: translateY(6px); }
    to { opacity: 1; transform: translateY(0); }
}

/* =====================================================================
   RTL LAYOUT SUPPORT FOR URDU (اردو)
   ===================================================================== */
[dir="rtl"], .rtl-layout {
    text-align: right;
}

[dir="rtl"] .action-card,
.rtl-layout .action-card {
    text-align: right;
    border-left: none;
}

[dir="rtl"] .action-card.card-recharge,
.rtl-layout .action-card.card-recharge { border-right: 3px solid var(--accent-cyan); }
[dir="rtl"] .action-card.card-withdrawal,
.rtl-layout .action-card.card-withdrawal { border-right: 3px solid var(--accent-blue); }
[dir="rtl"] .action-card.card-invest,
.rtl-layout .action-card.card-invest { border-right: 3px solid var(--accent-emerald); }
[dir="rtl"] .action-card.card-task,
.rtl-layout .action-card.card-task { border-right: 3px solid var(--accent-amber); }

[dir="rtl"] .action-arrow-icon,
.rtl-layout .action-arrow-icon {
    transform: rotate(180deg);
}

[dir="rtl"] .action-card:hover .action-arrow-icon,
.rtl-layout .action-card:hover .action-arrow-icon {
    transform: rotate(180deg) translateX(3px);
}

[dir="rtl"] .lang-dropdown-menu,
.rtl-layout .lang-dropdown-menu {
    right: auto;
    left: 0;
}

[dir="rtl"] .lang-item-btn,
.rtl-layout .lang-item-btn {
    text-align: right;
}

[dir="rtl"] .ticker-right-stats,
.rtl-layout .ticker-right-stats {
    text-align: left;
}

[dir="rtl"] .balance-amount,
.rtl-layout .balance-amount,
[dir="rtl"] .price-main,
.rtl-layout .price-main,
[dir="rtl"] .pnl-indicator,
.rtl-layout .pnl-indicator,
[dir="rtl"] .deposit-address-box,
.rtl-layout .deposit-address-box {
    direction: ltr !important;
    unicode-bidi: isolate !important;
}

/* =====================================================================
   TEAM & REFERRAL NETWORK PAGE STYLES
   Fintech aesthetic matching index.html & layout from team.jpeg sketch
   ===================================================================== */

.team-page-container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 1.5rem 1.25rem 120px;
    position: relative;
    z-index: 5;
}

/* Page Header */
.team-header-section {
    margin-bottom: 1.75rem;
}

.team-header-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 0.5rem;
}

.team-title-group {
    display: flex;
    align-items: center;
    gap: 0.85rem;
}

.team-network-icon-box {
    width: 44px;
    height: 44px;
    border-radius: var(--radius-md);
    background: linear-gradient(135deg, rgba(0, 240, 255, 0.2), rgba(59, 130, 246, 0.2));
    border: 1px solid var(--border-focus);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 16px rgba(0, 240, 255, 0.25);
}

.team-page-title {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.02em;
    margin: 0;
}

.team-page-subtitle {
    font-size: 0.92rem;
    color: var(--text-secondary);
    line-height: 1.5;
    max-width: 640px;
}

/* Compact Referral Quick Bar */
.team-referral-compact-card {
    background: linear-gradient(135deg, rgba(14, 22, 40, 0.85), rgba(8, 14, 26, 0.94));
    border: 1px solid rgba(0, 240, 255, 0.22);
    border-radius: var(--radius-lg);
    padding: 0.65rem 1.15rem;
    margin-bottom: 1.25rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25);
}

.compact-ref-code-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    background: rgba(0, 240, 255, 0.08);
    border: 1px solid rgba(0, 240, 255, 0.28);
    border-radius: var(--radius-md);
    padding: 0.35rem 0.75rem;
    direction: ltr !important;
    unicode-bidi: isolate !important;
}

.compact-ref-code-text {
    font-size: 0.92rem;
    font-weight: 700;
    color: var(--accent-cyan);
    letter-spacing: 0.08em;
    font-family: var(--font-mono);
}

.btn-icon-copy {
    background: transparent;
    border: none;
    color: var(--accent-cyan);
    cursor: pointer;
    padding: 3px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.btn-icon-copy:hover {
    color: #ffffff;
    background: rgba(0, 240, 255, 0.25);
    transform: scale(1.12);
}

.btn-icon-copy:active {
    transform: scale(0.95);
}

.btn-copy-link-pill,
.btn-invite-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    background: linear-gradient(135deg, #00f0ff, #0099ff);
    color: #030816;
    border: none;
    border-radius: var(--radius-md);
    padding: 0.45rem 1.15rem;
    font-size: 0.85rem;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 0 14px rgba(0, 240, 255, 0.3);
    transition: all 0.2s ease;
    white-space: nowrap;
}

.btn-copy-link-pill:hover,
.btn-invite-pill:hover {
    box-shadow: 0 0 22px rgba(0, 240, 255, 0.55);
    transform: translateY(-1px);
    color: #030816;
}

.btn-copy-link-pill:active,
.btn-invite-pill:active {
    transform: translateY(0);
}



/* 3 Summary Level Cards (Matching Sketch team.jpeg) */
.team-summary-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.25rem;
    margin-bottom: 2rem;
}

.summary-level-card {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: 1.25rem 1.15rem;
    position: relative;
    cursor: pointer;
    transition: var(--transition-smooth);
    user-select: none;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    box-shadow: var(--shadow-card);
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.summary-level-card:hover {
    background: var(--bg-card-hover);
    border-color: rgba(56, 189, 248, 0.35);
    transform: translateY(-2px);
}

/* Sketch match: TOTAL MEMBER text on top */
.card-total-member-label {
    font-size: 0.76rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: 0.65rem;
}

/* Sketch match: Oval / Pill with "1 LEVEL", "2 LEVEL", "3 LEVEL" */
.level-oval-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    padding: 0.45rem 1.25rem;
    border-radius: 999px;
    font-weight: 700;
    font-size: 0.95rem;
    letter-spacing: 0.03em;
    margin-bottom: 0.85rem;
    transition: var(--transition-fast);
}

.summary-level-card.level-1 .level-oval-pill {
    background: rgba(0, 240, 255, 0.10);
    border: 1.5px solid rgba(0, 240, 255, 0.35);
    color: var(--accent-cyan);
}

.summary-level-card.level-2 .level-oval-pill {
    background: rgba(59, 130, 246, 0.10);
    border: 1.5px solid rgba(59, 130, 246, 0.35);
    color: #60a5fa;
}

.summary-level-card.level-3 .level-oval-pill {
    background: rgba(16, 185, 129, 0.10);
    border: 1.5px solid rgba(16, 185, 129, 0.35);
    color: var(--accent-emerald);
}

/* Big Number Count */
.level-count-num {
    font-family: var(--font-mono);
    font-size: 2.25rem;
    font-weight: 700;
    line-height: 1.1;
    color: var(--text-primary);
    margin-bottom: 0.4rem;
    direction: ltr !important;
    unicode-bidi: isolate !important;
}

.level-desc-text {
    font-size: 0.78rem;
    color: var(--text-secondary);
    font-weight: 500;
}

/* Active Level Pointer (Matching the down arrow in the sketch!) */
.summary-level-card.active {
    border-color: var(--border-focus);
    background: rgba(19, 31, 56, 0.95);
    box-shadow: 0 0 24px rgba(0, 240, 255, 0.22), var(--shadow-card);
}

.summary-level-card.active.level-1 { border-color: var(--accent-cyan); }
.summary-level-card.active.level-2 { border-color: #60a5fa; }
.summary-level-card.active.level-3 { border-color: var(--accent-emerald); }

.card-active-arrow {
    position: absolute;
    bottom: -11px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 10px solid transparent;
    border-right: 10px solid transparent;
    border-top: 11px solid var(--accent-cyan);
    display: none;
    z-index: 3;
}

.summary-level-card.active.level-1 .card-active-arrow {
    display: block;
    border-top-color: var(--accent-cyan);
}
.summary-level-card.active.level-2 .card-active-arrow {
    display: block;
    border-top-color: #60a5fa;
}
.summary-level-card.active.level-3 .card-active-arrow {
    display: block;
    border-top-color: var(--accent-emerald);
}

/* Horizontal Level Tabs */
.team-tabs-bar {
    display: flex;
    gap: 0.5rem;
    background: rgba(8, 14, 26, 0.8);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 0.35rem;
    margin-bottom: 1.25rem;
}

.team-level-tab {
    flex: 1;
    min-height: 44px;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    font-family: var(--font-main);
    font-size: 0.92rem;
    font-weight: 600;
    border-radius: var(--radius-sm);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.55rem;
    transition: var(--transition-fast);
}

.team-level-tab:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.04);
}

.team-level-tab.active {
    color: var(--text-primary);
    background: linear-gradient(135deg, rgba(0, 240, 255, 0.18), rgba(59, 130, 246, 0.18));
    border: 1px solid rgba(0, 240, 255, 0.35);
    box-shadow: 0 2px 10px rgba(0, 240, 255, 0.15);
}

.tab-count-pill {
    background: rgba(0, 0, 0, 0.4);
    color: var(--text-primary);
    font-family: var(--font-mono);
    font-size: 0.78rem;
    padding: 0.15rem 0.5rem;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    direction: ltr !important;
    unicode-bidi: isolate !important;
}

/* Search & Results Bar */
.team-filter-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.25rem;
    flex-wrap: wrap;
}

.team-search-box {
    position: relative;
    flex: 1;
    min-width: 240px;
}

.team-search-box svg {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    pointer-events: none;
}

.team-search-input {
    width: 100%;
    background: rgba(14, 22, 40, 0.85);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-family: var(--font-main);
    font-size: 0.88rem;
    padding: 0.65rem 2.5rem 0.65rem 2.75rem;
    outline: none;
    transition: var(--transition-fast);
}

.team-search-input:focus {
    border-color: var(--border-focus);
    box-shadow: 0 0 14px rgba(0, 240, 255, 0.2);
}

.team-search-clear {
    position: absolute;
    right: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 0.25rem;
    font-size: 0.85rem;
    display: none;
}

.team-search-clear:hover {
    color: var(--text-primary);
}

.team-results-count {
    font-size: 0.82rem;
    color: var(--text-muted);
    white-space: nowrap;
}

/* Desktop & Tablet Table */
.team-table-wrapper {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-card);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.team-table-scroll {
    width: 100%;
    overflow-x: auto;
}

.team-data-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
    white-space: nowrap;
}

.team-data-table th {
    background: rgba(8, 14, 26, 0.95);
    color: var(--text-muted);
    font-size: 0.74rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    padding: 1rem 1.15rem;
    border-bottom: 1px solid var(--border-subtle);
}

.team-data-table td {
    padding: 1.05rem 1.15rem;
    border-bottom: 1px solid rgba(56, 189, 248, 0.07);
    color: var(--text-secondary);
    font-size: 0.88rem;
    vertical-align: middle;
}

.team-data-table tbody tr {
    transition: var(--transition-fast);
}

.team-data-table tbody tr:hover {
    background: rgba(255, 255, 255, 0.025);
}

.member-name-cell {
    font-weight: 600;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 0.65rem;
}

.member-avatar-circle {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, rgba(0, 240, 255, 0.2), rgba(59, 130, 246, 0.2));
    border: 1px solid rgba(0, 240, 255, 0.3);
    color: var(--accent-cyan);
    font-weight: 700;
    font-size: 0.8rem;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.mono-cell {
    font-family: var(--font-mono);
    color: var(--text-primary);
    direction: ltr !important;
    unicode-bidi: isolate !important;
}

.sponsor-info-cell {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

.sponsor-name {
    color: var(--text-primary);
    font-weight: 500;
}

.sponsor-phone {
    font-family: var(--font-mono);
    font-size: 0.78rem;
    color: var(--text-muted);
    direction: ltr !important;
    unicode-bidi: isolate !important;
}

/* Status Badges */
.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.22rem 0.65rem;
    border-radius: 999px;
    font-size: 0.74rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    text-transform: capitalize;
}

.status-badge::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: currentColor;
}

.status-badge.status-active {
    background: rgba(16, 185, 129, 0.14);
    color: var(--accent-emerald);
    border: 1px solid rgba(16, 185, 129, 0.35);
}

.status-badge.status-pending {
    background: rgba(245, 158, 11, 0.14);
    color: var(--accent-amber);
    border: 1px solid rgba(245, 158, 11, 0.35);
}

.status-badge.status-inactive {
    background: rgba(148, 163, 184, 0.14);
    color: var(--text-secondary);
    border: 1px solid rgba(148, 163, 184, 0.25);
}

.status-badge.status-suspended {
    background: rgba(244, 63, 94, 0.14);
    color: var(--accent-rose);
    border: 1px solid rgba(244, 63, 94, 0.35);
}

/* Mobile Member Cards (< 768px) */
.team-mobile-cards-list {
    display: none;
    flex-direction: column;
    gap: 0.85rem;
}

.mobile-member-card {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 1rem 1.15rem;
    box-shadow: var(--shadow-card);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    transition: var(--transition-fast);
}

.mobile-member-card:hover {
    border-color: rgba(56, 189, 248, 0.3);
}

.card-header-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.85rem;
    padding-bottom: 0.65rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.card-details-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.65rem 1rem;
}

.card-detail-item {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

.detail-label {
    font-size: 0.72rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.detail-val {
    font-size: 0.86rem;
    color: var(--text-primary);
}

/* Pagination Bar */
.team-pagination-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.15rem;
    border-top: 1px solid var(--border-subtle);
    gap: 1rem;
    flex-wrap: wrap;
}

.pagination-btn {
    min-height: 38px;
    padding: 0.4rem 1rem;
    background: rgba(14, 22, 40, 0.9);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    font-size: 0.84rem;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    transition: var(--transition-fast);
}

.pagination-btn:hover:not(:disabled) {
    color: var(--text-primary);
    border-color: var(--border-focus);
    background: rgba(0, 240, 255, 0.08);
}

.pagination-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.pagination-page-info {
    font-size: 0.84rem;
    color: var(--text-secondary);
    font-family: var(--font-mono);
    direction: ltr !important;
    unicode-bidi: isolate !important;
}

/* Empty, Loading & Error States */
.team-state-box {
    padding: 3.5rem 1.5rem;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.team-state-icon {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: rgba(56, 189, 248, 0.08);
    border: 1px dashed var(--border-subtle);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1rem;
    color: var(--accent-cyan);
}

.team-state-title {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.35rem;
}

.team-state-desc {
    font-size: 0.85rem;
    color: var(--text-muted);
    max-width: 440px;
    line-height: 1.5;
    margin-bottom: 1.25rem;
}

/* Skeleton Loading Animation */
.skeleton-box {
    background: linear-gradient(90deg, rgba(255, 255, 255, 0.03) 25%, rgba(255, 255, 255, 0.08) 50%, rgba(255, 255, 255, 0.03) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: var(--radius-sm);
}

@keyframes shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* Responsive Breakpoints */
@media (max-width: 900px) {
    .team-summary-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 0.85rem;
    }

    .level-oval-pill {
        padding: 0.35rem 0.85rem;
        font-size: 0.85rem;
    }

    .level-count-num {
        font-size: 1.85rem;
    }
}

@media (max-width: 768px) {
    .team-table-wrapper {
        display: none;
    }

    .team-mobile-cards-list {
        display: flex;
    }

    .team-referral-compact-card {
        padding: 0.6rem 0.85rem;
        gap: 0.6rem;
        margin-bottom: 1rem;
    }

    .compact-ref-code-pill {
        padding: 0.25rem 0.55rem;
    }

    .btn-copy-link-pill,
    .btn-invite-pill {
        padding: 0.4rem 0.95rem;
        font-size: 0.82rem;
    }

    .team-summary-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 0.6rem;
    }

    .summary-level-card {
        padding: 1rem 0.5rem;
    }

    .card-total-member-label {
        font-size: 0.65rem;
        letter-spacing: 0.04em;
    }

    .level-oval-pill {
        padding: 0.25rem 0.55rem;
        font-size: 0.74rem;
        margin-bottom: 0.5rem;
    }

    .level-count-num {
        font-size: 1.45rem;
    }

    .level-desc-text {
        font-size: 0.68rem;
    }
}

@media (max-width: 480px) {
    .team-summary-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 0.45rem;
    }

    .summary-level-card {
        padding: 0.85rem 0.35rem;
    }

    .card-total-member-label {
        font-size: 0.6rem;
    }

    .level-oval-pill {
        font-size: 0.68rem;
        padding: 0.2rem 0.4rem;
    }

    .level-count-num {
        font-size: 1.3rem;
    }

    .level-desc-text {
        display: none;
    }

    .card-details-grid {
        grid-template-columns: 1fr;
    }
}

/* RTL Urdu Layout Adjustments */
[dir="rtl"] .team-data-table {
    text-align: right;
}

[dir="rtl"] .team-search-box svg {
    left: auto;
    right: 1rem;
}

[dir="rtl"] .team-search-input {
    padding: 0.65rem 2.75rem 0.65rem 2.5rem;
}

[dir="rtl"] .team-search-clear {
    right: auto;
    left: 0.75rem;
}

[dir="rtl"] .mono-cell,
.rtl-layout .mono-cell,
[dir="rtl"] .sponsor-phone,
.rtl-layout .sponsor-phone,
[dir="rtl"] .level-count-num,
.rtl-layout .level-count-num,
[dir="rtl"] .referral-code-badge,
.rtl-layout .referral-code-badge,
[dir="rtl"] .referral-link-input,
.rtl-layout .referral-link-input,
[dir="rtl"] .tab-count-pill,
.rtl-layout .tab-count-pill,
[dir="rtl"] .pagination-page-info,
.rtl-layout .pagination-page-info {
    direction: ltr !important;
    unicode-bidi: isolate !important;
}

[dir="rtl"] .pagination-btn svg {
    transform: rotate(180deg);
}

/* =====================================================================
   GOOGLE AUTHENTICATION & SINGLE 4-DIGIT PIN ONBOARDING
   ===================================================================== */
.btn-google-auth {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.85rem;
    width: 100%;
    min-height: 52px;
    padding: 0.8rem 1.25rem;
    background: #ffffff;
    color: #1f2937;
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-radius: var(--radius-md);
    font-family: var(--font-main);
    font-size: 0.98rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
    box-shadow: 0 4px 18px rgba(0, 0, 0, 0.35);
    text-decoration: none;
    user-select: none;
    position: relative;
    overflow: hidden;
}

.btn-google-auth:hover {
    background: #f8fafc;
    color: #0f172a;
    transform: translateY(-1px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
}

.btn-google-auth:active {
    transform: translateY(0);
}

.google-icon-svg {
    width: 22px;
    height: 22px;
    flex-shrink: 0;
}

.auth-divider {
    display: flex;
    align-items: center;
    text-align: center;
    margin: 1.4rem 0 1.2rem;
    color: var(--text-muted);
    font-size: 0.82rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.auth-divider::before,
.auth-divider::after {
    content: '';
    flex: 1;
    border-bottom: 1px solid rgba(255, 255, 255, 0.09);
}

.auth-divider span {
    padding: 0 0.85rem;
}

/* Google Onboarding Modal */
.google-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(4, 7, 16, 0.82);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    z-index: 99999;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    overflow-y: auto;
}

.google-modal-overlay.active {
    display: flex;
    animation: fadeIn 0.25s ease-out forwards;
}

.google-modal-card {
    background: linear-gradient(175deg, #0f1b33 0%, #080d1a 100%);
    border: 1px solid rgba(0, 240, 255, 0.32);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.85), 0 0 35px rgba(0, 240, 255, 0.15);
    border-radius: var(--radius-xl);
    width: 100%;
    max-width: 440px;
    padding: 1.75rem 1.6rem;
    position: relative;
    color: var(--text-primary);
    animation: zoomUp 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.google-modal-header {
    text-align: center;
    margin-bottom: 1.25rem;
}

.google-modal-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    background: rgba(0, 240, 255, 0.1);
    border: 1px solid rgba(0, 240, 255, 0.25);
    color: var(--accent-cyan);
    font-size: 0.76rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    padding: 0.3rem 0.75rem;
    border-radius: 999px;
    margin-bottom: 0.65rem;
}

.google-modal-title {
    font-size: 1.35rem;
    font-weight: 700;
    color: #ffffff;
    margin-bottom: 0.35rem;
}

.google-modal-subtitle {
    font-size: 0.86rem;
    color: var(--text-secondary);
    line-height: 1.45;
}

.google-account-pill {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: var(--radius-md);
    padding: 0.65rem 0.85rem;
    margin-bottom: 1.25rem;
}

.google-pill-avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    object-fit: cover;
    background: linear-gradient(135deg, #00f0ff, #3b82f6);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1rem;
    color: #050a14;
    flex-shrink: 0;
}

.google-pill-info {
    flex: 1;
    min-width: 0;
}

.google-pill-email {
    font-size: 0.82rem;
    color: var(--text-primary);
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.google-pill-tag {
    font-size: 0.72rem;
    color: var(--accent-emerald);
    display: flex;
    align-items: center;
    gap: 0.3rem;
    margin-top: 0.15rem;
}

.pin-single-instruction {
    background: rgba(16, 185, 129, 0.08);
    border: 1px dashed rgba(16, 185, 129, 0.35);
    border-radius: var(--radius-sm);
    padding: 0.6rem 0.75rem;
    font-size: 0.78rem;
    color: #a7f3d0;
    margin-top: 0.45rem;
    display: flex;
    align-items: flex-start;
    gap: 0.45rem;
    line-height: 1.4;
}

.pin-single-instruction svg {
    flex-shrink: 0;
    margin-top: 0.1rem;
    color: var(--accent-emerald);
}

.pin-digit-input {
    font-family: var(--font-mono);
    font-size: 1.25rem;
    letter-spacing: 0.35rem;
    text-align: left;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes zoomUp {
    from {
        opacity: 0;
        transform: translateY(20px) scale(0.96);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}


