/* ===================================================================
   NikiFX Dashboard - Custom Styles (on top of Tailwind)
   =================================================================== */

:root {
    --bg-void: #050508;
    --bg-surface: #0a0a0f;
    --bg-elevated: #12121a;
    --bg-card: #1a1a24;
    --bg-card-hover: #22222e;
    --border-subtle: rgba(255,255,255,0.06);
    --border-accent: rgba(0,255,200,0.2);
    --text-primary: #f0f0f5;
    --text-secondary: rgba(240,240,245,0.6);
    --text-muted: rgba(240,240,245,0.35);
    --accent-cyan: #00ffc8;
    --accent-gold: #ffd700;
    --accent-emerald: #00d4aa;
    --accent-red: #ff4757;
    --accent-blue: #4da6ff;
    --accent-purple: #a855f7;
    --accent-orange: #ff8c42;
    --sidebar-width: 240px;
    --header-height: 56px;
}

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

body {
    font-family: 'Outfit', sans-serif;
    background: var(--bg-void);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
}

/* ===== SCROLLBAR ===== */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg-surface); }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.2); }

/* ===== AUTH SCREEN ===== */
.auth-overlay {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-void);
    z-index: 9000;
    padding: 1.5rem;
}

.auth-box {
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: 16px;
    padding: 2.5rem;
    width: 100%;
    max-width: 420px;
    box-shadow: 0 25px 50px rgba(0,0,0,0.5);
}

.auth-logo {
    font-family: 'DM Serif Display', serif;
    font-size: 1.75rem;
    text-align: center;
    margin-bottom: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.logo-icon {
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, var(--accent-cyan), var(--accent-emerald));
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'JetBrains Mono', monospace;
    font-size: 1rem;
    font-weight: 700;
    color: var(--bg-void);
}

.auth-tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 2rem;
}

.auth-tab {
    flex: 1;
    padding: 0.75rem;
    background: transparent;
    border: 1px solid var(--border-subtle);
    border-radius: 8px;
    color: var(--text-secondary);
    font-family: inherit;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s;
}

.auth-tab.active {
    background: var(--accent-cyan);
    color: var(--bg-void);
    border-color: var(--accent-cyan);
    font-weight: 600;
}

.auth-form { display: none; }
.auth-form.active { display: block; }

.form-group { margin-bottom: 1.25rem; }

.form-label {
    display: block;
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 0.4rem;
}

.form-input {
    width: 100%;
    padding: 0.75rem 1rem;
    background: var(--bg-elevated);
    border: 1px solid var(--border-subtle);
    border-radius: 8px;
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.95rem;
    transition: border-color 0.2s;
}

.form-input:focus {
    outline: none;
    border-color: var(--accent-cyan);
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.form-hint {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 0.25rem;
}

.form-error {
    color: var(--accent-red);
    font-size: 0.85rem;
    margin-top: 1rem;
    text-align: center;
}

.btn-submit {
    width: 100%;
    padding: 0.875rem;
    background: var(--accent-cyan);
    color: var(--bg-void);
    border: none;
    border-radius: 8px;
    font-family: inherit;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    margin-top: 0.5rem;
}

.btn-submit:hover { background: var(--accent-emerald); }
.btn-submit:disabled { opacity: 0.5; cursor: not-allowed; }

/* ===== LAYOUT: SIDEBAR + MAIN ===== */
.app-layout {
    display: flex;
    min-height: 100vh;
}

/* --- Sidebar --- */
.sidebar {
    width: var(--sidebar-width);
    background: var(--bg-surface);
    border-right: 1px solid var(--border-subtle);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 200;
    transition: transform 0.3s ease;
}

.sidebar-logo {
    padding: 1.25rem 1.5rem;
    font-family: 'DM Serif Display', serif;
    font-size: 1.35rem;
    display: flex;
    align-items: center;
    gap: 0.6rem;
    border-bottom: 1px solid var(--border-subtle);
    text-decoration: none;
    color: inherit;
}

.sidebar-logo .logo-icon {
    width: 32px;
    height: 32px;
    font-size: 0.85rem;
    flex-shrink: 0;
}

.sidebar-nav {
    flex: 1;
    padding: 1rem 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    overflow-y: auto;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.7rem 0.85rem;
    border-radius: 8px;
    color: var(--text-secondary);
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.15s;
    border: none;
    background: none;
    width: 100%;
    text-align: left;
    font-family: inherit;
}

.nav-item:hover {
    background: var(--bg-elevated);
    color: var(--text-primary);
}

.nav-item.active {
    background: rgba(0,255,200,0.08);
    color: var(--accent-cyan);
}

.nav-item svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    stroke: currentColor;
    fill: none;
    stroke-width: 1.8;
}

.nav-section-label {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
    padding: 1rem 0.85rem 0.4rem;
}

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

.sidebar-user {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.5rem;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.15s;
}

.sidebar-user:hover {
    background: var(--bg-elevated);
}

.user-avatar {
    width: 34px;
    height: 34px;
    background: linear-gradient(135deg, var(--accent-cyan), var(--accent-emerald));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--bg-void);
    flex-shrink: 0;
}

.user-info {
    flex: 1;
    min-width: 0;
}

.user-name {
    font-size: 0.85rem;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-role {
    font-size: 0.72rem;
    color: var(--text-muted);
}

/* --- Main content area --- */
.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    min-height: 100vh;
}

.top-bar {
    height: var(--header-height);
    background: var(--bg-surface);
    border-bottom: 1px solid var(--border-subtle);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1.5rem;
    position: sticky;
    top: 0;
    z-index: 100;
}

.top-bar-title {
    font-family: 'DM Serif Display', serif;
    font-size: 1.2rem;
}

.top-bar-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.mobile-menu-btn {
    display: none;
    background: none;
    border: none;
    color: var(--text-primary);
    cursor: pointer;
    padding: 0.25rem;
}

.mobile-menu-btn svg { width: 24px; height: 24px; }

.page-content {
    padding: 1.5rem;
    max-width: 1400px;
    margin: 0 auto;
}

/* ===== CARDS ===== */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: 12px;
    padding: 1.25rem;
    transition: border-color 0.2s;
}

.card:hover {
    border-color: rgba(255,255,255,0.1);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.card-title {
    font-size: 0.95rem;
    font-weight: 600;
}

/* ===== STAT CARDS ===== */
.stats-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: 12px;
    padding: 1.25rem;
}

.stat-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.5rem;
}

.stat-value {
    font-family: 'JetBrains Mono', monospace;
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.stat-subtext {
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* ===== COLOR CLASSES ===== */
.positive { color: var(--accent-emerald) !important; }
.negative { color: var(--accent-red) !important; }
.neutral { color: var(--text-secondary); }
.pending-color { color: var(--accent-gold) !important; }

/* ===== BADGES ===== */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.25rem 0.6rem;
    border-radius: 6px;
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.badge-success { background: rgba(0,212,170,0.12); color: var(--accent-emerald); }
.badge-danger  { background: rgba(255,71,87,0.12); color: var(--accent-red); }
.badge-warning { background: rgba(255,215,0,0.12); color: var(--accent-gold); }
.badge-info    { background: rgba(77,166,255,0.12); color: var(--accent-blue); }
.badge-purple  { background: rgba(168,85,247,0.12); color: var(--accent-purple); }
.badge-neutral { background: var(--bg-elevated); color: var(--text-secondary); }

/* ===== BUTTONS ===== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    padding: 0.6rem 1.1rem;
    border-radius: 8px;
    font-family: inherit;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s;
    border: none;
    white-space: nowrap;
}

.btn-primary {
    background: var(--accent-cyan);
    color: var(--bg-void);
}

.btn-primary:hover { background: var(--accent-emerald); }

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

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

.btn-danger {
    background: rgba(255,71,87,0.15);
    color: var(--accent-red);
    border: 1px solid rgba(255,71,87,0.2);
}

.btn-danger:hover {
    background: rgba(255,71,87,0.25);
}

.btn-sm { padding: 0.4rem 0.75rem; font-size: 0.8rem; }
.btn-block { width: 100%; }

.btn:disabled { opacity: 0.5; cursor: not-allowed; pointer-events: none; }

/* ===== TABLES ===== */
.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
}

.data-table th {
    text-align: left;
    padding: 0.6rem 0.75rem;
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-muted);
    border-bottom: 1px solid var(--border-subtle);
    white-space: nowrap;
}

.data-table td {
    padding: 0.65rem 0.75rem;
    border-bottom: 1px solid rgba(255,255,255,0.03);
    white-space: nowrap;
}

.data-table tbody tr:hover {
    background: rgba(255,255,255,0.02);
}

.data-table tfoot td {
    font-weight: 600;
    background: var(--bg-elevated);
    border-top: 1px solid var(--border-subtle);
}

.mono { font-family: 'JetBrains Mono', monospace; }

.direction-buy  { color: var(--accent-emerald); font-weight: 600; font-size: 0.75rem; }
.direction-sell { color: var(--accent-red); font-weight: 600; font-size: 0.75rem; }

/* ===== EMPTY STATE ===== */
.empty-state {
    text-align: center;
    padding: 2.5rem 1rem;
    color: var(--text-muted);
}

.empty-state svg {
    width: 40px;
    height: 40px;
    margin: 0 auto 0.75rem;
    stroke: var(--text-muted);
    fill: none;
    stroke-width: 1.5;
    display: block;
}

.empty-state p { font-size: 0.9rem; }

/* ===== AB COMPARISON ===== */
.ab-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.ab-card {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: 12px;
    padding: 1.25rem;
    position: relative;
}

.ab-card .ab-label {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
}

.ab-card-header {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    margin-bottom: 1rem;
}

.ab-card-header h4 { font-size: 0.9rem; }

.ab-stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
}

.ab-stat-label {
    font-size: 0.72rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.ab-stat-value {
    font-family: 'JetBrains Mono', monospace;
    font-size: 1.1rem;
    font-weight: 600;
    margin-top: 0.15rem;
}

/* ===== ACCOUNT CARDS ===== */
.account-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.85rem 1rem;
    background: var(--bg-elevated);
    border-radius: 8px;
    margin-bottom: 0.5rem;
    border: 1px solid var(--border-subtle);
    transition: border-color 0.2s;
}

.account-item.trading { border-color: rgba(0,212,170,0.3); }

.account-label {
    font-weight: 500;
    font-size: 0.9rem;
}

.account-meta {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 0.2rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* ===== TOGGLE SWITCH ===== */
.toggle {
    width: 44px;
    height: 24px;
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: 12px;
    position: relative;
    cursor: pointer;
    transition: all 0.2s;
    flex-shrink: 0;
}

.toggle::after {
    content: '';
    width: 18px;
    height: 18px;
    background: var(--text-muted);
    border-radius: 50%;
    position: absolute;
    top: 2px;
    left: 2px;
    transition: all 0.2s;
}

.toggle.on {
    background: rgba(0,212,170,0.2);
    border-color: var(--accent-emerald);
}

.toggle.on::after {
    background: var(--accent-emerald);
    left: 22px;
}

/* ===== CONNECTOR CARDS ===== */
.connector-card {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 1rem;
}

.connector-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.connector-icon {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'JetBrains Mono', monospace;
    font-weight: 700;
    font-size: 0.85rem;
    flex-shrink: 0;
}

.connector-desc {
    font-size: 0.88rem;
    color: var(--text-secondary);
    line-height: 1.5;
    margin-bottom: 1rem;
}

.connector-status {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.82rem;
    margin-bottom: 1rem;
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

.status-dot.online  { background: var(--accent-emerald); box-shadow: 0 0 6px var(--accent-emerald); }
.status-dot.offline { background: var(--accent-red); }
.status-dot.pending { background: var(--accent-gold); }

.system-reqs {
    margin-top: 1rem;
    padding: 1rem;
    background: var(--bg-elevated);
    border-radius: 8px;
}

.system-reqs h5 {
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
}

.system-reqs li {
    font-size: 0.82rem;
    color: var(--text-secondary);
    margin-bottom: 0.3rem;
    margin-left: 1rem;
}

/* ===== INSTRUMENTS GRID ===== */
.instruments-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 1rem;
}

.instrument-card {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: 12px;
    padding: 1.1rem;
    cursor: pointer;
    transition: all 0.2s;
}

.instrument-card:hover { border-color: rgba(255,255,255,0.12); }

.instrument-card.active {
    border-color: rgba(0,212,170,0.3);
    background: rgba(0,212,170,0.03);
}

.instrument-symbol {
    font-family: 'JetBrains Mono', monospace;
    font-weight: 600;
    font-size: 1rem;
}

.instrument-meta {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-top: 0.25rem;
}

.instrument-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 0.75rem;
}

/* ===== TRADING CONTROLS ===== */
.trading-controls {
    padding: 1rem;
    background: var(--bg-elevated);
    border-radius: 8px;
    margin-top: 1rem;
}

.mode-buttons {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.mode-btn {
    flex: 1;
    padding: 0.6rem;
    border-radius: 8px;
    border: 1px solid var(--border-subtle);
    background: transparent;
    color: var(--text-secondary);
    font-family: inherit;
    font-size: 0.82rem;
    cursor: pointer;
    transition: all 0.15s;
}

.mode-btn.active {
    background: rgba(0,255,200,0.1);
    border-color: var(--accent-cyan);
    color: var(--accent-cyan);
}

.mode-btn:hover:not(.active) {
    border-color: rgba(255,255,255,0.15);
    color: var(--text-primary);
}

.exit-buttons {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
}

/* ===== ONBOARDING BANNER ===== */
.onboarding-banner {
    background: linear-gradient(135deg, rgba(0,255,200,0.06), rgba(168,85,247,0.06));
    border: 1px solid var(--border-accent);
    border-radius: 12px;
    padding: 1.25rem;
    margin-bottom: 1.5rem;
}

.onboarding-banner h3 {
    font-size: 1rem;
    margin-bottom: 0.5rem;
}

.onboarding-steps {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
    margin-top: 0.75rem;
}

.onboarding-step {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.4rem 0.7rem;
    border-radius: 6px;
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.15s;
    background: var(--bg-elevated);
    border: 1px solid var(--border-subtle);
}

.onboarding-step.completed {
    background: rgba(0,212,170,0.1);
    border-color: rgba(0,212,170,0.3);
    color: var(--accent-emerald);
}

.onboarding-step.current {
    background: rgba(0,255,200,0.08);
    border-color: var(--accent-cyan);
    color: var(--accent-cyan);
    animation: pulse-border 2s infinite;
}

.onboarding-step.pending {
    color: var(--text-muted);
}

@keyframes pulse-border {
    0%, 100% { box-shadow: 0 0 0 0 rgba(0,255,200,0.3); }
    50% { box-shadow: 0 0 0 4px rgba(0,255,200,0); }
}

/* ===== ACTIVITY FEED ===== */
.activity-item {
    display: flex;
    gap: 0.6rem;
    padding: 0.65rem 0;
    border-bottom: 1px solid rgba(255,255,255,0.03);
    font-size: 0.83rem;
}

.activity-icon {
    font-size: 1rem;
    flex-shrink: 0;
    margin-top: 0.1rem;
}

.activity-text { color: var(--text-secondary); line-height: 1.4; }
.activity-text .symbol { color: var(--accent-cyan); font-family: 'JetBrains Mono', monospace; font-weight: 500; }
.activity-text .direction.buy { color: var(--accent-emerald); }
.activity-text .direction.sell { color: var(--accent-red); }
.activity-text .profit.positive { color: var(--accent-emerald); }
.activity-text .profit.negative { color: var(--accent-red); }
.activity-time { font-size: 0.72rem; color: var(--text-muted); margin-top: 0.2rem; }

/* ===== PAYMENT ===== */
.payment-methods {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.payment-method {
    padding: 1rem;
    background: var(--bg-elevated);
    border: 1px solid var(--border-subtle);
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s;
    text-align: center;
}

.payment-method:hover { border-color: rgba(255,255,255,0.12); }

.payment-method.selected {
    border-color: var(--accent-cyan);
    background: rgba(0,255,200,0.04);
}

.payment-method h4 { font-size: 0.9rem; margin-top: 0.3rem; }
.payment-method p { font-size: 0.75rem; color: var(--text-muted); margin-top: 0.2rem; }

.amount-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.amount-btn {
    padding: 0.65rem;
    border-radius: 8px;
    border: 1px solid var(--border-subtle);
    background: var(--bg-elevated);
    color: var(--text-secondary);
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.88rem;
    cursor: pointer;
    transition: all 0.15s;
}

.amount-btn:hover { border-color: rgba(255,255,255,0.15); }

.amount-btn.selected {
    border-color: var(--accent-cyan);
    color: var(--accent-cyan);
    background: rgba(0,255,200,0.06);
}

/* ===== MODAL ===== */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.7);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 5000;
    padding: 1rem;
}

.modal-overlay.show { display: flex; }

.modal {
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: 16px;
    width: 100%;
    max-width: 480px;
    overflow: hidden;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--border-subtle);
}

.modal-header h3 { font-size: 1rem; }

.modal-close {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.3rem;
    cursor: pointer;
}

.modal-body { padding: 1.25rem; }

/* ===== TOAST ===== */
.toast {
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    padding: 0.85rem 1.25rem;
    border-radius: 8px;
    font-weight: 500;
    font-size: 0.88rem;
    z-index: 9999;
    animation: toastIn 0.3s ease;
    max-width: 360px;
}

.toast-success { background: var(--accent-emerald); color: var(--bg-void); }
.toast-error   { background: var(--accent-red); color: white; }
.toast-info    { background: var(--accent-blue); color: var(--bg-void); }

@keyframes toastIn {
    from { transform: translateY(20px); opacity: 0; }
    to   { transform: translateY(0); opacity: 1; }
}

/* ===== SPINNER ===== */
.spinner {
    width: 32px;
    height: 32px;
    border: 3px solid var(--border-subtle);
    border-top-color: var(--accent-cyan);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

/* ===== ALERTS ===== */
.alert {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.85rem 1rem;
    border-radius: 8px;
    font-size: 0.85rem;
    margin-bottom: 1rem;
}

.alert-warning {
    background: rgba(255,215,0,0.08);
    border: 1px solid rgba(255,215,0,0.15);
    color: var(--accent-gold);
}

.alert-info {
    background: rgba(77,166,255,0.08);
    border: 1px solid rgba(77,166,255,0.15);
    color: var(--accent-blue);
}

.alert a { color: inherit; font-weight: 600; }

/* ===== COMING SOON ===== */
.coming-soon-card {
    background: repeating-linear-gradient(
        -45deg,
        var(--bg-card),
        var(--bg-card) 10px,
        rgba(255,255,255,0.01) 10px,
        rgba(255,255,255,0.01) 20px
    );
    border: 1px dashed rgba(255,255,255,0.08);
    border-radius: 12px;
    padding: 2rem 1.5rem;
    text-align: center;
}

.coming-soon-card h4 {
    font-size: 1rem;
    margin-bottom: 0.5rem;
}

.coming-soon-card p {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 1rem;
}

.email-signup {
    display: flex;
    gap: 0.5rem;
    max-width: 360px;
    margin: 0 auto;
}

.email-signup input {
    flex: 1;
    padding: 0.6rem 0.85rem;
    background: var(--bg-elevated);
    border: 1px solid var(--border-subtle);
    border-radius: 8px;
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.85rem;
}

.email-signup input:focus { outline: none; border-color: var(--accent-cyan); }

/* ===== TWO-COL LAYOUT ===== */
.grid-2col {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}

.grid-3col {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 1rem;
}

/* ===== REFERRAL ===== */
.referral-box {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    background: var(--bg-elevated);
    border-radius: 8px;
    margin-bottom: 0.75rem;
}

.referral-box code {
    flex: 1;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.9rem;
    color: var(--accent-cyan);
    word-break: break-all;
}

/* ===== SIDEBAR OVERLAY (mobile) ===== */
.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.6);
    z-index: 199;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 1024px) {
    .ab-grid { grid-template-columns: 1fr; }
    .grid-2col { grid-template-columns: 1fr; }
    .grid-3col { grid-template-columns: 1fr 1fr; }
    .stats-row { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
    }

    .sidebar.open {
        transform: translateX(0);
    }

    .sidebar-overlay.open {
        display: block;
    }

    .main-content {
        margin-left: 0;
    }

    .mobile-menu-btn {
        display: block;
    }

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

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

    .grid-2col, .grid-3col {
        grid-template-columns: 1fr;
    }

    .payment-methods {
        grid-template-columns: 1fr;
    }

    .amount-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .page-content {
        padding: 1rem;
    }

    .data-table {
        display: block;
        overflow-x: auto;
    }

    .exit-buttons {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .form-row { grid-template-columns: 1fr; }
    .onboarding-steps { flex-direction: column; }
}

/* Filter bar and timestamps */
.filter-bar {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-bottom: 0.75rem;
    align-items: center;
}
.filter-select, .filter-input {
    background: var(--bg-elevated);
    border: 1px solid var(--border-subtle);
    border-radius: 8px;
    color: var(--text-primary);
    padding: 0.4rem 2rem 0.4rem 0.75rem;
    font-size: 0.8rem;
    font-family: inherit;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='rgba(240,240,245,0.4)' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.6rem center;
    cursor: pointer;
    transition: border-color 0.15s, box-shadow 0.15s;
    min-height: 34px;
}
.filter-select:hover {
    border-color: rgba(255,255,255,0.12);
}
.filter-select:focus, .filter-input:focus {
    border-color: var(--accent-cyan);
    box-shadow: 0 0 0 2px rgba(0,255,200,0.1);
    outline: none;
}
.filter-input {
    padding: 0.4rem 0.75rem;
    background-image: none;
}
.filter-input[type="date"] {
    max-width: 150px;
    color-scheme: dark;
}
.filter-select option {
    background: var(--bg-card);
    color: var(--text-primary);
    padding: 0.4rem;
}
.timestamp-line {
    text-align: right;
    font-size: 0.72rem;
    color: var(--text-muted);
    margin-top: 0.5rem;
}
