/* =========================================================================
   Global biders - Fintech design system
   iPhone-inspired, glassmorphism, dark + light themes
   ========================================================================= */

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

:root {
    --font-display: 'Sora', system-ui, sans-serif;
    --font-body: 'Inter', system-ui, sans-serif;

    --radius-sm: 12px;
    --radius: 18px;
    --radius-lg: 26px;
    --radius-pill: 999px;

    --maxw: 1240px;
    --sidebar-w: 252px;

    --shadow-soft: 0 8px 30px rgba(0, 0, 0, 0.12);
    --shadow-card: 0 10px 40px rgba(12, 16, 40, 0.18);
    --shadow-glow: 0 8px 32px rgba(99, 102, 241, 0.35);

    --transition: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ---- Dark theme (default) ---- */
:root,
[data-theme='dark'] {
    --bg-0: #070a16;
    --bg-1: #0c1024;
    --bg-grad: radial-gradient(1200px 700px at 12% -8%, #1b1f53 0%, transparent 55%),
               radial-gradient(900px 600px at 100% 0%, #0e3b5c 0%, transparent 50%),
               linear-gradient(180deg, #080b1a 0%, #05070f 100%);

    --glass: rgba(255, 255, 255, 0.06);
    --glass-strong: rgba(255, 255, 255, 0.10);
    --glass-border: rgba(255, 255, 255, 0.12);
    --glass-hover: rgba(255, 255, 255, 0.14);

    --text: #f3f5ff;
    --text-soft: #aab1d6;
    --text-dim: #6f78a3;

    --accent: #6366f1;
    --accent-2: #22d3ee;
    --accent-grad: linear-gradient(135deg, #6366f1 0%, #8b5cf6 45%, #22d3ee 100%);

    /* Two-color purple to blue gradient for the balance hero */
    --hero-grad: linear-gradient(120deg, #8b5cf6 0%, #6366f1 50%, #3b82f6 100%);

    --green: #34d399;
    --red: #fb7185;
    --amber: #fbbf24;

    --card-shadow: 0 18px 50px rgba(0, 0, 0, 0.45);
}

/* ---- Light theme ---- */
[data-theme='light'] {
    --bg-0: #eef1fb;
    --bg-1: #ffffff;
    --bg-grad: radial-gradient(1200px 700px at 10% -10%, #dfe4ff 0%, transparent 55%),
               radial-gradient(900px 600px at 100% 0%, #cdeefb 0%, transparent 50%),
               linear-gradient(180deg, #f4f6ff 0%, #e9edfb 100%);

    --glass: rgba(255, 255, 255, 0.65);
    --glass-strong: rgba(255, 255, 255, 0.85);
    --glass-border: rgba(20, 30, 80, 0.10);
    --glass-hover: rgba(255, 255, 255, 0.95);

    --text: #131836;
    --text-soft: #4a5280;
    --text-dim: #8088b0;

    --accent: #5b5ef0;
    --accent-2: #0ea5b7;
    --accent-grad: linear-gradient(135deg, #5b5ef0 0%, #8b5cf6 45%, #0ea5b7 100%);

    /* Two-color purple to blue gradient for the balance hero */
    --hero-grad: linear-gradient(120deg, #9b7cf4 0%, #6f72f2 50%, #4f8df4 100%);

    --green: #059669;
    --red: #e11d48;
    --amber: #d97706;

    --card-shadow: 0 18px 50px rgba(60, 70, 130, 0.16);
}

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

html { -webkit-text-size-adjust: 100%; }

body {
    font-family: var(--font-body);
    background: var(--bg-0);
    background-image: var(--bg-grad);
    background-attachment: fixed;
    color: var(--text);
    min-height: 100vh;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    transition: background var(--transition), color var(--transition);
}

h1, h2, h3, h4, h5 { font-family: var(--font-display); font-weight: 700; letter-spacing: -0.02em; }

a { color: inherit; text-decoration: none; }

/* ---- Glass primitives ---- */
.glass {
    background: var(--glass);
    border: 1px solid var(--glass-border);
    backdrop-filter: blur(18px) saturate(160%);
    -webkit-backdrop-filter: blur(18px) saturate(160%);
    border-radius: var(--radius);
}

.card {
    background: var(--glass);
    border: 1px solid var(--glass-border);
    backdrop-filter: blur(20px) saturate(160%);
    -webkit-backdrop-filter: blur(20px) saturate(160%);
    border-radius: var(--radius);
    box-shadow: var(--card-shadow);
    padding: 22px;
    transition: transform var(--transition), border var(--transition), background var(--transition);
}

.card-hover:hover { transform: translateY(-4px); border-color: var(--glass-hover); }

/* =========================================================================
   App shell layout
   ========================================================================= */
.app-shell { display: flex; min-height: 100vh; }

.sidebar {
    width: var(--sidebar-w);
    flex-shrink: 0;
    padding: 26px 18px;
    position: sticky;
    top: 0;
    height: 100vh;
    display: flex;
    flex-direction: column;
    gap: 8px;
    background: var(--glass);
    border-right: 1px solid var(--glass-border);
    backdrop-filter: blur(24px) saturate(160%);
    -webkit-backdrop-filter: blur(24px) saturate(160%);
    z-index: 40;
}

.brand { display: flex; align-items: center; gap: 12px; padding: 4px 10px 22px; }
.brand-logo {
    width: 42px; height: 42px; border-radius: 13px;
    background: var(--accent-grad);
    display: grid; place-items: center;
    font-size: 20px; box-shadow: var(--shadow-glow);
}
.brand-name { font-family: var(--font-display); font-weight: 800; font-size: 19px; }
.brand-sub { font-size: 11px; color: var(--text-dim); letter-spacing: 0.14em; text-transform: uppercase; }

.nav-section-label { font-size: 11px; color: var(--text-dim); text-transform: uppercase; letter-spacing: 0.12em; padding: 14px 12px 6px; }

.nav-link {
    display: flex; align-items: center; gap: 13px;
    padding: 12px 14px; border-radius: 14px;
    color: var(--text-soft); font-weight: 500; font-size: 14.5px;
    transition: all var(--transition);
}
.nav-link .nav-ico { font-size: 18px; width: 22px; text-align: center; }
.nav-link:hover { background: var(--glass-hover); color: var(--text); }
.nav-link.active { background: var(--accent-grad); color: #fff; box-shadow: var(--shadow-glow); }
.nav-badge { margin-left: auto; background: var(--red); color: #fff; font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: var(--radius-pill); }

.sidebar-footer { margin-top: auto; }

/* ---- Main content ---- */
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }

.topbar {
    display: flex; align-items: center; gap: 16px;
    padding: 18px 26px;
    position: sticky; top: 0; z-index: 30;
    background: linear-gradient(180deg, var(--bg-0) 20%, transparent);
    backdrop-filter: blur(8px);
}
.topbar h1 { font-size: 22px; }
.topbar .topbar-sub { color: var(--text-dim); font-size: 13px; }
.topbar-actions { margin-left: auto; display: flex; align-items: center; gap: 10px; }

.content { padding: 8px 26px 110px; max-width: var(--maxw); width: 100%; margin: 0 auto; }

/* ---- Icon buttons ---- */
.icon-btn {
    width: 42px; height: 42px; border-radius: 13px;
    display: grid; place-items: center; cursor: pointer;
    background: var(--glass); border: 1px solid var(--glass-border);
    color: var(--text); font-size: 18px; position: relative;
    transition: all var(--transition);
}
.icon-btn:hover { background: var(--glass-hover); transform: translateY(-2px); }
.icon-btn .dot { position: absolute; top: 8px; right: 9px; width: 8px; height: 8px; border-radius: 50%; background: var(--red); }

.avatar {
    width: 42px; height: 42px; border-radius: 13px;
    background: var(--accent-grad); color: #fff;
    display: grid; place-items: center; font-weight: 700; font-family: var(--font-display);
}

/* =========================================================================
   Buttons & forms
   ========================================================================= */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    padding: 12px 20px; border-radius: 14px; border: 1px solid transparent;
    font-family: var(--font-body); font-weight: 600; font-size: 14.5px;
    cursor: pointer; transition: all var(--transition); white-space: nowrap;
}
.btn-primary { background: var(--accent-grad); color: #fff; box-shadow: var(--shadow-glow); }
.btn-primary:hover { transform: translateY(-2px); filter: brightness(1.07); }
.btn-ghost { background: var(--glass); border-color: var(--glass-border); color: var(--text); }
.btn-ghost:hover { background: var(--glass-hover); }
.btn-danger { background: var(--red); color: #fff; }
.btn-success { background: var(--green); color: #04201a; }
.btn-block { width: 100%; }
.btn-sm { padding: 8px 14px; font-size: 13px; border-radius: 11px; }

.form-group { margin-bottom: 16px; }
.form-label { display: block; font-size: 13px; font-weight: 600; color: var(--text-soft); margin-bottom: 7px; }
.form-control {
    width: 100%; padding: 13px 15px; font-size: 15px; font-family: var(--font-body);
    color: var(--text); background: var(--glass);
    border: 1px solid var(--glass-border); border-radius: 13px;
    transition: all var(--transition);
}
.form-control:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.18); }
.form-control::placeholder { color: var(--text-dim); }
select.form-control { appearance: none; cursor: pointer; }
.form-hint { font-size: 12px; color: var(--text-dim); margin-top: 6px; }

/* =========================================================================
   Balance hero + stat cards
   ========================================================================= */
.balance-hero {
    background: var(--accent-grad);
    border-radius: var(--radius-lg);
    padding: 28px;
    color: #fff;
    position: relative; overflow: hidden;
    box-shadow: var(--shadow-glow);
}
.balance-hero::after {
    content: ''; position: absolute; inset: 0;
    background: radial-gradient(400px 200px at 90% -20%, rgba(255,255,255,0.35), transparent 60%);
    pointer-events: none;
}
.balance-hero .label { font-size: 13px; opacity: 0.85; letter-spacing: 0.04em; }
.balance-hero .amount { font-family: var(--font-display); font-size: 40px; font-weight: 800; margin: 6px 0 14px; letter-spacing: -0.03em; }
.balance-hero .sub-row { display: flex; gap: 22px; flex-wrap: wrap; }
.balance-hero .sub-item .k { font-size: 12px; opacity: 0.82; }
.balance-hero .sub-item .v { font-weight: 700; font-size: 16px; }

.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.stat-card { padding: 18px; }
.stat-card .stat-ico {
    width: 44px; height: 44px; border-radius: 13px; display: grid; place-items: center;
    font-size: 20px; background: var(--glass-strong); margin-bottom: 12px;
}
.stat-card .stat-label { font-size: 12.5px; color: var(--text-dim); }
.stat-card .stat-value { font-family: var(--font-display); font-size: 23px; font-weight: 700; margin-top: 3px; }
.stat-card .stat-delta { font-size: 12px; font-weight: 600; margin-top: 6px; display: inline-flex; align-items: center; gap: 4px; }
.delta-up { color: var(--green); }
.delta-down { color: var(--red); }

/* ---- Section headings ---- */
.section { margin-top: 26px; }
.section-head { display: flex; align-items: center; margin-bottom: 14px; }
.section-head h2 { font-size: 18px; }
.section-head .section-link { margin-left: auto; font-size: 13px; color: var(--accent-2); font-weight: 600; }

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

/* =========================================================================
   Quick actions
   ========================================================================= */
.quick-actions { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.quick-action {
    display: flex; flex-direction: column; align-items: center; gap: 9px;
    padding: 18px 10px; border-radius: var(--radius);
    background: var(--glass); border: 1px solid var(--glass-border);
    transition: all var(--transition); text-align: center;
}
.quick-action:hover { transform: translateY(-3px); background: var(--glass-hover); }
.quick-action .qa-ico { width: 48px; height: 48px; border-radius: 15px; display: grid; place-items: center; font-size: 22px; background: var(--accent-grad); color: #fff; }
.quick-action .qa-label { font-size: 13px; font-weight: 600; }

/* =========================================================================
   Transactions list
   ========================================================================= */
.tx-list { display: flex; flex-direction: column; }
.tx-item { display: flex; align-items: center; gap: 14px; padding: 13px 4px; border-bottom: 1px solid var(--glass-border); }
.tx-item:last-child { border-bottom: none; }
.tx-ico { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; font-size: 18px; background: var(--glass-strong); flex-shrink: 0; }
.tx-meta { min-width: 0; }
.tx-title { font-weight: 600; font-size: 14.5px; }
.tx-sub { font-size: 12.5px; color: var(--text-dim); }
.tx-amount { margin-left: auto; text-align: right; font-weight: 700; font-family: var(--font-display); }
.tx-amount .tx-time { display: block; font-family: var(--font-body); font-weight: 400; font-size: 11.5px; color: var(--text-dim); }
.amount-credit { color: var(--green); }
.amount-debit { color: var(--text); }

/* ---- Badges ---- */
.badge { display: inline-flex; align-items: center; gap: 5px; padding: 4px 11px; border-radius: var(--radius-pill); font-size: 11.5px; font-weight: 700; letter-spacing: 0.02em; }
.badge-green { background: rgba(52, 211, 153, 0.16); color: var(--green); }
.badge-red { background: rgba(251, 113, 133, 0.16); color: var(--red); }
.badge-amber { background: rgba(251, 191, 36, 0.16); color: var(--amber); }
.badge-blue { background: rgba(99, 102, 241, 0.16); color: var(--accent); }
.badge-gray { background: var(--glass-strong); color: var(--text-soft); }

.risk-low { background: rgba(52,211,153,0.16); color: var(--green); }
.risk-medium { background: rgba(251,191,36,0.16); color: var(--amber); }
.risk-high { background: rgba(251,113,133,0.16); color: var(--red); }

/* =========================================================================
   Securities (Discover)
   ========================================================================= */
.security-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.security-card { padding: 20px; display: flex; flex-direction: column; gap: 14px; position: relative; overflow: hidden; }
.security-card .sec-top { display: flex; align-items: flex-start; gap: 13px; }
.security-card .sec-ico { width: 50px; height: 50px; border-radius: 15px; display: grid; place-items: center; font-size: 24px; background: var(--glass-strong); flex-shrink: 0; }
.security-card .sec-name { font-family: var(--font-display); font-weight: 700; font-size: 16.5px; }
.security-card .sec-cat { font-size: 12px; color: var(--text-dim); }
.security-card .sec-return { margin-left: auto; text-align: right; }
.security-card .sec-return .pct { font-family: var(--font-display); font-weight: 800; font-size: 26px; color: var(--green); line-height: 1; }
.security-card .sec-return .pct-lbl { font-size: 11px; color: var(--text-dim); }
.security-card .sec-desc { font-size: 13px; color: var(--text-soft); }
.security-card .sec-foot { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-size: 12px; color: var(--text-dim); }
.security-card .sec-foot .dot-sep { width: 3px; height: 3px; border-radius: 50%; background: var(--text-dim); }

/* ---- Live ticker / activity feed ---- */
.live-feed { display: flex; flex-direction: column; gap: 2px; max-height: 460px; overflow-y: auto; }
.live-item { display: flex; align-items: center; gap: 12px; padding: 11px 4px; border-bottom: 1px solid var(--glass-border); }
.live-item:last-child { border-bottom: none; }
.live-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 4px rgba(52,211,153,0.18); flex-shrink: 0; animation: pulse 2s infinite; }
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: 0.4; } }
.live-text { font-size: 13px; }
.live-text strong { font-weight: 700; }
.live-time { margin-left: auto; font-size: 11.5px; color: var(--text-dim); white-space: nowrap; }

.live-pill {
    display: inline-flex; align-items: center; gap: 7px;
    padding: 5px 12px; border-radius: var(--radius-pill);
    background: rgba(52,211,153,0.14); color: var(--green); font-size: 12px; font-weight: 700;
}

/* =========================================================================
   Social-proof toast
   ========================================================================= */
.toast-stack { position: fixed; bottom: 88px; left: 16px; z-index: 80; display: flex; flex-direction: column; gap: 10px; max-width: 320px; }
@media (min-width: 1024px) { .toast-stack { bottom: 24px; left: 24px; } }
.toast {
    display: flex; align-items: center; gap: 12px; padding: 13px 16px;
    background: var(--glass-strong); border: 1px solid var(--glass-border);
    border-radius: 15px; backdrop-filter: blur(20px); box-shadow: var(--card-shadow);
    animation: toastIn 0.4s ease, toastOut 0.4s ease 5.4s forwards;
}
@keyframes toastIn { from { transform: translateX(-120%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }
@keyframes toastOut { to { transform: translateX(-120%); opacity: 0; } }
.toast .toast-ico { width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; font-size: 18px; background: var(--accent-grad); color: #fff; flex-shrink: 0; }
.toast .toast-title { font-size: 13.5px; font-weight: 700; }
.toast .toast-sub { font-size: 12px; color: var(--text-dim); }

/* =========================================================================
   Flash messages
   ========================================================================= */
.flash-stack { position: fixed; top: 18px; right: 18px; z-index: 90; display: flex; flex-direction: column; gap: 10px; max-width: 360px; }
.flash {
    display: flex; align-items: center; gap: 11px; padding: 14px 16px;
    border-radius: 14px; background: var(--glass-strong); border: 1px solid var(--glass-border);
    backdrop-filter: blur(20px); box-shadow: var(--card-shadow); font-size: 14px; font-weight: 500;
    animation: flashIn 0.35s ease;
}
@keyframes flashIn { from { transform: translateY(-16px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
.flash.success { border-left: 4px solid var(--green); }
.flash.error { border-left: 4px solid var(--red); }
.flash.info { border-left: 4px solid var(--accent); }
.flash .flash-close { margin-left: auto; cursor: pointer; color: var(--text-dim); background: none; border: none; font-size: 18px; }

/* =========================================================================
   Tables (admin)
   ========================================================================= */
.table-wrap { overflow-x: auto; border-radius: var(--radius); }
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th { text-align: left; padding: 13px 14px; font-size: 12px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-dim); border-bottom: 1px solid var(--glass-border); white-space: nowrap; }
.table td { padding: 13px 14px; border-bottom: 1px solid var(--glass-border); }
.table tbody tr { transition: background var(--transition); }
.table tbody tr:hover { background: var(--glass); }
.table .td-strong { font-weight: 600; }

/* =========================================================================
   Auth pages
   ========================================================================= */
.auth-wrap { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.auth-card { width: 100%; max-width: 420px; padding: 34px; }
.auth-brand { display: flex; align-items: center; gap: 12px; justify-content: center; margin-bottom: 8px; }
.auth-title { text-align: center; font-size: 24px; margin-bottom: 4px; }
.auth-sub { text-align: center; color: var(--text-dim); font-size: 14px; margin-bottom: 24px; }
.auth-foot { text-align: center; font-size: 13.5px; color: var(--text-soft); margin-top: 18px; }
.auth-foot a { color: var(--accent-2); font-weight: 600; }
.cred-hint { margin-top: 18px; padding: 12px 14px; border-radius: 12px; background: var(--glass); border: 1px dashed var(--glass-border); font-size: 12.5px; color: var(--text-soft); }

/* =========================================================================
   Bottom navigation (mobile)
   ========================================================================= */
.bottom-nav { display: none; }

/* ---- Modal ---- */
.modal-overlay { position: fixed; inset: 0; background: rgba(4,6,16,0.6); backdrop-filter: blur(6px); z-index: 100; display: none; place-items: center; padding: 20px; }
.modal-overlay.open { display: grid; }
.modal { width: 100%; max-width: 440px; padding: 26px; max-height: 90vh; overflow-y: auto; }
.modal-head { display: flex; align-items: center; margin-bottom: 18px; }
.modal-head h3 { font-size: 19px; }
.modal-close { margin-left: auto; background: none; border: none; color: var(--text-dim); font-size: 24px; cursor: pointer; }

/* ---- Misc utility ---- */
.muted { color: var(--text-dim); }
.text-green { color: var(--green); }
.text-red { color: var(--red); }
.flex { display: flex; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-8 { gap: 8px; } .gap-12 { gap: 12px; } .gap-16 { gap: 16px; }
.mt-8 { margin-top: 8px; } .mt-16 { margin-top: 16px; } .mt-24 { margin-top: 24px; }
.mb-16 { margin-bottom: 16px; }
.w-full { width: 100%; }
.empty-state { text-align: center; padding: 40px 20px; color: var(--text-dim); }
.empty-state .empty-ico { font-size: 40px; margin-bottom: 10px; }
.divider { height: 1px; background: var(--glass-border); margin: 16px 0; }
.row-tight { display: flex; gap: 10px; flex-wrap: wrap; }
.pill-tabs { display: inline-flex; gap: 4px; padding: 5px; background: var(--glass); border: 1px solid var(--glass-border); border-radius: var(--radius-pill); }
.pill-tab { padding: 8px 16px; border-radius: var(--radius-pill); font-size: 13px; font-weight: 600; color: var(--text-soft); transition: all var(--transition); }
.pill-tab.active { background: var(--accent-grad); color: #fff; }

.kv-list { display: flex; flex-direction: column; gap: 10px; }
.kv-row { display: flex; align-items: center; justify-content: space-between; padding: 9px 0; border-bottom: 1px solid var(--glass-border); }
.kv-row:last-child { border-bottom: none; }
.kv-k { color: var(--text-dim); font-size: 13.5px; }
.kv-v { font-weight: 600; font-size: 14px; }

/* =========================================================================
   Responsive
   ========================================================================= */
@media (max-width: 1080px) {
    .stat-grid { grid-template-columns: repeat(2, 1fr); }
    .grid-2 { grid-template-columns: 1fr; }
    .security-grid { grid-template-columns: 1fr; }
    .grid-3 { grid-template-columns: 1fr; }
}

@media (max-width: 820px) {
    .sidebar { display: none; }
    .content { padding: 8px 16px 100px; }
    .topbar { padding: 16px; }
    .quick-actions { grid-template-columns: repeat(2, 1fr); }

    .bottom-nav {
        display: flex; position: fixed; bottom: 0; left: 0; right: 0; z-index: 50;
        padding: 10px 8px calc(10px + env(safe-area-inset-bottom));
        justify-content: space-around; align-items: center;
        background: var(--glass-strong); border-top: 1px solid var(--glass-border);
        backdrop-filter: blur(24px) saturate(160%);
        -webkit-backdrop-filter: blur(24px) saturate(160%);
    }
    .bnav-link { display: flex; flex-direction: column; align-items: center; gap: 3px; color: var(--text-dim); font-size: 10.5px; font-weight: 600; flex: 1; padding: 4px; }
    .bnav-link .bnav-ico { font-size: 21px; }
    .bnav-link.active { color: var(--accent); }
    .bnav-link.bnav-fab .bnav-ico {
        width: 48px; height: 48px; margin-top: -26px; border-radius: 16px;
        background: var(--accent-grad); color: #fff; display: grid; place-items: center;
        box-shadow: var(--shadow-glow);
    }
}

@media (max-width: 460px) {
    .stat-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
    .balance-hero .amount { font-size: 32px; }
    .quick-actions { grid-template-columns: repeat(4, 1fr); }
    .quick-action { padding: 14px 6px; }
    .quick-action .qa-ico { width: 42px; height: 42px; font-size: 19px; }
    .quick-action .qa-label { font-size: 11px; }
}

/* Scrollbars */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--glass-border); border-radius: 10px; }
::-webkit-scrollbar-track { background: transparent; }

/* =========================================================================
   Premium icons (inline SVG)
   ========================================================================= */
.pi { display: block; }
.pi-img { display: block; object-fit: contain; }
.stat-ico .pi, .qa-ico .pi, .trust-ico .pi, .secure-chip .pi { color: inherit; }

/* =========================================================================
   Dashboard premium polish — layered depth + bank-grade surfaces
   ========================================================================= */
.dash { position: relative; }

/* Ambient background depth (sits behind dashboard content) */
.dash-atmos { position: absolute; inset: -40px -20px auto -20px; height: 620px; z-index: 0; pointer-events: none; overflow: hidden; }
.dash-atmos .orb { position: absolute; border-radius: 50%; filter: blur(60px); opacity: 0.5; }
.dash-atmos .orb-1 { width: 360px; height: 360px; top: -120px; left: -40px; background: radial-gradient(circle, #6366f1, transparent 70%); animation: float1 14s ease-in-out infinite; }
.dash-atmos .orb-2 { width: 300px; height: 300px; top: -80px; right: 4%; background: radial-gradient(circle, #22d3ee, transparent 70%); opacity: 0.4; animation: float2 18s ease-in-out infinite; }
.dash-atmos .orb-3 { width: 260px; height: 260px; top: 160px; left: 36%; background: radial-gradient(circle, #8b5cf6, transparent 70%); opacity: 0.32; animation: float1 22s ease-in-out infinite reverse; }
.dash-atmos .grid-veil {
    position: absolute; inset: 0;
    background-image: linear-gradient(var(--glass-border) 1px, transparent 1px), linear-gradient(90deg, var(--glass-border) 1px, transparent 1px);
    background-size: 46px 46px;
    -webkit-mask-image: radial-gradient(ellipse 80% 60% at 50% 0%, #000 0%, transparent 75%);
    mask-image: radial-gradient(ellipse 80% 60% at 50% 0%, #000 0%, transparent 75%);
    opacity: 0.5;
}
@keyframes float1 { 0%,100% { transform: translate(0,0); } 50% { transform: translate(18px, 22px); } }
@keyframes float2 { 0%,100% { transform: translate(0,0); } 50% { transform: translate(-22px, 16px); } }

.dash > .balance-hero,
.dash > .section { position: relative; z-index: 1; }

/* ---- Balance hero upgrade ---- */
.balance-hero {
    background:
        linear-gradient(135deg, rgba(255,255,255,0.08), transparent 42%),
        var(--hero-grad);
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.20), 0 22px 48px -22px rgba(40,40,90,0.45);
    border: 1px solid rgba(255,255,255,0.14);
}
.balance-hero .hero-texture {
    position: absolute; inset: 0; pointer-events: none; opacity: 0.5;
    background-image: radial-gradient(rgba(255,255,255,0.18) 1px, transparent 1px);
    background-size: 22px 22px;
    -webkit-mask-image: linear-gradient(120deg, #000, transparent 70%);
    mask-image: linear-gradient(120deg, #000, transparent 70%);
}
.balance-hero .hero-sheen {
    position: absolute; top: -60%; left: -20%; width: 60%; height: 220%;
    background: linear-gradient(105deg, transparent, rgba(255,255,255,0.30), transparent);
    transform: rotate(8deg); pointer-events: none;
    animation: sheen 7s ease-in-out infinite;
}
@keyframes sheen { 0%, 72% { transform: translateX(-40%) rotate(8deg); opacity: 0; } 82% { opacity: 0.45; } 100% { transform: translateX(420%) rotate(8deg); opacity: 0; } }

.balance-hero .hero-top { position: relative; z-index: 2; display: flex; align-items: flex-start; gap: 16px; }
.balance-hero .hero-secure { margin-left: auto; display: flex; flex-direction: column; gap: 8px; align-items: flex-end; }
.secure-chip {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 6px 11px; border-radius: var(--radius-pill);
    background: rgba(255,255,255,0.16); border: 1px solid rgba(255,255,255,0.22);
    color: #fff; font-size: 11.5px; font-weight: 600; white-space: nowrap;
    backdrop-filter: blur(6px);
}
.secure-chip .pi { width: 15px; height: 15px; }
.balance-hero .sub-row { position: relative; z-index: 2; align-items: center; }
.balance-hero .sub-divider { width: 1px; height: 30px; background: rgba(255,255,255,0.22); }

/* ---- Hero action buttons (balanced row) ---- */
.hero-actions { position: relative; z-index: 2; display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 6px; }
.hero-btn {
    width: 100%; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    padding: 13px 18px; border-radius: 14px; font-weight: 700; font-size: 14.5px;
    transition: transform var(--transition), background var(--transition), box-shadow var(--transition);
    white-space: nowrap;
}
.hero-btn .pi { width: 20px; height: 20px; }
.hero-btn-light {
    background: #fff; color: #1d2147;
    box-shadow: 0 10px 24px -10px rgba(0,0,0,0.55), inset 0 1px 0 rgba(255,255,255,0.8);
}
.hero-btn-light:hover { transform: translateY(-2px); box-shadow: 0 16px 30px -10px rgba(0,0,0,0.6); }
.hero-btn-ghost {
    background: rgba(255,255,255,0.16); color: #fff;
    border: 1px solid rgba(255,255,255,0.34); backdrop-filter: blur(6px);
}
.hero-btn-ghost:hover { transform: translateY(-2px); background: rgba(255,255,255,0.26); }

/* ---- Premium stat cards ---- */
.stat-card { position: relative; overflow: hidden; box-shadow: var(--card-shadow), inset 0 1px 0 rgba(255,255,255,0.06); }
.stat-card .stat-bloom { position: absolute; top: -50px; right: -50px; width: 140px; height: 140px; border-radius: 50%; filter: blur(36px); opacity: 0.55; pointer-events: none; }
.stat-card .stat-ico {
    position: relative; z-index: 1; color: #fff;
    border: 1px solid rgba(255,255,255,0.18);
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.25), 0 8px 18px -6px rgba(0,0,0,0.5);
}
.stat-card .stat-ico .pi { width: 24px; height: 24px; }
.stat-card .stat-value, .stat-card .stat-label, .stat-card .stat-delta { position: relative; z-index: 1; }

.stat-accent-violet .stat-ico { background: linear-gradient(135deg, #6366f1, #8b5cf6); }
.stat-accent-violet .stat-bloom { background: #6366f1; }
.stat-accent-green .stat-ico { background: linear-gradient(135deg, #10b981, #34d399); }
.stat-accent-green .stat-bloom { background: #34d399; }
.stat-accent-cyan .stat-ico { background: linear-gradient(135deg, #0ea5b7, #22d3ee); }
.stat-accent-cyan .stat-bloom { background: #22d3ee; }
.stat-accent-amber .stat-ico { background: linear-gradient(135deg, #f59e0b, #fbbf24); }
.stat-accent-amber .stat-bloom { background: #fbbf24; }

/* ---- Premium quick-action tiles ---- */
.quick-action { position: relative; overflow: hidden; box-shadow: var(--card-shadow); }
.quick-action::before {
    content: ''; position: absolute; inset: 0; opacity: 0; transition: opacity var(--transition);
    background: radial-gradient(120px 80px at 50% 0%, currentColor, transparent 70%);
}
.quick-action:hover::before { opacity: 0.10; }
.quick-action .qa-ico {
    position: relative; color: #fff;
    border: 1px solid rgba(255,255,255,0.20);
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.30), 0 10px 22px -8px rgba(0,0,0,0.55);
    transition: transform var(--transition);
}
.quick-action:hover .qa-ico { transform: translateY(-2px) scale(1.04); }
.quick-action .qa-ico .pi { width: 26px; height: 26px; }
.qa-violet .qa-ico { background: linear-gradient(135deg, #6366f1, #8b5cf6); }
.qa-violet { color: #8b5cf6; }
.qa-cyan .qa-ico { background: linear-gradient(135deg, #0ea5b7, #22d3ee); }
.qa-cyan { color: #22d3ee; }
.qa-rose .qa-ico { background: linear-gradient(135deg, #f43f5e, #fb7185); }
.qa-rose { color: #fb7185; }
.qa-slate .qa-ico { background: linear-gradient(135deg, #475569, #94a3b8); }
.qa-slate { color: #94a3b8; }

/* ---- Premium security icons (Discover) ---- */
.security-card .sec-ico {
    color: #fff; border: 1px solid rgba(255,255,255,0.18);
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.25), 0 8px 18px -6px rgba(0,0,0,0.5);
}
.security-card .sec-ico .pi { width: 26px; height: 26px; }
.sec-accent-violet { background: linear-gradient(135deg, #6366f1, #8b5cf6); }
.sec-accent-green { background: linear-gradient(135deg, #10b981, #34d399); }
.sec-accent-cyan { background: linear-gradient(135deg, #0ea5b7, #22d3ee); }
.sec-accent-amber { background: linear-gradient(135deg, #f59e0b, #fbbf24); }

/* ---- Raised panels ---- */
.panel-raised { box-shadow: var(--card-shadow), inset 0 1px 0 rgba(255,255,255,0.06); }

/* ---- Bank-grade trust strip ---- */
.trust-strip {
    display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px;
    padding: 18px; border-radius: var(--radius);
    background: linear-gradient(180deg, var(--glass-strong), var(--glass));
    border: 1px solid var(--glass-border);
    backdrop-filter: blur(20px) saturate(160%);
    -webkit-backdrop-filter: blur(20px) saturate(160%);
    box-shadow: var(--card-shadow);
}
.trust-item { display: flex; align-items: center; gap: 12px; }
.trust-ico {
    width: 40px; height: 40px; border-radius: 12px; flex-shrink: 0;
    display: grid; place-items: center; color: var(--accent);
    background: var(--glass-strong); border: 1px solid var(--glass-border);
}
.trust-ico .pi { width: 20px; height: 20px; }
.trust-t { font-size: 13.5px; font-weight: 700; }
.trust-s { font-size: 11.5px; color: var(--text-dim); }

@media (max-width: 1080px) {
    .trust-strip { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 820px) {
    .dash-atmos { height: 460px; }
    .balance-hero .hero-secure { display: none; }
}
@media (max-width: 460px) {
    .trust-strip { grid-template-columns: 1fr; }
    .balance-hero .sub-divider { display: none; }
    .balance-hero .sub-row { gap: 16px; }
}

/* =========================================================================
   PWA login gate
   ========================================================================= */
.pwa-browser-note {
    display: flex; gap: 12px; align-items: flex-start;
    padding: 16px; margin-bottom: 20px; border-radius: 16px;
    background: var(--glass); border: 1px solid var(--glass-border);
}
.pwa-note-ico { font-size: 26px; line-height: 1; }
.pwa-note-body { flex: 1; }
.pwa-note-body strong { display: block; font-size: 15px; margin-bottom: 4px; }
.pwa-note-body p { font-size: 13px; color: var(--text-dim); margin-bottom: 12px; }
.pwa-note-body .btn { margin-bottom: 8px; }

/* In the installed app (standalone) the install prompt is irrelevant. */
html[data-display-mode="standalone"] .pwa-browser-note { display: none; }
html[data-display-mode="standalone"] [data-pwa-install] { display: none; }
