// Shared mock data for Joy Move client dashboard
window.JOY_MOVE = {
  brand: {
    name: "Joy Move",
    site: "joymove.co",
    tagline: "Movement studio · Portland, OR",
    contact: "Alex Reyes",
    email: "alex@joymove.co",
    since: "Launched Aug 2025",
    anniversary: "Aug 14, 2026",
  },
  plans: {
    Essentials: {
      tier: "Essentials",
      monthly: 175,
      partnerMonthly: 150,
      hoursIncluded: 2,
      responseSLA: "48-hour response",
      overage: 75,
      rollover: 0,
      features: {
        dns: false, healthCheck: false, training: "—", strategy: false, rollover: false,
      },
    },
    Growth: {
      tier: "Growth",
      monthly: 325,
      partnerMonthly: 275,
      hoursIncluded: 4,
      responseSLA: "24-hour response",
      overage: 65,
      rollover: 0,
      features: {
        dns: true, healthCheck: true, training: "30 min/mo", strategy: false, rollover: false,
      },
    },
    Stewardship: {
      tier: "Stewardship",
      monthly: 575,
      partnerMonthly: 500,
      hoursIncluded: 6,
      responseSLA: "Same business day",
      overage: 60,
      rollover: 1,
      features: {
        dns: true, healthCheck: true, training: "60 min/mo", strategy: true, rollover: true,
      },
    },
  },
  // April 2026 cycle (current)
  cycle: {
    periodLabel: "April 2026",
    start: "Apr 1",
    end: "Apr 30",
    renews: "May 1, 2026",
    hoursUsed: 2.75, // will be clamped to plan's hoursIncluded in UI
  },
  siteHealth: {
    uptime30: 99.98,
    lastBackup: "2h ago",
    ssl: { status: "valid", expires: "Jul 12, 2026" },
    platform: "Squarespace 7.1",
    pageSpeed: 92,
    coreVitals: "Good",
    pendingUpdates: 0,
    lastScan: "Apr 21, 9:04 AM",
  },
  requests: [
    {
      id: "JM-214", title: "Swap April class schedule PDF in studio page",
      status: "In progress", priority: "Normal", category: "Content update",
      opened: "Apr 20", updated: "Today", est: 0.5,
      description: "Need the April PDF swapped on the /studio page — old one still shows March dates. New PDF is attached.",
      attachments: ["joymove-april-2026.pdf"],
      assigned: "Mara (State of Motion)",
      thread: [
        { from: "Alex Reyes", role: "client", when: "Apr 20, 1:12 PM", body: "New April schedule attached. Same spot as last month please." },
        { from: "Mara Castillo", role: "agency", when: "Apr 20, 2:15 PM", body: "Got it — started on this. Will have a preview link before EOD tomorrow." },
      ],
    },
    {
      id: "JM-213", title: "Fix mobile header overlap on iOS 17",
      status: "Awaiting you", priority: "Normal", category: "Bug fix",
      opened: "Apr 18", updated: "Apr 19", est: 0.75,
      description: "Header logo overlaps with the hamburger menu on iPhone 14+ in portrait. Desktop looks fine.",
      attachments: [],
      assigned: "Jordan Kim (State of Motion)",
      thread: [
        { from: "Alex Reyes", role: "client", when: "Apr 18, 10:30 AM", body: "A student sent this screenshot — logo cuts into the menu button on her iPhone." },
        { from: "Jordan Kim", role: "agency", when: "Apr 19, 4:40 PM", body: "Reproduced on iOS 17.4. Could you confirm which device and iOS version — want to make sure we catch the edge case." },
      ],
    },
    { id: "JM-212", title: "New sponsor logo — Cascadia Wellness", status: "Done", priority: "Low", category: "Content update", opened: "Apr 14", updated: "Apr 15", est: 0.5, description: "Add Cascadia Wellness logo to partner strip on homepage.", attachments: ["cascadia-logo.svg"], assigned: "Mara Castillo", thread: [] },
    { id: "JM-211", title: "Updates to waiver form email recipients", status: "Done", priority: "Normal", category: "Form / email", opened: "Apr 09", updated: "Apr 10", est: 0.5, description: "Add studio@joymove.co and remove old intern address from waiver form notifications.", attachments: [], assigned: "Jordan Kim", thread: [] },
    { id: "JM-210", title: "Add 'Teacher Training' landing page", status: "Done", priority: "High", category: "New page", opened: "Apr 02", updated: "Apr 08", est: 2.25, description: "New landing page for the summer teacher training cohort. Needed copy block, hero image, application form, and nav link.", attachments: ["tt-copy-doc.pdf","tt-hero.jpg"], assigned: "Mara Castillo", thread: [] },
  ],
  requestCategories: [
    { id: "content", label: "Content update", sub: "Copy, images, PDFs, sponsor logos", icon: "✎", est: "~30–60 min" },
    { id: "bug", label: "Bug fix", sub: "Something is broken or looks off", icon: "!", est: "~45–90 min" },
    { id: "page", label: "New page", sub: "Add a page, landing, or section", icon: "+", est: "~2–4 hours" },
    { id: "form", label: "Form or email", sub: "Forms, recipients, autoresponders", icon: "✉", est: "~30–60 min" },
    { id: "seo", label: "SEO / metadata", sub: "Titles, descriptions, OG tags", icon: "◉", est: "~30–45 min" },
    { id: "integration", label: "Integration", sub: "Embed, booking, third-party tool", icon: "⧉", est: "~1–3 hours" },
    { id: "other", label: "Something else", sub: "Not sure where this fits", icon: "…", est: "We'll scope it" },
  ],
  activity: [
    { when: "Apr 21, 9:04 AM", what: "Monthly health check complete — all green", kind: "health", ref: null },
    { when: "Apr 20, 2:15 PM", what: "Mara started work on JM-214 · Swap April schedule PDF", kind: "work", ref: "JM-214" },
    { when: "Apr 20, 1:12 PM", what: "Alex opened JM-214 · Swap April schedule PDF", kind: "request", ref: "JM-214" },
    { when: "Apr 19, 4:40 PM", what: "Jordan replied on JM-213 — need screenshot", kind: "message", ref: "JM-213" },
    { when: "Apr 18, 10:30 AM", what: "Alex opened JM-213 · Fix mobile header overlap", kind: "request", ref: "JM-213" },
    { when: "Apr 15, 11:20 AM", what: "Completed JM-212 · Cascadia sponsor logo swap", kind: "done", ref: "JM-212" },
    { when: "Apr 14, 8:02 AM", what: "SSL auto-renewed through Jul 12, 2026", kind: "health" },
    { when: "Apr 12, 2:45 PM", what: "Squarespace plugin update applied — class booking 4.2.1", kind: "health" },
    { when: "Apr 10, 3:30 PM", what: "Completed JM-211 · Waiver form email update", kind: "done", ref: "JM-211" },
    { when: "Apr 08, 5:10 PM", what: "Launched JM-210 · Teacher Training landing page", kind: "launch", ref: "JM-210" },
    { when: "Apr 05, 10:00 AM", what: "Weekly backup verified — 14 GB archived to S3", kind: "health" },
    { when: "Apr 02, 9:30 AM", what: "Alex opened JM-210 · Add Teacher Training page", kind: "request", ref: "JM-210" },
    { when: "Apr 01, 12:00 AM", what: "April billing cycle started — 4 hours available", kind: "billing" },
    { when: "Mar 28, 4:20 PM", what: "Invoice INV-0042 paid — $325", kind: "billing" },
  ],
  roadmap: [
    { when: "Apr 24", title: "Quarterly strategy call", kind: "meeting", tierMin: "Stewardship" },
    { when: "Apr 28", title: "Spring retreat announcement bar goes live", kind: "launch" },
    { when: "May 02", title: "Monthly health check", kind: "health" },
    { when: "May 14", title: "Review summer class schedule migration", kind: "planning" },
  ],
  resources: [
    { title: "Editing pages in Squarespace", kind: "Video", length: "6 min", category: "Editing basics", updated: "Apr 14", new: false },
    { title: "How to swap your class schedule PDF", kind: "Guide", length: "3 min read", category: "Editing basics", updated: "Apr 18", new: true },
    { title: "Adding a new sponsor logo", kind: "Guide", length: "4 min read", category: "Editing basics", updated: "Mar 22", new: false },
    { title: "Image sizing cheat sheet", kind: "Reference", length: "1 page", category: "Editing basics", updated: "Feb 10", new: false },

    { title: "Emergency contacts & escalation", kind: "PDF", length: "1 page", category: "Your site", updated: "Jan 05", new: false },
    { title: "Brand colors, fonts & logos", kind: "Reference", length: "—", category: "Your site", updated: "Apr 01", new: false },
    { title: "Squarespace admin handoff", kind: "PDF", length: "3 pages", category: "Your site", updated: "Sep 12", new: false },
    { title: "Your monthly health check, explained", kind: "Guide", length: "5 min read", category: "Your site", updated: "Mar 30", new: false },

    { title: "How to file a great request", kind: "Guide", length: "4 min read", category: "Working together", updated: "Feb 01", new: false },
    { title: "Response times & what's included", kind: "Reference", length: "1 page", category: "Working together", updated: "Apr 01", new: false },
    { title: "Overage hours — how they work", kind: "Guide", length: "2 min read", category: "Working together", updated: "Mar 15", new: false },
  ],
  invoices: [
    { id: "INV-0042", date: "Apr 01, 2026", amount: 325, status: "Paid", period: "April 2026" },
    { id: "INV-0038", date: "Mar 01, 2026", amount: 325, status: "Paid", period: "March 2026" },
    { id: "INV-0033", date: "Feb 01, 2026", amount: 325, status: "Paid", period: "February 2026" },
    { id: "INV-0028", date: "Jan 01, 2026", amount: 325, status: "Paid", period: "January 2026" },
    { id: "INV-0022", date: "Dec 01, 2025", amount: 325, status: "Paid", period: "December 2025" },
    { id: "INV-0017", date: "Nov 01, 2025", amount: 325, status: "Paid", period: "November 2025" },
    { id: "INV-0013", date: "Oct 01, 2025", amount: 325, status: "Paid", period: "October 2025" },
    { id: "INV-0009", date: "Sep 01, 2025", amount: 325, status: "Paid", period: "September 2025" },
    { id: "INV-0005", date: "Aug 14, 2025", amount: 325, status: "Paid", period: "Launch month" },
  ],
  messageThreads: [
    {
      id: "t1", subject: "Retreat announcement bar", with: "Alex Reyes",
      updated: "2h ago", unread: true,
      messages: [
        { from: "Alex Reyes", role: "client", when: "Apr 21, 9:45 AM", body: "Hi! Can we push the spring retreat announcement bar live Friday AM? Copy hasn't changed from what we drafted last week." },
        { from: "Alex Reyes", role: "client", when: "Apr 21, 11:02 AM", body: "Also — should this come out of my monthly hours or is it quick enough to be courtesy?" },
      ],
    },
    {
      id: "t2", subject: "iOS header bug", with: "Jordan Kim",
      updated: "Yesterday", unread: false,
      messages: [
        { from: "Jordan Kim", role: "agency", when: "Apr 19, 4:40 PM", body: "Hey Alex — screenshot received, thank you. Looking at the iOS header now. Can you confirm which iOS version the student is on? I've reproduced on 17.4 but want to cover 17.5 too." },
        { from: "You", role: "client", when: "Apr 20, 9:10 AM", body: "Screenshot received — looking at the iOS header now." },
      ],
    },
    {
      id: "t3", subject: "Teacher Training launch 🎉", with: "Mara Castillo",
      updated: "Apr 09", unread: false,
      messages: [
        { from: "Mara Castillo", role: "agency", when: "Apr 08, 5:15 PM", body: "Teacher Training page is live at joymove.co/teacher-training. Nav link added, form goes to studio@ and trainings@. Enjoy the launch!" },
        { from: "Alex Reyes", role: "client", when: "Apr 09, 7:20 AM", body: "Love the new Teacher Training page 🙏 Already had two applications overnight." },
      ],
    },
  ],
  // Kept for sidebar preview
  messages: [
    { from: "Alex Reyes", preview: "Can we push the retreat bar live Friday AM?", when: "2h ago", unread: true },
    { from: "You", preview: "Screenshot received — looking at the iOS header now.", when: "Yesterday", unread: false },
    { from: "Alex Reyes", preview: "Love the new Teacher Training page 🙏", when: "Apr 09", unread: false },
  ],
};

// Admin client roster
window.ADMIN_CLIENTS = [
  { name: "Joy Move", site: "joymove.co", tier: "Growth", used: 2.75, total: 4, openRequests: 2, health: "good", lastTouch: "Today", mrr: 325 },
  { name: "Harbor Lane Dental", site: "harborlanedental.com", tier: "Essentials", used: 1.5, total: 2, openRequests: 1, health: "good", lastTouch: "Yesterday", mrr: 175 },
  { name: "Pinecrest Chamber", site: "pinecrestchamber.org", tier: "Stewardship", used: 4.25, total: 6, openRequests: 3, health: "warn", lastTouch: "2d ago", mrr: 575 },
  { name: "Foglight Coffee Co", site: "foglightcoffee.com", tier: "Growth", used: 3.9, total: 4, openRequests: 0, health: "good", lastTouch: "4d ago", mrr: 325 },
  { name: "Ridgeway Law", site: "ridgewaylaw.com", tier: "Growth", used: 0.5, total: 4, openRequests: 0, health: "good", lastTouch: "Apr 12", mrr: 325 },
  { name: "Otter & Birch Press", site: "otterbirch.press", tier: "Essentials", used: 2.0, total: 2, openRequests: 1, health: "warn", lastTouch: "Apr 09", mrr: 150 },
  { name: "Northbound Arts Co-op", site: "northboundarts.org", tier: "Stewardship", used: 5.5, total: 6, openRequests: 2, health: "good", lastTouch: "Apr 18", mrr: 500 },
  { name: "Maple & Fern Florals", site: "maplefern.co", tier: "Essentials", used: 0.75, total: 2, openRequests: 0, health: "good", lastTouch: "Apr 03", mrr: 175 },
];
