Spaces:
Sleeping
feat: improved light mode + language sync to html lang attribute
Browse files- globals.css: richer CSS variable system (--fg-muted, --fg-subtle, --card-hover,
--border-strong, --navbar-bg, --sidebar-bg, --ambient-*) with proper light mode values
- DashboardLayout: removed hardcoded bg-[#050505]/text-white, uses CSS vars + theme-aware ambient blobs
- Navbar: search input, divider, avatar all use CSS vars / isLight conditionals
- Sidebar: fully rewritten with CSS var system, improved lang dropdown with animation
- NotificationPanel: complete light mode overhaul, type-aware bg colors per mode
- page.tsx (dashboard): all hardcoded zinc/white colors replaced with CSS vars,
stat cards with light gradients, chart tick/grid colors adapt to theme
- AppShell: useEffect syncs document.documentElement.lang to BCP-47 code on lang change
- backend ai/chat + router + websocket: language param threaded through to AI backends
Files changed (12)
- backend/app/ai/chat.py+13-12
- backend/app/ai/router.py+2-1
- backend/app/websocket/router.py+2-1
- frontend/src/app/globals.css+78-24
- frontend/src/app/layout.tsx+7-3
- frontend/src/app/page.tsx+157-79
- frontend/src/components/layout/AppShell.tsx+16-3
- frontend/src/components/layout/DashboardLayout.tsx+38-14
- frontend/src/components/layout/Navbar.tsx+28-7
- frontend/src/components/layout/Sidebar.tsx+179-70
- frontend/src/components/notifications/NotificationPanel.tsx+99-30
- frontend/src/lib/stores/languageStore.ts+66-12
273 unmodified lines2742752762772782792807 unmodified lines2882892902912922931 unmodified line29529629729829930030128 unmodified lines3303313323333343353363 unmodified lines34034134234334434534634734834935035135238 unmodified lines3913923933943953963973983994004014024034044054064074084093 unmodified lines4134144154164174184192 unmodified lines42242342442542642742852 unmodified lines481482483484485486487488489490491492493273 unmodified lines"""return contextdef get_contextual_system_prompt(db: Session, user_id: str) -> str:"""Constructs a highly specific system prompt containing the user's financial profile."""7 unmodified lines3. Be concise and specific — 2-5 sentences max. No generic advice.4. If asked about balance, quote the exact figure. If asked about spending, reference actual transactions. If asked about goals, quote exact progress.5. Speak like a personal banker who knows this client's finances intimately.THIS USER'S LIVE FINANCIAL DATA:{financial_context}1 unmodified lineYou have read-only access to this data. Use it to answer every question with precision."""return system_promptdef get_offline_chat_fallback(db: Session, user_id: str, prompt: str) -> str:"""Generates a localized, rule-grounded financial analyst reply when AI engines are offline."""28 unmodified lines)def get_chat_response(db: Session, user_id: str, prompt: str, session_id: str | None = None) -> tuple[str, str]:"""Returns (assistant reply, session_id) grounded in database context.3 unmodified linessession = chat_memory.ensure_session(db, user_id, session_id)if not has_active_ai_backend():fallback_msg = get_offline_chat_fallback(db, user_id, prompt)chat_memory.add_message(db, session, user_id, "user", prompt)chat_memory.add_message(db, session, user_id, "assistant", fallback_msg)return fallback_msg, session.id# Build full message list: system prompt with real account data + history + new messagesys_prompt = get_contextual_system_prompt(db, user_id)history = chat_memory.get_history(db, session.id)full_messages = [{"role": "system", "content": sys_prompt}]38 unmodified linesif not response_content:try:from app.ai.ollama_integration import get_ollama_responseresponse_content = get_ollama_response(prompt, history=history, language="English")except Exception as e:print(f"Ollama error in chat: {e}")if not response_content:response_content = get_offline_chat_fallback(db, user_id, prompt)chat_memory.add_message(db, session, user_id, "user", prompt)chat_memory.add_message(db, session, user_id, "assistant", response_content)return response_content, session.iddef stream_chat_response(db: Session, user_id: str, prompt: str, session_id: str | None = None):"""Generates streaming chunks for WebSocket or HTTP SSE.3 unmodified linessession = chat_memory.ensure_session(db, user_id, session_id)if not has_active_ai_backend():fallback_msg = get_offline_chat_fallback(db, user_id, prompt)chat_memory.add_message(db, session, user_id, "user", prompt)chat_memory.add_message(db, session, user_id, "assistant", fallback_msg)import time2 unmodified linestime.sleep(0.05)returnsys_prompt = get_contextual_system_prompt(db, user_id)history = chat_memory.get_history(db, session.id)full_messages = [{"role": "system", "content": sys_prompt}]52 unmodified linestry:from app.ai.ollama_integration import stream_ollama_responsefor chunk in stream_ollama_response(prompt, history=history, language="English"):if chunk:complete_reply += chunkyield chunkchat_memory.add_message(db, session, user_id, "assistant", complete_reply)except Exception as e:print(f"Ollama streaming error: {e}")fallback_msg = get_offline_chat_fallback(db, user_id, prompt)yield fallback_msgchat_memory.add_message(db, session, user_id, "assistant", fallback_msg)273 unmodified lines2742752762772782792807 unmodified lines2882892902912922932941 unmodified line29629729829930030130228 unmodified lines3313323333343353363373 unmodified lines34134234334434534634734834935035135235338 unmodified lines3923933943953963973983994004014024034044054064074084094103 unmodified lines4144154164174184194202 unmodified lines42342442542642742842952 unmodified lines482483484485486487488489490491492493494273 unmodified lines"""return contextdef get_contextual_system_prompt(db: Session, user_id: str, language: str = "English") -> str:"""Constructs a highly specific system prompt containing the user's financial profile."""7 unmodified lines3. Be concise and specific — 2-5 sentences max. No generic advice.4. If asked about balance, quote the exact figure. If asked about spending, reference actual transactions. If asked about goals, quote exact progress.5. Speak like a personal banker who knows this client's finances intimately.6. ALWAYS communicate in {language}.THIS USER'S LIVE FINANCIAL DATA:{financial_context}1 unmodified lineYou have read-only access to this data. Use it to answer every question with precision."""return system_promptdef get_offline_chat_fallback(db: Session, user_id: str, prompt: str, language: str = "English") -> str:"""Generates a localized, rule-grounded financial analyst reply when AI engines are offline."""28 unmodified lines)def get_chat_response(db: Session, user_id: str, prompt: str, session_id: str | None = None, language: str = "English") -> tuple[str, str]:"""Returns (assistant reply, session_id) grounded in database context.3 unmodified linessession = chat_memory.ensure_session(db, user_id, session_id)if not has_active_ai_backend():fallback_msg = get_offline_chat_fallback(db, user_id, prompt, language=language)chat_memory.add_message(db, session, user_id, "user", prompt)chat_memory.add_message(db, session, user_id, "assistant", fallback_msg)return fallback_msg, session.id# Build full message list: system prompt with real account data + history + new messagesys_prompt = get_contextual_system_prompt(db, user_id, language=language)history = chat_memory.get_history(db, session.id)full_messages = [{"role": "system", "content": sys_prompt}]38 unmodified linesif not response_content:try:from app.ai.ollama_integration import get_ollama_responseresponse_content = get_ollama_response(prompt, history=history, language=language)except Exception as e:print(f"Ollama error in chat: {e}")if not response_content:response_content = get_offline_chat_fallback(db, user_id, prompt, language=language)chat_memory.add_message(db, session, user_id, "user", prompt)chat_memory.add_message(db, session, user_id, "assistant", response_content)return response_content, session.iddef stream_chat_response(db: Session, user_id: str, prompt: str, session_id: str | None = None, language: str = "English"):"""Generates streaming chunks for WebSocket or HTTP SSE.3 unmodified linessession = chat_memory.ensure_session(db, user_id, session_id)if not has_active_ai_backend():fallback_msg = get_offline_chat_fallback(db, user_id, prompt, language=language)chat_memory.add_message(db, session, user_id, "user", prompt)chat_memory.add_message(db, session, user_id, "assistant", fallback_msg)import time2 unmodified linestime.sleep(0.05)returnsys_prompt = get_contextual_system_prompt(db, user_id, language=language)history = chat_memory.get_history(db, session.id)full_messages = [{"role": "system", "content": sys_prompt}]52 unmodified linestry:from app.ai.ollama_integration import stream_ollama_responsefor chunk in stream_ollama_response(prompt, history=history, language=language):if chunk:complete_reply += chunkyield chunkchat_memory.add_message(db, session, user_id, "assistant", complete_reply)except Exception as e:print(f"Ollama streaming error: {e}")fallback_msg = get_offline_chat_fallback(db, user_id, prompt, language=language)yield fallback_msgchat_memory.add_message(db, session, user_id, "assistant", fallback_msg)
44 unmodified lines454647484950198 unmodified lines24925025125225325425544 unmodified linesclass ChatMessageRequest(BaseModel):message: strsession_id: Optional[str] = Noneclass ChatSessionCreateRequest(BaseModel):title: Optional[str] = "New chat"198 unmodified lines@router.post("/chat")def post_chat(req: ChatMessageRequest, user_id: Optional[str] = None, db: Session = Depends(get_db)):uid = get_user_id_fallback(db, user_id)response_msg, session_id = get_chat_response(db, uid, req.message, req.session_id)return {"response": response_msg, "session_id": session_id}44 unmodified lines45464748495051198 unmodified lines25025125225325425525644 unmodified linesclass ChatMessageRequest(BaseModel):message: strsession_id: Optional[str] = Nonelanguage: str = "English"class ChatSessionCreateRequest(BaseModel):title: Optional[str] = "New chat"198 unmodified lines@router.post("/chat")def post_chat(req: ChatMessageRequest, user_id: Optional[str] = None, db: Session = Depends(get_db)):uid = get_user_id_fallback(db, user_id)response_msg, session_id = get_chat_response(db, uid, req.message, req.session_id, req.language)return {"response": response_msg, "session_id": session_id}
114 unmodified lines115116117118119120121114 unmodified linestry:ws_session_id = payload.get("session_id")for chunk in stream_chat_response(db, user_id, prompt, ws_session_id):if chunk:await websocket.send_json({"type": "chat_chunk", "content": chunk})except Exception as e:114 unmodified lines115116117118119120121122114 unmodified linestry:ws_session_id = payload.get("session_id")ws_language = payload.get("language", "English")for chunk in stream_chat_response(db, user_id, prompt, ws_session_id, language=ws_language):if chunk:await websocket.send_json({"type": "chat_chunk", "content": chunk})except Exception as e:
7 unmodified lines8910111213141516171819202122232425261 unmodified line282930313233346 unmodified lines41424344454647484950515253545556575859606162636465666768697071727374757677787980818283849 unmodified lines9495969798991003 unmodified lines10410510610710810923 unmodified lines13313413513613713811 unmodified lines1501511521531541557 unmodified lines--background: 0 0% 3%;--foreground: 0 0% 98%;--radius: 0.625rem;--bg: #050505;--fg: #fafafa;--card-bg: rgba(255,255,255,0.04);--border: rgba(255,255,255,0.08);--muted: #71717a;}html.light {--bg: #f4f6f9;--fg: #0f172a;--card-bg: rgba(255,255,255,0.85);--border: rgba(0,0,0,0.08);--muted: #64748b;}* { border-color: var(--border); box-sizing: border-box; }1 unmodified linebody {background-color: var(--bg);color: var(--fg);transition: background-color 0.2s, color 0.2s;}html { font-family: var(--font-sans, ui-sans-serif, system-ui, sans-serif); }6 unmodified lines}.glass {background: rgba(255, 255, 255, 0.05);backdrop-filter: blur(20px);-webkit-backdrop-filter: blur(20px);border: 1px solid rgba(255, 255, 255, 0.10);}.glass-strong {background: rgba(255, 255, 255, 0.10);backdrop-filter: blur(32px);-webkit-backdrop-filter: blur(32px);border: 1px solid rgba(255, 255, 255, 0.20);}.glass-card {border-radius: 1rem;background: rgba(255, 255, 255, 0.04);backdrop-filter: blur(20px);-webkit-backdrop-filter: blur(20px);border: 1px solid rgba(255, 255, 255, 0.08);box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);}/* Light mode overrides */html.light .glass-card {background: rgba(255,255,255,0.85);border: 1px solid rgba(0,0,0,0.08);box-shadow: 0 4px 24px rgba(0,0,0,0.08);}html.light .glass {background: rgba(255,255,255,0.7);border: 1px solid rgba(0,0,0,0.08);}html.light .shimmer {background: linear-gradient(90deg, rgba(0,0,0,0.04) 0%, rgba(0,0,0,0.08) 50%, rgba(0,0,0,0.04) 100%);background-size: 200% 100%;animation: shimmer 1.5s infinite;}/* Gradient text */.gradient-text {background: linear-gradient(135deg, #60a5fa, #22d3ee, #34d399);9 unmodified lines-webkit-text-fill-color: transparent;}/* Glow effects */.glow-blue {box-shadow: 0 0 30px rgba(59, 130, 246, 0.3), 0 0 60px rgba(59, 130, 246, 0.1);}3 unmodified lines.glow-purple {box-shadow: 0 0 30px rgba(139, 92, 246, 0.3), 0 0 60px rgba(139, 92, 246, 0.1);}/* Streaming text cursor */.streaming-cursor::after {23 unmodified linesbackground-size: 200% 200%;animation: gradient-shift 4s ease infinite;}}/* ─── Custom scrollbar ───────────────────────────────────────────────────────── */11 unmodified lines::-webkit-scrollbar-thumb:hover {background: rgba(255, 255, 255, 0.2);}/* ─── Keyframes ──────────────────────────────────────────────────────────────── */@keyframes blink {7 unmodified lines891011121314151617181920212223242526272829303132333435363738394041424344454647481 unmodified line505152535455566 unmodified lines636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201219 unmodified lines1311321331341351361373 unmodified lines14114214314414514614714814923 unmodified lines17317417517617717817918018118218318418518611 unmodified lines1981992002012022032042052062072082097 unmodified lines--background: 0 0% 3%;--foreground: 0 0% 98%;--radius: 0.625rem;/* Dark mode (default) */--bg: #050505;--bg-secondary:#0d0d0d;--fg: #fafafa;--fg-muted: #a1a1aa;--fg-subtle: #71717a;--card-bg: rgba(255,255,255,0.04);--card-hover: rgba(255,255,255,0.06);--border: rgba(255,255,255,0.08);--border-strong: rgba(255,255,255,0.14);--input-bg: rgba(255,255,255,0.05);--navbar-bg: rgba(0,0,0,0.5);--sidebar-bg: rgba(0,0,0,0.6);--ambient-1: rgba(37,99,235,0.10);--ambient-2: rgba(5,150,105,0.10);--ambient-3: rgba(124,58,237,0.05);}html.light {--bg: #f0f4f8;--bg-secondary:#e8edf3;--fg: #0f172a;--fg-muted: #475569;--fg-subtle: #94a3b8;--card-bg: rgba(255,255,255,0.95);--card-hover: rgba(255,255,255,1);--border: rgba(15,23,42,0.10);--border-strong: rgba(15,23,42,0.18);--input-bg: rgba(255,255,255,0.9);--navbar-bg: rgba(240,244,248,0.90);--sidebar-bg: rgba(255,255,255,0.97);--ambient-1: rgba(37,99,235,0.06);--ambient-2: rgba(5,150,105,0.06);--ambient-3: rgba(124,58,237,0.04);}* { border-color: var(--border); box-sizing: border-box; }1 unmodified linebody {background-color: var(--bg);color: var(--fg);transition: background-color 0.25s ease, color 0.25s ease;}html { font-family: var(--font-sans, ui-sans-serif, system-ui, sans-serif); }6 unmodified lines}.glass {background: var(--card-bg);backdrop-filter: blur(20px);-webkit-backdrop-filter: blur(20px);border: 1px solid var(--border);}.glass-strong {background: rgba(255, 255, 255, 0.10);backdrop-filter: blur(32px);-webkit-backdrop-filter: blur(32px);border: 1px solid var(--border-strong);}html.light .glass-strong {background: rgba(255,255,255,0.95);}.glass-card {border-radius: 1rem;background: var(--card-bg);backdrop-filter: blur(20px);-webkit-backdrop-filter: blur(20px);border: 1px solid var(--border);box-shadow: 0 20px 40px rgba(0,0,0,0.25);transition: background 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;}/* Light mode overrides */html.light .glass-card {background: var(--card-bg);border: 1px solid var(--border);box-shadow: 0 2px 16px rgba(15,23,42,0.08), 0 1px 4px rgba(15,23,42,0.06);}html.light .glass {background: rgba(255,255,255,0.80);border: 1px solid var(--border);}html.light .shimmer {background: linear-gradient(90deg, rgba(15,23,42,0.04) 0%, rgba(15,23,42,0.09) 50%, rgba(15,23,42,0.04) 100%);background-size: 200% 100%;animation: shimmer 1.5s infinite;}/* ── Adaptive text helpers ── */.text-adaptive {color: var(--fg);}.text-adaptive-muted {color: var(--fg-muted);}.text-adaptive-subtle {color: var(--fg-subtle);}/* Gradient text */.gradient-text {background: linear-gradient(135deg, #60a5fa, #22d3ee, #34d399);9 unmodified lines-webkit-text-fill-color: transparent;}/* Glow effects (toned down in light mode) */.glow-blue {box-shadow: 0 0 30px rgba(59, 130, 246, 0.3), 0 0 60px rgba(59, 130, 246, 0.1);}3 unmodified lines.glow-purple {box-shadow: 0 0 30px rgba(139, 92, 246, 0.3), 0 0 60px rgba(139, 92, 246, 0.1);}html.light .glow-blue { box-shadow: 0 0 20px rgba(59,130,246,0.15); }html.light .glow-emerald{ box-shadow: 0 0 20px rgba(16,185,129,0.15); }html.light .glow-purple { box-shadow: 0 0 20px rgba(139,92,246,0.15); }/* Streaming text cursor */.streaming-cursor::after {23 unmodified linesbackground-size: 200% 200%;animation: gradient-shift 4s ease infinite;}/* ── Light mode chart / tooltip fixes ── */html.light .recharts-cartesian-grid line {stroke: rgba(15,23,42,0.07) !important;}html.light .recharts-text {fill: #64748b !important;}}/* ─── Custom scrollbar ───────────────────────────────────────────────────────── */11 unmodified lines::-webkit-scrollbar-thumb:hover {background: rgba(255, 255, 255, 0.2);}html.light ::-webkit-scrollbar-thumb {background: rgba(15,23,42,0.15);}html.light ::-webkit-scrollbar-thumb:hover {background: rgba(15,23,42,0.25);}/* ─── Keyframes ──────────────────────────────────────────────────────────────── */@keyframes blink {
1234567894 unmodified lines1415161718192021import type { Metadata } from "next";import { Inter } from "next/font/google";import "./globals.css";import { AppShell } from "@/components/layout/AppShell";const inter = Inter({ subsets: ["latin"], variable: "--font-sans" });export const metadata: Metadata = {title: "BankBot AI | Modern Banking",4 unmodified lineschildren,}: Readonly<{ children: React.ReactNode }>) {return (<html lang="en" className="dark"><body className={`${inter.variable} font-sans antialiased`}><AppShell>{children}</AppShell></body></html>1234567891011124 unmodified lines171819202122232425import type { Metadata } from "next";import localFont from "next/font/local";import "./globals.css";import { AppShell } from "@/components/layout/AppShell";const geistSans = localFont({src: "./fonts/GeistVF.woff",variable: "--font-sans",});export const metadata: Metadata = {title: "BankBot AI | Modern Banking",4 unmodified lineschildren,}: Readonly<{ children: React.ReactNode }>) {return (// lang is updated client-side by AppShell via useEffect<html lang="en" className="dark"><body className={`${geistSans.variable} font-sans antialiased`}><AppShell>{children}</AppShell></body></html>
12 unmodified lines13141516171827 unmodified lines46474849505152535455568 unmodified lines65666768697071727374757677787980818283848586878889909192939495969798991001011021031044 unmodified lines1091101111121131143 unmodified lines11811912012112212312412512618 unmodified lines1451461471481491501511521531541551 unmodified line1571581591601611621631641651661671681692 unmodified lines1721731741751761771781791801811823 unmodified lines1861871881891901911921931941951961971981992002012022032042052 unmodified lines2082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482493 unmodified lines25325425525625725825926026126226326426526626726826927010 unmodified lines2812822832842852862872882892902912922932946 unmodified lines3013023033043053063073081 unmodified line3103113123133143153163 unmodified lines3203213223233243253269 unmodified lines3363373383393403413423433443452 unmodified lines3483493503513523533547 unmodified lines3623633643653663673683693703713725 unmodified lines3783793803813823833843853863873883893903913923933943953963973983994004014024034044054 unmodified lines41041141241341441541641741841942042142242342442542642742842943012 unmodified lines} from "recharts";import { useDashboardStore } from "@/lib/stores/dashboardStore";import { useAuthStore } from "@/lib/stores/authStore";import Link from "next/link";// ─── Category colors ──────────────────────────────────────────────────────────27 unmodified linesif (!active || !payload?.length) return null;return (<div className="glass-card p-3 text-xs space-y-1 min-w-[140px]"><p className="text-zinc-400 font-medium mb-2">{label}</p>{payload.map((entry) => (<div key={entry.name} className="flex justify-between gap-4"><span style={{ color: entry.color }}>{entry.name}</span><span className="text-white font-semibold">${entry.value.toLocaleString()}</span></div>))}</div>8 unmodified linespositive?: boolean;icon: React.ElementType;gradient: string;iconColor: string;borderColor: string;loading?: boolean;}function StatCard({ title, value, change, positive, icon: Icon, gradient, iconColor, borderColor, loading }: StatCardProps) {return (<motion.divvariants={itemVariants}whileHover={{ scale: 1.02, y: -2 }}className={`relative overflow-hidden rounded-2xl border ${borderColor} bg-gradient-to-br ${gradient} backdrop-blur-xl p-6 cursor-pointer group`}><div className="absolute inset-0 opacity-0 group-hover:opacity-100 transition-opacity duration-300 bg-white/[0.02]" /><div className="flex items-start justify-between"><div><p className="text-xs font-medium text-zinc-400 uppercase tracking-wider">{title}</p>{loading ? (<Skeleton className="mt-2 h-8 w-28" />) : (<p className="mt-2 text-2xl font-bold text-white tracking-tight">{value}</p>)}</div><div className="flex h-10 w-10 items-center justify-center rounded-xl bg-white/5 border border-white/10"><Icon className={`h-5 w-5 ${iconColor}`} /></div></div>{change && !loading && (<div className="mt-4 flex items-center gap-1.5">{positive ? (<ArrowUpRight className="h-3.5 w-3.5 text-emerald-400" />) : (<ArrowDownRight className="h-3.5 w-3.5 text-red-400" />)}<span className={`text-xs font-semibold ${positive ? "text-emerald-400" : "text-red-400"}`}>{change}</span><span className="text-xs text-zinc-500">vs last month</span></div>)}</motion.div>4 unmodified linesexport default function Home() {const { data, isLoading, error, fetch } = useDashboardStore();const { user } = useAuthStore();useEffect(() => {fetch();3 unmodified linesconst greeting = () => {const h = new Date().getHours();if (h < 12) return "Good morning";if (h < 17) return "Good afternoon";return "Good evening";};const briefingText = data?.ai_briefing18 unmodified lines>{/* Header */}<motion.div variants={itemVariants}><h1 className="text-3xl font-bold tracking-tight text-white">{greeting()}, <span className="gradient-text">{firstName}</span> 👋</h1><p className="text-zinc-400 mt-1 text-sm">Here's your financial overview for today.</p></motion.div>1 unmodified line{error && (<motion.divvariants={itemVariants}className="flex items-center gap-3 rounded-2xl border border-amber-500/20 bg-amber-500/5 px-5 py-3"><AlertTriangle className="h-4 w-4 text-amber-400 flex-shrink-0" /><p className="text-xs text-zinc-400"><span className="text-amber-400 font-medium">Backend offline</span> — showing cached data.{" "}<button onClick={() => fetch(undefined, true)} className="underline hover:text-white transition-colors">Retry</button></p></motion.div>2 unmodified lines{/* AI Briefing */}<motion.divvariants={itemVariants}className="relative overflow-hidden rounded-2xl border border-emerald-500/20 bg-gradient-to-r from-emerald-500/10 via-cyan-500/5 to-blue-500/10 p-4"><div className="relative flex items-center gap-3"><div className="flex h-9 w-9 items-center justify-center rounded-xl bg-emerald-500/20 border border-emerald-500/30 flex-shrink-0"><Sparkles className="h-4 w-4 text-emerald-400" /></div><div className="flex-1 min-w-0">{isLoading ? (3 unmodified lines</>) : (<><p className="text-sm font-medium text-white">AI Daily Briefing —{" "}<span className="text-emerald-400">{briefingText?.slice(0, 100) || "Your financial health looks good today."}</span></p><p className="text-xs text-zinc-400 mt-0.5">Health score: {data?.health_score ?? "—"}/100{data?.fraud_alert_count ? ` · ${data.fraud_alert_count} fraud alert(s)` : " · No fraud alerts"}</p></>)}</div><Link href="/chat" className="flex items-center gap-1 text-xs text-emerald-400 hover:text-emerald-300 transition-colors whitespace-nowrap">Ask AI <ChevronRight className="h-3 w-3" /></Link></div>2 unmodified lines{/* Stat Cards */}<div className="grid gap-4 sm:grid-cols-2 lg:grid-cols-4"><StatCardtitle="Total Balance"value={data ? `$${data.total_balance.toLocaleString("en-US", { minimumFractionDigits: 2 })}` : "$—"}icon={DollarSign}gradient="from-blue-500/20 to-cyan-500/20"iconColor="text-blue-400"borderColor="border-blue-500/20"loading={isLoading}/><StatCardtitle="Monthly Income"value={data ? `$${data.monthly_income.toLocaleString("en-US", { minimumFractionDigits: 2 })}` : "$—"}icon={TrendingUp}gradient="from-emerald-500/20 to-teal-500/20"iconColor="text-emerald-400"borderColor="border-emerald-500/20"loading={isLoading}/><StatCardtitle="Monthly Spend"value={data ? `$${data.monthly_expenses.toLocaleString("en-US", { minimumFractionDigits: 2 })}` : "$—"}icon={CreditCard}gradient="from-orange-500/20 to-amber-500/20"iconColor="text-orange-400"borderColor="border-orange-500/20"loading={isLoading}/><StatCardtitle="Savings Rate"value={data ? `${data.savings_rate}%` : "—%"}change={data ? `${data.savings_rate > 20 ? "+" : ""}${(data.savings_rate - 20).toFixed(1)}% vs target` : undefined}positive={data ? data.savings_rate >= 20 : true}icon={Activity}gradient="from-purple-500/20 to-violet-500/20"iconColor="text-purple-400"borderColor="border-purple-500/20"loading={isLoading}/></div>3 unmodified lines<motion.div variants={itemVariants} className="col-span-4 glass-card p-6"><div className="flex items-center justify-between mb-6"><div><h2 className="text-base font-semibold text-white">Cash Flow</h2><p className="text-xs text-zinc-400 mt-0.5">Income vs Expenses vs Savings</p></div><div className="flex gap-4 text-xs">{[{ label: "Income", color: "#10b981" },{ label: "Expenses", color: "#f59e0b" },{ label: "Savings", color: "#3b82f6" },].map((l) => (<div key={l.label} className="flex items-center gap-1.5"><div className="h-2 w-2 rounded-full" style={{ background: l.color }} /><span className="text-zinc-400">{l.label}</span></div>))}</div>10 unmodified lines{ id: "savingsGrad", color: "#3b82f6" },].map(({ id, color }) => (<linearGradient key={id} id={id} x1="0" y1="0" x2="0" y2="1"><stop offset="5%" stopColor={color} stopOpacity={0.3} /><stop offset="95%" stopColor={color} stopOpacity={0} /></linearGradient>))}</defs><CartesianGrid strokeDasharray="3 3" stroke="rgba(255,255,255,0.05)" /><XAxis dataKey="month" tick={{ fill: "#71717a", fontSize: 11 }} axisLine={false} tickLine={false} /><YAxis tick={{ fill: "#71717a", fontSize: 11 }} axisLine={false} tickLine={false} /><Tooltip content={<CustomTooltip />} /><Area type="monotone" dataKey="income" stroke="#10b981" strokeWidth={2} fill="url(#incomeGrad)" /><Area type="monotone" dataKey="expenses" stroke="#f59e0b" strokeWidth={2} fill="url(#expenseGrad)" />6 unmodified lines{/* Spending Breakdown */}<motion.div variants={itemVariants} className="col-span-3 glass-card p-6"><div className="mb-4"><h2 className="text-base font-semibold text-white">Spending Breakdown</h2><p className="text-xs text-zinc-400 mt-0.5">This month by category</p></div>{isLoading ? (<Skeleton className="h-[160px] w-full mb-4" />1 unmodified line<div className="flex items-center justify-center"><ResponsiveContainer width="100%" height={160}><PieChart><Pie data={categoryData} cx="50%" cy="50%" innerRadius={50} outerRadius={75} paddingAngle={3} dataKey="value">{categoryData.map((entry, index) => (<Cell key={index} fill={entry.color} stroke="transparent" />))}3 unmodified linesactive && payload?.length ? (<div className="glass-card p-2 text-xs"><span style={{ color: payload[0].payload.color }}>{payload[0].name}</span><span className="text-white ml-2 font-bold">${(payload[0].value as number).toLocaleString()}</span></div>) : null}9 unmodified lines<div key={cat.name} className="flex items-center justify-between"><div className="flex items-center gap-2"><div className="h-2 w-2 rounded-full flex-shrink-0" style={{ background: cat.color }} /><span className="text-xs text-zinc-400">{cat.name}</span></div><div className="flex items-center gap-2"><div className="h-1 w-16 rounded-full bg-white/5 overflow-hidden"><divclassName="h-full rounded-full"style={{2 unmodified lines}}/></div><span className="text-xs font-medium text-white w-16 text-right">${cat.value.toLocaleString()}</span></div>7 unmodified lines<motion.div variants={itemVariants} className="glass-card p-6"><div className="flex items-center justify-between mb-5"><div><h2 className="text-base font-semibold text-white">Recent Transactions</h2><p className="text-xs text-zinc-400 mt-0.5">Your latest activity</p></div><Link href="/transactions" className="flex items-center gap-1 text-xs text-emerald-400 hover:text-emerald-300 transition-colors">View all <ChevronRight className="h-3 w-3" /></Link></div><div className="space-y-1">5 unmodified linesinitial={{ opacity: 0, x: -10 }}animate={{ opacity: 1, x: 0 }}transition={{ delay: i * 0.05 }}whileHover={{ backgroundColor: "rgba(255,255,255,0.03)" }}className="flex items-center justify-between rounded-xl px-3 py-3 transition-colors cursor-pointer"><div className="flex items-center gap-3"><div className="flex h-9 w-9 items-center justify-center rounded-xl bg-white/5 border border-white/10 text-sm font-bold text-zinc-400">{tx.merchant.charAt(0).toUpperCase()}</div><div><p className="text-sm font-medium text-white">{tx.merchant}</p><p className="text-xs text-zinc-500">{tx.category} · {tx.timestamp ? new Date(tx.timestamp).toLocaleDateString() : ""}</p></div></div><div className="flex items-center gap-2"><span className={`text-sm font-semibold ${tx.amount > 0 ? "text-emerald-400" : "text-white"}`}>{tx.amount > 0 ? "+" : ""}${Math.abs(tx.amount).toFixed(2)}</span>{tx.amount > 0 ? (<TrendingUp className="h-3.5 w-3.5 text-emerald-400" />) : (<TrendingDown className="h-3.5 w-3.5 text-zinc-500" />)}</div></motion.div>4 unmodified lines{/* Fraud Shield */}<motion.divvariants={itemVariants}className="flex items-center gap-3 rounded-2xl border border-emerald-500/20 bg-emerald-500/5 px-5 py-3"><Shield className="h-4 w-4 text-emerald-400 flex-shrink-0" /><p className="text-xs text-zinc-400"><span className="text-emerald-400 font-medium">AI Fraud Shield active</span>{data?.fraud_alert_count? ` — ${data.fraud_alert_count} alert(s) require your attention.`: " — All transactions monitored in real-time. No suspicious activity detected."}</p>{data?.fraud_alert_count ? (<Link href="/security" className="ml-auto text-xs text-red-400 hover:text-red-300 transition-colors whitespace-nowrap">Review <ChevronRight className="h-3 w-3 inline" /></Link>) : null}</motion.div></motion.div>);}12 unmodified lines131415161718192027 unmodified lines48495051525354555657588 unmodified lines6768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241254 unmodified lines1301311321331341351361371381391401411423 unmodified lines14614714814915015115215315418 unmodified lines1731741751761771781791801811821831 unmodified line1851861871881891901911921931941951961971981992002012022032042 unmodified lines2072082092102112122132142152162172182192202212222233 unmodified lines2272282292302312322332342352362372382392402412422432442452462472482 unmodified lines2512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043 unmodified lines30830931031131231331431531631731831932032132232332432510 unmodified lines3363373383393403413423433443453463473483496 unmodified lines3563573583593603613623631 unmodified line3653663673683693703713723733743753763 unmodified lines3803813823833843853863873889 unmodified lines3983994004014024034044054064074084094102 unmodified lines4134144154164174184197 unmodified lines4274284294304314324334344354364375 unmodified lines4434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794 unmodified lines48448548648748848949049149249349449549649749849950050150250350450550650750812 unmodified lines} from "recharts";import { useDashboardStore } from "@/lib/stores/dashboardStore";import { useAuthStore } from "@/lib/stores/authStore";import { useLanguageStore } from "@/lib/stores/languageStore";import { useThemeStore } from "@/lib/stores/themeStore";import Link from "next/link";// ─── Category colors ──────────────────────────────────────────────────────────27 unmodified linesif (!active || !payload?.length) return null;return (<div className="glass-card p-3 text-xs space-y-1 min-w-[140px]"><p className="text-adaptive-muted font-medium mb-2">{label}</p>{payload.map((entry) => (<div key={entry.name} className="flex justify-between gap-4"><span style={{ color: entry.color }}>{entry.name}</span><span className="text-adaptive font-semibold">${entry.value.toLocaleString()}</span></div>))}</div>8 unmodified linespositive?: boolean;icon: React.ElementType;gradient: string;lightGradient: string;iconColor: string;borderColor: string;lightBorderColor: string;loading?: boolean;isLight: boolean;}function StatCard({title, value, change, positive, icon: Icon,gradient, lightGradient, iconColor, borderColor, lightBorderColor, loading, isLight}: StatCardProps) {return (<motion.divvariants={itemVariants}whileHover={{ scale: 1.02, y: -2 }}className={`relative overflow-hidden rounded-2xl border backdrop-blur-xl p-6 cursor-pointer group ${isLight? `bg-gradient-to-br ${lightGradient} ${lightBorderColor}`: `bg-gradient-to-br ${gradient} ${borderColor}`}`}><div className="absolute inset-0 opacity-0 group-hover:opacity-100 transition-opacity duration-300 bg-white/[0.03]" /><div className="flex items-start justify-between"><div><p className="text-xs font-medium uppercase tracking-wider" style={{ color: "var(--fg-subtle)" }}>{title}</p>{loading ? (<Skeleton className="mt-2 h-8 w-28" />) : (<p className="mt-2 text-2xl font-bold tracking-tight" style={{ color: "var(--fg)" }}>{value}</p>)}</div><divclassName="flex h-10 w-10 items-center justify-center rounded-xl border"style={{ background: "var(--card-bg)", borderColor: "var(--border-strong)" }}><Icon className={`h-5 w-5 ${iconColor}`} /></div></div>{change && !loading && (<div className="mt-4 flex items-center gap-1.5">{positive ? (<ArrowUpRight className="h-3.5 w-3.5 text-emerald-500" />) : (<ArrowDownRight className="h-3.5 w-3.5 text-red-500" />)}<span className={`text-xs font-semibold ${positive ? "text-emerald-500" : "text-red-500"}`}>{change}</span><span className="text-xs" style={{ color: "var(--fg-subtle)" }}>vs last month</span></div>)}</motion.div>4 unmodified linesexport default function Home() {const { data, isLoading, error, fetch } = useDashboardStore();const { user } = useAuthStore();const { t } = useLanguageStore();const { theme } = useThemeStore();const isLight = theme === "light";// Recharts axis tick colorconst tickColor = isLight ? "#64748b" : "#71717a";const gridColor = isLight ? "rgba(15,23,42,0.07)" : "rgba(255,255,255,0.05)";useEffect(() => {fetch();3 unmodified linesconst greeting = () => {const h = new Date().getHours();if (h < 12) return t("good_morning");if (h < 17) return t("good_afternoon");return t("good_evening");};const briefingText = data?.ai_briefing18 unmodified lines>{/* Header */}<motion.div variants={itemVariants}><h1 className="text-3xl font-bold tracking-tight" style={{ color: "var(--fg)" }}>{greeting()}, <span className="gradient-text">{firstName}</span> 👋</h1><p className="mt-1 text-sm" style={{ color: "var(--fg-muted)" }}>{t("financial_overview")}</p></motion.div>1 unmodified line{error && (<motion.divvariants={itemVariants}className={`flex items-center gap-3 rounded-2xl border px-5 py-3 ${isLight? "border-amber-300/60 bg-amber-50": "border-amber-500/20 bg-amber-500/5"}`}><AlertTriangle className="h-4 w-4 text-amber-500 flex-shrink-0" /><p className="text-xs" style={{ color: "var(--fg-muted)" }}><span className="text-amber-500 font-medium">{t("backend_offline")}</span> — {t("showing_cached")}{" "}<buttononClick={() => fetch(undefined, true)}className="underline hover:text-emerald-500 transition-colors">{t("retry")}</button></p></motion.div>2 unmodified lines{/* AI Briefing */}<motion.divvariants={itemVariants}className={`relative overflow-hidden rounded-2xl border p-4 ${isLight? "border-emerald-300/50 bg-gradient-to-r from-emerald-50 via-cyan-50/50 to-blue-50": "border-emerald-500/20 bg-gradient-to-r from-emerald-500/10 via-cyan-500/5 to-blue-500/10"}`}><div className="relative flex items-center gap-3"><div className={`flex h-9 w-9 items-center justify-center rounded-xl border flex-shrink-0 ${isLight ? "bg-emerald-100 border-emerald-200" : "bg-emerald-500/20 border-emerald-500/30"}`}><Sparkles className="h-4 w-4 text-emerald-500" /></div><div className="flex-1 min-w-0">{isLoading ? (3 unmodified lines</>) : (<><p className="text-sm font-medium" style={{ color: "var(--fg)" }}>{t("ai_daily_briefing")}{" "}<span className="text-emerald-500">{briefingText?.slice(0, 100) || "Your financial health looks good today."}</span></p><p className="text-xs mt-0.5" style={{ color: "var(--fg-muted)" }}>{t("health_score")} {data?.health_score ?? "—"}/100{data?.fraud_alert_count? ` · ${data.fraud_alert_count} fraud alert(s)`: ` · ${t("no_fraud_alerts")}`}</p></>)}</div><Link href="/chat" className="flex items-center gap-1 text-xs text-emerald-500 hover:text-emerald-400 transition-colors whitespace-nowrap">Ask AI <ChevronRight className="h-3 w-3" /></Link></div>2 unmodified lines{/* Stat Cards */}<div className="grid gap-4 sm:grid-cols-2 lg:grid-cols-4"><StatCardtitle={t("total_balance")}value={data ? `$${data.total_balance.toLocaleString("en-US", { minimumFractionDigits: 2 })}` : "$—"}icon={DollarSign}gradient="from-blue-500/20 to-cyan-500/20"lightGradient="from-blue-50 to-cyan-50"iconColor="text-blue-500"borderColor="border-blue-500/20"lightBorderColor="border-blue-200/70"loading={isLoading}isLight={isLight}/><StatCardtitle={t("monthly_income")}value={data ? `$${data.monthly_income.toLocaleString("en-US", { minimumFractionDigits: 2 })}` : "$—"}icon={TrendingUp}gradient="from-emerald-500/20 to-teal-500/20"lightGradient="from-emerald-50 to-teal-50"iconColor="text-emerald-500"borderColor="border-emerald-500/20"lightBorderColor="border-emerald-200/70"loading={isLoading}isLight={isLight}/><StatCardtitle={t("monthly_spend")}value={data ? `$${data.monthly_expenses.toLocaleString("en-US", { minimumFractionDigits: 2 })}` : "$—"}icon={CreditCard}gradient="from-orange-500/20 to-amber-500/20"lightGradient="from-orange-50 to-amber-50"iconColor="text-orange-500"borderColor="border-orange-500/20"lightBorderColor="border-orange-200/70"loading={isLoading}isLight={isLight}/><StatCardtitle={t("savings_rate")}value={data ? `${data.savings_rate}%` : "—%"}change={data ? `${data.savings_rate > 20 ? "+" : ""}${(data.savings_rate - 20).toFixed(1)}% vs target` : undefined}positive={data ? data.savings_rate >= 20 : true}icon={Activity}gradient="from-purple-500/20 to-violet-500/20"lightGradient="from-purple-50 to-violet-50"iconColor="text-purple-500"borderColor="border-purple-500/20"lightBorderColor="border-purple-200/70"loading={isLoading}isLight={isLight}/></div>3 unmodified lines<motion.div variants={itemVariants} className="col-span-4 glass-card p-6"><div className="flex items-center justify-between mb-6"><div><h2 className="text-base font-semibold" style={{ color: "var(--fg)" }}>{t("cash_flow")}</h2><p className="text-xs mt-0.5" style={{ color: "var(--fg-muted)" }}>{t("income_vs_expenses")}</p></div><div className="flex gap-4 text-xs">{[{ label: t("income"), color: "#10b981" },{ label: t("expenses"), color: "#f59e0b" },{ label: t("savings"), color: "#3b82f6" },].map((l) => (<div key={l.label} className="flex items-center gap-1.5"><div className="h-2 w-2 rounded-full" style={{ background: l.color }} /><span style={{ color: "var(--fg-muted)" }}>{l.label}</span></div>))}</div>10 unmodified lines{ id: "savingsGrad", color: "#3b82f6" },].map(({ id, color }) => (<linearGradient key={id} id={id} x1="0" y1="0" x2="0" y2="1"><stop offset="5%" stopColor={color} stopOpacity={isLight ? 0.15 : 0.3} /><stop offset="95%" stopColor={color} stopOpacity={0} /></linearGradient>))}</defs><CartesianGrid strokeDasharray="3 3" stroke={gridColor} /><XAxis dataKey="month" tick={{ fill: tickColor, fontSize: 11 }} axisLine={false} tickLine={false} /><YAxis tick={{ fill: tickColor, fontSize: 11 }} axisLine={false} tickLine={false} /><Tooltip content={<CustomTooltip />} /><Area type="monotone" dataKey="income" stroke="#10b981" strokeWidth={2} fill="url(#incomeGrad)" /><Area type="monotone" dataKey="expenses" stroke="#f59e0b" strokeWidth={2} fill="url(#expenseGrad)" />6 unmodified lines{/* Spending Breakdown */}<motion.div variants={itemVariants} className="col-span-3 glass-card p-6"><div className="mb-4"><h2 className="text-base font-semibold" style={{ color: "var(--fg)" }}>{t("spending_breakdown")}</h2><p className="text-xs mt-0.5" style={{ color: "var(--fg-muted)" }}>{t("this_month_by_category")}</p></div>{isLoading ? (<Skeleton className="h-[160px] w-full mb-4" />1 unmodified line<div className="flex items-center justify-center"><ResponsiveContainer width="100%" height={160}><PieChart><Piedata={categoryData}cx="50%" cy="50%"innerRadius={50} outerRadius={75}paddingAngle={3} dataKey="value">{categoryData.map((entry, index) => (<Cell key={index} fill={entry.color} stroke="transparent" />))}3 unmodified linesactive && payload?.length ? (<div className="glass-card p-2 text-xs"><span style={{ color: payload[0].payload.color }}>{payload[0].name}</span><span className="ml-2 font-bold" style={{ color: "var(--fg)" }}>${(payload[0].value as number).toLocaleString()}</span></div>) : null}9 unmodified lines<div key={cat.name} className="flex items-center justify-between"><div className="flex items-center gap-2"><div className="h-2 w-2 rounded-full flex-shrink-0" style={{ background: cat.color }} /><span className="text-xs" style={{ color: "var(--fg-muted)" }}>{cat.name}</span></div><div className="flex items-center gap-2"><divclassName="h-1 w-16 rounded-full overflow-hidden"style={{ background: "var(--border)" }}><divclassName="h-full rounded-full"style={{2 unmodified lines}}/></div><span className="text-xs font-medium w-16 text-right" style={{ color: "var(--fg)" }}>${cat.value.toLocaleString()}</span></div>7 unmodified lines<motion.div variants={itemVariants} className="glass-card p-6"><div className="flex items-center justify-between mb-5"><div><h2 className="text-base font-semibold" style={{ color: "var(--fg)" }}>{t("recent_transactions")}</h2><p className="text-xs mt-0.5" style={{ color: "var(--fg-muted)" }}>{t("latest_activity")}</p></div><Link href="/transactions" className="flex items-center gap-1 text-xs text-emerald-500 hover:text-emerald-400 transition-colors">{t("view_all")} <ChevronRight className="h-3 w-3" /></Link></div><div className="space-y-1">5 unmodified linesinitial={{ opacity: 0, x: -10 }}animate={{ opacity: 1, x: 0 }}transition={{ delay: i * 0.05 }}whileHover={{ backgroundColor: isLight ? "rgba(15,23,42,0.03)" : "rgba(255,255,255,0.03)" }}className="flex items-center justify-between rounded-xl px-3 py-3 transition-colors cursor-pointer"><div className="flex items-center gap-3"><divclassName="flex h-9 w-9 items-center justify-center rounded-xl border text-sm font-bold"style={{background: "var(--card-bg)",borderColor: "var(--border-strong)",color: "var(--fg-muted)",}}>{tx.merchant.charAt(0).toUpperCase()}</div><div><p className="text-sm font-medium" style={{ color: "var(--fg)" }}>{tx.merchant}</p><p className="text-xs" style={{ color: "var(--fg-subtle)" }}>{tx.category} · {tx.timestamp ? new Date(tx.timestamp).toLocaleDateString() : ""}</p></div></div><div className="flex items-center gap-2"><span className={`text-sm font-semibold ${tx.amount > 0 ? "text-emerald-500" : ""}`}style={tx.amount <= 0 ? { color: "var(--fg)" } : undefined}>{tx.amount > 0 ? "+" : ""}${Math.abs(tx.amount).toFixed(2)}</span>{tx.amount > 0 ? (<TrendingUp className="h-3.5 w-3.5 text-emerald-500" />) : (<TrendingDown className="h-3.5 w-3.5" style={{ color: "var(--fg-subtle)" }} />)}</div></motion.div>4 unmodified lines{/* Fraud Shield */}<motion.divvariants={itemVariants}className={`flex items-center gap-3 rounded-2xl border px-5 py-3 ${isLight? "border-emerald-300/60 bg-emerald-50": "border-emerald-500/20 bg-emerald-500/5"}`}><Shield className="h-4 w-4 text-emerald-500 flex-shrink-0" /><p className="text-xs" style={{ color: "var(--fg-muted)" }}><span className="text-emerald-500 font-medium">{t("fraud_shield_active")}</span>{data?.fraud_alert_count? ` — ${data.fraud_alert_count} ${t("alerts_require_attention")}`: ` — ${t("all_monitored")}`}</p>{data?.fraud_alert_count ? (<Link href="/security" className="ml-auto text-xs text-red-500 hover:text-red-400 transition-colors whitespace-nowrap">{t("review")} <ChevronRight className="h-3 w-3 inline" /></Link>) : null}</motion.div></motion.div>);}
9 unmodified lines10111213141513 unmodified lines2930313233343536373839404142434445469 unmodified linesconst PUBLIC_PATHS = ["/login"];function FullPageSpinner() {return (<div className="flex min-h-screen items-center justify-center" style={{ background: "var(--bg, #050505)" }}>13 unmodified linesconst router = useRouter();const { isAuthenticated, restoreSession } = useAuthStore();const { theme, setTheme } = useThemeStore();const { setLanguage } = useLanguageStore();const [hydrated, setHydrated] = useState(false);const isPublic = PUBLIC_PATHS.includes(pathname);useEffect(() => {// Apply persisted theme to DOMsetTheme(theme);// Restore session, then optionally sync preferences from backendrestoreSession().finally(() => setHydrated(true));}, []); // eslint-disable-line react-hooks/exhaustive-depsif (!hydrated) return <FullPageSpinner />;if (isPublic) return <>{children}</>;if (!isAuthenticated) {9 unmodified lines1011121314151617181920212213 unmodified lines3637383940414243444546474849505152535455565758599 unmodified linesconst PUBLIC_PATHS = ["/login"];// Lang codes mapped to BCP-47 HTML lang valuesconst LANG_MAP: Record<string, string> = {en: "en",hi: "hi",mr: "mr",};function FullPageSpinner() {return (<div className="flex min-h-screen items-center justify-center" style={{ background: "var(--bg, #050505)" }}>13 unmodified linesconst router = useRouter();const { isAuthenticated, restoreSession } = useAuthStore();const { theme, setTheme } = useThemeStore();const { language } = useLanguageStore();const [hydrated, setHydrated] = useState(false);const isPublic = PUBLIC_PATHS.includes(pathname);// Apply persisted theme on mountuseEffect(() => {setTheme(theme);restoreSession().finally(() => setHydrated(true));}, []); // eslint-disable-line react-hooks/exhaustive-deps// Sync <html lang> whenever language changesuseEffect(() => {if (typeof document !== "undefined") {document.documentElement.lang = LANG_MAP[language] ?? language;}}, [language]);if (!hydrated) return <FullPageSpinner />;if (isPublic) return <>{children}</>;if (!isAuthenticated) {
5 unmodified lines6789101116 unmodified lines282930313233343536373839404142434445464748495010 unmodified lines6162636465666711 unmodified lines798081828384858687885 unmodified linesimport { Sidebar } from "./Sidebar";import { Navbar } from "./Navbar";import { Menu } from "lucide-react";// ─── Page transition wrapper ──────────────────────────────────────────────────function PageTransition({ children }: { children: React.ReactNode }) {16 unmodified linesexport function DashboardLayout({ children }: { children: React.ReactNode }) {const [mobileOpen, setMobileOpen] = useState(false);return (<div className="flex h-screen bg-[#050505] text-white overflow-hidden">{/* Ambient background gradients */}<div className="fixed inset-0 z-0 overflow-hidden pointer-events-none"><div className="absolute top-[-15%] left-[-5%] w-[45%] h-[45%] rounded-full bg-blue-600/10 blur-[140px]" /><div className="absolute bottom-[-15%] right-[-5%] w-[45%] h-[45%] rounded-full bg-emerald-600/10 blur-[140px]" /><div className="absolute top-[40%] left-[40%] w-[30%] h-[30%] rounded-full bg-purple-600/5 blur-[120px]" />{/* Noise texture */}<divclassName="absolute inset-0 opacity-[0.015]"style={{backgroundImage: `url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E")`,backgroundRepeat: "repeat",backgroundSize: "128px 128px",}}/></div>{/* ── Desktop Sidebar ─────────────────────────────────────────────────── */}10 unmodified linesanimate={{ opacity: 1 }}exit={{ opacity: 0 }}onClick={() => setMobileOpen(false)}className="fixed inset-0 z-30 bg-black/60 backdrop-blur-sm lg:hidden"/><motion.divinitial={{ x: "-100%" }}11 unmodified lines{/* ── Main content ─────────────────────────────────────────────────────── */}<div className="z-10 flex flex-1 flex-col overflow-hidden min-w-0">{/* Mobile header with hamburger */}<div className="flex items-center lg:hidden border-b border-white/10 bg-black/40 backdrop-blur-xl px-4 py-3"><buttononClick={() => setMobileOpen(true)}className="rounded-xl bg-white/5 p-2 text-zinc-400 hover:text-white transition-colors mr-3"><Menu className="h-5 w-5" /></button>5 unmodified lines678910111216 unmodified lines29303132333435363738394041424344454647484950515253545556575859606162636465666710 unmodified lines7879808182838411 unmodified lines969798991001011021031041051061071081091101111125 unmodified linesimport { Sidebar } from "./Sidebar";import { Navbar } from "./Navbar";import { Menu } from "lucide-react";import { useThemeStore } from "@/lib/stores/themeStore";// ─── Page transition wrapper ──────────────────────────────────────────────────function PageTransition({ children }: { children: React.ReactNode }) {16 unmodified linesexport function DashboardLayout({ children }: { children: React.ReactNode }) {const [mobileOpen, setMobileOpen] = useState(false);const { theme } = useThemeStore();const isLight = theme === "light";return (<divclassName="flex h-screen overflow-hidden transition-colors duration-300"style={{ background: "var(--bg)", color: "var(--fg)" }}>{/* Ambient background gradients */}<div className="fixed inset-0 z-0 overflow-hidden pointer-events-none"><divclassName="absolute top-[-15%] left-[-5%] w-[45%] h-[45%] rounded-full blur-[140px] transition-opacity duration-300"style={{ background: "var(--ambient-1)" }}/><divclassName="absolute bottom-[-15%] right-[-5%] w-[45%] h-[45%] rounded-full blur-[140px] transition-opacity duration-300"style={{ background: "var(--ambient-2)" }}/><divclassName="absolute top-[40%] left-[40%] w-[30%] h-[30%] rounded-full blur-[120px] transition-opacity duration-300"style={{ background: "var(--ambient-3)" }}/>{/* Noise texture — only visible in dark mode */}{!isLight && (<divclassName="absolute inset-0 opacity-[0.015]"style={{backgroundImage: `url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E")`,backgroundRepeat: "repeat",backgroundSize: "128px 128px",}}/>)}</div>{/* ── Desktop Sidebar ─────────────────────────────────────────────────── */}10 unmodified linesanimate={{ opacity: 1 }}exit={{ opacity: 0 }}onClick={() => setMobileOpen(false)}className={`fixed inset-0 z-30 backdrop-blur-sm lg:hidden ${isLight ? "bg-slate-900/30" : "bg-black/60"}`}/><motion.divinitial={{ x: "-100%" }}11 unmodified lines{/* ── Main content ─────────────────────────────────────────────────────── */}<div className="z-10 flex flex-1 flex-col overflow-hidden min-w-0">{/* Mobile header with hamburger */}<divclassName="flex items-center lg:hidden border-b backdrop-blur-xl px-4 py-3"style={{ background: "var(--navbar-bg)", borderColor: "var(--border)" }}><buttononClick={() => setMobileOpen(true)}className={`rounded-xl p-2 mr-3 transition-colors ${isLight? "bg-slate-100 text-slate-500 hover:text-slate-800": "bg-white/5 text-zinc-400 hover:text-white"}`}><Menu className="h-5 w-5" /></button>
4 unmodified lines56789101112134 unmodified lines1819202122232425262728293031323334353637386 unmodified lines454647484950511 unmodified line535455565758592 unmodified lines626364656667684 unmodified linesimport { NotificationBell } from "@/components/notifications/NotificationPanel";import { motion } from "framer-motion";import { useAuthStore } from "@/lib/stores/authStore";export function Navbar() {const { user } = useAuthStore();const displayName = user?.name || "User";const initials = displayName4 unmodified lines.slice(0, 2);return (<header className="sticky top-0 z-40 flex h-16 w-full items-center justify-between bg-black/40 backdrop-blur-xl border-b border-white/10 px-8">{/* Search */}<div className="flex flex-1 items-center"><div className="relative w-full max-w-sm"><div className="pointer-events-none absolute inset-y-0 left-0 flex items-center pl-3"><Search className="h-4 w-4 text-zinc-500" aria-hidden="true" /></div><inputid="search"className="block w-full rounded-xl border-0 bg-white/5 py-2 pl-9 pr-3 text-sm text-white placeholder:text-zinc-500 focus:bg-white/8 focus:ring-1 focus:ring-emerald-500/40 transition-all duration-200 outline-none"placeholder="Search transactions, ask AI..."type="search"/><div className="pointer-events-none absolute inset-y-0 right-0 flex items-center pr-3"><kbd className="hidden sm:inline-flex h-5 items-center gap-1 rounded border border-white/10 bg-white/5 px-1.5 text-[10px] text-zinc-500">⌘K</kbd></div>6 unmodified lines<NotificationBell />{/* Divider */}<div className="h-6 w-px bg-white/10" />{/* User */}<motion.div1 unmodified lineclassName="flex items-center gap-3 cursor-pointer group"><div className="flex flex-col text-right"><span className="text-sm font-semibold text-white group-hover:text-emerald-400 transition-colors leading-tight">{displayName}</span><span className="text-xs text-emerald-500 leading-tight">2 unmodified lines</div><Avatar className="h-9 w-9 border border-emerald-500/30 ring-2 ring-emerald-500/10"><AvatarImage src="" alt={displayName} /><AvatarFallback className="bg-emerald-900 text-emerald-400 text-xs font-bold">{initials || <User className="h-4 w-4" />}</AvatarFallback></Avatar>4 unmodified lines56789101112131415164 unmodified lines21222324252627282930313233343536373839404142434445464748495051526 unmodified lines596061626364651 unmodified line676869707172737475762 unmodified lines79808182838485868788894 unmodified linesimport { NotificationBell } from "@/components/notifications/NotificationPanel";import { motion } from "framer-motion";import { useAuthStore } from "@/lib/stores/authStore";import { useThemeStore } from "@/lib/stores/themeStore";export function Navbar() {const { user } = useAuthStore();const { theme } = useThemeStore();const isLight = theme === "light";const displayName = user?.name || "User";const initials = displayName4 unmodified lines.slice(0, 2);return (<headerclassName="sticky top-0 z-40 flex h-16 w-full items-center justify-between backdrop-blur-xl border-b px-8 transition-colors duration-300"style={{ background: "var(--navbar-bg)", borderColor: "var(--border)" }}>{/* Search */}<div className="flex flex-1 items-center"><div className="relative w-full max-w-sm"><div className="pointer-events-none absolute inset-y-0 left-0 flex items-center pl-3"><Search className="h-4 w-4" style={{ color: "var(--fg-subtle)" }} aria-hidden="true" /></div><inputid="search"className={`block w-full rounded-xl border py-2 pl-9 pr-3 text-sm transition-all duration-200 outline-none focus:ring-1 focus:ring-emerald-500/40 ${isLight? "bg-white border-slate-200 text-slate-800 placeholder:text-slate-400 focus:bg-white focus:border-emerald-400/50": "bg-white/5 border-white/10 text-white placeholder:text-zinc-500 focus:bg-white/8 border-0"}`}placeholder="Search transactions, ask AI..."type="search"/><div className="pointer-events-none absolute inset-y-0 right-0 flex items-center pr-3"><kbdclassName={`hidden sm:inline-flex h-5 items-center gap-1 rounded border px-1.5 text-[10px] ${isLight ? "border-slate-200 bg-slate-100 text-slate-400" : "border-white/10 bg-white/5 text-zinc-500"}`}>⌘K</kbd></div>6 unmodified lines<NotificationBell />{/* Divider */}<div className="h-6 w-px" style={{ background: "var(--border-strong)" }} />{/* User */}<motion.div1 unmodified lineclassName="flex items-center gap-3 cursor-pointer group"><div className="flex flex-col text-right"><spanclassName="text-sm font-semibold group-hover:text-emerald-500 transition-colors leading-tight"style={{ color: "var(--fg)" }}>{displayName}</span><span className="text-xs text-emerald-500 leading-tight">2 unmodified lines</div><Avatar className="h-9 w-9 border border-emerald-500/30 ring-2 ring-emerald-500/10"><AvatarImage src="" alt={displayName} /><AvatarFallbackclassName={`text-xs font-bold ${isLight ? "bg-emerald-100 text-emerald-700" : "bg-emerald-900 text-emerald-400"}`}>{initials || <User className="h-4 w-4" />}</AvatarFallback></Avatar>
22 unmodified lines2324252627282930313233343536373839401 unmodified line4243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915022 unmodified linesconst [showLang, setShowLang] = useState(false);const navigation = [{ key: "overview", href: "/", icon: LayoutDashboard },{ key: "transactions", href: "/transactions", icon: ArrowRightLeft },{ key: "payments", href: "/payments", icon: CreditCard, badge: "NEW" },{ key: "analytics", href: "/analytics", icon: BarChart2 },{ key: "simulator", href: "/simulator", icon: Zap },{ key: "loans", href: "/loans", icon: Wallet },{ key: "goals", href: "/goals", icon: Target },{ key: "documents", href: "/documents", icon: FileText, badge: "AI" },{ key: "ai_assistant", href: "/chat", icon: MessageSquare, badge: "AI" },{ key: "security", href: "/security", icon: Shield },{ key: "system_status", href: "/status", icon: Activity },{ key: "settings", href: "/settings", icon: Settings },];const handleLogout = () => { logout(); router.replace("/login"); };1 unmodified lineconst isLight = theme === "light";return (<div className={cn("flex h-full w-60 flex-col overflow-y-auto border-r text-sm",isLight? "bg-white/90 border-black/8 text-slate-800": "bg-black/60 backdrop-blur-2xl border-white/8 text-white")}>{/* Logo */}<div className={cn("flex h-16 shrink-0 items-center gap-2.5 px-5 border-b", isLight ? "border-black/8" : "border-white/8")}><div className="flex h-8 w-8 items-center justify-center rounded-xl bg-gradient-to-br from-emerald-400 to-cyan-500 shadow-lg shadow-emerald-500/20"><Sparkles className="h-4 w-4 text-white" /></div><div><h1 className="text-base font-bold leading-tight">BankBot</h1><p className="text-[10px] text-emerald-500 leading-tight">AI Finance</p></div></div>{/* Nav */}<div className="flex flex-1 flex-col justify-between px-3 py-4"><nav className="space-y-0.5">{navigation.map((item) => {const isActive = pathname === item.href;return (<Link key={item.key} href={item.href}className={cn("group relative flex items-center rounded-xl px-3 py-2.5 font-medium transition-all duration-200",isActive? isLight ? "text-slate-900" : "text-white": isLight ? "text-slate-500 hover:text-slate-800 hover:bg-black/5" : "text-zinc-500 hover:text-zinc-200 hover:bg-white/5")}>{isActive && (<motion.div layoutId="activeNav"className={cn("absolute inset-0 rounded-xl border", isLight ? "bg-emerald-50 border-emerald-200" : "bg-white/10 border-white/10")}transition={{ type: "spring", bounce: 0.2, duration: 0.4 }} />)}{isActive && <div className="absolute left-0 top-1/2 -translate-y-1/2 h-5 w-0.5 rounded-full bg-emerald-400" />}<item.icon className={cn("relative mr-3 h-4 w-4 flex-shrink-0 transition-colors", isActive ? "text-emerald-500" : isLight ? "text-slate-400 group-hover:text-slate-600" : "text-zinc-500 group-hover:text-zinc-300")} /><span className="relative flex-1">{t(item.key)}</span>{item.badge && (<span className={cn("relative ml-auto rounded-md px-1.5 py-0.5 text-[9px] font-bold uppercase tracking-wide",item.badge === "AI" ? "bg-emerald-500/20 text-emerald-500 border border-emerald-500/30" : "bg-blue-500/20 text-blue-500 border border-blue-500/30")}>{item.badge}</span>)}</Link>);})}</nav>{/* Bottom controls */}<div className={cn("space-y-1 pt-4 border-t", isLight ? "border-black/8" : "border-white/8")}>{/* AI Shield */}<div className={cn("flex items-center gap-2.5 rounded-xl px-3 py-2.5 border", isLight ? "bg-emerald-50 border-emerald-200" : "bg-emerald-500/5 border-emerald-500/10")}><div className="h-1.5 w-1.5 rounded-full bg-emerald-400 animate-pulse flex-shrink-0" /><div className="flex-1 min-w-0"><p className="text-xs font-medium text-emerald-500 leading-tight">{t("ai_shield")}</p><p className={cn("text-[10px] leading-tight truncate", isLight ? "text-slate-400" : "text-zinc-600")}>{t("all_normal")}</p></div></div>{/* Theme toggle */}<button onClick={toggle}className={cn("flex w-full items-center rounded-xl px-3 py-2.5 font-medium transition-all duration-200",isLight ? "text-slate-500 hover:bg-black/5 hover:text-slate-800" : "text-zinc-500 hover:bg-white/5 hover:text-zinc-200")}>{isLight ? <Sun className="mr-3 h-4 w-4 text-amber-500" /> : <Moon className="mr-3 h-4 w-4 text-blue-400" />}{isLight ? t("theme_light") : t("theme_dark")}</button>{/* Language switcher */}<div className="relative"><button onClick={() => setShowLang(!showLang)}className={cn("flex w-full items-center rounded-xl px-3 py-2.5 font-medium transition-all duration-200",isLight ? "text-slate-500 hover:bg-black/5 hover:text-slate-800" : "text-zinc-500 hover:bg-white/5 hover:text-zinc-200")}><Globe className="mr-3 h-4 w-4" /><span className="flex-1 text-left">{LANGUAGES[language].native}</span><span className="text-base">{LANGUAGES[language].flag}</span></button>{showLang && (<div className={cn("absolute bottom-full left-0 right-0 mb-1 rounded-xl border overflow-hidden shadow-xl z-50",isLight ? "bg-white border-black/8" : "bg-zinc-900 border-white/10")}>{(Object.entries(LANGUAGES) as [Language, typeof LANGUAGES[Language]][]).map(([code, info]) => (<button key={code} onClick={() => { setLanguage(code); setShowLang(false); }}className={cn("flex w-full items-center gap-2 px-3 py-2.5 text-sm transition-colors",language === code? isLight ? "bg-emerald-50 text-emerald-700" : "bg-emerald-500/10 text-emerald-400": isLight ? "text-slate-600 hover:bg-slate-50" : "text-zinc-400 hover:bg-white/5")}><span>{info.flag}</span><span>{info.native}</span><span className={cn("text-xs ml-auto", isLight ? "text-slate-400" : "text-zinc-600")}>{info.label}</span></button>))}</div>)}</div>{/* Sign out */}<button onClick={handleLogout}className={cn("flex w-full items-center rounded-xl px-3 py-2.5 font-medium transition-all duration-200",isLight ? "text-slate-500 hover:bg-red-50 hover:text-red-600" : "text-zinc-500 hover:bg-red-500/8 hover:text-red-400")}><LogOut className="mr-3 h-4 w-4 flex-shrink-0" />{t("sign_out")}</button>22 unmodified lines2324252627282930313233343536373839401 unmodified line4243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825922 unmodified linesconst [showLang, setShowLang] = useState(false);const navigation = [{ key: "overview", href: "/", icon: LayoutDashboard },{ key: "transactions", href: "/transactions", icon: ArrowRightLeft },{ key: "payments", href: "/payments", icon: CreditCard, badge: "NEW" },{ key: "analytics", href: "/analytics", icon: BarChart2 },{ key: "simulator", href: "/simulator", icon: Zap },{ key: "loans", href: "/loans", icon: Wallet },{ key: "goals", href: "/goals", icon: Target },{ key: "documents", href: "/documents", icon: FileText, badge: "AI" },{ key: "ai_assistant", href: "/chat", icon: MessageSquare, badge: "AI" },{ key: "security", href: "/security", icon: Shield },{ key: "system_status", href: "/status", icon: Activity },{ key: "settings", href: "/settings", icon: Settings },];const handleLogout = () => { logout(); router.replace("/login"); };1 unmodified lineconst isLight = theme === "light";return (<divclassName="flex h-full w-60 flex-col overflow-y-auto border-r text-sm backdrop-blur-2xl transition-colors duration-300"style={{background: "var(--sidebar-bg)",borderColor: "var(--border)",color: "var(--fg)",}}>{/* ── Logo ─────────────────────────────────────────────────────────────── */}<divclassName="flex h-16 shrink-0 items-center gap-2.5 px-5 border-b"style={{ borderColor: "var(--border)" }}><div className="flex h-8 w-8 items-center justify-center rounded-xl bg-gradient-to-br from-emerald-400 to-cyan-500 shadow-lg shadow-emerald-500/20"><Sparkles className="h-4 w-4 text-white" /></div><div><h1 className="text-base font-bold leading-tight" style={{ color: "var(--fg)" }}>BankBot</h1><p className="text-[10px] text-emerald-500 leading-tight">AI Finance</p></div></div>{/* ── Nav ──────────────────────────────────────────────────────────────── */}<div className="flex flex-1 flex-col justify-between px-3 py-4"><nav className="space-y-0.5">{navigation.map((item) => {const isActive = pathname === item.href;return (<Linkkey={item.key}href={item.href}className={cn("group relative flex items-center rounded-xl px-3 py-2.5 font-medium transition-all duration-200",isActive? "": isLight? "hover:bg-black/5": "hover:bg-white/5")}style={{color: isActive? "var(--fg)": "var(--fg-subtle)",}}>{/* Active background pill */}{isActive && (<motion.divlayoutId="activeNav"className={cn("absolute inset-0 rounded-xl border",isLight? "bg-emerald-50 border-emerald-200/80": "bg-white/10 border-white/10")}transition={{ type: "spring", bounce: 0.2, duration: 0.4 }}/>)}{/* Active left accent */}{isActive && (<div className="absolute left-0 top-1/2 -translate-y-1/2 h-5 w-0.5 rounded-full bg-emerald-500" />)}<item.iconclassName={cn("relative mr-3 h-4 w-4 flex-shrink-0 transition-colors",isActive? "text-emerald-500": isLight? "text-slate-400 group-hover:text-slate-600": "text-zinc-500 group-hover:text-zinc-300")}/><span className="relative flex-1">{t(item.key)}</span>{item.badge && (<spanclassName={cn("relative ml-auto rounded-md px-1.5 py-0.5 text-[9px] font-bold uppercase tracking-wide border",item.badge === "AI"? "bg-emerald-500/15 text-emerald-500 border-emerald-500/30": "bg-blue-500/15 text-blue-500 border-blue-500/30")}>{item.badge}</span>)}</Link>);})}</nav>{/* ── Bottom controls ───────────────────────────────────────────────── */}<divclassName="space-y-1 pt-4 border-t"style={{ borderColor: "var(--border)" }}>{/* AI Shield status */}<divclassName={cn("flex items-center gap-2.5 rounded-xl px-3 py-2.5 border",isLight? "bg-emerald-50 border-emerald-200/80": "bg-emerald-500/5 border-emerald-500/10")}><div className="h-1.5 w-1.5 rounded-full bg-emerald-400 animate-pulse flex-shrink-0" /><div className="flex-1 min-w-0"><p className="text-xs font-medium text-emerald-500 leading-tight">{t("ai_shield")}</p><pclassName="text-[10px] leading-tight truncate"style={{ color: "var(--fg-subtle)" }}>{t("all_normal")}</p></div></div>{/* Theme toggle */}<buttononClick={toggle}className={cn("flex w-full items-center rounded-xl px-3 py-2.5 font-medium transition-all duration-200",isLight ? "hover:bg-black/5" : "hover:bg-white/5")}style={{ color: "var(--fg-muted)" }}>{isLight? <Sun className="mr-3 h-4 w-4 text-amber-500" />: <Moon className="mr-3 h-4 w-4 text-indigo-400" />}{isLight ? t("theme_light") : t("theme_dark")}</button>{/* Language switcher */}<div className="relative"><buttononClick={() => setShowLang(!showLang)}className={cn("flex w-full items-center rounded-xl px-3 py-2.5 font-medium transition-all duration-200",isLight ? "hover:bg-black/5" : "hover:bg-white/5",showLang && (isLight ? "bg-black/5" : "bg-white/5"))}style={{ color: "var(--fg-muted)" }}><Globe className="mr-3 h-4 w-4" /><span className="flex-1 text-left">{LANGUAGES[language].native}</span><span className="text-base leading-none">{LANGUAGES[language].flag}</span></button>{showLang && (<motion.divinitial={{ opacity: 0, y: 4, scale: 0.97 }}animate={{ opacity: 1, y: 0, scale: 1 }}exit={{ opacity: 0, y: 4, scale: 0.97 }}transition={{ duration: 0.15 }}className="absolute bottom-full left-0 right-0 mb-1.5 rounded-xl border overflow-hidden shadow-2xl z-50"style={{background: isLight ? "white" : "#18181b",borderColor: "var(--border-strong)",boxShadow: isLight? "0 8px 32px rgba(15,23,42,0.12)": "0 8px 32px rgba(0,0,0,0.5)",}}>{(Object.entries(LANGUAGES) as [Language, typeof LANGUAGES[Language]][]).map(([code, info]) => (<buttonkey={code}onClick={() => { setLanguage(code); setShowLang(false); }}className={cn("flex w-full items-center gap-3 px-3 py-2.5 text-sm transition-colors",language === code? isLight? "bg-emerald-50 text-emerald-700": "bg-emerald-500/10 text-emerald-400": isLight? "text-slate-600 hover:bg-slate-50": "text-zinc-300 hover:bg-white/5")}><span className="text-base leading-none">{info.flag}</span><span className="flex-1 text-left font-medium">{info.native}</span><spanclassName="text-xs"style={{ color: "var(--fg-subtle)" }}>{info.label}</span>{language === code && (<span className="ml-1 text-emerald-500 text-xs">✓</span>)}</button>))}</motion.div>)}</div>{/* Sign out */}<buttononClick={handleLogout}className={cn("flex w-full items-center rounded-xl px-3 py-2.5 font-medium transition-all duration-200",isLight? "text-slate-500 hover:bg-red-50 hover:text-red-600": "text-zinc-500 hover:bg-red-500/10 hover:text-red-400")}><LogOut className="mr-3 h-4 w-4 flex-shrink-0" />{t("sign_out")}</button>
6 unmodified lines789101112131415161718192015 unmodified lines363738394041424344454647483 unmodified lines5253545556575859606162636465666768697071727374759 unmodified lines85868788899051 unmodified lines1421431441451461471481491501511521531541 unmodified line1561571581591601611621631641651661671681691701711721731741751761771781791801811821831841855 unmodified lines1911921931941951961971 unmodified line1992002012022032042052062072082092102112122132142152162174 unmodified lines2222232242252262277 unmodified lines2352362372382392402416 unmodified linesDollarSign, X, CheckCheck, Bell, RefreshCw} from "lucide-react";import { notificationsApi, NotificationItem } from "@/lib/api";// ─── Type config ──────────────────────────────────────────────────────────────const typeConfig: Record<string, { icon: React.ElementType; color: string; bg: string }> = {alert: { icon: Shield, color: "text-red-400", bg: "bg-red-500/10 border-red-500/20" },insight: { icon: Sparkles, color: "text-blue-400", bg: "bg-blue-500/10 border-blue-500/20" },warning: { icon: AlertTriangle, color: "text-amber-400", bg: "bg-amber-500/10 border-amber-500/20" },success: { icon: TrendingUp, color: "text-emerald-400", bg: "bg-emerald-500/10 border-emerald-500/20" },default: { icon: DollarSign, color: "text-zinc-400", bg: "bg-zinc-500/10 border-zinc-500/20" },};function getTypeConfig(type: string) {15 unmodified linesnotification,onDismiss,onRead,}: {notification: NotificationItem;onDismiss: (id: string) => void;onRead: (id: string) => void;}) {const config = getTypeConfig(notification.type);const Icon = config.icon;return (<motion.div3 unmodified linesexit={{ opacity: 0, x: 20, height: 0, marginBottom: 0 }}transition={{ duration: 0.25 }}onClick={() => onRead(notification.id)}className={`relative flex gap-3 rounded-xl border p-3 cursor-pointer transition-all group ${config.bg} ${!notification.read ? "ring-1 ring-white/5" : "opacity-60"}`}>{!notification.read && (<div className="absolute top-3 right-3 h-1.5 w-1.5 rounded-full bg-blue-400" />)}<div className={`flex h-8 w-8 flex-shrink-0 items-center justify-center rounded-lg border ${config.bg}`}><Icon className={`h-4 w-4 ${config.color}`} /></div><div className="flex-1 min-w-0 pr-4"><p className="text-xs font-semibold text-white leading-tight">{notification.title}</p><p className="text-xs text-zinc-400 mt-0.5 leading-relaxed line-clamp-2">{notification.message}</p><p className="text-xs text-zinc-600 mt-1">{timeAgo(notification.created_at)}</p></div><buttononClick={(e) => { e.stopPropagation(); onDismiss(notification.id); }}className="absolute top-2 right-2 p-0.5 rounded text-zinc-600 hover:text-zinc-400 transition-colors opacity-0 group-hover:opacity-100"><X className="h-3 w-3" /></button>9 unmodified linesisOpen: boolean;onClose: () => void;}) {const [notifications, setNotifications] = useState<NotificationItem[]>([]);const [unreadCount, setUnreadCount] = useState(0);const [filter, setFilter] = useState<"all" | "unread">("all");51 unmodified linesanimate={{ opacity: 1, y: 0, scale: 1 }}exit={{ opacity: 0, y: -10, scale: 0.97 }}transition={{ duration: 0.2, ease: "easeOut" }}className="absolute right-0 top-full mt-2 z-50 w-80 rounded-2xl border border-white/10 bg-zinc-950/95 backdrop-blur-2xl shadow-2xl shadow-black/50 overflow-hidden">{/* Header */}<div className="flex items-center justify-between border-b border-white/10 px-4 py-3"><div className="flex items-center gap-2"><Bell className="h-4 w-4 text-zinc-400" /><span className="text-sm font-semibold text-white">Notifications</span>{unreadCount > 0 && (<span className="flex h-4 w-4 items-center justify-center rounded-full bg-blue-500 text-[10px] font-bold text-white">{unreadCount}1 unmodified line)}</div><div className="flex items-center gap-2"><button onClick={loadNotifications} className="text-zinc-500 hover:text-zinc-300 transition-colors"><RefreshCw className={`h-3.5 w-3.5 ${loading ? "animate-spin" : ""}`} /></button>{unreadCount > 0 && (<button onClick={markAllRead} className="flex items-center gap-1 text-xs text-zinc-500 hover:text-zinc-300 transition-colors"><CheckCheck className="h-3 w-3" />All read</button>)}<button onClick={onClose} className="text-zinc-500 hover:text-zinc-300 transition-colors"><X className="h-4 w-4" /></button></div></div>{/* Filter tabs */}<div className="flex gap-1 border-b border-white/10 px-4 py-2">{(["all", "unread"] as const).map((f) => (<buttonkey={f}onClick={() => setFilter(f)}className={`rounded-lg px-3 py-1 text-xs font-medium capitalize transition-all ${filter === f ? "bg-white/10 text-white" : "text-zinc-500 hover:text-zinc-300"}`}>{f} {f === "unread" && unreadCount > 0 && `(${unreadCount})`}</button>5 unmodified lines<AnimatePresence mode="popLayout">{loading ? (<div className="flex items-center justify-center py-8"><RefreshCw className="h-5 w-5 text-zinc-600 animate-spin" /></div>) : displayed.length === 0 ? (<motion.div1 unmodified lineanimate={{ opacity: 1 }}className="flex flex-col items-center gap-2 py-8 text-center"><Bell className="h-8 w-8 text-zinc-700" /><p className="text-sm text-zinc-500">No notifications</p></motion.div>) : (displayed.map((n) => (<NotifItem key={n.id} notification={n} onDismiss={dismiss} onRead={markRead} />)))}</AnimatePresence></div><div className="border-t border-white/10 px-4 py-2.5"><p className="text-center text-xs text-zinc-600">Real-time · AI-powered · Encrypted</p></div></motion.div></>4 unmodified lines// ─── Notification Bell ────────────────────────────────────────────────────────export function NotificationBell() {const [isOpen, setIsOpen] = useState(false);const [unreadCount, setUnreadCount] = useState(0);7 unmodified lineswhileHover={{ scale: 1.05 }}whileTap={{ scale: 0.95 }}onClick={() => setIsOpen((v) => !v)}className="relative rounded-xl bg-white/5 p-2.5 text-zinc-400 hover:text-white hover:bg-white/10 transition-all duration-200 focus:outline-none"><Bell className="h-5 w-5" aria-hidden="true" />{unreadCount > 0 && (6 unmodified lines789101112131415161718192021222324252615 unmodified lines424344454647484950515253545556573 unmodified lines61626364656667686970717273747576777879808182838485868788899091929 unmodified lines10210310410510610710810911051 unmodified lines1621631641651661671681691701711721731741751761771781791801811821831841851861 unmodified line1881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362375 unmodified lines2432442452462472482491 unmodified line2512522532542552562572582592602612622632642652662672682692702712722732742752762772782792804 unmodified lines2852862872882892902912927 unmodified lines3003013023033043053063073083093106 unmodified linesDollarSign, X, CheckCheck, Bell, RefreshCw} from "lucide-react";import { notificationsApi, NotificationItem } from "@/lib/api";import { useThemeStore } from "@/lib/stores/themeStore";// ─── Type config ──────────────────────────────────────────────────────────────const typeConfig: Record<string, {icon: React.ElementType;color: string;darkBg: string;lightBg: string;}> = {alert: { icon: Shield, color: "text-red-500", darkBg: "bg-red-500/10 border-red-500/20", lightBg: "bg-red-50 border-red-200/70" },insight: { icon: Sparkles, color: "text-blue-500", darkBg: "bg-blue-500/10 border-blue-500/20", lightBg: "bg-blue-50 border-blue-200/70" },warning: { icon: AlertTriangle, color: "text-amber-500", darkBg: "bg-amber-500/10 border-amber-500/20", lightBg: "bg-amber-50 border-amber-200/70" },success: { icon: TrendingUp, color: "text-emerald-500", darkBg: "bg-emerald-500/10 border-emerald-500/20", lightBg: "bg-emerald-50 border-emerald-200/70" },default: { icon: DollarSign, color: "text-slate-500", darkBg: "bg-zinc-500/10 border-zinc-500/20", lightBg: "bg-slate-50 border-slate-200/70" },};function getTypeConfig(type: string) {15 unmodified linesnotification,onDismiss,onRead,isLight,}: {notification: NotificationItem;onDismiss: (id: string) => void;onRead: (id: string) => void;isLight: boolean;}) {const config = getTypeConfig(notification.type);const Icon = config.icon;const bgClass = isLight ? config.lightBg : config.darkBg;return (<motion.div3 unmodified linesexit={{ opacity: 0, x: 20, height: 0, marginBottom: 0 }}transition={{ duration: 0.25 }}onClick={() => onRead(notification.id)}className={`relative flex gap-3 rounded-xl border p-3 cursor-pointer transition-all group ${bgClass} ${!notification.read ? "ring-1 ring-inset" : "opacity-60"}`}>{!notification.read && (<div className="absolute top-3 right-3 h-1.5 w-1.5 rounded-full bg-blue-500" />)}<div className={`flex h-8 w-8 flex-shrink-0 items-center justify-center rounded-lg border ${bgClass}`}><Icon className={`h-4 w-4 ${config.color}`} /></div><div className="flex-1 min-w-0 pr-4"><p className="text-xs font-semibold leading-tight" style={{ color: "var(--fg)" }}>{notification.title}</p><p className="text-xs mt-0.5 leading-relaxed line-clamp-2" style={{ color: "var(--fg-muted)" }}>{notification.message}</p><p className="text-xs mt-1" style={{ color: "var(--fg-subtle)" }}>{timeAgo(notification.created_at)}</p></div><buttononClick={(e) => { e.stopPropagation(); onDismiss(notification.id); }}className={`absolute top-2 right-2 p-0.5 rounded transition-colors opacity-0 group-hover:opacity-100 ${isLight ? "text-slate-400 hover:text-slate-600" : "text-zinc-600 hover:text-zinc-400"}`}><X className="h-3 w-3" /></button>9 unmodified linesisOpen: boolean;onClose: () => void;}) {const { theme } = useThemeStore();const isLight = theme === "light";const [notifications, setNotifications] = useState<NotificationItem[]>([]);const [unreadCount, setUnreadCount] = useState(0);const [filter, setFilter] = useState<"all" | "unread">("all");51 unmodified linesanimate={{ opacity: 1, y: 0, scale: 1 }}exit={{ opacity: 0, y: -10, scale: 0.97 }}transition={{ duration: 0.2, ease: "easeOut" }}className="absolute right-0 top-full mt-2 z-50 w-80 rounded-2xl border backdrop-blur-2xl overflow-hidden"style={{background: isLight ? "rgba(255,255,255,0.97)" : "rgba(9,9,11,0.97)",borderColor: "var(--border-strong)",boxShadow: isLight? "0 8px 40px rgba(15,23,42,0.14), 0 2px 8px rgba(15,23,42,0.08)": "0 8px 40px rgba(0,0,0,0.6)",}}>{/* Header */}<divclassName="flex items-center justify-between border-b px-4 py-3"style={{ borderColor: "var(--border)" }}><div className="flex items-center gap-2"><Bell className="h-4 w-4" style={{ color: "var(--fg-muted)" }} /><span className="text-sm font-semibold" style={{ color: "var(--fg)" }}>Notifications</span>{unreadCount > 0 && (<span className="flex h-4 w-4 items-center justify-center rounded-full bg-blue-500 text-[10px] font-bold text-white">{unreadCount}1 unmodified line)}</div><div className="flex items-center gap-2"><buttononClick={loadNotifications}className="transition-colors hover:text-emerald-500"style={{ color: "var(--fg-subtle)" }}><RefreshCw className={`h-3.5 w-3.5 ${loading ? "animate-spin" : ""}`} /></button>{unreadCount > 0 && (<buttononClick={markAllRead}className="flex items-center gap-1 text-xs transition-colors hover:text-emerald-500"style={{ color: "var(--fg-subtle)" }}><CheckCheck className="h-3 w-3" />All read</button>)}<buttononClick={onClose}className="transition-colors hover:text-red-500"style={{ color: "var(--fg-subtle)" }}><X className="h-4 w-4" /></button></div></div>{/* Filter tabs */}<divclassName="flex gap-1 border-b px-4 py-2"style={{ borderColor: "var(--border)" }}>{(["all", "unread"] as const).map((f) => (<buttonkey={f}onClick={() => setFilter(f)}className={`rounded-lg px-3 py-1 text-xs font-medium capitalize transition-all ${filter === f? isLight? "bg-slate-100 text-slate-800": "bg-white/10 text-white": ""}`}style={filter !== f ? { color: "var(--fg-subtle)" } : undefined}>{f} {f === "unread" && unreadCount > 0 && `(${unreadCount})`}</button>5 unmodified lines<AnimatePresence mode="popLayout">{loading ? (<div className="flex items-center justify-center py-8"><RefreshCw className="h-5 w-5 animate-spin" style={{ color: "var(--fg-subtle)" }} /></div>) : displayed.length === 0 ? (<motion.div1 unmodified lineanimate={{ opacity: 1 }}className="flex flex-col items-center gap-2 py-8 text-center"><Bell className="h-8 w-8" style={{ color: "var(--fg-subtle)" }} /><p className="text-sm" style={{ color: "var(--fg-muted)" }}>No notifications</p></motion.div>) : (displayed.map((n) => (<NotifItemkey={n.id}notification={n}onDismiss={dismiss}onRead={markRead}isLight={isLight}/>)))}</AnimatePresence></div><divclassName="border-t px-4 py-2.5"style={{ borderColor: "var(--border)" }}><p className="text-center text-xs" style={{ color: "var(--fg-subtle)" }}>Real-time · AI-powered · Encrypted</p></div></motion.div></>4 unmodified lines// ─── Notification Bell ────────────────────────────────────────────────────────export function NotificationBell() {const { theme } = useThemeStore();const isLight = theme === "light";const [isOpen, setIsOpen] = useState(false);const [unreadCount, setUnreadCount] = useState(0);7 unmodified lineswhileHover={{ scale: 1.05 }}whileTap={{ scale: 0.95 }}onClick={() => setIsOpen((v) => !v)}className={`relative rounded-xl p-2.5 transition-all duration-200 focus:outline-none ${isLight? "bg-slate-100 text-slate-500 hover:bg-slate-200 hover:text-slate-800": "bg-white/5 text-zinc-400 hover:text-white hover:bg-white/10"}`}><Bell className="h-5 w-5" aria-hidden="true" />{unreadCount > 0 && (
14 unmodified lines1516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686914 unmodified lines// ─── UI translations ──────────────────────────────────────────────────────────export const T: Record<Language, Record<string, string>> = {en: {overview: "Overview", transactions: "Transactions", payments: "Payments",analytics: "Analytics", simulator: "Simulator", loans: "Loans",goals: "Goals", ai_assistant: "AI Assistant", security: "Security",system_status: "System Status", settings: "Settings", documents: "Documents",sign_out: "Sign Out", ai_shield: "AI Shield Active", all_normal: "All systems normal",upload_doc: "Upload Document", doc_analyzer: "Document Analyzer",ask_doc: "Ask about this document...", analyzing: "Analyzing...",no_docs: "No documents yet", drop_here: "Drop files here or click to upload",supported: "PDF, DOCX, TXT, CSV — max 10 MB",chat_placeholder: "Ask about your finances...",theme_dark: "Dark Mode", theme_light: "Light Mode",language: "Language", save: "Save", cancel: "Cancel",fraud_alerts: "Fraud Alerts", total_balance: "Total Balance",monthly_income: "Monthly Income", monthly_spend: "Monthly Spend",savings_rate: "Savings Rate",},hi: {overview: "अवलोकन", transactions: "लेनदेन", payments: "भुगतान",analytics: "विश्लेषण", simulator: "सिमुलेटर", loans: "ऋण",goals: "लक्ष्य", ai_assistant: "AI सहायक", security: "सुरक्षा",system_status: "सिस्टम स्थिति", settings: "सेटिंग्स", documents: "दस्तावेज़",sign_out: "साइन आउट", ai_shield: "AI शील्ड सक्रिय", all_normal: "सभी सिस्टम सामान्य",upload_doc: "दस्तावेज़ अपलोड करें", doc_analyzer: "दस्तावेज़ विश्लेषक",ask_doc: "इस दस्तावेज़ के बारे में पूछें...", analyzing: "विश्लेषण हो रहा है...",no_docs: "अभी तक कोई दस्तावेज़ नहीं", drop_here: "फ़ाइलें यहाँ छोड़ें या अपलोड करने के लिए क्लिक करें",supported: "PDF, DOCX, TXT, CSV — अधिकतम 10 MB",chat_placeholder: "अपने वित्त के बारे में पूछें...",theme_dark: "डार्क मोड", theme_light: "लाइट मोड",language: "भाषा", save: "सहेजें", cancel: "रद्द करें",fraud_alerts: "धोखाधड़ी अलर्ट", total_balance: "कुल शेष",monthly_income: "मासिक आय", monthly_spend: "मासिक खर्च",savings_rate: "बचत दर",},mr: {overview: "आढावा", transactions: "व्यवहार", payments: "देयके",analytics: "विश्लेषण", simulator: "सिम्युलेटर", loans: "कर्ज",goals: "उद्दिष्टे", ai_assistant: "AI सहाय्यक", security: "सुरक्षा",system_status: "सिस्टम स्थिती", settings: "सेटिंग्ज", documents: "कागदपत्रे",sign_out: "साइन आउट", ai_shield: "AI शील्ड सक्रिय", all_normal: "सर्व प्रणाली सामान्य",upload_doc: "कागदपत्र अपलोड करा", doc_analyzer: "कागदपत्र विश्लेषक",ask_doc: "या कागदपत्राबद्दल विचारा...", analyzing: "विश्लेषण होत आहे...",no_docs: "अद्याप कोणतेही कागदपत्र नाही", drop_here: "फाइल्स येथे टाका किंवा अपलोड करण्यासाठी क्लिक करा",supported: "PDF, DOCX, TXT, CSV — कमाल 10 MB",chat_placeholder: "तुमच्या वित्ताबद्दल विचारा...",theme_dark: "डार्क मोड", theme_light: "लाइट मोड",language: "भाषा", save: "जतन करा", cancel: "रद्द करा",fraud_alerts: "फसवणूक अलर्ट", total_balance: "एकूण शिल्लक",monthly_income: "मासिक उत्पन्न", monthly_spend: "मासिक खर्च",savings_rate: "बचत दर",},};14 unmodified lines1516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212314 unmodified lines// ─── UI translations ──────────────────────────────────────────────────────────export const T: Record<Language, Record<string, string>> = {en: {// Navoverview: "Overview", transactions: "Transactions", payments: "Payments",analytics: "Analytics", simulator: "Simulator", loans: "Loans",goals: "Goals", ai_assistant: "AI Assistant", security: "Security",system_status: "System Status", settings: "Settings", documents: "Documents",sign_out: "Sign Out", ai_shield: "AI Shield Active", all_normal: "All systems normal",// Dashboardgood_morning: "Good morning", good_afternoon: "Good afternoon", good_evening: "Good evening",financial_overview: "Here's your financial overview for today.",backend_offline: "Backend offline", showing_cached: "showing cached data.",retry: "Retry", ai_daily_briefing: "AI Daily Briefing —",health_score: "Health score:", no_fraud_alerts: "No fraud alerts",total_balance: "Total Balance", monthly_income: "Monthly Income",monthly_spend: "Monthly Spend", savings_rate: "Savings Rate",vs_target: "vs target", vs_last_month: "vs last month",cash_flow: "Cash Flow", income_vs_expenses: "Income vs Expenses vs Savings",income: "Income", expenses: "Expenses", savings: "Savings",spending_breakdown: "Spending Breakdown", this_month_by_category: "This month by category",recent_transactions: "Recent Transactions", latest_activity: "Your latest activity",view_all: "View all", fraud_shield_active: "AI Fraud Shield active",alerts_require_attention: "alert(s) require your attention.",all_monitored: "All transactions monitored in real-time. No suspicious activity detected.",review: "Review",// Documentsupload_doc: "Upload Document", doc_analyzer: "Document Analyzer",ask_doc: "Ask about this document...", analyzing: "Analyzing...",no_docs: "No documents yet", drop_here: "Drop files here or click to upload",supported: "PDF, DOCX, TXT, CSV — max 10 MB",// Chatchat_placeholder: "Ask about your finances...",// Settingstheme_dark: "Dark Mode", theme_light: "Light Mode",language: "Language", save: "Save", cancel: "Cancel", fraud_alerts: "Fraud Alerts",},hi: {// Navoverview: "अवलोकन", transactions: "लेनदेन", payments: "भुगतान",analytics: "विश्लेषण", simulator: "सिमुलेटर", loans: "ऋण",goals: "लक्ष्य", ai_assistant: "AI सहायक", security: "सुरक्षा",system_status: "सिस्टम स्थिति", settings: "सेटिंग्स", documents: "दस्तावेज़",sign_out: "साइन आउट", ai_shield: "AI शील्ड सक्रिय", all_normal: "सभी सिस्टम सामान्य",// Dashboardgood_morning: "शुभ प्रभात", good_afternoon: "शुभ दोपहर", good_evening: "शुभ संध्या",financial_overview: "यहाँ आज के लिए आपका वित्तीय अवलोकन है।",backend_offline: "बैकएंड ऑफ़लाइन", showing_cached: "कैश डेटा दिखा रहा है।",retry: "पुनः प्रयास करें", ai_daily_briefing: "AI दैनिक ब्रीफिंग —",health_score: "स्वास्थ्य स्कोर:", no_fraud_alerts: "कोई धोखाधड़ी अलर्ट नहीं",total_balance: "कुल शेष", monthly_income: "मासिक आय",monthly_spend: "मासिक खर्च", savings_rate: "बचत दर",vs_target: "लक्ष्य बनाम", vs_last_month: "पिछले महीने बनाम",cash_flow: "नकद प्रवाह", income_vs_expenses: "आय बनाम खर्च बनाम बचत",income: "आय", expenses: "खर्च", savings: "बचत",spending_breakdown: "खर्च विवरण", this_month_by_category: "इस महीने श्रेणी के अनुसार",recent_transactions: "हाल के लेनदेन", latest_activity: "आपकी नवीनतम गतिविधि",view_all: "सभी देखें", fraud_shield_active: "AI धोखाधड़ी शील्ड सक्रिय",alerts_require_attention: "अलर्ट को आपके ध्यान की आवश्यकता है।",all_monitored: "सभी लेनदेन वास्तविक समय में मॉनिटर किए जाते हैं। कोई संदिग्ध गतिविधि नहीं मिली।",review: "समीक्षा करें",// Documentsupload_doc: "दस्तावेज़ अपलोड करें", doc_analyzer: "दस्तावेज़ विश्लेषक",ask_doc: "इस दस्तावेज़ के बारे में पूछें...", analyzing: "विश्लेषण हो रहा है...",no_docs: "अभी तक कोई दस्तावेज़ नहीं", drop_here: "फ़ाइलें यहाँ छोड़ें या अपलोड करने के लिए क्लिक करें",supported: "PDF, DOCX, TXT, CSV — अधिकतम 10 MB",// Chatchat_placeholder: "अपने वित्त के बारे में पूछें...",// Settingstheme_dark: "डार्क मोड", theme_light: "लाइट मोड",language: "भाषा", save: "सहेजें", cancel: "रद्द करें", fraud_alerts: "धोखाधड़ी अलर्ट",},mr: {// Navoverview: "आढावा", transactions: "व्यवहार", payments: "देयके",analytics: "विश्लेषण", simulator: "सिम्युलेटर", loans: "कर्ज",goals: "उद्दिष्टे", ai_assistant: "AI सहाय्यक", security: "सुरक्षा",system_status: "सिस्टम स्थिती", settings: "सेटिंग्ज", documents: "कागदपत्रे",sign_out: "साइन आउट", ai_shield: "AI शील्ड सक्रिय", all_normal: "सर्व प्रणाली सामान्य",// Dashboardgood_morning: "शुभ प्रभात", good_afternoon: "शुभ दुपार", good_evening: "शुभ संध्याकाळ",financial_overview: "येथे आजसाठी तुमचा आर्थिक आढावा आहे.",backend_offline: "बॅकएंड ऑफलाइन", showing_cached: "कॅश केलेला डेटा दर्शवित आहे.",retry: "पुन्हा प्रयत्न करा", ai_daily_briefing: "AI दैनिक ब्रीफिंग —",health_score: "आरोग्य स्कोअर:", no_fraud_alerts: "कोणतेही फसवणूक अलर्ट नाहीत",total_balance: "एकूण शिल्लक", monthly_income: "मासिक उत्पन्न",monthly_spend: "मासिक खर्च", savings_rate: "बचत दर",vs_target: "लक्ष्याविरुद्ध", vs_last_month: "गेल्या महिन्याच्या तुलनेत",cash_flow: "रोख प्रवाह", income_vs_expenses: "उत्पन्न विरुद्ध खर्च विरुद्ध बचत",income: "उत्पन्न", expenses: "खर्च", savings: "बचत",spending_breakdown: "खर्च विभागणी", this_month_by_category: "या महिन्यात श्रेणीनुसार",recent_transactions: "अलीकडील व्यवहार", latest_activity: "तुमची नवीनतम क्रियाकलाप",view_all: "सर्व पहा", fraud_shield_active: "AI फसवणूक शील्ड सक्रिय",alerts_require_attention: "अलर्ट्सकडे तुमचे लक्ष वेधणे आवश्यक आहे.",all_monitored: "सर्व व्यवहार रिअल-टाइममध्ये मॉनिटर केले जातात. कोणतीही संशयास्पद क्रिया आढळली नाही.",review: "पुनरावलोकन करा",// Documentsupload_doc: "कागदपत्र अपलोड करा", doc_analyzer: "कागदपत्र विश्लेषक",ask_doc: "या कागदपत्राबद्दल विचारा...", analyzing: "विश्लेषण होत आहे...",no_docs: "अद्याप कोणतेही कागदपत्र नाही", drop_here: "फाइल्स येथे टाका किंवा अपलोड करण्यासाठी क्लिक करा",supported: "PDF, DOCX, TXT, CSV — कमाल 10 MB",// Chatchat_placeholder: "तुमच्या वित्ताबद्दल विचारा...",// Settingstheme_dark: "डार्क मोड", theme_light: "लाइट मोड",language: "भाषा", save: "जतन करा", cancel: "रद्द करा", fraud_alerts: "फसवणूक अलर्ट",},};