/* ════════════════════════════════════════════════════════════════════════
   Elaamart Pay — Premium Admin Panel
   Dark glassmorphism theme · animated · fully responsive (phone/tablet/desktop)
   Frontend only — every class name preserved so app.js keeps working.
   ════════════════════════════════════════════════════════════════════════ */

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

:root {
    /* Brand */
    --primary: #6366f1;
    --primary-dark: #4f46e5;
    --primary-2: #8b5cf6;
    --primary-grad: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    --primary-light: rgba(99, 102, 241, 0.16);

    /* Semantic */
    --success: #22c55e;  --success-light: rgba(34, 197, 94, 0.15);
    --warning: #f59e0b;  --warning-light: rgba(245, 158, 11, 0.16);
    --danger:  #f43f5e;  --danger-light:  rgba(244, 63, 94, 0.16);
    --info:    #38bdf8;  --info-light:    rgba(56, 189, 248, 0.16);

    /* Surfaces (dark + glass) */
    --bg-color: #07070f;
    --bg-elev: #0c0c18;
    --sidebar-bg: rgba(13, 13, 26, 0.72);
    --sidebar-hover: rgba(255, 255, 255, 0.06);
    --card-bg: rgba(255, 255, 255, 0.045);
    --card-solid: #13131f;
    --header-bg: rgba(10, 10, 20, 0.66);

    /* Text */
    --text-primary: #eef0f7;
    --text-secondary: #a6acc4;
    --text-muted: #757b97;

    /* Lines + shadow */
    --border-color: rgba(255, 255, 255, 0.09);
    --border-strong: rgba(255, 255, 255, 0.16);
    --shadow-sm: 0 2px 10px rgba(0, 0, 0, 0.35);
    --shadow-md: 0 12px 40px rgba(0, 0, 0, 0.5);
    --glow: 0 0 40px rgba(99, 102, 241, 0.35);

    --radius: 16px;
    --radius-sm: 11px;

    --ease: cubic-bezier(0.4, 0, 0.2, 1);
    --spring: cubic-bezier(0.34, 1.56, 0.64, 1);
}

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

body {
    font-family: 'Inter', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    color: var(--text-primary);
    background-color: var(--bg-color);
    /* Animated aurora background */
    background-image:
        radial-gradient(60vw 60vw at 12% -10%, rgba(99, 102, 241, 0.22), transparent 60%),
        radial-gradient(50vw 50vw at 100% 0%, rgba(139, 92, 246, 0.20), transparent 55%),
        radial-gradient(55vw 55vw at 50% 120%, rgba(56, 189, 248, 0.12), transparent 60%);
    background-attachment: fixed;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

.app-container { display: flex; min-height: 100vh; }

/* ─── SIDEBAR (glass) ──────────────────────────────────────────────────── */
.sidebar {
    width: 268px;
    background: var(--sidebar-bg);
    backdrop-filter: blur(22px) saturate(140%);
    -webkit-backdrop-filter: blur(22px) saturate(140%);
    color: #fff;
    position: fixed;
    left: 0; top: 0;
    height: 100vh; height: 100dvh;
    height: calc(var(--real-vh, 1vh) * 100);
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    z-index: 100;
    border-right: 1px solid var(--border-color);
    will-change: transform;
    transform: translateX(-100%);
    transition: transform 0.35s var(--ease);
}

.sidebar-header {
    padding: 22px 20px;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 10px;
}

.logo { display: flex; align-items: center; gap: 13px; }

.logo-icon {
    position: relative;
    width: 46px; height: 46px;
    background: var(--primary-grad);
    border-radius: 13px;
    display: flex; align-items: center; justify-content: center;
    font-size: 21px; color: #fff;
    box-shadow: 0 8px 22px rgba(99, 102, 241, 0.5);
    overflow: hidden;
}
/* rotating sheen ring */
.logo-icon::before {
    content: '';
    position: absolute; inset: -40%;
    background: conic-gradient(from 0deg, transparent 0 70%, rgba(255,255,255,0.55) 85%, transparent 100%);
    animation: spin 4.5s linear infinite;
}
.logo-icon i { position: relative; z-index: 1; }

.logo-text { display: flex; flex-direction: column; }
.logo-title {
    font-size: 19px; font-weight: 800; letter-spacing: -0.4px;
    background: linear-gradient(90deg, #fff, #c7c9ff);
    -webkit-background-clip: text; background-clip: text;
    -webkit-text-fill-color: transparent;
}
.logo-subtitle { font-size: 11px; color: var(--text-muted); font-weight: 500; letter-spacing: 0.3px; }

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

.nav-item {
    display: flex; align-items: center; gap: 13px;
    padding: 12px 14px;
    color: var(--text-secondary);
    text-decoration: none;
    border-radius: 12px;
    margin-bottom: 4px;
    font-size: 14px; font-weight: 600;
    position: relative;
    transition: color 0.2s var(--ease), background 0.2s var(--ease), transform 0.2s var(--ease);
}
.nav-item .nav-icon, .nav-item i { width: 20px; text-align: center; font-size: 15px; transition: transform 0.2s var(--spring); }
.nav-item:hover { background: var(--sidebar-hover); color: #fff; }
.nav-item:hover .nav-icon, .nav-item:hover i { transform: scale(1.15); }
.nav-item.active {
    background: var(--primary-grad);
    color: #fff;
    box-shadow: 0 8px 22px rgba(99, 102, 241, 0.4);
}
/* active accent bar */
.nav-item.active::before {
    content: '';
    position: absolute; left: -12px; top: 50%; transform: translateY(-50%);
    width: 4px; height: 22px; border-radius: 0 4px 4px 0;
    background: #fff;
}

.nav-badge {
    margin-left: auto;
    background: rgba(255, 255, 255, 0.12);
    padding: 2px 10px; border-radius: 20px;
    font-size: 11px; font-weight: 700;
    font-variant-numeric: tabular-nums;
}
.nav-item.active .nav-badge { background: rgba(255, 255, 255, 0.28); }

.sidebar-footer {
    padding: 18px 20px;
    border-top: 1px solid var(--border-color);
    margin-top: auto;
}

.api-status { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--text-secondary); }
.status-dot { width: 8px; height: 8px; border-radius: 50%; }
.status-dot.online { background: var(--success); box-shadow: 0 0 0 0 rgba(34,197,94,0.6); animation: ping 2s infinite; }

@keyframes ping {
    0% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.55); }
    70% { box-shadow: 0 0 0 7px rgba(34, 197, 94, 0); }
    100% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0); }
}
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.45; } }

.version-badge {
    font-size: 11px; color: var(--text-muted);
    padding: 3px 9px; border-radius: 6px;
    background: rgba(255, 255, 255, 0.06);
    font-weight: 600;
}

/* ─── MAIN ─────────────────────────────────────────────────────────────── */
.main-content { flex: 1; margin-left: 0; min-height: 100vh; display: flex; flex-direction: column; }

.header {
    display: flex; justify-content: space-between; align-items: center;
    padding: 16px 28px;
    background: var(--header-bg);
    backdrop-filter: blur(20px) saturate(140%);
    -webkit-backdrop-filter: blur(20px) saturate(140%);
    border-bottom: 1px solid var(--border-color);
    position: sticky; top: 0; z-index: 50;
}

.header-left { display: flex; align-items: center; gap: 16px; min-width: 0; }
.header-left h1 {
    font-size: 22px; font-weight: 800; letter-spacing: -0.4px;
    color: var(--text-primary);
}
.page-subtitle { font-size: 13px; color: var(--text-secondary); margin-top: 2px; }

.mobile-menu-btn {
    display: none;
    background: var(--card-bg); border: 1px solid var(--border-color);
    font-size: 18px; color: var(--text-primary);
    cursor: pointer; padding: 9px 11px; border-radius: 11px;
    transition: background 0.2s, transform 0.2s;
    touch-action: manipulation; -webkit-tap-highlight-color: transparent;
    flex-shrink: 0;
}
.mobile-menu-btn:active { transform: scale(0.92); }

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

/* ─── BUTTONS ──────────────────────────────────────────────────────────── */
.btn {
    padding: 10px 18px; border: none; border-radius: 11px;
    cursor: pointer; font-size: 14px; font-weight: 600;
    display: inline-flex; align-items: center; gap: 8px;
    transition: transform 0.18s var(--ease), box-shadow 0.18s var(--ease), background 0.18s var(--ease), filter 0.18s;
    font-family: inherit; line-height: 1.4; white-space: nowrap;
    position: relative; overflow: hidden;
    -webkit-tap-highlight-color: transparent;
}
.btn:disabled { opacity: 0.55; cursor: not-allowed; }
.btn:active:not(:disabled) { transform: scale(0.97); }

.btn-primary { background: var(--primary-grad); color: #fff; box-shadow: 0 6px 18px rgba(99, 102, 241, 0.4); }
.btn-primary:hover:not(:disabled) { transform: translateY(-2px); box-shadow: 0 10px 26px rgba(99, 102, 241, 0.55); }
.btn-secondary { background: rgba(255, 255, 255, 0.08); color: var(--text-primary); border: 1px solid var(--border-color); }
.btn-secondary:hover:not(:disabled) { background: rgba(255, 255, 255, 0.13); }
.btn-success { background: var(--success); color: #04130a; }
.btn-danger { background: linear-gradient(135deg, #f43f5e, #e11d48); color: #fff; box-shadow: 0 6px 18px rgba(244,63,94,0.4); }
.btn-danger:hover:not(:disabled) { transform: translateY(-2px); box-shadow: 0 10px 26px rgba(244,63,94,0.5); }
.btn-outline { background: transparent; border: 1px solid var(--border-strong); color: var(--text-secondary); }
.btn-outline:hover:not(:disabled) { border-color: var(--primary); color: #fff; background: var(--primary-light); }
.btn-sm { padding: 6px 12px; font-size: 12px; border-radius: 9px; }

/* ─── CARDS (glass) ────────────────────────────────────────────────────── */
.card {
    background: var(--card-bg);
    backdrop-filter: blur(16px) saturate(130%);
    -webkit-backdrop-filter: blur(16px) saturate(130%);
    border-radius: var(--radius);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}
.card-header {
    display: flex; justify-content: space-between; align-items: center;
    padding: 18px 24px; border-bottom: 1px solid var(--border-color);
}
.card-header h2 { font-size: 16px; font-weight: 700; display: flex; align-items: center; gap: 9px; }
.card-header h2 i { color: var(--primary); }
.card-body { padding: 20px 24px; }
.card-body.p-0 { padding: 0; }

/* ─── TABLES ───────────────────────────────────────────────────────────── */
.table-wrapper { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.data-table { width: 100%; border-collapse: collapse; min-width: 750px; }
.data-table th {
    padding: 13px 16px; text-align: left;
    border-bottom: 1px solid var(--border-color);
    font-weight: 700; font-size: 11px; text-transform: uppercase; letter-spacing: 0.6px;
    color: var(--text-muted);
    background: rgba(255, 255, 255, 0.03);
    white-space: nowrap; position: sticky; top: 0;
}
.data-table td {
    padding: 14px 16px; border-bottom: 1px solid var(--border-color);
    font-size: 14px; white-space: nowrap; color: var(--text-primary);
}
.data-table td.text-muted, .data-table .text-muted { color: var(--text-muted); }
#clients-table-body td:first-child { white-space: normal; min-width: 180px; }
.data-table td code { max-width: 170px; display: inline-block; overflow: hidden; text-overflow: ellipsis; vertical-align: middle; }
.data-table tbody tr { transition: background 0.16s; }
.data-table tbody tr:hover { background: rgba(99, 102, 241, 0.08); }
.data-table tbody tr:last-child td { border-bottom: none; }
.data-table code { background: rgba(255,255,255,0.06); padding: 3px 8px; border-radius: 6px; color: #c7c9ff; }

.text-center { text-align: center; }
.text-muted { color: var(--text-muted); }

/* ─── PAGES (animated entrance) ────────────────────────────────────────── */
.page { display: none; padding: 28px; }
.page.active { display: block; animation: pageIn 0.45s var(--ease) both; }
@keyframes pageIn { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: translateY(0); } }

/* ─── STAT CARDS ───────────────────────────────────────────────────────── */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
    gap: 16px; margin-bottom: 28px;
}
.stat-card {
    position: relative;
    background: var(--card-bg);
    backdrop-filter: blur(16px) saturate(130%);
    -webkit-backdrop-filter: blur(16px) saturate(130%);
    border-radius: var(--radius);
    padding: 20px;
    display: flex; align-items: center; gap: 16px;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
    cursor: pointer; overflow: hidden;
    transition: transform 0.25s var(--ease), box-shadow 0.25s var(--ease), border-color 0.25s var(--ease);
    animation: cardRise 0.5s var(--ease) both;
}
.stat-card::after {
    content: ''; position: absolute; inset: 0;
    background: radial-gradient(120px 80px at 85% 0%, rgba(99,102,241,0.18), transparent 70%);
    opacity: 0; transition: opacity 0.3s;
}
.stat-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); border-color: var(--border-strong); }
.stat-card:hover::after { opacity: 1; }
.stat-card:nth-child(1) { animation-delay: 0.04s; }
.stat-card:nth-child(2) { animation-delay: 0.10s; }
.stat-card:nth-child(3) { animation-delay: 0.16s; }
.stat-card:nth-child(4) { animation-delay: 0.22s; }
.stat-card:nth-child(5) { animation-delay: 0.28s; }
.stat-card:nth-child(6) { animation-delay: 0.34s; }
@keyframes cardRise { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: translateY(0); } }

.stat-icon {
    width: 50px; height: 50px; border-radius: 14px;
    display: flex; align-items: center; justify-content: center;
    font-size: 22px; color: #fff; flex-shrink: 0;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.35);
}
.stat-icon.clients { background: linear-gradient(135deg, #6366f1, #8b5cf6); }
.stat-icon.total-trx { background: linear-gradient(135deg, #0ea5e9, #3b82f6); }
.stat-icon.completed { background: linear-gradient(135deg, #22c55e, #16a34a); }
.stat-icon.pending { background: linear-gradient(135deg, #f59e0b, #d97706); }
.stat-icon.amount { background: linear-gradient(135deg, #a855f7, #7c3aed); }
.stat-icon.failed { background: linear-gradient(135deg, #f43f5e, #e11d48); }

.stat-info { position: relative; z-index: 1; }
.stat-info h3 { font-size: 28px; font-weight: 800; letter-spacing: -0.6px; line-height: 1.1; font-variant-numeric: tabular-nums; }
.stat-info p { font-size: 13px; color: var(--text-secondary); margin-top: 3px; }
.stat-sub { font-size: 12px; color: var(--text-muted); }

/* ─── STATUS BADGES ────────────────────────────────────────────────────── */
.status-badge {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 4px 11px; border-radius: 20px;
    font-size: 12px; font-weight: 700; text-transform: capitalize;
    border: 1px solid transparent;
}
.status-badge::before { content: ''; width: 6px; height: 6px; border-radius: 50%; }
.status-badge.pending   { background: var(--warning-light); color: #fbbf24; border-color: rgba(245,158,11,0.3); }
.status-badge.pending::before { background: var(--warning); animation: pulse 1.6s infinite; }
.status-badge.completed { background: var(--success-light); color: #4ade80; border-color: rgba(34,197,94,0.3); }
.status-badge.completed::before { background: var(--success); }
.status-badge.failed    { background: var(--danger-light); color: #fb7185; border-color: rgba(244,63,94,0.3); }
.status-badge.failed::before { background: var(--danger); }
.status-badge.cancelled { background: rgba(255,255,255,0.07); color: var(--text-secondary); border-color: var(--border-color); }
.status-badge.cancelled::before { background: var(--text-muted); }
.status-badge.active    { background: var(--success-light); color: #4ade80; border-color: rgba(34,197,94,0.3); }
.status-badge.active::before { background: var(--success); }
.status-badge.inactive  { background: var(--danger-light); color: #fb7185; border-color: rgba(244,63,94,0.3); }
.status-badge.inactive::before { background: var(--danger); }

/* ─── CLIENT CELLS ─────────────────────────────────────────────────────── */
.client-cell { display: flex; align-items: center; gap: 12px; }
.client-avatar {
    width: 38px; height: 38px; border-radius: 11px;
    background: var(--primary-grad); color: #fff;
    display: flex; align-items: center; justify-content: center;
    font-weight: 800; font-size: 14px; flex-shrink: 0;
    box-shadow: 0 4px 12px rgba(99,102,241,0.4);
}
.client-name { font-weight: 700; font-size: 14px; }
.client-email { font-size: 12px; color: var(--text-muted); }
.api-key-snippet { font-size: 12px; background: rgba(255,255,255,0.06); padding: 4px 9px; border-radius: 6px; color: #c7c9ff; }
.trx-count { font-weight: 700; color: var(--text-primary); font-variant-numeric: tabular-nums; }

/* ─── ICON ACTION BUTTONS ──────────────────────────────────────────────── */
.action-buttons { display: flex; gap: 5px; }
.btn-icon {
    width: 34px; height: 34px; padding: 0;
    display: inline-flex; align-items: center; justify-content: center;
    border-radius: 10px; border: 1px solid var(--border-color); cursor: pointer;
    font-size: 13px; background: rgba(255,255,255,0.04); color: var(--text-secondary);
    transition: all 0.18s var(--ease);
}
.btn-icon:hover { background: rgba(255,255,255,0.1); color: #fff; transform: translateY(-1px); }
.btn-keys:hover { background: var(--primary-light); color: #a5b4fc; border-color: rgba(99,102,241,0.4); }
.btn-edit:hover { background: var(--info-light); color: #7dd3fc; border-color: rgba(56,189,248,0.4); }
.btn-toggle-off:hover { background: var(--warning-light); color: #fbbf24; }
.btn-toggle-on:hover { background: var(--success-light); color: #4ade80; }
.btn-delete:hover { background: var(--danger-light); color: #fb7185; border-color: rgba(244,63,94,0.4); }

/* ─── PAGE ACTIONS / SEARCH ────────────────────────────────────────────── */
.page-actions { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; gap: 16px; flex-wrap: wrap; }
.page-actions-left { display: flex; align-items: center; gap: 12px; flex: 1; }
.search-box {
    display: flex; align-items: center; gap: 4px;
    background: var(--card-bg); border: 1px solid var(--border-color);
    border-radius: 11px; padding: 0 13px; flex: 1; max-width: 340px;
    transition: border-color 0.2s, box-shadow 0.2s;
}
.search-box:focus-within { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-light); }
.search-box i { color: var(--text-muted); font-size: 14px; }
.search-box input { border: none; outline: none; padding: 10px; font-size: 14px; width: 100%; background: transparent; font-family: inherit; color: var(--text-primary); }
.search-box input::placeholder { color: var(--text-muted); }

/* ─── FILTERS ──────────────────────────────────────────────────────────── */
.filters { display: flex; gap: 12px; margin-bottom: 20px; flex-wrap: wrap; align-items: center; }
.filter-group {
    display: flex; align-items: center; gap: 8px;
    background: var(--card-bg); border: 1px solid var(--border-color);
    border-radius: 11px; padding: 0 13px;
    transition: border-color 0.2s;
}
.filter-group:focus-within { border-color: var(--primary); }
.filter-group i { color: var(--text-muted); font-size: 14px; }
.filter-group select, .filter-group input {
    border: none; outline: none; padding: 10px 4px; font-size: 14px;
    background: transparent; font-family: inherit; color: var(--text-primary);
}
.filter-group select option { background: var(--card-solid); color: var(--text-primary); }
.filter-group input[type="date"] { min-width: 140px; color-scheme: dark; }

/* ─── PAGINATION ───────────────────────────────────────────────────────── */
.pagination { display: flex; justify-content: center; gap: 6px; margin-top: 22px; flex-wrap: wrap; }
.page-btn {
    min-width: 38px; height: 38px; padding: 0 10px;
    border: 1px solid var(--border-color); border-radius: 10px;
    background: var(--card-bg); cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    font-size: 13px; color: var(--text-secondary); font-weight: 600;
    transition: all 0.18s var(--ease);
}
.page-btn:hover:not(:disabled) { border-color: var(--primary); color: #fff; background: var(--primary-light); }
.page-btn.active { background: var(--primary-grad); color: #fff; border-color: transparent; box-shadow: 0 4px 14px rgba(99,102,241,0.4); }
.page-btn:disabled { opacity: 0.35; cursor: not-allowed; }

/* ─── FORMS ────────────────────────────────────────────────────────────── */
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-group { margin-bottom: 16px; }
.form-group label {
    display: flex; align-items: center; gap: 6px;
    font-size: 13px; font-weight: 600; color: var(--text-primary); margin-bottom: 7px;
}
.form-group label i { color: var(--primary); width: 16px; }
.form-group input, .form-group select, .form-group textarea {
    width: 100%; padding: 11px 14px;
    border: 1px solid var(--border-color); border-radius: 11px;
    font-size: 16px; font-family: inherit;
    transition: border-color 0.18s, box-shadow 0.18s, background 0.18s;
    outline: none; background: rgba(255,255,255,0.04); color: var(--text-primary);
}
.form-group input::placeholder, .form-group textarea::placeholder { color: var(--text-muted); }
.form-group select option { background: var(--card-solid); color: var(--text-primary); }
.form-group input:focus, .form-group select:focus, .form-group textarea:focus {
    border-color: var(--primary); background: rgba(255,255,255,0.06);
    box-shadow: 0 0 0 3.5px var(--primary-light);
}
.form-hint { display: block; font-size: 11.5px; color: var(--text-muted); margin-top: 5px; }
.form-section-label {
    font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px;
    color: var(--text-muted); margin: 16px 0 10px; padding-top: 14px;
    border-top: 1px solid var(--border-color);
}

/* ─── MODALS (glass dark) ──────────────────────────────────────────────── */
.modal { display: none; position: fixed; inset: 0; z-index: 1000; align-items: center; justify-content: center; }
.modal.active { display: flex; }
.modal-backdrop {
    position: absolute; inset: 0;
    background: rgba(5, 5, 12, 0.6);
    backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
    animation: fadeIn 0.25s ease;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.modal-content {
    background: rgba(20, 20, 32, 0.92);
    backdrop-filter: blur(28px) saturate(140%);
    -webkit-backdrop-filter: blur(28px) saturate(140%);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius);
    width: 92%; max-width: 520px; max-height: 90vh; overflow-y: auto;
    position: relative; box-shadow: 0 30px 80px rgba(0, 0, 0, 0.65);
    animation: modalSlideUp 0.35s var(--spring);
}
@keyframes modalSlideUp { from { opacity: 0; transform: translateY(26px) scale(0.96); } to { opacity: 1; transform: translateY(0) scale(1); } }
.modal-lg { max-width: 640px; }
.modal-sm { max-width: 440px; }
.modal-header { display: flex; align-items: flex-start; gap: 14px; padding: 24px 24px 0; position: relative; }
.modal-header-icon {
    width: 46px; height: 46px; border-radius: 13px;
    display: flex; align-items: center; justify-content: center;
    font-size: 20px; color: #fff; flex-shrink: 0;
    background: var(--primary-grad); box-shadow: 0 8px 20px rgba(99,102,241,0.4);
}
.modal-header-icon.success { background: linear-gradient(135deg, #22c55e, #16a34a); box-shadow: 0 8px 20px rgba(34,197,94,0.4); }
.modal-header-icon.edit { background: var(--primary-grad); }
.modal-header-icon.danger { background: linear-gradient(135deg, #f43f5e, #e11d48); box-shadow: 0 8px 20px rgba(244,63,94,0.4); }
.modal-header h2 { font-size: 18px; font-weight: 800; margin-bottom: 3px; }
.modal-header p { font-size: 13px; color: var(--text-secondary); }
.close-btn {
    position: absolute; top: 16px; right: 16px;
    background: rgba(255,255,255,0.06); border: 1px solid var(--border-color);
    width: 34px; height: 34px; border-radius: 10px; font-size: 18px; cursor: pointer;
    color: var(--text-secondary);
    display: flex; align-items: center; justify-content: center; transition: all 0.18s;
}
.close-btn:hover { background: var(--danger-light); color: #fb7185; border-color: rgba(244,63,94,0.4); transform: rotate(90deg); }
.modal-body { padding: 20px 24px; }
.modal-footer {
    display: flex; gap: 10px; justify-content: flex-end;
    padding: 16px 24px; border-top: 1px solid var(--border-color);
    background: rgba(255, 255, 255, 0.02);
    border-radius: 0 0 var(--radius) var(--radius);
}

/* ─── API DETAILS ──────────────────────────────────────────────────────── */
.api-details { display: flex; flex-direction: column; gap: 14px; }
.api-detail-item { display: flex; flex-direction: column; gap: 5px; }
.api-detail-item label { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px; color: var(--text-muted); }
.api-detail-item .value { display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--text-primary); word-break: break-all; }
.api-detail-item .value code {
    font-size: 13px; background: rgba(255,255,255,0.05); padding: 6px 11px;
    border-radius: 8px; border: 1px solid var(--border-color); flex: 1; color: #c7c9ff;
}
.api-detail-item .value button {
    background: rgba(255,255,255,0.05); border: 1px solid var(--border-color); cursor: pointer;
    color: var(--text-secondary); font-size: 14px; padding: 7px 9px; border-radius: 8px;
    transition: all 0.18s; flex-shrink: 0;
}
.api-detail-item .value button:hover { color: #fff; background: var(--primary-light); border-color: rgba(99,102,241,0.4); }
.secret-hidden { font-size: 12px; color: var(--warning); font-style: italic; }

/* ─── ALERTS ───────────────────────────────────────────────────────────── */
.alert { display: flex; align-items: flex-start; gap: 12px; padding: 14px 16px; border-radius: 12px; margin-bottom: 16px; font-size: 13px; line-height: 1.55; }
.alert i { font-size: 18px; flex-shrink: 0; margin-top: 1px; }
.alert-warning { background: var(--warning-light); border: 1px solid rgba(245,158,11,0.3); color: #fcd34d; }
.alert-warning i { color: var(--warning); }
.alert-warning strong { font-weight: 800; color: #fde68a; }

/* ─── EMPTY / LOADING ──────────────────────────────────────────────────── */
.empty-state { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 60px 20px; color: var(--text-muted); }
.empty-state i { font-size: 48px; margin-bottom: 16px; color: rgba(255,255,255,0.14); }
.empty-state p { font-size: 15px; margin-bottom: 20px; }
.loading-spinner {
    display: inline-block; width: 24px; height: 24px;
    border: 3px solid rgba(255,255,255,0.12); border-top-color: var(--primary);
    border-radius: 50%; animation: spin 0.8s linear infinite; margin-right: 8px; vertical-align: middle;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ─── TOASTS ───────────────────────────────────────────────────────────── */
#toast-container { position: fixed; bottom: 0; right: 0; z-index: 9999; padding: 20px; pointer-events: none; }
.toast {
    pointer-events: auto; display: flex; align-items: center; gap: 11px;
    padding: 14px 20px; border-radius: 13px; font-size: 14px; font-weight: 600;
    box-shadow: 0 12px 40px rgba(0,0,0,0.5); max-width: 400px; position: absolute; right: 20px;
    border: 1px solid var(--border-strong);
    backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px);
}
.toast i { font-size: 18px; flex-shrink: 0; }
.toast.success { background: rgba(6, 78, 59, 0.85); color: #d1fae5; border-color: rgba(34,197,94,0.4); }
.toast.success i { color: #4ade80; }
.toast.error { background: rgba(127, 29, 29, 0.85); color: #fee2e2; border-color: rgba(244,63,94,0.4); }
.toast.error i { color: #fb7185; }
.toast.info { background: rgba(30, 58, 95, 0.85); color: #dbeafe; border-color: rgba(56,189,248,0.4); }
.toast.info i { color: #7dd3fc; }

/* ─── SIDEBAR OVERLAY ──────────────────────────────────────────────────── */
#sidebar-overlay {
    display: none; position: fixed; inset: 0;
    background: rgba(3, 3, 8, 0.6); z-index: 99;
    backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px);
    cursor: pointer; touch-action: manipulation; -webkit-tap-highlight-color: transparent;
}
#sidebar-overlay.active { display: block; animation: fadeIn 0.25s ease; }
body.sidebar-open { overflow: hidden; }

/* ─── HEADER ADMIN INFO + PROVIDER SWITCHER ────────────────────────────── */
.header-admin-info { display: flex; align-items: center; gap: 12px; }
.admin-badge {
    display: flex; align-items: center; gap: 7px; padding: 8px 14px;
    background: var(--primary-light); color: #a5b4fc; border: 1px solid rgba(99,102,241,0.3);
    border-radius: 11px; font-size: 13px; font-weight: 700;
}
.btn-logout {
    display: flex; align-items: center; gap: 7px; padding: 8px 14px;
    background: rgba(255,255,255,0.04); border: 1px solid var(--border-color);
    border-radius: 11px; font-size: 13px; font-weight: 600; color: var(--text-secondary);
    cursor: pointer; font-family: inherit; transition: all 0.18s;
}
.btn-logout:hover { background: var(--danger-light); border-color: rgba(244,63,94,0.4); color: #fb7185; }
.sidebar-logout-btn {
    display: flex; align-items: center; justify-content: center; gap: 10px;
    width: 100%; padding: 11px 14px;
    background: rgba(244,63,94,0.12); border: 1px solid rgba(244,63,94,0.25);
    border-radius: 11px; color: #fb7185; font-size: 13px; font-weight: 700;
    cursor: pointer; font-family: inherit; transition: all 0.18s;
}
.sidebar-logout-btn:hover { background: rgba(244,63,94,0.22); transform: translateY(-1px); }

.provider-switcher-wrap {
    display: flex; align-items: center; gap: 8px;
    background: var(--card-bg); border: 1px solid var(--border-color);
    border-radius: 11px; padding: 8px 13px; transition: border-color 0.2s;
}
.provider-switcher-wrap:focus-within { border-color: var(--primary); }
.provider-switcher-wrap i { color: var(--primary); font-size: 14px; }
.provider-switcher-wrap select {
    border: none; background: transparent; font-size: 14px; font-weight: 700;
    color: var(--text-primary); cursor: pointer; outline: none; padding-right: 4px;
}
.provider-switcher-wrap select option { background: var(--card-solid); color: var(--text-primary); }

.refresh-indicator { display: none; align-items: center; gap: 6px; font-size: 11px; color: var(--text-muted); white-space: nowrap; }
.refresh-indicator.visible { display: flex; }
.refresh-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--success); animation: pulse 2s infinite; }

/* ─── FOOTER ───────────────────────────────────────────────────────────── */
.app-footer {
    margin-top: auto;
    display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px;
    padding: 18px 28px;
    border-top: 1px solid var(--border-color);
    background: rgba(10, 10, 20, 0.5);
    backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
    font-size: 12.5px; color: var(--text-muted);
}
.app-footer .foot-brand { display: flex; align-items: center; gap: 8px; font-weight: 700; color: var(--text-secondary); }
.app-footer .foot-brand .dot { width: 16px; height: 16px; border-radius: 5px; background: var(--primary-grad); display: inline-block; }
.app-footer a { color: var(--text-secondary); text-decoration: none; transition: color 0.2s; }
.app-footer a:hover { color: #a5b4fc; }
.app-footer .foot-links { display: flex; gap: 16px; flex-wrap: wrap; }

/* ─── MOBILE BOTTOM NAV (like IG/Twitter) ──────────────────────────────── */
.bottom-nav {
    display: none;
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 90;
    background: var(--header-bg);
    backdrop-filter: blur(22px) saturate(140%); -webkit-backdrop-filter: blur(22px) saturate(140%);
    border-top: 1px solid var(--border-color);
    padding: 6px 6px calc(6px + env(safe-area-inset-bottom));
    justify-content: space-around; align-items: stretch;
}
.bottom-nav .nav-item {
    flex: 1; flex-direction: column; gap: 3px; margin: 0; padding: 8px 4px;
    border-radius: 12px; font-size: 10.5px; font-weight: 600; text-align: center;
    color: var(--text-muted); min-height: 52px; justify-content: center;
}
.bottom-nav .nav-item::before { display: none; }
.bottom-nav .nav-item i, .bottom-nav .nav-item .nav-icon { font-size: 18px; width: auto; }
.bottom-nav .nav-item.active { background: transparent; color: #a5b4fc; box-shadow: none; }
.bottom-nav .nav-item.active i, .bottom-nav .nav-item.active .nav-icon { transform: translateY(-2px) scale(1.1); }
.bottom-nav .nav-badge { position: absolute; top: 4px; right: 50%; margin: 0; transform: translateX(18px); padding: 1px 6px; font-size: 9px; background: var(--danger); }

/* ─── SCROLLBAR / SELECTION ────────────────────────────────────────────── */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.14); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.24); }
::selection { background: rgba(99,102,241,0.45); color: #fff; }

/* ════════════════════════════════════════════════════════════════════════
   LOGIN SCREEN (premium dark glass)
   ════════════════════════════════════════════════════════════════════════ */
.login-screen {
    position: fixed; inset: 0; z-index: 99999;
    display: flex; align-items: center; justify-content: center;
    min-height: 100vh; min-height: 100dvh;
    font-family: 'Inter', 'Segoe UI', sans-serif; overflow: hidden;
    background: linear-gradient(145deg, #0a0a16 0%, #1e1b4b 30%, #2e1065 60%, #0a0a16 100%);
}
.login-orb { position: absolute; border-radius: 50%; pointer-events: none; filter: blur(80px); animation: orbPulse 7s ease-in-out infinite; }
.login-orb-1 { width: 620px; height: 620px; background: radial-gradient(circle at center, rgba(99,102,241,0.6) 0%, transparent 65%); top: -210px; left: -160px; }
.login-orb-2 { width: 520px; height: 520px; background: radial-gradient(circle at center, rgba(139,92,246,0.55) 0%, transparent 65%); bottom: -160px; right: -130px; animation-delay: 3.5s; }
.login-orb-3 { width: 380px; height: 380px; background: radial-gradient(circle at center, rgba(56,189,248,0.4) 0%, transparent 65%); top: 45%; left: 45%; transform: translate(-50%,-50%); animation-name: orbPulse3; animation-delay: 5s; }
@keyframes orbPulse { 0%,100% { opacity: 1; transform: scale(1); } 50% { opacity: 0.7; transform: scale(1.1); } }
@keyframes orbPulse3 { 0%,100% { opacity: 1; transform: translate(-50%,-50%) scale(1); } 50% { opacity: 0.65; transform: translate(-50%,-50%) scale(1.14); } }
.login-screen::before {
    content: ''; position: absolute; inset: 0; z-index: 0; pointer-events: none;
    background-image: linear-gradient(rgba(255,255,255,0.035) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,0.035) 1px, transparent 1px);
    background-size: 42px 42px;
    mask-image: radial-gradient(ellipse 80% 80% at 50% 40%, #000 40%, transparent 100%);
    -webkit-mask-image: radial-gradient(ellipse 80% 80% at 50% 40%, #000 40%, transparent 100%);
}
.login-card {
    position: relative; z-index: 1; width: 100%; max-width: 440px; margin: 16px;
    background: rgba(18, 18, 32, 0.78);
    backdrop-filter: blur(28px) saturate(150%); -webkit-backdrop-filter: blur(28px) saturate(150%);
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 22px; padding: 46px 42px 38px;
    box-shadow: 0 0 0 1px rgba(255,255,255,0.05), 0 30px 80px rgba(0,0,0,0.6), 0 0 120px rgba(99,102,241,0.25);
    animation: cardAppear 0.6s var(--spring) both;
}
@keyframes cardAppear { from { opacity: 0; transform: translateY(40px) scale(0.94); } to { opacity: 1; transform: translateY(0) scale(1); } }
.login-logo-wrap { display: flex; flex-direction: column; align-items: center; margin-bottom: 26px; }
.login-logo-icon {
    position: relative; width: 70px; height: 70px;
    background: var(--primary-grad); border-radius: 19px;
    display: flex; align-items: center; justify-content: center;
    font-size: 31px; color: #fff; margin-bottom: 18px; overflow: hidden;
    box-shadow: 0 10px 30px rgba(99,102,241,0.55);
}
.login-logo-icon::before {
    content: ''; position: absolute; inset: -40%;
    background: conic-gradient(from 0deg, transparent 0 70%, rgba(255,255,255,0.6) 86%, transparent 100%);
    animation: spin 4s linear infinite;
}
.login-logo-icon i { position: relative; z-index: 1; }
.login-title { font-size: 25px; font-weight: 800; color: #fff; letter-spacing: -0.5px; margin: 0 0 5px; text-align: center; }
.login-subtitle { font-size: 13.5px; color: #a6acc4; margin: 0; text-align: center; }
.login-divider { display: flex; align-items: center; gap: 10px; margin: 24px 0 22px; }
.login-divider::before, .login-divider::after { content: ''; flex: 1; height: 1px; background: rgba(255,255,255,0.12); }
.login-divider span { font-size: 11px; font-weight: 700; color: #757b97; text-transform: uppercase; letter-spacing: 0.9px; white-space: nowrap; }
.login-field-label { display: block; font-size: 12.5px; font-weight: 600; color: #c3c8db; letter-spacing: 0.2px; margin-bottom: 8px; }
.login-input-row { position: relative; margin-bottom: 14px; }
.login-input {
    width: 100%; padding: 14px 46px 14px 16px;
    background: rgba(255,255,255,0.05); border: 1.5px solid rgba(255,255,255,0.12);
    border-radius: 12px; color: #fff; font-size: 16px; font-family: inherit;
    outline: none; transition: all 0.18s; box-sizing: border-box;
}
.login-input::placeholder { color: #757b97; }
.login-input:focus { border-color: var(--primary); background: rgba(255,255,255,0.08); box-shadow: 0 0 0 3.5px rgba(99,102,241,0.22); }
.login-input.shake { animation: shake 0.4s ease; }
@keyframes shake { 0%,100% { transform: translateX(0); } 20% { transform: translateX(-7px); } 40% { transform: translateX(7px); } 60% { transform: translateX(-4px); } 80% { transform: translateX(4px); } }
.login-eye-btn { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); background: none; border: none; color: #757b97; cursor: pointer; padding: 5px; border-radius: 6px; font-size: 15px; transition: color 0.18s; line-height: 1; }
.login-eye-btn:hover { color: var(--primary); }
.login-msg { display: none; align-items: flex-start; gap: 9px; padding: 12px 14px; border-radius: 11px; font-size: 13px; font-weight: 500; line-height: 1.45; margin-bottom: 14px; }
.login-error-box { background: rgba(244,63,94,0.12); border: 1px solid rgba(244,63,94,0.35); color: #fda4af; }
.login-lockout-box { background: rgba(245,158,11,0.12); border: 1px solid rgba(245,158,11,0.35); color: #fcd34d; }
.login-msg i { font-size: 14px; flex-shrink: 0; margin-top: 1px; }
.login-submit {
    width: 100%; padding: 15px; background: var(--primary-grad); color: #fff;
    border: none; border-radius: 12px; font-size: 14.5px; font-weight: 700; font-family: inherit;
    cursor: pointer; transition: all 0.2s; display: flex; align-items: center; justify-content: center; gap: 9px;
    box-shadow: 0 8px 26px rgba(99,102,241,0.5); letter-spacing: 0.2px;
}
.login-submit:hover:not(:disabled) { transform: translateY(-2px); box-shadow: 0 12px 34px rgba(99,102,241,0.6); }
.login-submit:active:not(:disabled) { transform: translateY(0); }
.login-submit:disabled { opacity: 0.55; cursor: not-allowed; }
.login-spin { width: 17px; height: 17px; border: 2.5px solid rgba(255,255,255,0.35); border-top-color: #fff; border-radius: 50%; animation: spin 0.65s linear infinite; display: none; flex-shrink: 0; }
.login-card-footer { display: flex; align-items: center; justify-content: center; gap: 7px; margin-top: 22px; font-size: 11.5px; color: #757b97; border-top: 1px solid rgba(255,255,255,0.08); padding-top: 18px; }
.login-dot { width: 3px; height: 3px; border-radius: 50%; background: #4b5169; }

/* ════════════════════════════════════════════════════════════════════════
   RESPONSIVE  — mobile-first
   ════════════════════════════════════════════════════════════════════════ */
@media (min-width: 1201px) {
    .sidebar { transform: translateX(0); width: 268px; }
    .main-content { margin-left: 268px; }
    .mobile-menu-btn { display: none; }
}
@media (min-width: 1025px) and (max-width: 1200px) {
    .sidebar { transform: translateX(0); width: 244px; }
    .main-content { margin-left: 244px; }
    .mobile-menu-btn { display: none; }
    .logo-title { font-size: 17px; }
}
@media (min-width: 769px) and (max-width: 1024px) {
    .sidebar { transform: translateX(0); width: 224px; }
    .main-content { margin-left: 224px; }
    .mobile-menu-btn { display: none; }
    .nav-item { padding: 11px 12px; font-size: 13px; }
    .stats-grid { grid-template-columns: repeat(3, 1fr); }
    .page { padding: 22px; }
    .header { padding: 14px 22px; }
}

/* ── MOBILE (≤768px) ── */
@media (max-width: 768px) {
    .sidebar { transform: translateX(-100%); width: 280px; }
    .sidebar.active { transform: translateX(0); }
    .main-content { margin-left: 0; }
    .mobile-menu-btn { display: flex; align-items: center; justify-content: center; }

    .header { padding: 0 14px; height: 58px; flex-wrap: nowrap; gap: 10px; }
    .header-left { flex: 1; min-width: 0; gap: 10px; overflow: hidden; }
    .header-left h1 { font-size: 17px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
    .page-subtitle { display: none; }
    .refresh-indicator { display: none !important; }
    .header-right { flex-shrink: 0; }

    /* show bottom nav, give content clearance */
    .bottom-nav { display: flex; }
    .page { padding: 16px 14px; padding-bottom: 88px; }
    .app-footer { display: none; } /* footer hidden on mobile (bottom-nav present) */

    .stats-grid { grid-template-columns: repeat(2, 1fr); gap: 11px; margin-bottom: 18px; }
    .stat-card { padding: 15px 13px; gap: 11px; }
    .stat-icon { width: 42px; height: 42px; font-size: 18px; border-radius: 12px; }
    .stat-info h3 { font-size: 22px; }
    .stat-info p { font-size: 12px; }
    .stat-sub { display: none; }

    .card-header { padding: 15px 16px; }
    .card-header h2 { font-size: 14px; }
    .card-body { padding: 6px; }
    .card-body.p-0 { padding: 0; }

    .data-table { min-width: 540px; }
    .data-table th { padding: 11px 10px; font-size: 10.5px; }
    .data-table td { padding: 12px 10px; font-size: 13px; }
    .status-badge { font-size: 11px; padding: 3px 9px; }
    .btn-icon { width: 36px; height: 36px; }
    .action-buttons { gap: 4px; }
    .client-avatar { width: 34px; height: 34px; }

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

    /* modals as bottom sheets */
    .modal { align-items: flex-end; }
    .modal-content { width: 100%; max-width: 100%; max-height: 90vh; border-radius: 22px 22px 0 0; margin: 0; }
    .modal-header { padding: 22px 18px 0; }
    .modal-body { padding: 16px 18px; }
    .modal-footer { padding: 14px 18px calc(14px + env(safe-area-inset-bottom)); flex-wrap: wrap; gap: 8px; }
    .modal-footer .btn { flex: 1; justify-content: center; }

    .filters { flex-direction: column; align-items: stretch; gap: 9px; }
    .filter-group { width: 100%; }
    .filter-group select, .filter-group input[type="date"] { width: 100%; min-width: 0; }

    .page-actions { flex-direction: column; gap: 11px; }
    .page-actions-left { width: 100%; }
    .search-box { max-width: none; width: 100%; }
    .page-actions > .btn-primary { width: 100%; justify-content: center; }
    .pagination { gap: 5px; }

    #toast-container { left: 0; right: 0; bottom: 70px; padding: 12px; }
    .toast { right: 12px; left: 12px; max-width: none; }
}

/* ── SMALL PHONE (≤480px) ── */
@media (max-width: 480px) {
    .page { padding: 12px 10px 88px; }
    .header { padding: 0 10px; height: 54px; }
    .header-left h1 { font-size: 16px; }
    .stats-grid { gap: 8px; margin-bottom: 14px; }
    .stat-card { padding: 13px 11px; flex-direction: column; align-items: flex-start; gap: 8px; }
    .stat-icon { width: 38px; height: 38px; font-size: 16px; border-radius: 10px; }
    .stat-info h3 { font-size: 19px; }
    .stat-info p { font-size: 11px; }
    .admin-badge { padding: 8px 10px; }
    .admin-badge span { display: none; }
    .btn-logout { padding: 8px 10px; }
    .btn-logout-text { display: none; }
    .data-table th { padding: 9px 8px; font-size: 10px; }
    .data-table td { padding: 10px 8px; font-size: 12px; }
    .modal-header h2 { font-size: 16px; }
    .provider-switcher-wrap { padding: 7px 10px; }
    .provider-switcher-wrap select { font-size: 13px; max-width: 96px; }
}

/* ── VERY SMALL (≤360px) ── */
@media (max-width: 360px) {
    .stats-grid { grid-template-columns: 1fr; }
    .header { padding: 0 8px; }
}

/* ── TOUCH DEVICES: comfortable targets ── */
@media (hover: none) and (pointer: coarse) {
    .btn, .btn-icon, .nav-item, .page-btn, .btn-logout, .login-submit, .sidebar-logout-btn {
        touch-action: manipulation; -webkit-tap-highlight-color: transparent;
    }
    .btn-icon { min-width: 40px; min-height: 40px; }
    .nav-item { min-height: 48px; }
}

@media (max-width: 768px) {
    .login-card { padding: 38px 26px 32px; }
    .login-title { font-size: 22px; }
}
@media (max-width: 480px) {
    .login-card { padding: 32px 20px 28px; }
}

/* ════════════════════════════════════════════════════════════════════════
   FINANCE AMBIENT BACKGROUND — floating revenue/transaction motion
   Decorative only, sits behind all content, never blocks interaction.
   ════════════════════════════════════════════════════════════════════════ */
.app-container { position: relative; }
.main-content { position: relative; z-index: 1; }
.fin-bg { position: fixed; inset: 0; z-index: 0; overflow: hidden; pointer-events: none; }

.fin-glyph {
    position: absolute; bottom: -10%;
    font-size: 26px; font-weight: 800;
    color: rgba(165, 180, 252, 0.5);
    text-shadow: 0 0 18px rgba(99, 102, 241, 0.5);
    font-family: 'Inter', sans-serif;
    animation: finFloat linear infinite;
    will-change: transform, opacity;
}
.fin-glyph.coin { color: rgba(250, 204, 110, 0.55); text-shadow: 0 0 18px rgba(245, 158, 11, 0.55); }
.fin-glyph.up   { color: rgba(74, 222, 128, 0.55); text-shadow: 0 0 18px rgba(34, 197, 94, 0.55); }

@keyframes finFloat {
    0%   { transform: translateY(0) translateX(0) rotate(0deg); opacity: 0; }
    12%  { opacity: 0.55; }
    50%  { opacity: 0.6; }
    88%  { opacity: 0.3; }
    100% { transform: translateY(-118vh) translateX(var(--drift, 30px)) rotate(var(--rot, 160deg)); opacity: 0; }
}

/* spread the 14 glyphs across the screen with varied size/speed/drift */
.fin-bg .fin-glyph:nth-child(1)  { left: 6%;  font-size: 30px; animation-duration: 19s; animation-delay: 0s;   --drift: 40px;  --rot: 180deg; }
.fin-bg .fin-glyph:nth-child(2)  { left: 14%; font-size: 20px; animation-duration: 24s; animation-delay: -6s;  --drift: -30px; --rot: -140deg; }
.fin-bg .fin-glyph:nth-child(3)  { left: 22%; font-size: 38px; animation-duration: 27s; animation-delay: -12s; --drift: 50px;  --rot: 200deg; }
.fin-bg .fin-glyph:nth-child(4)  { left: 30%; font-size: 24px; animation-duration: 21s; animation-delay: -3s;  --drift: -45px; --rot: 120deg; }
.fin-bg .fin-glyph:nth-child(5)  { left: 38%; font-size: 28px; animation-duration: 30s; animation-delay: -16s; --drift: 35px;  --rot: -180deg; }
.fin-bg .fin-glyph:nth-child(6)  { left: 46%; font-size: 22px; animation-duration: 23s; animation-delay: -9s;  --drift: 55px;  --rot: 160deg; }
.fin-bg .fin-glyph:nth-child(7)  { left: 54%; font-size: 34px; animation-duration: 26s; animation-delay: -2s;  --drift: -40px; --rot: -150deg; }
.fin-bg .fin-glyph:nth-child(8)  { left: 62%; font-size: 21px; animation-duration: 20s; animation-delay: -14s; --drift: 30px;  --rot: 190deg; }
.fin-bg .fin-glyph:nth-child(9)  { left: 70%; font-size: 30px; animation-duration: 28s; animation-delay: -7s;  --drift: -50px; --rot: 140deg; }
.fin-bg .fin-glyph:nth-child(10) { left: 78%; font-size: 26px; animation-duration: 22s; animation-delay: -11s; --drift: 45px;  --rot: -200deg; }
.fin-bg .fin-glyph:nth-child(11) { left: 85%; font-size: 36px; animation-duration: 31s; animation-delay: -4s;  --drift: -35px; --rot: 170deg; }
.fin-bg .fin-glyph:nth-child(12) { left: 91%; font-size: 22px; animation-duration: 25s; animation-delay: -18s; --drift: 40px;  --rot: -130deg; }
.fin-bg .fin-glyph:nth-child(13) { left: 97%; font-size: 28px; animation-duration: 29s; animation-delay: -10s; --drift: -48px; --rot: 210deg; }
.fin-bg .fin-glyph:nth-child(14) { left: 2%;  font-size: 24px; animation-duration: 33s; animation-delay: -20s; --drift: 50px;  --rot: -160deg; }

/* animated "live revenue" bar chart along the bottom */
.fin-bars {
    position: absolute; left: 0; right: 0; bottom: 0;
    height: 160px; display: flex; align-items: flex-end; justify-content: space-around;
    gap: 1.5%; padding: 0 3%; opacity: 0.18;
    mask-image: linear-gradient(to top, #000 10%, transparent 100%);
    -webkit-mask-image: linear-gradient(to top, #000 10%, transparent 100%);
}
.fin-bars span {
    flex: 1; max-width: 46px;
    background: linear-gradient(to top, rgba(99, 102, 241, 0.9), rgba(139, 92, 246, 0.1));
    border-radius: 7px 7px 0 0;
    transform-origin: bottom; transform: scaleY(0.3);
    animation: finBar ease-in-out infinite;
    will-change: transform;
}
@keyframes finBar { 0%, 100% { transform: scaleY(0.22); } 50% { transform: scaleY(1); } }
.fin-bars span:nth-child(1) { height: 70px;  animation-duration: 3.2s; animation-delay: 0s; }
.fin-bars span:nth-child(2) { height: 110px; animation-duration: 4.1s; animation-delay: -0.6s; }
.fin-bars span:nth-child(3) { height: 60px;  animation-duration: 3.6s; animation-delay: -1.2s; }
.fin-bars span:nth-child(4) { height: 130px; animation-duration: 4.6s; animation-delay: -0.3s; }
.fin-bars span:nth-child(5) { height: 90px;  animation-duration: 3.9s; animation-delay: -1.8s; }
.fin-bars span:nth-child(6) { height: 120px; animation-duration: 4.3s; animation-delay: -0.9s; }
.fin-bars span:nth-child(7) { height: 75px;  animation-duration: 3.4s; animation-delay: -2.1s; }
.fin-bars span:nth-child(8) { height: 140px; animation-duration: 4.8s; animation-delay: -1.5s; }
.fin-bars span:nth-child(9) { height: 95px;  animation-duration: 3.7s; animation-delay: -0.4s; }

/* keep the ambient layer calm on small screens */
@media (max-width: 768px) {
    .fin-glyph { font-size: 20px !important; }
    .fin-bars { height: 120px; opacity: 0.14; }
}

/* ── ACCESSIBILITY: reduced motion ── */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.001ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.001ms !important;
        scroll-behavior: auto !important;
    }
}
