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

:root {
    --bg: #0a0b0f;
    --bg2: #12141a;
    --bg3: #1a1d26;
    --card: #1e2130;
    --card2: #252840;
    --border: #2a2d3e;
    --text: #e8eaf0;
    --text2: #8b8fa8;
    --text3: #5a5e72;
    --accent: #6c63ff;
    --accent2: #8b83ff;
    --green: #00d4aa;
    --red: #ff4d6d;
    --yellow: #ffd166;
    --blue: #4cc9f0;
    --radius: 16px;
    --radius-sm: 10px;
    --shadow: 0 8px 32px rgba(0,0,0,0.4);
    --shadow-sm: 0 4px 16px rgba(0,0,0,0.3);
    --font: 'Inter', sans-serif;
    --mono: 'JetBrains Mono', monospace;
    --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

[data-theme="light"] {
    --bg: #f0f2f8;
    --bg2: #e4e7f0;
    --bg3: #d8dbe8;
    --card: #ffffff;
    --card2: #f5f6fc;
    --border: #dde0ee;
    --text: #1a1d26;
    --text2: #5a5e72;
    --text3: #8b8fa8;
    --shadow: 0 8px 32px rgba(100,100,150,0.12);
    --shadow-sm: 0 4px 16px rgba(100,100,150,0.08);
}

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

html { scroll-behavior: smooth; }

body {
    font-family: var(--font);
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    transition: var(--transition);
    line-height: 1.6;
}

/* ---- SCROLLBAR ---- */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg2); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }

/* ---- LAYOUT ---- */
.app-shell {
    display: grid;
    grid-template-columns: 260px 1fr;
    min-height: 100vh;
}

.sidebar {
    background: var(--bg2);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    padding: 24px 0;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
}

.sidebar-logo {
    padding: 0 24px 32px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo-icon {
    width: 40px; height: 40px;
    background: linear-gradient(135deg, var(--accent), var(--blue));
    border-radius: 12px;
    display: flex; align-items: center; justify-content: center;
    font-size: 20px; color: #fff;
    box-shadow: 0 4px 16px rgba(108,99,255,0.4);
}

.logo-text {
    font-family: var(--mono);
    font-size: 16px;
    font-weight: 700;
    color: var(--text);
    letter-spacing: -0.5px;
}

.logo-text span { color: var(--accent); }

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

.nav-section {
    margin-bottom: 8px;
}

.nav-label {
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: var(--text3);
    padding: 12px 12px 6px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 14px;
    border-radius: var(--radius-sm);
    color: var(--text2);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: var(--transition);
    margin-bottom: 2px;
    position: relative;
}

.nav-item:hover {
    background: var(--bg3);
    color: var(--text);
}

.nav-item.active {
    background: linear-gradient(135deg, rgba(108,99,255,0.2), rgba(76,201,240,0.1));
    color: var(--accent2);
    border: 1px solid rgba(108,99,255,0.2);
}

.nav-item .icon {
    width: 36px; height: 36px;
    background: var(--bg3);
    border-radius: 8px;
    display: flex; align-items: center; justify-content: center;
    font-size: 16px;
    flex-shrink: 0;
}

.nav-item.active .icon {
    background: rgba(108,99,255,0.2);
}

.nav-badge {
    margin-left: auto;
    background: var(--red);
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 20px;
    min-width: 18px;
    text-align: center;
}

.sidebar-footer {
    padding: 16px 24px;
    border-top: 1px solid var(--border);
}

.theme-toggle {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    background: var(--bg3);
    border-radius: var(--radius-sm);
    cursor: pointer;
    border: 1px solid var(--border);
    color: var(--text2);
    font-size: 13px;
    font-weight: 500;
    transition: var(--transition);
    width: 100%;
}

.theme-toggle:hover { border-color: var(--accent); color: var(--accent); }

.toggle-track {
    width: 36px; height: 20px;
    background: var(--bg);
    border-radius: 10px;
    position: relative;
    margin-left: auto;
    border: 1px solid var(--border);
    transition: var(--transition);
}

.toggle-thumb {
    width: 14px; height: 14px;
    background: var(--text3);
    border-radius: 50%;
    position: absolute;
    top: 2px; left: 2px;
    transition: var(--transition);
}

[data-theme="light"] .toggle-thumb { left: 18px; background: var(--accent); }
[data-theme="light"] .toggle-track { background: rgba(108,99,255,0.1); }

/* ---- MAIN CONTENT ---- */
.main-content {
    background: var(--bg);
    overflow-y: auto;
}

.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 32px;
    border-bottom: 1px solid var(--border);
    background: var(--bg);
    position: sticky;
    top: 0;
    z-index: 10;
    backdrop-filter: blur(10px);
}

.topbar-left h1 {
    font-size: 20px;
    font-weight: 700;
    color: var(--text);
}

.topbar-left p {
    font-size: 13px;
    color: var(--text2);
}

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

.icon-btn {
    width: 40px; height: 40px;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    display: flex; align-items: center; justify-content: center;
    cursor: pointer;
    transition: var(--transition);
    color: var(--text2);
    font-size: 16px;
    text-decoration: none;
    position: relative;
}

.icon-btn:hover { border-color: var(--accent); color: var(--accent); }

.notif-dot {
    width: 8px; height: 8px;
    background: var(--red);
    border-radius: 50%;
    position: absolute;
    top: 6px; right: 6px;
    border: 2px solid var(--bg);
}

.user-avatar {
    width: 40px; height: 40px;
    background: linear-gradient(135deg, var(--accent), var(--blue));
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-weight: 700;
    font-size: 14px;
    color: #fff;
    cursor: pointer;
}

.page-body { padding: 28px 32px; }

/* ---- CARDS ---- */
.card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
    transition: var(--transition);
}

.card:hover { border-color: rgba(108,99,255,0.3); }

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

/* ---- BALANCE HERO ---- */
.balance-hero {
    background: linear-gradient(135deg, #1a1040 0%, #0d1a3a 50%, #0a1628 100%);
    border: 1px solid rgba(108,99,255,0.3);
    border-radius: var(--radius);
    padding: 32px;
    position: relative;
    overflow: hidden;
}

[data-theme="light"] .balance-hero {
    background: linear-gradient(135deg, #6c63ff 0%, #4cc9f0 100%);
    border-color: transparent;
}

.balance-hero::before {
    content: '';
    position: absolute;
    width: 300px; height: 300px;
    background: radial-gradient(circle, rgba(108,99,255,0.2) 0%, transparent 70%);
    top: -100px; right: -100px;
    pointer-events: none;
}

.balance-hero::after {
    content: '';
    position: absolute;
    width: 200px; height: 200px;
    background: radial-gradient(circle, rgba(76,201,240,0.15) 0%, transparent 70%);
    bottom: -80px; left: 50px;
    pointer-events: none;
}

.balance-label {
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: rgba(255,255,255,0.6);
    margin-bottom: 8px;
}

.balance-amount {
    font-family: var(--mono);
    font-size: 42px;
    font-weight: 700;
    color: #fff;
    line-height: 1;
    margin-bottom: 6px;
}

.balance-change {
    font-size: 13px;
    color: rgba(255,255,255,0.6);
}

.balance-change .up { color: var(--green); }
.balance-change .down { color: var(--red); }

.quick-actions {
    display: flex;
    gap: 12px;
    margin-top: 24px;
    position: relative;
    z-index: 1;
}

.qa-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    background: rgba(255,255,255,0.12);
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: 50px;
    color: #fff;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
    backdrop-filter: blur(10px);
}

.qa-btn:hover {
    background: rgba(255,255,255,0.2);
    transform: translateY(-1px);
    color: #fff;
}

.qa-btn .qa-icon {
    width: 24px; height: 24px;
    background: rgba(255,255,255,0.2);
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 12px;
}

/* ---- STATS GRID ---- */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
}

.stat-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    display: flex;
    align-items: flex-start;
    gap: 16px;
    transition: var(--transition);
}

.stat-card:hover {
    border-color: rgba(108,99,255,0.3);
    transform: translateY(-2px);
    box-shadow: var(--shadow-sm);
}

.stat-icon {
    width: 48px; height: 48px;
    border-radius: 12px;
    display: flex; align-items: center; justify-content: center;
    font-size: 20px;
    flex-shrink: 0;
}

.stat-info { flex: 1; }
.stat-value { font-size: 22px; font-weight: 700; font-family: var(--mono); color: var(--text); }
.stat-label { font-size: 12px; color: var(--text2); margin-top: 2px; }

/* ---- WALLET LIST ---- */
.wallet-list { display: flex; flex-direction: column; gap: 8px; }

.wallet-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px 20px;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    transition: var(--transition);
    cursor: pointer;
    text-decoration: none;
    color: inherit;
}

.wallet-item:hover {
    border-color: rgba(108,99,255,0.3);
    background: var(--card2);
    transform: translateX(2px);
}

.coin-badge {
    width: 44px; height: 44px;
    border-radius: 12px;
    display: flex; align-items: center; justify-content: center;
    font-size: 18px;
    font-weight: 700;
    color: #fff;
    flex-shrink: 0;
}

.coin-info { flex: 1; }
.coin-name { font-size: 14px; font-weight: 600; color: var(--text); }
.coin-network { font-size: 11px; color: var(--text3); font-family: var(--mono); }

.coin-balance { text-align: right; }
.coin-amount { font-size: 14px; font-weight: 700; font-family: var(--mono); color: var(--text); }
.coin-usd { font-size: 12px; color: var(--text2); }

.coin-change {
    font-size: 11px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 20px;
}

.coin-change.up { background: rgba(0,212,170,0.15); color: var(--green); }
.coin-change.down { background: rgba(255,77,109,0.15); color: var(--red); }

/* ---- TX LIST ---- */
.tx-list { display: flex; flex-direction: column; gap: 4px; }

.tx-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 16px;
    border-radius: var(--radius-sm);
    transition: var(--transition);
    border: 1px solid transparent;
}

.tx-item:hover {
    background: var(--card2);
    border-color: var(--border);
}

.tx-icon {
    width: 40px; height: 40px;
    border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    font-size: 16px;
    flex-shrink: 0;
}

.tx-icon.deposit { background: rgba(0,212,170,0.15); color: var(--green); }
.tx-icon.withdrawal { background: rgba(255,77,109,0.15); color: var(--red); }
.tx-icon.send { background: rgba(255,209,102,0.15); color: var(--yellow); }
.tx-icon.receive { background: rgba(76,201,240,0.15); color: var(--blue); }
.tx-icon.swap { background: rgba(108,99,255,0.15); color: var(--accent); }

.tx-info { flex: 1; }
.tx-title { font-size: 13px; font-weight: 600; color: var(--text); }
.tx-date { font-size: 11px; color: var(--text3); }

.tx-amount { text-align: right; }
.tx-val { font-size: 13px; font-weight: 700; font-family: var(--mono); }
.tx-val.positive { color: var(--green); }
.tx-val.negative { color: var(--red); }
.tx-status { font-size: 10px; font-weight: 600; }

/* ---- BADGES ---- */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
}

.badge-pending { background: rgba(255,209,102,0.15); color: var(--yellow); }
.badge-approved, .badge-completed { background: rgba(0,212,170,0.15); color: var(--green); }
.badge-rejected { background: rgba(255,77,109,0.15); color: var(--red); }

/* ---- FORMS ---- */
.form-group { margin-bottom: 20px; }

.form-label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    color: var(--text2);
    margin-bottom: 8px;
}

.form-control {
    width: 100%;
    padding: 12px 16px;
    background: var(--bg2);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text);
    font-size: 14px;
    font-family: var(--font);
    transition: var(--transition);
    outline: none;
}

.form-control:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(108,99,255,0.15);
}

.form-control::placeholder { color: var(--text3); }

select.form-control option {
    background: var(--bg2);
    color: var(--text);
}

.form-hint { font-size: 12px; color: var(--text3); margin-top: 6px; }

/* ---- BUTTONS ---- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    border: none;
    text-decoration: none;
    font-family: var(--font);
}

.btn-primary {
    background: linear-gradient(135deg, var(--accent), #8b65ff);
    color: #fff;
    box-shadow: 0 4px 16px rgba(108,99,255,0.35);
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 24px rgba(108,99,255,0.45);
    color: #fff;
}

.btn-secondary {
    background: var(--bg3);
    color: var(--text);
    border: 1px solid var(--border);
}

.btn-secondary:hover { border-color: var(--accent); color: var(--accent); }

.btn-danger {
    background: rgba(255,77,109,0.15);
    color: var(--red);
    border: 1px solid rgba(255,77,109,0.3);
}

.btn-danger:hover { background: var(--red); color: #fff; }

.btn-success {
    background: rgba(0,212,170,0.15);
    color: var(--green);
    border: 1px solid rgba(0,212,170,0.3);
}

.btn-success:hover { background: var(--green); color: #0a0b0f; }

.btn-sm { padding: 7px 14px; font-size: 12px; }
.btn-lg { padding: 15px 32px; font-size: 16px; }
.btn-block { width: 100%; }

/* ---- ALERTS ---- */
.alert {
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    margin-bottom: 16px;
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

.alert-success { background: rgba(0,212,170,0.1); border: 1px solid rgba(0,212,170,0.3); color: var(--green); }
.alert-error { background: rgba(255,77,109,0.1); border: 1px solid rgba(255,77,109,0.3); color: var(--red); }
.alert-warning { background: rgba(255,209,102,0.1); border: 1px solid rgba(255,209,102,0.3); color: var(--yellow); }
.alert-info { background: rgba(76,201,240,0.1); border: 1px solid rgba(76,201,240,0.3); color: var(--blue); }

/* ---- TABLE ---- */
.table-wrap { overflow-x: auto; }

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

thead th {
    padding: 12px 16px;
    text-align: left;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.8px;
    text-transform: uppercase;
    color: var(--text3);
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}

tbody tr {
    border-bottom: 1px solid var(--border);
    transition: var(--transition);
}

tbody tr:hover { background: var(--card2); }
tbody tr:last-child { border-bottom: none; }

tbody td {
    padding: 14px 16px;
    color: var(--text);
    vertical-align: middle;
}

/* ---- AUTH PAGES ---- */
.auth-page {
    min-height: 100vh;
    background: var(--bg);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    position: relative;
    overflow: hidden;
}

.auth-page::before {
    content: '';
    position: fixed;
    width: 600px; height: 600px;
    background: radial-gradient(circle, rgba(108,99,255,0.12) 0%, transparent 70%);
    top: -200px; right: -200px;
    pointer-events: none;
}

.auth-page::after {
    content: '';
    position: fixed;
    width: 400px; height: 400px;
    background: radial-gradient(circle, rgba(76,201,240,0.08) 0%, transparent 70%);
    bottom: -100px; left: -100px;
    pointer-events: none;
}

.auth-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 24px;
    padding: 40px;
    width: 100%;
    max-width: 440px;
    position: relative;
    z-index: 1;
    box-shadow: var(--shadow);
}

.auth-logo {
    text-align: center;
    margin-bottom: 32px;
}

.auth-logo .logo-icon {
    width: 56px; height: 56px;
    font-size: 26px;
    margin: 0 auto 12px;
}

.auth-logo h2 {
    font-size: 22px;
    font-weight: 700;
    font-family: var(--mono);
    color: var(--text);
}

.auth-logo p { font-size: 13px; color: var(--text2); margin-top: 4px; }

.auth-divider {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 20px 0;
    color: var(--text3);
    font-size: 12px;
}

.auth-divider::before, .auth-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border);
}

.auth-footer {
    text-align: center;
    margin-top: 24px;
    font-size: 13px;
    color: var(--text2);
}

.auth-footer a { color: var(--accent); text-decoration: none; font-weight: 600; }
.auth-footer a:hover { text-decoration: underline; }

/* ---- MODAL ---- */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.7);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 20px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s;
}

.modal-overlay.active {
    opacity: 1;
    pointer-events: all;
}

.modal {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 32px;
    width: 100%;
    max-width: 480px;
    max-height: 90vh;
    overflow-y: auto;
    transform: scale(0.95) translateY(10px);
    transition: transform 0.3s;
    box-shadow: var(--shadow);
}

.modal-overlay.active .modal {
    transform: scale(1) translateY(0);
}

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

.modal-title { font-size: 18px; font-weight: 700; }

.modal-close {
    width: 32px; height: 32px;
    background: var(--bg3);
    border: none;
    border-radius: 8px;
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    color: var(--text2);
    font-size: 16px;
    transition: var(--transition);
}

.modal-close:hover { background: var(--red); color: #fff; }

/* ---- GRIDS ---- */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }

/* ---- SECTION HEADER ---- */
.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

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

.section-link {
    font-size: 12px;
    color: var(--accent);
    text-decoration: none;
    font-weight: 600;
}

.section-link:hover { text-decoration: underline; }

/* ---- EMPTY STATE ---- */
.empty-state {
    text-align: center;
    padding: 48px 24px;
    color: var(--text2);
}

.empty-state .empty-icon {
    font-size: 48px;
    margin-bottom: 16px;
    opacity: 0.4;
}

.empty-state h3 { font-size: 16px; font-weight: 600; margin-bottom: 8px; }
.empty-state p { font-size: 13px; color: var(--text3); }

/* ---- INPUT WITH ICON ---- */
.input-wrap {
    position: relative;
}

.input-wrap .input-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text3);
    font-size: 14px;
    pointer-events: none;
}

.input-wrap .form-control { padding-left: 40px; }

.input-wrap .input-suffix {
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text2);
    font-size: 12px;
    font-weight: 600;
}

/* ---- COIN SELECTOR ---- */
.coin-select-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    border-radius: 8px;
    cursor: pointer;
    transition: var(--transition);
}

.coin-select-item:hover { background: var(--bg3); }
.coin-select-item.selected { background: rgba(108,99,255,0.1); border: 1px solid rgba(108,99,255,0.3); }

/* ---- ADDRESS BOX ---- */
.address-box {
    background: var(--bg2);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 14px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.address-text {
    font-family: var(--mono);
    font-size: 12px;
    color: var(--text);
    word-break: break-all;
    flex: 1;
}

.copy-btn {
    flex-shrink: 0;
    padding: 6px 12px;
    background: rgba(108,99,255,0.15);
    border: 1px solid rgba(108,99,255,0.3);
    border-radius: 6px;
    color: var(--accent);
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

.copy-btn:hover { background: var(--accent); color: #fff; }

/* ---- PROGRESS ---- */
.progress-bar {
    width: 100%;
    height: 6px;
    background: var(--bg3);
    border-radius: 3px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--accent), var(--blue));
    border-radius: 3px;
    transition: width 0.5s ease;
}

/* ---- RESPONSIVE ---- */
@media (max-width: 1024px) {
    .app-shell { grid-template-columns: 1fr; }
    .sidebar { display: none; }
}

@media (max-width: 768px) {
    .page-body { padding: 20px 16px; }
    .topbar { padding: 16px 20px; }
    .balance-amount { font-size: 32px; }
    .grid-2, .grid-3 { grid-template-columns: 1fr; }
    .quick-actions { flex-wrap: wrap; }
    .auth-card { padding: 28px 20px; }
}

/* ---- ANIMATIONS ---- */
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(16px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

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

.fade-in { animation: fadeInUp 0.4s ease forwards; }
.loading { animation: pulse 1.5s ease infinite; }

.spinner {
    width: 20px; height: 20px;
    border: 2px solid var(--border);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
    display: inline-block;
}

/* ---- ADMIN SPECIFIC ---- */
.admin-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 12px;
    background: rgba(255,209,102,0.15);
    border: 1px solid rgba(255,209,102,0.3);
    border-radius: 20px;
    font-size: 11px;
    font-weight: 700;
    color: var(--yellow);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.actions-row {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

/* Pagination */
.pagination {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 20px;
    justify-content: center;
}

.page-btn {
    width: 36px; height: 36px;
    display: flex; align-items: center; justify-content: center;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text2);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
}

.page-btn:hover, .page-btn.active {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
}

/* ---- MOBILE SIDEBAR ---- */
.hamburger {
    display: none;
    width: 40px; height: 40px;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    align-items: center; justify-content: center;
    cursor: pointer;
    flex-direction: column;
    gap: 5px;
    transition: var(--transition);
}
.hamburger span {
    display: block;
    width: 18px; height: 2px;
    background: var(--text2);
    border-radius: 2px;
    transition: var(--transition);
}
.hamburger:hover { border-color: var(--accent); }
.hamburger:hover span { background: var(--accent); }

.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.6);
    backdrop-filter: blur(3px);
    z-index: 99;
}
.sidebar-overlay.active { display: block; }

@media (max-width: 1024px) {
    .app-shell { grid-template-columns: 1fr; }

    .sidebar {
        display: flex !important;
        position: fixed;
        top: 0; left: 0;
        height: 100vh;
        width: 270px;
        z-index: 100;
        transform: translateX(-100%);
        transition: transform 0.3s cubic-bezier(0.4,0,0.2,1);
        box-shadow: 4px 0 32px rgba(0,0,0,0.5);
    }
    .sidebar.open { transform: translateX(0); }

    .hamburger { display: flex; }

    .topbar-left h1 { font-size: 16px; }
    .topbar-left p  { font-size: 12px; }
}

@media (max-width: 768px) {
    .page-body { padding: 16px 14px; }
    .topbar { padding: 12px 16px; gap: 8px; }
    .balance-amount { font-size: 28px; }
    .grid-2, .grid-3 { grid-template-columns: 1fr; }
    .quick-actions { flex-wrap: wrap; gap: 8px; }
    .auth-card { padding: 24px 18px; }
    .qa-btn { font-size: 12px; padding: 8px 14px; }
    .balance-hero { padding: 22px 18px; }
}

/* ---- THEME TOGGLE IN TOPBAR ---- */
.topbar-theme-btn {
    width: 40px; height: 40px;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    display: flex; align-items: center; justify-content: center;
    cursor: pointer;
    font-size: 16px;
    transition: var(--transition);
    color: var(--text2);
    flex-shrink: 0;
}
.topbar-theme-btn:hover { border-color: var(--accent); color: var(--accent); }

/* ---- HAMBURGER FIX ---- */
/* Force hamburger visible on all screens ≤1024px — overrides any flex/display conflicts */
@media (max-width: 1024px) {
    .hamburger {
        display: flex !important;
        flex-shrink: 0;
    }
    /* ensure topbar left wrapper doesn't collapse hamburger */
    .topbar > div:first-child {
        display: flex !important;
        align-items: center;
        gap: 12px;
        min-width: 0;
    }
}

/* ---- THEME BUTTON — HIGH VISIBILITY ---- */
/* Replace subtle icon with a pill-style toggle that's always readable */
.topbar-theme-btn {
    width: auto !important;
    padding: 0 12px !important;
    gap: 6px;
    font-size: 13px !important;
    font-weight: 600;
    color: var(--text) !important;
    background: var(--card2) !important;
    border: 1.5px solid var(--accent) !important;
    border-radius: 50px !important;
    letter-spacing: 0.2px;
    white-space: nowrap;
}
.topbar-theme-btn:hover {
    background: var(--accent) !important;
    color: #fff !important;
}
[data-theme="light"] .topbar-theme-btn {
    background: #fff !important;
    border-color: var(--accent) !important;
    color: var(--accent) !important;
}

/* On very small screens, show icon only */
@media (max-width: 380px) {
    .topbar-theme-btn {
        width: 40px !important;
        padding: 0 !important;
        font-size: 16px !important;
    }
    .topbar-theme-btn .theme-label-text { display: none; }
}

/* ---- COIN LOGO BADGES ---- */
.coin-badge {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    flex-shrink: 0;
}
.coin-badge svg,
.coin-badge img {
    width: 100%;
    height: 100%;
    display: block;
}
/* Coin logo in wallet list items */
.wallet-item .coin-badge {
    width: 44px;
    height: 44px;
    padding: 2px;
}
/* Transaction type icons keep their class but coin logos use inline svg */
.coin-logo-sm svg {
    border-radius: 50%;
    display: inline-block;
    vertical-align: middle;
}

/* ---- SVG CLICK FIX — prevent SVGs inside buttons from swallowing clicks ---- */
.btn svg, .btn span svg {
    pointer-events: none;
}
