:root {
    --bg: #0D0D1A;
    --bg2: #1A1A2E;
    --bg3: #252540;
    --green: #00D632;
    --green-dim: #00A828;
    --red: #FF4444;
    --white: #FFFFFF;
    --gray: #8E8E9A;
    --gray-light: #B0B0C0;
    --card-radius: 16px;
    --nav-height: 70px;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", Roboto, sans-serif;
    background: var(--bg);
    color: var(--white);
    min-height: 100vh;
    max-width: 480px;
    margin: 0 auto;
    padding-bottom: calc(var(--nav-height) + 20px);
    -webkit-font-smoothing: antialiased;
}

/* ── Flash Messages ─────────────────────────── */
.flash { padding: 12px 16px; border-radius: 10px; margin: 10px 16px; font-size: 14px; font-weight: 500; }
.flash.success { background: rgba(0,214,50,0.15); color: var(--green); }
.flash.error { background: rgba(255,68,68,0.15); color: var(--red); }
.flash.info { background: rgba(142,142,154,0.15); color: var(--gray-light); }

/* ── Auth Pages ─────────────────────────────── */
.auth-page { padding: 60px 24px 24px; display: flex; flex-direction: column; align-items: center; min-height: 100vh; }
.auth-page .logo { font-size: 32px; font-weight: 800; color: var(--green); margin-bottom: 8px; letter-spacing: -1px; }
.auth-page .subtitle { color: var(--gray); font-size: 14px; margin-bottom: 40px; }
.auth-form { width: 100%; }
.auth-form input {
    width: 100%; padding: 16px; margin-bottom: 12px;
    background: var(--bg2); border: 1px solid var(--bg3); border-radius: 12px;
    color: var(--white); font-size: 16px; outline: none; transition: border 0.2s;
}
.auth-form input:focus { border-color: var(--green); }
.auth-form input::placeholder { color: var(--gray); }
.btn {
    width: 100%; padding: 16px; border: none; border-radius: 12px;
    font-size: 16px; font-weight: 700; cursor: pointer; transition: all 0.2s;
}
.btn-green { background: var(--green); color: #000; }
.btn-green:active { background: var(--green-dim); transform: scale(0.98); }
.btn-outline { background: transparent; border: 1px solid var(--bg3); color: var(--gray-light); margin-top: 12px; }
.btn-outline:active { background: var(--bg2); }
.btn-red { background: var(--red); color: #fff; }
.btn-small { width: auto; padding: 10px 20px; font-size: 14px; display: inline-block; }

.link { color: var(--green); text-decoration: none; font-size: 14px; margin-top: 20px; display: inline-block; }

/* ── Home Screen ────────────────────────────── */
.home-header { padding: 20px 20px 0; text-align: center; }
.home-header .greeting { color: var(--gray); font-size: 14px; font-weight: 500; }
.balance-display { font-size: 56px; font-weight: 800; letter-spacing: -2px; margin: 12px 0; }
.balance-display .cents { font-size: 32px; color: var(--gray-light); }

.quick-actions { display: flex; gap: 12px; padding: 20px; justify-content: center; flex-wrap: wrap; }
.quick-action {
    background: var(--bg2); border-radius: 14px; padding: 16px 14px;
    text-align: center; flex: 1; min-width: 85px; max-width: 100px;
    text-decoration: none; color: var(--white); transition: transform 0.15s;
}
.quick-action:active { transform: scale(0.95); }
.quick-action .icon { font-size: 24px; margin-bottom: 6px; }
.quick-action .label { font-size: 11px; color: var(--gray-light); font-weight: 600; }

/* ── Section ────────────────────────────────── */
.section { padding: 0 20px; margin-top: 24px; }
.section-title { font-size: 18px; font-weight: 700; margin-bottom: 14px; }

/* ── Transaction Cards ──────────────────────── */
.txn-card {
    display: flex; align-items: center; gap: 12px;
    padding: 14px; background: var(--bg2); border-radius: 12px; margin-bottom: 8px;
    text-decoration: none; color: var(--white);
}
.txn-avatar {
    width: 42px; height: 42px; border-radius: 50%; display: flex;
    align-items: center; justify-content: center; font-weight: 700;
    font-size: 16px; color: #000; flex-shrink: 0;
}
.txn-info { flex: 1; min-width: 0; }
.txn-name { font-weight: 600; font-size: 15px; }
.txn-note { color: var(--gray); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.txn-amount { font-weight: 700; font-size: 16px; white-space: nowrap; }
.txn-amount.received { color: var(--green); }
.txn-amount.sent { color: var(--red); }
.txn-time { font-size: 11px; color: var(--gray); text-align: right; }

/* ── Request Cards ──────────────────────────── */
.req-card {
    padding: 16px; background: var(--bg2); border-radius: 12px; margin-bottom: 10px;
    border-left: 3px solid var(--green);
}
.req-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.req-name { font-weight: 600; }
.req-amount { font-weight: 700; color: var(--green); font-size: 18px; }
.req-note { color: var(--gray); font-size: 13px; margin-bottom: 12px; }
.req-actions { display: flex; gap: 8px; }
.req-actions form { flex: 1; }
.req-actions .btn { padding: 10px; font-size: 13px; }
.req-pin { width: 100%; padding: 10px; background: var(--bg3); border: none; border-radius: 8px; color: var(--white); text-align: center; margin-bottom: 8px; font-size: 16px; letter-spacing: 8px; }

/* ── Pay Screen ─────────────────────────────── */
.pay-page { padding: 20px; }
.pay-recipient { margin-bottom: 16px; position: relative; }
.pay-recipient input {
    width: 100%; padding: 16px; padding-left: 36px;
    background: var(--bg2); border: 1px solid var(--bg3); border-radius: 12px;
    color: var(--white); font-size: 16px; outline: none;
}
.pay-recipient input:focus { border-color: var(--green); }
.pay-recipient .dollar { position: absolute; left: 16px; top: 50%; transform: translateY(-50%); color: var(--green); font-weight: 700; }
.search-results {
    position: absolute; top: 100%; left: 0; right: 0; background: var(--bg3);
    border-radius: 0 0 12px 12px; z-index: 10; max-height: 200px; overflow-y: auto;
}
.search-result {
    display: flex; align-items: center; gap: 10px; padding: 12px 16px;
    cursor: pointer; transition: background 0.15s;
}
.search-result:hover { background: var(--bg2); }
.search-result .sr-avatar { width: 32px; height: 32px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 13px; color: #000; }
.search-result .sr-name { font-size: 14px; }
.search-result .sr-tag { font-size: 12px; color: var(--gray); }

.amount-display {
    text-align: center; font-size: 52px; font-weight: 800; margin: 20px 0;
    letter-spacing: -2px; min-height: 68px;
}
.amount-display .dollar-sign { color: var(--green); }

.numpad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 20px; }
.numpad button {
    background: var(--bg2); border: none; color: var(--white); font-size: 24px;
    font-weight: 600; padding: 18px; border-radius: 12px; cursor: pointer;
    transition: all 0.1s;
}
.numpad button:active { background: var(--bg3); transform: scale(0.95); }
.numpad .backspace { font-size: 20px; }

.pay-note input {
    width: 100%; padding: 14px; background: var(--bg2); border: 1px solid var(--bg3);
    border-radius: 12px; color: var(--white); font-size: 14px; margin-bottom: 12px; outline: none;
}
.pay-note input:focus { border-color: var(--green); }
.pay-pin { margin-bottom: 12px; }
.pay-pin input {
    width: 100%; padding: 14px; background: var(--bg2); border: 1px solid var(--bg3);
    border-radius: 12px; color: var(--white); font-size: 18px; text-align: center;
    letter-spacing: 10px; outline: none;
}
.pay-pin input:focus { border-color: var(--green); }

/* ── Activity ───────────────────────────────── */
.activity-page { padding: 20px; }
.activity-page h1 { font-size: 28px; font-weight: 800; margin-bottom: 20px; }
.tab-bar { display: flex; gap: 0; margin-bottom: 20px; background: var(--bg2); border-radius: 12px; overflow: hidden; }
.tab-bar a {
    flex: 1; padding: 12px; text-align: center; color: var(--gray);
    text-decoration: none; font-weight: 600; font-size: 14px; transition: all 0.2s;
}
.tab-bar a.active { background: var(--green); color: #000; }

/* ── Card ───────────────────────────────────── */
.card-page { padding: 20px; }
.card-page h1 { font-size: 28px; font-weight: 800; margin-bottom: 20px; }
.virtual-card {
    border-radius: 16px; padding: 28px; position: relative; overflow: hidden;
    aspect-ratio: 1.586; display: flex; flex-direction: column; justify-content: space-between;
    box-shadow: 0 8px 32px rgba(0,0,0,0.4);
}
.virtual-card .card-brand { font-size: 22px; font-weight: 800; letter-spacing: -0.5px; }
.virtual-card .card-chip { font-size: 32px; }
.virtual-card .card-number { font-size: 18px; letter-spacing: 3px; font-weight: 600; }
.virtual-card .card-bottom { display: flex; justify-content: space-between; align-items: flex-end; }
.virtual-card .card-name { font-size: 14px; font-weight: 600; text-transform: uppercase; letter-spacing: 1px; }
.virtual-card .card-expiry { font-size: 12px; color: rgba(255,255,255,0.7); }
.card-locked-badge {
    position: absolute; top: 16px; right: 16px; background: rgba(255,68,68,0.9);
    padding: 4px 10px; border-radius: 6px; font-size: 11px; font-weight: 700;
}
.card-actions { margin-top: 24px; display: flex; flex-direction: column; gap: 10px; }
.color-picker { display: flex; gap: 10px; margin-top: 16px; flex-wrap: wrap; }
.color-swatch {
    width: 40px; height: 40px; border-radius: 50%; border: 3px solid transparent;
    cursor: pointer; transition: all 0.2s;
}
.color-swatch:hover { transform: scale(1.15); }
.color-swatch.active { border-color: var(--white); }

/* ── Profile ────────────────────────────────── */
.profile-page { padding: 20px; }
.profile-page h1 { font-size: 28px; font-weight: 800; margin-bottom: 20px; }
.profile-avatar {
    width: 80px; height: 80px; border-radius: 50%; display: flex;
    align-items: center; justify-content: center; font-size: 32px;
    font-weight: 800; color: #000; margin: 0 auto 12px;
}
.profile-tag { text-align: center; color: var(--green); font-weight: 700; font-size: 18px; margin-bottom: 4px; }
.profile-email { text-align: center; color: var(--gray); font-size: 13px; margin-bottom: 24px; }
.profile-form input {
    width: 100%; padding: 14px; background: var(--bg2); border: 1px solid var(--bg3);
    border-radius: 12px; color: var(--white); font-size: 15px; margin-bottom: 12px; outline: none;
}
.profile-form input:focus { border-color: var(--green); }
.profile-form label { display: block; color: var(--gray); font-size: 12px; font-weight: 600; margin-bottom: 6px; text-transform: uppercase; letter-spacing: 0.5px; }

.contacts-section { margin-top: 30px; }
.contact-item { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--bg3); }
.contact-avatar { width: 38px; height: 38px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 14px; color: #000; }
.contact-info { flex: 1; }
.contact-name { font-weight: 600; font-size: 14px; }
.contact-tag { color: var(--gray); font-size: 12px; }
.contact-pay { color: var(--green); font-weight: 700; font-size: 13px; text-decoration: none; }

/* ── QR Page ────────────────────────────────── */
.qr-page { padding: 40px 20px; text-align: center; }
.qr-page h1 { font-size: 24px; font-weight: 800; margin-bottom: 8px; }
.qr-page .qr-tag { color: var(--green); font-size: 20px; font-weight: 700; margin-bottom: 24px; }
.qr-page img { width: 240px; height: 240px; border-radius: 16px; }
.qr-page .qr-hint { color: var(--gray); font-size: 13px; margin-top: 20px; }

/* ── Bottom Nav ─────────────────────────────── */
.bottom-nav {
    position: fixed; bottom: 0; left: 50%; transform: translateX(-50%);
    width: 100%; max-width: 480px; height: var(--nav-height);
    background: var(--bg2); border-top: 1px solid var(--bg3);
    display: flex; align-items: center; justify-content: space-around;
    z-index: 100; padding-bottom: env(safe-area-inset-bottom, 0);
}
.nav-item {
    display: flex; flex-direction: column; align-items: center; gap: 4px;
    text-decoration: none; color: var(--gray); font-size: 10px; font-weight: 600;
    padding: 8px 12px; transition: color 0.2s;
}
.nav-item .nav-icon { font-size: 22px; }
.nav-item.active { color: var(--green); }
.nav-item:active { color: var(--white); }

/* ── Pay button (center nav) ────────────────── */
.nav-pay {
    width: 52px; height: 52px; border-radius: 50%; background: var(--green);
    display: flex; align-items: center; justify-content: center;
    margin-top: -20px; box-shadow: 0 4px 20px rgba(0,214,50,0.4);
    text-decoration: none; transition: transform 0.15s;
}
.nav-pay:active { transform: scale(0.9); }
.nav-pay .nav-icon { color: #000; font-size: 26px; }

/* ── Inline forms row ───────────────────────── */
.inline-form { display: flex; gap: 8px; margin-top: 10px; }
.inline-form input { flex: 1; padding: 12px; background: var(--bg2); border: 1px solid var(--bg3); border-radius: 10px; color: var(--white); font-size: 15px; outline: none; }
.inline-form input:focus { border-color: var(--green); }
.inline-form .btn { width: auto; padding: 12px 20px; }

/* ── Empty state ────────────────────────────── */
.empty-state { text-align: center; padding: 40px 20px; color: var(--gray); }
.empty-state .icon { font-size: 48px; margin-bottom: 12px; }
.empty-state p { font-size: 14px; }

/* ── Utilities ──────────────────────────────── */
.mt-12 { margin-top: 12px; }
.mt-20 { margin-top: 20px; }
.text-center { text-align: center; }
.text-gray { color: var(--gray); }
.text-sm { font-size: 13px; }
