/* Investment Platform - Custom Styles */

/* ================================================================
   Theme Variables
   ================================================================ */
:root {
    --trader-primary: #6366f1;
    --trader-secondary: #7c3aed;
    --trader-footer-h: 60px;
}

@media (max-width: 640px) {
    :root {
        --trader-footer-h: 50px;
    }
}

/* ================================================================
   Base
   ================================================================ */
body {
    font-family: 'Inter', ui-sans-serif, system-ui, sans-serif;
}

/* ================================================================
   RTL Support
   ================================================================ */
[dir="rtl"] .rtl\:left-auto { left: auto; }
[dir="rtl"] .rtl\:right-auto { right: auto; }
[dir="rtl"] .rtl\:left-4 { left: 1rem; }
[dir="rtl"] .rtl\:right-3 { right: 0.75rem; }
[dir="rtl"] .rtl\:pl-4 { padding-left: 1rem; }
[dir="rtl"] .rtl\:pr-10 { padding-right: 2.5rem; }

/* ================================================================
   Admin Sidebar
   ================================================================ */
.admin-sidebar {
    background: linear-gradient(160deg, #0f172a 0%, #1a2540 60%, #0f172a 100%);
}

/* Animated rainbow accent bar */
.sidebar-accent {
    height: 3px;
    flex-shrink: 0;
    background: linear-gradient(90deg, #3b82f6, #6366f1, #8b5cf6, #ec4899, #3b82f6);
    background-size: 300% 100%;
    animation: gradientShift 5s ease infinite;
}

@keyframes gradientShift {
    0%   { background-position: 0% 50%; }
    50%  { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* ================================================================
   Navigation Links
   ================================================================ */
.nav-link {
    position: relative;
    transition: all 0.18s ease;
}

.nav-icon-wrap {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    background: rgba(255, 255, 255, 0.05);
    transition: all 0.18s ease;
}

.nav-link:hover .nav-icon-wrap {
    background: rgba(255, 255, 255, 0.1);
}

/* Active nav */
.nav-link.active-nav {
    background: rgba(59, 130, 246, 0.18) !important;
    color: white !important;
    font-weight: 600;
}

.nav-link.active-nav .nav-icon-wrap {
    background: rgba(59, 130, 246, 0.3) !important;
}

.nav-link.active-nav::before {
    content: '';
    position: absolute;
    left: 0;
    top: 7px;
    bottom: 7px;
    width: 3px;
    border-radius: 0 3px 3px 0;
    background: linear-gradient(180deg, #60a5fa, #818cf8);
}

[dir="rtl"] .nav-link.active-nav::before {
    left: auto;
    right: 0;
    border-radius: 3px 0 0 3px;
}

/* ================================================================
   Admin Header
   ================================================================ */
.admin-header {
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05), 0 1px 2px rgba(0, 0, 0, 0.04);
    flex-shrink: 0;
}

/* ================================================================
   Primary Gradient Button
   ================================================================ */
.btn-primary {
    background: linear-gradient(135deg, #2563eb, #4f46e5);
    color: white !important;
    transition: all 0.2s ease;
    box-shadow: 0 2px 10px rgba(79, 70, 229, 0.35);
    border: none;
}

.btn-primary:hover:not(:disabled) {
    background: linear-gradient(135deg, #1d4ed8, #4338ca);
    box-shadow: 0 4px 16px rgba(79, 70, 229, 0.45);
    transform: translateY(-1px);
}

.btn-primary:active:not(:disabled) {
    transform: translateY(0);
    box-shadow: 0 2px 6px rgba(79, 70, 229, 0.3);
}

.btn-primary:disabled {
    background: #94a3b8;
    box-shadow: none;
    transform: none;
    cursor: not-allowed;
}

/* ================================================================
   Dashboard Stat Cards
   ================================================================ */
.stat-card {
    transition: transform 0.25s ease, box-shadow 0.25s ease;
    overflow: hidden;
}

.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 16px 32px -8px rgba(0, 0, 0, 0.14);
}

/* Gradient icon backgrounds */
.stat-icon-area {
    width: 52px;
    height: 52px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.stat-icon-area.blue {
    background: linear-gradient(135deg, #3b82f6, #6366f1);
    box-shadow: 0 4px 14px rgba(99, 102, 241, 0.4);
}

.stat-icon-area.emerald {
    background: linear-gradient(135deg, #10b981, #059669);
    box-shadow: 0 4px 14px rgba(16, 185, 129, 0.4);
}

.stat-icon-area.amber {
    background: linear-gradient(135deg, #f59e0b, #f97316);
    box-shadow: 0 4px 14px rgba(245, 158, 11, 0.4);
}

.stat-icon-area.violet {
    background: linear-gradient(135deg, #8b5cf6, #7c3aed);
    box-shadow: 0 4px 14px rgba(139, 92, 246, 0.4);
}

.stat-icon-area.rose {
    background: linear-gradient(135deg, #f43f5e, #e11d48);
    box-shadow: 0 4px 14px rgba(244, 63, 94, 0.4);
}

.stat-icon-area.teal {
    background: linear-gradient(135deg, #14b8a6, #0d9488);
    box-shadow: 0 4px 14px rgba(20, 184, 166, 0.4);
}

/* Quick Action Cards */
.quick-action-card {
    transition: all 0.2s ease;
    text-decoration: none;
    display: flex;
}

.quick-action-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px -6px rgba(0, 0, 0, 0.12);
}

/* ================================================================
   Modal Animations
   ================================================================ */
.modal-dialog {
    animation: slideUpFade 0.28s cubic-bezier(0.34, 1.46, 0.64, 1);
}

@keyframes slideUpFade {
    from {
        opacity: 0;
        transform: translateY(24px) scale(0.96);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.modal-backdrop-blur {
    backdrop-filter: blur(6px) saturate(1.2);
    -webkit-backdrop-filter: blur(6px) saturate(1.2);
    background: rgba(15, 23, 42, 0.55) !important;
}

/* ================================================================
   Toast Animations
   ================================================================ */
#toast-container > div {
    transition: transform 0.3s ease, opacity 0.3s ease;
}

/* ================================================================
   Table Styles
   ================================================================ */
tbody tr {
    transition: background-color 0.15s ease;
}

tbody tr:hover {
    background-color: rgba(239, 246, 255, 0.7);
}

/* ================================================================
   Skeleton Loading
   ================================================================ */
.skeleton {
    background: linear-gradient(90deg, #f1f5f9 25%, #e8eef4 50%, #f1f5f9 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s ease-in-out infinite;
    border-radius: 6px;
    display: inline-block;
}

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

/* Skeleton table rows - used while list pages fetch data, replacing
   the old spinner-in-a-row loading state for a consistent feel. */
.skeleton-row td {
    padding-top: 0.6rem;
    padding-bottom: 0.6rem;
}

/* ================================================================
   Status Badges
   ================================================================ */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.15rem 0.6rem;
    border-radius: 9999px;
    font-size: 0.7rem;
    font-weight: 600;
    line-height: 1.4;
    white-space: nowrap;
}

.badge-success { background: #d1fae5; color: #047857; }
.badge-danger  { background: #fee2e2; color: #b91c1c; }
.badge-warning { background: #fef3c7; color: #b45309; }
.badge-info    { background: #dbeafe; color: #1d4ed8; }
.badge-neutral { background: #f1f5f9; color: #475569; }

.dark .badge-success { background: rgba(16, 185, 129, 0.18); color: #6ee7b7; }
.dark .badge-danger  { background: rgba(239, 68, 68, 0.18); color: #fca5a5; }
.dark .badge-warning { background: rgba(245, 158, 11, 0.18); color: #fbbf24; }
.dark .badge-info    { background: rgba(59, 130, 246, 0.18); color: #93c5fd; }
.dark .badge-neutral { background: rgba(148, 163, 184, 0.18); color: #cbd5e1; }

/* ================================================================
   Activity Feed (admin dashboard)
   ================================================================ */
.activity-item {
    display: flex;
    gap: 0.75rem;
    align-items: flex-start;
    padding: 0.5rem 0;
    border-bottom: 1px solid #f1f5f9;
}

.activity-item:last-child { border-bottom: none; }

.dark .activity-item { border-bottom-color: #263449; }

.activity-icon {
    width: 32px;
    height: 32px;
    border-radius: 9999px;
    background: #eef2ff;
    color: #4f46e5;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.dark .activity-icon { background: rgba(99, 102, 241, 0.18); color: #a5b4fc; }

/* ================================================================
   Settings Tabs
   ================================================================ */
.settings-tab {
    transition: all 0.2s ease;
}

/* Active state — works with JS-added bg-blue-50 class */
.settings-tab.bg-blue-50 {
    background: rgba(59, 130, 246, 0.08) !important;
    color: #1d4ed8 !important;
    font-weight: 600;
    border-inline-start: 3px solid #3b82f6;
    padding-inline-start: calc(1rem - 3px);
}

/* ================================================================
   Scrollbar Styling
   ================================================================ */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: #f8fafc; }
::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #94a3b8; }

/* ================================================================
   RTL Sidebar
   ================================================================ */
[dir="rtl"] #sidebar {
    border-right: none;
    border-left: none;
}

/* ================================================================
   Form Focus States
   ================================================================ */
input:focus, select:focus, textarea:focus {
    outline: none;
}

/* ================================================================
   Disabled States
   ================================================================ */
button:disabled {
    cursor: not-allowed;
}

/* ================================================================
   Dark Mode
   ================================================================
   The `dark` class is toggled on <html> by assets/js/theme.js.
   Rather than sprinkling dark: variants across every page, we re-skin
   the Tailwind utility classes already in use, scoped under `.dark`.
   ================================================================ */
html.dark { color-scheme: dark; }

.dark body { background-color: #0f172a; }

/* Surfaces */
.dark .bg-white { background-color: #1e293b; }
.dark .bg-slate-50 { background-color: #0f172a; }
.dark .bg-slate-100 { background-color: #334155; }
.dark .bg-gray-50 { background-color: #1e293b; }
.dark .bg-gray-50\/80 { background-color: rgba(30, 41, 59, 0.8); }
.dark .bg-gray-50\/40 { background-color: rgba(30, 41, 59, 0.4); }
.dark .bg-gray-100 { background-color: #334155; }
.dark .hover\:bg-white:hover { background-color: #1e293b; }
.dark .hover\:bg-gray-50:hover { background-color: #263449; }
.dark .hover\:bg-gray-100:hover { background-color: #334155; }
.dark .hover\:bg-slate-50:hover { background-color: #263449; }
.dark .hover\:bg-slate-100:hover { background-color: #334155; }
.dark .focus\:bg-white:focus { background-color: #263449; }

/* Text */
.dark .text-gray-900 { color: #f1f5f9; }
.dark .text-gray-800 { color: #e2e8f0; }
.dark .text-gray-700 { color: #cbd5e1; }
.dark .text-gray-600 { color: #94a3b8; }
.dark .text-gray-500 { color: #94a3b8; }
.dark .text-gray-400 { color: #64748b; }
.dark .text-gray-300 { color: #475569; }
.dark .text-slate-400 { color: #64748b; }
.dark .text-slate-500 { color: #94a3b8; }
.dark .text-slate-600 { color: #94a3b8; }
.dark .text-slate-700 { color: #cbd5e1; }
.dark .hover\:text-gray-600:hover { color: #cbd5e1; }
.dark .hover\:text-gray-800:hover { color: #f1f5f9; }
.dark .hover\:text-gray-900:hover { color: #f8fafc; }
.dark .hover\:text-slate-700:hover { color: #e2e8f0; }
.dark .placeholder\:text-gray-400::placeholder { color: #475569; }
.dark input::placeholder,
.dark textarea::placeholder { color: #64748b; }

/* Borders / dividers */
.dark .border-gray-100 { border-color: #334155; }
.dark .border-gray-100\/80 { border-color: rgba(51, 65, 85, 0.8); }

/* ================================================================
   Mobile Responsive Sidebar
   ================================================================ */

/* Hamburger button — hidden on desktop, shown on mobile */
#sidebar-toggle {
    display: none;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 10px;
    border: 1px solid #e2e8f0;
    background: #f8fafc;
    color: #475569;
    cursor: pointer;
    flex-shrink: 0;
    transition: background .15s;
    margin-right: 10px;
}
[dir="rtl"] #sidebar-toggle { margin-right: 0; margin-left: 10px; }
#sidebar-toggle:hover { background: #f1f5f9; }
.dark #sidebar-toggle { background: rgba(255,255,255,.06); border-color: rgba(255,255,255,.1); color: #94a3b8; }

/* Sidebar overlay backdrop */
#sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.6);
    z-index: 39;
    backdrop-filter: blur(2px);
}
#sidebar-overlay.active { display: block; }

@media (max-width: 767px) {
    #sidebar-toggle { display: flex; }

    /* Push the sidebar off-screen and make it a fixed overlay */
    #sidebar {
        position: fixed !important;
        top: 0;
        bottom: 0;
        left: 0;
        z-index: 40;
        transform: translateX(-100%);
        transition: transform .25s cubic-bezier(.4,0,.2,1);
        width: 260px !important;
        flex-shrink: 0;
    }
    [dir="rtl"] #sidebar {
        left: auto;
        right: 0;
        transform: translateX(100%);
    }

    #sidebar.sidebar-open {
        transform: translateX(0) !important;
        box-shadow: 8px 0 32px rgba(15,23,42,.35);
    }

    /* Let main content take full width */
    #sidebar + div,
    .trader-shell > #sidebar + div,
    .investor-shell > #sidebar + div {
        margin-left: 0 !important;
        width: 100% !important;
    }
}
.dark .border-gray-200 { border-color: #334155; }
.dark .border-gray-300 { border-color: #475569; }
.dark .border-slate-300 { border-color: #475569; }
.dark .hover\:border-gray-200:hover { border-color: #334155; }
.dark .hover\:border-gray-300:hover { border-color: #475569; }
.dark .hover\:border-slate-300:hover { border-color: #475569; }
.dark .divide-gray-100 > :not([hidden]) ~ :not([hidden]) { border-color: #334155; }
.dark .divide-gray-50 > :not([hidden]) ~ :not([hidden]) { border-color: #1e293b; }

/* Status / badge tints (soften saturated light backgrounds) */
.dark .bg-blue-50 { background-color: rgba(59, 130, 246, 0.14); }
.dark .bg-blue-100 { background-color: rgba(59, 130, 246, 0.2); }
.dark .bg-emerald-50 { background-color: rgba(16, 185, 129, 0.14); }
.dark .bg-emerald-100 { background-color: rgba(16, 185, 129, 0.2); }
.dark .bg-amber-50 { background-color: rgba(245, 158, 11, 0.14); }
.dark .bg-amber-100 { background-color: rgba(245, 158, 11, 0.2); }
.dark .bg-red-50 { background-color: rgba(239, 68, 68, 0.14); }
.dark .bg-red-100 { background-color: rgba(239, 68, 68, 0.2); }
.dark .bg-green-50 { background-color: rgba(34, 197, 94, 0.14); }
.dark .bg-green-100 { background-color: rgba(34, 197, 94, 0.2); }
.dark .bg-yellow-50 { background-color: rgba(234, 179, 8, 0.14); }
.dark .bg-yellow-100 { background-color: rgba(234, 179, 8, 0.2); }
.dark .bg-indigo-50 { background-color: rgba(99, 102, 241, 0.14); }
.dark .bg-teal-50 { background-color: rgba(20, 184, 166, 0.14); }
.dark .ring-gray-100 { --tw-ring-color: rgba(148, 163, 184, 0.25); }
.dark .ring-green-100 { --tw-ring-color: rgba(34, 197, 94, 0.25); }
.dark .ring-yellow-100 { --tw-ring-color: rgba(234, 179, 8, 0.25); }
.dark .text-blue-700 { color: #93c5fd; }
.dark .text-emerald-700 { color: #6ee7b7; }
.dark .text-emerald-800 { color: #6ee7b7; }
.dark .text-amber-600 { color: #fbbf24; }
.dark .text-red-700 { color: #fca5a5; }
.dark .text-green-700 { color: #86efac; }
.dark .text-green-800 { color: #86efac; }
.dark .text-yellow-800 { color: #fde68a; }
.dark .border-green-200 { border-color: rgba(34, 197, 94, 0.3); }
.dark .border-yellow-200 { border-color: rgba(234, 179, 8, 0.3); }
.dark .border-blue-200 { border-color: rgba(59, 130, 246, 0.3); }

/* Settings active-tab highlight (base rule uses !important) */
.dark .settings-tab.bg-blue-50 {
    background: rgba(59, 130, 246, 0.16) !important;
    color: #93c5fd !important;
}

/* Table row hover */
.dark tbody tr:hover { background-color: rgba(51, 65, 85, 0.4); }

/* Skeleton loading shimmer */
.dark .skeleton {
    background: linear-gradient(90deg, #1e293b 25%, #273449 50%, #1e293b 75%);
    background-size: 200% 100%;
}

/* Scrollbar */
.dark ::-webkit-scrollbar-track { background: #0f172a; }
.dark ::-webkit-scrollbar-thumb { background: #334155; }
.dark ::-webkit-scrollbar-thumb:hover { background: #475569; }

/* Theme toggle button icon swap */
#theme-toggle .icon-sun { display: none; }
#theme-toggle .icon-moon { display: block; }
.dark #theme-toggle .icon-sun { display: block; }
.dark #theme-toggle .icon-moon { display: none; }

/* ================================================================
   Dashboard Enhancements
   ================================================================ */

/* Active user pills on stat cards */
.stat-active-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.15rem 0.6rem;
    border-radius: 9999px;
    font-size: 0.7rem;
    font-weight: 600;
}
.stat-active-pill.blue    { background: rgba(59,130,246,0.12); color: #2563eb; }
.stat-active-pill.emerald { background: rgba(16,185,129,0.12); color: #059669; }
.dark .stat-active-pill.blue    { background: rgba(59,130,246,0.2); color: #93c5fd; }
.dark .stat-active-pill.emerald { background: rgba(16,185,129,0.2); color: #6ee7b7; }

/* Order breakdown pills (failed / pending) */
.stat-breakdown-pill {
    display: inline-flex;
    align-items: center;
    padding: 0.1rem 0.55rem;
    border-radius: 9999px;
    font-size: 0.68rem;
    font-weight: 600;
}
.stat-breakdown-pill.red   { background: rgba(239,68,68,0.1);  color: #dc2626; }
.stat-breakdown-pill.amber { background: rgba(245,158,11,0.1); color: #d97706; }
.dark .stat-breakdown-pill.red   { background: rgba(239,68,68,0.18);  color: #fca5a5; }
.dark .stat-breakdown-pill.amber { background: rgba(245,158,11,0.18); color: #fbbf24; }

/* 7-day Sparkline */
.sparkline-bar-wrap {
    position: relative;
}
.sparkline-bar {
    background: linear-gradient(180deg, #3b82f6 0%, #6366f1 100%);
    opacity: 0.75;
    min-height: 3px;
    transition: opacity 0.15s;
}
.sparkline-bar:hover { opacity: 1; }
.sparkline-bar-today {
    background: linear-gradient(180deg, #3b82f6 0%, #2563eb 100%);
    opacity: 1;
    box-shadow: 0 0 8px rgba(59,130,246,0.5);
}
.dark .sparkline-bar        { background: linear-gradient(180deg, #6366f1 0%, #4f46e5 100%); }
.dark .sparkline-bar-today  { background: linear-gradient(180deg, #60a5fa 0%, #3b82f6 100%); box-shadow: 0 0 8px rgba(96,165,250,0.4); }

/* System Health chip rows */
.health-chip-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    padding: 0.55rem 0.75rem;
    border-radius: 12px;
    border: 1px solid #f1f5f9;
    text-decoration: none;
    transition: border-color 0.15s, background 0.15s;
}
.health-chip-row:hover {
    border-color: #bfdbfe;
    background: rgba(239,246,255,0.6);
}
.dark .health-chip-row        { border-color: rgba(148,163,184,0.15); }
.dark .health-chip-row:hover  { border-color: rgba(99,102,241,0.4); background: rgba(99,102,241,0.08); }

/* Health indicator dots */
.health-dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    flex-shrink: 0;
    background: #cbd5e1;
}
.health-dot-green { background: #10b981; box-shadow: 0 0 0 0 rgba(16,185,129,0.6); animation: health-pulse 2s infinite; }
.health-dot-amber { background: #f59e0b; }
.health-dot-red   { background: #ef4444; }
.health-dot-info  { background: #6366f1; }

@keyframes health-pulse {
    0%   { box-shadow: 0 0 0 0 rgba(16,185,129,0.55); }
    70%  { box-shadow: 0 0 0 6px rgba(16,185,129,0); }
    100% { box-shadow: 0 0 0 0 rgba(16,185,129,0); }
}

/* Health badge chips */
.health-chip-badge {
    flex-shrink: 0;
    font-size: 0.68rem;
    font-weight: 600;
    padding: 0.15rem 0.55rem;
    border-radius: 9999px;
    white-space: nowrap;
}
.health-chip-badge.green { background: rgba(16,185,129,0.12); color: #059669; }
.health-chip-badge.amber { background: rgba(245,158,11,0.12); color: #d97706; }
.health-chip-badge.red   { background: rgba(239,68,68,0.12);  color: #dc2626; }
.health-chip-badge.gray  { background: #f1f5f9;               color: #64748b; }
.health-chip-badge.info  { background: rgba(99,102,241,0.12); color: #4f46e5; }
.dark .health-chip-badge.green { background: rgba(16,185,129,0.2);  color: #6ee7b7; }
.dark .health-chip-badge.amber { background: rgba(245,158,11,0.2);  color: #fbbf24; }
.dark .health-chip-badge.red   { background: rgba(239,68,68,0.2);   color: #fca5a5; }
.dark .health-chip-badge.gray  { background: rgba(148,163,184,0.15); color: #94a3b8; }
.dark .health-chip-badge.info  { background: rgba(99,102,241,0.2);  color: #a5b4fc; }

/* Top Traders rows */
.top-trader-row {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.45rem 0.6rem;
    border-radius: 10px;
    text-decoration: none;
    transition: background 0.15s;
}
.top-trader-row:hover { background: rgba(239,246,255,0.8); }
.dark .top-trader-row:hover { background: rgba(99,102,241,0.08); }

.top-trader-rank {
    flex-shrink: 0;
    width: 18px;
    font-size: 0.68rem;
    font-weight: 700;
    color: #94a3b8;
    text-align: center;
}
.top-trader-avatar {
    flex-shrink: 0;
    width: 28px;
    height: 28px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    font-weight: 700;
    color: white;
}
.top-trader-avatar.blue    { background: linear-gradient(135deg,#3b82f6,#6366f1); }
.top-trader-avatar.violet  { background: linear-gradient(135deg,#8b5cf6,#7c3aed); }
.top-trader-avatar.emerald { background: linear-gradient(135deg,#10b981,#059669); }
.top-trader-avatar.amber   { background: linear-gradient(135deg,#f59e0b,#f97316); }
.top-trader-avatar.rose    { background: linear-gradient(135deg,#f43f5e,#e11d48); }

.top-trader-count {
    flex-shrink: 0;
    font-size: 0.68rem;
    font-weight: 600;
    color: #64748b;
    background: #f8fafc;
    padding: 0.1rem 0.45rem;
    border-radius: 9999px;
    border: 1px solid #e2e8f0;
}
.dark .top-trader-count {
    background: rgba(148,163,184,0.1);
    border-color: rgba(148,163,184,0.2);
    color: #94a3b8;
}

/* ================================================================
   Sidebar Collapse (Desktop)
   ================================================================ */
#sidebar-collapse-btn {
    display: none;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 0.6rem 0;
    color: #64748b;
    background: transparent;
    border: none;
    border-top: 1px solid rgba(255,255,255,0.07);
    cursor: pointer;
    transition: color 0.15s, background 0.15s;
    flex-shrink: 0;
}
#sidebar-collapse-btn:hover { color: #94a3b8; background: rgba(255,255,255,0.04); }

@media (min-width: 768px) {
    #sidebar-collapse-btn { display: flex; }

    #sidebar {
        transition: width 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    }

    #sidebar.sidebar-collapsed {
        width: 70px !important;
    }

    /* Hide text labels when collapsed */
    #sidebar.sidebar-collapsed .nav-link span,
    #sidebar.sidebar-collapsed .sidebar-section-label,
    #sidebar.sidebar-collapsed .sidebar-brand-text {
        display: none;
    }

    /* Center nav icons when collapsed */
    #sidebar.sidebar-collapsed .nav-link {
        justify-content: center;
        padding-left: 0;
        padding-right: 0;
        position: relative;
    }
    #sidebar.sidebar-collapsed .nav-icon-wrap {
        margin: 0 auto;
    }

    /* Hide nav dividers' section labels */
    #sidebar.sidebar-collapsed p.text-\[10px\] {
        display: none;
    }

    /* Tooltip on hover when collapsed */
    #sidebar.sidebar-collapsed .nav-link:hover::after {
        content: attr(data-tooltip);
        position: absolute;
        left: calc(100% + 12px);
        top: 50%;
        transform: translateY(-50%);
        background: #1e293b;
        color: #f1f5f9;
        font-size: 0.72rem;
        font-weight: 500;
        white-space: nowrap;
        padding: 0.3rem 0.65rem;
        border-radius: 8px;
        pointer-events: none;
        box-shadow: 0 4px 12px rgba(0,0,0,0.25);
        z-index: 50;
    }

    /* Collapse toggle icon rotation */
    #sidebar-collapse-btn .collapse-icon {
        transition: transform 0.25s;
    }
    #sidebar.sidebar-collapsed #sidebar-collapse-btn .collapse-icon {
        transform: rotate(180deg);
    }
}
