// User-facing screens: Sidebar, Dashboard, BotsList, BotDetail, History, Deposit, KYC. const BOT_COLORS = ['#1f8a5b', '#4f46e5', '#dc2626', '#0891b2', '#f97316', '#a855f7', '#0ea5e9', '#84cc16']; const colorFor = (id) => BOT_COLORS[id % BOT_COLORS.length]; const emojiFor = (cat) => ({ conservative: '〰', moderate: '⬢', aggressive: '⚡' })[cat] || '◆'; function Sidebar({ route, setRoute, isAdmin, adminView, setAdminView, user, signOut }) { const userNav = [ { id: 'dashboard', label: 'Dashboard', icon: IconDash }, { id: 'bots', label: 'Bots', icon: IconBot }, { id: 'history', label: 'Transactions', icon: IconClock }, { id: 'deposit', label: 'Deposit', icon: IconPlus }, { id: 'kyc', label: 'Verification', icon: IconID }, ]; const adminNav = [ { id: 'admin', label: 'God View', icon: IconDash }, { id: 'stats', label: 'Stats', icon: IconChart }, { id: 'funding', label: 'Funding', icon: IconChart }, { id: 'backtest', label: 'Backtest', icon: IconChart }, { id: 'approvals', label: 'Approvals', icon: IconQueue }, { id: 'users', label: 'Users', icon: IconUser }, { id: 'killswitch', label: 'Bot Control', icon: IconPower }, { id: 'exchange', label: 'Exchange', icon: IconExchange }, { id: 'settings', label: 'Settings', icon: IconSettings }, ]; const filteredUserNav = (user && user.role !== 'admin' && user.approval_status !== 'approved') ? userNav.filter(it => it.id === 'kyc') : userNav; const nav = adminView ? adminNav : filteredUserNav; const initials = (user?.full_name || user?.username || 'A').split(' ').map(s => s[0]).join('').slice(0,2).toUpperCase(); return ( <> {/* Mobile-only floating logout — sidebar-foot is hidden on mobile, and the bottom-nav has no room. Rendered as a SIBLING of