@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&display=swap');

/* ========== RESET & BASE ========== */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background-color: #F5F7FA;
    color: #1A1A2E;
    line-height: 1.6;
    min-height: 100vh;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

a { color: inherit; text-decoration: none; }
button { cursor: pointer; border: none; background: none; font-family: inherit; }
input, select, textarea { font-family: inherit; outline: none; }
img { max-width: 100%; height: auto; display: block; }
svg { max-width: 100%; max-height: 100%; }
ul, ol { list-style: none; }

/* ========== CSS VARIABLES ========== */
:root {
    --blue-50: #EBF5FF;
    --blue-100: #D6EBFF;
    --blue-200: #ADD6FF;
    --blue-300: #70BFFF;
    --blue-400: #3DA8FF;
    --blue-500: #00A3FF;
    --blue-600: #0088D4;
    --blue-700: #006DAA;
    --blue-800: #005280;
    --blue-900: #003755;

    --cyan-400: #00D4FF;
    --cyan-500: #00BCD4;

    --white: #FFFFFF;
    --gray-50: #F8F9FB;
    --gray-100: #F1F3F7;
    --gray-200: #E4E7ED;
    --gray-300: #CDD2DC;
    --gray-400: #9DA5B4;
    --gray-500: #6B7280;
    --gray-600: #4B5563;
    --gray-700: #374151;
    --gray-800: #1F2937;
    --gray-900: #111827;

    --text-primary: #1A1A2E;
    --text-secondary: #6B7280;
    --text-muted: #9DA5B4;

    --card-bg: #FFFFFF;
    --card-border: #E4E7ED;
    --input-bg: #F8F9FB;
    --input-border: #E4E7ED;

    --success: #00C853;
    --success-light: #E8F8EF;
    --error: #FF3B30;
    --error-light: #FFEBEE;
    --info: #00A3FF;
    --info-light: #EBF5FF;
    --warning: #FF9500;
    --warning-light: #FFF8E1;

    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 16px 40px rgba(0, 0, 0, 0.12);
    --shadow-blue: 0 4px 16px rgba(0, 163, 255, 0.25);
    --shadow-glow: 0 0 16px rgba(0, 163, 255, 0.1);

    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --radius-full: 9999px;

    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-fast: all 0.15s cubic-bezier(0.4, 0, 0.2, 1);

    --max-width: 480px;
    --nav-height: 64px;
    --bottom-nav-height: 72px;
}

/* ========== APP CONTAINER ========== */
#app {
    max-width: var(--max-width);
    margin: 0 auto;
    min-height: 100vh;
    background: var(--white);
    position: relative;
}

@media (min-width: 768px) {
    body {
        background: linear-gradient(135deg, #EBF5FF 0%, #F5F7FA 50%, #EBF5FF 100%);
    }
    #app {
        box-shadow: 0 0 60px rgba(0, 0, 0, 0.06);
    }
}

/* ========== SPLASH SCREEN ========== */
.splash-screen {
    position: fixed;
    inset: 0;
    background: linear-gradient(145deg, #0D1B2A, #0A1628);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    transition: opacity 0.5s ease, visibility 0.5s ease;
}

.splash-screen.hidden {
    opacity: 0;
    visibility: hidden;
}

.splash-logo {
    width: 120px;
    height: 120px;
    border-radius: 24px;
    animation: splashPulse 1.5s ease-in-out infinite;
    margin-bottom: 20px;
    filter: drop-shadow(0 0 20px rgba(0, 163, 255, 0.4));
}

.splash-text {
    color: var(--blue-500);
    font-size: 28px;
    font-weight: 800;
    letter-spacing: -0.5px;
}

.splash-sub {
    color: rgba(255,255,255,0.4);
    font-size: 13px;
    margin-top: 6px;
    letter-spacing: 2px;
    text-transform: uppercase;
}

.splash-loader {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(0, 163, 255, 0.15);
    border-top-color: var(--blue-500);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin-top: 30px;
}

@keyframes splashPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

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

/* ========== AUTH PAGES ========== */
.auth-page {
    min-height: 100vh;
    background: linear-gradient(165deg, #0D1B2A 0%, #0A1628 40%, #071220 100%);
    display: flex;
    flex-direction: column;
    padding: 0;
    position: relative;
    overflow: hidden;
}

.auth-page::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -30%;
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(0, 163, 255, 0.12) 0%, transparent 70%);
    border-radius: 50%;
}

.auth-page::after {
    content: '';
    position: absolute;
    bottom: -20%;
    left: -20%;
    width: 300px;
    height: 300px;
    background: radial-gradient(circle, rgba(0, 212, 255, 0.06) 0%, transparent 70%);
    border-radius: 50%;
}

.auth-header {
    padding: 60px 28px 30px;
    position: relative;
    z-index: 1;
}

.auth-logo-row {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 32px;
}

.auth-logo-img {
    width: 56px;
    height: 56px;
    border-radius: 14px;
    filter: drop-shadow(0 0 12px rgba(0, 163, 255, 0.3));
}

.auth-logo-name {
    font-size: 24px;
    font-weight: 800;
    color: var(--blue-500);
    letter-spacing: -0.5px;
}

.auth-title {
    font-size: 28px;
    font-weight: 800;
    color: var(--white);
    line-height: 1.2;
    margin-bottom: 8px;
}

.auth-subtitle {
    font-size: 15px;
    color: rgba(255,255,255,0.5);
    line-height: 1.5;
}

.auth-form-container {
    flex: 1;
    background: var(--white);
    border-radius: 28px 28px 0 0;
    padding: 32px 24px 40px;
    position: relative;
    z-index: 1;
}

.auth-form-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 24px;
}

.form-group {
    margin-bottom: 18px;
}

.form-label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--gray-600);
    margin-bottom: 7px;
    letter-spacing: 0.02em;
}

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

.form-input-icon {
    position: absolute;
    left: 14px;
    color: var(--gray-400);
    width: 18px;
    height: 18px;
    transition: var(--transition-fast);
    pointer-events: none;
}

.form-input {
    width: 100%;
    height: 50px;
    border: 1.5px solid var(--input-border);
    border-radius: var(--radius-md);
    padding: 0 16px 0 44px;
    font-size: 15px;
    color: var(--text-primary);
    background: var(--input-bg);
    transition: var(--transition);
}

.form-input:focus {
    border-color: var(--blue-500);
    background: var(--white);
    box-shadow: 0 0 0 3px rgba(0, 163, 255, 0.1);
}

.form-input:focus + .form-input-icon,
.form-input:focus ~ .form-input-icon {
    color: var(--blue-500);
}

.form-input::placeholder {
    color: var(--gray-400);
}

.password-toggle {
    position: absolute;
    right: 14px;
    color: var(--gray-400);
    padding: 4px;
    transition: var(--transition-fast);
}

.password-toggle:hover {
    color: var(--blue-500);
}

.btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    height: 52px;
    border-radius: var(--radius-md);
    font-size: 15px;
    font-weight: 700;
    transition: var(--transition);
    letter-spacing: 0.01em;
}

.btn-primary {
    background: linear-gradient(135deg, #00A3FF 0%, #0077CC 100%);
    color: var(--white);
    box-shadow: var(--shadow-blue);
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 24px rgba(0, 163, 255, 0.35);
}

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

.btn-gold {
    background: linear-gradient(135deg, var(--cyan-400) 0%, var(--blue-500) 100%);
    color: var(--white);
    box-shadow: 0 4px 16px rgba(0, 212, 255, 0.2);
}

.btn-gold:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 24px rgba(0, 212, 255, 0.3);
}

.btn-outline {
    background: transparent;
    color: var(--gray-600);
    border: 1.5px solid var(--gray-200);
}

.btn-outline:hover {
    background: var(--gray-50);
    border-color: var(--blue-500);
    color: var(--blue-500);
}

.btn-sm {
    height: 40px;
    font-size: 13px;
    border-radius: var(--radius-sm);
}

.btn svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.auth-link {
    text-align: center;
    margin-top: 20px;
    font-size: 14px;
    color: var(--gray-500);
}

.auth-link a, .auth-link span.link {
    color: var(--blue-500);
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition-fast);
}

.auth-link a:hover, .auth-link span.link:hover {
    color: var(--blue-700);
}

.form-error {
    font-size: 12px;
    color: var(--error);
    margin-top: 5px;
    display: none;
}

.form-error.show {
    display: block;
}

/* ========== TOP NAVIGATION ========== */
.top-nav {
    display: flex;
    position: relative;
    z-index: 100;
    height: var(--nav-height);
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--gray-200);
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
}

.nav-left {
    display: flex;
    align-items: center;
    gap: 10px;
}

.nav-logo {
    width: 36px;
    height: 36px;
    border-radius: 10px;
}

.nav-brand {
    font-size: 20px;
    font-weight: 800;
    color: var(--text-primary);
    letter-spacing: -0.5px;
}

.nav-right {
    display: flex;
    align-items: center;
    gap: 6px;
}

.nav-icon-btn {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--gray-500);
    transition: var(--transition-fast);
    position: relative;
}

.nav-icon-btn svg {
    width: 24px;
    height: 24px;
}

.nav-icon-btn:hover {
    background: var(--gray-100);
    color: var(--blue-500);
}

.nav-badge {
    position: absolute;
    top: 6px;
    right: 6px;
    width: 8px;
    height: 8px;
    background: var(--error);
    border-radius: 50%;
    border: 2px solid var(--white);
}

/* ========== BOTTOM NAVIGATION ========== */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: var(--max-width);
    height: var(--bottom-nav-height);
    background: rgba(255, 255, 255, 0.96);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-top: 1px solid var(--gray-200);
    display: flex;
    align-items: center;
    justify-content: space-around;
    padding: 0 8px;
    padding-bottom: env(safe-area-inset-bottom, 0);
    z-index: 100;
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    padding: 8px 12px;
    border-radius: var(--radius-md);
    transition: var(--transition-fast);
    min-width: 56px;
    position: relative;
}

.nav-item svg {
    width: 22px;
    height: 22px;
    color: var(--gray-400);
    transition: var(--transition-fast);
}

.nav-item-label {
    font-size: 10px;
    font-weight: 600;
    color: var(--gray-400);
    transition: var(--transition-fast);
}

.nav-item.active svg {
    color: var(--blue-500);
}

.nav-item.active .nav-item-label {
    color: var(--blue-500);
}

.nav-item.active::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 20px;
    height: 3px;
    background: var(--blue-500);
    border-radius: 0 0 3px 3px;
}

/* ========== PAGE CONTENT ========== */
.page {
    display: none;
    padding-bottom: calc(var(--bottom-nav-height) + 20px);
    animation: pageIn 0.3s ease;
}

.page.active {
    display: block;
}

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

/* ========== BALANCE CARD ========== */
.balance-card {
    margin: 16px 16px 0;
    background: linear-gradient(145deg, #0D1B2A, #0A1628);
    border-radius: var(--radius-xl);
    padding: 24px;
    color: var(--white);
    position: relative;
    overflow: hidden;
}

.balance-card::before {
    content: '';
    position: absolute;
    top: -40%;
    right: -20%;
    width: 200px;
    height: 200px;
    background: radial-gradient(circle, rgba(0, 163, 255, 0.15) 0%, transparent 70%);
    border-radius: 50%;
}

.balance-card::after {
    content: '';
    position: absolute;
    bottom: -30%;
    left: -10%;
    width: 150px;
    height: 150px;
    background: radial-gradient(circle, rgba(0, 212, 255, 0.08) 0%, transparent 70%);
    border-radius: 50%;
}

.balance-label {
    font-size: 13px;
    color: rgba(255,255,255,0.55);
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 6px;
}

.balance-eye {
    cursor: pointer;
    padding: 2px;
    opacity: 0.6;
    transition: var(--transition-fast);
}

.balance-eye:hover { opacity: 1; }

.balance-value {
    font-size: 32px;
    font-weight: 800;
    margin-top: 6px;
    letter-spacing: -1px;
    position: relative;
    z-index: 1;
}

.balance-hidden { font-size: 32px; letter-spacing: 4px; }

.balance-row {
    display: flex;
    gap: 20px;
    margin-top: 18px;
    position: relative;
    z-index: 1;
}

.balance-item { flex: 1; }

.balance-item-label {
    font-size: 11px;
    color: rgba(255,255,255,0.45);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.balance-item-value {
    font-size: 16px;
    font-weight: 700;
    margin-top: 2px;
}

.balance-item-value.positive { color: #00E676; }

.balance-actions {
    display: flex;
    gap: 10px;
    margin-top: 20px;
    position: relative;
    z-index: 1;
}

.balance-action-btn {
    flex: 1;
    height: 42px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    font-size: 13px;
    font-weight: 700;
    transition: var(--transition);
}

.balance-action-btn.deposit {
    background: var(--blue-500);
    color: var(--white);
}

.balance-action-btn.deposit:hover {
    background: var(--blue-400);
}

.balance-action-btn.withdraw {
    background: rgba(255,255,255,0.1);
    color: var(--white);
    border: 1px solid rgba(255,255,255,0.15);
}

.balance-action-btn.withdraw:hover {
    background: rgba(255,255,255,0.18);
}

.balance-action-btn svg { width: 16px; height: 16px; }

/* ========== SECTION HEADER ========== */
.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 16px 12px;
}

.section-title {
    font-size: 17px;
    font-weight: 700;
    color: var(--text-primary);
}

.section-link {
    font-size: 13px;
    font-weight: 600;
    color: var(--blue-500);
    transition: var(--transition-fast);
}

.section-link:hover { color: var(--blue-700); }

/* ========== QUICK ACTIONS ========== */
.quick-actions {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    padding: 0 16px;
    margin-top: 16px;
}

.quick-action {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 16px 8px;
    background: var(--white);
    border-radius: var(--radius-lg);
    transition: var(--transition);
    border: 1px solid var(--gray-200);
}

.quick-action:hover {
    border-color: var(--blue-300);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

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

.quick-action-icon.brown { background: linear-gradient(135deg, #00A3FF, #0077CC); }
.quick-action-icon.gold { background: linear-gradient(135deg, #00D4FF, #00A3FF); }
.quick-action-icon.green { background: linear-gradient(135deg, #00C853, #00A040); }
.quick-action-icon.blue { background: linear-gradient(135deg, #7C4DFF, #651FFF); }

.quick-action-icon svg { width: 20px; height: 20px; color: var(--white); }

.quick-action-label {
    font-size: 11px;
    font-weight: 600;
    color: var(--gray-600);
    text-align: center;
}

/* ========== MACHINE CARDS ========== */
.machines-scroll {
    display: flex;
    gap: 12px;
    padding: 0 16px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
}

.machines-scroll::-webkit-scrollbar { display: none; }

.machine-card {
    min-width: 200px;
    flex-shrink: 0;
    background: var(--white);
    border-radius: var(--radius-lg);
    border: 1px solid var(--gray-200);
    overflow: hidden;
    transition: var(--transition);
    scroll-snap-align: start;
    cursor: pointer;
}

.machine-card:hover {
    border-color: var(--blue-300);
    box-shadow: var(--shadow-md);
    transform: translateY(-3px);
}

.machine-card-img {
    width: 100%;
    height: 150px;
    object-fit: cover;
    background: var(--gray-100);
}

.machine-card-body { padding: 14px; }

.machine-card-name {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.machine-card-price {
    font-size: 17px;
    font-weight: 800;
    color: var(--text-primary);
}

.machine-card-yield {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin-top: 6px;
    padding: 4px 8px;
    background: var(--success-light);
    color: var(--success);
    border-radius: var(--radius-full);
    font-size: 11px;
    font-weight: 700;
}

.machine-card-period {
    font-size: 11px;
    color: var(--gray-400);
    margin-top: 6px;
}

/* ========== MACHINES GRID ========== */
.machines-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
    padding: 0 16px;
}

.machine-grid-card {
    background: var(--white);
    border-radius: var(--radius-lg);
    border: 1px solid var(--gray-200);
    overflow: hidden;
    transition: var(--transition);
    cursor: pointer;
}

.machine-grid-card:hover {
    border-color: var(--blue-300);
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.machine-grid-card .machine-card-img { height: 130px; }

.machine-badge {
    position: absolute;
    top: 8px;
    right: 8px;
    padding: 3px 8px;
    border-radius: var(--radius-full);
    font-size: 9px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.machine-badge.hot { background: var(--error); color: var(--white); }
.machine-badge.new { background: var(--blue-500); color: var(--white); }
.machine-badge.vip { background: linear-gradient(135deg, #7C4DFF, #651FFF); color: var(--white); }

/* ========== ACTIVE RENTALS ========== */
.rental-card {
    margin: 0 16px 12px;
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-lg);
    padding: 16px;
    transition: var(--transition);
}

.rental-card:hover {
    box-shadow: var(--shadow-sm);
}

.rental-top { display: flex; align-items: center; gap: 12px; }

.rental-img {
    width: 56px;
    height: 56px;
    border-radius: var(--radius-md);
    object-fit: cover;
    background: var(--gray-100);
}

.rental-info { flex: 1; }

.rental-name { font-size: 14px; font-weight: 700; color: var(--text-primary); }

.rental-status {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    border-radius: var(--radius-full);
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    margin-top: 3px;
}

.rental-status.active { background: var(--success-light); color: var(--success); }
.rental-status.completed { background: var(--gray-100); color: var(--gray-500); }

.rental-earning { text-align: right; }
.rental-earning-label { font-size: 10px; color: var(--gray-400); text-transform: uppercase; letter-spacing: 0.3px; }
.rental-earning-value { font-size: 16px; font-weight: 800; color: var(--success); }

.rental-progress { margin-top: 12px; }

.rental-progress-bar {
    width: 100%;
    height: 6px;
    background: var(--gray-100);
    border-radius: var(--radius-full);
    overflow: hidden;
}

.rental-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--blue-500), var(--cyan-400));
    border-radius: var(--radius-full);
    transition: width 1s ease;
}

.rental-progress-info {
    display: flex;
    justify-content: space-between;
    margin-top: 6px;
    font-size: 11px;
    color: var(--gray-400);
}

/* ========== WALLET ========== */
.wallet-tabs {
    display: flex;
    margin: 12px 16px;
    background: var(--gray-100);
    border-radius: var(--radius-md);
    padding: 4px;
}

.wallet-tab {
    flex: 1;
    height: 40px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 600;
    color: var(--gray-400);
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.wallet-tab.active {
    background: var(--white);
    color: var(--blue-500);
    box-shadow: var(--shadow-sm);
}

.wallet-content { padding: 0 16px; }

.wallet-amount-input { position: relative; margin-bottom: 20px; }

.wallet-currency {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 18px;
    font-weight: 700;
    color: var(--gray-400);
}

.wallet-input {
    width: 100%;
    height: 60px;
    border: 2px solid var(--gray-200);
    border-radius: var(--radius-lg);
    padding: 0 16px 0 48px;
    font-size: 24px;
    font-weight: 800;
    color: var(--text-primary);
    background: var(--white);
    transition: var(--transition);
}

.wallet-input:focus {
    border-color: var(--blue-500);
    box-shadow: 0 0 0 3px rgba(0, 163, 255, 0.1);
}

.wallet-quick-amounts { display: flex; gap: 8px; margin-bottom: 20px; flex-wrap: wrap; }

.quick-amount-btn {
    padding: 8px 16px;
    border-radius: var(--radius-full);
    background: var(--white);
    border: 1px solid var(--gray-200);
    font-size: 13px;
    font-weight: 600;
    color: var(--gray-600);
    transition: var(--transition);
}

.quick-amount-btn:hover, .quick-amount-btn.active {
    background: var(--blue-500);
    color: var(--white);
    border-color: var(--blue-500);
}

.pix-info {
    background: var(--gray-50);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-lg);
    padding: 20px;
    text-align: center;
    margin-top: 20px;
}

.pix-qr {
    width: 180px;
    height: 180px;
    background: var(--white);
    border: 2px solid var(--gray-200);
    border-radius: var(--radius-md);
    margin: 0 auto 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 12px;
}

.pix-key {
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-md);
    padding: 12px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 12px;
}

.pix-key-text {
    font-size: 12px;
    color: var(--gray-600);
    font-family: 'Courier New', monospace;
    word-break: break-all;
}

.pix-key-copy {
    padding: 6px 12px;
    border-radius: var(--radius-sm);
    background: var(--blue-500);
    color: var(--white);
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
    margin-left: 8px;
    transition: var(--transition-fast);
}

.pix-key-copy:hover { background: var(--blue-600); }

/* ========== TRANSACTIONS ========== */
.transaction-list { margin-top: 20px; }

.transaction-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 0;
    border-bottom: 1px solid var(--gray-100);
}

.transaction-item:last-child { border-bottom: none; }

.transaction-icon {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
}

.transaction-icon.deposit { background: var(--success-light); color: var(--success); }
.transaction-icon.withdraw { background: var(--error-light); color: var(--error); }
.transaction-icon.rental { background: var(--info-light); color: var(--blue-500); }
.transaction-icon.bonus { background: rgba(124, 77, 255, 0.1); color: #7C4DFF; }

.transaction-icon svg { width: 18px; height: 18px; }

.transaction-info { flex: 1; }
.transaction-title { font-size: 14px; font-weight: 600; color: var(--text-primary); }
.transaction-date { font-size: 11px; color: var(--gray-400); margin-top: 2px; }

.transaction-amount { font-size: 15px; font-weight: 700; }
.transaction-amount.positive { color: var(--success); }
.transaction-amount.negative { color: var(--error); }

.transaction-status { font-size: 10px; font-weight: 600; text-align: right; margin-top: 2px; }
.transaction-status.pending { color: var(--warning); }
.transaction-status.approved { color: var(--success); }
.transaction-status.rejected { color: var(--error); }

/* ========== AFFILIATE ========== */
.affiliate-card {
    margin: 16px;
    background: linear-gradient(145deg, #0D1B2A, #0A1628);
    border-radius: var(--radius-xl);
    padding: 24px;
    color: var(--white);
    position: relative;
    overflow: hidden;
}

.affiliate-card::before {
    content: '';
    position: absolute;
    top: -30%;
    right: -20%;
    width: 200px;
    height: 200px;
    background: radial-gradient(circle, rgba(0, 163, 255, 0.15) 0%, transparent 70%);
    border-radius: 50%;
}

.affiliate-title { font-size: 20px; font-weight: 800; margin-bottom: 8px; position: relative; z-index: 1; }

.affiliate-desc { font-size: 13px; color: rgba(255,255,255,0.55); margin-bottom: 20px; line-height: 1.5; position: relative; z-index: 1; }

.affiliate-code-box {
    background: rgba(0, 163, 255, 0.1);
    border: 1px solid rgba(0, 163, 255, 0.2);
    border-radius: var(--radius-md);
    padding: 14px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: relative;
    z-index: 1;
}

.affiliate-code { font-size: 16px; font-weight: 700; letter-spacing: 1px; color: var(--cyan-400); }

.affiliate-copy-btn {
    padding: 6px 14px;
    background: var(--blue-500);
    color: var(--white);
    border-radius: var(--radius-sm);
    font-size: 12px;
    font-weight: 700;
    transition: var(--transition-fast);
}

.affiliate-copy-btn:hover { background: var(--blue-400); }

.affiliate-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    padding: 0 16px;
    margin-top: 16px;
}

.affiliate-stat {
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-lg);
    padding: 16px 12px;
    text-align: center;
}

.affiliate-stat-value { font-size: 22px; font-weight: 800; color: var(--text-primary); }
.affiliate-stat-label { font-size: 11px; color: var(--gray-400); margin-top: 4px; font-weight: 500; }

.affiliate-how { margin: 20px 16px; }
.affiliate-how-title { font-size: 17px; font-weight: 700; color: var(--text-primary); margin-bottom: 16px; }

.affiliate-step { display: flex; gap: 14px; margin-bottom: 16px; }

.affiliate-step-num {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--blue-500), var(--blue-700));
    color: var(--white);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 800;
    flex-shrink: 0;
}

.affiliate-step-text { padding-top: 6px; }
.affiliate-step-title { font-size: 14px; font-weight: 700; color: var(--text-primary); }
.affiliate-step-desc { font-size: 12px; color: var(--gray-400); margin-top: 2px; line-height: 1.5; }

/* ========== PROFILE ========== */
.profile-header { padding: 24px 16px; display: flex; align-items: center; gap: 14px; }

.profile-avatar {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--blue-500), var(--blue-700));
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--white);
    font-size: 24px;
    font-weight: 800;
}

.profile-name { font-size: 18px; font-weight: 700; color: var(--text-primary); }
.profile-phone { font-size: 13px; color: var(--gray-400); margin-top: 2px; }

.profile-menu { padding: 0 16px; }

.profile-menu-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px 0;
    border-bottom: 1px solid var(--gray-100);
    transition: var(--transition-fast);
    cursor: pointer;
}

.profile-menu-item:hover { opacity: 0.7; }

.profile-menu-icon {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-md);
    background: var(--gray-50);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--blue-500);
}

.profile-menu-icon svg { width: 18px; height: 18px; }
.profile-menu-text { flex: 1; font-size: 14px; font-weight: 600; color: var(--text-primary); }
.profile-menu-arrow { color: var(--gray-300); }

.profile-menu-item.danger .profile-menu-icon { background: var(--error-light); color: var(--error); }
.profile-menu-item.danger .profile-menu-text { color: var(--error); }

/* ========== MODAL (Legacy classes used in sub-pages) ========== */

.modal-details { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; margin-top: 20px; }

/* ========== SUB PAGE ========== */
.sub-page {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background: #F5F7FA;
    z-index: 50;
    overflow-y: auto;
    overflow-x: hidden;
    animation: slideInRight 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.sub-page.active {
    display: block;
}

.sub-page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 8px;
    background: #fff;
    border-bottom: 1px solid var(--card-border);
    position: sticky;
    top: 0;
    z-index: 10;
    min-height: 56px;
}

.sub-page-back {
    background: none;
    border: none;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--text-primary);
}

.sub-page-title {
    font-size: 16px;
    font-weight: 800;
    color: var(--text-primary);
}

.sub-page-body {
    padding-bottom: 80px;
}

@keyframes slideInRight {
    from { transform: translateX(100%); opacity: 0.9; }
    to { transform: translateX(0); opacity: 1; }
}

.modal-detail {
    background: var(--gray-50);
    border-radius: var(--radius-md);
    padding: 14px;
    border: 1px solid var(--gray-200);
}

.modal-detail-label { font-size: 11px; color: var(--gray-400); text-transform: uppercase; letter-spacing: 0.5px; font-weight: 600; }
.modal-detail-value { font-size: 18px; font-weight: 800; color: var(--text-primary); margin-top: 4px; }
.modal-detail-value.highlight { color: var(--success); }

.modal-footer { padding: 16px 20px 32px; display: flex; gap: 12px; }

/* ========== TOAST ========== */
.toast {
    position: fixed;
    top: 30px;
    left: 50%;
    transform: translateX(-50%);
    max-width: 90%;
    width: max-content;
    padding: 12px 16px 12px 14px;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(0,0,0,0.06);
    border-radius: 40px;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 12px;
    z-index: 9999;
    box-shadow: 0 8px 24px rgba(0,0,0,0.08);
    animation: toastIn 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    font-size: 14px;
    font-weight: 600;
    line-height: 1.4;
    text-align: left;
}

.toast.hidden { animation: toastOut 0.3s ease forwards; }
.toast.success { color: var(--success); }
.toast.error { color: var(--error); }
.toast.info { color: var(--blue-500); }

@keyframes toastIn {
    from { transform: translateX(-50%) translateY(-120%); opacity: 0; }
    to { transform: translateX(-50%) translateY(0); opacity: 1; }
}
@keyframes toastOut {
    from { transform: translateX(-50%) translateY(0); opacity: 1; }
    to { transform: translateX(-50%) translateY(-120%); opacity: 0; }
}

/* ========== MISC ========== */
.empty-state { text-align: center; padding: 40px 20px; }
.empty-state-icon { font-size: 48px; margin-bottom: 12px; }
.empty-state-title { font-size: 16px; font-weight: 700; color: var(--text-primary); }
.empty-state-desc { font-size: 13px; color: var(--gray-400); margin-top: 6px; line-height: 1.5; }

.spinner {
    width: 20px; height: 20px;
    border: 2px solid rgba(0, 163, 255, 0.2);
    border-top-color: var(--blue-500);
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

.announcement {
    margin: 12px 16px;
    padding: 12px 16px;
    background: var(--blue-50);
    border: 1px solid var(--blue-100);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 13px;
    color: var(--gray-700);
    font-weight: 500;
}

.announcement-icon { font-size: 18px; flex-shrink: 0; }

.page-title-bar { padding: 20px 16px 12px; }
.page-title { font-size: 24px; font-weight: 800; color: var(--text-primary); letter-spacing: -0.5px; }
.page-subtitle { font-size: 13px; color: var(--gray-400); margin-top: 4px; }

/* Utilities */
.mt-8 { margin-top: 8px; }
.mt-12 { margin-top: 12px; }
.mt-16 { margin-top: 16px; }
.mt-20 { margin-top: 20px; }
.mt-24 { margin-top: 24px; }
.mb-8 { margin-bottom: 8px; }
.mb-16 { margin-bottom: 16px; }
.px-16 { padding: 0 16px; }
.hidden { display: none !important; }
.text-success { color: var(--success); }

/* ========== NAV ITEM ICON SIZING ========== */
.nav-item-icon {
    width: 22px;
    height: 22px;
    display: inline-flex;
}

/* ========== HORIZONTAL MACHINE CARDS ========== */
.machine-h-card {
    display: block;
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-lg);
    padding: 16px;
    margin-bottom: 12px;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: var(--shadow-sm);
}

.machine-h-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-1px);
}

.machine-h-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}

.machine-h-name {
    font-size: 15px;
    font-weight: 700;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.machine-h-status {
    font-size: 10px;
    font-weight: 600;
    color: var(--white);
    background: var(--gray-600);
    padding: 2px 8px;
    border-radius: var(--radius-full);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.machine-h-detail {
    font-size: 12px;
    color: var(--text-secondary);
}

.machine-h-detail strong {
    color: var(--text-primary);
}

.machine-h-tags {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    margin-top: 2px;
}

.machine-h-tag {
    font-size: 10px;
    color: var(--text-muted);
    background: var(--gray-50);
    border: 1px solid var(--gray-200);
    padding: 2px 8px;
    border-radius: var(--radius-sm);
}

.machine-h-bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 8px;
}

.machine-h-price {
    font-size: 18px;
    font-weight: 800;
    color: var(--text-primary);
}

.machine-h-btn {
    background: linear-gradient(135deg, #00A3FF 0%, #0077CC 100%);
    color: var(--white);
    border: none;
    padding: 8px 20px;
    border-radius: var(--radius-full);
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition-fast);
    box-shadow: var(--shadow-blue);
}

.machine-h-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(0, 163, 255, 0.35);
}

.machine-h-img-wrap {
    width: 100px;
    flex-shrink: 0;
    margin-left: 12px;
    display: flex;
    align-items: flex-start;
    justify-content: flex-end;
    position: relative;
}

.machine-h-img {
    width: 100px;
    height: 100px;
    object-fit: contain;
    border-radius: var(--radius-md);
    background: #fff;
}

.machine-badge {
    position: absolute;
    top: -8px;
    right: -8px;
    width: 24px;
    height: 24px;
    background: #FF3B30;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    box-shadow: 0 2px 4px rgba(255, 59, 48, 0.3);
    z-index: 2;
}

/* ========== PROFILE VIP HEADER ========== */
.profile-vip-header {
    padding: 0 16px 16px;
}

.profile-vip-top {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 0;
}

.profile-vip-avatar {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    overflow: hidden;
    flex-shrink: 0;
    box-shadow: var(--shadow-sm);
}

.profile-vip-info {
    flex: 1;
    min-width: 0;
}

.profile-vip-phone {
    font-size: 18px;
    font-weight: 800;
    color: var(--text-primary);
}

.profile-vip-code {
    font-size: 12px;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 6px;
}

.vip-badge {
    background: var(--blue-500);
    color: #fff;
    font-size: 10px;
    font-weight: 800;
    padding: 2px 8px;
    border-radius: var(--radius-full);
}

.profile-vip-diamond {
    cursor: pointer;
    transition: var(--transition-fast);
}

.profile-vip-diamond:hover {
    transform: scale(1.1);
}

.profile-vip-banner {
    background: linear-gradient(135deg, #FFD700 0%, #FFA000 100%);
    color: #fff;
    border-radius: var(--radius-lg);
    padding: 16px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: 0 4px 16px rgba(255, 160, 0, 0.3);
}

.profile-vip-banner:hover {
    transform: translateY(-1px);
}

/* ========== PROFILE CARDS ========== */
.profile-card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-lg);
    padding: 16px;
    margin: 0 16px 12px;
}

.profile-card-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.profile-card-col {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 6px;
}

.profile-card-label {
    font-size: 12px;
    color: var(--text-muted);
    font-weight: 500;
}

.profile-card-value {
    font-size: 20px;
    font-weight: 800;
    color: var(--text-primary);
}

.profile-card-btn {
    border: none;
    padding: 6px 16px;
    border-radius: var(--radius-full);
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition-fast);
}

.profile-card-btn.primary {
    background: linear-gradient(135deg, #00A3FF, #0077CC);
    color: #fff;
}

.profile-card-link {
    font-size: 12px;
    color: var(--blue-500);
    cursor: pointer;
    font-weight: 600;
}

/* ========== PROFILE INCOME/CONTRACT ========== */
.profile-income-grid {
    display: flex;
    justify-content: space-between;
    gap: 8px;
}

.profile-income-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.profile-income-label {
    font-size: 11px;
    color: var(--text-muted);
}

.profile-income-value {
    font-size: 15px;
    font-weight: 700;
    color: var(--text-primary);
}

.profile-contract-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
    text-align: center;
}

.profile-contract-item {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.profile-contract-value {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-primary);
}

.profile-contract-label {
    font-size: 10px;
    color: var(--text-muted);
}

.profile-transfer-btn {
    border: 1px solid var(--gray-200);
    background: var(--white);
    color: var(--text-primary);
    padding: 6px 14px;
    border-radius: var(--radius-full);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition-fast);
}

.profile-transfer-btn:hover {
    background: var(--blue-500);
    color: var(--white);
    border-color: var(--blue-500);
}

/* ========== PROFILE ACTION GRID ========== */
.profile-actions-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    padding: 0 16px;
    margin-bottom: 16px;
}

.profile-action-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px 0;
}

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

.profile-action-item:hover .profile-action-icon {
    transform: scale(1.08);
}

.profile-action-label {
    font-size: 11px;
    color: var(--text-secondary);
    font-weight: 500;
}

/* ========== VIP LEVEL CARDS ========== */
.vip-level-card {
    background: var(--gray-50);
    border-radius: var(--radius-md);
    padding: 14px 16px;
    margin-bottom: 8px;
    transition: var(--transition-fast);
}

.vip-level-card.unlocked {
    background: var(--success-light);
}

@media (max-width: 380px) {
    .balance-value { font-size: 26px; }
    .quick-actions { grid-template-columns: repeat(2, 1fr); }
    .profile-contract-grid { grid-template-columns: repeat(2, 1fr); }
}


.spinner { display: inline-block; width: 14px; height: 14px; border: 2px solid rgba(255,255,255,0.3); border-radius: 50%; border-top-color: #fff; animation: spin 1s ease-in-out infinite; margin-right: 8px; vertical-align: middle; } @keyframes spin { to { transform: rotate(360deg); } }
