// PortalTable — Client Portal mock data. Pure data on window.
// One client (Northwind Studio) logged into their agency's branded portal
// (Studio Northstar). Scoped: the client only ever sees their own account.

const CP_AGENCY = { name: "Studio Northstar", mark: "SN", accent: "var(--accent)" };
const CP_CLIENT = { name: "Northwind Studio", contact: "Maya Okonkwo", initials: "MO", email: "maya@northwind.co" };

// Studio team members the client works with
const CP_TEAM = {
  alex: { name: "Alex Rivera", initials: "AR", role: "Account lead", color: "#2D6FE0" },
  devin: { name: "Devin Park", initials: "DP", role: "Designer", color: "#0E9888" },
  sam: { name: "Sam Hale", initials: "SH", role: "Copywriter", color: "#B5790B" },
};

const CP_PROJECT_STATUS = {
  in_progress: { label: "In progress", tone: "blue" },
  review: { label: "In review", tone: "amber" },
  done: { label: "Delivered", tone: "green" },
};
const CP_INVOICE_STATUS = {
  paid: { label: "Paid", tone: "green" },
  due: { label: "Due", tone: "amber" },
  overdue: { label: "Overdue", tone: "red" },
  upcoming: { label: "Upcoming", tone: "neutral" },
};
const CP_APPROVAL_STATUS = {
  pending: { label: "Awaiting you", tone: "amber" },
  approved: { label: "Approved", tone: "green" },
  changes: { label: "Changes sent", tone: "blue" },
};

const CP_PROJECTS = [
  {
    id: "pr1", name: "Q3 brand refresh", status: "in_progress", progress: 64,
    due: "Jun 28", lead: "alex", tasksDone: 12, tasksTotal: 19,
    summary: "A full visual refresh — logo system, color, type, and a new homepage.",
    milestones: [
      { label: "Discovery & moodboard", done: true, date: "May 20" },
      { label: "Logo & color system", done: true, date: "Jun 04" },
      { label: "Homepage design", done: false, date: "Jun 28", current: true },
      { label: "Guidelines handoff", done: false, date: "Jul 10" },
    ],
  },
  {
    id: "pr2", name: "Brand guidelines", status: "review", progress: 90,
    due: "Jun 18", lead: "devin", tasksDone: 17, tasksTotal: 19,
    summary: "The living document — usage rules, spacing, voice, and asset library.",
    milestones: [
      { label: "Outline & structure", done: true, date: "May 28" },
      { label: "Visual sections", done: true, date: "Jun 10" },
      { label: "Final review", done: false, date: "Jun 18", current: true },
    ],
  },
  {
    id: "pr3", name: "Social launch kit", status: "done", progress: 100,
    due: "Jun 05", lead: "devin", tasksDone: 15, tasksTotal: 15,
    summary: "Templates and a 12-post launch set for the new brand reveal.",
    milestones: [
      { label: "Template system", done: true, date: "May 22" },
      { label: "Launch set (12)", done: true, date: "Jun 02" },
      { label: "Delivered", done: true, date: "Jun 05" },
    ],
  },
];

const CP_APPROVALS = [
  { id: "ap1", title: "Homepage hero — final copy", project: "Q3 brand refresh", type: "Copy", by: "sam", submitted: "Jun 14", status: "pending",
    note: "Two headline options for the hero. We're leaning option A — let us know which reads truer to the new voice." },
  { id: "ap2", title: "Logo lockup — 3 variations", project: "Q3 brand refresh", type: "Design", by: "devin", submitted: "Jun 13", status: "pending",
    note: "Primary, stacked, and a compact mark for favicons. Approve the set to move into guidelines." },
  { id: "ap3", title: "June social set", project: "Social launch kit", type: "Asset", by: "devin", submitted: "Jun 04", status: "approved",
    note: "12-post launch set, approved and scheduled." },
  { id: "ap4", title: "Brand color direction", project: "Q3 brand refresh", type: "Design", by: "devin", submitted: "Jun 02", status: "changes",
    note: "You asked to warm up the neutrals — updated palette is in the next round." },
];

const CP_INVOICES = [
  { id: "INV-2052", desc: "Q3 brand refresh — milestone 2", amount: 3200, issued: "Jun 05", due: "Jun 20", status: "due" },
  { id: "INV-2041", desc: "Brand guidelines — deposit", amount: 4350, issued: "May 01", due: "May 15", status: "paid" },
  { id: "INV-2033", desc: "Social launch kit", amount: 1800, issued: "Apr 12", due: "Apr 26", status: "paid" },
  { id: "INV-2060", desc: "Q3 brand refresh — final milestone", amount: 3200, issued: "—", due: "Jul 10", status: "upcoming" },
];

const CP_FILES = [
  { id: "f1", name: "Brand refresh — concept deck", kind: "pdf", size: "8.4 MB", date: "Jun 13", project: "Q3 brand refresh" },
  { id: "f2", name: "Logo pack (SVG + PNG)", kind: "zip", size: "2.1 MB", date: "Jun 13", project: "Q3 brand refresh" },
  { id: "f3", name: "Homepage hero — option A", kind: "image", size: "1.3 MB", date: "Jun 14", project: "Q3 brand refresh" },
  { id: "f4", name: "Homepage hero — option B", kind: "image", size: "1.2 MB", date: "Jun 14", project: "Q3 brand refresh" },
  { id: "f5", name: "Social launch kit — final", kind: "zip", size: "14.8 MB", date: "Jun 05", project: "Social launch kit" },
  { id: "f6", name: "Statement of work", kind: "pdf", size: "320 KB", date: "Apr 30", project: "—" },
];

const CP_MESSAGES = [
  { id: "m1", from: "alex", text: "Hi Maya — homepage hero copy is up for review. Two directions inside, curious which lands for you.", time: "Jun 14 · 9:24am" },
  { id: "m2", from: "me", text: "Looking now. Option A feels closer to where we want the voice to go.", time: "Jun 14 · 10:02am" },
  { id: "m3", from: "alex", text: "Agreed. Approve it when you're ready and we'll lock the homepage layout this week.", time: "Jun 14 · 10:09am" },
];

const CP_ACTIVITY = [
  { id: "act1", icon: "checklist", tone: "amber", who: "Sam Hale", what: "sent for your approval", target: "Homepage hero — final copy", time: "Jun 14" },
  { id: "act2", icon: "image", tone: "blue", who: "Devin Park", what: "uploaded 2 files to", target: "Q3 brand refresh", time: "Jun 14" },
  { id: "act3", icon: "message", tone: "teal", who: "Alex Rivera", what: "messaged you about", target: "homepage copy", time: "Jun 14" },
  { id: "act4", icon: "card", tone: "amber", who: "Studio Northstar", what: "issued", target: "INV-2052 · $3,200", time: "Jun 05" },
  { id: "act5", icon: "check", tone: "green", who: "You", what: "approved", target: "June social set", time: "Jun 04" },
];

Object.assign(window, {
  CP_AGENCY, CP_CLIENT, CP_TEAM, CP_PROJECTS, CP_APPROVALS, CP_INVOICES, CP_FILES, CP_MESSAGES, CP_ACTIVITY,
  CP_PROJECT_STATUS, CP_INVOICE_STATUS, CP_APPROVAL_STATUS,
});
