/**
 * TTT Trading Platform - Dashboard Styles
 * Version: 1.0
 */

:root {
    --black: #000000;
    --white: #ffffff;
    --gray-100: #f5f5f5;
    --gray-200: #e5e5e5;
    --gray-300: #d4d4d4;
    --gray-400: #a3a3a3;
    --gray-500: #737373;
    --gray-600: #525252;
    --gray-700: #404040;
    --gray-800: #262626;
    --gray-900: #171717;
    --gray-950: #0a0a0f;
    --orange: #f18206;
    --orange-dim: #ea580c;
    --orange-light: #ff8c00;
    --red: #ef4444;
    --red-dim: #dc2626;
    --blue: #3b82f6;
    --green: #22c55e;
    --green-dim: #16a34a;
    --purple: #8b5cf6;
    --border: rgba(255, 255, 255, 0.08);
    --border-light: rgba(255, 255, 255, 0.12);
    --glass-bg: rgba(15, 16, 20, 0.6);
    --glass-border: rgba(255, 255, 255, 0.05);
    /* Dark mode defaults */
    --text-primary: #ffffff;
    --text-secondary: #e5e5e5;
    --text-muted: #a3a3a3;
    --bg-secondary: var(--gray-950);
}

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

html {
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: 'Roboto', -apple-system, BlinkMacSystemFont, sans-serif;
    background-color: var(--black);
    color: var(--white);
    min-height: 100vh;
    line-height: 1.5;
    overflow-x: hidden;
    overflow-y: auto;
}

/* Layout */
.app {
    display: flex;
    min-height: 100vh;
}

/* Sidebar - Now static positioned for proper flex layout */

.sidebar-header {
    padding: 24px;
    border-bottom: 1px solid var(--border);
}

.logo {
    font-size: 1.25rem;
    font-weight: 500;
    letter-spacing: -0.02em;
    display: flex;
    align-items: center;
    gap: 8px;
}

.logo-mark {
    width: 24px;
    height: 24px;
    border-radius: 4px;
    background: linear-gradient(135deg, var(--orange), var(--orange-light));
}

.logo-image {
    width: 100px;
    height: 30px;
    object-fit: contain;
    margin-right: 8px;
}

.nav {
    flex: 1;
    padding: 16px 12px;
    overflow-y: auto;
}

.nav-section {
    margin-bottom: 24px;
}

.nav-label {
    font-size: 0.6875rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--gray-500);
    padding: 8px 12px;
    font-weight: 500;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: 8px;
    color: var(--gray-400);
    text-decoration: none;
    font-size: 0.875rem;
    transition: all 0.15s ease;
    cursor: pointer;
}

.nav-item:hover {
    color: var(--white);
    background: rgba(255, 255, 255, 0.04);
}

.nav-item.active {
    color: var(--white);
    background: rgba(241, 130, 6, 0.1);
    border-left: 3px solid var(--orange);
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.1);
}

.nav-item svg {
    width: 18px !important;
    height: 18px !important;
    opacity: 0.7;
}

.nav-item.active svg {
    opacity: 1;
    color: var(--orange);
}

.nav-new-tag {
    background: linear-gradient(135deg, var(--orange), var(--orange-light));
    color: var(--black);
    font-size: 0.625rem;
    font-weight: 600;
    padding: 2px 6px;
    border-radius: 10px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-left: auto;
}

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

.user-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border);
}

.user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--gray-700), var(--gray-800));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.875rem;
    font-weight: 500;
}

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

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

.user-email {
    font-size: 0.75rem;
    color: var(--gray-500);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Main Content */
.main {
    flex: 1;
    min-height: 100vh;
    overflow-y: auto;
}

/* Ensure main content areas can scroll */
main.flex-1 {
    overflow-y: auto;
}

.header {
    position: sticky;
    top: 0;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border);
    z-index: 50;
    padding: 12px 32px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: nowrap;
    min-height: 60px;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 24px;
}

.breadcrumb {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.875rem;
    color: var(--gray-500);
}

.breadcrumb-separator {
    color: var(--gray-700);
}

.breadcrumb-current {
    color: var(--white);
}

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

/* Header Search Styles */
.header-search {
    position: relative;
    z-index: 10;
}

.search-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.search-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    width: 16px;
    height: 16px;
    color: #a3a3a3;
    pointer-events: none;
    z-index: 2;
}

.search-input {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 24px;
    padding: 10px 16px 10px 44px;
    color: #ffffff;
    font-size: 0.875rem;
    width: 280px;
    transition: all 0.2s ease;
    box-sizing: border-box;
}

.search-input:focus {
    outline: none;
    border-color: #f18206;
    background: rgba(255, 255, 255, 0.12);
    box-shadow: 0 0 0 3px rgba(241, 130, 6, 0.2);
}

.search-input::placeholder {
    color: #737373;
}

.header-badge {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: rgba(241, 130, 6, 0.1);
    border: 1px solid rgba(241, 130, 6, 0.2);
    border-radius: 100px;
    font-size: 0.75rem;
    color: var(--orange);
    font-weight: 500;
}

.header-badge-dot {
    width: 6px;
    height: 6px;
    background: var(--orange);
    border-radius: 50%;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

@keyframes pulse-slow {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}

.animate-pulse-slow {
    animation: pulse-slow 3s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

.icon-btn {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: transparent;
    color: var(--gray-400);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.15s ease;
}

.icon-btn:hover {
    background: rgba(255, 255, 255, 0.04);
    color: var(--white);
    border-color: var(--border-light);
}

.icon-btn svg {
    width: 18px !important;
    height: 18px !important;
}

.notification-bell {
    position: relative;
    cursor: pointer;
    text-decoration: none;
}

.notification-badge {
    position: absolute;
    top: -8px;
    right: -8px;
    background: var(--red);
    color: var(--white);
    border-radius: 10px;
    padding: 2px 6px;
    font-size: 0.625rem;
    font-weight: 500;
    min-width: 16px;
    text-align: center;
}

.account-selector {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: var(--gray-950);
    border: 1px solid var(--border);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.15s ease;
}

.account-selector:hover {
    border-color: var(--border-light);
}

.account-selector-info {
    text-align: right;
}

.account-selector-label {
    font-size: 0.6875rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--gray-500);
}

.account-selector-value {
    font-size: 0.9375rem;
    font-weight: 500;
}

.account-selector svg {
    width: 16px;
    height: 16px;
    color: var(--gray-500);
}

/* Content */
.content {
    padding: 20px 32px;
}

@media (max-width: 1200px) {
    .content {
        padding: 20px 24px;
    }
}

.page-header {
    margin-bottom: 32px;
}

.page-header-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 8px;
}

.page-title {
    font-size: 2rem;
    font-weight: 500;
    letter-spacing: -0.03em;
    line-height: 1.2;
}

.page-subtitle {
    color: var(--gray-500);
    font-size: 0.9375rem;
}

/* Cards */
.card {
    background: var(--gray-950);
    border: 1px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 24px;
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid var(--border);
}

.card-title {
    font-size: 0.875rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 8px;
}

.card-title-badge {
    font-size: 0.6875rem;
    padding: 2px 8px;
    background: rgba(255, 255, 255, 0.06);
    border-radius: 4px;
    color: var(--gray-400);
    font-weight: 400;
}

.card-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.card-body {
    padding: 24px;
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1px;
    background: var(--border);
    border: 1px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 24px;
}

.stats-grid[data-columns="2"] {
    grid-template-columns: repeat(2, 1fr);
}

.stats-grid[data-columns="3"] {
    grid-template-columns: repeat(3, 1fr);
}

.stats-grid[data-columns="4"] {
    grid-template-columns: repeat(4, 1fr);
}

.stat-card {
    background: var(--black);
    padding: 20px 24px;
    transition: all 0.15s ease;
}

.stat-card:hover {
    background: var(--gray-950);
}

/* Support for legacy stat card structure */
.stat-card .flex {
    display: flex;
}

.stat-card h3 {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--gray-500);
    margin-bottom: 8px;
}

.stat-card p {
    font-size: 2rem;
    font-weight: 500;
    letter-spacing: -0.03em;
    line-height: 1.1;
    color: var(--white);
    margin-bottom: 8px;
}

.stat-card span.text-green-400,
.stat-card span.text-yellow-400,
.stat-card span.text-red-400 {
    font-size: 0.75rem;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 8px;
    border-radius: 4px;
}

.stat-card span.text-green-400 {
    color: var(--green);
    background: rgba(34, 197, 94, 0.1);
}

.stat-card span.text-yellow-400 {
    color: var(--orange);
    background: rgba(241, 130, 6, 0.1);
}

.stat-card span.text-red-400 {
    color: var(--red);
    background: rgba(239, 68, 68, 0.1);
}

.stat-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--gray-500);
    margin-bottom: 8px;
    display: block;
}

.stat-value {
    font-size: 2rem;
    font-weight: 500;
    letter-spacing: -0.03em;
    line-height: 1.1;
    color: var(--white);
}

.stat-value.positive {
    color: var(--green);
}

.stat-value.negative {
    color: var(--red);
}

.stat-change {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 0.75rem;
    margin-top: 8px;
    padding: 4px 8px;
    border-radius: 4px;
}

.stat-change.positive {
    color: var(--green);
    background: rgba(34, 197, 94, 0.1);
}

.stat-change.negative {
    color: var(--red);
    background: rgba(239, 68, 68, 0.1);
}

.stat-change svg {
    width: 12px !important;
    height: 12px !important;
    flex-shrink: 0;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    font-size: 0.875rem;
    font-weight: 500;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    transition: all 0.15s ease;
    font-family: inherit;
    text-decoration: none;
}

.btn-primary {
    background: linear-gradient(135deg, var(--orange), var(--orange-light));
    color: var(--black);
}

.btn-primary:hover {
    background: linear-gradient(135deg, var(--orange-dim), var(--orange));
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(241, 130, 6, 0.3);
}

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

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.04);
    border-color: var(--border-light);
}

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

.btn-success:hover {
    background: var(--green-dim);
}

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

.btn-danger:hover {
    background: var(--red-dim);
}

.btn-sm {
    padding: 6px 12px;
    font-size: 0.75rem;
}

/* Time Filter */
.time-filter {
    display: flex;
    gap: 4px;
    padding: 4px;
    background: var(--gray-900);
    border-radius: 8px;
}

.time-filter-btn {
    padding: 6px 12px;
    font-size: 0.75rem;
    border: none;
    background: transparent;
    color: var(--gray-500);
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.15s ease;
    font-family: inherit;
}

.time-filter-btn:hover {
    color: var(--white);
}

.time-filter-btn.active {
    background: linear-gradient(135deg, var(--orange), var(--orange-light));
    color: var(--black);
}

/* Tables */
.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table th {
    text-align: left;
    padding: 12px 16px;
    font-size: 0.6875rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--gray-500);
    font-weight: 500;
    border-bottom: 1px solid var(--border);
}

.data-table td {
    padding: 14px 16px;
    font-size: 0.875rem;
    border-bottom: 1px solid var(--border);
    font-variant-numeric: tabular-nums;
}

.data-table tr:last-child td {
    border-bottom: none;
}

.data-table tbody tr {
    transition: background 0.15s ease;
}

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

/* Form Elements */
.form-input {
    padding: 10px 12px;
    background: var(--gray-950);
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--white);
    font-family: inherit;
    font-size: 0.875rem;
    width: 100%;
}

.form-input:focus {
    outline: none;
    border-color: var(--orange);
    box-shadow: 0 0 0 3px rgba(241, 130, 6, 0.1);
}

.form-select {
    padding: 10px 12px;
    background: var(--gray-950);
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--white);
    font-family: inherit;
    font-size: 0.875rem;
    width: 100%;
}

.form-textarea {
    padding: 10px 12px;
    background: var(--gray-950);
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--white);
    font-family: inherit;
    font-size: 0.875rem;
    width: 100%;
    resize: vertical;
    min-height: 80px;
}

.form-textarea:focus {
    outline: none;
    border-color: var(--orange);
    box-shadow: 0 0 0 3px rgba(241, 130, 6, 0.1);
}

.form-textarea::placeholder {
    color: var(--gray-500);
}

/* Toggle Switch */
.toggle-switch {
    position: relative;
    width: 44px;
    height: 24px;
    background: var(--gray-800);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.15s ease;
}

.toggle-switch.active {
    background: var(--green);
}

.toggle-slider {
    position: absolute;
    top: 2px;
    left: 2px;
    width: 20px;
    height: 20px;
    background: var(--white);
    border-radius: 50%;
    transition: all 0.15s ease;
}

.toggle-switch.active .toggle-slider {
    transform: translateX(20px);
}

/* Progress Bar */
.progress-bar {
    height: 4px;
    background: var(--gray-800);
    border-radius: 2px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    border-radius: 2px;
    transition: width 0.5s ease;
}

.progress-fill.green {
    background: linear-gradient(90deg, var(--green), var(--green-dim));
}

.progress-fill.red {
    background: linear-gradient(90deg, var(--red), var(--red-dim));
}

.progress-fill.white {
    background: var(--white);
}

.progress-fill.orange {
    background: linear-gradient(90deg, var(--orange), var(--orange-light));
}

/* Badges */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.6875rem;
    font-weight: 500;
    text-transform: uppercase;
}

.badge-success {
    background: rgba(34, 197, 94, 0.1);
    color: var(--green);
}

.badge-danger {
    background: rgba(239, 68, 68, 0.1);
    color: var(--red);
}

.badge-warning {
    background: rgba(245, 158, 11, 0.1);
    color: var(--orange);
}

.badge-info {
    background: rgba(59, 130, 246, 0.1);
    color: var(--blue);
}

/* Status Indicators */
.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--green);
    box-shadow: 0 0 8px rgba(34, 197, 94, 0.5);
}

.status-indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
    margin-right: 8px;
}

.status-indicator.positive {
    background: var(--green);
}

.status-indicator.negative {
    background: var(--red);
}

/* Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate-in {
    animation: fadeInUp 0.4s ease forwards;
}

.delay-1 { animation-delay: 0.05s; }
.delay-2 { animation-delay: 0.1s; }
.delay-3 { animation-delay: 0.15s; }
.delay-4 { animation-delay: 0.2s; }
.delay-5 { animation-delay: 0.25s; }

/* Utilities */
.text-muted {
    color: var(--gray-500);
}

.text-sm {
    font-size: 0.875rem;
}

.font-mono {
    font-family: 'SF Mono', 'Fira Code', monospace;
    font-size: 0.9em;
}

.positive {
    color: var(--green);
}

.negative {
    color: var(--red);
}

/* Responsive */
@media (max-width: 1400px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 1024px) {
    .grid.grid-cols-1.md\\:grid-cols-3 {
        grid-template-columns: repeat(2, 1fr);
    }

    .grid.grid-cols-1.lg\\:grid-cols-2 {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .main {
        margin-left: 0;
    }

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

    .content {
        padding: 20px;
    }

    .header {
        padding: 16px 20px;
        padding-left: 72px; /* Space for mobile menu button */
    }

    .page-title {
        font-size: 1.5rem;
    }

    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s ease;
    }

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

    .grid.grid-cols-1.md\\:grid-cols-3 {
        grid-template-columns: 1fr;
    }

    .grid.grid-cols-2.md\\:grid-cols-4.lg\\:grid-cols-6 {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 640px) {
    .grid.grid-cols-2.md\\:grid-cols-4.lg\\:grid-cols-6 {
        grid-template-columns: repeat(2, 1fr);
    }

    .page-header {
        padding: 20px;
    }
}

/* Light Mode Overrides */
.light-mode {
    --bg-primary: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    --bg-secondary: #ffffff;
    --text-primary: #0f172a;
    --text-secondary: #334155;
    --text-muted: #64748b;
    --card-border: rgba(0, 0, 0, 0.1);
    --card-shadow: rgba(0, 0, 0, 0.08);
    --glass-bg: rgba(255, 255, 255, 0.98);
    --glass-border: rgba(0, 0, 0, 0.08);
    --button-secondary-bg: #f8fafc;
    --button-secondary-hover: #f1f5f9;
    --progress-bg: rgba(0, 0, 0, 0.05);
    --tab-inactive: #64748b;
    --input-bg: rgba(255, 255, 255, 0.95);
    background: var(--bg-primary);
    color: var(--text-primary);
    background-image:
        radial-gradient(circle at 20% 80%, rgba(30, 64, 175, 0.04) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(30, 64, 175, 0.04) 0%, transparent 50%),
        radial-gradient(circle at 40% 40%, rgba(30, 64, 175, 0.03) 0%, transparent 50%);
    background-attachment: fixed;
    background-size: 100% 100%, 100% 100%, 100% 100%;
}

.light-mode body {
    background: var(--bg-primary);
    color: var(--text-primary);
}

/* Force dark text in light mode for headings and figures */
.light-mode h1,
.light-mode h2,
.light-mode h3,
.light-mode h4,
.light-mode h5,
.light-mode h6,
.light-mode .text-gray-900,
.light-mode .text-3xl,
.light-mode .text-2xl,
.light-mode .text-xl,
.light-mode .text-lg {
    color: #0f172a !important;
}

/* Override text-white in light mode for regular content (not buttons) */
.light-mode .text-white:not(button):not(a[class*="bg-"]):not([class*="bg-orange"]):not([class*="bg-gradient"]) {
    color: #0f172a !important;
}

.light-mode .text-gray-400 {
    color: #64748b !important;
}

.light-mode .text-gray-300 {
    color: #475569 !important;
}

.light-mode .text-gray-500 {
    color: #64748b !important;
}

.light-mode .text-gray-600 {
    color: #475569 !important;
}

/* Table header fixes for light mode */
.light-mode table thead {
    background: #f8fafc !important;
    border-bottom: 1px solid #e2e8f0 !important;
}

.light-mode table thead th {
    color: #475569 !important;
    background: transparent !important;
}

.light-mode table tbody tr:hover {
    background: #f8fafc !important;
}

/* Enhanced Light Mode */
.light-mode .blur-container {
    background: linear-gradient(135deg, #ffffff 0%, #fafbfc 100%);
    border: 1px solid rgba(0, 0, 0, 0.12);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1), 0 4px 16px rgba(0, 0, 0, 0.06);
}

.light-mode .account-card {
    background: linear-gradient(135deg, #ffffff 0%, #fafbfc 100%);
    border: 1px solid rgba(0, 0, 0, 0.1);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08), 0 2px 8px rgba(0, 0, 0, 0.04);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.light-mode .account-card:hover {
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12), 0 4px 16px rgba(0, 0, 0, 0.06);
    transform: translateY(-2px);
    border-color: rgba(241, 130, 6, 0.3);
}

/* Tab Enhancements */
.tab-bar-container {
    position: relative;
    display: flex;
    gap: 0.375rem;
    padding: 0.375rem;
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: 9999px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

.light-mode .tab-bar-container {
    background: rgba(255, 255, 255, 0.98);
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.08), 0 2px 12px rgba(0, 0, 0, 0.04);
}

.tab-button {
    position: relative;
    flex: 1;
    padding: 0.75rem 1.125rem;
    font-size: 0.875rem;
    font-weight: 500;
    border-radius: 9999px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    border: none;
    outline: none;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    letter-spacing: 0.025em;
    min-width: 0;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

.tab-button:not(.tab-active) {
    color: var(--text-muted);
    background: transparent;
}

.tab-button:not(.tab-active):hover {
    color: var(--text-primary);
    background: rgba(241, 130, 6, 0.08);
    transform: translateY(-1px);
}

.light-mode .tab-button:not(.tab-active):hover {
    background: rgba(241, 130, 6, 0.12);
    color: var(--orange);
}

.tab-button.tab-active {
    background: linear-gradient(135deg, var(--orange), var(--orange-light));
    color: var(--black);
    font-weight: 600;
    box-shadow: 0 4px 12px rgba(241, 130, 6, 0.35), 0 2px 4px rgba(241, 130, 6, 0.2);
    transform: translateY(-1px);
    z-index: 1;
}

.light-mode .tab-button.tab-active {
    box-shadow: 0 4px 16px rgba(241, 130, 6, 0.4), 0 2px 8px rgba(241, 130, 6, 0.25);
}

/* Enhanced Progress Bars */
.light-mode .target-progress {
    background: rgba(0, 0, 0, 0.08);
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.06);
}

.light-mode .target-progress-bar.profit {
    background: linear-gradient(90deg, var(--orange), var(--orange-light));
    box-shadow: 0 2px 8px rgba(241, 130, 6, 0.3);
}

.light-mode .target-progress-bar.drawdown {
    background: linear-gradient(90deg, var(--red), var(--red-dim));
    box-shadow: 0 2px 8px rgba(239, 68, 68, 0.3);
}

/* Enhanced Buttons */
.light-mode .btn-primary {
    box-shadow: 0 4px 12px rgba(241, 130, 6, 0.3);
}

.light-mode .btn-primary:hover {
    box-shadow: 0 6px 20px rgba(241, 130, 6, 0.4);
    transform: translateY(-1px);
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: var(--gray-800);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--gray-700);
}

.light-mode ::-webkit-scrollbar-thumb {
    background: rgba(241, 130, 6, 0.3);
}

.light-mode ::-webkit-scrollbar-thumb:hover {
    background: rgba(241, 130, 6, 0.5);
}

/* Special Dashboard Elements */
.challenge-button {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    width: 100%;
    max-width: 320px;
    margin: 0 auto;
    padding: 18px 32px;
    font-size: 1.125rem;
    font-weight: 600;
    color: #ffffff;
    text-transform: uppercase;
    letter-spacing: 1px;
    background: rgba(241, 130, 6, 0.1);
    border: 1px solid rgba(241,130, 6, 0.2);
    border-radius: 16px;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    text-decoration: none;
    overflow: hidden;
}

.challenge-button::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(241, 130, 6, 0.15), rgba(255, 140, 0, 0.1));
    opacity: 0;
    transition: opacity 0.4s ease;
}

.challenge-button::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background: linear-gradient(to right, rgba(241, 130, 6, 0.8), rgba(255, 140, 0, 0.8));
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.challenge-button:hover {
    transform: translateY(-2px);
    border-color: rgba(241, 130, 6, 0.4);
    box-shadow: 0 8px 24px rgba(241, 130, 6, 0.15), 0 2px 4px rgba(241, 130, 6, 0.1);
}

.challenge-button:hover::before {
    opacity: 1;
}

.challenge-button:hover::after {
    transform: scaleX(1);
}

.challenge-button .button-text {
    position: relative;
    z-index: 1;
    background: linear-gradient(135deg, var(--orange), var(--orange-light));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    transition: opacity 0.3s ease;
}

.challenge-button:hover .button-text {
    opacity: 0.9;
}

/* Account Cards */
.account-card {
    position: relative;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.account-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 32px rgba(241, 130, 6, 0.1);
}

.profit-share-badge {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: 9999px;
    background: linear-gradient(135deg, var(--orange), var(--orange-light));
    color: var(--black);
    box-shadow: 0 2px 8px rgba(241, 130, 6, 0.2);
}

.scaling-eligible {
    background: rgba(34, 197, 94, 0.1);
    border: 1px solid rgba(34, 197, 94, 0.2);
    color: var(--green);
    box-shadow: 0 2px 8px rgba(34, 197, 94, 0.15);
}

/* Quick Action Buttons */
.quick-action-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 16px 12px;
    padding-top: 20px;
    background: var(--black);
    border: 1px solid var(--border);
    border-radius: 8px;
    text-decoration: none;
    color: var(--white);
    transition: all 0.15s ease;
}

.quick-action-btn:hover {
    background: var(--gray-950);
    border-color: var(--border-light);
}

.quick-action-icon {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    background: rgba(241, 130, 6, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s ease;
}

.quick-action-btn:hover .quick-action-icon {
    background: rgba(241, 130, 6, 0.2);
}

.quick-action-icon svg {
    width: 20px !important;
    height: 20px !important;
    color: var(--orange);
}

.quick-action-label {
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--gray-300);
    text-align: center;
}

.quick-action-btn:hover .quick-action-label {
    color: var(--white);
}

/* Enhanced Stat Cards */
.stat-card {
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(241, 130, 6, 0.02), transparent);
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: -1;
}

.stat-card:hover::before {
    opacity: 1;
}

/* Improved Page Header */
.page-header {
    background: linear-gradient(135deg, var(--gray-950), var(--gray-900));
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 32px;
    margin-bottom: 32px;
    position: relative;
    overflow: hidden;
}

.page-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(241, 130, 6, 0.03), transparent);
    z-index: -1;
}

.page-title {
    background: linear-gradient(135deg, var(--white), var(--gray-300));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    margin-bottom: 8px;
}

/* Enhanced Cards */
.card {
    position: relative;
    overflow: hidden;
}

.card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(241, 130, 6, 0.02), transparent);
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: -1;
}

.card:hover::before {
    opacity: 1;
}

/* Enhanced Charts Container */
.chart-container {
    background: linear-gradient(135deg, var(--gray-950), var(--gray-900));
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 24px;
    transition: all 0.3s ease;
}

.chart-container:hover {
    border-color: rgba(241, 130, 6, 0.3);
    box-shadow: 0 8px 32px rgba(241, 130, 6, 0.1);
}

/* Improved Table Styling */
.data-table {
    background: linear-gradient(135deg, var(--gray-950), var(--gray-900));
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid var(--border);
}

.data-table thead {
    background: linear-gradient(135deg, var(--gray-900), var(--gray-800));
}

/* Table Styling for Admin Dashboard */
table.w-full {
    width: 100%;
    border-collapse: collapse;
}

table.w-full thead tr {
    border-bottom: 1px solid var(--border);
}

table.w-full th {
    text-align: left;
    padding: 16px;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--gray-400);
    font-weight: 500;
    border-bottom: 1px solid var(--border);
}

table.w-full td {
    padding: 16px;
    font-size: 0.875rem;
    color: var(--gray-300);
    border-bottom: 1px solid var(--border);
}

table.w-full tbody tr {
    transition: background 0.2s ease;
}

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

table.w-full tbody tr:last-child td {
    border-bottom: none;
}

/* Card Header Styling */
.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid var(--border);
    background: linear-gradient(135deg, var(--gray-900), var(--gray-950));
}

.card-title {
    font-size: 0.875rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--white);
}

.card-title svg {
    width: 18px !important;
    height: 18px !important;
    color: var(--orange);
}

/* Card Body Styling */
.card-body {
    padding: 24px;
}

/* Chart Card Styling */
.card h3 {
    font-size: 1.125rem;
    font-weight: 500;
    color: var(--white);
    margin-bottom: 20px;
    padding: 0 24px;
    padding-top: 24px;
}

/* User Avatar Styling */
.h-10 {
    height: 2.5rem;
}

.w-10 {
    width: 2.5rem;
}

.rounded-full {
    border-radius: 9999px;
}

.bg-dark-tertiary {
    background-color: var(--gray-800);
}

/* Text Utilities */
.text-left {
    text-align: left;
}

.text-center {
    text-align: center;
}

.text-xl {
    font-size: 1.25rem;
}

.text-lg {
    font-size: 1.125rem;
}

.font-semibold {
    font-weight: 600;
}

/* Spacing Utilities */
.space-x-2 > * + * {
    margin-left: 0.5rem;
}

.space-y-3 > * + * {
    margin-top: 0.75rem;
}

.space-y-4 > * + * {
    margin-top: 1rem;
}

.ml-1 {
    margin-left: 0.25rem;
}

.ml-2 {
    margin-left: 0.5rem;
}

.ml-3 {
    margin-left: 0.75rem;
}

.ml-6 {
    margin-left: 1.5rem;
}

.mr-2 {
    margin-right: 0.5rem;
}

.mr-3 {
    margin-right: 0.75rem;
}

/* Background Utilities */
.bg-gray-700 {
    background-color: var(--gray-700);
}

.bg-gray-800 {
    background-color: var(--gray-800);
}

.bg-blue-500\/20 {
    background-color: rgba(59, 130, 246, 0.2);
}

.bg-purple-500\/20 {
    background-color: rgba(139, 92, 246, 0.2);
}

.hover\:bg-blue-500\/30:hover {
    background-color: rgba(59, 130, 246, 0.3);
}

.hover\:bg-purple-500\/30:hover {
    background-color: rgba(139, 92, 246, 0.3);
}

.hover\:bg-gray-800\/30:hover {
    background-color: rgba(31, 41, 55, 0.3);
}

/* Text Color Utilities */
.text-blue-400 {
    color: #60a5fa;
}

.text-purple-400 {
    color: #a78bfa;
}

.text-gray-300 {
    color: var(--gray-300);
}

/* Padding Utilities */
.px-2 {
    padding-left: 0.5rem;
    padding-right: 0.5rem;
}

.px-3 {
    padding-left: 0.75rem;
    padding-right: 0.75rem;
}

.py-1 {
    padding-top: 0.25rem;
    padding-bottom: 0.25rem;
}

.py-4 {
    padding-top: 1rem;
    padding-bottom: 1rem;
}

.pb-4 {
    padding-bottom: 1rem;
}

/* Border Utilities */
.border-b {
    border-bottom: 1px solid var(--border);
}

.border-gray-700 {
    border-color: var(--gray-700);
}

/* Transition Utilities */
.transition-colors {
    transition-property: color, background-color, border-color;
    transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
    transition-duration: 150ms;
}

.duration-200 {
    transition-duration: 200ms;
}

/* Overflow Utilities */
.overflow-x-auto {
    overflow-x: auto;
}

/* Enhanced Card Styling for Charts */
.card {
    background: var(--gray-950);
    border: 1px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 24px;
    transition: all 0.3s ease;
}

.card:hover {
    border-color: rgba(241, 130, 6, 0.3);
    transform: translateY(-2px);
    box-shadow: 0 8px 32px rgba(241, 130, 6, 0.1);
}

/* Chart Card Specific */
.card .donut-chart-container {
    padding: 0 24px 24px 24px;
}

/* Enhanced Page Header */
.page-header {
    margin-bottom: 32px;
}

.page-header-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border);
}

.page-header-top > div {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.page-title {
    font-size: 1.875rem;
    font-weight: 600;
    letter-spacing: -0.02em;
    line-height: 1.2;
    color: var(--white);
}

.page-subtitle {
    color: var(--gray-500);
    font-size: 0.8125rem;
    font-weight: 400;
}

/* Stats Grid Enhancement - removed duplicate */

/* Trading Account Overview Grid */
.grid.grid-cols-1.md\:grid-cols-3 {
    display: grid;
    grid-template-columns: repeat(1, minmax(0, 1fr));
    gap: 1px;
    background: var(--border);
    border: 1px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 24px;
}

.grid.grid-cols-1.md\:grid-cols-3 > .stat-card {
    background: var(--black);
    border: none;
    border-radius: 0;
}

@media (min-width: 768px) {
    .grid.grid-cols-1.md\:grid-cols-3 {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

/* Chart Grid */
.grid.grid-cols-1.lg\:grid-cols-2 {
    display: grid;
    grid-template-columns: repeat(1, minmax(0, 1fr));
    gap: 24px;
    margin-bottom: 32px;
}

@media (min-width: 1024px) {
    .grid.grid-cols-1.lg\:grid-cols-2 {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

/* Enhanced Stat Cards with Icons */
.grid .stat-card {
    background: var(--black);
    border: none;
    border-radius: 0;
}

/* Icon Background Utilities */
.bg-blue-500\/20 {
    background-color: rgba(59, 130, 246, 0.2);
}

.bg-green-500\/20 {
    background-color: rgba(34, 197, 94, 0.2);
}

.bg-purple-500\/20 {
    background-color: rgba(139, 92, 246, 0.2);
}

.bg-yellow-500\/20 {
    background-color: rgba(245, 158, 11, 0.2);
}

/* Icon Size Utilities */
.h-7 {
    height: 1.75rem;
}

.w-7 {
    width: 1.75rem;
}

.h-8 {
    height: 2rem;
}

.w-8 {
    width: 2rem;
}

.h-14 {
    height: 3.5rem;
}

.w-14 {
    width: 3.5rem;
}

.h-16 {
    height: 4rem;
}

.w-16 {
    width: 4rem;
}

/* Text Size for Icons */
.text-blue-500 {
    color: var(--blue);
}

.text-green-500 {
    color: var(--green);
}

.text-purple-500 {
    color: var(--purple);
}

.text-yellow-500 {
    color: var(--orange);
}

/* Relative and Absolute Positioning */
.relative {
    position: relative;
}

.absolute {
    position: absolute;
}

/* Width Utilities */
.w-20 {
    width: 5rem;
}

.w-3 {
    width: 0.75rem;
}

.h-3 {
    height: 0.75rem;
}

.h-2 {
    height: 0.5rem;
}

/* Rounded Utilities */
.rounded {
    border-radius: 0.375rem;
}

/* Flex Direction */
.flex-col {
    flex-direction: column;
}

/* Enhanced Recent Users Table */
.card.mb-8 {
    margin-bottom: 2rem;
}

.card .flex.justify-between.items-center.mb-6 {
    margin-bottom: 1.5rem;
    padding: 24px 24px 0 24px;
}

.card .flex.justify-between.items-center.mb-6 h3 {
    font-size: 1.25rem;
    font-weight: 500;
    color: var(--white);
}

.card .flex.justify-between.items-center.mb-6 a {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    color: var(--orange);
    text-decoration: none;
    font-size: 0.875rem;
    transition: color 0.2s ease;
}

.card .flex.justify-between.items-center.mb-6 a:hover {
    color: var(--orange-light);
}

.card .flex.justify-between.items-center.mb-6 a svg {
    width: 16px !important;
    height: 16px !important;
}

/* Table Container */
.card .overflow-x-auto {
    padding: 0 24px 24px 24px;
}

/* Badge Styling in Table */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.6875rem;
    font-weight: 500;
    text-transform: uppercase;
}

.badge-success {
    background: rgba(34, 197, 94, 0.1);
    color: var(--green);
    border: 1px solid rgba(34, 197, 94, 0.2);
}

.badge-warning {
    background: rgba(241, 130, 6, 0.1);
    color: var(--orange);
    border: 1px solid rgba(241, 130, 6, 0.2);
}

/* Enhanced Table Row Styling */
table.w-full tbody tr {
    border-bottom: 1px solid var(--border);
}

table.w-full tbody tr:last-child {
    border-bottom: none;
}

table.w-full tbody tr td {
    vertical-align: middle;
}

/* User Avatar in Table */
table.w-full .h-10.w-10.rounded-full {
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    color: var(--white);
    flex-shrink: 0;
}

/* Account Count Badge */
table.w-full .bg-gray-700 {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 32px;
    font-weight: 500;
    color: var(--white);
}

/* Action Buttons in Table */
table.w-full a.text-xs {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 6px 12px;
    border-radius: 6px;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.2s ease;
    border: 1px solid transparent;
}

table.w-full a.text-xs:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

/* Enhanced Grid Layouts */
.grid {
    display: grid;
}

.grid-cols-1 {
    grid-template-columns: repeat(1, minmax(0, 1fr));
}

.gap-4 {
    gap: 1rem;
}

.gap-6 {
    gap: 1.5rem;
}

/* Enhanced Card Title with Icon */
.card-title svg {
    flex-shrink: 0;
}

/* Chart Container Padding */
.card-body .donut-chart-container {
    padding: 0;
}

/* Better Spacing for Chart Legends */
.card-body .flex.flex-col.space-y-3 {
    min-width: 150px;
}

/* Enhanced Footer */
.text-center {
    text-align: center;
    padding: 24px;
    margin-top: 32px;
}

.text-center p {
    color: var(--gray-500);
    font-size: 0.875rem;
}

/* Ensure proper text colors */
.text-white {
    color: var(--white) !important;
}

.text-gray-300 {
    color: var(--gray-300) !important;
}

.text-gray-400 {
    color: var(--gray-400) !important;
}

.text-gray-500 {
    color: var(--gray-500) !important;
}

/* Font Weight Utilities */
.font-medium {
    font-weight: 500;
}

.font-semibold {
    font-weight: 600;
}

/* Ensure proper display for flex items */
.flex.items-center {
    display: flex;
    align-items: center;
}

/* Better hover states for table */
table.w-full tbody tr:hover td {
    background-color: rgba(255, 255, 255, 0.02);
}

/* Enhanced Quick Action Buttons Grid */
.grid.grid-cols-2.md\:grid-cols-4.lg\:grid-cols-6 {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

@media (min-width: 768px) {
    .grid.grid-cols-2.md\:grid-cols-4.lg\:grid-cols-6 {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

@media (min-width: 1024px) {
    .grid.grid-cols-2.md\:grid-cols-4.lg\:grid-cols-6 {
        grid-template-columns: repeat(6, minmax(0, 1fr));
    }
}

/* Ensure proper card structure */
.card > .card-header + .card-body {
    padding-top: 0;
}

/* Compact card body */
.card-body {
    padding: 20px 24px;
}

/* Compact card header */
.card-header {
    padding: 16px 24px;
}

/* Chart Legend Container */
.chart-legend-container {
    display: flex;
    align-items: center;
    gap: 32px;
    flex-wrap: wrap;
}

.donut-chart-container {
    flex-shrink: 0;
    width: 200px;
    height: 200px;
}

.chart-legend {
    display: flex;
    flex-direction: column;
    gap: 16px;
    flex: 1;
    min-width: 200px;
}

.chart-legend-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 4px 0;
}

.chart-legend-indicator {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    flex-shrink: 0;
}

.chart-legend-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex: 1;
    gap: 16px;
}

.chart-legend-label {
    font-size: 0.875rem;
    color: var(--gray-400);
    font-weight: 400;
}

.chart-legend-value {
    font-size: 0.875rem;
    color: var(--white);
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}

@media (max-width: 768px) {
    .chart-legend-container {
        flex-direction: column;
        align-items: center;
        gap: 24px;
    }
    
    .chart-legend {
        width: 100%;
        min-width: auto;
    }
}

/* Ensure all text is properly styled */
h1, h2, h3, h4, h5, h6 {
    color: var(--white);
    font-weight: 500;
}

/* Better table header styling */
table.w-full thead th {
    background: linear-gradient(135deg, var(--gray-900), var(--gray-800));
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Enhanced stat card content */
.stat-card h3 {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--gray-500);
    margin-bottom: 8px;
    font-weight: 500;
}

.stat-card p {
    font-size: 1.875rem;
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 8px;
}

/* Better icon container styling */
.bg-blue-500\/20,
.bg-green-500\/20,
.bg-purple-500\/20,
.bg-yellow-500\/20 {
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

/* Ensure proper spacing in stat cards */
.stat-card .flex.justify-between.items-start {
    width: 100%;
}

.stat-card .flex.justify-between.items-start > div:first-child {
    flex: 1;
    min-width: 0;
}

/* Better link styling */
a {
    color: inherit;
    text-decoration: none;
}

a:hover {
    text-decoration: none;
}

/* Enhanced table cell padding */
table.w-full td,
table.w-full th {
    padding: 16px;
}

/* Better user name display */
table.w-full td .font-medium {
    color: var(--white);
    font-weight: 500;
}

/* Ensure proper display for all flex utilities */
.flex {
    display: flex;
}

.items-start {
    align-items: flex-start;
}

.justify-between {
    justify-content: space-between;
}

.min-w-\[180px\] {
    min-width: 180px;
}

/* Better chart legend spacing */
.card-body .flex.flex-col.space-y-3 > div {
    display: flex;
    align-items: center;
    min-height: 24px;
}

/* Enhanced card header icon */
.card-title {
    font-size: 1rem;
    font-weight: 600;
}

/* Better stat value display */
.stat-value {
    font-size: 2rem;
    font-weight: 600;
    line-height: 1.1;
    color: var(--white);
}

/* Ensure proper text colors for all elements */
.text-gray-300,
.text-gray-400,
.text-gray-500 {
    color: inherit;
}

/* Better responsive behavior */
@media (max-width: 640px) {
    .page-title {
        font-size: 1.375rem;
    }
    
    .stat-card {
        padding: 16px;
    }
    
    .stat-value {
        font-size: 1.5rem;
    }
    
    table.w-full {
        font-size: 0.8125rem;
    }
    
    table.w-full td,
    table.w-full th {
        padding: 10px 12px;
    }

    .quick-action-btn {
        padding: 12px 8px;
    }

    .quick-action-icon {
        width: 36px;
        height: 36px;
    }

    .quick-action-icon svg {
        width: 18px !important;
        height: 18px !important;
    }
}

/* Mobile Optimizations */
@media (max-width: 640px) {
    .content {
        padding: 16px;
    }

    .challenge-button {
        padding: 16px 24px;
        font-size: 1rem;
        max-width: 280px;
    }

    .stats-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .stat-card {
        padding: 20px;
    }

    .stat-value {
        font-size: 1.75rem;
    }

    .quick-action-btn {
        padding: 16px 12px;
    }

    .quick-action-icon {
        width: 40px;
        height: 40px;
    }

    .quick-action-icon svg {
        width: 20px !important;
        height: 20px !important;
    }

    .page-header {
        padding: 24px;
    }
}

/* Enhanced Glass Effects */
.glass-morphism {
    background: var(--glass-bg);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border: 1px solid var(--glass-border);
    transition: all 0.3s ease;
}

.blur-container {
    position: relative;
    border: 1px solid var(--card-border);
    border-radius: 1.5rem;
    overflow: hidden;
    box-shadow: 0 8px 32px var(--card-shadow);
    user-select: none;
    transition: all 0.3s ease;
    background: var(--glass-bg);
    padding-bottom: 200px;
}

.blur-content {
    filter: blur(6px);
    opacity: 0.4;
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.start-challenge {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 10;
    width: 100%;
    padding: 0 24px;
    pointer-events: auto;
}

/* Loading States */
.skeleton {
    background: linear-gradient(90deg, var(--gray-900) 0%, var(--gray-800) 50%, var(--gray-900) 100%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s infinite;
    border-radius: 4px;
}

@keyframes skeleton-loading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* Focus States */
.tab-button:focus-visible,
.btn:focus-visible,
.form-input:focus-visible {
    outline: 2px solid rgba(241, 130, 6, 0.5);
    outline-offset: 2px;
}

/* Utility Classes for Admin Dashboard Compatibility */
.flex { display: flex; }
.flex-col { flex-direction: column; }
.flex-row { flex-direction: row; }
.items-center { align-items: center; }
.items-start { align-items: flex-start; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }
.gap-2 { gap: 0.5rem; }
.gap-4 { gap: 1rem; }
.gap-6 { gap: 1.5rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-4 { margin-bottom: 1rem; }
.mb-6 { margin-bottom: 1.5rem; }
.mb-8 { margin-bottom: 2rem; }
.mt-4 { margin-top: 1rem; }
.mr-1 { margin-right: 0.25rem; }
.mr-3 { margin-right: 0.75rem; }
.p-4 { padding: 1rem; }
.p-6 { padding: 1.5rem; }
.px-3 { padding-left: 0.75rem; padding-right: 0.75rem; }
.px-4 { padding-left: 1rem; padding-right: 1rem; }
.py-2 { padding-top: 0.5rem; padding-bottom: 0.5rem; }
.py-3 { padding-top: 0.75rem; padding-bottom: 0.75rem; }
.rounded-xl { border-radius: 0.75rem; }
.rounded-full { border-radius: 9999px; }
.h-4 { height: 1rem; }
.h-6 { height: 1.5rem; }
.h-8 { height: 2rem; }
.h-12 { height: 3rem; }
.h-16 { height: 4rem; }
.w-4 { width: 1rem; }
.w-6 { width: 1.5rem; }
.w-8 { width: 2rem; }
.w-12 { width: 3rem; }
.w-16 { width: 4rem; }
.w-full { width: 100%; }
.text-sm { font-size: 0.875rem; }
.text-xs { font-size: 0.75rem; }
.text-2xl { font-size: 1.5rem; }
.text-3xl { font-size: 1.875rem; }
.font-bold { font-weight: 700; }
.font-medium { font-weight: 500; }
.text-white { color: var(--white); }
.text-gray-400 { color: var(--gray-400); }
.text-gray-500 { color: var(--gray-500); }
.text-green-400 { color: var(--green); }
.text-green-500 { color: var(--green); }
.text-blue-500 { color: var(--blue); }
.text-purple-500 { color: var(--purple); }
.text-yellow-400 { color: var(--orange); }
.text-orange { color: var(--orange); }
.text-brand-accent { color: var(--orange); }
.text-brand-hover { color: var(--orange-light); }
.bg-brand-accent { background-color: var(--orange); }
.bg-brand-hover { background-color: var(--orange-light); }
.hover\:bg-brand-hover:hover { background-color: var(--orange-light); }
.hover\:text-brand-hover:hover { color: var(--orange-light); }
.bg-dark-bg { background-color: var(--gray-950); }
.bg-dark-secondary { background-color: var(--gray-900); }
.bg-dark-tertiary { background-color: var(--gray-800); }
/* Utility classes for topnav and components */
.bg-secondary { background-color: var(--bg-secondary); }
.text-primary { color: var(--text-primary); }
.text-secondary { color: var(--text-secondary); }
.text-muted { color: var(--text-muted); }
.focus\:ring-brand-accent:focus { outline: 2px solid var(--orange); outline-offset: 2px; }
.focus\:ring-2:focus { outline-width: 2px; }
[class*="bg-blue-500"] { background-color: rgba(59, 130, 246, 0.2) !important; }
[class*="bg-green-500"] { background-color: rgba(34, 197, 94, 0.2) !important; }
[class*="bg-purple-500"] { background-color: rgba(139, 92, 246, 0.2) !important; }
[class*="bg-yellow-500"] { background-color: rgba(245, 158, 11, 0.2) !important; }
[class*="bg-orange-500"] { background-color: rgba(241, 130, 6, 0.2) !important; }
.grid { display: grid; }
.grid-cols-1 { grid-template-columns: repeat(1, minmax(0, 1fr)); }
.transition-colors { transition-property: color, background-color, border-color; transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1); transition-duration: 150ms; }
.relative { position: relative; }
.absolute { position: absolute; }
.hidden { display: none; }

@media (min-width: 768px) {
    .md\:flex { display: flex; }
    .md\:grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .md\:items-center { align-items: center; }
    .md\:mt-0 { margin-top: 0; }
}

@media (min-width: 1024px) {
    .lg\:grid-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .lg\:grid-cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

/* Print Styles */
@media print {
    .sidebar,
    .header,
    .tab-bar-container,
    .challenge-button {
        display: none !important;
    }

    .content {
        margin: 0 !important;
        padding: 0 !important;
    }

    .card {
        break-inside: avoid;
        margin-bottom: 16px;
    }
}
