// Realistic, business-flavored sample data for Marigold & Oak (a small landscape design firm)
const DATA = {
  brands: {
    marigold: { name: "Marigold & Oak", sub: "Landscape Studio", glyph: "M", accent: "oklch(52% 0.13 145)" },
    harbor:   { name: "Harbor Provisions", sub: "Coffee + Pantry", glyph: "H", accent: "oklch(54% 0.13 35)" },
    fielder:  { name: "Fielder Cycles", sub: "Custom Bike Shop", glyph: "F", accent: "oklch(50% 0.14 250)" },
    petal:    { name: "Petal Studio", sub: "Floral + Events", glyph: "P", accent: "oklch(58% 0.14 350)" },
  },
  glance: {
    revenue: { value: 18420, delta: 12.4, spark: [12, 14, 11, 15, 18, 16, 19, 22, 21, 24, 22, 26] },
    bookings: 7,
    inboxUnread: 12,
    crewOut: 5,
    crewTotal: 8,
    aiHandled: 23,
  },
  // "While you slept" — honest, reconciled. The headline is a COUNT of real
  // actions; every dollar is labeled by category and never blended into one
  // "money handled" figure. 14 + 6 + 1 = 21 actions.
  recap: {
    actionCount: 21,
    items: [
      { did: "Replied to 14 leads overnight", outcome: "3 booked consults", amount: "$6,000", cat: "Pipeline", note: "potential — not yet earned", tone: "accent", target: "inbox" },
      { did: "Drafted 6 proposals", outcome: "awaiting your approval", amount: "$9,200", cat: "Ready to send", note: "drafted, your call to send", tone: "accent", target: "approvals" },
      { did: "Flagged 1 overdue invoice", outcome: "Hawthorne café · 8 days", amount: "$2,300", cat: "At risk", note: "recover with one reminder", tone: "warn", target: "finances" },
    ],
    line: "Replied to 14 leads → 3 booked consults · Drafted 6 proposals → ready to send · Flagged 1 overdue invoice.",
  },
  // Approvals — the AI does the labor, the owner just decides.
  approvals: [
    { id: "mulch", icon: "Truck", title: "Send mulch reorder to Salem Stone", detail: "Cedar mulch is low (2 of 8 cu yd). I drafted the order and tagged pickup to Tuesday's run.", amount: "$480" },
    { id: "diane", icon: "Mail", title: "Send thank-you note to Diane Kapoor", detail: "Warm, brief, welcomes her to phase 2. 82 words — ready to go.", amount: null },
    { id: "invoice", icon: "Coin", title: "Send a polite reminder for Inv. #1182", detail: "Hawthorne café, 8 days overdue. I drafted a gentle nudge for your okay.", amount: "$2,300" },
  ],
  // Single source of truth for Communications channels — reused by desktop,
  // mobile, and the pitch view so the connected strip never drifts.
  channels: [
    { ch: "email", label: "Email", title: "Email" },
    { ch: "phone", label: "Phone", title: "Phone" },
    { ch: "text", label: "Text", title: "Text" },
    { ch: "ig", label: "Instagram", title: "Instagram" },
    { ch: "fb", label: "Facebook", title: "Facebook" },
    { ch: "google", label: "Google", title: "Google Business Profile" },
  ],
  // Day-1 connect states (shared by desktop InboxConnect + mobile connect rows).
  connectChannels: [
    { ch: "email", name: "Email", desc: "Link your inbox — Gmail, Outlook, or forwarding." },
    { ch: "phone", name: "Phone", desc: "Answers missed calls with a text and transcribes voicemails.", req: "Needs a business phone number · one-time setup." },
    { ch: "text", name: "Text", desc: "Reply to customer texts in one place.", req: "Needs a business number + a one-time carrier registration." },
    { ch: "ig", name: "Instagram", desc: "Needs a linked Business account + a one-time approval." },
    { ch: "fb", name: "Facebook", desc: "Needs a linked Business Page + a one-time approval." },
    { ch: "google", name: "Google Business Profile", desc: "Reply to Google messages and respond to reviews.", req: "Connect your Google Business Profile · one-time approval." },
  ],
  inbox: [
    { id: "call", channel: "phone", name: "Missed call · Karen Delgado", snippet: "E28E texted back: “Sorry we missed you! How can we help?” — she replied asking about a spring cleanup.", time: "5m", unread: true, ai: true, aiLabel: "AI texted back", flag: "Lead saved", needsReply: true },
    { id: "vm", channel: "phone", name: "Voicemail · Tom Reyes (0:42)", snippet: "“Hi, calling about a quote for my front yard — wondering if you do retaining walls and a bit of regrading…”", time: "18m", unread: true, ai: false, transcribed: true, needsReply: true },
    { id: "ig", channel: "ig", name: "@portland_garden_collective", snippet: "Loved the Cedar Hill project — any availability for a May backyard consult?", time: "32m", unread: true, ai: false, needsReply: true },
    { id: "email", channel: "email", name: "Diane Kapoor", snippet: "Re: Tualatin estate — quote approved. Sending the deposit today, please confirm receipt.", time: "1h", unread: true, ai: true, aiLabel: "AI drafted reply", needsReply: false },
    { id: "google", channel: "google", name: "New 5★ review · Cedar Hill project", snippet: "“They completely transformed our backyard — couldn't be happier.” — K. Park", time: "2h", unread: false, ai: true, aiLabel: "AI drafted thank-you", needsReply: false },
    { id: "text", channel: "text", name: "Marisol Ortiz", snippet: "Hey — any chance we can push tomorrow's walkthrough to 2pm?", time: "3h", unread: true, ai: true, aiLabel: "AI suggested reply", suggested: "“2pm works great — see you then!”", needsReply: true },
  ],
  agents: [
    { name: "Lead Triage", task: "Sorted 14 inquiries · drafted 6 replies", state: "active", today: 14 },
    { name: "Quote Assistant", task: "Building proposal for Tualatin estate", state: "active", today: 3 },
    { name: "Schedule Optimizer", task: "Re-routed Tuesday crew (saved 38 min)", state: "active", today: 1 },
    { name: "Review Responder", task: "Idle — no new reviews this week", state: "idle", today: 0 },
  ],
  finances: {
    mtd: 84200,
    mtdGoal: 110000,
    expenses: 31800,
    profit: 52400,
    arOpen: 18420,
    arOverdue: 2300,
    breakdown: [
      { label: "Design", value: 38, color: "oklch(52% 0.13 145)" },
      { label: "Install", value: 41, color: "oklch(58% 0.10 105)" },
      { label: "Maintenance", value: 15, color: "oklch(62% 0.08 80)" },
      { label: "Other", value: 6, color: "oklch(72% 0.04 80)" },
    ],
  },
  projects: [
    { name: "Cedar Hill backyard reset", client: "K. Park", crew: ["EM", "JT", "RS"], pct: 78, due: "May 12" },
    { name: "Tualatin estate — phase 2", client: "D. Kapoor", crew: ["EM", "JT"], pct: 34, due: "May 28" },
    { name: "Mt. Tabor pollinator garden", client: "Third Coast Co.", crew: ["RS", "AN"], pct: 92, due: "May 8" },
    { name: "Sellwood front yard", client: "B. Ortiz", crew: ["JT"], pct: 12, due: "Jun 4" },
  ],
  // Automations, described in plain English — no vendor chains, no diagrams.
  workflows: [
    { name: "New inquiry handling", plain: "When someone messages you, E28E replies within minutes and saves them as a lead.", on: true, runs: 28 },
    { name: "Thank-you notes", plain: "When an invoice is paid, E28E sends a warm thank-you in your voice.", on: true, runs: 12 },
    { name: "Low-stock reorders", plain: "When a material runs low, E28E drafts the reorder for your okay.", on: true, runs: 4 },
    { name: "Review requests", plain: "When a project wraps, E28E asks the happy customer for a review.", on: false, runs: 0 },
  ],
  inventory: [
    { name: "Basalt cobbles (pallet)", qty: 6, max: 10, state: "ok" },
    { name: "Cedar mulch (cu yd)", qty: 2, max: 8, state: "low" },
    { name: "Drip irrigation tubing", qty: 14, max: 20, state: "ok" },
    { name: "Native fern starts", qty: 0, max: 24, state: "empty" },
    { name: "Hardware fasteners", qty: 9, max: 12, state: "ok" },
  ],
  employees: [
    { name: "Elena Marsh", role: "Designer", initials: "EM", status: "on" },
    { name: "Jamie Tao", role: "Crew Lead", initials: "JT", status: "on" },
    { name: "Reggie Sosa", role: "Install", initials: "RS", status: "on" },
    { name: "Anya Nair", role: "Office Admin", initials: "AN", status: "on" },
    { name: "Theo Kim", role: "Install", initials: "TK", status: "off" },
    { name: "Priya Bell", role: "Design Asst.", initials: "PB", status: "off" },
  ],
  integrations: [
    { name: "Stripe", on: true }, { name: "Quickbooks", on: true },
    { name: "Gmail", on: true }, { name: "HubSpot", on: true },
    { name: "Slack", on: true }, { name: "Notion", on: true },
    { name: "Google Cal", on: true }, { name: "Twilio", on: false },
  ],
  // Per-tenant connector config — the "plug a business in" layer for the
  // Integrations screen (connectors.jsx). Keyed by brand id. The connector
  // CATALOG is defined once in connectors.jsx; this row decides which ones a
  // given business has turned on + the account behind each. Onboarding a new
  // business = a new key here; absent / empty = everything shows "Connect".
  connectorConfig: {
    marigold: {
      gmail:      { connected: true, account: "hello@marigoldoak.com", synced: "2 min ago" },
      gcal:       { connected: true, account: "Marigold & Oak calendar", synced: "8 min ago" },
      quickbooks: { connected: true, account: "Marigold & Oak LLC", synced: "1 hr ago" },
    },
    harbor:  { gmail: { connected: true, account: "orders@harborprovisions.com", synced: "5 min ago" } },
    fielder: {},  // fresh business — nothing connected yet (shows the template's connect state)
    petal:   { gmail: { connected: false } },
  },
  notifications: [
    { text: "Diane Kapoor approved the Tualatin proposal — deposit pending.", time: "12 min ago", tone: "accent" },
    { text: "Cedar mulch is low (2 of 8 cu yd). Reorder draft is ready.", time: "1 hr ago", tone: "accent" },
    { text: "Schedule Optimizer re-routed Tuesday crew, saving 38 minutes.", time: "3 hr ago", tone: "muted" },
    { text: "New 5★ Google review from Karen P. — Cedar Hill project.", time: "Yesterday", tone: "muted" },
  ],
  today: [
    { time: "8:30", title: "Crew dispatch — Cedar Hill", sub: "EM, JT, RS · 4-hour install window", pill: "On site", tone: "green" },
    { time: "10:00", title: "Design review w/ D. Kapoor", sub: "Tualatin estate, phase 2 · video", pill: "Call", tone: "blue" },
    { time: "12:30", title: "Pickup at Salem Stone", sub: "Order #SS-3389 · 2 pallets basalt", pill: "Errand", tone: "amber" },
    { time: "15:00", title: "Site walk — Sellwood", sub: "B. Ortiz · scope confirmation", pill: "On site", tone: "green" },
    { time: "17:30", title: "Review Q2 cash flow", sub: "Solo · 30 min", pill: "Focus", tone: "gray" },
  ],
  weather: { temp: 64, cond: "Mostly sunny", city: "Portland" },
  // Employee role-specific
  empTasks: [
    { title: "Cedar Hill — finalize plant placements", due: "Today, 11:00", project: "Cedar Hill", priority: "high", done: false },
    { title: "Mt. Tabor — final walk-through w/ client", due: "Today, 15:30", project: "Mt. Tabor", priority: "high", done: false },
    { title: "Send revised plant schedule to Tualatin", due: "Tomorrow", project: "Tualatin estate", priority: "med", done: false },
    { title: "Order replacement drip emitters", due: "Wed", project: "Workshop", priority: "low", done: false },
    { title: "Photograph completed Sellwood entry", due: "Last Friday", project: "Sellwood", priority: "med", done: true },
  ],
  // Employee "while you were off" recap — measured in time & busywork, never dollars.
  empRecap: {
    count: 4,
    sub: "3 stops today, first at Cedar Hill, 8:30 with Elena & Reggie.",
    items: [
      { did: "Re-routed your stops", detail: "saved 38 min of drive time" },
      { did: "Drafted your timesheet", detail: "28.5 hrs — ready to submit" },
      { did: "Texted the Sellwood client", detail: "let them know you're 10 min out" },
      { did: "Confirmed tomorrow's 8:30 dispatch", detail: "Elena + Reggie are in" },
    ],
    line: "Re-routed your stops (saved 38 min) · Drafted your timesheet · Texted the Sellwood client · Confirmed tomorrow's dispatch.",
  },
  // The agent PROPOSES; the employee accepts. Nothing auto-changes their day.
  empProposals: [
    { id: "route", icon: "Map", title: "Start your day at Cedar Hill", detail: "Schedule Optimizer re-routed your three stops to start here — saves 38 min of driving.", accept: "Accept plan", adjust: "Adjust" },
    { id: "timesheet", icon: "Clock", title: "Submit this week's timesheet", detail: "28.5 hrs across Cedar Hill, Mt. Tabor & Sellwood, pre-filled from your clock-ins.", accept: "Submit", adjust: "Review first" },
  ],
  empControlNote: "Nothing changes your schedule or hours without your okay.",
  // The employee's own agent, made to feel alive.
  empAgent: {
    name: "Schedule Optimizer",
    summary: "Re-routed today's stops to start at Cedar Hill — saving you 38 minutes of drive time.",
    did: [
      "Re-ordered your three stops for the shortest route",
      "Pre-filled your timesheet from this week's clock-ins",
    ],
    watching: [
      "Hawthorne bridge traffic — I'll reroute you if it backs up",
      "Tomorrow's 8:30 dispatch — I'll confirm the crew tonight",
    ],
  },
  empPay: [
    { l: "Logged this week", v: "28.5 hrs" },
    { l: "Period pay", v: "$1,824 gross" },
    { l: "Next paycheck", v: "May 15 · Fri" },
  ],
};
window.DATA = DATA;
