{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "dashboard-agency",
  "title": "Modern Agency Dashboard",
  "description": "",
  "dependencies": [
    "framer-motion",
    "lucide-react"
  ],
  "files": [
    {
      "path": "registry/default/blocks/Dashboard/dashboard-agency.tsx",
      "content": "import React, { useState } from \"react\";\nimport Image from \"next/image\";\nimport { motion, AnimatePresence } from \"framer-motion\";\nimport {\n  LayoutDashboard,\n  Package,\n  Repeat,\n  BarChart3,\n  MessageSquare,\n  Users2,\n  Megaphone,\n  Users,\n  Layers,\n  ClipboardList,\n  ShieldCheck,\n  CreditCard,\n  Puzzle,\n  Headphones,\n  HelpCircle,\n  Settings,\n  Search,\n  Bell,\n  ChevronDown,\n  Calendar,\n  Download,\n  Sparkles,\n  MoreHorizontal,\n  Plus,\n  ArrowUpRight,\n  Pencil,\n  RotateCcw,\n  Trash2,\n  Mail,\n  Trophy,\n  Target,\n  User,\n  LogOut,\n  Check,\n  Moon,\n  Sun,\n  type LucideIcon,\n} from \"lucide-react\";\n\n/* ------------------------------------------------------------------ */\n/*  Types                                                              */\n/* ------------------------------------------------------------------ */\n\ninterface NavItem {\n  label: string;\n  icon: LucideIcon;\n}\n\ninterface Stat {\n  label: string;\n  value: string;\n  sub?: string;\n}\n\ntype TransactionStatus = \"Success\" | \"Pending\" | \"Refunded\";\n\ninterface Transaction {\n  id: string;\n  customer: string;\n  product: string;\n  status: TransactionStatus;\n  qty: number;\n  price: string;\n  total: string;\n}\n\ntype TimeRange = \"Weekly\" | \"Monthly\" | \"Yearly\";\ntype CampaignStatus = \"Active\" | \"Paused\" | \"Ended\";\n\ninterface Campaign {\n  name: string;\n  status: CampaignStatus;\n  budget: string;\n  spent: string;\n}\n\ninterface ChatMessage {\n  id: string;\n  name: string;\n  preview: string;\n  full: string;\n  time: string;\n  unread: boolean;\n}\n\n/* ------------------------------------------------------------------ */\n/*  Static data                                                        */\n/* ------------------------------------------------------------------ */\n\nconst mainMenu: NavItem[] = [\n  { label: \"Dashboard\", icon: LayoutDashboard },\n  { label: \"Products\", icon: Package },\n  { label: \"Transactions\", icon: Repeat },\n  { label: \"Reports & Analytics\", icon: BarChart3 },\n  { label: \"Messages\", icon: MessageSquare },\n  { label: \"Team Performance\", icon: Users2 },\n  { label: \"Campaigns\", icon: Megaphone },\n];\n\nconst customersMenu: NavItem[] = [\n  { label: \"Customer List\", icon: Users },\n  { label: \"Channels\", icon: Layers },\n  { label: \"Order Management\", icon: ClipboardList },\n];\n\nconst managementMenu: NavItem[] = [\n  { label: \"Roles & Permissions\", icon: ShieldCheck },\n  { label: \"Billing & Subscription\", icon: CreditCard },\n  { label: \"Integrations\", icon: Puzzle },\n];\n\nconst settingsMenu: NavItem[] = [\n  { label: \"Customer Support\", icon: Headphones },\n  { label: \"Help Center\", icon: HelpCircle },\n  { label: \"System Settings\", icon: Settings },\n];\n\nconst stats: Stat[] = [\n  { label: \"Total Revenue\", value: \"$20,320\", sub: \"\" },\n  { label: \"Total Orders\", value: \"10,320\", sub: \"Orders\" },\n  { label: \"New Customers\", value: \"4,305\", sub: \"New Users\" },\n  { label: \"Conversion Rate\", value: \"3.9%\", sub: \"\" },\n];\n\nconst monthLabels: string[] = [\n  \"JAN\",\n  \"FEB\",\n  \"MAR\",\n  \"APR\",\n  \"MAY\",\n  \"JUN\",\n  \"JUL\",\n  \"AUG\",\n  \"SEP\",\n  \"OCT\",\n  \"NOV\",\n  \"DEC\",\n];\n\nconst salesBars: number[] = [\n  28, 42, 24, 48, 58, 38, 34, 52, 44, 62, 48, 38, 44, 58, 48, 68, 54, 44, 58,\n  74, 92, 68, 54, 44, 58, 48, 38, 52, 44, 34, 48, 38, 28, 42, 34, 24,\n];\n\nconst revenueBars: number[] = [\n  38, 62, 48, 78, 58, 42, 68, 52, 88, 58, 48, 72, 44, 34,\n];\n\nconst initialTransactions: Transaction[] = [\n  {\n    id: \"#04910\",\n    customer: \"Ryan Korsgaard\",\n    product: \"Ergo Office Chair\",\n    status: \"Success\",\n    qty: 12,\n    price: \"$3,450\",\n    total: \"$41,400\",\n  },\n  {\n    id: \"#04911\",\n    customer: \"Madelyn Lubin\",\n    product: \"Sunset Desk 02\",\n    status: \"Success\",\n    qty: 20,\n    price: \"$2,980\",\n    total: \"$89,200\",\n  },\n  {\n    id: \"#04912\",\n    customer: \"Abram Bergson\",\n    product: \"Eco Bookshelf\",\n    status: \"Pending\",\n    qty: 22,\n    price: \"$1,750\",\n    total: \"$75,900\",\n  },\n  {\n    id: \"#04913\",\n    customer: \"Phillip Mango\",\n    product: \"Green Leaf Desk\",\n    status: \"Refunded\",\n    qty: 24,\n    price: \"$1,950\",\n    total: \"$19,500\",\n  },\n];\n\nconst statusStyles: Record<TransactionStatus, string> = {\n  Success: \"bg-emerald-500\",\n  Pending: \"bg-amber-500\",\n  Refunded: \"bg-neutral-400\",\n};\n\nconst customersPool = [\n  \"Elena Cho\",\n  \"Marcus Webb\",\n  \"Priya Nair\",\n  \"Tomasz Wiel\",\n  \"Grace Ilori\",\n  \"Noah Fitzgerald\",\n];\nconst productsPool = [\n  \"Oak Coffee Table\",\n  \"Mesh Task Chair\",\n  \"Walnut Shelf Unit\",\n  \"Linen Sofa Cover\",\n  \"Steel Desk Lamp\",\n  \"Woven Storage Bin\",\n];\n\nconst products = [\n  {\n    name: \"Ergo Office Chair\",\n    category: \"Seating\",\n    price: \"$3,450\",\n    stock: 42,\n  },\n  { name: \"Sunset Desk 02\", category: \"Desks\", price: \"$2,980\", stock: 18 },\n  { name: \"Eco Bookshelf\", category: \"Storage\", price: \"$1,750\", stock: 65 },\n  { name: \"Green Leaf Desk\", category: \"Desks\", price: \"$1,950\", stock: 24 },\n  { name: \"Oak Coffee Table\", category: \"Tables\", price: \"$1,290\", stock: 37 },\n  { name: \"Mesh Task Chair\", category: \"Seating\", price: \"$980\", stock: 51 },\n];\n\nconst teamMembers = [\n  { name: \"Salung Prastyo\", role: \"Sales Operator\", score: 92 },\n  { name: \"Elena Cho\", role: \"Account Manager\", score: 87 },\n  { name: \"Marcus Webb\", role: \"Sales Rep\", score: 79 },\n  { name: \"Priya Nair\", role: \"Sales Rep\", score: 74 },\n  { name: \"Tomasz Wiel\", role: \"Support Lead\", score: 68 },\n];\n\nconst initialCampaigns: Campaign[] = [\n  {\n    name: \"Summer Sale Blast\",\n    status: \"Active\",\n    budget: \"$5,000\",\n    spent: \"$3,120\",\n  },\n  {\n    name: \"New Customer Push\",\n    status: \"Active\",\n    budget: \"$2,500\",\n    spent: \"$980\",\n  },\n  {\n    name: \"Retargeting Q3\",\n    status: \"Paused\",\n    budget: \"$1,800\",\n    spent: \"$1,800\",\n  },\n  {\n    name: \"Holiday Preview\",\n    status: \"Ended\",\n    budget: \"$4,200\",\n    spent: \"$4,150\",\n  },\n];\n\nconst campaignStatusStyles: Record<CampaignStatus, string> = {\n  Active: \"bg-emerald-100 text-emerald-700\",\n  Paused: \"bg-amber-100 text-amber-700\",\n  Ended: \"bg-neutral-200 text-neutral-500\",\n};\n\nconst initialMessages: ChatMessage[] = [\n  {\n    id: \"m1\",\n    name: \"Ryan Korsgaard\",\n    preview: \"Hey, can we push the delivery date...\",\n    time: \"09:24\",\n    unread: true,\n    full: \"Hey, can we push the delivery date for the Ergo Office Chair order to next Friday? Our warehouse team needs a bit more time.\",\n  },\n  {\n    id: \"m2\",\n    name: \"Madelyn Lubin\",\n    preview: \"Thanks for the quick refund on...\",\n    time: \"Yesterday\",\n    unread: true,\n    full: \"Thanks for the quick refund on the Sunset Desk order, really appreciate the fast turnaround!\",\n  },\n  {\n    id: \"m3\",\n    name: \"Abram Bergson\",\n    preview: \"Is the Eco Bookshelf still in stock...\",\n    time: \"Yesterday\",\n    unread: false,\n    full: \"Is the Eco Bookshelf still in stock in walnut finish? Looking to order 20 units for a client.\",\n  },\n  {\n    id: \"m4\",\n    name: \"Phillip Mango\",\n    preview: \"Following up on the refund status\",\n    time: \"Mon\",\n    unread: false,\n    full: \"Just following up on the refund status for order #04913, haven't seen it reflected yet.\",\n  },\n];\n\nconst GENERIC_CONTENT: Record<\n  string,\n  { subtitle: string; rows: { label: string; value: string }[] }\n> = {\n  \"Customer List\": {\n    subtitle: \"Browse and manage your customers.\",\n    rows: [\n      { label: \"Ryan Korsgaard\", value: \"Active\" },\n      { label: \"Madelyn Lubin\", value: \"Active\" },\n      { label: \"Abram Bergson\", value: \"Active\" },\n      { label: \"Phillip Mango\", value: \"Inactive\" },\n    ],\n  },\n  Channels: {\n    subtitle: \"Manage where your orders come from.\",\n    rows: [\n      { label: \"Online Store\", value: \"Connected\" },\n      { label: \"Marketplace\", value: \"Connected\" },\n      { label: \"Retail POS\", value: \"Disconnected\" },\n      { label: \"Wholesale\", value: \"Connected\" },\n    ],\n  },\n  \"Order Management\": {\n    subtitle: \"Track and fulfill customer orders.\",\n    rows: [\n      { label: \"#04910 · Ergo Office Chair\", value: \"Shipped\" },\n      { label: \"#04911 · Sunset Desk 02\", value: \"Delivered\" },\n      { label: \"#04912 · Eco Bookshelf\", value: \"Processing\" },\n      { label: \"#04913 · Green Leaf Desk\", value: \"Refunded\" },\n    ],\n  },\n  \"Roles & Permissions\": {\n    subtitle: \"Control who can access what.\",\n    rows: [\n      { label: \"Admin\", value: \"2 members\" },\n      { label: \"Sales Operator\", value: \"6 members\" },\n      { label: \"Support Agent\", value: \"4 members\" },\n      { label: \"Viewer\", value: \"9 members\" },\n    ],\n  },\n  \"Billing & Subscription\": {\n    subtitle: \"Manage your plan and invoices.\",\n    rows: [\n      { label: \"Current plan\", value: \"Pro — $49/mo\" },\n      { label: \"Next invoice\", value: \"Sep 1, 2026\" },\n      { label: \"Payment method\", value: \"Visa •••• 4242\" },\n      { label: \"Billing email\", value: \"anelkadevs@gmail.com\" },\n    ],\n  },\n  Integrations: {\n    subtitle: \"Connect your favorite tools.\",\n    rows: [\n      { label: \"Slack\", value: \"Connected\" },\n      { label: \"Stripe\", value: \"Connected\" },\n      { label: \"Zapier\", value: \"Not connected\" },\n      { label: \"Notion\", value: \"Not connected\" },\n    ],\n  },\n  \"Customer Support\": {\n    subtitle: \"Open tickets and support requests.\",\n    rows: [\n      { label: \"Delivery delay — order #04910\", value: \"Open\" },\n      { label: \"Wrong item received\", value: \"Open\" },\n      { label: \"Refund question\", value: \"Closed\" },\n      { label: \"Bulk order inquiry\", value: \"Closed\" },\n    ],\n  },\n  \"Help Center\": {\n    subtitle: \"Guides and documentation.\",\n    rows: [\n      { label: \"Getting started with BagUI\", value: \"Article\" },\n      { label: \"Managing transactions\", value: \"Article\" },\n      { label: \"Setting up integrations\", value: \"Article\" },\n      { label: \"Billing FAQ\", value: \"Article\" },\n    ],\n  },\n  \"System Settings\": {\n    subtitle: \"General configuration for your workspace.\",\n    rows: [\n      { label: \"Two-factor authentication\", value: \"toggle-on\" },\n      { label: \"Email notifications\", value: \"toggle-on\" },\n      { label: \"Weekly summary email\", value: \"toggle-off\" },\n      { label: \"Dark mode\", value: \"toggle-off\" },\n    ],\n  },\n};\n\nconst PAGE_SUBTITLES: Record<string, string> = {\n  Products: \"Manage your product catalog and inventory.\",\n  Transactions: \"View, filter and manage every transaction.\",\n  \"Reports & Analytics\": \"A deeper look at your sales performance.\",\n  Messages: \"Conversations with your customers.\",\n  \"Team Performance\": \"See how your team is performing this month.\",\n  Campaigns: \"Track and manage your marketing campaigns.\",\n};\n\n/* ------------------------------------------------------------------ */\n/*  Small building blocks                                              */\n/* ------------------------------------------------------------------ */\n\nfunction NavSection({\n  title,\n  items,\n  activePage,\n  onSelect,\n  isDark,\n}: {\n  title?: string;\n  items: NavItem[];\n  activePage: string;\n  onSelect: (label: string) => void;\n  isDark: boolean;\n}) {\n  return (\n    <div className=\"mb-6\">\n      {title && (\n        <p\n          className={`px-2 mb-2 text-[11px] font-semibold uppercase tracking-[0.18em] ${\n            isDark ? \"text-neutral-500\" : \"text-gray-400\"\n          }`}\n        >\n          {title}\n        </p>\n      )}\n      <ul className=\"space-y-1\">\n        {items.map((item) => {\n          const active = item.label === activePage;\n          return (\n            <li key={item.label}>\n              <button\n                onClick={() => onSelect(item.label)}\n                className={`w-full flex items-center gap-2.5 px-2 py-1.5 rounded-xl text-[13px] transition-colors ${\n                  active\n                    ? isDark\n                      ? \"bg-neutral-900 border border-neutral-800 shadow-sm text-neutral-50 font-medium\"\n                      : \"bg-gray-100 border border-gray-200 shadow-sm text-gray-900 font-medium\"\n                    : isDark\n                      ? \"border border-transparent text-neutral-400 hover:bg-neutral-900 hover:text-neutral-50\"\n                      : \"border border-transparent text-gray-500 hover:bg-gray-50 hover:text-gray-900\"\n                }`}\n              >\n                <span\n                  className={`flex items-center justify-center w-6 h-6 rounded-md border ${\n                    active\n                      ? isDark\n                        ? \"border-neutral-700 bg-neutral-800 text-neutral-50\"\n                        : \"border-gray-200 bg-white text-gray-900\"\n                      : isDark\n                        ? \"border-neutral-800 bg-black text-neutral-500\"\n                        : \"border-gray-200 bg-white text-gray-400\"\n                  }`}\n                >\n                  <item.icon size={13} strokeWidth={2} />\n                </span>\n                <span className=\"truncate\">{item.label}</span>\n              </button>\n            </li>\n          );\n        })}\n      </ul>\n    </div>\n  );\n}\n\nfunction MiniSparkline() {\n  const bars: number[] = [5, 9, 6, 12, 8];\n  return (\n    <div className=\"flex items-end gap-0.5 h-6\">\n      {bars.map((h, i) => (\n        <div\n          key={i}\n          className=\"w-1 rounded-full bg-neutral-300\"\n          style={{ height: `${h * 2}px` }}\n        />\n      ))}\n    </div>\n  );\n}\n\nfunction StatCard({\n  label,\n  value,\n  sub,\n  index,\n  selected,\n  onClick,\n  isDark,\n}: Stat & {\n  index: number;\n  selected: boolean;\n  onClick: () => void;\n  isDark: boolean;\n}) {\n  return (\n    <motion.button\n      onClick={onClick}\n      initial={{ opacity: 0, y: 12 }}\n      animate={{ opacity: 1, y: 0 }}\n      transition={{ duration: 0.4, delay: 0.05 * index }}\n      className={`text-left border rounded-2xl p-4 transition-shadow ${\n        isDark\n          ? selected\n            ? \"bg-neutral-900 border-neutral-700 ring-1 ring-neutral-50/40\"\n            : \"bg-neutral-900 border-neutral-800 hover:border-neutral-700\"\n          : selected\n            ? \"bg-white border-gray-900 ring-1 ring-gray-900\"\n            : \"bg-white border-gray-200 hover:shadow-sm\"\n      }`}\n    >\n      <div className=\"flex items-start justify-between\">\n        <p\n          className={`text-[12px] ${isDark ? \"text-neutral-400\" : \"text-neutral-400\"}`}\n        >\n          {label}\n        </p>\n        <MiniSparkline />\n      </div>\n      <p\n        className={`mt-2 text-2xl font-semibold tracking-tight ${isDark ? \"text-white\" : \"text-neutral-900\"}`}\n      >\n        {value}{\" \"}\n        {sub && (\n          <span\n            className={`text-sm font-normal ${isDark ? \"text-neutral-400\" : \"text-neutral-400\"}`}\n          >\n            {sub}\n          </span>\n        )}\n      </p>\n      <div className=\"mt-3 flex items-center gap-1.5\">\n        <span className=\"flex items-center justify-center w-4 h-4 rounded-full border border-neutral-200 text-emerald-500\">\n          <ArrowUpRight size={10} strokeWidth={2.5} />\n        </span>\n        <span className=\"text-[12px] text-neutral-400\">+0.94 last year</span>\n      </div>\n    </motion.button>\n  );\n}\n\nfunction PageHeader({\n  title,\n  subtitle,\n  isDark = false,\n}: {\n  title: string;\n  subtitle?: string;\n  isDark?: boolean;\n}) {\n  return (\n    <div>\n      <h1\n        className={`text-xl font-semibold ${isDark ? \"text-white\" : \"text-neutral-900\"}`}\n      >\n        {title}\n      </h1>\n      {subtitle && (\n        <p\n          className={`text-[13px] mt-1 ${isDark ? \"text-neutral-400\" : \"text-neutral-400\"}`}\n        >\n          {subtitle}\n        </p>\n      )}\n    </div>\n  );\n}\n\nfunction Toggle({ defaultOn }: { defaultOn?: boolean }) {\n  const [on, setOn] = useState(!!defaultOn);\n  return (\n    <button\n      onClick={() => setOn(!on)}\n      className={`w-9 h-5 rounded-full flex p-0.5 transition-colors ${\n        on ? \"bg-neutral-900 justify-end\" : \"bg-neutral-200 justify-start\"\n      }`}\n    >\n      <motion.span\n        layout\n        transition={{ duration: 0.15 }}\n        className=\"w-4 h-4 rounded-full bg-white shadow\"\n      />\n    </button>\n  );\n}\n\n/* ------------------------------------------------------------------ */\n/*  Sales trend + revenue breakdown (self-contained, reusable)         */\n/* ------------------------------------------------------------------ */\n\nfunction SalesTrendCard({ isDark }: { isDark: boolean }) {\n  const [range, setRange] = useState<TimeRange>(\"Monthly\");\n  const maxSales = Math.max(...salesBars);\n  const peakIndex = 20;\n\n  return (\n    <motion.div\n      initial={{ opacity: 0, y: 12 }}\n      animate={{ opacity: 1, y: 0 }}\n      transition={{ duration: 0.4 }}\n      className={`xl:col-span-2 border rounded-2xl p-4 ${\n        isDark\n          ? \"bg-neutral-900 border-neutral-800\"\n          : \"bg-white border-gray-200\"\n      }`}\n    >\n      <div className=\"flex flex-wrap items-start justify-between gap-3 mb-4\">\n        <div>\n          <p\n            className={`text-[13px] font-medium mb-1 ${isDark ? \"text-white\" : \"text-neutral-900\"}`}\n          >\n            Sales Trend\n          </p>\n          <p\n            className={`text-[12px] ${isDark ? \"text-neutral-400\" : \"text-neutral-400\"}`}\n          >\n            Total Revenue :{\" \"}\n            <span\n              className={`font-medium ${isDark ? \"text-white\" : \"text-neutral-900\"}`}\n            >\n              $20,320\n            </span>\n          </p>\n        </div>\n        <div className=\"flex items-center gap-3\">\n          <div\n            className={`flex items-center gap-1.5 text-[12px] ${isDark ? \"text-neutral-400\" : \"text-neutral-400\"}`}\n          >\n            <span\n              className={`w-2 h-2 rounded-full ${isDark ? \"bg-white\" : \"bg-neutral-900\"}`}\n            />{\" \"}\n            New User\n            <span\n              className={`w-2 h-2 rounded-full ml-2 ${isDark ? \"bg-neutral-700\" : \"bg-neutral-300\"}`}\n            />{\" \"}\n            Existing User\n          </div>\n          <div\n            className={`flex items-center rounded-lg p-0.5 text-[12px] ${isDark ? \"bg-neutral-900\" : \"bg-neutral-100\"}`}\n          >\n            {([\"Weekly\", \"Monthly\", \"Yearly\"] as TimeRange[]).map((r) => (\n              <button\n                key={r}\n                onClick={() => setRange(r)}\n                className={`px-2.5 py-1 rounded-md transition-colors ${\n                  range === r\n                    ? isDark\n                      ? \"bg-white text-neutral-900\"\n                      : \"bg-neutral-900 text-white\"\n                    : isDark\n                      ? \"text-neutral-400\"\n                      : \"text-neutral-500\"\n                }`}\n              >\n                {r}\n              </button>\n            ))}\n          </div>\n        </div>\n      </div>\n\n      <div className=\"relative\">\n        <motion.div\n          key={range}\n          initial={{ opacity: 0, y: 6 }}\n          animate={{ opacity: 1, y: 0 }}\n          transition={{ duration: 0.3 }}\n          className=\"absolute z-10 bg-neutral-900 text-white rounded-lg px-3 py-2 text-[11px] shadow-lg\"\n          style={{\n            left: `calc(${(peakIndex / salesBars.length) * 100}% - 46px)`,\n            top: 0,\n          }}\n        >\n          <p className=\"font-medium mb-1\">Jun 2025</p>\n          <p className=\"flex items-center gap-1.5 text-neutral-300\">\n            <span className=\"w-1.5 h-1.5 rounded-full bg-white\" /> New\n            User&nbsp;\n            <span className=\"text-white font-medium\">38k</span>\n          </p>\n          <p className=\"flex items-center gap-1.5 text-neutral-300\">\n            <span className=\"w-1.5 h-1.5 rounded-full bg-neutral-500\" />{\" \"}\n            Existing User&nbsp;\n            <span className=\"text-white font-medium\">18k</span>\n          </p>\n        </motion.div>\n\n        <div className=\"flex\">\n          <div className=\"flex flex-col justify-between text-[10px] text-neutral-300 pr-2 pb-6 h-52\">\n            {[\"60k\", \"50k\", \"40k\", \"30k\", \"20k\", \"10k\", \"0k\"].map((y) => (\n              <span key={y}>{y}</span>\n            ))}\n          </div>\n\n          <div className=\"flex-1\">\n            <div className=\"flex items-end gap-1 h-52 border-l border-b border-neutral-100 pl-2\">\n              {salesBars.map((h, i) => {\n                const scale =\n                  range === \"Weekly\" ? 0.7 : range === \"Yearly\" ? 1 : 0.9;\n                const pct = (h / maxSales) * 100 * scale;\n                const isPeak = i === peakIndex;\n                const newUserPct = isPeak ? 0.68 : 0.4;\n                return (\n                  <div\n                    key={i}\n                    className=\"flex-1 flex flex-col justify-end h-full\"\n                  >\n                    <motion.div\n                      initial={{ height: 0 }}\n                      animate={{ height: `${pct * newUserPct}%` }}\n                      transition={{ duration: 0.5, delay: 0.02 * i }}\n                      className={`w-full rounded-t-sm ${isDark ? \"bg-white\" : \"bg-neutral-900\"}`}\n                    />\n                    <motion.div\n                      initial={{ height: 0 }}\n                      animate={{ height: `${pct * (1 - newUserPct)}%` }}\n                      transition={{ duration: 0.5, delay: 0.02 * i }}\n                      className={`w-full ${isDark ? \"bg-neutral-700\" : \"bg-neutral-200\"}`}\n                    />\n                  </div>\n                );\n              })}\n            </div>\n            <div\n              className={`flex justify-between text-[10px] mt-2 pl-2 ${isDark ? \"text-neutral-500\" : \"text-neutral-300\"}`}\n            >\n              {monthLabels.map((m) => (\n                <span key={m}>{m}</span>\n              ))}\n            </div>\n          </div>\n        </div>\n      </div>\n    </motion.div>\n  );\n}\n\nfunction RevenueBreakdownCard({ isDark }: { isDark: boolean }) {\n  const [insight, setInsight] = useState(false);\n  const maxRevenue = Math.max(...revenueBars);\n\n  return (\n    <motion.div\n      initial={{ opacity: 0, y: 12 }}\n      animate={{ opacity: 1, y: 0 }}\n      transition={{ duration: 0.4, delay: 0.05 }}\n      className={`border rounded-2xl p-4 flex flex-col ${\n        isDark\n          ? \"bg-[#161616] border-neutral-800\"\n          : \"bg-white border-neutral-200\"\n      }`}\n    >\n      <p className=\"text-[13px] font-medium text-neutral-900 mb-1\">\n        Revenue Breakdown\n      </p>\n      <div className=\"flex items-center justify-between mb-4\">\n        <div>\n          <p className=\"text-[12px] text-neutral-400\">Revenue by Category</p>\n          <p className=\"text-lg font-semibold text-neutral-900\">$20,320</p>\n        </div>\n        <button className=\"flex items-center gap-1 text-[11px] text-neutral-500 border border-neutral-200 rounded-lg px-2 py-1\">\n          Jan 1 - Aug 30 <ChevronDown size={12} />\n        </button>\n      </div>\n\n      <div className=\"flex-1 flex items-end gap-1.5 h-40 border-b border-dashed border-neutral-200\">\n        {revenueBars.map((h, i) => (\n          <motion.div\n            key={i}\n            initial={{ height: 0 }}\n            animate={{ height: `${(h / maxRevenue) * 100}%` }}\n            transition={{ duration: 0.5, delay: 0.03 * i }}\n            className={`flex-1 rounded-t-sm ${isDark ? \"bg-white\" : \"bg-neutral-900\"}`}\n          />\n        ))}\n      </div>\n      <div\n        className={`flex justify-between text-[10px] mt-2 ${isDark ? \"text-neutral-500\" : \"text-neutral-300\"}`}\n      >\n        <span>1 JAN</span>\n        <span>30 JAN</span>\n      </div>\n\n      <button\n        onClick={() => setInsight(!insight)}\n        className={`mt-4 flex items-center justify-center gap-1.5 w-full transition-colors rounded-lg py-2 text-[12px] ${isDark ? \"bg-neutral-900 text-neutral-300 hover:bg-neutral-800\" : \"bg-neutral-100 hover:bg-neutral-200 text-neutral-600\"}`}\n      >\n        <Sparkles size={13} />{\" \"}\n        {insight ? \"Hide insight\" : \"Get AI insight for better analysis\"}\n      </button>\n      <AnimatePresence>\n        {insight && (\n          <motion.p\n            initial={{ opacity: 0, height: 0 }}\n            animate={{ opacity: 1, height: \"auto\" }}\n            exit={{ opacity: 0, height: 0 }}\n            className={`text-[12px] mt-2 leading-relaxed overflow-hidden ${isDark ? \"text-neutral-400\" : \"text-neutral-500\"}`}\n          >\n            Revenue peaks mid-period, driven mostly by repeat customers.\n            Consider timing your next promotion around this window to compound\n            the effect.\n          </motion.p>\n        )}\n      </AnimatePresence>\n    </motion.div>\n  );\n}\n\n/* ------------------------------------------------------------------ */\n/*  Transactions table (shared by Dashboard + Transactions page)       */\n/* ------------------------------------------------------------------ */\n\nfunction TransactionsCard({\n  title,\n  txs,\n  limit,\n  query,\n  setQuery,\n  onAdd,\n  onDelete,\n  onStatusChange,\n  openMenu,\n  setOpenMenu,\n  isDark,\n}: {\n  title: string;\n  txs: Transaction[];\n  limit?: number;\n  query: string;\n  setQuery: (v: string) => void;\n  onAdd: () => void;\n  onDelete: (id: string) => void;\n  onStatusChange: (id: string, status: TransactionStatus) => void;\n  openMenu: string | null;\n  setOpenMenu: (id: string | null) => void;\n  isDark: boolean;\n}) {\n  const filtered = txs.filter(\n    (t) =>\n      query === \"\" ||\n      t.customer.toLowerCase().includes(query.toLowerCase()) ||\n      t.product.toLowerCase().includes(query.toLowerCase()),\n  );\n  const shown = limit ? filtered.slice(0, limit) : filtered;\n\n  return (\n    <motion.div\n      initial={{ opacity: 0, y: 12 }}\n      animate={{ opacity: 1, y: 0 }}\n      transition={{ duration: 0.4 }}\n      className={`border rounded-2xl p-4 ${\n        isDark\n          ? \"bg-[#161616] border-neutral-800\"\n          : \"bg-white border-neutral-200\"\n      }`}\n    >\n      <div className=\"flex flex-wrap items-center justify-between gap-3 mb-4\">\n        <p className=\"text-[13px] font-medium text-neutral-900\">{title}</p>\n        <div className=\"flex items-center gap-2\">\n          <div className=\"flex items-center gap-2 bg-neutral-100 rounded-lg px-3 py-1.5 w-48\">\n            <Search size={13} className=\"text-neutral-400\" />\n            <input\n              value={query}\n              onChange={(e) => setQuery(e.target.value)}\n              placeholder=\"Search transactions\"\n              className={`bg-transparent outline-none text-[12px] w-full ${isDark ? \"placeholder:text-neutral-500 text-white\" : \"placeholder:text-neutral-400 text-neutral-900\"}`}\n            />\n          </div>\n          <button\n            onClick={onAdd}\n            className=\"flex items-center gap-1.5 bg-neutral-900 text-white rounded-lg px-3 py-1.5 text-[12px] font-medium hover:bg-neutral-800 transition-colors\"\n          >\n            <Plus size={13} /> Add Transaction\n          </button>\n        </div>\n      </div>\n\n      <div className=\"overflow-x-auto [scrollbar-width:none] [-ms-overflow-style:none] [&::-webkit-scrollbar]:hidden\">\n        <table className=\"w-full text-left text-[13px]\">\n          <thead>\n            <tr\n              className={`text-[11px] border-b ${isDark ? \"text-neutral-500 border-neutral-800\" : \"text-neutral-400 border-neutral-100\"}`}\n            >\n              <th className=\"py-2 pr-2 font-medium\">\n                <input type=\"checkbox\" className=\"rounded border-neutral-300\" />\n              </th>\n              <th className=\"py-2 pr-4 font-medium\">ID</th>\n              <th className=\"py-2 pr-4 font-medium\">Customer</th>\n              <th className=\"py-2 pr-4 font-medium\">Product</th>\n              <th className=\"py-2 pr-4 font-medium\">Status</th>\n              <th className=\"py-2 pr-4 font-medium\">Qty</th>\n              <th className=\"py-2 pr-4 font-medium\">Unit Price</th>\n              <th className=\"py-2 pr-4 font-medium\">Total Revenue</th>\n              <th className=\"py-2 pr-2 font-medium text-right\">Actions</th>\n            </tr>\n          </thead>\n          <tbody>\n            {shown.map((t, i) => (\n              <motion.tr\n                key={t.id}\n                initial={{ opacity: 0 }}\n                animate={{ opacity: 1 }}\n                transition={{ duration: 0.3, delay: i * 0.04 }}\n                className={`border-b last:border-0 ${isDark ? \"border-neutral-800\" : \"border-gray-50\"}`}\n              >\n                <td className=\"py-3 pr-2\">\n                  <input\n                    type=\"checkbox\"\n                    className=\"rounded border-neutral-300\"\n                  />\n                </td>\n                <td\n                  className={`py-3 pr-4 ${isDark ? \"text-neutral-400\" : \"text-neutral-500\"}`}\n                >\n                  {t.id}\n                </td>\n                <td\n                  className={`py-3 pr-4 ${isDark ? \"text-white\" : \"text-neutral-900\"}`}\n                >\n                  {t.customer}\n                </td>\n                <td\n                  className={`py-3 pr-4 ${isDark ? \"text-neutral-400\" : \"text-neutral-500\"}`}\n                >\n                  {t.product}\n                </td>\n                <td className=\"py-3 pr-4\">\n                  <span\n                    className={`inline-flex items-center gap-1.5 ${isDark ? \"text-neutral-300\" : \"text-neutral-600\"}`}\n                  >\n                    <span\n                      className={`w-1.5 h-1.5 rounded-full ${statusStyles[t.status]}`}\n                    />\n                    {t.status}\n                  </span>\n                </td>\n                <td\n                  className={`py-3 pr-4 ${isDark ? \"text-neutral-400\" : \"text-neutral-500\"}`}\n                >\n                  {t.qty}\n                </td>\n                <td\n                  className={`py-3 pr-4 ${isDark ? \"text-neutral-400\" : \"text-neutral-500\"}`}\n                >\n                  {t.price}\n                </td>\n                <td\n                  className={`py-3 pr-4 font-medium ${isDark ? \"text-white\" : \"text-neutral-900\"}`}\n                >\n                  {t.total}\n                </td>\n                <td\n                  className={`py-3 pr-2 text-right ${isDark ? \"text-neutral-500\" : \"text-neutral-400\"}`}\n                >\n                  <div className=\"relative inline-block\">\n                    <button\n                      onClick={() =>\n                        setOpenMenu(openMenu === t.id ? null : t.id)\n                      }\n                      className={`p-1 rounded-md ${isDark ? \"hover:bg-neutral-800\" : \"hover:bg-neutral-100\"}`}\n                    >\n                      <MoreHorizontal size={15} />\n                    </button>\n                    {openMenu === t.id && (\n                      <>\n                        <div\n                          className=\"fixed inset-0 z-10\"\n                          onClick={() => setOpenMenu(null)}\n                        />\n                        <motion.div\n                          initial={{ opacity: 0, y: -4 }}\n                          animate={{ opacity: 1, y: 0 }}\n                          className={`absolute right-0 top-full mt-1 w-40 rounded-lg shadow-lg z-20 py-1 text-left ${isDark ? \"bg-neutral-950 border border-neutral-800\" : \"bg-white border border-gray-200\"}`}\n                        >\n                          <button\n                            onClick={() => onStatusChange(t.id, \"Success\")}\n                            className={`w-full flex items-center gap-2 px-3 py-1.5 text-[12px] ${isDark ? \"text-neutral-300 hover:bg-neutral-800\" : \"text-neutral-600 hover:bg-neutral-50\"}`}\n                          >\n                            <Check size={13} /> Mark Success\n                          </button>\n                          <button\n                            onClick={() => onStatusChange(t.id, \"Refunded\")}\n                            className={`w-full flex items-center gap-2 px-3 py-1.5 text-[12px] ${isDark ? \"text-neutral-300 hover:bg-neutral-800\" : \"text-neutral-600 hover:bg-neutral-50\"}`}\n                          >\n                            <RotateCcw size={13} /> Mark Refunded\n                          </button>\n                          <button\n                            onClick={() => onDelete(t.id)}\n                            className={`w-full flex items-center gap-2 px-3 py-1.5 text-[12px] ${isDark ? \"text-red-400 hover:bg-red-950/40\" : \"text-red-500 hover:bg-red-50\"}`}\n                          >\n                            <Trash2 size={13} /> Delete\n                          </button>\n                        </motion.div>\n                      </>\n                    )}\n                  </div>\n                </td>\n              </motion.tr>\n            ))}\n            {shown.length === 0 && (\n              <tr>\n                <td\n                  colSpan={9}\n                  className={`py-6 text-center text-[13px] ${isDark ? \"text-neutral-500\" : \"text-neutral-400\"}`}\n                >\n                  No transactions match your search.\n                </td>\n              </tr>\n            )}\n          </tbody>\n        </table>\n      </div>\n    </motion.div>\n  );\n}\n\n/* ------------------------------------------------------------------ */\n/*  Other pages                                                        */\n/* ------------------------------------------------------------------ */\n\nfunction ProductsPage({ isDark = false }: { isDark?: boolean }) {\n  const [selected, setSelected] = useState<Set<string>>(new Set());\n\n  function toggle(name: string) {\n    const next = new Set(selected);\n    next.has(name) ? next.delete(name) : next.add(name);\n    setSelected(next);\n  }\n\n  return (\n    <div className=\"flex flex-col gap-4\">\n      <div className=\"flex items-center justify-between\">\n        <PageHeader\n          title=\"Products\"\n          subtitle={PAGE_SUBTITLES[\"Products\"]}\n          isDark={isDark}\n        />\n        {selected.size > 0 && (\n          <button\n            onClick={() => setSelected(new Set())}\n            className=\"text-[12px] text-neutral-500 border border-neutral-200 rounded-lg px-3 py-1.5 bg-white\"\n          >\n            {selected.size} selected · Clear\n          </button>\n        )}\n      </div>\n      <div className=\"grid grid-cols-2 md:grid-cols-3 gap-3\">\n        {products.map((p, i) => {\n          const active = selected.has(p.name);\n          return (\n            <motion.button\n              key={p.name}\n              onClick={() => toggle(p.name)}\n              initial={{ opacity: 0, y: 10 }}\n              animate={{ opacity: 1, y: 0 }}\n              transition={{ duration: 0.3, delay: i * 0.05 }}\n              className={`relative text-left bg-white border rounded-2xl p-4 transition-shadow ${\n                active\n                  ? \"border-neutral-900 ring-1 ring-neutral-900\"\n                  : \"border-neutral-200 hover:shadow-sm\"\n              }`}\n            >\n              {active && (\n                <span className=\"absolute top-3 right-3 w-5 h-5 rounded-full bg-neutral-900 text-white flex items-center justify-center\">\n                  <Check size={12} />\n                </span>\n              )}\n              <span className=\"w-9 h-9 rounded-lg bg-neutral-100 flex items-center justify-center text-neutral-500 mb-3\">\n                <Package size={16} />\n              </span>\n              <p className=\"text-[13px] font-medium text-neutral-900\">\n                {p.name}\n              </p>\n              <p className=\"text-[12px] text-neutral-400 mb-2\">{p.category}</p>\n              <div className=\"flex items-center justify-between\">\n                <span className=\"text-[13px] font-semibold text-neutral-900\">\n                  {p.price}\n                </span>\n                <span className=\"text-[11px] text-neutral-400\">\n                  {p.stock} in stock\n                </span>\n              </div>\n            </motion.button>\n          );\n        })}\n      </div>\n    </div>\n  );\n}\n\nfunction ReportsPage({ isDark = false }: { isDark?: boolean }) {\n  return (\n    <div className=\"flex flex-col gap-4\">\n      <PageHeader\n        title=\"Reports & Analytics\"\n        subtitle={PAGE_SUBTITLES[\"Reports & Analytics\"]}\n        isDark={isDark}\n      />\n      <div className=\"grid grid-cols-1 xl:grid-cols-3 gap-4\">\n        <SalesTrendCard isDark={isDark} />\n        <RevenueBreakdownCard isDark={isDark} />\n      </div>\n      <motion.div\n        initial={{ opacity: 0, y: 12 }}\n        animate={{ opacity: 1, y: 0 }}\n        transition={{ duration: 0.4, delay: 0.1 }}\n        className=\"bg-white border border-neutral-200 rounded-2xl p-4\"\n      >\n        <p className=\"text-[13px] font-medium text-neutral-900 mb-3\">\n          Top Products\n        </p>\n        <div className=\"space-y-2\">\n          {products.slice(0, 4).map((p, i) => (\n            <div\n              key={p.name}\n              className=\"flex items-center justify-between text-[13px] py-1.5 border-b border-neutral-50 last:border-0\"\n            >\n              <span className=\"text-neutral-700\">{p.name}</span>\n              <span className=\"text-neutral-400 text-[12px]\">\n                {80 - i * 12} units sold\n              </span>\n              <span className=\"text-neutral-900 font-medium\">{p.price}</span>\n            </div>\n          ))}\n        </div>\n      </motion.div>\n    </div>\n  );\n}\n\nfunction MessagesPage({ isDark = false }: { isDark?: boolean }) {\n  const [messages, setMessages] = useState<ChatMessage[]>(initialMessages);\n  const [selectedId, setSelectedId] = useState(initialMessages[0].id);\n  const [reply, setReply] = useState(\"\");\n  const [sent, setSent] = useState(false);\n  const selected = messages.find((m) => m.id === selectedId)!;\n\n  function select(id: string) {\n    setSelectedId(id);\n    setSent(false);\n    setMessages(\n      messages.map((m) => (m.id === id ? { ...m, unread: false } : m)),\n    );\n  }\n\n  return (\n    <div className=\"flex flex-col gap-4\">\n      <PageHeader\n        title=\"Messages\"\n        subtitle={PAGE_SUBTITLES[\"Messages\"]}\n        isDark={isDark}\n      />\n      <div className=\"grid grid-cols-1 md:grid-cols-5 gap-4\">\n        <div className=\"md:col-span-2 bg-white border border-neutral-200 rounded-2xl p-2\">\n          {messages.map((m) => (\n            <button\n              key={m.id}\n              onClick={() => select(m.id)}\n              className={`w-full flex items-start gap-2.5 p-2.5 rounded-xl text-left transition-colors ${\n                m.id === selectedId ? \"bg-neutral-100\" : \"hover:bg-neutral-50\"\n              }`}\n            >\n              <img\n                src={`https://api.dicebear.com/7.x/avataaars/svg?seed=${encodeURIComponent(m.name)}`}\n                alt=\"\"\n                className=\"w-8 h-8 rounded-full shrink-0\"\n              />\n              <div className=\"min-w-0 flex-1\">\n                <div className=\"flex items-center justify-between\">\n                  <p\n                    className={`text-[13px] truncate ${m.unread ? \"font-semibold text-neutral-900\" : \"text-neutral-700\"}`}\n                  >\n                    {m.name}\n                  </p>\n                  <span className=\"text-[10px] text-neutral-400 shrink-0 ml-2\">\n                    {m.time}\n                  </span>\n                </div>\n                <p className=\"text-[12px] text-neutral-400 truncate\">\n                  {m.preview}\n                </p>\n              </div>\n              {m.unread && (\n                <span className=\"w-2 h-2 rounded-full bg-neutral-900 mt-1.5 shrink-0\" />\n              )}\n            </button>\n          ))}\n        </div>\n\n        <motion.div\n          key={selectedId}\n          initial={{ opacity: 0 }}\n          animate={{ opacity: 1 }}\n          className=\"md:col-span-3 bg-white border border-neutral-200 rounded-2xl p-4 flex flex-col\"\n        >\n          <div className=\"flex items-center gap-2.5 pb-3 border-b border-neutral-100\">\n            <img\n              src={`https://api.dicebear.com/7.x/avataaars/svg?seed=${encodeURIComponent(selected.name)}`}\n              alt=\"\"\n              className=\"w-9 h-9 rounded-full\"\n            />\n            <div>\n              <p className=\"text-[13px] font-medium text-neutral-900\">\n                {selected.name}\n              </p>\n              <p className=\"text-[11px] text-neutral-400\">{selected.time}</p>\n            </div>\n          </div>\n          <p className=\"text-[13px] text-neutral-600 leading-relaxed py-4 flex-1\">\n            {selected.full}\n          </p>\n          <div className=\"flex items-center gap-2 pt-3 border-t border-neutral-100\">\n            <input\n              value={reply}\n              onChange={(e) => {\n                setReply(e.target.value);\n                setSent(false);\n              }}\n              placeholder=\"Write a reply...\"\n              className=\"flex-1 bg-neutral-100 rounded-lg px-3 py-2 text-[12px] outline-none placeholder:text-neutral-400\"\n            />\n            <button\n              onClick={() => {\n                if (reply.trim()) {\n                  setSent(true);\n                  setReply(\"\");\n                }\n              }}\n              className=\"flex items-center gap-1.5 bg-neutral-900 text-white rounded-lg px-3 py-2 text-[12px] font-medium\"\n            >\n              <Mail size={13} /> Send\n            </button>\n          </div>\n          {sent && (\n            <p className=\"text-[11px] text-emerald-600 mt-1.5\">\n              Message sent ✓\n            </p>\n          )}\n        </motion.div>\n      </div>\n    </div>\n  );\n}\n\nfunction TeamPage({ isDark = false }: { isDark?: boolean }) {\n  const [order, setOrder] = useState<\"desc\" | \"asc\">(\"desc\");\n  const sorted = [...teamMembers].sort((a, b) =>\n    order === \"desc\" ? b.score - a.score : a.score - b.score,\n  );\n  const top = Math.max(...teamMembers.map((m) => m.score));\n\n  return (\n    <div className=\"flex flex-col gap-4\">\n      <div className=\"flex items-center justify-between\">\n        <PageHeader\n          title=\"Team Performance\"\n          subtitle={PAGE_SUBTITLES[\"Team Performance\"]}\n          isDark={isDark}\n        />\n        <button\n          onClick={() => setOrder(order === \"desc\" ? \"asc\" : \"desc\")}\n          className=\"text-[12px] text-neutral-600 border border-neutral-200 rounded-lg px-3 py-1.5 bg-white flex items-center gap-1.5\"\n        >\n          Sort: {order === \"desc\" ? \"Highest first\" : \"Lowest first\"}\n          <ChevronDown\n            size={13}\n            className={`transition-transform ${order === \"asc\" ? \"rotate-180\" : \"\"}`}\n          />\n        </button>\n      </div>\n      <div className=\"bg-white border border-neutral-200 rounded-2xl p-4 space-y-4\">\n        {sorted.map((m, i) => (\n          <div key={m.name} className=\"flex items-center gap-3\">\n            <img\n              src={`https://api.dicebear.com/7.x/avataaars/svg?seed=${encodeURIComponent(m.name)}`}\n              alt=\"\"\n              className=\"w-9 h-9 rounded-full shrink-0\"\n            />\n            <div className=\"flex-1 min-w-0\">\n              <div className=\"flex items-center justify-between mb-1\">\n                <p className=\"text-[13px] font-medium text-neutral-900 flex items-center gap-1.5\">\n                  {m.name}\n                  {m.score === top && (\n                    <Trophy size={13} className=\"text-amber-500\" />\n                  )}\n                </p>\n                <span className=\"text-[12px] text-neutral-500\">{m.score}</span>\n              </div>\n              <p className=\"text-[11px] text-neutral-400 mb-1.5\">{m.role}</p>\n              <div className=\"h-1.5 bg-neutral-100 rounded-full overflow-hidden\">\n                <motion.div\n                  initial={{ width: 0 }}\n                  animate={{ width: `${m.score}%` }}\n                  transition={{ duration: 0.6, delay: i * 0.05 }}\n                  className=\"h-full bg-neutral-900 rounded-full\"\n                />\n              </div>\n            </div>\n          </div>\n        ))}\n      </div>\n    </div>\n  );\n}\n\nfunction CampaignsPage({ isDark = false }: { isDark?: boolean }) {\n  const [campaigns, setCampaigns] = useState<Campaign[]>(initialCampaigns);\n  const cycle: Record<CampaignStatus, CampaignStatus> = {\n    Active: \"Paused\",\n    Paused: \"Ended\",\n    Ended: \"Active\",\n  };\n\n  function cycleStatus(name: string) {\n    setCampaigns(\n      campaigns.map((c) =>\n        c.name === name ? { ...c, status: cycle[c.status] } : c,\n      ),\n    );\n  }\n\n  return (\n    <div className=\"flex flex-col gap-4\">\n      <PageHeader\n        title=\"Campaigns\"\n        subtitle={PAGE_SUBTITLES[\"Campaigns\"]}\n        isDark={isDark}\n      />\n      <div className=\"grid grid-cols-1 md:grid-cols-2 gap-3\">\n        {campaigns.map((c, i) => (\n          <motion.div\n            key={c.name}\n            initial={{ opacity: 0, y: 10 }}\n            animate={{ opacity: 1, y: 0 }}\n            transition={{ duration: 0.3, delay: i * 0.05 }}\n            className=\"bg-white border border-neutral-200 rounded-2xl p-4\"\n          >\n            <div className=\"flex items-start justify-between mb-3\">\n              <div className=\"flex items-center gap-2.5\">\n                <span className=\"w-9 h-9 rounded-lg bg-neutral-100 flex items-center justify-center text-neutral-500\">\n                  <Target size={16} />\n                </span>\n                <p className=\"text-[13px] font-medium text-neutral-900\">\n                  {c.name}\n                </p>\n              </div>\n              <button\n                onClick={() => cycleStatus(c.name)}\n                className={`text-[11px] px-2 py-1 rounded-full font-medium ${campaignStatusStyles[c.status]}`}\n              >\n                {c.status}\n              </button>\n            </div>\n            <div className=\"flex items-center justify-between text-[12px] text-neutral-400\">\n              <span>\n                Budget{\" \"}\n                <span className=\"text-neutral-900 font-medium\">{c.budget}</span>\n              </span>\n              <span>\n                Spent{\" \"}\n                <span className=\"text-neutral-900 font-medium\">{c.spent}</span>\n              </span>\n            </div>\n          </motion.div>\n        ))}\n      </div>\n    </div>\n  );\n}\n\nfunction GenericPage({\n  pageKey,\n  isDark = false,\n}: {\n  pageKey: string;\n  isDark?: boolean;\n}) {\n  const content = GENERIC_CONTENT[pageKey];\n  const [checked, setChecked] = useState<Set<string>>(new Set());\n\n  function toggle(label: string) {\n    const next = new Set(checked);\n    next.has(label) ? next.delete(label) : next.add(label);\n    setChecked(next);\n  }\n\n  if (!content) return null;\n  const isSettings = pageKey === \"System Settings\";\n\n  return (\n    <div className=\"flex flex-col gap-4\">\n      <PageHeader title={pageKey} subtitle={content.subtitle} isDark={isDark} />\n      <div className=\"bg-white border border-neutral-200 rounded-2xl p-2\">\n        {content.rows.map((row, i) => (\n          <div\n            key={row.label}\n            onClick={() => !isSettings && toggle(row.label)}\n            className={`flex items-center justify-between px-3 py-3 rounded-xl transition-colors ${\n              !isSettings ? \"cursor-pointer hover:bg-neutral-50\" : \"\"\n            } ${checked.has(row.label) ? \"bg-neutral-50\" : \"\"} ${i !== content.rows.length - 1 ? \"border-b border-neutral-50\" : \"\"}`}\n          >\n            <span className=\"text-[13px] text-neutral-700\">{row.label}</span>\n            {isSettings ? (\n              <Toggle defaultOn={row.value === \"toggle-on\"} />\n            ) : (\n              <span className=\"text-[12px] text-neutral-400\">{row.value}</span>\n            )}\n          </div>\n        ))}\n      </div>\n    </div>\n  );\n}\n\n/* ------------------------------------------------------------------ */\n/*  Main component                                                     */\n/* ------------------------------------------------------------------ */\n\nexport default function Dashboard() {\n  const [activePage, setActivePage] = useState(\"Dashboard\");\n  const [txs, setTxs] = useState<Transaction[]>(initialTransactions);\n  const [query, setQuery] = useState(\"\");\n  const [isDark, setIsDark] = useState(false);\n  const [openMenu, setOpenMenu] = useState<string | null>(null);\n  const [nextId, setNextId] = useState(4914);\n  const [notifOpen, setNotifOpen] = useState(false);\n  const [profileOpen, setProfileOpen] = useState(false);\n  const [selectedStat, setSelectedStat] = useState<string | null>(null);\n  const [periodLabel, setPeriodLabel] = useState(\"Daily\");\n  const [periodOpen, setPeriodOpen] = useState(false);\n\n  function handleAdd() {\n    const customer =\n      customersPool[Math.floor(Math.random() * customersPool.length)];\n    const product =\n      productsPool[Math.floor(Math.random() * productsPool.length)];\n    const qty = Math.floor(Math.random() * 20) + 1;\n    const unit = Math.floor(Math.random() * 3000) + 500;\n    const newTx: Transaction = {\n      id: `#${nextId}`,\n      customer,\n      product,\n      status: \"Pending\",\n      qty,\n      price: `$${unit.toLocaleString()}`,\n      total: `$${(unit * qty).toLocaleString()}`,\n    };\n    setTxs([newTx, ...txs]);\n    setNextId(nextId + 1);\n  }\n\n  function handleDelete(id: string) {\n    setTxs(txs.filter((t) => t.id !== id));\n    setOpenMenu(null);\n  }\n\n  function handleStatus(id: string, status: TransactionStatus) {\n    setTxs(txs.map((t) => (t.id === id ? { ...t, status } : t)));\n    setOpenMenu(null);\n  }\n\n  function renderPage() {\n    switch (activePage) {\n      case \"Dashboard\":\n        return (\n          <div className=\"flex flex-col gap-4\">\n            <div className=\"flex flex-wrap items-center justify-between gap-3\">\n              <h1\n                className={`text-xl font-semibold ${isDark ? \"text-white\" : \"text-neutral-900\"}`}\n              >\n                Welcome back, Anelka\n              </h1>\n              <div className=\"flex items-center gap-2\">\n                <div className=\"relative\">\n                  <button\n                    onClick={() => setPeriodOpen(!periodOpen)}\n                    className={`flex items-center gap-1.5 border rounded-lg px-3 py-1.5 text-[13px] ${isDark ? \"bg-[#1a1a1a] border-neutral-700 text-neutral-300\" : \"bg-white border-neutral-200 text-neutral-600\"}`}\n                  >\n                    {periodLabel} <ChevronDown size={14} />\n                  </button>\n                  {periodOpen && (\n                    <>\n                      <div\n                        className=\"fixed inset-0 z-10\"\n                        onClick={() => setPeriodOpen(false)}\n                      />\n                      <div className=\"absolute right-0 top-full mt-1 w-32 bg-white border border-neutral-200 rounded-lg shadow-lg z-20 py-1\">\n                        {[\"Daily\", \"Weekly\", \"Monthly\"].map((p) => (\n                          <button\n                            key={p}\n                            onClick={() => {\n                              setPeriodLabel(p);\n                              setPeriodOpen(false);\n                            }}\n                            className=\"w-full text-left px-3 py-1.5 text-[12px] text-neutral-600 hover:bg-neutral-50\"\n                          >\n                            {p}\n                          </button>\n                        ))}\n                      </div>\n                    </>\n                  )}\n                </div>\n                <button\n                  className={`flex items-center gap-1.5 border rounded-lg px-3 py-1.5 text-[13px] ${isDark ? \"bg-[#1a1a1a] border-neutral-700 text-neutral-300\" : \"bg-white border-neutral-200 text-neutral-600\"}`}\n                >\n                  <Calendar size={14} /> 6 Nov 2025\n                </button>\n                <button className=\"flex items-center gap-1.5 bg-neutral-900 text-white rounded-lg px-3 py-1.5 text-[13px] font-medium hover:bg-neutral-800 transition-colors\">\n                  <Download size={14} /> Export CSV\n                </button>\n              </div>\n            </div>\n\n            <div className=\"grid grid-cols-2 lg:grid-cols-4 gap-3\">\n              {stats.map((s, i) => (\n                <StatCard\n                  key={s.label}\n                  index={i}\n                  selected={selectedStat === s.label}\n                  onClick={() =>\n                    setSelectedStat(selectedStat === s.label ? null : s.label)\n                  }\n                  isDark={isDark}\n                  {...s}\n                />\n              ))}\n            </div>\n\n            <div className=\"grid grid-cols-1 xl:grid-cols-3 gap-4\">\n              <SalesTrendCard isDark={isDark} />\n              <RevenueBreakdownCard isDark={isDark} />\n            </div>\n\n            <TransactionsCard\n              title=\"Recent Transactions\"\n              txs={txs}\n              limit={4}\n              query={query}\n              setQuery={setQuery}\n              onAdd={handleAdd}\n              onDelete={handleDelete}\n              onStatusChange={handleStatus}\n              openMenu={openMenu}\n              setOpenMenu={setOpenMenu}\n              isDark={isDark}\n            />\n          </div>\n        );\n      case \"Products\":\n        return <ProductsPage isDark={isDark} />;\n      case \"Transactions\":\n        return (\n          <div className=\"flex flex-col gap-4\">\n            <PageHeader\n              title=\"Transactions\"\n              subtitle={PAGE_SUBTITLES[\"Transactions\"]}\n            />\n            <TransactionsCard\n              title=\"All Transactions\"\n              txs={txs}\n              query={query}\n              setQuery={setQuery}\n              onAdd={handleAdd}\n              onDelete={handleDelete}\n              onStatusChange={handleStatus}\n              openMenu={openMenu}\n              setOpenMenu={setOpenMenu}\n              isDark={isDark}\n            />\n          </div>\n        );\n      case \"Reports & Analytics\":\n        return <ReportsPage isDark={isDark} />;\n      case \"Messages\":\n        return <MessagesPage isDark={isDark} />;\n      case \"Team Performance\":\n        return <TeamPage isDark={isDark} />;\n      case \"Campaigns\":\n        return <CampaignsPage isDark={isDark} />;\n      default:\n        return <GenericPage pageKey={activePage} isDark={isDark} />;\n    }\n  }\n\n  return (\n    <div\n      className={`min-h-screen w-full p-0 ${isDark ? \"bg-black text-white\" : \"bg-gray-50 text-gray-900\"}`}\n    >\n      <div className=\"flex items-stretch gap-0 w-full min-h-screen\">\n        {/* Sidebar */}\n        <motion.aside\n          initial={{ opacity: 0, x: -16 }}\n          animate={{ opacity: 1, x: 0 }}\n          transition={{ duration: 0.4 }}\n          className={`sticky top-0 flex flex-col w-[248px] shrink-0 border-r p-3 ${\n            isDark ? \"bg-black border-neutral-800\" : \"bg-white border-gray-100\"\n          }`}\n          style={{ height: \"100vh\" }}\n        >\n          <div className=\"flex items-center justify-between mb-4\">\n            <button\n              className={`flex min-w-0 items-center gap-3 rounded-lg px-2 py-1.5 transition-colors ${\n                isDark ? \"hover:bg-neutral-900\" : \"hover:bg-gray-50\"\n              }`}\n            >\n              <div className=\"relative h-9 w-9 shrink-0 overflow-hidden rounded-lg\">\n                <Image\n                  src=\"/logoR.png\"\n                  alt=\"BagUI\"\n                  fill\n                  className=\"object-contain\"\n                />\n              </div>\n\n              <div className=\"min-w-0 text-left\">\n                <p\n                  className={`truncate text-sm font-semibold ${\n                    isDark ? \"text-neutral-50\" : \"text-gray-900\"\n                  }`}\n                >\n                  Bag\\UI\n                </p>\n                <p\n                  className={`truncate text-xs ${\n                    isDark ? \"text-neutral-400\" : \"text-gray-500\"\n                  }`}\n                >\n                  Open Source UI Blocks\n                </p>\n              </div>\n            </button>\n          </div>\n\n          <div className=\"flex-1 overflow-y-auto pr-1 [scrollbar-width:none] [-ms-overflow-style:none] [&::-webkit-scrollbar]:hidden\">\n            <NavSection\n              title=\"Main Menu\"\n              items={mainMenu}\n              activePage={activePage}\n              onSelect={setActivePage}\n              isDark={isDark}\n            />\n            <NavSection\n              title=\"Customers\"\n              items={customersMenu}\n              activePage={activePage}\n              onSelect={setActivePage}\n              isDark={isDark}\n            />\n            <NavSection\n              title=\"Management\"\n              items={managementMenu}\n              activePage={activePage}\n              onSelect={setActivePage}\n              isDark={isDark}\n            />\n            <NavSection\n              title=\"Settings\"\n              items={settingsMenu}\n              activePage={activePage}\n              onSelect={setActivePage}\n              isDark={isDark}\n            />\n          </div>\n\n          <div className=\"relative\">\n            <button\n              onClick={() => setProfileOpen(!profileOpen)}\n              className={`w-full flex items-center gap-2 px-2 py-2 border-t pt-3 rounded-[14px] ${\n                isDark\n                  ? \"border-neutral-800 hover:bg-neutral-900\"\n                  : \"border-gray-100 hover:bg-gray-50\"\n              }`}\n            >\n              <img\n                src=\"/avatar.png\"\n                alt=\"avatar\"\n                className=\"w-8 h-8 rounded-full bg-white\"\n              />\n              <div className=\"leading-tight text-left\">\n                <p\n                  className={`text-[13px] font-medium ${\n                    isDark ? \"text-neutral-50\" : \"text-gray-900\"\n                  }`}\n                >\n                  Anelka Bag\n                </p>\n                <p\n                  className={`text-[11px] ${isDark ? \"text-neutral-400\" : \"text-gray-500\"}`}\n                >\n                  Software Developer\n                </p>\n              </div>\n            </button>\n            {profileOpen && (\n              <>\n                <div\n                  className=\"fixed inset-0 z-10\"\n                  onClick={() => setProfileOpen(false)}\n                />\n                <div\n                  className={`absolute bottom-full left-0 mb-1 w-full rounded-lg shadow-lg z-20 py-1 ${\n                    isDark\n                      ? \"bg-neutral-950 border border-neutral-800\"\n                      : \"bg-white border border-gray-200\"\n                  }`}\n                >\n                  <button\n                    className={`w-full flex items-center gap-2 px-3 py-2 text-[12px] ${isDark ? \"text-neutral-300 hover:bg-neutral-900\" : \"text-gray-600 hover:bg-gray-50\"}`}\n                  >\n                    <User size={13} /> Profile\n                  </button>\n                  <button\n                    className={`w-full flex items-center gap-2 px-3 py-2 text-[12px] ${isDark ? \"text-neutral-300 hover:bg-neutral-900\" : \"text-gray-600 hover:bg-gray-50\"}`}\n                  >\n                    <Settings size={13} /> Settings\n                  </button>\n                  <button\n                    className={`w-full flex items-center gap-2 px-3 py-2 text-[12px] ${isDark ? \"text-red-400 hover:bg-red-950/40\" : \"text-red-500 hover:bg-red-50\"}`}\n                  >\n                    <LogOut size={13} /> Log out\n                  </button>\n                </div>\n              </>\n            )}\n          </div>\n        </motion.aside>\n\n        {/* Main content */}\n        <motion.main\n          initial={{ opacity: 0, y: 12 }}\n          animate={{ opacity: 1, y: 0 }}\n          transition={{ duration: 0.4, delay: 0.05 }}\n          className={`flex-1 min-w-0 flex flex-col gap-4 p-3 md:p-4 ${\n            isDark ? \"bg-black\" : \"bg-gray-50\"\n          }`}\n        >\n          {/* Top bar */}\n          <div\n            className={`flex items-center justify-between border rounded-[18px] px-4 py-2.5 shadow-[0_1px_0_rgba(0,0,0,0.02)] ${isDark ? \"bg-neutral-950 border-neutral-800\" : \"bg-white border-gray-200\"}`}\n          >\n            <p\n              className={`text-[13px] ${isDark ? \"text-neutral-400\" : \"text-gray-400\"}`}\n            >\n              {activePage}{\" \"}\n              <span\n                className={`${isDark ? \"text-neutral-500\" : \"text-gray-300\"} mx-1`}\n              >\n                /\n              </span>\n              <span\n                className={`${isDark ? \"text-neutral-50\" : \"text-gray-900\"}`}\n              >\n                Overview\n              </span>\n            </p>\n            <div className=\"flex items-center gap-3\">\n              <div\n                className={`hidden md:flex items-center gap-2 rounded-lg border px-3 py-1.5 w-56 transition-colors ${\n                  isDark\n                    ? \"bg-[#161616] border-neutral-800\"\n                    : \"bg-neutral-100 border-neutral-200\"\n                }`}\n              >\n                <Search\n                  size={14}\n                  className={isDark ? \"text-neutral-500\" : \"text-neutral-400\"}\n                />\n                <input\n                  placeholder=\"Search...\"\n                  className={`bg-transparent outline-none text-[13px] w-full ${\n                    isDark\n                      ? \"placeholder:text-neutral-500 text-neutral-100\"\n                      : \"placeholder:text-neutral-400 text-neutral-900\"\n                  }`}\n                />\n              </div>\n\n              <button\n                onClick={() => setIsDark((v) => !v)}\n                className=\"w-8 h-8 flex items-center justify-center rounded-lg hover:bg-neutral-100\"\n                aria-label=\"Toggle theme\"\n              >\n                {isDark ? (\n                  <Sun size={16} className=\"text-neutral-500\" />\n                ) : (\n                  <Moon size={16} className=\"text-neutral-500\" />\n                )}\n              </button>\n\n              <div className=\"relative\">\n                <button\n                  onClick={() => setNotifOpen(!notifOpen)}\n                  className=\"relative w-8 h-8 flex items-center justify-center rounded-lg hover:bg-neutral-100\"\n                >\n                  <Bell size={16} className=\"text-neutral-500\" />\n                  <span className=\"absolute top-1.5 right-1.5 w-1.5 h-1.5 rounded-full bg-red-500\" />\n                </button>\n                {notifOpen && (\n                  <>\n                    <div\n                      className=\"fixed inset-0 z-10\"\n                      onClick={() => setNotifOpen(false)}\n                    />\n                    <div className=\"absolute right-0 top-full mt-1 w-64 bg-white border border-neutral-200 rounded-lg shadow-lg z-20 py-1\">\n                      <p className=\"px-3 py-2 text-[12px] font-medium text-neutral-900 border-b border-neutral-50\">\n                        Notifications\n                      </p>\n                      {[\n                        \"New order from Madelyn Lubin\",\n                        \"Refund requested — order #04913\",\n                        \"Monthly report is ready\",\n                      ].map((n) => (\n                        <p\n                          key={n}\n                          className=\"px-3 py-2 text-[12px] text-neutral-600 hover:bg-neutral-50\"\n                        >\n                          {n}\n                        </p>\n                      ))}\n                    </div>\n                  </>\n                )}\n              </div>\n\n              <button className=\"w-8 h-8 flex items-center justify-center rounded-lg hover:bg-neutral-100\">\n                <Settings size={16} className=\"text-neutral-500\" />\n              </button>\n              <img\n                src=\"/avatar.png\"\n                alt=\"avatar\"\n                className=\"w-8 h-8 rounded-full\"\n              />\n            </div>\n          </div>\n\n          <AnimatePresence mode=\"wait\">\n            <motion.div\n              key={activePage}\n              initial={{ opacity: 0, y: 8 }}\n              animate={{ opacity: 1, y: 0 }}\n              exit={{ opacity: 0, y: -8 }}\n              transition={{ duration: 0.25 }}\n            >\n              {renderPage()}\n            </motion.div>\n          </AnimatePresence>\n        </motion.main>\n      </div>\n    </div>\n  );\n}\n",
      "type": "registry:block",
      "target": "components/Dashboard/dashboard-agency.tsx"
    }
  ],
  "type": "registry:block"
}