:root {
    --bg-color: #0f172a;
    --glass-bg: rgba(30, 41, 59, 0.7);
    --glass-border: rgba(255, 255, 255, 0.05);
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --primary: #6366f1;
    --primary-hover: #4f46e5;
    --accent: #10b981;
    --danger: #ef4444;
    --warning: #f59e0b;
    --danger-bg: rgba(239, 68, 68, 0.2);
    --accent-bg: rgba(16, 185, 129, 0.2);
    
    --purple: #8b5cf6;
    --blue: #3b82f6;
    --sidebar-width: 250px;
    --terminal-bg: #0b0f19;
    --emerald: #10b981;
    --rose: #f43f5e;
}

/* Custom Scrollbar for Premium Feel */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.1);
}
::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
}
::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.2);
}

.terminal-window {
    background: var(--terminal-bg);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 12px;
    box-shadow: 0 20px 50px rgba(0,0,0,0.5);
    overflow: hidden;
}

.terminal-header {
    background: rgba(255,255,255,0.05);
    padding: 10px 15px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    display: flex;
    gap: 8px;
    align-items: center;
}

.dot { width: 12px; height: 12px; border-radius: 50%; }
.dot-red { background: #ff5f56; }
.dot-yellow { background: #ffbd2e; }
.dot-green { background: #27c93f; }

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', sans-serif;
}

html, body {
    max-width: 100vw;
    overflow-x: hidden;
    position: relative;
}

body {
    background-color: var(--bg-color);
    color: var(--text-primary);
    min-height: 100vh;
    background-image: 
        radial-gradient(at 0% 0%, rgba(99, 102, 241, 0.15) 0, transparent 50%), 
        radial-gradient(at 100% 100%, rgba(139, 92, 246, 0.15) 0, transparent 50%);
    background-attachment: fixed;
}

h1, h2, h3, h4, h5, h6 {
    font-family: 'Outfit', sans-serif;
}

.glass {
    background: rgba(30, 41, 59, 0.4);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.3);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.glass:hover {
    background: rgba(30, 41, 59, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
    box-shadow: 0 12px 40px 0 rgba(0, 0, 0, 0.4);
}

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

.stat-card {
    animation: slideUp 0.5s ease forwards;
    animation-delay: calc(var(--i) * 0.1s);
    opacity: 0;
}

.dashboard-container {
    display: flex;
    min-height: 100vh;
    max-width: 100vw;
    overflow-x: hidden;
    position: relative;
}

/* Sidebar */
.sidebar {
    width: var(--sidebar-width);
    background: rgba(15, 23, 42, 0.6);
    border-right: 1px solid var(--glass-border);
    padding: 2rem 1.5rem;
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
    z-index: 10;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 3rem;
}

.logo i {
    font-size: 1.8rem;
    color: var(--primary);
}

.logo h2 {
    font-size: 1.5rem;
    font-weight: 800;
    background: linear-gradient(135deg, #fff, #94a3b8);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.nav-menu {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    flex: 1;
}

.nav-menu a {
    color: var(--text-secondary);
    text-decoration: none;
    padding: 0.875rem 1rem;
    border-radius: 12px;
    display: flex;
    align-items: center;
    gap: 1rem;
    font-weight: 600;
    transition: all 0.3s ease;
}

.nav-menu a i {
    font-size: 1.1rem;
    width: 20px;
    text-align: center;
}

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

.status-indicator {
    margin-top: auto;
    padding: 1rem;
    background: rgba(16, 185, 129, 0.1);
    border-radius: 12px;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    color: var(--accent);
    font-weight: 600;
}

.status-indicator.live .dot {
    width: 8px;
    height: 8px;
    background: var(--accent);
    border-radius: 50%;
    box-shadow: 0 0 8px var(--accent);
    animation: blink 2s infinite;
}

@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}

/* Mobile Header (Hidden by default) */
.mobile-header {
    display: none;
    align-items: center;
    justify-content: space-between;
    padding: 15px 20px;
    background: rgba(15, 23, 42, 0.95);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--glass-border);
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1030;
}

.mobile-header .logo { margin-bottom: 0; }
.mobile-header .logo h2 { font-size: 1.2rem; }

/* Sidebar Overlay */
.sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.7);
    z-index: 1040;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}
.sidebar-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

/* Main Content */
.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    padding: 2rem 3rem;
}

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

header h1 {
    font-size: 2rem;
    font-weight: 600;
    color: #fff;
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 1rem;
    background: var(--glass-bg);
    padding: 0.5rem 1rem 0.5rem 0.5rem;
    border-radius: 50px;
    border: 1px solid var(--glass-border);
}

.user-profile img {
    width: 40px;
    height: 40px;
    border-radius: 50%;
}

.user-profile span {
    font-weight: 600;
    font-size: 0.9rem;
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2.5rem;
}

.stat-card {
    padding: 1.5rem;
    display: flex;
    align-items: center;
    gap: 1.25rem;
    transition: transform 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-5px);
}

.stat-icon {
    width: 56px;
    height: 56px;
    border-radius: 16px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.5rem;
}

.u-blue { background: rgba(59, 130, 246, 0.2); color: var(--blue); }
.u-purple { background: rgba(139, 92, 246, 0.2); color: var(--purple); }
.u-green { background: rgba(16, 185, 129, 0.2); color: var(--accent); }
.u-orange { background: rgba(245, 158, 11, 0.2); color: var(--warning); }

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

.stat-details h3 {
    font-size: 1.5rem;
    color: #fff;
}

/* Tables */
.content-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
}

.data-section {
    padding: 1.5rem;
}

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

.section-header h2 {
    font-size: 1.25rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.table-wrapper {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th, td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

th {
    color: var(--text-secondary);
    font-weight: 600;
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

td {
    font-size: 0.95rem;
}

tbody tr {
    transition: background-color 0.2s;
}

tbody tr:hover {
    background-color: rgba(255, 255, 255, 0.02);
}

.fw-bold {
    font-weight: 600;
    color: #fff;
}

.text-center {
    text-align: center;
    color: var(--text-secondary);
    padding: 2rem;
}

/* Badges */
.badge {
    padding: 0.25rem 0.75rem;
    border-radius: 50px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.badge-active { background: var(--accent-bg); color: var(--accent); border: 1px solid var(--accent); }
.badge-inactive { background: rgba(148, 163, 184, 0.1); color: var(--text-secondary); border: 1px solid var(--text-secondary); }

.badge-buy { background: var(--accent-bg); color: var(--accent); }
.badge-sell { background: var(--danger-bg); color: var(--danger); }

.badge-pending { background: rgba(245, 158, 11, 0.1); color: var(--warning); border: 1px solid var(--warning); }
.badge-accepted { background: var(--accent-bg); color: var(--accent); border: 1px solid var(--accent); }
.badge-declined { background: var(--danger-bg); color: var(--danger); border: 1px solid var(--danger); }
.badge-executed { background: rgba(99, 102, 241, 0.1); color: var(--primary); border: 1px solid var(--primary); }

/* Confidence Bar */
.confidence-bar {
    width: 60px;
    height: 6px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
    overflow: hidden;
    display: inline-block;
    vertical-align: middle;
    margin-right: 0.5rem;
}

.confidence-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), var(--purple));
    border-radius: 3px;
}

.confidence-text {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

/* Responsive */
@media (max-width: 1024px) {
    .mobile-header { display: flex !important; }
    
    .sidebar { 
        position: fixed;
        left: -280px;
        top: 0;
        bottom: 0;
        width: 280px;
        transition: left 0.3s ease;
        z-index: 1050;
        padding: 2rem 1.5rem;
        align-items: stretch;
        background: #0f172a; /* Solid background for mobile */
        border-right: 1px solid var(--glass-border);
    }
    
    .sidebar.active {
        left: 0;
    }
    
    .logo h2, .nav-menu a span, .status-indicator { display: flex; }
    .nav-menu a { justify-content: flex-start; }
    
    .desktop-profile { display: none !important; }
    .mobile-profile { display: block !important; }
    
    .main-content { 
        margin-left: 0; 
        padding: 85px 15px 20px 15px; 
    }
    
    .stats-grid { 
        display: flex;
        overflow-x: auto;
        padding-bottom: 1rem;
        gap: 1rem;
        scroll-snap-type: x mandatory;
        -webkit-overflow-scrolling: touch;
    }
    
    .stats-grid::-webkit-scrollbar {
        height: 4px;
    }
    .stats-grid::-webkit-scrollbar-track {
        background: rgba(255, 255, 255, 0.05);
        border-radius: 4px;
    }
    .stats-grid::-webkit-scrollbar-thumb {
        background: rgba(255, 255, 255, 0.2);
        border-radius: 4px;
    }
    
    .stat-card {
        padding: 1rem;
        gap: 0.75rem;
    }
    
    .stat-card .stat-icon {
        min-width: 36px;
        width: 36px;
        height: 36px;
        font-size: 1.1rem;
    }
    
    .stat-card .stat-details h3 {
        font-size: 1.1rem !important;
    }
    
    .stat-card .stat-details p {
        font-size: 0.8rem !important;
    }
    
    header { 
        flex-direction: column; 
        align-items: flex-start; 
        gap: 1rem; 
        margin-bottom: 1.5rem;
    }

    header h1 { font-size: 1.5rem; }
    
    .data-section { padding: 1rem; }
    
    /* Responsive Content Grids & Tables */
    .table-wrapper, .table-responsive, .dataTables_wrapper {
        border-radius: 8px;
        max-width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        display: block;
        width: 100%;
    }
    
    th, td {
        white-space: nowrap;
        padding: 0.75rem;
    }
}

/* DataTables Global Theming for Dark Mode */
.dataTables_wrapper .dataTables_filter label,
.dataTables_wrapper .dataTables_length label,
.dataTables_wrapper .dataTables_info,
.dataTables_wrapper .dataTables_paginate .paginate_button {
    color: #fff !important;
}
.dataTables_wrapper .dataTables_filter input {
    color: #fff !important;
    background-color: rgba(255, 255, 255, 0.1) !important;
    border: 1px solid rgba(255, 255, 255, 0.2) !important;
    border-radius: 5px;
    padding: 0.2rem 0.5rem;
}
