{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "dashboard-ads",
  "title": "Modern Ads Dashboard",
  "description": "",
  "dependencies": [
    "framer-motion",
    "lucide-react"
  ],
  "files": [
    {
      "path": "registry/default/blocks/Dashboard/dashboard-ads.tsx",
      "content": "\"use client\";\n\nimport React, { useEffect, useMemo, useRef, useState } from \"react\";\nimport { motion, AnimatePresence } from \"motion/react\";\nimport {\n  Globe,\n  Clock,\n  AlertTriangle,\n  RotateCw,\n  Cpu,\n  Timer,\n  Home,\n  Compass,\n  Megaphone,\n  Layers,\n  Users,\n  BarChart3,\n  Settings,\n  LogOut,\n  Infinity as InfinityIcon,\n  Music2,\n  LayoutDashboard,\n  Calendar,\n  Folder,\n  PieChart,\n  Lightbulb,\n  SlidersHorizontal,\n  ArrowDownUp,\n  Flag,\n  Square,\n  ChevronDown,\n  Bell,\n  Plus,\n  Search,\n  Command,\n  MoreVertical,\n  Info,\n  PanelLeftClose,\n  Check,\n  TrendingUp,\n  TrendingDown,\n} from \"lucide-react\";\nimport { cn } from \"@/lib/utils\";\n\n/* ------------------------------------------------------------------ */\n/* Types                                                               */\n/* ------------------------------------------------------------------ */\n\ntype IconType = React.ComponentType<{ className?: string }>;\n\ntype SidebarKey = \"overview\" | \"discover\" | \"campaigns\" | \"adsets\" | \"audience\" | \"reports\" | \"google\" | \"meta\" | \"tiktok\" | \"linkedin\" | \"settings\";\n\ntype TopTabKey = \"dashboard\" | \"planner\" | \"assethub\" | \"segments\" | \"insights\" | \"preferences\";\n\ntype CampaignStatus = \"ACTIVE\" | \"PAUSED\" | \"CANCEL\" | \"COMPLETED\";\n\ntype Campaign = {\n  id: string;\n  name: string;\n  status: CampaignStatus;\n  budget: number;\n  spent: number;\n  conversions: number | null;\n  convRate: number | null;\n  roas: number | null;\n  clicks: number | null;\n  ctr: number | null;\n};\n\ntype SortKey = \"name\" | \"status\" | \"budget\" | \"spent\" | \"conversions\" | \"convRate\" | \"roas\" | \"clicks\" | \"ctr\";\n\n/* ------------------------------------------------------------------ */\n/* Static data                                                         */\n/* ------------------------------------------------------------------ */\n\nconst months = [\"JAN\", \"FEB\", \"MAR\", \"APR\", \"MAY\", \"JUN\", \"JUL\", \"AUG\", \"SEP\", \"OCT\", \"NOV\", \"DEC\"];\n\nconst generalNav: { key: SidebarKey; label: string; icon: IconType; badge?: number }[] = [\n  { key: \"overview\", label: \"Overview\", icon: Home },\n  { key: \"discover\", label: \"Discover\", icon: Compass },\n  { key: \"campaigns\", label: \"Campaigns\", icon: Megaphone },\n  { key: \"adsets\", label: \"Ad Sets\", icon: Layers, badge: 12 },\n  { key: \"audience\", label: \"Audience\", icon: Users },\n  { key: \"reports\", label: \"Reports\", icon: BarChart3, badge: 32 },\n];\n\nconst accountNav: { key: SidebarKey; label: string; platform: \"google\" | \"meta\" | \"tiktok\" | \"linkedin\" }[] = [\n  { key: \"google\", label: \"Google Ads\", platform: \"google\" },\n  { key: \"meta\", label: \"Meta Ads\", platform: \"meta\" },\n  { key: \"tiktok\", label: \"TikTok Ads\", platform: \"tiktok\" },\n  { key: \"linkedin\", label: \"LinkedIn Ads\", platform: \"linkedin\" },\n];\n\nconst topTabs: { key: TopTabKey; label: string; icon: IconType }[] = [\n  { key: \"dashboard\", label: \"Dashboard\", icon: LayoutDashboard },\n  { key: \"planner\", label: \"Planner\", icon: Calendar },\n  { key: \"assethub\", label: \"Asset Hub\", icon: Folder },\n  { key: \"segments\", label: \"Segments\", icon: PieChart },\n  { key: \"insights\", label: \"Insights\", icon: Lightbulb },\n  { key: \"preferences\", label: \"Preferences\", icon: SlidersHorizontal },\n];\n\nconst sectionCopy: Partial<Record<SidebarKey, { icon: IconType; title: string; description: string }>> = {\n  discover: { icon: Compass, title: \"Discover\", description: \"Trending creatives and benchmarks across your industry will show up here.\" },\n  campaigns: { icon: Megaphone, title: \"Campaigns\", description: \"Create and manage every campaign across your connected ad accounts.\" },\n  adsets: { icon: Layers, title: \"Ad Sets\", description: \"Group your ads into sets with shared budget and targeting.\" },\n  audience: { icon: Users, title: \"Audience\", description: \"Build and save audience segments to target across platforms.\" },\n  reports: { icon: BarChart3, title: \"Reports\", description: \"Schedule and export custom performance reports.\" },\n  google: { icon: Globe, title: \"Google Ads\", description: \"Connect your Google Ads account to pull performance data in.\" },\n  meta: { icon: InfinityIcon, title: \"Meta Ads\", description: \"Connect Meta Ads to sync Facebook and Instagram campaigns.\" },\n  tiktok: { icon: Music2, title: \"TikTok Ads\", description: \"Connect TikTok Ads to manage spend alongside your other channels.\" },\n  linkedin: { icon: Users, title: \"LinkedIn Ads\", description: \"Connect LinkedIn Ads to track B2B campaign performance.\" },\n  settings: { icon: Settings, title: \"Settings\", description: \"Manage workspace, billing and team preferences.\" },\n};\n\nconst topTabCopy: Partial<Record<TopTabKey, { icon: IconType; title: string; description: string }>> = {\n  planner: { icon: Calendar, title: \"Planner\", description: \"Plan upcoming campaigns and launches on a shared calendar.\" },\n  assethub: { icon: Folder, title: \"Asset Hub\", description: \"Store and organize creatives shared across every campaign.\" },\n  segments: { icon: PieChart, title: \"Segments\", description: \"Slice performance data by audience segment.\" },\n  insights: { icon: Lightbulb, title: \"Insights\", description: \"AI-generated recommendations based on recent performance.\" },\n  preferences: { icon: SlidersHorizontal, title: \"Preferences\", description: \"Configure default currency, timezone and reporting cadence.\" },\n};\n\nconst stats: { icon: IconType; label: string; value: string; unit?: string; delta: string; direction: \"up\" | \"down\"; info: string }[] = [\n  { icon: Globe, label: \"Requests\", value: \"94\", delta: \"12.4%\", direction: \"up\", info: \"Total API requests processed in the selected period.\" },\n  { icon: Clock, label: \"Wall Time\", value: \"0.01\", unit: \"ms\", delta: \"20.4%\", direction: \"up\", info: \"Average wall-clock duration per request.\" },\n  { icon: AlertTriangle, label: \"Errors\", value: \"2\", delta: \"56.4%\", direction: \"down\", info: \"Requests that returned a 4xx or 5xx response.\" },\n  { icon: RotateCw, label: \"Processing Time\", value: \"0\", unit: \"GB/s\", delta: \"1.7%\", direction: \"up\", info: \"Average data throughput per request.\" },\n  { icon: Cpu, label: \"CPU Time\", value: \"0.08\", unit: \"ms\", delta: \"13.1%\", direction: \"down\", info: \"Average CPU time consumed per request.\" },\n  { icon: Timer, label: \"Request Time\", value: \"0.02\", unit: \"ms\", delta: \"1.8%\", direction: \"down\", info: \"End-to-end time from request to response.\" },\n];\n\nconst adPerfDatasets: Record<\"2026\" | \"2025\", number[]> = {\n  \"2026\": [520, 560, 540, 610, 498, 650, 670, 700, 730, 760, 780, 810],\n  \"2025\": [470, 500, 480, 540, 430, 560, 580, 600, 620, 640, 660, 690],\n};\n\nconst campaignBars: { h: number; cat: \"high\" | \"moderate\" | \"low\" }[] = [\n  { h: 70, cat: \"high\" }, { h: 45, cat: \"moderate\" }, { h: 30, cat: \"low\" }, { h: 55, cat: \"moderate\" }, { h: 65, cat: \"high\" }, { h: 40, cat: \"moderate\" },\n  { h: 75, cat: \"high\" }, { h: 60, cat: \"high\" }, { h: 25, cat: \"low\" }, { h: 35, cat: \"moderate\" }, { h: 70, cat: \"high\" }, { h: 20, cat: \"low\" },\n  { h: 50, cat: \"moderate\" }, { h: 65, cat: \"high\" }, { h: 30, cat: \"low\" }, { h: 55, cat: \"moderate\" }, { h: 60, cat: \"high\" }, { h: 45, cat: \"moderate\" },\n  { h: 80, cat: \"high\" }, { h: 70, cat: \"high\" }, { h: 35, cat: \"moderate\" }, { h: 60, cat: \"high\" }, { h: 75, cat: \"high\" }, { h: 50, cat: \"moderate\" },\n  { h: 65, cat: \"high\" }, { h: 55, cat: \"moderate\" }, { h: 25, cat: \"low\" }, { h: 70, cat: \"high\" }, { h: 60, cat: \"high\" }, { h: 40, cat: \"moderate\" },\n  { h: 75, cat: \"high\" }, { h: 30, cat: \"low\" }, { h: 65, cat: \"high\" }, { h: 50, cat: \"moderate\" }, { h: 35, cat: \"low\" }, { h: 70, cat: \"high\" },\n];\n\nconst campaignsSeed: Campaign[] = [\n  { id: \"c1\", name: \"Spring Sale Boost\", status: \"ACTIVE\", budget: 50, spent: 48.67, conversions: 128, convRate: 6.42, roas: 4.21, clicks: 1987, ctr: 6.91 },\n  { id: \"c2\", name: \"New App Install Drive\", status: \"ACTIVE\", budget: 40, spent: 36.21, conversions: 312, convRate: 18.35, roas: 3.67, clicks: 1700, ctr: 7.57 },\n  { id: \"c3\", name: \"Brand Awareness Q2\", status: \"PAUSED\", budget: 30, spent: 27.89, conversions: null, convRate: null, roas: null, clicks: null, ctr: null },\n  { id: \"c4\", name: \"Retargeting Visitors\", status: \"CANCEL\", budget: 25, spent: 12.34, conversions: 42, convRate: 9.24, roas: 5.18, clicks: 455, ctr: 4.62 },\n  { id: \"c5\", name: \"Summer Promo Leads\", status: \"COMPLETED\", budget: 35, spent: 31.75, conversions: 68, convRate: 12.07, roas: 2.84, clicks: 563, ctr: 3.94 },\n  { id: \"c6\", name: \"Video Views Campaign\", status: \"PAUSED\", budget: 25, spent: 21.43, conversions: null, convRate: null, roas: null, clicks: null, ctr: null },\n];\n\nconst dateRangePresets = [\"1 MAY - 31 MAY 2026\", \"1 APR - 30 APR 2026\", \"1 MAR - 31 MAR 2026\"];\n\nconst notifications = [\n  { id: \"n1\", title: \"Spring Sale Boost hit 6.4% conv. rate\", time: \"8m ago\" },\n  { id: \"n2\", title: \"Brand Awareness Q2 was paused\", time: \"2h ago\" },\n  { id: \"n3\", title: \"Monthly report is ready\", time: \"Yesterday\" },\n];\n\nconst addMenuItems = [\n  { key: \"campaign\", label: \"New Campaign\", icon: Megaphone },\n  { key: \"adset\", label: \"New Ad Set\", icon: Layers },\n  { key: \"audience\", label: \"New Audience\", icon: Users },\n  { key: \"report\", label: \"New Report\", icon: BarChart3 },\n];\n\nconst pillSpring = { type: \"spring\" as const, stiffness: 350, damping: 30 };\n\nfunction statusStyle(status: CampaignStatus) {\n  switch (status) {\n    case \"ACTIVE\":\n      return \"bg-blue-500/15 text-blue-400\";\n    case \"PAUSED\":\n      return \"bg-amber-500/15 text-amber-400\";\n    case \"CANCEL\":\n      return \"bg-rose-500/15 text-rose-400\";\n    case \"COMPLETED\":\n      return \"bg-emerald-500/15 text-emerald-400\";\n  }\n}\n\nfunction roasStyle(roas: number | null) {\n  if (roas == null) return \"text-neutral-500\";\n  if (roas > 4) return \"text-emerald-400\";\n  if (roas >= 2) return \"text-amber-400\";\n  return \"text-rose-400\";\n}\n\n/* ------------------------------------------------------------------ */\n/* Generic atoms                                                       */\n/* ------------------------------------------------------------------ */\n\nfunction Dropdown({\n  open,\n  onClose,\n  anchor = \"left\",\n  width = 220,\n  children,\n}: {\n  open: boolean;\n  onClose: () => void;\n  anchor?: \"left\" | \"right\";\n  width?: number;\n  children: React.ReactNode;\n}) {\n  const ref = useRef<HTMLDivElement>(null);\n\n  useEffect(() => {\n    if (!open) return;\n    function handlePointer(e: MouseEvent) {\n      if (ref.current && !ref.current.contains(e.target as Node)) onClose();\n    }\n    function handleKey(e: KeyboardEvent) {\n      if (e.key === \"Escape\") onClose();\n    }\n    document.addEventListener(\"mousedown\", handlePointer);\n    document.addEventListener(\"keydown\", handleKey);\n    return () => {\n      document.removeEventListener(\"mousedown\", handlePointer);\n      document.removeEventListener(\"keydown\", handleKey);\n    };\n  }, [open, onClose]);\n\n  return (\n    <AnimatePresence>\n      {open && (\n        <motion.div\n          ref={ref}\n          initial={{ opacity: 0, y: -6, scale: 0.97 }}\n          animate={{ opacity: 1, y: 0, scale: 1 }}\n          exit={{ opacity: 0, y: -6, scale: 0.97 }}\n          transition={{ duration: 0.15, ease: \"easeOut\" }}\n          style={{ width }}\n          className={cn(\n            \"absolute top-full z-50 mt-2 rounded-lg border border-white/10 bg-[#1A1A1D] p-1.5 font-mono shadow-[0_16px_40px_-12px_rgba(0,0,0,0.6)]\",\n            anchor === \"left\" ? \"left-0\" : \"right-0\"\n          )}\n        >\n          {children}\n        </motion.div>\n      )}\n    </AnimatePresence>\n  );\n}\n\nfunction DropdownItem({\n  icon: Icon,\n  label,\n  onClick,\n  active,\n}: {\n  icon: IconType;\n  label: string;\n  onClick?: () => void;\n  active?: boolean;\n}) {\n  return (\n    <button\n      onClick={onClick}\n      className=\"flex w-full items-center gap-2.5 rounded-md px-2.5 py-2 text-left text-[11.5px] uppercase tracking-wide text-neutral-300 transition-colors hover:bg-white/5\"\n    >\n      <Icon className=\"h-[14px] w-[14px] text-neutral-500\" />\n      <span className=\"flex-1 normal-case tracking-normal\">{label}</span>\n      {active && <Check className=\"h-3.5 w-3.5 text-blue-400\" />}\n    </button>\n  );\n}\n\nfunction MoreHorizontalMenu() {\n  const [open, setOpen] = useState(false);\n  return (\n    <div className=\"relative\">\n      <button onClick={() => setOpen((o) => !o)} className=\"flex h-6 w-6 items-center justify-center rounded-md text-neutral-500 hover:bg-white/5\">\n        <MoreVertical className=\"h-[15px] w-[15px]\" />\n      </button>\n      <Dropdown open={open} onClose={() => setOpen(false)} anchor=\"right\" width={150}>\n        <DropdownItem icon={BarChart3} label=\"View report\" />\n        <DropdownItem icon={Folder} label=\"Export CSV\" />\n      </Dropdown>\n    </div>\n  );\n}\n\nfunction InfoTip({ text }: { text: string }) {\n  const [open, setOpen] = useState(false);\n  return (\n    <div className=\"relative\">\n      <button onClick={() => setOpen((o) => !o)} className=\"flex h-5 w-5 items-center justify-center rounded-md text-neutral-600 hover:bg-white/5 hover:text-neutral-400\">\n        <Info className=\"h-3.5 w-3.5\" />\n      </button>\n      <Dropdown open={open} onClose={() => setOpen(false)} anchor=\"right\" width={190}>\n        <p className=\"px-2 py-1.5 text-[11px] normal-case leading-snug tracking-normal text-neutral-400\">{text}</p>\n      </Dropdown>\n    </div>\n  );\n}\n\ntype Platform = \"google\" | \"meta\" | \"tiktok\" | \"linkedin\";\n\nconst platformLogos: Record<Platform, string> = {\n  google: \"https://api.iconify.design/logos/google-icon.svg\",\n  meta: \"https://api.iconify.design/logos/meta-icon.svg\",\n  tiktok: \"https://api.iconify.design/logos/tiktok-icon.svg\",\n  linkedin: \"https://api.iconify.design/logos/linkedin-icon.svg\",\n};\n\nfunction PlatformIcon({ platform }: { platform: Platform }) {\n  return (\n    <img\n      src={platformLogos[platform]}\n      alt=\"\"\n      className=\"h-5 w-5 object-contain\"\n      loading=\"lazy\"\n    />\n  );\n}\n\nfunction BaguiLogo() {\n  return (\n    <div className=\"flex h-7 w-7 shrink-0 items-center justify-center overflow-hidden\">\n      <img\n        src=\"/logoW.png\"\n        alt=\"BagUi\"\n        className=\"h-full w-full object-contain\"\n      />\n    </div>\n  );\n}\n\n/* ------------------------------------------------------------------ */\n/* Sidebar                                                              */\n/* ------------------------------------------------------------------ */\n\nfunction NavItem({\n  icon,\n  iconNode,\n  label,\n  active,\n  collapsed,\n  badge,\n  onClick,\n}: {\n  icon?: IconType;\n  iconNode?: React.ReactNode;\n  label: string;\n  active?: boolean;\n  collapsed?: boolean;\n  badge?: number;\n  onClick?: () => void;\n}) {\n  const IconComp = icon;\n  return (\n    <button\n      onClick={onClick}\n      title={collapsed ? label : undefined}\n      className={cn(\n        \"relative flex w-full items-center gap-2.5 rounded-lg px-2.5 py-[8px] text-[12px] uppercase tracking-wide transition-colors\",\n        collapsed && \"justify-center px-0\"\n      )}\n    >\n      {active && <motion.span layoutId=\"adforma-nav-pill\" className=\"absolute inset-0 rounded-lg bg-white/[0.07]\" transition={pillSpring} />}\n      <span className=\"relative z-10 flex h-[16px] w-[16px] shrink-0 items-center justify-center\">\n        {iconNode ? iconNode : IconComp ? <IconComp className={cn(\"h-[15px] w-[15px]\", active ? \"text-white\" : \"text-neutral-500\")} /> : null}\n      </span>\n      {!collapsed && <span className={cn(\"relative z-10 flex-1 truncate text-left\", active ? \"font-medium text-white\" : \"text-neutral-400\")}>{label}</span>}\n      {!collapsed && badge != null && (\n        <span className=\"relative z-10 rounded-md bg-white/10 px-[6px] py-[1px] text-[10.5px] normal-case tracking-normal text-neutral-300\">{badge}</span>\n      )}\n    </button>\n  );\n}\n\nfunction SectionHeader({ label, open, onToggle, collapsed }: { label: string; open: boolean; onToggle: () => void; collapsed: boolean }) {\n  if (collapsed) return null;\n  return (\n    <button onClick={onToggle} className=\"flex w-full items-center justify-between px-2.5 pb-1.5 text-[10px] uppercase tracking-widest text-neutral-600 hover:text-neutral-400\">\n      {label}\n      <motion.span animate={{ rotate: open ? 0 : -90 }} transition={{ duration: 0.15 }}>\n        <ChevronDown className=\"h-3 w-3\" />\n      </motion.span>\n    </button>\n  );\n}\n\nfunction Sidebar({\n  activeKey,\n  collapsed,\n  onSelect,\n  onToggleCollapse,\n}: {\n  activeKey: SidebarKey;\n  collapsed: boolean;\n  onSelect: (key: SidebarKey) => void;\n  onToggleCollapse: () => void;\n}) {\n  const [generalOpen, setGeneralOpen] = useState(true);\n  const [accountOpen, setAccountOpen] = useState(true);\n  const [profileOpen, setProfileOpen] = useState(false);\n\n  return (\n    <motion.aside\n      animate={{ width: collapsed ? 72 : 216 }}\n      transition={{ type: \"spring\", stiffness: 260, damping: 28 }}\n      className=\"flex h-full shrink-0 flex-col overflow-hidden border-r border-white/[0.06] bg-[#0C0C0E] px-3 py-4 font-mono\"\n    >\n      <div className={cn(\"mb-5 flex items-center\", collapsed ? \"justify-center\" : \"justify-between\")}>\n        {!collapsed ? (\n          <div className=\"flex items-center gap-2\">\n            <BaguiLogo />\n            <span className=\"text-[15px] font-semibold tracking-tight text-white\">BagUI</span>\n          </div>\n        ) : (\n          <BaguiLogo />\n        )}\n        {!collapsed && (\n          <button onClick={onToggleCollapse} className=\"flex h-6 w-6 items-center justify-center rounded-md text-neutral-500 hover:bg-white/5 hover:text-neutral-300\">\n            <PanelLeftClose className=\"h-[14px] w-[14px]\" />\n          </button>\n        )}\n      </div>\n      {collapsed && (\n        <button\n          onClick={onToggleCollapse}\n          className=\"mb-4 flex h-7 w-7 items-center justify-center self-center rounded-md text-neutral-500 hover:bg-white/5 hover:text-neutral-300\"\n        >\n          <PanelLeftClose className=\"h-[14px] w-[14px] rotate-180\" />\n        </button>\n      )}\n\n      <nav className=\"flex flex-1 flex-col gap-4 overflow-y-auto\">\n        <div className=\"flex flex-col gap-0.5\">\n          <SectionHeader label=\"General\" open={generalOpen} onToggle={() => setGeneralOpen((o) => !o)} collapsed={collapsed} />\n          <AnimatePresence initial={false}>\n            {(generalOpen || collapsed) && (\n              <motion.div\n                initial={{ height: 0, opacity: 0 }}\n                animate={{ height: \"auto\", opacity: 1 }}\n                exit={{ height: 0, opacity: 0 }}\n                transition={{ duration: 0.16 }}\n                className=\"flex flex-col gap-0.5 overflow-hidden\"\n              >\n                {generalNav.map((item) => (\n                  <NavItem\n                    key={item.key}\n                    icon={item.icon}\n                    label={item.label}\n                    badge={item.badge}\n                    active={activeKey === item.key}\n                    collapsed={collapsed}\n                    onClick={() => onSelect(item.key)}\n                  />\n                ))}\n              </motion.div>\n            )}\n          </AnimatePresence>\n        </div>\n\n        <div className=\"flex flex-col gap-0.5\">\n          <SectionHeader label=\"Account\" open={accountOpen} onToggle={() => setAccountOpen((o) => !o)} collapsed={collapsed} />\n          <AnimatePresence initial={false}>\n            {(accountOpen || collapsed) && (\n              <motion.div\n                initial={{ height: 0, opacity: 0 }}\n                animate={{ height: \"auto\", opacity: 1 }}\n                exit={{ height: 0, opacity: 0 }}\n                transition={{ duration: 0.16 }}\n                className=\"flex flex-col gap-0.5 overflow-hidden\"\n              >\n                {accountNav.map((item) => (\n                  <NavItem\n                    key={item.key}\n                    iconNode={<PlatformIcon platform={item.platform} />}\n                    label={item.label}\n                    active={activeKey === item.key}\n                    collapsed={collapsed}\n                    onClick={() => onSelect(item.key)}\n                  />\n                ))}\n              </motion.div>\n            )}\n          </AnimatePresence>\n        </div>\n      </nav>\n\n      <div className=\"flex flex-col gap-0.5 pt-3\">\n        <NavItem icon={Settings} label=\"Settings\" active={activeKey === \"settings\"} collapsed={collapsed} onClick={() => onSelect(\"settings\")} />\n        <NavItem icon={LogOut} label=\"Logout\" collapsed={collapsed} />\n      </div>\n\n      {!collapsed && (\n        <div className=\"relative mt-3 border-t border-white/[0.06] pt-3\">\n          <button onClick={() => setProfileOpen((o) => !o)} className=\"flex w-full items-center gap-2.5 rounded-lg px-1 py-1 hover:bg-white/5\">\n            <img\n              src=\"/avatar.png\"\n              alt=\"Anelka Bag\"\n              className=\"h-8 w-8 shrink-0 rounded-full border border-white/10 bg-neutral-800 object-cover\"\n            />\n            <div className=\"min-w-0 flex-1 text-left\">\n              <p className=\"truncate text-[11.5px] font-medium uppercase tracking-wide text-white\">Anelka Bag</p>\n              <p className=\"truncate text-[10.5px] normal-case tracking-normal text-neutral-500\">ceo@bagui.pro</p>\n            </div>\n            <ChevronDown className=\"h-3.5 w-3.5 shrink-0 text-neutral-500\" />\n          </button>\n          <Dropdown open={profileOpen} onClose={() => setProfileOpen(false)} width={190}>\n            <DropdownItem icon={Settings} label=\"Workspace settings\" />\n            <DropdownItem icon={LogOut} label=\"Log out\" />\n          </Dropdown>\n        </div>\n      )}\n    </motion.aside>\n  );\n}\n\n/* ------------------------------------------------------------------ */\n/* Top bar + tabs                                                       */\n/* ------------------------------------------------------------------ */\n\nfunction TopBar({ query, onQueryChange }: { query: string; onQueryChange: (v: string) => void }) {\n  const [openMenu, setOpenMenu] = useState<\"add\" | \"notif\" | null>(null);\n\n  return (\n    <div className=\"flex items-center justify-between px-6 pb-4 pt-5 font-mono\">\n      <div className=\"flex w-[320px] items-center gap-2 rounded-lg border border-white/[0.07] bg-white/[0.03] px-3 py-2\">\n        <Search className=\"h-[14px] w-[14px] text-neutral-500\" />\n        <input\n          value={query}\n          onChange={(e) => onQueryChange(e.target.value)}\n          placeholder=\"SEARCH...\"\n          className=\"w-full bg-transparent text-[11.5px] uppercase tracking-wide text-neutral-200 placeholder:text-neutral-500 focus:outline-none\"\n        />\n        <span className=\"flex items-center gap-0.5 rounded-md bg-white/[0.06] px-1.5 py-0.5 text-[10px] text-neutral-500\">\n          <Command className=\"h-2.5 w-2.5\" />F\n        </span>\n      </div>\n\n      <div className=\"flex items-center gap-2.5\">\n        <div className=\"relative\">\n          <button\n            onClick={() => setOpenMenu((m) => (m === \"notif\" ? null : \"notif\"))}\n            className=\"flex h-8 w-8 items-center justify-center rounded-lg border border-white/[0.07] bg-white/[0.03] text-neutral-400 hover:text-neutral-200\"\n          >\n            <Bell className=\"h-[15px] w-[15px]\" />\n          </button>\n          <Dropdown open={openMenu === \"notif\"} onClose={() => setOpenMenu(null)} anchor=\"right\" width={240}>\n            <div className=\"px-2.5 py-1.5 text-[10.5px] uppercase tracking-widest text-neutral-500\">Notifications</div>\n            {notifications.map((n) => (\n              <div key={n.id} className=\"flex flex-col gap-0.5 rounded-md px-2.5 py-2 hover:bg-white/5\">\n                <p className=\"text-[11.5px] normal-case tracking-normal text-neutral-200\">{n.title}</p>\n                <p className=\"text-[10.5px] normal-case tracking-normal text-neutral-500\">{n.time}</p>\n              </div>\n            ))}\n          </Dropdown>\n        </div>\n\n        <div className=\"relative\">\n          <button\n            onClick={() => setOpenMenu((m) => (m === \"add\" ? null : \"add\"))}\n            className=\"flex items-center gap-1.5 rounded-lg bg-blue-500 px-3 py-2 text-[11.5px] font-medium uppercase tracking-wide text-white hover:bg-blue-600\"\n          >\n            <Plus className=\"h-3.5 w-3.5\" /> Add <ChevronDown className=\"h-3 w-3\" />\n          </button>\n          <Dropdown open={openMenu === \"add\"} onClose={() => setOpenMenu(null)} anchor=\"right\" width={190}>\n            {addMenuItems.map((item) => (\n              <DropdownItem key={item.key} icon={item.icon} label={item.label} onClick={() => setOpenMenu(null)} />\n            ))}\n          </Dropdown>\n        </div>\n      </div>\n    </div>\n  );\n}\n\nfunction TopTabs({ activeTab, onSelect }: { activeTab: TopTabKey; onSelect: (key: TopTabKey) => void }) {\n  return (\n    <div className=\"flex items-center gap-1 border-b border-white/[0.06] px-6 pb-3 font-mono\">\n      {topTabs.map((tab) => {\n        const active = tab.key === activeTab;\n        return (\n          <button\n            key={tab.key}\n            onClick={() => onSelect(tab.key)}\n            className={cn(\n              \"relative flex items-center gap-1.5 rounded-lg px-3 py-1.5 text-[11.5px] uppercase tracking-wide transition-colors\",\n              active ? \"text-white\" : \"text-neutral-500 hover:text-neutral-300\"\n            )}\n          >\n            {active && <motion.span layoutId=\"adforma-tab-pill\" className=\"absolute inset-0 rounded-lg bg-white/[0.07]\" transition={pillSpring} />}\n            <tab.icon className=\"relative z-10 h-[14px] w-[14px]\" />\n            <span className=\"relative z-10\">{tab.label}</span>\n          </button>\n        );\n      })}\n    </div>\n  );\n}\n\n/* ------------------------------------------------------------------ */\n/* Stat cards                                                           */\n/* ------------------------------------------------------------------ */\n\nfunction StatCard({ stat }: { stat: (typeof stats)[number] }) {\n  const Icon = stat.icon;\n  const TrendIcon = stat.direction === \"up\" ? TrendingUp : TrendingDown;\n  return (\n    <div className=\"rounded-xl border border-white/[0.06] bg-[#141416] p-4 font-mono\">\n      <div className=\"flex items-center justify-between\">\n        <span className=\"flex items-center gap-2 text-[11.5px] uppercase tracking-wide text-neutral-400\">\n          <Icon className=\"h-[14px] w-[14px] text-neutral-500\" />\n          {stat.label}\n        </span>\n        <InfoTip text={stat.info} />\n      </div>\n      <p className=\"mt-2.5 text-[24px] font-semibold text-white\">\n        {stat.value}\n        {stat.unit && <span className=\"ml-0.5 text-[13px] font-normal text-neutral-400\">{stat.unit}</span>}\n      </p>\n      <p className={cn(\"mt-1.5 flex items-center gap-1 text-[11px]\", stat.direction === \"up\" ? \"text-emerald-400\" : \"text-rose-400\")}>\n        <TrendIcon className=\"h-3 w-3\" />\n        {stat.delta}\n        <span className=\"text-neutral-500\">vs last month</span>\n      </p>\n    </div>\n  );\n}\n\n/* ------------------------------------------------------------------ */\n/* Ad performance line chart                                            */\n/* ------------------------------------------------------------------ */\n\nfunction AdPerformanceChart({ year, onYearChange }: { year: \"2026\" | \"2025\"; onYearChange: (y: \"2026\" | \"2025\") => void }) {\n  const [hovered, setHovered] = useState<number | null>(null);\n  const [menuOpen, setMenuOpen] = useState(false);\n  const values = adPerfDatasets[year];\n  const activeIndex = hovered ?? 4;\n\n  const max = Math.max(...values);\n  const min = Math.min(...values);\n  const span = max - min || 1;\n  const pad = span * 0.25;\n  const lo = min - pad;\n  const hi = max + pad;\n\n  const points = values.map((v, i) => ({\n    x: (i / (values.length - 1)) * 100,\n    y: 100 - ((v - lo) / (hi - lo)) * 100,\n  }));\n  const pointsAttr = points.map((p) => `${p.x},${p.y}`).join(\" \");\n  const active = points[activeIndex];\n  const total = values.reduce((a, b) => a + b, 0);\n\n  return (\n    <div className=\"rounded-xl border border-white/[0.06] bg-[#141416] p-5 font-mono\">\n      <div className=\"mb-1 flex items-start justify-between\">\n        <span className=\"text-[11.5px] uppercase tracking-wider text-neutral-400\">Ad Performance</span>\n        <div className=\"relative\">\n          <button\n            onClick={() => setMenuOpen((o) => !o)}\n            className=\"flex items-center gap-1.5 rounded-lg border border-white/[0.08] bg-white/[0.04] px-2.5 py-1.5 text-[11px] uppercase tracking-wide text-neutral-300\"\n          >\n            <Calendar className=\"h-3.5 w-3.5 text-neutral-500\" /> {year} <ChevronDown className=\"h-3 w-3 text-neutral-500\" />\n          </button>\n          <Dropdown open={menuOpen} onClose={() => setMenuOpen(false)} anchor=\"right\" width={110}>\n            {([\"2026\", \"2025\"] as const).map((y) => (\n              <DropdownItem\n                key={y}\n                icon={Calendar}\n                label={y}\n                active={year === y}\n                onClick={() => {\n                  onYearChange(y);\n                  setMenuOpen(false);\n                }}\n              />\n            ))}\n          </Dropdown>\n        </div>\n      </div>\n      <p className=\"text-[26px] font-semibold text-white\">${(total / 1000).toFixed(2)}M</p>\n      <p className=\"mb-4 flex items-center gap-1 text-[11px] text-emerald-400\">\n        <TrendingUp className=\"h-3 w-3\" /> 18.7%\n        <span className=\"text-neutral-500\">vs last year</span>\n      </p>\n\n      <div className=\"relative h-[120px] w-full\">\n        <svg viewBox=\"0 0 100 100\" preserveAspectRatio=\"none\" className=\"absolute inset-0 h-full w-full overflow-visible\">\n          <defs>\n            <filter id=\"adforma-line-glow\" x=\"-60%\" y=\"-60%\" width=\"220%\" height=\"220%\">\n              <feGaussianBlur stdDeviation=\"2.4\" result=\"blur\" />\n              <feMerge>\n                <feMergeNode in=\"blur\" />\n                <feMergeNode in=\"SourceGraphic\" />\n              </feMerge>\n            </filter>\n          </defs>\n          <polyline points={pointsAttr} fill=\"none\" stroke=\"#3B82F6\" strokeWidth=\"1.6\" vectorEffect=\"non-scaling-stroke\" filter=\"url(#adforma-line-glow)\" />\n        </svg>\n\n        <div className=\"absolute inset-0 flex\">\n          {values.map((_, i) => (\n            <div key={i} className=\"flex-1\" onMouseEnter={() => setHovered(i)} onMouseLeave={() => setHovered(null)} />\n          ))}\n        </div>\n\n        <motion.span\n          layoutId=\"adforma-line-dot\"\n          style={{ left: `${active.x}%`, top: `${active.y}%` }}\n          transition={{ type: \"spring\", stiffness: 300, damping: 28 }}\n          className=\"pointer-events-none absolute h-2.5 w-2.5 -translate-x-1/2 -translate-y-1/2 rounded-full bg-blue-400 shadow-[0_0_0_5px_rgba(59,130,246,0.25)]\"\n        />\n\n        <motion.div\n          layoutId=\"adforma-line-tooltip\"\n          style={{ left: `${active.x}%`, top: `${active.y}%` }}\n          transition={{ type: \"spring\", stiffness: 300, damping: 28 }}\n          className=\"pointer-events-none absolute z-20 -translate-x-1/2 -translate-y-[calc(100%+14px)] whitespace-nowrap rounded-lg border border-white/10 bg-[#1E1E22] px-3 py-2 shadow-[0_16px_32px_-12px_rgba(0,0,0,0.6)]\"\n        >\n          <p className=\"text-[10px] uppercase tracking-wide text-neutral-500\">\n            {months[activeIndex]}, {year}\n          </p>\n          <p className=\"flex items-center gap-1.5 text-[12px] font-medium text-white\">\n            <span className=\"h-1.5 w-1.5 rounded-full bg-blue-400\" /> INCOME {values[activeIndex].toFixed(0)}K\n          </p>\n        </motion.div>\n      </div>\n\n      <div className=\"mt-2 flex text-[10px] tracking-wide text-neutral-500\">\n        {months.map((m, i) => (\n          <span key={m} className={cn(\"flex-1 text-center\", i === activeIndex && \"font-medium text-white\")}>\n            {m}\n          </span>\n        ))}\n      </div>\n    </div>\n  );\n}\n\n/* ------------------------------------------------------------------ */\n/* Campaign breakdown bar chart                                         */\n/* ------------------------------------------------------------------ */\n\nconst catColor = { high: \"bg-emerald-400\", moderate: \"bg-amber-400\", low: \"bg-rose-400\" } as const;\nconst catLabel = { high: \"High (>4X)\", moderate: \"Moderate (2-4X)\", low: \"Low (<2X)\" } as const;\n\nfunction CampaignBreakdownChart() {\n  const [activeCats, setActiveCats] = useState<Set<\"high\" | \"moderate\" | \"low\">>(new Set([\"high\", \"moderate\", \"low\"]));\n  const [hovered, setHovered] = useState<number | null>(null);\n\n  function toggleCat(cat: \"high\" | \"moderate\" | \"low\") {\n    setActiveCats((prev) => {\n      const next = new Set(prev);\n      if (next.has(cat)) {\n        if (next.size > 1) next.delete(cat);\n      } else {\n        next.add(cat);\n      }\n      return next;\n    });\n  }\n\n  return (\n    <div className=\"rounded-xl border border-white/[0.06] bg-[#141416] p-5 font-mono\">\n      <div className=\"mb-1 flex flex-wrap items-start justify-between gap-3\">\n        <span className=\"text-[11.5px] uppercase tracking-wider text-neutral-400\">Campaign Breakdown</span>\n        <div className=\"flex items-center gap-3\">\n          {([\"high\", \"moderate\", \"low\"] as const).map((cat) => (\n            <button\n              key={cat}\n              onClick={() => toggleCat(cat)}\n              className={cn(\"flex items-center gap-1.5 text-[10.5px] uppercase tracking-wide transition-opacity\", activeCats.has(cat) ? \"opacity-100\" : \"opacity-30\")}\n            >\n              <span className={cn(\"h-2 w-2 rounded-full\", catColor[cat])} />\n              <span className=\"text-neutral-400\">{catLabel[cat]}</span>\n            </button>\n          ))}\n          <MoreHorizontalMenu />\n        </div>\n      </div>\n      <p className=\"text-[26px] font-semibold text-white\">4.8x</p>\n      <p className=\"mb-4 flex items-center gap-1 text-[11px] text-emerald-400\">\n        <TrendingUp className=\"h-3 w-3\" /> 9.4%\n        <span className=\"text-neutral-500\">vs last month</span>\n      </p>\n\n      <div className=\"flex h-[100px] items-end gap-[3px]\">\n        {campaignBars.map((bar, i) => {\n          const dimmed = !activeCats.has(bar.cat);\n          return (\n            <div key={i} className=\"relative flex-1\" onMouseEnter={() => setHovered(i)} onMouseLeave={() => setHovered(null)}>\n              {hovered === i && (\n                <div className=\"absolute -top-7 left-1/2 z-20 -translate-x-1/2 whitespace-nowrap rounded-md border border-white/10 bg-[#1E1E22] px-1.5 py-0.5 text-[10px] text-white shadow-lg\">\n                  {(bar.h / 20).toFixed(1)}x\n                </div>\n              )}\n              <motion.div\n                initial={{ height: 0 }}\n                animate={{ height: `${bar.h}%`, opacity: dimmed ? 0.25 : 1 }}\n                transition={{ type: \"spring\", stiffness: 200, damping: 22, delay: i * 0.006 }}\n                className={cn(\"w-full rounded-[2px]\", catColor[bar.cat])}\n              />\n            </div>\n          );\n        })}\n      </div>\n    </div>\n  );\n}\n\n/* ------------------------------------------------------------------ */\n/* Deployment table                                                      */\n/* ------------------------------------------------------------------ */\n\nconst columns: { key: SortKey; label: string }[] = [\n  { key: \"name\", label: \"Campaign\" },\n  { key: \"status\", label: \"Status\" },\n  { key: \"budget\", label: \"Budget\" },\n  { key: \"spent\", label: \"Spent\" },\n  { key: \"conversions\", label: \"Conversions\" },\n  { key: \"convRate\", label: \"Conv. Rate\" },\n  { key: \"roas\", label: \"ROAS\" },\n  { key: \"clicks\", label: \"Clicks\" },\n  { key: \"ctr\", label: \"CTR\" },\n];\n\nfunction DeploymentTable({ query }: { query: string }) {\n  const [statusFilter, setStatusFilter] = useState<\"ALL\" | CampaignStatus>(\"ALL\");\n  const [statusMenuOpen, setStatusMenuOpen] = useState(false);\n  const [dateMenuOpen, setDateMenuOpen] = useState(false);\n  const [dateRange, setDateRange] = useState(dateRangePresets[0]);\n  const [sortKey, setSortKey] = useState<SortKey>(\"name\");\n  const [sortDir, setSortDir] = useState<\"asc\" | \"desc\">(\"asc\");\n\n  function handleSort(key: SortKey) {\n    if (key === sortKey) {\n      setSortDir((d) => (d === \"asc\" ? \"desc\" : \"asc\"));\n    } else {\n      setSortKey(key);\n      setSortDir(\"asc\");\n    }\n  }\n\n  const rows = useMemo(() => {\n    const filtered = campaignsSeed.filter((c) => {\n      const matchesQuery = c.name.toLowerCase().includes(query.trim().toLowerCase());\n      const matchesStatus = statusFilter === \"ALL\" || c.status === statusFilter;\n      return matchesQuery && matchesStatus;\n    });\n    const sorted = [...filtered].sort((a, b) => {\n      const av = a[sortKey];\n      const bv = b[sortKey];\n      if (av == null && bv == null) return 0;\n      if (av == null) return 1;\n      if (bv == null) return -1;\n      if (typeof av === \"string\" && typeof bv === \"string\") {\n        return sortDir === \"asc\" ? av.localeCompare(bv) : bv.localeCompare(av);\n      }\n      if (typeof av === \"number\" && typeof bv === \"number\") {\n        return sortDir === \"asc\" ? av - bv : bv - av;\n      }\n      return 0;\n    });\n    return sorted;\n  }, [query, statusFilter, sortKey, sortDir]);\n\n  return (\n    <div className=\"rounded-xl border border-white/[0.06] bg-[#141416] font-mono\">\n      <div className=\"flex flex-wrap items-center justify-between gap-3 border-b border-white/[0.06] p-4\">\n        <div className=\"flex items-center gap-2.5\">\n          <Square className=\"h-4 w-4 text-neutral-400\" />\n          <span className=\"text-[12px] uppercase tracking-wide text-white\">Deployment in progress</span>\n          <div className=\"relative\">\n            <button\n              onClick={() => setStatusMenuOpen((o) => !o)}\n              className=\"flex items-center gap-1.5 rounded-md bg-white/[0.06] px-2.5 py-1 text-[10.5px] uppercase tracking-wide text-neutral-300 hover:bg-white/[0.1]\"\n            >\n              <Flag className=\"h-3 w-3\" /> {statusFilter === \"ALL\" ? \"Status\" : statusFilter}\n            </button>\n            <Dropdown open={statusMenuOpen} onClose={() => setStatusMenuOpen(false)} width={160}>\n              {([\"ALL\", \"ACTIVE\", \"PAUSED\", \"CANCEL\", \"COMPLETED\"] as const).map((s) => (\n                <DropdownItem\n                  key={s}\n                  icon={Flag}\n                  label={s}\n                  active={statusFilter === s}\n                  onClick={() => {\n                    setStatusFilter(s);\n                    setStatusMenuOpen(false);\n                  }}\n                />\n              ))}\n            </Dropdown>\n          </div>\n        </div>\n        <div className=\"relative\">\n          <button\n            onClick={() => setDateMenuOpen((o) => !o)}\n            className=\"flex items-center gap-1.5 rounded-lg border border-white/[0.08] bg-white/[0.04] px-3 py-1.5 text-[11px] uppercase tracking-wide text-neutral-300\"\n          >\n            <Calendar className=\"h-3.5 w-3.5 text-neutral-500\" /> {dateRange} <ChevronDown className=\"h-3 w-3 text-neutral-500\" />\n          </button>\n          <Dropdown open={dateMenuOpen} onClose={() => setDateMenuOpen(false)} anchor=\"right\" width={200}>\n            {dateRangePresets.map((preset) => (\n              <DropdownItem\n                key={preset}\n                icon={Calendar}\n                label={preset}\n                active={dateRange === preset}\n                onClick={() => {\n                  setDateRange(preset);\n                  setDateMenuOpen(false);\n                }}\n              />\n            ))}\n          </Dropdown>\n        </div>\n      </div>\n\n      <div className=\"overflow-x-auto\">\n        <div className=\"min-w-[820px]\">\n          <div className=\"grid grid-cols-9 gap-2 px-4 py-2.5 text-[10.5px] uppercase tracking-wide text-neutral-500\">\n            {columns.map((col) => (\n              <button key={col.key} onClick={() => handleSort(col.key)} className=\"flex items-center gap-1 text-left hover:text-neutral-300\">\n                {col.label}\n                <ArrowDownUp className={cn(\"h-3 w-3\", sortKey === col.key ? \"text-blue-400\" : \"text-neutral-600\")} />\n              </button>\n            ))}\n          </div>\n\n          <AnimatePresence initial={false}>\n            {rows.map((c) => (\n              <motion.div\n                key={c.id}\n                layout\n                initial={{ opacity: 0 }}\n                animate={{ opacity: 1 }}\n                exit={{ opacity: 0 }}\n                className=\"grid grid-cols-9 gap-2 border-t border-white/[0.04] px-4 py-3 text-[12px] text-neutral-300 hover:bg-white/[0.02]\"\n              >\n                <span className=\"truncate uppercase tracking-wide text-neutral-200\">{c.name}</span>\n                <span>\n                  <span className={cn(\"inline-block rounded px-2 py-0.5 text-[10px] uppercase tracking-wide\", statusStyle(c.status))}>{c.status}</span>\n                </span>\n                <span className=\"text-neutral-300\">${c.budget.toFixed(2)}</span>\n                <span className=\"text-neutral-400\">${c.spent.toFixed(2)}</span>\n                <span className=\"text-blue-400\">{c.conversions ?? \"-\"}</span>\n                <span className=\"text-emerald-400\">{c.convRate != null ? `${c.convRate}%` : \"-\"}</span>\n                <span className={roasStyle(c.roas)}>{c.roas ?? \"-\"}</span>\n                <span className=\"text-neutral-300\">{c.clicks ?? \"-\"}</span>\n                <span className=\"text-neutral-300\">{c.ctr != null ? `${c.ctr}%` : \"-\"}</span>\n              </motion.div>\n            ))}\n          </AnimatePresence>\n          {rows.length === 0 && <p className=\"py-8 text-center text-[11.5px] uppercase tracking-wide text-neutral-500\">No campaigns match your filters.</p>}\n        </div>\n      </div>\n    </div>\n  );\n}\n\n/* ------------------------------------------------------------------ */\n/* Empty state (non-overview sections)                                  */\n/* ------------------------------------------------------------------ */\n\nfunction EmptyStateDark({ icon: Icon, title, description }: { icon: IconType; title: string; description: string }) {\n  return (\n    <motion.div\n      initial={{ opacity: 0, y: 8 }}\n      animate={{ opacity: 1, y: 0 }}\n      exit={{ opacity: 0, y: -8 }}\n      transition={{ duration: 0.2 }}\n      className=\"flex h-full flex-col items-center justify-center gap-3 py-24 text-center font-mono\"\n    >\n      <span className=\"flex h-12 w-12 items-center justify-center rounded-2xl bg-white/[0.06]\">\n        <Icon className=\"h-5 w-5 text-neutral-400\" />\n      </span>\n      <h2 className=\"text-[13px] uppercase tracking-wide text-white\">{title}</h2>\n      <p className=\"max-w-[280px] text-[12px] normal-case tracking-normal text-neutral-500\">{description}</p>\n    </motion.div>\n  );\n}\n\n/* ------------------------------------------------------------------ */\n/* Dashboard view                                                       */\n/* ------------------------------------------------------------------ */\n\nfunction DashboardView({\n  query,\n  year,\n  onYearChange,\n}: {\n  query: string;\n  year: \"2026\" | \"2025\";\n  onYearChange: (y: \"2026\" | \"2025\") => void;\n}) {\n  return (\n    <motion.div\n      initial={{ opacity: 0, y: 8 }}\n      animate={{ opacity: 1, y: 0 }}\n      exit={{ opacity: 0, y: -8 }}\n      transition={{ duration: 0.2 }}\n      className=\"flex flex-col gap-4\"\n    >\n      <div className=\"grid grid-cols-3 gap-4 md:grid-cols-3\">\n        {stats.map((stat) => (\n          <StatCard key={stat.label} stat={stat} />\n        ))}\n      </div>\n\n      <div className=\"grid grid-cols-1 gap-4 lg:grid-cols-2\">\n        <AdPerformanceChart year={year} onYearChange={onYearChange} />\n        <CampaignBreakdownChart />\n      </div>\n\n      <DeploymentTable query={query} />\n    </motion.div>\n  );\n}\n\n/* ------------------------------------------------------------------ */\n/* Page                                                                  */\n/* ------------------------------------------------------------------ */\n\nexport default function AdformaDashboard() {\n  const [sidebarKey, setSidebarKey] = useState<SidebarKey>(\"overview\");\n  const [topTab, setTopTab] = useState<TopTabKey>(\"dashboard\");\n  const [collapsed, setCollapsed] = useState(false);\n  const [query, setQuery] = useState(\"\");\n  const [year, setYear] = useState<\"2026\" | \"2025\">(\"2026\");\n\n  function handleSelectSidebar(key: SidebarKey) {\n    setSidebarKey(key);\n    setTopTab(\"dashboard\");\n    setQuery(\"\");\n  }\n\n  function handleSelectTab(key: TopTabKey) {\n    setTopTab(key);\n    setQuery(\"\");\n  }\n\n  const sidebarCopy = sectionCopy[sidebarKey];\n  const tabCopy = topTabCopy[topTab];\n\n  return (\n    <div className=\"flex h-screen w-full overflow-hidden bg-black text-white\">\n      <Sidebar activeKey={sidebarKey} collapsed={collapsed} onSelect={handleSelectSidebar} onToggleCollapse={() => setCollapsed((c) => !c)} />\n      <div className=\"flex flex-1 flex-col overflow-hidden\">\n        <TopBar query={query} onQueryChange={setQuery} />\n        {sidebarKey === \"overview\" && <TopTabs activeTab={topTab} onSelect={handleSelectTab} />}\n        <main className=\"flex-1 overflow-y-auto px-6 py-5\">\n          <AnimatePresence mode=\"wait\">\n            {sidebarKey === \"overview\" && topTab === \"dashboard\" ? (\n              <DashboardView key=\"dashboard\" query={query} year={year} onYearChange={setYear} />\n            ) : sidebarKey === \"overview\" && tabCopy ? (\n              <EmptyStateDark key={topTab} icon={tabCopy.icon} title={tabCopy.title} description={tabCopy.description} />\n            ) : (\n              sidebarCopy && <EmptyStateDark key={sidebarKey} icon={sidebarCopy.icon} title={sidebarCopy.title} description={sidebarCopy.description} />\n            )}\n          </AnimatePresence>\n        </main>\n      </div>\n    </div>\n  );\n}",
      "type": "registry:block",
      "target": "components/Dashboard/dashboard-ads.tsx"
    }
  ],
  "type": "registry:block"
}