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

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: #0f172a;
    color: #e2e8f0;
    min-height: 100vh;
    line-height: 1.6;
}

/* ===== TOP BAR ===== */
.topbar {
    background: #1e293b;
    border-bottom: 1px solid #334155;
    padding: 16px 32px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 100;
}

.topbar-left {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    color: #e2e8f0;
}

.topbar-left img {
    width: 36px;
    height: 36px;
}

.topbar-left span {
    font-size: 1.25rem;
    font-weight: 700;
    color: #60a5fa;
}

.topbar-right {
    display: flex;
    align-items: center;
    gap: 16px;
}

.topbar-user {
    font-size: 0.9rem;
    color: #94a3b8;
}

.btn-logout {
    background: transparent;
    border: 1px solid #475569;
    color: #e2e8f0;
    padding: 8px 18px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 500;
    transition: all 0.2s;
}

.btn-logout:hover {
    background: #dc2626;
    border-color: #dc2626;
    color: white;
}

/* ===== MAIN LAYOUT ===== */
.dashboard {
    max-width: 1200px;
    margin: 0 auto;
    padding: 32px 24px;
}

.dashboard-header {
    margin-bottom: 32px;
}

.dashboard-header h1 {
    font-size: 1.75rem;
    font-weight: 700;
    color: #f1f5f9;
    margin-bottom: 4px;
}

.dashboard-header p {
    color: #64748b;
    font-size: 0.95rem;
}

/* ===== STATS ROW ===== */
.stats-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 32px;
}

.stat-card {
    background: #1e293b;
    border: 1px solid #334155;
    border-radius: 12px;
    padding: 20px;
    transition: border-color 0.2s;
}

.stat-card:hover {
    border-color: #60a5fa;
}

.stat-label {
    font-size: 0.8rem;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 6px;
}

.stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: #f1f5f9;
}

.stat-value.blue { color: #60a5fa; }
.stat-value.green { color: #34d399; }
.stat-value.purple { color: #a78bfa; }

/* ===== SECTION CARDS ===== */
.section-card {
    background: #1e293b;
    border: 1px solid #334155;
    border-radius: 16px;
    margin-bottom: 24px;
    overflow: hidden;
}

.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid #334155;
}

.section-header h2 {
    font-size: 1.15rem;
    font-weight: 600;
    color: #f1f5f9;
    display: flex;
    align-items: center;
    gap: 10px;
}

.section-header h2 i {
    color: #60a5fa;
    font-size: 1rem;
}

.section-body {
    padding: 24px;
}

/* ===== PROFILE INFO ===== */
.profile-grid {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 32px;
    align-items: start;
}

.profile-avatar-area {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.avatar {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid #334155;
    transition: border-color 0.2s;
}

.avatar:hover {
    border-color: #60a5fa;
}

.btn-photo {
    background: #334155;
    color: #cbd5e1;
    border: none;
    padding: 6px 14px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.8rem;
    font-weight: 500;
    transition: background 0.2s;
}

.btn-photo:hover {
    background: #475569;
}

.profile-fields {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.info-card {
    background: #0f172a;
    border: 1px solid #334155;
    border-radius: 10px;
    padding: 14px 18px;
}

.info-label {
    font-size: 0.7rem;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
}

.info-value {
    font-size: 1rem;
    font-weight: 500;
    color: #e2e8f0;
    word-break: break-all;
}

/* ===== WALLET GRID ===== */
.wallet-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 14px;
}

.wallet-card {
    background: #0f172a;
    border: 1px solid #334155;
    border-radius: 12px;
    padding: 18px;
    display: flex;
    align-items: center;
    gap: 14px;
    transition: border-color 0.2s, transform 0.2s;
}

.wallet-card:hover {
    border-color: #60a5fa;
    transform: translateY(-2px);
}

.wallet-icon {
    width: 42px;
    height: 42px;
    border-radius: 10px;
    background: linear-gradient(135deg, #1e40af 0%, #3b82f6 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 700;
    color: white;
    flex-shrink: 0;
}

.wallet-info {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.wallet-currency {
    font-size: 0.75rem;
    color: #64748b;
    font-weight: 500;
}

.wallet-amount {
    font-size: 1.15rem;
    font-weight: 700;
    color: #f1f5f9;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.wallet-empty {
    grid-column: 1 / -1;
    text-align: center;
    padding: 40px 20px;
    color: #475569;
    font-size: 0.95rem;
}

.wallet-empty i {
    display: block;
    font-size: 2rem;
    margin-bottom: 10px;
    color: #334155;
}

/* ===== TRANSACTIONS TABLE ===== */
.txn-wrapper {
    overflow-x: auto;
}

.txn-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.txn-table th {
    text-align: left;
    padding: 12px 16px;
    font-size: 0.75rem;
    font-weight: 600;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid #334155;
}

.txn-table td {
    padding: 14px 16px;
    border-bottom: 1px solid #1e293b;
    color: #cbd5e1;
}

.txn-table tbody tr:hover {
    background: rgba(96, 165, 250, 0.05);
}

.txn-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.txn-badge.buy {
    background: rgba(52, 211, 153, 0.15);
    color: #34d399;
}

.txn-badge.sell {
    background: rgba(251, 113, 133, 0.15);
    color: #fb7185;
}

.txn-amount {
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}

.txn-amount.from { color: #fb7185; }
.txn-amount.to { color: #34d399; }

.txn-empty {
    text-align: center;
    padding: 40px 20px;
    color: #475569;
    font-size: 0.95rem;
}

.txn-empty i {
    display: block;
    font-size: 2rem;
    margin-bottom: 10px;
    color: #334155;
}

.btn-load-more {
    display: block;
    width: 100%;
    padding: 12px;
    background: #0f172a;
    border: 1px solid #334155;
    color: #60a5fa;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
    margin-top: 12px;
    transition: all 0.2s;
}

.btn-load-more:hover {
    background: #1e293b;
    border-color: #60a5fa;
}

/* ===== LOADING STATE ===== */
.skeleton {
    background: linear-gradient(90deg, #1e293b 25%, #334155 50%, #1e293b 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: 6px;
    height: 20px;
}

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

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
    .topbar {
        padding: 12px 16px;
    }

    .dashboard {
        padding: 20px 16px;
    }

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

    .profile-grid {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .profile-avatar-area {
        margin-bottom: 8px;
    }

    .profile-fields {
        grid-template-columns: 1fr;
    }

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

    .section-body {
        padding: 16px;
    }

    .txn-table {
        font-size: 0.8rem;
    }

    .txn-table th, .txn-table td {
        padding: 10px 10px;
    }
}

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

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

    .topbar-user {
        display: none;
    }

    .dashboard-header h1 {
        font-size: 1.4rem;
    }
}