:root {
    --brand-accent: #5B5BF6;
    --brand-glow: #7C7CFF;
    --bg-base: #0A0B14;
    --bg-surface: #11131F;
    --bg-elevated: #181A2E;
    --bg-border: rgba(91, 91, 246, 0.15);
    --text-primary: #F0F1FF;
    --text-secondary: #8B8FA8;
    --text-tertiary: #4A4E6A;
    --success: #00D68F;
    --warning: #FFB020;
    --gradient-brand: linear-gradient(135deg, #2C2C9A 0%, #5B5BF6 100%);
}

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

body {
    background: var(--bg-base);
    color: var(--text-primary);
    font-family: 'Inter', sans-serif;
    min-height: 100vh;
    padding-top: 64px;
    padding-bottom: 72px;
    -webkit-font-smoothing: antialiased;
}

/* HEADER */
.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    height: 64px;
    background: var(--bg-surface);
    border-bottom: 1px solid var(--bg-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
}

.menu-btn {
    background: none;
    border: none;
    color: var(--text-primary);
    font-size: 18px;
    cursor: pointer;
    padding: 8px;
    border-radius: 8px;
    transition: background 0.2s;
}

.menu-btn:hover {
    background: var(--bg-elevated);
}

.header-logo {
    font-family: 'Syne', sans-serif;
    font-size: 16px;
    font-weight: 800;
    background: var(--gradient-brand);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: 2px;
}

.avatar-wrap {
    position: relative;
}

.avatar {
    width: 36px;
    height: 36px;
    background: var(--gradient-brand);
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 15px;
    font-weight: 700;
    color: #fff;
    font-family: 'Syne', sans-serif;
    user-select: none;
}

.dropdown {
    position: absolute;
    top: 44px;
    right: 0;
    background: var(--bg-surface);
    border: 1px solid var(--bg-border);
    border-radius: 12px;
    width: 160px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    overflow: hidden;
    z-index: 1001;
}

.dropdown.hidden {
    display: none;
}

.dropdown-item {
    padding: 12px 16px;
    font-size: 14px;
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: background 0.15s, color 0.15s;
}

.dropdown-item:hover {
    background: var(--bg-elevated);
    color: var(--text-primary);
}

.dropdown-item.danger:hover {
    color: #FF4F6A;
}

/* DRAWER */
.drawer-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1500;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s;
}

.drawer-overlay.show {
    opacity: 1;
    pointer-events: all;
}

.drawer {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: 260px;
    background: var(--bg-surface);
    border-right: 1px solid var(--bg-border);
    z-index: 1600;
    transform: translateX(-100%);
    transition: transform 0.32s cubic-bezier(0.22, 1, 0.36, 1);
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

.drawer.open {
    transform: translateX(0);
}

.drawer-logo {
    font-family: 'Syne', sans-serif;
    font-size: 18px;
    font-weight: 800;
    background: var(--gradient-brand);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: 2px;
    padding: 28px 20px 20px;
    border-bottom: 1px solid var(--bg-border);
}

.drawer-nav {
    padding: 12px 0;
    flex: 1;
}

.nav-section-label {
    font-size: 10px;
    font-weight: 600;
    color: var(--text-tertiary);
    letter-spacing: 1px;
    padding: 12px 20px 6px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 20px;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 14px;
    transition: background 0.15s, color 0.15s;
    border-left: 3px solid transparent;
}

.nav-item:hover {
    background: var(--bg-elevated);
    color: var(--text-primary);
}

.nav-item.active {
    color: var(--brand-accent);
    border-left-color: var(--brand-accent);
    background: rgba(91, 91, 246, 0.07);
}

.nav-item i {
    width: 16px;
    text-align: center;
}

.drawer-footer {
    padding: 16px 20px;
    border-top: 1px solid var(--bg-border);
}

.logout-btn {
    background: none;
    border: 1px solid rgba(255, 79, 106, 0.3);
    border-radius: 8px;
    color: #FF4F6A;
    padding: 10px 16px;
    font-size: 13px;
    font-family: 'Inter', sans-serif;
    cursor: pointer;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: background 0.15s;
}

.logout-btn:hover {
    background: rgba(255, 79, 106, 0.1);
}

/* MAIN */
.main {
    max-width: 900px;
    margin: 0 auto;
    padding: 24px 20px;
}

.greeting-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 24px;
    flex-wrap: wrap;
    gap: 8px;
}

.greeting-label {
    font-size: 12px;
    color: var(--text-secondary);
}

.greeting-name {
    font-family: 'Syne', sans-serif;
    font-size: 22px;
    font-weight: 700;
}

.greeting-date {
    font-size: 12px;
    color: var(--text-tertiary);
    align-self: flex-end;
}

/* BALANCE CARD */
.balance-card {
    background: var(--gradient-brand);
    border-radius: 20px;
    padding: 28px;
    margin-bottom: 20px;
    position: relative;
    overflow: hidden;
}

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

.balance-label {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 6px;
}

.balance-amount {
    font-family: 'Syne', sans-serif;
    font-size: 36px;
    font-weight: 800;
    color: #fff;
}

.balance-btc {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.6);
    margin-top: 4px;
}

.balance-icon {
    font-size: 72px;
    color: rgba(255, 255, 255, 0.1);
    line-height: 1;
    position: absolute;
    right: 20px;
    top: 20px;
}

.balance-actions {
    display: flex;
    gap: 12px;
    margin-top: 24px;
}

.bal-btn {
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    padding: 8px 16px;
    color: #fff;
    font-size: 13px;
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
    transition: background 0.15s;
    display: flex;
    align-items: center;
    gap: 6px;
}

.bal-btn:hover {
    background: rgba(255, 255, 255, 0.25);
}

/* STATS */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 14px;
    margin-bottom: 20px;
}

.stat-card {
    background: var(--bg-surface);
    border: 1px solid var(--bg-border);
    border-radius: 16px;
    padding: 18px;
}

.stat-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 12px;
}

.stat-label {
    font-size: 12px;
    color: var(--text-secondary);
}

.stat-icon {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
}

.stat-icon.blue {
    background: rgba(91, 91, 246, 0.15);
    color: var(--brand-accent);
}

.stat-icon.purple {
    background: rgba(91, 91, 246, 0.15);
    color: var(--brand-glow);
}

.stat-icon.green {
    background: rgba(0, 214, 143, 0.12);
    color: var(--success);
}

.stat-value {
    font-family: 'Syne', sans-serif;
    font-size: 20px;
    font-weight: 700;
}

.stat-sub {
    font-size: 11px;
    color: var(--text-tertiary);
    margin-top: 4px;
}

.green-text {
    color: var(--success);
}

/* CARDS */
.two-col {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.card {
    background: var(--bg-surface);
    border: 1px solid var(--bg-border);
    border-radius: 16px;
    padding: 20px;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 14px;
}

.card-header h3 {
    font-size: 15px;
    font-weight: 600;
}

.view-all {
    font-size: 12px;
    color: var(--brand-accent);
    text-decoration: none;
}

/* Chart tabs */
.coin-tabs {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 4px;
}

.coin-tab {
    background: var(--bg-elevated);
    border: 1px solid var(--bg-border);
    border-radius: 6px;
    color: var(--text-secondary);
    font-size: 12px;
    font-family: 'Inter', sans-serif;
    padding: 5px 12px;
    cursor: pointer;
    transition: all 0.15s;
}

.coin-tab.active,
.coin-tab:hover {
    background: var(--brand-accent);
    color: #fff;
    border-color: var(--brand-accent);
}

/* Transaction rows */
.tx-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 0;
    border-bottom: 1px solid var(--bg-border);
}

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

.tx-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: rgba(91, 91, 246, 0.12);
    color: var(--brand-accent);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 14px;
}

.tx-info {
    flex: 1;
}

.tx-name {
    font-size: 13px;
    font-weight: 500;
}

.tx-date {
    font-size: 11px;
    color: var(--text-tertiary);
    margin-top: 2px;
}

.tx-amount {
    font-size: 13px;
    font-weight: 600;
    color: #FF4F6A;
}

/* Empty state */
.empty-state {
    text-align: center;
    padding: 32px 16px;
    color: var(--text-tertiary);
}

.empty-state i {
    font-size: 32px;
    margin-bottom: 10px;
    display: block;
}

.empty-state p {
    font-size: 13px;
}

/* BOTTOM NAV */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--bg-surface);
    border-top: 1px solid var(--bg-border);
    display: none;
    grid-template-columns: repeat(5, 1fr);
    z-index: 999;
    padding-bottom: env(safe-area-inset-bottom);
}

.bnav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    padding: 10px;
    color: var(--text-tertiary);
    text-decoration: none;
    font-size: 10px;
    font-weight: 500;
    transition: color 0.15s;
}

.bnav-item i {
    font-size: 18px;
}

.bnav-item.active,
.bnav-item:hover {
    color: var(--brand-accent);
}

/* RESPONSIVE */
@media (max-width: 700px) {
    .bottom-nav {
        display: grid;
    }

    .two-col {
        grid-template-columns: 1fr;
    }

    .stats-grid {
        grid-template-columns: 1fr 1fr;
    }

    .balance-amount {
        font-size: 28px;
    }
}

@media (max-width: 480px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }

    .balance-actions {
        flex-wrap: wrap;
    }
}