/* =========================================================================
   Proxima Crypto — design system
   ========================================================================= */
:root {
    --bg: #0a0e1a;
    --bg-2: #111729;
    --surface: #161d31;
    --surface-2: #1d2540;
    --surface-3: #232b48;
    --line: #2a3354;
    --line-soft: #1f274a;
    --text: #eaf0ff;
    --muted: #8b94b8;
    --muted-2: #6a7299;
    --accent: #8b5cff;
    --accent-2: #c33aa6;
    --accent-soft: rgba(139, 92, 255, 0.15);
    --ok: #2ee6a8;
    --warn: #ffb547;
    --danger: #ff5b6e;
    --info: #38b6ff;
    --grad: linear-gradient(135deg, #6c5cff 0%, #b94aff 60%, #ff4d8d 100%);
    --grad-soft: linear-gradient(135deg, rgba(108, 92, 255, 0.2), rgba(255, 77, 141, 0.2));
    --grad-card: radial-gradient(circle at 85% 15%, rgba(255, 140, 210, 0.35), transparent 50%),
                 radial-gradient(circle at 15% 90%, rgba(110, 50, 220, 0.5), transparent 55%),
                 linear-gradient(135deg, #150932 0%, #2b1063 30%, #5a1a90 65%, #a02ba8 100%);
    --shadow-1: 0 1px 2px rgba(0, 0, 0, 0.3), 0 4px 12px rgba(0, 0, 0, 0.15);
    --shadow-2: 0 8px 32px rgba(0, 0, 0, 0.4);
    --shadow-glow: 0 0 32px rgba(139, 92, 255, 0.25);
    --radius: 14px;
    --radius-sm: 10px;
    --radius-lg: 20px;
    --t: 220ms cubic-bezier(0.4, 0, 0.2, 1);
}

html[data-theme="light"] {
    --bg: #f4f5fb;
    --bg-2: #ffffff;
    --surface: #ffffff;
    --surface-2: #f7f8fc;
    --surface-3: #eef0f7;
    --line: #e3e7f1;
    --line-soft: #ecf0f7;
    --text: #16182b;
    --muted: #6a7295;
    --muted-2: #9aa1bd;
    --accent: #6b41e8;
    --accent-2: #b1339a;
    --accent-soft: rgba(107, 65, 232, 0.1);
    --ok: #16a37a;
    --warn: #d68b1e;
    --danger: #d6354a;
    --info: #1d8ed8;
    --shadow-1: 0 1px 2px rgba(40, 44, 73, 0.05), 0 4px 12px rgba(40, 44, 73, 0.06);
    --shadow-2: 0 12px 32px rgba(40, 44, 73, 0.1);
    --shadow-glow: 0 0 24px rgba(107, 65, 232, 0.15);
}

* {
    box-sizing: border-box;
}

html, body {
    margin: 0;
    padding: 0;
    background: var(--bg);
    color: var(--text);
    font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 14.5px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

body {
    min-height: 100vh;
}

h1, h2, h3, h4, h5, h6 {
    font-family: 'Manrope', system-ui, sans-serif;
    font-weight: 700;
    letter-spacing: -0.01em;
    margin: 0 0 0.5em;
    color: var(--text);
}

a {
    color: var(--accent);
    text-decoration: none;
    transition: color var(--t);
}
a:hover { color: var(--accent-2); }

button {
    font-family: inherit;
    cursor: pointer;
    border: none;
    background: none;
    color: inherit;
}

input, textarea, select {
    font-family: inherit;
    color: inherit;
}

.tabular { font-variant-numeric: tabular-nums; }

/* ===== Auth page ===== */
.auth-wrap {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 1fr 1fr;
    background: var(--bg);
}

.auth-side {
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 48px 56px;
    background: var(--grad-card);
    overflow: hidden;
    color: #fff;
}
.auth-side::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(800px 400px at 80% 90%, rgba(255, 255, 255, 0.08), transparent 60%),
        radial-gradient(600px 300px at 10% 10%, rgba(255, 255, 255, 0.06), transparent 60%);
    pointer-events: none;
}

.auth-brand {
    position: relative;
    display: flex;
    align-items: center;
    gap: 12px;
    font-family: 'Manrope', sans-serif;
    font-weight: 800;
    font-size: 22px;
    letter-spacing: -0.01em;
}
.auth-brand .brand-logo {
    width: 38px;
    height: 38px;
    border-radius: 11px;
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(8px);
    display: grid;
    place-items: center;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.2);
}

.auth-hero {
    position: relative;
    max-width: 460px;
}
.auth-hero h1 {
    font-size: 38px;
    line-height: 1.15;
    margin-bottom: 14px;
    color: #fff;
}
.auth-hero p {
    color: rgba(255, 255, 255, 0.78);
    font-size: 15.5px;
    line-height: 1.6;
}

.auth-features {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 14px;
    margin-top: 30px;
}
.auth-features .feat {
    display: flex;
    gap: 14px;
    align-items: center;
    color: rgba(255, 255, 255, 0.92);
    font-size: 14px;
}
.auth-features .feat .ico {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.13);
    border: 1px solid rgba(255, 255, 255, 0.18);
    display: grid;
    place-items: center;
    flex: 0 0 36px;
}

.auth-foot {
    position: relative;
    color: rgba(255, 255, 255, 0.6);
    font-size: 12.5px;
}

.auth-main {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 32px;
}

.auth-card {
    width: 100%;
    max-width: 420px;
}

.auth-card .seg {
    display: grid;
    grid-template-columns: 1fr 1fr;
    background: var(--surface-2);
    border-radius: 12px;
    padding: 4px;
    margin-bottom: 26px;
    border: 1px solid var(--line);
}
.auth-card .seg button {
    padding: 10px 12px;
    border-radius: 9px;
    color: var(--muted);
    font-size: 13.5px;
    font-weight: 600;
    transition: all var(--t);
}
.auth-card .seg button.on {
    background: var(--surface);
    color: var(--text);
    box-shadow: var(--shadow-1);
}

.auth-card h2 {
    font-size: 26px;
    margin-bottom: 6px;
}
.auth-card .lead {
    color: var(--muted);
    margin-bottom: 22px;
    font-size: 14px;
}

/* ===== Forms ===== */
.field {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 16px;
}
.field-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}
.field label,
.field-label {
    font-size: 12.5px;
    color: var(--muted);
    font-weight: 600;
    letter-spacing: 0.02em;
    text-transform: uppercase;
}
.field input,
.field select,
.field textarea,
.input {
    background: var(--surface-2);
    border: 1px solid var(--line);
    border-radius: 10px;
    color: var(--text);
    padding: 12px 14px;
    font-size: 14.5px;
    transition: all var(--t);
    outline: none;
    width: 100%;
}
.field input:focus,
.field select:focus,
.field textarea:focus,
.input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-soft);
    background: var(--surface);
}
.field textarea { resize: vertical; min-height: 90px; font-family: 'JetBrains Mono', 'Courier New', monospace; font-size: 13px; }

/* Choice grid (registration questions) */
.choice-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}
.choice {
    padding: 11px 12px;
    border-radius: 10px;
    background: var(--surface-2);
    border: 1px solid var(--line);
    cursor: pointer;
    font-size: 13.5px;
    text-align: center;
    transition: all var(--t);
    color: var(--text);
    user-select: none;
}
.choice:hover {
    border-color: var(--accent);
    background: var(--surface);
}
.choice.on {
    border-color: var(--accent);
    background: var(--accent-soft);
    color: var(--text);
    box-shadow: 0 0 0 3px var(--accent-soft);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 11px 18px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    transition: all var(--t);
    background: var(--surface-2);
    border: 1px solid var(--line);
    color: var(--text);
    cursor: pointer;
    white-space: nowrap;
}
.btn:hover { background: var(--surface); transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none !important; }
.btn-primary {
    background: var(--grad);
    border: none;
    color: #fff;
    box-shadow: var(--shadow-glow);
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 12px 28px rgba(139, 92, 255, 0.4); }
.btn-block { width: 100%; }
.btn-sm { padding: 7px 12px; font-size: 12.5px; }
.btn-ghost { background: transparent; border-color: transparent; color: var(--muted); }
.btn-ghost:hover { color: var(--text); background: var(--surface-2); }
.btn-ok { background: var(--ok); color: #0a2418; border: none; }
.btn-ok:hover { filter: brightness(1.1); }
.btn-danger { background: var(--danger); color: #fff; border: none; }
.btn-danger:hover { filter: brightness(1.05); }
.btn-warn { background: var(--warn); color: #2a1a06; border: none; }

/* Form helpers */
.form-error {
    background: rgba(255, 91, 110, 0.08);
    border: 1px solid rgba(255, 91, 110, 0.3);
    color: var(--danger);
    border-radius: 10px;
    padding: 10px 14px;
    font-size: 13px;
    margin-bottom: 12px;
    display: none;
}
.form-error.on { display: block; }

.muted { color: var(--muted); font-size: 13px; }

/* ===== App shell ===== */
.app-shell {
    display: grid;
    grid-template-columns: 260px 1fr;
    min-height: 100vh;
    background: var(--bg);
}

.sidebar {
    background: var(--bg-2);
    border-right: 1px solid var(--line);
    padding: 22px 14px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    position: sticky;
    top: 0;
    height: 100vh;
}

.sidebar .brand {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 6px 8px 22px;
    font-family: 'Manrope', sans-serif;
    font-weight: 800;
    font-size: 18px;
    border-bottom: 1px solid var(--line);
    margin-bottom: 16px;
}
.sidebar .brand .brand-logo {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    background: var(--grad);
    display: grid;
    place-items: center;
    color: #fff;
    box-shadow: var(--shadow-glow);
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 10px 12px;
    border-radius: 10px;
    color: var(--muted);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--t);
}
.nav-item:hover { background: var(--surface-2); color: var(--text); }
.nav-item.on {
    background: var(--surface-2);
    color: var(--text);
    box-shadow: inset 3px 0 0 var(--accent);
}
.nav-item svg { flex: 0 0 18px; opacity: 0.9; }

.sidebar .nav-foot { margin-top: auto; padding-top: 12px; border-top: 1px solid var(--line); }
.sidebar .userchip {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 10px;
    background: var(--surface-2);
    margin-bottom: 8px;
}
.userchip .avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--grad);
    color: #fff;
    display: grid;
    place-items: center;
    font-weight: 700;
    font-size: 12.5px;
    flex: 0 0 32px;
}
.userchip .who { font-size: 13px; overflow: hidden; }
.userchip .who b { display: block; font-weight: 600; font-size: 13px; text-overflow: ellipsis; overflow: hidden; white-space: nowrap; }
.userchip .who small { color: var(--muted); font-size: 11.5px; text-overflow: ellipsis; overflow: hidden; white-space: nowrap; display: block; }

.main {
    padding: 28px 36px 80px;
    min-width: 0;
}

.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 26px;
    gap: 16px;
}
.topbar h2 { font-size: 24px; margin: 0; }
.topbar .sub { color: var(--muted); font-size: 13.5px; }
.topbar .actions { display: flex; gap: 10px; }

/* ===== Hero card ===== */
.hero-card {
    position: relative;
    aspect-ratio: 1.586 / 1;
    max-width: 460px;
    background: var(--grad-card);
    border-radius: var(--radius-lg);
    padding: 26px 28px;
    color: #fff;
    overflow: hidden;
    box-shadow: var(--shadow-2);
    transition: transform var(--t);
    cursor: pointer;
}
.hero-card::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -100%;
    width: 80%;
    height: 200%;
    background: linear-gradient(110deg, transparent 30%, rgba(255, 255, 255, 0.25) 50%, transparent 70%);
    transform: skewX(-15deg);
    transition: left 1s cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: none;
}
.hero-card:hover {
    transform: translateY(-3px);
}
.hero-card:hover::after {
    left: 130%;
}
.hero-card .top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}
.hero-card .chip-mark {
    width: 42px;
    height: 32px;
    border-radius: 6px;
    background: linear-gradient(135deg, #f4d77a, #b8902c);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.4);
    position: relative;
}
.hero-card .chip-mark::after {
    content: '';
    position: absolute;
    inset: 4px;
    border: 1px solid rgba(0, 0, 0, 0.2);
    border-radius: 4px;
}
.hero-card .brand-mini {
    font-family: 'Manrope', sans-serif;
    font-weight: 800;
    font-size: 16px;
    letter-spacing: 0.02em;
    opacity: 0.95;
}
.hero-card .bal-label {
    font-size: 12.5px;
    opacity: 0.7;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 4px;
}
.hero-card .bal {
    font-family: 'Manrope', sans-serif;
    font-size: 36px;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}
.hero-card .addr-row {
    position: absolute;
    bottom: 22px;
    left: 28px;
    right: 28px;
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    font-family: 'JetBrains Mono', 'Courier New', monospace;
    font-size: 14px;
    letter-spacing: 0.05em;
    opacity: 0.9;
}
.hero-card .addr-row .net { font-size: 11px; text-transform: uppercase; opacity: 0.7; letter-spacing: 0.1em; }

/* Wallet hero — centered balance + sparkline + action pills */
.wallet-hero {
    position: relative;
    padding: 52px 32px 56px;
    margin-bottom: 26px;
    border-radius: 26px;
    overflow: hidden;
    background: linear-gradient(180deg, var(--surface) 0%, var(--bg-2) 100%);
    border: 1px solid var(--line);
    box-shadow: var(--shadow-1);
    isolation: isolate;
}
.hero-bg-glow {
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse 700px 360px at 20% 0%, rgba(139, 92, 255, 0.22), transparent 60%),
        radial-gradient(ellipse 600px 320px at 85% 100%, rgba(195, 58, 166, 0.18), transparent 60%);
    pointer-events: none;
    z-index: 0;
}
.hero-sparkline {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    width: 100%;
    height: 170px;
    pointer-events: none;
    z-index: 0;
    opacity: 0.7;
}
.hero-content {
    position: relative;
    text-align: center;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
}
.hero-eyebrow {
    font-size: 11.5px;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.18em;
    margin-bottom: 14px;
    font-weight: 600;
}
.hero-balance {
    display: inline-flex;
    align-items: baseline;
    gap: 0;
    font-family: 'Manrope', sans-serif;
    font-weight: 700;
    line-height: 1;
    font-variant-numeric: tabular-nums;
    color: var(--text);
}
.hero-balance .hero-currency {
    font-size: 38px;
    margin-right: 6px;
    color: var(--muted);
    font-weight: 600;
    transform: translateY(-6px);
}
.hero-balance #big-balance {
    font-size: 68px;
    letter-spacing: -0.025em;
    background: linear-gradient(180deg, var(--text) 0%, var(--muted) 140%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    filter: drop-shadow(0 6px 32px rgba(139, 92, 255, 0.25));
}
.hero-delta-wrap { margin-top: 20px; }
.hero-delta {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    border-radius: 22px;
    background: rgba(46, 230, 168, 0.12);
    border: 1px solid rgba(46, 230, 168, 0.28);
    color: var(--ok);
    font-size: 13px;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}
.hero-delta.down {
    background: rgba(255, 91, 110, 0.1);
    border-color: rgba(255, 91, 110, 0.28);
    color: var(--danger);
}
.hero-actions {
    display: flex;
    justify-content: center;
    gap: 28px;
    margin-top: 36px;
    flex-wrap: wrap;
}
.hero-action {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    transition: all var(--t);
    color: var(--text);
    min-width: 78px;
    padding: 4px;
    background: transparent;
    border: none;
}
.hero-action:hover { transform: translateY(-3px); }
.hero-action:hover .ico-circle {
    background: var(--grad);
    border-color: transparent;
    color: #fff;
    box-shadow: 0 12px 28px rgba(139, 92, 255, 0.42);
}
.hero-action:hover .lbl { color: var(--accent); }
.hero-action .ico-circle {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: var(--surface);
    border: 1px solid var(--line);
    display: grid;
    place-items: center;
    color: var(--accent);
    transition: all var(--t);
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.12);
}
.hero-action .lbl {
    font-size: 13.5px;
    font-weight: 600;
    transition: color var(--t);
}
.hero-range {
    display: inline-flex;
    gap: 4px;
    margin-top: 30px;
    padding: 4px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 24px;
}
.range-pill {
    padding: 6px 14px;
    border-radius: 20px;
    background: transparent;
    border: none;
    color: var(--muted);
    font-size: 11.5px;
    font-weight: 600;
    letter-spacing: 0.04em;
    cursor: pointer;
    transition: all var(--t);
    font-family: inherit;
}
.range-pill:hover { color: var(--text); }
.range-pill.on {
    background: var(--accent);
    color: #fff;
    box-shadow: 0 4px 12px rgba(139, 92, 255, 0.35);
}

/* ===== Cards ===== */
.card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 22px 24px;
    box-shadow: var(--shadow-1);
}
.card-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}
.card-title h3 { font-size: 16px; margin: 0; font-weight: 700; }
.card-title .right { color: var(--muted); font-size: 13px; display: flex; gap: 12px; align-items: center; }

.section-gap { margin-bottom: 22px; }

/* ===== Portfolio list ===== */
.portfolio {
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.coin-row {
    display: grid;
    grid-template-columns: 44px 1fr auto auto;
    gap: 14px;
    align-items: center;
    padding: 14px 14px;
    border-radius: 12px;
    transition: all var(--t);
    cursor: pointer;
}
.coin-row:hover {
    background: var(--surface-2);
    transform: translateX(2px);
}
.coin-row .icon {
    width: 44px;
    height: 44px;
    display: block;
    filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.22));
}
.coin-row .icon svg {
    width: 100%;
    height: 100%;
    display: block;
    transition: transform var(--t);
}
.coin-row:hover .icon svg { transform: scale(1.05) rotate(-3deg); }
.coin-icon { display: inline-block; }
.coin-icon svg { width: 100%; height: 100%; display: block; }
.coin-row .name { font-weight: 600; font-size: 14.5px; }
.coin-row .ticker { color: var(--muted); font-size: 12.5px; }
.coin-row .balance { text-align: right; }
.coin-row .balance .amt { font-weight: 600; font-variant-numeric: tabular-nums; }
.coin-row .balance .usd { color: var(--muted); font-size: 12.5px; font-variant-numeric: tabular-nums; }
.coin-row .delta {
    padding: 4px 8px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    background: rgba(46, 230, 168, 0.12);
    color: var(--ok);
    min-width: 60px;
    text-align: center;
}
.coin-row .delta.down { background: rgba(255, 91, 110, 0.12); color: var(--danger); }

/* ===== Transactions ===== */
.tx-row {
    display: grid;
    grid-template-columns: 40px 1fr auto;
    gap: 12px;
    align-items: center;
    padding: 12px 6px;
    border-bottom: 1px solid var(--line-soft);
}
.tx-row:last-child { border-bottom: none; }
.tx-row .tx-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    display: grid;
    place-items: center;
    background: var(--surface-2);
    color: var(--muted);
}
.tx-row .tx-icon.in { background: rgba(46, 230, 168, 0.12); color: var(--ok); }
.tx-row .tx-icon.out { background: rgba(255, 91, 110, 0.12); color: var(--danger); }
.tx-row .tx-icon.swap { background: rgba(56, 182, 255, 0.12); color: var(--info); }
.tx-row .tx-icon.pending { background: rgba(255, 181, 71, 0.12); color: var(--warn); }
.tx-row .tx-icon.rejected { background: rgba(255, 91, 110, 0.12); color: var(--danger); }
.tx-row .tx-main .ttl { font-weight: 600; font-size: 14px; }
.tx-row .tx-main .sub { color: var(--muted); font-size: 12.5px; font-family: 'JetBrains Mono', monospace; }
.tx-row .tx-amt { text-align: right; font-variant-numeric: tabular-nums; }
.tx-row .tx-amt .amt { font-weight: 600; }
.tx-row .tx-amt .usd { color: var(--muted); font-size: 12.5px; }
.tx-empty { color: var(--muted); padding: 30px; text-align: center; font-size: 13.5px; }

.badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.badge.pending { background: rgba(255, 181, 71, 0.15); color: var(--warn); }
.badge.approved { background: rgba(46, 230, 168, 0.15); color: var(--ok); }
.badge.completed { background: rgba(46, 230, 168, 0.15); color: var(--ok); }
.badge.rejected { background: rgba(255, 91, 110, 0.15); color: var(--danger); }

/* ===== Two-col layout ===== */
.two-col {
    display: grid;
    grid-template-columns: 1.4fr 1fr;
    gap: 22px;
}

/* ===== Stat cards (admin) ===== */
.stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 14px;
    margin-bottom: 22px;
}
.stat-card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 18px 20px;
    position: relative;
    overflow: hidden;
    transition: transform var(--t);
}
.stat-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-1); }
.stat-card::before {
    content: '';
    position: absolute;
    left: 0; top: 0; bottom: 0;
    width: 4px;
    background: var(--stat-color, var(--accent));
}
.stat-card .label { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: 6px; }
.stat-card .value {
    font-family: 'Manrope', sans-serif;
    font-size: 30px;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    letter-spacing: -0.01em;
}
.stat-card .hint { color: var(--muted); font-size: 12px; margin-top: 4px; }
.stat-card.c-blue { --stat-color: var(--info); }
.stat-card.c-green { --stat-color: var(--ok); }
.stat-card.c-warn { --stat-color: var(--warn); }
.stat-card.c-purple { --stat-color: var(--accent); }
.stat-card.c-pink { --stat-color: var(--accent-2); }
.stat-card.c-red { --stat-color: var(--danger); }

/* ===== Modals ===== */
.modal-back {
    position: fixed;
    inset: 0;
    background: rgba(7, 9, 18, 0.7);
    backdrop-filter: blur(6px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 200;
    padding: 20px;
}
.modal-back.on { display: flex; animation: fadein 200ms ease-out; }
@keyframes fadein { from { opacity: 0; } to { opacity: 1; } }

.modal {
    width: 100%;
    max-width: 440px;
    background: var(--bg-2);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-2);
    max-height: 90vh;
    overflow: auto;
    animation: slidein 240ms cubic-bezier(0.2, 0.8, 0.2, 1);
}
.modal.wide { max-width: 620px; }
@keyframes slidein { from { opacity: 0; transform: translateY(20px) scale(0.96); } to { opacity: 1; transform: translateY(0) scale(1); } }
.modal-head {
    padding: 18px 24px;
    border-bottom: 1px solid var(--line);
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.modal-head h3 { margin: 0; font-size: 17px; }
.modal-head .close {
    width: 32px; height: 32px;
    display: grid; place-items: center;
    border-radius: 9px;
    color: var(--muted);
    transition: all var(--t);
}
.modal-head .close:hover { background: var(--surface-2); color: var(--text); }
.modal-body { padding: 22px 24px; }
.modal-foot {
    padding: 16px 24px;
    border-top: 1px solid var(--line);
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

/* QR */
.qr-wrap {
    background: #fff;
    padding: 16px;
    border-radius: 14px;
    width: fit-content;
    margin: 0 auto 18px;
    box-shadow: var(--shadow-1);
}
.qr-wrap canvas, .qr-wrap img { display: block; }

.copy-row {
    display: flex;
    background: var(--surface-2);
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 10px 12px;
    align-items: center;
    gap: 8px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 12px;
    word-break: break-all;
}
.copy-row .addr { flex: 1; line-height: 1.5; }
.copy-row .copy-btn {
    flex: 0 0 auto;
    padding: 6px 10px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 8px;
    font-size: 12px;
    cursor: pointer;
    transition: all var(--t);
}
.copy-row .copy-btn:hover { background: var(--accent); color: #fff; border-color: var(--accent); }

/* Method picker (Send modal) */
.method-grid {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.method-card {
    display: flex;
    gap: 14px;
    padding: 14px 16px;
    background: var(--surface-2);
    border: 1px solid var(--line);
    border-radius: 12px;
    cursor: pointer;
    transition: all var(--t);
    align-items: center;
    text-align: left;
    color: var(--text);
}
.method-card:hover {
    border-color: var(--accent);
    background: var(--surface);
    transform: translateY(-1px);
}
.method-card .ic {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: var(--grad-soft);
    color: var(--accent);
    display: grid;
    place-items: center;
    flex: 0 0 44px;
}
.method-card .ic.cash {
    background: rgba(46, 230, 168, 0.12);
    color: var(--ok);
}
.method-card .ic.card {
    background: rgba(56, 182, 255, 0.12);
    color: var(--info);
}
.method-card .desc { flex: 1; }
.method-card .desc h4 {
    margin: 0 0 4px;
    font-size: 14.5px;
    font-weight: 700;
    font-family: 'Inter', sans-serif;
}
.method-card .desc p {
    margin: 0;
    color: var(--muted);
    font-size: 12.5px;
    line-height: 1.4;
}
.method-card .lock {
    flex: 0 0 16px;
    color: var(--muted);
}

.method-intro {
    color: var(--muted);
    font-size: 13.5px;
    margin-bottom: 14px;
}

/* Verification code step */
.verify-msg {
    padding: 14px 16px;
    border-radius: 11px;
    margin-bottom: 16px;
    font-size: 13.5px;
    line-height: 1.5;
    display: flex;
    gap: 10px;
    align-items: flex-start;
}
.verify-msg.info { background: rgba(56, 182, 255, 0.08); border: 1px solid rgba(56, 182, 255, 0.25); color: var(--info); }
.verify-msg.ok { background: rgba(46, 230, 168, 0.08); border: 1px solid rgba(46, 230, 168, 0.3); color: var(--ok); }
.verify-msg.err { background: rgba(255, 91, 110, 0.08); border: 1px solid rgba(255, 91, 110, 0.3); color: var(--danger); }
.verify-msg.warn { background: rgba(255, 181, 71, 0.08); border: 1px solid rgba(255, 181, 71, 0.3); color: var(--warn); }
.verify-waiting {
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--warn);
    font-size: 14px;
    padding: 16px;
    background: rgba(255, 181, 71, 0.06);
    border: 1px solid rgba(255, 181, 71, 0.2);
    border-radius: 11px;
    margin-bottom: 16px;
}
.spinner {
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255, 181, 71, 0.3);
    border-top-color: var(--warn);
    border-radius: 50%;
    animation: spin 800ms linear infinite;
    flex: 0 0 18px;
}
@keyframes spin { to { transform: rotate(360deg); } }

.code-input {
    font-family: 'JetBrains Mono', monospace;
    font-size: 22px;
    text-align: center;
    letter-spacing: 0.3em;
    padding: 14px 18px !important;
}

.support-link {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 14px;
    color: var(--muted);
    font-size: 13.5px;
    cursor: pointer;
    padding: 10px;
    border-radius: 10px;
    transition: all var(--t);
}
.support-link:hover { color: var(--accent); background: var(--surface-2); }

/* ===== Chat ===== */
.chat-shell {
    display: flex;
    flex-direction: column;
    height: 540px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    overflow: hidden;
}
.chat-head {
    padding: 14px 18px;
    border-bottom: 1px solid var(--line);
    display: flex;
    align-items: center;
    gap: 11px;
}
.chat-head .avatar {
    width: 36px; height: 36px;
    border-radius: 50%;
    background: var(--grad);
    color: #fff;
    font-weight: 700;
    display: grid;
    place-items: center;
}
.chat-head .who b { font-size: 14px; }
.chat-head .who .status { font-size: 11.5px; color: var(--ok); display: flex; align-items: center; gap: 4px; }
.chat-head .who .status::before {
    content: '';
    width: 7px; height: 7px;
    border-radius: 50%;
    background: var(--ok);
    box-shadow: 0 0 0 3px rgba(46, 230, 168, 0.18);
}

.chat-list {
    flex: 1;
    overflow-y: auto;
    padding: 16px 18px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    background: var(--bg);
}
.chat-msg {
    max-width: 75%;
    padding: 9px 13px;
    border-radius: 14px;
    font-size: 13.5px;
    line-height: 1.45;
    word-break: break-word;
}
.chat-msg.me {
    align-self: flex-end;
    background: var(--grad);
    color: #fff;
    border-bottom-right-radius: 4px;
}
.chat-msg.them {
    align-self: flex-start;
    background: var(--surface-2);
    color: var(--text);
    border-bottom-left-radius: 4px;
    border: 1px solid var(--line);
}
.chat-msg .time { font-size: 10.5px; opacity: 0.7; margin-top: 4px; }
.chat-msg img { max-width: 220px; max-height: 220px; border-radius: 8px; display: block; margin-bottom: 4px; cursor: pointer; }

.chat-foot {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 14px;
    border-top: 1px solid var(--line);
    background: var(--surface);
}
.chat-foot input {
    flex: 1;
    background: var(--surface-2);
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 10px 12px;
    color: var(--text);
    font-size: 14px;
    outline: none;
}
.chat-foot input:focus { border-color: var(--accent); }
.chat-foot .attach-btn {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    background: var(--surface-2);
    color: var(--muted);
    display: grid;
    place-items: center;
    cursor: pointer;
    transition: all var(--t);
    flex: 0 0 38px;
}
.chat-foot .attach-btn:hover { color: var(--accent); }
.chat-foot .send-btn {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    background: var(--grad);
    color: #fff;
    display: grid;
    place-items: center;
    flex: 0 0 38px;
}

.attach-preview {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: var(--surface-2);
    border-bottom: 1px solid var(--line);
}
.attach-preview img { width: 40px; height: 40px; border-radius: 6px; object-fit: cover; }
.attach-preview .rem { color: var(--muted); cursor: pointer; }
.attach-preview .rem:hover { color: var(--danger); }

/* ===== Settings ===== */
.settings-section {
    border-bottom: 1px solid var(--line);
    padding-bottom: 20px;
    margin-bottom: 20px;
}
.settings-section:last-child { border-bottom: none; margin-bottom: 0; }
.settings-section h4 { font-size: 14px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 12px; font-family: 'Inter'; font-weight: 700; }

.kv-row {
    display: flex;
    justify-content: space-between;
    padding: 10px 0;
    font-size: 14px;
    border-bottom: 1px solid var(--line-soft);
}
.kv-row:last-child { border-bottom: none; }
.kv-row .k { color: var(--muted); }
.kv-row .v { font-weight: 500; font-variant-numeric: tabular-nums; }

.toggle {
    width: 42px;
    height: 24px;
    background: var(--surface-3);
    border-radius: 14px;
    cursor: pointer;
    position: relative;
    transition: background var(--t);
}
.toggle::after {
    content: '';
    position: absolute;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #fff;
    top: 3px;
    left: 3px;
    transition: all var(--t);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}
.toggle.on { background: var(--accent); }
.toggle.on::after { left: 21px; }

.contact-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 14px;
}
.contact-card {
    padding: 18px;
    border-radius: 12px;
    background: var(--surface-2);
    border: 1px solid var(--line);
    display: flex;
    gap: 14px;
    align-items: center;
    cursor: pointer;
    color: var(--text);
    transition: all var(--t);
}
.contact-card:hover { border-color: var(--accent); transform: translateY(-2px); }
.contact-card .ic {
    width: 44px; height: 44px;
    border-radius: 12px;
    background: var(--accent-soft);
    color: var(--accent);
    display: grid;
    place-items: center;
    flex: 0 0 44px;
}
.contact-card .lbl b { display: block; font-size: 14px; }
.contact-card .lbl small { color: var(--muted); font-size: 12.5px; }

/* ===== Admin ===== */
.admin-shell {
    display: grid;
    grid-template-columns: 240px 1fr;
    min-height: 100vh;
}
.admin-side {
    background: var(--bg-2);
    border-right: 1px solid var(--line);
    padding: 22px 14px;
}
.admin-main { padding: 26px 32px 60px; }

.client-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
    max-height: 720px;
    overflow-y: auto;
    padding-right: 6px;
}
.client-row {
    display: grid;
    grid-template-columns: 36px 1fr auto;
    gap: 12px;
    align-items: center;
    padding: 11px 12px;
    border-radius: 10px;
    cursor: pointer;
    transition: all var(--t);
    border: 1px solid transparent;
}
.client-row:hover { background: var(--surface-2); }
.client-row.on { background: var(--surface-2); border-color: var(--accent); box-shadow: inset 3px 0 0 var(--accent); }
.client-row .avatar {
    width: 36px; height: 36px;
    border-radius: 50%;
    background: var(--grad);
    color: #fff;
    font-weight: 700;
    font-size: 13px;
    display: grid;
    place-items: center;
    flex: 0 0 36px;
}
.client-row .ttl b { display: block; font-weight: 600; font-size: 13.5px; }
.client-row .ttl small { color: var(--muted); font-size: 12px; display: block; }
.client-row .amt { font-variant-numeric: tabular-nums; font-weight: 600; font-size: 13px; text-align: right; }
.client-row .amt small { display: block; color: var(--muted); font-weight: 500; font-size: 11.5px; }

.search-box {
    position: relative;
    margin-bottom: 14px;
}
.search-box input {
    background: var(--surface-2);
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 10px 12px 10px 38px;
    color: var(--text);
    width: 100%;
    font-size: 13.5px;
    outline: none;
}
.search-box .ic {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--muted);
}

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

.tabs {
    display: flex;
    gap: 4px;
    border-bottom: 1px solid var(--line);
    margin-bottom: 18px;
}
.tab {
    padding: 10px 14px;
    color: var(--muted);
    cursor: pointer;
    font-weight: 600;
    font-size: 13.5px;
    border-bottom: 2px solid transparent;
    transition: all var(--t);
}
.tab:hover { color: var(--text); }
.tab.on { color: var(--accent); border-bottom-color: var(--accent); }

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

.code-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-top: 10px;
    max-height: 260px;
    overflow-y: auto;
}
.code-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    background: var(--surface-2);
    border-radius: 8px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 13px;
}
.code-item .tag { font-size: 11px; padding: 1px 6px; border-radius: 4px; font-weight: 600; text-transform: uppercase; font-family: 'Inter'; }
.code-item.used { opacity: 0.55; }
.code-item.used .tag { background: rgba(46, 230, 168, 0.15); color: var(--ok); }
.code-item.next .tag { background: rgba(139, 92, 255, 0.15); color: var(--accent); }
.code-item.next { box-shadow: inset 3px 0 0 var(--accent); }
.code-item.waiting .tag { background: var(--surface-3); color: var(--muted); }

.bar-chart {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 14px;
}
.bar-row { display: grid; grid-template-columns: 90px 1fr 60px; gap: 12px; align-items: center; font-size: 13px; }
.bar-row .bar-bg { background: var(--surface-2); height: 12px; border-radius: 6px; overflow: hidden; }
.bar-row .bar-fill { height: 100%; border-radius: 6px; transition: width 600ms cubic-bezier(0.4, 0, 0.2, 1); }
.bar-row .bar-fill.approved { background: var(--ok); }
.bar-row .bar-fill.pending { background: var(--warn); }
.bar-row .bar-fill.rejected { background: var(--danger); }
.bar-row .num { font-variant-numeric: tabular-nums; text-align: right; }

.top-list { display: flex; flex-direction: column; gap: 8px; }
.top-item {
    display: grid;
    grid-template-columns: 28px 1fr auto;
    gap: 10px;
    align-items: center;
    padding: 10px 12px;
    background: var(--surface-2);
    border-radius: 10px;
}
.top-item .rank {
    width: 26px; height: 26px;
    border-radius: 8px;
    background: var(--grad);
    color: #fff;
    font-weight: 700;
    font-size: 12px;
    display: grid;
    place-items: center;
}
.top-item .nm b { display: block; font-size: 13.5px; }
.top-item .nm small { color: var(--muted); font-size: 12px; }
.top-item .amt { font-weight: 600; font-variant-numeric: tabular-nums; }

/* ===== Toasts ===== */
.toast-stack {
    position: fixed;
    top: 18px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 10px;
    align-items: center;
    pointer-events: none;
}
.toast {
    background: var(--bg-2);
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 12px 18px;
    color: var(--text);
    font-size: 13.5px;
    box-shadow: var(--shadow-2);
    display: flex;
    gap: 10px;
    align-items: center;
    min-width: 240px;
    max-width: 440px;
    animation: toastdrop 320ms cubic-bezier(0.2, 0.8, 0.2, 1);
    pointer-events: auto;
    backdrop-filter: blur(8px);
}
@keyframes toastdrop {
    from { opacity: 0; transform: translateY(-20px) scale(0.94); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}
.toast.out { animation: toastout 200ms ease-in forwards; }
@keyframes toastout {
    to { opacity: 0; transform: translateY(-10px) scale(0.94); }
}
.toast.success { border-color: rgba(46, 230, 168, 0.5); }
.toast.error { border-color: rgba(255, 91, 110, 0.5); }
.toast.warn { border-color: rgba(255, 181, 71, 0.5); }
.toast .ic { width: 22px; height: 22px; flex: 0 0 22px; }
.toast.success .ic { color: var(--ok); }
.toast.error .ic { color: var(--danger); }
.toast.warn .ic { color: var(--warn); }
.toast.info .ic { color: var(--info); }

/* ===== Region block page ===== */
.region-block {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 32px;
}
.region-block .card {
    max-width: 480px;
    text-align: center;
}
.region-block .ic {
    width: 64px; height: 64px;
    border-radius: 18px;
    background: rgba(255, 91, 110, 0.12);
    color: var(--danger);
    display: grid;
    place-items: center;
    margin: 0 auto 18px;
}
.region-block h1 { font-size: 24px; margin-bottom: 10px; }
.region-block p { color: var(--muted); font-size: 14.5px; line-height: 1.6; }

/* ===== Loading & misc ===== */
.skeleton {
    background: linear-gradient(90deg, var(--surface-2) 0%, var(--surface-3) 50%, var(--surface-2) 100%);
    background-size: 200% 100%;
    animation: shimmer 1.4s infinite;
    border-radius: 8px;
}
@keyframes shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }

.divider { height: 1px; background: var(--line); margin: 14px 0; }

/* Count-up animation root */
.countup { transition: opacity 200ms; }

/* ===== Responsive ===== */
@media (max-width: 880px) {
    .auth-wrap { grid-template-columns: 1fr; }
    .auth-side { display: none; }
    .field-row { grid-template-columns: 1fr; }

    .app-shell { grid-template-columns: 1fr; }
    .sidebar {
        position: sticky;
        top: 0;
        height: auto;
        flex-direction: column;
        padding: 14px;
        border-right: none;
        border-bottom: 1px solid var(--line);
        z-index: 50;
    }
    .sidebar .brand { padding-bottom: 14px; }
    .sidebar nav {
        display: grid;
        grid-template-columns: repeat(3, 1fr);
        gap: 6px;
    }
    .nav-item {
        flex-direction: column;
        text-align: center;
        gap: 4px;
        padding: 8px 4px;
        font-size: 11.5px;
    }
    .nav-item.on { box-shadow: none; background: var(--accent-soft); }
    .sidebar .nav-foot {
        margin-top: 14px;
        border-top: 1px solid var(--line);
        padding-top: 12px;
    }
    .sidebar .userchip { display: none; }
    .sidebar .nav-foot .btn { width: 100%; }

    .main { padding: 18px 16px 60px; }
    .wallet-hero { padding: 36px 18px 44px; border-radius: 22px; }
    .hero-balance #big-balance { font-size: 46px; }
    .hero-balance .hero-currency { font-size: 26px; transform: translateY(-4px); }
    .hero-actions { gap: 14px; }
    .hero-action { min-width: 64px; }
    .hero-action .ico-circle { width: 48px; height: 48px; }
    .hero-action .lbl { font-size: 12px; }
    .hero-sparkline { height: 120px; }
    .two-col { grid-template-columns: 1fr; }
    .topbar { flex-direction: column; align-items: flex-start; }

    .admin-shell { grid-template-columns: 1fr; }
    .admin-side { border-right: none; border-bottom: 1px solid var(--line); }
    .admin-main { padding: 16px; }
    .client-list { max-height: 320px; }

    .modal { max-width: 100%; border-radius: 14px; }
}

@media (max-width: 520px) {
    .main { padding: 14px 12px 60px; }
    .auth-main { padding: 18px; }
    .auth-card h2 { font-size: 22px; }
    .card { padding: 16px; }
    .wallet-hero { padding: 28px 14px 36px; }
    .hero-balance #big-balance { font-size: 38px; }
    .hero-balance .hero-currency { font-size: 22px; }
    .stat-card .value { font-size: 24px; }
    .chat-shell { height: 480px; }
}

/* Scrollbar */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--surface-3); border-radius: 6px; }
::-webkit-scrollbar-thumb:hover { background: var(--line); }
