:root {
    /* Color Palette - Premium Dark Mode (Red & Black) */
    --bg-main: #000000;
    --bg-panel: #0a0a0a;
    --bg-panel-hover: #111111;
    
    --primary-color: #ef4444; /* Red */
    --primary-hover: #dc2626; /* Darker Red */
    --accent-color: #ef4444; /* Red */
    --accent-hover: #dc2626;
    --danger-color: #b91c1c; /* Deep Red */
    --success-color: #10b981; /* Keep green just for positive money values */
    
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --text-muted: #475569;
    
    --border-color: rgba(255, 255, 255, 0.05);
    --border-highlight: rgba(255, 255, 255, 0.1);
    
    --glass-blur: blur(12px);
    
    /* Typography */
    --font-family: 'Inter', system-ui, -apple-system, sans-serif;
    
    /* Shadows */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.5), 0 2px 4px -1px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.5), 0 4px 6px -2px rgba(0, 0, 0, 0.3);
    --shadow-glow: 0 0 15px rgba(99, 102, 241, 0.3);
    
    /* Transitions */
    --transition-fast: 0.15s ease;
    --transition-normal: 0.3s ease;
}

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

body {
    font-family: var(--font-family);
    background-color: var(--bg-main);
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
    /* Subtle background gradient */
    background-image: 
        radial-gradient(circle at 15% 50%, rgba(99, 102, 241, 0.08), transparent 25%),
        radial-gradient(circle at 85% 30%, rgba(16, 185, 129, 0.05), transparent 25%);
}

/* Typography utilities */
h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    letter-spacing: -0.025em;
    color: var(--text-primary);
}

p {
    color: var(--text-secondary);
    line-height: 1.6;
}

a {
    color: var(--primary-color);
    text-decoration: none;
    transition: color var(--transition-fast);
}

a:hover {
    color: var(--primary-hover);
}

/* Glassmorphism Panel */
.glass-panel {
    background: var(--bg-panel);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    box-shadow: var(--shadow-md);
    transition: all 0.3s ease-in-out;
}

.glass-panel:hover {
    border-color: rgba(255, 255, 255, 0.15);
    box-shadow: 0 15px 35px -5px rgba(0, 0, 0, 0.6), 0 0 15px rgba(239, 68, 68, 0.05);
    transform: translateY(-2px);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.625rem 1.25rem;
    font-size: 0.875rem;
    font-weight: 500;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    transition: all var(--transition-fast);
    gap: 0.5rem;
}

.btn-primary {
    background: var(--primary-color);
    color: white;
    box-shadow: 0 4px 10px rgba(239, 68, 68, 0.2);
    transition: all 0.25s ease-in-out;
}

.btn-primary:hover {
    background: var(--primary-hover);
    transform: translateY(-2px) scale(1.02);
    box-shadow: 0 8px 20px rgba(239, 68, 68, 0.4);
}

.btn-accent {
    background: var(--accent-color);
    color: white;
}

.btn-accent:hover {
    background: var(--accent-hover);
    transform: translateY(-1px);
}

.btn-danger {
    background: transparent;
    border: 1px solid var(--danger-color);
    color: var(--danger-color);
}

.btn-danger:hover {
    background: var(--danger-color);
    color: white;
}

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

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

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

.form-label {
    display: block;
    margin-bottom: 0.5rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-secondary);
}

.form-input {
    width: 100%;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 0.75rem 1rem;
    color: var(--text-primary);
    font-family: var(--font-family);
    transition: all 0.3s ease-in-out;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.1);
}

.form-input:focus {
    outline: none;
    background: rgba(0, 0, 0, 0.4);
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.15), inset 0 2px 4px rgba(0,0,0,0.2);
}

/* Layout */
#app-container {
    display: flex;
    flex: 1;
    height: 100vh;
}

/* Sidebar */
.sidebar {
    width: 260px;
    background: var(--bg-panel);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    transition: width var(--transition-normal), transform var(--transition-normal), opacity var(--transition-normal);
}

.sidebar.collapsed {
    width: 0;
    overflow: hidden;
    opacity: 0;
    border-right: none;
}

.sidebar-logo {
    padding: 1.5rem;
    font-size: 1.5rem;
    font-weight: 700;
    color: white;
    text-align: center;
    border-bottom: 1px solid var(--border-color);
    letter-spacing: 2px;
    text-transform: uppercase;
}

.nav-links {
    list-style: none;
    padding: 1rem;
    flex: 1;
}

.nav-item {
    margin-bottom: 0.5rem;
}

.nav-link {
    display: flex;
    align-items: center;
    padding: 0.75rem 1rem;
    color: var(--text-secondary);
    border-radius: 8px;
    transition: all var(--transition-fast);
    font-weight: 500;
}

.nav-link i {
    margin-right: 1rem;
    font-size: 1.1rem;
    width: 20px;
    text-align: center;
}

.nav-link:hover, .nav-link.active {
    background: rgba(99, 102, 241, 0.1);
    color: var(--primary-color);
}

/* User Info Profile at bottom of sidebar */
.sidebar-user {
    padding: 1.5rem 1rem;
    border-top: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    gap: 1rem;
}

.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--primary-color);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    color: white;
}

.user-details {
    flex: 1;
    overflow: hidden;
}

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

.user-balance {
    font-size: 0.75rem;
    color: var(--accent-color);
    font-weight: 600;
}

/* Main Content */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}

.topbar {
    height: 70px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 2rem;
    backdrop-filter: blur(10px);
    position: sticky;
    top: 0;
    z-index: 10;
}

.page-title {
    font-size: 1.25rem;
    font-weight: 600;
}

.topbar-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.user-profile-top {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding-left: 1rem;
    border-left: 1px solid var(--border-color);
}

.user-profile-top .user-details {
    flex: initial;
    overflow: visible;
}

.content-wrapper {
    padding: 2rem;
    flex: 1;
}

/* Table Styles */
.table-container {
    width: 100%;
    overflow-x: auto;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
}

.data-table th {
    padding: 1rem;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-secondary);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    background: var(--bg-panel);
    z-index: 2;
    white-space: nowrap;
}

.data-table td {
    padding: 1rem;
    font-size: 0.875rem;
    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);
}

/* Badges */
.badge {
    padding: 0.3rem 0.6rem;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(4px);
    border: 1px solid transparent;
}
.badge-success { background: rgba(16, 185, 129, 0.15); color: #34d399; border-color: rgba(16, 185, 129, 0.3); }
.badge-warning { background: rgba(245, 158, 11, 0.15); color: #fbbf24; border-color: rgba(245, 158, 11, 0.3); }
.badge-danger { background: rgba(239, 68, 68, 0.15); color: #f87171; border-color: rgba(239, 68, 68, 0.3); }
.badge-outline { background: transparent; color: var(--primary-color); border-color: var(--primary-color); }
.badge-dark { background: rgba(255, 255, 255, 0.05); color: var(--text-secondary); border-color: rgba(255, 255, 255, 0.1); }

/* Table Rows Modernization */
.hover-row {
    transition: all 0.2s ease-in-out;
}
.hover-row:hover {
    background: rgba(255, 255, 255, 0.04);
    transform: scale(1.005);
    box-shadow: inset 0 0 10px rgba(0,0,0,0.5);
}

/* Animations */
@keyframes pulse {
    0% { opacity: 0.6; transform: scale(0.98); }
    50% { opacity: 1; transform: scale(1); }
    100% { opacity: 0.6; transform: scale(0.98); }
}
.pulse-anim {
    animation: pulse 2s infinite ease-in-out;
}

/* Grid Layouts */
.grid-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
}

.stat-card {
    padding: 1.5rem;
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.stat-icon {
    width: 50px;
    height: 50px;
    border-radius: 12px;
    background: rgba(99, 102, 241, 0.1);
    color: var(--primary-color);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

.stat-info h4 {
    color: var(--text-secondary);
    font-size: 0.875rem;
    margin-bottom: 0.25rem;
}

.stat-info p {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
}

/* Auth Screens */
.auth-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100vh;
    width: 100vw;
}

.auth-box {
    width: 100%;
    max-width: 400px;
    padding: 2.5rem;
}

.auth-header {
    text-align: center;
    margin-bottom: 2rem;
}

.auth-header h2 {
    font-size: 1.75rem;
    margin-bottom: 0.5rem;
}

.auth-switch {
    text-align: center;
    margin-top: 1.5rem;
    font-size: 0.875rem;
}

/* Hide pages logically */
.page {
    display: none;
    animation: fadeIn var(--transition-normal);
}

.page.active {
    display: block;
}

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

/* Toast Notifications */
#toast-container {
    position: fixed;
    top: 2rem;
    right: 2rem;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.toast {
    background: var(--bg-panel);
    border-left: 4px solid var(--primary-color);
    padding: 1rem 1.5rem;
    border-radius: 8px;
    box-shadow: var(--shadow-lg);
    color: var(--text-primary);
    font-size: 0.875rem;
    animation: slideInRight 0.3s ease forwards;
}

.toast.error { border-color: var(--danger-color); }
.toast.success { border-color: var(--accent-color); }

@keyframes slideInRight {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

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

/* Responsive - Strict Mobile Experience */
@media (max-width: 768px) {
    .mobile-menu-btn {
        display: block;
    }
    .desktop-menu-btn {
        display: none !important;
    }
    /* Layout Adjustments */
    .content-wrapper {
        padding: 16px !important;
    }
    .topbar {
        padding: 0 16px;
    }
    
    /* Typography & Legibility */
    html {
        font-size: 15px; /* Base size slightly larger for mobile */
    }
    
    /* Buttons */
    .btn {
        min-height: 48px;
        width: 100%;
        margin-bottom: 0.5rem;
    }
    .topbar-actions .btn {
        width: auto;
        min-height: 40px;
    }
    .page-btn {
        width: auto; /* keep pagination small */
    }
    
    /* Inputs */
    .form-input {
        min-height: 48px;
        margin-bottom: 1rem;
        font-size: 1rem; /* Prevent iOS zoom */
    }
    
    /* Cards */
    .glass-panel {
        width: 100% !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
        padding: 1.5rem 1rem !important;
    }
    .grid-cards {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    #deposit-wizard-container > div {
        max-width: 100% !important;
    }
    
    /* Tables - Horizontal Scroll */
    .table-container {
        width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        border-radius: 8px;
    }
    .data-table {
        min-width: 600px; /* Force scroll */
    }
    
    /* Grid overrides */
    div[style*="grid-template-columns"] {
        grid-template-columns: 1fr !important;
    }
    
    /* Sidebar / Drawer Navigation */
    .sidebar {
        position: fixed;
        top: 0;
        left: -280px;
        width: 280px;
        height: 100vh;
        z-index: 1000;
        box-shadow: 5px 0 25px rgba(0,0,0,0.8);
        transition: transform 0.3s ease-in-out;
    }
    .sidebar.open {
        transform: translateX(280px);
    }
    
    /* Mobile Overlay */
    body.menu-open {
        overflow: hidden;
    }
    body.menu-open::before {
        content: '';
        position: fixed;
        top: 0;
        left: 0;
        width: 100vw;
        height: 100vh;
        background: rgba(0, 0, 0, 0.7);
        backdrop-filter: blur(3px);
        z-index: 999;
        animation: fadeIn 0.3s ease forwards;
    }
    
    /* QR Code and Images */
    #invoice-qr {
        width: 200px !important;
        height: 200px !important;
        margin: 0 auto;
    }
    
    /* Interactivity */
    .btn:active, .glass-panel:active, .hover-row:active {
        transform: scale(0.98);
        opacity: 0.9;
    }
    
    /* Auth Screens */
    .auth-box {
        padding: 1.5rem;
    }
}

/* Finance & Stock Admin SPA Tabs */
.fin-nav-btn, .stock-nav-btn {
    white-space: nowrap;
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-muted);
}
.fin-nav-btn.active, .stock-nav-btn.active {
    background: var(--accent-color);
    color: #fff;
    border-color: var(--accent-color);
}
.fin-subtab, .stock-subtab, .settings-subtab {
    display: none;
    animation: fadeIn 0.3s ease;
}
.fin-subtab.active, .stock-subtab.active, .settings-subtab.active {
    display: block;
}

/* Animated Toggle Button */
.toggle-btn {
    width: 80px;
    padding: 0.5rem;
    border-radius: 20px;
    border: none;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    color: white;
}
.toggle-btn.on {
    background-color: var(--success-color);
}
.toggle-btn.off {
    background-color: var(--danger-color);
}

/* Marketplace Redesign */
.marketplace-table {
    width: 100%;
    border-collapse: collapse;
}
.marketplace-table th {
    text-align: left;
    padding: 1rem;
    color: var(--text-muted);
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-bottom: 1px solid var(--border-color);
    background: transparent;
}
.marketplace-table td {
    padding: 1rem;
    vertical-align: middle;
    border-bottom: 1px solid var(--border-color);
    background: transparent;
    font-size: 0.9rem;
}
.marketplace-table tr:last-child td {
    border-bottom: none;
}
.marketplace-table tr:hover td {
    background: rgba(255, 255, 255, 0.02);
}

/* Badges */
.badge {
    display: inline-block;
    padding: 0.2rem 0.5rem;
    border-radius: 12px;
    font-size: 0.65rem;
    font-weight: 600;
    text-transform: uppercase;
    margin-right: 0.3rem;
    margin-bottom: 0.3rem;
    letter-spacing: 0.02em;
}
.badge-dark {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-secondary);
}
.badge-visa {
    background: rgba(255, 255, 255, 0.05);
    color: #fff;
}
.badge-mc {
    background: rgba(255, 255, 255, 0.05);
    color: #10b981; /* Green text as per user screenshot for MC */
}
.badge-amex {
    background: rgba(255, 255, 255, 0.05);
    color: #10b981;
}

/* Pagination Buttons */
.page-btn {
    padding: 0.4rem 0.8rem;
    font-size: 0.85rem;
    border-radius: 4px;
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s ease;
}
.page-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

/* Custom Buy Button */
.btn-buy {
    background: #fff;
    color: #000;
    font-weight: 600;
    padding: 0.4rem 1rem;
    border-radius: 6px;
    font-size: 0.85rem;
    border: none;
    cursor: pointer;
    transition: background 0.2s ease;
}
.btn-buy:hover {
    background: #e2e8f0;
}

/* User Panel Modern UI */
.data-table tbody tr {
    transition: background 0.2s ease, transform 0.1s ease;
}
.data-table tbody tr:hover {
    background: rgba(255, 255, 255, 0.03);
}

.badge-admin {
    background: rgba(225, 29, 72, 0.15);
    color: #e11d48;
    border: 1px solid rgba(225, 29, 72, 0.3);
}

.badge-user {
    background: rgba(148, 163, 184, 0.15);
    color: #94a3b8;
    border: 1px solid rgba(148, 163, 184, 0.3);
}

.badge-finance-pos {
    background: rgba(16, 185, 129, 0.1);
    color: #10b981;
}

.badge-finance-zero {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-secondary);
}

/* Dropdown Menu */
.dropdown-container {
    position: relative;
    display: inline-block;
}

.dropdown-btn {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 0.4rem 0.8rem;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.85rem;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.dropdown-btn:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: var(--text-secondary);
}

.dropdown-menu {
    position: absolute;
    right: 0;
    top: calc(100% + 5px);
    background: #111;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    min-width: 160px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.5);
    z-index: 100;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    padding: 0.4rem;
    display: flex;
    flex-direction: column;
}

.dropdown-menu.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-item {
    background: transparent;
    border: none;
    color: var(--text-primary);
    padding: 0.6rem 0.8rem;
    text-align: left;
    font-size: 0.85rem;
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.dropdown-item:hover {
    background: rgba(255, 255, 255, 0.05);
}

.dropdown-item.danger {
    color: var(--danger-color);
}
.dropdown-item.danger:hover {
    background: rgba(239, 68, 68, 0.1);
}

/* Modal Animations */
@keyframes modalFadeIn {
    from { opacity: 0; transform: scale(0.95); }
    to { opacity: 1; transform: scale(1); }
}

.modal .glass-panel, .modal .modal-content {
    animation: modalFadeIn 0.2s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* SaaS Dashboard Tokens */
:root {
    --glass-bg: rgba(255, 255, 255, 0.03);
    --glass-border: rgba(255, 255, 255, 0.05);
    --glass-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.3);
}

.kpi-card {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    padding: 1.2rem;
    box-shadow: var(--glass-shadow);
    backdrop-filter: blur(4px);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}
.kpi-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 40px 0 rgba(0, 0, 0, 0.5);
    border-color: rgba(255, 255, 255, 0.1);
}
.kpi-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.8rem;
}
.kpi-title {
    color: var(--text-secondary);
    font-size: 0.85rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
.kpi-value {
    font-size: 1.8rem;
    font-weight: 700;
    color: #fff;
    font-family: monospace;
}
.kpi-trend {
    font-size: 0.75rem;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    font-weight: bold;
}
.kpi-trend.positive { background: rgba(16, 185, 129, 0.1); color: #10b981; }
.kpi-trend.neutral { background: rgba(148, 163, 184, 0.1); color: #94a3b8; }

.btn-ghost {
    background: transparent !important;
    color: var(--text-secondary) !important;
    border: none !important;
}
.btn-ghost:hover {
    background: rgba(255,255,255,0.05) !important;
    color: #fff !important;
}
.btn-ghost.active {
    background: rgba(255,255,255,0.1) !important;
    color: #fff !important;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2) !important;
}

.ranking-list {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
}
.ranking-item {
    display: flex;
    align-items: center;
    background: rgba(0,0,0,0.2);
    padding: 0.8rem 1rem;
    border-radius: 8px;
    border: 1px solid rgba(255,255,255,0.02);
    transition: background 0.2s ease;
}
.ranking-item:hover {
    background: rgba(255,255,255,0.05);
}
.ranking-pos {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 0.8rem;
    margin-right: 1rem;
    background: rgba(255,255,255,0.1);
    color: var(--text-secondary);
}
.ranking-pos.top-1 { background: linear-gradient(135deg, #f59e0b, #d97706); color: #fff; box-shadow: 0 0 10px rgba(245, 158, 11, 0.3); }
.ranking-pos.top-2 { background: linear-gradient(135deg, #94a3b8, #64748b); color: #fff; }
.ranking-pos.top-3 { background: linear-gradient(135deg, #b45309, #78350f); color: #fff; }

.ranking-info { flex: 1; }
.ranking-name { font-weight: 600; color: #fff; font-size: 0.95rem; }
.ranking-val { font-family: monospace; font-weight: bold; color: #10b981; font-size: 1rem; }

@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}
.fade-in-up {
    animation: fadeInUp 0.4s ease forwards;
}

.skeleton-text {
    background: linear-gradient(90deg, rgba(255,255,255,0.05) 25%, rgba(255,255,255,0.1) 50%, rgba(255,255,255,0.05) 75%);
    background-size: 200% 100%;
    animation: skeletonLoading 1.5s infinite;
    border-radius: 4px;
}
@keyframes skeletonLoading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

.switch-premium { position: relative; display: inline-block; width: 50px; height: 26px; }
.switch-premium input { opacity: 0; width: 0; height: 0; }
.switch-slider { position: absolute; cursor: pointer; top: 0; left: 0; right: 0; bottom: 0; background-color: rgba(255,255,255,0.1); transition: .4s; border-radius: 34px; border: 1px solid rgba(255,255,255,0.2); }
.switch-slider:before { position: absolute; content: ''; height: 18px; width: 18px; left: 4px; bottom: 3px; background-color: var(--text-secondary); transition: .4s; border-radius: 50%; box-shadow: 0 2px 4px rgba(0,0,0,0.2); }
input:checked + .switch-slider { background-color: var(--danger-color); border-color: var(--danger-color); }
input:checked + .switch-slider:before { transform: translateX(24px); background-color: #fff; }

.stat-card-1 { border-left: 4px solid #ef4444 !important; box-shadow: -4px 0 15px rgba(239, 68, 68, 0.1); }
.stat-card-2 { border-left: 4px solid #f59e0b !important; box-shadow: -4px 0 15px rgba(245, 158, 11, 0.1); }
.stat-card-3 { border-left: 4px solid #10b981 !important; box-shadow: -4px 0 15px rgba(16, 185, 129, 0.1); }
.stat-card-4 { border-left: 4px solid #3b82f6 !important; box-shadow: -4px 0 15px rgba(59, 130, 246, 0.1); }

/* Animation for the emojis in the finance nav */
.fin-nav-btn { transition: all 0.3s ease; display: inline-flex; align-items: center; gap: 0.5rem; }
.fin-nav-btn:hover span.emoji-icon { transform: scale(1.2) rotate(5deg) translateY(-2px); text-shadow: 0 4px 8px rgba(0,0,0,0.3); }
span.emoji-icon { transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275); display: inline-block; }

.spinner {
    border: 4px solid rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    border-top: 4px solid var(--primary-color);
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Custom Context Menu */
.context-menu {
    position: fixed;
    background-color: #121212;
    border-radius: 12px;
    padding: 8px;
    width: 220px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.8);
    z-index: 10000;
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-family: 'Inter', sans-serif;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.context-menu-header {
    font-size: 0.75rem;
    color: #6b7280;
    padding: 8px 12px;
    display: flex;
    align-items: center;
    font-weight: 700;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.context-menu-item {
    display: flex;
    align-items: center;
    padding: 8px 12px;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.2s ease;
    color: #e5e7eb;
}

.context-menu-item:hover {
    background: rgba(255, 255, 255, 0.08);
}

.context-menu-icon {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    margin-right: 12px;
    font-size: 0.95rem;
}

.context-menu-text {
    flex: 1;
    font-size: 0.9rem;
    font-weight: 600;
}

.context-menu-shortcut {
    font-size: 0.75rem;
    color: #6b7280;
    font-weight: 600;
}

.context-menu-footer {
    margin-top: 4px;
    padding-top: 8px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    text-align: center;
}

.context-menu-footer i {
    font-size: 0.85rem;
    color: #ffffff;
    font-weight: 900;
    font-style: italic;
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.5);
}

.sortable-header { cursor: pointer; user-select: none; transition: color 0.2s; }
.sortable-header:hover { color: var(--primary-color); }

/* Premium User Edit Modal Styles */
.custom-scrollbar::-webkit-scrollbar {
    width: 6px;
}
.custom-scrollbar::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.02);
    border-radius: 10px;
}
.custom-scrollbar::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
}
.custom-scrollbar::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.2);
}

.premium-input:focus {
    outline: none;
    border-color: #3b82f6 !important;
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2) !important;
}

.quick-add-btn:hover {
    background: rgba(16, 185, 129, 0.2) !important;
    transform: translateY(-1px);
}
.quick-add-btn:active {
    transform: scale(0.95);
}

.edit-user-panel {
    animation: premiumModalSlideUp 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes premiumModalSlideUp {
    from { opacity: 0; transform: scale(0.95) translateY(10px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

@media (max-width: 900px) {
    .finance-charts-grid {
        grid-template-columns: 1fr !important;
    }
}



/* Global Scrollbar Settings */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}
::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 4px;
}
::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    transition: background 0.3s ease;
}
::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.2);
}
/* For Firefox */
* {
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.1) rgba(0, 0, 0, 0.2);
}


/* Enhanced Form Inputs & Selects */
.form-input, .form-select {
    background-color: rgba(0, 0, 0, 0.4) !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    border-radius: 8px !important;
    padding: 0.5rem 1rem !important;
    color: #fff !important;
    transition: all 0.3s ease !important;
    font-family: inherit;
}
.form-input:focus, .form-select:focus {
    border-color: var(--accent-color) !important;
    box-shadow: 0 0 0 2px rgba(220, 38, 38, 0.2) !important;
    outline: none !important;
}
.form-select {
    appearance: none;
    background-image: url('data:image/svg+xml;charset=US-ASCII,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%22292.4%22%20height%3D%22292.4%22%3E%3Cpath%20fill%3D%22%23FFFFFF%22%20d%3D%22M287%2069.4a17.6%2017.6%200%200%200-13-5.4H18.4c-5%200-9.3%201.8-12.9%205.4A17.6%2017.6%200%200%200%200%2082.2c0%205%201.8%209.3%205.4%2012.9l128%20127.9c3.6%203.6%207.8%205.4%2012.8%205.4s9.2-1.8%2012.8-5.4L287%2095c3.5-3.5%205.4-7.8%205.4-12.8%200-5-1.9-9.2-5.5-12.8z%22%2F%3E%3C%2Fsvg%3E') !important;
    background-repeat: no-repeat !important;
    background-position: right 1rem top 50% !important;
    background-size: 0.65rem auto !important;
    padding-right: 2.5rem !important;
}
.form-select option {
    background-color: #111 !important;
    color: #fff !important;
}

/* Fix search inputs */
input[id$='search'] { padding-left: 2.8rem !important; }


/* Modern Dropdown */
.dropdown-menu {
    position: absolute;
    background: rgba(20, 20, 25, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    padding: 0.5rem;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
    display: none;
    z-index: 100;
    min-width: 140px;
    animation: fadeInDown 0.2s ease-out forwards;
}
.dropdown-menu.show {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}
.dropdown-item {
    background: transparent;
    border: none;
    padding: 0.6rem 1rem;
    color: var(--text-secondary);
    cursor: pointer;
    text-align: left;
    font-size: 0.85rem;
    border-radius: 6px;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 500;
}
.dropdown-item:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
    transform: translateX(2px);
}
@keyframes fadeInDown {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Premium Affiliate Admin Styles */
.stat-card-premium {
    position: relative;
    overflow: hidden;
}
.stat-card-premium:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0,0,0,0.5), inset 0 0 0 1px rgba(255,255,255,0.1);
}

/* Modern Switch Toggle */
.switch-modern {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
}
.switch-modern input {
    opacity: 0;
    width: 0;
    height: 0;
}
.slider-modern {
    position: absolute;
    cursor: pointer;
    top: 0; left: 0; right: 0; bottom: 0;
    background-color: rgba(255,255,255,0.1);
    transition: .4s;
    border-radius: 24px;
    border: 1px solid rgba(255,255,255,0.05);
}
.slider-modern:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 2px;
    bottom: 2px;
    background-color: #fff;
    transition: .4s;
    border-radius: 50%;
    box-shadow: 0 2px 5px rgba(0,0,0,0.3);
}
.switch-modern input:checked + .slider-modern {
    background-color: #6366f1;
    border-color: #6366f1;
    box-shadow: 0 0 15px rgba(99, 102, 241, 0.4);
}
.switch-modern input:checked + .slider-modern:before {
    transform: translateX(20px);
}
